feat(ch34): NP-Completeness theorem layer complete (composition, P⊆NP, ≤_P transitivity, complement, union, intersection) - #157
Open
TankTechnology wants to merge 1 commit into
Open
Conversation
…ansitivity, and P closure under complement/union/intersection Green-field Chapter 34 (NP-Completeness) on Mathlib's Turing.TM2ComputableInPolyTime (machine-level polynomial-time computability with Polynomial ℕ time bounds). The theorem layer of Sections 34.1–34.3 is complete and kernel-clean (headline theorems depend only on propext/Classical.choice/Quot.sound). - Framework: Language, PolyTimeComputable, PolyTimeDecidable, ClassP, PolyTimeVerifiable/ClassNP, PolyTimeReducible/NPHard/NPComplete/ClassNPC. - PolyTimeComputable.comp: polytime composition closure, closing Mathlib's proof_wanted TM2ComputableInPolyTime.comp via the shared-stack two-phase TM2 machine Turing.TM2Comp.compMachine (Composition.lean). - ClassP_subset_ClassNP (Theorem 34.2, P ⊆ NP) via the pair-projection machine Turing.Prj.prjMachine (PairProjection.lean). - PolyTimeReducible.trans: transitivity of ≤_P. - ClassP_compl: P closed under complement (Bool.not machine). - ClassP_union / ClassP_inter: P closed under union and intersection via the AND/OR machine Turing.TM2AndOr.andOrMachine (AndOr.lean) — a four-phase TM2 that duplicates the input onto both deciders' stacks, runs M₁ then M₂, and combines the two Bool results with AND/OR. Sections 34.4–34.5 (specific reductions) and open problems (P vs NP) remain documented out of scope. literate.toml, edition map, progress CSV, Progress.lean, README, index, proof map, and the progress-CSV tests are synced; check_repository.py passes. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Green-field Chapter 34 (NP-Completeness) on Mathlib's
Turing.TM2ComputableInPolyTime(machine-level polynomial-time computabilitywith
Polynomial ℕtime bounds). The theorem layer of Sections 34.1–34.3 iscomplete and kernel-clean.
Section 34.1 — Polynomial Time (framework + closure properties)
CLRS.Chapter34.Language/PolyTimeComputable/PolyTimeDecidable/ClassP/mem_ClassP.PolyTimeComputable.comp— polytime composition closure, closing Mathlib'sproof_wanted TM2ComputableInPolyTime.compvia the shared-stack two-phaseTM2 machine
Turing.TM2Comp.compMachine(Composition.lean).PolyTimeDecidable.compl/ClassP_compl—Pclosed under complement(via the
Bool.notmachineTuring.TM2Comp.notMachine).PolyTimeDecidable.union/ClassP_unionandPolyTimeDecidable.inter/ClassP_inter—Pclosed under union and intersection, via the AND/ORmachine
Turing.TM2AndOr.andOrMachine(AndOr.lean): a four-phase TM2 thatduplicates the input onto both deciders' stacks, runs
M₁thenM₂sequentially, and combines the two
Boolresults with AND/OR.Section 34.2 — Polynomial-Time Verification
PolyTimeVerifiable/ClassNP/mem_ClassNP.PolyTimeVerifiable.of_decidableandClassP_subset_ClassNP—P ⊆ NP(Theorem 34.2), via the pair-projection machine
Turing.Prj.prjMachine(
PairProjection.lean).Section 34.3 — NP-Completeness and Reducibility
PolyTimeReducible/NPHard/NPComplete/ClassNPC.PolyTimeReducible.trans— transitivity of≤_Pvia the compositionclosure.
Remaining chapter scope (documented, not
sorry)CLIQUE, VERTEX-COVER, HAM-CYCLE, SUBSET-SUM) are not yet represented.
Pas concrete machine constructions.Verification
lake build CLRSLeanpasses (nosorry/admit; the headline theoremsdepend only on
propext/Classical.choice/Quot.sound).check_repository.pyandcheck_progress_csv.py --write-dashboardpass.index / proof-map / progress-CSV tests synced.
🤖 Generated with Claude Code