-
Notifications
You must be signed in to change notification settings - Fork 242
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
Respects₂-generic ? #31
Comments
Strangely, this editor cancels many of underscores that I set in the code. ≈ |
How to enter here the underscore symbol? |
Hmm I can envisage a use case for such a type. Not sure about the name _Respects₂_∧_ : ∀ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} →
REL A B ℓ₁ → Rel A ℓ₂ → Rel B ℓ₃ → Set _
_∼_ Respects₂ _≈₁_ ∧ _≈₂_ = ∀ {x y u v} → x ∼ u → x ≈₁ y → u ≈₂ v → y ∼ v Still not entirely happy with it though. Thoughts? The other question is whether we define it as a product ala _Respects₂_∧_ : ∀ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} →
REL A B ℓ₁ → Rel A ℓ₂ → Rel B ℓ₃ → Set _
_∼_ Respects₂ _≈₁_ ∧ _≈₂_ = (∀ {y} → (_∼ y) Respects _≈₁_) ×
(∀ {x} → (x ∼_) Respects _≈₂_) |
On Sun, 2018-03-18 at 08:06 -0700, MatthewDaggitt wrote:
Hmm I can envisage a use case for such a proof. Not sure about the
name Respects₂gen though. My alternative is:
_Respects₂_∧_ : ∀ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} →
REL A B ℓ₁ → Rel A ℓ₂ → Rel B ℓ₃ → Set _
_∼_ Respects₂ _≈₁_ ∧ _≈₂_ = ∀ {x y u v} → x ∼ u → x ≈₁ y → u ≈₂ v → y ∼ v
Still not entirely happy with it though. Thoughts?
I like more prefix Respects₂gen or prefix Respects₂-∧.
But I would not argue against this _Respects₂_∧_.
The other question is whether we define it as a product ala
_Respects₂_
_Respects₂_∧_ : ∀ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} →
REL A B ℓ₁ → Rel A ℓ₂ → Rel B ℓ₃ → Set _
_∼_ Respects₂ _≈₁_ ∧ _≈₂_ = (∀ {y} → (_∼ y) Respects _≈₁_) ×
(∀ {x} → (x ∼_) Respects _≈₂_)
My impression was that _Respects₂_ of Standard is difficult to use.
So that I have introduced
_Respects2_ : ∀ {a ℓ₁ ℓ₂} {A : Set a} → Rel A ℓ₁ → Rel A ℓ₂ → Set _
_Respects2_ _~_ _≈_ =
∀ {x x' y y'} → x ≈ x' → y ≈ y' → x ~ y → x' ~ y'
…--
SM
|
I keep introducing generalisations of the combinators in I would go even further and suggest: _⟶_Respects₂_∧_ :
∀ {a b c d r s ℓ₁ ℓ₂} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
(R : REL A B r) (S : REL C D s) (_≈₁_ : REL A C ℓ₁) (_≈₂_ : REL B D ℓ₂) → Set _
R ⟶ S Respects₂ _≈₁_ ∧ _≈₂_ = ∀ {a b c d} → a ≈₁ c → b ≈₂ d → R a b → S c d The others can be defined as specialisations.
I would say yes because this one is usable even when the respected relations are not |
Currently I define and use
and suggest this for Standard library. The attempt with |
Relation.Binary.Core has
_Respects₂_ : ∀ {a ℓ₁ ℓ₂} {A : Set a} → Rel A ℓ₁ → Rel A ℓ₂ → Set _
And I introduce
Example:
expresses that the equality =set on lists
(\xs ys -> xs ⊆ ys × ys ⊆ xs)
agrees withthe equality
_≈_
on elements and with the relation_∈_
betwen elements and lists.Has Standard library a replacement for Respects₂gen ?
Has it a denotation for
(A → B → Set ℓ)
?(somewhat "Rel-heterogeneous A B" ? ...)
The text was updated successfully, but these errors were encountered: