OAI/Computability/MaxCut/PCP/TupleBody.lean
59 declarations, 0 contain sorry, 0 declared as axioms
One actual clause-tuple body. Its fixed finite control loads the context, computes the shared right address base, traverses every selected-slot tuple and query tape in their declared encoding order, and physically clears its work.
- abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.SlotCountline 17 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.QueryCountline 18 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Queryline 19 - inductive
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Labelline 21 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.selectedline 40 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.mainline 43 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.framedline 45 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.framedConfigurationline 50 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.framed_stepAuxline 59 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.framed_stepline 66 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.framedExecutionline 81 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.finishline 96 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.drainProgramline 102 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.drainStatementline 106 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.selectStateline 113Source documentation
Only the chosen-slot/query registers change; the computed context profile and original signature remain available across all local traversals.
def selectState (initialQuery : Query u D) (index : Fin (SlotCount u)) (state : State u D) : State u D := …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.SlotCount
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.programline 118 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.reset_stepline 156Source documentation
All finite internal state is reset before the caller continuation.
theorem reset_step (initialQuery : Query u D) (exit : Option (Label u D Extra)) (state : State u D) (tapes : Arena u Extra → List Bool) : TM2.step (program initialQuery exit) ⟨some .reset, state, tapes⟩ = some ⟨exit, canonicalState initialQuery, tapes⟩ := by …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.resetInTimeline 162 - structure
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Readyline 172Source documentation
The complete representation needed at one odometer leaf. Remaining-digit stacks, output history, and retained unused headers are arbitrary.
structure Ready (F : Target.Formula) (c : ClauseContext F u) (base : Arena u Extra → List Bool) : Prop where … - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.contextSignatureline 198 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.workingStateline 201 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.workingState_loaderline 206 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.arithmeticMetadataline 210 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.queryMetadataline 216 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.arithmeticState_workingline 221 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.queryState_workingline 226 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.select_workingStateline 231 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.rightValueline 236 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.variableRankline 239 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.leftValueline 242 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.slotBudgetline 245 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.preparePhaseline 254Source documentation
Concrete context-loader/signature phase in the tuple-body program.
noncomputable def preparePhase (F : Target.Formula) (c : ClauseContext F u) (initialQuery : Query u D) (exit : Option (Label u D Extra)) (base : Arena u Extra → List Bool) (hformula : base .formula = formulaBits F) (hcurrent : ∀ j, base (.current j) = encodeWord (c j).val) (hindex : base .index = []) (hwork : base .work = []) (hscratch : base .scratch = []) (hcopy : base .copyScratch = []) (hfields : ∀ p : Position u, base (SourceSignaturePrepare.variableField p) = []) : StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some main, canonicalState initialQuery, base⟩ (some ⟨some .seedZero, SourceContextPrepare.finalState F c (fun _ => .first) …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.variableField, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.main, OAI.MaxCutGames.Foundations.Hastad.SourceContextPrepare.finalState
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.seedZeroPhaseline 277 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.drainPhaseline 292Source documentation
The caller only supplies a local code equality; the physical drain and its entire runtime are obtained from the checked drain machine.
def drainPhase (initialQuery : Query u D) (exit : Option (Label u D Extra)) (source : Arena u Extra) (entry : Label u D Extra) (next : Option (Label u D Extra)) (atEntry : program initialQuery exit entry = drainStatement source entry next) (base : Arena u Extra → List Bool) (metadata : SourceSignaturePrepare.State u (QueryState u D × ArithmeticState)) (register : Option Bool) : StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some entry, (((), register), metadata), base⟩ (some ⟨next, (((), none), metadata), Function.update base source []⟩) ((base source).length + 1) := by …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.drainStatement, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.State
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.clauseRankPhaseline 306 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.variableRankPhaseline 323 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.rightBasePhaseline 344 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.leftBasePhaseline 366 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.queryPhaseline 391 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.selectPhaseline 417Source documentation
The fixed selected-slot tuple is loaded in one actual transition.
def selectPhase (initialQuery : Query u D) (exit : Option (Label u D Extra)) (index : Fin (SlotCount u)) (state : State u D) (base : Arena u Extra → List Bool) : StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some (.select index.castSucc), state, base⟩ (some ⟨some (.variableRank index .start), selectState initialQuery index state, base⟩) 1 where …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.SlotCount, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.variableRank, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.selectState
- theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.loaded_extraline 429 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Ready.loadedCleanline 435 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.loopSnapshotline 443 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.rankSnapshotline 446 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.baseSnapshotline 450 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.slotInTimeline 456Source documentation
One selected-slot tuple: actual rank, base construction, complete query stream, and physical cleanup, in the one fixed caller program.
theorem slotInTime (F : Target.Formula) (c : ClauseContext F u) (initialQuery beforeQuery : Query u D) (beforeSignature : Signature u) (exit : Option (Label u D Extra)) (base : Arena u Extra → List Bool) (h : Ready F c base) (index : Fin (SlotCount u)) (bits : List Bool) : ∃ afterQuery : Query u D, Nonempty (StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some (.select index.castSucc), workingState F c beforeSignature beforeQuery, tapes (SourceContextLoad.stageTapes F c base u) (loopSnapshot F c bits)⟩ (some ⟨some (.select ⟨index.val + 1, by omega⟩), workingState F c (ofContext F c (selected index)) afterQuery, tapes (SourceContextLoad.stageTapes F c base u) (loopSnapshot F c (bits ++ SourceQueryOrder.slotBits F u D c (selected index)))⟩) …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Ready, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.SlotCount, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.workingState, OAI.MaxCutGames.Foundations.Hastad.SourceContextLoad.stageTapes, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.loopSnapshot, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.selected, OAI.MaxCutGames.Foundations.Hastad.SourceQueryOrder.slotBits
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.slotAtline 553 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.prefixBitsline 556 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.prefixBudgetline 560 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.prefixInTimeline 565Source documentation
The explicit finite loop runs in ascending slot-encoding order.
theorem prefixInTime (F : Target.Formula) (c : ClauseContext F u) (initialQuery beforeQuery : Query u D) (beforeSignature : Signature u) (exit : Option (Label u D Extra)) (base : Arena u Extra → List Bool) (h : Ready F c base) (r : Nat) (hr : r ≤ SlotCount u) : ∃ afterSignature : Signature u, ∃ afterQuery : Query u D, Nonempty (StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some (.select ⟨0, by omega⟩), workingState F c beforeSignature beforeQuery, tapes (SourceContextLoad.stageTapes F c base u) (loopSnapshot F c [])⟩ (some ⟨some (.select ⟨r, by omega⟩), workingState F c afterSignature afterQuery, tapes (SourceContextLoad.stageTapes F c base u) (loopSnapshot F c (prefixBits (D := D) F c r))⟩) …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Ready, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.SlotCount, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.workingState, OAI.MaxCutGames.Foundations.Hastad.SourceContextLoad.stageTapes, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.loopSnapshot, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.prefixBits
- theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.prefixBits_eq_ofFnline 598 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.prefixBits_eq_tupleBitsline 609 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.setupBudgetline 620 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.finishBudgetline 630 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.bodyBudgetline 633 - def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.setupInTimeline 637Source documentation
Actual context preparation and the shared right base are computed once.
noncomputable def setupInTime (F : Target.Formula) (c : ClauseContext F u) (initialQuery : Query u D) (exit : Option (Label u D Extra)) (base : Arena u Extra → List Bool) (h : Ready F c base) : StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some main, canonicalState initialQuery, base⟩ (some ⟨some (.select ⟨0, by omega⟩), workingState F c (canonicalSignature u) initialQuery, tapes (SourceContextLoad.stageTapes F c base u) (loopSnapshot F c [])⟩) (setupBudget F c) := by …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Ready, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.main, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.workingState, OAI.MaxCutGames.Foundations.Hastad.SourceContextLoad.stageTapes, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.loopSnapshot, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.setupBudget
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.finishInTimeline 707Source documentation
Physical cleanup and canonical finite-state reset complete the body.
def finishInTime (F : Target.Formula) (c : ClauseContext F u) (initialQuery query : Query u D) (signature : Signature u) (exit : Option (Label u D Extra)) (base : Arena u Extra → List Bool) (h : Ready F c base) (bits : List Bool) : StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some (.select ⟨SlotCount u, by omega⟩), workingState F c signature query, tapes (SourceContextLoad.stageTapes F c base u) (loopSnapshot F c bits)⟩ (some ⟨exit, canonicalState initialQuery, SourceTestAppend.resultTapes queryLayout base bits⟩) (finishBudget F c) := by …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Ready, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.SlotCount, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.workingState, OAI.MaxCutGames.Foundations.Hastad.SourceContextLoad.stageTapes, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.loopSnapshot, OAI.MaxCutGames.Foundations.Hastad.SourceTestAppend.resultTapes, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.finishBudget
- theorem
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.bodyInTimeline 768Source documentation
One complete actual clause-tuple execution. The only changed tape is the reversed-output accumulator; every internal finite register is reset.
theorem bodyInTime (F : Target.Formula) (c : ClauseContext F u) (initialQuery : Query u D) (exit : Option (Label u D Extra)) (base : Arena u Extra → List Bool) (h : Ready F c base) : Nonempty (StateTransition.EvalsToInTime (TM2.step (program initialQuery exit)) ⟨some main, canonicalState initialQuery, base⟩ (some ⟨exit, canonicalState initialQuery, SourceTestAppend.resultTapes queryLayout base (SourceQueryOrder.tupleBits F u D c)⟩) (bodyBudget (D := D) F c)) := by …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Query, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Label, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.Ready, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.program, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.main, OAI.MaxCutGames.Foundations.Hastad.SourceTestAppend.resultTapes, OAI.MaxCutGames.Foundations.Hastad.SourceQueryOrder.tupleBits, OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.bodyBudget
- def
OAI.MaxCutGames.Foundations.Hastad.SourceTupleBody.machineline 789