Skip to content

[Merged by Bors] - feat: category equivalence between coalgebras and comonoid objects - #11974

Closed
101damnations wants to merge 36 commits into
masterfrom
coalgmonequiv
Closed

101damnations wants to merge 36 commits into
masterfrom
coalgmonequiv

Conversation

@101damnations

@101damnations 101damnations commented Apr 7, 2024 •

Copy link
Copy Markdown
Contributor

Given a commutative ring R, this PR defines the equivalence of categories between R-coalgebras and comonoid objects in the category of R-modules. We then use this to set up boilerplate for the monoidal structure on R-coalgebras defined in #11975 and #11976.


Possibly everything after the equivalence of categories should be in a separate PR, but here's its explanation.
We make the definition CoalgebraCat.instMonoidalCategoryAux in this PR, which is the monoidal structure on CoalgebraCat induced by the equivalence with Comon(R-Mod), and we prove lemmas about this declaration which are essentially true by definition. But our actual 1. Coalgebra instance on a tensor product of coalgebras and 2. MonoidalCategory instance on CoalgebraCat are constructed in #11975 and #11976 respectively. We construct the instances to have simple data - i.e. the underlying linear maps are more obviously stuff from LinearAlgebra.TensorProduct.Basic. But to fill in the Prop fields in those PRs, we use CoalgebraCat.instMonoidalCategoryAux and the API in the second half of this PR.

I really don't know how necessary this roundabout approach is; I was just pleased to have got it working. The idea was to use category theory to get non-category theory API for free-ish, without performance issues or the category theory leaking through.

Open in Gitpod

@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 7, 2024
@ghost ghost 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 16, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 27, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label May 28, 2024
@101damnations 101damnations changed the title feat: category equivalence between coalgebras and monoid objects feat: category equivalence between coalgebras and comonoid objects May 29, 2024
@101damnations 101damnations added awaiting-review t-algebra Algebra (groups, rings, fields, etc) labels May 29, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 1, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jun 6, 2024
@101damnations
101damnations requested a review from kbuzzard June 7, 2024 13:51

@jcommelin jcommelin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

2 minor comments. Otherwise, LGTM

bors d+

set_option linter.uppercaseLean3 false in
#align Module.monoidal_category.braiding_inv_apply ModuleCat.MonoidalCategory.braiding_inv_apply

@[simp]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure if this should be a simp lemma by default. Because the RHS is quite a long expr.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With TensorProduct open, it's ↑(tensorTensorTensorComm R ↑A ↑B ↑C ↑D) : (↑A ⊗[R] ↑B) ⊗[R] ↑C ⊗[R] ↑D →ₗ[R] (↑A ⊗[R] ↑C) ⊗[R] ↑B ⊗[R] ↑D. I think that people like Eric like this kind of expression because ext fires very well on it. It looks simpler than the left hand side as well :-) However mathlib does build without the attribute so it's not being used yet...

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.

Thank you both for the reviews! I've removed the @[simp] on this lemma but added this

@[simp]
theorem tensor_μ_apply
    {A B C D : ModuleCat R} (x : A) (y : B) (z : C) (w : D) :
    tensor_μ _ (A, B) (C, D) ((x ⊗ₜ y) ⊗ₜ (z ⊗ₜ w)) = (x ⊗ₜ z) ⊗ₜ (y ⊗ₜ w) := rfl

as a simp lemma, more in line with other API for the monoidal structure on modules.

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Jul 5, 2024
@mathlib-bors

mathlib-bors Bot commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

✌️ 101damnations can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@kbuzzard kbuzzard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!


instance : MonoidalCategoryStruct (ModuleCat.{u} R) where
@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R) where

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's going on here, out of interest?

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.

It's like @[simps] except it doesn't tag the resulting lemmas with simp

set_option linter.uppercaseLean3 false in
#align Module.monoidal_category.braiding_inv_apply ModuleCat.MonoidalCategory.braiding_inv_apply

@[simp]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With TensorProduct open, it's ↑(tensorTensorTensorComm R ↑A ↑B ↑C ↑D) : (↑A ⊗[R] ↑B) ⊗[R] ↑C ⊗[R] ↑D →ₗ[R] (↑A ⊗[R] ↑C) ⊗[R] ↑B ⊗[R] ↑D. I think that people like Eric like this kind of expression because ext fires very well on it. It looks simpler than the left hand side as well :-) However mathlib does build without the attribute so it's not being used yet...

Comment thread Mathlib/RingTheory/Coalgebra/Basic.lean Resolved
@github-actions

github-actions Bot commented Jul 8, 2024 •

Copy link
Copy Markdown

PR summary 715478e721

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.RingTheory.Coalgebra.Basic 770 772 +2 (+0.26%)
Import changes for all files
Files Import difference
4 files Mathlib.RingTheory.Coalgebra.Basic Mathlib.RingTheory.Coalgebra.Hom Mathlib.Algebra.Category.CoalgebraCat.Basic Mathlib.RingTheory.Coalgebra.Equiv
2
Mathlib.Algebra.Category.CoalgebraCat.ComonEquivalence 913

Declarations diff

+ associator_hom_toLinearMap
+ comonEquivalence
+ comul_tensorObj
+ comul_tensorObj_tensorObj_left
+ comul_tensorObj_tensorObj_right
+ counit_tensorObj
+ counit_tensorObj_tensorObj_left
+ counit_tensorObj_tensorObj_right
+ instCoalgebraStruct
+ instMonoidalCategoryAux
+ instMonoidalCategoryStruct
+ leftUnitor_hom_toLinearMap
+ ofComon
+ ofComonObj
+ ofComonObjCoalgebraStruct
+ op_tensor_μ
+ rightUnitor_hom_toLinearMap
+ tensorHom_toLinearMap
+ tensorObj_comul
+ tensor_μ_apply
+ tensor_μ_eq_tensorTensorTensorComm
+ toComon
+ toComonObj
+ unop_tensor_μ
+ we
- instance : MonoidalCategoryStruct (ModuleCat.{u} R)

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>

@101damnations

Copy link
Copy Markdown
Contributor Author

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request Jul 16, 2024
…11974)

Given a commutative ring `R`, this PR defines the equivalence of categories between `R`-coalgebras and comonoid objects in the category of `R`-modules. We then use this to set up boilerplate for the monoidal structure on `R`-coalgebras defined in #11975 and #11976.



Co-authored-by: Eric Wieser <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Jul 16, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: category equivalence between coalgebras and comonoid objects [Merged by Bors] - feat: category equivalence between coalgebras and comonoid objects Jul 16, 2024
@mathlib-bors mathlib-bors Bot closed this Jul 16, 2024
@mathlib-bors
mathlib-bors Bot deleted the coalgmonequiv branch July 16, 2024 20:02
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants