refactor(NumberTheory): Golf 100 files#38144
refactor(NumberTheory): Golf 100 files#38144yuanyi-350 wants to merge 15 commits intoleanprover-community:masterfrom
Conversation
This reverts commit 5a25d45.
PR summary 00427301b0Import changes exceeding 2%
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.NumberTheory.FLT.Polynomial | 1406 | 1669 | +263 (+18.71%) |
| Mathlib.NumberTheory.Padics.PadicNorm | 931 | 934 | +3 (+0.32%) |
| Mathlib.NumberTheory.Padics.Hensel | 1745 | 1746 | +1 (+0.06%) |
Import changes for all files
| Files | Import difference |
|---|---|
15 filesMathlib.AlgebraicGeometry.Sites.ElladicCohomology Mathlib.NumberTheory.Cyclotomic.CyclotomicCharacter Mathlib.NumberTheory.Harmonic.Int Mathlib.NumberTheory.Ostrowski Mathlib.NumberTheory.Padics.AddChar Mathlib.NumberTheory.Padics.Hensel Mathlib.NumberTheory.Padics.MahlerBasis Mathlib.NumberTheory.Padics.PadicIntegers Mathlib.NumberTheory.Padics.PadicNumbers Mathlib.NumberTheory.Padics.ProperSpace Mathlib.NumberTheory.Padics.RingHoms Mathlib.NumberTheory.Padics.ValuativeRel Mathlib.NumberTheory.Padics.WithVal Mathlib.RingTheory.DividedPowers.Padic Mathlib.RingTheory.WittVector.Compare |
1 |
Mathlib.NumberTheory.Padics.PadicNorm |
3 |
Mathlib.NumberTheory.FLT.Polynomial |
263 |
Declarations diff
No declarations were harmed in the making of this PR! 🐙
You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.
No changes to technical debt.
This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
These actually look pretty reasonable. Nice work! If you could split into smaller PRs, that would make reviewing easier and quicker (some of these are clearer improvements than others, and some will require more specialized reviewing knowledge to make sure that the new proofs are using the API in a healthy maintainable way). Also, you should change the title of the PR to avoid scaring off reviewers :) |
This PR selectively ports part of #38144 and only migrates the changes in: - `Mathlib/NumberTheory/FactorisationProperties.lean` Concretely, this PR: - rewrites `Prime.not_pseudoperfect` to use `Prime.properDivisors` and `Finset.sum_le_sum_of_subset` directly, instead of analyzing the powerset of proper divisors by cases - shortens `Prime.not_perfect` to the direct consequence of `Prime.not_pseudoperfect` - refactors `Prime.deficient_pow` to reuse `properDivisors_prime_pow` and a simple mapped-sum identity, instead of reproving the structure of the proper divisors of a prime power inline
|
Can you mark this PR as depend on the other smaller PRs (so that this PR doesn't show up on queue)? |
|
@tb65536 , done! |
…38280) - refactors `Cyclotomic/Basic` by rewriting `nonempty_algEquiv_adjoin_of_isSepClosed` around `AlgHom.fieldRange_eq_map` and `IntermediateField.adjoin_map` - replaces the manual adjoin induction with direct `adjoin_le_iff` inclusions for the cyclotomic roots Extracted from #38144 , migrate from #38202 [](https://gitpod.io/from-referrer/)
|
This pull request has conflicts, please merge |
…38277) - refactors `NumberField/Norm` by moving `isUnit_norm_of_isGalois` after `dvd_norm` and shortening its proof to a direct application of `dvd_norm` together with `isUnit_of_dvd_unit` Extracted from #38144 [](https://gitpod.io/from-referrer/)
…8351) - golfs `ADEInequality` by replacing repeated `inv_le_inv₀` proof blocks with direct applications of `inv_anti₀` - shortens `lt_three`, `lt_four`, and `lt_six` by removing the now-unneeded fixed-denominator positivity witnesses Extracted from #38144 [](https://gitpod.io/from-referrer/)
This PR is an experimental project. In this PR, we use an Agent to automatically scan and attempt to simplify proofs. We hope to eventually effectively golf 100 files and avoid reinventing the wheel in mathlib.
We have chosen
Mathlib/NumberTheoryas the testing ground.If this experiment is very successful and accepted by the mathlib community, we would be honored to open source it.
The relevant projects includes
Mathlib/MeasureTheory.Mathlib/Analysis.This PR serves as an index. For the actual code review, please refer to the individual PRs linked below. Each of those PRs modifies only a single file to facilitate the review process.
FactorisationProperties#38204Mathlib/NumberTheory/NumberField/Norm#38277Mathlib/NumberTheory/ArithmeticFunction/Zeta#38278Mathlib/NumberTheory/NumberField/Basic#38279Mathlib/NumberTheory/Cyclotomic/Basic#38280Mathlib/NumberTheory/ADEInequality#38351Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas#38402Mathlib/NumberTheory/LSeries/AbstractFuncEq#38403