Theorem: Filter.Tendsto.cesaro_smul
File: Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean

tactic: rw [← tendsto_sub_nhds_zero_iff, ← isLittleO_one_iff ℝ]
state_before: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
⊢ Tendsto (fun n => (↑n)⁻¹ • ∑ i ∈ range n, u i) atTop (𝓝 l)
state_after: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
⊢ (fun x => (↑x)⁻¹ • ∑ i ∈ range x, u i - l) =o[atTop] fun _x => 1

tactic: have := Asymptotics.isLittleO_sum_range_of_tendsto_zero (tendsto_sub_nhds_zero_iff.2 h)
state_before: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
⊢ (fun x => (↑x)⁻¹ • ∑ i ∈ range x, u i - l) =o[atTop] fun _x => 1
state_after: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ∑ i ∈ range x, u i - l) =o[atTop] fun _x => 1

tactic: apply ((isBigO_refl (fun n : ℕ => (n : ℝ)⁻¹) atTop).smul_isLittleO this).congr' _ _
state_before: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ∑ i ∈ range x, u i - l) =o[atTop] fun _x => 1
state_after: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ∑ i ∈ range x, (u i - l)) =ᶠ[atTop] fun x => (↑x)⁻¹ • ∑ i ∈ range x, u i - l

E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ↑x) =ᶠ[atTop] fun _x => 1

tactic: filter_upwards [Ici_mem_atTop 1] with n npos
state_before: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ∑ i ∈ range x, (u i - l)) =ᶠ[atTop] fun x => (↑x)⁻¹ • ∑ i ∈ range x, u i - l
state_after: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
⊢ (↑n)⁻¹ • ∑ i ∈ range n, (u i - l) = (↑n)⁻¹ • ∑ i ∈ range n, u i - l

tactic: have nposℝ : (0 : ℝ) < n := Nat.cast_pos.2 npos
state_before: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
⊢ (↑n)⁻¹ • ∑ i ∈ range n, (u i - l) = (↑n)⁻¹ • ∑ i ∈ range n, u i - l
state_after: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • ∑ i ∈ range n, (u i - l) = (↑n)⁻¹ • ∑ i ∈ range n, u i - l

tactic: simp only [smul_sub, sum_sub_distrib, sum_const, card_range, sub_right_inj]
state_before: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • ∑ i ∈ range n, (u i - l) = (↑n)⁻¹ • ∑ i ∈ range n, u i - l
state_after: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • n • l = l

tactic: rw [nsmul_eq_smul_cast ℝ, smul_smul, inv_mul_cancel nposℝ.ne', one_smul]
state_before: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • n • l = l
state_after: no goals

tactic: filter_upwards [Ici_mem_atTop 1] with n npos
state_before: E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
⊢ (fun x => (↑x)⁻¹ • ↑x) =ᶠ[atTop] fun _x => 1
state_after: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
⊢ (↑n)⁻¹ • ↑n = 1

tactic: have nposℝ : (0 : ℝ) < n := Nat.cast_pos.2 npos
state_before: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
⊢ (↑n)⁻¹ • ↑n = 1
state_after: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • ↑n = 1

tactic: rw [Algebra.id.smul_eq_mul, inv_mul_cancel nposℝ.ne']
state_before: case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
u : ℕ → E
l : E
h : Tendsto u atTop (𝓝 l)
this : (fun n => ∑ i ∈ range n, (u i - l)) =o[atTop] fun n => ↑n
n : ℕ
npos : n ∈ Set.Ici 1
nposℝ : 0 < ↑n
⊢ (↑n)⁻¹ • ↑n = 1
state_after: no goals