Skip to content
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

biproducts, additive and abelian categories #1929

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

Alizter
Copy link
Collaborator

@Alizter Alizter commented Apr 25, 2024

Here is a definition of biproducts, semiadditive categories and additive categories. We show that semiadditive categories have a commutative monoid structure on their hom and additive categories have an abelian group structure.

We also show that the group of endormorphisms forms a ring with composition.

Kernels, cokernels and abelian categories are also defined.

I will probably split this PR further into smaller parts once the main theory has been settled. I'll keep it here for a global overview.

TODO

  • clean up associativity proof
  • left modules are additive
  • left modules are abelian (over a commutative ring!)
  • AbGroup is additive
  • AbGroup is abelian
  • quotients in abelian categories
  • epi-mono factorization in abelian categories
  • speed up slow build
  • work out how to make op of additive category additive without funext
  • Fix unification issue in 8.18
  • finish opposite additive cat proof (inverse law is tricky)

5 years ago I was apparently interested in doing this:

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter changed the title biproducts, semiadditive and additive categories biproducts, additive and abelian categories Apr 27, 2024
@Alizter

This comment was marked as resolved.

This was referenced Apr 27, 2024
Copy link
Collaborator

@jdchristensen jdchristensen left a comment

Choose a reason for hiding this comment

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

I've only read partway, and will read more later.

theories/WildCat/Coproducts.v Outdated Show resolved Hide resolved
theories/Algebra/Homological/Biproducts.v Outdated Show resolved Hide resolved
theories/Algebra/Homological/Biproducts.v Show resolved Hide resolved
@jdchristensen
Copy link
Collaborator

I pushed a slight cleanup to using decidability. I'm guessing the lemmas/tactics I added can be used elsewhere. But if you think they don't help, feel free to revert.

@Alizter
Copy link
Collaborator Author

Alizter commented Apr 27, 2024

@jdchristensen They look helpful, thanks!

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@jdchristensen
Copy link
Collaborator

Did you replace apply with nrapply to speed things up? I've noticed this occasionally before, and I don't know why it happens.

@Alizter
Copy link
Collaborator Author

Alizter commented Apr 29, 2024

@jdchristensen I think apply is wasting time trying all sorts of first-order heuristics which are not fast when there are typeclass searches to be done.

@Alizter
Copy link
Collaborator Author

Alizter commented Apr 29, 2024

@jdchristensen FTR, I will push some changes here shortly. I am working on smart constructors for biproducts and showing that AbGroup has them.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter mentioned this pull request May 2, 2024
@Alizter Alizter mentioned this pull request May 5, 2024
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter
Copy link
Collaborator Author

Alizter commented May 25, 2024

One of my merges accidentally introduced some WIP changes so the build fails. I will fix the build accordingly soon enough.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter
Copy link
Collaborator Author

Alizter commented May 26, 2024

I've fixed the build errors and tried to make progress on the cocommutative comonoids giving commutative monoid structures on the homs. Unfortunately, this doesn't follow formally from what I can tell so I had to reprove the argument like I did for commutative monoids giving commutative monoids. Once this is done, I have trouble using it since the is1bifunctor instance for cat_binbiprod and cat_bincoprod are different.

One way to fix this is to redefine biproduct so that the coproduct structure is something that can be proved rather than part of the data. I don't know if this will really work, but I am getting quite stuck with this approach, however I'll continue to experiment when I have more time.

@jdchristensen
Copy link
Collaborator

I've [...] tried to make progress on the cocommutative comonoids giving commutative monoid structures on the homs. Unfortunately, this doesn't follow formally

It should be formal. If X is a cocommutative comonoid in a wild category C, then you should be able to prove easily (or, if you are lucky, it might be definitionally true) that X is a commutative monoid in C^op. From that it follows that Hom in C^op from any Y to X is a commutative monoid. But that Hom type is definitionally equal to Hom in C from X to Y, so we have a commutative monoid structure here as well.

I haven't looked at the code you pushed, so I don't know how this compares to what have done, but the point is that the argument factors into two parts, and the second part is definitional, and doesn't require that you check the commutative monoid axioms again.

@Alizter
Copy link
Collaborator Author

Alizter commented May 27, 2024

As you said, it should be possible to prove that the double opposite monoid structure is the original structure, however this does not appear to be the case definitionally hence why I struggled earlier. One possible way to fix this is to fix natural transformations (and equivlaences) to become definitionally involutive as highlighted in #1961. This would allow the associator and unitors to be definitionally involutive. (For the full monoidal structure it seems we would need two pentagons and two traingles) however I don't see any use for that yet)
.

@jdchristensen
Copy link
Collaborator

Even if it is not definitional that a comonoid in C is a monoid in C^op, I still suspect that going via this statement might be a better way to prove that hom from a comonoid is a monoid. First, this statement only involves one object, not two, and shouldn't need any extensionality, so it should have less bureaucracy. Second, it's a useful statement to know independently of this application . Third, once you have this statement, the monoid structure on the hom will be immediate.

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 3, 2024

@jdchristensen Do you think it would be a good idea to split off the part on biproducts into a separate PR so that it can be reviewed and merged separately? It mostly mirrors what we have for Products and Coproducts and can be modified later when we wish to make progress on semiadditive categories.

@jdchristensen
Copy link
Collaborator

@Alizter At this point, I don't remember the status of everything in this PR. Skimming the above, I see lots of discussions that haven't been marked as resolved, so it seems like there might still be a lot to do for the whole PR. But smaller pieces that are ready to merge would be easier to review.

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 4, 2024

@jdchristensen Yes, there are a lot of points and I've lost track of most of them at this point.

My plan for making progress is to isolate the part about biproducts and afterwards we can try to tackle the definition of additivity together with the abgroup homs. I've tried a few times to formalize the argument about cocommutative comonoids but I am always running into difficulties which means I am probably doing something wrong. As this PR is too big for its own good, it would be good to investigate these in its own separate PR.

This was referenced Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants