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

[Merged by Bors] - feat(category/limits/shapes): fix biproducts #3175

Closed
wants to merge 3 commits into from

Conversation

semorrison
Copy link
Collaborator

This is a second attempt at #3102.

Previously the definition of a (binary) biproduct in a category with zero morphisms (but not necessarily) preadditive was just wrong.

The definition for a "bicone" was just something that was simultaneously a cone and a cocone, with the same cone points. It was a "biproduct bicone" if the cone was a limit cone and the cocone was a colimit cocone. However, this definition was not particularly useful. In particular, there was no way to prove that the two different map constructions providing a morphism W ⊞ X ⟶ Y ⊞ Z (i.e. by treating the biproducts either as cones, or as cocones) were actually equal. Blech.

So, I've added the axioms inl ≫ fst = 𝟙 P, inl ≫ snd = 0, inr ≫ fst = 0, and inr ≫ snd = 𝟙 Q to bicone P Q. (Note these only require the exist of zero morphisms, not preadditivity.)

Now the two map constructions are equal.

I've then entirely removed the has_preadditive_biproduct typeclass. Instead we have

  1. additional theorems providing total, when preadditive C is available
  2. alternative constructors for has_biproduct that use total rather than is_limit and is_colimit.

This PR also introduces some abbreviations along the lines of abbreviation has_binary_product (X Y : C) := has_limit (pair X Y), just to improve readability.


@semorrison semorrison added the awaiting-review The author would like community review of the PR label Jun 26, 2020
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.

This looks good to me. But the proof of the pudding is in the eating...
Let's give it a try!

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jun 29, 2020
@bryangingechen
Copy link
Collaborator

don't mind me, just combining some batches...
bors r-

@bors
Copy link

bors bot commented Jun 29, 2020

Canceled.

@bryangingechen
Copy link
Collaborator

bors r+

bors bot pushed a commit that referenced this pull request Jun 29, 2020
This is a second attempt at #3102.

Previously the definition of a (binary) biproduct in a category with zero morphisms (but not necessarily) preadditive was just wrong.

The definition for a "bicone" was just something that was simultaneously a cone and a cocone, with the same cone points. It was a "biproduct bicone" if the cone was a limit cone and the cocone was a colimit cocone. However, this definition was not particularly useful. In particular, there was no way to prove that the two different `map` constructions providing a morphism `W ⊞ X ⟶ Y ⊞ Z` (i.e. by treating the biproducts either as cones, or as cocones) were actually equal. Blech.

So, I've added the axioms `inl ≫ fst = 𝟙 P`, `inl ≫ snd = 0`, `inr ≫ fst = 0`, and `inr ≫ snd = 𝟙 Q` to `bicone P Q`. (Note these only require the exist of zero morphisms, not preadditivity.)

Now the two map constructions are equal.

I've then entirely removed the `has_preadditive_biproduct` typeclass. Instead we have
1. additional theorems providing `total`, when `preadditive C` is available
2. alternative constructors for `has_biproduct` that use `total` rather than `is_limit` and `is_colimit`.

This PR also introduces some abbreviations along the lines of `abbreviation has_binary_product (X Y : C) := has_limit (pair X Y)`, just to improve readability.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@robertylewis
Copy link
Member

bors is having trouble

bors r-

@robertylewis
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jun 29, 2020
This is a second attempt at #3102.

Previously the definition of a (binary) biproduct in a category with zero morphisms (but not necessarily) preadditive was just wrong.

The definition for a "bicone" was just something that was simultaneously a cone and a cocone, with the same cone points. It was a "biproduct bicone" if the cone was a limit cone and the cocone was a colimit cocone. However, this definition was not particularly useful. In particular, there was no way to prove that the two different `map` constructions providing a morphism `W ⊞ X ⟶ Y ⊞ Z` (i.e. by treating the biproducts either as cones, or as cocones) were actually equal. Blech.

So, I've added the axioms `inl ≫ fst = 𝟙 P`, `inl ≫ snd = 0`, `inr ≫ fst = 0`, and `inr ≫ snd = 𝟙 Q` to `bicone P Q`. (Note these only require the exist of zero morphisms, not preadditivity.)

Now the two map constructions are equal.

I've then entirely removed the `has_preadditive_biproduct` typeclass. Instead we have
1. additional theorems providing `total`, when `preadditive C` is available
2. alternative constructors for `has_biproduct` that use `total` rather than `is_limit` and `is_colimit`.

This PR also introduces some abbreviations along the lines of `abbreviation has_binary_product (X Y : C) := has_limit (pair X Y)`, just to improve readability.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@bors
Copy link

bors bot commented Jun 29, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(category/limits/shapes): fix biproducts [Merged by Bors] - feat(category/limits/shapes): fix biproducts Jun 29, 2020
@bors bors bot closed this Jun 29, 2020
@bors bors bot deleted the fix_biproducts2 branch June 29, 2020 15:01
cipher1024 pushed a commit to cipher1024/mathlib that referenced this pull request Mar 15, 2022
This is a second attempt at leanprover-community#3102.

Previously the definition of a (binary) biproduct in a category with zero morphisms (but not necessarily) preadditive was just wrong.

The definition for a "bicone" was just something that was simultaneously a cone and a cocone, with the same cone points. It was a "biproduct bicone" if the cone was a limit cone and the cocone was a colimit cocone. However, this definition was not particularly useful. In particular, there was no way to prove that the two different `map` constructions providing a morphism `W ⊞ X ⟶ Y ⊞ Z` (i.e. by treating the biproducts either as cones, or as cocones) were actually equal. Blech.

So, I've added the axioms `inl ≫ fst = 𝟙 P`, `inl ≫ snd = 0`, `inr ≫ fst = 0`, and `inr ≫ snd = 𝟙 Q` to `bicone P Q`. (Note these only require the exist of zero morphisms, not preadditivity.)

Now the two map constructions are equal.

I've then entirely removed the `has_preadditive_biproduct` typeclass. Instead we have
1. additional theorems providing `total`, when `preadditive C` is available
2. alternative constructors for `has_biproduct` that use `total` rather than `is_limit` and `is_colimit`.

This PR also introduces some abbreviations along the lines of `abbreviation has_binary_product (X Y : C) := has_limit (pair X Y)`, just to improve readability.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants