OAI/Computability/MaxCut/Machines/MachineProductGatherBounds.lean
70 declarations, 0 contain sorry, 0 declared as axioms
Bounds on the actual work stacks left by the preserving gather. These bounds justify clearing the query/scan remnants after each product field; they are consequences of the exact tape formulas, not runtime assumptions.
- theorem
OAI.MaxCutGames.Explicit.MachineProductGather.affine_final_lengthline 17 - theorem
OAI.MaxCutGames.Explicit.MachineProductGather.finalTapes_lengthline 51Source documentation
One field query adds at most one table's worth of bits to any tape. A width-fold gather therefore has a uniform linear-in-width space bound.
theorem finalTapes_length (values : List Nat) (coefficient width : Nat) (placement : Tape width → K) (distinct : Function.Injective placement) (indices offsets fields : Fin width → Nat) (selected : ∀ i, values[coefficient * indices i + offsets i]? = some (fields i)) (base : K → List Bool) (k : K) : (finalTapes values coefficient width placement indices offsets fields base k).length ≤ (base k).length + width * ((encodeWords values).length + 1) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductGather.Tape, OAI.MaxCutGames.Explicit.MachineProductGather.finalTapes
- theorem
OAI.MaxCutGames.Explicit.MachineProductField.mem_clearTapesline 90 - theorem
OAI.MaxCutGames.Explicit.MachineProductField.extra_not_mem_clearTapesline 96 - theorem
OAI.MaxCutGames.Explicit.MachineProductField.Ready.empty_clearTapesline 105 - theorem
OAI.MaxCutGames.Explicit.MachineProductField.gathered_frameline 112 - theorem
OAI.MaxCutGames.Explicit.MachineProductField.finalTapes_eqline 123Source documentation
The complete row-field phase changes just the output accumulator.
theorem finalTapes_eq (slots : Layout width ↪ K) (values : List Nat) (coefficient : Nat) (indices offsets fields : Fin width → Nat) (base : K → List Bool) (ready : Ready slots base) (value : Nat) : finalTapes slots values coefficient indices offsets fields base value = Function.update base (slots (.inr 6)) ((encodeWord value).reverse ++ base (slots (.inr 6))) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductField.Layout, OAI.MaxCutGames.Explicit.MachineProductField.Ready, OAI.MaxCutGames.Explicit.MachineProductField.finalTapes
- theorem
OAI.MaxCutGames.Explicit.MachineProductField.Ready.output_updateline 150Source documentation
The output update preserves all work-tape entry conditions.
theorem Ready.output_update (slots : Layout width ↪ K) (base : K → List Bool) (ready : Ready slots base) (word : List Bool) : Ready slots (Function.update base (slots (.inr 6)) word) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductField.Layout, OAI.MaxCutGames.Explicit.MachineProductField.Ready
- theorem
OAI.MaxCutGames.Explicit.MachineProductField.final_readyline 167 - theorem
OAI.MaxCutGames.Explicit.MachineProductField.emitted_clear_lengthline 175Source documentation
Cleanup only touches gather work; it never scans the global accumulator.
theorem emitted_clear_length (slots : Layout width ↪ K) (values : List Nat) (coefficient : Nat) (indices offsets fields : Fin width → Nat) (selected : ∀ i, values[coefficient * indices i + offsets i]? = some (fields i)) (base : K → List Bool) (ready : Ready slots base) (value : Nat) (k : K) (member : k ∈ clearTapes slots) : (emitted slots values coefficient indices offsets fields base value k).length ≤ width * ((encodeWords values).length + 1) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductField.Layout, OAI.MaxCutGames.Explicit.MachineProductField.Ready, OAI.MaxCutGames.Explicit.MachineProductField.clearTapes, OAI.MaxCutGames.Explicit.MachineProductField.emitted
- theorem
OAI.MaxCutGames.Explicit.MachineProductField.clearTapes_lengthline 193 - theorem
OAI.MaxCutGames.Explicit.MachineProductField.cleanup_steps_leline 196 - abbrev
OAI.MaxCutGames.Explicit.MachineProductRow.Layoutline 234 - abbrev
OAI.MaxCutGames.Explicit.MachineProductRow.Commandline 235 - def
OAI.MaxCutGames.Explicit.MachineProductRow.fieldRoleline 238Source documentation
Only the radix tape is switched between endpoint and alphabet fields.
def fieldRole (useAlphabet : Bool) : MachineProductField.Layout width → Layout width | .inr 0 => if useAlphabet then .inr () else .inl (.inr 0) | tape => .inl tape
Mentions: OAI.MaxCutGames.Explicit.MachineProductField.Layout, OAI.MaxCutGames.Explicit.MachineProductRow.Layout
- theorem
OAI.MaxCutGames.Explicit.MachineProductRow.fieldRole_injectiveline 242 - def
OAI.MaxCutGames.Explicit.MachineProductRow.fieldSlotsline 255 - abbrev
OAI.MaxCutGames.Explicit.MachineProductRow.LocalLabelline 259 - abbrev
OAI.MaxCutGames.Explicit.MachineProductRow.Labelline 262 - def
OAI.MaxCutGames.Explicit.MachineProductRow.localMainline 265 - def
OAI.MaxCutGames.Explicit.MachineProductRow.localInstructionline 268 - def
OAI.MaxCutGames.Explicit.MachineProductRow.entryline 273 - def
OAI.MaxCutGames.Explicit.MachineProductRow.instructionline 277 - def
OAI.MaxCutGames.Explicit.MachineProductRow.outputTapeline 283 - def
OAI.MaxCutGames.Explicit.MachineProductRow.appendFieldline 285 - def
OAI.MaxCutGames.Explicit.MachineProductRow.rowBitsline 289Source documentation
Exact literal output of the command list in field order.
def rowBits (values : Command width → Nat) (commands : List (Command width)) : List Bool := …
Mentions: OAI.MaxCutGames.Explicit.MachineProductRow.Command
- def
OAI.MaxCutGames.Explicit.MachineProductRow.resultline 292 - theorem
OAI.MaxCutGames.Explicit.MachineProductRow.resultOf_eqline 296 - structure
OAI.MaxCutGames.Explicit.MachineProductRow.Readyline 309Source documentation
The input-dependent data needed for one whole row, held invariant by all physical field executions.
structure Ready (slots : Layout width ↪ K) (table : List Nat) (indices : Fin width → Nat) (radices : Bool → Nat) (base : K → List Bool) : Prop where … - theorem
OAI.MaxCutGames.Explicit.MachineProductRow.Ready.appendFieldline 316 - theorem
OAI.MaxCutGames.Explicit.MachineProductRow.rowTraceline 339Source documentation
Complete row trace from the concrete field implementation. The only premises concerning values are literal indexed-table identities and the Horner interpretation of those values.
theorem rowTrace (slots : Layout width ↪ K) (table : List Nat) (coefficient : Nat) (indices : Fin width → Nat) (radices : Bool → Nat) (commands : List (Command width)) (fields : Command width → Fin width → Nat) (digits : Command width → Nat → Nat) (selected : ∀ command ∈ commands, ∀ i, table[coefficient * indices i + command.2 i]? = some (fields command i)) (reversed : ∀ command ∈ commands, ∀ i : Fin width, digits command i.val = fields command i.rev) (labels : Label slots commands → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (MachineHorner.State σ)) (atLabels : ∀ l, program (labels l) = instruction slots coefficient commands labels exit l) (base : K → List Bool) (ready : Ready slots table indices radices base) (ambient : σ) : let values := fun c : Command width => MachineHorner.value (radices c.1) (digits c) width …Mentions: OAI.MaxCutGames.Explicit.MachineProductRow.Layout, OAI.MaxCutGames.Explicit.MachineProductRow.Command, OAI.MaxCutGames.Explicit.MachineProductRow.Label, OAI.MaxCutGames.Explicit.MachineProductRow.instruction, OAI.MaxCutGames.Explicit.MachineProductRow.Ready
- theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.row_table_lookupline 400Source documentation
Indexing a flattened constant-width row list preserves the literal field position, not merely the multiset of row contents.
theorem row_table_lookup (constraints : List (Constraint n q)) (e : Fin constraints.length) (field : Fin (q + 2)) : (constraints.flatMap constraintWords)[(q + 2) * e.val + field.val]? = (constraintWords constraints[e])[field.val]? := by … - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.inputTableline 421 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.inputTable_sourceline 423 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.inputTable_targetline 428 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.inputTable_imageline 433 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.reverseDigitsline 440 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.reverseDigits_atline 443 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.reverseDigits_wordsline 446 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.horner_ofFinline 459 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.sourceCommandline 465 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.targetCommandline 466 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.imageCommandline 467 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.commandsline 472Source documentation
The complete fixed-alphabet row schedule: two endpoints followed by every forward-table entry in increasing numeric label order.
def commands (q t : ℕ) : List (MachineProductRow.Command t) := …
Mentions: OAI.MaxCutGames.Explicit.MachineProductRow.Command
- theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.commands_lengthline 475 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.fieldsline 478 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.fieldValueline 482 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.source_fieldsline 487 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.target_fieldsline 492 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.image_fieldsline 497 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.selectedline 507Source documentation
Every scheduled lookup selects an actual word in the input table.
theorem selected (H : Instance q) (edges : Fin t → Fin H.constraints.length) (c : MachineProductRow.Command t) (hc : c ∈ commands q t) (i : Fin t) : (inputTable H)[(q + 2) * (edges i).val + c.2 i]? = some (fields H edges c i) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductRow.Command, OAI.MaxCutGames.Explicit.ProductMachineSemantics.commands, OAI.MaxCutGames.Explicit.ProductMachineSemantics.inputTable, OAI.MaxCutGames.Explicit.ProductMachineSemantics.fields
- theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.command_offset_ltline 519 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.fields_ltline 530 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.source_valueline 543 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.target_valueline 550 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.image_valueline 557 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.encodeWords_map_inline_ProductMachineSemanticsline 567 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.rowBits_eqline 575Source documentation
The controller's literal field-command output is the serialized semantic row, including every forward permutation-table entry.
theorem rowBits_eq (H : Instance q) (presentation : SimpleBipartite H) (t : ℕ) (ht : 0 < t) (i : Fin (H.constraints.length ^ t)) : MachineProductRow.rowBits (fieldValue H (finFunctionFinEquiv.symm i)) (commands q t) = encodeWords (constraintWords (ProductPaddedOutput.outputRow H presentation t ht i)) := by …Mentions: OAI.MaxCutGames.Explicit.MachineProductRow.rowBits, OAI.MaxCutGames.Explicit.ProductMachineSemantics.fieldValue, OAI.MaxCutGames.Explicit.ProductMachineSemantics.commands, OAI.MaxCutGames.Explicit.ProductPaddedOutput.outputRow
- theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.encodeWords_flatMap_inline_ProductMachineSemanticsline 601 - def
OAI.MaxCutGames.Explicit.ProductMachineSemantics.allRowsBitsline 609Source documentation
Product rows are emitted in ascending radix address, exactly the literal order of the output constraint list.
def allRowsBits (H : Instance q) (t : ℕ) : List Bool := …
- theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.allRowsBits_eqline 613 - theorem
OAI.MaxCutGames.Explicit.ProductMachineSemantics.gameBits_eqline 629Source documentation
Concatenating the three computed headers and all physical row fields yields precisely the target serialization, including list order and full tables.
theorem gameBits_eq (H : Instance q) (presentation : SimpleBipartite H) (t : ℕ) (ht : 0 < t) : encodeWords [H.vertices ^ t, q ^ t, H.constraints.length ^ t] ++ allRowsBits H t = gameBits (ProductPaddedOutput.output H presentation t ht) := by …Mentions: OAI.MaxCutGames.Explicit.ProductMachineSemantics.allRowsBits, OAI.MaxCutGames.Explicit.ProductPaddedOutput.output
- def
OAI.MaxCutGames.Explicit.MachineProductPower.digitsline 651 - theorem
OAI.MaxCutGames.Explicit.MachineProductPower.value_eqline 653 - abbrev
OAI.MaxCutGames.Explicit.MachineProductPower.Labelline 660 - def
OAI.MaxCutGames.Explicit.MachineProductPower.instructionline 662 - def
OAI.MaxCutGames.Explicit.MachineProductPower.stepsline 669 - theorem
OAI.MaxCutGames.Explicit.MachineProductPower.powerTraceline 674Source documentation
Header powers are computed from a unary input radix, not stored in an unbounded register. Only the output accumulator changes at the boundary.
theorem powerTrace (slots : MachineHorner.Layout (exponent + 1) ↪ K) (output : K) (outside : ∀ i, output ≠ slots i) (labels : Label exponent → Λ) (exit : Option Λ) (program : Λ → TM2.Stmt (fun _ : K => Bool) Λ (MachineHorner.State σ)) (atLabels : ∀ l, program (labels l) = instruction slots output labels exit l) (base : K → List Bool) (radix : Nat) (radixWord : base (slots (.inl 0)) = encodeWord radix) (digitWords : ∀ i : Fin (exponent + 1), base (slots (.inr i)) = encodeWord (digits i.val)) (clean : MachineHorner.Clean slots base) (fieldEmpty : base (slots (.inl 3)) = []) (ambient : σ) (register : Option Bool) : (advance (TM2.step program))^[steps radix exponent] (some ⟨some (labels (.inl .start)), ((ambient, ()), register), base⟩) = some ⟨exit, ((ambient, ()), none), …Mentions: OAI.MaxCutGames.Explicit.MachineProductPower.Label, OAI.MaxCutGames.Explicit.MachineProductPower.instruction, OAI.MaxCutGames.Explicit.MachineProductPower.digits, OAI.MaxCutGames.Explicit.MachineProductPower.steps
- def
OAI.MaxCutGames.Explicit.MachineProductPower.timePolynomialline 716 - theorem
OAI.MaxCutGames.Explicit.MachineProductPower.steps_leline 720