Skip to content

Commit 6e59af1

Browse files
committed
feat(RingTheory): finite flat constant rank module over semilocal ring is free (#31241)
https://stacks.math.columbia.edu/tag/02M9 As a consequence, the Picard group of any semilocal ring is trivial.
1 parent cf3061f commit 6e59af1

File tree

9 files changed

+159
-11
lines changed

9 files changed

+159
-11
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5734,6 +5734,7 @@ import Mathlib.RingTheory.Ideal.Pointwise
57345734
import Mathlib.RingTheory.Ideal.Prime
57355735
import Mathlib.RingTheory.Ideal.Prod
57365736
import Mathlib.RingTheory.Ideal.Quotient.Basic
5737+
import Mathlib.RingTheory.Ideal.Quotient.ChineseRemainder
57375738
import Mathlib.RingTheory.Ideal.Quotient.Defs
57385739
import Mathlib.RingTheory.Ideal.Quotient.Index
57395740
import Mathlib.RingTheory.Ideal.Quotient.Nilpotent

Mathlib/LinearAlgebra/TensorProduct/Pi.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ lemma piRight_symm_single (x : N) (i : ι) (m : M i) :
105105
(piRight R S N M).symm (Pi.single i (x ⊗ₜ m)) = x ⊗ₜ Pi.single i m := by
106106
simp [piRight]
107107

108+
/-- Tensor product commutes with finite products on the left.
109+
TODO: generalize to `S`-linear. -/
110+
@[simp] def piLeft : (∀ i, M i) ⊗[R] N ≃ₗ[R] ∀ i, M i ⊗[R] N :=
111+
TensorProduct.comm .. ≪≫ₗ piRight .. ≪≫ₗ .piCongrRight fun _ ↦ TensorProduct.comm ..
112+
108113
end
109114

110115
private def piScalarRightHomBil : N →ₗ[S] (ι → R) →ₗ[R] (ι → N) where

Mathlib/LinearAlgebra/TensorProduct/RightExactness.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ theorem lTensor_exact : Exact (lTensor Q f) (lTensor Q g) := by
290290

291291
/-- Right-exactness of tensor product -/
292292
lemma lTensor_mkQ (N : Submodule R M) :
293-
ker (lTensor Q (N.mkQ)) = range (lTensor Q N.subtype) := by
293+
ker (lTensor Q N.mkQ) = range (lTensor Q N.subtype) := by
294294
rw [← exact_iff]
295295
exact lTensor_exact Q (LinearMap.exact_subtype_mkQ N) (Submodule.mkQ_surjective N)
296296

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/-
2+
Copyright (c) 2025 Junyan Xu. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Junyan Xu
5+
-/
6+
import Mathlib.LinearAlgebra.TensorProduct.Pi
7+
import Mathlib.LinearAlgebra.TensorProduct.RightExactness
8+
import Mathlib.RingTheory.Ideal.Quotient.Operations
9+
10+
/-! # Module version of Chinese remainder theorem
11+
-/
12+
13+
open Function
14+
15+
variable {R : Type*} [CommRing R] {ι : Type*}
16+
variable (M : Type*) [AddCommGroup M] [Module R M]
17+
variable (I : ι → Ideal R) (hI : Pairwise (IsCoprime on I))
18+
19+
namespace Ideal
20+
21+
open TensorProduct LinearMap
22+
23+
lemma pi_mkQ_rTensor [Fintype ι] [DecidableEq ι] :
24+
(LinearMap.pi fun i ↦ (I i).mkQ).rTensor M = (piLeft ..).symm.toLinearMap ∘ₗ
25+
.pi (fun i ↦ TensorProduct.mk R (R ⧸ I i) M 1) ∘ₗ TensorProduct.lid R M := by
26+
ext; simp [LinearMap.pi, LinearEquiv.piCongrRight]
27+
28+
variable [Finite ι]
29+
include hI
30+
31+
attribute [local instance] Fintype.ofFinite
32+
33+
/-- A form of Chinese remainder theorem for modules, part I: if ideals `Iᵢ` of `R` are pairwise
34+
coprime, then for any `R`-module `M`, the natural map `M → Πᵢ (R ⧸ Iᵢ) ⊗[R] M` is surjective. -/
35+
theorem pi_tensorProductMk_quotient_surjective :
36+
Surjective (LinearMap.pi fun i ↦ TensorProduct.mk R (R ⧸ I i) M 1) := by
37+
have := rTensor_surjective M (pi_mkQ_surjective hI)
38+
classical rw [pi_mkQ_rTensor] at this
39+
simpa using this
40+
41+
/-- A form of Chinese remainder theorem for modules, part II: if ideals `Iᵢ` of `R` are pairwise
42+
coprime, then for any `R`-module `M`, the kernel of `M → Πᵢ (R ⧸ Iᵢ) ⊗[R] M` equals `(⋂ᵢ Iᵢ) • M`.
43+
-/
44+
theorem ker_tensorProductMk_quotient :
45+
ker (LinearMap.pi fun i ↦ TensorProduct.mk R (R ⧸ I i) M 1) =
46+
(⨅ i, I i) • (⊤ : Submodule R M) := by
47+
have := rTensor_exact M (exact_subtype_ker_map _) (pi_mkQ_surjective hI)
48+
rw [← (TensorProduct.lid R M).conj_exact_iff_exact, exact_iff] at this
49+
convert this
50+
· classical simp [pi_mkQ_rTensor, LinearMap.comp_assoc]
51+
refine le_antisymm (Submodule.smul_le.mpr fun r hr m _ ↦ ⟨⟨r, ?_⟩ ⊗ₜ m, rfl⟩) ?_
52+
· simpa only [ker_pi, Submodule.ker_mkQ]
53+
rintro _ ⟨x, rfl⟩
54+
refine x.induction_on (by simp) (fun r m ↦ Submodule.smul_mem_smul ?_ ⟨⟩) fun _ _ ↦ ?_
55+
· simpa only [← (I _).ker_mkQ, ← ker_pi] using Subtype.mem _
56+
· simpa using add_mem
57+
58+
end Ideal

Mathlib/RingTheory/Ideal/Quotient/Operations.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,21 @@ noncomputable def quotientInfRingEquivPiQuotient (f : ι → Ideal R)
238238
/-- Corollary of Chinese Remainder Theorem: if `Iᵢ` are pairwise coprime ideals in a
239239
commutative ring then the canonical map `R → ∏ (R ⧸ Iᵢ)` is surjective. -/
240240
lemma pi_quotient_surjective {I : ι → Ideal R}
241-
(hf : Pairwise fun i j ↦ IsCoprime (I i) (I j)) (x : (i : ι) → R ⧸ I i) :
241+
(hf : Pairwise (IsCoprime on I)) (x : (i : ι) → R ⧸ I i) :
242242
∃ r : R, ∀ i, r = x i := by
243243
obtain ⟨y, rfl⟩ := Ideal.quotientInfToPiQuotient_surj hf x
244244
obtain ⟨r, rfl⟩ := Ideal.Quotient.mk_surjective y
245245
exact ⟨r, fun i ↦ rfl⟩
246246

247+
lemma pi_mkQ_surjective {I : ι → Ideal R} (hI : Pairwise (IsCoprime on I)) :
248+
Surjective (LinearMap.pi fun i ↦ (I i).mkQ) :=
249+
fun x ↦ have ⟨r, eq⟩ := pi_quotient_surjective hI x; ⟨r, funext eq⟩
250+
247251
-- variant of `IsDedekindDomain.exists_forall_sub_mem_ideal` which doesn't assume Dedekind domain!
248252
/-- Corollary of Chinese Remainder Theorem: if `Iᵢ` are pairwise coprime ideals in a
249253
commutative ring then given elements `xᵢ` you can find `r` with `r - xᵢ ∈ Iᵢ` for all `i`. -/
250254
lemma exists_forall_sub_mem_ideal
251-
{I : ι → Ideal R} (hI : Pairwise fun i j ↦ IsCoprime (I i) (I j)) (x : ι → R) :
255+
{I : ι → Ideal R} (hI : Pairwise (IsCoprime on I)) (x : ι → R) :
252256
∃ r : R, ∀ i, r - x i ∈ I i := by
253257
obtain ⟨y, hy⟩ := Ideal.pi_quotient_surjective hI (fun i ↦ x i)
254258
exact ⟨y, fun i ↦ (Submodule.Quotient.eq (I i)).mp <| hy i⟩

Mathlib/RingTheory/LocalProperties/Exactness.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ variable {R M N L : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M]
2828
[AddCommMonoid N] [Module R N] [AddCommMonoid L] [Module R L]
2929

3030
variable
31+
(Rₚ : ∀ (P : Ideal R) [P.IsMaximal], Type*)
32+
[∀ (P : Ideal R) [P.IsMaximal], CommSemiring (Rₚ P)]
33+
[∀ (P : Ideal R) [P.IsMaximal], Algebra R (Rₚ P)]
34+
[∀ (P : Ideal R) [P.IsMaximal], IsLocalization.AtPrime (Rₚ P) P]
3135
(Mₚ : ∀ (P : Ideal R) [P.IsMaximal], Type*)
3236
[∀ (P : Ideal R) [P.IsMaximal], AddCommMonoid (Mₚ P)]
3337
[∀ (P : Ideal R) [P.IsMaximal], Module R (Mₚ P)]
38+
[∀ (P : Ideal R) [P.IsMaximal], Module (Rₚ P) (Mₚ P)]
39+
[∀ (P : Ideal R) [P.IsMaximal], IsScalarTower R (Rₚ P) (Mₚ P)]
3440
(f : ∀ (P : Ideal R) [P.IsMaximal], M →ₗ[R] Mₚ P)
3541
[∀ (P : Ideal R) [P.IsMaximal], IsLocalizedModule.AtPrime P (f P)]
3642
(Nₚ : ∀ (P : Ideal R) [P.IsMaximal], Type*)
@@ -76,6 +82,17 @@ theorem exact_of_isLocalized_maximal (H : ∀ (J : Ideal R) [J.IsMaximal],
7682
simp only [mem_range, mem_ker] at this ⊢
7783
exact this x
7884

85+
theorem LinearIndependent.of_isLocalized_maximal {ι} (v : ι → M)
86+
(H : ∀ (P : Ideal R) [P.IsMaximal], LinearIndependent (Rₚ P) (f P ∘ v)) :
87+
LinearIndependent R v :=
88+
let l (P) [IsMaximal P] := Finsupp.mapRange.linearMap (α := ι) (Algebra.linearMap R (Rₚ P))
89+
injective_of_isLocalized_maximal _ (fun P _ ↦ l P) _ f _ fun P _ ↦ by
90+
simp_rw [LinearIndependent, ← LinearMap.coe_restrictScalars R (S := Rₚ _)] at H
91+
convert H P
92+
apply linearMap_ext (S := P.primeCompl) (l P) (f P)
93+
ext
94+
simp [IsLocalizedModule.map_comp, l]
95+
7996
end isLocalized_maximal
8097

8198
section localized_maximal

Mathlib/RingTheory/LocalRing/Module.lean

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ import Mathlib.Algebra.Module.Torsion
88
import Mathlib.LinearAlgebra.Dual.Lemmas
99
import Mathlib.RingTheory.FiniteType
1010
import Mathlib.RingTheory.Flat.EquationalCriterion
11+
import Mathlib.RingTheory.Ideal.Quotient.ChineseRemainder
12+
import Mathlib.RingTheory.LocalProperties.Exactness
1113
import Mathlib.RingTheory.LocalRing.ResidueField.Basic
1214
import Mathlib.RingTheory.LocalRing.ResidueField.Ideal
1315
import Mathlib.RingTheory.Nakayama
1416
import Mathlib.RingTheory.Support
17+
import Mathlib.RingTheory.TensorProduct.Free
1518

1619
/-!
1720
# Finite modules over local rings
@@ -364,3 +367,59 @@ theorem IsLocalRing.split_injective_iff_lTensor_residueField_injective [IsLocalR
364367
exact Module.projective_lifting_property _ _ (Submodule.mkQ_surjective _)
365368

366369
end
370+
371+
namespace Module
372+
373+
open Ideal TensorProduct Submodule
374+
375+
variable (R M) [Finite (MaximalSpectrum R)] [AddCommGroup M] [Module R M]
376+
377+
/-- If `M` is a finite flat module over a commutative semilocal ring `R` that has the same rank `n`
378+
at every maximal ideal, then `M` is free of rank `n`. -/
379+
@[stacks 02M9] theorem nonempty_basis_of_flat_of_finrank_eq [Module.Finite R M] [Flat R M]
380+
(n : ℕ) (rk : ∀ P : MaximalSpectrum R, finrank (R ⧸ P.1) ((R ⧸ P.1) ⊗[R] M) = n) :
381+
Nonempty (Basis (Fin n) R M) := by
382+
let := @Quotient.field
383+
have coprime : Pairwise fun I J : MaximalSpectrum R ↦ IsCoprime I.1 J.1 :=
384+
fun _ _ ne ↦ isCoprime_of_isMaximal (MaximalSpectrum.ext_iff.ne.mp ne)
385+
/- For every maximal ideal `P`, `R⧸P ⊗[R] M` is an `n`-dimensional vector space over the field
386+
`R⧸P` by assumption, so we can choose a basis `b' P` indexed by `Fin n`. -/
387+
have b' (P) := Module.finBasisOfFinrankEq _ _ (rk P)
388+
/- By Chinese remainder theorem for modules, there exist `n` elements `b i : M` that reduces
389+
to `b' P i` modulo each maximal ideal `P`. -/
390+
choose b hb using fun i ↦ pi_tensorProductMk_quotient_surjective M _ coprime (b' · i)
391+
/- It suffices to show `b` spans `M` and is linearly independent when localized at each
392+
maximal ideal. -/
393+
refine ⟨.mk (v := b) (.of_isLocalized_maximal (fun P _ ↦ Localization P.primeCompl) _
394+
(fun P _ ↦ TensorProduct.mk R (Localization P.primeCompl) M 1) _ fun P _ ↦ ?_) ?_⟩
395+
· /- Since `M` is finite flat, linear independence in `Rₚ ⊗[R] M` is equivalent to linear
396+
independence in `Rₚ⧸PRₚ ⊗[Rₚ] (Rₚ ⊗[R] M) ≃ Rₚ⧸PRₚ ⊗[R⧸P] (R⧸P ⊗[R] M)`. -/
397+
apply IsLocalRing.linearIndependent_of_flat
398+
rw [← LinearMap.linearIndependent_iff _ (AlgebraTensorModule.cancelBaseChange R _ _ _ M).ker]
399+
convert LinearMap.linearIndependent_iff _ (AlgebraTensorModule.cancelBaseChange R _ _ _ M).ker
400+
|>.mpr (Algebra.TensorProduct.basis P.ResidueField (b' ⟨P, ‹_›⟩)).linearIndependent
401+
ext
402+
simp [← funext_iff.mp (hb _)]
403+
· -- To show `b` spans `M`, it suffices to show `M = Rb + J(R)M` by Nakayama.
404+
refine Submodule.le_of_le_smul_of_le_jacobson_bot (Module.finite_def.mp ‹_›) le_rfl fun m _ ↦ ?_
405+
/- For each `m : M` and maximal ideal `P`, `1 ⊗ₜ m : R⧸P ⊗[R] M` is in the span of `b' P`.
406+
By Chinese remainder theorem for rings, we may lift the coefficients `r i : R`. -/
407+
choose r hr using fun i ↦ pi_quotient_surjective coprime fun P ↦ (b' P).repr (1 ⊗ₜ m) i
408+
rw [← add_sub_cancel (∑ i, r i • b i) m]
409+
/- It suffices to show `m - ∑ i, r i • b i` is `J(R)M`, which equals the kernel of
410+
`M → Πₚ R⧸P ⊗[R] M` by Chinese remainder theorem for modules. -/
411+
refine Submodule.add_mem_sup (sum_mem fun i _ ↦ smul_mem _ _ <| subset_span ⟨i, rfl⟩) <|
412+
((ker_tensorProductMk_quotient M _ coprime).le.trans <| smul_mono_left <|
413+
le_sInf fun i hi ↦ iInf_le_of_le ⟨i, hi.2⟩ le_rfl) ?_
414+
ext P
415+
simp_rw [map_sub, map_sum, map_smul, hb, Pi.sub_apply]
416+
refine sub_eq_zero.mpr (((b' P).sum_repr _).symm.trans ?_)
417+
simp [← hr, ← Quotient.algebraMap_eq]
418+
419+
@[stacks 02M9] theorem free_of_flat_of_finrank_eq [Module.Finite R M] [Flat R M]
420+
(n : ℕ) (rk : ∀ P : MaximalSpectrum R, finrank (R ⧸ P.1) ((R ⧸ P.1) ⊗[R] M) = n) :
421+
Free R M :=
422+
have ⟨b⟩ := nonempty_basis_of_flat_of_finrank_eq R M n rk
423+
.of_basis b
424+
425+
end Module

Mathlib/RingTheory/Localization/BaseChange.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ lemma Algebra.isPushout_of_isLocalization [IsLocalization (Algebra.algebraMapSub
139139
Algebra.IsPushout R T A B :=
140140
(Algebra.isLocalization_iff_isPushout S _).mp inferInstance
141141

142+
variable (R M) in
142143
open TensorProduct in
143-
instance (R M : Type*) [CommRing R] [AddCommGroup M] [Module R M]
144-
{α} (S : Submonoid R) {Mₛ} [AddCommGroup Mₛ] [Module R Mₛ] (f : M →ₗ[R] Mₛ)
145-
[IsLocalizedModule S f] : IsLocalizedModule S (Finsupp.mapRange.linearMap (α := α) f) := by
144+
instance {α} [IsLocalizedModule S f] :
145+
IsLocalizedModule S (Finsupp.mapRange.linearMap (α := α) f) := by
146146
classical
147-
let e : Localization S ⊗[R] M ≃ₗ[R] Mₛ :=
147+
let e : Localization S ⊗[R] M ≃ₗ[R] M' :=
148148
(LocalizedModule.equivTensorProduct S M).symm.restrictScalars R ≪≫ₗ IsLocalizedModule.iso S f
149-
let e' : Localization S ⊗[R] (α →₀ M) ≃ₗ[R] (α →₀ Mₛ) :=
149+
let e' : Localization S ⊗[R] (α →₀ M) ≃ₗ[R] (α →₀ M') :=
150150
finsuppRight R (Localization S) M α ≪≫ₗ Finsupp.mapRange.linearEquiv e
151151
suffices IsLocalizedModule S (e'.symm.toLinearMap ∘ₗ Finsupp.mapRange.linearMap f) by
152152
convert this.of_linearEquiv (e := e')

Mathlib/RingTheory/PicardGroup.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ invertible `R`-modules (in the sense that `M` is invertible if there exists anot
4747
4848
Show:
4949
- The Picard group of a commutative domain is isomorphic to its ideal class group.
50-
- All commutative semi-local rings, in particular Artinian rings, have trivial Picard group.
5150
- All unique factorization domains have trivial Picard group.
5251
- Invertible modules over a commutative ring have the same cardinality as the ring.
5352
@@ -246,13 +245,13 @@ theorem free_iff_linearEquiv : Free R M ↔ Nonempty (M ≃ₗ[R] R) := by
246245
considering the localization at a prime (which is free of rank 1) using the strong rank condition.
247246
The ≥ direction fails in general but holds for domains and Noetherian rings without embedded
248247
components, see https://math.stackexchange.com/q/5089900. -/
249-
theorem finrank_eq_one [StrongRankCondition R] [Free R M] : finrank R M = 1 := by
248+
protected theorem finrank_eq_one [StrongRankCondition R] [Free R M] : finrank R M = 1 := by
250249
cases subsingleton_or_nontrivial R
251250
· rw [← rank_eq_one_iff_finrank_eq_one, rank_subsingleton]
252251
· rw [(free_iff_linearEquiv.mp ‹_›).some.finrank_eq, finrank_self]
253252

254253
theorem rank_eq_one [StrongRankCondition R] [Free R M] : Module.rank R M = 1 :=
255-
rank_eq_one_iff_finrank_eq_one.mpr (finrank_eq_one R M)
254+
rank_eq_one_iff_finrank_eq_one.mpr (Invertible.finrank_eq_one R M)
256255

257256
open TensorProduct (comm lid) in
258257
theorem toModuleEnd_bijective : Function.Bijective (toModuleEnd R (S := R) M) := by
@@ -499,6 +498,11 @@ instance [Subsingleton (Pic R)] : Free R M :=
499498
instance [IsLocalRing R] : Subsingleton (Pic R) :=
500499
subsingleton_iff.mpr fun _ _ _ _ ↦ free_of_flat_of_isLocalRing
501500

501+
/-- The Picard group of a semilocal ring is trivial. -/
502+
instance [Finite (MaximalSpectrum R)] : Subsingleton (Pic R) :=
503+
subsingleton_iff.mpr fun _ _ _ _ ↦ free_of_flat_of_finrank_eq _ _ 1
504+
fun _ ↦ let _ := @Ideal.Quotient.field; Invertible.finrank_eq_one ..
505+
502506
end CommRing.Pic
503507

504508
end CommRing

0 commit comments

Comments
 (0)