lemmasymmetric_dot_mulVec {n : Type*} [Fintype n] [DecidableEq n]
{A : Matrix n n ℝ} (hA : A.IsHermitian) (x y : n →ℝ) : x ⬝ᵥ (A *ᵥ y)=y ⬝ᵥ (A *ᵥ x) :=by
proof · 2
lines
havehs : Aᵀ=A:=by simpa using hA.eq
rw [dotProduct_mulVec,←mulVec_transpose,hs,dotProduct_comm]
lemmamatrixChristoffel_bound {n : Type*} [Fintype n] [DecidableEq n]
{A : Matrix n n ℝ} (hA : A.PosDef) (v x : n →ℝ) :
(x ⬝ᵥ v)^2≤ matrixChristoffel A v*(x ⬝ᵥ (A *ᵥ x)) :=by
proof · 18
lines
by_cases hv : v=0
· simp [hv,matrixChristoffel]
have hK:=matrixChristoffel_pos hA hv
letu : n →ℝ:=A⁻¹ *ᵥ v
havehAu : A *ᵥ u=v :=by
dsimp [u]
rw [mulVec_mulVec,mul_nonsing_inv A (isUnit_iff_ne_zero.mpr hA.det_pos.ne'),one_mulVec]
havehKu : u ⬝ᵥ (A *ᵥ u)=matrixChristoffel A v :=by
rw [hAu,dotProduct_comm]
rfl
let t := (x ⬝ᵥ v)/matrixChristoffel A v
have hnn:=hA.posSemidef.dotProduct_mulVec_nonneg (x-t • u)
simp only [star_trivial,mulVec_sub,mulVec_smul,sub_dotProduct,dotProduct_sub,
dotProduct_smul,smul_dotProduct] at hnn
rw [symmetric_dot_mulVec hA.1 u x,hKu,hAu] at hnn
simp only [smul_eq_mul] at hnn
haveht : t*matrixChristoffel A v=x ⬝ᵥ v :=by dsimp [t];field_simp
nlinarith [mul_nonneg hK.le hnn]
lemmamatrixChristoffel_ratio_bound {n : Type*} [Fintype n] [DecidableEq n]
{A : Matrix n n ℝ} (hA : A.PosDef) (v x : n →ℝ) :
(x ⬝ᵥ v)^2/(x ⬝ᵥ (A *ᵥ x)) ≤ matrixChristoffel A v :=by
proof · 7
lines
by_cases hx : x=0
· simp only [hx,zero_dotProduct,zero_pow (byomega : 2≠0),zero_div]
by_cases hv : v=0
· simp [hv,matrixChristoffel]
· exact (matrixChristoffel_pos hA hv).le
havehp : 0<x ⬝ᵥ (A *ᵥ x) :=by simpa only [star_trivial] using hA.dotProduct_mulVec_pos hx
exact (div_le_iff₀ hp).mpr (matrixChristoffel_bound hA v x)
lemmamatrixChristoffel_ratio_attained {n : Type*} [Fintype n] [DecidableEq n]
{A : Matrix n n ℝ} (hA : A.PosDef) (v : n →ℝ) :
∃x : n →ℝ,(x ⬝ᵥ v)^2/(x ⬝ᵥ (A *ᵥ x))=matrixChristoffel A v :=by
proof · 7
lines
by_cases hv : v=0
· refine ⟨0,?_⟩
simp [hv,matrixChristoffel]
refine ⟨A⁻¹ *ᵥ v,?_⟩
rw [mulVec_mulVec,mul_nonsing_inv A (isUnit_iff_ne_zero.mpr hA.det_pos.ne'),one_mulVec,dotProduct_comm (A⁻¹ *ᵥ v) v]
change (matrixChristoffel A v)^2/matrixChristoffel A v=matrixChristoffel A v
rw [pow_two,mul_div_cancel_right₀ _ (matrixChristoffel_pos hA hv).ne']
lemmamatrixChristoffel_variational {n : Type*} [Fintype n] [DecidableEq n]
{A : Matrix n n ℝ} (hA : A.PosDef) (v : n →ℝ) :
sSup {r : ℝ | ∃x : n →ℝ,r=(x ⬝ᵥ v)^2/(x ⬝ᵥ (A *ᵥ x))}=matrixChristoffel A v :=by
proof · 10
lines
obtain ⟨x,hx⟩:=matrixChristoffel_ratio_attained hA v
havehm : matrixChristoffel A v ∈ {r : ℝ | ∃x : n →ℝ,r=(x ⬝ᵥ v)^2/(x ⬝ᵥ (A *ᵥ x))} := ⟨x,hx.symm⟩
havehb : BddAbove {r : ℝ | ∃x : n →ℝ,r=(x ⬝ᵥ v)^2/(x ⬝ᵥ (A *ᵥ x))} :=by
refine ⟨matrixChristoffel A v,?_⟩
rintro _ ⟨y,rfl⟩
exact matrixChristoffel_ratio_bound hA v y
apply le_antisymm _ (le_csSup hb hm)
apply csSup_le ⟨_,hm⟩
rintro _ ⟨y,rfl⟩
exact matrixChristoffel_ratio_bound hA v y
lemmamatrixChristoffel_first_cofactor {n : ℕ} (A : Matrix (Fin (n+1)) (Fin (n+1)) ℝ) :
matrixChristoffel A (Pi.single 01)=(A.submatrix Fin.succ Fin.succ).det/A.det :=by
proof · 4
lines
rw [matrixChristoffel_single,Matrix.inv_def]
simp only [Matrix.smul_apply,smul_eq_mul,Ring.inverse_eq_inv,adjugate_fin_succ_eq_det_submatrix,
Fin.val_zero,add_zero,pow_zero,one_mul,Fin.succAbove_zero]
ring
lemmamatrixChristoffel_congruence {n : Type*} [Fintype n] [DecidableEq n]
(AT : Matrix n n ℝ) (hT : IsUnitT.det) (v : n →ℝ) :
matrixChristoffel (T*A*Tᵀ) (T *ᵥ v)=matrixChristoffel A v :=by
proof · 7
lines
have hleft (u : n →ℝ) : (T *ᵥ v) ⬝ᵥ ((Tᵀ)⁻¹ *ᵥ u)=v ⬝ᵥ u :=by
rw [dotProduct_mulVec,←mulVec_transpose,←transpose_nonsing_inv,transpose_transpose,
mulVec_mulVec,nonsing_inv_mul T hT,one_mulVec]
unfold matrixChristoffel
rw [Matrix.mul_inv_rev,Matrix.mul_inv_rev]
simp only [←mulVec_mulVec]
rw [mulVec_mulVec v T⁻¹T,nonsing_inv_mul T hT,one_mulVec,hleft]
lemmamonomialGram_quadratic {n : ℕ} (w : ℝ→ℝ)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0)) (a : Fin n →ℝ) :
a ⬝ᵥ ((monomialGram n w) *ᵥ a)=∫ p inSet.Ioi (0:ℝ),(Polynomial.ofFn n a).eval (p^2)^2*w p :=by
proof · 15
lines
havehpair i j : IntegrableOn (funp : ℝ=>a i*((p^2)^i.val*(p^2)^j.val*w p)*a j) (Set.Ioi0) :=
(monomial_pair_integrable w hi i.val j.val).const_mul (a i) |>.mul_const (a j)
havehe p : (Polynomial.ofFn n a).eval (p^2)^2*w p=
∑i : Fin n,∑j : Fin n,a i*((p^2)^i.val*(p^2)^j.val*w p)*a j :=by
rw [ofFn_eval_eq_dot,pow_two]
simp only [dotProduct,monomialVector,sum_mul,mul_sum]
apply sum_congr rfl
intro i _
apply sum_congr rfl
intro j _
ring
simp_rw [he]
rw [integral_finsetSum _ (fun i _=>integrable_finsetSum _ (fun j _=>hpair i j))]
simp_rw [integral_finsetSum _ (fun j _=>hpair _ j),integral_mul_const,integral_const_mul]
simp [dotProduct,mulVec,monomialGram,mul_sum,mul_assoc]
lemmamonomialGram_norm_integrable {n : ℕ} (w : ℝ→ℝ)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0)) (a : Fin n →ℝ) :
IntegrableOn (funp : ℝ=>(Polynomial.ofFn n a).eval (p^2)^2*w p) (Set.Ioi0) :=by
proof · 12
lines
havehe p : (Polynomial.ofFn n a).eval (p^2)^2*w p=
∑i : Fin n,∑j : Fin n,a i*((p^2)^i.val*(p^2)^j.val*w p)*a j :=by
rw [ofFn_eval_eq_dot,pow_two]
simp only [dotProduct,monomialVector,sum_mul,mul_sum]
apply sum_congr rfl
intro i _
apply sum_congr rfl
intro j _
ring
simp_rw [he]
exact integrable_finsetSum _ (fun i _=>integrable_finsetSum _ (fun j _=>
(monomial_pair_integrable w hi i.val j.val).const_mul (a i) |>.mul_const (a j)))
apply Matrix.PosDef.of_dotProduct_mulVec_pos
· rw [Matrix.isHermitian_iff_isSymm]
ext i j
dsimp [monomialGram,Matrix.transpose]
congr 1
funext p
ring
· intro a ha
simp only [star_trivial,monomialGram_quadratic w hi]
havehP : Polynomial.ofFn n a ≠0:=fun h=>ha ((Polynomial.injective_ofFn n) (by simpa using h))
havehae : ∀ᵐ p : ℝ ∂volume.restrict (Set.Ioi (0:ℝ)),0<(Polynomial.ofFn n a).eval (p^2)^2*w p :=by
filter_upwards [ae_restrict_mem measurableSet_Ioi,polynomial_square_eval_ae_ne_zero hP] with p hp hn
exact mul_pos (sq_pos_of_ne_zero hn) (hw p hp)
apply (integral_pos_iff_support_of_nonneg_ae (hae.mono fun _ h=>h.le) (monomialGram_norm_integrable w hi a)).mpr
havehs : Function.support (funp : ℝ=>(Polynomial.ofFn n a).eval (p^2)^2*w p)=ᵐ[volume.restrict (Set.Ioi (0:ℝ))] Set.univ :=by
filter_upwards [hae] with p hp
exact propext (iff_of_true hp.ne' trivial)
rw [measure_congr hs]
simp
lemmarootBasisMatrix_det (n : ℕ) (a : ℝ) : (rootBasisMatrix n a).det=1:=by
proof · 19
lines
haveht : (rootBasisMatrix n a).IsLowerTriangular:=by
intro i j hij
change i < j at hij
cases i usingFin.cases with
| zero =>
simp only [rootBasisMatrix,Fin.cases_zero,Pi.single_apply]
rw [ite_eq_right (by simp only [Fin.lt_def,Fin.ext_iff,Fin.val_zero] at *; omega)]
| succ i =>haveh1 : i.succ ≠ j := ne_of_lt hij
haveh2 : i.castSucc ≠ j := ne_of_lt (i.castSucc_lt_succ.trans hij)
simp [rootBasisMatrix,h1,h2]
rw [Matrix.det_of_isLowerTriangular _ ht]
have hd (i : Fin (n+1)) : rootBasisMatrix n a i i=1:=by
cases i usingFin.cases with
| zero => simp [rootBasisMatrix]
| succ i =>havehne : i.castSucc ≠ i.succ := ne_of_lt i.castSucc_lt_succ
simp [rootBasisMatrix,hne]
simp only [hd,prod_const_one]
lemmamonomialGram_congruence_entry {n : ℕ} (w : ℝ→ℝ)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0))
(T : Matrix (Fin n) (Fin n) ℝ) (i j : Fin n) :
(T*monomialGram n w*Tᵀ) i j=
∫ p inSet.Ioi (0:ℝ),(T *ᵥ monomialVector n (p^2)) i*(T *ᵥ monomialVector n (p^2)) j*w p :=by
proof · 16
lines
havehpair k l : IntegrableOn (funp : ℝ=>T i k*((p^2)^k.val*(p^2)^l.val*w p)*T j l) (Set.Ioi0) :=
(monomial_pair_integrable w hi k.val l.val).const_mul (T i k) |>.mul_const (T j l)
havehe p : (T *ᵥ monomialVector n (p^2)) i*(T *ᵥ monomialVector n (p^2)) j*w p=
∑k : Fin n,∑l : Fin n,T i k*((p^2)^k.val*(p^2)^l.val*w p)*T j l :=by
simp only [mulVec,dotProduct,monomialVector,sum_mul,mul_sum]
rw [sum_comm]
apply sum_congr rfl
intro k _
apply sum_congr rfl
intro l _
ring
simp_rw [he]
rw [integral_finsetSum _ (fun k _=>integrable_finsetSum _ (fun l _=>hpair k l))]
simp_rw [integral_finsetSum _ (fun l _=>hpair _ l),integral_mul_const,integral_const_mul]
simp only [Matrix.mul_apply,transpose_apply,monomialGram,sum_mul]
rw [sum_comm]
lemmarootBasisGram_minor (n : ℕ) (a : ℝ) (w : ℝ→ℝ)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0)) :
(rootBasisMatrix n a*monomialGram (n+1) w*(rootBasisMatrix n a)ᵀ).submatrix Fin.succ Fin.succ=
monomialGram n (fun p=>(p^2-a)^2*w p) :=by
proof · 6
lines
ext i j
rw [Matrix.submatrix_apply,monomialGram_congruence_entry w hi]
simp_rw [rootBasisMatrix_eval_succ]
apply integral_congr_ae
filter_upwards with p
ring
Gram cofactor identity used in the manuscript's polynomial comparison.
theorempolynomial_compression_cofactor (n : ℕ) (a : ℝ) (w : ℝ→ℝ)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0)) :
(monomialGram n (fun p=>(p^2-a)^2*w p)).det/(monomialGram (n+1) w).det=
matrixChristoffel (monomialGram (n+1) w) (monomialVector (n+1) a) :=by
proof · 5
lines
havehdet : IsUnit (rootBasisMatrix n a).det :=by rw [rootBasisMatrix_det];exact isUnit_one
have h:=matrixChristoffel_congruence (monomialGram (n+1) w) (rootBasisMatrix n a) hdet (monomialVector (n+1) a)
rw [rootBasisMatrix_eval_self,matrixChristoffel_first_cofactor,rootBasisGram_minor n a w hi,
det_mul,det_mul,det_transpose,rootBasisMatrix_det,one_mul,mul_one] at h
exact h
lemmaweightedPolynomial_ratio_bound (n : ℕ) (x : ℝ) (w : ℝ→ℝ)
(hw : ∀ p,0<p →0<w p)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0))
(P : Polynomialℝ) (hP : P.natDegree≤n) :
P.eval x^2/weightedPolynomialNorm w P≤weightedPolynomialChristoffel w n x :=by
proof · 5
lines
rw [weightedPolynomialChristoffel_eq n x w hw hi]
have he :=Polynomial.ofFn_comp_toFn_eq_id_of_natDegree_lt (Nat.lt_succ_of_le hP)
have h:=matrixChristoffel_ratio_bound (monomialGram_posDef (n+1) w hw hi) (monomialVector (n+1) x) (P.toFn (n+1))
rw [monomialGram_quadratic w hi,←ofFn_eval_eq_dot,he] at h
exact h
lemmaweightedPolynomial_ratio_attained (n : ℕ) (x : ℝ) (w : ℝ→ℝ)
(hw : ∀ p,0<p →0<w p)
(hi : ∀k : ℕ,IntegrableOn (funp : ℝ=>p^k*w p) (Set.Ioi0)) :
∃P : Polynomialℝ,P.natDegree≤n ∧P.eval x^2/weightedPolynomialNorm w P=weightedPolynomialChristoffel w n x :=by
proof · 5
lines
rw [weightedPolynomialChristoffel_eq n x w hw hi]
obtain ⟨a,ha⟩:=matrixChristoffel_ratio_attained (monomialGram_posDef (n+1) w hw hi) (monomialVector (n+1) x)
refine ⟨Polynomial.ofFn (n+1) a,Nat.le_of_lt_succ (Polynomial.ofFn_natDegree_lt (by omega) a),?_⟩
rw [monomialGram_quadratic w hi,←ofFn_eval_eq_dot] at ha
exact ha
have he :=Polynomial.ofFn_comp_toFn_eq_id_of_natDegree_lt (Nat.lt_succ_self P.natDegree)
haveha : P.toFn (P.natDegree+1)≠0:=by
intro h
rw [h] at he
exact hP (by simpa using he.symm)
have h := (monomialGram_posDef (P.natDegree+1) w hw hi).dotProduct_mulVec_pos ha
simpa only [star_trivial,monomialGram_quadratic w hi,he,weightedPolynomialNorm] using h