Skip to content

Commit 53fafe9

Browse files
committed
feat(Topology/Order/Basic): lower set in well-order is open (#26928)
As well as the other analogous theorems.
1 parent e75bdf0 commit 53fafe9

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Mathlib/Order/UpperLower/Basic.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Yaël Dillies, Sara Rousta
66
import Mathlib.Logic.Equiv.Set
77
import Mathlib.Order.Interval.Set.OrderEmbedding
88
import Mathlib.Order.SetNotation
9+
import Mathlib.Order.WellFounded
910

1011
/-!
1112
# Properties of unbundled upper/lower sets
@@ -353,4 +354,23 @@ theorem IsUpperSet.total (hs : IsUpperSet s) (ht : IsUpperSet t) : s ⊆ t ∨ t
353354
theorem IsLowerSet.total (hs : IsLowerSet s) (ht : IsLowerSet t) : s ⊆ t ∨ t ⊆ s :=
354355
hs.toDual.total ht.toDual
355356

357+
theorem IsUpperSet.eq_empty_or_Ici [WellFoundedLT α] (h : IsUpperSet s) :
358+
s = ∅ ∨ (∃ a, s = Set.Ici a) := by
359+
refine or_iff_not_imp_left.2 fun ha ↦ ?_
360+
obtain ⟨a, ha⟩ := Set.nonempty_iff_ne_empty.2 ha
361+
exact ⟨_, Set.ext fun b ↦ ⟨wellFounded_lt.min_le, (h · <| wellFounded_lt.min_mem _ ⟨a, ha⟩)⟩⟩
362+
363+
theorem IsLowerSet.eq_empty_or_Iic [WellFoundedGT α] (h : IsLowerSet s) :
364+
s = ∅ ∨ (∃ a, s = Set.Iic a) :=
365+
IsUpperSet.eq_empty_or_Ici (α := αᵒᵈ) h
366+
367+
theorem IsLowerSet.eq_univ_or_Iio [WellFoundedLT α] (h : IsLowerSet s) :
368+
s = .univ ∨ (∃ a, s = Set.Iio a) := by
369+
simp_rw [← @compl_inj_iff _ s]
370+
simpa using h.compl.eq_empty_or_Ici
371+
372+
theorem IsUpperSet.eq_univ_or_Ioi [WellFoundedGT α] (h : IsUpperSet s) :
373+
s = .univ ∨ (∃ a, s = Set.Ioi a) :=
374+
IsLowerSet.eq_univ_or_Iio (α := αᵒᵈ) h
375+
356376
end LinearOrder

Mathlib/Topology/Order/Basic.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,23 @@ theorem dense_of_exists_between [OrderTopology α] [Nontrivial α] {s : Set α}
448448
obtain ⟨x, xs, hx⟩ : ∃ x ∈ s, a < x ∧ x < b := h hab
449449
exact ⟨x, ⟨H hx, xs⟩⟩
450450

451+
theorem IsUpperSet.isClosed [OrderTopology α] [WellFoundedLT α] {s : Set α} (h : IsUpperSet s) :
452+
IsClosed s := by
453+
obtain rfl | ⟨a, rfl⟩ := h.eq_empty_or_Ici
454+
exacts [isClosed_empty, isClosed_Ici]
455+
456+
theorem IsLowerSet.isClosed [OrderTopology α] [WellFoundedGT α] {s : Set α} (h : IsLowerSet s) :
457+
IsClosed s :=
458+
h.toDual.isClosed
459+
460+
theorem IsLowerSet.isOpen [OrderTopology α] [WellFoundedLT α] {s : Set α} (h : IsLowerSet s) :
461+
IsOpen s := by
462+
simpa using h.compl.isClosed
463+
464+
theorem IsUpperSet.isOpen [OrderTopology α] [WellFoundedGT α] {s : Set α} (h : IsUpperSet s) :
465+
IsOpen s :=
466+
h.toDual.isOpen
467+
451468
/-- A set in a nontrivial densely linear ordered type is dense in the sense of topology if and only
452469
if for any `a < b` there exists `c ∈ s`, `a < c < b`. Each implication requires less typeclass
453470
assumptions. -/

0 commit comments

Comments
 (0)