Download data/lean/OAI/Algebra/FormulaHitting/Multiplicity.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.95 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/FormulaHitting/Multiplicity.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algebra/FormulaHitting/Multiplicity.lean
-
curl -L -o Multiplicity.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/FormulaHitting/Multiplicity.lean
6.95 kB
| import OAI.Algebra.FormulaHitting.ScaledDerivatives | |
| import OAI.Algebra.FormulaHitting.WronskianBound | |
| import OAI.Algebra.FormulaHitting.MinorFactor | |
| import Mathlib.RingTheory.PowerSeries.NoZeroDivisors | |
| import Mathlib.Data.Nat.Choose.Basic | |
| import Mathlib.Algebra.BigOperators.Intervals | |
| namespace OAI | |
| noncomputable section | |
| namespace NCHitting | |
| open PowerSeries Polynomial Matrix Submodule | |
| variable {F : Type*} [Field F] [CharZero F] | |
| def derivativeMatrix {I : Type*} (k : β) (h : I β PowerSeries F) : | |
| Matrix (Fin k) I (PowerSeries F) := fun j t => derivativeIter j.val (h t) | |
| omit [CharZero F] in | |
| theorem derivativeMatrix_combination {I J : Type*} [Fintype I] | |
| (k : β) (h : I β PowerSeries F) (C : Matrix I J F) : | |
| derivativeMatrix k (fun l => β t : I, C t l β’ h t) = | |
| derivativeMatrix k h * C.map PowerSeries.C := by | |
| classical | |
| funext j l | |
| change derivativeIter j.val (β t : I, C t l β’ h t) = | |
| β t : I, derivativeIter j.val (h t) * PowerSeries.C (C t l) | |
| rw [derivativeIter_sum] | |
| simp only [derivativeIter_smul] | |
| simp only [PowerSeries.smul_eq_C_mul] | |
| apply Finset.sum_congr rfl | |
| intro t _ | |
| exact mul_comm _ _ | |
| omit [CharZero F] in | |
| theorem order_le_natDegree_of_dvd (f : PowerSeries F) (p : F[X]) | |
| (hp : p β 0) (h : f β£ (p : PowerSeries F)) : f.order.toNat β€ p.natDegree := by | |
| by_contra hn | |
| have hd : PowerSeries.X^f.order.toNat β£ (p : PowerSeries F) := | |
| PowerSeries.X_pow_order_dvd.trans h | |
| have hz := (PowerSeries.X_pow_dvd_iff.mp hd) p.natDegree (by omega) | |
| exact (Polynomial.leadingCoeff_ne_zero.mpr hp) (by simpa using hz) | |
| theorem sum_fin_eq_choose (k : β) : (β j : Fin k, j.val) = k.choose 2 := by | |
| calc | |
| (β j : Fin k, j.val) = β j β Finset.range k, j := | |
| Fin.sum_univ_eq_sum_range (fun j => j) k | |
| _ = k.choose 2 := by rw [Finset.sum_range_id, Nat.choose_two_right] | |
| variable {I : Type*} [Fintype I] [DecidableEq I] | |
| def systemScalarOutput (u v : I β F) (G : Matrix I I (PowerSeries F)) : | |
| PowerSeries F := β l : I, (β t : I, PowerSeries.C (u t) * G t l) * PowerSeries.C (v l) | |
| theorem system_multiplicity (n : β) (hn : 0 < n) | |
| (q : F[X]) (P : Matrix I I F[X]) (u v : I β F) | |
| (G : Matrix I I (PowerSeries F)) | |
| (hq : q.natDegree β€ n) (hqn : q β 0) | |
| (hP : β t l, (P t l).natDegree β€ n-1) (hG : IsUnit G) | |
| (hD : β t l, (q : PowerSeries F) * PowerSeries.derivative (R := F) (G t l) = | |
| β a : I, (P t a : PowerSeries F) * G a l) | |
| (hy : systemScalarOutput u v G β 0) : | |
| (systemScalarOutput u v G).order.toNat < | |
| (n-1) * (Fintype.card I).choose 2 + Fintype.card I := by | |
| classical | |
| let h : I β PowerSeries F := fun l => β t : I, PowerSeries.C (u t) * G t l | |
| let V := Submodule.span F (Set.range h) | |
| let : FiniteDimensional F V := FiniteDimensional.span_of_finite F (Set.finite_range h) | |
| obtain β¨k, b, a, hbi, hspan, ha, hlead, hzeroβ© := hasOrderBasis V | |
| have hbn : wronskian b β 0 := (wronskian_order_sum b a ha hlead hzero).1 | |
| have hk : k β€ Fintype.card I := by | |
| have hkdim : Module.finrank F (Submodule.span F (Set.range b)) = k := by | |
| simpa using finrank_span_eq_card hbi | |
| rw [hspan] at hkdim | |
| rw [β hkdim] | |
| exact finrank_range_le_card h | |
| have hhmem : β l, h l β Submodule.span F (Set.range b) := by | |
| intro l | |
| rw [hspan] | |
| exact Submodule.subset_span β¨l, rflβ© | |
| have hbmem : β l, b l β Submodule.span F (Set.range h) := by | |
| intro l | |
| change b l β V | |
| rw [β hspan] | |
| exact Submodule.subset_span β¨l, rflβ© | |
| have hc : β l : I, β c : Fin k β F, β j : Fin k, c j β’ b j = h l := by | |
| intro l | |
| exact (Submodule.mem_span_range_iff_exists_fun F).mp (hhmem l) | |
| have he : β l : Fin k, β c : I β F, β j : I, c j β’ h j = b l := by | |
| intro l | |
| exact (Submodule.mem_span_range_iff_exists_fun F).mp (hbmem l) | |
| choose c hc using hc | |
| choose e he using he | |
| let H := derivativeMatrix k h | |
| let W := wronskianMatrix b | |
| let C : Matrix (Fin k) I (PowerSeries F) := | |
| fun j l => PowerSeries.C (c l j) | |
| let E : Matrix I (Fin k) (PowerSeries F) := | |
| fun j l => PowerSeries.C (e l j) | |
| let D : Matrix (Fin k) (Fin k) (PowerSeries F) := | |
| Matrix.diagonal (fun j => (q : PowerSeries F)^j.val) | |
| let Zp : Matrix (Fin k) I F[X] := fun j t => numeratorRow q P u j.val t | |
| let Z : Matrix (Fin k) I (PowerSeries F) := | |
| fun j t => (Zp j t : PowerSeries F) | |
| have hHC : H = W * C := by | |
| funext j l | |
| change derivativeIter j.val (h l) = | |
| β t : Fin k, derivativeIter j.val (b t) * PowerSeries.C (c l t) | |
| rw [β hc l, derivativeIter_sum] | |
| simp only [derivativeIter_smul] | |
| simp only [PowerSeries.smul_eq_C_mul] | |
| apply Finset.sum_congr rfl | |
| intro t _ | |
| exact mul_comm _ _ | |
| have hHE : W = H * E := by | |
| funext j l | |
| change derivativeIter j.val (b l) = | |
| β t : I, derivativeIter j.val (h t) * PowerSeries.C (e l t) | |
| rw [β he l, derivativeIter_sum] | |
| simp only [derivativeIter_smul] | |
| simp only [PowerSeries.smul_eq_C_mul] | |
| apply Finset.sum_congr rfl | |
| intro t _ | |
| exact mul_comm _ _ | |
| have hZG : Z * G = D * H := by | |
| funext j l | |
| rw [Matrix.diagonal_mul] | |
| exact (scaled_derivative_row q P u G hD j.val l).symm | |
| have hDn : D.det β 0 := by | |
| rw [Matrix.det_diagonal] | |
| apply Finset.prod_ne_zero_iff.mpr | |
| intro j _ | |
| exact pow_ne_zero _ (Polynomial.coe_eq_zero_iff.not.mpr hqn) | |
| obtain β¨f, hfn, hdivβ© := exists_nonzero_divisible_minor Z H G D W C E hG hDn hbn hZG hHC hHE | |
| let p : F[X] := (Zp.submatrix id f).det | |
| have hpcoe : (p : PowerSeries F) = (Z.submatrix id f).det := by | |
| exact RingHom.map_det Polynomial.coeToPowerSeries.ringHom (Zp.submatrix id f) | |
| have hpn : p β 0 := by | |
| intro hp | |
| apply hfn | |
| rw [β hpcoe, hp, Polynomial.coe_zero] | |
| have hdegree : p.natDegree β€ (n-1) * k.choose 2 := by | |
| calc | |
| p.natDegree β€ β j : Fin k, j.val * (n-1) := by | |
| apply natDegree_det_le_sum | |
| intro j l | |
| exact numeratorRow_degree hn q P u hq hP j.val (f l) | |
| _ = (n-1) * k.choose 2 := by | |
| rw [β Finset.sum_mul, sum_fin_eq_choose, mul_comm] | |
| have horder : (wronskian b).order.toNat β€ (n-1) * k.choose 2 := by | |
| apply (order_le_natDegree_of_dvd (wronskian b) p hpn ?_).trans hdegree | |
| rwa [hpcoe] | |
| have hymem : systemScalarOutput u v G β Submodule.span F (Set.range b) := by | |
| apply Submodule.sum_mem | |
| intro l _ | |
| change h l * PowerSeries.C (v l) β _ | |
| rw [mul_comm, β PowerSeries.smul_eq_C_mul] | |
| exact Submodule.smul_mem _ _ (hhmem l) | |
| have hybound := order_le_wronskian_add b hbn (systemScalarOutput u v G) hy hymem | |
| have hkpos : 0 < k := by | |
| by_contra hn | |
| have hk0 : k = 0 := by omega | |
| subst k | |
| have : systemScalarOutput u v G = 0 := by simpa using hymem | |
| exact hy this | |
| have hchoose : k.choose 2 β€ (Fintype.card I).choose 2 := Nat.choose_le_choose 2 hk | |
| have hmul := Nat.mul_le_mul_left (n-1) hchoose | |
| omega | |
| end NCHitting | |
| end | |
| end OAI | |