zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_0 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (u : EuclideanSpace ℝ (Fin ↑m))
  (v : EuclideanSpace ℝ (Fin ↑n)) : Aᵀ *ᵥ u ⬝ᵥ v = u ⬝ᵥ A *ᵥ v := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
u : EuclideanSpace ℝ (Fin ↑m)
v : EuclideanSpace ℝ (Fin ↑n)
⊢ Aᵀ *ᵥ u ⬝ᵥ v = u ⬝ᵥ A *ᵥ v

Tactic:
rw [← vecMul_transpose, transpose_transpose, dotProduct_mulVec]

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_1 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (u v : Fin ↑n → ℝ) :
  A *ᵥ u - A *ᵥ v = A *ᵥ (u - v) := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
u v : Fin ↑n → ℝ
⊢ A *ᵥ u - A *ᵥ v = A *ᵥ (u - v)

Tactic:
rw [sub_eq_add_neg u v, mulVec_add, mulVec_neg, sub_eq_add_neg]

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_2 {m : ℕ+} (x : EuclideanSpace ℝ (Fin ↑m)) (h_original_goal : ‖x‖ ^ 2 = x ⬝ᵥ x) :
  ∑ i, ‖x i‖ ^ 2 = ∑ i, x i * x i := sorry

Tactic state before:
m : ℕ+
x : EuclideanSpace ℝ (Fin ↑m)
⊢ ‖x‖ ^ 2 = x ⬝ᵥ x

Tactic:
rw [EuclideanSpace.norm_eq, Real.sq_sqrt, dotProduct]

Tactic state after:
[m : ℕ+
 x : EuclideanSpace ℝ (Fin ↑m)
 ⊢ ∑ i, ‖x i‖ ^ 2 = ∑ i, x i * x i,
 m : ℕ+
 x : EuclideanSpace ℝ (Fin ↑m)
 ⊢ 0 ≤ ∑ i, ‖x i‖ ^ 2]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_3 {m : ℕ+} (x : EuclideanSpace ℝ (Fin ↑m)) (h_original_goal : ‖x‖ ^ 2 = x ⬝ᵥ x) :
  0 ≤ ∑ i, ‖x i‖ ^ 2 := sorry

Tactic state before:
m : ℕ+
x : EuclideanSpace ℝ (Fin ↑m)
⊢ ‖x‖ ^ 2 = x ⬝ᵥ x

Tactic:
rw [EuclideanSpace.norm_eq, Real.sq_sqrt, dotProduct]

Tactic state after:
[m : ℕ+
 x : EuclideanSpace ℝ (Fin ↑m)
 ⊢ ∑ i, ‖x i‖ ^ 2 = ∑ i, x i * x i,
 m : ℕ+
 x : EuclideanSpace ℝ (Fin ↑m)
 ⊢ 0 ≤ ∑ i, ‖x i‖ ^ 2]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_4 {m : ℕ+} (x : EuclideanSpace ℝ (Fin ↑m)) (h_original_goal : 0 ≤ ∑ i, ‖x i‖ ^ 2)
  (i : Fin ↑m) : i ∈ Finset.univ → 0 ≤ ‖x i‖ ^ 2 := sorry

Tactic state before:
m : ℕ+
x : EuclideanSpace ℝ (Fin ↑m)
⊢ 0 ≤ ∑ i, ‖x i‖ ^ 2

Tactic:
apply sum_nonneg

Tactic state after:
[case h
 m : ℕ+
 x : EuclideanSpace ℝ (Fin ↑m)
 ⊢ ∀ i ∈ Finset.univ, 0 ≤ ‖x i‖ ^ 2]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_5 {m : ℕ+} (x : EuclideanSpace ℝ (Fin ↑m)) (i : Fin ↑m) :
  i ∈ Finset.univ → 0 ≤ ‖x i‖ ^ 2 := sorry

