Download data/lean/OAI/Probability/MatroidSecretary/Transport/TransferContracts.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.73 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Transport/TransferContracts.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MatroidSecretary/Transport/TransferContracts.lean
-
curl -L -o TransferContracts.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Transport/TransferContracts.lean
4.73 kB
| import OAI.Probability.MatroidProphet.Main | |
| namespace OAI | |
| namespace MatroidProphet | |
| namespace TransferContracts | |
| open Finset Set Pivots MainAlgorithm | |
| section Pivots | |
| variable {Ξ± : Type*} {r q n : β} | |
| /-- An injectively timed sequence determines one recorded pivot-mark vector. -/ | |
| lemma recordsPivots_unique (M : Matroid Ξ±) (label : Occurrence r q β Ξ±) | |
| (test : Fin n β Ξ±) (time : Occurrence r q β β) | |
| (htime : Function.Injective time) (oldMark : Fin r β Bool) | |
| (movableMark : Fin q β Bool) {t u : Finset (Fin n)} | |
| (ht : RecordsPivots M label test time oldMark movableMark t) | |
| (hu : RecordsPivots M label test time oldMark movableMark u) : t = u := by | |
| ext f | |
| obtain β¨o, ho, htoβ© := ht f | |
| obtain β¨p, hp, hupβ© := hu f | |
| have hop := pivot_unique M label time htime ho hp | |
| subst p | |
| exact hto.symm.trans hup | |
| variable [Fintype Ξ±] | |
| /-- Complete marked-pivot contract: arbitrary repeated/redundant old labels, | |
| all placements/orders/marks of at most `s` movable occurrences, and the exact | |
| binomial bound. Source old-spanning/nonloop assumptions ensure every permitted | |
| interleaving actually contributes exactly one vector. No positivity assumption | |
| on `s`, `q`, `r`, or `n` is imposed. -/ | |
| theorem marked_pivot_contract (M : Matroid Ξ±) (b : β β Ξ±) (a : Fin q β Ξ±) | |
| (test : Fin n β Ξ±) (oldMark : Fin r β Bool) (s : β) (hqs : q β€ s) | |
| (hground : β o : Occurrence r q, occurrenceLabel b a o β M.E) | |
| (holdspan : M.closure (oldPrefix b r) = M.E) | |
| (htest : β f, test f β M.E β§ test f β M.closure β ) : | |
| (markedPivotPatterns M b a test oldMark).card β€ | |
| 4 ^ s * β k β Finset.Iic s, n.choose k β§ | |
| β (time : Occurrence r q β β), OldOrdered time β Function.Injective time β | |
| β movableMark : Fin q β Bool, | |
| β! t, t β markedPivotPatterns M b a test oldMark β§ | |
| RecordsPivots M (occurrenceLabel b a) test time oldMark movableMark t := by | |
| refine β¨card_markedPivotPatterns_le M b a test oldMark s hqs hground, ?_β© | |
| intro time horder htime movableMark | |
| obtain β¨t, htmem, htβ© := recorded_pattern_exists_of_old_spanning M b a test oldMark | |
| holdspan htest time horder htime movableMark | |
| refine β¨t, β¨htmem, htβ©, ?_β© | |
| intro u hu | |
| exact recordsPivots_unique M (occurrenceLabel b a) test time htime oldMark movableMark hu.2 ht | |
| end Pivots | |
| section Transfer | |
| variable {n : β} | |
| /-- The independent comparison group is constructed by priority greedy and | |
| fair-mask deletion, exactly as in the manuscript (`Y_i = (I* \ H) β© U_i`). -/ | |
| lemma comparison_group_indep_subset (M : Matroid (Fin n)) (hE : M.E = Set.univ) | |
| (d : MainMasks n) (a : Fin n β Option β€) (i : β€) : | |
| let Y := (positiveGreedy M a \ d.H).filter (fun e => a e = some i) | |
| M.Indep (Y : Set (Fin n)) β§ (Y : Set (Fin n)) β (trueGroup M d a i : Set (Fin n)) := by | |
| classical | |
| dsimp only | |
| constructor | |
| Β· exact (positiveGreedy_survivors_indep M hE a d.H).subset (Finset.filter_subset _ _) | |
| Β· intro e he | |
| obtain β¨heY, heiβ© := Finset.mem_filter.mp he | |
| apply (mem_trueGroup M d a i e).mpr | |
| refine β¨?_, heiβ© | |
| exact (Finset.mem_filter.mp (positiveGreedy_survivors_subset M a d.H heY)).2 | |
| /-- Full sample-to-rank inequality for the actual rounded weight vector. | |
| `withMasks` averages all density, guard and test bits while fixing `H`; | |
| `fairParityExpectation` averages parity. `listedRankStatistic` is explicitly | |
| zero on the unlisted branch. Thus there is no conditioning on listing and no | |
| independence assumption about the selected residual. -/ | |
| theorem sample_to_rank_contract (M : Matroid (Fin n)) (hE : M.E = Set.univ) | |
| (w : Weights n) (d : MainMasks n) (i : β€) | |
| (hn : densityThreshold β€ | |
| ((trueGroup M d (fun e => roundedLevel weightBase (w e)) i).card : β)) : | |
| let a := fun e => roundedLevel weightBase (w e) | |
| let Y := (positiveGreedy M a \ d.H).filter (fun e => a e = some i) | |
| (retainedFraction * (Y.card : β) - ((2 : β) ^ 23)β»ΒΉ * | |
| (trueGroup M d a i).card) / densityThreshold β€ | |
| tripleMaskExpectation (fun _ => (1 : β) / 4) | |
| (fun _ => thinningRate) (fun _ => thinningRate) Finset.univ | |
| (fun D C T => fairParityExpectation (fun p => | |
| (listedRankStatistic M hE (2 ^ 100) (withMasks d D C T) a i | |
| (boolParity p) : β))) := by | |
| classical | |
| let a := fun e => roundedLevel weightBase (w e) | |
| let Y := (positiveGreedy M a \ d.H).filter (fun e => a e = some i) | |
| have hY := comparison_group_indep_subset M hE d a i | |
| have h := listedRankStatistic_lower M hE d a i (Y : Set (Fin n)) hY.2 hY.1 hn | |
| simpa only [Set.ncard_coe_finset] using h | |
| end Transfer | |
| end TransferContracts | |
| end MatroidProphet | |
| end OAI | |