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
[Merged by Bors] - feat(CategoryTheory/Bicategory): define left Kan extensions #6552
Conversation
structure IsKan (t : LeftExtension f g) where | ||
/-- The family of morphisms out of a left Kan extension. -/ | ||
descHom : ∀ s : LeftExtension f g, t ⟶ s | ||
/-- The uniqueness of the family of morphisms out of a left Kan extension. -/ | ||
uniq : ∀ (s : LeftExtension f g) (τ : t ⟶ s), τ = descHom s |
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.
With suitable imports, I would suggest using the existing limits API:
structure IsKan (t : LeftExtension f g) where | |
/-- The family of morphisms out of a left Kan extension. -/ | |
descHom : ∀ s : LeftExtension f g, t ⟶ s | |
/-- The uniqueness of the family of morphisms out of a left Kan extension. -/ | |
uniq : ∀ (s : LeftExtension f g) (τ : t ⟶ s), τ = descHom s | |
structure IsKan (t : LeftExtension f g) where | |
/-- a left Kan extension is initial in `LeftExtension f g` -/ | |
isInitial : Limits.IsInitial t |
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.
How about stating the equivalence to IsInitial
as a lemma instead of putting in the default consructor?
The constructor of IsInitial
(defined as a specific IsColimit
) unfolds descHom
into desc
and fac
, but I find in the current situation it's more convenient to bundle them when providing a term of IsKan t
.
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.
As it seems to me that your definitions/lemmas are not at all specific to the category LeftExtension
, I think the overall situation would be better if the general IsInitial
API was improved instead, and then IsKan
could be made an abbreviation of IsInitial
. Indeed, I believe that for the future development of Kan extensions, it shall be convenient to use the Limits
API, e.g. when two objects in LeftExtension
are isomorphic, then one is initial iff the other is, etc. This should avoid some unnecessary duplication of code.
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 see. Maybe it is enough to just define abbrev IsKan (t : LeftExtension f g) := Limits.IsInitial t
? I will try it.
structure LeftExtension (f : a ⟶ b) (g : a ⟶ c) where | ||
/-- The extension of `g` along `f`. -/ | ||
extension : b ⟶ c | ||
/-- The 2-morphism filling the triangle diagram. -/ | ||
unit : g ⟶ f ≫ extension |
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.
If we introduce the whiskering functors, the category LeftExtension
identifies to a suitable category StructuredArrow
. Recent PRs by @TwoFX like #6248 contain useful results about these categories. I know that this type of results about (Co)structuredArrow
categories will be very useful when proving things about Kan extensions (e.g. total derived functors for which I have done some experiments). Then, again, in order to avoid duplication of code, it would be great to base the definition of Left/RightExtension
using this so that we can later use the existing and future developments of the StructuredArrow
API. Still, you may introduce more convenient specialized abbreviations like "LeftExtension.extension" or "LeftExtension.unit" instead of Comma.right
and Comma.hom
.
@[simps]
def whiskeringLeft (a b c : B) : (a ⟶ b) ⥤ (b ⟶ c) ⥤ (a ⟶ c) where
obj f :=
{ obj := fun e => f ≫ e
map := fun φ => f ◁ φ }
map ψ :=
{ app := fun e => ψ ▷ e
naturality := fun {e₁ e₂} φ => whisker_exchange _ _ }
def LeftExtension (f : a ⟶ b) (g : a ⟶ c) :=
StructuredArrow g ((whiskeringLeft a b c).obj 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.
This looks great! I think we need to develop an API for the initial object of StructuredArrow
first. Does mathlib already have this?
(It should be similar to the colimit API, which would suggest the possibility of refactoring the colimit files.)
namespace LeftExtension | ||
|
||
variable {f : a ⟶ b} {g : a ⟶ c} | ||
|
||
/-- A left Kan extension of `g` along `f` is an initial object in `LeftExtension f g`. -/ | ||
abbrev IsKan (t : LeftExtension f g) := t.IsUniversal | ||
|
||
end LeftExtension |
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 think that this design is good. As you have developed the API for both StructuredArrow
and CostructuredArrow
, I believe you may also add the dual definition RightExtension.IsKan
.
Thanks! |
The basic design follows the API for colimits in the category theory library. The dictionary looks like: Current PR `LeftExtension` <-> `Limits.Cocone` `LeftExtension.IsKan` <-> `Limits.IsColimit` Future PR `LeftExtension.HasKan` <-> `Limits.HasColimit` `lan` <-> `Limits.colimit` The diagrams in the docs are far from ideal, but I hope it helps for the time being. I would be very happy to have a graphical visualization by e.g. the widgets.
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
The basic design follows the API for colimits in the category theory library.
The dictionary looks like:
Current PR
LeftExtension
<->Limits.Cocone
LeftExtension.IsKan
<->Limits.IsColimit
Future PR
LeftExtension.HasKan
<->Limits.HasColimit
lan
<->Limits.colimit
The diagrams in the docs are far from ideal, but I hope it helps for the time being. I would be very happy to have a graphical visualization by e.g. the widgets.