Tactic state before:
case h
m : ℕ+
x : EuclideanSpace ℝ (Fin ↑m)
⊢ ∀ i ∈ Finset.univ, 0 ≤ ‖x i‖ ^ 2

Tactic:
exact fun i _ => sq_nonneg (‖x i‖)

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_6 {m : ℕ+} (x y : EuclideanSpace ℝ (Fin ↑m)) (h_original_goal : inner x y = x ⬝ᵥ y) :
  ∑ x_1, y x_1 * x x_1 = x ⬝ᵥ y := sorry

Tactic state before:
m : ℕ+
x y : EuclideanSpace ℝ (Fin ↑m)
⊢ inner x y = x ⬝ᵥ y

Tactic:
simp

Tactic state after:
[m : ℕ+
 x y : EuclideanSpace ℝ (Fin ↑m)
 ⊢ ∑ x_1, y x_1 * x x_1 = x ⬝ᵥ y]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_7 {m : ℕ+} (x y : EuclideanSpace ℝ (Fin ↑m))
  (h_original_goal : ∑ x_1, y x_1 * x x_1 = x ⬝ᵥ y) : ∑ x_1, y x_1 * x x_1 = ∑ i, x i * y i := sorry

Tactic state before:
m : ℕ+
x y : EuclideanSpace ℝ (Fin ↑m)
⊢ ∑ x_1, y x_1 * x x_1 = x ⬝ᵥ y

Tactic:
rw [dotProduct]

Tactic state after:
[m : ℕ+
 x y : EuclideanSpace ℝ (Fin ↑m)
 ⊢ ∑ x_1, y x_1 * x x_1 = ∑ i, x i * y i]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_8 {m : ℕ+} (x y : EuclideanSpace ℝ (Fin ↑m)) :
  ∑ x_1, y x_1 * x x_1 = ∑ i, x i * y i := sorry

Tactic state before:
m : ℕ+
x y : EuclideanSpace ℝ (Fin ↑m)
⊢ ∑ x_1, y x_1 * x x_1 = ∑ i, x i * y i

Tactic:
simp [mul_comm]

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_9 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (h_original_goal : HasGradientAt (fun x => A *ᵥ x ⬝ᵥ A *ᵥ x) (2 • Aᵀ *ᵥ A *ᵥ x) x) :
  HasGradientAt (fun x => 0 *ᵥ x ⬝ᵥ 0 *ᵥ x) (2 • 0ᵀ *ᵥ 0 *ᵥ x) x := sorry

Tactic state before:
case pos
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : A = 0
x : EuclideanSpace ℝ (Fin ↑n)
⊢ HasGradientAt (fun x => A *ᵥ x ⬝ᵥ A *ᵥ x) (2 • Aᵀ *ᵥ A *ᵥ x) x

Tactic:
rw [hA]

Tactic state after:
[case pos
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ⊢ HasGradientAt (fun x => 0 *ᵥ x ⬝ᵥ 0 *ᵥ x) (2 • 0ᵀ *ᵥ 0 *ᵥ x) x]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_10 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (h_original_goal : HasGradientAt (fun x => 0 *ᵥ x ⬝ᵥ 0 *ᵥ x) (2 • 0ᵀ *ᵥ 0 *ᵥ x) x) :
  HasGradientAt (fun x => 0) 0 x := sorry

Tactic state before:
case pos
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : A = 0
x : EuclideanSpace ℝ (Fin ↑n)
⊢ HasGradientAt (fun x => 0 *ᵥ x ⬝ᵥ 0 *ᵥ x) (2 • 0ᵀ *ᵥ 0 *ᵥ x) x

Tactic:
simp

Tactic state after:
[case pos
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ⊢ HasGradientAt (fun x => 0) 0 x]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_11 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) : HasGradientAt (fun x => 0) 0 x := sorry

Tactic state before:
case pos
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : A = 0
x : EuclideanSpace ℝ (Fin ↑n)
⊢ HasGradientAt (fun x => 0) 0 x

