-
Notifications
You must be signed in to change notification settings - Fork 250
[Add] Initial files for Domain theory #2721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jmougeot
wants to merge
11
commits into
agda:master
Choose a base branch
from
jmougeot:domain_part1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4486fd0
Definitons of domain theory
jmougeot 34be6b0
1st review
jmougeot 502e288
whitespaces
jmougeot 63810b7
@ review
jmougeot 87d5f16
remove the file Padrightdraft
jmougeot 51954b6
quick fix
jmougeot 85192d0
add using to importation
jmougeot ceb39d6
add perserveLub in defintion
jmougeot 2384bd3
fixwhitespace
jmougeot b753478
{I} instead of I
jmougeot 1e41d41
remove file
jmougeot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Order-theoretic Domains | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Relation.Binary.Domain where | ||
|
||
------------------------------------------------------------------------ | ||
-- Re-export various components of the Domain hierarchy | ||
|
||
open import Relation.Binary.Domain.Definitions public | ||
open import Relation.Binary.Domain.Structures public | ||
open import Relation.Binary.Domain.Bundles public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Bundles for domain theory | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Relation.Binary.Domain.Bundles where | ||
|
||
open import Level using (Level; _⊔_; suc) | ||
open import Relation.Binary.Bundles using (Poset) | ||
open import Relation.Binary.Domain.Structures | ||
using (IsDirectedFamily; IsDirectedCompletePartialOrder; IsScottContinuous | ||
; IsLub) | ||
|
||
private | ||
variable | ||
o ℓ e o' ℓ' e' ℓ₂ : Level | ||
Ix A B : Set o | ||
|
||
------------------------------------------------------------------------ | ||
-- Directed Complete Partial Orders | ||
------------------------------------------------------------------------ | ||
|
||
record DirectedFamily {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {B : Set c} (f : B → Poset.Carrier P) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where | ||
field | ||
isDirectedFamily : IsDirectedFamily P f | ||
|
||
open IsDirectedFamily isDirectedFamily public | ||
|
||
record DirectedCompletePartialOrder (c ℓ₁ ℓ₂ : Level) : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where | ||
field | ||
poset : Poset c ℓ₁ ℓ₂ | ||
isDirectedCompletePartialOrder : IsDirectedCompletePartialOrder poset | ||
|
||
open Poset poset public | ||
open IsDirectedCompletePartialOrder isDirectedCompletePartialOrder public | ||
|
||
------------------------------------------------------------------------ | ||
-- Scott-continuous functions | ||
------------------------------------------------------------------------ | ||
|
||
record ScottContinuous | ||
{c₁ ℓ₁₁ ℓ₁₂ c₂ ℓ₂₁ ℓ₂₂ : Level} | ||
(P : Poset c₁ ℓ₁₁ ℓ₁₂) | ||
(Q : Poset c₂ ℓ₂₁ ℓ₂₂) : Set (suc (c₁ ⊔ ℓ₁₁ ⊔ ℓ₁₂ ⊔ c₂ ⊔ ℓ₂₁ ⊔ ℓ₂₂)) where | ||
field | ||
f : Poset.Carrier P → Poset.Carrier Q | ||
isScottContinuous : IsScottContinuous P Q f | ||
|
||
open IsScottContinuous isScottContinuous public | ||
|
||
------------------------------------------------------------------------ | ||
-- Lubs | ||
------------------------------------------------------------------------ | ||
|
||
record Lub {c ℓ₁ ℓ₂ : Level} {P : Poset c ℓ₁ ℓ₂} {B : Set c} | ||
(f : B → Poset.Carrier P) : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where | ||
open Poset P | ||
field | ||
lub : Carrier | ||
isLub : IsLub P f lub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Definitions for domain theory | ||
------------------------------------------------------------------------ | ||
|
||
|
||
|
||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Relation.Binary.Domain.Definitions where | ||
|
||
open import Data.Product using (∃-syntax; _×_; _,_) | ||
open import Function using (_∘_) | ||
open import Level using (Level; _⊔_; suc) | ||
open import Relation.Binary.Core using (Rel) | ||
|
||
private | ||
variable | ||
a b i ℓ ℓ₁ ℓ₂ : Level | ||
A : Set a | ||
B : Set b | ||
I : Set ℓ | ||
|
||
------------------------------------------------------------------------ | ||
-- Directed families | ||
------------------------------------------------------------------------ | ||
|
||
semidirected : {A : Set a} → Rel A ℓ → (B : Set b) → (B → A) → Set _ | ||
semidirected _≤_ B f = ∀ i j → ∃[ k ] (f i ≤ f k × f j ≤ f k) | ||
|
||
------------------------------------------------------------------------ | ||
-- Least upper bounds | ||
------------------------------------------------------------------------ | ||
|
||
leastupperbound : {A : Set a} → Rel A ℓ → {B : Set b} → (g : B → A) → A → Set _ | ||
leastupperbound _≤_ g lub = (∀ i → g i ≤ lub) × (∀ y → (∀ i → g i ≤ y) → lub ≤ y) | ||
|
||
preserveLubs : {A : Set a} {B : Set b } (≤₁ : Rel A ℓ₁) (≤₂ : Rel B ℓ₂) (f : A → B) → Set (suc (a ⊔ b ⊔ ℓ₁ ⊔ ℓ₂)) | ||
preserveLubs ≤₁ ≤₂ f = ∀ {I} → ∀ {g : I → _} → ∀ lub → leastupperbound ≤₁ g lub → leastupperbound ≤₂ (f ∘ g) (f lub) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Structures for domain theory | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
module Relation.Binary.Domain.Structures where | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To 'fit' the rest of |
||
|
||
open import Data.Product using (_×_; _,_; proj₁; proj₂) | ||
open import Function using (_∘_) | ||
open import Level using (Level; _⊔_; suc) | ||
open import Relation.Binary.Bundles using (Poset) | ||
open import Relation.Binary.Domain.Definitions | ||
using (semidirected; leastupperbound; preserveLubs) | ||
open import Relation.Binary.Morphism.Structures using (IsOrderHomomorphism) | ||
|
||
private variable | ||
a b c c₁ c₂ ℓ ℓ₁ ℓ₂ ℓ₁₁ ℓ₁₂ ℓ₂₁ ℓ₂₂ : Level | ||
A B : Set a | ||
|
||
|
||
module _ (P : Poset c ℓ₁ ℓ₂) where | ||
open Poset P | ||
|
||
record IsLub {b : Level} {B : Set b} (f : B → Carrier) | ||
(lub : Carrier) : Set (b ⊔ c ⊔ ℓ₁ ⊔ ℓ₂) where | ||
field | ||
isLeastUpperBound : leastupperbound _≤_ f lub | ||
|
||
isUpperBound : ∀ i → f i ≤ lub | ||
isUpperBound = proj₁ isLeastUpperBound | ||
|
||
isLeast : ∀ y → (∀ i → f i ≤ y) → lub ≤ y | ||
isLeast = proj₂ isLeastUpperBound | ||
|
||
record IsDirectedFamily {b : Level} {B : Set b} (f : B → Carrier) : | ||
Set (b ⊔ c ⊔ ℓ₁ ⊔ ℓ₂) where | ||
no-eta-equality | ||
field | ||
elt : B | ||
isSemidirected : semidirected _≤_ B f | ||
|
||
record IsDirectedCompletePartialOrder : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where | ||
field | ||
⋁ : ∀ {B : Set c} → | ||
(f : B → Carrier) → | ||
IsDirectedFamily f → | ||
Carrier | ||
⋁-isLub : ∀ {B : Set c} | ||
→ (f : B → Carrier) | ||
→ (dir : IsDirectedFamily f) | ||
→ IsLub f (⋁ f dir) | ||
|
||
module _ {B : Set c} {f : B → Carrier} {dir : IsDirectedFamily f} where | ||
open IsLub (⋁-isLub f dir) | ||
renaming (isUpperBound to ⋁-≤; isLeast to ⋁-least) | ||
public | ||
|
||
------------------------------------------------------------------------ | ||
-- Scott‐continuous maps between two (possibly different‐universe) posets | ||
------------------------------------------------------------------------ | ||
|
||
module _ (P : Poset c₁ ℓ₁₁ ℓ₁₂) (Q : Poset c₂ ℓ₂₁ ℓ₂₂) | ||
where | ||
module P = Poset P | ||
module Q = Poset Q | ||
|
||
record IsScottContinuous (f : P.Carrier → Q.Carrier) : Set (suc (c₁ ⊔ ℓ₁₁ ⊔ ℓ₁₂ ⊔ c₂ ⊔ ℓ₂₁ ⊔ ℓ₂₂)) | ||
where | ||
field | ||
preservelub : preserveLubs P._≤_ Q._≤_ f | ||
isOrderHomomorphism : IsOrderHomomorphism P._≈_ Q._≈_ P._≤_ Q._≤_ f | ||
|
||
open IsOrderHomomorphism isOrderHomomorphism public |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that neither of the definitions here depend on
Poset
(now), maybe they should go where all the other binary relations are defined?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is that all 3 definitions below should be moved to
Relation.Binary.Definitions
, with the naming made consistent with the names already in that file.