OAI/Probability/CubeShuffle/Basic.lean
81 declarations, 0 contain sorry, 0 declared as axioms
The physical Thorp chain on every binary position. A tape enumerates independent fair pair coins; its push-forward is the full permutation distribution.
- abbrev
OAI.CubeShuffle.Cardline 15Also declared: ComparatorChallenges/WeightedSweepMoments.lean:165 (same declaration text).
- def
OAI.CubeShuffle.Coinsline 19Source documentation
One coin for each pair, indexed by the unchanged tail of a binary position. The one-card case is the deterministic extension of the physical definition.
Also declared: ComparatorChallenges/WeightedSweepMoments.lean:167 (same declaration text).
def Coins : ℕ → Type | 0 => Unit | d + 1 => Card d → Bool
Mentions: OAI.CubeShuffle.Card
- instance
OAI.CubeShuffle.(instance at line 23)line 23 - instance
OAI.CubeShuffle.(instance at line 26)line 26 - def
OAI.CubeShuffle.switchFunline 30Source documentation
Switch the first-coordinate pairs, without rotating.
Also declared: ComparatorChallenges/WeightedSweepMoments.lean:177 (same declaration text).
def switchFun {d : ℕ} (ξ : Card d → Bool) (x : Card (d + 1)) : Card (d + 1) := …Mentions: OAI.CubeShuffle.Card
- theorem
OAI.CubeShuffle.switchFun_involutiveline 33Also declared: ComparatorChallenges/WeightedSweepMoments.lean:180 (same declaration text).
- def
OAI.CubeShuffle.pairSwitchline 42Also declared: ComparatorChallenges/WeightedSweepMoments.lean:189 (same declaration text).
- def
OAI.CubeShuffle.rotateline 49Source documentation
(x₁,…,x_d) ↦ (x₂,…,x_d,x₁).Also declared: ComparatorChallenges/WeightedSweepMoments.lean:195 (same declaration text).
def rotate (d : ℕ) : Equiv.Perm (Card d) where …
Mentions: OAI.CubeShuffle.Card
- def
OAI.CubeShuffle.stepline 56Source documentation
One physical shuffle: rotate after independently switching each pair.
Also declared: ComparatorChallenges/WeightedSweepMoments.lean:201 (same declaration text).
def step : (d : ℕ) → Coins d → Equiv.Perm (Card d) | 0, _ => 1 | d + 1, ξ => rotate (d + 1) * pairSwitch ξ /-- The time-t permutation, with the latest physical shuffle multiplying on the left. -/
Mentions: OAI.CubeShuffle.Coins, OAI.CubeShuffle.Card, OAI.CubeShuffle.rotate, OAI.CubeShuffle.pairSwitch
- def
OAI.CubeShuffle.runline 61Source documentation
The time-t permutation, with the latest physical shuffle multiplying on the left.
Also declared: ComparatorChallenges/WeightedSweepMoments.lean:205 (same declaration text).
def run (d : ℕ) : (t : ℕ) → (Fin t → Coins d) → Equiv.Perm (Card d) | 0, _ => 1 | t + 1, ω => step d (ω (Fin.last t)) * run d t (fun i => ω i.castSucc) /-- The push-forward of the uniform law on all independent fair coin tapes. -/
Mentions: OAI.CubeShuffle.Coins, OAI.CubeShuffle.Card, OAI.CubeShuffle.step, OAI.CubeShuffle.law
- def
OAI.CubeShuffle.lawline 66Source documentation
The push-forward of the uniform law on all independent fair coin tapes.
noncomputable def law (d t : ℕ) (g : Equiv.Perm (Card d)) : ℝ := …
Mentions: OAI.CubeShuffle.Card
- def
OAI.CubeShuffle.distanceline 71Source documentation
Full-permutation total variation, with the source's factor one half.
noncomputable def distance (d t : ℕ) : ℝ := …
- def
OAI.CubeShuffle.mixingTimeline 77Source documentation
First physical time with TV at most 1/4. The main conclusion proves this set nonempty for every sufficiently large d.
noncomputable def mixingTime (d : ℕ) : ℕ := …
- def
OAI.CubeShuffle.supportTimeBoundline 81Source documentation
The exact integer lower bound, using log base two.
noncomputable def supportTimeBound (d : ℕ) : ℤ := …
- def
OAI.CubeShuffle.OptimalOrderline 87Source documentation
Every clause of the literal optimal-order endpoint. The single absolute C is in PHYSICAL time; convergence is to zero, not merely below a fixed cutoff.
def OptimalOrder : Prop := …
- def
OAI.CubeShuffle.finiteLawline 101Source documentation
A finite uniform experiment pushed forward by an arbitrary map.
noncomputable def finiteLaw {α β : Type*} [Fintype α] (f : α → β) (b : β) : ℝ := by … - lemma
OAI.CubeShuffle.sum_card_fibersline 105 - lemma
OAI.CubeShuffle.finiteLaw_nonnegline 111 - lemma
OAI.CubeShuffle.finiteLaw_sumline 115 - lemma
OAI.CubeShuffle.finiteLaw_eq_zero_of_not_memline 124 - lemma
OAI.CubeShuffle.event_le_totalVariationline 132Source documentation
An event discrepancy is bounded by one-half L1, with no missing factor of two.
lemma event_le_totalVariation {β : Type*} [Fintype β] [DecidableEq β] (p q : β → ℝ) (hpq : ∑ b, (p b - q b) = 0) (s : Finset β) : (∑ b ∈ s, p b) - (∑ b ∈ s, q b) ≤ (1 / 2 : ℝ) * ∑ b, |p b - q b| := by … - lemma
OAI.CubeShuffle.finiteLaw_support_boundline 147Source documentation
Information-theoretic support obstruction for a finite uniform experiment.
lemma finiteLaw_support_bound {α β : Type*} [Fintype α] [Nonempty α] [Fintype β] [Nonempty β] (f : α → β) : 1 - (Fintype.card α : ℝ) / (Fintype.card β : ℝ) ≤ (1 / 2 : ℝ) * ∑ b, |finiteLaw f b - 1 / (Fintype.card β : ℝ)| := by …Mentions: OAI.CubeShuffle.finiteLaw
- lemma
OAI.CubeShuffle.card_positionsline 171Also declared: ComparatorChallenges/WeightedSweepMoments.lean:209 (same declaration text).
- lemma
OAI.CubeShuffle.card_permutationsline 174 - lemma
OAI.CubeShuffle.card_coins_succline 177 - lemma
OAI.CubeShuffle.card_tapes_succline 180 - lemma
OAI.CubeShuffle.law_eq_finiteLawline 183 - lemma
OAI.CubeShuffle.law_nonnegline 189 - lemma
OAI.CubeShuffle.law_sumline 193 - lemma
OAI.CubeShuffle.physical_support_bound_succline 197 - lemma
OAI.CubeShuffle.step_succ_formulaline 206Source documentation
The coordinate formula in the manuscript, before any sweep conversion.
lemma step_succ_formula (d : ℕ) (ξ : Coins (d + 1)) (x : Card (d + 1)) : step (d + 1) ξ x = Fin.snoc (Fin.tail x) (Bool.xor (x 0) (ξ (Fin.tail x))) := by …Mentions: OAI.CubeShuffle.Coins, OAI.CubeShuffle.Card, OAI.CubeShuffle.step
- lemma
OAI.CubeShuffle.distance_nonnegline 212 - lemma
OAI.CubeShuffle.physical_support_boundline 217Source documentation
The exact support clause, uniform over every physical time and deck dimension.
lemma physical_support_bound (d t : ℕ) : 1 - (2 : ℝ) ^ ((t : ℝ) * (2 : ℝ) ^ d / 2) / (Nat.factorial (2 ^ d) : ℝ) ≤ distance d t := by …Mentions: OAI.CubeShuffle.distance
- lemma
OAI.CubeShuffle.supportTimeBound_le_of_distance_leline 234Source documentation
Every time that attains the prescribed TV tolerance obeys the integer lower bound.
lemma supportTimeBound_le_of_distance_le (d t : ℕ) (ht : distance d t ≤ (1 / 4 : ℝ)) : supportTimeBound d ≤ (t : ℤ) := by …Mentions: OAI.CubeShuffle.distance, OAI.CubeShuffle.supportTimeBound
- lemma
OAI.CubeShuffle.supportTimeBound_le_mixingTimeline 257Source documentation
Once the defining set is nonempty, its minimum inherits the exact obstruction.
lemma supportTimeBound_le_mixingTime {d : ℕ} (h : ({t : ℕ | distance d t ≤ (1 / 4 : ℝ)} : Set ℕ).Nonempty) : supportTimeBound d ≤ (mixingTime d : ℤ) := by …Mentions: OAI.CubeShuffle.distance, OAI.CubeShuffle.supportTimeBound, OAI.CubeShuffle.mixingTime
- lemma
OAI.CubeShuffle.log_factorial_lowerline 263 - lemma
OAI.CubeShuffle.log_three_quarters_lowerline 272 - lemma
OAI.CubeShuffle.linear_le_supportTimeBoundline 282Source documentation
An explicit version of the source's
2d - O(1)support lower bound.lemma linear_le_supportTimeBound (d : ℕ) : 2 * (d : ℝ) - 4 / Real.log 2 ≤ (supportTimeBound d : ℝ) := by …Mentions: OAI.CubeShuffle.supportTimeBound
- lemma
OAI.CubeShuffle.linear_le_time_of_distance_leline 309 - lemma
OAI.CubeShuffle.entropy_chordline 317 - lemma
OAI.CubeShuffle.split_entropy_lowerline 328 - def
OAI.CubeShuffle.Butterflyline 364Source documentation
Two independently routed half-sized butterflies, followed by the final layer of first-coordinate pair switches. Coordinates are named in the reverse of their editing order, as in the manuscript's recursive proof.
def Butterfly : ℕ → Type | 0 => Unit | d + 1 => (Card d → Bool) × (Bool → Butterfly d)
Mentions: OAI.CubeShuffle.Card
- def
OAI.CubeShuffle.childLiftline 368 - def
OAI.CubeShuffle.butterflyPermline 374 - def
OAI.CubeShuffle.childMarksline 379Source documentation
The marked input paths assigned to one of the two recursive children.
noncomputable def childMarks {d : ℕ} (s : Finset (Card (d + 1))) (ε : Bool) : Finset (Card d) := (s.filter (fun x => x 0 = ε)).image Fin.tailMentions: OAI.CubeShuffle.Card
- lemma
OAI.CubeShuffle.card_childMarksline 382 - lemma
OAI.CubeShuffle.card_childMarks_addline 392 - def
OAI.CubeShuffle.topMeetingsline 401Source documentation
The switches in the final layer used by two marked paths. A switch is indexed by the common tail at the end of the two child butterflies.
noncomputable def topMeetings {d : ℕ} (b : Butterfly (d + 1)) (s : Finset (Card (d + 1))) : Finset (Card d) := …Mentions: OAI.CubeShuffle.Butterfly, OAI.CubeShuffle.Card
- lemma
OAI.CubeShuffle.card_topMeetings_leline 406 - def
OAI.CubeShuffle.encountersline 416Source documentation
Total number of shared switches along the distinct marked routes.
noncomputable def encounters : (d : ℕ) → Butterfly d → Finset (Card d) → ℕ | 0, _, _ => 0 | d + 1, b, s => encounters d (b.2 false) (childMarks s false) + encounters d (b.2 true) (childMarks s true) + (topMeetings b s).card /-- Butterfly encounter estimate (`net:encounters`): no random hypotheses are needed, and each switch contains at most two paths because each child routes by a bijection. -/Mentions: OAI.CubeShuffle.Butterfly, OAI.CubeShuffle.Card, OAI.CubeShuffle.childMarks, OAI.CubeShuffle.topMeetings
- lemma
OAI.CubeShuffle.butterfly_encountersline 424Source documentation
Butterfly encounter estimate (
net:encounters): no random hypotheses are needed, and each switch contains at most two paths because each child routes by a bijection.lemma butterfly_encounters (d : ℕ) (b : Butterfly d) (s : Finset (Card d)) : (encounters d b s : ℝ) ≤ (s.card : ℝ) * Real.log s.card / (2 * Real.log 2) := by …Mentions: OAI.CubeShuffle.Butterfly, OAI.CubeShuffle.Card, OAI.CubeShuffle.encounters
- lemma
OAI.CubeShuffle.prod_split_atline 450 - lemma
OAI.CubeShuffle.prod_split_twoline 457 - lemma
OAI.CubeShuffle.swap_average_productline 473Source documentation
A fair transposition preserves the upper product bound on every inclusion moment; this is the elementary input used in the factorial-moment route,
11-palindrome.tex:94–97.lemma swap_average_product {α : Type*} [DecidableEq α] (s : Finset α) (p : α → ℝ) (hp : ∀ i, 0 ≤ p i) (a b : α) : ((∏ i ∈ s, p i) + ∏ i ∈ s, p (Equiv.swap a b i)) / 2 ≤ ∏ i ∈ s, (p i + p (Equiv.swap a b i)) / 2 := by … - def
OAI.CubeShuffle.CylinderBoundline 511Source documentation
Abstract inclusion moments
m(S)and their coordinate marginal majorant. This definition does not postulate independence.def CylinderBound {α : Type*} (m : Finset α → ℝ) (p : α → ℝ) : Prop := … - lemma
OAI.CubeShuffle.CylinderBound.fair_swapline 514 - def
OAI.CubeShuffle.finiteMeanline 529Source documentation
Uniform expectation in a finite experiment, kept in the real numbers.
noncomputable def finiteMean {Ω : Type*} [Fintype Ω] (f : Ω → ℝ) : ℝ := … - def
OAI.CubeShuffle.inclusionMomentline 533Source documentation
The inclusion moment of the random marked set
F.noncomputable def inclusionMoment {α Ω : Type*} [Fintype Ω] (F : Ω → Finset α) (s : Finset α) : ℝ := by … - lemma
OAI.CubeShuffle.inclusionMoment_nonnegline 538 - lemma
OAI.CubeShuffle.indicator_subset_prodline 544 - lemma
OAI.CubeShuffle.inclusionMoment_constline 553 - lemma
OAI.CubeShuffle.cylinder_constline 560 - def
OAI.CubeShuffle.fairSetSwapline 569Source documentation
Add an independent fair coin which chooses whether to transpose
aandb.noncomputable def fairSetSwap {α Ω : Type*} [DecidableEq α] (F : Ω → Finset α) (a b : α) : Ω × Bool → Finset α := … - lemma
OAI.CubeShuffle.subset_swap_image_iffline 573 - lemma
OAI.CubeShuffle.inclusionMoment_fairSetSwapline 584 - lemma
OAI.CubeShuffle.cylinder_fairSetSwapline 595 - def
OAI.CubeShuffle.SwitchSamplesline 606Source documentation
An explicit product of independent fair coins, of a recursively specified length.
def SwitchSamples : ℕ → Type | 0 => Unit | n + 1 => SwitchSamples n × Bool
- instance
OAI.CubeShuffle.(instance at line 610)line 610 - instance
OAI.CubeShuffle.(instance at line 615)line 615 - def
OAI.CubeShuffle.switchedSetline 621Source documentation
Successive independent fair transpositions, listed in reverse time order.
noncomputable def switchedSet {α : Type*} [DecidableEq α] (A : Finset α) : (L : List (α × α)) → SwitchSamples L.length → Finset α | [], _ => A | (a,b) :: L, ω => fairSetSwap (switchedSet A L) a b ω /-- Actual inclusion moments after any deterministic sequence of independent fair switches satisfy the upper product-of-marginals bound. -/Mentions: OAI.CubeShuffle.SwitchSamples, OAI.CubeShuffle.fairSetSwap
- lemma
OAI.CubeShuffle.switchedSet_cylinderline 628Source documentation
Actual inclusion moments after any deterministic sequence of independent fair switches satisfy the upper product-of-marginals bound.
lemma switchedSet_cylinder {α : Type*} [DecidableEq α] (A : Finset α) (L : List (α × α)) : CylinderBound (inclusionMoment (switchedSet A L)) (fun i => inclusionMoment (switchedSet A L) {i}) := by …Mentions: OAI.CubeShuffle.CylinderBound, OAI.CubeShuffle.inclusionMoment, OAI.CubeShuffle.switchedSet
- lemma
OAI.CubeShuffle.finiteMean_congrline 636 - lemma
OAI.CubeShuffle.finiteMean_addline 642 - lemma
OAI.CubeShuffle.finiteMean_mul_constline 646 - lemma
OAI.CubeShuffle.finiteMean_sumline 652 - lemma
OAI.CubeShuffle.finiteMean_monoline 657 - lemma
OAI.CubeShuffle.finiteMean_equivline 661 - lemma
OAI.CubeShuffle.finiteMean_prod_leftline 669 - lemma
OAI.CubeShuffle.finiteMean_pi_evalline 676 - lemma
OAI.CubeShuffle.finiteMean_eq_indicatorline 687 - lemma
OAI.CubeShuffle.exp_finiteMean_leline 691