-- Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean
theorem Filter.Tendsto.cesaro_smul {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {u : ℕ → E}
    {l : E} (h : Tendsto u atTop (𝓝 l)) :
    Tendsto (fun n : ℕ => (n⁻¹ : ℝ) • ∑ i ∈ range n, u i) atTop (𝓝 l)

Proof state:
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

Tactic:
filter_upwards [Ici_mem_atTop 1] with n npos

Result:
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

Proof state:
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]

Result:
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

Proof state:
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)

Result:
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

Proof state:
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

Result:
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

Proof state:
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' _ _

Result:
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

Proof state:
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

Result:
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

Proof state:
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)

Tactic:
rw [← tendsto_sub_nhds_zero_iff, ← isLittleO_one_iff ℝ]

Result:
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

Proof state:
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

Result:
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

Proof state:
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 [← Nat.cast_smul_eq_nsmul ℝ, smul_smul, inv_mul_cancel₀ nposℝ.ne', one_smul]

Result:
no goals

Proof state:
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']

Result:
no goals