OAI/Computability/MaxCut/Machines/Lookup.lean
84 declarations, 0 contain sorry, 0 declared as axioms
The finite registers and physical tape roles of the alphabet-table machine. Input-sized numbers occur only on unary tapes. The comparison and emitter register layouts are related by explicit, executable product rearrangements.
- abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabetline 14 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.skipBitsline 19Source documentation
A fixed finite chain skips Boolean unary words. A true head causes one additional delimiter pop; a false head is already the complete zero word. Only the one-bit head register is examined.
def skipBits (source : K) : Nat → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) → …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.stepAux_skipBitsline 30 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.stepAux_skipBits_fromTapesline 47 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.skipBits_pushBoundline 61 - inductive
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Labelline 69 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label.enumListline 73 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label.enumList_getElem?_ctorIdx_eqline 76 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label.enumList_nodupline 80 - instance
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.(instance at line 82)line 82 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.statementline 88Source documentation
Six fixed control labels implement row selection.
qfixes the finite predicate parser; no data-dependent number is placed in the program syntax.def statement (q : Nat) (counter source destination : K) (labels : Label → Λ) (exit : Option Λ) : Label → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabet
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.programline 97 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowBitsline 101 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowBits_eqline 103 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowsBitsline 108 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowsBits_nilline 111 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowsBits_consline 113 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.skipCostline 117 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.prefixCostline 120 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookupCostline 123 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.skipRowTraceline 137Source documentation
One skipped row: two actual unary scans followed by one finite predicate statement. All registers are reset and every other tape is untouched.
theorem skipRowTrace (base : K → List Bool) (row : DartRow q n m) (suffix : List Bool) (ambient : σ) (register : Option Bool) : (advance (TM2.step P))^[row.tail.val + row.reverseIndex.val + 3] (some ⟨some (labels .skipTail), (ambient, register), Function.update base source (rowBits row ++ suffix)⟩) = some ⟨some (labels .guard), (ambient, none), Function.update base source suffix⟩ := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowBits
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.skipRowTrace_fromTapesline 166 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.selectTraceline 180 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookupTailTraceline 200Source documentation
Exact successful row lookup. The only data premise is the literal table prefix; no lookup result or whole execution is postulated.
theorem lookupTailTrace (hcs : counter ≠ source) (hcd : counter ≠ destination) (hsd : source ≠ destination) (base : K → List Bool) (prior : List (DartRow q n m)) (row : DartRow q n m) (counterSuffix suffix output : List Bool) (ambient : σ) (register : Option Bool) : (advance (TM2.step P))^[lookupCost prior row] (some ⟨some (labels .guard), (ambient, register), MachineLookup.tapes counter source destination base (encodeWord prior.length ++ counterSuffix) (rowsBits prior ++ (rowBits row ++ suffix)) output⟩) = some ⟨exit, (ambient, none), MachineLookup.tapes counter source destination base (encodeWord 0 ++ counterSuffix) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookupCost, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowsBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowBits
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookupCost_leline 270Source documentation
The number of actual transitions is linear in the scanned encoding and the unary row index. Fixed predicate statements contribute one transition.
theorem lookupCost_le {q n m : Nat} (prior : List (DartRow q n m)) (row : DartRow q n m) : lookupCost prior row ≤ (rowsBits prior ++ rowBits row).length + 2 * (encodeWord prior.length).length + 1 := by …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookupCost, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowsBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.rowBits
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookupTailInTimeline 290Source documentation
The exact row-selection trace packaged with its linear transition budget.
def lookupTailInTime {q n m : Nat} (counter source destination : K) (labels : Label → Λ) (exit : Option Λ) (P : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.tableTailTraceline 315Source documentation
The input's actual stored row vector determines the selected row. This specialization derives the literal lookup prefix from the checked codec.
theorem tableTailTrace {q : Nat} (counter source destination : K) (labels : Label → Λ) (exit : Option Λ) (P : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.fullTableTailTraceline 350Source documentation
Two real delimiter-scanning loops remove the header of the copied table before the row counter starts. The protected original table can occupy any other tape in
baseand is unchanged.theorem fullTableTailTrace {q : Nat} (counter source destination : K) (labels : Label → Λ) (exit : Option Λ) (headerVertices headerDarts : Λ) (P : Λ → TM2.Stmt (Alphabet (K := K)) Λ (σ × Option Bool)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Label, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabet
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.lookup_frameline 390 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.tableTailCostline 396 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.tableTailCost_leline 400 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headIndexline 423 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headValueline 426 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headValue_eq_semanticsline 431Source documentation
The looked-up endpoint is the head of the actual graph semantics, including paired loop darts whose reverse index differs from their own index.
theorem headValue_eq_semantics {q : Nat} (table : Table q) (e : Fin table.darts) : headValue table e = ((semantics table).head e).val := rflMentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headValue
- abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.HeadTapesline 434 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headLookupTapesline 436 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headLookupCostline 445 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headLookupCost_leline 449 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headTimePolynomialline 458 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headLookupInTimeline 461 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headLookupTapes_headline 553 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.headLookupTapes_frameline 558 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowTapesline 564 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowTapes_sourceline 569 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowTapes_tailline 575 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowTapes_reverseline 581 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowTapes_frameline 587 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowCostline 593 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowCost_leline 596 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowCost_table_leline 603 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.readRowInTimeline 615Source documentation
Read both unary fields using actual copy loops, then execute the checked fixed predicate parser. Only the two field destinations must initially be empty; the cursor suffix and every unrelated tape are retained exactly.
def readRowInTime {q n m : Nat} (source tail reverse : K) (hst : source ≠ tail) (hsr : source ≠ reverse) (htr : tail ≠ reverse) (tailStart tailLoop reverseStart reverseLoop readLabel exitLabel : Λ) (P : Λ → TM2.Stmt (Alphabet (K := K)) Λ (ReadRelation.State σ q)) …Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.Alphabet, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.ReadRelation.State
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Lookup.machineline 701Source documentation
A concrete finite machine instance, with input-dependent unary values located only on its three tapes.
def machine (q : Nat) : FinTM2 where …
- inductive
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Tapeline 725 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Tape.enumListline 731 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Tape.enumList_getElem?_ctorIdx_eqline 735 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Tape.enumList_nodupline 739 - instance
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.(instance at line 741)line 741 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Alphabetline 745 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Flagsline 748Source documentation
Self-loop flag, comparison mismatch flag, and second head register.
abbrev Flags := Bool × Bool × Option Bool
- abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Ambientline 749 - abbrev
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Stateline 750 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.normalline 752 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.initialline 755 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.contextline 757 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.compareEquivline 760 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.compareEquiv_normalline 767 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.emitterEquivline 772 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.setupPortsline 778 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.setupPorts_injectiveline 781 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.headPortsline 785 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.headPorts_injectiveline 788 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.rowSourcesline 792 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.headerSourcesline 793 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.fieldPortsline 794 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.cleanupPortsline 796 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.cleanupPorts_ne_outputline 800 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.cleanupPorts_coverline 803 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.compareStatementline 825 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.emitterStatementline 830 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.storeLoopline 836Source documentation
Store the result chosen by the actual comparison's equal/different exit. This does not compare tape contents in a register transition.
def storeLoop (value : Bool) (next : Λ) : TM2.Stmt Alphabet Λ (State q) := …
Mentions: OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.Alphabet, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.State
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.stepAux_storeLoopline 839 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.nextRowline 844 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.stepAux_nextRowline 848 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.RuntimeModel.transportInTimeline 858Source documentation
One-step simulations transport complete timed executions through the explicit finite register permutations.
def transportInTime {K τ υ : Type} [DecidableEq K] {Γ : K → Type} (e : τ ≃ υ) (p : Λ → TM2.Stmt Γ Λ τ) {start finish : TM2.Cfg Γ Λ τ} {budget : Nat} (run : StateTransition.EvalsToInTime (TM2.step p) start (some finish) budget) : StateTransition.EvalsToInTime (TM2.step (MachineControl.program (Equiv.refl Λ) e p)) (MachineControl.configuration id e start) (some (MachineControl.configuration id e finish)) budget := by …