Skip to content

Commit 12a9e23

Browse files
chrisflavkim-em
authored andcommitted
feat(RingTheory): Algebra.FinitePresentation descends along faithfully flat algebras (leanprover-community#35254)
From Pi1.
1 parent 6282649 commit 12a9e23

File tree

4 files changed

+177
-0
lines changed

4 files changed

+177
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6080,6 +6080,7 @@ public import Mathlib.RingTheory.Finiteness.Bilinear
60806080
public import Mathlib.RingTheory.Finiteness.Cardinality
60816081
public import Mathlib.RingTheory.Finiteness.Cofinite
60826082
public import Mathlib.RingTheory.Finiteness.Defs
6083+
public import Mathlib.RingTheory.Finiteness.Descent
60836084
public import Mathlib.RingTheory.Finiteness.Finsupp
60846085
public import Mathlib.RingTheory.Finiteness.Ideal
60856086
public import Mathlib.RingTheory.Finiteness.Lattice

Mathlib/LinearAlgebra/TensorProduct/Finiteness.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,16 @@ theorem exists_finite_submodule_right_of_setFinite' (s : Set (M₁ ⊗[R] N₁))
199199
@[deprecated (since := "2025-10-11")] alias exists_finite_submodule_right_of_finite' :=
200200
exists_finite_submodule_right_of_setFinite'
201201

202+
/-- Avoid using this and use the induction principle on `M ⊗[R] N` instead. -/
203+
lemma exists_sum_tmul_eq (x : M ⊗[R] N) :
204+
∃ (k : ℕ) (m : Fin k → M) (n : Fin k → N), x = ∑ j, m j ⊗ₜ n j := by
205+
induction x with
206+
| zero => exact ⟨0, IsEmpty.elim inferInstance, IsEmpty.elim inferInstance, by simp⟩
207+
| tmul x y => exact ⟨1, fun _ ↦ x, fun _ ↦ y, by simp⟩
208+
| add x y hx hy =>
209+
obtain ⟨kx, mx, nx, rfl⟩ := hx
210+
obtain ⟨ky, my, ny, rfl⟩ := hy
211+
use kx + ky, Fin.addCases mx my, Fin.addCases nx ny
212+
simp [Fin.sum_univ_add]
213+
202214
end TensorProduct
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/-
2+
Copyright (c) 2026 Christian Merten. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Christian Merten
5+
-/
6+
module
7+
8+
public import Mathlib.RingTheory.FinitePresentation
9+
public import Mathlib.RingTheory.FiniteStability
10+
public import Mathlib.RingTheory.RingHom.FinitePresentation
11+
public import Mathlib.RingTheory.RingHom.FaithfullyFlat
12+
13+
/-!
14+
# Descent of finiteness conditions under faithfully flat maps
15+
16+
In this file we show that
17+
18+
- `Algebra.FiniteType`:
19+
- `Algebra.FinitePresentation`:
20+
- `Module.Finite`:
21+
22+
descend along faithfully flat base change.
23+
-/
24+
25+
@[expose] public section
26+
27+
universe u v w
28+
29+
open TensorProduct
30+
31+
variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S]
32+
(T : Type*) [CommRing T] [Algebra R T]
33+
34+
lemma Module.Finite.of_finite_tensorProduct_of_faithfullyFlat {M : Type*} [AddCommGroup M]
35+
[Module R M] [Module.FaithfullyFlat R T] [Module.Finite T (T ⊗[R] M)] :
36+
Module.Finite R M := by
37+
classical
38+
obtain ⟨n, s, hs⟩ := Module.Finite.exists_fin (R := T) (M := T ⊗[R] M)
39+
choose k t m h using fun i : Fin n ↦ TensorProduct.exists_sum_tmul_eq (s i)
40+
let f₀ : ((Σ i, Fin (k i)) → R) →ₗ[R] M := (Pi.basisFun R _).constr R fun ⟨i, j⟩ ↦ m i j
41+
apply of_surjective f₀
42+
have : Function.Surjective (AlgebraTensorModule.lTensor T T f₀) := by
43+
rw [← LinearMap.range_eq_top, eq_top_iff, ← hs, Submodule.span_le, Set.range_subset_iff]
44+
intro i
45+
use ∑ (j : Fin (k i)), t i j ⊗ₜ Pi.basisFun R _ ⟨i, j⟩
46+
simp [f₀, -Pi.basisFun_equivFun, -Pi.basisFun_apply, h i]
47+
rwa [← Module.FaithfullyFlat.lTensor_surjective_iff_surjective _ T]
48+
49+
lemma Ideal.FG.of_FG_map_of_faithfullyFlat [Module.FaithfullyFlat R S] {I : Ideal R}
50+
(hI : (I.map (algebraMap R S)).FG) : I.FG := by
51+
change Submodule.FG I
52+
rw [← Module.Finite.iff_fg]
53+
let f : S ⊗[R] I →ₗ[S] S :=
54+
(AlgebraTensorModule.rid _ _ _).toLinearMap ∘ₗ AlgebraTensorModule.lTensor S S I.subtype
55+
have hf : Function.Injective f := by simp [f]
56+
have : I.map (algebraMap R S) = LinearMap.range f := by
57+
refine le_antisymm ?_ ?_
58+
· rw [Ideal.map_le_iff_le_comap]
59+
intro x hx
60+
use 1 ⊗ₜ ⟨x, hx⟩
61+
simp [f, Algebra.smul_def]
62+
· rintro - ⟨x, rfl⟩
63+
induction x with
64+
| zero => simp
65+
| add _ _ _ _ => simp_all [Ideal.add_mem]
66+
| tmul s x =>
67+
have : f (s ⊗ₜ[R] x) = s • f (1 ⊗ₜ x) := by simp [f]
68+
rw [this]
69+
apply Ideal.mul_mem_left
70+
simpa [f, Algebra.smul_def] using Ideal.mem_map_of_mem _ x.2
71+
let e : S ⊗[R] I ≃ₗ[S] I.map (algebraMap R S) := .ofInjective _ hf ≪≫ₗ .ofEq _ _ this.symm
72+
have : Module.Finite S (S ⊗[R] ↥I) := by
73+
rwa [Module.Finite.equiv_iff e, Module.Finite.iff_fg]
74+
apply Module.Finite.of_finite_tensorProduct_of_faithfullyFlat S
75+
76+
namespace Algebra
77+
78+
/-- If `T ⊗[R] S` is of finite type over `T` and `T` is `R`-faithfully flat,
79+
then `S` is of finite type over `R` -/
80+
lemma FiniteType.of_finiteType_tensorProduct_of_faithfullyFlat
81+
[Module.FaithfullyFlat R T] [Algebra.FiniteType T (T ⊗[R] S)] :
82+
Algebra.FiniteType R S := by
83+
obtain ⟨s, hs⟩ := Algebra.FiniteType.out (R := T) (A := T ⊗[R] S)
84+
have (x : s) := TensorProduct.exists_sum_tmul_eq x.1
85+
choose k t m h using this
86+
let f : MvPolynomial (Σ x : s, Fin (k x)) R →ₐ[R] S := MvPolynomial.aeval (fun ⟨x, i⟩ ↦ m x i)
87+
apply Algebra.FiniteType.of_surjective f
88+
have hf : Function.Surjective (Algebra.TensorProduct.map (.id T T) f) := by
89+
rw [← AlgHom.range_eq_top, _root_.eq_top_iff, ← hs, adjoin_le_iff]
90+
intro x hx
91+
let i : s := ⟨x, hx⟩
92+
use ∑ (j : Fin (k i)), t i j ⊗ₜ MvPolynomial.X ⟨i, j⟩
93+
simp [f, ← h, i]
94+
exact (Module.FaithfullyFlat.lTensor_surjective_iff_surjective _ T _).mp hf
95+
96+
attribute [local instance] Algebra.TensorProduct.rightAlgebra in
97+
/-- If `T ⊗[R] S` is of finite presentation over `T` and `T` is `R`-faithfully flat,
98+
then `S` is of finite presentation over `R` -/
99+
lemma FinitePresentation.of_finitePresentation_tensorProduct_of_faithfullyFlat
100+
[Module.FaithfullyFlat R T] [Algebra.FinitePresentation T (T ⊗[R] S)] :
101+
Algebra.FinitePresentation R S := by
102+
have : Algebra.FiniteType R S := .of_finiteType_tensorProduct_of_faithfullyFlat T
103+
rw [Algebra.FiniteType.iff_quotient_mvPolynomial''] at this
104+
obtain ⟨n, f, hf⟩ := this
105+
have : Module.FaithfullyFlat (MvPolynomial (Fin n) R) (T ⊗[R] MvPolynomial (Fin n) R) :=
106+
.of_linearEquiv _ _ (Algebra.TensorProduct.commRight _ _ _).symm.toLinearEquiv
107+
let fT := Algebra.TensorProduct.map (.id T T) f
108+
refine .of_surjective hf (.of_FG_map_of_faithfullyFlat (S := T ⊗[R] MvPolynomial (Fin n) R) ?_)
109+
have : (RingHom.ker f.toRingHom).map
110+
(algebraMap (MvPolynomial (Fin n) R) (T ⊗[R] MvPolynomial (Fin n) R)) = RingHom.ker fT :=
111+
(Algebra.TensorProduct.lTensor_ker f hf).symm
112+
rw [this]
113+
apply ker_fG_of_surjective
114+
exact FiniteType.baseChangeAux_surj T hf
115+
116+
end Algebra
117+
118+
namespace RingHom
119+
120+
lemma FiniteType.codescendsAlong_faithfullyFlat :
121+
CodescendsAlong FiniteType FaithfullyFlat := by
122+
refine .mk _ finiteType_respectsIso fun R S T _ _ _ _ _ h h' ↦ ?_
123+
rw [finiteType_algebraMap] at h' ⊢
124+
rw [faithfullyFlat_algebraMap_iff] at h
125+
exact .of_finiteType_tensorProduct_of_faithfullyFlat S
126+
127+
lemma FinitePresentation.codescendsAlong_faithfullyFlat :
128+
CodescendsAlong FinitePresentation FaithfullyFlat := by
129+
refine .mk _ finitePresentation_respectsIso fun R S T _ _ _ _ _ h h' ↦ ?_
130+
rw [finitePresentation_algebraMap] at h' ⊢
131+
rw [faithfullyFlat_algebraMap_iff] at h
132+
exact .of_finitePresentation_tensorProduct_of_faithfullyFlat S
133+
134+
lemma Finite.codescendsAlong_faithfullyFlat :
135+
CodescendsAlong Finite FaithfullyFlat := by
136+
refine .mk _ finite_respectsIso fun R S T _ _ _ _ _ h h' ↦ ?_
137+
rw [finite_algebraMap] at h' ⊢
138+
rw [faithfullyFlat_algebraMap_iff] at h
139+
exact .of_finite_tensorProduct_of_faithfullyFlat S
140+
141+
end RingHom

