zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_91.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {m : ℝ} {f' : E → E} {xm x₀ : E} {alg : Gradient_Descent_fix_stepsize f f' x₀}
  (hm : m > 0) (min : IsMinOn f univ xm)
  (step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
  (hsc : StrongConvexOn univ m f) (this_1 : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f')
  (this_2 : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0)
  (reduction :
    ∀ (k : ℕ),
      ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
        (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
          ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2)
  (this : 0 < m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) :
  0 ≤ (m - ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) ^ 2 := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
m : ℝ
f' : E → E
xm x₀ : E
alg : Gradient_Descent_fix_stepsize f f' x₀
hm : m > 0
min : IsMinOn f univ xm
step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))
hsc : StrongConvexOn univ m f
this✝¹ : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f'
this✝ : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0
reduction :
  ∀ (k : ℕ),
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
      (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
        ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2
this : 0 < m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)
⊢ 0 ≤ (m - ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) ^ 2

Tactic:
apply sq_nonneg

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_93.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {m : ℝ} {f' : E → E} {xm x₀ : E} {alg : Gradient_Descent_fix_stepsize f f' x₀}
  (hm : m > 0) (min : IsMinOn f univ xm)
  (step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
  (hsc : StrongConvexOn univ m f) (this_1 : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f')
  (this_2 : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0)
  (reduction :
    ∀ (k : ℕ),
      ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
        (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
          ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2)
  (this : 0 < m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) :
  (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) * (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) /
      (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) =
    m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀) := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
m : ℝ
f' : E → E
xm x₀ : E
alg : Gradient_Descent_fix_stepsize f f' x₀
hm : m > 0
min : IsMinOn f univ xm
step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))
hsc : StrongConvexOn univ m f
this✝¹ : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f'
this✝ : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0
reduction :
  ∀ (k : ℕ),
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
      (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
        ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2
this : 0 < m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)
⊢ (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) * (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) /
      (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)) =
    m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)

