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

tactic: apply sum_le_sum_of_subset_of_nonneg
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: intro x hx
state_before: case h
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ Ioo k n ⊆ Ioc k (max (k + 1) n)
state_after: case h
α : Type u_1
inst✝ : LinearOrderedField α
k n x : ℕ
hx : x ∈ Ioo k n
⊢ x ∈ Ioc k (max (k + 1) n)

tactic: simp only [mem_Ioo] at hx
state_before: case h
α : Type u_1
inst✝ : LinearOrderedField α
k n x : ℕ
hx : x ∈ Ioo k n
⊢ x ∈ Ioc k (max (k + 1) n)
state_after: case h
α : Type u_1
inst✝ : LinearOrderedField α
k n x : ℕ
hx : k < x ∧ x < n
⊢ x ∈ Ioc k (max (k + 1) n)

tactic: simp only [hx, hx.2.le, mem_Ioc, le_max_iff, or_true_iff, and_self_iff]
state_before: case h
α : Type u_1
inst✝ : LinearOrderedField α
k n x : ℕ
hx : k < x ∧ x < n
⊢ x ∈ Ioc k (max (k + 1) n)
state_after: no goals

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

tactic: positivity
state_before: case hf
α : Type u_1
inst✝ : LinearOrderedField α
k n i : ℕ
_hi : i ∈ Ioc k (max (k + 1) n)
_hident : i ∉ Ioo k n
⊢ 0 ≤ (↑i ^ 2)⁻¹
state_after: no goals

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 : ℕ
⊢ ∑ 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: 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)⁻¹

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: rw [Nat.Ico_succ_right, Nat.Icc_succ_left, Nat.cast_succ]
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: exact Nat.succ_lt_succ ((Nat.lt_succ_self k).trans_le (le_max_left _ _))
state_before: case hab
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ k.succ < (max (k + 1) n).succ
state_after: no goals

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)⁻¹ + ∑ 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: simp only [Ne, Nat.succ_ne_zero, not_false_iff]
state_before: case refine_1
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ k.succ ≠ 0
state_after: no goals

tactic: simp only [Nat.cast_succ, one_div, sub_le_self_iff, inv_nonneg, Nat.cast_nonneg]
state_before: case refine_2
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑k.succ)⁻¹ - (↑(max k.succ n))⁻¹ ≤ (↑k + 1)⁻¹
state_after: no goals

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 : ℕ
⊢ ((↑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: simp_rw [← one_div]
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: gcongr
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: simpa using pow_le_pow_right A one_le_two
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: simp only [le_add_iff_nonneg_left, Nat.cast_nonneg]
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ 1 ≤ ↑k + 1
state_after: no goals

tactic: ring
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ 1 / (↑k + 1) + 1 / (↑k + 1) = 2 / (↑k + 1)
state_after: no goals