zzhisthebest/LeanBenchmark huggingface dataset:
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] [inst_3 : ProperSpace E] {x₀ : E} {f : E → ℝ} {f' : E → E} {h : E → ℝ}
  {alg : proximal_gradient_method f h f' x₀} (k : ℕ+)
  (h_original_goal :
    f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
          f (proximal_gradient_method.xm f h f' x₀) -
        h (proximal_gradient_method.xm f h f' x₀) ≤
      1 / (2 * ↑↑k * proximal_gradient_method.t f h f' x₀) * ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2) :
  0 < 2 * ↑↑k * proximal_gradient_method.t f h f' x₀ := sorry

Tactic state before:
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : ProperSpace E
x₀ : E
f : E → ℝ
f' : E → E
h : E → ℝ
alg : proximal_gradient_method f h f' x₀
k : ℕ+
⊢ f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
        f (proximal_gradient_method.xm f h f' x₀) -
      h (proximal_gradient_method.xm f h f' x₀) ≤
    1 / (2 * ↑↑k * proximal_gradient_method.t f h f' x₀) * ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2

Tactic:
rw [mul_comm, mul_one_div, le_div_iff₀, mul_comm]
    have th : ContinuousOn (alg.t • h) univ := by apply ContinuousOn.const_smul alg.h₃ alg.t
    have th' : ConvexOn ℝ univ (alg.t • h) := by to_theorem apply ConvexOn.smul;linarith [alg.tpos];apply alg.hconv

Tactic state after:
[E : Type u_1
 inst✝³ : NormedAddCommGroup E
 inst✝² : InnerProductSpace ℝ E
 inst✝¹ : CompleteSpace E
 inst✝ : ProperSpace E
 x₀ : E
 f : E → ℝ
 f' : E → E
 h : E → ℝ
 alg : proximal_gradient_method f h f' x₀
 k : ℕ+
 th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
 th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)
 ⊢ 2 * ↑↑k * proximal_gradient_method.t f h f' x₀ *
       (f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
           f (proximal_gradient_method.xm f h f' x₀) -
         h (proximal_gradient_method.xm f h f' x₀)) ≤
     ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2,
 E : Type u_1
 inst✝³ : NormedAddCommGroup E
 inst✝² : InnerProductSpace ℝ E
 inst✝¹ : CompleteSpace E
 inst✝ : ProperSpace E
 x₀ : E
 f : E → ℝ
 f' : E → E
 h : E → ℝ
 alg : proximal_gradient_method f h f' x₀
 k : ℕ+
 ⊢ 0 < 2 * ↑↑k * proximal_gradient_method.t f h f' x₀]
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] [inst_3 : ProperSpace E] {x₀ : E} {f : E → ℝ} {f' : E → E} {h : E → ℝ}
  {alg : proximal_gradient_method f h f' x₀} (th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ) :
  ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h) := sorry

Tactic state before:
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : ProperSpace E
x₀ : E
f : E → ℝ
f' : E → E
h : E → ℝ
alg : proximal_gradient_method f h f' x₀
k : ℕ+
th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
⊢ ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)

Tactic:
apply ConvexOn.smul
    linarith [alg.tpos]
    apply alg.hconv

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] [inst_3 : ProperSpace E] {x₀ : E} {f : E → ℝ} {f' : E → E} {h : E → ℝ}
  {alg : proximal_gradient_method f h f' x₀} (th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ)
  (th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)) :
  let Gt := fun x =>
    (1 / proximal_gradient_method.t f h f' x₀) •
      (x -
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
          th');
  ∀ (z : E),
    z - proximal_gradient_method.t f h f' x₀ • Gt z =
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (z - proximal_gradient_method.t f h f' x₀ • f' z) th
          th' →
      proximal_gradient_method.t f h f' x₀ ≠ 0 := sorry

Tactic state before:
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : ProperSpace E
x₀ : E
f : E → ℝ
f' : E → E
h : E → ℝ
alg : proximal_gradient_method f h f' x₀
k : ℕ+
th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)
Gt : E → E :=
  fun x =>
    (1 / proximal_gradient_method.t f h f' x₀) •
      (x -
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
          th')
φ : E → ℝ := fun x => f x + h x
z : E
⊢ z - proximal_gradient_method.t f h f' x₀ • Gt z =
    prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (z - proximal_gradient_method.t f h f' x₀ • f' z) th th'

Tactic:
simp [Gt]
    rw [smul_inv_smul₀, ← sub_add]
    simp

Tactic state after:
[case ha
 E : Type u_1
 inst✝³ : NormedAddCommGroup E
 inst✝² : InnerProductSpace ℝ E
 inst✝¹ : CompleteSpace E
 inst✝ : ProperSpace E
 x₀ : E
 f : E → ℝ
 f' : E → E
 h : E → ℝ
 alg : proximal_gradient_method f h f' x₀
 k : ℕ+
 th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
 th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)
 Gt : E → E :=
   fun x =>
     (1 / proximal_gradient_method.t f h f' x₀) •
       (x -
         prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
           th')
 φ : E → ℝ := fun x => f x + h x
 z : E
 ⊢ proximal_gradient_method.t f h f' x₀ ≠ 0]
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_4.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] [inst_3 : ProperSpace E] {x₀ : E} {f : E → ℝ} {f' : E → E} {h : E → ℝ}
  {alg : proximal_gradient_method f h f' x₀} (th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ)
  (th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)) :
  let Gt := fun x =>
    (1 / proximal_gradient_method.t f h f' x₀) •
      (x -
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
          th');
  ∀ (z : E),
    z - proximal_gradient_method.t f h f' x₀ • Gt z =
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (z - proximal_gradient_method.t f h f' x₀ • f' z) th
          th' →
      prox_prop (proximal_gradient_method.t f h f' x₀ • h) (z - proximal_gradient_method.t f h f' x₀ • f' z)
        (z - proximal_gradient_method.t f h f' x₀ • Gt z) := sorry

Tactic state before:
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : ProperSpace E
x₀ : E
f : E → ℝ
f' : E → E
h : E → ℝ
alg : proximal_gradient_method f h f' x₀
k : ℕ+
th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)
Gt : E → E :=
  fun x =>
    (1 / proximal_gradient_method.t f h f' x₀) •
      (x -
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
          th')
φ : E → ℝ := fun x => f x + h x
z : E
eq1 :
  z - proximal_gradient_method.t f h f' x₀ • Gt z =
    prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (z - proximal_gradient_method.t f h f' x₀ • f' z) th th'
⊢ prox_prop (proximal_gradient_method.t f h f' x₀ • h) (z - proximal_gradient_method.t f h f' x₀ • f' z)
    (z - proximal_gradient_method.t f h f' x₀ • Gt z)

Tactic:
rw [prox_point_c'] at eq1
    rw [eq1]
    apply Classical.choose_spec

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_12.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] [inst_3 : ProperSpace E] {x₀ : E} {f : E → ℝ} {f' : E → E} {h : E → ℝ}
  {alg : proximal_gradient_method f h f' x₀} (th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ)
  (th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)) :
  let Gt := fun x =>
    (1 / proximal_gradient_method.t f h f' x₀) •
      (x -
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
          th');
  (∀ (z : E), Gt z - f' z ∈ SubderivAt h (z - proximal_gradient_method.t f h f' x₀ • Gt z)) →
    (∀ (x : E),
        f (x - proximal_gradient_method.t f h f' x₀ • Gt x) ≤
          f x - proximal_gradient_method.t f h f' x₀ * inner (f' x) (Gt x) +
            proximal_gradient_method.t f h f' x₀ ^ 2 * ↑(proximal_gradient_method.L f h f' x₀) / 2 * ‖Gt x‖ ^ 2) →
      (∀ (x : E),
          f (x - proximal_gradient_method.t f h f' x₀ • Gt x) ≤
            f x - proximal_gradient_method.t f h f' x₀ * inner (f' x) (Gt x) +
              proximal_gradient_method.t f h f' x₀ / 2 * ‖Gt x‖ ^ 2) →
        ∀ (x z : E), f x + inner (f' x) (z - x) ≤ f z := sorry

Tactic state before:
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : ProperSpace E
x₀ : E
f : E → ℝ
f' : E → E
h : E → ℝ
alg : proximal_gradient_method f h f' x₀
k : ℕ+
th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)
Gt : E → E :=
  fun x =>
    (1 / proximal_gradient_method.t f h f' x₀) •
      (x -
        prox_point_c' (proximal_gradient_method.t f h f' x₀ • h) (x - proximal_gradient_method.t f h f' x₀ • f' x) th
          th')
φ : E → ℝ := fun x => f x + h x
hG : ∀ (z : E), Gt z - f' z ∈ SubderivAt h (z - proximal_gradient_method.t f h f' x₀ • Gt z)
fieq1 :
  ∀ (x : E),
    f (x - proximal_gradient_method.t f h f' x₀ • Gt x) ≤
      f x - proximal_gradient_method.t f h f' x₀ * inner (f' x) (Gt x) +
        proximal_gradient_method.t f h f' x₀ ^ 2 * ↑(proximal_gradient_method.L f h f' x₀) / 2 * ‖Gt x‖ ^ 2
fieq2 :
  ∀ (x : E),
    f (x - proximal_gradient_method.t f h f' x₀ • Gt x) ≤
      f x - proximal_gradient_method.t f h f' x₀ * inner (f' x) (Gt x) +
        proximal_gradient_method.t f h f' x₀ / 2 * ‖Gt x‖ ^ 2
x z : E
⊢ f x + inner (f' x) (z - x) ≤ f z

Tactic:
apply Convex_first_order_condition' (alg.h₁ x) alg.fconv
    simp
    simp

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_0.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {G : NNReal} (hf : ConvexOn ℝ Set.univ f) (hc : ContinuousOn f Set.univ)
  (h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G) (x y gx : E) (hx₁ : gx ∈ SubderivAt f x) (hx₃ : ‖gx‖ ≤ ↑G)
  (hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ) (hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ) (gy : E) (hy₁ : gy ∈ SubderivAt f y)
  (hy₃ : ‖gy‖ ≤ ↑G) (hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ) (hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ) (hG₁ : ↑G = ENNReal.ofReal ↑G)
  (h_original_goal : edist (f x) (f y) ≤ ↑G * edist x y) :
  ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y) := sorry

Tactic state before:
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
G : NNReal
hf : ConvexOn ℝ Set.univ f
hc : ContinuousOn f Set.univ
h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
x y gx : E
hx₁ : gx ∈ SubderivAt f x
hx₃ : ‖gx‖ ≤ ↑G
hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
gy : E
hy₁ : gy ∈ SubderivAt f y
hy₃ : ‖gy‖ ≤ ↑G
hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
hG₁ : ↑G = ENNReal.ofReal ↑G
⊢ edist (f x) (f y) ≤ ↑G * edist x y

Tactic:
rw [edist_dist, edist_dist, hG₁]
    have hG₂ : ENNReal.ofReal (↑G * (dist x y)) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) := by
  apply ENNReal.ofReal_mul; simp
    rw [← hG₂]

Tactic state after:
[case intro.intro
 E : Type u_1
 inst✝² : NormedAddCommGroup E
 inst✝¹ : InnerProductSpace ℝ E
 inst✝ : CompleteSpace E
 f : E → ℝ
 G : NNReal
 hf : ConvexOn ℝ Set.univ f
 hc : ContinuousOn f Set.univ
 h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
 x y gx : E
 hx₁ : gx ∈ SubderivAt f x
 hx₃ : ‖gx‖ ≤ ↑G
 hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
 hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
 gy : E
 hy₁ : gy ∈ SubderivAt f y
 hy₃ : ‖gy‖ ≤ ↑G
 hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
 hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
 hG₁ : ↑G = ENNReal.ofReal ↑G
 hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
 ⊢ ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y)]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_1.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {G : NNReal} (hf : ConvexOn ℝ Set.univ f) (hc : ContinuousOn f Set.univ)
  (h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G) (x y gx : E) (hx₁ : gx ∈ SubderivAt f x) (hx₃ : ‖gx‖ ≤ ↑G)
  (hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ) (hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ) (gy : E) (hy₁ : gy ∈ SubderivAt f y)
  (hy₃ : ‖gy‖ ≤ ↑G) (hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ) (hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ) (hG₁ : ↑G = ENNReal.ofReal ↑G)
  (hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)) (hG₃ : 0 ≤ ↑G * dist x y)
  (h_original_goal : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y)) :
  |f x - f y| ≤ ↑G * ‖x - y‖ := sorry

Tactic state before:
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
G : NNReal
hf : ConvexOn ℝ Set.univ f
hc : ContinuousOn f Set.univ
h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
x y gx : E
hx₁ : gx ∈ SubderivAt f x
hx₃ : ‖gx‖ ≤ ↑G
hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
gy : E
hy₁ : gy ∈ SubderivAt f y
hy₃ : ‖gy‖ ≤ ↑G
hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
hG₁ : ↑G = ENNReal.ofReal ↑G
hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
hG₃ : 0 ≤ ↑G * dist x y
⊢ ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y)

Tactic:
apply (ENNReal.ofReal_le_ofReal_iff hG₃).mpr
    have h₁ : dist (f x) (f y) = |f x - f y| := rfl
    rw [h₁, dist_eq_norm x y]

Tactic state after:
[case intro.intro
 E : Type u_1
 inst✝² : NormedAddCommGroup E
 inst✝¹ : InnerProductSpace ℝ E
 inst✝ : CompleteSpace E
 f : E → ℝ
 G : NNReal
 hf : ConvexOn ℝ Set.univ f
 hc : ContinuousOn f Set.univ
 h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
 x y gx : E
 hx₁ : gx ∈ SubderivAt f x
 hx₃ : ‖gx‖ ≤ ↑G
 hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
 hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
 gy : E
 hy₁ : gy ∈ SubderivAt f y
 hy₃ : ‖gy‖ ≤ ↑G
 hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
 hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
 hG₁ : ↑G = ENNReal.ofReal ↑G
 hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
 hG₃ : 0 ≤ ↑G * dist x y
 h₁ : dist (f x) (f y) = |f x - f y|
 ⊢ |f x - f y| ≤ ↑G * ‖x - y‖]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_2.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {G : NNReal} (hf : ConvexOn ℝ Set.univ f) (hc : ContinuousOn f Set.univ)
  (h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G) (x y gx : E) (hx₁ : gx ∈ SubderivAt f x) (hx₃ : ‖gx‖ ≤ ↑G)
  (hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ) (hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ) (gy : E) (hy₁ : gy ∈ SubderivAt f y)
  (hy₃ : ‖gy‖ ≤ ↑G) (hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ) (hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ) (hG₁ : ↑G = ENNReal.ofReal ↑G)
  (hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)) (hG₃ : 0 ≤ ↑G * dist x y)
  (h₁ : dist (f x) (f y) = |f x - f y|) (h_original_goal : |f x - f y| ≤ ↑G * ‖x - y‖) :
  f x - f y ≤ ↑G * ‖x - y‖ := sorry

Tactic state before:
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
G : NNReal
hf : ConvexOn ℝ Set.univ f
hc : ContinuousOn f Set.univ
h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
x y gx : E
hx₁ : gx ∈ SubderivAt f x
hx₃ : ‖gx‖ ≤ ↑G
hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
gy : E
hy₁ : gy ∈ SubderivAt f y
hy₃ : ‖gy‖ ≤ ↑G
hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
hG₁ : ↑G = ENNReal.ofReal ↑G
hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
hG₃ : 0 ≤ ↑G * dist x y
h₁ : dist (f x) (f y) = |f x - f y|
⊢ |f x - f y| ≤ ↑G * ‖x - y‖

Tactic:
apply abs_le.mpr
    constructor
    ·
  calc
    f x - f y ≥ inner gy (x - y) := hy₄
    _ ≥ -(‖gy‖ * ‖x - y‖) := by
      to_theorem apply neg_le_of_neg_le rw [← inner_neg_right, neg_sub, norm_sub_rev]apply real_inner_le_norm
    _ ≥ -(↑G * ‖x - y‖) := neg_le_neg (mul_le_mul_of_nonneg_right hy₃ (norm_nonneg _))

Tactic state after:
[case intro.intro.right
 E : Type u_1
 inst✝² : NormedAddCommGroup E
 inst✝¹ : InnerProductSpace ℝ E
 inst✝ : CompleteSpace E
 f : E → ℝ
 G : NNReal
 hf : ConvexOn ℝ Set.univ f
 hc : ContinuousOn f Set.univ
 h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
 x y gx : E
 hx₁ : gx ∈ SubderivAt f x
 hx₃ : ‖gx‖ ≤ ↑G
 hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
 hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
 gy : E
 hy₁ : gy ∈ SubderivAt f y
 hy₃ : ‖gy‖ ≤ ↑G
 hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
 hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
 hG₁ : ↑G = ENNReal.ofReal ↑G
 hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
 hG₃ : 0 ≤ ↑G * dist x y
 h₁ : dist (f x) (f y) = |f x - f y|
 ⊢ f x - f y ≤ ↑G * ‖x - y‖]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_3.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {G : NNReal} (hf : ConvexOn ℝ Set.univ f) (hc : ContinuousOn f Set.univ)
  (h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G) (x y gx : E) (hx₁ : gx ∈ SubderivAt f x) (hx₃ : ‖gx‖ ≤ ↑G)
  (hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ) (hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ) (gy : E) (hy₁ : gy ∈ SubderivAt f y)
  (hy₃ : ‖gy‖ ≤ ↑G) (hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ) (hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ) (hG₁ : ↑G = ENNReal.ofReal ↑G)
  (hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)) (hG₃ : 0 ≤ ↑G * dist x y)
  (h₁ : dist (f x) (f y) = |f x - f y|) : ⟪gy, x - y⟫_ℝ ≥ -(‖gy‖ * ‖x - y‖) := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
G : NNReal
hf : ConvexOn ℝ Set.univ f
hc : ContinuousOn f Set.univ
h : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑G
x y gx : E
hx₁ : gx ∈ SubderivAt f x
hx₃ : ‖gx‖ ≤ ↑G
hx₂ : f y ≥ f x + ⟪gx, y - x⟫_ℝ
hx₄ : f x - f y ≤ ⟪gx, x - y⟫_ℝ
gy : E
hy₁ : gy ∈ SubderivAt f y
hy₃ : ‖gy‖ ≤ ↑G
hy₂ : f x ≥ f y + ⟪gy, x - y⟫_ℝ
hy₄ : f x - f y ≥ ⟪gy, x - y⟫_ℝ
hG₁ : ↑G = ENNReal.ofReal ↑G
hG₂ : ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
hG₃ : 0 ≤ ↑G * dist x y
h₁ : dist (f x) (f y) = |f x - f y|
⊢ ⟪gy, x - y⟫_ℝ ≥ -(‖gy‖ * ‖x - y‖)

Tactic:
apply neg_le_of_neg_le
    rw [← inner_neg_right, neg_sub, norm_sub_rev]
    apply real_inner_le_norm

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_4.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} (xm x₀ : E) {alg : subgradient_method f x₀}
  (h' : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑(subgradient_method.G f x₀))
  (hk₀ : f xm ≥ f (subgradient_method.x f x₀ 0) + ⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ)
  (h₀' : ‖subgradient_method.g f x₀ 0‖ ≤ ↑(subgradient_method.G f x₀))
  (h_original_goal :
    2 * subgradient_method.a f x₀ 0 * (f (subgradient_method.x f x₀ 0) - f xm) ≤
      ‖x₀ - xm‖ ^ 2 + ↑(subgradient_method.G f x₀) ^ 2 * subgradient_method.a f x₀ 0 ^ 2) :
  2 * (subgradient_method.a f x₀ 0 * (f (subgradient_method.x f x₀ 0) - f xm)) ≤
    2 * (‖x₀ - xm‖ * (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0)) := sorry

Tactic state before:
case pos
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
xm x₀ : E
alg : subgradient_method f x₀
k : ℕ
h' : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑(subgradient_method.G f x₀)
k₀ : k = 0
hk₀ : f xm ≥ f (subgradient_method.x f x₀ 0) + ⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ
h₀' : ‖subgradient_method.g f x₀ 0‖ ≤ ↑(subgradient_method.G f x₀)
⊢ 2 * subgradient_method.a f x₀ 0 * (f (subgradient_method.x f x₀ 0) - f xm) ≤
    ‖x₀ - xm‖ ^ 2 + ↑(subgradient_method.G f x₀) ^ 2 * subgradient_method.a f x₀ 0 ^ 2

Tactic:
rw [← mul_pow]
    apply le_trans _ (two_mul_le_add_sq _ _)
    rw [mul_assoc, mul_assoc]

Tactic state after:
[E : Type u_1
 inst✝¹ : NormedAddCommGroup E
 inst✝ : InnerProductSpace ℝ E
 f : E → ℝ
 xm x₀ : E
 alg : subgradient_method f x₀
 k : ℕ
 h' : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑(subgradient_method.G f x₀)
 k₀ : k = 0
 hk₀ : f xm ≥ f (subgradient_method.x f x₀ 0) + ⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ
 h₀' : ‖subgradient_method.g f x₀ 0‖ ≤ ↑(subgradient_method.G f x₀)
 ⊢ 2 * (subgradient_method.a f x₀ 0 * (f (subgradient_method.x f x₀ 0) - f xm)) ≤
     2 * (‖x₀ - xm‖ * (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0))]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_5.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} (xm x₀ : E) {alg : subgradient_method f x₀}
  (h' : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑(subgradient_method.G f x₀))
  (hk₀ : f xm ≥ f (subgradient_method.x f x₀ 0) + ⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ)
  (h₀' : ‖subgradient_method.g f x₀ 0‖ ≤ ↑(subgradient_method.G f x₀))
  (h_original_goal :
    subgradient_method.a f x₀ 0 * (f (subgradient_method.x f x₀ 0) - f xm) ≤
      ‖x₀ - xm‖ * (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0)) :
  f (subgradient_method.x f x₀ 0) - f xm ≤ ‖x₀ - xm‖ * ↑(subgradient_method.G f x₀) := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
xm x₀ : E
alg : subgradient_method f x₀
k : ℕ
h' : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑(subgradient_method.G f x₀)
k₀ : k = 0
hk₀ : f xm ≥ f (subgradient_method.x f x₀ 0) + ⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ
h₀' : ‖subgradient_method.g f x₀ 0‖ ≤ ↑(subgradient_method.G f x₀)
⊢ subgradient_method.a f x₀ 0 * (f (subgradient_method.x f x₀ 0) - f xm) ≤
    ‖x₀ - xm‖ * (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0)

Tactic:
rw [mul_comm, ← mul_assoc]
    apply (mul_le_mul_right (alg.ha 0)).mpr
    have : f (alg.x 0) - f xm ≤ -inner (alg.g 0) (xm - alg.x 0) := by to_theorem simp [hk₀];rw [add_comm];apply hk₀

Tactic state after:
[E : Type u_1
 inst✝¹ : NormedAddCommGroup E
 inst✝ : InnerProductSpace ℝ E
 f : E → ℝ
 xm x₀ : E
 alg : subgradient_method f x₀
 k : ℕ
 h' : ∀ ⦃x g : E⦄, g ∈ SubderivAt f x → ‖g‖ ≤ ↑(subgradient_method.G f x₀)
 k₀ : k = 0
 hk₀ : f xm ≥ f (subgradient_method.x f x₀ 0) + ⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ
 h₀' : ‖subgradient_method.g f x₀ 0‖ ≤ ↑(subgradient_method.G f x₀)
 this : f (subgradient_method.x f x₀ 0) - f xm ≤ -⟪subgradient_method.g f x₀ 0, xm - subgradient_method.x f x₀ 0⟫_ℝ
 ⊢ f (subgradient_method.x f x₀ 0) - f xm ≤ ‖x₀ - xm‖ * ↑(subgradient_method.G f x₀)]