@@ -3,7 +3,7 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Johannes Hölzl, Jeremy Avigad, Yury Kudryashov, Patrick Massot
5
5
-/
6
- import order.filter.basic
6
+ import order.filter.bases
7
7
8
8
/-!
9
9
# `at_top` and `at_bot` filters on preorded sets, monoids and groups.
@@ -46,23 +46,24 @@ mem_infi_sets a $ subset.refl _
46
46
lemma Iio_mem_at_bot [preorder α] [no_bot_order α] (x : α) : Iio x ∈ (at_bot : filter α) :=
47
47
let ⟨z, hz⟩ := no_bot x in mem_sets_of_superset (mem_at_bot z) $ λ y h, lt_of_le_of_lt h hz
48
48
49
+ lemma at_top_basis [hα : nonempty α] [semilattice_sup α] :
50
+ (@at_top α _).has_basis (λ _, true) Ici :=
51
+ has_basis_infi_principal (directed_of_sup $ λ a b, Ici_subset_Ici.2 ) hα
52
+
53
+ lemma at_top_basis' [semilattice_sup α] (a : α) :
54
+ (@at_top α _).has_basis (λ x, a ≤ x) Ici :=
55
+ ⟨λ t, (@at_top_basis α ⟨a⟩ _).mem_iff.trans
56
+ ⟨λ ⟨x, _, hx⟩, ⟨x ⊔ a, le_sup_right, λ y hy, hx (le_trans le_sup_left hy)⟩,
57
+ λ ⟨x, _, hx⟩, ⟨x, trivial, hx⟩⟩⟩
58
+
49
59
@[instance]
50
60
lemma at_top_ne_bot [nonempty α] [semilattice_sup α] : ne_bot (at_top : filter α) :=
51
- infi_ne_bot_of_directed
52
- (assume a b, ⟨a ⊔ b, by simp only [ge, le_principal_iff, forall_const, set_of_subset_set_of,
53
- mem_principal_sets, and_self, sup_le_iff, forall_true_iff] {contextual := tt}⟩)
54
- (assume a, principal_ne_bot_iff.2 nonempty_Ici)
61
+ at_top_basis.forall_nonempty_iff_ne_bot.1 $ λ a _, nonempty_Ici
55
62
56
63
@[simp, nolint ge_or_gt]
57
64
lemma mem_at_top_sets [nonempty α] [semilattice_sup α] {s : set α} :
58
65
s ∈ (at_top : filter α) ↔ ∃a:α, ∀b≥a, b ∈ s :=
59
- let ⟨a⟩ := ‹nonempty α› in
60
- iff.intro
61
- (assume h, infi_sets_induct h ⟨a, by simp only [forall_const, mem_univ, forall_true_iff]⟩
62
- (assume a s₁ s₂ ha ⟨b, hb⟩, ⟨a ⊔ b,
63
- assume c hc, ⟨ha $ le_trans le_sup_left hc, hb _ $ le_trans le_sup_right hc⟩⟩)
64
- (assume s₁ s₂ h ⟨a, ha⟩, ⟨a, assume b hb, h $ ha _ hb⟩))
65
- (assume ⟨a, h⟩, mem_infi_sets a $ assume x, h x)
66
+ at_top_basis.mem_iff.trans $ exists_congr $ λ _, exists_const _
66
67
67
68
@[simp, nolint ge_or_gt]
68
69
lemma eventually_at_top [semilattice_sup α] [nonempty α] {p : α → Prop } :
@@ -71,6 +72,11 @@ mem_at_top_sets
71
72
72
73
lemma eventually_ge_at_top [preorder α] (a : α) : ∀ᶠ x in at_top, a ≤ x := mem_at_top a
73
74
75
+ lemma at_top_countable_basis [nonempty α] [semilattice_sup α] [encodable α] :
76
+ has_countable_basis (at_top : filter α) (λ _, true) Ici :=
77
+ { countable := countable_encodable _,
78
+ .. at_top_basis }
79
+
74
80
lemma order_top.at_top_eq (α) [order_top α] : (at_top : filter α) = pure ⊤ :=
75
81
le_antisymm (le_pure_iff.2 $ (eventually_ge_at_top ⊤).mono $ λ b, top_unique)
76
82
(le_infi $ λ b, le_principal_iff.2 le_top)
@@ -109,11 +115,7 @@ frequently_at_top.mp h
109
115
110
116
lemma map_at_top_eq [nonempty α] [semilattice_sup α] {f : α → β} :
111
117
at_top.map f = (⨅a, 𝓟 $ f '' {a' | a ≤ a'}) :=
112
- calc map f (⨅a, 𝓟 {a' | a ≤ a'}) = (⨅a, map f $ 𝓟 {a' | a ≤ a'}) :
113
- map_infi_eq (assume a b, ⟨a ⊔ b, by simp only [ge, le_principal_iff, forall_const, set_of_subset_set_of,
114
- mem_principal_sets, and_self, sup_le_iff, forall_true_iff] {contextual := tt}⟩)
115
- (by apply_instance)
116
- ... = (⨅a, 𝓟 $ f '' {a' | a ≤ a'}) : by simp only [map_principal, eq_self_iff_true]
118
+ (at_top_basis.map _).eq_infi
117
119
118
120
lemma tendsto_at_top [preorder β] (m : α → β) (f : filter α) :
119
121
tendsto m f at_top ↔ (∀b, ∀ᶠ a in f, b ≤ m a) :=
@@ -558,6 +560,78 @@ by rw [map_at_top_eq, map_at_top_eq];
558
560
from (le_infi $ assume b, let ⟨v, hv⟩ := h_eq b in infi_le_of_le v $
559
561
by simp [set.image_subset_iff]; exact hv)
560
562
563
+ lemma has_antimono_basis.tendsto [semilattice_sup ι] [nonempty ι] {l : filter α}
564
+ {p : ι → Prop } {s : ι → set α} (hl : l.has_antimono_basis p s) {φ : ι → α}
565
+ (h : ∀ i : ι, φ i ∈ s i) : tendsto φ at_top l :=
566
+ begin
567
+ rw hl.to_has_basis.tendsto_right_iff,
568
+ intros i hi,
569
+ rw eventually_at_top,
570
+ exact ⟨i, λ j hij, hl.decreasing hi (hl.mono hij hi) hij (h j)⟩,
571
+ end
572
+
573
+ namespace is_countably_generated
574
+
575
+ /-- An abstract version of continuity of sequentially continuous functions on metric spaces:
576
+ if a filter `k` is countably generated then `tendsto f k l` iff for every sequence `u`
577
+ converging to `k`, `f ∘ u` tends to `l`. -/
578
+ lemma tendsto_iff_seq_tendsto {f : α → β} {k : filter α} {l : filter β}
579
+ (hcb : k.is_countably_generated) :
580
+ tendsto f k l ↔ (∀ x : ℕ → α, tendsto x at_top k → tendsto (f ∘ x) at_top l) :=
581
+ suffices (∀ x : ℕ → α, tendsto x at_top k → tendsto (f ∘ x) at_top l) → tendsto f k l,
582
+ from ⟨by intros; apply tendsto.comp; assumption, by assumption⟩,
583
+ begin
584
+ rcases hcb.exists_antimono_seq with ⟨g, gmon, gbasis⟩,
585
+ have gbasis : ∀ A, A ∈ k ↔ ∃ i, g i ⊆ A,
586
+ { intro A,
587
+ subst gbasis,
588
+ rw mem_infi,
589
+ { simp only [set.mem_Union, iff_self, filter.mem_principal_sets] },
590
+ { exact directed_of_sup (λ i j h, principal_mono.mpr $ gmon _ _ h) },
591
+ { apply_instance } },
592
+ classical, contrapose,
593
+ simp only [not_forall, not_imp, not_exists, subset_def, @tendsto_def _ _ f, gbasis],
594
+ rintro ⟨B, hBl, hfBk⟩,
595
+ choose x h using hfBk,
596
+ use x, split,
597
+ { simp only [tendsto_at_top', gbasis],
598
+ rintros A ⟨i, hgiA⟩,
599
+ use i,
600
+ refine (λ j hj, hgiA $ gmon _ _ hj _),
601
+ simp only [h] },
602
+ { simp only [tendsto_at_top', (∘), not_forall, not_exists],
603
+ use [B, hBl],
604
+ intro i, use [i, (le_refl _)],
605
+ apply (h i).right },
606
+ end
607
+
608
+ lemma tendsto_of_seq_tendsto {f : α → β} {k : filter α} {l : filter β}
609
+ (hcb : k.is_countably_generated) :
610
+ (∀ x : ℕ → α, tendsto x at_top k → tendsto (f ∘ x) at_top l) → tendsto f k l :=
611
+ hcb.tendsto_iff_seq_tendsto.2
612
+
613
+ lemma subseq_tendsto {f : filter α} (hf : is_countably_generated f)
614
+ {u : ℕ → α}
615
+ (hx : ne_bot (f ⊓ map u at_top)) :
616
+ ∃ (θ : ℕ → ℕ), (strict_mono θ) ∧ (tendsto (u ∘ θ) at_top f) :=
617
+ begin
618
+ rcases hf.has_antimono_basis with ⟨B, h⟩,
619
+ have : ∀ N, ∃ n ≥ N, u n ∈ B N,
620
+ from λ N, filter.inf_map_at_top_ne_bot_iff.mp hx _ (h.to_has_basis.mem_of_mem trivial) N,
621
+ choose φ hφ using this ,
622
+ cases forall_and_distrib.mp hφ with φ_ge φ_in,
623
+ have lim_uφ : tendsto (u ∘ φ) at_top f,
624
+ from h.tendsto φ_in,
625
+ have lim_φ : tendsto φ at_top at_top,
626
+ from (tendsto_at_top_mono φ_ge tendsto_id),
627
+ obtain ⟨ψ, hψ, hψφ⟩ : ∃ ψ : ℕ → ℕ, strict_mono ψ ∧ strict_mono (φ ∘ ψ),
628
+ from strict_mono_subseq_of_tendsto_at_top lim_φ,
629
+ exact ⟨φ ∘ ψ, hψφ, lim_uφ.comp $ strict_mono_tendsto_at_top hψ⟩,
630
+ end
631
+
632
+ end is_countably_generated
633
+
634
+
561
635
end filter
562
636
563
637
open filter finset
0 commit comments