Skip to content

Conversation

joelriou
Copy link
Collaborator

@joelriou joelriou commented Sep 11, 2025

Given a functor F : C ⥤ D and Y : D, we say that F is dense at Y if Y identifies to the colimit of all F.obj X for X : C and f : F.obj X ⟶ Y, i.e. the obvious natural transformation makes the identity functor of D a pointwise left Kan extension of F along F at Y.


Open in Gitpod

@joelriou joelriou added the t-category-theory Category theory label Sep 11, 2025
Copy link

github-actions bot commented Sep 11, 2025

PR summary 74170ab45e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.CategoryTheory.Functor.KanExtension.DenseAt (new file) 466

Declarations diff

+ DenseAt
+ DenseAt.ofIso
+ DenseAt.ofNatIso
+ DenseAt.postcompEquivalence
+ DenseAt.precompEquivalence
+ congr_isDenseAt
+ instance : E.isPointwiseLeftKanExtensionAt.IsClosedUnderIsomorphisms
+ instance : E.isPointwiseRightKanExtensionAt.IsClosedUnderIsomorphisms
+ instance : F.isDenseAt.IsClosedUnderIsomorphisms := by
+ isDenseAt
+ isDenseAt_eq_isPointwiseLeftKanExtensionAt
+ isPointwiseLeftKanExtensionAt
+ isPointwiseRightKanExtensionAt
++ hom_ext'

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@robin-carlier
Copy link
Collaborator

robin-carlier commented Oct 7, 2025

Will review more thoroughly later, but I really think that having "canonical" in the naming is a recipe for disaster in terms of understanding and should be avoided at all cost. I don’t believe this is standard terminology at all.

Given that this is used to define dense functors, maybe F.DenseAt Y would be a more reasonable way to name this?

I am also rather worried by the fact that the design here goes with ad hoc definitions and does not even mention (not even in docstrings!) the link with Kan extensions.

The definition here is that the (left extension defined by the) inverse right unitor F.rightUnitor.inv exhibits 𝟭 D as a pointwise left Kan extension of F along itself at Y (Kerodon phrases the definition of dense functors in that language as well).

The ad hoc definitions here means that we’ll be having more than one way of saying the same thing, and means that depending on how many properties for dense functors we want, we may have to duplicate API etc.

In fact, replacing your definition by

abbrev CanonicalColimit (Y : D) : Type _ := 
  (Functor.LeftExtension.mk (𝟭 D) F.rightUnitor.inv).IsPointwiseLeftKanExtensionAt Y

makes the proof of hom_ext go through.

Given that

def canonicalCoconeIso (Y : D) :
    canonicalCocone F Y ≅ (Functor.LeftExtension.mk (𝟭 D) F.rightUnitor.inv).coconeAt Y :=
  Cocones.ext (.refl _) (by cat_disch)

also goes through, I think it’s safe to say that we don’t lose a lot by taking Kan extensions as a definition here (and we gain the link with a well-established API).

Hence I also think the file here belongs in the Functor/KanExtension subfolder.

@robin-carlier robin-carlier added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 7, 2025
@joelriou
Copy link
Collaborator Author

joelriou commented Oct 7, 2025

Thanks! Indeed, I should have made the connection with Kan extensions! The name "canonical colimit" is used throughout the book by Adámek and Rosický, but indeed, Functor.DenseAt looks better.

@joelriou joelriou changed the title feat(CategoryTheory): canonical colimits feat(CategoryTheory): functors that are dense at an object Oct 7, 2025
@joelriou joelriou removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 7, 2025
Copy link
Collaborator

@robin-carlier robin-carlier left a comment

Choose a reason for hiding this comment

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

Thanks!

maintainer delegate

@robin-carlier robin-carlier added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 12, 2025
Copy link

🚀 Pull request has been placed on the maintainer queue by robin-carlier.

Co-authored-by: Robin Carlier <57142648+robin-carlier@users.noreply.github.com>
@joelriou
Copy link
Collaborator Author

Thanks @robin-carlier for the review!

@joelriou joelriou removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 12, 2025
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge labels Oct 16, 2025
mathlib-bors bot pushed a commit that referenced this pull request Oct 16, 2025
Given a functor `F : C ⥤ D` and `Y : D`, we say that `F` is dense at `Y` if `Y` identifies to the colimit of all `F.obj X` for `X : C` and `f : F.obj X ⟶ Y`, i.e. the obvious natural transformation makes the identity functor of `D` a pointwise left Kan extension of `F` along `F` at `Y`.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Oct 16, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(CategoryTheory): functors that are dense at an object [Merged by Bors] - feat(CategoryTheory): functors that are dense at an object Oct 16, 2025
@mathlib-bors mathlib-bors bot closed this Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-category-theory Category theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants