Skip to content

Commit f84b364

Browse files
UpperLowerSetTopology WithBot/Top
1 parent 163c192 commit f84b364

File tree

1 file changed

+255
-0
lines changed

1 file changed

+255
-0
lines changed

Mathlib/Topology/Order/UpperLowerSetTopology.lean

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ def WithUpperSet.toDualHomeomorph [Preorder α] : WithUpperSet α ≃ₜ WithLow
177177
continuous_toFun := continuous_coinduced_rng
178178
continuous_invFun := continuous_coinduced_rng
179179

180+
181+
/--
182+
The Lower Set topology is homeomorphic to the Upper Set topology on the dual order
183+
-/
184+
def WithLowerSet.toDualHomeomorph [Preorder α] : WithLowerSet α ≃ₜ WithUpperSet αᵒᵈ where
185+
toFun := OrderDual.toDual
186+
invFun := OrderDual.ofDual
187+
left_inv := OrderDual.toDual_ofDual
188+
right_inv := OrderDual.ofDual_toDual
189+
continuous_toFun := continuous_coinduced_rng
190+
continuous_invFun := continuous_coinduced_rng
191+
180192
/-- Prop-valued mixin for an ordered topological space to be
181193
The upper set topology is the topology where the open sets are the upper sets. In general the upper
182194
set topology does not coincide with the upper topology.
@@ -462,4 +474,247 @@ def map (f : α →o β) : C(WithLowerSet α, WithLowerSet β) where
462474
IsOpen (ofLowerSet ⁻¹' s) ↔ IsLowerSet s := isLowerSet_toLowerSet_preimage.symm
463475

464476
end WithLowerSet
477+
478+
namespace IsUpperSet
479+
variable [Preorder α] [TopologicalSpace α] [Topology.IsUpperSet α]
480+
[Preorder β] [TopologicalSpace β] [Topology.IsUpperSet β]
481+
482+
open scoped Filter
483+
484+
lemma specializes_bot [OrderBot α] {a : α} : a ⤳ ⊥ := by
485+
simp [IsUpperSet.specializes_iff_le]
486+
487+
lemma specializes_top [OrderTop α] {a : α} : ⊤ ⤳ a := by
488+
simp [IsUpperSet.specializes_iff_le]
489+
490+
@[simps]
491+
instance [OrderBot α] : OrderBot (WithUpperSet α) where
492+
bot := WithUpperSet.toUpperSet ⊥
493+
bot_le a := by cases a; simp [WithUpperSet.toUpperSet_le_iff]
494+
495+
@[simps]
496+
instance [OrderTop α] : OrderTop (WithUpperSet α) where
497+
top := WithUpperSet.toUpperSet ⊤
498+
le_top a := by cases a; simp [WithUpperSet.toUpperSet_le_iff]
499+
500+
lemma WithBot.continuous_coe :
501+
Continuous (Y := WithUpperSet <| WithBot α) (WithUpperSet.toUpperSet ∘ WithBot.some) := by
502+
rw [← IsUpperSet.monotone_iff_continuous]
503+
exact WithBot.coe_mono
504+
505+
lemma WithTop.continuous_coe :
506+
Continuous (Y := WithUpperSet <| WithTop α) (WithUpperSet.toUpperSet ∘ WithTop.some) := by
507+
rw [← IsUpperSet.monotone_iff_continuous]
508+
exact WithTop.coe_mono
509+
510+
lemma WithBot.isOpenEmbedding_coe :
511+
IsOpenEmbedding (Y := WithUpperSet <| WithBot α) (WithUpperSet.toUpperSet ∘ WithBot.some) :=
512+
have inj : (WithUpperSet.toUpperSet ∘ WithBot.some).Injective := Option.some_injective _
513+
{ eq_induced := by
514+
ext s
515+
simp_rw [isOpen_induced_iff]
516+
constructor
517+
· intro hs; use WithUpperSet.toUpperSet ∘ WithBot.some '' s; split_ands
518+
· rw [IsUpperSet.isOpen_iff_isUpperSet, IsUpperSet]
519+
intro a b; cases a with | _ a => cases b with | _ b =>
520+
cases a using WithBot.recBotCoe <;> cases b using WithBot.recBotCoe
521+
rotate_right
522+
· simp_rw [WithUpperSet.toUpperSet_le_iff, WithBot.coe_le_coe,
523+
← IsUpperSet.specializes_iff_le]; intro h
524+
simp_rw [← Function.comp_apply (f := WithUpperSet.toUpperSet), inj.mem_set_image]
525+
exact h.mem_open hs
526+
all_goals simp [WithBot.some, WithUpperSet, WithUpperSet.toUpperSet, WithBot.le_bot_iff]
527+
· rw [inj.preimage_image]
528+
· rintro ⟨t, tO, rfl⟩
529+
exact tO.preimage WithBot.continuous_coe
530+
injective := inj
531+
isOpen_range := by
532+
rw [← isClosed_compl_iff]
533+
convert_to IsClosed {(⊥ : WithUpperSet (WithBot α))}
534+
· ext x
535+
cases x using WithBot.recBotCoe <;> simp [WithUpperSet, WithUpperSet.toUpperSet]
536+
· rw [IsUpperSet.isClosed_iff_isLower, IsLowerSet]
537+
rintro a b h ⟨⟩; simpa [WithUpperSet, WithBot.le_bot_iff] using h }
538+
539+
lemma nhds_bot [OrderBot α] : 𝓝 (⊥ : α) = ⊤ := by
540+
rw [eq_top_iff, le_nhds_iff]
541+
intro s hs sO
542+
rw [Filter.mem_top, eq_univ_iff_forall]
543+
intro x; exact specializes_bot.mem_open sO hs
544+
545+
omit [TopologicalSpace α] in
546+
lemma WithBot.isClosed_singleton_bot : IsClosed {(⊥ : WithUpperSet <| WithBot α)} := by
547+
rw [IsUpperSet.isClosed_iff_isLower, IsLowerSet]
548+
rintro x y h ⟨⟩; cases y
549+
simp [WithUpperSet.toUpperSet_le_iff, WithBot.le_bot_iff] at h; simp [h]
550+
551+
omit [TopologicalSpace α] in
552+
@[simp]
553+
lemma WithBot.le_bot_iff {a : WithUpperSet (WithBot α)} :
554+
a ≤ WithUpperSet.toUpperSet (⊥ : WithBot α) ↔ a = WithUpperSet.toUpperSet (⊥ : WithBot α) :=
555+
_root_.WithBot.le_bot_iff
556+
557+
def WithBot.lift {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)] (Uo : IsOpen U)
558+
(f : C(U, α)) : C(X, WithUpperSet (WithBot α)) where
559+
toFun x := if h : x ∈ U then (WithUpperSet.toUpperSet ∘ WithBot.some) (f ⟨x, h⟩) else
560+
continuous_toFun := by
561+
constructor; intro s hs
562+
by_cases hb : ⊥ ∈ s
563+
· have : s = univ := by
564+
rw [eq_univ_iff_forall]; intro x; exact IsUpperSet.specializes_bot.mem_open hs hb
565+
simp [this]
566+
· simp only [preimage_dif, hb, exists_false, setOf_false, union_empty]
567+
rw [Uo.isOpenEmbedding_subtypeVal.isOpen_iff_preimage_isOpen, preimage_setOf_eq]
568+
· simpa [← mem_preimage, setOf_mem_eq] using
569+
hs.preimage WithBot.continuous_coe |>.preimage <| map_continuous f
570+
· intro x; simp +contextual
571+
572+
@[simp]
573+
lemma WithBot.lift_coe {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)] (Uo : IsOpen U)
574+
(f : C(U, α)) (x : U) :
575+
WithBot.lift Uo f (x : X) = (WithUpperSet.toUpperSet ∘ WithBot.some) (f x) := by
576+
simp [WithBot.lift]
577+
578+
@[simp]
579+
lemma WithBot.lift_of_mem {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
580+
(Uo : IsOpen U) (f : C(U, α)) {x : X} (hx : x ∈ U) :
581+
WithBot.lift Uo f x = (WithUpperSet.toUpperSet ∘ WithBot.some) (f ⟨x, hx⟩) := by
582+
simp [WithBot.lift, hx]
583+
584+
@[simp]
585+
lemma WithBot.lift_of_notMem {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
586+
(Uo : IsOpen U) (f : C(U, α)) {x : X} (hx : x ∉ U) : WithBot.lift Uo f x = ⊥ := by
587+
simp [WithBot.lift, hx]
588+
589+
@[simp]
590+
lemma WithBot.lift_restrict {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
591+
(Uo : IsOpen U) (f : C(U, α)) :
592+
(WithBot.lift Uo f).restrict U =
593+
.comp ⟨WithUpperSet.toUpperSet ∘ WithBot.some, continuous_coe⟩ f := by
594+
ext x; simp [WithBot.lift]
595+
596+
@[simp]
597+
lemma WithBot.lift_restrict_compl {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
598+
(Uo : IsOpen U) (f : C(U, α)) :
599+
(WithBot.lift Uo f).restrict Uᶜ = .const _ ⊥ := by
600+
ext x; simpa [WithBot.lift, -Subtype.coe_prop] using x.2
601+
602+
end IsUpperSet
603+
604+
namespace IsLowerSet
605+
606+
variable [Preorder α] [TopologicalSpace α] [Topology.IsLowerSet α]
607+
[Preorder β] [TopologicalSpace β] [Topology.IsLowerSet β]
608+
609+
lemma specializes_bot [OrderBot α] {a : α} : ⊥ ⤳ a := by
610+
simp [IsLowerSet.specializes_iff_le]
611+
612+
lemma specializes_top [OrderTop α] {a : α} : a ⤳ ⊤ := by
613+
simp [IsLowerSet.specializes_iff_le]
614+
615+
@[simps]
616+
instance [OrderBot α] : OrderBot (WithLowerSet α) where
617+
bot := WithLowerSet.toLowerSet ⊥
618+
bot_le a := by cases a; simp [WithLowerSet.toLowerSet_le_iff]
619+
620+
@[simps]
621+
instance [OrderTop α] : OrderTop (WithLowerSet α) where
622+
top := WithLowerSet.toLowerSet ⊤
623+
le_top a := by cases a; simp [WithLowerSet.toLowerSet_le_iff]
624+
625+
lemma WithTop.continuous_coe :
626+
Continuous (Y := WithLowerSet <| WithTop α) (WithLowerSet.toLowerSet ∘ WithTop.some) := by
627+
rw [← IsLowerSet.monotone_iff_continuous]
628+
exact WithTop.coe_mono
629+
630+
lemma WithBot.continuous_coe :
631+
Continuous (Y := WithLowerSet <| WithBot α) (WithLowerSet.toLowerSet ∘ WithBot.some) := by
632+
rw [← IsLowerSet.monotone_iff_continuous]
633+
exact WithBot.coe_mono
634+
635+
open OrderDual in
636+
lemma isOpenEmbedding_iff_orderDual {f : α → β} :
637+
IsOpenEmbedding f ↔ IsOpenEmbedding (toDual ∘ f ∘ ofDual) := by
638+
let η₁ : α ≃ₜ αᵒᵈ :=
639+
IsLowerSet.WithLowerSetHomeomorph.symm.trans <|
640+
WithLowerSet.toDualHomeomorph.trans IsUpperSet.WithUpperSetHomeomorph
641+
let η₂ : β ≃ₜ βᵒᵈ :=
642+
IsLowerSet.WithLowerSetHomeomorph.symm.trans <|
643+
WithLowerSet.toDualHomeomorph.trans IsUpperSet.WithUpperSetHomeomorph
644+
have h_of : IsOpenEmbedding (@ofDual α) := η₁.symm.isOpenEmbedding
645+
have h_to : IsOpenEmbedding (@toDual β) := η₂.isOpenEmbedding
646+
refine (fun (mp : {f : _} → IsOpenEmbedding f → IsOpenEmbedding (⇑toDual ∘ f ∘ ⇑ofDual)) ↦
647+
⟨mp, ?mpr⟩) ?mp
648+
case mp => intro f h; exact h_to.comp (h.comp h_of)
649+
case mpr => intro h; simpa using mp h
650+
651+
lemma WithTop.isOpenEmbedding_coe :
652+
IsOpenEmbedding (Y := WithLowerSet <| WithTop α) (WithLowerSet.toLowerSet ∘ WithTop.some) := by
653+
rw [isOpenEmbedding_iff_orderDual]
654+
exact IsUpperSet.WithBot.isOpenEmbedding_coe
655+
656+
lemma nhds_top [OrderTop α] : 𝓝 (⊤ : α) = ⊤ := by
657+
rw [eq_top_iff, le_nhds_iff]
658+
intro s hs sO
659+
rw [Filter.mem_top, eq_univ_iff_forall]
660+
intro x; exact specializes_top.mem_open sO hs
661+
662+
omit [TopologicalSpace α] in
663+
lemma WithTop.isClosed_singleton_top : IsClosed {(⊤ : WithLowerSet <| WithTop α)} := by
664+
rw [IsLowerSet.isClosed_iff_isUpper, IsUpperSet]
665+
rintro x y h ⟨⟩; cases y
666+
simp [WithLowerSet.toLowerSet_le_iff] at h; simp [h]
667+
668+
omit [TopologicalSpace α] in
669+
@[simp]
670+
lemma WithTop.top_le_iff {a : WithLowerSet (WithTop α)} :
671+
WithLowerSet.toLowerSet (⊤ : WithTop α) ≤ a ↔ a = WithLowerSet.toLowerSet (⊤ : WithTop α) :=
672+
_root_.WithTop.top_le_iff
673+
674+
def WithTop.lift {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)] (Uo : IsOpen U)
675+
(f : C(U, α)) : C(X, WithLowerSet (WithTop α)) where
676+
toFun x := if h : x ∈ U then (WithLowerSet.toLowerSet ∘ WithTop.some) (f ⟨x, h⟩) else
677+
continuous_toFun := by
678+
constructor; intro s hs
679+
by_cases hb : ⊤ ∈ s
680+
· have : s = univ := by
681+
rw [eq_univ_iff_forall]; intro x; exact IsLowerSet.specializes_top.mem_open hs hb
682+
simp [this]
683+
· simp only [preimage_dif, hb, exists_false, setOf_false, union_empty]
684+
rw [Uo.isOpenEmbedding_subtypeVal.isOpen_iff_preimage_isOpen, preimage_setOf_eq]
685+
· simpa [← mem_preimage, setOf_mem_eq] using
686+
hs.preimage WithTop.continuous_coe |>.preimage <| map_continuous f
687+
· intro x; simp +contextual
688+
689+
@[simp]
690+
lemma WithTop.lift_coe {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)] (Uo : IsOpen U)
691+
(f : C(U, α)) (x : U) :
692+
WithTop.lift Uo f (x : X) = (WithLowerSet.toLowerSet ∘ WithTop.some) (f x) := by
693+
simp [WithTop.lift]
694+
695+
@[simp]
696+
lemma WithTop.lift_of_mem {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
697+
(Uo : IsOpen U) (f : C(U, α)) {x : X} (hx : x ∈ U) :
698+
WithTop.lift Uo f x = (WithLowerSet.toLowerSet ∘ WithTop.some) (f ⟨x, hx⟩) := by
699+
simp [WithTop.lift, hx]
700+
701+
@[simp]
702+
lemma WithTop.lift_of_notMem {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
703+
(Uo : IsOpen U) (f : C(U, α)) {x : X} (hx : x ∉ U) : WithTop.lift Uo f x = ⊥ := by
704+
simp [WithTop.lift, hx]
705+
706+
@[simp]
707+
lemma WithTop.lift_restrict {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
708+
(Uo : IsOpen U) (f : C(U, α)) :
709+
(WithTop.lift Uo f).restrict U =
710+
.comp ⟨WithLowerSet.toLowerSet ∘ WithTop.some, continuous_coe⟩ f := by
711+
ext x; simp [WithTop.lift]
712+
713+
@[simp]
714+
lemma WithTop.lift_restrict_compl {X} [TopologicalSpace X] {U : Set X} [DecidablePred (· ∈ U)]
715+
(Uo : IsOpen U) (f : C(U, α)) :
716+
(WithTop.lift Uo f).restrict Uᶜ = .const _ ⊥ := by
717+
ext x; simpa [WithTop.lift, -Subtype.coe_prop] using x.2
718+
719+
end IsLowerSet
465720
end Topology

0 commit comments

Comments
 (0)