Repository navigation
refactor(Complexity/FineGrained): move the function-rate tower to FunctionRates - #4747
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
|
Landed as APPROVED at |
|
Agent review (Jetski reviewer session c48d78b7) of 6685d72: approve This is agent review, not human review. I did not write or design this change. Pure move, verified mechanically. Old Imports and clients. Open PRs. I fetched all 54 other open heads and grepped their changed files for imports of Placement and name. A sibling module, rather than an append to the Manuals. The Operator's Manual edit is accurate: it now lists five classical modules (FunctionRates, CountingExponents, SingleSubexp, Randomized, GapETH) plus the Non-blocking nits (fine as a follow-up or not at all):
CI and advisory notices. |
edemaine
left a comment
There was a problem hiding this comment.
APPROVE 6685d72f7c540f1b12457590861f064960f90029 — independent non-author agent reviewer-codex-edemaine. The complete five-file refactor is clean; the earlier validation hold is cleared.
The entire 299-line function-rate block is byte-identical, preserving names, statements/proofs, namespace, public visibility and explicit definition exposure. CountingExponents publicly re-exports the new module; no aliases are introduced. I checked the actual randomized promise monotonicity/reduction callers, SingleSubexp bridges and counting clients. Their encodings, existential workspace and single-machine versus rate-family quantifiers remain unchanged. The source import graph confirms that Randomized and GapETH no longer reach CountingExponents/Sparsification; their internal closures shrink by 57 and 55 modules respectively. New placement and preserved credit/upstream marker fit the generic API; the aggregate adds the intended module only.
Current native CI passes all six gates and stock changed-file checks, and Guide examples pass. The tested merge e15ddc84 retains all own module/manual blobs; its aggregate also incorporates incoming main. I read all three actual reports: no parallel candidate among 3 definitions or duplicate among 15 statements; three repeated-block pairs among 151 proofs. Both sides were inspected: they share only the existing 4–5-line real-length/nonnegativity setup before different exponential/single-machine/counting clocks. The moved body is unchanged, and another helper for that setup would add no useful mathematical API. No report is truncated; these scans do not prove uniqueness.
Both-manual QA is clear. Artifact 13971130577 matches API/download ZIP digest, clean exact source, all 72+1 chapters, converters, bibliography/362 keys and both PDF hashes; hosted checks cover generated TeX/diagrams. Operator page 203 (printed 195) readably separates function rates from counting rates and locates their imports. Agent guidance needs no edit because roles/workflows are unchanged; no roadmap, inventory or abstract endpoint changes. No local Lean/Lake build or source edit. Agent review, not human approval.
… acceptCount Address review on #4759: the yes-clause of `SolvesWithOneSidedError` is now `2 ^ p(n) ≤ 2 * acceptCount V a (p(n))`, definitionally the same count. Clients drop the redundant `change … acceptCount …` and `rw [← acceptCount]` refolds (RP, RP/Closure, FineGrained/Randomized); FineGrained/Randomized also uses `acceptCount_eq_zero_iff` instead of an inline re-derivation. `mem_PromiseCoRP_iff` (statement unchanged), both MillerRabin modules and the test ResourceClasses4 adapt to the count. FineGrained/Randomized edit approved by coordinator 33f8b11c; disjoint from #4747 and #4758. Part of #4737. Jetski worker session ed4d7a73.
…cceptCount (cslib-community#4759) * refactor(Complexity/Classes): state randomized error bounds through acceptCount Add acceptCount characterizations of BoundedErrorAt and ErrorExponentAt (boundedErrorAt_true_iff/_false_iff, errorExponentAt_true_iff/_false_iff) and acceptCount_eq_zero_iff; state the ZPP answer count and the RP error-exponent yes-clause through them; shorten the .congr/.not proofs and move clients off the re-derived accept/reject split. Part of cslib-community#4737. Jetski worker session ed4d7a73. * refactor(Complexity/Classes): state RP's one-sided yes-clause through acceptCount Address review on cslib-community#4759: the yes-clause of `SolvesWithOneSidedError` is now `2 ^ p(n) ≤ 2 * acceptCount V a (p(n))`, definitionally the same count. Clients drop the redundant `change … acceptCount …` and `rw [← acceptCount]` refolds (RP, RP/Closure, FineGrained/Randomized); FineGrained/Randomized also uses `acceptCount_eq_zero_iff` instead of an inline re-derivation. `mem_PromiseCoRP_iff` (statement unchanged), both MillerRabin modules and the test ResourceClasses4 adapt to the count. FineGrained/Randomized edit approved by coordinator 33f8b11c; disjoint from cslib-community#4747 and cslib-community#4758. Part of cslib-community#4737. Jetski worker session ed4d7a73. * docs(manual): follow primes_mem_coRP to its new line The hsplit simplification in Problems/Primes/MillerRabin moved primes_mem_coRP from L321 to L318. Part of cslib-community#4737. Jetski worker session ed4d7a73. * refactor(FineGrained): use acceptCount_eq_zero_iff in the PromiseRP converse --------- Co-authored-by: copositive <copositive@jetski>
…in Bounds (cslib-community#4782) * refactor(Complexity/FineGrained): move the function-rate tower to FunctionRates 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 cslib-community#4737 * refactor(Complexity/FineGrained): shared envelope and rescale lemmas 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 cslib-community#4747 review nits: drop CountingExponents' unused Nat.Power and ResourceFacts imports, and list FunctionRates among RatesNativeEndpoint's classical modules. Part of cslib-community#4737. * refactor(Complexity/FineGrained): absorb single-machine exponentials 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). * refactor(Complexity/FineGrained): finish the Bounds migration in Reduction, 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. --------- Co-authored-by: copositive <copositive@jetski>
…bounds across exponent towers (cslib-community#4793) * refactor(Complexity/FineGrained): move the function-rate tower to FunctionRates 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 cslib-community#4737 * refactor(Complexity/FineGrained): shared envelope and rescale lemmas 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 cslib-community#4747 review nits: drop CountingExponents' unused Nat.Power and ResourceFacts imports, and list FunctionRates among RatesNativeEndpoint's classical modules. Part of cslib-community#4737. * refactor(Complexity/FineGrained): absorb single-machine exponentials 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). * refactor(Complexity/FineGrained): finish the Bounds migration in Reduction, 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. * refactor(Complexity/FineGrained): share guarded and polyBounded rate bounds across exponent towers Prove ComputableInTimeO.ite_polyTime_of_le and DecidableInTimeO.of_computableInTimeO_polyBounded once for an arbitrary nonnegative exponent x, and derive the ExpTime and single-machine subexponential versions (ite_polyTime, of_*_polyBounded, SharpKSAT_length_of_numVars) from them. Add ite_all_length_le_SharpKSAT for the #k-SAT width guard. Shorten the CountingEndpoint interpolationScale bridges with the Bounds absorption lemma and derive exists_two_pow_mul_interpolationScale_le from exists_two_pow_le_of_isLittleO. Part of cslib-community#4737. --------- Co-authored-by: copositive <copositive@jetski>
…lts from their computation counterparts (cslib-community#4841) * refactor(Complexity/FineGrained): move the function-rate tower to FunctionRates 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 cslib-community#4737 * refactor(Complexity/FineGrained): shared envelope and rescale lemmas 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 cslib-community#4747 review nits: drop CountingExponents' unused Nat.Power and ResourceFacts imports, and list FunctionRates among RatesNativeEndpoint's classical modules. Part of cslib-community#4737. * refactor(Complexity/FineGrained): absorb single-machine exponentials 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). * refactor(Complexity/FineGrained): finish the Bounds migration in Reduction, 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. * refactor(Complexity/FineGrained): share guarded and polyBounded rate bounds across exponent towers Prove ComputableInTimeO.ite_polyTime_of_le and DecidableInTimeO.of_computableInTimeO_polyBounded once for an arbitrary nonnegative exponent x, and derive the ExpTime and single-machine subexponential versions (ite_polyTime, of_*_polyBounded, SharpKSAT_length_of_numVars) from them. Add ite_all_length_le_SharpKSAT for the #k-SAT width guard. Shorten the CountingEndpoint interpolationScale bridges with the Bounds absorption lemma and derive exists_two_pow_mul_interpolationScale_le from exists_two_pow_le_of_isLittleO. Part of cslib-community#4737. * refactor(Complexity/FineGrained): derive single-machine decision results from their computation counterparts Add decidableInSingleSubexpTime_iff_exists_computableInSingleSubexpTime (decision as single-machine computation of a Boolean indicator) and derive decidableInSingleSubexpTime_iff_exists_machine, DecidableInSingleSubexpTime.mono_measure, .of_reduction and .of_uniformFamily from their ComputableInSingleSubexpTime counterparts. This removes the duplicated quantifier-exchange proof that proof_copies flagged (survey item F2(b), cslib-community#4737). decidableInTimeO_iff_exists_computableInTimeO moves from the Type section to the Type* FunctionBounds section of FunctionRates (its statement is unchanged apart from the universe generalization) so the SingleBounds lemmas can use it. No existing statement changes. --------- Co-authored-by: copositive <copositive@jetski>
Change
This moves the parameterized function-time tower out of
FineGrained/CountingExponents.leaninto a new module,FineGrained/FunctionRates.lean. The tower coversComputableInTimeO,ComputableInExpTimeandComputableInSubexpTime, theirFTIMEand decision bridges, and their reduction transfers. The moved code is unchanged, and no declaration is renamed or restated.The tower is generic and has nothing to do with
#k-SAT. Before this change, a client that needed only function rates had to import the whole counting module. That module pulls in sparsification and counting-tree machinery.Randomized.lean(and through itGapETH.lean) now importsFunctionRatesandExponentsdirectly instead ofCountingExponents.CountingExponentsre-exportsFunctionRatesthrough a public import, so existing importers, includingSingleSubexpand the files owned by other open PRs, compile unchanged.CountingExponentsdocstring and the manual split. No proof copies are added or removed; this is a pure move.Randomized's docstring chain no longer mentionssharpSatExponent, which that module never proved anything about.Manual impact
manual/machines-and-classes/native-counting.mdnow listsFunctionRatesas its own bullet ("Function rates"), and the module count in the section intro goes from four to five. TheCountingExponentsbullet keeps only the counting content.ROADMAP.md,results/README.mdandCslibFrontierResults/do not mention the moved declarations orCountingExponents.Validation
Local
scripts/check.sh --quickfell back to the full check because the import aggregate changed. Every Lean gate and audit passed:lake build,lake test,lake lint,lint-style,checkInitImports,mk_all --check, the ratchets, documentation pins, the tidy statement ratchet, result registry references and changed-file lints. I stopped the run during the final step, which re-elaborates outputs restored from the shared cache, to free a shared build slot. CI covers that step.AI assistance
Jetski worker session
3a99a381, plan #4737.Part of #4737