import OAI.AlgebraicGeometry.DivisorClass.Chern.FiniteTypeDimension import Mathlib.RingTheory.Jacobson.Ring import Mathlib.RingTheory.UniqueFactorizationDomain.Ideal import Mathlib.RingTheory.KrullDimension.Regular /-! # Polynomial Dimension -/ namespace OAI.AlgebraicGeometry.DivisorClass.Chern.PolynomialDimension.Construction noncomputable section /-! # ChernClass: dimension drop at height-one primes of polynomial rings Maximal polynomial ideals have the full ambient height. A height-one prime is generated by a prime element, and the regular-element dimension theorem then gives the exact one-dimensional drop. -/ variable (K : Type) [Field K] /-- Every maximal ideal of an `n`-variable polynomial algebra over a field has height `n`. -/ theorem mvPolynomial_maximal_height (n : ℕ) (p : Ideal (MvPolynomial (Fin n) K)) [p.IsMaximal] : p.height = n := by induction n with | zero => let e := (MvPolynomial.isEmptyAlgEquiv K (Fin 0)).toRingEquiv let q : Ideal K := p.map e have : q.IsMaximal := by dsimp [q]; infer_instance have hq := Ideal.height_le_ringKrullDim_of_ne_top (show q ≠ ⊤ from (show q.IsMaximal from inferInstance).ne_top) rw [ringKrullDim_eq_zero_of_field] at hq have hq0 : q.height = 0 := by apply le_antisymm _ bot_le exact_mod_cast hq exact (e.height_map p).symm.trans hq0 | succ n ih => let e := (MvPolynomial.finSuccEquiv K n).toRingEquiv let q : Ideal (Polynomial (MvPolynomial (Fin n) K)) := p.map e have : q.IsMaximal := by dsimp [q]; infer_instance let r : Ideal (MvPolynomial (Fin n) K) := q.comap Polynomial.C have : r.IsMaximal := Polynomial.isMaximal_comap_C_of_isJacobsonRing q have : q.LiesOver r := ⟨rfl⟩ calc p.height = q.height := (e.height_map p).symm _ = r.height + 1 := Polynomial.height_eq_height_add_one r q _ = (n + 1 : ℕ) := by rw [ih r]; simp only [Nat.cast_add, Nat.cast_one] /-- Quotient by a height-one polynomial prime lowers Krull dimension by exactly one. -/ theorem mvPolynomial_height_one_quotient_dimension (n : ℕ) (p : Ideal (MvPolynomial (Fin n) K)) [p.IsPrime] (hp : p.height = 1) : ringKrullDim (MvPolynomial (Fin n) K ⧸ p) + 1 = ringKrullDim (MvPolynomial (Fin n) K) := by obtain ⟨f, hfp, hf⟩ := Ideal.IsPrime.exists_mem_prime_of_ne_bot (show p.IsPrime from inferInstance) (Ideal.ne_bot_of_height_eq_one hp) have hspan : p = Ideal.span {f} := Ideal.eq_span_singleton_of_height_eq_one hp hfp hf obtain ⟨m, hm, hpm⟩ := Ideal.exists_le_maximal p Ideal.IsPrime.ne_top' let : m.IsMaximal := hm have hmax : (m.height : WithBot ℕ∞) = ringKrullDim (MvPolynomial (Fin n) K) := by rw [mvPolynomial_maximal_height, MvPolynomial.ringKrullDim_of_isNoetherianRing, ringKrullDim_eq_zero_of_field, zero_add, ENat.card_eq_coe_fintype_card, Fintype.card_fin] have hdim := Module.ringKrullDim_quotient_add_one_of_mem_nonZeroDivisors (mem_nonZeroDivisors_iff_ne_zero.mpr hf.ne_zero) hmax (hpm hfp) rwa [← hspan] at hdim end end OAI.AlgebraicGeometry.DivisorClass.Chern.PolynomialDimension.Construction