Download data/lean/OAI/Combinatorics/GraphThreshold/ProbabilityTree.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.88 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/ProbabilityTree.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GraphThreshold/ProbabilityTree.lean
-
curl -L -o ProbabilityTree.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/ProbabilityTree.lean
3.88 kB
| import OAI.Combinatorics.GraphThreshold.Basic | |
| import Mathlib.Data.List.Pairwise | |
| import Mathlib.Data.Fintype.Sigma | |
| namespace OAI | |
| noncomputable section | |
| namespace LeanBlast.SecondKahnKalai | |
| /-- Equal-depth trees carrying an actual strictly positive child law at every branch. -/ | |
| inductive ProbabilityTree (X : Type) : β β Type 1 | |
| | leaf : ProbabilityTree X 0 | |
| | node {d : β} (B : Type) [Fintype B] (law : FiniteLaw B) | |
| (positive : law.IsPositive) (label : B β Finset X) | |
| (child : B β ProbabilityTree X d) : ProbabilityTree X (d + 1) | |
| /-- A function inspects only the indicated coordinates of its input subset. -/ | |
| def DependsOnlyOn {X Ξ² : Type*} [DecidableEq X] (S : Finset X) | |
| (f : Finset X β Ξ²) : Prop := | |
| β W V, W β© S = V β© S β f W = f V | |
| /-- A function is unchanged by modifications inside the indicated coordinates. -/ | |
| def DependsOutside {X Ξ² : Type*} [DecidableEq X] (A : Finset X) | |
| (f : Finset X β Ξ²) : Prop := | |
| β W V, W \ A = V \ A β f W = f V | |
| namespace ProbabilityTree | |
| variable {X : Type} | |
| /-- Full root-to-leaf paths, retaining distinct child-index histories. -/ | |
| def Path : {d : β} β ProbabilityTree X d β Type | |
| | _, .leaf => PUnit | |
| | _, @node _ _ B _ _ _ _ child => Ξ£ b : B, Path (child b) | |
| /-- The list of arc labels along a full path, in root-to-leaf order. -/ | |
| def pathLabels : {d : β} β (T : ProbabilityTree X d) β T.Path β List (Finset X) | |
| | _, .leaf => fun _ => [] | |
| | _, @node _ _ _B _ _ _ label child => fun p => | |
| label p.1 :: pathLabels (child p.1) p.2 | |
| /-- Every path family is finite; no quotient by labels is taken. -/ | |
| instance pathFintype : {d : β} β (T : ProbabilityTree X d) β Fintype T.Path | |
| | _, .leaf => inferInstanceAs (Fintype PUnit) | |
| | _, @node _ _ B _ _ _ _ child => by | |
| letI : β b : B, Fintype (Path (child b)) := fun b => pathFintype (child b) | |
| exact inferInstanceAs (Fintype (Ξ£ b : B, Path (child b))) | |
| section Labels | |
| variable [DecidableEq X] | |
| /-- Union of all arc labels along a specified full path. -/ | |
| def pathUnion : {d : β} β (T : ProbabilityTree X d) β T.Path β Finset X | |
| | _, .leaf => fun _ => β | |
| | _, @node _ _ _B _ _ _ label child => fun p => | |
| label p.1 βͺ pathUnion (child p.1) p.2 | |
| /-- All coordinates used by any arc anywhere in the tree. -/ | |
| def support : {d : β} β ProbabilityTree X d β Finset X | |
| | _, .leaf => β | |
| | _, @node _ _ B inst _ _ label child => | |
| (@Finset.univ B inst).biUnion fun b => label b βͺ support (child b) | |
| /-- A recursive form of disjointness, equivalent to pairwise disjoint labels on every full path. -/ | |
| def IsDisjoint : {d : β} β ProbabilityTree X d β Prop | |
| | _, .leaf => True | |
| | _, @node _ _ _ _ _ _ label child => | |
| (β b, Disjoint (label b) (support (child b))) β§ β b, IsDisjoint (child b) | |
| /-- Literal pairwise disjointness along every full root-to-leaf path. -/ | |
| def PathDisjoint {d : β} (T : ProbabilityTree X d) : Prop := | |
| β p : T.Path, (T.pathLabels p).Pairwise Disjoint | |
| /-- Per-level spread conditions, starting with index zero at the root. -/ | |
| def HasSpread : {d : β} β ProbabilityTree X d β (β β β) β Prop | |
| | _, .leaf, _ => True | |
| | _, @node _ _ _ _ law _ label child, a => | |
| IsSpread law label (a 0) β§ β b, HasSpread (child b) (fun j => a (j + 1)) | |
| /-- The event that some full path is covered by a given set. -/ | |
| def CoveredBy {d : β} (T : ProbabilityTree X d) (W : Finset X) : Prop := | |
| β p : T.Path, T.pathUnion p β W | |
| end Labels | |
| /-- Per-level cardinality capacities, starting with index zero at the root. -/ | |
| def HasCapacities : {d : β} β ProbabilityTree X d β (β β β) β Prop | |
| | _, .leaf, _ => True | |
| | _, @node _ _ _ _ _ _ label child, m => | |
| (β b, (label b).card β€ m 0) β§ β b, HasCapacities (child b) (fun j => m (j + 1)) | |
| end ProbabilityTree | |
| end LeanBlast.SecondKahnKalai | |
| end | |
| end OAI | |