# User:Michiexile/MATH198/Lecture 4

### From HaskellWiki

Michiexile (Talk | contribs) |
Michiexile (Talk | contribs) |

## Revision as of 21:12, 7 October 2009

IMPORTANT NOTE: THESE NOTES ARE STILL UNDER DEVELOPMENT. PLEASE WAIT UNTIL AFTER THE LECTURE WITH HANDING ANYTHING IN, OR TREATING THE NOTES AS READY TO READ.

### Product

Recall the construction of a *cartesian product*: for sets *S*,*T*, the set .

The cartesian product is one of the canonical ways to combine sets with each other. This is how we build binary operations, and higher ones - as well as how we formally define functions, partial functions and relations in the first place.

This, too, is how we construct vector spaces: recall that is built out of tuples of elements from , with pointwise operations. This constructions reoccurs all over the place - sets with structure almost always have the structure carry over to products by pointwise operations.

Given the cartesian product in sets, the important thing about the product is that we can extract both parts, and doing so preserves any structure present, since the structure is defined pointwise.

This is what we use to define what we want to mean by products in a categorical setting.

*Definition* Let *C* be a category. The *product* of two objects *A*,*B* is an object equipped with maps and such that any other object *V* with maps has a unique map such that both maps from *V* factor through the *p*_{1},*p*_{2}.

In the category of Set, the unique map from *V* to would be given by *q*(*v*) = (*q*_{1}(*v*),*q*_{2}(*v*)).

The uniqueness requirement is what, in the theoretical setting, forces the product to be what we expect it to be - pairing of elements with no additional changes, preserving as much of the structure as we possibly can make it preserve.

In the Haskell category, the product is simply the Pair type:

Product a b = (a,b)

*p*

_{1},

*p*

_{2}are just

* Cartesian product in Set

* Product of categories construction

* Record types

* Categorical formulation

** Universal X such that Y

===Coproduct===

* Diagram definition

* Disjoint union in Set

* Coproduct of categories construction

* Union types

===Limits and colimits===

* Generalizing these constructions

* Diagram and universal object mapping to (from) the diagram

* Express product/coproduct as limit/colimit

* Issues with Haskell

** No dependent types

** No compiler-enforced equational conditions

** Can be ''simulated'' but not enforced, e.g. using QuickCheck.

====Useful limits and colimits====

=====Equalizer, coequalizer=====

* Kernels, cokernels, images, coimages

** connect to linear algebra: null spaces et.c.

=====Pushout and pullback squares=====

* Computer science applications

* The power of dualization.

* Limits, colimits.

* Products, coproducts.

* Equalizers, coequalizers.