-- File: optlib/Optlib/Algorithm/GD/GradientDescent.lean
Theorem statement:
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:

Premises used:
add_div : ∀ {K : Type u_1} [inst : DivisionSemiring K] (a b c : K), (a + b) / c = a / c + b / c
Finset.sum_range_succ : ∀ {β : Type u_4} [inst : AddCommMonoid β] (f : ℕ → β) (n : ℕ),
  ∑ x ∈ Finset.range (n + 1), f x = ∑ x ∈ Finset.range n, f x + f n