Download data/lean/OAI/Probability/MatroidSecretary/Secretary/ReplayFacts.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.37 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Secretary/ReplayFacts.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MatroidSecretary/Secretary/ReplayFacts.lean
-
curl -L -o ReplayFacts.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Secretary/ReplayFacts.lean
5.37 kB
Lean 4 Β· 10
declarations statementsfull
| import OAI.Probability.MatroidProphet.Main | |
| import Mathlib.MeasureTheory.Integral.Bochner.Basic | |
| namespace OAI | |
| /-! | |
| # Deterministic replay for the secretary transport | |
| This optional supplement uses a distinct namespace so it can coexist with the | |
| canonical `SecretaryReplay` implementation without duplicate declaration names. | |
| These lemmas concern the replay step in the proof of `cor:secretary` in the | |
| pinned `sections/secretary.tex`. They do not assert or assume the random-prefix | |
| law. The latter is a separate probability obligation. A reconstructed seed may | |
| be any function of the secretary seed and observed prefix: all the results | |
| below hold pointwise for every seed and every completed arrival permutation. | |
| -/ | |
| namespace MatroidProphet.SecretaryReplaySupplement | |
| open MeasureTheory | |
| /-- Agreement on the sacrificed labels is the exact information needed to replay | |
| an actual fixed vector. Values supplied outside that mask are irrelevant. -/ | |
| lemma glue_eq_of_agree {n : β} (mask : Finset (Fin n)) (s w : Weights n) | |
| (hs : β e β mask, s e = w e) : glue mask s w = w := by | |
| classical | |
| funext e | |
| by_cases he : e β mask | |
| Β· simp [glue, he, hs e he] | |
| Β· simp [glue, he] | |
| lemma observed_agrees {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (w : Weights n) : β e β A.mask r, observed A r w e = w e := by | |
| classical | |
| intro e he | |
| simp [observed, he] | |
| /-- The actual current and past label--weight pairs, including rejected prefix | |
| arrivals, are passed to the source core unchanged. -/ | |
| lemma history_replay {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (s w : Weights n) (hs : β e β A.mask r, s e = w e) | |
| (Ο : ArrivalOrder n) (k : Fin n) : | |
| simulationHistory A r s (history w Ο k) = history w Ο k := by | |
| rw [simulationHistory_eq, glue_eq_of_agree _ _ _ hs] | |
| /-- Exact accepted-set identity at every time, not just equality of total reward. -/ | |
| theorem acceptedThrough_replay {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (s w : Weights n) (hs : β e β A.mask r, s e = w e) | |
| (Ο : ArrivalOrder n) (t : β) : | |
| acceptedThrough (sampleSimulation A) r s w Ο t = | |
| hiddenAcceptedThrough A r w Ο t := by | |
| rw [sampleSimulation_acceptedThrough, glue_eq_of_agree _ _ _ hs] | |
| /-- Replay never replaces a realized payoff by a sampled or auxiliary value. -/ | |
| theorem reward_replay {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (s w : Weights n) (hs : β e β A.mask r, s e = w e) | |
| (Ο : ArrivalOrder n) : | |
| reward (sampleSimulation A) r s w Ο = hiddenReward A r w Ο := by | |
| rw [sampleSimulation_reward, glue_eq_of_agree _ _ _ hs] | |
| /-- Only the revealed vector is needed for the initial observation. -/ | |
| theorem observed_replay {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (w : Weights n) (Ο : ArrivalOrder n) (t : β) : | |
| acceptedThrough (sampleSimulation A) r (observed A r w) w Ο t = | |
| hiddenAcceptedThrough A r w Ο t := | |
| acceptedThrough_replay A r _ w (observed_agrees A r w) Ο t | |
| /-- If the mask is exactly the observed prefix set, no prefix label is accepted. | |
| The bound includes both zero-length and full-length prefixes. -/ | |
| theorem prefix_rejected {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (s w : Weights n) (Ο : ArrivalOrder n) (K : β) | |
| (hmask : β e, e β A.mask r β (Ο.symm e).val < K) : | |
| acceptedThrough (sampleSimulation A) r s w Ο K = β := by | |
| classical | |
| rw [sampleSimulation_acceptedThrough] | |
| apply Finset.eq_empty_iff_forall_notMem.mpr | |
| intro e he | |
| obtain β¨he, hnotβ© := Finset.mem_sdiff.mp he | |
| exact hnot ((hmask e).mpr (acceptedThrough_arrived _ _ _ _ _ _ _ he)) | |
| /-- The prefix is still excluded at all later times. -/ | |
| theorem accepted_after_prefix {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (s w : Weights n) (Ο : ArrivalOrder n) (K t : β) | |
| (hmask : β e, e β A.mask r β (Ο.symm e).val < K) | |
| {e : Fin n} (he : e β acceptedThrough (sampleSimulation A) r s w Ο t) : | |
| K β€ (Ο.symm e).val := by | |
| classical | |
| rw [sampleSimulation_acceptedThrough] at he | |
| exact Nat.le_of_not_gt (fun h => (Finset.mem_sdiff.mp he).2 ((hmask e).mpr h)) | |
| /-- An arbitrary suffix order, even one knowing all unused seed coordinates, | |
| cannot defeat the pointwise minimum over completed permutations. -/ | |
| theorem worstReward_le_replay {n bits : β} (A : HiddenRule n bits) (r : Seed bits) | |
| (s w : Weights n) (hs : β e β A.mask r, s e = w e) | |
| (Ο : ArrivalOrder n) : | |
| hiddenWorstReward A w r β€ reward (sampleSimulation A) r s w Ο := by | |
| rw [reward_replay A r s w hs Ο] | |
| exact hiddenWorstReward_le A w r Ο | |
| /-- Every-prefix matroid feasibility transfers without a condition on the | |
| suffix adversary or on weights assigned outside the observation mask. -/ | |
| theorem feasible_replay {n bits : β} (M : Matroid (Fin n)) (A : HiddenRule n bits) | |
| (hA : β (w : Weights n), (β e, 0 β€ w e) β | |
| β (r : Seed bits) (Ο : ArrivalOrder n) (t : β), | |
| M.Indep (hiddenAcceptedThrough A r w Ο t : Set (Fin n))) | |
| (r : Seed bits) (s w : Weights n) (hw : β e, 0 β€ w e) | |
| (hs : β e β A.mask r, s e = w e) (Ο : ArrivalOrder n) (t : β) : | |
| M.Indep (acceptedThrough (sampleSimulation A) r s w Ο t : Set (Fin n)) := by | |
| rw [acceptedThrough_replay A r s w hs Ο t] | |
| exact hA w hw r Ο t | |
| end MatroidProphet.SecretaryReplaySupplement | |
| end OAI | |
Outline