-
Notifications
You must be signed in to change notification settings - Fork 253
[ add ] Setoid
from PartialSetoid
#2816
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
@@ -45,3 +53,37 @@ partial-reflexiveˡ p ≡.refl = partial-reflˡ p | |||
partial-reflexiveʳ : x ≈ y → y ≡ z → y ≈ z | |||
partial-reflexiveʳ p ≡.refl = partial-reflʳ p | |||
|
|||
------------------------------------------------------------------------ | |||
-- Setoids from partial setoids |
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.
My instinct would be to put all of these in a (named) module rather than adding more things to the exported namespace of this module. That would also obviate the need for the awkward names with subscripts.
Also: definitely a construction. In fact, why not build the Setoid
bundle directly?
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.
Are you saying that I 'just' build a value of type Setoid
, and not explicitly define all the other fields at top-level?
I'm not quite sure what you mean otherwise, but it would be good to be clear...
Our custom to date seems to be to such structures/bundle explicitly piece-by-piece, but my suggestion in #2391 was that, at least for additional structure, that we could apply a Construct
, and then publicly re-open it to expose its subfields. But that's not the same as making a Construct
definition from scratch, as here?
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.
In any case, will move to Relation.Binary.Construct.SetoidFromPartialSetoid
, unless a better name is available/recommended?
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.
Or did you mean to build the relevant Function.Bundles
object(s) directly from isRelHomomorphism
? That's not possible, precisely because the Function
hierarchy is based on Setoid
s as source and target, ... and we only have the former here!
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.
Are you saying that I 'just' build a value of type Setoid, and not explicitly define all the other fields at top-level?
Yes. Because the pieces are so trivial.
Having all the pieces exposed in SetoidFromPartialSetoid
does make sense. It's just pollution here.
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.
One quibble, but otherwise I like this now.
Carrier = Σ S.Carrier λ x → x S.≈ x | ||
|
||
_≈_ : Rel Carrier _ | ||
x≈x@(x , _) ≈ y≈y@(y , _) = x S.≈ y |
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.
x ≈ y = proj₁ x S.≈ proj₁ y
? Or even
_≈_ = S._≈_ on proj₁
I certainly don't like binding names that are not used on the rhs as you do here.
This tackles one version of how to develop 'subsetoid's via PERs. Cf. #2814
Not necessarily the 'right' way to go, but still functionality which may be useful in the future
UPDATED: to live under
Relation.Binary.Construct