theoremlinear_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
proof · 10
lines
classical
obtain ⟨a,ha⟩ := finrank_le_one_iff.mp h
obtain ⟨b,rfl⟩ :=Submodule.Quotient.mk_surjective (linearCoefficientSubspace v I) a
choose c hc usingfun t => ha (Submodule.Quotient.mk (Pi.single t (1 : K)))
refine ⟨linearFormMap v b,c,fun t => ?_⟩
havehmem : 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
theoremvariables_mem_of_codimension_zero (v : τ → σ) (I : Ideal (MvPolynomial σ K))
(h : Module.finrank K ((τ →K) ⧸ linearCoefficientSubspace v I) = 0) :
∀ t, X (v t) ∈I:=by
proof · 10
lines
classical
intro t
havehz : 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
lemmalinearIndependent_rect_vandermonde {n N : ℕ} (hn : n ≤N)
(t : Fin n →K) (ht : Function.Injective t) :
LinearIndependentK (funi : Fin n =>funj : FinN=> t i ^ j.val) :=by
proof · 5
lines
letf : (FinN→K) →ₗ[K] Fin n →K:=LinearMap.funLeft KK (Fin.castLE hn)
apply LinearIndependent.of_comp f
exact Matrix.linearIndependent_rows_of_det_ne_zero
(Matrix.det_vandermonde_ne_zero_iff.mpr ht)
lemmalinear_block_codimension_le {σ : Type*} {n N : ℕ} (hn : n ≤N)
(v : FinN→ σ) (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 ((FinN→K) ⧸ linearCoefficientSubspace v I) + n ≤N:=by
proof · 11
lines
have hi := linearIndependent_rect_vandermonde hn t ht
havehspan : Submodule.span K (Set.range (funi : Fin n =>funj : FinN=> 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
lemmalabeled_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
proof · 10
lines
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
havehij : g (e i).val = j := (e i).property
rw [hij] at h
exact h
theoremlabeled_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 (funv : BlockVariables a => v.1)) I d) ≤if∀ j, Fintype.card {l // g l = j} = a j then1else0:=by
proof · 24
lines
classical
split_ifs with hbalanced
· have hj (j : ι) :
Module.finrank K ((Fin (a j+1) →K) ⧸ linearCoefficientSubspace (blockVar a j) I) ≤1:=byhave h := labeled_codimension a g t ht I hforms j (a j) (by omega) (by rw [hbalanced])
omega
choose z c hc usingfun j => linear_relations_of_codimension_le_one (blockVar a j) I (hj j)
exact component_finrank_le_one_of_linear_relations (funv : BlockVariables a => v.1) I z
(fun v => c v.1 v.2) (fun v => hc v.1 v.2) d
· havehs : (∑ j, Fintype.card {l // g l = j}) = ∑ j, a j :=by
rw [←Fintype.card_sigma, Fintype.card_congr (Equiv.sigmaFiberEquiv g), hcard]
havehex : ∃ 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)
havehb : ∀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 (funv : BlockVariables a => v.1) I j hb d (hd j)).le
lemmasplitBound_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
proof · 18
lines
classical
induction qs generalizing I d with
| nil =>
change pieceDim w I d = ∑c : Fin0→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]
letf : (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 _ _
lemmachoice_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
proof · 6
lines
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)
lemmamixedPolynomial_eq_choices [DecidableEqE] (u v : E→ ι) :
mixedPolynomial u v = ∑c : E→Bool,
monomial (choiceCount (fun e =>if c e then v e else u e)) (1 : ℕ) :=by
proof · 13
lines
classical
have h :=Fintype.prod_sum (fun e (b : Bool) =>if b thenX (v e) elseX (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
lemmamixed_coefficient_eq_count [Fintype ι] [DecidableEqE] (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 then1else0:=by
proof · 8
lines
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]
theoremcomparison_piece_bound (a : ι →₀ ℕ)
(qs : List (FactorPair (K:=K) (blockWeight (funv : 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 (funv : BlockVariables a => v.1))
(productIdeal (blockWeight (funv : BlockVariables a => v.1)) qs) d ≤
(mixedPolynomial u v).coeff a :=by
proof · 29
lines
classical
let w := blockWeight (funv : 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]
letg : Fin qs.length → ι :=fun i =>if c i then v i else u i
lett' : Fin qs.length →K:=fun i => t (i,c i)
haveht' : 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 :=byhave 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 :=byhave 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
lemmahomogeneousIdealMap_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
proof · 8
lines
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]
theoremaffine_independent_polynomial (v w : E→V) (hv : LinearIndependentK v) :
∃p : PolynomialK, p.eval 0 = 1∧∀t : K, p.eval t ≠0→LinearIndependentK (fun i => (1-t) • v i + t • w i) :=by
proof · 33
lines
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:=byhave h :=LinearMap.congr_fun hg (Pi.single i 1)
simpa [f, Fintype.linearCombination_apply] using h
letM : MatrixEE (PolynomialK) :=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
havehzero : 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 0M.det = 1
rw [RingHom.map_det, RingHom.mapMatrix_apply, hzero, Matrix.det_one]
· intro t ht
havehu : 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