Theorem: Real.tendsto_sum_pi_div_four
File: Mathlib/Data/Real/Pi/Leibniz.lean

tactic: have abel := tendsto_tsum_powerSeries_nhdsWithin_lt h
state_before: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))
state_after: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))

tactic: have m : 𝓝[<] (1 : ℝ) ≤ 𝓝 1 := tendsto_nhdsWithin_of_tendsto_nhds fun _ a ↦ a
state_before: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))
state_after: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))

tactic: replace abel := (abel.comp q).mul m
state_before: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))
state_after: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel :
  Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1)
    (𝓝 (l * 1))
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))

tactic: rw [mul_one] at abel
state_before: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel :
  Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1)
    (𝓝 (l * 1))
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))
state_after: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))

tactic: replace abel : Tendsto arctan (𝓝[<] 1) (𝓝 l) := by
  apply abel.congr'
  rw [eventuallyEq_nhdsWithin_iff, Metric.eventually_nhds_iff]
  use 1, zero_lt_one
  intro y hy1 hy2
  rw [dist_eq, abs_sub_lt_iff] at hy1
  rw [Set.mem_Iio] at hy2
  have ny : ‖y‖ < 1 := by rw [norm_eq_abs, abs_lt]; constructor <;> linarith
  rw [← (hasSum_arctan ny).tsum_eq, Function.comp_apply, ← tsum_mul_right]
  simp_rw [mul_assoc, ← pow_mul, ← pow_succ, div_mul_eq_mul_div]
  norm_cast
state_before: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))
state_after: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto arctan (𝓝[<] 1) (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))

tactic: rwa [tendsto_nhds_unique abel ((continuous_arctan.tendsto 1).mono_left m), arctan_one] at h
state_before: case intro
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto arctan (𝓝[<] 1) (𝓝 l)
⊢ Tendsto (fun k => ∑ i ∈ range k, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 (π / 4))
state_after: no goals

tactic: apply Antitone.tendsto_alternating_series_of_tendsto_zero
state_before: ⊢ ∃ l, Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
state_after: case hfa

⊢ Antitone fun i => (2 * ↑i + 1)⁻¹

case hf0

⊢ Tendsto (fun i => (2 * ↑i + 1)⁻¹) atTop (𝓝 0)

tactic: exact antitone_iff_forall_lt.mpr fun _ _ _ ↦ by gcongr
state_before: case hfa

⊢ Antitone fun i => (2 * ↑i + 1)⁻¹
state_after: no goals

tactic: gcongr
state_before: x✝² x✝¹ : ℕ
x✝ : x✝² < x✝¹
⊢ (2 * ↑x✝¹ + 1)⁻¹ ≤ (2 * ↑x✝² + 1)⁻¹
state_after: no goals

tactic: apply Tendsto.inv_tendsto_atTop
state_before: case hf0

⊢ Tendsto (fun i => (2 * ↑i + 1)⁻¹) atTop (𝓝 0)
state_after: case hf0.h

⊢ Tendsto (fun i => 2 * ↑i + 1) atTop atTop

tactic: apply tendsto_atTop_add_const_right
state_before: case hf0.h

⊢ Tendsto (fun i => 2 * ↑i + 1) atTop atTop
state_after: case hf0.h.hf

⊢ Tendsto (fun x => 2 * ↑x) atTop atTop

tactic: exact tendsto_natCast_atTop_atTop.const_mul_atTop zero_lt_two
state_before: case hf0.h.hf

⊢ Tendsto (fun x => 2 * ↑x) atTop atTop
state_after: no goals

tactic: apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
state_after: case h1
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝 1)

case h2
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ ∀ᶠ (x : ℝ) in 𝓝[<] 1, x ^ 2 ∈ Set.Iio 1

tactic: nth_rw 3 [← one_pow 2]
state_before: case h1
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝 1)
state_after: case h1
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝 (1 ^ 2))

tactic: exact Tendsto.pow ‹_› _
state_before: case h1
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝 (1 ^ 2))
state_after: no goals

tactic: rw [eventually_iff_exists_mem]
state_before: case h2
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ ∀ᶠ (x : ℝ) in 𝓝[<] 1, x ^ 2 ∈ Set.Iio 1
state_after: case h2
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ ∃ v ∈ 𝓝[<] 1, ∀ y ∈ v, y ^ 2 ∈ Set.Iio 1

tactic: use Set.Ioo (-1) 1
state_before: case h2
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ ∃ v ∈ 𝓝[<] 1, ∀ y ∈ v, y ^ 2 ∈ Set.Iio 1
state_after: case h
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Set.Ioo (-1) 1 ∈ 𝓝[<] 1 ∧ ∀ y ∈ Set.Ioo (-1) 1, y ^ 2 ∈ Set.Iio 1

tactic: exact ⟨(by rw [mem_nhdsWithin_Iio_iff_exists_Ioo_subset]; use -1, by simp),
  fun _ _ ↦ by rwa [Set.mem_Iio, sq_lt_one_iff_abs_lt_one, abs_lt, ← Set.mem_Ioo]⟩
state_before: case h
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Set.Ioo (-1) 1 ∈ 𝓝[<] 1 ∧ ∀ y ∈ Set.Ioo (-1) 1, y ^ 2 ∈ Set.Iio 1
state_after: no goals

tactic: rw [mem_nhdsWithin_Iio_iff_exists_Ioo_subset]
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ Set.Ioo (-1) 1 ∈ 𝓝[<] 1
state_after: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ ∃ l ∈ Set.Iio 1, Set.Ioo l 1 ⊆ Set.Ioo (-1) 1

tactic: use -1, by simp
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ ∃ l ∈ Set.Iio 1, Set.Ioo l 1 ⊆ Set.Ioo (-1) 1
state_after: no goals

tactic: simp
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
⊢ -1 ∈ Set.Iio 1
state_after: no goals

tactic: rwa [Set.mem_Iio, sq_lt_one_iff_abs_lt_one, abs_lt, ← Set.mem_Ioo]
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
abel : Tendsto (fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) (𝓝[<] 1) (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
x✝¹ : ℝ
x✝ : x✝¹ ∈ Set.Ioo (-1) 1
⊢ x✝¹ ^ 2 ∈ Set.Iio 1
state_after: no goals

tactic: apply abel.congr'
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ Tendsto arctan (𝓝[<] 1) (𝓝 l)
state_after: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) =ᶠ[𝓝[<] 1] arctan

tactic: rw [eventuallyEq_nhdsWithin_iff, Metric.eventually_nhds_iff]
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) =ᶠ[𝓝[<] 1] arctan
state_after: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ ∃ ε > 0,
    ∀ ⦃y : ℝ⦄,
      dist y 1 < ε →
        y ∈ Set.Iio 1 → ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y

tactic: use 1, zero_lt_one
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ ∃ ε > 0,
    ∀ ⦃y : ℝ⦄,
      dist y 1 < ε →
        y ∈ Set.Iio 1 → ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ ∀ ⦃y : ℝ⦄,
    dist y 1 < 1 →
      y ∈ Set.Iio 1 → ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y

tactic: intro y hy1 hy2
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
⊢ ∀ ⦃y : ℝ⦄,
    dist y 1 < 1 →
      y ∈ Set.Iio 1 → ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : dist y 1 < 1
hy2 : y ∈ Set.Iio 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y

tactic: rw [dist_eq, abs_sub_lt_iff] at hy1
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : dist y 1 < 1
hy2 : y ∈ Set.Iio 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y ∈ Set.Iio 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y

tactic: rw [Set.mem_Iio] at hy2
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y ∈ Set.Iio 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y

tactic: have ny : ‖y‖ < 1 := by rw [norm_eq_abs, abs_lt]; constructor <;> linarith
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
ny : ‖y‖ < 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y

tactic: rw [← (hasSum_arctan ny).tsum_eq, Function.comp_apply, ← tsum_mul_right]
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
ny : ‖y‖ < 1
⊢ ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) y * y = arctan y
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
ny : ‖y‖ < 1
⊢ ∑' (x : ℕ), (-1) ^ x / (2 * ↑x + 1) * (y ^ 2) ^ x * y = ∑' (b : ℕ), (-1) ^ b * y ^ (2 * b + 1) / ↑(2 * b + 1)

tactic: simp_rw [mul_assoc, ← pow_mul, ← pow_succ, div_mul_eq_mul_div]
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
ny : ‖y‖ < 1
⊢ ∑' (x : ℕ), (-1) ^ x / (2 * ↑x + 1) * (y ^ 2) ^ x * y = ∑' (b : ℕ), (-1) ^ b * y ^ (2 * b + 1) / ↑(2 * b + 1)
state_after: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
ny : ‖y‖ < 1
⊢ ∑' (x : ℕ), (-1) ^ x * y ^ (2 * x + 1) / (2 * ↑x + 1) = ∑' (b : ℕ), (-1) ^ b * y ^ (2 * b + 1) / ↑(2 * b + 1)

tactic: norm_cast
state_before: case right
l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
ny : ‖y‖ < 1
⊢ ∑' (x : ℕ), (-1) ^ x * y ^ (2 * x + 1) / (2 * ↑x + 1) = ∑' (b : ℕ), (-1) ^ b * y ^ (2 * b + 1) / ↑(2 * b + 1)
state_after: no goals

tactic: rw [norm_eq_abs, abs_lt]
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
⊢ ‖y‖ < 1
state_after: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
⊢ -1 < y ∧ y < 1

tactic: constructor <;> linarith
state_before: l : ℝ
h : Tendsto (fun n => ∑ i ∈ range n, (-1) ^ i / (2 * ↑i + 1)) atTop (𝓝 l)
m : 𝓝[<] 1 ≤ 𝓝 1
q : Tendsto (fun x => x ^ 2) (𝓝[<] 1) (𝓝[<] 1)
abel : Tendsto (fun x => ((fun x => ∑' (n : ℕ), (-1) ^ n / (2 * ↑n + 1) * x ^ n) ∘ fun x => x ^ 2) x * x) (𝓝[<] 1) (𝓝 l)
y : ℝ
hy1 : y - 1 < 1 ∧ 1 - y < 1
hy2 : y < 1
⊢ -1 < y ∧ y < 1
state_after: no goals