-- File: optlib/Optlib/Algorithm/Nesterov/NesterovSmooth.lean
Theorem statement:
theorem extracted_formal_statement_43.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {f' : E → E} {xm x₀ : E} {γ : ℕ+ → ℝ} {alg : Nesterov f f' γ x₀}
  (hfun : ConvexOn ℝ univ f) (hg : ∀ (k : ℕ+), γ k = 2 / (↑↑k + 1))
  (h2 :
    ∀ (k : ℕ+) (x' : E),
      f (Nesterov.x f f' γ x₀ ↑k) - f x' ≤
        ↑(Nesterov.l f f' γ x₀) *
            inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) (x' - Nesterov.x f f' γ x₀ ↑k) +
          ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2)
  (h3 :
    ∀ (k : ℕ+),
      f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) ≤
        ↑(Nesterov.l f f' γ x₀) *
            inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
              ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) +
          ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2)
  (k : ℕ+) (hz : γ k ≥ 0) (hzs : γ k > 0)
  (this1 :
    ↑(Nesterov.l f f' γ x₀) * γ k ^ 2 / 2 *
        (‖Nesterov.v f f' γ x₀ (↑k - 1) - xm‖ ^ 2 - ‖Nesterov.v f f' γ x₀ ↑k - xm‖ ^ 2) =
      ↑(Nesterov.l f f' γ x₀) / 2 *
        (‖Nesterov.y f f' γ x₀ k - (1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) - γ k • xm‖ ^ 2 -
          ‖Nesterov.x f f' γ x₀ ↑k - (1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) - γ k • xm‖ ^ 2))
  (h_original_goal :
    ↑(Nesterov.l f f' γ x₀) / 2 * (‖Nesterov.y f f' γ x₀ k‖ ^ 2 - ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2) +
          ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) (Nesterov.x f f' γ x₀ ↑k) +
        ↑(Nesterov.l f f' γ x₀) *
          inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
            ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) =
      ↑(Nesterov.l f f' γ x₀) / 2 * (‖Nesterov.y f f' γ x₀ k‖ ^ 2 - ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2) +
            ↑(Nesterov.l f f' γ x₀) * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 -
          ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.x f f' γ x₀ ↑k) (Nesterov.y f f' γ x₀ k) +
        ↑(Nesterov.l f f' γ x₀) *
          inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
            ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k)) :
  ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.y f f' γ x₀ k‖ ^ 2 -
          ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 +
        (↑(Nesterov.l f f' γ x₀) * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 -
          ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.y f f' γ x₀ k) (Nesterov.x f f' γ x₀ ↑k)) +
      ↑(Nesterov.l f f' γ x₀) *
        inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
          ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) =
    ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.y f f' γ x₀ k‖ ^ 2 -
            ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 +
          ↑(Nesterov.l f f' γ x₀) * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 -
        ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.x f f' γ x₀ ↑k) (Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) *
        inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
          ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
f' : E → E
xm x₀ : E
γ : ℕ+ → ℝ
alg : Nesterov f f' γ x₀
hfun : ConvexOn ℝ univ f
hg : ∀ (k : ℕ+), γ k = 2 / (↑↑k + 1)
h2 :
  ∀ (k : ℕ+) (x' : E),
    f (Nesterov.x f f' γ x₀ ↑k) - f x' ≤
      ↑(Nesterov.l f f' γ x₀) *
          inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) (x' - Nesterov.x f f' γ x₀ ↑k) +
        ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2
h3 :
  ∀ (k : ℕ+),
    f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) ≤
      ↑(Nesterov.l f f' γ x₀) *
          inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
            ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) +
        ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2
k : ℕ+
hz : γ k ≥ 0
hzs : γ k > 0
this1 :
  ↑(Nesterov.l f f' γ x₀) * γ k ^ 2 / 2 *
      (‖Nesterov.v f f' γ x₀ (↑k - 1) - xm‖ ^ 2 - ‖Nesterov.v f f' γ x₀ ↑k - xm‖ ^ 2) =
    ↑(Nesterov.l f f' γ x₀) / 2 *
      (‖Nesterov.y f f' γ x₀ k - (1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) - γ k • xm‖ ^ 2 -
        ‖Nesterov.x f f' γ x₀ ↑k - (1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) - γ k • xm‖ ^ 2)
⊢ ↑(Nesterov.l f f' γ x₀) / 2 * (‖Nesterov.y f f' γ x₀ k‖ ^ 2 - ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2) +
        ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) (Nesterov.x f f' γ x₀ ↑k) +
      ↑(Nesterov.l f f' γ x₀) *
        inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
          ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) =
    ↑(Nesterov.l f f' γ x₀) / 2 * (‖Nesterov.y f f' γ x₀ k‖ ^ 2 - ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2) +
          ↑(Nesterov.l f f' γ x₀) * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 -
        ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.x f f' γ x₀ ↑k) (Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) *
        inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
          ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k)

Tactic: rw [inner_sub_left, mul_sub, mul_sub, real_inner_self_eq_norm_sq]

Tactic state after:
[E : Type u_1
 inst✝² : NormedAddCommGroup E
 inst✝¹ : InnerProductSpace ℝ E
 inst✝ : CompleteSpace E
 f : E → ℝ
 f' : E → E
 xm x₀ : E
 γ : ℕ+ → ℝ
 alg : Nesterov f f' γ x₀
 hfun : ConvexOn ℝ univ f
 hg : ∀ (k : ℕ+), γ k = 2 / (↑↑k + 1)
 h2 :
   ∀ (k : ℕ+) (x' : E),
     f (Nesterov.x f f' γ x₀ ↑k) - f x' ≤
       ↑(Nesterov.l f f' γ x₀) *
           inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) (x' - Nesterov.x f f' γ x₀ ↑k) +
         ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2
 h3 :
   ∀ (k : ℕ+),
     f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) ≤
       ↑(Nesterov.l f f' γ x₀) *
           inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
             ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) +
         ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2
 k : ℕ+
 hz : γ k ≥ 0
 hzs : γ k > 0
 this1 :
   ↑(Nesterov.l f f' γ x₀) * γ k ^ 2 / 2 *
       (‖Nesterov.v f f' γ x₀ (↑k - 1) - xm‖ ^ 2 - ‖Nesterov.v f f' γ x₀ ↑k - xm‖ ^ 2) =
     ↑(Nesterov.l f f' γ x₀) / 2 *
       (‖Nesterov.y f f' γ x₀ k - (1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) - γ k • xm‖ ^ 2 -
         ‖Nesterov.x f f' γ x₀ ↑k - (1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) - γ k • xm‖ ^ 2)
 ⊢ ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.y f f' γ x₀ k‖ ^ 2 -
           ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 +
         (↑(Nesterov.l f f' γ x₀) * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 -
           ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.y f f' γ x₀ k) (Nesterov.x f f' γ x₀ ↑k)) +
       ↑(Nesterov.l f f' γ x₀) *
         inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
           ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k) =
     ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.y f f' γ x₀ k‖ ^ 2 -
             ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 +
           ↑(Nesterov.l f f' γ x₀) * ‖Nesterov.x f f' γ x₀ ↑k‖ ^ 2 -
         ↑(Nesterov.l f f' γ x₀) * inner (Nesterov.x f f' γ x₀ ↑k) (Nesterov.y f f' γ x₀ k) +
       ↑(Nesterov.l f f' γ x₀) *
         inner (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k)
           ((1 - γ k) • Nesterov.x f f' γ x₀ (↑k - 1) + γ k • xm - Nesterov.x f f' γ x₀ ↑k)]

Premises used:
mul_sub : ∀ {α : Type u} [inst : NonUnitalNonAssocRing α] (a b c : α), a * (b - c) = a * b - a * c
real_inner_self_eq_norm_sq : ∀ {F : Type u_3} [inst : SeminormedAddCommGroup F] [inst_3 : InnerProductSpace ℝ F]
  (x : F), inner x x = ‖x‖ ^ 2
inner_sub_left : ∀ {𝕜 : Type u_1} {E : Type u_2} [inst : RCLike 𝕜] [inst_3 : SeminormedAddCommGroup E]
  [inst_4 : InnerProductSpace 𝕜 E] (x y z : E), inner (x - y) z = inner x z - inner y z