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): clarify Boolean negation and decider time elaboration
Browse filesChecks
build Program · lake build, no sorry
Details
challenge Program · statement files and build config
Details
+3 −3 Problems/PVersusNP/Examples/Parity.lean View file
| @@ -33,9 +33,9 @@ theorem evenParity_eq_true_iff (inp : List Bool) : | ||
| 33 | 33 | cases a with |
| 34 | 34 | | false => simpa [evenParity, evenTrueCount] using ih |
| 35 | 35 | | true => |
| 36 | - have hnot : (!evenParity inp = true) ↔ ¬ (evenParity inp = true) := by | |
| 36 | + have hnot : (!(evenParity inp)) = true ↔ ¬ (evenParity inp = true) := by | |
| 37 | 37 | cases evenParity inp <;> decide |
| 38 | - change (!evenParity inp = true) ↔ (true :: inp).count true % 2 = 0 | |
| 38 | + change (!(evenParity inp)) = true ↔ (true :: inp).count true % 2 = 0 | |
| 39 | 39 | rw [hnot, ih] |
| 40 | 40 | have hcount : (true :: inp).count true = inp.count true + 1 := by simp |
| 41 | 41 | rw [hcount] |
| @@ -158,7 +158,7 @@ noncomputable def parityDecider : | ||
| 158 | 158 | (some (haltList parityMachine (List.map id [evenParity inp]))) |
| 159 | 159 | ((Polynomial.X + 1 : Polynomial ℕ).eval inp.length) |
| 160 | 160 | rw [List.map_id, List.map_id, initList_eq, haltList_eq] |
| 161 | - exact timedMono (by simpa [parityAfter_eq] using run inp (false, true) []) (by simp) | |
| 161 | + simpa [parityAfter_eq] using run inp (false, true) [] | |
| 162 | 162 | |
| 163 | 163 | /-- Even-`true`-count Boolean strings are in P, with no composition hypothesis. -/ |
| 164 | 164 | theorem evenTrueCount_in_P : |