OAI/Computability/MaxCut/PCP/Generator.lean
127 declarations, 0 contain sorry, 0 declared as axioms
Executable directed-dart tables for the fixed 64-label alphabet
The header gives vertex and dart counts. Every dart has one ordered row:
tail index, reverse-dart index, and 4096 Boolean predicate entries. Entry
b + 64 * a is the predicate at labels (a,b). All fields, including bits
as 0/1 words, use the existing zero-delimited unary natural-word codec.
The decoder checks all index bounds, row counts, predicate lengths, reverse involution, predicate transpose, and absence of trailing fields. Directed rows preserve loops, self-reversing darts, and repeated constraint occurrences. The size theorems concern the full encoded table, not a machine runtime.
- def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.prefixPolynomialline 17 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.timePolynomialline 20 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.beforeFinishline 24 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.enterFinishInTimeline 28 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.prefixInTimeline 44 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.output_emptyline 60 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.halted_configurationline 67 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.outputInTimeline 86 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.computableInPolyTimeline 112 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.finite_work_alphabetsline 127 - def
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.forErrorComputableInPolyTimeline 133 - theorem
OAI.MaxCutGames.Foundations.Hastad.SourceGenerator.forError_finite_work_alphabetsline 141 - structure
OAI.MaxCutGames.Foundations.PCP.ConstraintGraphline 153 - def
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.headline 164 - theorem
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.head_reverseline 166 - def
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.edgeSatisfiedline 170 - theorem
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.edgeSatisfied_reverseline 173 - def
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.Satisfiableline 179 - def
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.rejectedDartsline 182 - def
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.rejectionCountline 185 - theorem
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.mem_rejectedDartsline 188 - theorem
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.rejectionCount_leline 193 - theorem
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.rejected_exists_of_not_satisfiableline 197 - theorem
OAI.MaxCutGames.Foundations.PCP.ConstraintGraph.rejectionCount_positiveline 209 - abbrev
OAI.MaxCutGames.Foundations.PCP.GraphTables.Labelline 237 - abbrev
OAI.MaxCutGames.Foundations.PCP.GraphTables.RelationTableline 238 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationIndexline 241Source documentation
The fixed row-major ordering of the complete predicate table.
def relationIndex : Label × Label ≃ Fin 4096 := finProdFinEquiv
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationIndex_valline 243 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationAtline 246 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationOfline 249 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationAt_relationOfline 252 - structure
OAI.MaxCutGames.Foundations.PCP.GraphTables.DartRowline 257Source documentation
The row itself is finite data; index bounds are checked while parsing.
structure DartRow (vertices darts : Nat) where …
- abbrev
OAI.MaxCutGames.Foundations.PCP.GraphTables.Rowsline 262 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.reverseAtline 264 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.acceptsAtline 267 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.Validline 271Source documentation
The two graph laws are decidable finite checks on the stored rows.
def Valid {n m : Nat} (rows : Rows n m) : Prop := … - instance
OAI.MaxCutGames.Foundations.PCP.GraphTables.(instance at line 275)line 275 - structure
OAI.MaxCutGames.Foundations.PCP.GraphTables.Tableline 279 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowListline 286Source documentation
The ordered list serialized by the codec. Equal rows remain separate.
def rowList (table : Table) : List (DartRow table.vertices table.darts) := table.rows.toList
Mentions: OAI.MaxCutGames.Foundations.PCP.GraphTables.Table, OAI.MaxCutGames.Foundations.PCP.GraphTables.DartRow
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowList_lengthline 288 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.semanticsline 292Source documentation
Decode validated finite data into the actual constraint-graph semantics.
def semantics (table : Table) : ConstraintGraph (Fin table.vertices) (Fin table.darts) Label where …
Mentions: OAI.MaxCutGames.Foundations.PCP.GraphTables.Table, OAI.MaxCutGames.Foundations.PCP.ConstraintGraph, OAI.MaxCutGames.Foundations.PCP.GraphTables.Label
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_reverseline 303 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_tailline 306 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_acceptsline 309 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.graphRowsline 312 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.reverseAt_graphRowsline 315 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.acceptsAt_graphRowsline 320 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.graphRows_validline 325 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.ofGraphline 333 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_ofGraph_reverseline 336 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_ofGraph_tailline 341 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_ofGraph_acceptsline 347 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_ofGraph_edgeSatisfiedline 352 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.constraintGraph_ext_inline_GraphTablesline 357 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_ofGraphline 372Source documentation
Complete semantic graph roundtrip, including its actual reversal map.
@[simp] theorem semantics_ofGraph {n m : Nat} (G : ConstraintGraph (Fin n) (Fin m) Label) : semantics (ofGraph G) = G := by …Mentions: OAI.MaxCutGames.Foundations.PCP.ConstraintGraph, OAI.MaxCutGames.Foundations.PCP.GraphTables.Label, OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics, OAI.MaxCutGames.Foundations.PCP.GraphTables.ofGraph
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.semantics_ofGraph_rejectionCountline 381 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.enumeratedGraphline 389Source documentation
Explicit enumerations determine every vertex name, dart position, and predicate label. No hidden choice of a graph representation is made.
def enumeratedGraph {V E A : Type*} {n m : Nat} (G : ConstraintGraph V E A) (vertexOrder : V ≃ Fin n) (dartOrder : E ≃ Fin m) (labelOrder : A ≃ Label) : ConstraintGraph (Fin n) (Fin m) Label where …Mentions: OAI.MaxCutGames.Foundations.PCP.ConstraintGraph, OAI.MaxCutGames.Foundations.PCP.GraphTables.Label
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.enumeratedGraph_edgeSatisfiedline 405 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.enumeratedGraph_rejectionCountline 414Source documentation
Every directed occurrence contributes once before and after enumeration.
theorem enumeratedGraph_rejectionCount {V E A : Type*} [Fintype E] {n m : Nat} (G : ConstraintGraph V E A) (vertexOrder : V ≃ Fin n) (dartOrder : E ≃ Fin m) (labelOrder : A ≃ Label) (labeling : V → A) : (enumeratedGraph G vertexOrder dartOrder labelOrder).rejectionCount (fun v => labelOrder (labeling (vertexOrder.symm v))) = G.rejectionCount labeling := by …Mentions: OAI.MaxCutGames.Foundations.PCP.ConstraintGraph, OAI.MaxCutGames.Foundations.PCP.GraphTables.Label, OAI.MaxCutGames.Foundations.PCP.GraphTables.enumeratedGraph
- def
OAI.MaxCutGames.Foundations.PCP.GraphTables.ofEnumeratedGraphline 426 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.bitWordline 430 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseBitline 432 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseBit_bitWordline 437 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseBits_bitWordsline 440 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationWordsline 446 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationWords_lengthline 448 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseRelationline 451 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseRelation_encodedline 457 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowWordsline 464 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseRowline 467 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseRow_encodedline 475 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseRowsline 483 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.parseRows_encodedline 491 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.tableWordsline 497 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBitsline 500 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.decodeTableWordsline 502 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.decodeTableWords_encodedline 513 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.decodeTableBitsline 521 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.decodeTableBits_encodedline 524 - def
OAI.MaxCutGames.Foundations.PCP.GraphTables.encodingline 529Source documentation
A concrete encoding suitable for the existing TM2 computation interface.
def encoding : Computability.Encoding Table Bool where …
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBits_injectiveline 534 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowWords_lengthline 536 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowsWords_lengthline 539 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.tableWords_lengthline 545 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.tableWords_length_le_bitsline 552Source documentation
At least one unary delimiter is stored for every field, including all 4096 entries of every predicate table.
theorem tableWords_length_le_bits (table : Table) : 2 + 4098 * table.darts ≤ (tableBits table).length := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GraphTables.Table, OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBits
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.relationBits_length_leline 557 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowBits_length_leline 565 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.rowsBits_length_leline 574 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBits_length_leline 586Source documentation
Full unary size bound: headers, both bounded indices in every row, and every Boolean predicate entry are counted. This is not a runtime assertion.
theorem tableBits_length_le (table : Table) : (tableBits table).length ≤ table.vertices + table.darts + 2 + table.darts * (table.vertices + table.darts + 8192) := by …Mentions: OAI.MaxCutGames.Foundations.PCP.GraphTables.Table, OAI.MaxCutGames.Foundations.PCP.GraphTables.tableBits
- theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.vertices_le_tableBits_lengthline 595 - theorem
OAI.MaxCutGames.Foundations.PCP.GraphTables.darts_le_tableBits_lengthline 601 - structure
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.PortGraphline 615 - abbrev
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Edgeline 619 - abbrev
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walkline 620 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.nextline 624 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rot_rotline 626 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.walkEndline 629 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.walkEnd_nilline 633 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.walkEnd_consline 635 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.walkEnd_appendline 638 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.splitHeadline 645Source documentation
Exposes the first dart and the independent remaining port word.
def splitHead (V D : Type*) (n : Nat) : Walk V D (n + 1) ≃ ((V × D) × (Fin n → D)) where …Mentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk
- def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rotateHeadline 657Source documentation
Advance across the first edge while retaining its reverse port.
def rotateHead (G : PortGraph V D) (n : Nat) : Walk V D (n + 1) ≃ Walk V D (n + 1) := …
Mentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.PortGraph, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk
- theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rotateHead_vertexline 661 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rotateHead_zeroline 664 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rotateHead_succline 667 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.permutePortsline 672Source documentation
Relabeling time coordinates is a bijection on actual port words.
def permutePorts {t : Nat} (σ : Fin t ≃ Fin t) : Walk V D t ≃ Walk V D t where …Mentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk
- def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.wordEndline 686 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.endpointline 690 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.natCard_walkline 693 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.headTailEquivline 697 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.advanceTailline 708 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.edgeAtline 712Source documentation
The dart at the indicated time, computed by the actual preceding steps.
def edgeAt (G : PortGraph V D) : (n : Nat) → Walk V D (n + 1) → Fin (n + 1) → Edge V D | 0, w, _ => (w.1, w.2 0) | n + 1, w, k => Fin.cases (w.1, w.2 0) (fun j => edgeAt G n (advanceTail G w) j) k /-- Isolate any actual path edge. Previously traversed ports are replaced by their arrival ports, so the change of coordinates remains invertible. -/Mentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.PortGraph, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Edge, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.advanceTail
- def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.pivotEquivline 720Source documentation
Isolate any actual path edge. Previously traversed ports are replaced by their arrival ports, so the change of coordinates remains invertible.
def pivotEquiv (G : PortGraph V D) : (n : Nat) → Fin (n + 1) → (Walk V D (n + 1) ≃ (Edge V D × (Fin n → D))) | 0, _ => splitHead V D 0 | n + 1, k => Fin.cases (splitHead V D (n + 1)) (fun j => (rotateHead G (n + 1)).trans ((headTailEquiv V D (n + 1)).trans ((Equiv.prodCongr (pivotEquiv G n j) (Equiv.refl D)).trans (headTailEquiv (Edge V D) D n).symm))) kMentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.PortGraph, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Edge, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.splitHead, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rotateHead, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.headTailEquiv
- theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.pivotEquiv_fstline 730 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.edgeAt_portline 744 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.pivotEquiv_zero_applyline 760 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.pivotEquiv_succ_applyline 764 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.projectedFiberEquivline 771 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.projectedEventEquivline 783 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.natCard_edgeAt_fiberline 802Source documentation
Every fixed dart has exactly the same number of path realizations.
theorem natCard_edgeAt_fiber (G : PortGraph V D) (n : Nat) (k : Fin (n + 1)) (a : Edge V D) : Nat.card {w : Walk V D (n + 1) // edgeAt G n w k = a} = Nat.card D ^ n := by …Mentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.PortGraph, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Edge, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.edgeAt
- theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.natCard_edgeAt_eventline 812Source documentation
The exact event count underlying the uniform-pivot probability law.
theorem natCard_edgeAt_event (G : PortGraph V D) (n : Nat) (k : Fin (n + 1)) (P : Edge V D → Prop) : Nat.card {w : Walk V D (n + 1) // P (edgeAt G n w k)} = Nat.card {a : Edge V D // P a} * Nat.card D ^ n := by …Mentions: OAI.MaxCutGames.Foundations.PCP.PoweringWalks.PortGraph, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Edge, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.Walk, OAI.MaxCutGames.Foundations.PCP.PoweringWalks.edgeAt
- def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.leftFromPivotline 822 - def
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rightFromPivotline 828 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.leftFromPivot_zeroline 835 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rightFromPivot_zeroline 839 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.leftFromPivot_actualline 844 - theorem
OAI.MaxCutGames.Foundations.PCP.PoweringWalks.rightFromPivot_actualline 863