OAI/Computability/MaxCut/Machines/Runtime2.lean
99 declarations, 0 contain sorry, 0 declared as axioms
Every work tape of the actual alphabet-table machine stores Bool symbols. This checks the work alphabets separately from the finite-machine structure's input-alphabet condition, without changing the runtime certificate.
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.prefixPolynomialline 12 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.prefixPolynomial_evalline 18 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.timeline 25 - def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.tableOutputsInTimeline 29Source documentation
The concrete driver outputs exactly the checked table encoding.
noncomputable def tableOutputsInTime {q : Nat} (input : GenericGraphTables.Table q) : TM2OutputsInTime (Driver.machine q) (GenericGraphTables.tableBits input) (some (GraphTables.tableBits (Table.build input))) ((time q).eval (GenericGraphTables.tableBits input).length) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.Table, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.machine, OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.tableBits, OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBits, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Table.build, OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.time
- def
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.tablePolynomialTimeline 47Source documentation
Fixed q determines one finite machine and one natural polynomial. The input and output alphabets use the exact shared Bool serialization interfaces.
noncomputable def tablePolynomialTime (q : Nat) : TM2ComputableInPolyTime (GenericGraphTables.tableBits (q := q)) …Mentions: OAI.MaxCutGames.Foundations.PCP.GenericGraphTables.tableBits
- theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Driver.finiteAlphabetline 74 - theorem
OAI.MaxCutGames.Foundations.PCP.AlphabetTable.Runtime.finiteAlphabetline 80 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statementline 104Source documentation
Translate instructions using the checked recursive translator, keeping every tape and destination label unchanged.
abbrev statement (e : σ ≃ τ) : Stmt Γ Λ σ → Stmt Γ Λ τ := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statement_symm_statementline 109Source documentation
Translating every instruction back restores the original statement, including its state-dependent instruction functions.
@[simp] theorem statement_symm_statement (e : σ ≃ τ) (q : Stmt Γ Λ σ) : statement e.symm (statement e q) = q := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statement
- def
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configurationline 115 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration_labelline 118 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration_stateline 121 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration_tapesline 124 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration_symm_configurationline 127 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration_configuration_symmline 132 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configurationEquivline 138Source documentation
This is a bijection on actual machine configurations, not just on states.
def configurationEquiv (e : σ ≃ τ) : Cfg Γ Λ σ ≃ Cfg Γ Λ τ where …
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configurationEquiv_applyline 144 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.control_configurationline 147 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.programline 152 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.program_symm_programline 155 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statementPushBoundline 161Source documentation
The register change does not alter the finite statement's push bound.
theorem statementPushBound (e : σ ≃ τ) (q : Stmt Γ Λ σ) : Runtime.statementPushBound (statement e q) = Runtime.statementPushBound q := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.Runtime.statementPushBound, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statement
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.supportsStmt_iffline 167Source documentation
Exactly the same finite label set supports the translated statement.
theorem supportsStmt_iff (e : σ ≃ τ) (S : Finset Λ) (q : Stmt Γ Λ σ) : SupportsStmt S (statement e q) ↔ SupportsStmt S q := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statement
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.supports_iffline 189 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.stepAux_transportline 197Source documentation
The actual recursively interpreted statement commutes with the register equivalence, with exactly the same tape updates.
theorem stepAux_transport (e : σ ≃ τ) (q : Stmt Γ Λ σ) (state : σ) (tapes : ∀ k, List (Γ k)) : stepAux (statement e q) (e state) tapes = configuration e (stepAux q state tapes) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.statement, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.stepAux_transport_symmline 204 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.step_transportline 212Source documentation
Exact conjugacy also covers the halted configuration and the
nonestep.theorem step_transport (e : σ ≃ τ) (source : Λ → Stmt Γ Λ σ) (c : Cfg Γ Λ σ) : step (program e source) (configuration e c) = (step source c).map (configuration e) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.program, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.step_iffline 224 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.advance_transportline 236 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.iterate_transportline 246Source documentation
Every intermediate configuration is transported at its original time index. This includes traces whose option-valued result is
none.theorem iterate_transport (e : σ ≃ τ) (source : Λ → Stmt Γ Λ σ) (n : Nat) (c : Option (Cfg Γ Λ σ)) : (MachineComposition.advance (step (program e source)))^[n] (c.map (configuration e)) = ((MachineComposition.advance (step source))^[n] c).map (configuration e) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.program, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.trace_iffline 259Source documentation
A successful running trace exists for exactly the same number of steps in the translated and original program.
theorem trace_iff (e : σ ≃ τ) (source : Λ → Stmt Γ Λ σ) (n : Nat) (a b : Cfg Γ Λ σ) : (MachineComposition.advance (step (program e source)))^[n] (some (configuration e a)) = some (configuration e b) ↔ (MachineComposition.advance (step source))^[n] (some a) = some b := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.program, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.traceline 275 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.executionline 284Source documentation
Transport an actual runtime witness without changing its step count or budget; the final option may be either a configuration or
none.def execution (e : σ ≃ τ) (source : Λ → Stmt Γ Λ σ) {start : Cfg Γ Λ σ} {finish : Option (Cfg Γ Λ σ)} {budget : Nat} (run : StateTransition.EvalsToInTime (step source) start finish budget) : StateTransition.EvalsToInTime (step (program e source)) (configuration e start) (finish.map (configuration e)) budget where …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.program, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.execution_stepsline 298 - def
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.execution_reflectline 305Source documentation
Conversely, a translated runtime witness determines the original witness at exactly the same number of transitions.
def execution_reflect (e : σ ≃ τ) (source : Λ → Stmt Γ Λ σ) {start : Cfg Γ Λ σ} {finish : Option (Cfg Γ Λ σ)} {budget : Nat} (run : StateTransition.EvalsToInTime (step (program e source)) (configuration e start) (finish.map (configuration e)) budget) : StateTransition.EvalsToInTime (step source) start finish budget where …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.program, OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineStateEquiv.execution_reflect_stepsline 320 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Alphabetline 335 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Stateline 336 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.cleanline 338 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.compareStateEquivline 341Source documentation
Reassociate the actual three comparison registers into the shared state.
def compareStateEquiv (A : Type) : MachineCompare.State A ≃ State A where …
Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineCompare.State, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.State
- inductive
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Labelline 347 - abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Label.enumListline 353 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Label.enumList_getElem?_ctorIdx_eqline 356 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Label.enumList_nodupline 360 - instance
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.(instance at line 362)line 362 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.exitAtline 366 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.bitEncodingline 371 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.emitline 374Source documentation
Two fixed exits, each containing only literal push instructions.
def emit (destination : K) (bit : Bool) (exit : Option Λ) : TM2.Stmt (Alphabet (K := K)) Λ (State A) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.instructionline 379 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.copyStepsline 397 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.compareStepsline 398 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.stepsline 399 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.steps_leline 401 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.encodeWord_eq_iffline 405 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.emit_stepline 414 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.joinTrace_inline_MachineUnaryEqualityBitline 426 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.equalityTraceline 432Source documentation
Actual execution of the two copies, the translated comparison, and the literal bit writer, inside any program containing the stated instructions.
theorem equalityTrace (tape : Fin 6 → K) (distinct : Function.Injective tape) (labels : Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State A)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Label, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.equalityInTimeline 535Source documentation
Timed correctness has only concrete input-tape and instruction premises.
def equalityInTime (tape : Fin 6 → K) (distinct : Function.Injective tape) (labels : Label → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State A)) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Label, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.State
- def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.machineline 554 - def
OAI.MaxCutGames.Foundations.Complexity.MachineUnaryEqualityBit.machineInTimeline 565 - abbrev
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.Fieldline 603 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.inputSizeline 605 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.fieldEquivline 607 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.inputEquivline 611 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.packDataline 615Source documentation
Proof-level organization of exactly the finite bits physically read.
def packData {t S : Nat} (data : Fin t → Field S → Bool) : Buffer (inputSize t S) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.Field, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.inputSize
- theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.packData_inputEquivline 618 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.basePredicateline 623 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.leftMatchesline 627 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.rightMatchesline 631 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.firstMatchline 636Source documentation
The scan order is the fixed increasing finite-index order.
def firstMatch {S : Nat} (mask : Fin S → Bool) : Option (Fin S) := … - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.firstMatch_specline 639 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.firstMatch_noneline 646 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.edgeAcceptline 652Source documentation
labelAtis a fixed finite lookup table determined by the reduction parameters, for exampledecodeLabel a (allAddresses.get i).def edgeAccept {t S q : Nat} (labelAt : Fin q → Fin S → GraphTables.Label) (bits : Buffer (inputSize t S)) (k : Fin t) (a b : Fin q) : Bool := …Mentions: OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.inputSize
- theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.edgeAccept_of_matchesline 658 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.rowAcceptline 666 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.rowAccept_eq_trueline 670 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.rowBlockline 677Source documentation
Every powered-label pair is written in the canonical row-major order.
def rowBlock {t S q : Nat} (labelAt : Fin q → Fin S → GraphTables.Label) (bits : Buffer (inputSize t S)) : Buffer (q * q) := …Mentions: OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.inputSize
- theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.rowBlock_atline 683 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodeBitline 692 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodeBitsline 694 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodeBits_appendline 698 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodeBits_graphWordsline 704 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodeBits_length_leline 711 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.readEncodedSlotsline 725Source documentation
Read one zero-delimited unary Boolean field for each fixed register slot. The second pop occurs exactly when the value is one.
def readEncodedSlots (src : K) : List (Fin N) → TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N) → TM2.Stmt (fun _ : K => Bool) Λ (σ × Buffer N) | [], next => next | i :: slots, next => .pop src (fun state head => (state.1, Function.update state.2 i (head.getD false))) (.branch (fun state => state.2 i) (.pop src (fun state _ => state) (readEncodedSlots src slots next)) (readEncodedSlots src slots next)) variable [DecidableEq K] - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.stepAux_readEncodedSlotsline 738 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.stepAux_readEncodedAllline 757 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.statementPushBound_readEncodedSlotsline 773 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.writeEncodedSlotsline 783Source documentation
The delimiter is pushed first, then the optional unary one; writing slots in reverse order gives the canonical field order on the destination stack.
def writeEncodedSlots {M : Nat} (dst : K) (emit : σ → Buffer M) : List (Fin M) → TM2.Stmt (fun _ : K => Bool) Λ σ → TM2.Stmt (fun _ : K => Bool) Λ σ | [], next => next | i :: slots, next => .push dst (fun _ => false) (.branch (fun state => emit state i) (.push dst (fun _ => true) (writeEncodedSlots dst emit slots next)) (writeEncodedSlots dst emit slots next)) - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.stepAux_writeEncodedSlotsline 791 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.statementPushBound_writeEncodedSlotsline 808 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodedBlockStmtline 825 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodedBlockAtline 832 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.statementPushBound_encodedBlockAtline 836 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.stepAux_encodedBlockStmtline 845 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.stepAux_encodedBlockAtline 860 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.step_encodedBlockAtline 871 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.rowAtline 890 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.machineline 895 - theorem
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.machine_statementPushBoundline 906 - def
OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.machineInTimeline 914Source documentation
The input predicate/match block is consumed. The exact unary predicate row is prepended; the remaining input, old output, and ambient register are accounted for in the actual transition witness.
def machineInTime {t S q : Nat} (labelAt : Fin q → Fin S → GraphTables.Label) (bits : Buffer (inputSize t S)) (suffix : List Bool) (register : Buffer (inputSize t S)) (tapes : Bool → List Bool) (hinput : tapes false = encodeBits (List.ofFn bits) ++ suffix) : StateTransition.EvalsToInTime (machine (t := t) labelAt).step …Mentions: OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.inputSize, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.encodeBits, OAI.MaxCutGames.Foundations.Complexity.PoweringMachineRow.machine