OAI/Probability/CoordinateSweeps/Grid.lean
92 declarations, 0 contain sorry, 0 declared as axioms
- structure
OAI.CoordinateSweeps.FiniteLawline 28Source comment
A probability law on a finite sample space, with real-valued masses.Also declared: ComparatorChallenges/CoordinateSweeps.lean:19 (same declaration text).
structure FiniteLaw (Ω : Type*) where …
- instance
OAI.CoordinateSweeps.FiniteLaw.(instance at line 37)line 37 - theorem
OAI.CoordinateSweeps.FiniteLaw.extline 39Also declared: ComparatorChallenges/CoordinateSweeps.lean:30 (same declaration text).
- theorem
OAI.CoordinateSweeps.FiniteLaw.sum_massline 47Also declared: ComparatorChallenges/CoordinateSweeps.lean:38 (same declaration text).
- def
OAI.CoordinateSweeps.FiniteLaw.uniformline 51Source comment
Uniform probability, not counting measure.Also declared: ComparatorChallenges/CoordinateSweeps.lean:41 (same declaration text).
def uniform (Ω : Type*) [Fintype Ω] [Nonempty Ω] : FiniteLaw Ω where …
Mentions: OAI.CoordinateSweeps.FiniteLaw
- def
OAI.CoordinateSweeps.FiniteLaw.mapline 60Source comment
Push forward a law; the sample space need not map injectively.Also declared: ComparatorChallenges/CoordinateSweeps.lean:49 (same declaration text).
def map (μ : FiniteLaw Ω) (f : Ω → X) : FiniteLaw X where …
Mentions: OAI.CoordinateSweeps.FiniteLaw
- theorem
OAI.CoordinateSweeps.FiniteLaw.uniform_applyline 69 - theorem
OAI.CoordinateSweeps.FiniteLaw.map_applyline 72 - def
OAI.CoordinateSweeps.FiniteLaw.mixline 76Source comment
Mixture of two laws, with the real probability range explicit.def mix (μ ν : FiniteLaw Ω) (z : ℝ) (hz : 0 ≤ z) (hz' : z ≤ 1) : FiniteLaw Ω where …
Mentions: OAI.CoordinateSweeps.FiniteLaw
- def
OAI.CoordinateSweeps.FiniteLaw.independentline 86Source comment
Independent laws on finitely many (possibly different) finite spaces.def independent {ι : Type*} [Fintype ι] {A : ι → Type*} [∀ i, Fintype (A i)] (μ : ∀ i, FiniteLaw (A i)) : FiniteLaw (∀ i, A i) where …Mentions: OAI.CoordinateSweeps.FiniteLaw
- def
OAI.CoordinateSweeps.FiniteLaw.tvline 96Source comment
The finite total-variation convention of the source: half the l1 distance.def tv (μ ν : FiniteLaw Ω) : ℝ := (1 / 2 : ℝ) * ∑ x, |μ x - ν x|
Mentions: OAI.CoordinateSweeps.FiniteLaw
- def
OAI.CoordinateSweeps.FiniteLaw.eventline 99Source comment
Probability of an event.def event (μ : FiniteLaw Ω) (s : Finset Ω) : ℝ := ∑ x ∈ s, μ x …
Mentions: OAI.CoordinateSweeps.FiniteLaw
- def
OAI.CoordinateSweeps.lineCostline 103 - theorem
OAI.CoordinateSweeps.monotone_prefix_averageline 106 - theorem
OAI.CoordinateSweeps.sum_correctionsline 124 - theorem
OAI.CoordinateSweeps.lineCost_eqline 137 - theorem
OAI.CoordinateSweeps.lineCost_nonnegline 143 - theorem
OAI.CoordinateSweeps.full_lineCost_leline 154 - theorem
OAI.CoordinateSweeps.lineCost_leline 162 - abbrev
OAI.CoordinateSweeps.Cubeline 177Source comment
Binary positions with their actual bit-coordinate labels.Also declared: ComparatorChallenges/CoordinateSweeps.lean:60 (same declaration text).
abbrev Cube (d : ℕ) := Fin d → Bool
- def
OAI.CoordinateSweeps.pairSwitchline 180Source comment
Switches on a family of disjoint two-point fibers.Distinct definitions of this name: ComparatorChallenges/CoordinateSweeps.lean:62 (same statement text; different proof or body). Qualify references as OAI.CoordinateSweeps.pairSwitch@path.
def pairSwitch {L : Type*} (bits : L → Bool) : Equiv.Perm (Bool × L) where … - def
OAI.CoordinateSweeps.binaryLayerline 193Source comment
The parallel-edge switch layer in one specified bit direction.Also declared: ComparatorChallenges/CoordinateSweeps.lean:74 (same declaration text).
def binaryLayer {d : ℕ} (j : Fin d) (bits : ({k : Fin d // k ≠ j} → Bool) → Bool) : Equiv.Perm (Cube d) := …Mentions: OAI.CoordinateSweeps.Cube
- def
OAI.CoordinateSweeps.orderedProductline 198Source comment
Ordered composition: coordinate 0 is visited first.Also declared: ComparatorChallenges/CoordinateSweeps.lean:79 (same declaration text).
def orderedProduct {G : Type*} [Monoid G] {d : ℕ} (g : Fin d → G) : G := … - abbrev
OAI.CoordinateSweeps.BinaryChoicesline 202Source comment
Exactly one independent fair bit for every stage-edge.Also declared: ComparatorChallenges/CoordinateSweeps.lean:82 (same declaration text).
abbrev BinaryChoices (d : ℕ) := ∀ j : Fin d, ({k : Fin d // k ≠ j} → Bool) → Bool - instance
OAI.CoordinateSweeps.(instance at line 204)line 204 - def
OAI.CoordinateSweeps.binarySweepline 207Source comment
One binary coordinate sweep, with all individual switches specified.Also declared: ComparatorChallenges/CoordinateSweeps.lean:86 (same declaration text).
def binarySweep (d : ℕ) (bits : BinaryChoices d) : Equiv.Perm (Cube d) := …
Mentions: OAI.CoordinateSweeps.BinaryChoices, OAI.CoordinateSweeps.Cube
- def
OAI.CoordinateSweeps.binaryLawline 211Source comment
The source's B_(2^d), as the pushforward of the independent fair switches.Also declared: ComparatorChallenges/CoordinateSweeps.lean:89 (same declaration text).
def binaryLaw (d : ℕ) : FiniteLaw (Equiv.Perm (Cube d)) := …
Mentions: OAI.CoordinateSweeps.FiniteLaw, OAI.CoordinateSweeps.Cube
- def
OAI.CoordinateSweeps.lineLawline 215Source comment
The line law L_m(z)=(1-z)U_m+zB_m, with m=2^d.def lineLaw (d : ℕ) (z : ℝ) (hz : 0 ≤ z) (hz' : z ≤ 1) : FiniteLaw (Equiv.Perm (Cube d)) := …Mentions: OAI.CoordinateSweeps.FiniteLaw, OAI.CoordinateSweeps.Cube
- structure
OAI.CoordinateSweeps.Gridline 221Source comment
An ordered power-of-two grid. Its coordinate bounds are kept in the theorem, not hidden in a change to the definition of the process.Also declared: ComparatorChallenges/CoordinateSweeps.lean:92 (same declaration text).
structure Grid where …
- def
OAI.CoordinateSweeps.Grid.sizeline 228Also declared: ComparatorChallenges/CoordinateSweeps.lean:99 (same declaration text).
- abbrev
OAI.CoordinateSweeps.Grid.Slotline 230Also declared: ComparatorChallenges/CoordinateSweeps.lean:101 (same declaration text).
- abbrev
OAI.CoordinateSweeps.Grid.Lineline 232Also declared: ComparatorChallenges/CoordinateSweeps.lean:103 (same declaration text).
- abbrev
OAI.CoordinateSweeps.Grid.Choicesline 234Also declared: ComparatorChallenges/CoordinateSweeps.lean:105 (same declaration text).
- def
OAI.CoordinateSweeps.Grid.fiberPermline 237Source comment
Simultaneous permutations on disjoint coordinate lines.Also declared: ComparatorChallenges/CoordinateSweeps.lean:107 (same declaration text).
def fiberPerm {A B : Type*} (p : B → Equiv.Perm A) : Equiv.Perm (A × B) where … - def
OAI.CoordinateSweeps.Grid.stageline 243Also declared: ComparatorChallenges/CoordinateSweeps.lean:113 (same declaration text).
- def
OAI.CoordinateSweeps.Grid.boundaryline 248Source comment
The partial sweep at a stage boundary, including boundaries 0 and b.Also declared: ComparatorChallenges/CoordinateSweeps.lean:117 (same declaration text).
def boundary (G : Grid) (ω : G.Choices) (t : ℕ) : Equiv.Perm G.Slot := …
Mentions: OAI.CoordinateSweeps.Grid
- def
OAI.CoordinateSweeps.Grid.sweepline 251Also declared: ComparatorChallenges/CoordinateSweeps.lean:120 (same declaration text).
- def
OAI.CoordinateSweeps.Grid.stageLawline 254Source comment
Independent line choices for a single coordinate stage.def stageLaw (G : Grid) (j : Fin G.b) (z : ℝ) (hz : 0 ≤ z) (hz' : z ≤ 1) : FiniteLaw (G.Line j → Equiv.Perm (Cube (G.bits j))) := …Mentions: OAI.CoordinateSweeps.Grid, OAI.CoordinateSweeps.FiniteLaw, OAI.CoordinateSweeps.Cube
- def
OAI.CoordinateSweeps.Grid.choiceLawline 259Source comment
All stage-lines randomize independently, exactly as in 03-paths:5-17.def choiceLaw (G : Grid) (z : ℝ) (hz : 0 ≤ z) (hz' : z ≤ 1) : FiniteLaw G.Choices := …
Mentions: OAI.CoordinateSweeps.Grid, OAI.CoordinateSweeps.FiniteLaw
- def
OAI.CoordinateSweeps.Grid.Allowedline 263Source comment
Allowed grid, with R=2^r. This is precisely m_j ∈ [R,R²] in bit coordinates.Also declared: ComparatorChallenges/CoordinateSweeps.lean:123 (same declaration text).
def Allowed (G : Grid) (r : ℕ) : Prop := ∀ j, r ≤ G.bits j ∧ G.bits j ≤ 2 * r
Mentions: OAI.CoordinateSweeps.Grid
- structure
OAI.CoordinateSweeps.Grid.Holesline 266Source comment
Prescribed disjoint trajectories; disjointness is required at every boundary.Also declared: ComparatorChallenges/CoordinateSweeps.lean:126 (same declaration text).
structure Holes (G : Grid) (h : ℕ) where …
Mentions: OAI.CoordinateSweeps.Grid
- def
OAI.CoordinateSweeps.Grid.Holes.Compatibleline 276Also declared: ComparatorChallenges/CoordinateSweeps.lean:136 (same declaration text).
- def
OAI.CoordinateSweeps.Grid.Holes.Feasibleline 279Also declared: ComparatorChallenges/CoordinateSweeps.lean:139 (same declaration text).
- def
OAI.CoordinateSweeps.Grid.Holes.lineCountline 282Source comment
Holes using a particular stage-line, counted before that stage.Also declared: ComparatorChallenges/CoordinateSweeps.lean:141 (same declaration text).
def lineCount (H : G.Holes h) (j : Fin G.b) (L : G.Line j) : ℕ := …
- def
OAI.CoordinateSweeps.Grid.Holes.costline 287Source comment
The exact falling-factorial potential C(H), with (m)_0=1.Also declared: ComparatorChallenges/CoordinateSweeps.lean:145 (same declaration text).
def cost (H : G.Holes h) : ℝ := …
- theorem
OAI.CoordinateSweeps.Grid.Holes.lineCount_leline 292 - theorem
OAI.CoordinateSweeps.Grid.Holes.sum_lineCountline 309 - theorem
OAI.CoordinateSweeps.Grid.Holes.cost_nonnegline 316 - theorem
OAI.CoordinateSweeps.Grid.Holes.cost_leline 323 - def
OAI.CoordinateSweeps.Grid.Holes.stabilizerline 337Source comment
Permutations of the free input sites, presented as permutations fixing the prescribed inputs. This is the symmetric group on exactly s-h sites.Also declared: ComparatorChallenges/CoordinateSweeps.lean:151 (same declaration text).
def stabilizer (H : G.Holes h) : Subgroup (Equiv.Perm G.Slot) where …
- def
OAI.CoordinateSweeps.Grid.Holes.referenceline 348Source comment
One feasible reference bijection is a permitted choice of identifications of the remaining input and output sites (02-preliminaries:5).Also declared: ComparatorChallenges/CoordinateSweeps.lean:160 (same declaration text).
def reference (H : G.Holes h) (hf : H.Feasible) : G.Choices := hf.choose
- theorem
OAI.CoordinateSweeps.Grid.Holes.reference_compatibleline 350Also declared: ComparatorChallenges/CoordinateSweeps.lean:162 (same declaration text).
- def
OAI.CoordinateSweeps.Grid.Holes.residualline 354Source comment
The remaining permutation relative to those identifications.Also declared: ComparatorChallenges/CoordinateSweeps.lean:166 (same declaration text).
def residual (H : G.Holes h) (hf : H.Feasible) (ω : {ω : G.Choices // H.Compatible ω}) : H.stabilizer := … - def
OAI.CoordinateSweeps.Grid.choiceWeightline 365Source comment
Joint mass of all independent stage-line choices.Also declared: ComparatorChallenges/CoordinateSweeps.lean:177 (same declaration text).
def choiceWeight (G : Grid) (z : ℝ) (ω : G.Choices) : ℝ := …
Mentions: OAI.CoordinateSweeps.Grid
- theorem
OAI.CoordinateSweeps.Grid.choiceWeight_eqline 370 - theorem
OAI.CoordinateSweeps.Grid.choiceWeight_posline 373 - theorem
OAI.CoordinateSweeps.Grid.boundary_zeroline 390 - theorem
OAI.CoordinateSweeps.Grid.boundary_succline 393 - theorem
OAI.CoordinateSweeps.Grid.stage_apply_sameline 399 - theorem
OAI.CoordinateSweeps.Grid.stage_apply_neline 403 - def
OAI.CoordinateSweeps.Grid.Holes.StepCompatibleline 410 - theorem
OAI.CoordinateSweeps.Grid.Holes.compatible_iff_stepline 413 - theorem
OAI.CoordinateSweeps.Grid.Holes.step_iff_coordinateline 442Source comment
Compatibility is a product of independent line assignment events.theorem step_iff_coordinate (H : G.Holes h) (ω : G.Choices) : H.StepCompatible ω ↔ ∀ i (j : Fin G.b), ω j (fun k => H.path i j.castSucc k) (H.path i j.castSucc j) = H.path i j.succ j := by … - def
OAI.CoordinateSweeps.Grid.Holes.OnLineline 456 - theorem
OAI.CoordinateSweeps.Grid.Holes.line_input_injectiveline 459 - theorem
OAI.CoordinateSweeps.Grid.Holes.line_output_injectiveline 469 - theorem
OAI.CoordinateSweeps.Grid.Holes.feasible_of_disjointline 484Source comment
Disjoint source trajectories really are feasible; no probability event is postulated to be nonempty. The main target still retains its explicit feasibility hypothesis.theorem feasible_of_disjoint (H : G.Holes h) : H.Feasible := by …
- theorem
OAI.CoordinateSweeps.FiniteLaw.mass_le_oneline 502 - theorem
OAI.CoordinateSweeps.FiniteLaw.mix_uniform_betweenline 508Source comment
A uniform, finite-alphabet perturbation interval, depending on the line size only. This proves the source's half-to-two measure comparison.theorem mix_uniform_between [Nonempty Ω] (ν : FiniteLaw Ω) {z : ℝ} (hz : 0 ≤ z) (hzhalf : z ≤ 1/2) (hzcard : z ≤ (Fintype.card Ω : ℝ)⁻¹) (x : Ω) : (1/2 : ℝ) * uniform Ω x ≤ (uniform Ω).mix ν z hz (by linarith) x ∧ (uniform Ω).mix ν z hz (by linarith) x ≤ 2 * uniform Ω x := by …Mentions: OAI.CoordinateSweeps.FiniteLaw, OAI.CoordinateSweeps.FiniteLaw.uniform, OAI.CoordinateSweeps.FiniteLaw.mix
- def
OAI.CoordinateSweeps.FiniteLaw.assignmentsline 525 - theorem
OAI.CoordinateSweeps.FiniteLaw.assignments_nonnegline 529 - theorem
OAI.CoordinateSweeps.FiniteLaw.sum_assignmentsline 537 - theorem
OAI.CoordinateSweeps.FiniteLaw.uniform_assignments_sameline 543 - theorem
OAI.CoordinateSweeps.FiniteLaw.uniform_assignmentsline 568 - theorem
OAI.CoordinateSweeps.FiniteLaw.uniform_assignments_posline 585 - theorem
OAI.CoordinateSweeps.FiniteLaw.assignments_leline 591 - theorem
OAI.CoordinateSweeps.FiniteLaw.le_assignmentsline 602 - theorem
OAI.CoordinateSweeps.FiniteLaw.assignments_ratio_le_fourline 615Source comment
The exact factor four in the line-conditioning argument, with all line assignments represented by actual injections, not abstract events.theorem assignments_ratio_le_four {h v : ℕ} (μ : FiniteLaw (Equiv.Perm Ω)) (hμlo : ∀ g, (1/2 : ℝ) * uniform (Equiv.Perm Ω) g ≤ μ g) (hμhi : ∀ g, μ g ≤ 2 * uniform (Equiv.Perm Ω) g) (x y : Fin h ↪ Ω) (x' y' : Fin (h+v) ↪ Ω) : μ.assignments x' y' / μ.assignments x y ≤ 4 * (((Fintype.card Ω - h).descFactorial v : ℝ)⁻¹) := by …Mentions: OAI.CoordinateSweeps.FiniteLaw, OAI.CoordinateSweeps.FiniteLaw.uniform
- def
OAI.CoordinateSweeps.Grid.Holes.LineCompatibleline 648 - theorem
OAI.CoordinateSweeps.Grid.Holes.compatible_iff_linesline 652 - def
OAI.CoordinateSweeps.Grid.Holes.compatibleEquivline 663 - def
OAI.CoordinateSweeps.Grid.Holes.probabilityline 673Source comment
Probability of the prescribed trajectory event, with the root definition.Also declared: ComparatorChallenges/CoordinateSweeps.lean:186 (same declaration text).
def probability (H : G.Holes h) (z : ℝ) : ℝ := …
- theorem
OAI.CoordinateSweeps.Grid.Holes.probability_prodline 677Source comment
Exact path probability factors into its independent constrained lines.theorem probability_prod (H : G.Holes h) {z : ℝ} (hz : 0 ≤ z) (hz' : z ≤ 1) : H.probability z = ∏ j, ∏ L, ∑ σ : {σ // H.LineCompatible j L σ}, lineLaw (G.bits j) z hz hz' σ.val := by …Mentions: OAI.CoordinateSweeps.lineLaw
- theorem
OAI.CoordinateSweeps.Grid.Holes.card_onLineline 692 - def
OAI.CoordinateSweeps.Grid.Holes.lineCardsline 699 - def
OAI.CoordinateSweeps.Grid.Holes.lineInputline 703 - def
OAI.CoordinateSweeps.Grid.Holes.lineOutputline 707 - theorem
OAI.CoordinateSweeps.Grid.Holes.lineCompatible_iff_assignmentsline 711 - theorem
OAI.CoordinateSweeps.Grid.Holes.sum_subtype_eq_sum_ite_of_iffline 723 - theorem
OAI.CoordinateSweeps.Grid.Holes.lineProbability_eqline 734 - theorem
OAI.CoordinateSweeps.Grid.Holes.probability_eq_assignmentsline 740 - theorem
OAI.CoordinateSweeps.Grid.Holes.probability_zeroline 752Source comment
Under uniform line randomization each prescribed injection pays exactly one falling-factorial denominator.theorem probability_zero (H : G.Holes h) : H.probability 0 = ∏ j, ∏ L, (((2 ^ G.bits j).descFactorial (H.lineCount j L) : ℝ)⁻¹) := by …