zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_14.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g → f y ≥ f x + ⟪g, y - x⟫_ℝ → ‖g‖ ≠ 0 → 0 ≤ ↑G := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ⟪g, y - x⟫_ℝ
⊢ ‖g‖ ≠ 0

Tactic:
apply ne_of_gt (lt_of_le_of_lt _ h₃)

Tactic state after:
[E : Type u_1
 inst✝¹ : NormedAddCommGroup E
 inst✝ : InnerProductSpace ℝ E
 f : E → ℝ
 G : NNReal
 h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
 x g : E
 h₂ : g ∈ SubderivAt f x
 h₃ : ↑G < ‖g‖
 y : E := x + (1 / ‖g‖) • g
 hy : y = x + (1 / ‖g‖) • g
 hy₂ : f y ≥ f x + ⟪g, y - x⟫_ℝ
 ⊢ 0 ≤ ↑G]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_15.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g → f y ≥ f x + ⟪g, y - x⟫_ℝ → 0 ≤ ↑G := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ⟪g, y - x⟫_ℝ
⊢ 0 ≤ ↑G

Tactic:
simp only [NNReal.zero_le_coe]

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_16.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g → f y ≥ f x + ⟪g, y - x⟫_ℝ → ‖g‖ ≠ 0 → ‖g‖ ^ 2 = ‖g‖ * ‖g‖ := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ⟪g, y - x⟫_ℝ
hg₁ : ‖g‖ ≠ 0
⊢ ‖g‖ ^ 2 = ‖g‖ * ‖g‖

Tactic:
apply pow_two

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_17.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g → f y ≥ f x + ‖g‖ → ‖g‖ ≠ 0 → ⟪g, y - x⟫_ℝ = ‖g‖ → f y - f x ≥ f x + ‖g‖ - f x := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
⊢ f y - f x ≥ f x + ‖g‖ - f x

Tactic:
apply sub_le_sub_right hy₂

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_18.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g →
    f y ≥ f x + ‖g‖ →
      ‖g‖ ≠ 0 →
        ⟪g, y - x⟫_ℝ = ‖g‖ → f y - f x ≥ ‖g‖ → edist (f x) (f y) ≤ ↑G * edist x y → ↑G = ENNReal.ofReal ↑G := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
x✝ : f y - f x ≥ ‖g‖
h₅ : edist (f x) (f y) ≤ ↑G * edist x y
⊢ ↑G = ENNReal.ofReal ↑G

Tactic:
rw [ENNReal.ofReal_coe_nnreal]

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_19.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g →
    f y ≥ f x + ‖g‖ →
      ‖g‖ ≠ 0 →
        ⟪g, y - x⟫_ℝ = ‖g‖ →
          f y - f x ≥ ‖g‖ →
            ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) →
              ↑G = ENNReal.ofReal ↑G →
                ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) → 0 ≤ ↑G := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
x✝ : f y - f x ≥ ‖g‖
h₅ : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
hG₁ : ↑G = ENNReal.ofReal ↑G
⊢ ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)

Tactic:
apply ENNReal.ofReal_mul

Tactic state after:
[case hp
 E : Type u_1
 inst✝¹ : NormedAddCommGroup E
 inst✝ : InnerProductSpace ℝ E
 f : E → ℝ
 G : NNReal
 h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
 x g : E
 h₂ : g ∈ SubderivAt f x
 h₃ : ↑G < ‖g‖
 y : E := x + (1 / ‖g‖) • g
 hy : y = x + (1 / ‖g‖) • g
 hy₂ : f y ≥ f x + ‖g‖
 hg₁ : ‖g‖ ≠ 0
 hl : ⟪g, y - x⟫_ℝ = ‖g‖
 x✝ : f y - f x ≥ ‖g‖
 h₅ : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
 hG₁ : ↑G = ENNReal.ofReal ↑G
 ⊢ 0 ≤ ↑G]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_20.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g →
    f y ≥ f x + ‖g‖ →
      ‖g‖ ≠ 0 →
        ⟪g, y - x⟫_ℝ = ‖g‖ →
          f y - f x ≥ ‖g‖ →
            ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) →
              ↑G = ENNReal.ofReal ↑G → 0 ≤ ↑G := sorry

Tactic state before:
case hp
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
x✝ : f y - f x ≥ ‖g‖
h₅ : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y)
hG₁ : ↑G = ENNReal.ofReal ↑G
⊢ 0 ≤ ↑G

Tactic:
simp

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_21.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g →
    f y ≥ f x + ‖g‖ →
      ‖g‖ ≠ 0 →
        ⟪g, y - x⟫_ℝ = ‖g‖ →
          f y - f x ≥ ‖g‖ →
            ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y) →
              ↑G = ENNReal.ofReal ↑G →
                ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) →
                  0 ≤ ↑G * dist x y →
                    |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖) →
                      dist (f x) (f y) = |f x - f y| → f y - f x ≤ |f y - f x| := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
