Skip to content

[Merged by Bors] - feat(CategoryTheory/ObjectProperty): stability unfer finite products#34366

Closed
joelriou wants to merge 4 commits intoleanprover-community:masterfrom
joelriou:spectral-sequences-3-object-property-finite-products
Closed

[Merged by Bors] - feat(CategoryTheory/ObjectProperty): stability unfer finite products#34366
joelriou wants to merge 4 commits intoleanprover-community:masterfrom
joelriou:spectral-sequences-3-object-property-finite-products

Conversation

@joelriou
Copy link
Copy Markdown
Contributor

We introduce typeclasses IsClosedUnderBinaryProducts and IsClosedUnderFiniteProducts expressing that P : ObjectProperty C is closed under binary products or finite products.


Open in Gitpod

@joelriou joelriou added the t-category-theory Category theory label Jan 24, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 24, 2026

PR summary 62a82d6d0a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.CategoryTheory.ObjectProperty.FiniteProducts (new file) 618

Declarations diff

+ IsClosedUnderBinaryProducts
+ IsClosedUnderBinaryProducts.closedUnderIsomorphisms
+ IsClosedUnderFiniteProducts
+ IsClosedUnderFiniteProducts.mk'
+ instance [P.ContainsZero] [P.IsClosedUnderIsomorphisms] :
+ instance [P.IsClosedUnderFiniteProducts] (J : Type*) [Finite J] :
+ isClosedUnderColimitsOfShape_of_preservesColimitsOfShape_ι
+ isClosedUnderLimitsOfShape_of_preservesLimitsOfShape_ι
+ prop_of_isTerminal
+ prop_prod

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

Comment on lines +75 to +101
suffices ∀ (J : Type) [Finite J], P.IsClosedUnderLimitsOfShape (Discrete J) from ⟨this⟩
intro J _
induction J using Finite.induction_empty_option with
| of_equiv e =>
exact IsClosedUnderLimitsOfShape.of_equivalence (Discrete.equivalence e)
| h_empty => infer_instance
| h_option =>
constructor
rintro X ⟨p⟩
have hc : IsLimit
(BinaryFan.mk (Pi.lift (fun j ↦ p.π.app (.mk (some j)))) (p.π.app (.mk none))) :=
BinaryFan.IsLimit.mk _
(fun f₁ f₂ ↦ p.isLimit.lift (Cone.mk _ (Discrete.natTrans (fun ⟨j⟩ ↦ by
induction j with
| some j => exact f₁ ≫ Pi.π _ j
| none => exact f₂))))
(fun _ _ ↦ by dsimp; ext; simp [p.isLimit.fac])
(fun _ _ ↦ by simp [p.isLimit.fac])
(fun f₁ f₂ l hl₁ hl₂ ↦ by
refine p.isLimit.hom_ext (fun ⟨j⟩ ↦ ?_)
induction j with
| some j => simp [p.isLimit.fac, ← hl₁]
| none => simpa [p.isLimit.fac])
refine P.prop_of_isLimit hc ?_
rintro ⟨_ | _⟩
· exact P.prop_limit _ (fun _ ↦ p.prop_diag_obj _)
· exact p.prop_diag_obj _
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.

This seems overly complicated, I assume we already have API saying that P.IsClosedUnderLimitsOfShape J if and only if the inclusion functor from the full subcategory corresponding to P preserves limits of shape J. And we already have CategoryTheory.Limits.PreservesFiniteProducts.of_preserves_binary_and_terminal which could then be used here

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! I have added the suitable API to make this work. There was an additional intricacy which is that I had to prove that the property of objects was stable under isomorphisms by using the terminal object and binary products https://github.com/joelriou/mathlib4/blob/48fcdc03eda8511de3b025bfb1e033b95609eaed/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean#L47

@dagurtomas dagurtomas added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 29, 2026
@joelriou joelriou removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 29, 2026
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.

Thanks!

maintainer merge

@github-actions
Copy link
Copy Markdown

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

@ghost ghost added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jan 30, 2026
Copy link
Copy Markdown
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

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Jan 30, 2026
mathlib-bors bot pushed a commit that referenced this pull request Jan 30, 2026
…34366)

We introduce typeclasses `IsClosedUnderBinaryProducts` and `IsClosedUnderFiniteProducts` expressing that `P : ObjectProperty C` is closed under binary products or finite products.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 30, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(CategoryTheory/ObjectProperty): stability unfer finite products [Merged by Bors] - feat(CategoryTheory/ObjectProperty): stability unfer finite products Jan 30, 2026
@mathlib-bors mathlib-bors bot closed this Jan 30, 2026
YellPika pushed a commit to YellPika/mathlib4 that referenced this pull request Feb 3, 2026
…eanprover-community#34366)

We introduce typeclasses `IsClosedUnderBinaryProducts` and `IsClosedUnderFiniteProducts` expressing that `P : ObjectProperty C` is closed under binary products or finite products.
michaellee94 pushed a commit to michaellee94/mathlib4 that referenced this pull request Feb 15, 2026
…eanprover-community#34366)

We introduce typeclasses `IsClosedUnderBinaryProducts` and `IsClosedUnderFiniteProducts` expressing that `P : ObjectProperty C` is closed under binary products or finite products.
Maldooor pushed a commit to Maldooor/mathlib4 that referenced this pull request Feb 25, 2026
…eanprover-community#34366)

We introduce typeclasses `IsClosedUnderBinaryProducts` and `IsClosedUnderFiniteProducts` expressing that `P : ObjectProperty C` is closed under binary products or finite products.
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…eanprover-community#34366)

We introduce typeclasses `IsClosedUnderBinaryProducts` and `IsClosedUnderFiniteProducts` expressing that `P : ObjectProperty C` is closed under binary products or finite products.
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.

4 participants