-
Notifications
You must be signed in to change notification settings - Fork 251
[Add] Properties for DCPOs in Relation.Binary.Properties.Domain
#2734
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
base: master
Are you sure you want to change the base?
Conversation
Relation.Binary.Properties.Domain
Relation.Binary.Properties.Domain
record IsScottContinuous (f : P.Carrier → Q.Carrier) | ||
: Set (suc (c₁ ⊔ ℓ₁₁ ⊔ ℓ₁₂ ⊔ c₂ ⊔ ℓ₂₁ ⊔ ℓ₂₂)) where | ||
field | ||
preserveLub : ∀ {B : Set c₁} {g : B → P.Carrier} |
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.
I don't think this layout is as per the style guide.
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.
This looks good - but depends on a previous PR, so cannot be merged in quite yet.
Could we get another review? @jamesmckinna ? @MatthewDaggitt ? |
------------------------------------------------------------------------ | ||
|
||
-- IsSemidirectedFamily : (P : Poset c ℓ₁ ℓ₂) → ∀ {Ix : Set c} → (s : Ix → Poset.Carrier P) → Set _ | ||
-- IsSemidirectedFamily P {Ix} s = ∀ i j → ∃[ k ] (Poset._≤_ P (s i) (s k) × Poset._≤_ P (s j) (s k)) |
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.
This should either be removed or uncommented?
-- IsSemidirectedFamily : (P : Poset c ℓ₁ ℓ₂) → ∀ {Ix : Set c} → (s : Ix → Poset.Carrier P) → Set _ | ||
-- IsSemidirectedFamily P {Ix} s = ∀ i j → ∃[ k ] (Poset._≤_ P (s i) (s k) × Poset._≤_ P (s j) (s k)) | ||
|
||
semidirected : {A : Set a} → Rel A ℓ → (B : Set b) → (B → A) → Set _ |
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.
This implicit {A}
is already available as a variable? Can B
not be made implicit as well? It feels like it should be inferable from B -> A
?
-- Least upper bounds | ||
------------------------------------------------------------------------ | ||
|
||
leastupperbound : {A : Set a} → Rel A ℓ → (B : Set b) → (B → A) → A → Set _ |
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.
The capitalisation on this name is odd. Same comments as before though.
|
||
|
||
|
||
|
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.
Too much whitespace.
A B : Set a | ||
|
||
|
||
module _ {c ℓ₁ ℓ₂ : Level} (P : Poset c ℓ₁ ℓ₂) where |
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.
c ℓ₁ ℓ₂
already exist as variables.
isLeast : ∀ y → (∀ i → f i ≤ y) → lub ≤ y | ||
isLeast = proj₂ isLeastUpperBound | ||
|
||
record IsDirectedFamily {b : Level} {B : Set b} (f : B → Carrier) |
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.
Use of variables
open Poset P | ||
|
||
record IsLub {b : Level} {B : Set b} (f : B → Carrier) | ||
(lub : Carrier) : Set (b ⊔ c ⊔ ℓ₁ ⊔ ℓ₂) where |
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's the point of this record if it just wraps leastupperbound
?
module _ {B : Set c} {f : B → Carrier} {dir : IsDirectedFamily f} where | ||
open IsLub (⋁-isLub f dir) | ||
renaming (isUpperBound to ⋁-≤; isLeast to ⋁-least) | ||
public |
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.
public
should before renaming
according to the style guide
elt : B | ||
isSemidirected : semidirected _≤_ B f | ||
|
||
record IsDirectedCompletePartialOrder : Set (suc (c ⊔ ℓ₁ ⊔ ℓ₂)) where |
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.
These levels look deeply suspicious. It feels like the c
level shouldn't exposed in the interface. I know you'll run into level problems in the type of the record if you internalise it so I'm not sure what the solution is, but it feels like a strong code smell.
: Set (b ⊔ c ⊔ ℓ₁ ⊔ ℓ₂) where | ||
no-eta-equality | ||
field | ||
elt : B |
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.
Is this simply trying to encode the fact that B
is non-empty? Wouldn't be better to define and use a NonEmpty
type (probably defining it in Relation.Nullary
if it is not already there)
I've asked @e-mniang to take over this PR. |
And so... I'll come back to review once they've had a chance to grok the details, and @MatthewDaggitt 's initial feedback... and I've recovered some bandwidth after the latest round of comments on #2795 and #2769 ;-) |
This pull request introduces new modules and properties for directed complete partial orders (DCPOs) in the Agda standard library. These additions are adapted from the 1Lab library.
The first part of this pull request is available at [Add] Initial files for Domain theory #2721 .
Please comment only on the
src/Relation/Binary/Properties/Domain.agda
file hereKey Changes:
1. Properties of Least Upper Bounds:
uniqueLub:
Proves the uniqueness of least upper bounds.IsLub-cong
: Demonstrates congruence of least upper bounds under equivalence.2. Scott Continuity and Monotonicity:
DirectedCompletePartialOrder+scott→monotone
: Proves that Scott continuous functions are monotone.3. Scott Continuous Functions:
ScottId
: Identity function as a Scott continuous function.scott-∘
: Composition of Scott continuous functions.4. Suprema and Pointwise Ordering:
⋃-pointwise
: Proves pointwise ordering of suprema in directed families.5. Scott Continuity Module:
pres-⋁
: Proves preservation of least upper bounds under Scott continuous functions.6. Conversion to Scott Continuity:
-Added
to-scott
: Converts monotone functions with preservation of least upper bounds into Scott continuous functions.Source :
1Lab library