zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_0.{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)) (k : ℕ+) (x' : E)
  (h_original_goal :
    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) :
  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 := 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)
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

Tactic:
rw [sub_le_iff_le_add', ← add_assoc]

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)
 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]
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_1.{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)) (k : ℕ+)
  (update2 :
    (1 / ↑(Nesterov.l f f' γ x₀)) • f' (Nesterov.y f f' γ x₀ k) = Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
  (this : Nesterov.l f f' γ x₀ > 0)
  (h_original_goal :
    f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)) :
  f' (Nesterov.y f f' γ x₀ k) =
    (↑(Nesterov.l f f' γ x₀) * (1 / ↑(Nesterov.l f f' γ x₀))) • f' (Nesterov.y 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)
k : ℕ+
x' : E
update2 : (1 / ↑(Nesterov.l f f' γ x₀)) • f' (Nesterov.y f f' γ x₀ k) = Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k
this : Nesterov.l f f' γ x₀ > 0
⊢ f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)

Tactic:
rw [← update2, smul_smul]

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)
 k : ℕ+
 x' : E
 update2 :
   (1 / ↑(Nesterov.l f f' γ x₀)) • f' (Nesterov.y f f' γ x₀ k) = Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k
 this : Nesterov.l f f' γ x₀ > 0
 ⊢ f' (Nesterov.y f f' γ x₀ k) =
     (↑(Nesterov.l f f' γ x₀) * (1 / ↑(Nesterov.l f f' γ x₀))) • f' (Nesterov.y f f' γ x₀ k)]
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_2.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)) :
  f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x' := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
⊢ f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'

Tactic:
exact Convex_first_order_condition' (alg.diff (alg.y k)) hfun (by trivial) x' (by trivial)

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_3.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x') :
  f (Nesterov.x f f' γ x₀ ↑k) ≤
    f (Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ f (Nesterov.x f f' γ x₀ ↑k) ≤
    f (Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2

Tactic:
exact lipschitz_continuos_upper_bound' alg.diff alg.smooth (alg.y k) (alg.x k)

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_5.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x') :
  f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 =
    f (Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 =
    f (Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2

Tactic:
simp

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_6.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x') :
  f (Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k + (Nesterov.x f f' γ x₀ ↑k - x')) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 =
    f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ f (Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k + (Nesterov.x f f' γ x₀ ↑k - x')) +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 =
    f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2

Tactic:
rw [inner_add_right, ← add_assoc]

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_7.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x')
  (h_original_goal :
    f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) +
          inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
        ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 ≤
      f x' + inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
        ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2) :
  f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x' := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) +
        inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 ≤
    f x' + inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2

Tactic:
rw [add_le_add_iff_right, add_le_add_iff_right]

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)
 k : ℕ+
 x' : E
 this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
 t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
 ⊢ f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x']
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_8.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x') :
  f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x' := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'

Tactic:
exact t1

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_9.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x') :
  f x' + inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 =
    f x' +
        inner (↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
          (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ f x' + inner (f' (Nesterov.y f f' γ x₀ k)) (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2 =
    f x' +
        inner (↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
          (Nesterov.x f f' γ x₀ ↑k - x') +
      ↑(Nesterov.l f f' γ x₀) / 2 * ‖Nesterov.x f f' γ x₀ ↑k - Nesterov.y f f' γ x₀ k‖ ^ 2

Tactic:
rw [this]

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_11.{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)) (k : ℕ+) (x' : E)
  (this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k))
  (t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x') :
  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 =
    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 := 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)
k : ℕ+
x' : E
this : f' (Nesterov.y f f' γ x₀ k) = ↑(Nesterov.l f f' γ x₀) • (Nesterov.y f f' γ x₀ k - Nesterov.x f f' γ x₀ ↑k)
t1 : f (Nesterov.y f f' γ x₀ k) + inner (f' (Nesterov.y f f' γ x₀ k)) (x' - Nesterov.y f f' γ x₀ k) ≤ f x'
⊢ 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 =
    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

Tactic:
simp

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_13.{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)
  (k : ℕ+)
  (this :
    f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) =
      γ k * (f (Nesterov.x f f' γ x₀ ↑k) - f xm) +
        (1 - γ k) * (f (Nesterov.x f f' γ x₀ ↑k) - f (Nesterov.x f f' γ x₀ (↑k - 1))))
  (lzero : 0 < ↑↑k + 1) (h_original_goal : γ k ≥ 0) : 2 / (↑↑k + 1) ≥ 0 := 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
k : ℕ+
this :
  f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) =
    γ k * (f (Nesterov.x f f' γ x₀ ↑k) - f xm) +
      (1 - γ k) * (f (Nesterov.x f f' γ x₀ ↑k) - f (Nesterov.x f f' γ x₀ (↑k - 1)))
lzero : 0 < ↑↑k + 1
⊢ γ k ≥ 0

Tactic:
rw [hg k]

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
 k : ℕ+
 this :
   f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) =
     γ k * (f (Nesterov.x f f' γ x₀ ↑k) - f xm) +
       (1 - γ k) * (f (Nesterov.x f f' γ x₀ ↑k) - f (Nesterov.x f f' γ x₀ (↑k - 1)))
 lzero : 0 < ↑↑k + 1
 ⊢ 2 / (↑↑k + 1) ≥ 0]
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_14.{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)
  (k : ℕ+)
  (this :
    f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) =
      γ k * (f (Nesterov.x f f' γ x₀ ↑k) - f xm) +
        (1 - γ k) * (f (Nesterov.x f f' γ x₀ ↑k) - f (Nesterov.x f f' γ x₀ (↑k - 1))))
  (lzero : 0 < ↑↑k + 1) (h_original_goal : 2 / (↑↑k + 1) ≥ 0) : 0 ≤ ↑↑k + 1 := 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
k : ℕ+
this :
  f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) =
    γ k * (f (Nesterov.x f f' γ x₀ ↑k) - f xm) +
      (1 - γ k) * (f (Nesterov.x f f' γ x₀ ↑k) - f (Nesterov.x f f' γ x₀ (↑k - 1)))
lzero : 0 < ↑↑k + 1
⊢ 2 / (↑↑k + 1) ≥ 0

Tactic:
apply div_nonneg (by norm_num)

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
 k : ℕ+
 this :
   f (Nesterov.x f f' γ x₀ ↑k) - f xm - (1 - γ k) * (f (Nesterov.x f f' γ x₀ (↑k - 1)) - f xm) =
     γ k * (f (Nesterov.x f f' γ x₀ ↑k) - f xm) +
       (1 - γ k) * (f (Nesterov.x f f' γ x₀ ↑k) - f (Nesterov.x f f' γ x₀ (↑k - 1)))
 lzero : 0 < ↑↑k + 1
 ⊢ 0 ≤ ↑↑k + 1]