Skip to content

Commit 4486fd0

Browse files
committed
Definitons of domain theory
1 parent 4871f37 commit 4486fd0

File tree

5 files changed

+167
-0
lines changed

5 files changed

+167
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ New modules
123123

124124
* `Data.Sign.Show` to show a sign
125125

126+
* Added a new domain theory section to the library under `Relation.Binary.Domain.*`:
127+
- Introduced new modules and bundles for domain theory, including `DCPO`, `Lub`, and `ScottContinuous`.
128+
- All files for domain theory are now available in `src/Relation/Binary/Domain/`.
129+
126130
Additions to existing modules
127131
-----------------------------
128132

src/Relation/Binary/Domain.agda

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Order-theoretic Domains
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --cubical-compatible --safe #-}
8+
9+
module Relation.Binary.Domain where
10+
11+
------------------------------------------------------------------------
12+
-- Re-export various components of the Domain hierarchy
13+
14+
open import Relation.Binary.Domain.Definitions public
15+
open import Relation.Binary.Domain.Structures public
16+
open import Relation.Binary.Domain.Bundles public
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Bundles for domain theory
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --cubical-compatible --safe #-}
8+
9+
module Relation.Binary.Domain.Bundles where
10+
11+
open import Level using (Level; _⊔_; suc)
12+
open import Relation.Binary.Bundles using (Poset)
13+
open import Relation.Binary.Domain.Structures
14+
open import Relation.Binary.Domain.Definitions
15+
16+
private
17+
variable
18+
o ℓ e o' ℓ' e' ℓ₂ : Level
19+
Ix A B : Set o
20+
21+
------------------------------------------------------------------------
22+
-- DCPOs
23+
------------------------------------------------------------------------
24+
25+
record DCPO (c ℓ₁ ℓ₂ : Level) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
26+
field
27+
poset : Poset c ℓ₁ ℓ₂
28+
DcpoStr : IsDCPO poset
29+
30+
open Poset poset public
31+
open IsDCPO DcpoStr public
32+
33+
------------------------------------------------------------------------
34+
-- Scott-continuous functions
35+
------------------------------------------------------------------------
36+
37+
record ScottContinuous {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ₁ ℓ₂} :
38+
Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
39+
field
40+
f : Poset.Carrier P Poset.Carrier Q
41+
Scottfunction : IsScottContinuous {P = P} {Q = Q} f
42+
43+
------------------------------------------------------------------------
44+
-- Lubs
45+
------------------------------------------------------------------------
46+
47+
record Lub {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Ix : Set c} (s : Ix Poset.Carrier P) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
48+
private
49+
module P = Poset P
50+
field
51+
lub : P.Carrier
52+
is-upperbound : i P._≤_ (s i) lub
53+
is-least : y ( i P._≤_ (s i) y) P._≤_ lub y
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Definitions for domain theory
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --cubical-compatible --safe #-}
8+
9+
module Relation.Binary.Domain.Definitions where
10+
11+
open import Data.Product using (∃-syntax; _×_; _,_)
12+
open import Level using (Level; _⊔_)
13+
open import Relation.Binary.Bundles using (Poset)
14+
open import Relation.Binary.Morphism.Structures using (IsOrderHomomorphism)
15+
16+
private
17+
variable
18+
c o ℓ e o' ℓ' e' ℓ₁ ℓ₂ : Level
19+
Ix A B : Set o
20+
P : Poset c ℓ e
21+
22+
------------------------------------------------------------------------
23+
-- Directed families
24+
------------------------------------------------------------------------
25+
26+
IsSemidirectedFamily : (P : Poset c ℓ₁ ℓ₂) {Ix : Set c} (s : Ix Poset.Carrier P) Set _
27+
IsSemidirectedFamily P {Ix} s = i j ∃[ k ] (Poset._≤_ P (s i) (s k) × Poset._≤_ P (s j) (s k))
28+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Structures for domain theory
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --cubical-compatible --safe #-}
8+
9+
module Relation.Binary.Domain.Structures where
10+
11+
open import Data.Product using (_×_; _,_)
12+
open import Data.Nat.Properties using (≤-trans)
13+
open import Function using (_∘_)
14+
open import Level using (Level; _⊔_; suc)
15+
open import Relation.Binary.Bundles using (Poset)
16+
open import Relation.Binary.Domain.Definitions
17+
open import Relation.Binary.Morphism.Structures using (IsOrderHomomorphism)
18+
19+
private variable
20+
o ℓ e o' ℓ' e' ℓ₂ : Level
21+
Ix A B : Set o
22+
23+
module _ {c ℓ₁ ℓ₂ : Level} (P : Poset c ℓ₁ ℓ₂) where
24+
open Poset P
25+
26+
record IsDirectedFamily {Ix : Set c} (s : Ix Carrier) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
27+
no-eta-equality
28+
field
29+
elt : Ix
30+
SemiDirected : IsSemidirectedFamily P s
31+
32+
record IsLub {Ix : Set c} (s : Ix Carrier) (lub : Carrier) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
33+
field
34+
is-upperbound : i s i ≤ lub
35+
is-least : y ( i s i ≤ y) lub ≤ y
36+
37+
record IsDCPO : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
38+
field
39+
: {Ix : Set c}
40+
(s : Ix Carrier)
41+
IsDirectedFamily s
42+
Carrier
43+
⋁-isLub : {Ix : Set c}
44+
(s : Ix Carrier)
45+
(dir : IsDirectedFamily s)
46+
IsLub s (⋁ s dir)
47+
48+
module _ {Ix : Set c} {s : Ix Carrier} {dir : IsDirectedFamily s} where
49+
open IsLub (⋁-isLub s dir)
50+
renaming (is-upperbound to ⋁-≤; is-least to ⋁-least)
51+
public
52+
53+
module _ {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {Q : Poset c ℓ₁ ℓ₂} where
54+
55+
private
56+
module P = Poset P
57+
module Q = Poset Q
58+
59+
record IsScottContinuous (f : P.Carrier Q.Carrier) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where
60+
field
61+
PreserveLub : {Ix : Set c} {s : Ix P.Carrier}
62+
(dir : IsDirectedFamily P s)
63+
(lub : P.Carrier)
64+
IsLub P s lub
65+
IsLub Q (f ∘ s) (f lub)
66+
PreserveEquality : {x y} x P.≈ y f x Q.≈ f y

0 commit comments

Comments
 (0)