Product

Before introducing the product

Product in CT is somewhat related to products from arithmetic. So, in arithmetic, e.g. 6 = 2 3, means that 2 and 3 are factors of 6, either 2 or 3 factorizes 6. Similarly, in 6 = x 3 and with x restricted to β„• domain, there may be a nat that factorizes 6, or there may not be. If it exists, then it must satisfy the given equation.

If we know that a category C has a product object, P, then we know there will be two crucial arrows, both emerging from the product object but each going to some other, distinct, object, f: P -> A and g: P -> B in the category.

So, in the entire category, which may have a gazillion objects and arrows, we are looking for a pattern involving 3 objects and 2 arrows; such that two arrows emerge from the same object, P, and then one arrow goes to an object A and the other arrows goes to an object B (and all 3 objects are distinct).

         P'
         o
        /↑\
       / | \
      /  |  \
   f'/   |   \g'
    /    |    \
   /     |     \
  /      |      \
 ↙   f   |   g   β†˜
o <----- o -----> o
A        P        B

Products

The concepts of product corresponds to Cartesian products.

(Definition) A product of objects a and b in a category π’ž consists of a product object a Γ— b, and projection morphisms π₁ ∢ a Γ— b β†’ a and Ο€β‚‚ ∢ a Γ— b β†’ b, such that, for all objects c, and morphisms f ∢ c β†’ a and g ∢ c β†’ b, there is a unique morphism ⟨f, g⟩ ∢ c β†’ a Γ— b such that π₁ ∘ ⟨f, g⟩ = f and Ο€β‚‚ ∘ ⟨f, g⟩ = g.

In Hask, tuples are products and the two projection functions are fst and snd:

data (,) a b = (,) a b

fst :: (a,b) -> a
fst (a,b) = a

snd :: (a,b) -> b
snd (a,b) = b

fork :: (c -> a) -> (c -> b) -> c -> (a, b)
fork f g z = (f z, g z)

The fork function is required to show that tuples are indeed products.

In Set, the product of two sets 𝐴 and 𝐡 consists of the Cartesian product 𝐴 Γ— 𝐡 = {(π‘₯, 𝑦) ∣ π‘₯ ∈ 𝐴 and 𝑦 ∈ 𝐡} and two projection functions π₁ ∢ 𝐴 Γ— 𝐡 β†’ 𝐴 and Ο€β‚‚ ∢ 𝐴 Γ— 𝐡 β†’ 𝐡 such that, for all (π‘₯, 𝑦) ∈ 𝐴 Γ— 𝐡, π₁(π‘₯, 𝑦) = π‘₯ and Ο€β‚‚(π‘₯, 𝑦) = 𝑦.

Given a set 𝐢, and two functions 𝑓 ∢ 𝐢 β†’ 𝐴 and 𝑔 ∢ 𝐢 β†’ 𝐡, there is a unique function βŸ¨π‘“, π‘”βŸ© ∢ 𝐢 β†’ 𝐴 Γ— 𝐡 defined by βŸ¨π‘“, π‘”βŸ©(𝑧) = (𝑓(𝑧), 𝑔(𝑧)) for all 𝑧 ∈ 𝐢.

Last updated