intro u hu v hv a b ha hb hab
obtain ⟨x,hx,hxu⟩ := hu
obtain ⟨y,hy,hyv⟩ := hv
refine ⟨a • x+b • y,hS hx hy ha hb hab,?_⟩
intro i
have hf := (hF i).2 hx hy ha hb hab
change F i (a • x+b • y) < a*u i+b*v i
change F i (a • x+b • y) ≤ a*F i x+b*F i y at hf
havehlt : a*F i x+b*F i y < a*u i+b*v i :=byby_cases ha0 : a=0
· havehb1 : b=1:=by linarith
simpa [ha0,hb1] using hyv i
· havehapos : 0 < a := lt_of_le_of_ne ha (Ne.symm ha0)
exact add_lt_add_of_lt_of_le (mul_lt_mul_of_pos_left (hxu i) hapos)
(mul_le_mul_of_nonneg_left (hyv i).le hb)
exact hf.trans_lt hlt
lemmafunctional_coordinates (l : (I→ℝ) →L[ℝ] ℝ) (v : I→ℝ) :
l v = ∑i, l (Pi.single i 1)*v i :=by
proof · 11
lines
havehe : v=∑i, v i • Pi.single i (1:ℝ) :=by
funext j
simp [Pi.single_apply]
calc
l v = l (∑i, v i • Pi.single i (1:ℝ)) := congrArg l he
_ = ∑i, l (Pi.single i 1)*v i :=by
rw [map_sum]
apply sum_congr rfl
intro i _
rw [map_smul]
simp only [smul_eq_mul,mul_comm]
lemmaslater_certificate (S : SetE) (hS : ConvexℝS)
(f : I→E→ℝ) (g : J→E→ℝ)
(hf : ∀i, ConvexOnℝS (f i)) (hg : ∀j, ConvexOnℝS (g j))
(hslater : ∃x ∈S, ∀j, g j x < 0) (K : ℝ)
(hinfeasible : ¬∃x ∈S, (∀i, f i x < K) ∧ (∀j, g j x < 0)) :
∃lam : I→ℝ, ∃y : J→ℝ, (∀i, 0≤ lam i) ∧ (∑i, lam i)=1∧
(∀j, 0≤ y j) ∧∀x ∈S, K≤ (∑i, lam i*f i x)+(∑j, y j*g j x) :=by
proof · 46
lines
letF : I ⊕ J→E→ℝ:=Sum.elim (fun i x => f i x-K) g
havehF : ∀i, ConvexOnℝS (F i) :=by
intro i
cases i with
| inl i =>
refine ⟨hS,?_⟩
intro x hx y hy a b ha hb hab
have hh := (hf i).2 hx hy ha hb hab
change f i (a • x+b • y)-K≤ a*(f i x-K)+b*(f i y-K)
change f i (a • x+b • y) ≤ a*f i x+b*f i y at hh
nlinarith only [hh,congrArg (funz : ℝ=> z*K) hab]
| inr j => exact hg j
havehnone : ¬∃x ∈S, ∀i, F i x < 0:=by
intro ⟨x,hx,h⟩
apply hinfeasible
exact ⟨x,hx,fun i => sub_neg.mp (h (Sum.inl i)),fun j => h (Sum.inr j)⟩
obtain ⟨x₀,hx₀,hg₀⟩ := hslater
obtain ⟨w,hw,hws,hwb⟩ := convex_alternative S hS ⟨x₀,hx₀⟩ F hF hnone
let p :=∑i, w (Sum.inl i)
havehpnon : 0≤ p := sum_nonneg (fun i _ => hw (Sum.inl i))
havehsum : p+(∑j, w (Sum.inr j))=1:=by simpa only [p,Fintype.sum_sum_type] using hws
havehp : 0 < p :=by
by_contra hh
havehp0 : p=0:= le_antisymm (le_of_not_gt hh) hpnon
havehwi0 : ∀i, w (Sum.inl i)=0:=fun i =>
(sum_eq_zero_iff_of_nonneg (fun i _ => hw (Sum.inl i))).mp hp0 i (mem_univ i)
havehjpos : 0 < ∑j, w (Sum.inr j) :=by linarith only [hsum,hp0]
obtain ⟨j,hj,hjpos⟩ := (sum_pos_iff_of_nonneg (fun j _ => hw (Sum.inr j))).mp hjpos
havehgneg : (∑j, w (Sum.inr j)*g j x₀) < 0:=by
apply sum_neg' (fun j _ => mul_nonpos_of_nonneg_of_nonpos (hw (Sum.inr j)) (hg₀ j).le)
exact ⟨j,mem_univ j,mul_neg_of_pos_of_neg hjpos (hg₀ j)⟩
have hh := hwb x₀ hx₀
simp only [Fintype.sum_sum_type,F,Sum.elim_inl,Sum.elim_inr,hwi0,zero_mul,sum_const_zero,zero_add] at hh
linarith only [hh,hgneg]
refine ⟨fun i => w (Sum.inl i)/p,fun j => w (Sum.inr j)/p,
fun i => div_nonneg (hw (Sum.inl i)) hp.le,?_,
fun j => div_nonneg (hw (Sum.inr j)) hp.le,?_⟩
· rw [←sum_div]
exact div_self hp.ne'
· intro x hx
have hh := hwb x hx
simp only [Fintype.sum_sum_type,F,Sum.elim_inl,Sum.elim_inr,mul_sub,sum_sub_distrib,←sum_mul] at hh
simp only [div_mul_eq_mul_div,←sum_div,←add_div]
apply (le_div_iff₀ hp).mpr
change 0≤ (∑i, w (Sum.inl i)*f i x)-p*K+(∑j, w (Sum.inr j)*g j x) at hh
linarith only [hh]
lemmastrict_feasible_of_dual_bound (S : SetE) (hS : ConvexℝS)
(f : I→E→ℝ) (g : J→E→ℝ)
(hf : ∀i, ConvexOnℝS (f i)) (hg : ∀j, ConvexOnℝS (g j))
(hslater : ∃x ∈S, ∀j, g j x < 0) (K : ℝ)
(hdual : ∀lam : I→ℝ, ∀y : J→ℝ, (∀i, 0≤ lam i) → (∑i, lam i)=1→
(∀j, 0≤ y j) →∃x ∈S, (∑i, lam i*f i x)+(∑j, y j*g j x) < K) :
∃x ∈S, (∀i, f i x < K) ∧ (∀j, g j x < 0) :=by
proof · 4
lines
by_contra hh
obtain ⟨lam,y,hlam,hlams,hy,hbound⟩ := slater_certificate S hS f g hf hg hslater K hh
obtain ⟨x,hx,hval⟩ := hdual lam y hlam hlams hy
exact (not_lt_of_ge (hbound x hx)) hval
lemmainverse_quadratic_variational {D : MatrixVVℝ} (hD : D.PosDef) (b x : V→ℝ) :
2*(b ⬝ᵥ x)-x ⬝ᵥ (D *ᵥ x) ≤ b ⬝ᵥ (D⁻¹ *ᵥ b) :=by
proof · 8
lines
let y :=D⁻¹ *ᵥ b
havehDy : D *ᵥ y=b := solve hD b
havehs : y ⬝ᵥ (D *ᵥ x)=x ⬝ᵥ b :=by rw [quadratic_symm hD.isHermitian,hDy]
have hh := hD.posSemidef.dotProduct_mulVec_nonneg (x-y)
simp only [star_trivial,mulVec_sub,sub_dotProduct,dotProduct_sub,hDy,hs,
dotProduct_comm x b,dotProduct_comm y b] at hh
change 2*(b ⬝ᵥ x)-x ⬝ᵥ (D *ᵥ x) ≤ b ⬝ᵥ y
linarith only [hh]
intro X hX Y hY a b ha hb hab
by_cases ha0 : a=0
· havehb1 : b=1:=by linarith only [hab,ha0]
simpa [ha0,hb1] using hY
· exact (hX.smul (lt_of_le_of_ne ha (Ne.symm ha0))).add_posSemidef (hY.posSemidef.smul hb)
refine ⟨posDef_convex,?_⟩
intro X hX Y hY a b ha hb hab
simp only [add_mulVec,smul_mulVec,dotProduct_add,dotProduct_smul,smul_eq_mul]
nlinarith only [congrArg (funt : ℝ=> t*c) hab]
lemmatraceRoot_tendsto {I : Type uI3} {l : FilterI} {AZ : MatrixVVℝ}
(hA : A.PosSemidef) (hZ : Z.PosSemidef) {f g : I→MatrixVVℝ}
(hf : Tendsto f l (𝓝 A)) (hg : Tendsto g l (𝓝 Z))
(hfp : ∀ᶠ i in l, (f i).PosSemidef) (hgp : ∀ᶠ i in l, (g i).PosSemidef) :
Tendsto (fun i =>2*(CFC.sqrt (CFC.sqrt (g i)*f i*CFC.sqrt (g i))).trace) l
(𝓝 (2*(CFC.sqrt (CFC.sqrt Z*A*CFC.sqrt Z)).trace)) :=by
proof · 11
lines
have hs := sqrt_tendsto hZ hg hgp
havehp : (CFC.sqrt Z*A*CFC.sqrt Z).PosSemidef:=by
simpa only [(CFC.sqrt_nonneg Z).posSemidef.isHermitian.eq] using
hA.conjTranspose_mul_mul_same (CFC.sqrt Z)
havehps : ∀ᶠ i in l, (CFC.sqrt (g i)*f i*CFC.sqrt (g i)).PosSemidef:=by
filter_upwards [hfp] with i hi
simpa only [(CFC.sqrt_nonneg (g i)).posSemidef.isHermitian.eq] using
hi.conjTranspose_mul_mul_same (CFC.sqrt (g i))
have ht := sqrt_tendsto hp ((hs.mul hf).mul hs) hps
have htr := (continuous_id.matrix_trace.tendsto _).comp ht
exact htr.const_mul 2
lemmanorm_sq_mulVec_le {U : MatrixWVℝ} (hU : Uᵀ*U≤1) (x : V→ℝ) :
(U *ᵥ x) ⬝ᵥ (U *ᵥ x) ≤ x ⬝ᵥ x :=by
proof · 6
lines
have hp := (Matrix.le_iff.mp hU).dotProduct_mulVec_nonneg x
simp only [star_trivial,sub_mulVec,one_mulVec,dotProduct_sub] at hp
haveheq : x ⬝ᵥ ((Uᵀ*U) *ᵥ x)=(U *ᵥ x) ⬝ᵥ (U *ᵥ x) :=by
rw [←mulVec_mulVec,dotProduct_mulVec,vecMul_transpose]
rw [heq] at hp
linarith only [hp]
lemmapositive_optimizer (M : MatrixVWℝ) (w : W→ℝ) (hw : ∀e, 0≤ w e) :
∃U : MatrixWVℝ, Uᵀ*U≤1∧ (∀e, 0≤ (U*M) e e) ∧
(CFC.sqrt ((M*diagonal w)*(M*diagonal w)ᵀ)).trace ≤∑e, w e*(U*M) e e :=by
proof · 32
lines
obtain ⟨U,hU,htr⟩ := polar_optimizer (M*diagonal w)
leta : W→ℝ:=fun e => (U*M) e e
lets : W→ℝ:=fun e =>if0≤ a e then1else -1letD : MatrixWWℝ:= diagonal s
havehDD : Dᵀ*D=1:= signed_diag_orthogonal a
have hsa (e : W) : s e*a e=|a e| :=by
dsimp [s]
split_ifs with he
· simp [abs_of_nonneg he]
· simp [abs_of_neg (lt_of_not_ge he)]
have hdiag (e : W) : ((D*U)*M) e e=|a e| :=by
rw [Matrix.mul_assoc]
change (diagonal s*(U*M)) e e=|a e|
rw [diagonal_mul]
exact hsa e
refine ⟨D*U,?_,fun e => (hdiag e).symm ▸ abs_nonneg _,?_⟩
· haveheq : (D*U)ᵀ*(D*U)=Uᵀ*U:=by
rw [transpose_mul]
calc
(Uᵀ*Dᵀ)*(D*U)=Uᵀ*(Dᵀ*D)*U:=by simp only [Matrix.mul_assoc]
_=Uᵀ*U:=by rw [hDD,Matrix.mul_one]
rw [heq]
exact hU
· rw [←htr,←Matrix.mul_assoc]
unfold Matrix.trace
apply sum_le_sum
intro e _
change (U*M*diagonal w) e e ≤ w e*((D*U)*M) e e
rw [mul_diagonal,hdiag]
change a e*w e ≤ w e*|a e|
rw [mul_comm (a e)]
exact mul_le_mul_of_nonneg_left (le_abs_self _) (hw e)
lemmaboundaryAverage_convex (b : E→V→ℝ) (O : T→FinsetE) (t : T) :
ConvexOnℝ {D : MatrixVVℝ | D.PosDef} (boundaryAverage b O t) :=by
proof · 9
lines
refine ⟨MatrixDual.posDef_convex,?_⟩
intro X hX Y hY a a' ha ha' haa'
have hs := sum_le_sum (fun e (_ : e ∈O t) =>
(MatrixDual.inverse_quadratic_convex (b e)).2 hX hY ha ha' haa')
dsimp [boundaryAverage]
simp only [smul_eq_mul] at hs ⊢have h := mul_le_mul_of_nonneg_left hs (inv_nonneg.mpr (Nat.cast_nonneg (O t).card) :
0≤ ((O t).card : ℝ)⁻¹)
simpa only [sum_add_distrib,←mul_sum,mul_add,mul_left_comm] using h
lemmatrace_objectiveMatrix (b : E→V→ℝ) (O : T→FinsetE)
(lam : T→ℝ) (D : MatrixVVℝ) :
(objectiveMatrix b O lam * D⁻¹).trace = ∑t, lam t * boundaryAverage b O t D:=by
proof · 2
lines
simp only [objectiveMatrix,Finset.sum_mul,smul_mul_assoc,trace_sum,trace_smul,
boundaryMatrix,boundaryAverage,smul_eq_mul,trace_outer_mul]
lemmashortcut_of_trace_bound (b : E→V→ℝ) (O : T→FinsetE)
(c : J→V→ℝ) (d : J→ℝ) (hd : ∀j, 0 < d j) {K : ℝ} (hK : 0≤K)
(hbound : ∀lam : T→ℝ, ∀y : J→ℝ, (∀t, 0≤ lam t) → (∑t, lam t)=1→
(∀j, 0≤ y j) →
(CFC.sqrt (CFC.sqrt (cutMatrix c y) * objectiveMatrix b O lam *
CFC.sqrt (cutMatrix c y))).trace^2≤K * ∑j, y j*d j)
{eta : ℝ} (heta : 0 < eta) :
∃D : MatrixVVℝ, D.PosDef∧
(∀t, boundaryAverage b O t D < K+eta) ∧ (∀j, c j ⬝ᵥ (D *ᵥ c j) < d j) :=by
proof · 23
lines
have hs :=Duality.strict_feasible_of_dual_bound {D : MatrixVVℝ | D.PosDef}
MatrixDual.posDef_convex (boundaryAverage b O) (fun j D=> c j ⬝ᵥ (D *ᵥ c j)-d j)
(boundaryAverage_convex b O) (fun j =>MatrixDual.cut_quadratic_convex (c j) (d j))
(cut_slater c hd) (K+eta)
obtain ⟨D,hD,hf,hg⟩ := hs (by
intro lam y hlam hlams hy
letA:= objectiveMatrix b O lam
letZ:= cutMatrix c y
letN:= (CFC.sqrt (CFC.sqrt Z*A*CFC.sqrt Z)).trace
let v :=∑j, y j*d j
havehv : 0≤ v := sum_nonneg (fun j _ => mul_nonneg (hy j) (hd j).le)
havehN : 0≤N:= (CFC.sqrt_nonneg _).posSemidef.trace_nonneg
havehb : N^2≤K*v := hbound lam y hlam hlams hy
havehNv : 2*N≤K+v :=by nlinarith only [hb,hK,hv,hN,sq_nonneg (K-v)]
obtain ⟨D,hD,hval⟩ :=MatrixDual.trace_objective_approx
(objectiveMatrix_posSemidef b O hlam) (cutMatrix_posSemidef c hy)
(show2*N < K+eta+v by linarith only [hNv,heta])
refine ⟨D,hD,?_⟩
have htr := trace_cutMatrix c y d D
rw [trace_objectiveMatrix] at hval
change (∑t,lam t*boundaryAverage b O t D) + (cutMatrix c y*D).trace < K+eta+v at hval
linarith only [hval,htr])
exact ⟨D,hD,hf,fun j => sub_neg.mp (hg j)⟩
lemmaweighted_rows_bound (O : T→FinsetE) (lam : T→ℝ) (a : E→ℝ)
(hlam : ∀t, 0≤ lam t) (hsum : (∑t, lam t)=1) (ha : ∀e, 0≤ a e) :
(∑e, Real.sqrt (∑t, if e ∈O t then lam t / ((O t).card : ℝ) else0)*a e)^2≤∑t, (∑e ∈O t, a e)^2/((O t).card : ℝ) :=by
proof · 43
lines
letr : T→ℝ:=fun t =>Real.sqrt (lam t / ((O t).card : ℝ))
letc : T→ℝ:=fun t => (∑e ∈O t, a e)/Real.sqrt ((O t).card : ℝ)
have hw (e : E) : Real.sqrt (∑t, if e ∈O t then lam t / ((O t).card : ℝ) else0) ≤∑t, if e ∈O t then r t else0:=by
apply Real.sqrt_le_iff.mpr
refine ⟨sum_nonneg (fun t _ =>by split_ifs; exact Real.sqrt_nonneg _; exact le_rfl), ?_⟩
calc
(∑t, if e ∈O t then lam t / ((O t).card : ℝ) else0) =
∑t, (if e ∈O t then r t else0)^2:=by
apply sum_congr rfl
intro t _
split_ifs
· exact (Real.sq_sqrt (div_nonneg (hlam t) (Nat.cast_nonneg _))).symm
· norm_num
_ ≤ _ := sum_sq_le_sq_sum_of_nonneg (fun t _ =>by split_ifs; exact Real.sqrt_nonneg _; exact le_rfl)
haveheq : (∑e, (∑t, if e ∈O t then r t else0)*a e) =
∑t, Real.sqrt (lam t)*c t :=by
simp_rw [sum_mul]
rw [sum_comm]
apply sum_congr rfl
intro t _
calc
(∑e, (if e ∈O t then r t else0)*a e) = r t*∑e ∈O t, a e :=by
rw [mul_sum]
simp only [ite_mul,zero_mul]
rw [←sum_filter]
simp
_ = Real.sqrt (lam t)*c t :=by
dsimp [r,c]
rw [Real.sqrt_div (hlam t)]
ring
have hle := sum_le_sum (fun e (_ : e ∈ (univ : FinsetE)) =>
mul_le_mul_of_nonneg_right (hw e) (ha e))
rw [heq] at hle
have hsq := pow_le_pow_left₀ (sum_nonneg (fun e _ =>
mul_nonneg (Real.sqrt_nonneg _) (ha e))) hle 2have hc := sum_mul_sq_le_sq_mul_sq univ (fun t =>Real.sqrt (lam t)) c
havehs : (∑t, (Real.sqrt (lam t))^2)=1:=by simpa only [Real.sq_sqrt (hlam _)] using hsum
rw [hs,one_mul] at hc
refine hsq.trans (hc.trans_eq ?_)
apply sum_congr rfl
intro t _
simp only [c,div_pow,Real.sq_sqrt (Nat.cast_nonneg _)]
lemmaobjectiveMatrix_eq_sum_edges (b : E→V→ℝ) (O : T→FinsetE) (lam : T→ℝ) :
objectiveMatrix b O lam = ∑e, (∑t, if e ∈O t then lam t / ((O t).card : ℝ) else0) •
vecMulVec (b e) (b e) :=by
proof · 8
lines
have ht (t : T) : lam t • boundaryMatrix b O t =
∑e, (if e ∈O t then lam t / ((O t).card : ℝ) else0) • vecMulVec (b e) (b e) :=by
simp only [boundaryMatrix,smul_smul,div_eq_mul_inv,smul_sum,ite_smul,zero_smul]
rw [←sum_filter]
simp
simp only [objectiveMatrix,ht]
rw [sum_comm]
simp only [sum_smul]
lemmaweighted_gram (b : E→V→ℝ) (w : E→ℝ) :
letB : MatrixVEℝ:=fun v e => b e v
proof · 9
lines
(B*diagonal w)*(B*diagonal w)ᵀ=∑e, (w e)^2 • vecMulVec (b e) (b e) :=by
dsimp
ext i j
change (∑e, ((Matrix.of (fun v e => b e v))*diagonal w) i e *
((Matrix.of (fun v e => b e v))*diagonal w) j e) = _
simp only [mul_diagonal,Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,vecMulVec_apply,Matrix.of_apply]
apply sum_congr rfl
intro e _
ring
lemmanuclear_bound_of_embedding_bound (b : E→V→ℝ) (O : T→FinsetE)
{H : Type uH} [FintypeH] [DecidableEqH] (X : MatrixHVℝ) {K : ℝ}
(hbound : ∀U : MatrixEHℝ, Uᵀ*U≤1→ (∀e, 0≤ (U*(X*(Matrix.of (fun v e => b e v)))) e e) →
(∑t, (∑e ∈O t, (U*(X*(Matrix.of (fun v e => b e v)))) e e)^2/((O t).card : ℝ)) ≤K)
{lam : T→ℝ} (hlam : ∀t, 0≤ lam t) (hsum : (∑t, lam t)=1) :
(CFC.sqrt (CFC.sqrt (Xᵀ*X)*objectiveMatrix b O lam*CFC.sqrt (Xᵀ*X))).trace^2≤K:=by
proof · 10
lines
letB : MatrixVEℝ:=fun v e => b e v
let w := edgeWeight O lam
havehw : ∀e, 0≤ w e :=fun e =>Real.sqrt_nonneg _
obtain ⟨U,hU,hpos,htr⟩ :=Polar.positive_optimizer (X*B) w hw
rw [objectiveMatrix_gram b O hlam,Polar.dual_trace_rectangular]
change (CFC.sqrt ((X*(B*diagonal w))*(X*(B*diagonal w))ᵀ)).trace^2≤K
rw [←Matrix.mul_assoc]
have hsq := pow_le_pow_left₀ (CFC.sqrt_nonneg _).posSemidef.trace_nonneg htr 2
exact hsq.trans ((weighted_rows_bound O lam (fun e => (U*(X*B)) e e) hlam hsum hpos).trans
(hbound U hU hpos))
lemmatrace_bound_of_nat_weights {A : MatrixVVℝ} (hA : A.PosSemidef)
(c : J→V→ℝ) (d : J→ℝ) (K : ℝ)
(hb : ∀a : J→ℕ,
(CFC.sqrt (CFC.sqrt (cutMatrix c (fun j => (a j : ℝ)))*A*
CFC.sqrt (cutMatrix c (fun j => (a j : ℝ))))).trace^2≤K*∑j, (a j : ℝ)*d j)
{y : J→ℝ} (hy : ∀j, 0≤ y j) :
(CFC.sqrt (CFC.sqrt (cutMatrix c y)*A*CFC.sqrt (cutMatrix c y))).trace^2≤K*∑j, y j*d j :=by
proof · 25
lines
leta : ℝ→J→ℕ:=fun t j => ⌊y j*t⌋₊
letz : ℝ→J→ℝ:=fun t j => (a t j : ℝ)/t
have hz (j : J) : Tendsto (fun t => z t j) atTop (𝓝 (y j)) :=
tendsto_nat_floor_mul_div_atTop (hy j)
havehg : Tendsto (fun t => cutMatrix c (z t)) atTop (𝓝 (cutMatrix c y)) :=
tendsto_finsetSum univ (fun j _ => (hz j).smul_const (vecMulVec (c j) (c j)))
havehgp : ∀ᶠ t in atTop, (cutMatrix c (z t)).PosSemidef:=by
filter_upwards [eventually_gt_atTop (0:ℝ)] with t ht
exact cutMatrix_posSemidef c (fun j => div_nonneg (Nat.cast_nonneg _) ht.le)
have hl := traceRoot_sq_tendsto hA (cutMatrix_posSemidef c hy) hg hgp
havehr : Tendsto (fun t =>K*∑j, z t j*d j) atTop (𝓝 (K*∑j,y j*d j)) :=
(tendsto_finsetSum univ (fun j _ => (hz j).mul_const (d j))).const_mul K
apply le_of_tendsto_of_tendsto hl hr
filter_upwards [eventually_gt_atTop (0:ℝ)] with t ht
haveheq : cutMatrix c (z t)=t⁻¹ • cutMatrix c (fun j => (a t j : ℝ)) :=by
simpa only [z,div_eq_mul_inv,mul_comm] using
cutMatrix_smul c (fun j => (a t j : ℝ)) t⁻¹
rw [heq,traceRoot_sq_smul hA (cutMatrix_posSemidef c (fun j =>Nat.cast_nonneg _))
(inv_nonneg.mpr ht.le)]
have hh := mul_le_mul_of_nonneg_left (hb (a t)) (inv_nonneg.mpr ht.le)
convert hh using1
simp only [z,div_eq_mul_inv,mul_sum]
apply sum_congr rfl
intro j _
ring
lemmareplicaMatrix_gram (c : J→V→ℝ) (a : J→ℕ) :
(replicaMatrix c a)ᵀ*replicaMatrix c a=cutMatrix c (fun j => (a j : ℝ)) :=by
proof · 7
lines
ext v w
change (∑i, c ((Fintype.equivFin (Σj, Fin (a j))).symm i).1 v *
c ((Fintype.equivFin (Σj, Fin (a j))).symm i).1 w) = _
rw [(Fintype.equivFin (Σj, Fin (a j))).symm.sum_comp
(funi : (Σj, Fin (a j)) => c i.1 v*c i.1 w)]
simp only [Fintype.sum_sigma,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,
cutMatrix,Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,vecMulVec_apply]
lemmareplicaMatrix_energy (b : E→V→ℝ) (c : J→V→ℝ) (a : J→ℕ) :
(∑e, ∑i, (replicaMatrix c a * Matrix.of (fun v e => b e v)) i e ^ 2) =
∑j, (a j : ℝ)*(∑e, (∑v, c j v*b e v)^2) :=by
proof · 6
lines
rw [sum_comm]
change (∑i, (funj : (Σj, Fin (a j)) =>∑e, (∑v, c j.1 v*b e v)^2)
((Fintype.equivFin (Σj, Fin (a j))).symm i)) = _
rw [(Fintype.equivFin (Σj, Fin (a j))).symm.sum_comp
(funj : (Σj, Fin (a j)) =>∑e, (∑v, c j.1 v*b e v)^2)]
simp only [Fintype.sum_sigma,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul]
lemmashortcut_of_binary_bound (b : E→V→ℝ) (O : T→FinsetE)
(c : J→V→ℝ) (d : J→ℝ) (hc : ∀j v, c j v=0∨ c j v=1)
(hd : ∀j, 0 < d j) (henergy : ∀j, (∑e, (∑v, c j v*b e v)^2)=d j)
{K : ℝ} (hK : 0≤K)
(hbound : ∀h : ℕ, ∀X : Matrix (Fin h) Vℝ, (∀i v, X i v=0∨X i v=1) →∀U : MatrixE (Fin h) ℝ, Uᵀ*U≤1→
(∀e, 0≤ (U*(X*Matrix.of (fun v e => b e v))) e e) →
(∑t, (∑e ∈O t, (U*(X*Matrix.of (fun v e => b e v))) e e)^2/((O t).card : ℝ)) ≤K*(∑e, ∑i, (X*Matrix.of (fun v e => b e v)) i e ^2))
{eta : ℝ} (heta : 0 < eta) :
∃D : MatrixVVℝ, D.PosDef∧
(∀t, boundaryAverage b O t D < K+eta) ∧ (∀j, c j ⬝ᵥ (D *ᵥ c j) < d j) :=by
proof · 8
lines
apply shortcut_of_trace_bound b O c d hd hK _ heta
intro lam y hlam hlams hy
apply trace_bound_of_nat_weights (objectiveMatrix_posSemidef b O hlam) c d K _ hy
intro a
have heq := nuclear_bound_of_embedding_bound b O (replicaMatrix c a)
(hbound _ _ (replicaMatrix_binary c hc a)) hlam hlams
rwa [replicaMatrix_gram,replicaMatrix_energy,show
(∑j, (a j : ℝ)*(∑ e, (∑ v, c j v*b e v)^2))=∑j, (a j : ℝ)*d j by simp_rw [henergy]] at heq