OAI/Computability/MaxCut/Machines/MachineSubroutine.lean
58 declarations, 0 contain sorry, 0 declared as axioms
Actual lookup from a preserved table. A fresh copy is prefixed to the scan stack before each access. The old scan suffix is retained and need not be cleared between accesses. No graph/table data occurs in finite control.
- def
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.labelline 12 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.configurationline 16 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.statementline 19 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.stepAux_simulationline 33 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.step_simulationline 54 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.traceline 70 - def
OAI.MaxCutGames.Foundations.Complexity.MachineSubroutine.executionline 80 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.Alphabetline 103 - def
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.initialTapesline 106Source documentation
Tape roles: original table, unary query, scan work, output, copy scratch.
def initialTapes (tape : Fin 5 → K) (base : K → List Bool) (index : Nat) (indexSuffix workSuffix output : List Bool) : K → List Bool := … - def
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.finalTapesline 111 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.lookupFramedHaltTrace_someline 118 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.preservingLookupTraceline 138Source documentation
Code-level interfaces specify the actual two copy loops and six lookup instructions in the caller's program. No execution premise is supplied.
theorem preservingLookupTrace (tape : Fin 5 → K) (distinct : Function.Injective tape) (firstLabel secondLabel : Λ) (lookupLabels : MachineLookup.Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineLookup.Label, OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.program, OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.preservingLookup_steps_leline 188 - def
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.preservingLookupInTimeline 196 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.Labelline 218 - def
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.programline 222 - def
OAI.MaxCutGames.Foundations.Complexity.MachinePreservingLookup.machineline 229 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.Alphabetline 249 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.Labelline 251 - def
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.instructionline 256 - def
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.stepsline 271 - def
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.finalTapesline 276 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.initialTapes_eq_updateline 281 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.affineLookupTraceline 303Source documentation
An exact trace for the actual composite instructions.
atLabelsspecifies the caller's finite program; there is no execution or runtime premise.theorem affineLookupTrace (source : K) (tape : Fin 5 → K) (distinct : Function.Injective tape) (outside : ∀ i, source ≠ tape i) (coefficient offset : Nat) (labels : Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.Label, OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.steps_leline 331 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.steps_le_tableline 339 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.finalTapes_otherline 346 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.finalTapes_outputline 352 - def
OAI.MaxCutGames.Foundations.Complexity.MachineAffineLookup.machineline 357 - abbrev
OAI.MaxCutGames.Explicit.MachineProductGather.Tapeline 388Source documentation
Shared original table, query, scan and copy scratch, then input coordinate fields and the corresponding gathered output fields.
abbrev Tape (width : Nat) := Fin 4 ⊕ (Fin width ⊕ Fin width)
- def
OAI.MaxCutGames.Explicit.MachineProductGather.shiftline 390 - theorem
OAI.MaxCutGames.Explicit.MachineProductGather.shift_injectiveline 393 - def
OAI.MaxCutGames.Explicit.MachineProductGather.lookupRoleline 397 - theorem
OAI.MaxCutGames.Explicit.MachineProductGather.lookupRole_injectiveline 404 - def
OAI.MaxCutGames.Explicit.MachineProductGather.Labelline 408 - instance
OAI.MaxCutGames.Explicit.MachineProductGather.labelFintypeline 412 - instance
OAI.MaxCutGames.Explicit.MachineProductGather.labelDecidableEqline 419 - def
OAI.MaxCutGames.Explicit.MachineProductGather.entryline 426 - def
OAI.MaxCutGames.Explicit.MachineProductGather.instructionline 430 - def
OAI.MaxCutGames.Explicit.MachineProductGather.stepsline 444 - def
OAI.MaxCutGames.Explicit.MachineProductGather.finalTapesline 451 - theorem
OAI.MaxCutGames.Explicit.MachineProductGather.finalTapes_otherline 461 - theorem
OAI.MaxCutGames.Explicit.MachineProductGather.gatherTraceline 476 - theorem
OAI.MaxCutGames.Explicit.MachineProductGather.finalTapes_fieldline 538Source documentation
Every output is the physically gathered unary field, with its old suffix preserved. This identifies the operands consumed by the Horner phase.
theorem finalTapes_field (values : List Nat) (coefficient width : Nat) (placement : Tape width → K) (distinct : Function.Injective placement) (indices offsets fields : Fin width → Nat) (base : K → List Bool) (i : Fin width) : finalTapes values coefficient width placement indices offsets fields base (placement (.inr (.inr i))) = encodeWord (fields i) ++ base (placement (.inr (.inr i))) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductGather.Tape, OAI.MaxCutGames.Explicit.MachineProductGather.finalTapes
- theorem
OAI.MaxCutGames.Explicit.MachineProductGather.steps_leline 573Source documentation
For fixed width, gather time is linear in the encoded table size plus coordinate magnitudes. Query and scan debris is never rescanned.
theorem steps_le (values : List Nat) (coefficient width magnitude : Nat) (indices offsets fields : Fin width → Nat) (selected : ∀ i, values[coefficient * indices i + offsets i]? = some (fields i)) (bounded : ∀ i, indices i ≤ magnitude) : steps values coefficient width indices offsets ≤ width * (2 * magnitude + 5 * (encodeWords values).length + 6) + 1 := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductGather.steps
- def
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.guardConfigurationline 610 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.bodyConfigurationline 616 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.exitConfigurationline 621 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.BodyTracesline 628Source documentation
The hypotheses are actual traces of the caller's body in the same program. Both endpoints have the same unary remainder and unread suffix.
def BodyTraces (counter : K) (guardLabel bodyLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) … - def
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.totalStepsline 638Source documentation
Exactly
nsupplied body blocks andn + 1concrete guard transitions.def totalSteps (cost : Nat → Nat) (n : Nat) : Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.totalSteps_zeroline 641 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.totalSteps_succline 644 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.loopTraceline 651Source documentation
The loop trace is derived by composing each actual unary guard transition with one supplied body trace. No whole-loop execution is assumed.
theorem loopTrace (counter : K) (guardLabel bodyLabel exitLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.totalSteps_leline 684 - def
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.loopInTimeline 696Source documentation
An actual timed execution witness with the exact composed step count.
def loopInTime (counter : K) (guardLabel bodyLabel exitLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.baseFrameline 717Source documentation
Chaining the caller's declared per-body frame equalities.
theorem baseFrame (base : Nat → K → List Bool) (frame : K → Prop) (n : Nat) (bodyFrame : ∀ r, r < n → ∀ k, frame k → base (r + 1) k = base r k) : ∀ k, frame k → base n k = base 0 k := by … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.counterFrameline 730Source documentation
Protected tapes are unchanged by the complete loop, including its guard steps. The counter itself is explicitly excluded from this frame.
theorem counterFrame (counter : K) (suffix : List Bool) (base : Nat → K → List Bool) (frame : K → Prop) (n : Nat) (counterOutside : ∀ k, frame k → k ≠ counter) (bodyFrame : ∀ r, r < n → ∀ k, frame k → base (r + 1) k = base r k) : ∀ k, frame k → counterTapes counter (base n) n suffix k = counterTapes counter (base 0) 0 suffix k := by … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineCountedLoop.loopTrace_framedline 742Source documentation
Actual loop execution and preservation of an arbitrary declared tape frame.
theorem loopTrace_framed (counter : K) (guardLabel bodyLabel exitLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …