Theorem: sum_div_nat_floor_pow_sq_le_div_sq
File: Mathlib/Analysis/SpecificLimits/FloorPow.lean

tactic: have cpos : 0 < c := zero_lt_one.trans hc
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
⊢ ∑ i in filter (fun x => j < ↑⌊c ^ x⌋₊) (range N), 1 / ↑⌊c ^ i⌋₊ ^ 2 ≤ c ^ 5 * (c - 1)⁻¹ ^ 3 / j ^ 2

tactic: have A : 0 < 1 - c⁻¹ := sub_pos.2 (inv_lt_one hc)
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
⊢ ∑ i in filter (fun x => j < ↑⌊c ^ x⌋₊) (range N), 1 / ↑⌊c ^ i⌋₊ ^ 2 ≤ c ^ 5 * (c - 1)⁻¹ ^ 3 / j ^ 2

tactic: apply sum_le_sum_of_subset_of_nonneg
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ ∑ i in filter (fun x => j < ↑⌊c ^ x⌋₊) (range N), 1 / ↑⌊c ^ i⌋₊ ^ 2 ≤
    ∑ i in filter (fun x => j < c ^ x) (range N), 1 / ↑⌊c ^ i⌋₊ ^ 2

tactic: intro i hi
state_before: case h
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ filter (fun x => j < ↑⌊c ^ x⌋₊) (range N) ⊆ filter (fun x => j < c ^ x) (range N)

tactic: simp only [mem_filter, mem_range] at hi
state_before: case h
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
hi : i ∈ filter (fun x => j < ↑⌊c ^ x⌋₊) (range N)
⊢ i ∈ filter (fun x => j < c ^ x) (range N)

tactic: simpa only [hi.1, mem_filter, mem_range, true_and_iff] using
  hi.2.trans_le (Nat.floor_le (pow_nonneg cpos.le _))
state_before: case h
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
hi : i < N ∧ j < ↑⌊c ^ i⌋₊
⊢ i ∈ filter (fun x => j < c ^ x) (range N)

tactic: intro i _hi _hident
state_before: case hf
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ ∀ (i : ℕ),
    i ∈ filter (fun x => j < c ^ x) (range N) → ¬i ∈ filter (fun x => j < ↑⌊c ^ x⌋₊) (range N) → 0 ≤ 1 / ↑⌊c ^ i⌋₊ ^ 2

tactic: exact div_nonneg zero_le_one (sq_nonneg _)
state_before: case hf
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
_hident : ¬i ∈ filter (fun x => j < ↑⌊c ^ x⌋₊) (range N)
⊢ 0 ≤ 1 / ↑⌊c ^ i⌋₊ ^ 2

tactic: refine' sum_le_sum fun i _hi => _
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ ∑ i in filter (fun x => j < c ^ x) (range N), 1 / ↑⌊c ^ i⌋₊ ^ 2 ≤
    ∑ i in filter (fun x => j < c ^ x) (range N), (1 - c⁻¹)⁻¹ ^ 2 * (1 / (c ^ i) ^ 2)

tactic: rw [mul_div_assoc', mul_one, div_le_div_iff]
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 1 / ↑⌊c ^ i⌋₊ ^ 2 ≤ (1 - c⁻¹)⁻¹ ^ 2 * (1 / (c ^ i) ^ 2)

tactic: rotate_left
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 1 * (c ^ i) ^ 2 ≤ (1 - c⁻¹)⁻¹ ^ 2 * ↑⌊c ^ i⌋₊ ^ 2

case b0
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 0 < ↑⌊c ^ i⌋₊ ^ 2

case d0
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 0 < (c ^ i) ^ 2

tactic: rw [one_mul, ← mul_pow]
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 1 * (c ^ i) ^ 2 ≤ (1 - c⁻¹)⁻¹ ^ 2 * ↑⌊c ^ i⌋₊ ^ 2

tactic: apply pow_le_pow_of_le_left (pow_nonneg cpos.le _)
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ (c ^ i) ^ 2 ≤ ((1 - c⁻¹)⁻¹ * ↑⌊c ^ i⌋₊) ^ 2

tactic: rw [← div_eq_inv_mul, le_div_iff A, mul_comm]
state_before: case hab
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ c ^ i ≤ (1 - c⁻¹)⁻¹ * ↑⌊c ^ i⌋₊

tactic: exact mul_pow_le_nat_floor_pow hc i
state_before: case hab
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ (1 - c⁻¹) * c ^ i ≤ ↑⌊c ^ i⌋₊

tactic: apply sq_pos_of_pos
state_before: case b0
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 0 < ↑⌊c ^ i⌋₊ ^ 2

tactic: refine' zero_lt_one.trans_le _
state_before: case b0.ha
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 0 < ↑⌊c ^ i⌋₊

tactic: simp only [Nat.le_floor, one_le_pow_of_one_le, hc.le, Nat.one_le_cast, Nat.cast_one]
state_before: case b0.ha
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 1 ≤ ↑⌊c ^ i⌋₊

tactic: exact sq_pos_of_pos (pow_pos cpos _)
state_before: case d0
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
i : ℕ
_hi : i ∈ filter (fun x => j < c ^ x) (range N)
⊢ 0 < (c ^ i) ^ 2

tactic: rw [← mul_sum, ← mul_div_assoc']
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ ∑ i in filter (fun x => j < c ^ x) (range N), (1 - c⁻¹)⁻¹ ^ 2 * (1 / (c ^ i) ^ 2) ≤
    (1 - c⁻¹)⁻¹ ^ 2 * (c ^ 3 * (c - 1)⁻¹) / j ^ 2

tactic: refine' mul_le_mul_of_nonneg_left _ (sq_nonneg _)
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ (1 - c⁻¹)⁻¹ ^ 2 * ∑ x in filter (fun x => j < c ^ x) (range N), 1 / (c ^ x) ^ 2 ≤
    (1 - c⁻¹)⁻¹ ^ 2 * (c ^ 3 * (c - 1)⁻¹ / j ^ 2)

tactic: exact sum_div_pow_sq_le_div_sq N hj hc
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ ∑ x in filter (fun x => j < c ^ x) (range N), 1 / (c ^ x) ^ 2 ≤ c ^ 3 * (c - 1)⁻¹ / j ^ 2

tactic: congr 1
state_before: N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ (1 - c⁻¹)⁻¹ ^ 2 * (c ^ 3 * (c - 1)⁻¹) / j ^ 2 = c ^ 5 * (c - 1)⁻¹ ^ 3 / j ^ 2

tactic: field_simp [cpos.ne', (sub_pos.2 hc).ne']
state_before: case e_a
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ (1 - c⁻¹)⁻¹ ^ 2 * (c ^ 3 * (c - 1)⁻¹) = c ^ 5 * (c - 1)⁻¹ ^ 3

tactic: ring!
state_before: case e_a
N : ℕ
j : ℝ
hj : 0 < j
c : ℝ
hc : 1 < c
cpos : 0 < c
A : 0 < 1 - c⁻¹
⊢ c ^ 2 * c ^ 3 * (c - 1) ^ 3 = c ^ 5 * ((c - 1) ^ 2 * (c - 1))