Skip to content

refactor(NumberTheory/RamificationInertia): ring-level decomposition and inertia predicates - #41591

Open
xroblot wants to merge 17 commits into
leanprover-community:masterfrom
xroblot:hilbert-ring-predicates
Open

xroblot wants to merge 17 commits into
leanprover-community:masterfrom
xroblot:hilbert-ring-predicates

Conversation

@xroblot

@xroblot xroblot commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Refactor of the decomposition/inertia infrastructure in Hilbert Theory to the level of rings with two new predicates Ideal.IsDecompositionRing G P C and Ideal.IsInertiaRing G P C: for a group G acting on a commutative ring B with prime P, they state that B is Galois over the ring C with Galois group the decomposition group, resp. the inertia group of P.

The old field-level classes and their whole API are deprecated in favor of the ring versions.


Open in Gitpod

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

PR summary 7b42e25396

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ IsDecompositionRing
+ IsDecompositionRing.algebraMap_ringEquiv_apply
+ IsDecompositionRing.algebraMap_ringEquiv_symm_apply
+ IsDecompositionRing.finrank_bot
+ IsDecompositionRing.finrank_top
+ IsDecompositionRing.of_isFractionRing
+ IsDecompositionRing.ringEquiv
+ IsInertiaRing
+ IsInertiaRing.algebraMap_ringEquiv_apply
+ IsInertiaRing.algebraMap_ringEquiv_symm_apply
+ IsInertiaRing.finrank_bot
+ IsInertiaRing.finrank_decompositionRing
+ IsInertiaRing.finrank_top
+ IsInertiaRing.of_isFractionRing
+ IsInertiaRing.ringEquiv
+ inertiaDeg_bot_eq_finrank
+ instance [IsGaloisGroup (inertia G P) R B] : IsInertiaRing G P R
+ instance [IsGaloisGroup (stabilizer G P) R B] : IsDecompositionRing G P R
+ map_comap_bot
+ ramificationIdx_bot_eq_one
+ smul_top
+ stabilizer_bot
+ stabilizer_top
++ inertia_bot
++ inertia_top
++- primesOver_eq_singleton
-++ inertiaDegIn_eq
-++ inertiaDeg_eq
-++ ramificationIdxIn_eq
-++ ramificationIdxIn_eq_and_inertiaDegIn_eq
-++ ramificationIdx_eq

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

  • +44 new declarations
  • −0 removed declarations
+AddSubgroup.inertia_bot
+AddSubgroup.inertia_top
+Ideal.IsDecompositionRing
+Ideal.IsDecompositionRing.algebraMap_ringEquiv_apply
+Ideal.IsDecompositionRing.algebraMap_ringEquiv_symm_apply
+Ideal.IsDecompositionRing.casesOn
+Ideal.IsDecompositionRing.finrank_bot
+Ideal.IsDecompositionRing.finrank_top
+Ideal.IsDecompositionRing.inertiaDegIn_eq
+Ideal.IsDecompositionRing.inertiaDeg_eq
+Ideal.IsDecompositionRing.mk
+Ideal.IsDecompositionRing.of_isFractionRing
+Ideal.IsDecompositionRing.primesOver_eq_singleton
+Ideal.IsDecompositionRing.ramificationIdxIn_eq
+Ideal.IsDecompositionRing.ramificationIdx_eq
+Ideal.IsDecompositionRing.rec
+Ideal.IsDecompositionRing.recOn
+Ideal.IsDecompositionRing.ringEquiv
+Ideal.IsDecompositionRing.toIsGaloisGroup
+Ideal.IsInertiaRing
+Ideal.IsInertiaRing.algebraMap_ringEquiv_apply
+Ideal.IsInertiaRing.algebraMap_ringEquiv_symm_apply
+Ideal.IsInertiaRing.casesOn
+Ideal.IsInertiaRing.finrank_bot
+Ideal.IsInertiaRing.finrank_decompositionRing
+Ideal.IsInertiaRing.finrank_top
+Ideal.IsInertiaRing.mk
+Ideal.IsInertiaRing.of_isFractionRing
+Ideal.IsInertiaRing.rec
+Ideal.IsInertiaRing.recOn
+Ideal.IsInertiaRing.ringEquiv
+Ideal.IsInertiaRing.toIsGaloisGroup
+Ideal.inertiaDeg_bot_eq_finrank
+Ideal.inertia_bot
+Ideal.inertia_top
+Ideal.instIsDecompositionRingOfIsGaloisGroupSubtypeMemSubgroupStabilizer
+Ideal.instIsInertiaRingOfIsGaloisGroupSubtypeMemSubgroupInertia
+Ideal.isDecompositionRing_iff
+Ideal.isInertiaRing_iff
+Ideal.map_comap_bot
+Ideal.ramificationIdx_bot_eq_one
+Ideal.smul_top
+Ideal.stabilizer_bot
+Ideal.stabilizer_top

