Skip to content

Commit ff36646

Browse files
committed
feat(RingTheory/Flat): flat is stable under base change (#11614)
Shows that `Module.Flat` is stable under arbitrary base change of rings. Also adds the corresponding version for `Algebra.Flat`.
1 parent 6a3812f commit ff36646

File tree

2 files changed

+74
-10
lines changed

2 files changed

+74
-10
lines changed

Mathlib/RingTheory/Flat/Algebra.lean

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,26 @@ attribute [instance] out
3737
instance self (R : Type u) [CommRing R] : Algebra.Flat R R where
3838
out := Module.Flat.self R
3939

40-
variable (R : Type u) (S : Type v) (T : Type w) [CommRing R] [CommRing S] [CommRing T]
40+
variable (R : Type u) (S : Type v) [CommRing R] [CommRing S]
4141

4242
/-- If `T` is a flat `S`-algebra and `S` is a flat `R`-algebra,
4343
then `T` is a flat `R`-algebra. -/
44-
theorem comp [Algebra R S] [Algebra R T] [Algebra S T] [IsScalarTower R S T]
45-
[Algebra.Flat R S] [Algebra.Flat S T] : Algebra.Flat R T where
44+
theorem comp (T : Type w) [CommRing T] [Algebra R S] [Algebra R T] [Algebra S T]
45+
[IsScalarTower R S T] [Algebra.Flat R S] [Algebra.Flat S T] : Algebra.Flat R T where
4646
out := Module.Flat.comp R S T
4747

48+
/-- If `S` is a flat `R`-algebra and `T` is any `R`-algebra,
49+
then `T ⊗[R] S` is a flat `T`-algebra. -/
50+
instance baseChange (T : Type w) [CommRing T] [Algebra R S] [Algebra R T] [Algebra.Flat R S] :
51+
Algebra.Flat T (T ⊗[R] S) where
52+
out := Module.Flat.baseChange R T S
53+
54+
/-- A base change of a flat algebra is flat. -/
55+
theorem isBaseChange [Algebra R S] (R' : Type w) (S' : Type t) [CommRing R'] [CommRing S']
56+
[Algebra R R'] [Algebra S S'] [Algebra R' S'] [Algebra R S'] [IsScalarTower R R' S']
57+
[IsScalarTower R S S'] [h : IsPushout R S R' S'] [Algebra.Flat R R'] : Algebra.Flat S S' where
58+
out := Module.Flat.isBaseChange R S R' S' h.out
59+
4860
end Algebra.Flat
4961

5062
/-- A `RingHom` is flat if `R` is flat as an `S` algebra. -/

Mathlib/RingTheory/Flat/Stability.lean

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,24 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Christian Merten
55
-/
66
import Mathlib.RingTheory.Flat.Basic
7+
import Mathlib.RingTheory.IsTensorProduct
78
import Mathlib.LinearAlgebra.TensorProduct.Tower
89

910
/-!
1011
# Flatness is stable under composition and base change
1112
12-
We show that flatness is stable under composition and base change. The latter is not formalized yet.
13+
We show that flatness is stable under composition and base change.
1314
1415
## Main theorems
1516
1617
* `Module.Flat.comp`: if `S` is a flat `R`-algebra and `M` is a flat `S`-module,
1718
then `M` is a flat `R`-module
18-
19-
## TODO
20-
21-
* Show that flatness is stable under base change, i.e. if `S` is any `R`-algebra and `M` is a flat
22-
`R`-module, then `M ⊗[R] S` is a flat `S`-module.
19+
* `Module.Flat.baseChange`: if `M` is a flat `R`-module and `S` is any `R`-algebra,
20+
then `S ⊗[R] M` is `S`-flat.
2321
2422
-/
2523

26-
universe u v w
24+
universe u v w t
2725

2826
open Function (Injective Surjective)
2927

@@ -33,6 +31,8 @@ open TensorProduct
3331

3432
namespace Module.Flat
3533

34+
section Composition
35+
3636
/-! ### Composition
3737
3838
Let `R` be a ring, `S` a flat `R`-algebra and `M` a flat `S`-module. To show that `M` is flat
@@ -93,4 +93,56 @@ theorem comp [Module.Flat R S] [Module.Flat S M] : Module.Flat R M := by
9393
LinearEquiv.coe_coe, EquivLike.comp_injective, EquivLike.injective_comp]
9494
exact (Module.Flat.iff_lTensor_injective' S M).mp inferInstance _
9595

96+
end Composition
97+
98+
section BaseChange
99+
100+
/-! ### Base change
101+
102+
Let `R` be a ring, `M` a flat `R`-module and `S` an `R`-algebra. To show that
103+
`S ⊗[R] M` is `S`-flat, we consider for an ideal `I` in `S` the composition of natural maps
104+
105+
`I ⊗[S] (S ⊗[R] M) ≃ I ⊗[R] M → S ⊗[R] M ≃ S ⊗[S] (S ⊗[R] M)`.
106+
107+
One checks that this composition is precisely the inclusion `I → S` tensored on the right
108+
with `S ⊗[R] M` and that the former is injective (note that `I ⊗[R] M → S ⊗[R] M` is
109+
injective, since `M` is `R`-flat).
110+
111+
-/
112+
113+
variable (R : Type u) (S : Type v) (M : Type w)
114+
[CommRing R] [CommRing S] [Algebra R S]
115+
[AddCommGroup M] [Module R M]
116+
117+
private noncomputable abbrev auxRTensorBaseChange (I : Ideal S) :
118+
I ⊗[S] (S ⊗[R] M) →ₗ[S] S ⊗[S] (S ⊗[R] M) :=
119+
letI e1 : I ⊗[S] (S ⊗[R] M) ≃ₗ[S] I ⊗[R] M :=
120+
AlgebraTensorModule.cancelBaseChange R S S I M
121+
letI e2 : S ⊗[S] (S ⊗[R] M) ≃ₗ[S] S ⊗[R] M :=
122+
AlgebraTensorModule.cancelBaseChange R S S S M
123+
letI f : I ⊗[R] M →ₗ[S] S ⊗[R] M := AlgebraTensorModule.map
124+
(Submodule.subtype I) LinearMap.id
125+
e2.symm.toLinearMap ∘ₗ f ∘ₗ e1.toLinearMap
126+
127+
private lemma auxRTensorBaseChange_eq (I : Ideal S) :
128+
auxRTensorBaseChange R S M I = rTensor (S ⊗[R] M) (Submodule.subtype I) := by
129+
ext
130+
simp
131+
132+
/-- If `M` is a flat `R`-module and `S` is any `R`-algebra, `S ⊗[R] M` is `S`-flat. -/
133+
instance baseChange [Module.Flat R M] : Module.Flat S (S ⊗[R] M) := by
134+
rw [Module.Flat.iff_rTensor_injective']
135+
intro I
136+
simp only [← auxRTensorBaseChange_eq, auxRTensorBaseChange, LinearMap.coe_comp,
137+
LinearEquiv.coe_coe, EmbeddingLike.comp_injective, EquivLike.injective_comp]
138+
exact rTensor_preserves_injective_linearMap (I.subtype : I →ₗ[R] S) Subtype.val_injective
139+
140+
/-- A base change of a flat module is flat. -/
141+
theorem isBaseChange [Module.Flat R M] (N : Type t) [AddCommGroup N] [Module R N] [Module S N]
142+
[IsScalarTower R S N] {f : M →ₗ[R] N} (h : IsBaseChange S f) :
143+
Module.Flat S N :=
144+
of_linearEquiv S (S ⊗[R] M) N (IsBaseChange.equiv h).symm
145+
146+
end BaseChange
147+
96148
end Module.Flat

0 commit comments

Comments
 (0)