Skip to content

Commit 80dbc51

Browse files
vihdzpj-loreaux
andcommitted
feat: order topologies of successor orders (leanprover-community#32455)
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
1 parent da3584a commit 80dbc51

File tree

4 files changed

+126
-43
lines changed

4 files changed

+126
-43
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7481,6 +7481,7 @@ public import Mathlib.Topology.Order.ProjIcc
74817481
public import Mathlib.Topology.Order.Real
74827482
public import Mathlib.Topology.Order.Rolle
74837483
public import Mathlib.Topology.Order.ScottTopology
7484+
public import Mathlib.Topology.Order.SuccPred
74847485
public import Mathlib.Topology.Order.T5
74857486
public import Mathlib.Topology.Order.UpperLowerSetTopology
74867487
public import Mathlib.Topology.Order.WithTop

Mathlib/Order/Cover.lean

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,20 +388,27 @@ section LinearOrder
388388

389389
variable [LinearOrder α] {a b c : α}
390390

391+
@[to_dual ge_of_gt]
392+
theorem WCovBy.le_of_lt (hab : a ⩿ b) (hcb : c < b) : c ≤ a :=
393+
not_lt.1 fun hac => hab.2 hac hcb
394+
395+
@[to_dual ge_of_gt]
396+
theorem CovBy.le_of_lt (hab : a ⋖ b) : c < b → c ≤ a :=
397+
hab.wcovBy.le_of_lt
398+
391399
theorem CovBy.Ioi_eq (h : a ⋖ b) : Ioi a = Ici b := by
392400
rw [← Ioo_union_Ici_eq_Ioi h.lt, h.Ioo_eq, empty_union]
393401

394402
@[to_dual existing]
395403
theorem CovBy.Iio_eq (h : a ⋖ b) : Iio b = Iic a := by
396404
rw [← Iic_union_Ioo_eq_Iio h.lt, h.Ioo_eq, union_empty]
397405

398-
@[to_dual ge_of_gt]
399-
theorem WCovBy.le_of_lt (hab : a ⩿ b) (hcb : c < b) : c ≤ a :=
400-
not_lt.1 fun hac => hab.2 hac hcb
406+
theorem CovBy.Ioo_eq_Ico (h : a ⋖ b) (c : α) : Ioo a c = Ico b c :=
407+
subset_antisymm (fun _x hx ↦ ⟨h.ge_of_gt hx.1, hx.2⟩) <| Ico_subset_Ioo_left h.lt
401408

402-
@[to_dual ge_of_gt]
403-
theorem CovBy.le_of_lt (hab : a ⋖ b) : c < b → c ≤ a :=
404-
hab.wcovBy.le_of_lt
409+
@[to_dual existing]
410+
theorem CovBy.Ioo_eq_Ioc (h : a ⋖ b) (c : α) : Ioo c b = Ioc c a :=
411+
subset_antisymm (fun _x hx ↦ ⟨hx.1, h.le_of_lt hx.2⟩) <| Ioc_subset_Ioo_right h.lt
405412

406413
@[to_dual unique_right]
407414
theorem CovBy.unique_left (ha : a ⋖ c) (hb : b ⋖ c) : a = b :=

Mathlib/SetTheory/Ordinal/Topology.lean

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public import Mathlib.SetTheory.Ordinal.Enum
99
public import Mathlib.Tactic.TFAE
1010
public import Mathlib.Topology.Order.IsNormal
1111
public import Mathlib.Topology.Order.Monotone
12+
public import Mathlib.Topology.Order.SuccPred
1213

1314
/-!
1415
### Topology of ordinals
@@ -41,34 +42,17 @@ variable {s : Set Ordinal.{u}} {a : Ordinal.{u}}
4142
instance : TopologicalSpace Ordinal.{u} := Preorder.topology Ordinal.{u}
4243
instance : OrderTopology Ordinal.{u} := ⟨rfl⟩
4344

44-
-- todo: generalize to other well-orders
45-
theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) ↔ ¬ IsSuccLimit a := by
46-
refine ⟨fun h ha => ?_, fun ha => ?_⟩
47-
· obtain ⟨b, c, hbc, hbc'⟩ :=
48-
(mem_nhds_iff_exists_Ioo_subset' ⟨0, ha.bot_lt⟩ ⟨_, lt_succ a⟩).1
49-
(h.mem_nhds rfl)
50-
have hba := ha.succ_lt hbc.1
51-
exact hba.ne (hbc' ⟨lt_succ b, hba.trans hbc.2⟩)
52-
· rcases zero_or_succ_or_isSuccLimit a with (rfl | ⟨b, rfl⟩ | ha')
53-
· rw [← bot_eq_zero, ← Set.Iic_bot, ← Iio_succ]
54-
exact isOpen_Iio
55-
· rw [← Set.Icc_self, Icc_succ_left, ← Ioo_succ_right]
56-
exact isOpen_Ioo
57-
· exact (ha ha').elim
58-
59-
-- todo: generalize to a `SuccOrder`
45+
@[deprecated SuccOrder.isOpen_singleton_iff (since := "2026-01-20")]
46+
theorem isOpen_singleton_iff : IsOpen ({a} : Set Ordinal) ↔ ¬ IsSuccLimit a :=
47+
SuccOrder.isOpen_singleton_iff
48+
49+
@[deprecated SuccOrder.nhds_eq_pure (since := "2026-01-20")]
6050
theorem nhds_eq_pure : 𝓝 a = pure a ↔ ¬ IsSuccLimit a :=
61-
(isOpen_singleton_iff_nhds_eq_pure _).symm.trans isOpen_singleton_iff
62-
63-
-- todo: generalize this lemma to a `SuccOrder`
64-
theorem isOpen_iff : IsOpen s ↔ ∀ o ∈ s, IsSuccLimit o → ∃ a < o, Set.Ioo a o ⊆ s := by
65-
refine isOpen_iff_mem_nhds.trans <| forall₂_congr fun o ho => ?_
66-
by_cases ho' : IsSuccLimit o
67-
· simp only [(SuccOrder.hasBasis_nhds_Ioc_of_exists_lt ⟨0, ho'.bot_lt⟩).mem_iff, ho',
68-
true_implies]
69-
refine exists_congr fun a => and_congr_right fun ha => ?_
70-
simp only [← Set.Ioo_insert_right ha, Set.insert_subset_iff, ho, true_and]
71-
· simp [nhds_eq_pure.2 ho', ho, ho']
51+
SuccOrder.nhds_eq_pure
52+
53+
@[deprecated SuccOrder.isOpen_iff (since := "2026-01-20")]
54+
theorem isOpen_iff : IsOpen s ↔ ∀ o ∈ s, IsSuccLimit o → ∃ a < o, Set.Ioo a o ⊆ s :=
55+
SuccOrder.isOpen_iff
7256

7357
open List Set in
7458
theorem mem_closure_tfae (a : Ordinal.{u}) (s : Set Ordinal) :
@@ -154,16 +138,9 @@ theorem isClosed_iff_bsup :
154138
apply H (type_ne_zero_iff_nonempty.2 hι)
155139
exact fun i hi => hf _
156140

157-
-- todo: generalize to other well-orders
158-
theorem isSuccLimit_of_mem_frontier (ha : a ∈ frontier s) : IsSuccLimit a := by
159-
simp only [frontier_eq_closure_inter_closure, Set.mem_inter_iff, mem_closure_iff] at ha
160-
by_contra h
161-
rw [← isOpen_singleton_iff] at h
162-
rcases ha.1 _ h rfl with ⟨b, hb, hb'⟩
163-
rcases ha.2 _ h rfl with ⟨c, hc, hc'⟩
164-
rw [Set.mem_singleton_iff] at *
165-
subst hb; subst hc
166-
exact hc' hb'
141+
@[deprecated SuccOrder.isSuccLimit_of_mem_frontier (since := "2026-01-20")]
142+
theorem isSuccLimit_of_mem_frontier (ha : a ∈ frontier s) : IsSuccLimit a :=
143+
SuccOrder.isSuccLimit_of_mem_frontier ha
167144

168145
@[deprecated Order.isNormal_iff_strictMono_and_continuous (since := "2025-08-21")]
169146
theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/-
2+
Copyright (c) 2025 Jireh Loreaux. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Jireh Loreaux, Violeta Hernández Palacios
5+
-/
6+
module
7+
8+
public import Mathlib.Topology.Order.Basic
9+
public import Mathlib.Order.SuccPred.Limit
10+
11+
/-!
12+
# Order topologies of successor or predecessor orders
13+
14+
This file proves miscellaneous results under the assumption of `OrderTopology` plus either of
15+
`SuccOrder` or `PredOrder`.
16+
-/
17+
18+
@[expose] public section
19+
20+
variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [OrderTopology α]
21+
{a : α} {s : Set α}
22+
23+
open Order Topology
24+
25+
namespace SuccOrder
26+
variable [SuccOrder α]
27+
28+
theorem isOpen_singleton_of_not_isSuccPrelimit (ha : ¬ IsSuccPrelimit a) : IsOpen {a} := by
29+
obtain ⟨b, hb⟩ := not_isSuccPrelimit_iff_exists_covBy a |>.mp ha
30+
by_cases ha' : IsMax a
31+
· convert isOpen_Ioi (a := b) using 1
32+
rw [hb.Ioi_eq]
33+
grind [IsMax]
34+
· convert isOpen_Ioo (a := b) (b := Order.succ a) using 1
35+
simp [(covBy_succ_of_not_isMax ha').Ioo_eq_Ioc, hb.Ioc_eq]
36+
37+
variable [NoMaxOrder α]
38+
39+
theorem isOpen_singleton_iff : IsOpen {a} ↔ ¬ IsSuccLimit a := by
40+
nontriviality α
41+
refine ⟨fun h ha ↦ ?_, fun ha ↦ ?_⟩
42+
· obtain ⟨l, u, h₁, h₂⟩ := mem_nhds_iff_exists_Ioo_subset' (by simpa using ha.not_isMin)
43+
(by simpa only [not_isMax_iff] using not_isMax a) |>.mp (h.mem_nhds (Set.mem_singleton a))
44+
refine ha.isSuccPrelimit l ?_
45+
rw [← succ_eq_iff_covBy]
46+
simp only [Set.mem_Ioo, Set.subset_singleton_iff] at h₁ h₂
47+
exact h₂ _ ⟨lt_succ l, h₁.1.succ_le.trans_lt h₁.2
48+
· obtain (ha | ha) := not_isSuccLimit_iff.mp ha
49+
· convert isOpen_Iio (a := Order.succ a) using 1
50+
simp [ha.Iic_eq]
51+
· exact isOpen_singleton_of_not_isSuccPrelimit ha
52+
53+
theorem nhds_eq_pure {a : α} : 𝓝 a = pure a ↔ ¬ IsSuccLimit a :=
54+
(isOpen_singleton_iff_nhds_eq_pure _).symm.trans isOpen_singleton_iff
55+
56+
theorem isOpen_iff {s : Set α} : IsOpen s ↔
57+
∀ o ∈ s, IsSuccLimit o → ∃ a < o, Set.Ioo a o ⊆ s := by
58+
refine isOpen_iff_mem_nhds.trans <| forall₂_congr fun o ho ↦ ?_
59+
by_cases ho' : IsSuccLimit o
60+
· rw [(SuccOrder.hasBasis_nhds_Ioc_of_exists_lt (not_isMin_iff.1 ho'.not_isMin)).mem_iff]
61+
grind
62+
· simp [nhds_eq_pure.2 ho', ho, ho']
63+
64+
theorem isSuccLimit_of_mem_frontier {a : α} {s : Set α} (ha : a ∈ frontier s) : IsSuccLimit a := by
65+
rw [← isOpen_singleton_iff.not_left]
66+
rw [frontier_eq_closure_inter_closure] at ha
67+
grind [mem_closure_iff, Set.Nonempty]
68+
69+
end SuccOrder
70+
71+
-- TODO: use `to_dual`
72+
namespace PredOrder
73+
variable [PredOrder α]
74+
75+
theorem isOpen_singleton_of_not_isPredPrelimit (ha : ¬ IsPredPrelimit a) : IsOpen {a} :=
76+
SuccOrder.isOpen_singleton_of_not_isSuccPrelimit (α := αᵒᵈ) (isSuccPrelimit_toDual_iff.not.2 ha)
77+
78+
variable [NoMinOrder α]
79+
80+
theorem isOpen_singleton_iff : IsOpen {a} ↔ ¬ IsPredLimit a :=
81+
(SuccOrder.isOpen_singleton_iff (α := αᵒᵈ)).trans isSuccLimit_toDual_iff.not
82+
83+
theorem nhds_eq_pure {a : α} : 𝓝 a = pure a ↔ ¬ IsPredLimit a :=
84+
(isOpen_singleton_iff_nhds_eq_pure _).symm.trans isOpen_singleton_iff
85+
86+
theorem isOpen_iff {s : Set α} : IsOpen s ↔
87+
∀ o ∈ s, IsPredLimit o → ∃ a, o < a ∧ Set.Ioo o a ⊆ s := by
88+
refine isOpen_iff_mem_nhds.trans <| forall₂_congr fun o ho ↦ ?_
89+
by_cases ho' : IsPredLimit o
90+
· rw [(PredOrder.hasBasis_nhds_Ioc_of_exists_gt (not_isMax_iff.1 ho'.not_isMax)).mem_iff]
91+
grind
92+
· simp [nhds_eq_pure.2 ho', ho, ho']
93+
94+
theorem isPredLimit_of_mem_frontier {a : α} {s : Set α} (ha : a ∈ frontier s) : IsPredLimit a := by
95+
rw [← isSuccLimit_toDual_iff]
96+
exact SuccOrder.isSuccLimit_of_mem_frontier (α := αᵒᵈ) ha
97+
98+
end PredOrder

0 commit comments

Comments
 (0)