module Cat.Abelian.Limits {o β„“} {C : Precategory o β„“} where

LimitsπŸ”—

Recall that every pre-abelian category admits kernels and cokernels, and is also additive, so it additionally has products and coproducts1. It sounds like we’re missing some finite limits (dually, missing some finite colimits), but it turns out that this is enough: We can construct the equaliser of as β€” whence the name difference kernel!

The calculation is straightforward: To map out of we must have but this is immediate assuming that β€” an assumption we have to map out of Similarly, to show that we calculate

module _ (A : is-pre-abelian C) where
  open is-pre-abelian A
  difference-kernel
    : βˆ€ {A B} {f g : Hom A B}
    β†’ is-equaliser C f g (Ker.kernel (f - g))
  difference-kernel {f = f} {g} = equ where
    open is-equaliser
    equ : is-equaliser C f g (Ker.kernel (f - g))
    equ .equal = zero-diff $
      (f ∘ Ker.kernel (f - g)) - (g ∘ Ker.kernel (f - g)) β‰‘βŸ¨ ∘-minus-l f g (Ker.kernel (f - g)) βŸ©β‰‘
      (f - g) ∘ Ker.kernel (f - g)                        β‰‘βŸ¨ Ker.equal (f - g) βŸ©β‰‘
      βˆ….zeroβ†’ ∘ Ker.kernel (f - g)                        β‰‘βŸ¨ βˆ….zero-∘r _ βˆ™ 0m-unique βŸ©β‰‘
      0m                                                  ∎
    equ .universal {e' = e'} p = Ker.universal (f - g) {e' = e'} $
      (f - g) ∘ e'         β‰‘Λ˜βŸ¨ ∘-minus-l _ _ _ βŸ©β‰‘Λ˜
      f ∘ e' - g ∘ e'      β‰‘βŸ¨ ap (f ∘ e' -_) (sym p) βŸ©β‰‘
      f ∘ e' - f ∘ e'      β‰‘βŸ¨ Hom.inverser βŸ©β‰‘
      0m                   β‰‘Λ˜βŸ¨ βˆ….zero-∘r _ βˆ™ 0m-unique βŸ©β‰‘Λ˜
      Zero.zeroβ†’ βˆ… ∘ e'    ∎
    equ .factors = Ker.factors _
    equ .unique = Ker.unique (f - g)

By a standard characterisation of finite limits in terms of finite products and binary equalisers, the construction of β€œdifference kernels” above implies that any pre-abelian category is finitely complete.

  finitely-complete : Finitely-complete C
  finitely-complete =
    with-equalisers C has-terminal has-prods Ξ» f g β†’
      record { has-is-eq = difference-kernel }

Finite biproductsπŸ”—

An interesting property of categories is the coincidence of finite products and finite coproducts: not only is there a map2 defined from the universal properties, but it is also an isomorphism. This is, at least to the author, mildly unexpected, but it follows from the properties of zero morphisms.

More generally, suppose that is a finite family of objects in an If has both a coproduct and a product in then we can define a map by giving a family of morphisms which amounts to defining a family of morphisms 3. Since is discrete, we can define this family to be when and everywhere else!

What we actually prove in this module is a slight variation: we directly construct, given a product the structure of a coproduct on . Uniqueness of coproducts then implies that, if some other exists, then it must be isomorphic to

The first thing we’ll prove is a compatibility condition between tupling and sums: A sum of tuples is a tuple of sums. In the binary case, we’re showing that is

  tuple-sum : βˆ€ {j} {R} (f : Fin j β†’ βˆ€ i β†’ A.Hom R (F i))
        β†’ ip.tuple (Ξ» i β†’ βˆ‘β‚• j (Ξ» j β†’ f j i))
        ≑ βˆ‘β‚• j Ξ» j β†’ ip.tuple (f j)
  tuple-sum {j} f = sym $ ip.unique _ Ξ» i β†’
    ip.Ο€ i A.∘ βˆ‘β‚• j (Ξ» i β†’ ip.tuple (f i))   β‰‘βŸ¨ βˆ‘-∘-left {j = j} _ βŸ©β‰‘
    βˆ‘β‚• j (Ξ» j β†’ ip.Ο€ i A.∘ ip.tuple (f j))   β‰‘βŸ¨ βˆ‘-path {j} _ (Ξ» j β†’ ip.commute) βŸ©β‰‘
    βˆ‘β‚• j (Ξ» j β†’ f j i)                       ∎

We then define our function which is the identity on the diagonal.

  private
    Ξ΄' : (i j : Fin I) β†’ Dec (i ≑ᡒ j) β†’ A.Hom (F i) (F j)
    Ξ΄' i j (yes reflα΅’) = A.id
    Ξ΄' i j (no x) = A.0m

    Ξ΄ : βˆ€ i j β†’ A.Hom (F i) (F j)
    Ξ΄ i j = Ξ΄' i j (i ≑ᡒ? j)

    Ξ΄α΅’β±Ό : βˆ€ i j β†’ Β¬ i ≑ j β†’ (d : Dec (i ≑ᡒ j)) β†’ Ξ΄' i j d ≑ A.0m
    Ξ΄α΅’β±Ό i j iβ‰ j (yes i=j) = absurd (iβ‰ j (Id≃path.to i=j))
    δᡒⱼ i j i≠j (no _)    = refl

We can now define a factoring of the identity on through a β€” hypothetical β€” A β€œsplitting” map which works by summing (over the tupling (over of and since tupling commutes with sums, we conclude that this is the tupling over of a bunch of tuples, zero on every component except for the one corresponding to their index in the sum. In the binary case, we’re showing that

  split = βˆ‘β‚• I Ξ» j β†’ ip.tuple Ξ» i β†’ Ξ΄ j i A.∘ ip.Ο€ j

  private
    split-remark : A.id ≑ split
    split-remark = ip.unique ip.Ο€ (Ξ» _ β†’ A.idr _) βˆ™ sym (ip.unique _ πΣδπ) where
      sum-Ξ΄-Ο€ : βˆ€ i β†’ βˆ‘ {I} _ (Ξ» j β†’ Ξ΄ j i A.∘ ip.Ο€ j) ≑ ip.Ο€ i
      sum-Ξ΄-Ο€ i = βˆ‘-diagonal-lemma (Abelianβ†’Group-on (A.Abelian-group-on-hom _ _)) {I} i _
        (A.eliml refl) λ j i≠j →
          apβ‚‚ A._∘_ (Ξ΄α΅’β±Ό j i (Ξ» e β†’ iβ‰ j (sym e)) (j ≑ᡒ? i)) refl βˆ™ A.∘-zero-l

      πΣδπ : βˆ€ i β†’ ip.Ο€ i A.∘ split ≑ ip.Ο€ i
      πΣδπ i =
        ip.Ο€ i A.∘ βˆ‘β‚• I (Ξ» i β†’ ip.tuple Ξ» j β†’ Ξ΄ i j A.∘ ip.Ο€ i) β‰‘βŸ¨ ap (ip.Ο€ i A.∘_) (sym (tuple-sum {I} _)) βŸ©β‰‘
        ip.Ο€ i A.∘ ip.tuple (Ξ» i β†’ βˆ‘β‚• I Ξ» j β†’ Ξ΄ j i A.∘ ip.Ο€ j) β‰‘βŸ¨ ip.commute βŸ©β‰‘
        βˆ‘β‚• I (Ξ» j β†’ Ξ΄ j i A.∘ ip.Ο€ j)                           β‰‘βŸ¨ sum-Ξ΄-Ο€ i βŸ©β‰‘
        ip.Ο€ i                                                  ∎

We can now use this split morphism to construct the coproduct structure on First, the i-th coprojection is a tuple where all but the coordinate are and is one. That is: it’s the tuple over of

  open Indexed-coproduct
  open is-indexed-coproduct
  coprod : Indexed-coproduct C F
  coprod .Ξ£F = ip.Ξ F
  coprod .ΞΉ i = ip.tuple (Ξ΄ i)

We now need to define the β€œmatch” function: Given a family how do we extend this to a (unique) map satisfying Well, one potential approach is define to be some kind of sum β€” let’s say it’s a sum over where is something we’ll define later. We can still calculate

so we have to choose such that is when and otherwise, so only the term contributes to the above sum. And we know that, composed with the projection is the identity function, and all others are β€” so if we define then we certainly have =

  coprod .has-is-ic = ico where
    m : βˆ€ {Y} β†’ (βˆ€ i β†’ A.Hom (F i) Y) β†’ A.Hom (ip .Indexed-product.Ξ F) Y
    m f = βˆ‘β‚• I Ξ» j β†’ f j A.∘ ip.Ο€ j

    ico : is-indexed-coproduct C F _
    ico .match f = m f
    ico .commute {i = i} {f = f} =
      m f A.∘ ip.tuple (Ξ΄ i)                           β‰‘βŸ¨ βˆ‘-∘-right {I} _ βŸ©β‰‘
      βˆ‘β‚• I (Ξ» j β†’ (f j A.∘ ip.Ο€ j) A.∘ ip.tuple (Ξ΄ i)) β‰‘βŸ¨ remark βŸ©β‰‘
      f i                                              ∎

And how do we show uniqueness? Using our remark about the split morphism defined above! It shows that any map has to factor through something that looks a lot like our definition of above, and if it also satisfies then a bit of massaging shows it is exactly

    ico .unique {h = h} f prf =
      h                                                    β‰‘βŸ¨ A.intror (sym split-remark) βŸ©β‰‘
      h A.∘ split                                          β‰‘βŸ¨ βˆ‘-∘-left {I} _ βŸ©β‰‘
      βˆ‘β‚• I (Ξ» i β†’ h A.∘ ip.tuple (Ξ» j β†’ Ξ΄ i j A.∘ ip.Ο€ i)) β‰‘βŸ¨ βˆ‘-path {I} _ (Ξ» i β†’ ap (h A.∘_) (sym (tuple∘ C F ip _))) βŸ©β‰‘
      βˆ‘β‚• I (Ξ» i β†’ h A.∘ ip.tuple (Ξ» j β†’ Ξ΄ i j) A.∘ ip.Ο€ i) β‰‘βŸ¨ βˆ‘-path {I} _ (Ξ» i β†’ A.pulll (prf i)) βŸ©β‰‘
      βˆ‘β‚• I (Ξ» i β†’ f i A.∘ ip.Ο€ i)                          β‰‘βŸ¨βŸ©
      m f                                                  ∎

  1. We’ll see in this very same module that they’re actually the same thing!β†©οΈŽ

  2. In the binary case.β†©οΈŽ

  3. Where both range over β†©οΈŽ