| @@ -0,0 +1,63 @@ |
| 1 | +# Reductions, completeness and the easy inclusion |
| 2 | + |
| 3 | +This reading addresses [issue 55][issue]. Cook develops the computability analogy on pp. 2–3, then polynomial reductions on pp. 4–5. The frozen file follows the logical pattern but makes the encoding and the machine composition obligations visible. |
| 4 | + |
| 5 | +## Cook's definitions |
| 6 | + |
| 7 | +| Source | Verdict | |
| 8 | +| --- | --- | |
| 9 | +| Section 2, c.e. languages (pp. 2–3) | The verifier characterization matches on ordinary words. `ComputablyEnumerable` requires a *total computable* Boolean checking relation on pairs and an existential certificate over all finite words of one finite alphabet. There is no witness-length bound. On paper one can enumerate these words and test each, accepting on the first success. Conversely a finite accepting history of a recognizing computation is a checkable witness. The Lean definition selects the checking-relation characterization; it does not itself prove the equivalence with machine recognition. [Cook p. 3][p3], [Lean definition][ce] | |
| 10 | +| Definition 1, many-one reduction (p. 3) | Same total mapping and both directions of membership on string inputs. `ManyOneReducible` requires one computable f making x a yes-input exactly when f(x) is a yes-input. The Lean version can also relate arbitrary encoded types and only promises a computation on valid source encodings. [Cook p. 3][p3], [Lean reduction][many] | |
| 11 | +| Definition 2, c.e.-completeness (p. 3) | Both require c.e. membership and reductions **into** the proposed complete language from every c.e. language. Lean generalizes the source to every type equipped with a finite-alphabet encoding. Taking identity encodings of words gives Cook's string instances; the general encoding quantifier is extra. [Cook p. 3][p3], [Lean completeness][cec] | |
| 12 | +| Definition 3, polynomial reduction (p. 4) | Same direction and membership equivalence as Definition 1. `PolynomialTimeReducible` strengthens the certificate to `TM2ComputableInPolyTime` on the specified encodings. In particular f is defined for every value of the source type. For strings, relating its timed machine to Cook's one tape is the separate [machine-model reading](machines.md). [Cook p. 4][p4], [Lean polytime reduction][pred] | |
| 13 | +| Definition 4, NP-completeness (p. 4) | Both require NP membership as well as hardness. Cook ranges over languages of words. `NondeterministicPolynomialTimeComplete` quantifies over every `β : Type`, `FinEncoding β`, and NP predicate on β, including singleton-alphabet encodings. Its machine certificates concern valid codes. Specializing these quantifiers gives string tests. The opposite implication for arbitrary encodings would need a representation argument and does not follow by unfolding. The headline equality does not refer to completeness. [Cook p. 4][p4], [Lean completeness][npc], [equality][equality] | |
| 14 | + |
| 15 | +## Cook's Proposition 1 |
| 16 | + |
| 17 | +* **(a), p. 4.** Run a reduction from the first language to the second, then the second language's P decider. `PolynomialTimeReducible.source_in_p` proves the resulting decider correct by chaining two membership equivalences. It uses the supplied polynomial-time composition principle to obtain the machine computing the composite. [Cook p. 4][p4], [Lean (a)][a], [composition hypothesis][comp] |
| 18 | +* **(b), p. 4.** To show the second language is hard, take an arbitrary NP source, reduce it to the first complete language, then follow the given reduction to the second. The hypothesis that the second language is itself in NP supplies the other half of completeness. `PolynomialTimeReducible.trans` and `NondeterministicPolynomialTimeComplete.transfer` use the same composition hypothesis. [Cook p. 4][p4], [transitivity][trans], [Lean (b)][b] |
| 19 | +* **(c), pp. 4–5.** An NP-complete language in P puts every NP language in P by (a). Full class equality also needs P ⊆ NP. The former conclusion is named separately at line 1720. The version at line 1760 concludes `ClassEquality` from composition, completeness and P membership and uses the concrete projection for the easy inclusion. None of these implications supplies an NP-complete language in P. [Cook p. 5][p5], [hard direction][hard], [full equality][full] |
| 20 | + |
| 21 | +## Row 24 and D8 · Why P is contained in NP |
| 22 | + |
| 23 | +Cook's observation on p. 2 takes the checking relation to ignore its certificate. In the frozen proof the empty word witnesses every yes-input (even with exponent zero). The timed machine still receives a *pair*. The concrete left projection extracts its first word in linear time. Combining that projection with the original decider requires a timed composition certificate. The frozen theorem takes this as an explicit premise. The definitions of the positive equality and its negation themselves take no such premise. [Cook p. 2][p2], [left projection][projection], [verifier and inclusion][inclusion], [Monteverde row 24 and D8][audit] |
| 24 | + |
| 25 | +Monteverde v1.1.1's vendored Cook–Levin development provides `PvsNP.comp`. Its cross-check file applies this theorem to obtain `clay_composition` and then `clay_P_subset_NP` with no composition hypothesis. These are external source results. This reading contributes neither a local rebuild of that dependency nor a SAT completeness proof. The latter has its own project issue. [Composition construction][extcomp], [cross-check][cross], [S-5][sat] |
| 26 | + |
| 27 | +## Audit of the other observations |
| 28 | + |
| 29 | +* **Examples.** The module says its examples are “from the Clay PDF”. Cook discusses SAT and 3-SAT, subset sum, Hamiltonian cycle, clique and three-colouring on p. 5, integer factoring on p. 4, and composite-number testing on p. 2 with the primality result cited as reference 1. Directed reachability (PATH), travelling salesman (including its decision version), and vertex cover are additional examples from the module. Cook's references to Hamiltonian cycles and industrial routing do not name TSP. This qualification concerns attribution. [Module's list][examples], [Cook p. 2][p2], [p. 4][p4], [p. 5][p5], [reference 1][refs] |
| 30 | +* **PDF location.** The module's relative PDF path describes the upstream tree. Shoal's `UPSTREAM.md` explains the reduced import and the omitted PDFs. Use Clay's published PDF to check printed page numbers. [File header][header], [Shoal import note][up], [Clay PDF][p2] |
| 31 | +* **Machine certificate.** `TM2ComputableInPolyTime` is data carrying a machine, a polynomial and correctness. The enclosing `∃` in `InPolynomialTime` asks only whether such data exist, as a proposition. The same pattern appears in the reduction. [Mathlib certificate][math], [predicate][inp], [polynomial reduction][pred] |
| 32 | +* **Encoded domains.** The Definition 4 entry above identifies the enlarged source quantifier. Extending arbitrary predicates on encoded types to total string languages can require recognizing well-formed codes. The declaration provides no general polynomial-time guard for an arbitrary `FinEncoding`. [Complete predicate][npc], [Monteverde's other observations][other] |
| 33 | + |
| 34 | +[issue]: https://shoal.club/shoal/p-vs-np/issues/55 |
| 35 | +[p2]: https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf#page=2 |
| 36 | +[p3]: https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf#page=3 |
| 37 | +[p4]: https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf#page=4 |
| 38 | +[p5]: https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf#page=5 |
| 39 | +[refs]: https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf#page=10 |
| 40 | +[ce]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L232 |
| 41 | +[many]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L204 |
| 42 | +[cec]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L256 |
| 43 | +[pred]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L297 |
| 44 | +[npc]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L331 |
| 45 | +[inp]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L92 |
| 46 | +[equality]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L1535 |
| 47 | +[comp]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L308 |
| 48 | +[a]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L339 |
| 49 | +[trans]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L358 |
| 50 | +[b]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L375 |
| 51 | +[hard]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L1720 |
| 52 | +[full]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L1760 |
| 53 | +[projection]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L1349 |
| 54 | +[inclusion]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L1503 |
| 55 | +[examples]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L32 |
| 56 | +[header]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/Problems/PVersusNP/Millennium.lean#L14 |
| 57 | +[up]: https://shoal.club/shoal/p-vs-np/blob/a6f32235948ab2632158ded1b0104f064af80f65/UPSTREAM.md#L3 |
| 58 | +[math]: https://github.com/leanprover-community/mathlib4/blob/fabf563a7c95a166b8d7b6efca11c8b4dc9d911f/Mathlib/Computability/TuringMachine/Computable.lean#L179-L189 |
| 59 | +[extcomp]: https://github.com/wbnns/monteverde/blob/b51528033908938352f7a4b426494664ac64337a/Vendor/CookLevin/Comp.lean#L613 |
| 60 | +[cross]: https://github.com/wbnns/monteverde/blob/b51528033908938352f7a4b426494664ac64337a/CrossCheck/CookLevin.lean#L42-L53 |
| 61 | +[audit]: https://github.com/wbnns/monteverde/blob/b51528033908938352f7a4b426494664ac64337a/Audit/cook_text_audit.md#L169-L179 |
| 62 | +[other]: https://github.com/wbnns/monteverde/blob/b51528033908938352f7a4b426494664ac64337a/Audit/cook_text_audit.md#L180-L194 |
| 63 | +[sat]: https://shoal.club/shoal/p-vs-np/issues/26 |