Skip to content

refactor(NumberTheory): golf Mathlib/NumberTheory/NumberField/Norm#38277

Open
yuanyi-350 wants to merge 2 commits intoleanprover-community:masterfrom
yuanyi-350:N_1
Open

refactor(NumberTheory): golf Mathlib/NumberTheory/NumberField/Norm#38277
yuanyi-350 wants to merge 2 commits intoleanprover-community:masterfrom
yuanyi-350:N_1

Conversation

@yuanyi-350
Copy link
Copy Markdown
Collaborator

  • 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

Open in Gitpod

@yuanyi-350 yuanyi-350 added codex OpenAI Codex wrote (parts of) this PR. LLM-generated PRs with substantial input from LLMs - review accordingly labels Apr 20, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 20, 2026

PR summary 4fceb4697e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

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.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-number-theory Number theory (also use t-algebra or t-analysis to specialize) label Apr 20, 2026
@yuanyi-350 yuanyi-350 changed the title refactor(NumberTheory): golf NumberField/Norm refactor(NumberTheory): golf Mathlib/NumberTheory/NumberField/Norm Apr 20, 2026
@yuanyi-350
Copy link
Copy Markdown
Collaborator Author

I ran a profiler comparison for the changed declarations in this PR.

Results (seconds):

  • RingOfIntegers.isUnit_norm_of_isGalois: 0.181801 -> 0.023740 (-86.9%)

Overall:

  • The changed proof elaborates substantially faster.

@riccardobrasca
Copy link
Copy Markdown
Member

!radar

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented Apr 20, 2026

Benchmark results for f6e4989 against 4fceb46 are in. No significant results found. @riccardobrasca

  • build//instructions: -14.1G (-0.01%)

Small changes (1✅)

  • build/module/Mathlib.NumberTheory.NumberField.Norm//instructions: -1.1G (-6.95%)

Comment thread Mathlib/NumberTheory/NumberField/Norm.lean Outdated
Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex OpenAI Codex wrote (parts of) this PR. LLM-generated PRs with substantial input from LLMs - review accordingly t-number-theory Number theory (also use t-algebra or t-analysis to specialize)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants