Theorem: ENNReal.tsum_geometric
File: Mathlib/Analysis/SpecificLimits/Basic.lean

tactic: cases' lt_or_le r 1 with hr hr
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹
state_after: case inl
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : r < 1
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹

case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹

tactic: rcases ENNReal.lt_iff_exists_coe.1 hr with ⟨r, rfl, hr'⟩
state_before: case inl
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : r < 1
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹
state_after: case inl.intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' : ↑r < 1
hr : ↑r < 1
⊢ ∑' (n : ℕ), ↑r ^ n = (1 - ↑r)⁻¹

tactic: norm_cast at *
state_before: case inl.intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' : ↑r < 1
hr : ↑r < 1
⊢ ∑' (n : ℕ), ↑r ^ n = (1 - ↑r)⁻¹
state_after: case inl.intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ ∑' (n : ℕ), ↑(r ^ n) = (1 - ↑r)⁻¹

tactic: convert ENNReal.tsum_coe_eq (NNReal.hasSum_geometric hr)
state_before: case inl.intro.intro
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ ∑' (n : ℕ), ↑(r ^ n) = (1 - ↑r)⁻¹
state_after: case h.e'_3
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ (1 - ↑r)⁻¹ = ↑(1 - r)⁻¹

tactic: rw [ENNReal.coe_inv <| ne_of_gt <| tsub_pos_iff_lt.2 hr, coe_sub, coe_one]
state_before: case h.e'_3
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0
hr' hr : r < 1
⊢ (1 - ↑r)⁻¹ = ↑(1 - r)⁻¹
state_after: no goals

tactic: rw [tsub_eq_zero_iff_le.mpr hr, ENNReal.inv_zero, ENNReal.tsum_eq_iSup_nat, iSup_eq_top]
state_before: case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
⊢ ∑' (n : ℕ), r ^ n = (1 - r)⁻¹
state_after: case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
⊢ ∀ b < ⊤, ∃ i, b < ∑ a ∈ Finset.range i, r ^ a

tactic: refine fun a ha ↦
  (ENNReal.exists_nat_gt (lt_top_iff_ne_top.1 ha)).imp fun n hn ↦ lt_of_lt_of_le hn ?_
state_before: case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
⊢ ∀ b < ⊤, ∃ i, b < ∑ a ∈ Finset.range i, r ^ a
state_after: case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ↑n ≤ ∑ a ∈ Finset.range n, r ^ a

tactic: calc
  (n : ℝ≥0∞) = ∑ i ∈ range n, 1 := by rw [sum_const, nsmul_one, card_range]
  _ ≤ ∑ i ∈ range n, r ^ i := by gcongr; apply one_le_pow_of_one_le' hr
state_before: case inr
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ↑n ≤ ∑ a ∈ Finset.range n, r ^ a
state_after: no goals

tactic: rw [sum_const, nsmul_one, card_range]
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ↑n = ∑ i ∈ Finset.range n, 1
state_after: no goals

tactic: gcongr
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
⊢ ∑ i ∈ Finset.range n, 1 ≤ ∑ i ∈ Finset.range n, r ^ i
state_after: case h
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
i✝ : ℕ
a✝ : i✝ ∈ Finset.range n
⊢ 1 ≤ r ^ i✝

tactic: apply one_le_pow_of_one_le' hr
state_before: case h
α : Type u_1
β : Type u_2
ι : Type u_3
r : ℝ≥0∞
hr : 1 ≤ r
a : ℝ≥0∞
ha : a < ⊤
n : ℕ
hn : a < ↑n
i✝ : ℕ
a✝ : i✝ ∈ Finset.range n
⊢ 1 ≤ r ^ i✝
state_after: no goals