diff --git a/CommAlg/final_hil_pol.lean b/CommAlg/final_hil_pol.lean index 591c6cc..eff9302 100644 --- a/CommAlg/final_hil_pol.lean +++ b/CommAlg/final_hil_pol.lean @@ -6,7 +6,6 @@ import Mathlib.RingTheory.Artinian import Mathlib.Order.Height - -- Setting for "library_search" set_option maxHeartbeats 0 macro "ls" : tactic => `(tactic|library_search) @@ -44,7 +43,7 @@ noncomputable def length ( A : Type _) (M : Type _) [CommRing A] [AddCommGroup M] [Module A M] := Set.chainHeight {M' : Submodule A M | M' < โŠค} -- Make instance of M_i being an R_0-module -instance tada1 (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [DirectSum.GCommRing ๐’œ] +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) @@ -109,8 +108,7 @@ instance {๐’œ : โ„ค โ†’ Type _} [โˆ€ i, AddCommGroup (๐’œ i)] [DirectSum.GComm sorry) - -class StandardGraded {๐’œ : โ„ค โ†’ Type _} [โˆ€ i, AddCommGroup (๐’œ i)] [DirectSum.GCommRing ๐’œ] : Prop where +class StandardGraded (๐’œ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [DirectSum.GCommRing ๐’œ] : Prop where gen_in_first_piece : Algebra.adjoin (๐’œ 0) (DirectSum.of _ 1 : ๐’œ 1 โ†’+ โจ i, ๐’œ i).range = (โŠค : Subalgebra (๐’œ 0) (โจ i, ๐’œ i)) @@ -124,7 +122,25 @@ def Component_of_graded_as_addsubgroup (๐’œ : โ„ค โ†’ Type _) def graded_morphism (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) (๐“ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [โˆ€ i, AddCommGroup (๐“ i)] -[DirectSum.GCommRing ๐’œ] [DirectSum.Gmodule ๐’œ ๐“œ][DirectSum.Gmodule ๐’œ ๐“] (f : (โจ i, ๐“œ i) โ†’ (โจ i, ๐“ i)) : โˆ€ i, โˆ€ (r : ๐“œ i), โˆ€ j, (j โ‰  i โ†’ f (DirectSum.of _ i r) j = 0) โˆง (IsLinearMap (โจ i, ๐’œ i) f) := by sorry +[DirectSum.GCommRing ๐’œ] [DirectSum.Gmodule ๐’œ ๐“œ][DirectSum.Gmodule ๐’œ ๐“] +(f : (โจ i, ๐“œ i) โ†’โ‚—[(โจ i, ๐’œ i)] (โจ i, ๐“ i)) +: โˆ€ i, โˆ€ (r : ๐“œ i), โˆ€ j, (j โ‰  i โ†’ f (DirectSum.of _ i r) j = 0) +โˆง (IsLinearMap (โจ i, ๐’œ i) f) := by + sorry + +#check graded_morphism + +def graded_isomorphism (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) (๐“ : โ„ค โ†’ Type _) +[โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [โˆ€ i, AddCommGroup (๐“ i)] +[DirectSum.GCommRing ๐’œ] [DirectSum.Gmodule ๐’œ ๐“œ][DirectSum.Gmodule ๐’œ ๐“] +(f : (โจ i, ๐“œ i) โ†’โ‚—[(โจ i, ๐’œ i)] (โจ i, ๐“ i)) +: IsLinearEquiv f := by + sorry +-- f โˆˆ (โจ i, ๐“œ i) โ‰ƒโ‚—[(โจ i, ๐’œ i)] (โจ i, ๐“ i) +-- LinearEquivClass f (โจ i, ๐’œ i) (โจ i, ๐“œ i) (โจ i, ๐“ i) +-- #print IsLinearEquiv +#check graded_isomorphism + def graded_submodule @@ -143,6 +159,7 @@ end + -- @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 ๐’œ] @@ -150,6 +167,13 @@ instance Quotient_of_graded_is_graded : DirectSum.Gmodule ๐’œ (fun i => (๐’œ i)โงธ(Component_of_graded_as_addsubgroup ๐’œ p hp i)) := by sorry +-- +lemma sss + : true := by + sorry + + + -- If A_0 is Artinian and local, then A is graded local lemma Graded_local_if_zero_component_Artinian_and_local (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) @@ -189,10 +213,11 @@ lemma Associated_prime_of_graded_is_graded -- 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) theorem Hilbert_polynomial_d_ge_1 (d : โ„•) (d1 : 1 โ‰ค d) (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [DirectSum.GCommRing ๐’œ] -[DirectSum.Gmodule ๐’œ ๐“œ] (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) +[DirectSum.Gmodule ๐’œ ๐“œ] (st: StandardGraded ๐’œ) (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 @@ -203,7 +228,7 @@ theorem Hilbert_polynomial_d_ge_1_reduced (d : โ„•) (d1 : 1 โ‰ค d) (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [DirectSum.GCommRing ๐’œ] -[DirectSum.Gmodule ๐’œ ๐“œ] (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) +[DirectSum.Gmodule ๐’œ ๐“œ] (st: StandardGraded ๐’œ) (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) (fingen : IsNoetherian (โจ i, ๐’œ i) (โจ i, ๐“œ i)) (findim : dimensionmodule (โจ i, ๐’œ i) (โจ i, ๐“œ i) = d) (hilb : โ„ค โ†’ โ„ค) (Hhilb: hilbert_function ๐’œ ๐“œ hilb) @@ -217,7 +242,7 @@ theorem Hilbert_polynomial_d_ge_1_reduced -- If M is a finite graed R-Mod of dimension zero, then the Hilbert function H(M, n) = 0 for n >> 0 theorem Hilbert_polynomial_d_0 (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [DirectSum.GCommRing ๐’œ] -[DirectSum.Gmodule ๐’œ ๐“œ] (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) +[DirectSum.Gmodule ๐’œ ๐“œ] (st: StandardGraded ๐’œ) (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) (fingen : IsNoetherian (โจ i, ๐’œ i) (โจ i, ๐“œ i)) (findim : dimensionmodule (โจ i, ๐’œ i) (โจ i, ๐“œ i) = 0) (hilb : โ„ค โ†’ โ„ค) (Hhilb : hilbert_function ๐’œ ๐“œ hilb) @@ -230,7 +255,7 @@ theorem Hilbert_polynomial_d_0 (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) [ theorem Hilbert_polynomial_d_0_reduced (๐’œ : โ„ค โ†’ Type _) (๐“œ : โ„ค โ†’ Type _) [โˆ€ i, AddCommGroup (๐’œ i)] [โˆ€ i, AddCommGroup (๐“œ i)] [DirectSum.GCommRing ๐’œ] -[DirectSum.Gmodule ๐’œ ๐“œ] (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) +[DirectSum.Gmodule ๐’œ ๐“œ] (st: StandardGraded ๐’œ) (art: IsArtinianRing (๐’œ 0)) (loc : LocalRing (๐’œ 0)) (fingen : IsNoetherian (โจ i, ๐’œ i) (โจ i, ๐“œ i)) (findim : dimensionmodule (โจ i, ๐’œ i) (โจ i, ๐“œ i) = 0) (hilb : โ„ค โ†’ โ„ค) (Hhilb : hilbert_function ๐’œ ๐“œ hilb) @@ -252,6 +277,12 @@ theorem Hilbert_polynomial_d_0_reduced + + + + + + diff --git a/CommAlg/final_poly_type.lean b/CommAlg/final_poly_type.lean new file mode 100644 index 0000000..dcb0e70 --- /dev/null +++ b/CommAlg/final_poly_type.lean @@ -0,0 +1,285 @@ +import Mathlib.Order.Height +import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic + +-- 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.")) + + +-- Testing of Polynomial +section Polynomial +noncomputable section +#check Polynomial +#check Polynomial (โ„š) +#check Polynomial.eval + + +example (f : Polynomial โ„š) (hf : f = Polynomial.C (1 : โ„š)) : Polynomial.eval 2 f = 1 := by + have : โˆ€ (q : โ„š), Polynomial.eval q f = 1 := by + sorry + obviously + +-- example (f : โ„ค โ†’ โ„ค) (hf : โˆ€ x, f x = x ^ 2) : Polynomial.eval 2 f = 4 := by +-- sorry + +-- degree of a constant function is โŠฅ (is this same as -1 ???) +#print Polynomial.degree_zero + +def F : Polynomial โ„š := Polynomial.C (2 : โ„š) +#print F +#check F +#check Polynomial.degree F +#check Polynomial.degree 0 +#check WithBot โ„• +-- #eval Polynomial.degree F +#check Polynomial.eval 1 F +example : Polynomial.eval (100 : โ„š) F = (2 : โ„š) := by + refine Iff.mpr (Rat.ext_iff (Polynomial.eval 100 F) 2) ?_ + simp only [Rat.ofNat_num, Rat.ofNat_den] + rw [F] + simp + +-- Treat polynomial f โˆˆ โ„š[X] as a function f : โ„š โ†’ โ„š +#check CoeFun + + + + +end section + + + + + +-- @[BH, 4.1.2] + + + +-- All the polynomials are in โ„š[X], all the functions are considered as โ„ค โ†’ โ„ค +noncomputable section +-- Polynomial type of degree d +@[simp] +def PolyType (f : โ„ค โ†’ โ„ค) (d : โ„•) := โˆƒ Poly : Polynomial โ„š, โˆƒ (N : โ„ค), (โˆ€ (n : โ„ค), N โ‰ค n โ†’ f n = Polynomial.eval (n : โ„š) Poly) โˆง d = Polynomial.degree Poly +section +-- structure PolyType (f : โ„ค โ†’ โ„ค) where +-- Poly : Polynomial โ„ค +-- d : +-- N : โ„ค +-- Poly_equal : โˆ€ n โˆˆ โ„ค โ†’ f n = Polynomial.eval n : โ„ค Poly + +#check PolyType + +example (f : โ„ค โ†’ โ„ค) (hf : โˆ€ x, f x = x ^ 2) : PolyType f 2 := by + unfold PolyType + sorry + -- use Polynomial.monomial (2 : โ„ค) (1 : โ„ค) + -- have' := hf 0; ring_nf at this + -- exact this + +end section + +-- ฮ” operator (of d times) +@[simp] +def ฮ” : (โ„ค โ†’ โ„ค) โ†’ โ„• โ†’ (โ„ค โ†’ โ„ค) + | f, 0 => f + | f, d + 1 => fun (n : โ„ค) โ†ฆ (ฮ” f d) (n + 1) - (ฮ” f d) (n) +section +-- def ฮ” (f : โ„ค โ†’ โ„ค) (d : โ„•) := fun (n : โ„ค) โ†ฆ f (n + 1) - f n +-- def add' : โ„• โ†’ โ„• โ†’ โ„• +-- | 0, m => m +-- | n+1, m => (add' n m) + 1 +-- #eval add' 5 10 +#check ฮ” +def f (n : โ„ค) := n +#eval (ฮ” f 1) 100 +-- #check (by (show_term unfold ฮ”) : ฮ” f 0=0) +end section + + + + + + +-- (NO need to prove another direction) Constant polynomial function = constant function +lemma Poly_constant (F : Polynomial โ„š) (c : โ„š) : + (F = Polynomial.C (c : โ„š)) โ†” (โˆ€ r : โ„š, (Polynomial.eval r F) = (c : โ„š)) := by + constructor + ยท intro h + rintro r + refine Iff.mpr (Rat.ext_iff (Polynomial.eval r F) c) ?_ + simp only [Rat.ofNat_num, Rat.ofNat_den] + rw [h] + simp + ยท sorry + + + + +-- Shifting doesn't change the polynomial type +lemma Poly_shifting (f : โ„ค โ†’ โ„ค) (g : โ„ค โ†’ โ„ค) (hf : PolyType f d) (s : โ„ค) (hfg : โˆ€ (n : โ„ค), f (n + s) = g (n)) : PolyType g d := by + simp only [PolyType] + rcases hf with โŸจF, hhโŸฉ + rcases hh with โŸจN,ssโŸฉ + sorry + +-- PolyType 0 = constant function +lemma PolyType_0 (f : โ„ค โ†’ โ„ค) : (PolyType f 0) โ†” (โˆƒ (c : โ„ค), โˆƒ (N : โ„ค), (โˆ€ (n : โ„ค), + (N โ‰ค n โ†’ f n = c)) โˆง c โ‰  0) := by + constructor + ยท rintro โŸจPoly, โŸจN, โŸจH1, H2โŸฉโŸฉโŸฉ + have this1 : Polynomial.degree Poly = 0 := by rw [โ† H2]; rfl + have this2 : โˆƒ (c : โ„ค), Poly = Polynomial.C (c : โ„š) := by + have HH : โˆƒ (c : โ„š), Poly = Polynomial.C (c : โ„š) := + โŸจPoly.coeff 0, Polynomial.eq_C_of_degree_eq_zero (by rw[โ† H2]; rfl)โŸฉ + cases' HH with c HHH + have HHHH : โˆƒ (d : โ„ค), d = c := + โŸจf N, by simp [(Poly_constant Poly c).mp HHH N, H1 N (le_refl N)]โŸฉ + cases' HHHH with d H5; exact โŸจd, by rw[โ† H5] at HHH; exact HHHโŸฉ + rcases this2 with โŸจc, hthis2โŸฉ + use c; use N; intro n + constructor + ยท have this4 : Polynomial.eval (n : โ„š) Poly = c := by + rw [hthis2]; simp only [map_intCast, Polynomial.eval_int_cast] + exact fun HH1 => Iff.mp (Rat.coe_int_inj (f n) c) (by rw [โ†this4, H1 n HH1]) + ยท intro c0 + simp only [hthis2, c0, Int.cast_zero, map_zero, Polynomial.degree_zero] + at this1 + ยท rintro โŸจc, N, hhโŸฉ + have H2 : (c : โ„š) โ‰  0 := by simp only [ne_eq, Int.cast_eq_zero]; exact (hh 0).2 + exact โŸจPolynomial.C (c : โ„š), N, fun n Nn + => by rw [(hh n).1 Nn]; exact (((Poly_constant (Polynomial.C (c : โ„š)) + (c : โ„š)).mp rfl) n).symm, by rw [Polynomial.degree_C H2]; rflโŸฉ + +-- ฮ” of 0 times preserves the function +lemma ฮ”_0 (f : โ„ค โ†’ โ„ค) : (ฮ” f 0) = f := by tauto + +-- ฮ” of 1 times decreaes the polynomial type by one +lemma ฮ”_1 (f : โ„ค โ†’ โ„ค) (d : โ„•): d > 0 โ†’ PolyType f d โ†’ PolyType (ฮ” f 1) (d - 1) := by + sorry + +-- ฮ” of d times maps polynomial of degree d to polynomial of degree 0 +lemma ฮ”_1_s_equiv_ฮ”_s_1 (f : โ„ค โ†’ โ„ค) (s : โ„•) : ฮ” (ฮ” f 1) s = (ฮ” f (s + 1)) := by + sorry +lemma foofoo (d : โ„•) : (f : โ„ค โ†’ โ„ค) โ†’ (PolyType f d) โ†’ (PolyType (ฮ” f d) 0):= by + induction' d with d hd + ยท intro f h + rw [ฮ”_0] + tauto + ยท intro f hf + have this1 : PolyType f (d + 1) := by tauto + have this2 : PolyType (ฮ” f (d + 1)) 0 := by + have this3 : PolyType (ฮ” f 1) d := by + have this4 : d + 1 > 0 := by positivity + have this5 : (d + 1) > 0 โ†’ PolyType f (d + 1) โ†’ PolyType (ฮ” f 1) d := ฮ”_1 f (d + 1) + exact this5 this4 this1 + clear hf + specialize hd (ฮ” f 1) + have this4 : PolyType (ฮ” (ฮ” f 1) d) 0 := by tauto + rw [ฮ”_1_s_equiv_ฮ”_s_1] at this4 + tauto + tauto + +lemma ฮ”_d_PolyType_d_to_PolyType_0 (f : โ„ค โ†’ โ„ค) (d : โ„•): PolyType f d โ†’ PolyType (ฮ” f d) 0 := fun h => (foofoo d f) h + +lemma foofoofoo (d : โ„•) : (f : โ„ค โ†’ โ„ค) โ†’ (โˆƒ (c : โ„ค), โˆƒ (N : โ„ค), (โˆ€ (n : โ„ค), N โ‰ค n โ†’ (ฮ” f d) (n) = c) โˆง c โ‰  0) โ†’ (PolyType f d) := by + induction' d with d hd + + -- Base case + ยท intro f + intro h + rcases h with โŸจc, N, hhโŸฉ + rw [PolyType_0] + use c + use N + tauto + + -- Induction step + ยท intro f + intro h + rcases h with โŸจc, N, hโŸฉ + have this : PolyType f (d + 1) := by + sorry + tauto + + + +-- [BH, 4.1.2] (a) => (b) +-- ฮ”^d f (n) = c for some nonzero integer c for n >> 0 โ†’ f is of polynomial type d +lemma a_to_b (f : โ„ค โ†’ โ„ค) (d : โ„•) : (โˆƒ (c : โ„ค), โˆƒ (N : โ„ค), (โˆ€ (n : โ„ค), N โ‰ค n โ†’ (ฮ” f d) (n) = c) โˆง c โ‰  0) โ†’ PolyType f d := by + sorry + -- intro h + -- rcases h with โŸจc, N, hhโŸฉ + -- have H1 := ฮป n => (hh n).left + -- have H2 := ฮป n => (hh n).right + -- clear hh + -- have H2 : c โ‰  0 := by + -- tauto + -- induction' d with d hd + + -- -- Base case + -- ยท rw [PolyType_0] + -- use c + -- use N + -- tauto + + -- -- Induction step + -- ยท sorry + +-- [BH, 4.1.2] (a) <= (b) +-- f is of polynomial type d โ†’ ฮ”^d f (n) = c for some nonzero integer c for n >> 0 +lemma b_to_a (f : โ„ค โ†’ โ„ค) (d : โ„•) : PolyType f d โ†’ (โˆƒ (c : โ„ค), โˆƒ (N : โ„ค), (โˆ€ (n : โ„ค), N โ‰ค n โ†’ (ฮ” f d) (n) = c) โˆง c โ‰  0) := by + intro h + have : PolyType (ฮ” f d) 0 := by + apply ฮ”_d_PolyType_d_to_PolyType_0 + exact h + have this1 : (โˆƒ (c : โ„ค), โˆƒ (N : โ„ค), (โˆ€ (n : โ„ค), (N โ‰ค n โ†’ (ฮ” f d) n = c)) โˆง c โ‰  0) := by + rw [โ†PolyType_0] + exact this + exact this1 +end + +-- @Additive lemma of length for a SES +-- Given a SES 0 โ†’ A โ†’ B โ†’ C โ†’ 0, then length (A) - length (B) + length (C) = 0 +section +open LinearMap + +-- Definitiion of the length of a module +noncomputable def length (R M : Type _) [CommRing R] [AddCommGroup M] [Module R M] := Set.chainHeight {M' : Submodule R M | M' < โŠค} +#check length โ„ค โ„ค + +-- Definition of a SES (Short Exact Sequence) +-- @[ext] +structure SES {R A B C : Type _} [CommRing R] [AddCommGroup A] [AddCommGroup B] + [AddCommGroup C] [Module R A] [Module R B] [Module R C] + (f : A โ†’โ‚—[R] B) (g : B โ†’โ‚—[R] C) + where + left_exact : LinearMap.ker f = โŠฅ + middle_exact : LinearMap.range f = LinearMap.ker g + right_exact : LinearMap.range g = โŠค + +-- Additive lemma +lemma length_Additive (R A B C : Type _) [CommRing R] [AddCommGroup A] [AddCommGroup B] [AddCommGroup C] [Module R A] [Module R B] [Module R C] + (f : A โ†’โ‚—[R] B) (g : B โ†’โ‚—[R] C) + : (SES f g) โ†’ ((length R A) + (length R C) = (length R B)) := by + intro h + rcases h with โŸจleft_exact, middle_exact, right_exactโŸฉ + sorry + +end section \ No newline at end of file diff --git a/CommAlg/grant2.lean b/CommAlg/grant2.lean index 0e3092e..24edcff 100644 --- a/CommAlg/grant2.lean +++ b/CommAlg/grant2.lean @@ -54,9 +54,20 @@ def symbolicIdeal(Q : Ideal R) {hin : Q.IsPrime} (I : Ideal R) : Ideal R where rw [โ†mul_assoc, mul_comm s, mul_assoc] exact Ideal.mul_mem_left _ _ hs2 + +theorem WF_interval_le_prime (I : Ideal R) (P : Ideal R) [P.IsPrime] + (h : โˆ€ J โˆˆ (Set.Icc I P), J.IsPrime โ†’ J = P ): + WellFounded ((ยท < ยท) : (Set.Icc I P) โ†’ (Set.Icc I P) โ†’ Prop ) := sorry + protected lemma LocalRing.height_le_one_of_minimal_over_principle - [LocalRing R] (q : PrimeSpectrum R) {x : R} + [LocalRing R] {x : R} (h : (closedPoint R).asIdeal โˆˆ (Ideal.span {x}).minimalPrimes) : - q = closedPoint R โˆจ Ideal.height q = 0 := by - + Ideal.height (closedPoint R) โ‰ค 1 := by + -- by_contra hcont + -- push_neg at hcont + -- rw [Ideal.lt_height_iff'] at hcont + -- rcases hcont with โŸจc, hc1, hc2, hc3โŸฉ + apply height_le_of_gt_height_lt + intro p hp + sorry \ No newline at end of file diff --git a/CommAlg/jayden(krull-dim-zero).lean b/CommAlg/jayden(krull-dim-zero).lean index 78bd648..15dd150 100644 --- a/CommAlg/jayden(krull-dim-zero).lean +++ b/CommAlg/jayden(krull-dim-zero).lean @@ -43,7 +43,6 @@ class IsLocallyNilpotent {R : Type _} [CommRing R] (I : Ideal R) : Prop := #check Ideal.IsLocallyNilpotent end Ideal - -- Repeats the definition of the length of a module by Monalisa variable (R : Type _) [CommRing R] (I J : Ideal R) variable (M : Type _) [AddCommMonoid M] [Module R M] @@ -71,7 +70,7 @@ lemma ring_Noetherian_iff_spec_Noetherian : IsNoetherianRing R sorry -- how do I apply an instance to prove one direction? - +-- Stacks Lemma 5.9.2: -- Use TopologicalSpace.NoetherianSpace.exists_finset_irreducible : -- Every closed subset of a noetherian space is a finite union -- of irreducible closed subsets. @@ -169,7 +168,7 @@ abbrev Prod_of_localization := def foo : Prod_of_localization R โ†’+* R where toFun := sorry - invFun := sorry + -- invFun := sorry left_inv := sorry right_inv := sorry map_mul' := sorry @@ -198,6 +197,13 @@ lemma primes_of_Artinian_are_maximal lemma dim_le_zero_Noetherian_iff_Artinian (R : Type _) [CommRing R] : IsNoetherianRing R โˆง Ideal.krullDim R โ‰ค 0 โ†” IsArtinianRing R := by constructor + rintro โŸจRisNoetherian, dimzeroโŸฉ + rw [ring_Noetherian_iff_spec_Noetherian] at RisNoetherian + let Z := irreducibleComponents (PrimeSpectrum R) + have Zfinite : Set.Finite Z := by + -- apply TopologicalSpace.NoetherianSpace.finite_irreducibleComponents ?_ + sorry + sorry intro RisArtinian constructor @@ -207,81 +213,7 @@ lemma dim_le_zero_Noetherian_iff_Artinian (R : Type _) [CommRing R] : intro I apply primes_of_Artinian_are_maximal - - - --- Trash bin --- lemma Artinian_has_finite_max_ideal --- [IsArtinianRing R] : Finite (MaximalSpectrum R) := by --- by_contra infinite --- simp only [not_finite_iff_infinite] at infinite --- let m' : โ„• โ†ช MaximalSpectrum R := Infinite.natEmbedding (MaximalSpectrum R) --- have m'inj := m'.injective --- let m'' : โ„• โ†’ Ideal R := fun n : โ„• โ†ฆ โจ… k โˆˆ range n, (m' k).asIdeal --- let f : โ„• โ†’ Ideal R := fun n : โ„• โ†ฆ (m' n).asIdeal --- have DCC : โˆƒ n : โ„•, โˆ€ k : โ„•, n โ‰ค k โ†’ m'' n = m'' k := by --- apply IsArtinian.monotone_stabilizes { --- toFun := m'' --- monotone' := sorry --- } --- cases' DCC with n DCCn --- specialize DCCn (n+1) --- specialize DCCn (Nat.le_succ n) --- let F : Fin (n + 1) โ†’ MaximalSpectrum R := fun k โ†ฆ m' k --- have comaximal : โˆ€ (i j : Fin (n + 1)), (i โ‰  j) โ†’ (F i).asIdeal โŠ” (F j).asIdeal = --- (โŠค : Ideal R) := by --- intro i j distinct --- apply Ideal.IsMaximal.coprime_of_ne --- exact (F i).IsMaximal --- exact (F j).IsMaximal --- have : (F i) โ‰  (F j) := by --- apply Function.Injective.ne m'inj --- contrapose! distinct --- exact Fin.ext distinct --- intro h --- apply this --- exact MaximalSpectrum.ext _ _ h --- let CRT1 : (R โงธ โจ… (i : Fin (n + 1)), ((F i).asIdeal)) --- โ‰ƒ+* ((i : Fin (n + 1)) โ†’ R โงธ (F i).asIdeal) := --- Ideal.quotientInfRingEquivPiQuotient --- (fun i โ†ฆ (F i).asIdeal) comaximal --- let CRT2 : (R โงธ โจ… (i : Fin (n + 1)), ((F i).asIdeal)) --- โ‰ƒ+* ((i : Fin (n + 1)) โ†’ R โงธ (F i).asIdeal) := --- Ideal.quotientInfRingEquivPiQuotient --- (fun i โ†ฆ (F i).asIdeal) comaximal - - - - - -- have comaximal : โˆ€ (n : โ„•) (i j : Fin n), (i โ‰  j) โ†’ ((F n) i).asIdeal โŠ” ((F n) j).asIdeal = - -- (โŠค : Ideal R) := by - -- intro n i j distinct - -- apply Ideal.IsMaximal.coprime_of_ne - -- exact (F n i).IsMaximal - -- exact (F n j).IsMaximal - -- have : (F n i) โ‰  (F n j) := by - -- apply Function.Injective.ne m'inj - -- contrapose! distinct - -- exact Fin.ext distinct - -- intro h - -- apply this - -- exact MaximalSpectrum.ext _ _ h - -- let CRT : (n : โ„•) โ†’ (R โงธ โจ… (i : Fin n), ((F n) i).asIdeal) - -- โ‰ƒ+* ((i : Fin n) โ†’ R โงธ ((F n) i).asIdeal) := - -- fun n โ†ฆ Ideal.quotientInfRingEquivPiQuotient - -- (fun i โ†ฆ (F n i).asIdeal) (comaximal n) - -- have DCC : โˆƒ n : โ„•, โˆ€ k : โ„•, n โ‰ค k โ†’ m'' n = m'' k := by - -- apply IsArtinian.monotone_stabilizes { - -- toFun := m'' - -- monotone' := sorry - -- } - -- cases' DCC with n DCCn - -- specialize DCCn (n+1) - -- specialize DCCn (Nat.le_succ n) - -- let CRT1 := CRT n - -- let CRT2 := CRT (n + 1) - - +-- Use TopologicalSpace.NoetherianSpace.exists_finset_irreducible : diff --git a/CommAlg/krull.lean b/CommAlg/krull.lean index 642c2c7..e44fa91 100644 --- a/CommAlg/krull.lean +++ b/CommAlg/krull.lean @@ -112,31 +112,32 @@ lemma krullDim_eq_height [LocalRing R] : krullDim R = height (closedPoint R) := /-- The height of a prime `๐”ญ` is greater than `n` if and only if there is a chain of primes less than `๐”ญ` with length `n + 1`. -/ lemma lt_height_iff' {๐”ญ : PrimeSpectrum R} {n : โ„•โˆž} : -height ๐”ญ > n โ†” โˆƒ c : List (PrimeSpectrum R), c.Chain' (ยท < ยท) โˆง (โˆ€ ๐”ฎ โˆˆ c, ๐”ฎ < ๐”ญ) โˆง c.length = n + 1 := by - rcases n with _ | n - . constructor <;> intro h <;> exfalso +n < height ๐”ญ โ†” โˆƒ c : List (PrimeSpectrum R), c.Chain' (ยท < ยท) โˆง (โˆ€ ๐”ฎ โˆˆ c, ๐”ฎ < ๐”ญ) โˆง c.length = n + 1 := by + match n with + | โŠค => + constructor <;> intro h <;> exfalso . exact (not_le.mpr h) le_top . tauto - have (m : โ„•โˆž) : m > some n โ†” m โ‰ฅ some (n + 1) := by - symm - show (n + 1 โ‰ค m โ†” _ ) - apply ENat.add_one_le_iff - exact ENat.coe_ne_top _ - rw [this] - unfold Ideal.height - show ((โ†‘(n + 1):โ„•โˆž) โ‰ค _) โ†” โˆƒc, _ โˆง _ โˆง ((_ : WithTop โ„•) = (_:โ„•โˆž)) - rw [{J | J < ๐”ญ}.le_chainHeight_iff] - show (โˆƒ c, (List.Chain' _ c โˆง โˆ€๐”ฎ, ๐”ฎ โˆˆ c โ†’ ๐”ฎ < ๐”ญ) โˆง _) โ†” _ - constructor <;> rintro โŸจc, hcโŸฉ <;> use c - . tauto - . change _ โˆง _ โˆง (List.length c : โ„•โˆž) = n + 1 at hc - norm_cast at hc - tauto + | (n : โ„•) => + have (m : โ„•โˆž) : n < m โ†” (n + 1 : โ„•โˆž) โ‰ค m := by + symm + show (n + 1 โ‰ค m โ†” _ ) + apply ENat.add_one_le_iff + exact ENat.coe_ne_top _ + rw [this] + unfold Ideal.height + show ((โ†‘(n + 1):โ„•โˆž) โ‰ค _) โ†” โˆƒc, _ โˆง _ โˆง ((_ : WithTop โ„•) = (_:โ„•โˆž)) + rw [{J | J < ๐”ญ}.le_chainHeight_iff] + show (โˆƒ c, (List.Chain' _ c โˆง โˆ€๐”ฎ, ๐”ฎ โˆˆ c โ†’ ๐”ฎ < ๐”ญ) โˆง _) โ†” _ + constructor <;> rintro โŸจc, hcโŸฉ <;> use c + . tauto + . change _ โˆง _ โˆง (List.length c : โ„•โˆž) = n + 1 at hc + norm_cast at hc + tauto /-- Form of `lt_height_iff''` for rewriting with the height coerced to `WithBot โ„•โˆž`. -/ lemma lt_height_iff'' {๐”ญ : PrimeSpectrum R} {n : โ„•โˆž} : -height ๐”ญ > (n : WithBot โ„•โˆž) โ†” โˆƒ c : List (PrimeSpectrum R), c.Chain' (ยท < ยท) โˆง (โˆ€ ๐”ฎ โˆˆ c, ๐”ฎ < ๐”ญ) โˆง c.length = n + 1 := by - show (_ < _) โ†” _ +(n : WithBot โ„•โˆž) < height ๐”ญ โ†” โˆƒ c : List (PrimeSpectrum R), c.Chain' (ยท < ยท) โˆง (โˆ€ ๐”ฎ โˆˆ c, ๐”ฎ < ๐”ญ) โˆง c.length = n + 1 := by rw [WithBot.coe_lt_coe] exact lt_height_iff' @@ -198,7 +199,7 @@ lemma dim_le_zero_iff : krullDim R โ‰ค 0 โ†” โˆ€ I : PrimeSpectrum R, IsMaximal rw [hcontr] at h exact h h๐”ช.1 use ๐”ชp - show (_ : WithBot โ„•โˆž) > (0 : โ„•โˆž) + show (0 : โ„•โˆž) < (_ : WithBot โ„•โˆž) rw [lt_height_iff''] use [I] constructor @@ -209,7 +210,7 @@ lemma dim_le_zero_iff : krullDim R โ‰ค 0 โ†” โˆ€ I : PrimeSpectrum R, IsMaximal rwa [hI'] . simp . contrapose! h - change (_ : WithBot โ„•โˆž) > (0 : โ„•โˆž) at h + change (0 : โ„•โˆž) < (_ : WithBot โ„•โˆž) at h rw [lt_height_iff''] at h obtain โŸจc, _, hc2, hc3โŸฉ := h norm_cast at hc3