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): rewrite the run output before weakening its bound
Browse filesChecks
build Program · lake build, no sorry
Details
challenge Program · statement files and build config
Details
+3 −2 Problems/PVersusNP/Examples/Parity.lean View file
| @@ -144,7 +144,6 @@ theorem haltList_eq (out : List Bool) : | ||
| 144 | 144 | funext k |
| 145 | 145 | cases k <;> rfl |
| 146 | 146 | |
| 147 | -set_option pp.all true in | |
| 148 | 147 | /-- The explicit parity machine computes the Boolean answer with time polynomial `X + 1`. -/ |
| 149 | 148 | noncomputable def parityDecider : |
| 150 | 149 | TM2ComputableInPolyTime (fin_encoding_string Bool).encode |
| @@ -159,7 +158,9 @@ noncomputable def parityDecider : | ||
| 159 | 158 | (some (haltList parityMachine (List.map id [evenParity inp]))) |
| 160 | 159 | ((Polynomial.X + 1 : Polynomial ℕ).eval inp.length) |
| 161 | 160 | rw [List.map_id, List.map_id, initList_eq, haltList_eq] |
| 162 | - simpa [parityAfter_eq] using run inp (false, true) [] | |
| 161 | + have h := run inp (false, true) [] | |
| 162 | + rw [parityAfter_eq] at h | |
| 163 | + exact timedMono h (by simp) | |
| 163 | 164 | |
| 164 | 165 | /-- Even-`true`-count Boolean strings are in P, with no composition hypothesis. -/ |
| 165 | 166 | theorem evenTrueCount_in_P : |