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

Commit ffde2d8

Browse files
committed
chore(order/liminf_limsup): Generalise and move lemmas (#18628)
Generalise lemmas from semilattices to codirected orders. Move topology-less lemmas from `topology.algebra.order.liminf_limsup` to `order.liminf_limsup`. Also turn arguments to `bdd_above_insert` and friends implicit.
1 parent 32a7e53 commit ffde2d8

File tree

5 files changed

+99
-116
lines changed

5 files changed

+99
-116
lines changed

src/data/set/finite.lean

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,15 +1280,15 @@ end
12801280

12811281
section
12821282

1283-
variables [semilattice_sup α] [nonempty α] {s : set α}
1283+
variables [preorder α] [is_directed α (≤)] [nonempty α] {s : set α}
12841284

12851285
/--A finite set is bounded above.-/
12861286
protected lemma finite.bdd_above (hs : s.finite) : bdd_above s :=
12871287
finite.induction_on hs bdd_above_empty $ λ a s _ _ h, h.insert a
12881288

12891289
/--A finite union of sets which are all bounded above is still bounded above.-/
12901290
lemma finite.bdd_above_bUnion {I : set β} {S : β → set α} (H : I.finite) :
1291-
(bdd_above (⋃i∈I, S i))(∀i ∈ I, bdd_above (S i)) :=
1291+
bdd_above (⋃ i ∈ I, S i) ↔ i ∈ I, bdd_above (S i) :=
12921292
finite.induction_on H
12931293
(by simp only [bUnion_empty, bdd_above_empty, ball_empty_iff])
12941294
(λ a s ha _ hs, by simp only [bUnion_insert, ball_insert_iff, bdd_above_union, hs])
@@ -1299,22 +1299,17 @@ end
12991299

13001300
section
13011301

1302-
variables [semilattice_inf α] [nonempty α] {s : set α}
1302+
variables [preorder α] [is_directed α (≥)] [nonempty α] {s : set α}
13031303

13041304
/--A finite set is bounded below.-/
1305-
protected lemma finite.bdd_below (hs : s.finite) : bdd_below s := @finite.bdd_above αᵒᵈ _ _ _ hs
1305+
protected lemma finite.bdd_below (hs : s.finite) : bdd_below s := @finite.bdd_above αᵒᵈ _ _ _ _ hs
13061306

13071307
/--A finite union of sets which are all bounded below is still bounded below.-/
13081308
lemma finite.bdd_below_bUnion {I : set β} {S : β → set α} (H : I.finite) :
13091309
bdd_below (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, bdd_below (S i) :=
1310-
@finite.bdd_above_bUnion αᵒᵈ _ _ _ _ _ H
1310+
@finite.bdd_above_bUnion αᵒᵈ _ _ _ _ _ _ H
13111311

1312-
lemma infinite_of_not_bdd_below : ¬ bdd_below s → s.infinite :=
1313-
begin
1314-
contrapose!,
1315-
rw not_infinite,
1316-
apply finite.bdd_below,
1317-
end
1312+
lemma infinite_of_not_bdd_below : ¬ bdd_below s → s.infinite := mt finite.bdd_below
13181313

13191314
end
13201315

src/order/bounds/basic.lean

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Yury Kudryashov
55
-/
66
import data.set.intervals.basic
77
import data.set.n_ary
8+
import order.directed
89

910
/-!
1011
@@ -283,31 +284,30 @@ h.mono $ inter_subset_left s t
283284
lemma bdd_below.inter_of_right (h : bdd_below t) : bdd_below (s ∩ t) :=
284285
h.mono $ inter_subset_right s t
285286

286-
/-- If `s` and `t` are bounded above sets in a `semilattice_sup`, then so is `s ∪ t`. -/
287-
lemma bdd_above.union [semilattice_sup γ] {s t : set γ} :
287+
/-- In a directed order, the union of bounded above sets is bounded above. -/
288+
lemma bdd_above.union [is_directed α (≤)] {s t : set α} :
288289
bdd_above s → bdd_above t → bdd_above (s ∪ t) :=
289290
begin
290-
rintros ⟨bs, hs⟩ ⟨bt, ht⟩,
291-
use bs ⊔ bt,
292-
rw upper_bounds_union,
293-
exact ⟨upper_bounds_mono_mem le_sup_left hs,
294-
upper_bounds_mono_mem le_sup_right ht⟩
291+
rintro ⟨a, ha⟩ ⟨b, hb⟩,
292+
obtain ⟨c, hca, hcb⟩ := exists_ge_ge a b,
293+
rw [bdd_above, upper_bounds_union],
294+
exact ⟨c, upper_bounds_mono_mem hca ha, upper_bounds_mono_mem hcb hb⟩,
295295
end
296296

297-
/-- The union of two sets is bounded above if and only if each of the sets is. -/
298-
lemma bdd_above_union [semilattice_sup γ] {s t : set γ} :
297+
/-- In a directed order, the union of two sets is bounded above if and only if both sets are. -/
298+
lemma bdd_above_union [is_directed α (≤)] {s t : set α} :
299299
bdd_above (s ∪ t) ↔ bdd_above s ∧ bdd_above t :=
300-
⟨λ h, ⟨h.mono $ subset_union_left s t, h.mono $ subset_union_right s t⟩,
301-
λ h, h.1.union h.2
300+
⟨λ h, ⟨h.mono $ subset_union_left _ _, h.mono $ subset_union_right _ _⟩, λ h, h.1.union h.2
302301

303-
lemma bdd_below.union [semilattice_inf γ] {s t : set γ} :
302+
/-- In a codirected order, the union of bounded below sets is bounded below. -/
303+
lemma bdd_below.union [is_directed α (≥)] {s t : set α} :
304304
bdd_below s → bdd_below t → bdd_below (s ∪ t) :=
305-
@bdd_above.union γᵒᵈ _ s t
305+
@bdd_above.union αᵒᵈ _ _ _ _
306306

307-
/--The union of two sets is bounded above if and only if each of the sets is.-/
308-
lemma bdd_below_union [semilattice_inf γ] {s t : set γ} :
307+
/-- In a codirected order, the union of two sets is bounded below if and only if both sets are. -/
308+
lemma bdd_below_union [is_directed α (≥)] {s t : set α} :
309309
bdd_below (s ∪ t) ↔ bdd_below s ∧ bdd_below t :=
310-
@bdd_above_union γᵒᵈ _ s t
310+
@bdd_above_union αᵒᵈ _ _ _ _
311311

312312
/-- If `a` is the least upper bound of `s` and `b` is the least upper bound of `t`,
313313
then `a ⊔ b` is the least upper bound of `s ∪ t`. -/
@@ -642,22 +642,22 @@ lemma nonempty_of_not_bdd_below [ha : nonempty α] (h : ¬bdd_below s) : s.nonem
642642
-/
643643

644644
/-- Adding a point to a set preserves its boundedness above. -/
645-
@[simp] lemma bdd_above_insert [semilattice_sup γ] (a : γ) {s : set γ} :
645+
@[simp] lemma bdd_above_insert [is_directed α (≤)] {s : set α} {a : α} :
646646
bdd_above (insert a s) ↔ bdd_above s :=
647647
by simp only [insert_eq, bdd_above_union, bdd_above_singleton, true_and]
648648

649-
lemma bdd_above.insert [semilattice_sup γ] (a : γ) {s : set γ} (hs : bdd_above s) :
650-
bdd_above (insert a s) :=
651-
(bdd_above_insert a).2 hs
649+
protected lemma bdd_above.insert [is_directed α (≤)] {s : set α} (a : α) :
650+
bdd_above s → bdd_above (insert a s) :=
651+
bdd_above_insert.2
652652

653653
/--Adding a point to a set preserves its boundedness below.-/
654-
@[simp] lemma bdd_below_insert [semilattice_inf γ] (a : γ) {s : set γ} :
654+
@[simp] lemma bdd_below_insert [is_directed α (≥)] {s : set α} {a : α} :
655655
bdd_below (insert a s) ↔ bdd_below s :=
656656
by simp only [insert_eq, bdd_below_union, bdd_below_singleton, true_and]
657657

658-
lemma bdd_below.insert [semilattice_inf γ] (a : γ) {s : set γ} (hs : bdd_below s) :
659-
bdd_below (insert a s) :=
660-
(bdd_below_insert a).2 hs
658+
lemma bdd_below.insert [is_directed α (≥)] {s : set α} (a : α) :
659+
bdd_below s → bdd_below (insert a s) :=
660+
bdd_below_insert.2
661661

662662
lemma is_lub.insert [semilattice_sup γ] (a) {b} {s : set γ} (hs : is_lub s b) :
663663
is_lub (insert a s) (a ⊔ b) :=
@@ -1191,3 +1191,32 @@ end
11911191
lemma is_glb_prod [preorder α] [preorder β] {s : set (α × β)} (p : α × β) :
11921192
is_glb s p ↔ is_glb (prod.fst '' s) p.1 ∧ is_glb (prod.snd '' s) p.2 :=
11931193
@is_lub_prod αᵒᵈ βᵒᵈ _ _ _ _
1194+
1195+
section scott_continuous
1196+
variables [preorder α] [preorder β] {f : α → β} {a : α}
1197+
1198+
/-- A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
1199+
sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
1200+
Scott topology.
1201+
1202+
The dual notion
1203+
1204+
```lean
1205+
∀ ⦃d : set α⦄, d.nonempty → directed_on (≥) d → ∀ ⦃a⦄, is_glb d a → is_glb (f '' d) (f a)
1206+
```
1207+
1208+
does not appear to play a significant role in the literature, so is omitted here.
1209+
-/
1210+
def scott_continuous (f : α → β) : Prop :=
1211+
∀ ⦃d : set α⦄, d.nonempty → directed_on (≤) d → ∀ ⦃a⦄, is_lub d a → is_lub (f '' d) (f a)
1212+
1213+
protected lemma scott_continuous.monotone (h : scott_continuous f) : monotone f :=
1214+
begin
1215+
refine λ a b hab, (h (insert_nonempty _ _) (directed_on_pair le_refl hab) _).1
1216+
(mem_image_of_mem _ $ mem_insert _ _),
1217+
rw [is_lub, upper_bounds_insert, upper_bounds_singleton,
1218+
inter_eq_self_of_subset_right (Ici_subset_Ici.2 hab)],
1219+
exact is_least_Ici,
1220+
end
1221+
1222+
end scott_continuous

src/order/directed.lean

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Authors: Johannes Hölzl
66
import data.set.image
77
import order.lattice
88
import order.max
9-
import order.bounds.basic
109

1110
/-!
1211
# Directed indexed families and sets
@@ -259,42 +258,3 @@ instance order_top.to_is_directed_le [has_le α] [order_top α] : is_directed α
259258
@[priority 100] -- see Note [lower instance priority]
260259
instance order_bot.to_is_directed_ge [has_le α] [order_bot α] : is_directed α (≥) :=
261260
⟨λ a b, ⟨⊥, bot_le, bot_le⟩⟩
262-
263-
section scott_continuous
264-
265-
variables [preorder α] {a : α}
266-
267-
/--
268-
A function between preorders is said to be Scott continuous if it preserves `is_lub` on directed
269-
sets. It can be shown that a function is Scott continuous if and only if it is continuous wrt the
270-
Scott topology.
271-
272-
The dual notion
273-
274-
```lean
275-
∀ ⦃d : set α⦄, d.nonempty → directed_on (≥) d → ∀ ⦃a⦄, is_glb d a → is_glb (f '' d) (f a)
276-
```
277-
278-
does not appear to play a significant role in the literature, so is omitted here.
279-
-/
280-
def scott_continuous [preorder β] (f : α → β) : Prop :=
281-
∀ ⦃d : set α⦄, d.nonempty → directed_on (≤) d → ∀ ⦃a⦄, is_lub d a → is_lub (f '' d) (f a)
282-
283-
protected lemma scott_continuous.monotone [preorder β] {f : α → β}
284-
(h : scott_continuous f) :
285-
monotone f :=
286-
begin
287-
intros a b hab,
288-
have e1 : is_lub (f '' {a, b}) (f b),
289-
{ apply h,
290-
{ exact set.insert_nonempty _ _ },
291-
{ exact directed_on_pair le_refl hab },
292-
{ rw [is_lub, upper_bounds_insert, upper_bounds_singleton,
293-
set.inter_eq_self_of_subset_right (set.Ici_subset_Ici.mpr hab)],
294-
exact is_least_Ici } },
295-
apply e1.1,
296-
rw set.image_pair,
297-
exact set.mem_insert _ _,
298-
end
299-
300-
end scott_continuous

src/order/liminf_limsup.lean

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ lemma not_is_bounded_under_of_tendsto_at_bot [preorder β] [no_min_order β] {f
122122
¬ is_bounded_under (≥) l f :=
123123
@not_is_bounded_under_of_tendsto_at_top α βᵒᵈ _ _ _ _ _ hf
124124

125-
lemma is_bounded_under.bdd_above_range_of_cofinite [semilattice_sup β] {f : α → β}
125+
lemma is_bounded_under.bdd_above_range_of_cofinite [preorder β] [is_directed β (≤)] {f : α → β}
126126
(hf : is_bounded_under (≤) cofinite f) : bdd_above (range f) :=
127127
begin
128128
rcases hf with ⟨b, hb⟩,
@@ -131,17 +131,17 @@ begin
131131
exact ⟨⟨b, ball_image_iff.2 $ λ x, id⟩, (hb.image f).bdd_above⟩
132132
end
133133

134-
lemma is_bounded_under.bdd_below_range_of_cofinite [semilattice_inf β] {f : α → β}
134+
lemma is_bounded_under.bdd_below_range_of_cofinite [preorder β] [is_directed β (≥)] {f : α → β}
135135
(hf : is_bounded_under (≥) cofinite f) : bdd_below (range f) :=
136-
@is_bounded_under.bdd_above_range_of_cofinite α βᵒᵈ _ _ hf
136+
@is_bounded_under.bdd_above_range_of_cofinite α βᵒᵈ _ _ _ hf
137137

138-
lemma is_bounded_under.bdd_above_range [semilattice_sup β] {f : ℕ → β}
138+
lemma is_bounded_under.bdd_above_range [preorder β] [is_directed β (≤)] {f : ℕ → β}
139139
(hf : is_bounded_under (≤) at_top f) : bdd_above (range f) :=
140140
by { rw ← nat.cofinite_eq_at_top at hf, exact hf.bdd_above_range_of_cofinite }
141141

142-
lemma is_bounded_under.bdd_below_range [semilattice_inf β] {f : ℕ → β}
142+
lemma is_bounded_under.bdd_below_range [preorder β] [is_directed β (≥)] {f : ℕ → β}
143143
(hf : is_bounded_under (≥) at_top f) : bdd_below (range f) :=
144-
@is_bounded_under.bdd_above_range βᵒᵈ _ _ hf
144+
@is_bounded_under.bdd_above_range βᵒᵈ _ _ _ hf
145145

146146
/-- `is_cobounded (≺) f` states that the filter `f` does not tend to infinity w.r.t. `≺`. This is
147147
also called frequently bounded. Will be usually instantiated with `≤` or `≥`.
@@ -198,6 +198,31 @@ lemma is_cobounded.mono (h : f ≤ g) : f.is_cobounded r → g.is_cobounded r
198198

199199
end relation
200200

201+
section nonempty
202+
variables [preorder α] [nonempty α] {f : filter β} {u : β → α}
203+
204+
lemma is_bounded_le_at_bot : (at_bot : filter α).is_bounded (≤) :=
205+
‹nonempty α›.elim $ λ a, ⟨a, eventually_le_at_bot _⟩
206+
207+
lemma is_bounded_ge_at_top : (at_top : filter α).is_bounded (≥) :=
208+
‹nonempty α›.elim $ λ a, ⟨a, eventually_ge_at_top _⟩
209+
210+
lemma tendsto.is_bounded_under_le_at_bot (h : tendsto u f at_bot) : f.is_bounded_under (≤) u :=
211+
is_bounded_le_at_bot.mono h
212+
213+
lemma tendsto.is_bounded_under_ge_at_top (h : tendsto u f at_top) : f.is_bounded_under (≥) u :=
214+
is_bounded_ge_at_top.mono h
215+
216+
lemma bdd_above_range_of_tendsto_at_top_at_bot [is_directed α (≤)] {u : ℕ → α}
217+
(hx : tendsto u at_top at_bot) : bdd_above (set.range u) :=
218+
hx.is_bounded_under_le_at_bot.bdd_above_range
219+
220+
lemma bdd_below_range_of_tendsto_at_top_at_top [is_directed α (≥)] {u : ℕ → α}
221+
(hx : tendsto u at_top at_top) : bdd_below (set.range u) :=
222+
hx.is_bounded_under_ge_at_top.bdd_below_range
223+
224+
end nonempty
225+
201226
lemma is_cobounded_le_of_bot [preorder α] [order_bot α] {f : filter α} : f.is_cobounded (≤) :=
202227
⟨⊥, assume a h, bot_le⟩
203228

@@ -955,6 +980,15 @@ lemma frequently_lt_of_liminf_lt {α β} [conditionally_complete_linear_order β
955980
∃ᶠ x in f, u x < b :=
956981
@frequently_lt_of_lt_limsup _ βᵒᵈ _ f u b hu h
957982

983+
variables [conditionally_complete_linear_order α] {f : filter α} {b : α}
984+
985+
lemma lt_mem_sets_of_Limsup_lt (h : f.is_bounded (≤)) (l : f.Limsup < b) : ∀ᶠ a in f, a < b :=
986+
let ⟨c, (h : ∀ᶠ a in f, a ≤ c), hcb⟩ := exists_lt_of_cInf_lt h l in
987+
mem_of_superset h $ λ a, hcb.trans_le'
988+
989+
lemma gt_mem_sets_of_Liminf_gt : f.is_bounded (≥) → b < f.Liminf → ∀ᶠ a in f, b < a :=
990+
@lt_mem_sets_of_Limsup_lt αᵒᵈ _ _ _
991+
958992
end conditionally_complete_linear_order
959993

960994
end filter

src/topology/algebra/order/liminf_limsup.lean

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ lemma filter.tendsto.is_cobounded_under_ge {f : filter β} {u : β → α} {a :
5151
[ne_bot f] (h : tendsto u f (𝓝 a)) : f.is_cobounded_under (≥) u :=
5252
h.is_bounded_under_le.is_cobounded_flip
5353

54-
lemma is_bounded_le_at_bot (α : Type*) [hα : nonempty α] [preorder α] :
55-
(at_bot : filter α).is_bounded (≤) :=
56-
is_bounded_iff.2 ⟨set.Iic hα.some, mem_at_bot _, hα.some, λ x hx, hx⟩
57-
58-
lemma filter.tendsto.is_bounded_under_le_at_bot {α : Type*} [nonempty α] [preorder α]
59-
{f : filter β} {u : β → α} (h : tendsto u f at_bot) :
60-
f.is_bounded_under (≤) u :=
61-
(is_bounded_le_at_bot α).mono h
62-
63-
lemma bdd_above_range_of_tendsto_at_top_at_bot {α : Type*} [nonempty α] [semilattice_sup α]
64-
{u : ℕ → α} (hx : tendsto u at_top at_bot) : bdd_above (set.range u) :=
65-
(filter.tendsto.is_bounded_under_le_at_bot hx).bdd_above_range
66-
6754
end order_closed_topology
6855

6956
section order_closed_topology
@@ -90,33 +77,11 @@ lemma filter.tendsto.is_cobounded_under_le {f : filter β} {u : β → α} {a :
9077
[ne_bot f] (h : tendsto u f (𝓝 a)) : f.is_cobounded_under (≤) u :=
9178
h.is_bounded_under_ge.is_cobounded_flip
9279

93-
lemma is_bounded_ge_at_top (α : Type*) [hα : nonempty α] [preorder α] :
94-
(at_top : filter α).is_bounded (≥) :=
95-
is_bounded_le_at_bot αᵒᵈ
96-
97-
lemma filter.tendsto.is_bounded_under_ge_at_top {α : Type*} [nonempty α] [preorder α]
98-
{f : filter β} {u : β → α} (h : tendsto u f at_top) :
99-
f.is_bounded_under (≥) u :=
100-
(is_bounded_ge_at_top α).mono h
101-
102-
lemma bdd_below_range_of_tendsto_at_top_at_top {α : Type*} [nonempty α] [semilattice_inf α]
103-
{u : ℕ → α} (hx : tendsto u at_top at_top) : bdd_below (set.range u) :=
104-
(filter.tendsto.is_bounded_under_ge_at_top hx).bdd_below_range
105-
10680
end order_closed_topology
10781

10882
section conditionally_complete_linear_order
10983
variables [conditionally_complete_linear_order α]
11084

111-
theorem lt_mem_sets_of_Limsup_lt {f : filter α} {b} (h : f.is_bounded (≤)) (l : f.Limsup < b) :
112-
∀ᶠ a in f, a < b :=
113-
let ⟨c, (h : ∀ᶠ a in f, a ≤ c), hcb⟩ := exists_lt_of_cInf_lt h l in
114-
mem_of_superset h $ assume a hac, lt_of_le_of_lt hac hcb
115-
116-
theorem gt_mem_sets_of_Liminf_gt : ∀ {f : filter α} {b}, f.is_bounded (≥) → b < f.Liminf →
117-
∀ᶠ a in f, b < a :=
118-
@lt_mem_sets_of_Limsup_lt αᵒᵈ _
119-
12085
variables [topological_space α] [order_topology α]
12186

12287
/-- If the liminf and the limsup of a filter coincide, then this filter converges to

0 commit comments

Comments
 (0)