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
25Agreement 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 proof Β· 5 lines
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 proof Β· 3 lines
classical intro e he simp [observed, he]
41The 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 proof Β· 1 line
rw [simulationHistory_eq, glue_eq_of_agree _ _ _ hs]
48Exact 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 proof Β· 1 line
rw [sampleSimulation_acceptedThrough, glue_eq_of_agree _ _ _ hs]
56Replay 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 proof Β· 1 line
rw [sampleSimulation_reward, glue_eq_of_agree _ _ _ hs]
63Only 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 := proof Β· 1 line
acceptedThrough_replay A r _ w (observed_agrees A r w) Ο t71If 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 proof Β· 6 lines
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))83The 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 proof Β· 3 lines
classical
rw [sampleSimulation_acceptedThrough] at he
exact Nat.le_of_not_gt (fun h => (Finset.mem_sdiff.mp he).2 ((hmask e).mpr h))94An 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 proof Β· 2 lines
rw [reward_replay A r s w hs Ο]
exact hiddenWorstReward_le A w r Ο103Every-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 proof Β· 2 lines
rw [acceptedThrough_replay A r s w hs Ο t]
exact hA w hw r Ο tOutline