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

tactic: lift f to ℕ → ℝ≥0 using h_nonneg
state_before: C : ℕ
u : ℕ → ℕ
f : ℕ → ℝ
h_nonneg : ∀ (n : ℕ), 0 ≤ f n
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * f (u k)) ↔ Summable f
state_after: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → (fun i => ↑(f i)) n ≤ (fun i => ↑(f i)) m
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * (fun i => ↑(f i)) (u k)) ↔ Summable fun i => ↑(f i)

tactic: simp only [NNReal.coe_le_coe] at *
state_before: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → (fun i => ↑(f i)) n ≤ (fun i => ↑(f i)) m
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * (fun i => ↑(f i)) (u k)) ↔ Summable fun i => ↑(f i)
state_after: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * ↑(f (u k))) ↔ Summable fun i => ↑(f i)

tactic: have (k : ℕ) : (u (k + 1) - (u k : ℝ)) = ((u (k + 1) : ℝ≥0) - (u k : ℝ≥0) : ℝ≥0) := by
  have := Nat.cast_le (α := ℝ≥0).mpr <| (hu_strict k.lt_succ_self).le
  simp [NNReal.coe_sub this]
state_before: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * ↑(f (u k))) ↔ Summable fun i => ↑(f i)
state_after: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
this : ∀ (k : ℕ), ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * ↑(f (u k))) ↔ Summable fun i => ↑(f i)

tactic: simp_rw [this]
state_before: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
this : ∀ (k : ℕ), ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))
⊢ (Summable fun k => (↑(u (k + 1)) - ↑(u k)) * ↑(f (u k))) ↔ Summable fun i => ↑(f i)
state_after: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
this : ∀ (k : ℕ), ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))
⊢ (Summable fun k => ↑(↑(u (k + 1)) - ↑(u k)) * ↑(f (u k))) ↔ Summable fun i => ↑(f i)

tactic: exact_mod_cast NNReal.summable_schlomilch_iff hf h_pos hu_strict hC_nonzero h_succ_diff
state_before: case intro
C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
this : ∀ (k : ℕ), ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))
⊢ (Summable fun k => ↑(↑(u (k + 1)) - ↑(u k)) * ↑(f (u k))) ↔ Summable fun i => ↑(f i)
state_after: no goals

tactic: have := Nat.cast_le (α := ℝ≥0).mpr <| (hu_strict k.lt_succ_self).le
state_before: C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
k : ℕ
⊢ ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))
state_after: C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
k : ℕ
this : ↑(u k) ≤ ↑(u k.succ)
⊢ ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))

tactic: simp [NNReal.coe_sub this]
state_before: C : ℕ
u : ℕ → ℕ
h_pos : ∀ (n : ℕ), 0 < u n
hu_strict : StrictMono u
hC_nonzero : C ≠ 0
h_succ_diff : SuccDiffBounded C u
f : ℕ → ℝ≥0
hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m
k : ℕ
this : ↑(u k) ≤ ↑(u k.succ)
⊢ ↑(u (k + 1)) - ↑(u k) = ↑(↑(u (k + 1)) - ↑(u k))
state_after: no goals