Theorem: Antitone.alternating_series_le_tendsto
File: Mathlib/Analysis/SpecificLimits/Normed.lean

tactic: have hm : Monotone (fun n ↦ ∑ i ∈ range (2 * n), (-1) ^ i * f i) := by
  refine monotone_nat_of_le_succ (fun n ↦ ?_)
  rw [show 2 * (n + 1) = 2 * n + 1 + 1 by ring, sum_range_succ, sum_range_succ]
  simp_rw [_root_.pow_succ', show (-1 : E) ^ (2 * n) = 1 by simp, neg_one_mul, one_mul,
    ← sub_eq_add_neg, le_sub_iff_add_le]
  gcongr
  exact hfa (by omega)
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
⊢ ∑ i ∈ Finset.range (2 * k), (-1) ^ i * f i ≤ l
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
hm : Monotone fun n => ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i
⊢ ∑ i ∈ Finset.range (2 * k), (-1) ^ i * f i ≤ l

tactic: exact hm.ge_of_tendsto (hfl.comp (tendsto_atTop_mono (fun n ↦ by dsimp; omega) tendsto_id)) _
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
hm : Monotone fun n => ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i
⊢ ∑ i ∈ Finset.range (2 * k), (-1) ^ i * f i ≤ l
state_after: no goals

tactic: refine monotone_nat_of_le_succ (fun n ↦ ?_)
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
⊢ Monotone fun n => ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i ≤ ∑ i ∈ Finset.range (2 * (n + 1)), (-1) ^ i * f i

tactic: rw [show 2 * (n + 1) = 2 * n + 1 + 1 by ring, sum_range_succ, sum_range_succ]
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i ≤ ∑ i ∈ Finset.range (2 * (n + 1)), (-1) ^ i * f i
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i ≤
    ∑ x ∈ Finset.range (2 * n), (-1) ^ x * f x + (-1) ^ (2 * n) * f (2 * n) + (-1) ^ (2 * n + 1) * f (2 * n + 1)

tactic: simp_rw [_root_.pow_succ', show (-1 : E) ^ (2 * n) = 1 by simp, neg_one_mul, one_mul,
  ← sub_eq_add_neg, le_sub_iff_add_le]
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i ≤
    ∑ x ∈ Finset.range (2 * n), (-1) ^ x * f x + (-1) ^ (2 * n) * f (2 * n) + (-1) ^ (2 * n + 1) * f (2 * n + 1)
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i + f (2 * n + 1) ≤ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i + f (2 * n)

tactic: gcongr
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i + f (2 * n + 1) ≤ ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i + f (2 * n)
state_after: case bc
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ f (2 * n + 1) ≤ f (2 * n)

tactic: exact hfa (by omega)
state_before: case bc
α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ f (2 * n + 1) ≤ f (2 * n)
state_after: no goals

tactic: ring
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ 2 * (n + 1) = 2 * n + 1 + 1
state_after: no goals

tactic: simp
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ (-1) ^ (2 * n) = 1
state_after: no goals

tactic: omega
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k n : ℕ
⊢ 2 * n ≤ 2 * n + 1
state_after: no goals

tactic: dsimp
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
hm : Monotone fun n => ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i
n : ℕ
⊢ id n ≤ 2 * n
state_after: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
hm : Monotone fun n => ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i
n : ℕ
⊢ n ≤ 2 * n

tactic: omega
state_before: α : Type u_1
β : Type u_2
ι : Type u_3
E : Type u_4
inst✝² : OrderedRing E
inst✝¹ : TopologicalSpace E
inst✝ : OrderClosedTopology E
l : E
f : ℕ → E
hfl : Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) atTop (𝓝 l)
hfa : Antitone f
k : ℕ
hm : Monotone fun n => ∑ i ∈ Finset.range (2 * n), (-1) ^ i * f i
n : ℕ
⊢ n ≤ 2 * n
state_after: no goals