Skip to content

Conversation

@CharlesCNorton
Copy link
Contributor

@CharlesCNorton CharlesCNorton commented Aug 2, 2025

Extracting AdditiveCategories.v from stable categories formalization (#2288).

Provides:

  • AdditiveCategory: Categories with zero objects, biproducts, and abelian group structure on hom-sets
  • Helper functions for accessing biproduct components
  • Universal property operations with uniqueness (both product and coproduct)
  • AdditiveFunctor: Preserves zero objects, biproducts, and morphism addition (new preserves_addition field)
  • Main theorem: additive_functor_preserves_zero_morphisms
  • Identity and composition of additive functors (updated to handle preserves_addition)

Changes from original:

  • Fixed imports (removed non-existent ZeroMorphismLemmas.v)
  • Changed to Class with implicit ZeroObject instance
  • Added complete abelian group structure on hom-sets:
    • add_morphism operation with commutativity, associativity
    • Zero morphism as identity, existence of inverses
    • Bilinearity of composition (distributivity)
  • Removed 8 unused wrapper lemmas (e.g., add_beta_l, add_mixed_r)
  • Added add_prod_unique for product/coproduct duality
  • Updated transport lemma names (transport_compose_both_inversetransport_compose_middle)
  • Applied HoTT style conventions

Depends on: #2293 (ZeroObjects), #2300 (Biproducts)

@jdchristensen The main new addition (no pun intended) is the abelian group structure on hom-sets, which makes this a proper additive category (not just a category with zero objects and biproducts). Also I have probably overlooked a few things. Will be looking over again, but wanted to get the PR submitted.

CharlesCNorton and others added 3 commits August 2, 2025 06:32
Extracting AdditiveCategories.v from stable categories formalization (HoTT#2288).

**Provides:**
- `AdditiveCategory`: Categories with zero objects, biproducts, and abelian group structure on hom-sets
- Helper functions for accessing biproduct components  
- Universal property operations with uniqueness (both product and coproduct)
- `AdditiveFunctor`: Preserves zero objects, biproducts, and morphism addition
- Main theorem: `additive_functor_preserves_zero_morphisms`
- Identity and composition of additive functors

**Changes from original:**
- Fixed imports (removed non-existent ZeroMorphismLemmas.v)
- Changed to `Class` with implicit `ZeroObject` instance
- Added complete abelian group structure on hom-sets:
  - `add_morphism` operation with commutativity, associativity
  - Zero morphism as identity, existence of inverses
  - Bilinearity of composition (distributivity)
- Removed 8 unused wrapper lemmas (e.g., `add_beta_l`, `add_mixed_r`)
- Added `add_prod_unique` for product/coproduct duality
- Updated transport lemma names to match Core.v
- Applied HoTT style conventions

Depends on: HoTT#2293 (ZeroObjects), HoTT#2300 (Biproducts)

@jdchristensen The main new addition (no pun intended) is the abelian group structure on hom-sets, which makes this a proper additive category (not just a category with zero objects and biproducts). Also I have probably overlooked a few things. Will be looking over again, but wanted to get the PR submitted.
- Add addition_via_biproduct_axiom to AdditiveCategory class
- Add new AdditionViaBiproducts section with:
  - diagonal: X → X⊕X 
  - codiagonal: X⊕X → X
  - biproduct_mor: general biproduct morphism (f⊕g)
  - addition_via_biproducts theorem
- Shows our abstract add_morphism equals the standard 
  definition ∇∘(f⊕g)∘Δ from category theory
@jdchristensen
Copy link
Collaborator

Thanks @CharlesCNorton ! I just pushed a commit that shows that add_zero_morphism isn't needed. I suspect that many of your other wrappers can probably be avoided (maybe with the addition of some appropriate instances).

Comment on lines +18 to +21
Class AdditiveCategory := {
cat : PreCategory;
add_zero :: ZeroObject cat;
add_biproduct : forall (X Y : object cat), Biproduct X Y;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused by this class. The three fields above are already enough to show that cat has a unique enrichment over commutative monoids. That means that eight of the remaining nine fields are redundant. You only need to assume that inverses exist.

Here's an idea: Have a file, maybe called "SemiAdditive.v", which has a class with just the above three fields. In that file, prove that in every SemiAdditive category, the hom sets are commutative monoids in a way compatible with composition. It's probably best to use IsCommutativeMonoid from Classes/interfaces/abstract_algebra.v, which should then give you access to lots of lemmas (and notations) that hold for commutative monoids. Then, in Additive.v, you add the axiom that the commutative monoid structure defined in SemiAdditive.v has inverses. Then you can in fact say that the hom sets are abelian groups, using Algebra/AbGroups/AbelianGroup.v.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm confused by this class. The three fields above are already enough to show that cat has a unique enrichment over commutative monoids. That means that eight of the remaining nine fields are redundant. You only need to assume that inverses exist.

Here's an idea: Have a file, maybe called "SemiAdditive.v", which has a class with just the above three fields. In that file, prove that in every SemiAdditive category, the hom sets are commutative monoids in a way compatible with composition. It's probably best to use IsCommutativeMonoid from Classes/interfaces/abstract_algebra.v, which should then give you access to lots of lemmas (and notations) that hold for commutative monoids. Then, in Additive.v, you add the axiom that the commutative monoid structure defined in SemiAdditive.v has inverses. Then you can in fact say that the hom sets are abelian groups, using Algebra/AbGroups/AbelianGroup.v.

Just checking in - working on this, but it's taking some sweat. Will put a PR in soon.

CharlesCNorton added a commit to CharlesCNorton/Coq-HoTT that referenced this pull request Aug 10, 2025
Extracting SemiAdditive.v from additive categories work per PR HoTT#2304 review.

**Provides:**
- `SemiAdditiveCategory`: Class with just cat, zero object, and biproducts
- Derives `IsCommutativeMonoid` structure on morphisms using biproducts
- Addition defined as: f + g = ∇ ∘ (f ⊕ g) ∘ Δ  
- Proves identity laws, commutativity, associativity from biproduct axioms
- Bilinearity of composition (distributivity)

**Note:** The file is almost 1000 lines), especially the associativity proof. This was the only way I could get it to work - would very much appreciate help simplifying and identifying which helper lemmas can be removed. The associativity proof in particular requires many intermediate lemmas about how biproducts interact. It took me an entire week of 16 hour days to get here, but I assume there is a much more elegant method.

Addresses review feedback from HoTT#2304. Next step is to update AdditiveCategories.v to build on this, adding only the inverse axiom.
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.

2 participants