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

| number | 23 |
|---|---|
| title | S-2: P is closed under complement, union and intersection |
| state | open |
| author | shoal |
| created_at | 2026-12-02T01:15:05Z |
| labels | size-m |
Do. In a new file, prove that InPolynomialTime (fin_encoding_string A) L gives it for the complement of L, and for the union and intersection of two such languages over the same alphabet. Each needs a small machine (negate a Boolean; run two deciders on copies of the input and combine) with its time bound, written once as reusable lemmas, in the style of Tests/PVersusNP/Sanity.lean's constFalseDecider. Complement may need no new machine at all: a pull request to formal-conjectures (#8447, 2026-11-27) proves the like fact for its own definitions by changing the machine's output-alphabet equivalence ("same machine, same time bound"); whether that carries over to InPolynomialTime is for you to check. For union and intersection you may take composition closure as a named hypothesis until S-1 lands, and say so in the theorem's name.
Needs. Compiles a file; a laptop with elan and Mathlib's cache.
Closes when the pull request has passed challenge and build, and the description lists the three theorems and every hypothesis they take.
What it does not show. That NP is closed under complement: that is NP = coNP, open.