x✝ : f y - f x ≥ ‖g‖
h₅ : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist 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₃' : |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖)
h₁ : dist (f x) (f y) = |f x - f y|
⊢ f y - f x ≤ |f y - f x|

Tactic:
apply le_abs_self

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_22.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g →
    f y ≥ f x + ‖g‖ →
      ‖g‖ ≠ 0 →
        ⟪g, y - x⟫_ℝ = ‖g‖ →
          f y - f x ≥ ‖g‖ →
            ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y) →
              ↑G = ENNReal.ofReal ↑G →
                ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) →
                  0 ≤ ↑G * dist x y →
                    |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖) →
                      dist (f x) (f y) = |f x - f y| → |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖) := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
x✝ : f y - f x ≥ ‖g‖
h₅ : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist 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₃' : |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖)
h₁ : dist (f x) (f y) = |f x - f y|
⊢ |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖)

Tactic:
apply h₃'

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_23.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  {f : E → ℝ} {G : NNReal} (h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y) (x g : E) (h₂ : g ∈ SubderivAt f x)
  (h₃ : ↑G < ‖g‖) :
  let y := x + (1 / ‖g‖) • g;
  y = x + (1 / ‖g‖) • g →
    f y ≥ f x + ‖g‖ →
      ‖g‖ ≠ 0 →
        ⟪g, y - x⟫_ℝ = ‖g‖ →
          f y - f x ≥ ‖g‖ →
            ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist x y) →
              ↑G = ENNReal.ofReal ↑G →
                ENNReal.ofReal (↑G * dist x y) = ENNReal.ofReal ↑G * ENNReal.ofReal (dist x y) →
                  0 ≤ ↑G * dist x y →
                    |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖) → dist (f x) (f y) = |f x - f y| → ↑G < ‖g‖ := sorry

Tactic state before:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
f : E → ℝ
G : NNReal
h : ∀ (x y : E), edist (f x) (f y) ≤ ↑G * edist x y
x g : E
h₂ : g ∈ SubderivAt f x
h₃ : ↑G < ‖g‖
y : E := x + (1 / ‖g‖) • g
hy : y = x + (1 / ‖g‖) • g
hy₂ : f y ≥ f x + ‖g‖
hg₁ : ‖g‖ ≠ 0
hl : ⟪g, y - x⟫_ℝ = ‖g‖
x✝ : f y - f x ≥ ‖g‖
h₅ : ENNReal.ofReal (dist (f x) (f y)) ≤ ENNReal.ofReal (↑G * dist 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₃' : |f y - f x| ≤ ↑G * (‖1 / ‖g‖‖ * ‖g‖)
h₁ : dist (f x) (f y) = |f x - f y|
⊢ ↑G < ‖g‖

Tactic:
apply h₃

Tactic state after:
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_24.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : 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)
  (h_original_goal :
    2 * (Finset.range (k + 1)).sum (subgradient_method.a f x₀) *
        (sInf {x | ∃ i ∈ Finset.range (k + 1), f (subgradient_method.x f x₀ i) = x} - f xm) ≤
      ‖x₀ - xm‖ ^ 2 + ↑(subgradient_method.G f x₀) ^ 2 * ∑ i ∈ Finset.range (k + 1), subgradient_method.a f x₀ i ^ 2) :
  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 := 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
⊢ 2 * (Finset.range (k + 1)).sum (subgradient_method.a f x₀) *
      (sInf {x | ∃ i ∈ Finset.range (k + 1), f (subgradient_method.x f x₀ i) = x} - f xm) ≤
    ‖x₀ - xm‖ ^ 2 + ↑(subgradient_method.G f x₀) ^ 2 * ∑ i ∈ Finset.range (k + 1), subgradient_method.a f x₀ i ^ 2

Tactic:
simp [k₀]

Tactic state after:
[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
 ⊢ 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]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_25.{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) ≤
    ‖x₀ - xm‖ ^ 2 + (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0) ^ 2 := 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]

Tactic state after:
[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₀) * subgradient_method.a f x₀ 0) ^ 2]
import Mathlib
import Optlib


open Filter Topology Set InnerProductSpace Finset

open Finset

theorem extracted_formal_statement_26.{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₀) * 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₀) * subgradient_method.a f x₀ 0) ^ 2

Tactic:
apply le_trans _ (two_mul_le_add_sq _ _)

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_27.{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) ≤
      2 * ‖x₀ - xm‖ * (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0)) :
  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:
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)

Tactic:
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_28.{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)) ≤
      2 * (‖x₀ - xm‖ * (↑(subgradient_method.G f x₀) * subgradient_method.a f x₀ 0))) :
  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) := 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₀)
⊢ 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))

Tactic:
apply (mul_le_mul_left two_pos).mpr

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₀)
 ⊢ 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)]