-
Notifications
You must be signed in to change notification settings - Fork 272
[ refactor ] generalise Data.Sum.Relation.Binary.Pointwise.elim #3079
#3085
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?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,8 @@ open import Function.Bundles using (Inverse; mk↔) | |
| open import Relation.Nullary.Decidable.Core as Dec using (yes; no; map′) | ||
| open import Relation.Nullary.Negation.Core using (¬_) | ||
| open import Relation.Binary | ||
| open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_) | ||
| open import Relation.Binary.PropositionalEquality.Core as ≡ | ||
| using (_≡_; _≗_) | ||
| import Relation.Binary.PropositionalEquality.Properties as ≡ | ||
|
|
||
| private | ||
|
|
@@ -39,16 +40,33 @@ data Pointwise {A : Set a} {B : Set b} {C : Set c} {D : Set d} | |
| ---------------------------------------------------------------------- | ||
| -- Functions | ||
|
|
||
| elim : ∀ {f : A → C} {g : B → C} → | ||
| R =[ f ]⇒ T → S =[ g ]⇒ T → | ||
| Pointwise R S =[ Sum.[ f , g ]′ ]⇒ T | ||
| elim R⇒T S⇒T (inj₁ xRy) = R⇒T xRy | ||
| elim R⇒T S⇒T (inj₂ xSy) = S⇒T xSy | ||
| -- General eliminator arising from initiality of `Pointwise`. | ||
| -- | ||
| -- Ttype-theoreticaly/logically, `elim` is an inference rule for the | ||
| -- consequence relation given by (indexed) inclusion between relations, | ||
| -- describing what 'conclusion' T is derivable from what 'principal formula' | ||
| -- `Pointwise R S` by appeal to the ancillary sequents witnessing that | ||
| -- 'T follows from R' and 'T follows from S'. | ||
| -- | ||
| -- Categorically, it expresses `Pointwise R S` as a suitably indexed | ||
| -- generalisation of a coproduct, with elim generalising the usual | ||
| -- arrow-out-of-a-colimit. | ||
|
|
||
| module _ {f : A → C} {g : B → C} | ||
| (T : Rel C ℓ) (R⇒T : R =[ f ]⇒ T) (S⇒T : S =[ g ]⇒ T) | ||
| where | ||
|
|
||
| elim : ∀ {h} → Sum.[ f , g ]′ ≗ h → Pointwise R S =[ h ]⇒ T | ||
|
Collaborator
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. This is not really an eliminator, is it? It is much more like a transport (hence the Starting bid of
Collaborator
Author
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. Well, I happen to disagree, but I suppose in fairness It All Depends what you mean by... 'eliminator'... ... within the 'logic' / consequence relation given by inclusion/implication between relations, this is exactly an eliminator: it is an inference rule which describes what 'conclusion' Categorically, it expresses What's not like an eliminator about that!?
Collaborator
Author
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. And, FTR, I derived these while trying to think about #3081 in terms of product diagrams, with corresponding rule Or perhaps rather, given the contested terminology, not only categorically, but also type-theoretically!!! ;-) Hope you'll change your mind on this...
Collaborator
Author
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. Oh, and
Collaborator
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. Put that way (which should be in the comments!!!), I do see how this is an eliminator. In which case, given our naming convention for many other eliminators, maybe it should be called
Collaborator
Author
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. Interesting suggestion! And something I have suggested in the past... ... just as this new departure with |
||
| elim H (inj₁ xRy) = ≡.subst₂ T (H (inj₁ _)) (H (inj₁ _)) (R⇒T xRy) | ||
| elim H (inj₂ xSy) = ≡.subst₂ T (H (inj₂ _)) (H (inj₂ _)) (S⇒T xSy) | ||
|
|
||
| elim′ : Pointwise R S =[ Sum.[ f , g ]′ ]⇒ T | ||
| elim′ = elim λ _ → ≡.refl | ||
|
|
||
| map : ∀ {f : A → C} {g : B → D} → | ||
| R =[ f ]⇒ T → S =[ g ]⇒ U → | ||
| Pointwise R S =[ Sum.map f g ]⇒ Pointwise T U | ||
| map R⇒T S⇒U = elim {T = Pointwise _ _} (inj₁ ∘ R⇒T) (inj₂ ∘ S⇒U) | ||
| map R⇒T S⇒U = elim′ (Pointwise _ _) (inj₁ ∘ R⇒T) (inj₂ ∘ S⇒U) | ||
|
|
||
| ------------------------------------------------------------------------ | ||
| -- Relational properties | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.