Tactic:
apply hasGradientAt_const

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_12 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (h_original_goal : HasGradientAt (fun x => A *ᵥ x ⬝ᵥ A *ᵥ x) (2 • Aᵀ *ᵥ A *ᵥ x) x)
  (ε : ℝ) :
  ε > 0 →
    ∃ δ > 0,
      ∀ (x' : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - x'‖ ≤ δ →
          ‖A *ᵥ x' ⬝ᵥ A *ᵥ x' - A *ᵥ x ⬝ᵥ A *ᵥ x - inner (2 • Aᵀ *ᵥ A *ᵥ x) (x' - x)‖ ≤ ε * ‖x - x'‖ := sorry

Tactic state before:
case neg
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
⊢ HasGradientAt (fun x => A *ᵥ x ⬝ᵥ A *ᵥ x) (2 • Aᵀ *ᵥ A *ᵥ x) x

Tactic:
rw [HasGradient_iff_Convergence_Point]

Tactic state after:
[case neg
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ⊢ ∀ ε > 0,
     ∃ δ > 0,
       ∀ (x' : EuclideanSpace ℝ (Fin ↑n)),
         ‖x - x'‖ ≤ δ → ‖A *ᵥ x' ⬝ᵥ A *ᵥ x' - A *ᵥ x ⬝ᵥ A *ᵥ x - inner (2 • Aᵀ *ᵥ A *ᵥ x) (x' - x)‖ ≤ ε * ‖x - x'‖]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_13 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖ := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x✝ : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
x : EuclideanSpace ℝ (Fin ↑n)
⊢ ‖A *ᵥ x‖ ≤ normA * ‖x‖

Tactic:
apply Matrix.l2_opNorm_mulVec A

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_14 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) → normA ≤ 0 → 0 ≤ normA := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
hA : normA ≤ 0
⊢ 0 ≤ normA

Tactic:
apply norm_nonneg

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_15 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) → normA ≤ 0 → 0 ≤ normA → A = 0 → A = 0 := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
hA : normA ≤ 0
hA' : 0 ≤ normA
hA'' : A = 0
⊢ A = 0

Tactic:
exact hA''

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_16 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) → 0 < normA → ε / normA ^ 2 > 0 → 0 < normA ^ 2 := sorry

Tactic state before:
case h.left
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
⊢ ε / normA ^ 2 > 0

Tactic:
apply div_pos εpos

Tactic state after:
[case h.left
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 ⊢ 0 < normA ^ 2]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_17 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) → 0 < normA → 0 < normA ^ 2 → normA ≠ 0 := sorry

Tactic state before:
case h.left
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
⊢ 0 < normA ^ 2

Tactic:
rw [sq_pos_iff]

Tactic state after:
[case h.left
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 ⊢ normA ≠ 0]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_18 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          ‖A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - inner (2 • Aᵀ *ᵥ A *ᵥ x) (y - x)‖ ≤ ε * ‖x - y‖ →
            ‖A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - (starRingEnd ℝ) 2 * inner (Aᵀ *ᵥ A *ᵥ x) (y - x)‖ ≤
              ε * ‖x - y‖ := sorry

Tactic state before:
case h.right
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
⊢ ‖A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - inner (2 • Aᵀ *ᵥ A *ᵥ x) (y - x)‖ ≤ ε * ‖x - y‖

Tactic:
rw [inner_smul_left]

Tactic state after:
[case h.right
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 y : EuclideanSpace ℝ (Fin ↑n)
 ydist : ‖x - y‖ ≤ ε / normA ^ 2
 ⊢ ‖A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - (starRingEnd ℝ) 2 * inner (Aᵀ *ᵥ A *ᵥ x) (y - x)‖ ≤ ε * ‖x - y‖]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_19 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          ‖A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - (starRingEnd ℝ) 2 * inner (Aᵀ *ᵥ A *ᵥ x) (y - x)‖ ≤ ε * ‖x - y‖ →
            |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * ∑ x_1, (y x_1 - x x_1) * ((Aᵀ * A) *ᵥ x) x_1| ≤
              ε * ‖x - y‖ := sorry