No changes to strong technical debt.
No changes to weak technical debt.

Current commit 7b42e25396
Reference commit 971f540b1b

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

@github-actions github-actions Bot added the t-number-theory Number theory (also use t-algebra or t-analysis to specialize) label Jul 10, 2026
@xroblot xroblot added the WIP Work in progress label Jul 11, 2026
@xroblot xroblot added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed WIP Work in progress labels Jul 11, 2026
…icates

# Conflicts:
#	Mathlib/RingTheory/Algebraic/Integral.lean
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 30, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/RingTheory/Ideal/Pointwise.lean
Comment thread Mathlib/RingTheory/RamificationInertia/Inertia.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
@loefflerd loefflerd assigned tb65536 and unassigned loefflerd Aug 12, 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 Aug 14, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

…icates

# Conflicts:
#	Mathlib/RingTheory/Ideal/Pointwise.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 Aug 15, 2026
Comment thread Mathlib/Algebra/Group/Subgroup/Basic.lean Outdated
Comment thread Mathlib/Algebra/Group/Subgroup/Basic.lean
Comment thread Mathlib/RingTheory/Ideal/Pointwise.lean Outdated
Comment thread Mathlib/RingTheory/Ideal/Pointwise.lean Outdated
Comment thread Mathlib/RingTheory/RamificationInertia/Inertia.lean Outdated
Comment thread Mathlib/RingTheory/RamificationInertia/Ramification.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
Comment thread Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean Outdated
ramification index and the inertia degree of `p` in `B`. -/
theorem IsDecompositionRing.finrank_top [FaithfulSMul C B] [P.IsPrime] [P.IsDecompositionRing G C] :
Module.finrank C B = p.ramificationIdxIn B * p.inertiaDegIn B := by
by_cases hp : p = ⊥

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we had a predicate for separable residue fields, then we might not need this casework on p.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Oh, I guess I already said this earlier, but I think it's probably worth doing at this stage since it's now materially affecting the proofs, so a future refactor wouldn't just be a simple cut and paste from finite quotients to separable residue fields).

@xroblot xroblot Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're right but I am not really sure what it would look like. Is it something like:

class Ring.HasSeparableResidueFields (A : Type*) [CommRing A] : Prop where
  perfectField (p : Ideal A) [p.IsMaximal] : PerfectField (A ⧸ p)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just ask for Algebra.IsSpearable p.ResidueField q.ResidueField for all prime ideals q/p?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there's also the option of fixing p and defining Ring.HasSeparableResidueFieldsAt since that's probably what's needed in practice.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(The corresponding refactor is on my TODO list)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tb65536 Now that class Algebra.HasSeparableResidueFieldsAt has been added, I am thinking about how to use it in this file. The thing is to be able to use the new class, we need to have p.IsPrime and, in many results, this fact is derived from other hypothesis. Thus we will need to add this hypothesis p.IsPrime at several places to make use of the new class. Mathematically, this is not a problem, but still it will make the lemmas less easy to use. In my opinion, this is the right move, but I wanted to make sure first that you're okay with that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably ok. The other option would be to junk-ify Algebra.HasSeparableResidueFieldsAt at non-primes, but it's not immediately clear to me what the best choice would be for the junk.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quite agree. I'll refactor first what's already there to see what that looks like.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tb65536 tb65536 added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. 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