From e22b18e7c5964baf74ee825a0144a0b10379657c Mon Sep 17 00:00:00 2001 From: monula95 dutta Date: Mon, 12 Jun 2023 20:57:49 +0000 Subject: [PATCH 1/7] TESTMOna --- comm_alg/krull.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comm_alg/krull.lean b/comm_alg/krull.lean index 2a5af42..1067e63 100644 --- a/comm_alg/krull.lean +++ b/comm_alg/krull.lean @@ -41,4 +41,4 @@ lemma dim_eq_dim_polynomial_add_one [Nontrivial R] [IsNoetherianRing R] : lemma height_eq_dim_localization [Ideal.IsPrime I] : height I = krull_dim (Localization.AtPrime I) := sorry -lemma height_add_dim_quotient_le_dim : height I + krull_dim (R ⧸ I) ≤ krull_dim R := sorry \ No newline at end of file +lemma height_add_dim_quotient_le_dim : height I + krull_dim (R ⧸ I) ≤ krull_dim R := sorry From 871f38239c89e357335caa4b36e65494a07b7b48 Mon Sep 17 00:00:00 2001 From: monula95 dutta Date: Mon, 12 Jun 2023 20:59:28 +0000 Subject: [PATCH 2/7] TESTMOna --- comm_alg/Defhil.lean | 41 +++++++++++++++++++++++++++++++++++++++++ comm_alg/hilpol.lean | 14 ++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 comm_alg/Defhil.lean create mode 100644 comm_alg/hilpol.lean diff --git a/comm_alg/Defhil.lean b/comm_alg/Defhil.lean new file mode 100644 index 0000000..63c140a --- /dev/null +++ b/comm_alg/Defhil.lean @@ -0,0 +1,41 @@ +import Mathlib + +variable {R : Type _} (M A B C : Type _) [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup A] [Module R A] [AddCommGroup B] [Module R B] [AddCommGroup C] [Module R C] +variable (A' B' C' : ModuleCat R) +#check ModuleCat.of R A + +example : Module R A' := inferInstance + +#check ModuleCat.of R B + +example : Module R B' := inferInstance + +#check ModuleCat.of R C + +example : Module R C' := inferInstance + +namespace CategoryTheory + +noncomputable instance abelian : Abelian (ModuleCat.{v} R) := inferInstance +noncomputable instance haszero : Limits.HasZeroMorphisms (ModuleCat.{v} R) := inferInstance + +#check (A B : Submodule _ _) → (A ≤ B) + +#check Preorder (Submodule _ _) + +#check krullDim (Submodule _ _) + +noncomputable def length := krullDim (Submodule R M) + +open ZeroObject + +namespace HasZeroMorphisms + +open LinearMap + +#check length M + +#check ModuleCat.of R + +lemma length_additive_shortexact {f : A ⟶ B} {g : B ⟶ C} (h : ShortExact f g) : length B = length A + length C := sorry + diff --git a/comm_alg/hilpol.lean b/comm_alg/hilpol.lean new file mode 100644 index 0000000..957bade --- /dev/null +++ b/comm_alg/hilpol.lean @@ -0,0 +1,14 @@ +import Mathlib + + +--class GradedRing + +variable [GradedRing S] + +namespace DirectSum + +namespace ideal + +def S_+ := ⊕ (i ≥ 0) S_i + +lemma A set of homogeneous elements fi∈S+ generates S as an algebra over S0 ↔ they generate S+ as an ideal of S. \ No newline at end of file From 0a8fd3ef7cedb909dd11e28001f66bd4ef24379a Mon Sep 17 00:00:00 2001 From: monula95 dutta Date: Mon, 12 Jun 2023 23:09:47 +0000 Subject: [PATCH 3/7] Test --- comm_alg/Defhil.lean | 34 +++++++++++----------------------- comm_alg/hilpol.lean | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/comm_alg/Defhil.lean b/comm_alg/Defhil.lean index 63c140a..65da0c6 100644 --- a/comm_alg/Defhil.lean +++ b/comm_alg/Defhil.lean @@ -1,23 +1,15 @@ import Mathlib +import Mathlib.RingTheory.Ideal.Basic +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.LinearAlgebra.Finsupp +import Mathlib.RingTheory.GradedAlgebra.Basic +import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal + + + variable {R : Type _} (M A B C : Type _) [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup A] [Module R A] [AddCommGroup B] [Module R B] [AddCommGroup C] [Module R C] -variable (A' B' C' : ModuleCat R) -#check ModuleCat.of R A -example : Module R A' := inferInstance - -#check ModuleCat.of R B - -example : Module R B' := inferInstance - -#check ModuleCat.of R C - -example : Module R C' := inferInstance - -namespace CategoryTheory - -noncomputable instance abelian : Abelian (ModuleCat.{v} R) := inferInstance -noncomputable instance haszero : Limits.HasZeroMorphisms (ModuleCat.{v} R) := inferInstance #check (A B : Submodule _ _) → (A ≤ B) @@ -25,17 +17,13 @@ noncomputable instance haszero : Limits.HasZeroMorphisms (ModuleCat.{v} R) := in #check krullDim (Submodule _ _) -noncomputable def length := krullDim (Submodule R M) - -open ZeroObject - -namespace HasZeroMorphisms +noncomputable def length := Set.chainHeight {M' : Submodule R M | M' < ⊤} open LinearMap #check length M -#check ModuleCat.of R -lemma length_additive_shortexact {f : A ⟶ B} {g : B ⟶ C} (h : ShortExact f g) : length B = length A + length C := sorry + +--lemma length_additive_shortexact {f : A ⟶ B} {g : B ⟶ C} (h : ShortExact f g) : length B = length A + length C := sorry diff --git a/comm_alg/hilpol.lean b/comm_alg/hilpol.lean index 957bade..0aab559 100644 --- a/comm_alg/hilpol.lean +++ b/comm_alg/hilpol.lean @@ -1,14 +1,41 @@ -import Mathlib +import Mathlib.Order.KrullDimension +import Mathlib.Order.JordanHolder +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic +import Mathlib.Order.Height +import Mathlib.RingTheory.Ideal.Basic +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.LinearAlgebra.Finsupp +import Mathlib.RingTheory.GradedAlgebra.Basic +import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Ideal.AssociatedPrime +import Mathlib.RingTheory.Noetherian +variable {ι σ R A : Type _} ---class GradedRing +section HomogeneousDef -variable [GradedRing S] +variable [Semiring A] -namespace DirectSum +variable [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℤ → σ) -namespace ideal +variable [GradedRing 𝒜] -def S_+ := ⊕ (i ≥ 0) S_i +variable (I : HomogeneousIdeal 𝒜) -lemma A set of homogeneous elements fi∈S+ generates S as an algebra over S0 ↔ they generate S+ as an ideal of S. \ No newline at end of file +-- def Ideal.IsHomogeneous : Prop := +-- ∀ (i : ι) ⦃r : A⦄, r ∈ I → (DirectSum.decompose 𝒜 r i : A) ∈ I +-- #align ideal.is_homogeneous Ideal.IsHomogeneous + +-- structure HomogeneousIdeal extends Submodule A A where +-- is_homogeneous' : Ideal.IsHomogeneous 𝒜 toSubmodule + +--#check Ideal.IsPrime hI + +def HomogeneousPrime (I : Ideal A):= Ideal.IsPrime I + +def HomogeneousMax (I : Ideal A):= Ideal.IsMaximal I + +--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] \ No newline at end of file From 2c3d2d84a374a1ac81dd7777fed50cfc28d086a5 Mon Sep 17 00:00:00 2001 From: monula95 dutta Date: Wed, 14 Jun 2023 03:03:10 +0000 Subject: [PATCH 4/7] TEST --- .docker/test.lean | 133 +++++++++++++++++++++++++++++++++++++++++++ comm_alg/Defhil.lean | 29 ---------- comm_alg/hilpol.lean | 41 ------------- 3 files changed, 133 insertions(+), 70 deletions(-) create mode 100644 .docker/test.lean delete mode 100644 comm_alg/Defhil.lean delete mode 100644 comm_alg/hilpol.lean diff --git a/.docker/test.lean b/.docker/test.lean new file mode 100644 index 0000000..a851192 --- /dev/null +++ b/.docker/test.lean @@ -0,0 +1,133 @@ +import Mathlib.Order.KrullDimension +import Mathlib.Order.JordanHolder +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic +import Mathlib.Order.Height +import Mathlib.RingTheory.Ideal.Basic +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.LinearAlgebra.Finsupp +import Mathlib.RingTheory.GradedAlgebra.Basic +import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Ideal.AssociatedPrime +import Mathlib.RingTheory.Noetherian +import Mathlib.RingTheory.Artinian +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Noetherian +import Mathlib.RingTheory.Finiteness +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic +import Mathlib.RingTheory.FiniteType +import Mathlib.Order.Height +import Mathlib.RingTheory.PrincipalIdealDomain +import Mathlib.RingTheory.DedekindDomain.Basic +import Mathlib.RingTheory.Ideal.Quotient +import Mathlib.RingTheory.Localization.AtPrime +import Mathlib.Order.ConditionallyCompleteLattice.Basic +import Mathlib.Algebra.DirectSum.Ring +import Mathlib.RingTheory.Ideal.LocalRing +import Mathlib +import Mathlib.Algebra.MonoidAlgebra.Basic +import Mathlib.Data.Finset.Sort +import Mathlib.Order.Height +import Mathlib.Order.KrullDimension +import Mathlib.Order.JordanHolder +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic +import Mathlib.Order.Height +import Mathlib.RingTheory.Ideal.Basic +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.LinearAlgebra.Finsupp +import Mathlib.RingTheory.GradedAlgebra.Basic +import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Ideal.AssociatedPrime +import Mathlib.RingTheory.Noetherian +import Mathlib.RingTheory.Artinian +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Noetherian +import Mathlib.RingTheory.Finiteness +import Mathlib.RingTheory.Ideal.Operations + + + + +noncomputable def length ( A : Type _) (M : Type _) + [CommRing A] [AddCommGroup M] [Module A M] := Set.chainHeight {M' : Submodule A M | M' < ⊤} + + +def HomogeneousPrime { A σ : Type _} [CommRing A] [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℤ → σ) [GradedRing 𝒜] (I : Ideal A):= (Ideal.IsPrime I) ∧ (Ideal.IsHomogeneous 𝒜 I) + + +def HomogeneousMax { A σ : Type _} [CommRing A] [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℤ → σ) [GradedRing 𝒜] (I : Ideal A):= (Ideal.IsMaximal I) ∧ (Ideal.IsHomogeneous 𝒜 I) + +--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] + +open GradedMonoid.GSmul + +open DirectSum + +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) + +noncomputable def hilbert_function (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] + [DirectSum.GCommRing 𝒜] + [DirectSum.Gmodule 𝒜 𝓜] (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0)) + : ℤ → ℕ∞ := fun i => (length (𝒜 0) (𝓜 i)) + +lemma hilbertz (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] + [DirectSum.GCommRing 𝒜] + [DirectSum.Gmodule 𝒜 𝓜] + (finlen : ∀ i, (length (𝒜 0) (𝓜 i)) < ⊤ ) : ℤ → ℤ := by + intro i + let h := hilbert_function 𝒜 𝓜 + simp at h + let n : ℤ → ℕ := fun i ↦ WithTop.untop _ (finlen i).ne + have hn : ∀ i, (n i : ℕ∞) = length (𝒜 0) (𝓜 i) := fun i ↦ WithTop.coe_untop _ _ + have' := hn i + exact ((n 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)) ) + +-- 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 + + +def PolyType (f : ℤ → ℤ) (d : ℕ) := ∃ Poly : Polynomial ℚ, ∃ (N : ℤ), ∀ (n : ℤ), N ≤ n → f n = Polynomial.eval (n : ℚ) Poly ∧ d = Polynomial.degree Poly + + + +theorem hilbert_polynomial (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] +[DirectSum.GCommRing 𝒜] +[DirectSum.Gmodule 𝒜 𝓜] (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0)) (fingen : IsNoetherian (⨁ i, 𝒜 i) (⨁ i, 𝓜 i)) +(findim : ∃ d : ℕ , dimensionmodule (⨁ i, 𝒜 i) (⨁ i, 𝓜 i) = d):True := sorry + +-- Semiring A] + +-- variable [SetLike σ A] \ No newline at end of file diff --git a/comm_alg/Defhil.lean b/comm_alg/Defhil.lean deleted file mode 100644 index 65da0c6..0000000 --- a/comm_alg/Defhil.lean +++ /dev/null @@ -1,29 +0,0 @@ -import Mathlib -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.LinearAlgebra.Finsupp -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal - - - - -variable {R : Type _} (M A B C : Type _) [CommRing R] [AddCommGroup M] [Module R M] [AddCommGroup A] [Module R A] [AddCommGroup B] [Module R B] [AddCommGroup C] [Module R C] - - -#check (A B : Submodule _ _) → (A ≤ B) - -#check Preorder (Submodule _ _) - -#check krullDim (Submodule _ _) - -noncomputable def length := Set.chainHeight {M' : Submodule R M | M' < ⊤} - -open LinearMap - -#check length M - - - ---lemma length_additive_shortexact {f : A ⟶ B} {g : B ⟶ C} (h : ShortExact f g) : length B = length A + length C := sorry - diff --git a/comm_alg/hilpol.lean b/comm_alg/hilpol.lean deleted file mode 100644 index 0aab559..0000000 --- a/comm_alg/hilpol.lean +++ /dev/null @@ -1,41 +0,0 @@ -import Mathlib.Order.KrullDimension -import Mathlib.Order.JordanHolder -import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic -import Mathlib.Order.Height -import Mathlib.RingTheory.Ideal.Basic -import Mathlib.RingTheory.Ideal.Operations -import Mathlib.LinearAlgebra.Finsupp -import Mathlib.RingTheory.GradedAlgebra.Basic -import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal -import Mathlib.Algebra.Module.GradedModule -import Mathlib.RingTheory.Ideal.AssociatedPrime -import Mathlib.RingTheory.Noetherian - -variable {ι σ R A : Type _} - -section HomogeneousDef - -variable [Semiring A] - -variable [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℤ → σ) - -variable [GradedRing 𝒜] - -variable (I : HomogeneousIdeal 𝒜) - --- def Ideal.IsHomogeneous : Prop := --- ∀ (i : ι) ⦃r : A⦄, r ∈ I → (DirectSum.decompose 𝒜 r i : A) ∈ I --- #align ideal.is_homogeneous Ideal.IsHomogeneous - --- structure HomogeneousIdeal extends Submodule A A where --- is_homogeneous' : Ideal.IsHomogeneous 𝒜 toSubmodule - ---#check Ideal.IsPrime hI - -def HomogeneousPrime (I : Ideal A):= Ideal.IsPrime I - -def HomogeneousMax (I : Ideal A):= Ideal.IsMaximal I - ---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] \ No newline at end of file From d30702fb10a79ca854f1feb58037082377e0529a Mon Sep 17 00:00:00 2001 From: monula95 dutta Date: Wed, 14 Jun 2023 03:45:23 +0000 Subject: [PATCH 5/7] updated def --- .docker/test.lean | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.docker/test.lean b/.docker/test.lean index a851192..888270c 100644 --- a/.docker/test.lean +++ b/.docker/test.lean @@ -88,10 +88,11 @@ instance tada3 (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGr letI := Module.compHom (⨁ j, 𝓜 j) (ofZeroRingHom 𝒜) exact Dfinsupp.single_injective.module (𝒜 0) (of 𝓜 i) (mylem 𝒜 𝓜 i) + -- (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0)) + noncomputable def hilbert_function (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜] - [DirectSum.Gmodule 𝒜 𝓜] (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0)) - : ℤ → ℕ∞ := fun i => (length (𝒜 0) (𝓜 i)) + [DirectSum.Gmodule 𝒜 𝓜] (hilb : ℤ → ℕ∞) := ∀ i, hilb i = (length (𝒜 0) (𝓜 i)) lemma hilbertz (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜] From b6bbf7af8c1d08ac35f49898d632f4cedb1d8f9a Mon Sep 17 00:00:00 2001 From: monula95 dutta Date: Wed, 14 Jun 2023 04:49:17 +0000 Subject: [PATCH 6/7] udpated def final --- .docker/test.lean | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.docker/test.lean b/.docker/test.lean index 888270c..d3a272e 100644 --- a/.docker/test.lean +++ b/.docker/test.lean @@ -90,16 +90,17 @@ instance tada3 (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGr -- (art: IsArtinianRing (𝒜 0)) (loc : LocalRing (𝒜 0)) -noncomputable def hilbert_function (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] +noncomputable def dummyhil_function (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜] [DirectSum.Gmodule 𝒜 𝓜] (hilb : ℤ → ℕ∞) := ∀ i, hilb i = (length (𝒜 0) (𝓜 i)) + lemma hilbertz (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] [DirectSum.GCommRing 𝒜] [DirectSum.Gmodule 𝒜 𝓜] (finlen : ∀ i, (length (𝒜 0) (𝓜 i)) < ⊤ ) : ℤ → ℤ := by intro i - let h := hilbert_function 𝒜 𝓜 + let h := dummyhil_function 𝒜 𝓜 simp at h let n : ℤ → ℕ := fun i ↦ WithTop.untop _ (finlen i).ne have hn : ∀ i, (n i : ℕ∞) = length (𝒜 0) (𝓜 i) := fun i ↦ WithTop.coe_untop _ _ @@ -107,6 +108,11 @@ lemma hilbertz (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGr exact ((n i) : ℤ ) +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) From 7c91fd8d3133e1ca2f53716f7a9e9e622b536b77 Mon Sep 17 00:00:00 2001 From: Andre Date: Wed, 14 Jun 2023 01:38:51 -0400 Subject: [PATCH 7/7] fixed hilbertpoly --- comm_alg/test.lean | 137 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 comm_alg/test.lean diff --git a/comm_alg/test.lean b/comm_alg/test.lean new file mode 100644 index 0000000..64650dc --- /dev/null +++ b/comm_alg/test.lean @@ -0,0 +1,137 @@ +import Mathlib.Order.KrullDimension +import Mathlib.Order.JordanHolder +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic +import Mathlib.Order.Height +import Mathlib.RingTheory.Ideal.Basic +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.LinearAlgebra.Finsupp +import Mathlib.RingTheory.GradedAlgebra.Basic +import Mathlib.RingTheory.GradedAlgebra.HomogeneousIdeal +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Ideal.AssociatedPrime +import Mathlib.RingTheory.Noetherian +import Mathlib.RingTheory.Artinian +import Mathlib.Algebra.Module.GradedModule +import Mathlib.RingTheory.Noetherian +import Mathlib.RingTheory.Finiteness +import Mathlib.RingTheory.Ideal.Operations +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic +import Mathlib.RingTheory.FiniteType +import Mathlib.Order.Height +import Mathlib.RingTheory.PrincipalIdealDomain +import Mathlib.RingTheory.DedekindDomain.Basic +import Mathlib.RingTheory.Ideal.Quotient +import Mathlib.RingTheory.Localization.AtPrime +import Mathlib.Order.ConditionallyCompleteLattice.Basic +import Mathlib.Algebra.DirectSum.Ring +import Mathlib.RingTheory.Ideal.LocalRing + +-- 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.")) + +-- @[BH, 1.5.6 (b)(ii)] +lemma ss (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] + [DirectSum.GCommRing 𝒜] [DirectSum.Gmodule 𝒜 𝓜] (p : associatedPrimes (⨁ i, 𝒜 i) (⨁ i, 𝓜 i)) : true := by + sorry +-- Ideal.IsHomogeneous 𝒜 p + + + + +noncomputable def length ( A : Type _) (M : Type _) + [CommRing A] [AddCommGroup M] [Module A M] := Set.chainHeight {M' : Submodule A M | M' < ⊤} + + +def HomogeneousPrime { A σ : Type _} [CommRing A] [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℤ → σ) [GradedRing 𝒜] (I : Ideal A):= (Ideal.IsPrime I) ∧ (Ideal.IsHomogeneous 𝒜 I) +def HomogeneousMax { A σ : Type _} [CommRing A] [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℤ → σ) [GradedRing 𝒜] (I : Ideal A):= (Ideal.IsMaximal I) ∧ (Ideal.IsHomogeneous 𝒜 I) + +--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] + +open GradedMonoid.GSmul +open DirectSum + +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) + +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)) ) + +-- 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 + + + + +@[simp] +def PolyType (f : ℤ → ℤ) (d : ℕ) := ∃ Poly : Polynomial ℚ, ∃ (N : ℤ), ∀ (n : ℤ), N ≤ n → f n = Polynomial.eval (n : ℚ) Poly ∧ d = Polynomial.degree Poly + +-- @[BH, 4.1.3] +theorem hilbert_polynomial (d : ℕ) (d1 : 1 ≤ d) (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] +[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) +: PolyType hilb (d - 1) := by + sorry + +-- @ +lemma Graded_quotient (𝒜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)][DirectSum.GCommRing 𝒜] + : true := by + sorry + + +-- @Existence of a chain of submodules of graded submoduels of f.g graded R-mod M +lemma Exist_chain_of_graded_submodules (𝒜 : ℤ → Type _) (𝓜 : ℤ → Type _) [∀ i, AddCommGroup (𝒜 i)] [∀ i, AddCommGroup (𝓜 i)] + [DirectSum.GCommRing 𝒜] [DirectSum.Gmodule 𝒜 𝓜] (fingen : IsNoetherian (⨁ i, 𝒜 i) (⨁ i, 𝓜 i)) + : true := by + sorry +#print Exist_chain_of_graded_submodules +#print Finset \ No newline at end of file