Skip to content

Commit ba69382

Browse files
committed
feat(RingTheory/Localization): more API and kernels of localized maps (#14751)
This PR adds various API lemmas on localization. In particular it computes the kernel of a localized map as the localization of the kernel.
1 parent ad047c6 commit ba69382

File tree

9 files changed

+173
-1
lines changed

9 files changed

+173
-1
lines changed

Mathlib/Algebra/Algebra/Hom.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,27 @@ theorem smul_units_def (f : A →ₐ[R] A) (x : Aˣ) :
585585
f • x = Units.map (f : A →* A) x := rfl
586586

587587
end MulDistribMulAction
588+
589+
variable (M : Submonoid R) {B : Type w} [CommRing B] [Algebra R B] {A}
590+
591+
lemma algebraMapSubmonoid_map_eq (f : A →ₐ[R] B) :
592+
(algebraMapSubmonoid A M).map f = algebraMapSubmonoid B M := by
593+
ext x
594+
constructor
595+
· rintro ⟨a, ⟨r, hr, rfl⟩, rfl⟩
596+
simp only [AlgHom.commutes]
597+
use r
598+
· rintro ⟨r, hr, rfl⟩
599+
simp only [Submonoid.mem_map]
600+
use (algebraMap R A r)
601+
simp only [AlgHom.commutes, and_true]
602+
use r
603+
604+
lemma algebraMapSubmonoid_le_comap (f : A →ₐ[R] B) :
605+
algebraMapSubmonoid A M ≤ (algebraMapSubmonoid B M).comap f.toRingHom := by
606+
rw [← algebraMapSubmonoid_map_eq M f]
607+
exact Submonoid.le_comap_map (Algebra.algebraMapSubmonoid A M)
608+
588609
end Algebra
589610

590611
namespace MulSemiringAction

Mathlib/Algebra/Module/LocalizedModule.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,14 @@ lemma map_comp (h : M →ₗ[R] N) : (map S f g h) ∘ₗ f = g ∘ₗ h :=
11231123
lemma map_apply (h : M →ₗ[R] N) (x) : map S f g h (f x) = g (h x) :=
11241124
lift_apply S f (g ∘ₗ h) (IsLocalizedModule.map_units g) x
11251125

1126+
@[simp]
1127+
lemma map_mk' (h : M →ₗ[R] N) (x) (s : S) :
1128+
map S f g h (IsLocalizedModule.mk' f x s) = (IsLocalizedModule.mk' g (h x) s) := by
1129+
simp only [map, lift, LinearMap.coe_mk, AddHom.coe_mk, LinearMap.coe_comp, LinearEquiv.coe_coe,
1130+
Function.comp_apply]
1131+
rw [iso_symm_apply' S f (mk' f x s) x s (mk'_cancel' f x s), LocalizedModule.lift_mk]
1132+
rfl
1133+
11261134
open LocalizedModule LinearEquiv LinearMap Submonoid
11271135

11281136
variable (M)

Mathlib/Algebra/Module/Submodule/Localization.lean

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Andrew Yang
55
-/
66
import Mathlib.Algebra.Module.LocalizedModule
77
import Mathlib.LinearAlgebra.Quotient
8+
import Mathlib.RingTheory.Localization.Module
89

910
/-!
1011
# Localization of Submodules
@@ -27,7 +28,7 @@ Results about localizations of submodules and quotient modules are provided in t
2728

2829
open nonZeroDivisors
2930

30-
universe u u' v v'
31+
universe u u' v v' w w'
3132

3233
variable {R : Type u} (S : Type u') {M : Type v} {N : Type v'}
3334
variable [CommRing R] [CommRing S] [AddCommGroup M] [AddCommGroup N]
@@ -48,6 +49,10 @@ def Submodule.localized' : Submodule S N where
4849
have ⟨y, t, hyt⟩ := IsLocalization.mk'_surjective p r
4950
exact ⟨y • m, M'.smul_mem y hm, t * s, by simp [← hyt, ← hx, IsLocalizedModule.mk'_smul_mk']⟩
5051

52+
lemma Submodule.mem_localized' (x : N) :
53+
x ∈ Submodule.localized' S p f M' ↔ ∃ m ∈ M', ∃ s : p, IsLocalizedModule.mk' f m s = x :=
54+
Iff.rfl
55+
5156
/-- The localization of an `R`-submodule of `M` at `p` viewed as an `Rₚ`-submodule of `Mₚ`. -/
5257
abbrev Submodule.localized : Submodule (Localization p) (LocalizedModule p M) :=
5358
M'.localized' (Localization p) p (LocalizedModule.mkLinearMap p M)
@@ -113,3 +118,52 @@ instance IsLocalizedModule.toLocalizedQuotient' (M' : Submodule R M) :
113118

