Download data/lean/OAI/Algebra/Determinantal/LinearForms.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 20.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/Determinantal/LinearForms.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algebra/Determinantal/LinearForms.lean
-
curl -L -o LinearForms.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/Determinantal/LinearForms.lean
20.1 kB
| import OAI.Algebra.Determinantal.Multigraded | |
| namespace OAI | |
| namespace PermanentBorder.Multigraded | |
| open MvPolynomial | |
| section LinearCoefficients | |
| variable {K Ο Ο : Type*} [Field K] [Fintype Ο] | |
| noncomputable def linearFormMap (v : Ο β Ο) : (Ο β K) ββ[K] MvPolynomial Ο K := | |
| β t, (LinearMap.proj t).smulRight (X (v t)) | |
| lemma linearFormMap_apply (v : Ο β Ο) (c : Ο β K) : | |
| linearFormMap v c = β t, C (c t) * X (v t) := by | |
| simp [linearFormMap, smul_eq_C_mul] | |
| lemma linearFormMap_single [DecidableEq Ο] (v : Ο β Ο) (t : Ο) : | |
| linearFormMap v (Pi.single t (1 : K)) = X (v t) := by | |
| classical | |
| simp [linearFormMap_apply, Pi.single_apply] | |
| noncomputable def linearCoefficientSubspace (v : Ο β Ο) (I : Ideal (MvPolynomial Ο K)) : | |
| Submodule K (Ο β K) := (I.restrictScalars K).comap (linearFormMap v) | |
| theorem linear_relations_of_codimension_le_one (v : Ο β Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (h : Module.finrank K ((Ο β K) β§Έ linearCoefficientSubspace v I) β€ 1) : | |
| β z : MvPolynomial Ο K, β c : Ο β K, β t, X (v t) - C (c t) * z β I := by | |
| classical | |
| obtain β¨a,haβ© := finrank_le_one_iff.mp h | |
| obtain β¨b,rflβ© := Submodule.Quotient.mk_surjective (linearCoefficientSubspace v I) a | |
| choose c hc using fun t => ha (Submodule.Quotient.mk (Pi.single t (1 : K))) | |
| refine β¨linearFormMap v b,c,fun t => ?_β© | |
| have hmem : Pi.single t (1 : K) - c t β’ b β linearCoefficientSubspace v I := by | |
| apply (Submodule.Quotient.eq (linearCoefficientSubspace v I)).mp | |
| simpa only [Submodule.Quotient.mk_smul] using (hc t).symm | |
| change linearFormMap v (Pi.single t 1 - c t β’ b) β I at hmem | |
| simpa only [map_sub, map_smul, linearFormMap_single, smul_eq_C_mul] using hmem | |
| theorem variables_mem_of_codimension_zero (v : Ο β Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (h : Module.finrank K ((Ο β K) β§Έ linearCoefficientSubspace v I) = 0) : | |
| β t, X (v t) β I := by | |
| classical | |
| intro t | |
| have hz : Submodule.Quotient.mk (Pi.single t (1 : K)) = | |
| (0 : (Ο β K) β§Έ linearCoefficientSubspace v I) := by | |
| obtain β¨c,hc,hqβ© := Module.finrank_eq_zero_iff.mp h | |
| (Submodule.Quotient.mk (Pi.single t (1 : K))) | |
| exact (smul_eq_zero.mp hq).resolve_left hc | |
| have hm := (Submodule.Quotient.mk_eq_zero (linearCoefficientSubspace v I)).mp hz | |
| change linearFormMap v (Pi.single t (1 : K)) β I at hm | |
| simpa only [linearFormMap_single] using hm | |
| end LinearCoefficients | |
| section Vandermonde | |
| variable {K : Type*} [Field K] | |
| lemma linearIndependent_rect_vandermonde {n N : β} (hn : n β€ N) | |
| (t : Fin n β K) (ht : Function.Injective t) : | |
| LinearIndependent K (fun i : Fin n => fun j : Fin N => t i ^ j.val) := by | |
| let f : (Fin N β K) ββ[K] Fin n β K := | |
| LinearMap.funLeft K K (Fin.castLE hn) | |
| apply LinearIndependent.of_comp f | |
| exact Matrix.linearIndependent_rows_of_det_ne_zero | |
| (Matrix.det_vandermonde_ne_zero_iff.mpr ht) | |
| lemma linear_block_codimension_le {Ο : Type*} {n N : β} (hn : n β€ N) | |
| (v : Fin N β Ο) (I : Ideal (MvPolynomial Ο K)) | |
| (t : Fin n β K) (ht : Function.Injective t) | |
| (hforms : β i, linearFormMap v (fun j => t i ^ j.val) β I) : | |
| Module.finrank K ((Fin N β K) β§Έ linearCoefficientSubspace v I) + n β€ N := by | |
| have hi := linearIndependent_rect_vandermonde hn t ht | |
| have hspan : Submodule.span K (Set.range (fun i : Fin n => fun j : Fin N => t i ^ j.val)) β€ | |
| linearCoefficientSubspace v I := by | |
| apply Submodule.span_le.mpr | |
| rintro _ β¨i,rflβ© | |
| exact hforms i | |
| have hr := Submodule.finrank_mono hspan | |
| rw [finrank_span_eq_card hi, Fintype.card_fin] at hr | |
| have he := Submodule.finrank_quotient_add_finrank (linearCoefficientSubspace v I) | |
| rw [Module.finrank_fintype_fun_eq_card, Fintype.card_fin] at he | |
| omega | |
| end Vandermonde | |
| end PermanentBorder.Multigraded | |
| namespace PermanentBorder.Multigraded | |
| open MvPolynomial | |
| section VandermondeLeaves | |
| variable {K ΞΉ L : Type*} [Field K] [Fintype ΞΉ] [DecidableEq ΞΉ] [Fintype L] | |
| abbrev BlockVariables (a : ΞΉ β β) := (j : ΞΉ) Γ Fin (a j + 1) | |
| def blockVar (a : ΞΉ β β) (j : ΞΉ) (h : Fin (a j+1)) : BlockVariables a := β¨j,hβ© | |
| noncomputable def blockLinearForm (a : ΞΉ β β) (j : ΞΉ) (t : K) : | |
| MvPolynomial (BlockVariables a) K := | |
| linearFormMap (blockVar a j) (fun h : Fin (a j+1) => t ^ h.val) | |
| omit [Fintype ΞΉ] in | |
| lemma blockLinearForm_homogeneous (a : ΞΉ β β) (j : ΞΉ) (t : K) : | |
| (blockLinearForm a j t).IsWeightedHomogeneous (blockWeight (fun v : BlockVariables a => v.1)) | |
| (Pi.single j 1) := by | |
| classical | |
| rw [blockLinearForm,linearFormMap_apply] | |
| apply IsWeightedHomogeneous.sum | |
| intro h _ | |
| exact (isWeightedHomogeneous_X K (blockWeight (fun v : BlockVariables a => v.1)) (blockVar a j h)).C_mul _ | |
| omit [Fintype ΞΉ] in | |
| lemma labeled_codimension (a : ΞΉ β β) (g : L β ΞΉ) (t : L β K) | |
| (ht : Function.Injective t) (I : Ideal (MvPolynomial (BlockVariables a) K)) | |
| (hforms : β l, blockLinearForm a (g l) (t l) β I) | |
| (j : ΞΉ) (n : β) (hn : n β€ a j+1) (hj : n β€ Fintype.card {l // g l = j}) : | |
| Module.finrank K ((Fin (a j+1) β K) β§Έ linearCoefficientSubspace (blockVar a j) I) + n β€ a j+1 := by | |
| classical | |
| obtain β¨eβ© := Function.Embedding.nonempty_of_card_le (Ξ± := Fin n) | |
| (Ξ² := {l // g l = j}) (by simpa using hj) | |
| apply linear_block_codimension_le hn (blockVar a j) I (fun i => t (e i).val) | |
| (ht.comp (Subtype.val_injective.comp e.injective)) | |
| intro i | |
| have h := hforms (e i).val | |
| have hij : g (e i).val = j := (e i).property | |
| rw [hij] at h | |
| exact h | |
| theorem labeled_leaf_bound (a : ΞΉ β β) (g : L β ΞΉ) (t : L β K) | |
| (ht : Function.Injective t) (hcard : Fintype.card L = β j, a j) | |
| (I : Ideal (MvPolynomial (BlockVariables a) K)) | |
| (hforms : β l, blockLinearForm a (g l) (t l) β I) | |
| (d : ΞΉ β β€) (hd : β j, 0 < d j) : | |
| Module.finrank K (componentQuotient (blockWeight (fun v : BlockVariables a => v.1)) I d) β€ | |
| if β j, Fintype.card {l // g l = j} = a j then 1 else 0 := by | |
| classical | |
| split_ifs with hbalanced | |
| Β· have hj (j : ΞΉ) : | |
| Module.finrank K ((Fin (a j+1) β K) β§Έ linearCoefficientSubspace (blockVar a j) I) β€ 1 := by | |
| have h := labeled_codimension a g t ht I hforms j (a j) (by omega) (by rw [hbalanced]) | |
| omega | |
| choose z c hc using fun j => linear_relations_of_codimension_le_one (blockVar a j) I (hj j) | |
| exact component_finrank_le_one_of_linear_relations (fun v : BlockVariables a => v.1) I z | |
| (fun v => c v.1 v.2) (fun v => hc v.1 v.2) d | |
| Β· have hs : (β j, Fintype.card {l // g l = j}) = β j, a j := by | |
| rw [β Fintype.card_sigma, Fintype.card_congr (Equiv.sigmaFiberEquiv g), hcard] | |
| have hex : β j, a j < Fintype.card {l // g l = j} := by | |
| by_contra! hn | |
| apply hbalanced | |
| exact fun j => (Finset.sum_eq_sum_iff_of_le (fun j _ => hn j)).mp hs j (Finset.mem_univ j) | |
| obtain β¨j,hjβ© := hex | |
| have hdim := labeled_codimension a g t ht I hforms j (a j+1) le_rfl hj | |
| have hz := variables_mem_of_codimension_zero (blockVar a j) I (by omega) | |
| have hb : β v : BlockVariables a, v.1 = j β X v β I := by | |
| rintro β¨i,vβ© hv | |
| change i = j at hv | |
| subst i | |
| exact hz v | |
| exact (component_finrank_zero_of_block_killed (fun v : BlockVariables a => v.1) I j hb d (hd j)).le | |
| end VandermondeLeaves | |
| end PermanentBorder.Multigraded | |
| namespace PermanentBorder.Multigraded | |
| open MvPolynomial | |
| section BinaryChoices | |
| variable {K Ο G : Type*} [Field K] [AddCommGroup G] | |
| variable (w : Ο β G) | |
| noncomputable def pieceDim (I : Ideal (MvPolynomial Ο K)) (d : G) : β := | |
| Module.finrank K (componentQuotient w I d) | |
| noncomputable def choiceIdeal : (qs : List (FactorPair (K := K) w)) β | |
| (Fin qs.length β Bool) β Ideal (MvPolynomial Ο K) | |
| | [], _ => β₯ | |
| | q::qs, c => Ideal.span {if c 0 then q.right else q.left} β | |
| choiceIdeal qs (fun i => c i.succ) | |
| noncomputable def choiceShift : (qs : List (FactorPair (K := K) w)) β | |
| (Fin qs.length β Bool) β G | |
| | [], _ => 0 | |
| | q::qs, c => (if c 0 then q.leftDegree else 0) + choiceShift qs (fun i => c i.succ) | |
| lemma splitBound_eq_choiceSum (qs : List (FactorPair (K := K) w)) | |
| (I : Ideal (MvPolynomial Ο K)) (d : G) : | |
| splitBound w I d qs = β c : Fin qs.length β Bool, | |
| pieceDim w (I β choiceIdeal w qs c) (d-choiceShift w qs c) := by | |
| classical | |
| induction qs generalizing I d with | |
| | nil => | |
| change pieceDim w I d = β c : Fin 0 β Bool, | |
| pieceDim w (I β choiceIdeal w [] c) (d-choiceShift w [] c) | |
| simp only [choiceIdeal, choiceShift, sup_bot_eq, sub_zero] | |
| simp | |
| | cons q qs ih => | |
| rw [splitBound, ih, ih] | |
| let f : (Fin (qs.length+1) β Bool) β β := fun c => | |
| pieceDim w (I β choiceIdeal w (q::qs) c) (d-choiceShift w (q::qs) c) | |
| have hs := (Fin.consEquiv (fun _ : Fin (qs.length+1) => Bool)).sum_comp f | |
| apply Eq.trans (b := β p : Bool Γ (Fin qs.length β Bool), f (Fin.cons p.1 p.2)) _ hs | |
| simp only [f, Fintype.sum_prod_type, Fintype.sum_bool, | |
| choiceIdeal, choiceShift, Fin.cons_zero, Fin.cons_succ, Bool.false_eq_true, | |
| ite_false, ite_true, zero_add, β sup_assoc] | |
| simp_rw [sub_add_eq_sub_sub] | |
| exact add_comm _ _ | |
| lemma choice_mem_choiceIdeal (qs : List (FactorPair (K := K) w)) | |
| (c : Fin qs.length β Bool) (i : Fin qs.length) : | |
| (if c i then (qs.get i).right else (qs.get i).left) β choiceIdeal w qs c := by | |
| induction qs with | |
| | nil => exact Fin.elim0 i | |
| | cons q qs ih => | |
| refine Fin.cases ?_ (fun i => ?_) i | |
| Β· exact Submodule.mem_sup_left (Ideal.subset_span (Set.mem_singleton _)) | |
| Β· exact Submodule.mem_sup_right (ih (fun j => c j.succ) i) | |
| end BinaryChoices | |
| end PermanentBorder.Multigraded | |
| namespace PermanentBorder.Multigraded | |
| open MvPolynomial | |
| section MixedCoefficient | |
| variable {ΞΉ E : Type*} [Fintype E] [DecidableEq ΞΉ] | |
| noncomputable def choiceCount (g : E β ΞΉ) : ΞΉ ββ β := β e, Finsupp.single (g e) 1 | |
| lemma choiceCount_apply (g : E β ΞΉ) (j : ΞΉ) : | |
| choiceCount g j = Fintype.card {e // g e = j} := by | |
| classical | |
| rw [Fintype.card_subtype, Finset.card_filter] | |
| simp only [choiceCount, Finsupp.finsetSum_apply, Finsupp.single_apply] | |
| noncomputable def mixedPolynomial (u v : E β ΞΉ) : MvPolynomial ΞΉ β := | |
| β e, (X (u e) + X (v e)) | |
| omit [DecidableEq ΞΉ] in | |
| lemma mixedPolynomial_eq_choices [DecidableEq E] (u v : E β ΞΉ) : | |
| mixedPolynomial u v = β c : E β Bool, | |
| monomial (choiceCount (fun e => if c e then v e else u e)) (1 : β) := by | |
| classical | |
| have h := Fintype.prod_sum (fun e (b : Bool) => | |
| if b then X (v e) else X (u e) : E β Bool β MvPolynomial ΞΉ β) | |
| simp only [Fintype.sum_bool, ite_true, Bool.false_eq_true, ite_false] at h | |
| rw [mixedPolynomial] | |
| simp_rw [add_comm] at h | |
| rw [h] | |
| apply Finset.sum_congr rfl | |
| intro c _ | |
| rw [choiceCount, monomial_sum_one] | |
| apply Finset.prod_congr rfl | |
| intro e _ | |
| cases c e <;> rfl | |
| lemma mixed_coefficient_eq_count [Fintype ΞΉ] [DecidableEq E] (u v : E β ΞΉ) (a : ΞΉ ββ β) : | |
| (mixedPolynomial u v).coeff a = | |
| β c : E β Bool, if β j, | |
| Fintype.card {e // (if c e then v e else u e) = j} = a j then 1 else 0 := by | |
| classical | |
| rw [mixedPolynomial_eq_choices, coeff_sum] | |
| apply Finset.sum_congr rfl | |
| intro c _ | |
| rw [coeff_monomial] | |
| congr 1 | |
| rw [Finsupp.ext_iff] | |
| simp only [choiceCount_apply] | |
| end MixedCoefficient | |
| end PermanentBorder.Multigraded | |
| namespace PermanentBorder.Multigraded | |
| open MvPolynomial | |
| section ComparisonPieceBound | |
| variable {K ΞΉ Ο : Type*} [Field K] [DecidableEq ΞΉ] | |
| omit [DecidableEq ΞΉ] in | |
| lemma choiceShift_le_length (w : Ο β (ΞΉ β β€)) | |
| (qs : List (FactorPair (K := K) w)) (c : Fin qs.length β Bool) | |
| (hdeg : β q β qs, β j, q.leftDegree j β€ 1) (j : ΞΉ) : | |
| choiceShift w qs c j β€ (qs.length : β€) := by | |
| induction qs with | |
| | nil => simp [choiceShift] | |
| | cons q qs ih => | |
| have hq := hdeg q (List.mem_cons_self) j | |
| have hs := ih (fun i => c i.succ) (fun q h => hdeg q (List.mem_cons_of_mem _ h)) | |
| by_cases hc : c 0 = true | |
| Β· simpa [choiceShift, hc, add_comm] using add_le_add hq hs | |
| Β· simpa [choiceShift, hc] using hs.trans (show (qs.length : β€) β€ qs.length + 1 by omega) | |
| variable [Fintype ΞΉ] | |
| theorem comparison_piece_bound (a : ΞΉ ββ β) | |
| (qs : List (FactorPair (K := K) (blockWeight (fun v : BlockVariables a => v.1)))) | |
| (u v : Fin qs.length β ΞΉ) (t : (Fin qs.length Γ Bool) β K) | |
| (ht : Function.Injective t) | |
| (hleft : β i, (qs.get i).left = blockLinearForm a (u i) (t (i,false))) | |
| (hright : β i, (qs.get i).right = blockLinearForm a (v i) (t (i,true))) | |
| (hdeg : β q β qs, β j, q.leftDegree j β€ 1) | |
| (hlen : qs.length = β j, a j) (d : ΞΉ β β€) (hd : β j, (qs.length : β€) < d j) : | |
| pieceDim (blockWeight (fun v : BlockVariables a => v.1)) | |
| (productIdeal (blockWeight (fun v : BlockVariables a => v.1)) qs) d β€ | |
| (mixedPolynomial u v).coeff a := by | |
| classical | |
| let w := blockWeight (fun v : BlockVariables a => v.1) | |
| have hf := finrank_le_splitBound w qs β₯ (componentClosed_bot w) d | |
| change pieceDim w (β₯ β productIdeal w qs) d β€ splitBound w β₯ d qs at hf | |
| rw [bot_sup_eq] at hf | |
| apply hf.trans | |
| rw [splitBound_eq_choiceSum, mixed_coefficient_eq_count] | |
| apply Finset.sum_le_sum | |
| intro c _ | |
| simp only [bot_sup_eq] | |
| let g : Fin qs.length β ΞΉ := fun i => if c i then v i else u i | |
| let t' : Fin qs.length β K := fun i => t (i,c i) | |
| have ht' : Function.Injective t' := by | |
| intro i j hij | |
| exact congrArg Prod.fst (ht hij) | |
| have hforms (i : Fin qs.length) : | |
| blockLinearForm a (g i) (t' i) β choiceIdeal w qs c := by | |
| have h := choice_mem_choiceIdeal w qs c i | |
| dsimp only [g,t'] | |
| cases hc : c i | |
| Β· simpa only [hc, Bool.false_eq_true, ite_false, hleft i] using h | |
| Β· simpa only [hc, ite_true, hright i] using h | |
| have hp (j : ΞΉ) : 0 < (d-choiceShift w qs c) j := by | |
| have hb := choiceShift_le_length w qs c hdeg j | |
| have hh := hd j | |
| simp only [Pi.sub_apply] | |
| omega | |
| exact labeled_leaf_bound a g t' ht' (by simpa using hlen) | |
| (choiceIdeal w qs c) hforms (d-choiceShift w qs c) hp | |
| end ComparisonPieceBound | |
| end PermanentBorder.Multigraded | |
| namespace PermanentBorder.Multigraded | |
| open MvPolynomial | |
| section HomogeneousIdealMap | |
| variable {K Ο G E : Type*} [Field K] [AddCommGroup G] [Fintype E] | |
| variable (w : Ο β G) (e : E β G) (F : E β MvPolynomial Ο K) | |
| (hF : β i, (F i).IsWeightedHomogeneous w (e i)) | |
| noncomputable def homogeneousIdealMap (d : G) : | |
| (β i : E, Piece (K := K) w (d-e i)) ββ[K] Piece (K := K) w d := | |
| β i, (mulPiece w (hF i) d).comp (LinearMap.proj i) | |
| lemma homogeneousIdealMap_val (d : G) (p : β i : E, Piece (K := K) w (d-e i)) : | |
| (homogeneousIdealMap w e F hF d p).val = β i, F i * (p i).val := by | |
| simp [homogeneousIdealMap] | |
| lemma homogeneousIdealMap_range (d : G) : | |
| LinearMap.range (homogeneousIdealMap w e F hF d) = | |
| ((Ideal.span (Set.range F)).restrictScalars K).comap (Piece (K := K) w d).subtype := by | |
| classical | |
| ext p | |
| constructor | |
| Β· rintro β¨g,rflβ© | |
| change (homogeneousIdealMap w e F hF d g).val β Ideal.span (Set.range F) | |
| rw [homogeneousIdealMap_val] | |
| exact Ideal.sum_mem _ fun i _ => Ideal.mul_mem_right _ _ (Ideal.mem_span_range_self) | |
| Β· intro hp | |
| change p.val β Ideal.span (Set.range F) at hp | |
| obtain β¨g,hgβ© := Ideal.mem_span_range_iff_exists_fun.mp hp | |
| let g' : β i : E, Piece (K := K) w (d-e i) := fun i => | |
| β¨weightedHomogeneousComponent w (d-e i) (g i), | |
| weightedHomogeneousComponent_mem w (g i) (d-e i)β© | |
| refine β¨g', Subtype.ext ?_β© | |
| rw [homogeneousIdealMap_val] | |
| change β i, F i * weightedHomogeneousComponent w (d-e i) (g i) = p.val | |
| simp_rw [β project_mul w (hF _)] | |
| rw [β map_sum] | |
| simp_rw [mul_comm (F _) _] | |
| rw [hg, weightedHomogeneousComponent_eq_self p.property] | |
| lemma isWeightedHomogeneous_smul {p : MvPolynomial Ο K} {a : G} | |
| (hp : p.IsWeightedHomogeneous w a) (c : K) : | |
| (c β’ p).IsWeightedHomogeneous w a := by | |
| simpa only [Algebra.smul_def, MvPolynomial.algebraMap_eq] using hp.C_mul c | |
| lemma homogeneousIdealMap_affine (Q : E β MvPolynomial Ο K) | |
| (hQ : β i, (Q i).IsWeightedHomogeneous w (e i)) (d : G) (t : K) : | |
| homogeneousIdealMap w e (fun i => (1-t) β’ Q i + t β’ F i) | |
| (fun i => (isWeightedHomogeneous_smul w (hQ i) (1-t)).add | |
| (isWeightedHomogeneous_smul w (hF i) t)) d = | |
| (1-t) β’ homogeneousIdealMap w e Q hQ d + t β’ homogeneousIdealMap w e F hF d := by | |
| classical | |
| apply LinearMap.ext | |
| intro p | |
| apply Subtype.ext | |
| simp only [LinearMap.add_apply, LinearMap.smul_apply, Submodule.coe_add, | |
| Submodule.coe_smul] | |
| rw [homogeneousIdealMap_val, homogeneousIdealMap_val, homogeneousIdealMap_val] | |
| simp only [add_mul, smul_mul_assoc, Finset.sum_add_distrib, β Finset.smul_sum] | |
| end HomogeneousIdealMap | |
| lemma pairProduct_mem_productIdeal {K Ο G : Type*} [Field K] [AddCommGroup G] | |
| (w : Ο β G) (qs : List (FactorPair (K := K) w)) (i : Fin qs.length) : | |
| (qs.get i).left * (qs.get i).right β productIdeal w qs := by | |
| induction qs with | |
| | nil => exact Fin.elim0 i | |
| | cons q qs ih => | |
| refine Fin.cases ?_ (fun i => ?_) i | |
| Β· exact Submodule.mem_sup_left (Ideal.subset_span (Set.mem_singleton _)) | |
| Β· exact Submodule.mem_sup_right (ih i) | |
| lemma productIdeal_le {K Ο G : Type*} [Field K] [AddCommGroup G] | |
| (w : Ο β G) (qs : List (FactorPair (K := K) w)) (I : Ideal (MvPolynomial Ο K)) | |
| (h : β i : Fin qs.length, (qs.get i).left * (qs.get i).right β I) : | |
| productIdeal w qs β€ I := by | |
| induction qs with | |
| | nil => exact bot_le | |
| | cons q qs ih => | |
| exact sup_le (Ideal.span_le.mpr (Set.singleton_subset_iff.mpr (h 0))) | |
| (ih (fun i => h i.succ)) | |
| lemma productIdeal_eq_span {K Ο G : Type*} [Field K] [AddCommGroup G] | |
| (w : Ο β G) (qs : List (FactorPair (K := K) w)) : | |
| productIdeal w qs = Ideal.span (Set.range (fun i : Fin qs.length => | |
| (qs.get i).left * (qs.get i).right)) := by | |
| apply le_antisymm | |
| Β· exact productIdeal_le w qs _ (fun _ => Ideal.mem_span_range_self) | |
| Β· apply Ideal.span_le.mpr | |
| rintro _ β¨i,rflβ© | |
| exact pairProduct_mem_productIdeal w qs i | |
| end PermanentBorder.Multigraded | |
| namespace PermanentBorder.Multigraded | |
| section AffineIndependent | |
| variable {K E V : Type*} [Field K] [Fintype E] | |
| [AddCommGroup V] [Module K V] | |
| theorem affine_independent_polynomial (v w : E β V) (hv : LinearIndependent K v) : | |
| β p : Polynomial K, p.eval 0 = 1 β§ β t : K, p.eval t β 0 β | |
| LinearIndependent K (fun i => (1-t) β’ v i + t β’ w i) := by | |
| classical | |
| let f := Fintype.linearCombination K v | |
| obtain β¨g,hgβ© := f.exists_leftInverse_of_injective | |
| (LinearMap.ker_eq_bot.mpr hv.fintypeLinearCombination_injective) | |
| have hgv (i : E) : g (v i) = Pi.single i 1 := by | |
| have h := LinearMap.congr_fun hg (Pi.single i 1) | |
| simpa [f, Fintype.linearCombination_apply] using h | |
| let M : Matrix E E (Polynomial K) := fun j i => | |
| (1-Polynomial.X) * Polynomial.C (g (v i) j) + Polynomial.X * Polynomial.C (g (w i) j) | |
| have hM (t : K) : M.map (Polynomial.evalRingHom t) = | |
| (fun j i => g ((1-t) β’ v i + t β’ w i) j) := by | |
| ext j i | |
| change (Polynomial.evalRingHom t) (M j i) = _ | |
| simp [M] | |
| ring | |
| have hzero : M.map (Polynomial.evalRingHom 0) = 1 := by | |
| rw [hM] | |
| ext j i | |
| by_cases h : j = i | |
| Β· subst j; simp [hgv] | |
| Β· simp [hgv, h] | |
| refine β¨M.det, ?_, ?_β© | |
| Β· change Polynomial.evalRingHom 0 M.det = 1 | |
| rw [RingHom.map_det, RingHom.mapMatrix_apply, hzero, Matrix.det_one] | |
| Β· intro t ht | |
| have hu : IsUnit ((M.map (Polynomial.evalRingHom t)).det) := by | |
| rw [β RingHom.mapMatrix_apply, β RingHom.map_det] | |
| exact isUnit_iff_ne_zero.mpr ht | |
| have hi := (Matrix.linearIndependent_cols_iff_isUnit).mpr | |
| ((Matrix.isUnit_iff_isUnit_det _).mpr hu) | |
| apply LinearIndependent.of_comp g | |
| rw [hM] at hi | |
| exact hi | |
| end AffineIndependent | |
| end PermanentBorder.Multigraded | |
| end OAI | |