OAI/Computability/MaxCut/Machines/SelectorMachine.lean
59 declarations, 0 contain sorry, 0 declared as axioms
Reusable inherited-row execution with actual cleanup
Five concrete drain loops remove the query delimiter, unread scan suffix, raw reverse field, computed reverse field, and copied relation. With initially empty work tapes, the only final tape change is the appended output row. The index on tape zero and input table on tape one are both preserved.
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.selectionSteps_leline 12 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.selectorMachineline 33 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.selectionInTimeline 44 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorTapesline 65Source documentation
The fixed core rotor roles use the agreed reusable 27-tape frame.
def coreRotorTapes : Fin 8 → CoreTape := ![3, 7, 10, 11, 12, 9, 13, 14]
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreTape
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreFinishTapesline 68Source documentation
Tail, selected destination, return port, scratch and emitted row fields.
def coreFinishTapes : Fin 8 → CoreTape := ![1, 15, 14, 9, 24, 25, 26, 8]
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreTape
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectTapeline 70 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectViewline 88 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectView_leftline 97 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectView_rightline 105 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleanupTapeline 110 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorStateEquivline 112 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectStateEquivline 121 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreAfterCleanupline 128 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInstructionline 133Source documentation
The whole internal-row program has only fixed q and p in its code.
def coreInstruction (q : Nat) (positive : 0 < q) (p : Fin q) (labels : CoreLabel q → Λ) (exit : Option Λ) : CoreLabel q → TM2.Stmt (fun _ : CoreTape => Bool) Λ (CoreState σ q) | .rotor stage => MachineStateEquiv.statement (coreRotorStateEquiv σ q) (rotorInstruction q positive p coreRotorTapes (fun l => labels (.rotor l)) (some (labels (.select (.inr (.compare .scan))))) stage) | .select stage => MachineCloudPadding.Placement.statement coreSelectTape (fun l => labels (.select l)) (some (labels (.finish .seedReturn))) (MachineStateEquiv.statement (coreSelectStateEquiv σ q) (selectProgram stage)) | .finish stage => finishInstruction q coreFinishTapes (fun l => labels (.finish l)) (some (labels (.cleanup 0))) stage | .cleanup i => MachineDrain.drain (coreCleanupTape i) (labels (.cleanup i)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreLabel, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreTape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreState, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statement, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorStateEquiv, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.rotorInstruction, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorTapes, OAI.MaxCutGames.Foundations.Complexity.MachineCloudPadding.Placement.statement, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectTape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectStateEquiv, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.selectProgram, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.finishInstruction, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreFinishTapes, OAI.MaxCutGames.Foundations.Complexity.MachineDrain.drain, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleanupTape
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInitialStateline 147 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreMachineline 151 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreMemoryline 162 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreMemory_update_outputline 168 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorTapes_injectiveline 176 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreFinishTapes_injectiveline 180 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleanedline 184 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleanupStepsline 189 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleanupTraceline 194 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleaned_memoryline 271 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreCleanupSteps_memoryline 279 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorFinalFrameline 291 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreRotorTraceline 307 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectFrameline 353 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSelectionTraceline 362 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreFinishTraceline 397 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInputTapesline 429 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreStepsline 439 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreTraceline 456Source documentation
One full actual internal row of the serialized regularization, including the physical rotor lookup, both destination cases, full equality predicate, row append and complete reusable cleanup frame.
theorem coreTrace (q : Nat) (positive : 0 < q) (p : Fin q) (labels : CoreLabel q → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : CoreTape => Bool) Λ (CoreState σ q)) (code : ∀ l, program (labels l) = coreInstruction q positive p labels exit l) (t : GraphTables.Table) (padding : Fin t.vertices → Nat) (tables : ∀ v, ExpanderTables.Table (PreprocessingCloudIndex.cloudSize t v + padding v) q) (v : Fin t.vertices) (x : PreprocessingCloudIndex.PaddedCloud t padding v) (output : List Bool) (ambient : σ) : (advance (TM2.step program))^[coreSteps t padding tables v x p output.length] (some ⟨some (labels (coreEntry q)), coreInitialState q positive ambient, coreInputTapes t padding tables v x output⟩) = some ⟨exit, coreInitialState q positive ambient, …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreLabel, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreTape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.CoreState, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInstruction, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSteps, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreEntry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInitialState, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInputTapes
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.selectedIndex_leline 505Source documentation
A selected original dart is below the original dart count; a dummy target is the old-dart count plus its physical prefix and local remainder.
theorem selectedIndex_le (t : GraphTables.Table) (padding : Fin t.vertices → Nat) (v : Fin t.vertices) (i : Fin (PreprocessingCloudIndex.cloudSize t v + padding v)) : PreprocessingInternalRows.selectedIndex t padding v i ≤ t.darts + PreprocessingPaddingOffsets.offset padding v.val + i.val := by … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.encodedDrop_length_leline 516 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.rotorSize_le_encodedLengthline 524Source documentation
Every rotor entry occupies at least its delimiter on the physical tape.
theorem rotorSize_le_encodedLength {n q : Nat} (positive : 0 < q) (table : ExpanderTables.Table n q) : n ≤ (encodeWords (ExpanderTableWords.rotationWords table)).length := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.encodeWords
- def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreTimeBoundline 534Source documentation
For fixed cloud degree q this is affine in the lengths and unary values on the actual input tapes. All relation/cleanup constants are included.
def coreTimeBound (q graphLength rotorLength x v i k o m outputLength : Nat) : Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreSteps_leline 538 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreMachineInTimeline 604Source documentation
The concrete finite machine executes the actual internal row in the proved affine budget and returns the reusable clean frame.
def coreMachineInTime (q : Nat) (positive : 0 < q) (t : GraphTables.Table) (padding : Fin t.vertices → Nat) (tables : ∀ v, ExpanderTables.Table (PreprocessingCloudIndex.cloudSize t v + padding v) q) (v : Fin t.vertices) (x : PreprocessingCloudIndex.PaddedCloud t padding v) (p : Fin q) (output : List Bool) : StateTransition.EvalsToInTime (coreMachine q positive p).step ⟨some (coreEntry q), coreInitialState q positive (), coreInputTapes t padding tables v x output⟩ (some ⟨none, coreInitialState q positive (), coreInputTapes t padding tables v x (output ++ encodeWords (GraphTables.rowWords (PreprocessingInternalRows.row t padding tables v x p)))⟩) (coreTimeBound q (GraphTables.tableBits t).length (encodeWords (ExpanderTableWords.rotationWords (tables v))).length (PreprocessingRegularTables.vertexOrder t padding x.val).val v.val …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreMachine, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreEntry, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInitialState, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreInputTapes, OAI.MaxCutGames.Foundations.Complexity.encodeWords, OAI.MaxCutGames.Foundations.Complexity.MachineRegularInternalRow.coreTimeBound
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Tapeline 639 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Alphabetline 640 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Stateline 641 - inductive
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Labelline 643 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.instructionline 648 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.cleanupTapesline 658 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.cleanupStepsline 662 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.join_trace_inline_MachineRegularOriginalCleanline 666 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.cleanupTraceAtline 670 - structure
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Inputline 704 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.cleanup_frameline 709 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.suffix_length_leline 723 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.cleanupSteps_eqline 733 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.cleanupSteps_leline 777 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.stepsline 791 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.timeBoundline 795 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.steps_leline 798 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.traceAtline 806 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.machineline 825 - def
OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.machineInTimeline 837Source documentation
Exact inherited-row emission with all working tapes restored to empty.
def machineInTime (H : BaseTable) (t : Table) (e : Fin t.darts) (base : Tape → List Bool) (input : Input t e base) (register : Option Bool) : StateTransition.EvalsToInTime (machine internalDegree).step ⟨some (.row (.lookup .seed)), (((), MachineRegularOriginalRow.zeroBuffer), register), base⟩ (some ⟨none, (((), MachineRegularOriginalRow.zeroBuffer), none), Function.update base (9 : Tape) (base (9 : Tape) ++ encodeWords (rowWords (MachineRegularOriginalRow.inheritedRow H t e)))⟩) (timeBound internalDegree (tableBits t).length (base (9 : Tape)).length) where …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Tape, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.Input, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.machine, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalRow.zeroBuffer, OAI.MaxCutGames.Foundations.Complexity.encodeWords, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalRow.inheritedRow, OAI.MaxCutGames.Foundations.Complexity.MachineRegularOriginalClean.timeBound