Download data/lean/OAI/NumberTheory/PowerFree/NormalMonomials.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 18.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PowerFree/NormalMonomials.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/PowerFree/NormalMonomials.lean
-
curl -L -o NormalMonomials.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PowerFree/NormalMonomials.lean
18.8 kB
| import OAI.NumberTheory.PowerFree.Sieve | |
| namespace OAI | |
| namespace QuarticPowerFree | |
| open MvPolynomial Finsupp MonomialOrder | |
| open scoped MonomialOrder | |
| variable {Ο K : Type*} [Field K] | |
| def IdealNormal (m : MonomialOrder Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (d : Ο ββ β) : Prop := | |
| β p β I, p β 0 β Β¬ m.degree p β€ d | |
| theorem ideal_normal_form (m : MonomialOrder Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (p : MvPolynomial Ο K) : | |
| β r : MvPolynomial Ο K, p-r β I β§ | |
| (β d β r.support, IdealNormal m I d) β§ m.degree r βΌ[m] m.degree p := by | |
| classical | |
| let b : {q : MvPolynomial Ο K // q β I β§ q β 0} β MvPolynomial Ο K := Subtype.val | |
| have hb : β i, IsUnit (m.leadingCoeff (b i)) := by | |
| intro i | |
| apply isUnit_iff_ne_zero.mpr | |
| exact m.leadingCoeff_ne_zero_iff.mpr i.property.2 | |
| obtain β¨g, r, hpr, hdeg, hrβ© := m.div hb p | |
| have hg : Finsupp.linearCombination _ b g β I := by | |
| rw [Finsupp.linearCombination_apply, Finsupp.sum] | |
| apply Ideal.sum_mem | |
| intro i _ | |
| exact Ideal.mul_mem_left _ _ i.property.1 | |
| refine β¨r, ?_, ?_, ?_β© | |
| Β· rw [hpr, add_sub_cancel_right]; exact hg | |
| Β· intro d hd q hq hq0 | |
| exact hr d hd β¨q, hq, hq0β© | |
| Β· have hlin : m.degree (Finsupp.linearCombination _ b g) βΌ[m] m.degree p := by | |
| rw [Finsupp.linearCombination_apply, Finsupp.sum] | |
| apply m.degree_sum_le.trans | |
| apply Finset.sup_le | |
| intro i _ | |
| simpa [smul_eq_mul, mul_comm] using hdeg i | |
| have heq : r = p - Finsupp.linearCombination _ b g := by rw [hpr]; ring | |
| rw [heq] | |
| exact (m.degree_sub_le).trans (max_le le_rfl hlin) | |
| theorem ideal_normal_injective (m : MonomialOrder Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (p : MvPolynomial Ο K) (hp : β d β p.support, IdealNormal m I d) | |
| (hI : p β I) : p = 0 := by | |
| by_contra hp0 | |
| exact hp _ (m.degree_mem_support hp0) p hI hp0 le_rfl | |
| theorem ideal_normal_quotient_bijective (m : MonomialOrder Ο) | |
| (I : Ideal (MvPolynomial Ο K)) : | |
| Function.Bijective | |
| (((Ideal.Quotient.mkβ K I).toLinearMap).comp | |
| (restrictSupport K {d : Ο ββ β | IdealNormal m I d}).subtype) := by | |
| classical | |
| constructor | |
| Β· apply LinearMap.ker_eq_bot.mp | |
| apply LinearMap.ker_eq_bot'.mpr | |
| intro p hp | |
| apply Subtype.ext | |
| exact ideal_normal_injective m I p.val (fun d hd => p.property hd) | |
| (Ideal.Quotient.eq_zero_iff_mem.mp hp) | |
| Β· intro y | |
| obtain β¨p, rflβ© := Ideal.Quotient.mk_surjective y | |
| obtain β¨r, hr, hn, _β© := ideal_normal_form m I p | |
| refine β¨β¨r, fun d hd => hn d hdβ©, ?_β© | |
| change (Ideal.Quotient.mk I) r = (Ideal.Quotient.mk I) p | |
| apply Ideal.Quotient.eq.mpr | |
| simpa only [neg_sub] using I.neg_mem hr | |
| noncomputable def idealNormalEquiv (m : MonomialOrder Ο) | |
| (I : Ideal (MvPolynomial Ο K)) : | |
| restrictSupport K {d : Ο ββ β | IdealNormal m I d} ββ[K] | |
| MvPolynomial Ο K β§Έ I := | |
| LinearEquiv.ofBijective | |
| (((Ideal.Quotient.mkβ K I).toLinearMap).comp | |
| (restrictSupport K {d : Ο ββ β | IdealNormal m I d}).subtype) | |
| (ideal_normal_quotient_bijective m I) | |
| noncomputable def idealNormalBasis (m : MonomialOrder Ο) | |
| (I : Ideal (MvPolynomial Ο K)) : | |
| Module.Basis {d : Ο ββ β // IdealNormal m I d} K (MvPolynomial Ο K β§Έ I) := | |
| (basisRestrictSupport K {d : Ο ββ β | IdealNormal m I d}).map (idealNormalEquiv m I) | |
| theorem ideal_normal_finite_obstructions [Finite Ο] (m : MonomialOrder Ο) | |
| (I : Ideal (MvPolynomial Ο K)) : | |
| β s : Finset (Ο ββ β), | |
| (β d β s, β p β I, p β 0 β§ m.degree p = d) β§ | |
| β d, IdealNormal m I d β β a β s, Β¬ a β€ d := by | |
| classical | |
| let D : Set (Ο ββ β) := {d | β p β I, p β 0 β§ m.degree p = d} | |
| have hf : {a | Minimal (Β· β D) a}.Finite := | |
| WellQuasiOrderedLE.finite_of_isAntichain (setOfPred_minimal_antichain _) | |
| refine β¨hf.toFinset, ?_, ?_β© | |
| Β· intro d hd | |
| exact (hf.mem_toFinset.mp hd).1 | |
| Β· intro d | |
| constructor | |
| Β· intro hn a ha had | |
| obtain β¨p, hp, hp0, heβ© := (hf.mem_toFinset.mp ha).1 | |
| exact hn p hp hp0 (he βΈ had) | |
| Β· intro hn p hp hp0 hpd | |
| have hpD : m.degree p β D := β¨p, hp, hp0, rflβ© | |
| obtain β¨a, hap, haβ© := (show D.IsPWO from Set.isPWO_of_wellQuasiOrderedLE D).exists_le_minimal hpD | |
| exact hn a (hf.mem_toFinset.mpr ha) (hap.trans hpd) | |
| noncomputable def totalSpace (T : β) : Submodule K (MvPolynomial Ο K) := | |
| restrictSupport K {d | d.degree β€ T} | |
| @[simp] theorem mem_totalSpace {T : β} {p : MvPolynomial Ο K} : | |
| p β totalSpace T β p.totalDegree β€ T := by | |
| simp only [totalSpace, mem_restrictSupport_iff, totalDegree, Finset.sup_le_iff] | |
| rfl | |
| noncomputable def normalTotalSpace (m : MonomialOrder Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (T : β) : Submodule K (MvPolynomial Ο K) := | |
| restrictSupport K {d | IdealNormal m I d β§ d.degree β€ T} | |
| theorem normalTotalSpace_le (m : MonomialOrder Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (T : β) : normalTotalSpace m I T β€ totalSpace T := by | |
| intro p hp d hd | |
| exact (hp hd).2 | |
| theorem totalSpace_image_normal [LinearOrder Ο] [WellFoundedGT Ο] | |
| (I : Ideal (MvPolynomial Ο K)) (T : β) : | |
| (totalSpace T).map (Ideal.Quotient.mkβ K I).toLinearMap = | |
| (normalTotalSpace degLex I T).map (Ideal.Quotient.mkβ K I).toLinearMap := by | |
| apply le_antisymm | |
| Β· rintro y β¨p, hp, rflβ© | |
| obtain β¨r, hr, hn, hdβ© := ideal_normal_form degLex I p | |
| refine β¨r, ?_, ?_β© | |
| Β· intro d hdr | |
| refine β¨hn d hdr, ?_β© | |
| exact (le_totalDegree hdr).trans | |
| ((degLex_totalDegree_monotone hd).trans (mem_totalSpace.mp hp)) | |
| Β· apply Ideal.Quotient.eq.mpr | |
| simpa only [neg_sub] using I.neg_mem hr | |
| Β· exact Submodule.map_mono (normalTotalSpace_le _ _ _) | |
| theorem coordinate_hilbert_count [LinearOrder Ο] [WellFoundedGT Ο] | |
| (I : Ideal (MvPolynomial Ο K)) (T : β) : | |
| Module.finrank K ((totalSpace T).map (Ideal.Quotient.mkβ K I).toLinearMap) = | |
| Nat.card {d : Ο ββ β // IdealNormal degLex I d β§ d.degree β€ T} := by | |
| rw [totalSpace_image_normal] | |
| let M := normalTotalSpace degLex I T | |
| let f := (Ideal.Quotient.mkβ K I).toLinearMap.domRestrict M | |
| have hf : Function.Injective f := by | |
| apply LinearMap.ker_eq_bot.mp | |
| apply LinearMap.ker_eq_bot'.mpr | |
| intro p hp | |
| apply Subtype.ext | |
| exact ideal_normal_injective degLex I p.val (fun d hd => (p.property hd).1) | |
| (Ideal.Quotient.eq_zero_iff_mem.mp hp) | |
| have heq : LinearMap.range f = M.map (Ideal.Quotient.mkβ K I).toLinearMap := | |
| LinearMap.range_domRestrict _ _ | |
| rw [β heq, LinearMap.finrank_range_of_inj hf] | |
| exact Module.finrank_eq_nat_card_basis (basisRestrictSupport K _) | |
| open scoped BigOperators | |
| noncomputable def simplexTuple (h N : β) : Finset (Fin h β β) := | |
| (Finset.range (N+1)).biUnion (Finset.Nat.antidiagonalTuple h) | |
| @[simp] theorem mem_simplexTuple {h N : β} (x : Fin h β β) : | |
| x β simplexTuple h N β β i, x i β€ N := by | |
| classical | |
| simp only [simplexTuple, Finset.mem_biUnion, Finset.mem_range, | |
| Finset.Nat.mem_antidiagonalTuple] | |
| constructor | |
| Β· rintro β¨n, hn, heβ©; omega | |
| Β· intro hx; exact β¨_, by omega, rflβ© | |
| private theorem card_antidiagonalTuple (h N : β) : | |
| (Finset.Nat.antidiagonalTuple h N).card = h.multichoose N := by | |
| classical | |
| have hc := Finset.card_finsuppAntidiag_nat_eq_multichoose | |
| (s := (Finset.univ : Finset (Fin h))) N | |
| rw [Finset.card_univ, Fintype.card_fin] at hc | |
| rw [β hc] | |
| apply Finset.card_bij (fun x _ => Finsupp.equivFunOnFinite.symm x) | |
| Β· intro x hx | |
| rw [Finset.mem_finsuppAntidiag'] | |
| exact β¨by simpa [Finsupp.sum_fintype] using Finset.Nat.mem_antidiagonalTuple.mp hx, | |
| Finset.subset_univ _β© | |
| Β· intro x _ y _ he | |
| exact Finsupp.equivFunOnFinite.symm.injective he | |
| Β· intro x hx | |
| refine β¨Finsupp.equivFunOnFinite x, ?_, by simpβ© | |
| rw [Finset.Nat.mem_antidiagonalTuple] | |
| simpa [Finsupp.sum_fintype] using (Finset.mem_finsuppAntidiag'.mp hx).1 | |
| theorem card_simplexTuple (h N : β) : | |
| (simplexTuple h N).card = (N+h).choose h := by | |
| classical | |
| rw [simplexTuple, Finset.card_biUnion] | |
| Β· simp_rw [card_antidiagonalTuple] | |
| exact Nat.sum_range_multichoose N h | |
| Β· intro i _ j _ hij | |
| apply Finset.disjoint_left.mpr | |
| intro x hi hj | |
| exact hij ((Finset.Nat.mem_antidiagonalTuple.mp hi).symm.trans | |
| (Finset.Nat.mem_antidiagonalTuple.mp hj)) | |
| noncomputable def simplexExponents (n T : β) : Finset (Fin n ββ β) := | |
| (simplexTuple n T).map Finsupp.equivFunOnFinite.symm.toEmbedding | |
| @[simp] theorem mem_simplexExponents {n T : β} (d : Fin n ββ β) : | |
| d β simplexExponents n T β d.degree β€ T := by | |
| classical | |
| simp only [simplexExponents, Finset.mem_map_equiv, mem_simplexTuple] | |
| change (β i, d i) β€ T β (d.sum fun _ e => e) β€ T | |
| rw [Finsupp.sum_fintype] | |
| intro i; rfl | |
| @[simp] theorem card_simplexExponents (n T : β) : | |
| (simplexExponents n T).card = (T+n).choose n := by | |
| rw [simplexExponents, Finset.card_map, card_simplexTuple] | |
| noncomputable def normalExponents {n : β} (s : Finset (Fin n ββ β)) (T : β) : | |
| Finset (Fin n ββ β) := by | |
| classical | |
| exact (simplexExponents n T).filter (fun d => β a β s, Β¬ a β€ d) | |
| @[simp] theorem mem_normalExponents {n : β} (s : Finset (Fin n ββ β)) (T : β) | |
| (d : Fin n ββ β) : | |
| d β normalExponents s T β d.degree β€ T β§ β a β s, Β¬ a β€ d := by | |
| classical | |
| simp [normalExponents] | |
| @[simp] theorem normalExponents_empty (n T : β) : | |
| normalExponents (β : Finset (Fin n ββ β)) T = simplexExponents n T := by | |
| classical | |
| ext; simp | |
| noncomputable def colonMonomials {n : β} (a : Fin n ββ β) | |
| (s : Finset (Fin n ββ β)) : Finset (Fin n ββ β) := by | |
| classical | |
| exact s.image (fun b => b-a) | |
| theorem colonMonomials_card_le {n : β} (a : Fin n ββ β) | |
| (s : Finset (Fin n ββ β)) : (colonMonomials a s).card β€ s.card := by | |
| classical | |
| exact Finset.card_image_le | |
| theorem finsupp_tsub_le_iff {n : β} (a b d : Fin n ββ β) : | |
| b-a β€ d β b β€ a+d := by | |
| simp only [Finsupp.le_def, Finsupp.tsub_apply, Finsupp.add_apply] | |
| constructor | |
| Β· intro h i; have := h i; omega | |
| Β· intro h i; have := h i; omega | |
| theorem normalExponents_card_insert {n : β} (a : Fin n ββ β) | |
| (s : Finset (Fin n ββ β)) (T : β) (ha : a.degree β€ T) : | |
| (normalExponents (insert a s) T).card + | |
| (normalExponents (colonMonomials a s) (T-a.degree)).card = | |
| (normalExponents s T).card := by | |
| classical | |
| have hs : normalExponents (insert a s) T = | |
| (normalExponents s T).filter (fun d => Β¬ a β€ d) := by | |
| ext d; simp [and_left_comm, and_comm] | |
| have hc : ((normalExponents s T).filter (a β€ Β·)).card = | |
| (normalExponents (colonMonomials a s) (T-a.degree)).card := by | |
| symm | |
| apply Finset.card_bij (fun d _ => a+d) | |
| Β· intro d hd | |
| obtain β¨hdT, hdSβ© := (mem_normalExponents _ _ d).mp hd | |
| apply Finset.mem_filter.mpr | |
| refine β¨(mem_normalExponents _ _ _).mpr β¨?_, ?_β©, le_add_right le_rflβ© | |
| Β· rw [map_add]; omega | |
| Β· intro b hb hbad | |
| exact hdS (b-a) (Finset.mem_image.mpr β¨b, hb, rflβ©) | |
| ((finsupp_tsub_le_iff a b d).mpr hbad) | |
| Β· intro d _ e _ h; exact add_left_cancel h | |
| Β· intro d hd | |
| obtain β¨hdS, hadβ© := Finset.mem_filter.mp hd | |
| obtain β¨hdT, hdNβ© := (mem_normalExponents _ _ d).mp hdS | |
| refine β¨d-a, (mem_normalExponents _ _ _).mpr β¨?_, ?_β©, | |
| add_tsub_cancel_of_le hadβ© | |
| Β· have he := congrArg Finsupp.degree (add_tsub_cancel_of_le had) | |
| simp only [map_add] at he | |
| omega | |
| Β· intro b hb hbd | |
| obtain β¨c, hc, rflβ© := Finset.mem_image.mp hb | |
| apply hdN c hc | |
| have h := (finsupp_tsub_le_iff a c (d-a)).mp hbd | |
| simpa only [add_tsub_cancel_of_le had] using h | |
| rw [hs, β hc, add_comm] | |
| exact Finset.card_filter_add_card_filter_not _ | |
| theorem normalExponents_eventually_polynomial {n : β} (s : Finset (Fin n ββ β)) : | |
| β P : Polynomial β, P.natDegree β€ n β§ β Tβ : β, β T β₯ Tβ, | |
| ((normalExponents s T).card : β) = P.eval (T : β) := by | |
| classical | |
| suffices H : β N, β s : Finset (Fin n ββ β), s.card = N β | |
| β P : Polynomial β, P.natDegree β€ n β§ β Tβ : β, β T β₯ Tβ, | |
| ((normalExponents s T).card : β) = P.eval (T : β) by | |
| exact H s.card s rfl | |
| intro N | |
| induction N using Nat.strong_induction_on with | |
| | h N ih => | |
| intro s hs | |
| by_cases he : s = β | |
| Β· subst s | |
| refine β¨Polynomial.preHilbertPoly β n 0, | |
| (Polynomial.natDegree_preHilbertPoly _ _ _).le, 0, ?_β© | |
| intro T _ | |
| rw [normalExponents_empty, card_simplexExponents, | |
| Polynomial.preHilbertPoly_eq_choose_add_sub _ _ (Nat.zero_le _)] | |
| simp | |
| Β· obtain β¨a, haβ© := Finset.nonempty_iff_ne_empty.mpr he | |
| let s' := s.erase a | |
| have ht : s'.card < N := by rw [β hs]; exact Finset.card_erase_lt_of_mem ha | |
| obtain β¨P, hP, TP, hPTβ© := ih s'.card ht s' rfl | |
| obtain β¨Q, hQ, TQ, hQTβ© := ih (colonMonomials a s').card | |
| ((colonMonomials_card_le _ _).trans_lt ht) _ rfl | |
| refine β¨P - Q.comp (Polynomial.X - Polynomial.C (a.degree : β)), ?_, | |
| max TP (TQ+a.degree), ?_β© | |
| Β· apply (Polynomial.natDegree_sub_le _ _).trans | |
| apply max_le hP | |
| rw [Polynomial.natDegree_comp, Polynomial.natDegree_X_sub_C, mul_one] | |
| exact hQ | |
| Β· intro T hT | |
| have hTP : TP β€ T := (le_max_left _ _).trans hT | |
| have hTQ : TQ+a.degree β€ T := (le_max_right _ _).trans hT | |
| have haT : a.degree β€ T := by omega | |
| have hh := normalExponents_card_insert a s' T haT | |
| rw [show insert a s' = s from Finset.insert_erase ha] at hh | |
| have hhQ : ((normalExponents s T).card : β) + | |
| ((normalExponents (colonMonomials a s') (T-a.degree)).card : β) = | |
| ((normalExponents s' T).card : β) := by exact_mod_cast hh | |
| rw [hPT T hTP, hQT (T-a.degree) (by omega)] at hhQ | |
| rw [Polynomial.eval_sub, Polynomial.eval_comp, Polynomial.eval_sub, | |
| Polynomial.eval_X, Polynomial.eval_C] | |
| rw [Nat.cast_sub haT] at hhQ | |
| linarith | |
| theorem coordinate_hilbert_eventually_polynomial {n : β} | |
| (I : Ideal (MvPolynomial (Fin n) K)) : | |
| β P : Polynomial β, P.natDegree β€ n β§ β Tβ : β, β T β₯ Tβ, | |
| (Module.finrank K ((totalSpace T).map (Ideal.Quotient.mkβ K I).toLinearMap) : β) = | |
| P.eval (T : β) := by | |
| classical | |
| obtain β¨s, _, hsβ© := ideal_normal_finite_obstructions degLex I | |
| have hc (T : β) : | |
| Module.finrank K ((totalSpace T).map (Ideal.Quotient.mkβ K I).toLinearMap) = | |
| (normalExponents s T).card := by | |
| rw [coordinate_hilbert_count, β Fintype.card_coe, β Nat.card_eq_fintype_card] | |
| apply Nat.card_congr | |
| apply Equiv.subtypeEquivRight | |
| intro d | |
| simp only [mem_normalExponents, hs, and_comm] | |
| obtain β¨P, hP, Tβ, hTβ© := normalExponents_eventually_polynomial s | |
| refine β¨P, hP, Tβ, ?_β© | |
| intro T h | |
| rw [hc] | |
| exact hT T h | |
| theorem idealNormal_span_singleton (m : MonomialOrder Ο) | |
| (p : MvPolynomial Ο K) (hp : p β 0) (d : Ο ββ β) : | |
| IdealNormal m (Ideal.span {p}) d β Β¬ m.degree p β€ d := by | |
| constructor | |
| Β· intro h | |
| exact h p (Ideal.subset_span (Set.mem_singleton p)) hp | |
| Β· intro h q hq hq0 hqd | |
| obtain β¨r, rflβ© := Ideal.mem_span_singleton.mp hq | |
| have hr : r β 0 := by intro he; simp [he] at hq0 | |
| rw [m.degree_mul hp hr] at hqd | |
| exact h ((_root_.le_add_right le_rfl).trans hqd) | |
| theorem hypersurface_hilbert_count {n : β} (p : MvPolynomial (Fin n) K) | |
| (hp : p β 0) (T : β) (hT : p.totalDegree β€ T) : | |
| Module.finrank K ((totalSpace T).map | |
| (Ideal.Quotient.mkβ K (Ideal.span {p})).toLinearMap) + | |
| (T-p.totalDegree+n).choose n = (T+n).choose n := by | |
| classical | |
| have hc : Module.finrank K ((totalSpace T).map | |
| (Ideal.Quotient.mkβ K (Ideal.span {p})).toLinearMap) = | |
| (normalExponents {degLex.degree p} T).card := by | |
| rw [coordinate_hilbert_count, β Fintype.card_coe, β Nat.card_eq_fintype_card] | |
| apply Nat.card_congr | |
| apply Equiv.subtypeEquivRight | |
| intro d | |
| simp only [mem_normalExponents, idealNormal_span_singleton degLex p hp, | |
| Finset.mem_singleton, forall_eq, and_comm] | |
| rw [hc] | |
| have hh := normalExponents_card_insert (degLex.degree p) β T | |
| (by simpa only [degree_degLexDegree] using hT) | |
| simpa [colonMonomials, degree_degLexDegree] using hh | |
| theorem binomial_difference_sum (n e T : β) (he : e β€ T) : | |
| (T-e+(n+1)).choose (n+1) + | |
| β j β Finset.range e, (T-j+n).choose n = | |
| (T+(n+1)).choose (n+1) := by | |
| induction e with | |
| | zero => simp | |
| | succ e ih => | |
| rw [Finset.sum_range_succ] | |
| have hi := ih (by omega) | |
| have hE : T-e+n = (T-(e+1)+(n+1)) := by omega | |
| have hE' : T-e+(n+1) = (T-e+n)+1 := by omega | |
| have hb := Nat.choose_succ_succ (T-e+n) n | |
| change (T-e+n+1).choose (n+1) = (T-e+n).choose n + (T-e+n).choose (n+1) at hb | |
| rw [β hE'] at hb | |
| rw [β hE] | |
| omega | |
| noncomputable def hypersurfaceHilbertPolynomial (n e : β) : Polynomial β := | |
| β j β Finset.range e, Polynomial.preHilbertPoly β n j | |
| theorem hypersurfaceHilbertPolynomial_coeff (n e : β) : | |
| (hypersurfaceHilbertPolynomial n e).coeff n = (e : β)/(n.factorial : β) := by | |
| simp [hypersurfaceHilbertPolynomial, Polynomial.coeff_preHilbertPoly_self, div_eq_mul_inv] | |
| theorem hypersurfaceHilbertPolynomial_degree (n e : β) : | |
| (hypersurfaceHilbertPolynomial n e).natDegree β€ n := by | |
| apply Polynomial.natDegree_sum_le_of_forall_le | |
| intro j _ | |
| exact (Polynomial.natDegree_preHilbertPoly _ _ _).le | |
| theorem hypersurface_hilbert_polynomial {n : β} (p : MvPolynomial (Fin (n+1)) K) | |
| (hp : p β 0) (T : β) (hT : p.totalDegree β€ T) : | |
| (Module.finrank K ((totalSpace T).map | |
| (Ideal.Quotient.mkβ K (Ideal.span {p})).toLinearMap) : β) = | |
| (hypersurfaceHilbertPolynomial n p.totalDegree).eval (T : β) := by | |
| have hh := hypersurface_hilbert_count p hp T hT | |
| have hb := binomial_difference_sum n p.totalDegree T hT | |
| have he : Module.finrank K ((totalSpace T).map | |
| (Ideal.Quotient.mkβ K (Ideal.span {p})).toLinearMap) = | |
| β j β Finset.range p.totalDegree, (T-j+n).choose n := by omega | |
| rw [he, Nat.cast_sum] | |
| simp only [hypersurfaceHilbertPolynomial, Polynomial.eval_finsetSum] | |
| apply Finset.sum_congr rfl | |
| intro j hj | |
| rw [Polynomial.preHilbertPoly_eq_choose_add_sub _ _ | |
| (Nat.le_add_right_of_le ((Finset.mem_range.mp hj).le.trans hT)), | |
| Nat.sub_add_comm ((Finset.mem_range.mp hj).le.trans hT)] | |
| end QuarticPowerFree | |
| end OAI | |