OAI/Computability/MaxCut/Machines/Runtime.lean
72 declarations, 0 contain sorry, 0 declared as axioms
Stack-length bounds derived from actual machine transitions. A finite program has a maximum number of pushes in any one statement. Iterating its transitions therefore bounds output length by input length plus that constant times elapsed steps. This proves a consequence of a runtime certificate, not its converse.
- def
OAI.MaxCutGames.Foundations.Complexity.Runtime.statementPushBoundline 15 - def
OAI.MaxCutGames.Foundations.Complexity.Runtime.maxLabelPushesline 25 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.maxLabelPushes_geline 30 - def
OAI.MaxCutGames.Foundations.Complexity.Runtime.programPushBoundline 44Source documentation
The finite maximum is a proof-bound constant, not an operation of the machine being analyzed.
noncomputable def programPushBound (tm : Turing.FinTM2) : Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.statement_le_programPushBoundline 47 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.stepAuxStackLengthline 52 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.iterateSizeBound_inline_Runtimeline 95 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.executionSizeBoundline 108Source documentation
Resource growth along the actual iterated transition witness.
theorem executionSizeBound {σ : Type} (step : σ → Option σ) (size : σ → Nat) (C : Nat) (oneStep : ∀ a b, step a = some b → size b ≤ size a + C) {start finish : σ} {budget : Nat} (execution : StateTransition.EvalsToInTime step start (some finish) budget) : size finish ≤ size start + budget * C := by … - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.stepStackLengthline 131 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.initialStackLengthline 144 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.haltedOutputLengthline 151 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.outputLength_leline 155 - theorem
OAI.MaxCutGames.Foundations.Complexity.Runtime.encodedOutputLengthline 169Source documentation
Polynomial-time computation implies a polynomial bound on serialized output length. This direction is used for intermediate data in composition.
theorem encodedOutputLength {α β αΓ βΓ : Type} {ea : α → List αΓ} {eb : β → List βΓ} {f : α → β} (certificate : Turing.TM2ComputableInPolyTime ea eb f) (a : α) : (eb (f a)).length ≤ (Polynomial.X + Polynomial.C (programPushBound certificate.tm) * certificate.time).eval (ea a).length := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.Runtime.programPushBound
- abbrev
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.Alphabetline 191 - def
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.tapesline 195 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.tapes_inlline 200 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.tapes_inrline 203 - def
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.labelline 206 - def
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.configurationline 210 - def
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.statementline 217 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.tapes_updateline 234 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.stepAux_simulationline 249Source documentation
One finite statement executes identically on the original stacks and state. The entire statement is simulated in exactly one TM2 transition.
theorem stepAux_simulation (haltTarget : Option (Λ ⊕ Λextra)) (extraState : τ) (extraTapes : ∀ e, List (Δ e)) (q : Stmt Γ Λ σ) (state : σ) (source : ∀ k, List (Γ k)) : stepAux (statement haltTarget q) (state, extraState) (tapes source extraTapes) = configuration haltTarget extraState extraTapes (stepAux q state source) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.statement, OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.tapes, OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.stepAux_preserves_extra_stateline 275 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.stepAux_preserves_extra_tapeline 283 - def
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.programline 291 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.step_runningline 297 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.step_simulationline 310 - def
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advanceline 338 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance_noneline 341 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance_someline 344 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.advance_iterate_noneline 347 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.liftSuccessfulTraceline 353 - def
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.liftExecutionInTimeline 377 - theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.liftExecutionInTime_stepsline 391 - def
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.embeddedExecutionline 400Source documentation
The checked disjoint-stack embedding transports a complete successful run with no additional transitions, including its final jump to a bridge label.
def embeddedExecution {K E Λ Λextra σ τ : Type} {Γ : K → Type} {Δ : E → Type} [DecidableEq K] [DecidableEq E] (haltTarget : Option (Λ ⊕ Λextra)) (extraState : τ) (extraTapes : ∀ e, List (Δ e)) (source : Λ → Turing.TM2.Stmt Γ Λ σ) (extra : Λextra → Turing.TM2.Stmt (MachineEmbedding.Alphabet Γ Δ) (Λ ⊕ Λextra) (σ × τ)) {start finish : Turing.TM2.Cfg Γ Λ σ} {budget : Nat} (execution : StateTransition.EvalsToInTime (Turing.TM2.step source) start (some finish) budget) : StateTransition.EvalsToInTime (Turing.TM2.step (MachineEmbedding.program haltTarget source extra)) (MachineEmbedding.configuration haltTarget extraState extraTapes start) …Mentions: OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.Alphabet, OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.program, OAI.MaxCutGames.Foundations.Complexity.MachineEmbedding.configuration
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.natPolynomial_eval_monoline 418 - def
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.compositionPolynomialline 428Source documentation
Two reversal transfers each consume
intermediateLength + 1transitions.noncomputable def compositionPolynomial (first second intermediate : Polynomial Nat) : Polynomial Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.compositionBudget_leline 431 - def
OAI.MaxCutGames.Foundations.Complexity.MachineComposition.fourPhaseExecutionline 442 - abbrev
OAI.MaxCutGames.Reduction.MachineTransfer.alphabetline 488 - def
OAI.MaxCutGames.Reduction.MachineTransfer.loopline 494 - def
OAI.MaxCutGames.Reduction.MachineTransfer.machineline 501 - def
OAI.MaxCutGames.Reduction.MachineTransfer.tapeStacksline 513 - def
OAI.MaxCutGames.Reduction.MachineTransfer.runningline 518 - def
OAI.MaxCutGames.Reduction.MachineTransfer.haltedline 522 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.update_input_inline_MachineTransferline 526 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.update_output_inline_MachineTransferline 532 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.step_emptyline 537 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.step_consline 545 - def
OAI.MaxCutGames.Reduction.MachineTransfer.nextline 554 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.transfer_stepsline 558Source documentation
Exact actual-machine trace, for any accumulator and internal register.
theorem transfer_steps (f : α → β) (fallback : β) (input : List α) (output : List β) (state : Option β) : (next f fallback)^[input.length + 1] (some (running f fallback input output state)) = some (halted f fallback (input.reverse.map f ++ output)) := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransfer.next, OAI.MaxCutGames.Reduction.MachineTransfer.running, OAI.MaxCutGames.Reduction.MachineTransfer.halted
- theorem
OAI.MaxCutGames.Reduction.MachineTransfer.initList_eqline 575 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.haltList_eqline 582 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.transfer_init_stepsline 589 - def
OAI.MaxCutGames.Reduction.MachineTransfer.outputsInTimeline 595 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.outputsInTime_stepsline 602 - def
OAI.MaxCutGames.Reduction.MachineTransfer.computableInPolyTimeline 606Source documentation
A genuine finite-machine certificate with identity encodings and bound
X+1.noncomputable def computableInPolyTime (f : α → β) (fallback : β) : TM2ComputableInPolyTime (id : List α → List α) (id : List β → List β) (fun input => input.reverse.map f) where … - def
OAI.MaxCutGames.Reduction.MachineTransfer.exitAtline 625 - def
OAI.MaxCutGames.Reduction.MachineTransfer.loopAtline 630 - def
OAI.MaxCutGames.Reduction.MachineTransfer.tapesAtline 637 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt_srcline 641 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt_dstline 646 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt_otherline 651 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt_selfline 656 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.update_tapesAt_src_inline_MachineTransferline 660 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.update_tapesAt_dst_inline_MachineTransferline 674 - def
OAI.MaxCutGames.Reduction.MachineTransfer.nextAtline 685 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.stepAt_emptyline 690 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.stepAt_consline 704 - theorem
OAI.MaxCutGames.Reduction.MachineTransfer.transferAt_stepsline 722Source documentation
Placement-aware exact transfer, preserving all ambient state and other tapes. The optional exit label is reached in the same final empty-pop transition.
theorem transferAt_steps (src dst : K) (distinct : src ≠ dst) (f : Γ src → Γ dst) (fallback : Γ dst) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt Γ Λ (σ × Option (Γ dst))) (atLoop : program loopLabel = loopAt src dst f fallback loopLabel exit) (base : (k : K) → List (Γ k)) (input : List (Γ src)) (output : List (Γ dst)) (ambient : σ) (register : Option (Γ dst)) : (nextAt dst program)^[input.length + 1] (some ⟨some loopLabel, (ambient, register), tapesAt src dst base input output⟩) = some ⟨exit, (ambient, none), tapesAt src dst base [] (input.reverse.map f ++ output)⟩ := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransfer.loopAt, OAI.MaxCutGames.Reduction.MachineTransfer.nextAt, OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt
- theorem
OAI.MaxCutGames.Reduction.MachineTransfer.transferAt_fromTapesline 747Source documentation
The same trace starting with an arbitrary actual ambient tape family.
theorem transferAt_fromTapes (src dst : K) (distinct : src ≠ dst) (f : Γ src → Γ dst) (fallback : Γ dst) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt Γ Λ (σ × Option (Γ dst))) (atLoop : program loopLabel = loopAt src dst f fallback loopLabel exit) (base : (k : K) → List (Γ k)) (ambient : σ) (register : Option (Γ dst)) : (nextAt dst program)^[(base src).length + 1] (some ⟨some loopLabel, (ambient, register), base⟩) = some ⟨exit, (ambient, none), tapesAt src dst base [] ((base src).reverse.map f ++ base dst)⟩ := by …Mentions: OAI.MaxCutGames.Reduction.MachineTransfer.loopAt, OAI.MaxCutGames.Reduction.MachineTransfer.nextAt, OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt
- def
OAI.MaxCutGames.Reduction.MachineTransfer.transferAtInTimeline 762Source documentation
A timed execution witness suitable for composing this bridge with other phases of the same actual transition system.
def transferAtInTime (src dst : K) (distinct : src ≠ dst) (f : Γ src → Γ dst) (fallback : Γ dst) (loopLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt Γ Λ (σ × Option (Γ dst))) (atLoop : program loopLabel = loopAt src dst f fallback loopLabel exit) (base : (k : K) → List (Γ k)) (ambient : σ) (register : Option (Γ dst)) : StateTransition.EvalsToInTime (TM2.step program) ⟨some loopLabel, (ambient, register), base⟩ (some ⟨exit, (ambient, none), tapesAt src dst base [] ((base src).reverse.map f ++ base dst)⟩) ((base src).length + 1) where …Mentions: OAI.MaxCutGames.Reduction.MachineTransfer.loopAt, OAI.MaxCutGames.Reduction.MachineTransfer.tapesAt