url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
input
stringlengths
73
2.09M
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/HypersonicShapeDesign.lean
HypersonicShapeDesign.one_sub_bₚ_nonneg
[58, 1]
[60, 22]
unfold bₚ
a b : ℝ ⊢ 0 ≤ 1 - bₚ
a b : ℝ ⊢ 0 ≤ 1 - 0.65
Please generate a tactic in lean4 to solve the state. STATE: a b : ℝ ⊢ 0 ≤ 1 - bₚ TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/HypersonicShapeDesign.lean
HypersonicShapeDesign.one_sub_bₚ_nonneg
[58, 1]
[60, 22]
norm_num
a b : ℝ ⊢ 0 ≤ 1 - 0.65
no goals
Please generate a tactic in lean4 to solve the state. STATE: a b : ℝ ⊢ 0 ≤ 1 - 0.65 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
calc _ = ∑ i, ((a i) ^ 2 - 2 * (a i) * x + (x ^ 2)) := by congr; funext i; simp; ring _ = ∑ i, ((a i) ^ 2) - 2 * x * ∑ i, (a i) + n * (x ^ 2) := by rw [sum_add_distrib, sum_sub_distrib, ← sum_mul, ← mul_sum]; simp [sum_const]; ring _ = n * mean (a ^ 2) - 2 * x * n * mean a + n * (x ^ 2) := by simp [mean]; field_s...
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2))
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
congr
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2)
case e_f n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (fun i => (a i - x) ^ 2) = fun i => a i ^ 2 - 2 * a i * x + x ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
funext i
case e_f n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (fun i => (a i - x) ^ 2) = fun i => a i ^ 2 - 2 * a i * x + x ^ 2
case e_f.h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ i : Fin n ⊢ (a i - x) ^ 2 = a i ^ 2 - 2 * a i * x + x ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case e_f n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (fun i => (a i - x) ^ 2) = fun i => a i ^ 2 - 2 * a i * x + x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
case e_f.h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ i : Fin n ⊢ (a i - x) ^ 2 = a i ^ 2 - 2 * a i * x + x ^ 2
no goals
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ i : Fin n ⊢ (a i - x) ^ 2 = a i ^ 2 - 2 * a i * x + x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
rw [sum_add_distrib, sum_sub_distrib, ← sum_mul, ← mul_sum]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2) = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - (2 * ∑ i : Fin n, a i) * x + ∑ x_1 : Fin n, x ^ 2 = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2) = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
simp [sum_const]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - (2 * ∑ i : Fin n, a i) * x + ∑ x_1 : Fin n, x ^ 2 = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (2 * ∑ i : Fin n, a i) * x = 2 * x * ∑ i : Fin n, a i
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - (2 * ∑ i : Fin n, a i) * x + ∑ x_1 : Fin n, x ^ 2 = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (2 * ∑ i : Fin n, a i) * x = 2 * x * ∑ i : Fin n, a i
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (2 * ∑ i : Fin n, a i) * x = 2 * x * ∑ i : Fin n, a i TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
simp [mean]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 = ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i = ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i)
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 = ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
field_simp
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i = ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i)
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i) * ↑n = (∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i = ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i) * ↑n = (∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i) * ↑n = (∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
simp [mean]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2))
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) + ↑n * x ^ 2 = ↑n * ((x - (↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2 + ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2 - ((↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2))
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
field_simp
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) + ↑n * x ^ 2 = ↑n * ((x - (↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2 + ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2 - ((↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2))
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ((∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i + ↑n * x ^ 2 * ↑n) * (↑n ^ 2 * (↑n * ↑n ^ 2)) = ↑n * ((x * ↑n - ∑ i : Fin n, a i) ^ 2 * (↑n * ↑n ^ 2) + ((∑ x : Fin n, a x ^ 2) * ↑n ^ 2 - ↑n * (∑ i : Fin n, a i) ^ 2) * ↑n ^ 2) * ↑n
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) + ↑n * x ^ 2 = ↑n * ((x - (↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2 + ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2 - ((↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2)) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ((∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i + ↑n * x ^ 2 * ↑n) * (↑n ^ 2 * (↑n * ↑n ^ 2)) = ↑n * ((x * ↑n - ∑ i : Fin n, a i) ^ 2 * (↑n * ↑n ^ 2) + ((∑ x : Fin n, a x ^ 2) * ↑n ^ 2 - ↑n * (∑ i : Fin n, a i) ^ 2) * ↑n ^ 2) * ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ((∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i + ↑n * x ^ 2 * ↑n) * (↑n ^ 2 * (↑n * ↑n ^ 2)) = ↑n * ((x * ↑n - ∑ i : Fin n, a i) ^ 2 * (↑n * ↑n ^ 2) + ((∑ x : Fin n, a x ^ 2) * ↑n ^ 2 ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
simp [optimal, feasible, leastSquares] at h
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquares a).optimal x ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquares a).optimal x ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
replace h : ∀ y, (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 := by intros y have hy := h y have h_rw_x := leastSquares_alt_objFun hn a x have h_rw_y := leastSquares_alt_objFun hn a y simp only [rpow_two] at h_rw_x h_rw_y ⊢ rwa [h_rw_x, h_rw_y, mul_le_mul_left (by positivity), add_le_add_iff_right] at hy
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have hmean := h (mean a)
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ (mean a - mean a) ^ 2 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
simp at hmean
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ (mean a - mean a) ^ 2 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ (mean a - mean a) ^ 2 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have h_sq_eq_zero := le_antisymm hmean (sq_nonneg _)
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 h_sq_eq_zero : (x - mean a) ^ 2 = 0 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
rwa [sq_eq_zero_iff, sub_eq_zero] at h_sq_eq_zero
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 h_sq_eq_zero : (x - mean a) ^ 2 = 0 ⊢ x = mean a
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 h_sq_eq_zero : (x - mean a) ^ 2 = 0 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
intros y
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have hy := h y
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have h_rw_x := leastSquares_alt_objFun hn a x
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have h_rw_y := leastSquares_alt_objFun hn a y
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ i : Fin n, (a i - y) ^ 2 = ↑n * ((...
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2)...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
simp only [rpow_two] at h_rw_x h_rw_y ⊢
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ i : Fin n, (a i - y) ^ 2 = ↑n * ((...
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ x : Fin n, (a x - y) ^ 2 = ↑n ...
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2)...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
rwa [h_rw_x, h_rw_y, mul_le_mul_left (by positivity), add_le_add_iff_right] at hy
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ x : Fin n, (a x - y) ^ 2 = ↑n ...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
positivity
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ≤ ↑n * ((y - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ≤ ↑n * ((y - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_x : ∑ x_1 : Fin n, (a...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
apply leastSquares_optimal_eq_mean hn a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ x = mean a
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ (leastSquares a).optimal x
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
simp [leastSquaresVec, leastSquares, optimal, feasible] at h ⊢
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ (leastSquares a).optimal x
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) ⊢ ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ (leastSquares a).optimal x TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
intros y
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) ⊢ ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) y : ℝ ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) ⊢ ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
simp only [Vec.sum, Pi.pow_apply, Pi.sub_apply, Vec.const, rpow_two] at h
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) y : ℝ ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ y : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) y : ℝ ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
exact h y
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ y : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ y : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
simp [fittingSphereT, fittingSphereConvex, optimal, feasible] at h_opt ⊢
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : (fittingSphereConvex n m x).optimal (c, t) ⊢ (fittingSphereT n m x).optimal (c, t)
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ 0 ≤ t + ‖c‖ ^ 2 ∧ ∀ (a : Fin n → ℝ) (b : ℝ), 0 ≤ b + ‖a‖ ^ 2 → Vec.sum...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : (fittingSphereConvex n m x).optimal (c, t) ⊢ (fittingSphereT n m x).optimal (c, t) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
constructor
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ 0 ≤ t + ‖c‖ ^ 2 ∧ ∀ (a : Fin n → ℝ) (b : ℝ), 0 ≤ b + ‖a‖ ^ 2 → Vec.sum...
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ 0 ≤ t + ‖c‖ ^ 2 case right n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ 0 ≤ t + ‖c‖ ^ 2 ∧ ∀ (a ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
let a := Vec.norm x ^ 2 - 2 * mulVec x c
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ 0 ≤ t + ‖c‖ ^ 2
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c ⊢ 0 ≤ t + ‖c‖ ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ 0 ≤ t + ‖c‖ ^ 2 T...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
have h_ls : optimal (leastSquaresVec a) t := by refine ⟨trivial, ?_⟩ intros y _ simp [objFun, leastSquaresVec] exact h_opt c y
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c ⊢ 0 ≤ t + ‖c‖ ^ 2
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
have h_t_eq := leastSquaresVec_optimal_eq_mean hm a t h_ls
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
have h_c2_eq : ‖c‖ ^ 2 = (1 / m) * ∑ i : Fin m, ‖c‖ ^ 2 := by simp [sum_const] field_simp
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
have h_t_add_c2_eq : t + ‖c‖ ^ 2 = (1 / m) * ∑ i, ‖(x i) - c‖ ^ 2 := by rw [h_t_eq]; dsimp [mean] rw [h_c2_eq, mul_sum, mul_sum, mul_sum, ← sum_add_distrib] congr; funext i; rw [← mul_add] congr; simp [Vec.norm] rw [norm_sub_sq (𝕜 := ℝ) (E := Fin n → ℝ)] simp [a]; congr
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
rw [← rpow_two, h_t_add_c2_eq]
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
apply mul_nonneg (by norm_num)
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
apply sum_nonneg
case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal ...
case left.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optima...
Please generate a tactic in lean4 to solve the state. STATE: case left n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Ve...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
intros i _
case left.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optima...
case left.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optima...
Please generate a tactic in lean4 to solve the state. STATE: case left.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
exact sq_nonneg _
case left.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optima...
no goals
Please generate a tactic in lean4 to solve the state. STATE: case left.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
refine ⟨trivial, ?_⟩
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c ⊢ (leastSquaresVec a).optimal t
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c ⊢ ∀ (y : ℝ), (leastSquaresVec a).feasible y →...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
intros y _
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c ⊢ ∀ (y : ℝ), (leastSquaresVec a).feasible y →...
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c y : ℝ a✝ : (leastSquaresVec a).feasible y ⊢ (...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
simp [objFun, leastSquaresVec]
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c y : ℝ a✝ : (leastSquaresVec a).feasible y ⊢ (...
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c y : ℝ a✝ : (leastSquaresVec a).feasible y ⊢ V...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
exact h_opt c y
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c y : ℝ a✝ : (leastSquaresVec a).feasible y ⊢ V...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
simp [sum_const]
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
field_simp
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
rw [h_t_eq]
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
dsimp [mean]
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
rw [h_c2_eq, mul_sum, mul_sum, mul_sum, ← sum_add_distrib]
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
congr
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
case e_f n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t...
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
funext i
case e_f n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t...
case e_f.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal...
Please generate a tactic in lean4 to solve the state. STATE: case e_f n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
rw [← mul_add]
case e_f.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal...
case e_f.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal...
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := V...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
congr
case e_f.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal...
case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).opt...
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := V...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
rw [norm_sub_sq (𝕜 := ℝ) (E := Fin n → ℝ)]
case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).opt...
case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).opt...
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
simp [a]
case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).opt...
case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).opt...
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
congr
case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).opt...
no goals
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h.e_a n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
norm_num
n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^ 2 - 2 * x *ᵥ c h_ls : (leastSquaresVec a).optimal t h_t_eq :...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) a : Fin m → ℝ := Vec.norm x ^...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
intros c' x' _
case right n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ ∀ (a : Fin n → ℝ) (b : ℝ), 0 ≤ b + ‖a‖ ^ 2 → Vec.sum ((Vec.norm x ^...
case right n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) c' : Fin n → ℝ x' : ℝ a✝ : 0 ≤ x' + ‖c'‖ ^ 2 ⊢ Vec.sum ((Vec.norm x ^ 2 - 2 * x...
Please generate a tactic in lean4 to solve the state. STATE: case right n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) ⊢ ∀ (a : Fin n → ℝ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
FittingSphere.optimal_convex_implies_optimal_t
[157, 1]
[191, 22]
exact h_opt c' x'
case right n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) c' : Fin n → ℝ x' : ℝ a✝ : 0 ≤ x' + ‖c'‖ ^ 2 ⊢ Vec.sum ((Vec.norm x ^ 2 - 2 * x...
no goals
Please generate a tactic in lean4 to solve the state. STATE: case right n m : ℕ x : Fin m → Fin n → ℝ hm : 0 < m c : Fin n → ℝ t : ℝ h_opt : ∀ (a : Fin n → ℝ) (b : ℝ), Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ c - Vec.const m t) ^ 2) ≤ Vec.sum ((Vec.norm x ^ 2 - 2 * x *ᵥ a - Vec.const m b) ^ 2) c' : Fin n → ℝ x' ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Lib/Math/Analysis/InnerProductSpace/GramSchmidtOrtho.lean
repr_gramSchmidt_diagonal
[18, 1]
[24, 67]
rw [gramSchmidt_def, map_sub, Finsupp.sub_apply, Basis.repr_self, Finsupp.single_eq_same, sub_eq_self, map_sum, Finsupp.coe_finset_sum, Finset.sum_apply, Finset.sum_eq_zero]
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E ⊢ (b.repr (gramSchmidt 𝕜 (⇑b) i)) i = 1
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E ⊢ ∀ x ∈ Finset.Iio i, (b.repr ↑((orthogonalProjection (Submodule.span 𝕜 {gra...
Please generate a tactic in lean4 to solve the state. STATE: 𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E ⊢ (b.repr (gramS...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Lib/Math/Analysis/InnerProductSpace/GramSchmidtOrtho.lean
repr_gramSchmidt_diagonal
[18, 1]
[24, 67]
intros j hj
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E ⊢ ∀ x ∈ Finset.Iio i, (b.repr ↑((orthogonalProjection (Submodule.span 𝕜 {gra...
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E j : ι hj : j ∈ Finset.Iio i ⊢ (b.repr ↑((orthogonalProjection (Submodule.span...
Please generate a tactic in lean4 to solve the state. STATE: 𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E ⊢ ∀ x ∈ Finset.I...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Lib/Math/Analysis/InnerProductSpace/GramSchmidtOrtho.lean
repr_gramSchmidt_diagonal
[18, 1]
[24, 67]
rw [Finset.mem_Iio] at hj
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E j : ι hj : j ∈ Finset.Iio i ⊢ (b.repr ↑((orthogonalProjection (Submodule.span...
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E j : ι hj : j < i ⊢ (b.repr ↑((orthogonalProjection (Submodule.span 𝕜 {gramSc...
Please generate a tactic in lean4 to solve the state. STATE: 𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E j : ι hj : j ∈ F...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Lib/Math/Analysis/InnerProductSpace/GramSchmidtOrtho.lean
repr_gramSchmidt_diagonal
[18, 1]
[24, 67]
simp [orthogonalProjection_singleton, gramSchmidt_triangular hj]
𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E j : ι hj : j < i ⊢ (b.repr ↑((orthogonalProjection (Submodule.span 𝕜 {gramSc...
no goals
Please generate a tactic in lean4 to solve the state. STATE: 𝕜 : Type u_2 E : Type u_1 inst✝⁵ : RCLike 𝕜 inst✝⁴ : NormedAddCommGroup E inst✝³ : InnerProductSpace 𝕜 E ι : Type u_3 inst✝² : LinearOrder ι inst✝¹ : LocallyFiniteOrderBot ι inst✝ : IsWellOrder ι fun x x_1 => x < x_1 i : ι b : Basis ι 𝕜 E j : ι hj : j < i...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Tactic/DCP/AtomLibrary/Fns/Norm.lean
CvxLean.norm2₂_eq_norm2
[57, 1]
[58, 36]
simp [Norm.norm, sqrt_eq_rpow]
x y : ℝ ⊢ ‖![x, y]‖ = (x ^ 2 + y ^ 2).sqrt
no goals
Please generate a tactic in lean4 to solve the state. STATE: x y : ℝ ⊢ ‖![x, y]‖ = (x ^ 2 + y ^ 2).sqrt TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
calc _ = ∑ i, ((a i) ^ 2 - 2 * (a i) * x + (x ^ 2)) := by congr; funext i; simp; ring _ = ∑ i, ((a i) ^ 2) - 2 * x * ∑ i, (a i) + n * (x ^ 2) := by rw [sum_add_distrib, sum_sub_distrib, ← sum_mul, ← mul_sum]; simp [sum_const]; ring _ = n * mean (a ^ 2) - 2 * x * n * mean a + n * (x ^ 2) := by simp [mean]; field_s...
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2))
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
congr
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2)
case e_f n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (fun i => (a i - x) ^ 2) = fun i => a i ^ 2 - 2 * a i * x + x ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i - x) ^ 2 = ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
funext i
case e_f n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (fun i => (a i - x) ^ 2) = fun i => a i ^ 2 - 2 * a i * x + x ^ 2
case e_f.h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ i : Fin n ⊢ (a i - x) ^ 2 = a i ^ 2 - 2 * a i * x + x ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case e_f n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (fun i => (a i - x) ^ 2) = fun i => a i ^ 2 - 2 * a i * x + x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
case e_f.h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ i : Fin n ⊢ (a i - x) ^ 2 = a i ^ 2 - 2 * a i * x + x ^ 2
no goals
Please generate a tactic in lean4 to solve the state. STATE: case e_f.h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ i : Fin n ⊢ (a i - x) ^ 2 = a i ^ 2 - 2 * a i * x + x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
rw [sum_add_distrib, sum_sub_distrib, ← sum_mul, ← mul_sum]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2) = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - (2 * ∑ i : Fin n, a i) * x + ∑ x_1 : Fin n, x ^ 2 = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, (a i ^ 2 - 2 * a i * x + x ^ 2) = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
simp [sum_const]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - (2 * ∑ i : Fin n, a i) * x + ∑ x_1 : Fin n, x ^ 2 = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (2 * ∑ i : Fin n, a i) * x = 2 * x * ∑ i : Fin n, a i
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - (2 * ∑ i : Fin n, a i) * x + ∑ x_1 : Fin n, x ^ 2 = ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (2 * ∑ i : Fin n, a i) * x = 2 * x * ∑ i : Fin n, a i
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (2 * ∑ i : Fin n, a i) * x = 2 * x * ∑ i : Fin n, a i TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
simp [mean]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 = ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i = ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i)
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ i : Fin n, a i ^ 2 - 2 * x * ∑ i : Fin n, a i + ↑n * x ^ 2 = ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
field_simp
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i = ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i)
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i) * ↑n = (∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i = ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i) * ↑n = (∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ (∑ x : Fin n, a x ^ 2 - 2 * x * ∑ i : Fin n, a i) * ↑n = (∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
simp [mean]
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2))
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) + ↑n * x ^ 2 = ↑n * ((x - (↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2 + ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2 - ((↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2))
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * mean (a ^ 2) - 2 * x * ↑n * mean a + ↑n * x ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
field_simp
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) + ↑n * x ^ 2 = ↑n * ((x - (↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2 + ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2 - ((↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2))
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ((∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i + ↑n * x ^ 2 * ↑n) * (↑n ^ 2 * (↑n * ↑n ^ 2)) = ↑n * ((x * ↑n - ∑ i : Fin n, a i) ^ 2 * (↑n * ↑n ^ 2) + ((∑ x : Fin n, a x ^ 2) * ↑n ^ 2 - ↑n * (∑ i : Fin n, a i) ^ 2) * ↑n ^ 2) * ↑n
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ↑n * ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2) - 2 * x * ↑n * ((↑n)⁻¹ * ∑ i : Fin n, a i) + ↑n * x ^ 2 = ↑n * ((x - (↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2 + ((↑n)⁻¹ * ∑ x : Fin n, a x ^ 2 - ((↑n)⁻¹ * ∑ i : Fin n, a i) ^ 2)) TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_alt_objFun
[24, 1]
[41, 34]
ring
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ((∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i + ↑n * x ^ 2 * ↑n) * (↑n ^ 2 * (↑n * ↑n ^ 2)) = ↑n * ((x * ↑n - ∑ i : Fin n, a i) ^ 2 * (↑n * ↑n ^ 2) + ((∑ x : Fin n, a x ^ 2) * ↑n ^ 2 - ↑n * (∑ i : Fin n, a i) ^ 2) * ↑n ^ 2) * ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ ⊢ ((∑ x : Fin n, a x ^ 2) * ↑n - 2 * x * ↑n * ∑ i : Fin n, a i + ↑n * x ^ 2 * ↑n) * (↑n ^ 2 * (↑n * ↑n ^ 2)) = ↑n * ((x * ↑n - ∑ i : Fin n, a i) ^ 2 * (↑n * ↑n ^ 2) + ((∑ x : Fin n, a x ^ 2) * ↑n ^ 2 ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
simp [optimal, feasible, leastSquares] at h
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquares a).optimal x ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquares a).optimal x ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
replace h : ∀ y, (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 := by intros y have hy := h y have h_rw_x := leastSquares_alt_objFun hn a x have h_rw_y := leastSquares_alt_objFun hn a y simp only [rpow_two] at h_rw_x h_rw_y ⊢ rwa [h_rw_x, h_rw_y, mul_le_mul_left (by positivity), add_le_add_iff_right] at hy
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have hmean := h (mean a)
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ (mean a - mean a) ^ 2 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
simp at hmean
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ (mean a - mean a) ^ 2 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ (mean a - mean a) ^ 2 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have h_sq_eq_zero := le_antisymm hmean (sq_nonneg _)
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 ⊢ x = mean a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 h_sq_eq_zero : (x - mean a) ^ 2 = 0 ⊢ x = mean a
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
rwa [sq_eq_zero_iff, sub_eq_zero] at h_sq_eq_zero
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 h_sq_eq_zero : (x - mean a) ^ 2 = 0 ⊢ x = mean a
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 hmean : (x - mean a) ^ 2 ≤ 0 h_sq_eq_zero : (x - mean a) ^ 2 = 0 ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
intros y
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∀ (y : ℝ), (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have hy := h y
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have h_rw_x := leastSquares_alt_objFun hn a x
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
have h_rw_y := leastSquares_alt_objFun hn a y
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ⊢ (x - mean a) ^ 2 ≤ (y - mean a) ^ 2
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ i : Fin n, (a i - y) ^ 2 = ↑n * ((...
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2)...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
simp only [rpow_two] at h_rw_x h_rw_y ⊢
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ i : Fin n, (a i - y) ^ 2 = ↑n * ((...
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ x : Fin n, (a x - y) ^ 2 = ↑n ...
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ i : Fin n, (a i - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2)...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
rwa [h_rw_x, h_rw_y, mul_le_mul_left (by positivity), add_le_add_iff_right] at hy
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_y : ∑ x : Fin n, (a x - y) ^ 2 = ↑n ...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquares_optimal_eq_mean
[43, 1]
[57, 52]
positivity
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ≤ ↑n * ((y - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_x : ∑ x_1 : Fin n, (a x_1 - x) ^ 2 = ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean...
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 y : ℝ hy : ↑n * ((x - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) ≤ ↑n * ((y - mean a) ^ 2 + (mean (a ^ 2) - mean a ^ 2)) h_rw_x : ∑ x_1 : Fin n, (a...
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
apply leastSquares_optimal_eq_mean hn a
n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ x = mean a
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ (leastSquares a).optimal x
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ x = mean a TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
simp [leastSquaresVec, leastSquares, optimal, feasible] at h ⊢
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ (leastSquares a).optimal x
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) ⊢ ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : (leastSquaresVec a).optimal x ⊢ (leastSquares a).optimal x TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
intros y
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) ⊢ ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) y : ℝ ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) ⊢ ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
simp only [Vec.sum, Pi.pow_apply, Pi.sub_apply, Vec.const, rpow_two] at h
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) y : ℝ ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ y : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ h : ∀ (y : ℝ), Vec.sum ((a - Vec.const n x) ^ 2) ≤ Vec.sum ((a - Vec.const n y) ^ 2) y : ℝ ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 TACTIC:
https://github.com/verified-optimization/CvxLean.git
c62c2f292c6420f31a12e738ebebdfed50f6f840
CvxLean/Examples/FittingSphere.lean
leastSquaresVec_optimal_eq_mean
[63, 1]
[70, 12]
exact h y
case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ y : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h n : ℕ hn : 0 < n a : Fin n → ℝ x : ℝ y : ℝ h : ∀ (y : ℝ), ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 ⊢ ∑ x_1 : Fin n, (a x_1 - x) ^ 2 ≤ ∑ x : Fin n, (a x - y) ^ 2 TACTIC: