Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 6c09295

Browse files
committed
feat(analysis/specific_limits): basic ratio test for summability of a nat-indexed family (#7277)
1 parent 33ea698 commit 6c09295

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

src/analysis/specific_limits.lean

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@ lemma geom_le {u : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) (n : ℕ) (h : ∀ k <
199199
c ^ n * u 0 ≤ u n :=
200200
by refine (monotone_mul_left_of_nonneg hc).seq_le_seq n _ _ h; simp [pow_succ, mul_assoc, le_refl]
201201

202+
lemma lt_geom {u : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) {n : ℕ} (hn : 0 < n)
203+
(h : ∀ k < n, u (k + 1) < c * u k) :
204+
u n < c ^ n * u 0 :=
205+
begin
206+
refine (monotone_mul_left_of_nonneg hc).seq_pos_lt_seq_of_lt_of_le hn _ h _,
207+
{ simp },
208+
{ simp [pow_succ, mul_assoc, le_refl] }
209+
end
210+
211+
lemma le_geom {u : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) (n : ℕ) (h : ∀ k < n, u (k + 1) ≤ c * u k) :
212+
u n ≤ (c ^ n) * u 0 :=
213+
by refine (monotone_mul_left_of_nonneg hc).seq_le_seq n _ h _; simp [pow_succ, mul_assoc, le_refl]
214+
202215
/-- For any natural `k` and a real `r > 1` we have `n ^ k = o(r ^ n)` as `n → ∞`. -/
203216
lemma is_o_pow_const_const_pow_of_one_lt {R : Type*} [normed_ring R] (k : ℕ) {r : ℝ} (hr : 1 < r) :
204217
is_o (λ n, n ^ k : ℕ → R) (λ n, r ^ n) at_top :=
@@ -695,6 +708,82 @@ end
695708

696709
end normed_ring_geometric
697710

711+
/-! ### Summability tests based on comparison with geometric series -/
712+
713+
lemma summable_of_ratio_norm_eventually_le {α : Type*} [semi_normed_group α] [complete_space α]
714+
{f : ℕ → α} {r : ℝ} (hr₁ : r < 1)
715+
(h : ∀ᶠ n in at_top, ∥f (n+1)∥ ≤ r * ∥f n∥) : summable f :=
716+
begin
717+
by_cases hr₀ : 0 ≤ r,
718+
{ rw eventually_at_top at h,
719+
rcases h with ⟨N, hN⟩,
720+
rw ← @summable_nat_add_iff α _ _ _ _ N,
721+
refine summable_of_norm_bounded (λ n, ∥f N∥ * r^n)
722+
(summable.mul_left _ $ summable_geometric_of_lt_1 hr₀ hr₁) (λ n, _),
723+
conv_rhs {rw [mul_comm, ← zero_add N]},
724+
refine le_geom hr₀ n (λ i _, _),
725+
convert hN (i + N) (N.le_add_left i) using 3,
726+
ac_refl },
727+
{ push_neg at hr₀,
728+
refine summable_of_norm_bounded_eventually 0 summable_zero _,
729+
rw nat.cofinite_eq_at_top,
730+
filter_upwards [h],
731+
intros n hn,
732+
by_contra h,
733+
push_neg at h,
734+
exact not_lt.mpr (norm_nonneg _) (lt_of_le_of_lt hn $ mul_neg_of_neg_of_pos hr₀ h) }
735+
end
736+
737+
lemma summable_of_ratio_test_tendsto_lt_one {α : Type*} [normed_group α] [complete_space α]
738+
{f : ℕ → α} {l : ℝ} (hl₁ : l < 1) (hf : ∀ᶠ n in at_top, f n ≠ 0)
739+
(h : tendsto (λ n, ∥f (n+1)∥/∥f n∥) at_top (𝓝 l)) : summable f :=
740+
begin
741+
rcases exists_between hl₁ with ⟨r, hr₀, hr₁⟩,
742+
refine summable_of_ratio_norm_eventually_le hr₁ _,
743+
filter_upwards [eventually_le_of_tendsto_lt hr₀ h, hf],
744+
intros n h₀ h₁,
745+
rwa ← div_le_iff (norm_pos_iff.mpr h₁)
746+
end
747+
748+
lemma not_summable_of_ratio_norm_eventually_ge {α : Type*} [semi_normed_group α]
749+
{f : ℕ → α} {r : ℝ} (hr : 1 < r) (hf : ∃ᶠ n in at_top, ∥f n∥ ≠ 0)
750+
(h : ∀ᶠ n in at_top, r * ∥f n∥ ≤ ∥f (n+1)∥) : ¬ summable f :=
751+
begin
752+
rw eventually_at_top at h,
753+
rcases h with ⟨N₀, hN₀⟩,
754+
rw frequently_at_top at hf,
755+
rcases hf N₀ with ⟨N, hNN₀ : N₀ ≤ N, hN⟩,
756+
rw ← @summable_nat_add_iff α _ _ _ _ N,
757+
refine mt summable.tendsto_at_top_zero
758+
(λ h', not_tendsto_at_top_of_tendsto_nhds (tendsto_norm_zero.comp h') _),
759+
convert tendsto_at_top_of_geom_le _ hr _,
760+
{ refine lt_of_le_of_ne (norm_nonneg _) _,
761+
intro h'',
762+
specialize hN₀ N hNN₀,
763+
simp only [comp_app, zero_add] at h'',
764+
exact hN h''.symm },
765+
{ intro i,
766+
dsimp only [comp_app],
767+
convert (hN₀ (i + N) (hNN₀.trans (N.le_add_left i))) using 3,
768+
ac_refl }
769+
end
770+
771+
lemma not_summable_of_ratio_test_tendsto_gt_one {α : Type*} [semi_normed_group α]
772+
{f : ℕ → α} {l : ℝ} (hl : 1 < l)
773+
(h : tendsto (λ n, ∥f (n+1)∥/∥f n∥) at_top (𝓝 l)) : ¬ summable f :=
774+
begin
775+
have key : ∀ᶠ n in at_top, ∥f n∥ ≠ 0,
776+
{ filter_upwards [eventually_ge_of_tendsto_gt hl h],
777+
intros n hn hc,
778+
rw [hc, div_zero] at hn,
779+
linarith },
780+
rcases exists_between hl with ⟨r, hr₀, hr₁⟩,
781+
refine not_summable_of_ratio_norm_eventually_ge hr₀ key.frequently _,
782+
filter_upwards [eventually_ge_of_tendsto_gt hr₁ h, key],
783+
intros n h₀ h₁,
784+
rwa ← le_div_iff (lt_of_le_of_ne (norm_nonneg _) h₁.symm)
785+
end
786+
698787
/-! ### Positive sequences with small sums on encodable types -/
699788

700789
/-- For any positive `ε`, define on an encodable type a positive sequence with sum less than `ε` -/

0 commit comments

Comments
 (0)