114119
instance (M' : Submodule R M) : IsLocalizedModule p (M'.toLocalizedQuotient p) :=
115120
IsLocalizedModule.toLocalizedQuotient' _ _ _ _
121+
122+
section LinearMap
123+
124+
variable {P : Type w} [AddCommGroup P] [Module R P]
125+
variable {Q : Type w'} [AddCommGroup Q] [Module R Q] [Module S Q] [IsScalarTower R S Q]
126+
variable (f' : P →ₗ[R] Q) [IsLocalizedModule p f']
127+
128+
lemma LinearMap.localized'_ker_eq_ker_localizedMap (g : M →ₗ[R] P) :
129+
Submodule.localized' S p f (LinearMap.ker g) =
130+
LinearMap.ker ((IsLocalizedModule.map p f f' g).extendScalarsOfIsLocalization p S) := by
131+
ext x
132+
simp only [Submodule.mem_localized', mem_ker, extendScalarsOfIsLocalization_apply']
133+
constructor
134+
· rintro ⟨m, hm, a, ha, rfl⟩
135+
rw [IsLocalizedModule.map_mk', hm]
136+
simp
137+
· intro h
138+
obtain ⟨⟨a, b⟩, rfl⟩ := IsLocalizedModule.mk'_surjective p f x
139+
simp only [Function.uncurry_apply_pair, IsLocalizedModule.map_mk',
140+
IsLocalizedModule.mk'_eq_zero, IsLocalizedModule.eq_zero_iff p f'] at h
141+
obtain ⟨c, hc⟩ := h
142+
refine ⟨c • a, by simpa, c * b, by simp⟩
143+
144+
lemma LinearMap.ker_localizedMap_eq_localized'_ker (g : M →ₗ[R] P) :
145+
LinearMap.ker (IsLocalizedModule.map p f f' g) =
146+
((LinearMap.ker g).localized' S p f).restrictScalars _ := by
147+
rw [localized'_ker_eq_ker_localizedMap S p f f']
148+
rfl
149+
150+
/--
151+
The canonical map from the kernel of `g` to the kernel of `g` localized at a submonoid.
152+
153+
This is a localization map by `LinearMap.toKerLocalized_isLocalizedModule`.
154+
-/
155+
@[simps!]
156+
noncomputable def LinearMap.toKerIsLocalized (g : M →ₗ[R] P) :
157+
ker g →ₗ[R] ker (IsLocalizedModule.map p f f' g) :=
158+
f.restrict (fun x hx ↦ by simp [LinearMap.mem_ker, LinearMap.mem_ker.mp hx])
159+
160+
/-- The canonical map to the kernel of the localization of `g` is localizing.
161+
In other words, localization commutes with kernels. -/
162+
lemma LinearMap.toKerLocalized_isLocalizedModule (g : M →ₗ[R] P) :
163+
IsLocalizedModule p (toKerIsLocalized p f f' g) :=
164+
let e : Submodule.localized' S p f (ker g) ≃ₗ[S]
165+
ker ((IsLocalizedModule.map p f f' g).extendScalarsOfIsLocalization p S) :=
166+
LinearEquiv.ofEq _ _ (localized'_ker_eq_ker_localizedMap S p f f' g)
167+
IsLocalizedModule.of_linearEquiv p (Submodule.toLocalized' S p f (ker g)) (e.restrictScalars R)
168+
169+
end LinearMap

Mathlib/GroupTheory/MonoidLocalization.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,20 @@ theorem map_injective_of_injective (hg : Injective g) (k : LocalizationMap (S.ma
11881188
rw [← (f.map_units x).mul_left_inj, hxz, hxw, f.eq_iff_exists]
11891189
exact ⟨⟨c, hc⟩, eq⟩
11901190

1191+
/-- Given a surjective `CommMonoid` homomorphism `g : M →* P`, and a submonoid `S ⊆ M`,
1192+
the induced monoid homomorphism from the localization of `M` at `S` to the
1193+
localization of `P` at `g S`, is surjective.
1194+
-/
1195+
@[to_additive "Given a surjective `AddCommMonoid` homomorphism `g : M →+ P`, and a
1196+
submonoid `S ⊆ M`, the induced monoid homomorphism from the localization of `M` at `S`
1197+
to the localization of `P` at `g S`, is surjective. "]
1198+
theorem map_surjective_of_surjective (hg : Surjective g) (k : LocalizationMap (S.map g) Q) :
1199+
Surjective (map f (apply_coe_mem_map g S) k) := fun z ↦ by
1200+
obtain ⟨y, ⟨y', s, hs, rfl⟩, rfl⟩ := k.mk'_surjective z
1201+
obtain ⟨x, rfl⟩ := hg y
1202+
use f.mk' x ⟨s, hs⟩
1203+
rw [map_mk']
1204+
11911205
section AwayMap
11921206

11931207
variable (x : M)

Mathlib/RingTheory/Ideal/Maps.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,3 +908,15 @@ lemma coe_ideal_map (I : Ideal A) :
908908
Ideal.map f I = Ideal.map (f : A →+* B) I := rfl
909909

910910
end AlgHom
911+
912+
namespace Algebra
913+
914+
variable {R : Type*} [CommSemiring R] (S : Type*) [Semiring S] [Algebra R S]
915+
916+
/-- The induced linear map from `I` to the span of `I` in an `R`-algebra `S`. -/
917+
@[simps!]
918+
def idealMap (I : Ideal R) : I →ₗ[R] I.map (algebraMap R S) :=
919+
(Algebra.linearMap R S).restrict (q := (I.map (algebraMap R S)).restrictScalars R)
920+
(fun _ ↦ Ideal.mem_map_of_mem _)
921+
922+
end Algebra

Mathlib/RingTheory/Localization/Away/Basic.lean

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,45 @@ noncomputable def map (f : R →+* P) (r : R) [IsLocalization.Away r S]
117117
simp)
118118
#align is_localization.away.map IsLocalization.Away.map
119119

120+
section Algebra
121+
122+
variable {A : Type*} [CommRing A] [Algebra R A]
123+
variable {B : Type*} [CommRing B] [Algebra R B]
124+
variable (Aₚ : Type*) [CommRing Aₚ] [Algebra A Aₚ] [Algebra R Aₚ] [IsScalarTower R A Aₚ]
125+
variable (Bₚ : Type*) [CommRing Bₚ] [Algebra B Bₚ] [Algebra R Bₚ] [IsScalarTower R B Bₚ]
126+
127+
instance {f : A →+* B} (a : A) [Away (f a) Bₚ] : IsLocalization (.map f (.powers a)) Bₚ := by
128+
simpa
129+
130+
/-- Given a algebra map `f : A →ₐ[R] B` and an element `a : A`, we may construct a map
131+
`Aₐ →ₐ[R] Bₐ`. -/
132+
noncomputable def mapₐ (f : A →ₐ[R] B) (a : A) [Away a Aₚ] [Away (f a) Bₚ] : Aₚ →ₐ[R] Bₚ :=
133+
⟨map Aₚ Bₚ f.toRingHom a, fun r ↦ by
134+
dsimp only [AlgHom.toRingHom_eq_coe, map, RingHom.coe_coe, OneHom.toFun_eq_coe]
135+
rw [IsScalarTower.algebraMap_apply R A Aₚ, IsScalarTower.algebraMap_eq R B Bₚ]
136+
erw [IsLocalization.map_eq]
137+
simp⟩
138+
139+
@[simp]
140+
lemma mapₐ_apply (f : A →ₐ[R] B) (a : A) [Away a Aₚ] [Away (f a) Bₚ] (x : Aₚ) :
141+
mapₐ Aₚ Bₚ f a x = map Aₚ Bₚ f.toRingHom a x :=
142+
rfl
143+
144+
variable {Aₚ} {Bₚ}
145+
146+
lemma mapₐ_injective_of_injective {f : A →ₐ[R] B} (a : A) [Away a Aₚ] [Away (f a) Bₚ]
147+
(hf : Function.Injective f) : Function.Injective (mapₐ Aₚ Bₚ f a) :=
148+
IsLocalization.map_injective_of_injective _ _ _ hf
149+
150+
lemma mapₐ_surjective_of_surjective {f : A →ₐ[R] B} (a : A) [Away a Aₚ] [Away (f a) Bₚ]
151+
(hf : Function.Surjective f) : Function.Surjective (mapₐ Aₚ Bₚ f a) :=
152+
have : IsLocalization (Submonoid.map f.toRingHom (Submonoid.powers a)) Bₚ := by
153+
simp only [AlgHom.toRingHom_eq_coe, Submonoid.map_powers, RingHom.coe_coe]
154+
infer_instance
155+
IsLocalization.map_surjective_of_surjective _ _ _ hf
156+
157+
end Algebra
158+
120159
end Away
121160

122161
end Away
@@ -228,6 +267,14 @@ noncomputable abbrev awayMap (f : R →+* P) (r : R) :
228267
IsLocalization.Away.map _ _ f r
229268
#align localization.away_map Localization.awayMap
230269

270+
variable {A : Type*} [CommRing A] [Algebra R A]
271+
variable {B : Type*} [CommRing B] [Algebra R B]
272+
273+
/-- Given a map `f : A →ₐ[R] B` and an element `a : A`, we may construct a map `Aₐ →ₐ[R] Bₐ`. -/
274+
noncomputable abbrev awayMapₐ (f : A →ₐ[R] B) (a : A) :
275+
Localization.Away a →ₐ[R] Localization.Away (f a) :=
276+
IsLocalization.Away.mapₐ _ _ f a
277+
231278
end Localization
232279

233280
end CommSemiring

Mathlib/RingTheory/Localization/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ theorem map_injective_of_injective (h : Function.Injective g) [IsLocalization (M
799799
Function.Injective (map Q g M.le_comap_map : S → Q) :=
800800
(toLocalizationMap M S).map_injective_of_injective h (toLocalizationMap (M.map g) Q)
801801

802+
/-- Surjectivity of a map descends to the map induced on localizations. -/
803+
theorem map_surjective_of_surjective (h : Function.Surjective g) [IsLocalization (M.map g) Q] :
804+
Function.Surjective (map Q g M.le_comap_map : S → Q) :=
805+
(toLocalizationMap M S).map_surjective_of_surjective h (toLocalizationMap (M.map g) Q)
806+
802807
end
803808

804809
end IsLocalization

Mathlib/RingTheory/Localization/Ideal.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ theorem mem_map_algebraMap_iff {I : Ideal R} {z} : z ∈ Ideal.map (algebraMap R
6464
exact h.symm ▸ Ideal.mem_map_of_mem _ a.2
6565
#align is_localization.mem_map_algebra_map_iff IsLocalization.mem_map_algebraMap_iff
6666

67+
lemma mk'_mem_map_algebraMap_iff (I : Ideal R) (x : R) (s : M) :
68+
IsLocalization.mk' S x s ∈ I.map (algebraMap R S) ↔ ∃ s ∈ M, s * x ∈ I := by
69+
rw [← Ideal.unit_mul_mem_iff_mem _ (IsLocalization.map_units S s), IsLocalization.mk'_spec',
70+
IsLocalization.mem_map_algebraMap_iff M]
71+
simp_rw [← map_mul, IsLocalization.eq_iff_exists M, mul_comm x, ← mul_assoc, ← Submonoid.coe_mul]
72+
exact ⟨fun ⟨⟨y, t⟩, c, h⟩ ↦ ⟨_, (c * t).2, h ▸ I.mul_mem_left c.1 y.2⟩, fun ⟨s, hs, h⟩ ↦
73+
⟨⟨⟨_, h⟩, ⟨s, hs⟩⟩, 1, by simp⟩⟩
74+
6775
theorem map_comap (J : Ideal S) : Ideal.map (algebraMap R S) (Ideal.comap (algebraMap R S) J) = J :=
6876
le_antisymm (Ideal.map_le_iff_le_comap.2 le_rfl) fun x hJ => by
6977
obtain ⟨r, s, hx⟩ := mk'_surjective M x

Mathlib/RingTheory/Localization/Module.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ def LinearMap.extendScalarsOfIsLocalization (f : M →ₗ[R] N) : M →ₗ[A] N
213213
@[simp] lemma LinearMap.extendScalarsOfIsLocalization_apply (f : M →ₗ[A] N) :
214214
f.extendScalarsOfIsLocalization S A = f := rfl
215215

216+
@[simp] lemma LinearMap.extendScalarsOfIsLocalization_apply' (f : M →ₗ[R] N) (x : M) :
217+
(f.extendScalarsOfIsLocalization S A) x = f x := rfl
218+
216219
end
217220

218221
end Localization

0 commit comments

Comments
 (0)