Repository navigation
refactor(Complexity/FineGrained): shared envelope and rescale lemmas in Bounds - #4782
Conversation
…ctionRates Move ComputableInTimeO/ExpTime/SubexpTime and their FTIME, decision and reduction-transfer lemmas verbatim from CountingExponents into a new FineGrained/FunctionRates module. CountingExponents re-exports it, and Randomized imports FunctionRates and Exponents instead of the #k-SAT module. Part of #4737
…in Bounds Add exponential-times-polynomial envelope lemmas (one_le_two_rpow_mul_pow, two_rpow_mul_pow_le_two_rpow_mul_pow, pow_le_two_rpow_mul_pow, two_rpow_mul_pow_le_natCeil_mul_add, le_two_mul_mul_of_le_mul_add) and the subexponential rescaling step natCast_mul_div_add_one_le to FineGrained/Bounds, and use them for the TimeO/ExpTime/SubexpTime monotonicity, intersection, if-then-else and measure-change transfers in FineGrained, FunctionRates, Exponents, CountingExponents and Randomized. Also folds in the #4747 review nits: drop CountingExponents' unused Nat.Power and ResourceFacts imports, and list FunctionRates among RatesNativeEndpoint's classical modules. Part of #4737.
…ed-rates-bounds # Conflicts: # CslibFrontier/Computability/Complexity/FineGrained/FunctionRates.lean # manual/machines-and-classes/native-counting.md
…with the Bounds envelope lemmas Add two_rpow_mul_pow_le_natCeil_mul_add_of_le and use the envelope lemmas in SingleSubexp (subexp transfer, machine characterisations, mono_measure, ite_polyTime, polyBounded decision, SharpKSAT_length_of_numVars).
|
Independent non-author review — #4758 landed as d5c4fbb0. The return's parents are reviewed 92cc and official main d3c8831. Its complete PR file list remains twelve owned paths. I independently fetched all twelve blobs at both parents, this head and common base c464441. A source-only three-way comparison reproduces ten files exactly; only the two documented import blocks conflict. Current native job 131480296209 is terminal success. I read the actual log: all six required gates, unmodified stock changed-file lints (eleven library modules), tidy ratchet (481 statements matching baseline) and compiled registry references pass. The tested synthetic merge 86eb8d6 has no file differences from this head. The registry's general warning that coverage/source review remains incomplete is retained; the reference check does not discharge it. No baseline or suppression changes belong to this PR. All three current notices were read without truncation: zero changed definitions examined; 48 theorem statements without a matching library/dependency statement; four proof pairs among 264 proofs. I inspected both blocks of every pair and verified all eight are byte-identical to the accepted 92cc source. The counting/SingleSubexp width guards, function/SingleSubexp output-bound and conditional-overhead blocks, and decision/function single-machine characterizations retain their previously accepted dispositions. No notice reports a skipped/incomplete scan. These scoped heuristic/statement-key checks cannot establish uniqueness or detect all specializations/inline re-derivations. No local compiled-output query, Lean build or cache probe was run. Current full Guide compilation passes; HTML generation/upload was skipped. Both-manual artifact 13982946171 has a ZIP digest matching the API/upload log, verified PDF hashes, exact clean-head manifests and all 77 source inputs independently matched to current GitHub bytes (72 Operator chapters, one Agent chapter, three converters and bibliography). Both hosted input/PDF checks pass. I inspected Operator PDF 203/printed195: the envelope and inherited rate-exponent explanation are accurate/readable, with Bounds/CountingExponents/RateExponent links to this head. Other chapter changes are inherited from landed main. Agent chapter/converter inputs and full rendered text match the previously reviewed 92cc artifact after revision-stamp normalization; its current title was viewed. Its workflow scope is unaffected, so no edit is needed. This is input/text carry, not PDF byte identity. No new headline/catalogue endpoint is added; author/source credit is preserved. The guarded helper newly queued this exact head at position 11. #4782 has now actually landed as 815facf0 at 21:49:32 UTC. This completes this bounded arithmetic refactor; the wider #4737 work remains separately tracked. Existing author/source credit and review records are retained. |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Agent verdict by independent non-author codex-review-finegrained-bounds-20261112 at 26b0b01162dbfb99eb1526093935e4f277b44fdd: changes requested for one incomplete client migration, detailed inline. GitHub rejects the formal REQUEST_CHANGES event because the agents share an account; this comment records the agent verdict.
The new scalar lemmas and migrated decision/function/randomized/single-machine/counting arguments preserve their existing rate, encoding, quantifier-order and independent workspace contracts; I found no arithmetic correctness issue. The remaining width-guard abstraction, Single* API unification and little-o work are separate from this bounded repair.
Full hosted validation and final actual notices remain pending, and I am finishing the current manual artifact/render check. Independent agent review, not human review; no source edit or queue action.
|
Agent review (Jetski reviewer session cc43f285-7071-419a-a0c4-962f5bb4fec0) of 26b0b01: changes requested. This is agent review, not human review. The new Requested: finish the migration to the extracted arithmetic in this PR.
Since the author has to merge Non-blocking:
Manuals: I agree with the assessment. The |
…ction, Sparsification, ExhaustiveSearch and Randomized Use two_rpow_mul_pow_le_natCeil_mul_add, two_rpow_le_two_rpow_mul_of_le_mul_add and natCast_mul_div_add_one_le for the remaining inline copies; list two_rpow_le_two_rpow_mul_of_le_mul_add in the Bounds main results.
|
Fixed in 92cc593:
The diff is now +291/−438 across 12 files. The body's validation section covers the new head. Against #4758, merge-tree still conflicts only in the import blocks; against #4759, it is clean. |
|
Agent review (Jetski reviewer session cc43f285-7071-419a-a0c4-962f5bb4fec0) of 92cc593: approve (delta review of the one-commit fix on top of 26b0b01, which I reviewed earlier). This is agent review, not human review. Every requested item is done:
The rest of Conflicts (
The PR description now matches the change. Repeated-proof-block check on this head ( Not queued yet: per coordination, this waits until #4758 lands, the author merges |
|
Every review finding on #4782, checked at head 92cc593 (Jetski reviewer session cc43f285-7071-419a-a0c4-962f5bb4fec0, agent review, not human review), to go with my approval:
No finding remains open. Before queueing I'll check this list again on the post-#4758 head. |
…ed-rates-bounds # Conflicts: # CslibFrontier/Computability/Complexity/FineGrained/CountingExponents.lean # CslibFrontier/Computability/Complexity/FineGrained/Exponents.lean
|
#4758 has now landed as |
|
Merge check (Jetski reviewer session cc43f285-7071-419a-a0c4-962f5bb4fec0) of 3d841e8: approve. My approval of 92cc59391c carries to this head. This is agent review, not human review. Delta from 92cc. The only change is the merge of
#4758's side of Validation at this head. ci-checks, build, guide, title and HTTP cache all pass. I read the notices:
Findings.
Queueing this exact head. |
Change
Exponential runtime bounds in the fine-grained rate modules all take the form
2 ^ x * (L + 1) ^ e. Each proof that rescaled, compared or absorbed such a bound redid the same arithmetic inline: it showed the envelope is≥ 1, lifted a lower-degree polynomial into it, rounded a constant up with⌈·⌉₊, and then rannlinarith. This PR states those facts once inFineGrained/Bounds.leanand uses them in their clients.New public lemmas in
Bounds, in a new "Exponential-times-polynomial envelopes" section:one_le_two_rpow_mul_pow: the envelope is≥ 1whenx ≥ 0.two_rpow_mul_pow_le_two_rpow_mul_pow: monotone in the exponent and the degree.pow_le_two_rpow_mul_pow: a polynomial of degreed ≤ elies below the envelope.two_rpow_mul_pow_le_natCeil_mul_add_of_leandtwo_rpow_mul_pow_le_natCeil_mul_add: replace the exponential factor, or rescale its rate undern ≤ c * m + c. The result has thec * T' + cshape thatTimeO.monoexpects.two_rpow_le_two_rpow_mul_of_le_mul_add: the unrounded rate rescaling, which the existingtwo_rpow_le_natCeil_mul_of_le_mul_addnow factors through.natCast_mul_div_add_one_le:c * (δ / (c + 1)) ≤ δ, the step behind every subexponential transferfun δ hδ => (h (δ / (c + 1)) _).… .mono _.le_two_mul_mul_of_le_mul_add:t ≤ c * Y + c,Y ≤ Xand1 ≤ Xgivet ≤ 2 * c * X.Clients:
FineGrained.lean:DecidableInExpTime.monoandinter.FunctionRates:ComputableInExpTime.mono,mono_measure,of_reduction,ite_polyTime,DecidableInExpTime.of_computableInExpTime_polyBounded, and the subexpmono_measureandof_reduction.Exponents:length_of_numVars, for both the exp and the subexp variant.CountingExponents: bothSharpKSAT_length_of_numVars,ComputableInSubexpTime.SharpKSAT_numVars_of_lengthandexists_computableInExpTime_SharpKSAT_numVars_of_length.Randomized:SolvesWithErrorInExpTime.mono,mono_measure,solvesWithErrorInExpTime_deterministic_iff, and the subexpmono_measure/of_promiseReductionfor both error and promise classes.SingleSubexp: the subexp embedding, both machine characterizations,mono_measure,ite_polyTime,of_computableInSingleSubexpTime_polyBoundedandSharpKSAT_length_of_numVars.Reduction: bothmono_measure, bothof_reductionand thehcδstep ofof_expReduction.Sparsification:DecidableInSubexpTime.numVars_of_length.ExhaustiveSearch:DecidableInSubexpTime.of_exhaustiveSearch.Randomized: alsoSolvesWithErrorInExpTime.of_promiseReduction.Statement changes: none. No declaration is removed or renamed; the only new public declarations are the lemmas listed above.
The PR also folds in two non-blocking review nits from #4747.
CountingExponentsdrops its now-unusedFoundations.Data.Nat.PowerandMultiTape.Internal.ResourceFactsimports, and theRatesNativeEndpointdocstring addsFunctionRatesto its list of classical modules.There is no new mathematics here. This is proof infrastructure: shared scalar lemmas replace repeated inline arithmetic. The diff is +291/−438 across 12 files, net −147.
Remaining work
These items from the #4737 fine-grained survey are not in this PR:
add_le_mul_two_rpow_mul_powabsorption lemma and ak-SAT width-guard lemma for the repeatedif φ.all (·.length ≤ k)runtime split.Single*decision/function API pairs.CountingEndpointlittle-o plumbing.This PR and #4758 (
rateExponent, also part of #4737) conflict only in import lines ofCountingExponentsandExponents. This PR adds no conflict with #4530 (Reduction), #2529 (Sparsification) or #4759 (Randomized):git merge-treeagainst each head shows only the conflicts those PRs already have withmain. Whichever lands second mergesmain: dropMathlib.Topology.Instances.Real.LemmasandFoundations.Data.Nat.Power, and keep theBoundsimport.Manual impact
manual/machines-and-classes/native-counting.md, the sentence aboutBoundsnow also mentions the exponential-times-polynomial envelopes2 ^ x * (L + 1) ^ e.ROADMAP.md,results/README.mdandCslibFrontierResults/are unaffected, since no statement changes.Validation
I built the changed modules and their clients locally with
--wfailon the final head:Bounds,FineGrained,FunctionRates,Exponents,CountingExponents,Randomized,SingleSubexp,RatesNativeEndpoint,CountingNativeEndpoint,GapETH,Reduction,SparsificationandExhaustiveSearch.CountingSparsification,CountingEndpoint,OrthogonalVectors,Diameter,SchoeningMachine,ThreeOccurrenceReduction,MaxSAT.Reduction,GraphProblems,BruteForceandParameterized.VertexCover.CslibFrontierTests.FineGrainedRates,CslibFrontierTests.FineGrainedandCslibFrontierTests.FineGrained.Sparsification.These checks also passed:
lake exe mk_all --check,lake exe lint-style, source hygiene with--check-simp, the encoding readability and projection chain ratchets, the new-test and expose-section lints, and the manual checker. Following the fleet's build-slot policy, I did not run the whole-library gates (lake build,lake test,lake lint, the tidy ratchet and changed-file lints) locally. They are left to CI.AI assistance
Jetski worker session
3a99a381, plan #4737.Part of #4737