Download data/lean/OAI/Probability/MatroidSecretary/Pivots/MarkedPivotSpecification.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.09 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Pivots/MarkedPivotSpecification.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MatroidSecretary/Pivots/MarkedPivotSpecification.lean
-
curl -L -o MarkedPivotSpecification.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidSecretary/Pivots/MarkedPivotSpecification.lean
3.09 kB
| import Mathlib.Combinatorics.Matroid.Closure | |
| import Mathlib.Data.Finset.Powerset | |
| import Mathlib.Data.Nat.Choose.Basic | |
| import Mathlib.Order.Interval.Finset.Nat | |
| namespace OAI | |
| namespace MatroidProphet.MarkedPivots | |
| open scoped BigOperators | |
| abbrev Occurrences (r q : β) := Fin r β Fin q | |
| def label {Ξ± : Type*} {r q : β} (old : Fin r β Ξ±) (movable : Fin q β Ξ±) : | |
| Occurrences r q β Ξ± := Sum.elim old movable | |
| def mark {r q : β} (oldMark : Fin r β Bool) (movableMark : Fin q β Bool) : | |
| Occurrences r q β Bool := Sum.elim oldMark movableMark | |
| def OldOrdered {r q : β} (time : Occurrences r q β β) : Prop := | |
| β i j : Fin r, i < j β time (Sum.inl i) < time (Sum.inl j) | |
| /-- The label is first spanned at this occurrence, and not before it. -/ | |
| def FirstSpans {Ξ± : Type*} {r q : β} (M : Matroid Ξ±) | |
| (labels : Occurrences r q β Ξ±) (time : Occurrences r q β β) | |
| (e : Ξ±) (o : Occurrences r q) : Prop := | |
| e β M.closure (labels '' {p | time p β€ time o}) β§ | |
| e β M.closure (labels '' {p | time p < time o}) | |
| /-- The finite set encodes precisely those test coordinates whose pivot has mark one. -/ | |
| def Records {Ξ± : Type*} {r q n : β} (M : Matroid Ξ±) | |
| (old : Fin r β Ξ±) (movable : Fin q β Ξ±) (test : Fin n β Ξ±) | |
| (time : Occurrences r q β β) (oldMark : Fin r β Bool) | |
| (movableMark : Fin q β Bool) (pattern : Finset (Fin n)) : Prop := | |
| β f, β o, FirstSpans M (label old movable) time (test f) o β§ | |
| (mark oldMark movableMark o = true β f β pattern) | |
| /-- All actual pivot-mark vectors over all interleavings and all movable marks. -/ | |
| noncomputable def patterns {Ξ± : Type*} {r q n : β} (M : Matroid Ξ±) | |
| (old : Fin r β Ξ±) (movable : Fin q β Ξ±) (test : Fin n β Ξ±) | |
| (oldMark : Fin r β Bool) : Finset (Finset (Fin n)) := by | |
| classical | |
| exact Finset.univ.filter fun pattern => | |
| β time : Occurrences r q β β, OldOrdered time β§ Function.Injective time β§ | |
| β movableMark : Fin q β Bool, Records M old movable test time oldMark movableMark pattern | |
| /-- Full named source obligation, including well-definedness for every interleaving. | |
| The test function is injective because the manuscript tests a set of `n` nonloops. | |
| The conclusion actually remains true without that injectivity assumption. -/ | |
| def SourceContract.{u} : Prop := | |
| β {Ξ± : Type u} [Fintype Ξ±] (M : Matroid Ξ±) (r q n s : β) | |
| (old : Fin r β Ξ±) (movable : Fin q β Ξ±) (test : Fin n β Ξ±) | |
| (oldMark : Fin r β Bool), | |
| q β€ s β (β i, old i β M.E) β (β i, movable i β M.E) β | |
| M.closure (Set.range old) = M.E β Function.Injective test β | |
| (β f, test f β M.E β§ test f β M.closure β ) β | |
| (patterns M old movable test oldMark).card β€ | |
| 4 ^ s * β k β Finset.Iic s, n.choose k β§ | |
| β (time : Occurrences r q β β), OldOrdered time β Function.Injective time β | |
| β movableMark : Fin q β Bool, | |
| β! pattern, Records M old movable test time oldMark movableMark pattern | |
| end MatroidProphet.MarkedPivots | |
| end OAI | |