OAI/Computability/MaxCut/Machines/MachineSubdivisionDynamicRows.lean
88 declarations, 0 contain sorry, 0 declared as axioms
Four-edge subdivision row emission with a physical permutation-table field.
The program depends only on the fixed identity table. Five saved endpoint words
and the entire final forward permutation table are physical tape contents. In
particular an input-dependent permutation is not inserted into a program label
or literal instruction. The last row is oriented v → r; for binary-vector
translations its table equals the inverse table of the original u → v edge.
- def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.rowsline 28Source documentation
The last table is the actual table for the left-to-right
v → rrow.def rows {n q : Nat} (vertices : Fin 5 → Fin n) (p : PermutationTable q) : List (Constraint n q) := … - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.tokensline 35 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.tokens_lengthline 41 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.fieldsline 44 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.rowBitsline 50 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.templateOutput_rowsline 53 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.fieldline 62Source documentation
Six preserved fields, scratch, and a reversed-output accumulator.
def field (j : Fin 6) : Fin 8 := ⟨j.val, by omega⟩
- def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.scratchline 64 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.outputline 65 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.field_ne_scratchline 67 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.field_ne_outputline 73 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.scratch_ne_outputline 79 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.machineline 81 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.machine_finiteAlphabetline 92 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.phaseInTimeline 99Source documentation
Literal execution of the fixed program; all six input fields are preserved.
def phaseInTime (identity : List Bool) (base : Fin 8 → List Bool) (emptyScratch : base scratch = []) (state : MachineFieldTemplate.State Unit) : StateTransition.EvalsToInTime (machine identity).step ⟨some (MachineFieldTemplate.startAt (tokens identity).length 0), state, base⟩ (some ⟨none, MachineFieldTemplate.reset state, MachineFieldTemplate.outputTapes base output (MachineFieldTemplate.templateOutput (tokens identity) (fun j => base (field j)))⟩) (3 * MachineFieldTemplate.copiedLength (tokens identity) (fun j => base (field j)) + 37) := by …Mentions: OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.scratch, OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.machine, OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.tokens, OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.output, OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.field
- theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.phase_budgetline 116Source documentation
The variable permutation table is read once; vertex words are read according to their explicit occurrences in the four rows.
theorem phase_budget (identity : List Bool) (base : Fin 8 → List Bool) : 3 * MachineFieldTemplate.copiedLength (tokens identity) (fun j => base (field j)) + 37 = 3 * ((base (field 0)).length + 2 * (base (field 1)).length + 2 * (base (field 2)).length + 2 * (base (field 3)).length + (base (field 4)).length + (base (field 5)).length) + 37 := by …Mentions: OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.tokens, OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.field
- theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.translation_inverseline 126Source documentation
The inverse table of a binary translation is literally the same table.
theorem translation_inverse {s : Nat} (a b : MaxCutGames.Integration.BinaryLinear.Vector s) : inverseTable (Encoding.translationTable a b) = Encoding.translationTable a b := rfl - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.translation_rowsline 132Source documentation
Therefore the dynamic emitter serializes the same left-to-right rows as the general subdivision emitter, including the reversed final edge.
theorem translation_rows {n s : Nat} (vertices : Fin 5 → Fin n) (a b : MaxCutGames.Integration.BinaryLinear.Vector s) : rows vertices (Encoding.translationTable a b) = MachineSubdivisionRows.rows vertices (Encoding.translationTable a b) := by …Mentions: OAI.MaxCutGames.Integration.BinaryLinear.Vector, OAI.MaxCutGames.Explicit.MachineSubdivisionDynamicRows.rows, OAI.MaxCutGames.Explicit.MachineSubdivisionRows.rows
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.Alphabetline 153 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardline 157Source documentation
A single finite statement: inspect the counter, decrement a positive counter, and jump to the body or exit. The zero delimiter is never consumed.
def guard (counter : K) (bodyLabel exitLabel : Λ) : TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.Alphabet
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapesline 166Source documentation
An arbitrary caller frame with one tape holding the unary counter and its unread suffix. Only this tape depends on the counter value.
def counterTapes (counter : K) (base : K → List Bool) (n : Nat) (suffix : List Bool) : K → List Bool := … - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes_counterline 170 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes_otherline 175 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardPushBoundline 181 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.stepAux_succline 187Source documentation
Positive counters lose exactly one true bit; the delimiter and suffix remain. Ambient state, unrelated tapes, and labels are accounted for explicitly.
theorem stepAux_succ (counter : K) (bodyLabel exitLabel : Λ) (base : K → List Bool) (n : Nat) (suffix : List Bool) (ambient : σ) (register : Option Bool) : TM2.stepAux (guard counter bodyLabel exitLabel) (ambient, register) (counterTapes counter base (n + 1) suffix) = ⟨some bodyLabel, (ambient, none), counterTapes counter base n suffix⟩ := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guard, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.stepAux_zeroline 196Source documentation
A zero counter is inspected without removing its delimiter.
theorem stepAux_zero (counter : K) (bodyLabel exitLabel : Λ) (base : K → List Bool) (suffix : List Bool) (ambient : σ) (register : Option Bool) : TM2.stepAux (guard counter bodyLabel exitLabel) (ambient, register) (counterTapes counter base 0 suffix) = ⟨some exitLabel, (ambient, none), counterTapes counter base 0 suffix⟩ := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guard, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.counterTapes
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardStep_succline 204 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardStep_zeroline 216 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardTrace_succline 229Source documentation
The positive branch executes in exactly one transition of the ambient program.
theorem guardTrace_succ (counter : K) (guardLabel bodyLabel exitLabel : Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.Alphabet
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardTrace_zeroline 242 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardInTime_succline 254 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryCounter.guardInTime_zeroline 269 - inductive
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Tapeline 293 - abbrev
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Tape.enumListline 300 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Tape.enumList_getElem?_ctorIdx_eqline 304 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Tape.enumList_nodupline 308 - instance
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.(instance at line 310)line 310 - abbrev
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Stateline 314 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.initialStateline 316 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.headerFieldline 318 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.rowFieldline 323 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.rowTokensline 331 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.headerTokensline 334 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.newHeaderFieldline 337 - structure
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.InitOpline 343Source documentation
Nine fixed affine passes initialize headers, the loop counter, and all three private vertex indices.
nonemeans accumulate into the existing unary word.structure InitOp where …
- def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.initOpline 349 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.clearKeysline 360 - inductive
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Labelline 365 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.headerNextline 381 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.initNextline 384 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.rowEntryline 388 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.programline 393Source documentation
A fixed finite program: the table reader counts only
qdelimiters in finite control, while all unbounded integers are physical unary tape contents.def program (q : Nat) : Label q → TM2.Stmt (fun _ : Tape => Bool) (Label q) State | .headerStart i => SourceMachine.fieldStart (headerField i) (.headerRead i) | .headerRead i => SourceMachine.fieldLoop .input (headerField i) (.headerRead i) (some (headerNext i)) | .initialize i 0 => match (initOp i).seed with | some offset => MachineUnaryAffineAt.seed (initOp i).destination offset (.initialize i 1) | none => .goto (fun _ => .initialize i 1) | .initialize i 1 => MachineUnaryAffineAt.scan (initOp i).source .affineScratch (initOp i).destination (initOp i).coefficient (.initialize i 1) (.initialize i 2) | .initialize i 2 => MachineTransfer.loopAt .affineScratch (initOp i).source id false (.initialize i 2) (some (initNext i)) …Mentions: OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Label, OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.Tape, OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.State, OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.headerField, OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.headerNext, OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.initOp, OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.initNext
- def
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.machineline 437 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.machine_finiteAlphabetline 448 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.rowField_injectiveline 454 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.clearKeys_coversline 458 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.accumulator_not_mem_clearKeysline 462 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionProgram.output_not_mem_clearKeysline 463 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.inputTapesline 476 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.afterVerticesline 479 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.afterAlphabetline 482 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.resultTapesline 486 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.initList_eqline 491 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.first_resultline 497 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.second_resultline 505 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.third_resultline 513 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.headersInTimeline 523Source documentation
The input headers are consumed literally; all unread constraint bits retain their original order and no tape contains an implicit runtime number.
def headersInTime (q n Q : Nat) (body : List Bool) : StateTransition.EvalsToInTime (machine q).step (initList (machine q) (encodeWords [n, q, Q] ++ body)) (some ⟨some (.initialize 0 0), initialState, resultTapes n q Q body⟩) (n + q + Q + 6) := by …Mentions: OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.resultTapes
- theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.headers_budgetline 557 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.source_ne_scratchline 574 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.source_ne_destinationline 577 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.scratch_ne_destinationline 580 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.priorWordline 583 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.operationTraceline 588 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.sourceValueline 635 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.beforeValueline 646 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.afterValueline 657 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.frameline 660 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.frame_sourceline 667 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.frame_scratchline 672 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.frame_destinationline 676 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.atStageline 682 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.initNext_eq_atStageline 686 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.stageCostline 690 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.sourceValue_leline 692 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.prefixInTimeline 695 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.resultTapesline 737 - theorem
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.final_frameline 751 - def
OAI.MaxCutGames.Explicit.MachineSubdivisionInit.initializeInTimeline 761Source documentation
The actual initialized loop counters and fresh numeric vertex IDs are proved outputs of unary arithmetic, including the runtime vertex header.
def initializeInTime (q n Q : Nat) (body : List Bool) : StateTransition.EvalsToInTime (machine q).step ⟨some (.initialize 0 0), initialState, MachineSubdivisionHeaders.resultTapes n q Q body⟩ (some ⟨some (.emitHeader (MachineFieldTemplate.startAt (headerTokens q).length 0)), initialState, resultTapes n q Q body⟩) (9 * stageCost n Q) := by …Mentions: OAI.MaxCutGames.Explicit.MachineSubdivisionHeaders.resultTapes, OAI.MaxCutGames.Explicit.MachineSubdivisionInit.resultTapes, OAI.MaxCutGames.Explicit.MachineSubdivisionInit.stageCost