@@ -33,17 +33,43 @@ module _ {c ℓ₁ ℓ₂ : Level} (P : Poset c ℓ₁ ℓ₂) where
33
33
elt : Ix
34
34
SemiDirected : IsSemidirectedFamily s
35
35
36
+ record IsLub {Ix : Set c} (s : Ix → Carrier) (lub : Carrier) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
37
+ field
38
+ is-upperbound : ∀ i → s i ≤ lub
39
+ is-least : ∀ y → (∀ i → s i ≤ y) → lub ≤ y
40
+
41
+ record Lub {Ix : Set c} (s : Ix → Carrier) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
42
+ constructor mkLub
43
+ field
44
+ lub : Carrier
45
+ is-upperbound : ∀ i → s i ≤ lub
46
+ is-least : ∀ y → (∀ i → s i ≤ y) → lub ≤ y
47
+
36
48
record IsDCPO : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
37
49
field
38
- HasDirectedLub : ∀ {Ix : Set c} {s : Ix → Carrier}
50
+ ⋁ : ∀ {Ix : Set c}
51
+ → (s : Ix → Carrier)
39
52
→ IsDirectedFamily s
40
- → ∃[ lub ] ((∀ i → s i ≤ lub) × ∀ y → (∀ i → s i ≤ y) → lub ≤ y)
53
+ → Carrier
54
+ ⋁-isLub : ∀ {Ix : Set c}
55
+ → (s : Ix → Carrier)
56
+ → (dir : IsDirectedFamily s)
57
+ → IsLub s (⋁ s dir)
58
+
59
+ module _ {Ix : Set c} {s : Ix → Carrier} {dir : IsDirectedFamily s} where
60
+ open IsLub (⋁-isLub s dir)
61
+ renaming (is-upperbound to ⋁-≤; is-least to ⋁-least)
62
+ public
63
+
41
64
42
65
record DCPO (c ℓ₁ ℓ₂ : Level) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
43
66
field
44
67
poset : Poset c ℓ₁ ℓ₂
45
68
DcpoStr : IsDCPO poset
46
69
70
+ open Poset poset public
71
+ open IsDCPO DcpoStr public
72
+
47
73
module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ₁ ℓ₂} where
48
74
49
75
private
@@ -54,8 +80,9 @@ module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ
54
80
field
55
81
PreserveLub : ∀ {Ix : Set c} {s : Ix → P.Carrier}
56
82
→ (dir-s : IsDirectedFamily P s)
57
- → ∀ lub → ((∀ i → s i P.≤ lub) × ∀ y → (∀ i → s i P.≤ y) → lub P.≤ y)
58
- → ((∀ i → f (s i) Q.≤ f lub) × ∀ y → (∀ i → f (s i) Q.≤ y) → f lub Q.≤ y)
83
+ → (lub : P.Carrier)
84
+ → IsLub P s lub
85
+ → IsLub Q (f ∘ s) (f lub)
59
86
PreserveEquality : ∀ {x y} → x P.≈ y → f x Q.≈ f y
60
87
61
88
dcpo+scott→monotone : (P-dcpo : IsDCPO P)
@@ -68,7 +95,7 @@ module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ
68
95
}
69
96
where
70
97
mono-proof : ∀ x y → x P.≤ y → f x Q.≤ f y
71
- mono-proof x y x≤y = proj₁ fs-lub (lift true)
98
+ mono-proof x y x≤y = IsLub.is-upperbound fs-lub (lift true)
72
99
where
73
100
s : Lift c Bool → P.Carrier
74
101
s (lift b) = if b then x else y
@@ -82,12 +109,16 @@ module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ
82
109
{ elt = lift true
83
110
; SemiDirected = λ i j → (lift false , sx≤sfalse i , sx≤sfalse j)
84
111
}
112
+
113
+ s-lub : IsLub P s y
114
+ s-lub = record
115
+ { is-upperbound = sx≤sfalse
116
+ ; is-least = λ z proof → proof (lift false)
117
+ }
118
+
119
+ fs-lub : IsLub Q (f ∘ s) (f y)
120
+ fs-lub = IsScottContinuous.PreserveLub scott s-directed y s-lub
85
121
86
- s-lub : P.Carrier × ((∀ i → s i P.≤ y) × (∀ z → (∀ i → s i P.≤ z) → y P.≤ z))
87
- s-lub = y , (sx≤sfalse , λ z lt → lt (lift false))
88
-
89
- fs-lub = IsScottContinuous.PreserveLub scott
90
- s-directed y (sx≤sfalse , λ z lt → lt (lift false))
91
122
92
123
monotone∘directed : ∀ {Ix : Set c} {s : Ix → P.Carrier}
93
124
→ (f : P.Carrier → Q.Carrier)
@@ -114,51 +145,61 @@ module _ where
114
145
→ IsMonotone R Q f → IsMonotone P R g
115
146
→ IsScottContinuous {P = P} {Q = Q} (f ∘ g)
116
147
scott-∘ f g scottf scottg monotonef monotoneg = record
117
- { PreserveLub = λ dir-s lub z → IsScottContinuous.PreserveLub scottf
118
- (monotone∘directed g monotoneg dir-s)
119
- (g lub) ( IsScottContinuous.PreserveLub scottg dir-s lub z)
120
- ; PreserveEquality = λ {x} {y} z → IsScottContinuous.PreserveEquality scottf
121
- (IsScottContinuous.PreserveEquality scottg z)
148
+ { PreserveLub = λ dir-s lub z → f.PreserveLub
149
+ (monotone∘directed g monotoneg dir-s)
150
+ (g lub)
151
+ (g.PreserveLub dir-s lub z)
152
+ ; PreserveEquality = λ {x} {y} z →
153
+ f.PreserveEquality (g.PreserveEquality z)
122
154
}
155
+ where
156
+ module f = IsScottContinuous scottf
157
+ module g = IsScottContinuous scottg
123
158
124
- -- Module for the DCPO record
125
- module _ {c ℓ₁ ℓ₂} (D : DCPO c ℓ₁ ℓ₂) where
126
- open DCPO D public
159
+ module _ {c ℓ₁ ℓ₂} (D : DCPO c ℓ₁ ℓ₂) (let module D = DCPO D) where
160
+ open DCPO D
127
161
128
- posetD : Poset c ℓ₁ ℓ₂
129
- posetD = poset
130
-
131
- open Poset posetD
132
- open import Relation.Binary.Reasoning.PartialOrder posetD public
133
-
134
- dcpoD : IsDCPO posetD
135
- dcpoD = DcpoStr
136
-
137
- ⋃ : ∀ {Ix : Set c} (s : Ix → Carrier) → (dir : IsDirectedFamily posetD s) → Carrier
138
- ⋃ s dir = proj₁ (IsDCPO.HasDirectedLub dcpoD dir)
139
-
140
- module ⋃ {Ix : Set c} (s : Ix → Carrier) (dir : IsDirectedFamily posetD s) where
141
- fam≤lub : ∀ ix → s ix ≤ ⋃ s dir
142
- fam≤lub ix = proj₁ (proj₂ (IsDCPO.HasDirectedLub dcpoD dir)) ix
143
-
144
- least : ∀ ub → (∀ ix → s ix ≤ ub) → ⋃ s dir ≤ ub
145
- least ub p = proj₂ (proj₂ (IsDCPO.HasDirectedLub dcpoD dir)) ub p
162
+ open import Relation.Binary.Reasoning.PartialOrder poset public
146
163
147
164
⋃-pointwise : ∀ {Ix} {s s' : Ix → Carrier}
148
- → {fam : IsDirectedFamily posetD s} {fam' : IsDirectedFamily posetD s'}
165
+ → {fam : IsDirectedFamily poset s} {fam' : IsDirectedFamily poset s'}
149
166
→ (∀ ix → s ix ≤ s' ix)
150
- → ⋃ s fam ≤ ⋃ s' fam'
151
- ⋃-pointwise {s = s} {s'} {fam} {fam'} p = ⋃.least s fam (⋃ s' fam') λ ix →
152
- trans (p ix) (⋃.fam≤lub s' fam' ix)
153
-
154
- module Scott {c} {ℓ₁} {ℓ₂} {D E : DCPO c ℓ₁ ℓ₂}
155
- (f : Poset.Carrier (DCPO.poset D) → Poset.Carrier (DCPO.poset E))
156
- (mono : IsMonotone (DCPO.poset D) (DCPO.poset E) f) where``
167
+ → ⋁ s fam ≤ ⋁ s' fam'
168
+ ⋃-pointwise {s = s} {s'} {fam} {fam'} p =
169
+ ⋁-least (⋁ s' fam') λ i → trans (p i) (⋁-≤ i)
170
+
171
+ module Scott
172
+ {c ℓ₁ ℓ₂}
173
+ {D E : DCPO c ℓ₁ ℓ₂}
174
+ (let module D = DCPO D)
175
+ (let module E = DCPO E)
176
+ (f : D.Carrier → E.Carrier)
177
+ (mono : IsMonotone D.poset E.poset f) where
178
+
179
+ res-directed-lub : ∀ {Ix} (s : Ix → D.Carrier)
180
+ → IsDirectedFamily D.poset s
181
+ → ∀ x → IsLub D.poset s x
182
+ → IsLub E.poset (f ∘ s) (f x)
183
+ res-directed-lub s dir x lub = {! !}
184
+
185
+ directed : ∀ {Ix} {s : Ix → D.Carrier} → IsDirectedFamily D.poset s → IsDirectedFamily E.poset (f ∘ s)
186
+ directed = monotone∘directed f mono
187
+
188
+ pres-⋃
189
+ : ∀ {Ix} (s : Ix → D.Carrier) → (dir : IsDirectedFamily D.poset s)
190
+ → f (D.⋁ s dir) ≡ E.⋁ (f ∘ s) (monotone∘directed f mono dir)
191
+ pres-⋃ s dir = {! !}
157
192
193
+ module _ {c ℓ₁ ℓ₂} (D E : DCPO c ℓ₁ ℓ₂) where
158
194
private
159
195
module D = DCPO D
160
196
module E = DCPO E
161
197
162
- pres-directed-lub : ∀ {Ix} (s : Ix → Carrier) → is-directed-family D.poset s
163
- → ∀ x → is-lub (D .fst) s x → is-lub (E .fst) (apply f ⊙ s) (f · x)
198
+ to-scott : (f : D.Carrier → E.Carrier) → IsMonotone D.poset E.poset f
199
+ → (∀ {Ix} (s : Ix → D.Carrier) (dir : IsDirectedFamily D.poset s) →
200
+ IsLub E.poset (f ∘ s) (f (D.⋁ s dir))) → IsScottContinuous {P = D.poset} {Q = E.poset} f
201
+ to-scott f monotone pres-⋃ = {! !}
164
202
203
+ -- res-lub : ∀ {Ix} (s : Ix → D.Carrier) → (dir : is-directed-family D.poset s)
204
+ -- → ∀ x → is-lub D.poset s x → is-lub E.poset (f ⊙ s) (f x)
205
+ -- pres-lub s dir x x-lub .is-lub.fam≤lub i = ?
0 commit comments