2023-06-12 15:03:35 -05:00
|
|
|
|
import Mathlib.RingTheory.Ideal.Operations
|
|
|
|
|
import Mathlib.RingTheory.FiniteType
|
2023-06-10 10:13:10 -05:00
|
|
|
|
import Mathlib.Order.Height
|
|
|
|
|
import Mathlib.RingTheory.PrincipalIdealDomain
|
|
|
|
|
import Mathlib.RingTheory.DedekindDomain.Basic
|
|
|
|
|
import Mathlib.RingTheory.Ideal.Quotient
|
|
|
|
|
import Mathlib.RingTheory.Localization.AtPrime
|
2023-06-11 23:02:46 -05:00
|
|
|
|
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic
|
2023-06-12 11:49:40 -05:00
|
|
|
|
import Mathlib.Order.ConditionallyCompleteLattice.Basic
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
|
|
|
|
/- This file contains the definitions of height of an ideal, and the krull
|
|
|
|
|
dimension of a commutative ring.
|
|
|
|
|
There are also sorried statements of many of the theorems that would be
|
|
|
|
|
really nice to prove.
|
|
|
|
|
I'm imagining for this file to ultimately contain basic API for height and
|
|
|
|
|
krull dimension, and the theorems will probably end up other files,
|
|
|
|
|
depending on how long the proofs are, and what extra API needs to be
|
|
|
|
|
developed.
|
|
|
|
|
-/
|
|
|
|
|
|
2023-06-11 23:02:46 -05:00
|
|
|
|
namespace Ideal
|
2023-06-12 16:27:09 -05:00
|
|
|
|
open LocalRing
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-11 23:02:46 -05:00
|
|
|
|
variable {R : Type _} [CommRing R] (I : PrimeSpectrum R)
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-11 23:15:30 -05:00
|
|
|
|
noncomputable def height : ℕ∞ := Set.chainHeight {J : PrimeSpectrum R | J < I}
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-13 16:26:19 -05:00
|
|
|
|
noncomputable def krullDim (R : Type _) [CommRing R] : WithBot ℕ∞ := ⨆ (I : PrimeSpectrum R), height I
|
2023-06-12 11:49:40 -05:00
|
|
|
|
|
|
|
|
|
lemma height_def : height I = Set.chainHeight {J : PrimeSpectrum R | J < I} := rfl
|
2023-06-13 16:26:19 -05:00
|
|
|
|
lemma krullDim_def (R : Type _) [CommRing R] : krullDim R = (⨆ (I : PrimeSpectrum R), height I : WithBot ℕ∞) := rfl
|
|
|
|
|
lemma krullDim_def' (R : Type _) [CommRing R] : krullDim R = iSup (λ I : PrimeSpectrum R => (height I : WithBot ℕ∞)) := rfl
|
2023-06-12 11:49:40 -05:00
|
|
|
|
|
|
|
|
|
noncomputable instance : CompleteLattice (WithBot (ℕ∞)) := WithBot.WithTop.completeLattice
|
|
|
|
|
|
2023-06-12 16:27:09 -05:00
|
|
|
|
lemma height_le_of_le {I J : PrimeSpectrum R} (I_le_J : I ≤ J) : height I ≤ height J := by
|
|
|
|
|
apply Set.chainHeight_mono
|
|
|
|
|
intro J' hJ'
|
|
|
|
|
show J' < J
|
|
|
|
|
exact lt_of_lt_of_le hJ' I_le_J
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-13 16:26:19 -05:00
|
|
|
|
lemma krullDim_le_iff (R : Type _) [CommRing R] (n : ℕ) :
|
2023-06-12 16:27:09 -05:00
|
|
|
|
krullDim R ≤ n ↔ ∀ I : PrimeSpectrum R, (height I : WithBot ℕ∞) ≤ ↑n := iSup_le_iff (α := WithBot ℕ∞)
|
|
|
|
|
|
2023-06-13 16:26:19 -05:00
|
|
|
|
lemma krullDim_le_iff' (R : Type _) [CommRing R] (n : ℕ∞) :
|
2023-06-12 16:27:09 -05:00
|
|
|
|
krullDim R ≤ n ↔ ∀ I : PrimeSpectrum R, (height I : WithBot ℕ∞) ≤ ↑n := iSup_le_iff (α := WithBot ℕ∞)
|
|
|
|
|
|
2023-06-13 16:26:19 -05:00
|
|
|
|
lemma le_krullDim_iff (R : Type _) [CommRing R] (n : ℕ) :
|
2023-06-13 16:17:59 -05:00
|
|
|
|
n ≤ krullDim R ↔ ∃ I : PrimeSpectrum R, n ≤ (height I : WithBot ℕ∞) := by sorry
|
|
|
|
|
|
2023-06-13 16:26:19 -05:00
|
|
|
|
lemma le_krullDim_iff' (R : Type _) [CommRing R] (n : ℕ∞) :
|
2023-06-13 16:17:59 -05:00
|
|
|
|
n ≤ krullDim R ↔ ∃ I : PrimeSpectrum R, n ≤ (height I : WithBot ℕ∞) := by sorry
|
|
|
|
|
|
2023-06-12 16:27:09 -05:00
|
|
|
|
@[simp]
|
|
|
|
|
lemma height_le_krullDim (I : PrimeSpectrum R) : height I ≤ krullDim R :=
|
|
|
|
|
le_iSup (λ I : PrimeSpectrum R => (height I : WithBot ℕ∞)) I
|
|
|
|
|
|
|
|
|
|
lemma krullDim_eq_height [LocalRing R] : krullDim R = height (closedPoint R) := by
|
|
|
|
|
apply le_antisymm
|
|
|
|
|
. rw [krullDim_le_iff']
|
|
|
|
|
intro I
|
|
|
|
|
apply WithBot.coe_mono
|
|
|
|
|
apply height_le_of_le
|
|
|
|
|
apply le_maximalIdeal
|
|
|
|
|
exact I.2.1
|
|
|
|
|
. simp
|
|
|
|
|
|
|
|
|
|
#check height_le_krullDim
|
2023-06-10 10:13:10 -05:00
|
|
|
|
--some propositions that would be nice to be able to eventually
|
|
|
|
|
|
2023-06-13 15:34:02 -05:00
|
|
|
|
lemma primeSpectrum_empty_of_subsingleton (x : PrimeSpectrum R) [Subsingleton R] : False :=
|
|
|
|
|
x.1.ne_top_iff_one.1 x.2.1 <| Eq.substr (Subsingleton.elim 1 (0 : R)) x.1.zero_mem
|
|
|
|
|
|
|
|
|
|
lemma primeSpectrum_empty_iff : IsEmpty (PrimeSpectrum R) ↔ Subsingleton R := by
|
|
|
|
|
constructor
|
|
|
|
|
. contrapose
|
|
|
|
|
rw [not_isEmpty_iff, ←not_nontrivial_iff_subsingleton, not_not]
|
|
|
|
|
apply PrimeSpectrum.instNonemptyPrimeSpectrum
|
|
|
|
|
. intro h
|
|
|
|
|
by_contra hneg
|
|
|
|
|
rw [not_isEmpty_iff] at hneg
|
|
|
|
|
rcases hneg with ⟨a, ha⟩
|
|
|
|
|
exact primeSpectrum_empty_of_subsingleton ⟨a, ha⟩
|
|
|
|
|
|
|
|
|
|
/-- A ring has Krull dimension -∞ if and only if it is the zero ring -/
|
|
|
|
|
lemma dim_eq_bot_iff : krullDim R = ⊥ ↔ Subsingleton R := by
|
|
|
|
|
unfold Ideal.krullDim
|
|
|
|
|
rw [←primeSpectrum_empty_iff, iSup_eq_bot]
|
|
|
|
|
constructor <;> intro h
|
|
|
|
|
. rw [←not_nonempty_iff]
|
|
|
|
|
rintro ⟨a, ha⟩
|
|
|
|
|
specialize h ⟨a, ha⟩
|
|
|
|
|
tauto
|
|
|
|
|
. rw [h.forall_iff]
|
|
|
|
|
trivial
|
2023-06-12 15:03:35 -05:00
|
|
|
|
|
2023-06-13 22:58:32 -05:00
|
|
|
|
lemma krullDim_nonneg_of_nontrivial (R : Type _) [CommRing R] [Nontrivial R] : ∃ n : ℕ∞, Ideal.krullDim R = n := by
|
|
|
|
|
have h := dim_eq_bot_iff.not.mpr (not_subsingleton R)
|
|
|
|
|
lift (Ideal.krullDim R) to ℕ∞ using h with k
|
|
|
|
|
use k
|
|
|
|
|
|
|
|
|
|
lemma dim_eq_zero_iff [Nontrivial R] : krullDim R = 0 ↔ ∀ I : PrimeSpectrum R, IsMaximal I.asIdeal := by
|
|
|
|
|
constructor <;> intro h
|
|
|
|
|
. intro I
|
|
|
|
|
sorry
|
|
|
|
|
. sorry
|
2023-06-13 16:45:10 -05:00
|
|
|
|
|
2023-06-13 16:35:10 -05:00
|
|
|
|
@[simp]
|
|
|
|
|
lemma field_prime_bot {K: Type _} [Field K] (P : Ideal K) : IsPrime P ↔ P = ⊥ := by
|
|
|
|
|
constructor
|
|
|
|
|
· intro primeP
|
|
|
|
|
obtain T := eq_bot_or_top P
|
|
|
|
|
have : ¬P = ⊤ := IsPrime.ne_top primeP
|
|
|
|
|
tauto
|
|
|
|
|
· intro botP
|
|
|
|
|
rw [botP]
|
|
|
|
|
exact bot_prime
|
|
|
|
|
|
|
|
|
|
lemma field_prime_height_zero {K: Type _} [Field K] (P : PrimeSpectrum K) : height P = 0 := by
|
|
|
|
|
unfold height
|
|
|
|
|
simp
|
|
|
|
|
by_contra spec
|
|
|
|
|
change _ ≠ _ at spec
|
|
|
|
|
rw [← Set.nonempty_iff_ne_empty] at spec
|
|
|
|
|
obtain ⟨J, JlP : J < P⟩ := spec
|
|
|
|
|
have P0 : IsPrime P.asIdeal := P.IsPrime
|
|
|
|
|
have J0 : IsPrime J.asIdeal := J.IsPrime
|
|
|
|
|
rw [field_prime_bot] at P0 J0
|
|
|
|
|
have : J.asIdeal = P.asIdeal := Eq.trans J0 (Eq.symm P0)
|
|
|
|
|
have : J = P := PrimeSpectrum.ext J P this
|
|
|
|
|
have : J ≠ P := ne_of_lt JlP
|
|
|
|
|
contradiction
|
|
|
|
|
|
|
|
|
|
lemma dim_field_eq_zero {K : Type _} [Field K] : krullDim K = 0 := by
|
|
|
|
|
unfold krullDim
|
|
|
|
|
simp [field_prime_height_zero]
|
|
|
|
|
|
|
|
|
|
lemma isField.dim_zero {D: Type _} [CommRing D] [IsDomain D] (h: krullDim D = 0) : IsField D := by
|
|
|
|
|
by_contra x
|
|
|
|
|
rw [Ring.not_isField_iff_exists_prime] at x
|
|
|
|
|
obtain ⟨P, ⟨h1, primeP⟩⟩ := x
|
|
|
|
|
let P' : PrimeSpectrum D := PrimeSpectrum.mk P primeP
|
|
|
|
|
have h2 : P' ≠ ⊥ := by
|
|
|
|
|
by_contra a
|
|
|
|
|
have : P = ⊥ := by rwa [PrimeSpectrum.ext_iff] at a
|
|
|
|
|
contradiction
|
2023-06-13 21:55:50 -05:00
|
|
|
|
have pos_height : ¬ (height P') ≤ 0 := by
|
|
|
|
|
have : ⊥ ∈ {J | J < P'} := Ne.bot_lt h2
|
2023-06-13 16:35:10 -05:00
|
|
|
|
have : {J | J < P'}.Nonempty := Set.nonempty_of_mem this
|
2023-06-13 21:55:50 -05:00
|
|
|
|
unfold height
|
2023-06-13 16:35:10 -05:00
|
|
|
|
rw [←Set.one_le_chainHeight_iff] at this
|
|
|
|
|
exact not_le_of_gt (Iff.mp ENat.one_le_iff_pos this)
|
2023-06-13 21:55:50 -05:00
|
|
|
|
have nonpos_height : height P' ≤ 0 := by
|
|
|
|
|
have := height_le_krullDim P'
|
|
|
|
|
rw [h] at this
|
|
|
|
|
aesop
|
2023-06-13 16:35:10 -05:00
|
|
|
|
contradiction
|
|
|
|
|
|
|
|
|
|
lemma dim_eq_zero_iff_field {D: Type _} [CommRing D] [IsDomain D] : krullDim D = 0 ↔ IsField D := by
|
|
|
|
|
constructor
|
|
|
|
|
· exact isField.dim_zero
|
|
|
|
|
· intro fieldD
|
|
|
|
|
let h : Field D := IsField.toField fieldD
|
|
|
|
|
exact dim_field_eq_zero
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
|
|
|
|
#check Ring.DimensionLEOne
|
2023-06-12 11:49:40 -05:00
|
|
|
|
lemma dim_le_one_iff : krullDim R ≤ 1 ↔ Ring.DimensionLEOne R := sorry
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-12 11:49:40 -05:00
|
|
|
|
lemma dim_le_one_of_pid [IsDomain R] [IsPrincipalIdealRing R] : krullDim R ≤ 1 := by
|
2023-06-11 23:02:46 -05:00
|
|
|
|
rw [dim_le_one_iff]
|
|
|
|
|
exact Ring.DimensionLEOne.principal_ideal_ring R
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
|
|
|
|
lemma dim_le_dim_polynomial_add_one [Nontrivial R] :
|
2023-06-13 22:58:32 -05:00
|
|
|
|
krullDim R + 1 ≤ krullDim (Polynomial R) := sorry
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
|
|
|
|
lemma dim_eq_dim_polynomial_add_one [Nontrivial R] [IsNoetherianRing R] :
|
2023-06-13 22:58:32 -05:00
|
|
|
|
krullDim R + 1 = krullDim (Polynomial R) := sorry
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-11 23:02:46 -05:00
|
|
|
|
lemma height_eq_dim_localization :
|
2023-06-12 11:49:40 -05:00
|
|
|
|
height I = krullDim (Localization.AtPrime I.asIdeal) := sorry
|
2023-06-10 10:13:10 -05:00
|
|
|
|
|
2023-06-12 11:49:40 -05:00
|
|
|
|
lemma height_add_dim_quotient_le_dim : height I + krullDim (R ⧸ I.asIdeal) ≤ krullDim R := sorry
|