Skip to content

Conversation

@patrick-nicodemus
Copy link
Contributor

@patrick-nicodemus patrick-nicodemus commented Apr 1, 2025

This PR defines a wild bicategory. This is a rewrite of the previous PR, because my original definition of a 1Bicat was too far from the definition of a 1Cat, making it a lot of work to port work using 1Cats to use 1Bicats instead; the new definition of a 1Bicat mimics 1Cat as closely as possible.
Also, with my original definition using Is0Bifunctor there are two different ways to whisker a 2-cell with a 1-cell that are not in any way related, and this seems like a potential pitfall.

On the other hand, the definition of a Bicategory is more of a departure from the current definition of a (2,1)-category, in that it assumes that the associator is natural as a functor on (a $-> b) * (b $-> c) * (c $-> d) rather than being natural in each argument separately. This definition is more complex because it uses products and uncurrying, but I preferred the style, and there's not as much material in the library for (2,1)-cats as there is for 1-cats so refactoring is not as much of an issue.

  • The first commit defines a 1-bicategory (which is a wild 1-category without the requirement that 2-cells are invertible) and a bicategory; it refactors the definition of (2,1)-category to extend bicategory; all (2,1)-categories (the path groupoid of a type, the universe Type, pType) are rewritten as bicategories. While writing the proofs that pType is a bicategory I took care to try and reuse the same proofs for Type in many places. A few helper lemmas in constructing the (2,1)-category of paths are extracted and put in PathGroupoid.v. Notation is introduced for vertical pasting.
  • In the second commit, a definition is given to upgrade a 1-bicategory to a 1-category when 2-cells are invertible; all near-duplicate definitions from the first commit are deduplicated.
  • The third commit better integrates AreInverse into the library by rewriting Is1Gpd to depend on AreInverse.

@patrick-nicodemus patrick-nicodemus marked this pull request as ready for review April 1, 2025 16:59
@jdchristensen
Copy link
Collaborator

I haven't had time to look at this. I was hoping @Alizter might get a chance, but if not, I'll add it to my list.

@Alizter
Copy link
Collaborator

Alizter commented Apr 27, 2025

I have been very busy these past few weeks unfortunately and didn't have the brain-power to think about this.

Copy link
Collaborator

@jdchristensen jdchristensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a first pass through. Feel free to do an interactive rebase and a force push to move the changes from the "undid change to master" commit into the earlier commit(s), but it'll be easier to review if other changes are made as additional commits.

BTW, I'm not sure what "pre post" means in the title of this PR.

I didn't comment on notation, as that is being discussed in #2271.

I'm hoping that @Alizter will have time to take a look, maybe after my feedback has been addressed.

Comment on lines +72 to +105
(p : f $=> f') (p' : g $=> g'),
(p' $@R f) $| (g' $@L p) $== (g $@L p) $| (p' $@R f');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have been better to make the change to the notation in a separate commit, as the diff is now harder to read.

rapply is0bifunctor_flip.
Defined.

Notation "alpha $@@ beta" := (fmap11 cat_comp beta alpha) : twocat.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there are two meanings for $@@. Is the plan to unify them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to unify them. I'll take another look at this PR and figure out whether it's appropriate for the current PR or would require extensive refactoring.

Comment on lines 74 to 75
- exact (@concat_pV A _ _ _).
- exact (@concat_Vp A _ _ _).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply concat_pV. and apply concat_Vp. work and are cleaner.

Comment on lines +174 to +178
Class AreInverse {A} `{Is1Cat A} {a b : A} (f : a $-> b) (g : b $-> a) :=
{
inv_issect : g $o f $== Id a;
inv_isretr : f $o g $== Id b;
}.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have Cat_IsBiInv which uses bi-invertibility. Maybe it makes sense to have these separate, but it's worth thinking about.

@patrick-nicodemus patrick-nicodemus changed the title Bicategory pre post Bicategory (Is1Cat compatible design) Apr 29, 2025
@patrick-nicodemus
Copy link
Contributor Author

patrick-nicodemus commented Apr 29, 2025

Sorry, the name was just a lazy way of distinguishing it from the previous PR. In this PR, the definition of IsBicat takes pre- and post-whiskering of a 2-cell with a 1-cell as primitive, as opposed to a binary horizontal composition operation for 2-cells.

@patrick-nicodemus
Copy link
Contributor Author

Addressed some comments but not all, I will come back to address these

Copy link
Collaborator

@jdchristensen jdchristensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good. I especially like the new comments which make it much easier to understand what you are doing. As you mention, there are a couple more comments to respond to. And I think it would be a good time for @Alizter to take a look at this PR if he is able to.

Comment on lines +596 to +600
- intros ? ? ? ? f g h; exact ((pmap_compose_assoc h g f)^* ).
- intros ? ? f; exact (pmap_postcompose_idmap f).
- intros ? ? f; exact ((pmap_postcompose_idmap f)^* ).
- intros ? ? f; exact (pmap_precompose_idmap f).
- intros ? ? f; exact ((pmap_precompose_idmap f)^* ).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the lines with ^*, you can remove the outer parentheses.

1: reflexivity.
by pelim f g.
- intros A B C D; snapply Build_Is1Natural.
(* TODO: It would be nice if this naturality proof could reuse the proof in the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No line break in comment.

Comment on lines 61 to 63
- intros a b f. exact ((@concat_p1 A _ _ f)^).
- exact (@concat_1p A).
- intros a b f. exact ((@concat_1p A _ _ f)^).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the two lines with ^, you can remove the outer parentheses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants