Zulip Chat Archive
Stream: mathlib4
Topic: Notation clash for `≌`
Calle Sönne (Apr 11 2024 at 20:12):
I have a problem where the notation ≌
has two possible interpretations, either equivalence of categories or equivalence in terms of some (other) bicategory structure. Is there a way I can give preference to the latter? Maybe at the top of the file? The notation for equivalence in terms bicategories is defined using scoped infixr
, could this be helpful?
Here is my specific situation:
I have defined the bicategory FiberCat S
of fibered categories over a base S
. This lets me use the notation ≌
to denote equivalence in the sense of the bicategory structure. An object C : FiberCat S
consists of a category C.carrier : Type _
and a functor C.carrier ⥤ S
. Now, I have also equipped the type FiberCat S
with a CoeToSort
instance sending C : FiberCat S
to C.carrier : Type _
. Because of this (I think) ≌
can also denote an equivalence of underlying categories C.carrier
. I would like to give preference for ≌
to denote equivalence in the sense of the bicategory structure, is this possible? Or will I have to remove the CoeToSort
instance?
Eric Wieser (Apr 11 2024 at 20:40):
Does using (priority := high)
work?
Eric Wieser (Apr 11 2024 at 20:40):
(or is it prio :=
?)
Adam Topaz (Apr 11 2024 at 20:41):
I would get rid of that coercion
Adam Topaz (Apr 11 2024 at 20:42):
I feel like it’s likely to cause other similar issues elsewhere.
Calle Sönne (Apr 11 2024 at 20:48):
Eric Wieser said:
Does using
(priority := high)
work?
You mean next to the bicategory
instance?
Calle Sönne (Apr 11 2024 at 20:58):
Calle Sönne said:
Eric Wieser said:
Does using
(priority := high)
work?You mean next to the
bicategory
instance?
Okay I figured out where to put it in the scoped infixr
expression, and it works :)
Calle Sönne (Apr 11 2024 at 20:58):
(deleted)
Eric Wieser (Apr 11 2024 at 21:00):
Yes, I meant on the notation
Calle Sönne (Apr 11 2024 at 21:00):
Adam Topaz said:
I feel like it’s likely to cause other similar issues elsewhere.
After the next issue I run into, I will delete it ;)
Adam Topaz (Apr 11 2024 at 21:01):
If X Y : C
, what does X \hom Y
mean?
Calle Sönne (Apr 11 2024 at 21:02):
Adam Topaz said:
If
X Y : C
, what doesX \hom Y
mean?
hom within the category C
Adam Topaz (Apr 11 2024 at 21:02):
Isn't C
also a bicategory?
Calle Sönne (Apr 11 2024 at 21:03):
Adam Topaz said:
Isn't
C
also a bicategory?
Oh I meant that FiberedCat S
is a bicategory. So the bicategory of fibered categories.
Adam Topaz (Apr 11 2024 at 21:03):
Oh so I'm confused why using \backcong
causes issues...
Calle Sönne (Apr 11 2024 at 21:04):
Adam Topaz said:
Oh so I'm confused why using
\backcong
causes issues...
I think its because if I have C D : FiberedCat S
, then C \backcong D
could either mean C.carrier \backcong D.carrier
or C \backcong D
, meaning an equivalence in the bicategory structure on FiberedCat S
. (Or maybe you are not confused about this part)
Adam Topaz (Apr 11 2024 at 21:07):
Aha I see now.
Adam Topaz (Apr 11 2024 at 21:09):
I still think that the coercion is problematic because there's more notation that's shared between the category theory library and stuff internal to a bicategory (I think whiskering is another example). If writing C.carrier
is too much I would suggest renaming it C.cat
or something like that.
Calle Sönne (Apr 11 2024 at 21:12):
Adam Topaz said:
I still think that the coercion is problematic because there's more notation that's shared between the category theory library and stuff internal to a bicategory (I think whiskering is another example). If writing
C.carrier
is too much I would suggest renaming itC.cat
or something like that.
Yeah I think you are right, I was more just curious about the next time it would break. And C.cat
is a good suggestion, way less painful than C.carrier
!
Last updated: May 02 2025 at 03:31 UTC