mathlib4 review helperopen PRs by @wwylele on leanprover-community/mathlib4

← queue

#46708 feat(RingTheory): move ideal antidiagonally across a comm diagram of localization

t-ring-theory CI success

+23 −5 · 2 files · 1 commit · head 68d94ff · updated 7 days ago · Files changed on GitHub

PR description

The statement of this is similar to Ideal.under_map_eq_map_under, but requiring localization while dropping maximal ideal. With this, a downstream statement IsLocalization.AtPrime.liesOver_map_of_liesOver gets its proof simplified and P.IsPrime dropped.

AI usage: this lemma was discovered when I was asking Claude to develop a personal project. The statement was suggested by Claude. The proof was written by me.


Conversation on GitHub 1
github-actions[bot] · comment · 2026-11-29
PR summary 68d94ff04e
Import changes for modified files

No significant changes to the import graph

<details><summary>Import changes for all files</summary>

|Files|Import difference| |-|-|

</details>


<details><summary>

Declarations diff (regex)

</summary>

+ under_map_eq_map_under <details> <summary>You can run this locally as follows</summary>

## 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>

</details>

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

</details>

Declarations diff (Lean)

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

  • +1 new declarations
  • −0 removed declarations
+IsLocalization.under_map_eq_map_under

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

Current commit 68d94ff04e Reference commit 02a839bc62

This script lives in the undefined 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/RingTheory/Localization/AtPrime/Extension.lean +2 −5

theorem liesOver_comap_of_liesOver {T : Type*} [CommRing T] [Algebra R T] [Algeb
70 exact comap_liesOver Q p <| IsScalarTower.toAlgHom R S T
72include p in
theorem liesOver_map_of_liesOver changedL73–76
−theorem liesOver_map_of_liesOver [Algebra R Sₚ] [IsScalarTower R S Sₚ] [IsScalarTower R Rₚ Sₚ]
− [P.IsPrime] :
73theorem liesOver_map_of_liesOver [Algebra R Sₚ] [IsScalarTower R S Sₚ] [IsScalarTower R Rₚ Sₚ] :
74 (P.map (algebraMap S Sₚ)).LiesOver (IsLocalRing.maximalIdeal Rₚ) := by
75 rw [liesOver_iff, eq_comm, ← map_eq_maximalIdeal p, over_def P p]
− exact under_map_eq_map_under _
− (over_def P p ▸ map_eq_maximalIdeal p Rₚ ▸ maximalIdeal.isMaximal Rₚ)
− (isPrime_map_of_liesOver S p Sₚ P).ne_top
76 exact under_map_eq_map_under p.primeCompl P
78attribute [local instance] Ideal.Quotient.field

Mathlib/RingTheory/Localization/Ideal.lean +21 −0

lemma map_eq_top_of_not_subset {I : Ideal R} (hle : ¬ (I : Set R) ⊆ Mᶜ) :
288 · exact Ideal.mem_map_of_mem (algebraMap R _) hy
289 · exact IsLocalization.map_units _ (⟨y, hny⟩ : M)
theorem under_map_eq_map_under newL291–310
291/--
292Consider the following commutative diagram of ring maps, with both vertical map being localization
293```
294A → B
295↓ ↓
296Aₘ → Bₘ
297```
298and let `I` be an ideal of `B`. The ideal of `Aₘ` under the image of `I` in `Bₘ` is equal to the
299image in `Aₘ` of the ideal of `A` under `I`
300-/
301theorem under_map_eq_map_under {A Aₘ B Bₘ : Type*} [CommSemiring A] [CommSemiring Aₘ]
302 [CommSemiring B] [CommSemiring Bₘ] [Algebra A Aₘ] [Algebra A B] [Algebra B Bₘ] [Algebra A Bₘ]
303 [Algebra Aₘ Bₘ] [IsScalarTower A B Bₘ] [IsScalarTower A Aₘ Bₘ] (M : Submonoid A)
304 [IsLocalization M Aₘ] [IsLocalization (Algebra.algebraMapSubmonoid B M) Bₘ] (I : Ideal B) :
305 (I.map (algebraMap B Bₘ)).under Aₘ = (I.under A).map (algebraMap A Aₘ) := by
306 ext x
307 obtain ⟨⟨y, z⟩, rfl⟩ := IsLocalization.mk'_surjective M x
308 simp_rw [Ideal.mem_comap, algebraMap_mk' B Aₘ Bₘ, mk'_mem_map_algebraMap_iff,
309 Algebra.algebraMapSubmonoid, Submonoid.mem_map, Ideal.mem_comap]
310 grind
312end CommSemiring
314section CommRing
0/2 declarations checked

Your review, as Markdown

Paste it as a comment or a review on the PR. Line links to the head commit unfold into code snippets on GitHub.