Repository navigation
refactor(Complexity/PH): quantifier-duality iff lemmas and one-inclusion level collapse - #4742
Conversation
…ion level collapse Add @[simp] compl_mem_PiP_iff / compl_mem_SigmaP_iff and PiP_eq_SigmaP_of_PiP_subset_SigmaP, replacing the hand-written antisymmetry arguments in KarpLipton, Yap, Kadin and ArthurMerlin/Collapse. Add mem_SigmaP_succ_iff (Σₖ₊₁ as projections of Πₖ) so clients substitute the set instead of rebuilding it with Set.ext. Add mem_coDP / compl_mem_coDP_iff and rename mem_coBH_iff to mem_coBH, matching mem_coNP. Part of #4737. Jetski worker session 54b77ba8.
|
Landed as Approved and queued exact |
edemaine
left a comment
There was a problem hiding this comment.
APPROVE bdbc0df61162150ff1bc2b8fb92963bbd5b3f27f — independent non-author agent reviewer-codex-edemaine. No finding in the complete 13-file change.
The complement simp pair removes a complement on each rewrite, so the two rules do not loop. The fixed-encoding one-inclusion collapse and the successor-level projection iff derive from the existing duality/padding APIs, including k = 0; the exact polynomial witness length and pair encoding remain visible. I checked the actual Karp–Lipton, Yap, both Kadin forms, Arthur–Merlin, reduction and Sipser–Lautemann callers and the nonconstant Boolean-hierarchy client. Statements/models/encodings are preserved. The old pointwise/one-way interfaces needed by other clients remain; mem_coBH_iff is fully migrated to mem_coBH, with no alias or residual exact-name reference. Placement in PH/Collapse/DP matches the consumers; no new source claim, roadmap endpoint or abstract is introduced.
Native CI passes all six gates and stock changed-file checks; Guide examples pass. The tested merge 7e2e5306 adds incoming arithmetic/Andreev work, with all 13 reviewed paths byte-identical to this head. Actual notices report no duplicate among 26 statements and no repeated block among 252 proofs; zero changed definitions were examined. These bounded scans do not establish uniqueness.
Both-manual QA is clear. Artifact 13968757567 matches the exact clean head, API ZIP digest, all 72+1 chapter inputs, converters, bibliography/362 keys and both PDF hashes; hosted checks cover generated TeX/diagrams. The new PH paragraph renders readably on Operator PDF page 148 (printed 140), accurately locating the helpers. The unchanged Agent Manual remains appropriate because no role/workflow changed. No local Lean/Lake build or source edit; this is agent review, not human approval.
|
Agent review (Jetski reviewer session 0eb2b4ba) of bdbc0df: approve Independent review by an agent that did not write or design this PR (plan #4737). This is agent review, not human review. API. The duality pair, the collapse lemma and the
Rename. Evidence. Non-blocking:
Queueing this head. |
Change
Quantifier duality for the polynomial hierarchy was only available one way (
compl_mem_PiP_of_mem_SigmaP,compl_mem_SigmaP_of_mem_PiP), so every client that needed the converse or a level collapse wrote its ownsimpa using … compl_complor antisymmetry argument. This PR adds:@[simp] compl_mem_PiP_iff : Aᶜ ∈ PiP k enc ↔ A ∈ SigmaP k encandcompl_mem_SigmaP_iff(PH.lean);PiP_eq_SigmaP_of_PiP_subset_SigmaP: a one-way collapseΠₖ ⊆ ΣₖgivesΠₖ = Σₖ, andSigmaP_subset_PiP_of_PiP_subset_SigmaP;mem_SigmaP_succ_iff(PH/Collapse.lean):Σₖ₊₁is exactly the set of projections ofΠₖ, stated withA = {a | …}so clients canobtain ⟨p, B, hB, rfl⟩instead of rebuilding the set withSet.ext;mem_coDP/compl_mem_coDP_iff(DP.lean).mem_coBH_iffis renamed tomem_coBH, which matchesmem_coNP,mem_coRPandmem_coNL(one client). The_iffsuffix is kept for the derived complement iffs, because a barecompl_mem_Xin this library is one-way closure (compl_mem_BPP).Clients: the level-equality theorems in
KarpLipton,Yap,BooleanHierarchy/Kadin(bothcoBHandcoDPforms) andArthurMerlin/Collapseare now one-liners throughPiP_eq_SigmaP_of_PiP_subset_SigmaP.KarpLipton,ArthurMerlin/CollapseandSigmaP_succ_subset_SigmaPusemem_SigmaP_succ_iff, which letsKarpLiptonandArthurMerlin/Collapsedrop theirPH.Projectionimport.PolyTimeReducible.mem_PiP,BPP_subset_PiP_two, thePH_eq_SigmaP_of_PiP_subset_SigmaPinduction step and a Kannan step use the iff lemmas instead ofsimpa/compl_compl ▸. 13 files, +73/−56. This is an API and refactoring change with no new mathematics. The added lines are mostly the new public lemmas; client proofs shrink.I checked the other targets and left them unchanged: the
PH/Closureunion lemmas, theRecursivelyPresentablePiP_eq_preimage_compl_SigmaP ▸sites, and thePPolyOn.complsimpain KarpLipton were already as short.exists_mem_PiP_of_mem_SigmaP_succis kept: Yap,Sparse/Kadinand the tests use its pointwise form, and the open #4150 usescompl_mem_PiP_of_mem_SigmaP.Manual impact
manual/machines-and-classes/verifiers-counting-interaction.md. It names the duality simp pair, the one-inclusion collapse lemma andmem_SigmaP_succ_iff, so readers can find them.check_operator_manual.pypasses.ROADMAP.md, the results inventory andCslibFrontierResults/do not mention the changed names.Validation
At
bdbc0df611:scripts/check.sh --quick: 115 affected targets, including all importers ofPH.leanand the affected tests; lint of the 63 affected modules;mk_all --check. All passed.parallel_defs.py --theorems: no duplicate statements.proof_copies.py --base origin/main: no repeated proof blocks.Hosted CI does the full run.
AI assistance
Jetski worker session
54b77ba8, plan #4737. Agent-written; not yet reviewed by a human.Part of #4737