-
Notifications
You must be signed in to change notification settings - Fork 170
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
Refactor sub bicategories #1708
Conversation
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
Co-authored-by: Dan Frumin <dan@groupoid.moe>
Co-authored-by: Michael Lindgren <mlindgren84@gmail.com>
@@ -87,15 +87,15 @@ Definition disp_has_binprod_univ_cat_with_terminal_obj | |||
: disp_has_binprod disp_bicat_terminal_obj has_binprod_bicat_of_univ_cats. | |||
Proof. | |||
use subbicat_disp_binprod. | |||
- exact (λ C₁ C₂, terminal_category_binproduct (pr22 C₁) (pr22 C₂)). | |||
- exact (λ C₁ C₂, terminal_category_binproduct (pr12 C₁) (pr12 C₂)). |
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.
It seems to me that this file shows what happens when one does not use access functions. Could we add access functions instead of those projections?
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 nicest way to do so, would be as follows:
#[nonuniform] Coercion univ_cat_of_univ_cat_with_terminal_obj
(C : univ_cat_with_terminal_obj)
: univalent_category
:= pr1 C.
Definition terminal_of_univ_cat_with_terminal_obj
(C : univ_cat_with_terminal_obj)
: Terminal C
:= pr12 C.
#[nonuniform] Coercion functor_of_univ_cat_with_terminal_obj_mor
{C₁ C₂ : univ_cat_with_terminal_obj}
(F : C₁ --> C₂)
: C₁ ⟶ C₂
:= pr1 F.
Definition preserves_terminal_univ_cat_with_terminal_obj_mor
{C₁ C₂ : univ_cat_with_terminal_obj}
(F : C₁ --> C₂)
: preserves_terminal F
:= pr22 F.
Both coercions don't respect the uniform inheritance condition, so I needed to add #[nonuniform]
in order to suppress the warning arising from that (they do work though).
Would this solution be fine?
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.
Yes, I think that's good!
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.
Okay, I tried it further and by adding these coercions to univ_cat_with_binprod
,
#[nonuniform] Coercion univ_cat_of_univ_cat_with_binprod
(C : univ_cat_with_binprod)
: univalent_category
:= pr1 C.
Definition binprod_of_univ_cat_with_binprod
(C : univ_cat_with_binprod)
: BinProducts C
:= pr12 C.
The second definition is not accepted, and the first one gives the following warning:
univ_cat_of_univ_cat_with_binprod is defined
Warning:
New coercion path [univ_cat_of_univ_cat_with_binprod] : ob >-> univalent_category (reversible) is ambiguous with existing
[univ_cat_of_univ_cat_with_terminal_obj] : ob >-> univalent_category (reversible).
[ambiguous-paths,typechecker]
univ_cat_of_univ_cat_with_binprod is now a coercion
The error for the second definition is:
Error:
In environment
C : univ_cat_with_binprod
The term "C" has type "ob univ_cat_with_binprod" while it is expected to have type "category".
So: it is not a good idea to have a coercion from the objects of a bicategory to something, because this coercion seem as a coercion from ob
to categories and it does not take the bicategory into account.
Note that this idea was already used in:
https://github.com/UniMath/UniMath/blob/master/UniMath/Bicategories/DaggerCategories/BicatOfDaggerCats.v#L73
Now I think we should delete that coercion.
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.
By deleting all coercions completely we would get the following:
Definition univ_cat_of_univ_cat_with_terminal_obj
(C : univ_cat_with_terminal_obj)
: univalent_category
:= pr1 C.
Definition terminal_of_univ_cat_with_terminal_obj
(C : univ_cat_with_terminal_obj)
: Terminal (univ_cat_of_univ_cat_with_terminal_obj C)
:= pr12 C.
Definition functor_of_univ_cat_with_terminal_obj_mor
{C₁ C₂ : univ_cat_with_terminal_obj}
(F : C₁ --> C₂)
: univ_cat_of_univ_cat_with_terminal_obj C₁
⟶
univ_cat_of_univ_cat_with_terminal_obj C₂
:= pr1 F.
Definition preserves_terminal_univ_cat_with_terminal_obj_mor
{C₁ C₂ : univ_cat_with_terminal_obj}
(F : C₁ --> C₂)
: preserves_terminal (functor_of_univ_cat_with_terminal_obj_mor F)
:= pr22 F.
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 am not fully understanding the matter of coercions, but would like to. Could we discuss this in a meeting sometime?
Anyway, this is possibly something that is separate from the current PR. I would be happy with a solution without coercions for now. Also, the substitution of projections for access functions could happen in a later PR.
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 am not fully understanding the matter of coercions, but would like to. Could we discuss this in a meeting sometime?
Sure.
Anyway, this is possibly something that is separate from the current PR. I would be happy with a solution without coercions for now. Also, the substitution of projections for access functions could happen in a later PR.
I think that is fine.
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.
lgtm, modulo #1709 to be addressed later
In this PR:
subbicat
) is made more generalThe main reason to look at these bicategories is to study how it interacts with the Rezk completion. More specifically, what can we say about the Rezk completion of a category with a terminal object? Does it matter whether the terminal object is chosen or just exists?