Stafford38/Geometry/MvPolynomialFractionFieldTranscendenceBasis.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.RingTheory.AlgebraicIndependent.Adjoin
3 public import Mathlib.RingTheory.AlgebraicIndependent.TranscendenceBasis
4 public import Mathlib.RingTheory.Localization.FractionRing
5 public import Mathlib.RingTheory.Localization.Integral
6 
7 @[expose] public section
8 
9 set_option autoImplicit false
10 set_option linter.style.haveILetI false
11 
12 namespace Stafford38.Geometry.MvPolynomialFractionFieldTranscendenceBasis
13 
14 universe u v w
15 
16 variable {k : Type u} [Field k]
17 
18 /-- The standard variables are a transcendence basis in the fraction field of a polynomial ring
19 over any finite index type. `ULift` gives the indexing type the universe of the coefficient field,
20 as required by the cardinality API for transcendence degree. -/
21 theorem standardVariables_isTranscendenceBasis_of_fintype {σ : Type v} [Fintype σ] :
22     IsTranscendenceBasis k
23       (fun i : ULift.{u} σ =>
24         algebraMap (MvPolynomial σ k) (FractionRing (MvPolynomial σ k))
25           (MvPolynomial.X i.down)) := by
26   let A := MvPolynomial σ k
27   let E := FractionRing A
28   have hAE : Algebra.IsAlgebraic A E :=
29     (IsFractionRing.isAlgebraic_iff' A A E).mp inferInstance
30   letI : Algebra.IsAlgebraic A E := hAE
31   have hσ : IsTranscendenceBasis k
32       (fun i : σ => algebraMap A E (MvPolynomial.X i)) := by
33     exact (IsTranscendenceBasis.mvPolynomial σ k).algebraMap_comp
34   apply (isTranscendenceBasis_equiv
35     (Equiv.ulift.symm : σ ≃ ULift.{u} σ)).mp
36   simpa [Function.comp_def] using hσ
37 
38 /-- The canonical fraction field of a finite-variable polynomial algebra has the expected finite
39 transcendence degree. -/
40 theorem trdeg_eq_of_fintype {σ : Type v} [Fintype σ] :
41     Algebra.trdeg k (FractionRing (MvPolynomial σ k)) = Fintype.card σ := by
42   rw [← (standardVariables_isTranscendenceBasis_of_fintype (k := k) (σ := σ)).cardinalMk_eq_trdeg]
43   simp
44 
45 theorem trdeg_lt_aleph0_of_fintype {σ : Type v} [Fintype σ] :
46     Algebra.trdeg k (FractionRing (MvPolynomial σ k)) < Cardinal.aleph0 := by
47   rw [trdeg_eq_of_fintype (k := k) (σ := σ)]
48   exact Cardinal.natCast_lt_aleph0
49 
50 /-- If the images of the polynomial variables in a field extension form a transcendence basis,
51 then the fraction-field algebra they induce is the whole extension up to algebraic extension.
52 The algebra structure on the fraction field is the given one; the variable family is required to
53 be its actual image, so no extra range-identification hypothesis is hidden here. -/
54 theorem isAlgebraic_fractionRing_of_variable_images_isTranscendenceBasis
55     {σ : Type v} {κ : Type w} [Field κ] [Algebra k κ]
56     [Algebra (FractionRing (MvPolynomial σ k)) κ]
57     [IsScalarTower k (FractionRing (MvPolynomial σ k)) κ]
58     (hvars : IsTranscendenceBasis k
59       (fun i : σ =>
60         algebraMap (FractionRing (MvPolynomial σ k)) κ
61           (algebraMap (MvPolynomial σ k) (FractionRing (MvPolynomial σ k))
62             (MvPolynomial.X i)))) :
63     Algebra.IsAlgebraic (FractionRing (MvPolynomial σ k)) κ := by
64   let A := MvPolynomial σ k
65   let E := FractionRing A
66   let x : σ → κ := fun i =>
67     algebraMap E κ (algebraMap A E (MvPolynomial.X i))
68   have hx : IsTranscendenceBasis k x := by
69     simpa [x] using hvars
70   let K : IntermediateField k κ := IntermediateField.adjoin k (Set.range x)
71   let A₀ : Subalgebra k κ := Algebra.adjoin k (Set.range x)
72   have hA₀κ : Algebra.IsAlgebraic A₀ κ := by
73     simpa [A₀] using hx.isAlgebraic
74   let e : E ≃ₐ[k] K := hx.1.aevalEquivField
75   have hA₀K : A₀ ≤ K.toSubalgebra :=
76     IntermediateField.algebra_adjoin_le_adjoin k (Set.range x)
77   have hKκ : Algebra.IsAlgebraic K κ := by
78     letI : Algebra A₀ K := (Subalgebra.inclusion hA₀K).toAlgebra
79     letI : IsScalarTower A₀ K κ := IsScalarTower.of_algebraMap_eq fun _ => rfl
80     exact hA₀κ.extendScalars (Subalgebra.inclusion_injective hA₀K)
81   have hpoly :
82       (IsScalarTower.toAlgHom k E κ).comp (IsScalarTower.toAlgHom k A E) =
83         MvPolynomial.aeval x := by
84     apply MvPolynomial.algHom_ext
85     intro i
86     simp [x, IsScalarTower.toAlgHom]
87   letI : IsFractionRing A E := inferInstance
88   have hforward :
89       (algebraMap K κ).comp e.toRingEquiv.toRingHom = algebraMap E κ := by
90     apply IsFractionRing.ringHom_ext (A := A)
91     intro p
92     change ((e (algebraMap A E p) : K) : κ) = algebraMap E κ (algebraMap A E p)
93     rw [hx.1.aevalEquivField_algebraMap_apply_coe]
94     exact (DFunLike.congr_fun hpoly p).symm
95   have hback :
96       (algebraMap E κ).comp e.symm.toRingEquiv.toRingHom =
97         (RingHom.id κ).comp (algebraMap K κ) := by
98     ext z
99     have hz := DFunLike.congr_fun hforward (e.symm z)
100     simpa using hz.symm
101   exact
102     (Algebra.isAlgebraic_ringHom_iff_of_comp_eq
103       e.symm.toRingEquiv (RingEquiv.refl κ) hback).mpr hKκ
104 
105 /-- The legacy `Fin d` spelling is a specialization of the finite-index theorem. -/
106 theorem standardVariables_isTranscendenceBasis (d : ℕ) :
107     IsTranscendenceBasis k
108       (fun i : ULift.{u} (Fin d) =>
109         algebraMap (MvPolynomial (Fin d) k)
110           (FractionRing (MvPolynomial (Fin d) k)) (MvPolynomial.X i.down)) :=
111   standardVariables_isTranscendenceBasis_of_fintype (k := k) (σ := Fin d)
112 
113 theorem trdeg_eq (d : ℕ) :
114     Algebra.trdeg k (FractionRing (MvPolynomial (Fin d) k)) = d := by
115   simpa using (trdeg_eq_of_fintype (k := k) (σ := Fin d))
116 
117 theorem trdeg_lt_aleph0 (d : ℕ) :
118     Algebra.trdeg k (FractionRing (MvPolynomial (Fin d) k)) < Cardinal.aleph0 := by
119   exact trdeg_lt_aleph0_of_fintype (k := k) (σ := Fin d)
120 
121 end Stafford38.Geometry.MvPolynomialFractionFieldTranscendenceBasis
122