Lesson 2.22,002 words

Products and Coproducts

The product of two objects is a wedge of projections through which every other wedge factors uniquely; the coproduct is the dual, built from injections. In Set these are the cartesian product and the disjoint union, in a poset the meet and join, and in abelian groups the two coincide.

╌╌╌╌

The cartesian product of two sets carries two projections, and . Category theory defines the product from these projections and a universal property they satisfy, rather than from the ordered pairs. Stated arrow-theoretically, the definition transplants without change into groups, spaces, posets, and categories where ordered pair of elements means nothing, and it dualizes, producing the coproduct — a construction whose concrete instances (disjoint unions, free products, direct sums) look nothing alike until the common property is isolated.1

Wedges

Fix a category and a pair of objects . The auxiliary notion is a pair of arrows with a common vertex.

Simmons calls both a wedge; wedges to the pair are also called cones on , and wedges from the pair cocones.2 For a given pair there are typically many wedges on each side. The product is the wedge through which every other wedge to the pair factors, in exactly one way. That factorization condition is the universal property.

The product

The product's universal property: any wedge from to the pair factors through the projections by exactly one mediating arrow (dashed), with both triangles commuting.

Two points. First, the product is the object together with the projections; the same object with different arrows is a different product cone. Second, the mediator's uniqueness carries the definition, as the next lemma shows.

Rigidity and essential uniqueness

This is the round-trip uniqueness argument run inside the category of wedges to — in fact a product is nothing but a terminal object in that category of wedges, which is why the proof is the same. The reduction of every universal property to an initial or terminal object somewhere is completed by the comma-category construction.

Products in the standard categories

  • . The cartesian product with the usual projections. For a wedge , , the mediator must satisfy and , which forces both coordinates: . Existence and uniqueness in one line.4
  • , , , . The product set with componentwise operations. Two things need checking: the projections are homomorphisms, and the -mediator is a homomorphism whenever and are. Both are direct calculations; e.g. for semigroups .5
  • . The product set with the product topology — the coarsest topology making both projections continuous. Coarsest is forced: any finer topology keeps the projections continuous but breaks continuity of some mediator, and any coarser one breaks the projections. The universal property is why the product topology, not the box topology, is the right general definition.
  • . The product set with the componentwise order.
  • A poset as a category. A product of elements and is an element with , (the wedge) such that every below both and has (the mediator; uniqueness is automatic in a thin category). That is the meet : greatest lower bound. Categorical products generalize infima.6

Products can fail to exist. In the discrete two-object category with only identity arrows, no object has arrows to both and , so no wedge exists at all, let alone a universal one. A poset lacking meets (two incomparable elements with no common lower bound), or the category of fields, gives natural examples.7

Calculus of products

The mediator notation supports a small calculus, valid in any category with the relevant products:

  • Pairing. is the unique arrow with and .
  • Product of arrows. For and , , the arrow acting as on the first coordinate and on the second. This makes a functor.
  • Unit and associativity, up to isomorphism. If has a terminal object , then , and for any triple, . Each isomorphism is produced, uniquely, by pairing up the evident projections.8
  • Symmetry. via . The two cones have different bases (the ordered pairs and ), so they are different products of different diagrams that happen to have isomorphic vertices.

Indexed products generalize the binary case: for a family , a product is an object with projections through which every family of arrows factors by a unique mediator. Binary products are the case ; a terminal object is the case , a product of no objects, where the mediator condition degenerates to exactly one arrow from each .

The coproduct

Reverse every arrow in the definition of product. What results is a genuinely different construction, not a formal curiosity.

The coproduct's universal property, the mirror image of the product: arrows now leave the pair, enter the sum by the injections, and the unique mediator exits the sum.

Rigidity and essential uniqueness hold with the same proofs, arrows reversed; by the duality principle they need not be re-proved at all, since a coproduct in is a product in .

Coproducts in the standard categories

  • : disjoint union. Tag the elements to remember their origin and take the union:
    Given and , the mediator is case analysis — , — and no other function satisfies both triangle equations. Tagging matters: if and overlap, the plain union would identify shared elements and the mediator would be overdetermined.9
  • . The disjoint union of spaces, each part keeping its own topology, open sets being unions of an open set from each part.
  • A poset as a category. The join : least upper bound. In a power set ordered by , meet is intersection and join is union; in ordered by divisibility, meet is gcd and join is lcm.10
  • , . The direct sum — which as an object is the same as the product. The injections are and , and the mediator for is , using the addition on . Additivity of is essential, which is why the same trick fails in .
  • : the free product. The cartesian product with the coordinate embeddings is not a coproduct of nonabelian groups: images of the two embeddings commute elementwise in , but a wedge into need not have commuting images, so no mediator exists in general. The actual coproduct is the free product , built from reduced alternating words — a far larger group.11
  • . Similarly the free product of monoids; for commutative monoids the product object again serves.