Mathlib/RingTheory/TensorProduct/Maps.lean

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,29 @@ lemma comm_comp_includeRight :
364364
theorem adjoin_tmul_eq_top : adjoin R { t : A ⊗[R] B | ∃ a b, a ⊗ₜ[R] b = t } = ⊤ :=
365365
top_le_iff.mp <| (top_le_iff.mpr <| span_tmul_eq_top R A B).trans (span_le_adjoin R _)
366366

367+
section
368+
369+
omit [Algebra S A] [IsScalarTower R S A]
370+
371+
attribute [local instance] Algebra.TensorProduct.rightAlgebra in
372+
/-- `S`-linear version of `Algebra.TensorProduct.comm` when `A ⊗[R] S`
373+
is viewed as an `S`-algebra via the right component. -/
374+
noncomputable def commRight : S ⊗[R] A ≃ₐ[S] A ⊗[R] S where
375+
__ := Algebra.TensorProduct.comm R S A
376+
commutes' _ := rfl
377+
378+
variable {S A} in
379+
@[simp]
380+
lemma commRight_tmul (s : S) (a : A) : commRight R S A (s ⊗ₜ a) = a ⊗ₜ s := rfl
381+
382+
variable {S A} in
383+
attribute [local instance] Algebra.TensorProduct.rightAlgebra in
384+
@[simp]
385+
lemma Algebra.TensorProduct.commRight_symm_tmul (s : S) (a : A) :
386+
(commRight R S A).symm (a ⊗ₜ[R] s) = s ⊗ₜ a := rfl
387+
388+
end
389+
367390
end
368391

369392
section

0 commit comments

Comments
 (0)