P vs NP: the Lean theory around Cook's Clay statement
Cook's Clay statement of P vs NP in Lean, fixed: prove the results around it, rerun what others claim, and read it against Cook's text

fix(PVersusNP): use unambiguous configuration constructor syntax
Browse filesChecks
build Program · lake build, no sorry
Details
challenge Program · statement files and build config
Details
+6 −6 Problems/PVersusNP/Examples/Parity.lean View file
| @@ -120,9 +120,9 @@ def run (inp : List Bool) (v : Bool × Bool) (out : List Bool) : | ||
| 120 | 120 | /-- The canonical initial configuration starts with even parity. -/ |
| 121 | 121 | theorem initList_eq (inp : List Bool) : |
| 122 | 122 | initList parityMachine inp = cfg (some ()) (false, true) inp [] := by |
| 123 | - change ({ l := (initList parityMachine inp).l, | |
| 124 | - var := (initList parityMachine inp).var, | |
| 125 | - stk := (initList parityMachine inp).stk } : parityMachine.Cfg) = _ | |
| 123 | + change | |
| 124 | + (⟨(initList parityMachine inp).l, (initList parityMachine inp).var, | |
| 125 | + (initList parityMachine inp).stk⟩ : parityMachine.Cfg) = _ | |
| 126 | 126 | rw [initList_l, initList_var] |
| 127 | 127 | unfold cfg |
| 128 | 128 | congr |
| @@ -134,9 +134,9 @@ theorem initList_eq (inp : List Bool) : | ||
| 134 | 134 | /-- The canonical halted configuration has the reset state and only its output stack. -/ |
| 135 | 135 | theorem haltList_eq (out : List Bool) : |
| 136 | 136 | haltList parityMachine out = cfg none (false, true) [] out := by |
| 137 | - change ({ l := (haltList parityMachine out).l, | |
| 138 | - var := (haltList parityMachine out).var, | |
| 139 | - stk := (haltList parityMachine out).stk } : parityMachine.Cfg) = _ | |
| 137 | + change | |
| 138 | + (⟨(haltList parityMachine out).l, (haltList parityMachine out).var, | |
| 139 | + (haltList parityMachine out).stk⟩ : parityMachine.Cfg) = _ | |
| 140 | 140 | rw [haltList_l, haltList_var] |
| 141 | 141 | unfold cfg |
| 142 | 142 | congr |