OAI/Computability/MaxCut/Machines/Body.lean
60 declarations, 0 contain sorry, 0 declared as axioms
One actual iteration of the alphabet-table driver. The positive unary guard,
row parser, preserving head lookup, comparison, finite emission plan, three
drains, and unary index increment all execute inside Driver.program.
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.bodyTimeline 20 - structure
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.RowStepResultline 24Source documentation
An execution witness, with the exact invariant needed by the next guard.
structure RowStepResult (input : GenericGraphTables.Table q) (e : Fin input.darts) (base : Tape → List Bool) (oldRelation : GenericGraphTables.RelationTable q) (oldFlag : Bool) where …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.RelationTable
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.guardTapesline 34 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.parsedTapesline 38 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapesline 43 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.emittedTapesline 47 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.clearFieldsTapesline 52 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.resultTapesline 56Source documentation
Exact final tapes, including the lookup's retained scan suffixes.
def resultTapes (input : GenericGraphTables.Table q) (e : Fin input.darts) (base : Tape → List Bool) : Tape → List Bool := …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapes_other_inline_Bodyline 61 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapes_counter_inline_Bodyline 71 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapes_cursor_inline_Bodyline 77 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapes_tail_inline_Bodyline 83 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapes_reverse_inline_Bodyline 89 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingTapes_head_inline_Bodyline 95 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.clearFieldsInTimeline 103Source documentation
The three cleanup phases are actual drains in the concrete program.
def clearFieldsInTime (base : Tape → List Bool) (ambient : Ambient q) : StateTransition.EvalsToInTime (TM2.step (Driver.program q)) ⟨some (.clearField 0), (ambient, none), base⟩ (some ⟨some .increment, (ambient, none), clearFieldsTapes base⟩) ((base .tail).length + (base .reverseIndex).length + (base .head).length + 3) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.clearFieldsTapes
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.incrementInTimeline 125 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.emitterView_at_inline_Bodyline 140 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.context_rowState_inline_Bodyline 150 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.emitInTimeline 160Source documentation
Execute the actual emitted row block through the finite register equivalence.
def emitInTime (input : GenericGraphTables.Table q) (e : Fin input.darts) (base : Tape → List Bool) (operands : ∀ i, base (rowSources i) = encodeWord (EmitRows.rowValues input e i)) (scratchEmpty : base .scratch = []) : StateTransition.EvalsToInTime (TM2.step (Driver.program q)) ⟨some (Driver.rowEntry q), CompareLoop.rowState input e, base⟩ (some ⟨some (.clearField 0), CompareLoop.rowState input e, Emitter.resultTapes .reversed base (encodeWords (EmitRows.blockWords input e))⟩) (Enumeration.localCount q * (6 * (2 * 4104)) * (3 * ((LoopState.inputBits input).length + 1) + 3) + 1) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.rowValues, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.rowEntry, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.CompareLoop.rowState, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Emitter.resultTapes, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.EmitRows.blockWords, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Enumeration.localCount, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.inputBits
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.result_ready_inline_Bodyline 198 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.workingOperands_inline_Bodyline 209 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.rowStepline 221Source documentation
Execute a whole row iteration from the exact guard invariant. Every run below is obtained from the concrete code at its component labels.
def rowStep (input : GenericGraphTables.Table q) (e : Fin input.darts) (base : Tape → List Bool) (ready : LoopState.Ready input e.val base) (oldRelation : GenericGraphTables.RelationTable q) (oldFlag : Bool) : RowStepResult input e base oldRelation oldFlag := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.RelationTable, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Body.RowStepResult
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.inputTapesline 351 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.rowsBitsline 355 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.headerBitsline 358 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.setupTapesline 362 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.loopTapesline 371Source documentation
Complete initial loop state. Every auxiliary tape not listed here is empty.
def loopTapes (input : GenericGraphTables.Table q) : Tape → List Bool | .original => GenericGraphTables.tableBits input | .cursor => rowsBits input | .vertices => encodeWord input.vertices | .darts | .counter => encodeWord input.darts | .edge => encodeWord 0 | .reversed => (headerBits input).reverse | _ => []
Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.tableBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.rowsBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.headerBits
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.loopStartline 380 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.setupResult_eqline 384 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.headerResult_eqline 390 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.machineInitial_eqline 395 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.setupInTimeline 406Source documentation
The driver executes its actual setup statements from its actual input configuration.
def setupInTime (input : GenericGraphTables.Table q) : StateTransition.EvalsToInTime (TM2.step (Driver.program q)) (initList (Driver.machine q) (GenericGraphTables.tableBits input)) (some ⟨some (Driver.headerEntry q), initial q, setupTapes input⟩) (6 * (GenericGraphTables.tableBits input).length + 11) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machine, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.tableBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.headerEntry, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.setupTapes
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.headerView_at_inline_Initializationline 425 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.headerInTimeline 437Source documentation
No header execution is assumed: the checked template is instantiated at the concrete driver labels and transported through the finite state layout.
def headerInTime (input : GenericGraphTables.Table q) : StateTransition.EvalsToInTime (TM2.step (Driver.program q)) ⟨some (Driver.headerEntry q), initial q, setupTapes input⟩ (some (loopStart input)) (7 * (3 * ((GenericGraphTables.tableBits input).length + 1) + 3) + 1) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.headerEntry, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.setupTapes, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.loopStart, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.tableBits
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.timeline 475 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.time_eqline 477 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.initializeInTimeline 483Source documentation
Actual initialization of the complete finite driver, ending at its first guard with the exact input, counter, cursor, index, and reversed headers.
def initializeInTime (input : GenericGraphTables.Table q) : StateTransition.EvalsToInTime (TM2.step (Driver.program q)) (initList (Driver.machine q) (GenericGraphTables.tableBits input)) (some (loopStart input)) (time (GenericGraphTables.tableBits input).length) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machine, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.tableBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.loopStart, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.time
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopInitialization.initialization_readyline 509Source documentation
The actual initial loop tapes contain the complete unread input rows and exactly the two output headers in reverse order on the accumulation tape.
theorem initialization_ready {q : Nat} (input : GenericGraphTables.Table q) : Ready input 0 (Initialization.loopTapes input) where …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Initialization.loopTapes
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.zeroGuardInTimeline 545Source documentation
The zero guard preserves all tapes, resets its temporary register, and enters the actual driver's output-reversal phase in one transition.
def zeroGuardInTime (input : GenericGraphTables.Table q) (base : Tape → List Bool) (ready : LoopState.Ready input input.darts base) (relation : GenericGraphTables.RelationTable q) (flag : Bool) : StateTransition.EvalsToInTime (TM2.step (Driver.program q)) ⟨some .guard, normal relation flag, base⟩ (some ⟨some .reverseOutput, normal relation flag, base⟩) 1 := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.LoopState.Ready, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.RelationTable, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.program
- structure
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.LoopResultline 560Source documentation
Concrete final configuration and full remaining-loop execution.
structure LoopResult (input : GenericGraphTables.Table q) (e remaining : Nat) (base : Tape → List Bool) (oldRelation : GenericGraphTables.RelationTable q) (oldFlag : Bool) where …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.RelationTable
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.runRemainingline 572 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.prefixTimeline 606Source documentation
A quadratic prefix allowance because the number of original rows is at most the length of their fully encoded input table.
def prefixTime (q N : Nat) : Nat := …
- structure
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.PrefixResultline 623Source documentation
Actual initialization followed by every row, ending just before reversal.
structure PrefixResult (input : GenericGraphTables.Table q) where …
Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.runPrefixline 635Source documentation
No initialization or row trace is assumed: both are instantiated at this actual finite driver and this input, then composed.
def runPrefix (input : GenericGraphTables.Table q) : PrefixResult input := by …
Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.PrefixResult
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.PrefixResult.reversedline 658 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Loop.PrefixResult.outputline 662 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.afterReversalline 678 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.afterReversal_outputline 681 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.afterReversal_reversedline 685 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.finishBudgetline 689 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.reverseInTimeline 693Source documentation
The actual driver's reversal loop enters its first cleanup label.
def reverseInTime (q : Nat) (base : Tape → List Bool) (word : List Bool) (state : State q) (hreversed : base .reversed = word.reverse) (houtput : base .output = []) : StateTransition.EvalsToInTime (Driver.machine q).step ⟨some .reverseOutput, state, base⟩ (some ⟨some (.cleanup 0), (state.1, none), afterReversal base word⟩) (word.length + 1) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machine, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.afterReversal
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.cleared_eq_haltListline 707 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.cleanupInTimeline 716Source documentation
All remaining driver stacks are actually popped, and the exact initial finite state is restored before the halting configuration is reached.
def cleanupInTime (q : Nat) (base : Tape → List Bool) (state : State q) : StateTransition.EvalsToInTime (Driver.machine q).step ⟨some (.cleanup 0), state, base⟩ (some (haltList (Driver.machine q) (base .output))) ((∑ i : Fin 15, (base (cleanupPorts i)).length) + 16) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machine
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.finishInTimeline 732 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.afterReversal_selected_length_leline 753 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.stackLength_after_prefixline 761Source documentation
Every stack bound here is derived from the actual preceding driver trace.
theorem stackLength_after_prefix (q : Nat) (input : List Bool) (base : Tape → List Bool) (state : State q) (budget : Nat) (prefixRun : StateTransition.EvalsToInTime (Driver.machine q).step (initList (Driver.machine q) input) (some ⟨some .reverseOutput, state, base⟩) budget) (k : Tape) : (base k).length ≤ input.length + budget * Runtime.programPushBound (Driver.machine q) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machine
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.finishBudget_le_of_prefixline 773 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.completedPolynomialline 797Source documentation
A polynomial time allowance for the whole prefixRun followed by actual reversal and cleanup. The fixed push bound belongs to the concrete driver.
noncomputable def completedPolynomial (q : Nat) (prefixTime : Polynomial Nat) : Polynomial Nat := …
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.finishAfterPrefixline 802 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Finish.finishAfterPolynomialPrefixline 818