Skip to content

Commit ba81780

Browse files
committed
feat(Algebra): Transcendence degree (#20887)
Define transcendence degree `Algebra.trdeg` and proves some basic properties: In **AlgebraicIndependent/Basic.lean**: define `Algebra.trdeg` to be the supremum of the cardinalities of all AlgebraicIndependent sets, just like `Module.rank` is defined to be the supremum of the cardinalities of all LinearIndependent sets. Add some API lemmas and trivial results about `trdeg`, e.g. that injective/surjective AlgHoms induce inequalities between `trdeg`s, and AlgEquivs induce equalities. In **AlgebraicIndependent/Transcendental.lean**: add API lemmas and show the inequality `trdeg R S + trdeg S A ≤ trdeg R A` (which does not require a domain). In **AlgebraicIndependent/Defs.lean**: add Stacks tags and some trivial API lemmas about IsTranscendenceBasis. Thanks to Chris Hughes and Jz Pan for preliminary works and Peter Nelson for the hint about Finitary and IndepMatroid. TODO: + [The analogue of StrongRankCondition](https://mathoverflow.net/a/484564) in the setting of algebras, which implies `trdeg R (MvPolynomial (Fin n) R) = n` for all Nontrivial CommRing R.
1 parent 4eb8d38 commit ba81780

File tree

5 files changed

+317
-51
lines changed

5 files changed

+317
-51
lines changed

Mathlib/RingTheory/Algebraic/Integral.lean

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ theorem iff_exists_smul_integral [IsReduced R] :
187187
⟨(exists_integral_multiple ·), fun ⟨_, hy, int⟩ ↦
188188
of_smul_isIntegral (by rwa [isNilpotent_iff_eq_zero]) int⟩
189189

190-
section trans
190+
section restrictScalars
191191

192192
variable (R) [NoZeroDivisors S]
193193

@@ -247,7 +247,7 @@ theorem _root_.IsIntegral.trans_isAlgebraic [alg : Algebra.IsAlgebraic R S]
247247
· have := Module.nontrivial S A
248248
exact h.isAlgebraic.restrictScalars _
249249

250-
end trans
250+
end restrictScalars
251251

252252
variable [nzd : NoZeroDivisors R] {a b : S} (ha : IsAlgebraic R a) (hb : IsAlgebraic R b)
253253
include ha
@@ -323,6 +323,9 @@ def Subalgebra.algebraicClosure [IsDomain R] : Subalgebra R S where
323323
add_mem' ha hb := ha.add hb
324324
algebraMap_mem' := isAlgebraic_algebraMap
325325

326+
theorem Subalgebra.mem_algebraicClosure [IsDomain R] {x : S} :
327+
x ∈ algebraicClosure R S ↔ IsAlgebraic R x := Iff.rfl
328+
326329
theorem integralClosure_le_algebraicClosure [IsDomain R] :
327330
integralClosure R S ≤ Subalgebra.algebraicClosure R S :=
328331
fun _ ↦ IsIntegral.isAlgebraic
@@ -361,6 +364,29 @@ theorem IsAlgebraic.of_mul [NoZeroDivisors R] {y z : S} (hy : y ∈ nonZeroDivis
361364
rw [mul_right_comm, eq, ← Algebra.smul_def] at this
362365
exact this.of_smul (mem_nonZeroDivisors_of_ne_zero hr)
363366

367+
open Algebra in
368+
omit [Algebra R A] [IsScalarTower R S A] in
369+
theorem IsAlgebraic.adjoin_of_forall_isAlgebraic [NoZeroDivisors S] {s t : Set S}
370+
(alg : ∀ x ∈ s \ t, IsAlgebraic (adjoin R t) x) {a : A}
371+
(ha : IsAlgebraic (adjoin R s) a) : IsAlgebraic (adjoin R t) a := by
372+
set Rs := adjoin R s
373+
set Rt := adjoin R t
374+
let Rts := adjoin Rt s
375+
let _ : Algebra Rs Rts := (Subalgebra.inclusion
376+
(T := Rts.restrictScalars R) <| adjoin_le <| by apply subset_adjoin).toAlgebra
377+
have : IsScalarTower Rs Rts A := .of_algebraMap_eq fun ⟨a, _⟩ ↦ rfl
378+
have : Algebra.IsAlgebraic Rt Rts := by
379+
have := ha.nontrivial
380+
have := Subtype.val_injective (p := (· ∈ Rs)).nontrivial
381+
have := (isDomain_iff_noZeroDivisors_and_nontrivial Rt).mpr ⟨inferInstance, inferInstance⟩
382+
rw [← Subalgebra.isAlgebraic_iff, isAlgebraic_adjoin_iff]
383+
intro x hs
384+
by_cases ht : x ∈ t
385+
· exact isAlgebraic_algebraMap (⟨x, subset_adjoin ht⟩ : Rt)
386+
exact alg _ ⟨hs, ht⟩
387+
have : IsAlgebraic Rts a := ha.extendScalars (by apply Subalgebra.inclusion_injective)
388+
exact this.restrictScalars Rt
389+
364390
namespace Transcendental
365391

366392
section

Mathlib/RingTheory/AlgebraicIndependent/Basic.lean

Lines changed: 120 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ This file contains basic results on algebraic independence of a family of elemen
2020
2121
* [Stacks: Transcendence](https://stacks.math.columbia.edu/tag/030D)
2222
23-
## TODO
24-
Define the transcendence degree and show it is independent of the choice of a
25-
transcendence basis.
26-
2723
## Tags
2824
transcendence basis, transcendence degree, transcendence
2925
@@ -34,9 +30,17 @@ noncomputable section
3430

3531
open Function Set Subalgebra MvPolynomial Algebra
3632

37-
variable {ι ι' R K A A' : Type*} {x : ι → A}
33+
universe u v v'
34+
35+
variable {ι : Type u} {ι' R : Type*} {A : Type v} {A' : Type v'} {x : ι → A}
3836
variable [CommRing R] [CommRing A] [CommRing A'] [Algebra R A] [Algebra R A']
3937

38+
variable (R A) in
39+
/-- The transcendence degree of a commutative algebra `A` over a commutative ring `R` is
40+
defined to be the maximal cardinality of an `R`-algebraically independent set in `A`. -/
41+
@[stacks 030G] def Algebra.trdeg : Cardinal.{v} :=
42+
⨆ ι : { s : Set A // AlgebraicIndepOn R _root_.id s }, Cardinal.mk ι.1
43+
4044
theorem algebraicIndependent_iff_ker_eq_bot :
4145
AlgebraicIndependent R x ↔
4246
RingHom.ker (MvPolynomial.aeval x : MvPolynomial ι R →ₐ[R] A).toRingHom = ⊥ :=
@@ -47,6 +51,9 @@ theorem algebraicIndependent_empty_type_iff [IsEmpty ι] :
4751
AlgebraicIndependent R x ↔ Injective (algebraMap R A) := by
4852
rw [algebraicIndependent_iff_injective_aeval, MvPolynomial.aeval_injective_iff_of_isEmpty]
4953

54+
instance [FaithfulSMul R A] : Nonempty { s : Set A // AlgebraicIndepOn R id s } :=
55+
⟨∅, algebraicIndependent_empty_type_iff.mpr <| FaithfulSMul.algebraMap_injective R A⟩
56+
5057
namespace AlgebraicIndependent
5158

5259
variable (hx : AlgebraicIndependent R x)
@@ -114,6 +121,14 @@ theorem of_aeval {f : ι → MvPolynomial ι R}
114121

115122
end AlgebraicIndependent
116123

124+
theorem isEmpty_algebraicIndependent (h : ¬ Injective (algebraMap R A)) :
125+
IsEmpty { s : Set A // AlgebraicIndepOn R id s } where
126+
false s := h s.2.algebraMap_injective
127+
128+
theorem trdeg_eq_zero_of_not_injective (h : ¬ Injective (algebraMap R A)) : trdeg R A = 0 := by
129+
have := isEmpty_algebraicIndependent h
130+
rw [trdeg, ciSup_of_empty, bot_eq_zero]
131+
117132
theorem MvPolynomial.algebraicIndependent_X (σ R : Type*) [CommRing R] :
118133
AlgebraicIndependent R (X (R := R) (σ := σ)) := by
119134
rw [AlgebraicIndependent, aeval_X_left]
@@ -126,9 +141,30 @@ theorem AlgHom.algebraicIndependent_iff (f : A →ₐ[R] A') (hf : Injective f)
126141
fun h => h.of_comp f, fun h => h.map hf.injOn⟩
127142

128143
@[nontriviality]
129-
theorem algebraicIndependent_of_subsingleton [Subsingleton R] : AlgebraicIndependent R x :=
144+
theorem AlgebraicIndependent.of_subsingleton [Subsingleton R] : AlgebraicIndependent R x :=
130145
algebraicIndependent_iff.2 fun _ _ => Subsingleton.elim _ _
131146

147+
@[deprecated (since := "2025-02-07")] alias algebraicIndependent_of_subsingleton :=
148+
AlgebraicIndependent.of_subsingleton
149+
150+
theorem isTranscendenceBasis_iff_of_subsingleton [Subsingleton R] (x : ι → A) :
151+
IsTranscendenceBasis R x ↔ Nonempty ι := by
152+
have := Module.subsingleton R A
153+
refine ⟨fun h ↦ ?_, fun h ↦ ⟨.of_subsingleton, fun s hs hx ↦
154+
hx.antisymm fun a _ ↦ ⟨Classical.arbitrary _, Subsingleton.elim ..⟩⟩⟩
155+
by_contra hι; rw [not_nonempty_iff] at hι
156+
have := h.2 {0} .of_subsingleton
157+
simp [range_eq_empty, eq_comm (a := ∅)] at this
158+
159+
@[nontriviality] theorem IsTranscendenceBasis.of_subsingleton [Subsingleton R] [Nonempty ι] :
160+
IsTranscendenceBasis R x :=
161+
(isTranscendenceBasis_iff_of_subsingleton x).mpr ‹_›
162+
163+
@[nontriviality] theorem trdeg_subsingleton [Subsingleton R] : trdeg R A = 1 :=
164+
have := Module.subsingleton R A
165+
(ciSup_le' fun s ↦ by simpa using Set.subsingleton_of_subsingleton).antisymm <| le_ciSup_of_le
166+
(Cardinal.bddAbove_range _) ⟨{0}, .of_subsingleton⟩ (by simp)
167+
132168
theorem algebraicIndependent_adjoin (hs : AlgebraicIndependent R x) :
133169
@AlgebraicIndependent ι R (adjoin R (range x))
134170
(fun i : ι => ⟨x i, subset_adjoin (mem_range_self i)⟩) _ _ _ :=
@@ -236,14 +272,83 @@ theorem algebraicIndependent_empty_iff :
236272

237273
end Subtype
238274

239-
theorem AlgebraicIndependent.to_subtype_range {ι} {f : ι → A} (hf : AlgebraicIndependent R f) :
240-
AlgebraicIndependent R ((↑) : range f → A) := by
275+
theorem AlgebraicIndependent.to_subtype_range (hx : AlgebraicIndependent R x) :
276+
AlgebraicIndependent R ((↑) : range x → A) := by
277+
nontriviality R
278+
rwa [algebraicIndependent_subtype_range hx.injective]
279+
280+
theorem AlgebraicIndependent.to_subtype_range' (hx : AlgebraicIndependent R x) {t}
281+
(ht : range x = t) :AlgebraicIndependent R ((↑) : t → A) :=
282+
ht ▸ hx.to_subtype_range
283+
284+
theorem IsTranscendenceBasis.to_subtype_range (hx : IsTranscendenceBasis R x) :
285+
IsTranscendenceBasis R ((↑) : range x → A) := by
286+
cases subsingleton_or_nontrivial R
287+
· rw [isTranscendenceBasis_iff_of_subsingleton] at hx ⊢; infer_instance
288+
· rwa [isTranscendenceBasis_subtype_range hx.1.injective]
289+
290+
theorem IsTranscendenceBasis.to_subtype_range' (hx : IsTranscendenceBasis R x) {t}
291+
(ht : range x = t) : IsTranscendenceBasis R ((↑) : t → A) :=
292+
ht ▸ hx.to_subtype_range
293+
294+
theorem AlgEquiv.isTranscendenceBasis (e : A ≃ₐ[R] A') (hx : IsTranscendenceBasis R x) :
295+
IsTranscendenceBasis R (e ∘ x) := by
296+
refine ⟨by apply hx.1.map' (id e.injective : Injective e.toAlgHom), fun s hs hxs ↦ ?_⟩
297+
rw [AlgebraicIndepOn, ← e.symm.toAlgHom.algebraicIndependent_iff e.symm.injective] at hs
298+
rw [range_comp, hx.2 _ hs.to_subtype_range, ← range_comp, ← comp_assoc, range_comp]
299+
· convert s.image_id <;> (ext; simp)
300+
rintro _ ⟨i, rfl⟩
301+
exact ⟨⟨_, hxs ⟨i, rfl⟩⟩, by simp⟩
302+
303+
theorem AlgEquiv.isTranscendenceBasis_iff (e : A ≃ₐ[R] A') :
304+
IsTranscendenceBasis R (e ∘ x) ↔ IsTranscendenceBasis R x :=
305+
fun hx ↦ by convert e.symm.isTranscendenceBasis hx; ext; simp, e.isTranscendenceBasis⟩
306+
307+
section trdeg
308+
309+
open Cardinal
310+
311+
theorem AlgebraicIndependent.lift_cardinalMk_le_trdeg [Nontrivial R]
312+
(hx : AlgebraicIndependent R x) : lift.{v} #ι ≤ lift.{u} (trdeg R A) := by
313+
rw [lift_mk_eq'.mpr ⟨.ofInjective _ hx.injective⟩, lift_le]
314+
exact le_ciSup_of_le (bddAbove_range _) ⟨_, hx.to_subtype_range⟩ le_rfl
315+
316+
theorem AlgebraicIndependent.cardinalMk_le_trdeg [Nontrivial R] {ι : Type v} {x : ι → A}
317+
(hx : AlgebraicIndependent R x) : #ι ≤ trdeg R A := by
318+
rw [← (#ι).lift_id, ← (trdeg R A).lift_id]; exact hx.lift_cardinalMk_le_trdeg
319+
320+
theorem lift_trdeg_le_of_injective (f : A →ₐ[R] A') (hf : Injective f) :
321+
lift.{v'} (trdeg R A) ≤ lift.{v} (trdeg R A') := by
322+
nontriviality R
323+
rw [trdeg, lift_iSup (bddAbove_range _)]
324+
exact ciSup_le' fun i ↦ (i.2.map' hf).lift_cardinalMk_le_trdeg
325+
326+
theorem trdeg_le_of_injective {A' : Type v} [CommRing A'] [Algebra R A'] (f : A →ₐ[R] A')
327+
(hf : Injective f) : trdeg R A ≤ trdeg R A' := by
328+
rw [← (trdeg R A).lift_id, ← (trdeg R A').lift_id]; exact lift_trdeg_le_of_injective f hf
329+
330+
theorem lift_trdeg_le_of_surjective (f : A →ₐ[R] A') (hf : Surjective f) :
331+
lift.{v} (trdeg R A') ≤ lift.{v'} (trdeg R A) := by
241332
nontriviality R
242-
rwa [algebraicIndependent_subtype_range hf.injective]
333+
rw [trdeg, lift_iSup (bddAbove_range _)]
334+
refine ciSup_le' fun i ↦ (lift_cardinalMk_le_trdeg (x := fun a : i.1 ↦ (⇑f).invFun a) <|
335+
of_comp f ?_)
336+
convert i.2; simp [invFun_eq (hf _)]
337+
338+
theorem trdeg_le_of_surjective {A' : Type v} [CommRing A'] [Algebra R A'] (f : A →ₐ[R] A')
339+
(hf : Surjective f) : trdeg R A' ≤ trdeg R A := by
340+
rw [← (trdeg R A).lift_id, ← (trdeg R A').lift_id]; exact lift_trdeg_le_of_surjective f hf
341+
342+
theorem AlgEquiv.lift_trdeg_eq (e : A ≃ₐ[R] A') :
343+
lift.{v'} (trdeg R A) = lift.{v} (trdeg R A') :=
344+
(lift_trdeg_le_of_injective e.toAlgHom e.injective).antisymm
345+
(lift_trdeg_le_of_surjective e.toAlgHom e.surjective)
346+
347+
theorem AlgEquiv.trdeg_eq {A' : Type v} [CommRing A'] [Algebra R A'] (e : A ≃ₐ[R] A') :
348+
trdeg R A = trdeg R A' := by
349+
rw [← (trdeg R A).lift_id, e.lift_trdeg_eq, lift_id]
243350

244-
theorem AlgebraicIndependent.to_subtype_range' {ι} {f : ι → A} (hf : AlgebraicIndependent R f) {t}
245-
(ht : range f = t) : AlgebraicIndependent R ((↑) : t → A) :=
246-
ht ▸ hf.to_subtype_range
351+
end trdeg
247352

248353
theorem algebraicIndependent_comp_subtype {s : Set ι} :
249354
AlgebraicIndependent R (x ∘ (↑) : s → A) ↔
@@ -299,8 +404,8 @@ theorem algebraicIndependent_sUnion_of_directed {s : Set (Set A)} (hsn : s.Nonem
299404
exact algebraicIndependent_iUnion_of_directed hs.directed_val (by simpa using h)
300405

301406
theorem exists_maximal_algebraicIndependent (s t : Set A) (hst : s ⊆ t)
302-
(hs : AlgebraicIndependent R ((↑) : s → A)) : ∃ u, s ⊆ u ∧
303-
Maximal (fun (x : Set A) ↦ AlgebraicIndependent R ((↑) : x → A) ∧ x ⊆ t) u := by
407+
(hs : AlgebraicIndepOn R id s) : ∃ u, s ⊆ u ∧
408+
Maximal (fun (x : Set A) ↦ AlgebraicIndepOn R id x ∧ x ⊆ t) u := by
304409
refine zorn_subset_nonempty { u : Set A | AlgebraicIndependent R ((↑) : u → A) ∧ u ⊆ t}
305410
(fun c hc chainc hcn ↦ ⟨⋃₀ c, ⟨?_, ?_⟩, fun _ ↦ subset_sUnion_of_mem⟩) s ⟨hs, hst⟩
306411
· exact algebraicIndependent_sUnion_of_directed hcn chainc.directedOn (fun x hxc ↦ (hc hxc).1)
@@ -374,7 +479,7 @@ theorem AlgebraicIndependent.aeval_comp_mvPolynomialOptionEquivPolynomialAdjoin
374479

375480
section Field
376481

377-
variable [Field K] [Algebra K A]
482+
variable {K : Type*} [Field K] [Algebra K A]
378483

379484
/- Porting note: removing `simp`, not in simp normal form. Could make `Function.Injective f` a
380485
simp lemma when `f` is a field hom, and then simp would prove this -/

Mathlib/RingTheory/AlgebraicIndependent/Defs.lean

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ variable [CommRing R] [CommRing A] [CommRing A'] [Algebra R A] [Algebra R A']
4747
/-- `AlgebraicIndependent R x` states the family of elements `x`
4848
is algebraically independent over `R`, meaning that the canonical
4949
map out of the multivariable polynomial ring is injective. -/
50-
def AlgebraicIndependent : Prop :=
50+
@[stacks 030E "(1)"] def AlgebraicIndependent : Prop :=
5151
Injective (MvPolynomial.aeval x : MvPolynomial ι R →ₐ[R] A)
5252

53+
/-- `AlgebraicIndepOn R v s` states that the elements in the family `v` that are indexed by the
54+
elements of `s` are algebraically independent over `R`. -/
55+
abbrev AlgebraicIndepOn (s : Set ι) : Prop := AlgebraicIndependent R fun i : s ↦ x i
56+
5357
variable {R} {x}
5458

5559
theorem algebraicIndependent_iff :
@@ -145,9 +149,30 @@ end repr
145149

146150
end AlgebraicIndependent
147151

148-
variable (R)
149-
152+
variable (R) in
150153
/-- A family is a transcendence basis if it is a maximal algebraically independent subset. -/
151-
def IsTranscendenceBasis (x : ι → A) : Prop :=
154+
@[stacks 030E "(4)"] def IsTranscendenceBasis (x : ι → A) : Prop :=
152155
AlgebraicIndependent R x ∧
153-
∀ (s : Set A) (_ : AlgebraicIndependent R ((↑) : s → A)) (_ : range x ≤ s), range x = s
156+
∀ (s : Set A) (_ : AlgebraicIndepOn R id s) (_ : range x ⊆ s), range x = s
157+
158+
theorem isTranscendenceBasis_iff_maximal {s : Set A} :
159+
IsTranscendenceBasis R ((↑) : s → A) ↔ Maximal (AlgebraicIndepOn R id) s := by
160+
rw [IsTranscendenceBasis, maximal_iff, Subtype.range_val]; rfl
161+
162+
theorem isTranscendenceBasis_equiv (e : ι ≃ ι') {f : ι' → A} :
163+
IsTranscendenceBasis R (f ∘ e) ↔ IsTranscendenceBasis R f := by
164+
simp_rw [IsTranscendenceBasis, algebraicIndependent_equiv, EquivLike.range_comp]
165+
166+
theorem isTranscendenceBasis_equiv' (e : ι ≃ ι') {f : ι' → A} {g : ι → A} (h : f ∘ e = g) :
167+
IsTranscendenceBasis R g ↔ IsTranscendenceBasis R f :=
168+
h ▸ isTranscendenceBasis_equiv e
169+
170+
theorem isTranscendenceBasis_subtype_range {ι} {f : ι → A} (hf : Injective f) :
171+
IsTranscendenceBasis R ((↑) : range f → A) ↔ IsTranscendenceBasis R f :=
172+
.symm <| isTranscendenceBasis_equiv' (Equiv.ofInjective f hf) rfl
173+
174+
alias ⟨IsTranscendenceBasis.of_subtype_range, _⟩ := isTranscendenceBasis_subtype_range
175+
176+
theorem isTranscendenceBasis_image {ι} {s : Set ι} {f : ι → A} (hf : Set.InjOn f s) :
177+
IsTranscendenceBasis R (fun x : s ↦ f x) ↔ IsTranscendenceBasis R fun x : f '' s ↦ (x : A) :=
178+
isTranscendenceBasis_equiv' (Equiv.Set.imageOfInjOn _ _ hf) rfl

Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ theorem IsTranscendenceBasis.isAlgebraic [Nontrivial R] (hx : IsTranscendenceBas
8181
Algebra.IsAlgebraic (adjoin R (range x)) A := by
8282
constructor
8383
intro a
84-
rw [← not_iff_comm.1 (hx.1.option_iff _).symm]
84+
rw [← not_iff_comm.1 (hx.1.option_iff_transcendental _).symm]
8585
intro ai
8686
have h₁ : range x ⊆ range fun o : Option ι => o.elim a x := by
8787
rintro x ⟨y, rfl⟩

0 commit comments

Comments
 (0)