Skip to content

feat(CategoryTheory): presheaves of types which preserve a limit#32725

Open
joelriou wants to merge 6 commits intoleanprover-community:masterfrom
joelriou:cardinal-cocontinuous-3
Open

feat(CategoryTheory): presheaves of types which preserve a limit#32725
joelriou wants to merge 6 commits intoleanprover-community:masterfrom
joelriou:cardinal-cocontinuous-3

Conversation

@joelriou
Copy link
Copy Markdown
Contributor

@joelriou joelriou commented Dec 11, 2025

Let F : J ⥤ Cᵒᵖ be a functor. We show that a presheaf P : Cᵒᵖ ⥤ Type w preserves the limit of F iff P is a local object with respect to a suitable family of morphisms in Cᵒᵖ ⥤ Type w (this family contains 1 or 0 morphism depending on whether the limit of F exists or not).


Open in Gitpod

@joelriou joelriou added the t-category-theory Category theory label Dec 11, 2025
@joelriou joelriou changed the title feat(CategoryTheory): Presheaves of types which preserves a limit feat(CategoryTheory): presheaves of types which preserves a limit Dec 11, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 11, 2025

PR summary 42a89fc2b9

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.CategoryTheory.ObjectProperty.FunctorCategory.Presheaf (new file) 870

Declarations diff

+ coconeCompShrinkYonedaHomEquiv
+ coconePtToShrinkYoneda
+ coconePtToShrinkYoneda_comp
+ iSup_ofHoms
+ instance {α : Type t} [Small.{w} α] (W : α → MorphismProperty C) [∀ i, IsSmall.{w} (W i)] :
+ isColocal_iSup
+ isColocal_single_iff_bijective
+ isLocal_iSup
+ isLocal_single_iff_bijective
+ nonempty_isLimit_mapCone_iff
+ preservesLimitHomFamily
+ preservesLimitHomFamilySrc
+ preservesLimitHomFamilyTgt
+ preservesLimit_eq_isLocal
+ preservesLimit_eq_isLocal_single
+ preservesLimitsOfShape_eq_isLocal
+ single

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

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

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


Increase in tech debt: (relative, absolute) = (3.00, 0.00)
Current number Change Type
6538 3 backward.isDefEq.respectTransparency

Current commit d666851284
Reference commit 42a89fc2b9

You can run this locally as

./scripts/reporting/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).

Comment thread Mathlib/CategoryTheory/ObjectProperty/FunctorCategory/Presheaf.lean
Comment thread Mathlib/CategoryTheory/ObjectProperty/FunctorCategory/Presheaf.lean Outdated
Comment on lines +47 to +65
noncomputable def coconeCompShrinkYonedaHomEquiv :
(c'.pt ⟶ P) ≃ (F ⋙ P).sections where
toFun f :=
{ val j := shrinkYonedaEquiv (c'.ι.app (op j) ≫ f)
property {X X'} g := by
have h₁ := c'.w g.op
dsimp at h₁ ⊢
rw [← h₁, Category.assoc]
conv_rhs => rw [shrinkYonedaEquiv_comp]
rw [shrinkYonedaEquiv_shrinkYoneda_map]
apply map_shrinkYonedaEquiv }
invFun s := hc'.desc (Cocone.mk _
{ app j := shrinkYonedaEquiv.symm (s.val j.unop)
naturality j₁ j₂ f := by
rw [← s.property f.unop]
dsimp
rw [shrinkYonedaEquiv_symm_map, Category.comp_id] })
left_inv f := hc'.hom_ext (by simp)
right_inv u := by ext; simp
Copy link
Copy Markdown
Contributor

@robin-carlier robin-carlier Dec 12, 2025

Choose a reason for hiding this comment

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

a few questions/suggestions for this one

  • This definition should be in an other file: I think CategoryTheory.Limits.Types.Yoneda is a good target (because it contains the similar construction I link below).
  • This is essentially (a variation on) the LocallySmall + shrinkYoneda version of the existing CategoryTheory.Limits.compCoyonedaSectionsEquiv, so the docstring should at least reference this? (Though it is not the exact same construction).
  • To mimic the pattern from CategoryTheory.Limits.compCoyonedaSectionsEquiv, perhaps this should instead first be stated as an equivalence with natural transformations from the constant functor (dropping c' from the parameters) to a composition with shrinkYoneda, and then maybe for the result in this file you can work with composing this with an equivalence between morphisms out of c'.pt and natural transformations out of a constant functor in that case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, but I do not see any relation with compCoyonedaSectionsEquiv. As IsColimit appears in all the definitions, I do not think it would make sense to break the cocone c' into two variables.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, but can you still move that part (say up to l. 83) to the file CategoryTheory.Limits.Types.Yoneda (or a new file under CategoryTheory/Limits/Types if there are import increase issues)? It has pretty low discoverability within ObjectProperty/.

@robin-carlier robin-carlier added the awaiting-author A reviewer has asked the author a question or requested changes. label Dec 12, 2025
joelriou and others added 2 commits December 12, 2025 11:03
@joelriou joelriou changed the title feat(CategoryTheory): presheaves of types which preserves a limit feat(CategoryTheory): presheaves of types which preserve a limit Dec 29, 2025
@joelriou joelriou removed the awaiting-author A reviewer has asked the author a question or requested changes. label Dec 30, 2025
Copy link
Copy Markdown
Contributor

@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.

I still have a nitpick about the location of the result relating sections and morphisms from the cocone point, but otherwise LGTM.

Comment on lines +47 to +65
noncomputable def coconeCompShrinkYonedaHomEquiv :
(c'.pt ⟶ P) ≃ (F ⋙ P).sections where
toFun f :=
{ val j := shrinkYonedaEquiv (c'.ι.app (op j) ≫ f)
property {X X'} g := by
have h₁ := c'.w g.op
dsimp at h₁ ⊢
rw [← h₁, Category.assoc]
conv_rhs => rw [shrinkYonedaEquiv_comp]
rw [shrinkYonedaEquiv_shrinkYoneda_map]
apply map_shrinkYonedaEquiv }
invFun s := hc'.desc (Cocone.mk _
{ app j := shrinkYonedaEquiv.symm (s.val j.unop)
naturality j₁ j₂ f := by
rw [← s.property f.unop]
dsimp
rw [shrinkYonedaEquiv_symm_map, Category.comp_id] })
left_inv f := hc'.hom_ext (by simp)
right_inv u := by ext; simp
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, but can you still move that part (say up to l. 83) to the file CategoryTheory.Limits.Types.Yoneda (or a new file under CategoryTheory/Limits/Types if there are import increase issues)? It has pretty low discoverability within ObjectProperty/.

@robin-carlier robin-carlier added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 2, 2026
@mathlib-merge-conflicts mathlib-merge-conflicts bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 18, 2026
@mathlib-merge-conflicts
Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 19, 2026
@joelriou joelriou added the WIP Work in progress label Apr 19, 2026
@mathlib-dependent-issues mathlib-dependent-issues bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 19, 2026
@mathlib-dependent-issues
Copy link
Copy Markdown

This PR/issue depends on:

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

Labels

awaiting-author A reviewer has asked the author a question or requested changes. blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) t-category-theory Category theory WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants