Download data/lean/OAI/Combinatorics/ExpectationThreshold/SelectorDefinitions.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.35 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ExpectationThreshold/SelectorDefinitions.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/ExpectationThreshold/SelectorDefinitions.lean
-
curl -L -o SelectorDefinitions.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ExpectationThreshold/SelectorDefinitions.lean
4.35 kB
| import OAI.Combinatorics.ExpectationThreshold.Basic | |
| import OAI.Combinatorics.ExpectationThreshold.ProbabilityColors | |
| import OAI.Combinatorics.ExpectationThreshold.SelectorTruncationDefinitions | |
| import Mathlib.Data.Fintype.Pi | |
| import Mathlib.Data.Finset.Lattice.Fold | |
| namespace OAI | |
| /-! | |
| # Actual moves and profiles for the simultaneous selector | |
| We retain all colorings of minimum total movement for at least one original | |
| family member. This avoids an arbitrary tie-breaking order; each retained | |
| coloring still has the member-specific minimality used in reconstruction. | |
| -/ | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace TalagrandThreshold.Selector | |
| variable {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] | |
| /-- A probability mass for each actual member of the family. -/ | |
| structure MassFamily (F : Family Ξ±) where | |
| weight : β₯F β Ξ± β β | |
| nonneg : β H x, 0 β€ weight H x | |
| total : β H, β x, weight H x = 1 | |
| supported : β H x, x β H.val β weight H x = 0 | |
| /-- Colors have zero-based indices; the actual color level is one larger. -/ | |
| def prefixSet {s : β} (z : Coloring Ξ± s) (i : Fin s) : Finset Ξ± := | |
| Finset.univ.filter fun x => (z x).val β€ i.val | |
| def dscale {s : β} (i : Fin s) : β := ((2 : β) ^ (i.val + 1))β»ΒΉ | |
| /-- `Earlier a z` means that the move from `a` to `z` only lowers colors. -/ | |
| def Earlier {s : β} (a z : Coloring Ξ± s) : Prop := β x, z x β€ a x | |
| def changes {s : β} (a z : Coloring Ξ± s) : Finset Ξ± := | |
| Finset.univ.filter fun x => z x < a x | |
| def crossings {s : β} (a z : Coloring Ξ± s) (i : Fin s) : β := | |
| (prefixSet z i \ prefixSet a i).card | |
| def movement {s : β} (a z : Coloring Ξ± s) : β := | |
| β x, ((a x).val - (z x).val) | |
| def movedRow {s : β} (a z : Coloring Ξ± s) (i : Fin s) : Finset Ξ± := | |
| Finset.univ.filter fun x => (z x).val = i.val β§ (z x).val < (a x).val | |
| /-- The full profile retains both final and original colors. -/ | |
| abbrev Profile (s : β) := Fin s β Color s β β | |
| def profile {s : β} (a z : Coloring Ξ± s) : Profile s := | |
| fun i h => (Finset.univ.filter fun x => | |
| (z x).val = i.val β§ a x = h β§ i.val < h.val).card | |
| def rowCount {s : β} (n : Profile s) (i : Fin s) : β := β h, n i h | |
| def profileSize {s : β} (n : Profile s) : β := β i, rowCount n i | |
| def profileCrossings {s : β} (n : Profile s) (i : Fin s) : β := | |
| β j : Fin s, β h : Color s, | |
| if j.val β€ i.val β§ i.val < h.val then n j h else 0 | |
| def FeasibleFor {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a z : Coloring Ξ± s) (H : β₯F) : Prop := | |
| β i : Fin s, β Ξ΅ : β, | |
| Admissible (mu.weight H) (prefixSet z i) (crossings a z i : β) (dscale i) Ξ΅ | |
| def Feasible {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a z : Coloring Ξ± s) : Prop := | |
| Earlier a z β§ β H : β₯F, FeasibleFor mu a z H | |
| def BoundedFeasible {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a : Coloring Ξ± s) (Hβ : β₯F) (z : Coloring Ξ± s) : Prop := | |
| Feasible mu a z β§ changes a z β Hβ.val | |
| def IsMinimalMove {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a : Coloring Ξ± s) (Hβ : β₯F) (z : Coloring Ξ± s) : Prop := | |
| BoundedFeasible mu a Hβ z β§ | |
| β w, BoundedFeasible mu a Hβ w β movement a z β€ movement a w | |
| def Selected {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a z : Coloring Ξ± s) : Prop := β Hβ : β₯F, IsMinimalMove mu a Hβ z | |
| def selectedMoves {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a : Coloring Ξ± s) : Finset (Coloring Ξ± s) := by | |
| classical | |
| exact Finset.univ.filter (Selected mu a) | |
| /-- An actual bad original coloring, its selected endpoint, and its full profile. -/ | |
| def Captured {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a : Coloring Ξ± s) : Prop := | |
| β H : β₯F, β i : Fin s, | |
| 1 - dscale i β€ β x β prefixSet a i, mu.weight H x | |
| def Bad {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (a : Coloring Ξ± s) : Prop := Β¬ Captured mu a | |
| def groupOriginals {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (z : Coloring Ξ± s) (n : Profile s) : Finset (Coloring Ξ± s) := by | |
| classical | |
| exact Finset.univ.filter fun a => Bad mu a β§ Selected mu a z β§ profile a z = n | |
| def meanColor {F : Family Ξ±} (mu : MassFamily F) {s : β} | |
| (H : β₯F) (a : Coloring Ξ± s) : β := | |
| β x, ((a x).val + 1 : β) * mu.weight H x | |
| end TalagrandThreshold.Selector | |
| end | |
| end OAI | |