Tactic state before:
case h.right
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
⊢ ‖A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - (starRingEnd ℝ) 2 * inner (Aᵀ *ᵥ A *ᵥ x) (y - x)‖ ≤ ε * ‖x - y‖

Tactic:
simp

Tactic state after:
[case h.right
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 y : EuclideanSpace ℝ (Fin ↑n)
 ydist : ‖x - y‖ ≤ ε / normA ^ 2
 ⊢ |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * ∑ x_1, (y x_1 - x x_1) * ((Aᵀ * A) *ᵥ x) x_1| ≤ ε * ‖x - y‖]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_20 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * ∑ x_1, (y x_1 - x x_1) * ((Aᵀ * A) *ᵥ x) x_1| ≤ ε * ‖x - y‖ →
            |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * (fun x_1 => y x_1 - x x_1) ⬝ᵥ (Aᵀ * A) *ᵥ x| ≤
              ε * ‖x - y‖ := sorry

Tactic state before:
case h.right
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
⊢ |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * ∑ x_1, (y x_1 - x x_1) * ((Aᵀ * A) *ᵥ x) x_1| ≤ ε * ‖x - y‖

Tactic:
rw [← dotProduct]

Tactic state after:
[case h.right
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 y : EuclideanSpace ℝ (Fin ↑n)
 ydist : ‖x - y‖ ≤ ε / normA ^ 2
 ⊢ |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * (fun x_1 => y x_1 - x x_1) ⬝ᵥ (Aᵀ * A) *ᵥ x| ≤ ε * ‖x - y‖]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_21 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          ((fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) ⬝ᵥ fun x_1 => y x_1 - x x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x) →
            ∑ i, ((Aᵀ * A) *ᵥ x) i * (y i - x i) = ∑ i, ((Aᵀ * A) *ᵥ x) i * (y - x) i := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
⊢ ((fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) ⬝ᵥ fun x_1 => y x_1 - x x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x)

Tactic:
rw [dotProduct, dotProduct]

Tactic state after:
[n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 y : EuclideanSpace ℝ (Fin ↑n)
 ydist : ‖x - y‖ ≤ ε / normA ^ 2
 ⊢ ∑ i, ((Aᵀ * A) *ᵥ x) i * (y i - x i) = ∑ i, ((Aᵀ * A) *ᵥ x) i * (y - x) i]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_22 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 → ∑ i, ((Aᵀ * A) *ᵥ x) i * (y i - x i) = ∑ i, ((Aᵀ * A) *ᵥ x) i * (y - x) i := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
⊢ ∑ i, ((Aᵀ * A) *ᵥ x) i * (y i - x i) = ∑ i, ((Aᵀ * A) *ᵥ x) i * (y - x) i

Tactic:
simp [mul_comm]

Tactic state after:
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_23 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x) →
            |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * (fun x_1 => y x_1 - x x_1) ⬝ᵥ (Aᵀ * A) *ᵥ x| ≤ ε * ‖x - y‖ →
              |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * (A *ᵥ x ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x)| ≤ ε * ‖x - y‖ := sorry

Tactic state before:
case h.right
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
aux1 : ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x)
⊢ |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * (fun x_1 => y x_1 - x x_1) ⬝ᵥ (Aᵀ * A) *ᵥ x| ≤ ε * ‖x - y‖

Tactic:
rw [aux1, ← mulVec_mulVec, ← dot_mul_eq_transpose_mul_dot _ (y - x), Matrix.mulVec_sub, dotProduct_sub]

