Skip to content

Commit 7bfd7d1

Browse files
committed
feat: port Topology.OmegaCompletePartialOrder (#2034)
1 parent 616115e commit 7bfd7d1

File tree

2 files changed

+163
-0
lines changed

2 files changed

+163
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,7 @@ import Mathlib.Topology.LocalExtr
971971
import Mathlib.Topology.LocallyFinite
972972
import Mathlib.Topology.Maps
973973
import Mathlib.Topology.NhdsSet
974+
import Mathlib.Topology.OmegaCompletePartialOrder
974975
import Mathlib.Topology.Order
975976
import Mathlib.Topology.Separation
976977
import Mathlib.Topology.SubsetProperties
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/-
2+
Copyright (c) 2020 Simon Hudon. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Simon Hudon
5+
6+
! This file was ported from Lean 3 source module topology.omega_complete_partial_order
7+
! leanprover-community/mathlib commit 2705404e701abc6b3127da906f40bae062a169c9
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.Topology.Basic
12+
import Mathlib.Order.OmegaCompletePartialOrder
13+
14+
/-!
15+
# Scott Topological Spaces
16+
17+
A type of topological spaces whose notion
18+
of continuity is equivalent to continuity in ωCPOs.
19+
20+
## Reference
21+
22+
* https://ncatlab.org/nlab/show/Scott+topology
23+
24+
-/
25+
26+
27+
open Set OmegaCompletePartialOrder
28+
29+
open Classical
30+
31+
universe u
32+
33+
-- "Scott", "ωSup"
34+
set_option linter.uppercaseLean3 false
35+
36+
namespace Scott
37+
38+
/-- `x` is an `ω`-Sup of a chain `c` if it is the least upper bound of the range of `c`. -/
39+
def IsωSup {α : Type u} [Preorder α] (c : Chain α) (x : α) : Prop :=
40+
(∀ i, c i ≤ x) ∧ ∀ y, (∀ i, c i ≤ y) → x ≤ y
41+
#align Scott.is_ωSup Scott.IsωSup
42+
43+
theorem isωSup_iff_isLUB {α : Type u} [Preorder α] {c : Chain α} {x : α} :
44+
IsωSup c x ↔ IsLUB (range c) x := by
45+
simp [IsωSup, IsLUB, IsLeast, upperBounds, lowerBounds]
46+
#align Scott.is_ωSup_iff_is_lub Scott.isωSup_iff_isLUB
47+
48+
variable (α : Type u) [OmegaCompletePartialOrder α]
49+
50+
/-- The characteristic function of open sets is monotone and preserves
51+
the limits of chains. -/
52+
def IsOpen (s : Set α) : Prop :=
53+
Continuous' fun x ↦ x ∈ s
54+
#align Scott.is_open Scott.IsOpen
55+
56+
theorem isOpen_univ : IsOpen α univ :=
57+
fun _ _ _ _ ↦ mem_univ _, @CompleteLattice.top_continuous α Prop _ _⟩
58+
#align Scott.is_open_univ Scott.isOpen_univ
59+
60+
theorem IsOpen.inter (s t : Set α) : IsOpen α s → IsOpen α t → IsOpen α (s ∩ t) :=
61+
CompleteLattice.inf_continuous'
62+
#align Scott.is_open.inter Scott.IsOpen.inter
63+
64+
theorem isOpen_unionₛ (s : Set (Set α)) (hs : ∀ t ∈ s, IsOpen α t) : IsOpen α (⋃₀ s) := by
65+
simp only [IsOpen] at hs⊢
66+
convert CompleteLattice.supₛ_continuous' (setOf ⁻¹' s) hs
67+
ext1
68+
simp only [supₛ_apply, setOf_bijective.surjective.exists, exists_prop, mem_preimage,
69+
SetCoe.exists, supᵢ_Prop_eq, mem_setOf_eq, mem_unionₛ]
70+
#align Scott.is_open_sUnion Scott.isOpen_unionₛ
71+
72+
end Scott
73+
74+
/-- A Scott topological space is defined on preorders
75+
such that their open sets, seen as a function `α → Prop`,
76+
preserves the joins of ω-chains -/
77+
@[reducible]
78+
def Scott (α : Type u) := α
79+
#align Scott Scott
80+
81+
instance Scott.topologicalSpace (α : Type u) [OmegaCompletePartialOrder α] :
82+
TopologicalSpace (Scott α) where
83+
IsOpen := Scott.IsOpen α
84+
isOpen_univ := Scott.isOpen_univ α
85+
isOpen_inter := Scott.IsOpen.inter α
86+
isOpen_unionₛ := Scott.isOpen_unionₛ α
87+
#align Scott.topological_space Scott.topologicalSpace
88+
89+
section notBelow
90+
91+
variable {α : Type _} [OmegaCompletePartialOrder α] (y : Scott α)
92+
93+
/-- `notBelow` is an open set in `Scott α` used
94+
to prove the monotonicity of continuous functions -/
95+
def notBelow :=
96+
{ x | ¬x ≤ y }
97+
#align not_below notBelow
98+
99+
theorem notBelow_isOpen : IsOpen (notBelow y) := by
100+
have h : Monotone (notBelow y) := by
101+
intro x y' h
102+
simp only [notBelow, setOf, le_Prop_eq]
103+
intro h₀ h₁
104+
apply h₀ (le_trans h h₁)
105+
exists h
106+
rintro c
107+
apply eq_of_forall_ge_iff
108+
intro z
109+
rw [ωSup_le_iff]
110+
simp only [ωSup_le_iff, notBelow, mem_setOf_eq, le_Prop_eq, OrderHom.coe_fun_mk, Chain.map_coe,
111+
Function.comp_apply, exists_imp, not_forall]
112+
#align not_below_is_open notBelow_isOpen
113+
114+
end notBelow
115+
116+
open Scott hiding IsOpen
117+
118+
open OmegaCompletePartialOrder
119+
120+
theorem isωSup_ωSup {α} [OmegaCompletePartialOrder α] (c : Chain α) : IsωSup c (ωSup c) := by
121+
constructor
122+
· apply le_ωSup
123+
· apply ωSup_le
124+
#align is_ωSup_ωSup isωSup_ωSup
125+
126+
theorem scottContinuous_of_continuous {α β} [OmegaCompletePartialOrder α]
127+
[OmegaCompletePartialOrder β] (f : Scott α → Scott β) (hf : Continuous f) :
128+
OmegaCompletePartialOrder.Continuous' f := by
129+
simp only [continuous_def, (· ⁻¹' ·)] at hf
130+
have h : Monotone f := by
131+
intro x y h
132+
cases' hf { x | ¬x ≤ f y } (notBelow_isOpen _) with hf hf'
133+
clear hf'
134+
specialize hf h
135+
simp only [preimage, mem_setOf_eq, le_Prop_eq] at hf
136+
by_contra H
137+
apply hf H le_rfl
138+
exists h
139+
intro c
140+
apply eq_of_forall_ge_iff
141+
intro z
142+
specialize hf _ (notBelow_isOpen z)
143+
cases' hf with _ hf_h
144+
specialize hf_h c
145+
simp only [notBelow, eq_iff_iff, mem_setOf_eq] at hf_h
146+
rw [← not_iff_not]
147+
simp only [ωSup_le_iff, hf_h, ωSup, supᵢ, supₛ, mem_range, Chain.map_coe, Function.comp_apply,
148+
eq_iff_iff, not_forall]
149+
tauto
150+
#align Scott_continuous_of_continuous scottContinuous_of_continuous
151+
152+
theorem continuous_of_scottContinuous {α β} [OmegaCompletePartialOrder α]
153+
[OmegaCompletePartialOrder β] (f : Scott α → Scott β)
154+
(hf : OmegaCompletePartialOrder.Continuous' f) : Continuous f := by
155+
rw [continuous_def]
156+
intro s hs
157+
change Continuous' (s ∘ f)
158+
cases' hs with hs hs'
159+
cases' hf with hf hf'
160+
apply Continuous.of_bundled
161+
apply continuous_comp _ _ hf' hs'
162+
#align continuous_of_Scott_continuous continuous_of_scottContinuous

0 commit comments

Comments
 (0)