comm_alg/HilbertFunction.lean

196 lines
8.5 KiB
Text
Raw Normal View History

2023-06-14 02:23:01 -05:00
import Mathlib.Order.KrullDimension
import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic
import Mathlib.Algebra.Module.GradedModule
import Mathlib.RingTheory.Ideal.AssociatedPrime
import Mathlib.RingTheory.Artinian
import Mathlib.Order.Height
-- Setting for "library_search"
set_option maxHeartbeats 0
macro "ls" : tactic => `(tactic|library_search)
-- New tactic "obviously"
macro "obviously" : tactic =>
`(tactic| (
first
| dsimp; simp; done; dbg_trace "it was dsimp simp"
| simp; done; dbg_trace "it was simp"
| tauto; done; dbg_trace "it was tauto"
| simp; tauto; done; dbg_trace "it was simp tauto"
| rfl; done; dbg_trace "it was rfl"
| norm_num; done; dbg_trace "it was norm_num"
| /-change (@Eq _ _);-/ linarith; done; dbg_trace "it was linarith"
-- | gcongr; done
| ring; done; dbg_trace "it was ring"
| trivial; done; dbg_trace "it was trivial"
-- | nlinarith; done
| fail "No, this is not obvious."))
2023-06-14 13:23:01 -05:00
2023-06-14 02:23:01 -05:00
-- @Definitions (to be classified)
section
2023-06-14 13:23:01 -05:00
open GradedMonoid.GSmul
open DirectSum
2023-06-14 02:23:01 -05:00
2023-06-14 14:57:33 -05:00
-- Definition of polynomail of type d
def PolyType (f : ) (d : ) := ∃ Poly : Polynomial , ∃ (N : ), ∀ (n : ), N ≤ n → f n = Polynomial.eval (n : ) Poly ∧ d = Polynomial.degree Poly
2023-06-14 02:23:01 -05:00
noncomputable def length ( A : Type _) (M : Type _)
[CommRing A] [AddCommGroup M] [Module A M] := Set.chainHeight {M' : Submodule A M | M' < }
2023-06-14 13:23:01 -05:00
-- Make instance of M_i being an R_0-module
2023-06-14 02:23:01 -05:00
instance tada1 (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜]
[DirectSum.Gmodule 𝒜 𝓜] (i : ) : SMul (𝒜 0) (𝓜 i)
where smul x y := @Eq.rec (0+i) (fun a _ => 𝓜 a) (GradedMonoid.GSmul.smul x y) i (zero_add i)
lemma mylem (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜]
[h : DirectSum.Gmodule 𝒜 𝓜] (i : ) (a : 𝒜 0) (m : 𝓜 i) :
of _ _ (a • m) = of _ _ a • of _ _ m := by
refine' Eq.trans _ (Gmodule.of_smul_of 𝒜 𝓜 a m).symm
refine' of_eq_of_gradedMonoid_eq _
exact Sigma.ext (zero_add _).symm <| eq_rec_heq _ _
instance tada2 (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜]
[h : DirectSum.Gmodule 𝒜 𝓜] (i : ) : SMulWithZero (𝒜 0) (𝓜 i) := by
letI := SMulWithZero.compHom (⨁ i, 𝓜 i) (of 𝒜 0).toZeroHom
exact Function.Injective.smulWithZero (of 𝓜 i).toZeroHom Dfinsupp.single_injective (mylem 𝒜 𝓜 i)
instance tada3 (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜]
[h : DirectSum.Gmodule 𝒜 𝓜] (i : ): Module (𝒜 0) (𝓜 i) := by
letI := Module.compHom (⨁ j, 𝓜 j) (ofZeroRingHom 𝒜)
exact Dfinsupp.single_injective.module (𝒜 0) (of 𝓜 i) (mylem 𝒜 𝓜 i)
2023-06-14 13:23:01 -05:00
2023-06-14 02:23:01 -05:00
-- Definition of a Hilbert function of a graded module
2023-06-14 13:23:01 -05:00
section
2023-06-14 02:23:01 -05:00
noncomputable def hilbert_function (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)]
[DirectSum.GCommRing 𝒜]
[DirectSum.Gmodule 𝒜 𝓜] (hilb : ) := ∀ i, hilb i = (ENat.toNat (length (𝒜 0) (𝓜 i)))
noncomputable def dimensionring { A: Type _}
[CommRing A] := krullDim (PrimeSpectrum A)
noncomputable def dimensionmodule ( A : Type _) (M : Type _)
[CommRing A] [AddCommGroup M] [Module A M] := krullDim (PrimeSpectrum (A (( : Submodule A M).annihilator)) )
2023-06-14 13:23:01 -05:00
end
2023-06-14 02:23:01 -05:00
-- lemma graded_local (𝒜 : → Type _) [SetLike (⨁ i, 𝒜 i)] (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)]
-- [DirectSum.GCommRing 𝒜]
-- [DirectSum.Gmodule 𝒜 𝓜] (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0)) : ∃ ( I : Ideal ((⨁ i, 𝒜 i))),(HomogeneousMax 𝒜 I) := sorry
2023-06-14 15:44:23 -05:00
2023-06-14 14:57:33 -05:00
-- Definition(s) of homogeneous ideals
2023-06-14 15:44:23 -05:00
def Ideal.IsHomogeneous' (𝒜 : → Type _)
[∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜]
(I : Ideal (⨁ i, 𝒜 i)) := ∀ (i : )
⦃r : (⨁ i, 𝒜 i)⦄, r ∈ I → DirectSum.of _ i ( r i : 𝒜 i) ∈ I
2023-06-14 13:23:01 -05:00
def HomogeneousPrime (𝒜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜] (I : Ideal (⨁ i, 𝒜 i)):= (Ideal.IsPrime I) ∧ (Ideal.IsHomogeneous' 𝒜 I)
def HomogeneousMax (𝒜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜] (I : Ideal (⨁ i, 𝒜 i)):= (Ideal.IsMaximal I) ∧ (Ideal.IsHomogeneous' 𝒜 I)
2023-06-14 14:57:33 -05:00
--theorem monotone_stabilizes_iff_noetherian :
-- (∀ f : →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by
-- rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition]
2023-06-14 02:23:01 -05:00
2023-06-14 14:57:33 -05:00
end
2023-06-14 02:23:01 -05:00
2023-06-14 13:23:01 -05:00
2023-06-14 02:23:01 -05:00
-- @[BH, 4.1.3] when d ≥ 1
-- If M is a finite graed R-Mod of dimension d ≥ 1, then the Hilbert function H(M, n) is of polynomial type (d - 1)
2023-06-14 11:14:47 -05:00
theorem hilbert_polynomial_ge1 (d : ) (d1 : 1 ≤ d) (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)]
2023-06-14 02:23:01 -05:00
[DirectSum.GCommRing 𝒜]
[DirectSum.Gmodule 𝒜 𝓜] (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0))
(fingen : IsNoetherian (⨁ i, 𝒜 i) (⨁ i, 𝓜 i))
(findim : dimensionmodule (⨁ i, 𝒜 i) (⨁ i, 𝓜 i) = d)
(hilb : ) (Hhilb: hilbert_function 𝒜 𝓜 hilb)
2023-06-14 02:23:01 -05:00
: PolyType hilb (d - 1) := by
sorry
2023-06-14 13:23:01 -05:00
2023-06-14 02:23:01 -05:00
-- @[BH, 4.1.3] when d = 0
-- If M is a finite graed R-Mod of dimension zero, then the Hilbert function H(M, n) = 0 for n >> 0
2023-06-14 11:14:47 -05:00
theorem hilbert_polynomial_0 (𝒜 : → Type _) (𝓜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)]
2023-06-14 02:23:01 -05:00
[DirectSum.GCommRing 𝒜]
[DirectSum.Gmodule 𝒜 𝓜] (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0))
(fingen : IsNoetherian (⨁ i, 𝒜 i) (⨁ i, 𝓜 i))
(findim : dimensionmodule (⨁ i, 𝒜 i) (⨁ i, 𝓜 i) = 0)
(hilb : ) (Hhilb : hilbert_function 𝒜 𝓜 hilb)
: (∃ (N : ), ∀ (n : ), n ≥ N → hilb n = 0) := by
2023-06-14 11:14:47 -05:00
sorry
2023-06-14 02:23:01 -05:00
2023-06-14 13:23:01 -05:00
2023-06-14 14:57:33 -05:00
-- @Existence of a chain of submodules of graded submoduels of a f.g graded R-mod M
2023-06-14 13:23:01 -05:00
lemma Exist_chain_of_graded_submodules (𝒜 : → Type _) (𝓜 : → Type _)
[∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)]
[DirectSum.GCommRing 𝒜] [DirectSum.Gmodule 𝒜 𝓜]
(fingen : IsNoetherian (⨁ i, 𝒜 i) (⨁ i, 𝓜 i))
2023-06-14 14:57:33 -05:00
: ∃ (c : List (Submodule (⨁ i, 𝒜 i) (⨁ i, 𝓜 i))), c.Chain' (· < ·) ∧ ∀ M ∈ c, Ture := by
2023-06-14 13:23:01 -05:00
sorry
2023-06-14 02:23:01 -05:00
-- @[BH, 1.5.6 (b)(ii)]
-- An associated prime of a graded R-Mod M is graded
2023-06-14 11:14:47 -05:00
lemma Associated_prime_of_graded_is_graded
(𝒜 : → Type _) (𝓜 : → Type _)
[∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)]
[DirectSum.GCommRing 𝒜] [DirectSum.Gmodule 𝒜 𝓜]
(p : associatedPrimes (⨁ i, 𝒜 i) (⨁ i, 𝓜 i))
2023-06-14 15:44:23 -05:00
: (Ideal.IsHomogeneous' 𝒜 p) ∧ ((∃ (i : ), ∃ (x : 𝒜 i), p = (Submodule.span (⨁ i, 𝒜 i) {DirectSum.of _ i x}).annihilator)) := by
2023-06-14 02:23:01 -05:00
sorry
2023-06-14 13:23:01 -05:00
2023-06-14 14:57:33 -05:00
-- instance gyhoiu
-- (𝒜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜]
-- (p : Ideal (⨁ i, 𝒜 i)) (hp : Ideal.IsHomogeneous' 𝒜 p)
-- : (𝒫 : → Type _) [∀ i, AddCommGroup (𝒫 i)] [DirectSum.GCommRing 𝒫] → Gmodule (⊕ i, 𝒜 i) := by
-- sorry
2023-06-14 15:44:23 -05:00
-- instance sdfasdf
-- (𝒜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜]
-- (p : Ideal (⨁ i, 𝒜 i)) (hp : Ideal.IsHomogeneous' 𝒜 p)
-- : ∀ i, AddCommGroup (p i) := by
-- sorry
2023-06-14 15:48:21 -05:00
def Component_of_graded_as_addsubgroup (𝒜 : → Type _)
[∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜]
(p : Ideal (⨁ i, 𝒜 i)) (hp : Ideal.IsHomogeneous' 𝒜 p) (i : ) : AddSubgroup (𝒜 i) := by
sorry
2023-06-14 15:44:23 -05:00
2023-06-14 14:57:33 -05:00
-- @ Quotient of a graded ring R by a graded ideal p is a graded R-Mod, preserving each component
instance Quotient_of_graded_is_graded
(𝒜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜]
(p : Ideal (⨁ i, 𝒜 i)) (hp : Ideal.IsHomogeneous' 𝒜 p)
2023-06-14 15:44:23 -05:00
: DirectSum.Gmodule 𝒜 (fun i => (𝒜 i)(Component_of_graded_as_addsubgroup 𝒜 p hp i)) := by
2023-06-14 14:57:33 -05:00
sorry
2023-06-14 15:44:23 -05:00
-- @Graded submodule
2023-06-14 15:48:21 -05:00
instance Graded_submodule
(𝒜 : → Type _) [∀ i, AddCommGroup (𝒜 i)] [DirectSum.GCommRing 𝒜]
(p : Ideal (⨁ i, 𝒜 i)) (hp : Ideal.IsHomogeneous' 𝒜 p)
: DirectSum.Gmodule 𝒜 (fun i => (𝒜 i)(Component_of_graded_as_addsubgroup 𝒜 p hp i)) := by
sorry
2023-06-14 02:23:01 -05:00