Theorem: sum_Ioo_inv_sq_le
File: Mathlib/Analysis/PSeries.lean

Proof steps:
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ ∑ i ∈ Ioo k n, (↑i ^ 2)⁻¹ ≤ ∑ i ∈ Ioc k (max (k + 1) n), (↑i ^ 2)⁻¹
state_after: case h
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ Ioo k n ⊆ Ioc k (max (k + 1) n)

case hf
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ ∀ i ∈ Ioc k (max (k + 1) n), i ∉ Ioo k n → 0 ≤ (↑i ^ 2)⁻¹
tactic: apply sum_le_sum_of_subset_of_nonneg
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ ∑ i ∈ Ioc k (max (k + 1) n), (↑i ^ 2)⁻¹ ≤ ((↑k + 1) ^ 2)⁻¹ + ∑ i ∈ Ioc k.succ (max (k + 1) n), (↑i ^ 2)⁻¹
state_after: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑k.succ ^ 2)⁻¹ + ∑ k ∈ Ico (k.succ + 1) (max (k + 1) n).succ, (↑k ^ 2)⁻¹ ≤
    ((↑k + 1) ^ 2)⁻¹ + ∑ i ∈ Ioc k.succ (max (k + 1) n), (↑i ^ 2)⁻¹

case hab
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ k.succ < (max (k + 1) n).succ
tactic: rw [← Nat.Icc_succ_left, ← Nat.Ico_succ_right, sum_eq_sum_Ico_succ_bot]
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑k.succ ^ 2)⁻¹ + ∑ k ∈ Ico (k.succ + 1) (max (k + 1) n).succ, (↑k ^ 2)⁻¹ ≤
    ((↑k + 1) ^ 2)⁻¹ + ∑ i ∈ Ioc k.succ (max (k + 1) n), (↑i ^ 2)⁻¹

case hab
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ k.succ < (max (k + 1) n).succ
state_after: case hab
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ k.succ < (max (k + 1) n).succ

α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑k.succ ^ 2)⁻¹ + ∑ k ∈ Ico (k.succ + 1) (max (k + 1) n).succ, (↑k ^ 2)⁻¹ ≤
    ((↑k + 1) ^ 2)⁻¹ + ∑ i ∈ Ioc k.succ (max (k + 1) n), (↑i ^ 2)⁻¹
tactic: swap
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑k.succ ^ 2)⁻¹ + ∑ k ∈ Ico (k.succ + 1) (max (k + 1) n).succ, (↑k ^ 2)⁻¹ ≤
    ((↑k + 1) ^ 2)⁻¹ + ∑ i ∈ Ioc k.succ (max (k + 1) n), (↑i ^ 2)⁻¹
state_after: no goals
tactic: rw [Nat.Ico_succ_right, Nat.Icc_succ_left, Nat.cast_succ]
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ ((↑k + 1) ^ 2)⁻¹ + ∑ i ∈ Ioc k.succ (max (k + 1) n), (↑i ^ 2)⁻¹ ≤ ((↑k + 1) ^ 2)⁻¹ + (↑k + 1)⁻¹
state_after: case refine_1
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ k.succ ≠ 0

case refine_2
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑k.succ)⁻¹ - (↑(max k.succ n))⁻¹ ≤ (↑k + 1)⁻¹
tactic: refine add_le_add le_rfl ((sum_Ioc_inv_sq_le_sub ?_ (le_max_left _ _)).trans ?_)
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ ((↑k + 1) ^ 2)⁻¹ + (↑k + 1)⁻¹ ≤ 1 / (↑k + 1) + 1 / (↑k + 1)
state_after: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ ((↑k + 1) ^ 2)⁻¹ + (↑k + 1)⁻¹ ≤ 1 / (↑k + 1) + 1 / (↑k + 1)
tactic: have A : (1 : α) ≤ k + 1 := by simp only [le_add_iff_nonneg_left, Nat.cast_nonneg]
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ ((↑k + 1) ^ 2)⁻¹ + (↑k + 1)⁻¹ ≤ 1 / (↑k + 1) + 1 / (↑k + 1)
state_after: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ 1 / (↑k + 1) ^ 2 + 1 / (↑k + 1) ≤ 1 / (↑k + 1) + 1 / (↑k + 1)
tactic: simp_rw [← one_div]
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ 1 / (↑k + 1) ^ 2 + 1 / (↑k + 1) ≤ 1 / (↑k + 1) + 1 / (↑k + 1)
state_after: case bc.h
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ ↑k + 1 ≤ (↑k + 1) ^ 2
tactic: gcongr
state_before: case bc.h
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ ↑k + 1 ≤ (↑k + 1) ^ 2
state_after: no goals
tactic: simpa using pow_le_pow_right A one_le_two
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ 1 / (↑k + 1) + 1 / (↑k + 1) = 2 / (↑k + 1)
state_after: no goals
tactic: ring