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 in Ioo k n, (↑(i ^ 2))⁻¹ ≤ ∑ i in Ioc k (max (k + 1) n), (↑(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)

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)

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)

tactic: intro i _hi _hident
state_before: case hf
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ ∀ (i : ℕ), i ∈ Ioc k (max (k + 1) n) → ¬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))⁻¹

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 in Ioc k (max (k + 1) n), (↑(i ^ 2))⁻¹ ≤ ((↑k + 1) ^ 2)⁻¹ + ∑ i in Ioc (Nat.succ k) (max (k + 1) n), (↑(i ^ 2))⁻¹

tactic: swap
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ (↑(Nat.succ k ^ 2))⁻¹ + ∑ k in Ico (Nat.succ k + 1) (Nat.succ (max (k + 1) n)), (↑(k ^ 2))⁻¹ ≤
    ((↑k + 1) ^ 2)⁻¹ + ∑ i in Ioc (Nat.succ k) (max (k + 1) n), (↑(i ^ 2))⁻¹

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

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

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 : ℕ
⊢ Nat.succ k < Nat.succ (max (k + 1) n)

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 in Ioc (Nat.succ k) (max (k + 1) n), (↑(i ^ 2))⁻¹ ≤ ((↑k + 1) ^ 2)⁻¹ + (↑k + 1)⁻¹

tactic: simp only [Ne.def, Nat.succ_ne_zero, not_false_iff]
state_before: case refine'_1
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ Nat.succ k ≠ 0

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 : ℕ
⊢ (↑(Nat.succ k))⁻¹ - (↑(max (Nat.succ k) n))⁻¹ ≤ (↑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 : ℕ
⊢ ((↑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)

tactic: apply add_le_add_right
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)

tactic: refine' div_le_div zero_le_one le_rfl (zero_lt_one.trans_le A) _
state_before: case bc
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ 1 / (↑k + 1) ^ 2 ≤ 1 / (↑k + 1)

tactic: simpa using pow_le_pow A one_le_two
state_before: case bc
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
A : 1 ≤ ↑k + 1
⊢ ↑k + 1 ≤ (↑k + 1) ^ 2

tactic: simp only [le_add_iff_nonneg_left, Nat.cast_nonneg]
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
⊢ 1 ≤ ↑k + 1

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