OAI/Computability/UniqueGames/Machines/MachineTupleOdometer.lean
69 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabetline 15 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitTapesline 17 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.incrementline 21 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.resetline 30Source documentation
Reset conserves the digit's unary budget, then enters the next coordinate.
def reset (current remaining : K) (resetLabel carryLabel : Λ) : TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.incrementPushBoundline 35 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.resetPushBoundline 40 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.update_currentline 44 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.update_remainingline 55 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.stepAux_increment_succline 61 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.stepAux_increment_zeroline 71 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.incrementStep_succline 82Source documentation
A non-carrying digit increment is one actual ambient-program transition.
theorem incrementStep_succ (current remaining : K) (distinct : current ≠ remaining) (checkLabel doneLabel resetLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.incrementStep_zeroline 95 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.resetTraceline 108 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.carryTraceline 123Source documentation
Exhaustion costs one check plus the actual
d + 1-transition reset.theorem carryTrace (current remaining : K) (distinct : current ≠ remaining) (checkLabel doneLabel resetLabel carryLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitStepsline 145Source documentation
The exact step count for one digit, including its possible reset.
def digitSteps (d r : ℕ) : ℕ := if r = 0 then d + 2 else 1
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitTraceline 149Source documentation
The bounded digit operation follows actual transitions on both branches. It restores an exhausted digit to zero before returning the carry.
theorem digitTrace (current remaining : K) (distinct : current ≠ remaining) (checkLabel doneLabel resetLabel carryLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitSteps_leline 174 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitBudgetline 180 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitFrameline 186Source documentation
Every unrelated stack is preserved, including any separate stored radix or input bound. Both digit-stack suffixes are preserved by the trace itself.
theorem digitFrame (current remaining other : K) (notCurrent : other ≠ current) (notRemaining : other ≠ remaining) (base : K → List Bool) (d r : ℕ) (currentSuffix remainingSuffix : List Bool) : digitTapes current remaining base (if r = 0 then 0 else d + 1) (if r = 0 then d else r - 1) currentSuffix remainingSuffix other = digitTapes current remaining base d r currentSuffix remainingSuffix other := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitTapes
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.digitInTimeline 196Source documentation
A composable actual-time witness for any well-formed positive-radix digit.
def digitInTime (current remaining : K) (distinct : current ≠ remaining) (checkLabel doneLabel resetLabel carryLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.bodyConfigurationline 218 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.checkConfigurationline 226 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.cycleExitline 234 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.VisitTracesline 241 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.cycleStepsline 252 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.cycleSteps_zeroline 255 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.cycleSteps_succline 259 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.cycleTraceline 265 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.ascendingCycleInTimeline 302Source documentation
A full positive-radix cycle performs
nbody visits and exactly2*ncounter transitions. This bound comes from the composed actual execution.def ascendingCycleInTime (current remaining : K) (distinct : current ≠ remaining) (bodyLabel checkLabel resetLabel exitLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrderline 340 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrder_lengthline 343 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrder_dimension_zeroline 347Source documentation
Dimension zero visits the unique empty tuple once, even at radix zero.
theorem tupleOrder_dimension_zero (n : ℕ) : tupleOrder n 0 = [fun i => Fin.elim0 i] := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrder
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrder_radix_zeroline 355Source documentation
A positive-dimensional zero-radix loop has no tuples to visit.
theorem tupleOrder_radix_zero {q : ℕ} (hq : 0 < q) : tupleOrder 0 q = [] := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrder
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleRank_consline 361Source documentation
Coordinate zero is the least significant digit. This is the same radix rank used by
SourceOccurrences.Encoding.function.theorem tupleRank_cons {n q : ℕ} (d : Fin n) (tail : Fin q → Fin n) : (finFunctionFinEquiv (Fin.cons d tail)).val = d.val + n * (finFunctionFinEquiv tail).val := by … - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleRank_increment_lowestline 372 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleRank_carryline 381Source documentation
Resetting an exhausted low digit and incrementing the tail advances the same explicit tuple rank by one.
theorem tupleRank_carry {n q : ℕ} (hn : 0 < n) (d : Fin n) (tail tail' : Fin q → Fin n) (hmax : d.val = n - 1) (htail : (finFunctionFinEquiv tail').val = (finFunctionFinEquiv tail).val + 1) : (finFunctionFinEquiv (Fin.cons (⟨0, hn⟩ : Fin n) tail')).val = (finFunctionFinEquiv (Fin.cons d tail)).val + 1 := by … - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleRank_snocline 390 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.tupleOrder_snocline 397 - structure
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.CycleScheduleline 423Source documentation
Explicit caller state and tape endpoints for one level of the nested loop. Compatibility with its child schedules is checked by their types.
structure CycleSchedule (K σ : Type) where …
- abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Configurationline 430 - inductive
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycleline 437Source documentation
A finite nesting schedule. Only leaves supply actual emitter traces. Internal nodes supply concrete instruction placements and compatible endpoint schedules; their complete execution is derived below. Level
qoperates coordinateq, so coordinate zero is always the innermost loop.inductive NestedCycle (n : ℕ) (current remaining : ℕ → K) (bodyLabel : Λ) (checkLabel resetLabel : ℕ → Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) : …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.counterOverheadline 469Source documentation
Exact concrete-counter overhead for a complete positive-radix nesting.
def counterOverhead (n : ℕ) : ℕ → ℕ | 0 => 0 | q + 1 => n * (counterOverhead n q + 2) namespace NestedCycle variable {n : ℕ} {current remaining : ℕ → K} {bodyLabel : Λ} {checkLabel resetLabel : ℕ → Λ} {program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)}Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.stepsline 479 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.LeafBoundline 490Source documentation
Every supplied emitter leaf obeys its local time allowance. There is no whole-loop runtime premise at any internal node.
def LeafBound (B : ℕ) {depth : ℕ} {exitLabel : Λ} {start finish : Configuration K Λ σ} (tree : NestedCycle n current remaining bodyLabel checkLabel resetLabel program depth exitLabel start finish) : Prop := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Configuration, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.workline 499Source documentation
Sum of the actual supplied emitter costs, with no counter work included.
def work {depth : ℕ} {exitLabel : Λ} {start finish : Configuration K Λ σ} (tree : NestedCycle n current remaining bodyLabel checkLabel resetLabel program depth exitLabel start finish) : ℕ := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Configuration, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.reverseDigitline 507 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.reverseDigit_currentline 509 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.orderline 513 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.order_eq_tupleOrderline 523 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.order_lengthline 532 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.steps_eq_work_add_overheadline 537 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.traceline 563Source documentation
The whole nested-loop trace is derived from its actual leaf traces and the concrete increment/reset code.
theorem trace {depth : ℕ} {exitLabel : Λ} {start finish : Configuration K Λ σ} (tree : NestedCycle n current remaining bodyLabel checkLabel resetLabel program depth exitLabel start finish) : (MachineComposition.advance (TM2.step program))^[tree.steps] (some start) = some finish := by …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Configuration, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineComposition.advance
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.steps_leline 579 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.inTimeline 609Source documentation
An actual-time certificate for the complete fixed-dimensional schedule.
def inTime {depth : ℕ} {exitLabel : Λ} {start finish : Configuration K Λ σ} (tree : NestedCycle n current remaining bodyLabel checkLabel resetLabel program depth exitLabel start finish) (B : ℕ) (bounded : tree.LeafBound B) : StateTransition.EvalsToInTime (TM2.step program) start (some finish) (n ^ depth * B + counterOverhead n depth) where …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Configuration, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.counterOverhead
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.counterOverhead_leline 621 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.NestedCycle.steps_le_powerline 642 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.entryline 656Source documentation
The actual entry guard bypasses an empty positive-dimensional Cartesian product. Dimension zero always enters its one empty-tuple emitter.
def entry (q : ℕ) (radix : K) (bodyLabel exitLabel : Λ) : TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) := …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.entryStep_dimension_zeroline 666 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.entryStep_radix_zeroline 676 - theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.entryStep_radix_positiveline 688 - abbrev
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.Labelline 707Source documentation
Two labels per coordinate, plus start, body, and exit labels.
abbrev Label (q : ℕ) := Fin q ⊕ (Fin q ⊕ Option Bool)
- def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.startline 709 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.bodyline 710 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.exitline 711 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.checkline 712 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.resetLabelline 713 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.carryline 715 - def
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.programline 720Source documentation
A fixed finite controller. Its only unspecified instruction is the emitter body, whose actual leaf traces are supplied to
NestedCycle.def program (q : ℕ) (current remaining : Fin q → K) (radix : K) (emitter : TM2.Stmt (Alphabet (K := K)) (Label q) (σ × Option Bool)) : …Mentions: OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Alphabet, OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.Label
- theorem
OAI.UniqueGamesTheorem.Foundations.Complexity.MachineTupleOdometer.Control.label_cardline 730