OAI/Probability/CubeShuffle/ButterflyCycles.lean
121 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.CubeShuffle.cycleFiberline 15Source documentation
Ownership by distinguishable cycle slots;
nonemeans unselected.def cycleFiber (o : Card d → Option (Fin A)) (i : Fin A) : Finset (Card d) := by …
Mentions: OAI.CubeShuffle.Card
- lemma
OAI.CubeShuffle.mem_cycleFiberline 19 - abbrev
OAI.CubeShuffle.Terminalline 24 - def
OAI.CubeShuffle.slotWeightline 26 - def
OAI.CubeShuffle.pathWeightline 29 - def
OAI.CubeShuffle.withinWeightline 34 - def
OAI.CubeShuffle.rotationMeetingline 42Source documentation
Charge at a meeting after independently rotating the selected cycles. A later slot is the only possible closer, except within a single cycle where either user can be its terminal.
noncomputable def rotationMeeting (o : Card d → Option (Fin A)) (z : Terminal o) (u v : Card d) : ℝ := …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.Terminal
- lemma
OAI.CubeShuffle.card_cycleFiberline 50 - lemma
OAI.CubeShuffle.terminal_meanline 55 - lemma
OAI.CubeShuffle.slotWeight_antitoneline 69 - lemma
OAI.CubeShuffle.rotationMeeting_meanline 78 - lemma
OAI.CubeShuffle.pathWeight_sumline 111 - lemma
OAI.CubeShuffle.withinWeight_sum_boundline 128 - def
OAI.CubeShuffle.rotationChargeline 150 - lemma
OAI.CubeShuffle.rotationCharge_mean_boundline 154 - lemma
OAI.CubeShuffle.rotation_exp_boundline 174Source documentation
The Jensen rotation bound, still expressed in exponentials so that all normalizing constants and the factor one half are explicit.
lemma rotation_exp_bound {o : Card d → Option (Fin A)} [∀ i : Fin A, Nonempty {x : Card d // o x = some i}] (hm : Monotone (fun i => (cycleFiber o i).card)) (b : Butterfly d) : Real.exp (-Real.log 2 * ((A:ℝ)*d/2 + ∑ i : Fin A, Real.log (cycleFiber o i).card / (2 * Real.log 2))) ≤ finiteMean (fun z : Terminal o => Real.exp (-Real.log 2 * rotationCharge o b z)) := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.cycleFiber, OAI.CubeShuffle.Butterfly, OAI.CubeShuffle.finiteMean, OAI.CubeShuffle.Terminal, OAI.CubeShuffle.rotationCharge
- def
OAI.CubeShuffle.orbitSetline 199Source documentation
The full cycle as an orbit, including one-element cycles.
noncomputable def orbitSet (p : Equiv.Perm α) (x : α) : Finset α := …
- lemma
OAI.CubeShuffle.mem_orbitSetline 202 - lemma
OAI.CubeShuffle.orbitSet_nonemptyline 207 - lemma
OAI.CubeShuffle.orbitSet_eqline 210 - lemma
OAI.CubeShuffle.orbitSet_applyline 216 - lemma
OAI.CubeShuffle.orbitSet_eq_or_disjointline 220 - lemma
OAI.CubeShuffle.perm_minimalPeriod_posline 231 - lemma
OAI.CubeShuffle.orbitSet_cardline 235 - def
OAI.CubeShuffle.walkSetline 255Source documentation
Inputs of the first r path queries, in temporal order forgotten.
def walkSet (p : Equiv.Perm α) (r : ℕ) (x : α) : Finset α := …
- lemma
OAI.CubeShuffle.mem_walkSetline 259 - lemma
OAI.CubeShuffle.walkSet_zeroline 264 - lemma
OAI.CubeShuffle.walkSet_succ_lastline 268 - lemma
OAI.CubeShuffle.walkSet_succ_firstline 273 - lemma
OAI.CubeShuffle.not_mem_short_walkline 287 - lemma
OAI.CubeShuffle.walkSet_periodline 296 - lemma
OAI.CubeShuffle.walkSet_cardline 310 - lemma
OAI.CubeShuffle.walkSet_subset_orbitline 319 - def
OAI.CubeShuffle.cycleTraceline 329Source documentation
Deterministic semantics of the adaptive cycle validator. The result records all visited inputs and the unique terminal (closing-path input).
def cycleTrace (p : Equiv.Perm α) (S : Finset α) (a : α) : ℕ → α → Finset α → Option (Finset α × α) | 0, x, V => if x ∈ S ∧ x ∉ V ∧ p x = a then some (insert x V,x) else none | r+1, x, V => if x ∈ S ∧ x ∉ V then cycleTrace p S a r (p x) (insert x V) else none - lemma
OAI.CubeShuffle.cycleTrace_walkline 334 - lemma
OAI.CubeShuffle.cycleTrace_orbitline 368 - def
OAI.CubeShuffle.exposedPathsline 391Source documentation
Precisely the switch record produced by exposing a set of complete paths.
noncomputable def exposedPaths (d : ℕ) (b : Butterfly d) (V : Finset (Card d)) : Finset (SwitchIndex d) := …Mentions: OAI.CubeShuffle.Butterfly, OAI.CubeShuffle.Card, OAI.CubeShuffle.SwitchIndex
- lemma
OAI.CubeShuffle.exposedPaths_emptyline 395 - lemma
OAI.CubeShuffle.exposedPaths_insertline 399 - def
OAI.CubeShuffle.terminalChargeline 404 - lemma
OAI.CubeShuffle.QueryTree.followPath_stale_chargeline 409 - lemma
OAI.CubeShuffle.QueryTree.seekCycle_semanticsline 423Source documentation
The cycle-query certificate has exactly its deterministic cycle-trace semantics, including the complete exposure record and terminal encounter charge.
lemma seekCycle_semantics (d : ℕ) (S : Finset (Card d)) (a : Card d) (r : ℕ) (x : Card d) (V W : Finset (Card d)) (z : Card d) (k : Finset (Card d) → QueryTree (SwitchIndex d)) (ω : SwitchIndex d → Bool) (h : cycleTrace (butterflyPerm d (decodeButterfly d ω)) S a r x V = some (W,z)) : (seekCycle d S a r x V k).succeeds ω = (k W).succeeds ω ∧ (seekCycle d S a r x V k).staleCharge (exposedPaths d (decodeButterfly d ω) V) ω = (k W).staleCharge (exposedPaths d (decodeButterfly d ω) W) ω + terminalCharge d (decodeButterfly d ω) z (W.erase z) := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.QueryTree, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.cycleTrace, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly, OAI.CubeShuffle.QueryTree.seekCycle, OAI.CubeShuffle.QueryTree.succeeds, OAI.CubeShuffle.QueryTree.staleCharge, OAI.CubeShuffle.exposedPaths, OAI.CubeShuffle.terminalCharge
- lemma
OAI.CubeShuffle.QueryTree.seekCycle_orbitline 453 - lemma
OAI.CubeShuffle.mem_exposedPathsline 468 - lemma
OAI.CubeShuffle.terminalCharge_sumline 480 - def
OAI.CubeShuffle.priorPathsline 503Source documentation
All slots before time t, including the whole current cycle when t=i+1.
noncomputable def priorPaths {d A : ℕ} (o : Card d → Option (Fin A)) (t : ℕ) : Finset (Card d) := …Mentions: OAI.CubeShuffle.Card
- lemma
OAI.CubeShuffle.mem_priorPathsline 506 - lemma
OAI.CubeShuffle.terminalCharge_prior_sumline 511 - lemma
OAI.CubeShuffle.rotationMeeting_eq_slot_sumline 528 - lemma
OAI.CubeShuffle.rotationCharge_eq_terminal_sumline 582Source documentation
The geometric rotation charge equals the actual sum of exposed terminal route meetings, with exactly the earlier slots and own cycle made available.
lemma rotationCharge_eq_terminal_sum {d A : ℕ} (o : Card d → Option (Fin A)) (b : Butterfly d) (z : Terminal o) : rotationCharge o b z = ∑ i : Fin A, (terminalCharge d b (z i).val ((priorPaths o (i.val+1)).erase (z i).val) : ℝ) := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.Butterfly, OAI.CubeShuffle.Terminal, OAI.CubeShuffle.rotationCharge, OAI.CubeShuffle.terminalCharge, OAI.CubeShuffle.priorPaths
- lemma
OAI.CubeShuffle.priorPaths_zeroline 590 - lemma
OAI.CubeShuffle.priorPaths_succline 595 - lemma
OAI.CubeShuffle.priorPaths_disjointline 610 - lemma
OAI.CubeShuffle.QueryTree.seekCycles_ownedline 624Source documentation
Success and exact exposed-switch charge for a realized, disjoint collection of full permutation cycles in ordered distinguishable slots.
lemma seekCycles_owned {d A : ℕ} (S : Finset (Card d)) (r : Fin A → ℕ) (o : Card d → Option (Fin A)) (z : Terminal o) (ω : SwitchIndex d → Bool) (hS : ∀ i, cycleFiber o i ⊆ S) (hO : ∀ i, orbitSet (butterflyPerm d (decodeButterfly d ω)) (z i).val = cycleFiber o i) (hC : ∀ i, (cycleFiber o i).card = r i+1) : let p := butterflyPerm d (decodeButterfly d ω) …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.Terminal, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.cycleFiber, OAI.CubeShuffle.orbitSet, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly
- def
OAI.CubeShuffle.ValidCycleSlotsline 676Source documentation
A permutation-cycle collection in distinguishable slots, including all length-one cycles. No selection has been weakened to a collection of paths.
def ValidCycleSlots (p : Equiv.Perm (Card d)) (S : Finset (Card d)) (r : Fin A → ℕ) (o : Card d → Option (Fin A)) : Prop := …Mentions: OAI.CubeShuffle.Card
- abbrev
OAI.CubeShuffle.CycleSlotsline 682 - instance
OAI.CubeShuffle.(instance at line 685)line 685 - lemma
OAI.CubeShuffle.CycleSlots.terminal_nonemptyline 688 - lemma
OAI.CubeShuffle.owner_extline 694 - abbrev
OAI.CubeShuffle.RootedSlotsline 706 - def
OAI.CubeShuffle.rootedStartline 709 - lemma
OAI.CubeShuffle.rootedStart_injectiveline 715 - lemma
OAI.CubeShuffle.sum_comp_injective_leline 728 - lemma
OAI.CubeShuffle.rooted_weight_sum_leline 738Source documentation
Sum over every rooted realized collection is controlled by the sum over all starts. This injectivity step retains cycle disjointness and all rotations.
lemma rooted_weight_sum_le (S : Finset (Card d)) (r : Fin A → ℕ) (ω : SwitchIndex d → Bool) : (∑ c : RootedSlots (butterflyPerm d (decodeButterfly d ω)) S r, ((2:ℝ)^d)^A * Real.exp (-Real.log 2 * rotationCharge c.1.val (decodeButterfly d ω) c.2)) ≤ ∑ a : Fin A → S, if (QueryTree.seekCycles d S (List.ofFn (fun i => ((a i).val,r i))) ∅).succeeds ω then ((2:ℝ)^d)^A / (2:ℝ)^(QueryTree.seekCycles d S (List.ofFn (fun i => ((a i).val,r i))) ∅).staleCharge ∅ ω else 0 := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.RootedSlots, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly, OAI.CubeShuffle.rotationCharge, OAI.CubeShuffle.QueryTree.seekCycles
- def
OAI.CubeShuffle.rotationLowerline 765 - def
OAI.CubeShuffle.collectionWeightline 768 - lemma
OAI.CubeShuffle.collectionWeight_posline 771 - lemma
OAI.CubeShuffle.collection_rotation_lowerline 775 - lemma
OAI.CubeShuffle.cycleSlots_weighted_momentline 805Source documentation
The weighted collection inequality obtained by summing the actual adaptive query certificate over starts. The subsequent simplification yields FAC.3.
lemma cycleSlots_weighted_moment (S : Finset (Card d)) (r : Fin A → ℕ) (hr : Monotone r) : finiteMean (fun ω : SwitchIndex d → Bool => (Fintype.card (CycleSlots (butterflyPerm d (decodeButterfly d ω)) S r) : ℝ)) * collectionWeight d r ≤ (S.card : ℝ)^A := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.finiteMean, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.CycleSlots, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly, OAI.CubeShuffle.collectionWeight
- lemma
OAI.CubeShuffle.cycleSlots_momentline 838 - lemma
OAI.CubeShuffle.collectionWeight_eq_sqrtline 845 - lemma
OAI.CubeShuffle.butterfly_cycleSlots_momentline 872Source documentation
The exact fixed-distinguished-slot form of FAC.3, with physical butterfly size n=2^d and every slot a whole permutation cycle of the stated length.
lemma butterfly_cycleSlots_moment (S : Finset (Card d)) (r : Fin A → ℕ) (hr : Monotone r) : finiteMean (fun ω : SwitchIndex d → Bool => (Fintype.card (CycleSlots (butterflyPerm d (decodeButterfly d ω)) S r) : ℝ)) ≤ ((S.card : ℝ) / Real.sqrt ((2:ℝ)^d))^A * ∏ i : Fin A, (1 / Real.sqrt (r i+1)) := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.finiteMean, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.CycleSlots, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly
- abbrev
OAI.CubeShuffle.SelectedCycleline 889Source documentation
The genuine cycles retained completely in S; fixed points are included.
abbrev SelectedCycle (p : Equiv.Perm (Card d)) (S : Finset (Card d)) := …
Mentions: OAI.CubeShuffle.Card
- instance
OAI.CubeShuffle.(instance at line 892)line 892 - lemma
OAI.CubeShuffle.SelectedCycle.nonemptyline 895 - lemma
OAI.CubeShuffle.SelectedCycle.orbit_eqline 901 - lemma
OAI.CubeShuffle.SelectedCycle.eq_of_memline 907 - abbrev
OAI.CubeShuffle.SlotAssignmentline 912 - instance
OAI.CubeShuffle.(instance at line 915)line 915 - def
OAI.CubeShuffle.slotsToAssignmentline 918 - def
OAI.CubeShuffle.assignmentOwnerline 932 - lemma
OAI.CubeShuffle.assignmentOwner_eq_someline 937 - lemma
OAI.CubeShuffle.assignmentOwner_fiberline 955 - def
OAI.CubeShuffle.assignmentToSlotsline 960 - def
OAI.CubeShuffle.cycleSlotsEquivAssignmentsline 976Source documentation
Ownership and labelled distinct full cycles are equivalent, not merely bounded by one another. This identifies the factorial-moment combinatorics.
noncomputable def cycleSlotsEquivAssignments (p : Equiv.Perm (Card d)) (S : Finset (Card d)) (r : Fin A → ℕ) : CycleSlots p S r ≃ SlotAssignment p S r where …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.CycleSlots, OAI.CubeShuffle.SlotAssignment
- abbrev
OAI.CubeShuffle.LengthClassline 997 - def
OAI.CubeShuffle.slotClassline 999 - abbrev
OAI.CubeShuffle.SlotsOfLengthline 1002 - abbrev
OAI.CubeShuffle.CyclesOfLengthline 1003 - instance
OAI.CubeShuffle.(instance at line 1006)line 1006 - abbrev
OAI.CubeShuffle.GroupedAssignmentsline 1009 - def
OAI.CubeShuffle.assignmentToGroupsline 1012 - def
OAI.CubeShuffle.groupsEmbeddingline 1017 - def
OAI.CubeShuffle.groupsToAssignmentline 1024 - def
OAI.CubeShuffle.assignmentEquivGroupsline 1029 - lemma
OAI.CubeShuffle.card_cycleSlots_factorialline 1044 - lemma
OAI.CubeShuffle.butterfly_factorial_momentline 1055Source documentation
Factorial moments for independently fair butterflies, including every fixed point. The product is over the distinct positive lengths in the given sorted slot list.
lemma butterfly_factorial_moment (S : Finset (Card d)) (r : Fin A → ℕ) (hr : Monotone r) : finiteMean (fun ω : SwitchIndex d → Bool => (∏ j : LengthClass r, (Fintype.card (CyclesOfLength (butterflyPerm d (decodeButterfly d ω)) S j.val)).descFactorial (Fintype.card (SlotsOfLength r j)) : ℕ)) ≤ ((S.card : ℝ) / Real.sqrt ((2:ℝ)^d))^A * ∏ i : Fin A, (1 / Real.sqrt (r i+1)) := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.finiteMean, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.LengthClass, OAI.CubeShuffle.CyclesOfLength, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly, OAI.CubeShuffle.SlotsOfLength
- def
OAI.CubeShuffle.assignmentRelabelline 1069 - lemma
OAI.CubeShuffle.card_cycleSlots_relabelline 1078 - lemma
OAI.CubeShuffle.butterfly_cycleSlots_moment_allline 1084 - abbrev
OAI.CubeShuffle.ShortCycleline 1094 - instance
OAI.CubeShuffle.(instance at line 1097)line 1097 - def
OAI.CubeShuffle.shortCycleLengthline 1100 - lemma
OAI.CubeShuffle.shortCycleLength_add_oneline 1104 - def
OAI.CubeShuffle.shortEmbeddingEquivline 1110 - lemma
OAI.CubeShuffle.shortCycle_factorial_eqline 1136 - lemma
OAI.CubeShuffle.factorial_mgfline 1151Source documentation
A bounded integer variable with Poisson-dominated falling factorial moments has the corresponding exponential generating-function bound.
lemma factorial_mgf {Ω : Type*} [Fintype Ω] (F : Ω → ℕ) (k : ℕ) (Λ q : ℝ) (hF : ∀ ω, F ω ≤ k) (hΛ : 0 ≤ Λ) (hq : 1 ≤ q) (hm : ∀ a, finiteMean (fun ω => ((F ω).descFactorial a : ℝ)) ≤ Λ^a) : finiteMean (fun ω => q^(F ω)) ≤ Real.exp ((q-1)*Λ) := by …Mentions: OAI.CubeShuffle.finiteMean
- lemma
OAI.CubeShuffle.inv_sqrt_stepline 1188 - lemma
OAI.CubeShuffle.sum_inv_sqrtline 1196 - lemma
OAI.CubeShuffle.butterfly_shortCycle_momentline 1211 - def
OAI.CubeShuffle.cycleMassline 1230 - lemma
OAI.CubeShuffle.cycleMass_leline 1233 - lemma
OAI.CubeShuffle.shortCycle_card_leline 1251 - lemma
OAI.CubeShuffle.butterfly_shortCycle_mgfline 1260 - abbrev
OAI.CubeShuffle.LongCycleline 1274 - instance
OAI.CubeShuffle.(instance at line 1276)line 1276 - lemma
OAI.CubeShuffle.selectedCycle_card_splitline 1279 - lemma
OAI.CubeShuffle.longCycle_card_boundline 1285 - lemma
OAI.CubeShuffle.finiteMean_posline 1301 - lemma
OAI.CubeShuffle.longCycle_pow_boundline 1307 - lemma
OAI.CubeShuffle.butterfly_cycle_log_mgfline 1322Source documentation
FAC.4 for a full fair butterfly, with actual whole permutation cycles retained inside the marked set. No asymptotic or numerical oracle enters.
lemma butterfly_cycle_log_mgf (S : Finset (Card d)) (J : ℕ) (hJ : 0 < J) (q : ℝ) (hq : 1 ≤ q) : Real.log (finiteMean (fun ω : SwitchIndex d → Bool => q^(Fintype.card (SelectedCycle (butterflyPerm d (decodeButterfly d ω)) S)))) ≤ (S.card : ℝ)/J * Real.log q + 2*q*S.card*Real.sqrt J / Real.sqrt ((2:ℝ)^d) := by …Mentions: OAI.CubeShuffle.Card, OAI.CubeShuffle.finiteMean, OAI.CubeShuffle.SwitchIndex, OAI.CubeShuffle.SelectedCycle, OAI.CubeShuffle.butterflyPerm, OAI.CubeShuffle.decodeButterfly