In a poset the product and coproduct are the meet and join, and a small divisor lattice makes both concrete at once.

The divisor lattice of under divisibility. The meet (product) of and is their greatest common lower bound ; the join (coproduct) is their least common upper bound .

An object that is simultaneously a product and a coproduct (with compatible structure arrows) is a biproduct, and its presence is a defining trait of the additive categories of homological algebra. In the two constructions could hardly differ more: for finite sets,

which is also the mnemonic for the notation.

Product versus coproduct of finite sets: the product is a grid of pairs (one row per element of ; one column per element of ), the coproduct lays the two sets side by side with tags.

Comparison

CategoryCoincide?
cartesian producttagged disjoint unionno
product topologydisjoint union of spacesno
posetmeet join only when
, direct productdirect sumyes (biproduct)
direct productfree product no
product ringmore complex (not disjoint union)no

A distributivity caution: in , , but in a general category with products and coproducts only a canonical comparison arrow

exists, and it need not be an isomorphism (in it fails). Categories where it is invertible are called distributive, a property -like categories have and additive ones lack.12

Products and sums as data types

Barr and Wells give a computing reading of the two constructions.13 In a category of types and programs:

  • Products are record types. A record with fields , is an object with projections (field accessors) , and the universal property says a program computing a record is exactly a pair of programs computing its fields. Indexed products over an attribute set model database rows.
  • Sums are variant types. A tagged union () has injections (constructors), and the universal property is case analysis: a program out of is exactly one program handling each alternative — the mediator is the expression.
  • In logic, product is conjunction and sum is disjunction: a deduction system with conjunction satisfying the natural proof rules is a category with finite products, with as terminal object.

The pairing/case-analysis symmetry — construct into a product, eliminate out of a sum — is the categorical face of the introduction/elimination duality of natural deduction, and returns with cartesian closed categories.

General limits

Products answer a shape-question: given a discrete pair of objects, find the universal wedge. Replacing the pair by an arbitrary diagram — objects and arrows that mediating wedges must respect — yields the general limit, of which the product is the simplest nontrivial case (limit over a two-object discrete shape) and the terminal object the trivial one (limit over the empty shape). Two more small shapes, equalizers and pullbacks, complete a generating set: a category with binary products, equalizers, and a terminal object has all finite limits. The dual constructions run through colimits. The technique is the same throughout: apply the universal object to a competing wedge, take the unique factorization, and cancel round trips by rigidity.

Footnotes

  1. Simmons, An Introduction to Category Theory, §2.5 — products and coproducts developed in parallel left/right columns; the abelian-group motivation for the dual problem.
  2. Simmons, §2.5, Definition 2.5.1 — wedges to and from a pair; the cone/cocone terminology.
  3. Simmons, §2.5, Lemmas 2.5.3–2.5.4 — the endo-arrow rigidity lemma and essential uniqueness of products and coproducts.
  4. Leinster, Basic Category Theory, Example 5.1.3 — verification that the cartesian product is a categorical product, with the uniqueness computation.
  5. Barr & Wells, Category Theory for Computing Science, §5.1.7 — the semigroup product verified in full: projections are homomorphisms, and the induced mediator is one.
  6. Barr & Wells, §5.1.8 — products in a poset category are infima; a poset without infima is a category without products.
  7. Leinster, Remark 5.1.2(a) — nonexistence of products in the discrete two-object category; uniqueness up to isomorphism when they do exist.
  8. Simmons, §2.5, Exercise 2.5.7 — unit and associativity isomorphisms for binary products in a category with a terminal object.
  9. Simmons, §2.5 — the tagged disjoint union with its embeddings; Barr & Wells, §5.4.5 — sums in .
  10. Leinster, Example 5.2.6 — joins as binary sums in a poset; union in a power set, lcm under divisibility.
  11. Simmons, §2.5, Exercise 2.5.9 — the cartesian product implements both product and coproduct in but not the coproduct in ; Leinster, Example 5.2.4 — direct sums as sums in .
  12. Barr & Wells, §5.7 — distributive categories; the canonical arrow and when it is invertible; Simmons, §2.5, Exercise 2.5.8.
  13. Barr & Wells, §5.3.14 and §5.6 — indexed products as database attributes; deduction systems as categories, conjunction calculus with as terminal object and as product.

╌╌ END ╌╌