OAI/Computability/MaxCut/PCP/ProfileBridge.lean
61 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.positionEncodingline 12 - def
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.namesline 15 - def
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.nameWordsline 19 - def
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.reindexProfileline 23 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.computed_profile_eqline 27 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.prepared_signature_eqline 35 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.nameWords_length_le_inputline 45Source documentation
Every isolated unary variable-name field is bounded by the true CNF input encoding, including formulas with unused declared variable names.
theorem nameWords_length_le_input (F : Formula) {u : ℕ} (c : ClauseContext F u) (i : Fin (positionEncoding u).size) : (nameWords F c i).length ≤ (formulaBits F).length := by …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.positionEncoding, OAI.MaxCutGames.Foundations.Hastad.SourceProfileBridge.nameWords
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.positionsline 63Source documentation
An explicit computable enumeration, without an arbitrary finite-type equivalence. Slots occur first, second, third within each clause coordinate.
def positions (u : ℕ) : List (Position u) := …
- theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.mem_positionsline 66 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.fillSignsline 70Source documentation
The mathematical result of the individual finite sign-register writes.
def fillSigns {u : ℕ} (values initial : Position u → Bool) (cells : List (Position u)) : Position u → Bool := … - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.fillSigns_applyline 74 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.fillSigns_positionsline 88 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.Stateline 96 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.Alphabetline 97 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.finishline 99 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.peekChainline 106Source documentation
Each statement reads only the head of one supplied polarity field. The other signature fields and the entire ambient-register component are copied.
def peekChain (field : Position u → K) (exit : Option Λ) : List (Position u) → TM2.Stmt (Alphabet (K := K)) Λ (State u τ) …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.Alphabet, OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.State
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.statementline 114 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.readSignsline 120Source documentation
The head defaults make the finite program total on malformed tapes too; the correctness theorem below supplies the actual unary-field representation.
def readSigns (field : Position u → K) (tapes : K → List Bool) : Position u → Bool := …
- theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.stepAux_peekChainline 123 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.stepAux_statementline 136 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.peekChain_pushBoundline 143 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.statement_pushBoundline 151 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.readSigns_of_unaryline 156 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.loadStepline 166Source documentation
Exact actual caller-program step. Every stored field and unread suffix is preserved, as are sameName, selected, and all ambient registers.
theorem loadStep (field : Position u → K) (entryLabel : Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (Alphabet (K := K)) Λ (State u τ)) …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.Alphabet, OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.State
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.loadInTimeline 177 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.loaded_ofContextline 196Source documentation
The actual context signature is recovered when equality and selected-slot data have already been loaded by their separate verified preparation stages.
theorem loaded_ofContext (F : Target.Formula) (c : SourceContexts.ClauseContext F u) (selected : SourceContexts.SlotContext u) (initial : Signature u) (hnames : initial.sameName = contextNameProfile F c) (hselected : initial.selected = selected) : {initial with signs := (ofContext F c selected).signs} = ofContext F c selected := by …Mentions: OAI.MaxCutGames.Foundations.Target.Formula, OAI.MaxCutGames.Foundations.Hastad.SourceContexts.ClauseContext, OAI.MaxCutGames.Foundations.Hastad.SourceContexts.SlotContext
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.loadContextInTimeline 208 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Widthline 234 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Arenaline 235 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.ProfileStateline 236 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Stateline 237 - abbrev
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.ProfileLabelline 238 - inductive
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Labelline 240 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.variableFieldline 247 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.polarityFieldline 250 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.placeline 253 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.unplaceline 257 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.unplace_placeline 267 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.place_injectiveline 280 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.place_unplaceline 285 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.fillline 317 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.fill_placeline 323 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.fill_selfline 328 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.fill_frameline 336 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.fill_updateline 343 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.placedLabelline 366 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.placedConfigurationline 370 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.placedStatementline 376 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.placed_stepAuxline 391 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.signStateEquivline 419Source documentation
Reassociate finite registers without adding a transition.
def signStateEquiv (u : ℕ) (τ : Type) : SourceSignLoad.State u (ProfileState u × τ) ≃ State u τ where …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignLoad.State, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.ProfileState, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.State
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.commitStatementline 426 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.programline 432 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.placed_stepline 437 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.stepAux_commitline 454 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.profileInTimeline 467Source documentation
The actual profile execution, placed in the loaded context arena.
def profileInTime (tapes : Arena u Extra → List Bool) (hwork : ∀ w : Fin 3, tapes (place (.inr w)) = []) (initialProfile : MachineFieldProfile.Profile (Width u)) (initial : Signature u) (ambient : τ) (L : ℕ) (hL : ∀ i, (tapes (place (.inl i))).length ≤ L) : StateTransition.EvalsToInTime (TM2.step program) ⟨some (.profile (MachineFieldProfile.labelAt (MachineFieldProfile.allPairs (Width u)) 0 0)), (MachineFieldProfile.normalState initialProfile, (initial, ambient)), tapes⟩ (some ⟨some .commit, (MachineFieldProfile.normalState (MachineFieldProfile.equalityProfile (fun i => tapes (place (.inl i)))), (initial, ambient)), tapes⟩) …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Arena, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.place, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Width, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.program
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.commitInTimeline 487 - def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.prepareInTimeline 502Source documentation
Actual preparation from isolated name fields and unary sign fields. The conclusion preserves every tape and arbitrary caller metadata.
def prepareInTime (F : Formula) (c : ClauseContext F u) (selected : SlotContext u) (tapes : Arena u Extra → List Bool) (hwork : ∀ w : Fin 3, tapes (place (.inr w)) = []) (hnames : ∀ i, tapes (place (.inl i)) = nameWords F c i) (suffix : Position u → List Bool) (hsigns : ∀ p, tapes (polarityField p) = encodeWord (if positiveAt (clauseAt F (c p.1)) p.2 then 1 else 0) ++ suffix p) (initialProfile : MachineFieldProfile.Profile (Width u)) (initial : Signature u) (hselected : initial.selected = selected) (ambient : τ) : StateTransition.EvalsToInTime (TM2.step program) ⟨some (.profile (MachineFieldProfile.labelAt (MachineFieldProfile.allPairs (Width u)) 0 0)), (MachineFieldProfile.normalState initialProfile, (initial, ambient)), tapes⟩ …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Arena, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.place, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.polarityField, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Width, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.program
- theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.loaded_name_fieldline 541 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.loaded_sign_fieldline 560Source documentation
Unary sign fields may retain arbitrary old suffixes: only the leading sign bit is read.
theorem loaded_sign_field (F : Formula) (c : ClauseContext F u) (base : Arena u Extra → List Bool) (p : Position u) : SourceContextLoad.stageTapes F c base u (polarityField p) = encodeWord (if positiveAt (clauseAt F (c p.1)) p.2 then 1 else 0) ++ base (polarityField p) := by …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Arena, OAI.MaxCutGames.Foundations.Hastad.SourceContextLoad.stageTapes, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.polarityField
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.loadedPrepareInTimeline 575Source documentation
Exactly the loaded context signature is computed by the concrete finite program. Scratch is reset and all loaded fields and caller tapes are preserved.
def loadedPrepareInTime (F : Formula) (c : ClauseContext F u) (selected : SlotContext u) (base : Arena u Extra → List Bool) (hindex : base .index = []) (hwork : base .work = []) (hscratch : base .scratch = []) (hbase : ∀ p : Position u, base (variableField p) = []) (initialProfile : MachineFieldProfile.Profile (Width u)) (initial : Signature u) (hselected : initial.selected = selected) (ambient : τ) : StateTransition.EvalsToInTime (TM2.step program) ⟨some (.profile (MachineFieldProfile.labelAt (MachineFieldProfile.allPairs (Width u)) 0 0)), (MachineFieldProfile.normalState initialProfile, (initial, ambient)), SourceContextLoad.stageTapes F c base u⟩ (some ⟨none, (MachineFieldProfile.normalState (MachineFieldProfile.equalityProfile (nameWords F c)), …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Arena, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.variableField, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Width, OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.program, OAI.MaxCutGames.Foundations.Hastad.SourceContextLoad.stageTapes
- def
OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.machineline 607Source documentation
Finiteness of tape addresses and registers constructs an actual TM2; its execution bound is established above by the concrete transitions.
def machine (u : ℕ) (Extra τ : Type) [DecidableEq Extra] [Fintype Extra] [Fintype τ] (initialProfile : MachineFieldProfile.Profile (Width u)) (initial : Signature u) (ambient : τ) : FinTM2 where …Mentions: OAI.MaxCutGames.Foundations.Hastad.SourceSignaturePrepare.Width