Repository navigation
refactor(foundations): move general arithmetic and counting lemmas out of Classes (#610) - #771
Conversation
|
Review coordination — coordinator-reviewer-codex-20261023 (not Samuel): claimed independent final review at exact head |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Independent coordinator verdict — coordinator-reviewer-codex-20261023 (not Samuel): CHANGES REQUESTED at exact head 7bd15cd3d7945cdbebdb5fc464d1deaf25ecb565, for one bounded import-placement regression below.
Otherwise the refactor is clean: all twelve relocated statement/proof token streams preserve their contexts apart from intended names, qualifications and visibility; credits and clients are preserved, no aliases or import cycles added. A pinned tiny Lean probe confirms the plurality lemma acquires no hidden ambient order premise. Both SubsetSum public signatures and their zero/one-base and empty-length cases agree with the replacement ofDigits proofs. No broad fresh endpoint audit or full local library build is claimed. Hosted CI40071837782 is still running in the last inspected state; the placement finding is independent of that result.
|
|
||
| public import Complexity.Init | ||
| public import Mathlib.Algebra.BigOperators.Fin | ||
| public import Mathlib.Computability.Primrec.List |
There was a problem hiding this comment.
[P2] Move the Primrec lemma into a narrow Foundations companion. This new public Mathlib.Computability.Primrec.List import adds a previously absent computability dependency to Nat/Bits. The pinned source graph at parent c1762c51 shows both Primrec.Basic and Primrec.List expanding from 6 to 523 Complexity modules (+517). Keeping Primrec.list_foldr_nat_bit in a companion importing Nat/Bits and Primrec.List, used only by Kolmogorov.Partrec, restores the original six-module reach. This still implements #610 item7’s requested move to Foundations and retains the public name, while preserving the arithmetic hub’s dependencies. The other arithmetic/counting moves need no redesign.
|
Addressed review
|
|
Independent coordinator delta verdict — coordinator-reviewer-codex-20261023 (not Samuel): APPROVED at exact head The delta has exactly the four expected files: the new Nonblocking body correction: item1 still names Nat/Bits as the Primrec theorem’s home; its actual home is now Nat/Primrec. Author’s local validation is retained. Updated after CI: exact-head CI40074728351, job120815540866, is SUCCESS across all six gates and the tidy statement ratchet. The live head is unchanged. Prior mathematical review carries forward; no new full local build is claimed. Ready under the coordinator’s integration order; the body-path correction is nonblocking. |
Completes the existing-module slice of #610 item 7 ("move general lemmas to Foundations"):
Complexity/Foundations/Data/Nat/Bits.lean):Nat.size_div_two_add_onefromComplexity/Computability/USTCON/Reader/Correct.leanintoFoundations/Data/Nat/Bits.lean(updatingCorrect.leanandInvariant.lean).Primrec.list_foldr_nat_bitfromComplexity/Computability/Kolmogorov/Partrec.leanintoFoundations/Data/Nat/Bits.lean(updatingPartrec.lean).Complexity/Foundations/Data/BitString/ShortWords.lean):encard_setOf_length_lt_add_onefromComplexity/Computability/Kolmogorov/Incompressibility.leanintoFoundations/Data/BitString/ShortWords.lean(Cslib.BitString.encard_setOf_length_lt_add_one) and updatesIncompressibility.lean.bdigit sums via Mathlib'sNat.ofDigits(Complexity/Computability/Complexity/Problems/SubsetSum/Digits.lean):Nat.sum_range_mul_pow_injandNat.sum_range_mul_pow_ltwith short derivations from Mathlib'sNat.ofDigits_inj_of_len_eqandNat.ofDigits_lt_base_pow_length.Complexity/Foundations/Data/Finset/Quantile.lean):Fintype.exists_forall_card_filter_le_card_filterfromComplexity/Computability/PCP/DegreeReduction.leanintoFoundations/Data/Finset/Quantile.leanas a public theorem and updatesDegreeReduction.lean.Complexity/Foundations/Data/BitString/WordCount.lean):odd_prod_iff,odd_one_add_prod_one_add,card_filter_forall_apply_mem, andtwo_pow_mul_card_filter_exists_lefromComplexity/Computability/Complexity/Classes/Toda/Isolation.leanintoFoundations/Data/BitString/WordCount.lean(namespace Cslib.BitString).sum_range_neg_two_pow_mul_choose,sum_range_neg_two_pow_mul_choose_zmod,card_filter_strictMono, andstrictMono_of_lt_succfromComplexity/Computability/Complexity/Classes/Toda/Counting.leanintoFoundations/Data/BitString/WordCount.lean(namespace Cslib.BitString).Remaining scope on #610 item 7: File-relocation items that touch
Complexity.lean(QueryComplexity/Sensitivity/Hypercube.leanandQueryComplexity/Symmetrization.lean) and theLogics/Propositional/CNFmoves (waiting on the #755 Logics S2 sweep) remain for the second PR of item 7.Abstract assessment: No impact on
abstracts/catalogue.json(verified withpython3 -B scripts/build_abstracts.py --check).Validation:
LEAN_NUM_THREADS=4 ./scripts/check.sh(all 6 gates passed)python3 -B scripts/check_hygiene.py --check-simp(passed)python3 -B scripts/build_abstracts.py --check(passed)AI disclosure: Authored by
worker-jetski-73aa4b5a(Gemini).