Skip to content

refactor(RingTheory/Ideal): generalize some absNorm lemmas and move primesEquiv - #45300

Open
xroblot wants to merge 8 commits into
leanprover-community:masterfrom
xroblot:primesequiv-absnorm-cleanup
Open

xroblot wants to merge 8 commits into
leanprover-community:masterfrom
xroblot:primesequiv-absnorm-cleanup

Conversation

@xroblot

@xroblot xroblot commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

This is the clean-up part of #42567, extracted so that the summability work can build on it.

Two divisibility and positivity results about the absolute norm of an ideal are generalized from ℤ to a Dedekind domain, and from prime ideals to proper ideals, with the earlier versions deprecated.

The equivalence between the height-one prime ideals of the integral closure of ℤ in ℚ and the prime numbers is moved to the Dedekind domain files, where it belongs, and redefined through the absolute norm rather than through a generator of the corresponding ideal of ℤ. It now assumes less, and the auxiliary API it used to be built from is deprecated without replacement.

Finally, the equivalence between the height-one spectra of two isomorphic rings is reworked so that the surjectivity proofs have the expected type, which removes the need for a backward.isDefEq option.

The mathematics and design are mine. Claude Code was used as a coding assistant and for the housekeeping around this PR. 🤖

@xroblot xroblot added the WIP Work in progress label Oct 26, 2026
@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

PR summary 7113021a95

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.NumberTheory.Padics.HeightOneSpectrum 2632 2647 +15 (+0.57%)
Import changes for all files
Files Import difference
Mathlib.NumberTheory.Padics.HeightOneSpectrum 15

Declarations diff (regex)

+ Rat.HeightOneSpectrum.primesEquiv
+ absNorm_dvd_absNorm_of_liesOver
+ absNorm_ne_zero_nnreal
+ equivOfRingEquiv_apply_asIdeal
+ equivOfRingEquiv_symm_apply_asIdeal
+ instance : NeZero v.asIdeal := ⟨v.ne_bot⟩
+ primesEquivInt
+ primesEquivInt_apply_coe
+ primesEquivInt_symm_apply_asIdeal
+ primesEquiv_apply_coe
+ primesEquiv_symm_apply_asIdeal
+-+ one_lt_absNorm

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 7113021).

  • +13 new declarations
  • −1 removed declarations
+Ideal.absNorm_dvd_absNorm_of_liesOver
+Ideal.one_lt_absNorm
+IsDedekindDomain.HeightOneSpectrum.equivOfRingEquiv_apply_asIdeal
+IsDedekindDomain.HeightOneSpectrum.equivOfRingEquiv_symm_apply_asIdeal
+IsDedekindDomain.HeightOneSpectrum.instNeZeroIdealAsIdeal
+IsDedekindDomain.HeightOneSpectrum.primesEquiv
+IsDedekindDomain.HeightOneSpectrum.primesEquiv.congr_simp
+IsDedekindDomain.HeightOneSpectrum.primesEquivInt
+IsDedekindDomain.HeightOneSpectrum.primesEquivInt_apply_coe
+IsDedekindDomain.HeightOneSpectrum.primesEquivInt_symm_apply_asIdeal
+IsDedekindDomain.HeightOneSpectrum.primesEquiv_apply_coe
+IsDedekindDomain.HeightOneSpectrum.primesEquiv_symm_apply_asIdeal
+NumberField.HeightOneSpectrum.absNorm_ne_zero_nnreal
-Rat.HeightOneSpectrum.natGenerator.congr_simp

Decrease in strong tech debt: (relative, absolute) = (2.00, 0.00)
Current number Change Type (strong)
1948 -2 backward.isDefEq.respectTransparency.types
No changes to weak technical debt.

Current commit 7113021a95
Reference commit f1070cd4d9

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.py 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).

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 10, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

…rm-cleanup

# Conflicts:
#	Mathlib/RingTheory/Ideal/Int.lean
@mathlib-merge-conflicts mathlib-merge-conflicts Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 11, 2026
Comment thread Mathlib/RingTheory/Ideal/Int.lean Resolved
Comment thread Mathlib/RingTheory/Ideal/Int.lean Resolved
@tb65536 tb65536 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 13, 2026
@xroblot xroblot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 14, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 24, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

…rm-cleanup

# Conflicts:
#	Mathlib/NumberTheory/Padics/HeightOneSpectrum.lean
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants