-- File: optlib/Optlib/Algorithm/Nesterov/NesterovAccelerationFirst.lean
Theorem statement:
theorem extracted_formal_statement_79.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f h : E → ℝ} {f' : E → E} {x0 : E} {alg : Nesterov_first f h f' x0} {xm : E}
  (minφ : IsMinOn (f + h) univ xm)
  (h1 :
    ∀ (k : ℕ),
      Nesterov_first.y f h f' x0 k - Nesterov_first.x f h f' x0 (k + 1) -
          Nesterov_first.t f h f' x0 k • f' (Nesterov_first.y f h f' x0 k) ∈
        SubderivAt (Nesterov_first.t f h f' x0 k • h) (Nesterov_first.x f h f' x0 (k + 1)))
  (hieq1 :
    ∀ (z : E) (k : ℕ),
      Nesterov_first.t f h f' x0 k * h (Nesterov_first.x f h f' x0 (k + 1)) +
          inner
            (Nesterov_first.y f h f' x0 k - Nesterov_first.x f h f' x0 (k + 1) -
              Nesterov_first.t f h f' x0 k • f' (Nesterov_first.y f h f' x0 k))
            (z - Nesterov_first.x f h f' x0 (k + 1)) ≤
        Nesterov_first.t f h f' x0 k * h z)
  (hieq2 :
    ∀ (z : E) (k : ℕ),
      h (Nesterov_first.x f h f' x0 (k + 1)) ≤
        h z +
          inner
            (f' (Nesterov_first.y f h f' x0 k) +
              (1 / Nesterov_first.t f h f' x0 k) • (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k))
            (z - Nesterov_first.x f h f' x0 (k + 1)))
  (fieq1 :
    ∀ (k : ℕ) (x y : E), f x ≤ f y + inner (f' y) (x - y) + 1 / (2 * Nesterov_first.t f h f' x0 k) * ‖x - y‖ ^ 2) :
  let φ := fun z => f z + h z;
  (∀ (z : E) (k : ℕ),
      φ (Nesterov_first.x f h f' x0 (k + 1)) ≤
        φ z +
            1 / Nesterov_first.t f h f' x0 k *
              inner (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k)
                (z - Nesterov_first.x f h f' x0 (k + 1)) +
          1 / (2 * Nesterov_first.t f h f' x0 k) *
            ‖Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k‖ ^ 2) →
    let v := fun k =>
      Nesterov_first.x f h f' x0 (↑k - 1) +
        (1 / Nesterov_first.γ f h f' x0 (↑k - 1)) •
          (Nesterov_first.x f h f' x0 ↑k - Nesterov_first.x f h f' x0 (↑k - 1));
    (∀ (k : ℕ+),
        Nesterov_first.y f h f' x0 ↑k =
          (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k + Nesterov_first.γ f h f' x0 ↑k • v k) →
      (∀ (k : ℕ),
          1 / Nesterov_first.t f h f' x0 k *
                inner (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k)
                  ((1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k +
                      Nesterov_first.γ f h f' x0 k • xm -
                    Nesterov_first.x f h f' x0 (k + 1)) +
              1 / (2 * Nesterov_first.t f h f' x0 k) *
                ‖Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k‖ ^ 2 =
            1 / (2 * Nesterov_first.t f h f' x0 k) *
              (‖Nesterov_first.y f h f' x0 k - (1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k -
                      Nesterov_first.γ f h f' x0 k • xm‖ ^
                  2 -
                ‖Nesterov_first.x f h f' x0 (k + 1) -
                        (1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k -
                      Nesterov_first.γ f h f' x0 k • xm‖ ^
                  2)) →
        ∀ (k : ℕ+),
          φ (Nesterov_first.x f h f' x0 (↑k + 1)) - φ xm -
                (1 - Nesterov_first.γ f h f' x0 ↑k) * (φ (Nesterov_first.x f h f' x0 ↑k) - φ xm) ≤
              1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
                (‖Nesterov_first.y f h f' x0 ↑k - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
                        Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
                    2 -
                  ‖Nesterov_first.x f h f' x0 (↑k + 1) -
                          (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
                        Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
                    2) →
            1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
                  (‖Nesterov_first.y f h f' x0 ↑k -
                            (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
                          Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
                      2 -
                    ‖Nesterov_first.x f h f' x0 (↑k + 1) -
                            (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
                          Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
                      2) =
                Nesterov_first.γ f h f' x0 ↑k ^ 2 / (2 * Nesterov_first.t f h f' x0 ↑k) *
                  (‖v k - xm‖ ^ 2 - ‖v (k + 1) - xm‖ ^ 2) →
              1 / (2 * Nesterov_first.t f h f' x0 ↑k) * (|Nesterov_first.γ f h f' x0 ↑k| ^ 2 * ‖v k - xm‖ ^ 2) -
                  1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
                    ‖Nesterov_first.x f h f' x0 (↑k + 1) -
                            (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
                          Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
                      2 =
                Nesterov_first.γ f h f' x0 ↑k ^ 2 / (2 * Nesterov_first.t f h f' x0 ↑k) * ‖v k - xm‖ ^ 2 -
                  Nesterov_first.γ f h f' x0 ↑k ^ 2 / (2 * Nesterov_first.t f h f' x0 ↑k) *
                    ‖v (k + 1) - xm‖ ^ 2 := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f h : E → ℝ
f' : E → E
x0 : E
alg : Nesterov_first f h f' x0
xm : E
minφ : IsMinOn (f + h) univ xm
h1 :
  ∀ (k : ℕ),
    Nesterov_first.y f h f' x0 k - Nesterov_first.x f h f' x0 (k + 1) -
        Nesterov_first.t f h f' x0 k • f' (Nesterov_first.y f h f' x0 k) ∈
      SubderivAt (Nesterov_first.t f h f' x0 k • h) (Nesterov_first.x f h f' x0 (k + 1))
hieq1 :
  ∀ (z : E) (k : ℕ),
    Nesterov_first.t f h f' x0 k * h (Nesterov_first.x f h f' x0 (k + 1)) +
        inner
          (Nesterov_first.y f h f' x0 k - Nesterov_first.x f h f' x0 (k + 1) -
            Nesterov_first.t f h f' x0 k • f' (Nesterov_first.y f h f' x0 k))
          (z - Nesterov_first.x f h f' x0 (k + 1)) ≤
      Nesterov_first.t f h f' x0 k * h z
hieq2 :
  ∀ (z : E) (k : ℕ),
    h (Nesterov_first.x f h f' x0 (k + 1)) ≤
      h z +
        inner
          (f' (Nesterov_first.y f h f' x0 k) +
            (1 / Nesterov_first.t f h f' x0 k) • (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k))
          (z - Nesterov_first.x f h f' x0 (k + 1))
fieq1 : ∀ (k : ℕ) (x y : E), f x ≤ f y + inner (f' y) (x - y) + 1 / (2 * Nesterov_first.t f h f' x0 k) * ‖x - y‖ ^ 2
φ : E → ℝ := fun z => f z + h z
φieq2 :
  ∀ (z : E) (k : ℕ),
    φ (Nesterov_first.x f h f' x0 (k + 1)) ≤
      φ z +
          1 / Nesterov_first.t f h f' x0 k *
            inner (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k)
              (z - Nesterov_first.x f h f' x0 (k + 1)) +
        1 / (2 * Nesterov_first.t f h f' x0 k) * ‖Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k‖ ^ 2
v : ℕ+ → E :=
  fun k =>
    Nesterov_first.x f h f' x0 (↑k - 1) +
      (1 / Nesterov_first.γ f h f' x0 (↑k - 1)) • (Nesterov_first.x f h f' x0 ↑k - Nesterov_first.x f h f' x0 (↑k - 1))
eq :
  ∀ (k : ℕ+),
    Nesterov_first.y f h f' x0 ↑k =
      (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k + Nesterov_first.γ f h f' x0 ↑k • v k
eq2 :
  ∀ (k : ℕ),
    1 / Nesterov_first.t f h f' x0 k *
          inner (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k)
            ((1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k + Nesterov_first.γ f h f' x0 k • xm -
              Nesterov_first.x f h f' x0 (k + 1)) +
        1 / (2 * Nesterov_first.t f h f' x0 k) *
          ‖Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k‖ ^ 2 =
      1 / (2 * Nesterov_first.t f h f' x0 k) *
        (‖Nesterov_first.y f h f' x0 k - (1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k -
                Nesterov_first.γ f h f' x0 k • xm‖ ^
            2 -
          ‖Nesterov_first.x f h f' x0 (k + 1) - (1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k -
                Nesterov_first.γ f h f' x0 k • xm‖ ^
            2)
k : ℕ+
φieq3 :
  φ (Nesterov_first.x f h f' x0 (↑k + 1)) - φ xm -
      (1 - Nesterov_first.γ f h f' x0 ↑k) * (φ (Nesterov_first.x f h f' x0 ↑k) - φ xm) ≤
    1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
      (‖Nesterov_first.y f h f' x0 ↑k - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
              Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
          2 -
        ‖Nesterov_first.x f h f' x0 (↑k + 1) - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
              Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
          2)
⊢ 1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
      (‖Nesterov_first.y f h f' x0 ↑k - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
              Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
          2 -
        ‖Nesterov_first.x f h f' x0 (↑k + 1) - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
              Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
          2) =
    Nesterov_first.γ f h f' x0 ↑k ^ 2 / (2 * Nesterov_first.t f h f' x0 ↑k) * (‖v k - xm‖ ^ 2 - ‖v (k + 1) - xm‖ ^ 2)

Tactic: rw [eq k, add_sub_cancel_left, ← smul_sub, mul_sub, mul_sub, norm_smul, mul_pow, norm_eq_abs]

Tactic state after:
[E : Type u_1
 inst✝² : NormedAddCommGroup E
 inst✝¹ : InnerProductSpace ℝ E
 inst✝ : CompleteSpace E
 f h : E → ℝ
 f' : E → E
 x0 : E
 alg : Nesterov_first f h f' x0
 xm : E
 minφ : IsMinOn (f + h) univ xm
 h1 :
   ∀ (k : ℕ),
     Nesterov_first.y f h f' x0 k - Nesterov_first.x f h f' x0 (k + 1) -
         Nesterov_first.t f h f' x0 k • f' (Nesterov_first.y f h f' x0 k) ∈
       SubderivAt (Nesterov_first.t f h f' x0 k • h) (Nesterov_first.x f h f' x0 (k + 1))
 hieq1 :
   ∀ (z : E) (k : ℕ),
     Nesterov_first.t f h f' x0 k * h (Nesterov_first.x f h f' x0 (k + 1)) +
         inner
           (Nesterov_first.y f h f' x0 k - Nesterov_first.x f h f' x0 (k + 1) -
             Nesterov_first.t f h f' x0 k • f' (Nesterov_first.y f h f' x0 k))
           (z - Nesterov_first.x f h f' x0 (k + 1)) ≤
       Nesterov_first.t f h f' x0 k * h z
 hieq2 :
   ∀ (z : E) (k : ℕ),
     h (Nesterov_first.x f h f' x0 (k + 1)) ≤
       h z +
         inner
           (f' (Nesterov_first.y f h f' x0 k) +
             (1 / Nesterov_first.t f h f' x0 k) • (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k))
           (z - Nesterov_first.x f h f' x0 (k + 1))
 fieq1 : ∀ (k : ℕ) (x y : E), f x ≤ f y + inner (f' y) (x - y) + 1 / (2 * Nesterov_first.t f h f' x0 k) * ‖x - y‖ ^ 2
 φ : E → ℝ := fun z => f z + h z
 φieq2 :
   ∀ (z : E) (k : ℕ),
     φ (Nesterov_first.x f h f' x0 (k + 1)) ≤
       φ z +
           1 / Nesterov_first.t f h f' x0 k *
             inner (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k)
               (z - Nesterov_first.x f h f' x0 (k + 1)) +
         1 / (2 * Nesterov_first.t f h f' x0 k) *
           ‖Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k‖ ^ 2
 v : ℕ+ → E :=
   fun k =>
     Nesterov_first.x f h f' x0 (↑k - 1) +
       (1 / Nesterov_first.γ f h f' x0 (↑k - 1)) • (Nesterov_first.x f h f' x0 ↑k - Nesterov_first.x f h f' x0 (↑k - 1))
 eq :
   ∀ (k : ℕ+),
     Nesterov_first.y f h f' x0 ↑k =
       (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k + Nesterov_first.γ f h f' x0 ↑k • v k
 eq2 :
   ∀ (k : ℕ),
     1 / Nesterov_first.t f h f' x0 k *
           inner (Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k)
             ((1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k + Nesterov_first.γ f h f' x0 k • xm -
               Nesterov_first.x f h f' x0 (k + 1)) +
         1 / (2 * Nesterov_first.t f h f' x0 k) *
           ‖Nesterov_first.x f h f' x0 (k + 1) - Nesterov_first.y f h f' x0 k‖ ^ 2 =
       1 / (2 * Nesterov_first.t f h f' x0 k) *
         (‖Nesterov_first.y f h f' x0 k - (1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k -
                 Nesterov_first.γ f h f' x0 k • xm‖ ^
             2 -
           ‖Nesterov_first.x f h f' x0 (k + 1) - (1 - Nesterov_first.γ f h f' x0 k) • Nesterov_first.x f h f' x0 k -
                 Nesterov_first.γ f h f' x0 k • xm‖ ^
             2)
 k : ℕ+
 φieq3 :
   φ (Nesterov_first.x f h f' x0 (↑k + 1)) - φ xm -
       (1 - Nesterov_first.γ f h f' x0 ↑k) * (φ (Nesterov_first.x f h f' x0 ↑k) - φ xm) ≤
     1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
       (‖Nesterov_first.y f h f' x0 ↑k - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
               Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
           2 -
         ‖Nesterov_first.x f h f' x0 (↑k + 1) - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
               Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
           2)
 ⊢ 1 / (2 * Nesterov_first.t f h f' x0 ↑k) * (|Nesterov_first.γ f h f' x0 ↑k| ^ 2 * ‖v k - xm‖ ^ 2) -
       1 / (2 * Nesterov_first.t f h f' x0 ↑k) *
         ‖Nesterov_first.x f h f' x0 (↑k + 1) - (1 - Nesterov_first.γ f h f' x0 ↑k) • Nesterov_first.x f h f' x0 ↑k -
               Nesterov_first.γ f h f' x0 ↑k • xm‖ ^
           2 =
     Nesterov_first.γ f h f' x0 ↑k ^ 2 / (2 * Nesterov_first.t f h f' x0 ↑k) * ‖v k - xm‖ ^ 2 -
       Nesterov_first.γ f h f' x0 ↑k ^ 2 / (2 * Nesterov_first.t f h f' x0 ↑k) * ‖v (k + 1) - xm‖ ^ 2]

Premises used:
norm_smul : ∀ {α : Type u_1} {β : Type u_2} [inst : NormedDivisionRing α] [inst_3 : SeminormedAddGroup β]
  [inst_4 : MulActionWithZero α β] [inst_5 : IsBoundedSMul α β] (r : α) (x : β), ‖r • x‖ = ‖r‖ * ‖x‖
add_sub_cancel_left : ∀ {G : Type u_3} [inst : AddCommGroup G] (a b : G), a + b - a = b
Real.norm_eq_abs : ∀ (r : ℝ), ‖r‖ = |r|
mul_sub : ∀ {α : Type u} [inst : NonUnitalNonAssocRing α] (a b c : α), a * (b - c) = a * b - a * c
mul_pow : ∀ {M : Type u_4} [inst : CommMonoid M] (a b : M) (n : ℕ), (a * b) ^ n = a ^ n * b ^ n
PNat.eq : ∀ {m n : ℕ+}, ↑m = ↑n → m = n
smul_sub : ∀ {M : Type u_1} {A : Type u_7} [inst : Monoid M] [inst_3 : AddGroup A] [inst_4 : DistribMulAction M A]
  (r : M) (x y : A), r • (x - y) = r • x - r • y