Tactic:
simp

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_95.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {m : ℝ} {f' : E → E} {xm x₀ : E} {alg : Gradient_Descent_fix_stepsize f f' x₀}
  (hm : m > 0) (min : IsMinOn f univ xm)
  (step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
  (hsc : StrongConvexOn univ m f) (this_1 : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f')
  (this : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0)
  (reduction :
    ∀ (k : ℕ),
      ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
        (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
          ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2)
  (eq :
    0 ≤
      1 -
        Gradient_Descent_fix_stepsize.a f f' x₀ *
          (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) :
  ‖Gradient_Descent_fix_stepsize.x f f' x₀ 0 - xm‖ ^ 2 ≤ ‖x₀ - xm‖ ^ 2 := sorry

Tactic state before:
case zero
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
m : ℝ
f' : E → E
xm x₀ : E
alg : Gradient_Descent_fix_stepsize f f' x₀
hm : m > 0
min : IsMinOn f univ xm
step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))
hsc : StrongConvexOn univ m f
this✝ : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f'
this : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0
reduction :
  ∀ (k : ℕ),
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
      (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
        ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2
eq :
  0 ≤
    1 -
      Gradient_Descent_fix_stepsize.a f f' x₀ *
        (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
⊢ ‖Gradient_Descent_fix_stepsize.x f f' x₀ 0 - xm‖ ^ 2 ≤ ‖x₀ - xm‖ ^ 2

Tactic:
rw [alg.initial]

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_96.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {m : ℝ} {f' : E → E} {xm x₀ : E} {alg : Gradient_Descent_fix_stepsize f f' x₀}
  (hm : m > 0) (min : IsMinOn f univ xm)
  (step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
  (hsc : StrongConvexOn univ m f) (this_1 : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f')
  (this : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0)
  (reduction :
    ∀ (k : ℕ),
      ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
        (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
          ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2)
  (eq :
    0 ≤
      1 -
        Gradient_Descent_fix_stepsize.a f f' x₀ *
          (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))))
  (q : ℕ)
  (IH1 :
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ q - xm‖ ^ 2 ≤
      (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) ^
          q *
        ‖x₀ - xm‖ ^ 2) :
  ‖Gradient_Descent_fix_stepsize.x f f' x₀ (q + 1) - xm‖ ^ 2 =
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (q + 1) - xm‖ ^ 2 := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
m : ℝ
f' : E → E
xm x₀ : E
alg : Gradient_Descent_fix_stepsize f f' x₀
hm : m > 0
min : IsMinOn f univ xm
step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))
hsc : StrongConvexOn univ m f
this✝ : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f'
this : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0
reduction :
  ∀ (k : ℕ),
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
      (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
        ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2
eq :
  0 ≤
    1 -
      Gradient_Descent_fix_stepsize.a f f' x₀ *
        (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
q : ℕ
IH1 :
  ‖Gradient_Descent_fix_stepsize.x f f' x₀ q - xm‖ ^ 2 ≤
    (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) ^
        q *
      ‖x₀ - xm‖ ^ 2
⊢ ‖Gradient_Descent_fix_stepsize.x f f' x₀ (q + 1) - xm‖ ^ 2 =
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (q + 1) - xm‖ ^ 2

Tactic:
simp

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_101.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] {f : E → ℝ} {m : ℝ} {f' : E → E} {xm x₀ : E} {alg : Gradient_Descent_fix_stepsize f f' x₀}
  (hm : m > 0) (min : IsMinOn f univ xm)
  (step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
  (hsc : StrongConvexOn univ m f) (this_1 : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f')
  (this : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0)
  (reduction :
    ∀ (k : ℕ),
      ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
        (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
          ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2)
  (eq :
    0 ≤
      1 -
        Gradient_Descent_fix_stepsize.a f f' x₀ *
          (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))))
  (q : ℕ)
  (IH1 :
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ q - xm‖ ^ 2 ≤
      (1 -
            Gradient_Descent_fix_stepsize.a f f' x₀ *
              (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) ^
          q *
        ‖x₀ - xm‖ ^ 2) :
  0 ≤
    1 -
      Gradient_Descent_fix_stepsize.a f f' x₀ *
        (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))) := sorry

Tactic state before:
case a0
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
inst✝ : CompleteSpace E
f : E → ℝ
m : ℝ
f' : E → E
xm x₀ : E
alg : Gradient_Descent_fix_stepsize f f' x₀
hm : m > 0
min : IsMinOn f univ xm
step₂ : Gradient_Descent_fix_stepsize.a f f' x₀ ≤ 2 / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀))
hsc : StrongConvexOn univ m f
this✝ : LipschitzWith (Gradient_Descent_fix_stepsize.l f f' x₀) f'
this : ↑(Gradient_Descent_fix_stepsize.l f f' x₀) > 0
reduction :
  ∀ (k : ℕ),
    ‖Gradient_Descent_fix_stepsize.x f f' x₀ (k + 1) - xm‖ ^ 2 ≤
      (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) *
        ‖Gradient_Descent_fix_stepsize.x f f' x₀ k - xm‖ ^ 2
eq :
  0 ≤
    1 -
      Gradient_Descent_fix_stepsize.a f f' x₀ *
        (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))
q : ℕ
IH1 :
  ‖Gradient_Descent_fix_stepsize.x f f' x₀ q - xm‖ ^ 2 ≤
    (1 -
          Gradient_Descent_fix_stepsize.a f f' x₀ *
            (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))) ^
        q *
      ‖x₀ - xm‖ ^ 2
⊢ 0 ≤
    1 -
      Gradient_Descent_fix_stepsize.a f f' x₀ *
        (2 * m * ↑(Gradient_Descent_fix_stepsize.l f f' x₀) / (m + ↑(Gradient_Descent_fix_stepsize.l f f' x₀)))

Tactic:
apply eq

Tactic state after:
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_0.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k))
  (h_original_goal : ∑ k ∈ Finset.range (0 + 1), f (g (k + 1)) ≥ (↑0 + 1) * f (g (0 + 2))) : f (g 2) ≤ f (g 1) := sorry

Tactic state before:
case zero
E : Type u_1
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
⊢ ∑ k ∈ Finset.range (0 + 1), f (g (k + 1)) ≥ (↑0 + 1) * f (g (0 + 2))

Tactic:
simp

Tactic state after:
[case zero
 E : Type u_1
 f : E → ℝ
 g : ℕ → E
 mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
 ⊢ f (g 2) ≤ f (g 1)]
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_1.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) : f (g 2) ≤ f (g 1) := sorry

Tactic state before:
case zero
E : Type u_1
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
⊢ f (g 2) ≤ f (g 1)

Tactic:
apply mono 1

Tactic state after:
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_2.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E} (q : ℕ)
  (IH1 : ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) ≥ (↑q + 1) * f (g (q + 2)))
  (mono : f (g (q + 2 + 1)) ≤ f (g (q + 2))) :
  ∑ k ∈ Finset.range (q.succ + 1), f (g (k + 1)) = ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) + f (g (q + 2)) := sorry

