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

tactic: refine' Nat.le_induction _ _ n h
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
hk : k ≠ 0
h : k ≤ n
⊢ ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹

tactic: intro n hn IH
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
hk : k ≠ 0
h : k ≤ n
⊢ ∀ (n : ℕ),
    k ≤ n → ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹ → ∑ i in Ioc k (n + 1), (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑(n + 1))⁻¹

tactic: rw [sum_Ioc_succ_top hn]
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
⊢ ∑ i in Ioc k (n + 1), (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑(n + 1))⁻¹

tactic: apply (add_le_add IH le_rfl).trans
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
⊢ ∑ k in Ioc k n, (↑(k ^ 2))⁻¹ + (↑((n + 1) ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑(n + 1))⁻¹

tactic: simp only [sub_eq_add_neg, add_assoc, Nat.cast_add, Nat.cast_one, le_add_neg_iff_add_le,
  add_le_iff_nonpos_right, neg_add_le_iff_le_add, add_zero]
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
⊢ (↑k)⁻¹ - (↑n)⁻¹ + (↑((n + 1) ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑(n + 1))⁻¹

tactic: have A : 0 < (n : α) := by simpa using hk.bot_lt.trans_le hn
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
⊢ (↑((n + 1) ^ 2))⁻¹ + (↑n + 1)⁻¹ ≤ (↑n)⁻¹

tactic: have B : 0 < (n : α) + 1 := by linarith
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
⊢ (↑((n + 1) ^ 2))⁻¹ + (↑n + 1)⁻¹ ≤ (↑n)⁻¹

tactic: field_simp [B.ne']
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
B : 0 < ↑n + 1
⊢ (↑((n + 1) ^ 2))⁻¹ + (↑n + 1)⁻¹ ≤ (↑n)⁻¹

tactic: rw [div_le_div_iff _ A, ← sub_nonneg]
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
B : 0 < ↑n + 1
⊢ (↑n + 1 + (↑n + 1) ^ 2) / ((↑n + 1) ^ 2 * (↑n + 1)) ≤ 1 / ↑n

tactic: simp only [Ioc_self, sum_empty, sub_self, le_refl]
state_before: case refine'_1
α : Type u_1
inst✝ : LinearOrderedField α
k n : ℕ
hk : k ≠ 0
h : k ≤ n
⊢ ∑ i in Ioc k k, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑k)⁻¹

tactic: simpa using hk.bot_lt.trans_le hn
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
⊢ 0 < ↑n

tactic: linarith
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
⊢ 0 < ↑n + 1

tactic: ring_nf
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
B : 0 < ↑n + 1
⊢ 0 ≤ 1 * ((↑n + 1) ^ 2 * (↑n + 1)) - (↑n + 1 + (↑n + 1) ^ 2) * ↑n

tactic: rw [add_comm]
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
B : 0 < ↑n + 1
⊢ 0 ≤ 1 + ↑n

tactic: exact B.le
state_before: case refine'_2
α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
B : 0 < ↑n + 1
⊢ 0 ≤ ↑n + 1

tactic: nlinarith
state_before: α : Type u_1
inst✝ : LinearOrderedField α
k n✝ : ℕ
hk : k ≠ 0
h : k ≤ n✝
n : ℕ
hn : k ≤ n
IH : ∑ i in Ioc k n, (↑(i ^ 2))⁻¹ ≤ (↑k)⁻¹ - (↑n)⁻¹
A : 0 < ↑n
B : 0 < ↑n + 1
⊢ 0 < (↑n + 1) ^ 2 * (↑n + 1)