Tactic state after:
[case h.right
 n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 y : EuclideanSpace ℝ (Fin ↑n)
 ydist : ‖x - y‖ ≤ ε / normA ^ 2
 aux1 : ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x)
 ⊢ |A *ᵥ y ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x - 2 * (A *ᵥ x ⬝ᵥ A *ᵥ y - A *ᵥ x ⬝ᵥ A *ᵥ x)| ≤ ε * ‖x - y‖]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_24 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x) →
            ∀ (u v : Fin ↑m → ℝ),
              u ⬝ᵥ u + (v ⬝ᵥ v - v ⬝ᵥ u * 2) = (u - v) ⬝ᵥ (u - v) →
                u ⬝ᵥ u + (v ⬝ᵥ v - v ⬝ᵥ u * 2) = u ⬝ᵥ u - (v ⬝ᵥ u + v ⬝ᵥ u) + v ⬝ᵥ v := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
aux1 : ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x)
u v : Fin ↑m → ℝ
⊢ u ⬝ᵥ u + (v ⬝ᵥ v - v ⬝ᵥ u * 2) = (u - v) ⬝ᵥ (u - v)

Tactic:
rw [dotProduct_sub, sub_dotProduct, sub_dotProduct, ← sub_add, sub_sub, dotProduct_comm u v]

Tactic state after:
[n m : ℕ+
 A : Matrix (Fin ↑m) (Fin ↑n) ℝ
 hA : ¬A = 0
 x : EuclideanSpace ℝ (Fin ↑n)
 ε : ℝ
 εpos : ε > 0
 normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
 norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
 normApos : 0 < normA
 y : EuclideanSpace ℝ (Fin ↑n)
 ydist : ‖x - y‖ ≤ ε / normA ^ 2
 aux1 : ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x)
 u v : Fin ↑m → ℝ
 ⊢ u ⬝ᵥ u + (v ⬝ᵥ v - v ⬝ᵥ u * 2) = u ⬝ᵥ u - (v ⬝ᵥ u + v ⬝ᵥ u) + v ⬝ᵥ v]
import Mathlib
import Optlib


open Set Real Matrix Finset

open Set Real Matrix Finset NNReal

theorem extracted_formal_statement_25 {n m : ℕ+} {A : Matrix (Fin ↑m) (Fin ↑n) ℝ} (hA : ¬A = 0)
  (x : EuclideanSpace ℝ (Fin ↑n)) (ε : ℝ) (εpos : ε > 0) :
  let normA := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖;
  (∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖) →
    0 < normA →
      ∀ (y : EuclideanSpace ℝ (Fin ↑n)),
        ‖x - y‖ ≤ ε / normA ^ 2 →
          ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x) →
            ∀ (u v : Fin ↑m → ℝ), u ⬝ᵥ u + (v ⬝ᵥ v - v ⬝ᵥ u * 2) = u ⬝ᵥ u - (v ⬝ᵥ u + v ⬝ᵥ u) + v ⬝ᵥ v := sorry

Tactic state before:
n m : ℕ+
A : Matrix (Fin ↑m) (Fin ↑n) ℝ
hA : ¬A = 0
x : EuclideanSpace ℝ (Fin ↑n)
ε : ℝ
εpos : ε > 0
normA : ℝ := ‖(toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖
norm_mul : ∀ (x : EuclideanSpace ℝ (Fin ↑n)), ‖A *ᵥ x‖ ≤ normA * ‖x‖
normApos : 0 < normA
y : EuclideanSpace ℝ (Fin ↑n)
ydist : ‖x - y‖ ≤ ε / normA ^ 2
aux1 : ((fun x_1 => y x_1 - x x_1) ⬝ᵥ fun x_1 => ((Aᵀ * A) *ᵥ x) x_1) = (Aᵀ * A) *ᵥ x ⬝ᵥ (y - x)
u v : Fin ↑m → ℝ
⊢ u ⬝ᵥ u + (v ⬝ᵥ v - v ⬝ᵥ u * 2) = u ⬝ᵥ u - (v ⬝ᵥ u + v ⬝ᵥ u) + v ⬝ᵥ v

Tactic:
rw [← mul_two, add_comm_sub]

Tactic state after: