Skip to content

Commit 19b2d88

Browse files
committed
feat(RingTheory): base change commutes with finite products (#22339)
and in particular with localizations of modules. Co-authored-by: Christian Merten <136261474+chrisflav@users.noreply.github.com>
1 parent a05b659 commit 19b2d88

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5261,6 +5261,7 @@ import Mathlib.RingTheory.SurjectiveOnStalks
52615261
import Mathlib.RingTheory.TensorProduct.Basic
52625262
import Mathlib.RingTheory.TensorProduct.Finite
52635263
import Mathlib.RingTheory.TensorProduct.Free
5264+
import Mathlib.RingTheory.TensorProduct.IsBaseChangePi
52645265
import Mathlib.RingTheory.TensorProduct.MvPolynomial
52655266
import Mathlib.RingTheory.TensorProduct.Nontrivial
52665267
import Mathlib.RingTheory.TensorProduct.Pi

Mathlib/Algebra/Module/LocalizedModule/Basic.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Andrew Yang, Jujian Zhang
55
-/
66
import Mathlib.Algebra.Algebra.Tower
7+
import Mathlib.Algebra.Equiv.TransferInstance
78
import Mathlib.RingTheory.Localization.Defs
89

910
/-!
@@ -1293,6 +1294,20 @@ theorem mkOfAlgebra {R S S' : Type*} [CommSemiring R] [Ring S] [Ring S'] [Algebr
12931294

12941295
end Algebra
12951296

1297+
variable {R A M M' : Type*} [CommSemiring R] [CommSemiring A] [Algebra R A] (S : Submonoid R)
1298+
[AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M']
1299+
[IsLocalization S A]
1300+
1301+
/-- If `M'` is the localization of `M` at `S` and `A = S⁻¹R`, then
1302+
`M' is an `A`-module. -/
1303+
@[reducible] noncomputable def module (f : M →ₗ[R] M') [IsLocalizedModule S f] : Module A M' :=
1304+
(IsLocalizedModule.iso S f).symm.toAddEquiv.module A
1305+
1306+
lemma isScalarTower_module (f : M →ₗ[R] M') [IsLocalizedModule S f] :
1307+
letI : Module A M' := IsLocalizedModule.module S f
1308+
IsScalarTower R A M' :=
1309+
(IsLocalizedModule.iso S f).symm.isScalarTower A
1310+
12961311
section Subsingleton
12971312

12981313
lemma mem_ker_iff (S : Submonoid R) {g : M →ₗ[R] M'}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/-
2+
Copyright (c) 2025 Christian Merten. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Christian Merten
5+
-/
6+
import Mathlib.LinearAlgebra.TensorProduct.Pi
7+
import Mathlib.LinearAlgebra.TensorProduct.Prod
8+
import Mathlib.RingTheory.Localization.BaseChange
9+
10+
/-!
11+
# Base change commutes with finite products
12+
13+
In particular, localization of modules commutes with finite products. We also
14+
show the binary product versions.
15+
-/
16+
17+
variable {R S : Type*} [CommSemiring R] [CommSemiring S] [Algebra R S]
18+
19+
namespace IsBaseChange
20+
21+
/-- Base change commutes with binary products. -/
22+
lemma prodMap {M N M' N' : Type*}
23+
[AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N]
24+
[AddCommMonoid M'] [AddCommMonoid N'] [Module R M'] [Module R N']
25+
[Module S M'] [Module S N'] [IsScalarTower R S M'] [IsScalarTower R S N']
26+
(f : M →ₗ[R] M') (g : N →ₗ[R] N') (hf : IsBaseChange S f) (hg : IsBaseChange S g) :
27+
IsBaseChange S (f.prodMap g) := by
28+
apply of_equiv (TensorProduct.prodRight R _ S M N ≪≫ₗ hf.equiv.prod hg.equiv)
29+
intro p
30+
simp [equiv_tmul]
31+
32+
/-- Base change commutes with finite products. -/
33+
lemma pi {ι : Type*} [Finite ι]
34+
{M M' : ι → Type*} [∀ i, AddCommMonoid (M i)] [∀ i, AddCommMonoid (M' i)]
35+
[∀ i, Module R (M i)] [∀ i, Module R (M' i)] [∀ i, Module S (M' i)]
36+
[∀ i, IsScalarTower R S (M' i)]
37+
(f : ∀ i, M i →ₗ[R] M' i) (hf : ∀ i, IsBaseChange S (f i)) :
38+
IsBaseChange S (.pi fun i ↦ f i ∘ₗ .proj i) := by
39+
classical
40+
cases nonempty_fintype ι
41+
apply of_equiv <| TensorProduct.piRight R S _ M ≪≫ₗ .piCongrRight fun i ↦ (hf i).equiv
42+
intro x
43+
ext i
44+
simp [equiv_tmul]
45+
46+
end IsBaseChange
47+
48+
namespace IsLocalizedModule
49+
50+
variable (S : Submonoid R)
51+
52+
attribute [local instance] IsLocalizedModule.isScalarTower_module
53+
54+
/-- Localization of modules commutes with binary products. -/
55+
instance prodMap {M N M' N' : Type*}
56+
[AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N]
57+
[AddCommMonoid M'] [AddCommMonoid N'] [Module R M'] [Module R N']
58+
(f : M →ₗ[R] M') (g : N →ₗ[R] N')
59+
[IsLocalizedModule S f] [IsLocalizedModule S g] :
60+
IsLocalizedModule S (f.prodMap g) := by
61+
letI : Module (Localization S) M' := IsLocalizedModule.module S f
62+
letI : Module (Localization S) N' := IsLocalizedModule.module S g
63+
rw [isLocalizedModule_iff_isBaseChange S (Localization S)]
64+
apply IsBaseChange.prodMap
65+
· rw [← isLocalizedModule_iff_isBaseChange S]
66+
infer_instance
67+
· rw [← isLocalizedModule_iff_isBaseChange S]
68+
infer_instance
69+
70+
/-- Localization of modules commutes with finite products. -/
71+
instance pi {ι : Type*} [Finite ι]
72+
{M M' : ι → Type*} [∀ i, AddCommMonoid (M i)] [∀ i, AddCommMonoid (M' i)]
73+
[∀ i, Module R (M i)] [∀ i, Module R (M' i)]
74+
(f : ∀ i, M i →ₗ[R] M' i) [∀ i, IsLocalizedModule S (f i)] :
75+
IsLocalizedModule S (.pi fun i ↦ f i ∘ₗ .proj i) := by
76+
letI (i : ι) : Module (Localization S) (M' i) := IsLocalizedModule.module S (f i)
77+
rw [isLocalizedModule_iff_isBaseChange S (Localization S)]
78+
apply IsBaseChange.pi
79+
intro i
80+
rw [← isLocalizedModule_iff_isBaseChange S]
81+
infer_instance
82+
83+
end IsLocalizedModule

0 commit comments

Comments
 (0)