-- File: optlib/Optlib/Algorithm/Nesterov/NesterovAccelerationSecond.lean
Theorem statement:
theorem extracted_formal_statement_4.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {x0 : E} {f h : E → ℝ} {f' : E → E} {alg : Nesterov_second f h f' x0} {xm : E}
  (minφ : IsMinOn (f + h) univ xm) :
  let φ := fun z => f z + h z;
  (∀ (z : E), φ z = f z + h z) →
    ∀ (k : ℕ+),
      Nesterov_second.y f h f' x0 (↑k - 1) -
              (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • f' (Nesterov_second.z f h f' x0 k) -
            Nesterov_second.y f h f' x0 ↑k ∈
          SubderivAt ((Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • h)
            (Nesterov_second.y f h f' x0 ↑k) →
        SubderivAt (Nesterov_second.t f h f' x0 ↑k • h) (Nesterov_second.y f h f' x0 ↑k) =
            Nesterov_second.γ f h f' x0 ↑k •
              SubderivAt ((Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • h)
                (Nesterov_second.y f h f' x0 ↑k) →
          Nesterov_second.γ f h f' x0 ↑k •
                (Nesterov_second.y f h f' x0 (↑k - 1) -
                    (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) •
                      f' (Nesterov_second.z f h f' x0 k) -
                  Nesterov_second.y f h f' x0 ↑k) =
              Nesterov_second.γ f h f' x0 ↑k • (Nesterov_second.y f h f' x0 (↑k - 1) - Nesterov_second.y f h f' x0 ↑k) -
                Nesterov_second.t f h f' x0 ↑k • f' (Nesterov_second.z f h f' x0 k) →
            Nesterov_second.γ f h f' x0 ↑k • (Nesterov_second.y f h f' x0 (↑k - 1) - Nesterov_second.y f h f' x0 ↑k) -
                (Nesterov_second.γ f h f' x0 ↑k * (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k)) •
                  f' (Nesterov_second.z f h f' x0 k) =
              Nesterov_second.γ f h f' x0 ↑k • (Nesterov_second.y f h f' x0 (↑k - 1) - Nesterov_second.y f h f' x0 ↑k) -
                Nesterov_second.t f h f' x0 ↑k • f' (Nesterov_second.z f h f' x0 k) := sorry

Tactic state before:
case h.right
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
x0 : E
f h : E → ℝ
f' : E → E
alg : Nesterov_second f h f' x0
xm : E
minφ : IsMinOn (f + h) univ xm
φ : E → ℝ := fun z => f z + h z
φdef : ∀ (z : E), φ z = f z + h z
k : ℕ+
h1 :
  Nesterov_second.y f h f' x0 (↑k - 1) -
        (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • f' (Nesterov_second.z f h f' x0 k) -
      Nesterov_second.y f h f' x0 ↑k ∈
    SubderivAt ((Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • h) (Nesterov_second.y f h f' x0 ↑k)
upd2 :
  SubderivAt (Nesterov_second.t f h f' x0 ↑k • h) (Nesterov_second.y f h f' x0 ↑k) =
    Nesterov_second.γ f h f' x0 ↑k •
      SubderivAt ((Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • h)
        (Nesterov_second.y f h f' x0 ↑k)
⊢ Nesterov_second.γ f h f' x0 ↑k •
      (Nesterov_second.y f h f' x0 (↑k - 1) -
          (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • f' (Nesterov_second.z f h f' x0 k) -
        Nesterov_second.y f h f' x0 ↑k) =
    Nesterov_second.γ f h f' x0 ↑k • (Nesterov_second.y f h f' x0 (↑k - 1) - Nesterov_second.y f h f' x0 ↑k) -
      Nesterov_second.t f h f' x0 ↑k • f' (Nesterov_second.z f h f' x0 k)

Tactic: rw [sub_right_comm, smul_sub, ← smul_assoc, smul_eq_mul]

Tactic state after:
[case h.right
 E : Type u_1
 inst✝² : NormedAddCommGroup E
 inst✝¹ : InnerProductSpace ℝ E
 inst✝ : CompleteSpace E
 x0 : E
 f h : E → ℝ
 f' : E → E
 alg : Nesterov_second f h f' x0
 xm : E
 minφ : IsMinOn (f + h) univ xm
 φ : E → ℝ := fun z => f z + h z
 φdef : ∀ (z : E), φ z = f z + h z
 k : ℕ+
 h1 :
   Nesterov_second.y f h f' x0 (↑k - 1) -
         (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • f' (Nesterov_second.z f h f' x0 k) -
       Nesterov_second.y f h f' x0 ↑k ∈
     SubderivAt ((Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • h) (Nesterov_second.y f h f' x0 ↑k)
 upd2 :
   SubderivAt (Nesterov_second.t f h f' x0 ↑k • h) (Nesterov_second.y f h f' x0 ↑k) =
     Nesterov_second.γ f h f' x0 ↑k •
       SubderivAt ((Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k) • h)
         (Nesterov_second.y f h f' x0 ↑k)
 ⊢ Nesterov_second.γ f h f' x0 ↑k • (Nesterov_second.y f h f' x0 (↑k - 1) - Nesterov_second.y f h f' x0 ↑k) -
       (Nesterov_second.γ f h f' x0 ↑k * (Nesterov_second.t f h f' x0 ↑k / Nesterov_second.γ f h f' x0 ↑k)) •
         f' (Nesterov_second.z f h f' x0 k) =
     Nesterov_second.γ f h f' x0 ↑k • (Nesterov_second.y f h f' x0 (↑k - 1) - Nesterov_second.y f h f' x0 ↑k) -
       Nesterov_second.t f h f' x0 ↑k • f' (Nesterov_second.z f h f' x0 k)]

Premises used:
sub_right_comm : ∀ {α : Type u_1} [inst : SubtractionCommMonoid α] (a b c : α), a - b - c = a - c - b
smul_eq_mul : ∀ {α : Type u_9} [inst : Mul α] (a b : α), a • b = a * b
smul_assoc : ∀ {α : Type u_5} {M : Type u_9} {N : Type u_10} [inst : SMul M N] [inst_3 : SMul N α] [inst_4 : SMul M α]
  [inst_5 : IsScalarTower M N α] (x : M) (y : N) (z : α), (x • y) • z = x • y • z
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