OAI/Computability/MaxCut/Games/FinalCNFOutput.lean
44 declarations, 0 contain sorry, 0 declared as axioms
The final machine's complete output stream is the exact serialization of its actual formula. This identity includes the two size fields, every clause and literal field, and all unary delimiters. No desired output equality is assumed.
- def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.formulaHeaderline 17 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.formulaHeader_eqline 20 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.headerPlan_eq_formulaHeaderline 26 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.outputStream_eq_clauseBitsline 32 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.header_append_outputStreamline 51 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.emitted_output_eqline 57 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.reversed_accumulator_outputline 67Source documentation
Reversing the finished stack accumulator restores the required output order.
theorem reversed_accumulator_output (table : GraphTables.Table) : (formulaHeader table ++ outputStream rowPlan table (List.finRange table.darts)).reverse.reverse = formulaBits (FinalTableFormula.output table) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.formulaHeader, OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.outputStream, OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rowPlan, OAI.MaxCutGames.Foundations.Complexity.formulaBits
- theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.accumulator_length_boundline 72 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rowTimePolynomialline 84 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rowTimePolynomial_evalline 88 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rowTime_expandedline 93 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.phaseTimePolynomialline 98Source documentation
Header, at most
Nrows with guards, and the final output reversal.noncomputable def phaseTimePolynomial : Polynomial Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.phaseTimePolynomial_evalline 103 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.phaseTimePolynomial_eval_expandedline 110 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.phaseTime_leline 116 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.table_phaseTime_leline 125Source documentation
The bound specialized to the actual table and actual formula serialization.
theorem table_phaseTime_le (table : GraphTables.Table) : headerTimePolynomial.eval (GraphTables.tableBits table).length + (table.darts * (rowTime rowPlan (GraphTables.tableBits table).length + 1) + 1) + ((formulaBits (FinalTableFormula.output table)).length + 1) ≤ phaseTimePolynomial.eval (GraphTables.tableBits table).length := …Mentions: OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rowTime, OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rowPlan, OAI.MaxCutGames.Foundations.Complexity.formulaBits
- def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.finalTimePolynomialline 135Source documentation
Twelve private stacks are drained, then the finite state is reset.
Cis the fixed maximum number of pushes in a raw-program transition.noncomputable def finalTimePolynomial (C : Nat) : Polynomial Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.finalTimePolynomial_evalline 139 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.finalTime_leline 146Source documentation
Pure budget composition; the drain implementation supplies its own trace.
theorem finalTime_le (C N workLength : Nat) (workBound : workLength ≤ N + phaseTimePolynomial.eval N * C) : phaseTimePolynomial.eval N + 12 * (workLength + 1) + 1 ≤ (finalTimePolynomial C).eval N := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.finalTimePolynomial
- def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.redirectLabelline 166 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.redirectCfgline 170 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.redirectStmtline 175Source documentation
Structural redirection changes only the destinations of goto and halt.
def redirectStmt (labels : Λ → Λ') (haltTarget : Option Λ') : TM2.Stmt Γ Λ σ → TM2.Stmt Γ Λ' σ | .push k f next => .push k f (redirectStmt labels haltTarget next) | .peek k f next => .peek k f (redirectStmt labels haltTarget next) | .pop k f next => .pop k f (redirectStmt labels haltTarget next) | .load f next => .load f (redirectStmt labels haltTarget next) | .branch test yes no => .branch test (redirectStmt labels haltTarget yes) (redirectStmt labels haltTarget no) | .goto label => .goto (fun state => labels (label state)) | .halt => match haltTarget with | none => .halt | some label => .goto (fun _ => label) - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.stepAux_redirectline 188 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.chosenline 209Source documentation
The raw machine has thirteen tapes. These are precisely the twelve non-output tapes, including the original input and retained archive.
def chosen : List Tape := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.chosen_lengthline 213 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.mem_chosenline 215 - abbrev
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.Labelline 218 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.cleanupLabelline 222 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.resetLabelline 225 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.cleanupEntryline 227 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.completedProgramline 230 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.completedMachineline 238 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.embeddedCfgline 249 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.step_simulationline 254 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.embedded_initline 273 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.finalTapes_eqline 277 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.haltList_eqline 287 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.cleanupExecutionline 294Source documentation
Actual drains followed by a real state-reset instruction reach canonical halt.
def cleanupExecution (headerPlan rowPlan : Plan) (state : State Unit) (base : Tape → List Bool) : StateTransition.EvalsToInTime (completedMachine headerPlan rowPlan).step ⟨cleanupEntry headerPlan rowPlan, state, base⟩ (some (haltList (completedMachine headerPlan rowPlan) (base .output))) (MachineDrainMany.steps chosen base + 1) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.completedMachine, OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.cleanupEntry, OAI.MaxCutGames.Foundations.Complexity.MachineDrainMany.steps, OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.chosen
- def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.outputsInTimeline 327Source documentation
The extra cost is bounded from the actual raw execution, independently of the contents of its dirty private tapes and finite state.
def outputsInTime (headerPlan rowPlan : Plan) (input output : List Bool) (state : State Unit) (base : Tape → List Bool) (budget : Nat) (raw : StateTransition.EvalsToInTime (FinalCNFMachine.Program.machine headerPlan rowPlan).step (initList (FinalCNFMachine.Program.machine headerPlan rowPlan) input) (some ⟨none, state, base⟩) budget) (correctOutput : base .output = output) : TM2OutputsInTime (completedMachine headerPlan rowPlan) input (some output) (budget + 12 * (input.length + budget * Runtime.programPushBound (FinalCNFMachine.Program.machine headerPlan rowPlan) + 1) + 1) := by …Mentions: OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.machine, OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.completedMachine, OAI.MaxCutGames.Foundations.Complexity.Runtime.programPushBound
- def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.completedTimeline 360Source documentation
For fixed raw plans, polynomial raw time gives polynomial cleanup time.
noncomputable def completedTime (headerPlan rowPlan : Plan) (rawTime : Polynomial Nat) : Polynomial Nat := …
- theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFCleanup.completedTime_evalline 364 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.emittedBytes_eq_formulaBitsline 382 - theorem
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.rawBudget_le_phaseTimeline 386 - def
OAI.MaxCutGames.Foundations.Complexity.FinalCNFMachine.Program.computableInPolyTimeline 394Source documentation
A concrete finite machine computes the complete CNF serialization from the exact unary graph-table serialization, with a proved polynomial bound.
noncomputable def computableInPolyTime : TM2ComputableInPolyTime GraphTables.tableBits formulaBits FinalTableFormula.output where …Mentions: OAI.MaxCutGames.Foundations.Complexity.formulaBits