Skip to content

Commit 8405e44

Browse files
committed
feat: generalize some lemmas about linear ordered topological spaces (#33863)
Currently, lemmas about `Filter.map ((↑) : Set.Iio a → X) Filter.atTop` etc assume that the ambient type is densely ordered. However, it suffices to require that `a` is an `Order.IsSuccPrelimit`. Make this generalization and move the lemmas to a new file. Also, use the new lemmas to drop a `[DenselyOrdered _]` assumption in one lemma in measure theory. These more precise statements are also useful when dealing with, e.g., linear ordered topologies defined by ordinals.
1 parent 6062e0e commit 8405e44

File tree

7 files changed

+224
-127
lines changed

7 files changed

+224
-127
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7380,6 +7380,7 @@ public import Mathlib.Topology.OpenPartialHomeomorph.Continuity
73807380
public import Mathlib.Topology.OpenPartialHomeomorph.Defs
73817381
public import Mathlib.Topology.OpenPartialHomeomorph.IsImage
73827382
public import Mathlib.Topology.Order
7383+
public import Mathlib.Topology.Order.AtTopBotIxx
73837384
public import Mathlib.Topology.Order.Basic
73847385
public import Mathlib.Topology.Order.Bornology
73857386
public import Mathlib.Topology.Order.Category.AlexDisc

Mathlib/Analysis/SpecialFunctions/Exp.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public import Mathlib.Analysis.Complex.Asymptotics
99
public import Mathlib.Analysis.Complex.Trigonometric
1010
public import Mathlib.Analysis.SpecificLimits.Normed
1111
public import Mathlib.Topology.Algebra.MetricSpace.Lipschitz
12+
import Mathlib.Topology.Order.AtTopBotIxx
1213

1314
/-!
1415
# Complex and real exponential
@@ -300,10 +301,11 @@ theorem tendsto_div_pow_mul_exp_add_atTop (b c : ℝ) (n : ℕ) (hb : 0 ≠ b) :
300301

301302
/-- `Real.exp` as an order isomorphism between `ℝ` and `(0, +∞)`. -/
302303
def expOrderIso : ℝ ≃o Ioi (0 : ℝ) :=
303-
StrictMono.orderIsoOfSurjective _ (exp_strictMono.codRestrict exp_pos) <|
304+
StrictMono.orderIsoOfSurjective _
305+
(exp_strictMono.codRestrict fun x ↦ Set.mem_Ioi.mpr (exp_pos x)) <|
304306
(continuous_exp.subtype_mk _).surjective
305307
(by rw [tendsto_Ioi_atTop]; simp only [tendsto_exp_atTop])
306-
(by rw [tendsto_Ioi_atBot]; simp only [tendsto_exp_atBot_nhdsGT])
308+
(by simp [tendsto_exp_atBot_nhdsGT])
307309

308310
@[simp]
309311
theorem coe_expOrderIso_apply (x : ℝ) : (expOrderIso x : ℝ) = exp x :=

Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin
66
module
77

88
public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
9+
import Mathlib.Topology.Order.AtTopBotIxx
910

1011
/-!
1112
# The `arctan` function.
@@ -192,10 +193,10 @@ theorem arctan_eq_zero_iff : arctan x = 0 ↔ x = 0 :=
192193
.trans (by rw [arctan_zero]) arctan_injective.eq_iff
193194

194195
theorem tendsto_arctan_atTop : Tendsto arctan atTop (𝓝[<] (π / 2)) :=
195-
tendsto_Ioo_atTop.mp tanOrderIso.symm.tendsto_atTop
196+
tendsto_Ioo_atTop (by simp) |>.mp tanOrderIso.symm.tendsto_atTop
196197

197198
theorem tendsto_arctan_atBot : Tendsto arctan atBot (𝓝[>] (-(π / 2))) :=
198-
tendsto_Ioo_atBot.mp tanOrderIso.symm.tendsto_atBot
199+
tendsto_Ioo_atBot (by simp) |>.mp tanOrderIso.symm.tendsto_atBot
199200

200201
theorem arctan_eq_of_tan_eq (h : tan x = y) (hx : x ∈ Ioo (-(π / 2)) (π / 2)) :
201202
arctan y = x :=

Mathlib/MeasureTheory/Measure/Hausdorff.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic
1010
public import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
1111
public import Mathlib.Topology.MetricSpace.Holder
1212
public import Mathlib.Topology.MetricSpace.MetricSeparated
13+
import Mathlib.Topology.Order.AtTopBotIxx
1314

1415
/-!
1516
# Hausdorff measure and metric (outer) measures
@@ -276,7 +277,7 @@ theorem mono_pre_nat (m : Set X → ℝ≥0∞) : Monotone fun k : ℕ => pre m
276277

277278
theorem tendsto_pre (m : Set X → ℝ≥0∞) (s : Set X) :
278279
Tendsto (fun r => pre m r s) (𝓝[>] 0) (𝓝 <| mkMetric' m s) := by
279-
rw [← map_coe_Ioi_atBot, tendsto_map'_iff]
280+
rw [← tendsto_comp_coe_Ioi_atBot]
280281
simp only [mkMetric', OuterMeasure.iSup_apply, iSup_subtype']
281282
exact tendsto_atBot_iSup fun r r' hr => mono_pre _ hr _
282283

Mathlib/MeasureTheory/Measure/MeasureSpace.lean

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.MeasureTheory.MeasurableSpace.MeasurablyGenerated
99
public import Mathlib.MeasureTheory.Measure.NullMeasurable
1010
public import Mathlib.Order.Interval.Set.Monotone
11+
import Mathlib.Topology.Order.AtTopBotIxx
1112

1213
/-!
1314
# Measure spaces
@@ -650,17 +651,21 @@ theorem exists_measure_iInter_lt {α ι : Type*} {_ : MeasurableSpace α} {μ :
650651
/-- The measure of the intersection of a decreasing sequence of measurable
651652
sets indexed by a linear order with first countable topology is the limit of the measures. -/
652653
theorem tendsto_measure_biInter_gt {ι : Type*} [LinearOrder ι] [TopologicalSpace ι]
653-
[OrderTopology ι] [DenselyOrdered ι] [FirstCountableTopology ι] {s : ι → Set α}
654+
[OrderTopology ι] [FirstCountableTopology ι] {s : ι → Set α}
654655
{a : ι} (hs : ∀ r > a, NullMeasurableSet (s r) μ) (hm : ∀ i j, a < i → i ≤ j → s i ⊆ s j)
655656
(hf : ∃ r > a, μ (s r) ≠ ∞) : Tendsto (μ ∘ s) (𝓝[Ioi a] a) (𝓝 (μ (⋂ r > a, s r))) := by
656-
have : (atBot : Filter (Ioi a)).IsCountablyGenerated := by
657-
rw [← comap_coe_Ioi_nhdsGT]
658-
infer_instance
659-
simp_rw [← map_coe_Ioi_atBot, tendsto_map'_iff, ← mem_Ioi, biInter_eq_iInter]
660-
apply tendsto_measure_iInter_atBot
661-
· rwa [Subtype.forall]
662-
· exact fun i j h ↦ hm i j i.2 h
663-
· simpa only [Subtype.exists, exists_prop]
657+
by_cases ha : Order.IsPredPrelimit a
658+
· have : (atBot : Filter (Ioi a)).IsCountablyGenerated := by
659+
rw [← comap_coe_Ioi_nhdsGT a ha]
660+
infer_instance
661+
simp_rw [← map_coe_Ioi_atBot a ha, tendsto_map'_iff, ← mem_Ioi, biInter_eq_iInter]
662+
apply tendsto_measure_iInter_atBot
663+
· rwa [Subtype.forall]
664+
· exact fun i j h ↦ hm i j i.2 h
665+
· simpa only [Subtype.exists, exists_prop]
666+
· rw [Order.not_isPredPrelimit_iff_exists_covBy] at ha
667+
rcases ha with ⟨b, hab⟩
668+
simp [hab.nhdsGT]
664669

665670
theorem measure_if {x : β} {t : Set β} {s : Set α} [Decidable (x ∈ t)] :
666671
μ (if x ∈ t then s else ∅) = indicator t (fun _ => μ s) x := by split_ifs with h <;> simp [h]
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
/-
2+
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury Kudryashov
5+
-/
6+
module
7+
8+
public import Mathlib.Topology.Order.Basic
9+
public import Mathlib.Order.SuccPred.Limit
10+
import Mathlib.Topology.Order.IsLUB
11+
12+
/-!
13+
# `Filter.atTop` and `Filter.atBot` for intervals in a linear order topology
14+
15+
Let `X` be a linear order with order topology.
16+
Let `a` be a point that is either the bottom element of `X` or is not isolated on the left,
17+
see `Order.IsSuccPrelimit`.
18+
Then the `Filter.atTop` filter on `Set.Iio a` and `𝓝[<] a` are related by the coercion map
19+
via pushforward and pullback, see `map_coe_Iio_atTop` and `comap_coe_Iio_nhdsLT`.
20+
21+
We prove several versions of this statement for `Set.Iio`, `Set.Ioi`, and `Set.Ioo`,
22+
as well as `Filter.atTop` and `Filter.atBot`.
23+
24+
The assumption on `a` is automatically satisfied for densely ordered types,
25+
see `Order.IsSuccPrelimit.of_dense`.
26+
-/
27+
28+
public section
29+
30+
open Set Filter Order OrderDual
31+
open scoped Topology
32+
33+
variable {X : Type*} [LinearOrder X] [TopologicalSpace X] [OrderTopology X]
34+
{s : Set X} {a b : X}
35+
36+
theorem comap_coe_nhdsLT_eq_atTop_iff :
37+
comap ((↑) : s → X) (𝓝[<] b) = atTop ↔
38+
s ⊆ Iio b ∧ (s.Nonempty → ∀ a < b, (s ∩ Ioo a b).Nonempty) := by
39+
rcases s.eq_empty_or_nonempty with rfl | hsne
40+
· simp [eq_iff_true_of_subsingleton]
41+
have := hsne.to_subtype
42+
simp only [hsne, true_imp_iff]
43+
by_cases hsub : s ⊆ Iio b
44+
· simp only [hsub, true_and]
45+
constructor
46+
· intro h a ha
47+
have := preimage_mem_comap (m := ((↑) : s → X)) (Ioo_mem_nhdsLT ha)
48+
rw [h] at this
49+
rcases Filter.nonempty_of_mem this with ⟨⟨c, hcs⟩, hc⟩
50+
exact ⟨c, hcs, hc⟩
51+
· intro h
52+
refine (nhdsLT_basis_of_exists_lt (hsne.mono hsub)).comap _ |>.ext atTop_basis ?_ ?_
53+
· intro a hab
54+
rcases h a hab with ⟨c, hcs, hc⟩
55+
use ⟨c, hcs⟩
56+
simp_all [subset_def, hc.1.trans_le]
57+
· rintro ⟨a, has⟩ -
58+
use a, hsub has
59+
simp_all [subset_def, le_of_lt]
60+
· suffices ¬Tendsto (↑) (atTop : Filter s) (𝓝[<] b) by
61+
contrapose this
62+
simp_all [tendsto_iff_comap]
63+
intro h
64+
rcases not_subset_iff_exists_mem_notMem.mp hsub with ⟨a, has, ha⟩
65+
rcases h.eventually eventually_mem_nhdsWithin |>.and (eventually_ge_atTop ⟨a, has⟩) |>.exists
66+
with ⟨⟨c, hcs⟩, hcb, hac⟩
67+
apply lt_irrefl a
68+
calc
69+
a ≤ c := by simpa using hac
70+
_ < b := by simpa using hcb
71+
_ ≤ a := by simpa using ha
72+
73+
theorem comap_coe_nhdsGT_eq_atBot_iff :
74+
comap ((↑) : s → X) (𝓝[>] b) = atBot ↔
75+
s ⊆ Ioi b ∧ (s.Nonempty → ∀ a > b, (s ∩ Ioo b a).Nonempty) := by
76+
refine comap_coe_nhdsLT_eq_atTop_iff (s := OrderDual.ofDual ⁻¹' s) (b := OrderDual.toDual b)
77+
|>.trans <| .and .rfl <| forall₃_congr fun hne a ha ↦ ?_
78+
rw [← a.toDual_ofDual, Ioo_toDual]
79+
rfl
80+
81+
theorem comap_coe_nhdsLT_of_Ioo_subset (hsb : s ⊆ Iio b) (hs : s.Nonempty → ∃ a < b, Ioo a b ⊆ s)
82+
(hb : IsSuccPrelimit b := by exact .of_dense _) :
83+
comap ((↑) : s → X) (𝓝[<] b) = atTop := by
84+
rw [comap_coe_nhdsLT_eq_atTop_iff]
85+
refine ⟨hsb, fun hsne a ha ↦ ?_⟩
86+
rcases hs hsne with ⟨c, hcb, hcs⟩
87+
rcases hb.lt_iff_exists_lt.mp (max_lt ha hcb) with ⟨x, hxb, hacx⟩
88+
rw [max_lt_iff] at hacx
89+
exact ⟨x, hcs ⟨hacx.2, hxb⟩, hacx.1, hxb⟩
90+
91+
theorem comap_coe_nhdsGT_of_Ioo_subset (hsa : s ⊆ Ioi a) (hs : s.Nonempty → ∃ b > a, Ioo a b ⊆ s)
92+
(ha : IsPredPrelimit a := by exact .of_dense _) :
93+
comap ((↑) : s → X) (𝓝[>] a) = atBot := by
94+
refine comap_coe_nhdsLT_of_Ioo_subset (show ofDual ⁻¹' s ⊆ Iio (toDual a) from hsa) ?_ ha.dual
95+
simpa only [OrderDual.exists, Ioo_toDual]
96+
97+
theorem map_coe_atTop_of_Ioo_subset (hsb : s ⊆ Iio b) (hs : ∀ a' < b, ∃ a < b, Ioo a b ⊆ s)
98+
(hb : IsSuccPrelimit b := by exact .of_dense _) :
99+
map ((↑) : s → X) atTop = 𝓝[<] b := by
100+
rcases eq_empty_or_nonempty (Iio b) with (hb' | ⟨a, ha⟩)
101+
· have : IsEmpty s := ⟨fun x => hb'.subset (hsb x.2)⟩
102+
rw [filter_eq_bot_of_isEmpty atTop, Filter.map_bot, hb', nhdsWithin_empty]
103+
· rw [← comap_coe_nhdsLT_of_Ioo_subset hsb (fun _ => hs a ha) hb, map_comap_of_mem]
104+
rw [Subtype.range_val]
105+
exact (mem_nhdsLT_iff_exists_Ioo_subset' ha).2 (hs a ha)
106+
107+
theorem map_coe_atBot_of_Ioo_subset (hsa : s ⊆ Ioi a) (hs : ∀ b' > a, ∃ b > a, Ioo a b ⊆ s)
108+
(ha : IsPredPrelimit a := by exact .of_dense _) :
109+
map ((↑) : s → X) atBot = 𝓝[>] a := by
110+
refine map_coe_atTop_of_Ioo_subset (s := ofDual ⁻¹' s) (b := toDual a) hsa ?_ ha.dual
111+
intro b' hb'
112+
simpa [OrderDual.exists] using hs (ofDual b') hb'
113+
114+
/-- The `atTop` filter for an open interval `Ioo a b` comes from the left-neighbourhoods filter at
115+
the right endpoint in the ambient order. -/
116+
@[simp]
117+
theorem comap_coe_Ioo_nhdsLT (a b : X) (hb : IsSuccPrelimit b := by exact .of_dense _) :
118+
comap ((↑) : Ioo a b → X) (𝓝[<] b) = atTop :=
119+
comap_coe_nhdsLT_of_Ioo_subset Ioo_subset_Iio_self
120+
(fun h => ⟨a, h.elim fun _x hx ↦ hx.1.trans hx.2, Subset.rfl⟩) hb
121+
122+
/-- The `atBot` filter for an open interval `Ioo a b` comes from the right-neighbourhoods filter at
123+
the left endpoint in the ambient order. -/
124+
@[simp]
125+
theorem comap_coe_Ioo_nhdsGT (a b : X) (ha : IsPredPrelimit a := by exact .of_dense _) :
126+
comap ((↑) : Ioo a b → X) (𝓝[>] a) = atBot :=
127+
comap_coe_nhdsGT_of_Ioo_subset Ioo_subset_Ioi_self
128+
(fun h => ⟨b, h.elim fun _x hx ↦ hx.1.trans hx.2, Subset.rfl⟩) ha
129+
130+
@[simp]
131+
theorem comap_coe_Ioi_nhdsGT (a : X) (ha : IsPredPrelimit a := by exact .of_dense _) :
132+
comap ((↑) : Ioi a → X) (𝓝[>] a) = atBot :=
133+
comap_coe_nhdsGT_of_Ioo_subset Subset.rfl (fun ⟨x, hx⟩ => ⟨x, hx, Ioo_subset_Ioi_self⟩) ha
134+
135+
@[simp]
136+
theorem comap_coe_Iio_nhdsLT (a : X) (ha : IsSuccPrelimit a := by exact .of_dense _) :
137+
comap ((↑) : Iio a → X) (𝓝[<] a) = atTop :=
138+
comap_coe_Ioi_nhdsGT (toDual a) ha.dual
139+
140+
@[simp]
141+
theorem map_coe_Ioo_atTop (h : a < b) (hb : IsSuccPrelimit b := by exact .of_dense _) :
142+
map ((↑) : Ioo a b → X) atTop = 𝓝[<] b :=
143+
map_coe_atTop_of_Ioo_subset Ioo_subset_Iio_self (fun _ _ => ⟨_, h, Subset.rfl⟩) hb
144+
145+
@[simp]
146+
theorem map_coe_Ioo_atBot (h : a < b) (ha : IsPredPrelimit a := by exact .of_dense _) :
147+
map ((↑) : Ioo a b → X) atBot = 𝓝[>] a :=
148+
map_coe_atBot_of_Ioo_subset Ioo_subset_Ioi_self (fun _ _ => ⟨_, h, Subset.rfl⟩) ha
149+
150+
@[simp]
151+
theorem map_coe_Ioi_atBot (a : X) (ha : IsPredPrelimit a := by exact .of_dense _) :
152+
map ((↑) : Ioi a → X) atBot = 𝓝[>] a :=
153+
map_coe_atBot_of_Ioo_subset Subset.rfl (fun b hb => ⟨b, hb, Ioo_subset_Ioi_self⟩) ha
154+
155+
@[simp]
156+
theorem map_coe_Iio_atTop (a : X) (ha : IsSuccPrelimit a := by exact .of_dense _) :
157+
map ((↑) : Iio a → X) atTop = 𝓝[<] a :=
158+
map_coe_Ioi_atBot (toDual a) ha.dual
159+
160+
variable {α : Type*} {l : Filter α} {f : X → α}
161+
162+
@[simp]
163+
theorem tendsto_comp_coe_Ioo_atTop (h : a < b) (hb : IsSuccPrelimit b := by exact .of_dense _) :
164+
Tendsto (fun x : Ioo a b => f x) atTop l ↔ Tendsto f (𝓝[<] b) l := by
165+
rw [← map_coe_Ioo_atTop h hb, tendsto_map'_iff, Function.comp_def]
166+
167+
@[simp]
168+
theorem tendsto_comp_coe_Ioo_atBot (h : a < b) (ha : IsPredPrelimit a := by exact .of_dense _) :
169+
Tendsto (fun x : Ioo a b => f x) atBot l ↔ Tendsto f (𝓝[>] a) l := by
170+
rw [← map_coe_Ioo_atBot h ha, tendsto_map'_iff, Function.comp_def]
171+
172+
@[simp]
173+
theorem tendsto_comp_coe_Ioi_atBot (ha : IsPredPrelimit a := by exact .of_dense _) :
174+
Tendsto (fun x : Ioi a => f x) atBot l ↔ Tendsto f (𝓝[>] a) l := by
175+
rw [← map_coe_Ioi_atBot a ha, tendsto_map'_iff, Function.comp_def]
176+
177+
@[simp]
178+
theorem tendsto_comp_coe_Iio_atTop (ha : IsSuccPrelimit a := by exact .of_dense _) :
179+
Tendsto (fun x : Iio a => f x) atTop l ↔ Tendsto f (𝓝[<] a) l := by
180+
rw [← map_coe_Iio_atTop a ha, tendsto_map'_iff, Function.comp_def]
181+
182+
@[simp]
183+
theorem tendsto_Ioo_atTop {f : α → Ioo a b} (hb : IsSuccPrelimit b := by exact .of_dense _) :
184+
Tendsto f l atTop ↔ Tendsto (fun x => (f x : X)) l (𝓝[<] b) := by
185+
rw [← comap_coe_Ioo_nhdsLT a b hb, tendsto_comap_iff, Function.comp_def]
186+
187+
@[simp]
188+
theorem tendsto_Ioo_atBot {f : α → Ioo a b} (ha : IsPredPrelimit a := by exact .of_dense _) :
189+
Tendsto f l atBot ↔ Tendsto (fun x => (f x : X)) l (𝓝[>] a) := by
190+
rw [← comap_coe_Ioo_nhdsGT a b ha, tendsto_comap_iff, Function.comp_def]
191+
192+
@[simp]
193+
theorem tendsto_Ioi_atBot {f : α → Ioi a} (ha : IsPredPrelimit a := by exact .of_dense _) :
194+
Tendsto f l atBot ↔ Tendsto (fun x => (f x : X)) l (𝓝[>] a) := by
195+
rw [← comap_coe_Ioi_nhdsGT a ha, tendsto_comap_iff, Function.comp_def]
196+
197+
@[simp]
198+
theorem tendsto_Iio_atTop {f : α → Iio a} (ha : IsSuccPrelimit a := by exact .of_dense _) :
199+
Tendsto f l atTop ↔ Tendsto (fun x => (f x : X)) l (𝓝[<] a) := by
200+
rw [← comap_coe_Iio_nhdsLT a ha, tendsto_comap_iff, Function.comp_def]

0 commit comments

Comments
 (0)