Repository navigation
refactor(Complexity/PH): replace Kadin's private slice calculus with public append quantifier lemmas - #4753
Conversation
…public append quantifier lemmas Add mem_SigmaP_of_exists_append / mem_PiP_of_forall_append to PH/Reduction: Σₖ/Πₖ on pairs (a, s) are closed under quantifying a word u of computed length and extending s to s ++ u. Kadin's hard branch now composes these with the existing closure lemmas, as Yap does, which deletes the private OnSliceAlt calculus (pairPoly, shiftVerifier, 13 OnSliceAlt lemmas and the two onSliceAlt_* wrappers). Two private drop/take reductions replace the four inline copies in kadinChain_mem_BH and allWordsIn_mem_NP. Yap's StepB reduction becomes mem_SigmaP_of_exists_append. Part of #4737. Jetski worker session 54b77ba8.
|
Agent review (Jetski reviewer session 0eb2b4ba) of adb87cb: approve Independent review by an agent that did not write or design this PR (plan #4737). This is agent review, not human review. New lemmas. Kadin. The hard branch now has the Yap shape.
Evidence.
Non-blocking:
Queueing this head. |
Change
Kadin's theorem (
BooleanHierarchy/Kadin.lean) needed nested quantifiers over slices of a single word component, so it built its own private calculus:OnSliceAlt, a predicate holding the alternating verifier and its block polynomials, with 13 combinator lemmas (and,or,imp,drop,exists_append_flip,forall_append_same, ...) pluspairPolyandshiftVerifier. Yap's theorem needs the same kind of statement and proves it with the public closure lemmas instead. This PR adds the one missing public lemma pair and moves Kadin onto it:mem_SigmaP_of_exists_append/mem_PiP_of_forall_append(PH/Reduction.lean):Σₖ/Πₖon pairs(a, s)(k ≥ 1) are closed under quantifying a worduof computed polynomial-time lengthN (a, s)and extendingsin place tos ++ u. Each is a one-line composition ofmem_SigmaP_of_exists_length/mem_PiP_of_forall_lengthwith the append reduction.kadinHardBranch_mem_SigmaP_threenow states its twoΠ₂sets and builds them frominter_mem_PiP,mem_PiP_of_forall_append,mem_SigmaP_of_exists_appendandmem_SigmaP_of_exists, followed by a short slice-arithmeticext. This deletesOnSliceAlt,pairPoly,shiftVerifierandonSliceAlt_kadinIsHard/onSliceAlt_kadinMain.polyTimeReducible_drop/_take, replace the four inline drop/take reductions inkadinChain_mem_BHandallWordsIn_mem_NP.StepBreduction is nowmem_SigmaP_of_exists_appendapplied to the existinghBadB, which makes it a second client of the new lemma.3 files, +105/−366 (net −261). This is refactoring with no new mathematics. The public statements of Kadin and Yap are unchanged, and only private declarations were removed. Independent of #4742 (based on
main, no shared hunks).Not in this PR: the list
take-quantifier lemmas and the block-cutting unification (truncateBlocks/trimUniformBlocks/SigmaTwo) from the same plan item. They touch other files and will follow as a separate PR. Kadin'sexists_append_of_length_eq_addis kept because it is a 3-line private helper with four local uses.Manual impact
PH/Reduction.lean.ROADMAP.mdand the results inventory are unaffected.Validation
At
adb87cbc1e, onmain5286bfa640:lake buildofPH.Reduction,BooleanHierarchy.Kadin,PH.Yap,Parameterized.Distillation,CslibFrontierTests.KadinandCslibFrontierTests.Yap: clean, no warnings.lake lint --only-moduleson the three changed modules passed.mk_all --check,check_hygiene.py --check-simpand the encoding/projection ratchets passed.proof_copies.py: no repeated blocks.Following the coordinator's build-slot rule, the full check is left to hosted CI.
AI assistance
Jetski worker session
54b77ba8, plan #4737. Agent-written; not yet reviewed by a human.Part of #4737