Skip to content

Commit a7355ba

Browse files
committed
proof done
1 parent 8142340 commit a7355ba

File tree

1 file changed

+60
-26
lines changed

1 file changed

+60
-26
lines changed

src/Relation/Binary/Domain/Definitions.agda

Lines changed: 60 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Defintions for domain theory
5+
------------------------------------------------------------------------
6+
17
module Relation.Binary.Domain.Definitions where
28

39
open import Relation.Binary.Bundles using (Poset)
@@ -6,8 +12,9 @@ open import Level using (Level; _⊔_; suc; Lift; lift; lower)
612
open import Function using (_∘_; id)
713
open import Data.Product using (∃-syntax; _×_; _,_; proj₁; proj₂)
814
open import Relation.Unary using (Pred)
9-
open import Relation.Binary.PropositionalEquality using (_≡_)
15+
open import Relation.Binary.PropositionalEquality using (_≡_; subst; cong)
1016
open import Relation.Binary.Reasoning.PartialOrder
17+
open import Relation.Binary.Structures
1118
open import Data.Bool using (Bool; true; false; if_then_else_)
1219
open import Relation.Binary.Morphism.Structures
1320
open import Relation.Binary.Morphism.Structures using (IsOrderHomomorphism)
@@ -61,7 +68,6 @@ module _ {c ℓ₁ ℓ₂ : Level} (P : Poset c ℓ₁ ℓ₂) where
6168
renaming (is-upperbound to ⋁-≤; is-least to ⋁-least)
6269
public
6370

64-
6571
record DCPO (c ℓ₁ ℓ₂ : Level) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
6672
field
6773
poset : Poset c ℓ₁ ℓ₂
@@ -70,6 +76,27 @@ record DCPO (c ℓ₁ ℓ₂ : Level) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) wher
7076
open Poset poset public
7177
open IsDCPO DcpoStr public
7278

79+
module _ {c ℓ₁ ℓ₂} (D : DCPO c ℓ₁ ℓ₂) where
80+
private
81+
module D = DCPO D
82+
83+
uniqueLub : {Ix} {s : Ix D.Carrier}
84+
(x y : D.Carrier) IsLub D.poset s x IsLub D.poset s y
85+
x D.≈ y
86+
uniqueLub x y x-lub y-lub = D.antisym
87+
(IsLub.is-least x-lub y (IsLub.is-upperbound y-lub))
88+
(IsLub.is-least y-lub x (IsLub.is-upperbound x-lub))
89+
90+
is-lub-cong : {Ix} {s : Ix D.Carrier}
91+
(x y : D.Carrier)
92+
x D.≈ y
93+
IsLub D.poset s x IsLub D.poset s y
94+
is-lub-cong x y x≈y x-lub = record
95+
{ is-upperbound = λ i D.trans (IsLub.is-upperbound x-lub i) (D.reflexive x≈y)
96+
; is-least = λ z ub D.trans (D.reflexive (D.Eq.sym x≈y)) (IsLub.is-least x-lub z (λ i D.trans (ub i) (D.reflexive D.Eq.refl)))
97+
}
98+
99+
73100
module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ₁ ℓ₂} where
74101

75102
private
@@ -79,7 +106,7 @@ module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ
79106
record IsScottContinuous (f : P.Carrier Q.Carrier) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
80107
field
81108
PreserveLub : {Ix : Set c} {s : Ix P.Carrier}
82-
(dir-s : IsDirectedFamily P s)
109+
(dir : IsDirectedFamily P s)
83110
(lub : P.Carrier)
84111
IsLub P s lub
85112
IsLub Q (f ∘ s) (f lub)
@@ -136,19 +163,19 @@ module _ where
136163

137164
ScottId : {c ℓ₁ ℓ₂} {P : Poset c ℓ₁ ℓ₂} IsScottContinuous {P = P} {Q = P} id
138165
ScottId = record
139-
{ PreserveLub = λ dir-s lub z z
166+
{ PreserveLub = λ dir lub z z
140167
; PreserveEquality = λ z z }
141168

142169
scott-∘ : {c ℓ₁ ℓ₂} {P Q R : Poset c ℓ₁ ℓ₂}
143170
(f : Poset.Carrier R Poset.Carrier Q) (g : Poset.Carrier P Poset.Carrier R)
144171
IsScottContinuous {P = R} {Q = Q} f IsScottContinuous {P = P} {Q = R} g
145172
IsMonotone R Q f IsMonotone P R g
146173
IsScottContinuous {P = P} {Q = Q} (f ∘ g)
147-
scott-∘ f g scottf scottg monotonef monotoneg = record
148-
{ PreserveLub = λ dir-s lub z f.PreserveLub
149-
(monotone∘directed g monotoneg dir-s)
174+
scott-∘ f g scottf scottg monof monog = record
175+
{ PreserveLub = λ dir lub z f.PreserveLub
176+
(monotone∘directed g monog dir)
150177
(g lub)
151-
(g.PreserveLub dir-s lub z)
178+
(g.PreserveLub dir lub z)
152179
; PreserveEquality = λ {x} {y} z
153180
f.PreserveEquality (g.PreserveEquality z)
154181
}
@@ -174,22 +201,29 @@ module Scott
174201
(let module D = DCPO D)
175202
(let module E = DCPO E)
176203
(f : D.Carrier E.Carrier)
204+
(isScott : IsScottContinuous {P = D.poset} {Q = E.poset} f)
177205
(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
187206

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 = {! !}
207+
open DCPO D
208+
open DCPO E
192209

210+
pres-⋁
211+
: {Ix} (s : Ix D.Carrier) (dir : IsDirectedFamily D.poset s)
212+
f (D.⋁ s dir) E.≈ E.⋁ (f ∘ s) (monotone∘directed f mono dir)
213+
pres-⋁ s dir = E.antisym
214+
(IsLub.is-least
215+
(IsScottContinuous.PreserveLub isScott dir (D.⋁ s dir) (D.⋁-isLub s dir))
216+
(E.⋁ (f ∘ s) (monotone∘directed f mono dir))
217+
E.⋁-≤
218+
)
219+
(IsLub.is-least
220+
(E.⋁-isLub (f ∘ s) (monotone∘directed f mono dir))
221+
(f (D.⋁ s dir))
222+
(λ i IsOrderHomomorphism.mono mono (D.⋁-≤ i))
223+
)
224+
225+
226+
193227
module _ {c ℓ₁ ℓ₂} (D E : DCPO c ℓ₁ ℓ₂) where
194228
private
195229
module D = DCPO D
@@ -198,8 +232,8 @@ module _ {c ℓ₁ ℓ₂} (D E : DCPO c ℓ₁ ℓ₂) where
198232
to-scott : (f : D.Carrier E.Carrier) IsMonotone D.poset E.poset f
199233
( {Ix} (s : Ix D.Carrier) (dir : IsDirectedFamily D.poset s)
200234
IsLub E.poset (f ∘ s) (f (D.⋁ s dir))) IsScottContinuous {P = D.poset} {Q = E.poset} f
201-
to-scott f monotone pres- = {! !}
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 = ?
235+
to-scott f mono pres- = record
236+
{ PreserveLub = λ dir lub x is-lub-cong E (f (D.⋁ _ dir)) (f lub)
237+
(IsOrderHomomorphism.cong mono (uniqueLub D (D.⋁ _ dir) lub (D.⋁-isLub _ dir) x))
238+
(pres-⋁ _ dir)
239+
; PreserveEquality = IsOrderHomomorphism.cong mono }

0 commit comments

Comments
 (0)