Tactic state before:
E : Type u_1
f : E → ℝ
g : ℕ → E
q : ℕ
IH1 : ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) ≥ (↑q + 1) * f (g (q + 2))
mono : f (g (q + 2 + 1)) ≤ f (g (q + 2))
⊢ ∑ k ∈ Finset.range (q.succ + 1), f (g (k + 1)) = ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) + f (g (q + 2))

Tactic:
rw [Finset.sum_range_succ (fun k ↦ f (g (k + 1))) q.succ]

Tactic state after:
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_3.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E} (q : ℕ)
  (IH1 : ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) ≥ (↑q + 1) * f (g (q + 2)))
  (mono : f (g (q + 2 + 1)) ≤ f (g (q + 2)))
  (h_original_goal : (↑q + 2) * f (g (q + 3)) = (↑q.succ + 1) * f (g (q.succ + 2))) :
  ↑q + 2 = ↑q + 1 + 1 ∨ f (g (q + 3)) = 0 := sorry

Tactic state before:
E : Type u_1
f : E → ℝ
g : ℕ → E
q : ℕ
IH1 : ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) ≥ (↑q + 1) * f (g (q + 2))
mono : f (g (q + 2 + 1)) ≤ f (g (q + 2))
⊢ (↑q + 2) * f (g (q + 3)) = (↑q.succ + 1) * f (g (q.succ + 2))

Tactic:
simp

Tactic state after:
[E : Type u_1
 f : E → ℝ
 g : ℕ → E
 q : ℕ
 IH1 : ∑ k ∈ Finset.range (q + 1), f (g (k + 1)) ≥ (↑q + 1) * f (g (q + 2))
 mono : f (g (q + 2 + 1)) ≤ f (g (q + 2))
 ⊢ ↑q + 2 = ↑q + 1 + 1 ∨ f (g (q + 3)) = 0]
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_4.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (n : ℕ)
  (h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1)) :
  (∑ k ∈ Finset.range (n.succ + 1), f (g (k + 1))) / (↑n.succ + 1) =
    (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n.succ + 1) + f (g (n.succ + 1)) / (↑n.succ + 1) := sorry

Tactic state before:
E : Type u_1
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
n : ℕ
h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1)
⊢ (∑ k ∈ Finset.range (n.succ + 1), f (g (k + 1))) / (↑n.succ + 1) =
    (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n.succ + 1) + f (g (n.succ + 1)) / (↑n.succ + 1)

Tactic:
rw [Finset.sum_range_succ, add_div]

Tactic state after:
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_5.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (n : ℕ)
  (h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1))
  (h_original_goal :
    (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n.succ + 1) + f (g (n.succ + 1)) / (↑n.succ + 1) ≥
      ↑n.succ * f (g (n.succ + 1)) / (↑n.succ + 1) + f (g (n.succ + 1)) / (↑n.succ + 1)) :
  (↑n + 1) * f (g (n + 1 + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range (n + 1), f (g (k + 1))) / (↑n + 1 + 1) := sorry

Tactic state before:
E : Type u_1
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
n : ℕ
h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1)
⊢ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n.succ + 1) + f (g (n.succ + 1)) / (↑n.succ + 1) ≥
    ↑n.succ * f (g (n.succ + 1)) / (↑n.succ + 1) + f (g (n.succ + 1)) / (↑n.succ + 1)

Tactic:
simp

Tactic state after:
[E : Type u_1
 f : E → ℝ
 g : ℕ → E
 mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
 n : ℕ
 h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1)
 ⊢ (↑n + 1) * f (g (n + 1 + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range (n + 1), f (g (k + 1))) / (↑n + 1 + 1)]
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_6.{u_1} {E : Type u_1} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (n : ℕ)
  (h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1)) :
  (↑n + 1) * f (g (n + 1 + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range (n + 1), f (g (k + 1))) / (↑n + 1 + 1) := sorry

Tactic state before:
E : Type u_1
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
n : ℕ
h : (↑n + 1) * f (g (n.succ + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range n.succ, f (g (k + 1))) / (↑n + 1 + 1)
⊢ (↑n + 1) * f (g (n + 1 + 1)) / (↑n + 1 + 1) ≤ (∑ k ∈ Finset.range (n + 1), f (g (k + 1))) / (↑n + 1 + 1)

Tactic:
exact h

Tactic state after:
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_7.{u_1} {E : Type u_1} {xm : E} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) :
  f (g (0 + 1)) - f xm ≤ (∑ k ∈ Finset.range (0 + 1), (f (g (k + 1)) - f xm)) / (↑0 + 1) := sorry

Tactic state before:
case zero
E : Type u_1
xm : E
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
⊢ f (g (0 + 1)) - f xm ≤ (∑ k ∈ Finset.range (0 + 1), (f (g (k + 1)) - f xm)) / (↑0 + 1)

Tactic:
simp

Tactic state after:
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_8.{u_1} {E : Type u_1} {xm : E} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (j : ℕ)
  (a : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1))
  (h_original_goal :
    f (g (j + 1 + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1 + 1), (f (g (k + 1)) - f xm)) / (↑(j + 1) + 1)) :
  f (g (j + 1 + 1)) ≤
    (∑ x ∈ Finset.range (j + 1 + 1), f (g (x + 1)) - (↑j + 1 + 1) * f xm) / (↑j + 1 + 1) + f xm := sorry

Tactic state before:
case succ
E : Type u_1
xm : E
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
j : ℕ
a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
⊢ f (g (j + 1 + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1 + 1), (f (g (k + 1)) - f xm)) / (↑(j + 1) + 1)

Tactic:
simp

Tactic state after:
[case succ
 E : Type u_1
 xm : E
 f : E → ℝ
 g : ℕ → E
 mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
 j : ℕ
 a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
 ⊢ f (g (j + 1 + 1)) ≤ (∑ x ∈ Finset.range (j + 1 + 1), f (g (x + 1)) - (↑j + 1 + 1) * f xm) / (↑j + 1 + 1) + f xm]
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_9.{u_1} {E : Type u_1} {xm : E} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (j : ℕ)
  (a : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1))
  (h_original_goal :
    (∑ k ∈ Finset.range (j.succ + 1), f (g (k + 1))) / (↑j.succ + 1) =
      (∑ k ∈ Finset.range (j.succ + 1), f (g (k + 1))) / (↑j + 2) - f xm * 1 + f xm) :
  (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑(j + 1) + 1) =
    (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 2) - f xm * 1 + f xm := sorry

Tactic state before:
E : Type u_1
xm : E
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
j : ℕ
a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
⊢ (∑ k ∈ Finset.range (j.succ + 1), f (g (k + 1))) / (↑j.succ + 1) =
    (∑ k ∈ Finset.range (j.succ + 1), f (g (k + 1))) / (↑j + 2) - f xm * 1 + f xm

Tactic:
rw [Nat.succ_eq_add_one j]

Tactic state after:
[E : Type u_1
 xm : E
 f : E → ℝ
 g : ℕ → E
 mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
 j : ℕ
 a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
 ⊢ (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑(j + 1) + 1) =
     (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 2) - f xm * 1 + f xm]
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_10.{u_1} {E : Type u_1} {xm : E} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (j : ℕ)
  (a : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1))
  (h_original_goal :
    (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑(j + 1) + 1) =
      (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 2) - f xm * 1 + f xm) :
  (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 1 + 1) =
    (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 2) := sorry

Tactic state before:
E : Type u_1
xm : E
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
j : ℕ
a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
⊢ (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑(j + 1) + 1) =
    (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 2) - f xm * 1 + f xm

Tactic:
simp

Tactic state after:
[E : Type u_1
 xm : E
 f : E → ℝ
 g : ℕ → E
 mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
 j : ℕ
 a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
 ⊢ (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 1 + 1) =
     (∑ k ∈ Finset.range (j + 1 + 1), f (g (k + 1))) / (↑j + 2)]
import Mathlib
import Optlib


open Set Finset

open InnerProductSpace Set

theorem extracted_formal_statement_11.{u_1} {E : Type u_1} {xm : E} {f : E → ℝ} {g : ℕ → E}
  (mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)) (j : ℕ)
  (a : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)) :
  (∑ x ∈ Finset.range (2 + j), f (g (x + 1))) / (↑j + 1 + 1) =
    (∑ x ∈ Finset.range (2 + j), f (g (x + 1))) / (↑j + 2) := sorry

Tactic state before:
E : Type u_1
xm : E
f : E → ℝ
g : ℕ → E
mono : ∀ (k : ℕ), f (g (k + 1)) ≤ f (g k)
j : ℕ
a✝ : f (g (j + 1)) - f xm ≤ (∑ k ∈ Finset.range (j + 1), (f (g (k + 1)) - f xm)) / (↑j + 1)
⊢ (∑ x ∈ Finset.range (2 + j), f (g (x + 1))) / (↑j + 1 + 1) = (∑ x ∈ Finset.range (2 + j), f (g (x + 1))) / (↑j + 2)

Tactic:
rw [add_assoc, one_add_one_eq_two]

Tactic state after: