Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf ·...

Post on 24-Jun-2020

0 views 0 download

Transcript of Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf ·...

Categories, Proofs and Processes Lecture I

Samson Abramsky

Oxford University Computing Laboratory

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 1 / 27

About the Course

5 lectures

Lecture notes available on course web pages

Required background: discrete maths (sets, functions, relations, . . . )

The content is both mathematical and conceptual.

Plan of Course:

Lecture I: Basic notions of categories.

Lecture II: Functors, Adjoints and Logic.

Lecture III: Categories and Logic. Curry-Howard-Lambek correspondence.

Lecture IV: Linear logic and monoidal categories.

Lecture V: Further topics. Discussion of philosophical implications ofcategories.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 2 / 27

About the Course

5 lectures

Lecture notes available on course web pages

Required background: discrete maths (sets, functions, relations, . . . )

The content is both mathematical and conceptual.

Plan of Course:

Lecture I: Basic notions of categories.

Lecture II: Functors, Adjoints and Logic.

Lecture III: Categories and Logic. Curry-Howard-Lambek correspondence.

Lecture IV: Linear logic and monoidal categories.

Lecture V: Further topics. Discussion of philosophical implications ofcategories.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 2 / 27

About the Course

5 lectures

Lecture notes available on course web pages

Required background: discrete maths (sets, functions, relations, . . . )

The content is both mathematical and conceptual.

Plan of Course:

Lecture I: Basic notions of categories.

Lecture II: Functors, Adjoints and Logic.

Lecture III: Categories and Logic. Curry-Howard-Lambek correspondence.

Lecture IV: Linear logic and monoidal categories.

Lecture V: Further topics. Discussion of philosophical implications ofcategories.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 2 / 27

About the Course

5 lectures

Lecture notes available on course web pages

Required background: discrete maths (sets, functions, relations, . . . )

The content is both mathematical and conceptual.

Plan of Course:

Lecture I: Basic notions of categories.

Lecture II: Functors, Adjoints and Logic.

Lecture III: Categories and Logic. Curry-Howard-Lambek correspondence.

Lecture IV: Linear logic and monoidal categories.

Lecture V: Further topics. Discussion of philosophical implications ofcategories.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 2 / 27

About the Course

5 lectures

Lecture notes available on course web pages

Required background: discrete maths (sets, functions, relations, . . . )

The content is both mathematical and conceptual.

Plan of Course:

Lecture I: Basic notions of categories.

Lecture II: Functors, Adjoints and Logic.

Lecture III: Categories and Logic. Curry-Howard-Lambek correspondence.

Lecture IV: Linear logic and monoidal categories.

Lecture V: Further topics. Discussion of philosophical implications ofcategories.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 2 / 27

About the Course

5 lectures

Lecture notes available on course web pages

Required background: discrete maths (sets, functions, relations, . . . )

The content is both mathematical and conceptual.

Plan of Course:

Lecture I: Basic notions of categories.

Lecture II: Functors, Adjoints and Logic.

Lecture III: Categories and Logic. Curry-Howard-Lambek correspondence.

Lecture IV: Linear logic and monoidal categories.

Lecture V: Further topics. Discussion of philosophical implications ofcategories.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 2 / 27

Why Categories?

For logicians: gives a syntax-independent view of the fundamental structuresof logic, opens up new kinds of models and interpretations.

For philosophers: a fresh approach to structuralist foundations ofmathematics and science; an alternative to the traditional focus on settheory.

For computer scientists: gives a precise handle on abstraction,representation-independence, genericity and more. Gives the fundamentalmathematical structures underpinning programming concepts.

For mathematicians: organizes your previous mathematical experience in anew and powerful way, reveals new connections and structure, allows you to“think bigger thoughts”.

For physicists: new ways of formulating physical theories in a structuralform. Recent applications to Qauntum Information and Computation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 3 / 27

Why Categories?

For logicians: gives a syntax-independent view of the fundamental structuresof logic, opens up new kinds of models and interpretations.

For philosophers: a fresh approach to structuralist foundations ofmathematics and science; an alternative to the traditional focus on settheory.

For computer scientists: gives a precise handle on abstraction,representation-independence, genericity and more. Gives the fundamentalmathematical structures underpinning programming concepts.

For mathematicians: organizes your previous mathematical experience in anew and powerful way, reveals new connections and structure, allows you to“think bigger thoughts”.

For physicists: new ways of formulating physical theories in a structuralform. Recent applications to Qauntum Information and Computation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 3 / 27

Why Categories?

For logicians: gives a syntax-independent view of the fundamental structuresof logic, opens up new kinds of models and interpretations.

For philosophers: a fresh approach to structuralist foundations ofmathematics and science; an alternative to the traditional focus on settheory.

For computer scientists: gives a precise handle on abstraction,representation-independence, genericity and more. Gives the fundamentalmathematical structures underpinning programming concepts.

For mathematicians: organizes your previous mathematical experience in anew and powerful way, reveals new connections and structure, allows you to“think bigger thoughts”.

For physicists: new ways of formulating physical theories in a structuralform. Recent applications to Qauntum Information and Computation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 3 / 27

Why Categories?

For logicians: gives a syntax-independent view of the fundamental structuresof logic, opens up new kinds of models and interpretations.

For philosophers: a fresh approach to structuralist foundations ofmathematics and science; an alternative to the traditional focus on settheory.

For computer scientists: gives a precise handle on abstraction,representation-independence, genericity and more. Gives the fundamentalmathematical structures underpinning programming concepts.

For mathematicians: organizes your previous mathematical experience in anew and powerful way, reveals new connections and structure, allows you to“think bigger thoughts”.

For physicists: new ways of formulating physical theories in a structuralform. Recent applications to Qauntum Information and Computation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 3 / 27

Why Categories?

For logicians: gives a syntax-independent view of the fundamental structuresof logic, opens up new kinds of models and interpretations.

For philosophers: a fresh approach to structuralist foundations ofmathematics and science; an alternative to the traditional focus on settheory.

For computer scientists: gives a precise handle on abstraction,representation-independence, genericity and more. Gives the fundamentalmathematical structures underpinning programming concepts.

For mathematicians: organizes your previous mathematical experience in anew and powerful way, reveals new connections and structure, allows you to“think bigger thoughts”.

For physicists: new ways of formulating physical theories in a structuralform. Recent applications to Qauntum Information and Computation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 3 / 27

Why Categories?

For logicians: gives a syntax-independent view of the fundamental structuresof logic, opens up new kinds of models and interpretations.

For philosophers: a fresh approach to structuralist foundations ofmathematics and science; an alternative to the traditional focus on settheory.

For computer scientists: gives a precise handle on abstraction,representation-independence, genericity and more. Gives the fundamentalmathematical structures underpinning programming concepts.

For mathematicians: organizes your previous mathematical experience in anew and powerful way, reveals new connections and structure, allows you to“think bigger thoughts”.

For physicists: new ways of formulating physical theories in a structuralform. Recent applications to Qauntum Information and Computation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 3 / 27

Sets and Maps

Notation for maps (functions) between sets:

f : X −→ Y Diagrammatic notation: Xf−→ Y

X is the domain of f . Y is the codomain.

Notation for composition:

g ◦ f : X −→ Z or f ; g : X −→ Z or Xf−→ Y

g−→ Z

Identity map:1X : X −→ X

When are two functions f , g : X −→ Y equal?

f = g ⇐⇒ ∀x ∈ X . f (x) = g(x).

Axioms relating these operations:

(h ◦ g) ◦ f = h ◦ (g ◦ f ) 1X ◦ f = f = f ◦ 1Y .

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 4 / 27

Sets and MapsNotation for maps (functions) between sets:

f : X −→ Y Diagrammatic notation: Xf−→ Y

X is the domain of f . Y is the codomain.

Notation for composition:

g ◦ f : X −→ Z or f ; g : X −→ Z or Xf−→ Y

g−→ Z

Identity map:1X : X −→ X

When are two functions f , g : X −→ Y equal?

f = g ⇐⇒ ∀x ∈ X . f (x) = g(x).

Axioms relating these operations:

(h ◦ g) ◦ f = h ◦ (g ◦ f ) 1X ◦ f = f = f ◦ 1Y .

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 4 / 27

Sets and MapsNotation for maps (functions) between sets:

f : X −→ Y Diagrammatic notation: Xf−→ Y

X is the domain of f . Y is the codomain.

Notation for composition:

g ◦ f : X −→ Z or f ; g : X −→ Z or Xf−→ Y

g−→ Z

Identity map:1X : X −→ X

When are two functions f , g : X −→ Y equal?

f = g ⇐⇒ ∀x ∈ X . f (x) = g(x).

Axioms relating these operations:

(h ◦ g) ◦ f = h ◦ (g ◦ f ) 1X ◦ f = f = f ◦ 1Y .

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 4 / 27

Sets and MapsNotation for maps (functions) between sets:

f : X −→ Y Diagrammatic notation: Xf−→ Y

X is the domain of f . Y is the codomain.

Notation for composition:

g ◦ f : X −→ Z or f ; g : X −→ Z or Xf−→ Y

g−→ Z

Identity map:1X : X −→ X

When are two functions f , g : X −→ Y equal?

f = g ⇐⇒ ∀x ∈ X . f (x) = g(x).

Axioms relating these operations:

(h ◦ g) ◦ f = h ◦ (g ◦ f ) 1X ◦ f = f = f ◦ 1Y .

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 4 / 27

Sets and MapsNotation for maps (functions) between sets:

f : X −→ Y Diagrammatic notation: Xf−→ Y

X is the domain of f . Y is the codomain.

Notation for composition:

g ◦ f : X −→ Z or f ; g : X −→ Z or Xf−→ Y

g−→ Z

Identity map:1X : X −→ X

When are two functions f , g : X −→ Y equal?

f = g ⇐⇒ ∀x ∈ X . f (x) = g(x).

Axioms relating these operations:

(h ◦ g) ◦ f = h ◦ (g ◦ f ) 1X ◦ f = f = f ◦ 1Y .

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 4 / 27

Sets and MapsNotation for maps (functions) between sets:

f : X −→ Y Diagrammatic notation: Xf−→ Y

X is the domain of f . Y is the codomain.

Notation for composition:

g ◦ f : X −→ Z or f ; g : X −→ Z or Xf−→ Y

g−→ Z

Identity map:1X : X −→ X

When are two functions f , g : X −→ Y equal?

f = g ⇐⇒ ∀x ∈ X . f (x) = g(x).

Axioms relating these operations:

(h ◦ g) ◦ f = h ◦ (g ◦ f ) 1X ◦ f = f = f ◦ 1Y .

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 4 / 27

Preliminaries on Mathematical Structures: Monoids

A monoid is a structure (M, ·, 1) where M is a set,

− · − : M ×M −→ M

is a binary operation, and 1 ∈ M, satisfying the following axioms:

(x · y) · z = x · (y · z) 1 · x = x = x · 1

Examples:

Groups

(N,+, 0)

Strings: Σ∗, s · t = st, 1 = ε.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 5 / 27

Preliminaries on Mathematical Structures: Monoids

A monoid is a structure (M, ·, 1) where M is a set,

− · − : M ×M −→ M

is a binary operation, and 1 ∈ M, satisfying the following axioms:

(x · y) · z = x · (y · z) 1 · x = x = x · 1

Examples:

Groups

(N,+, 0)

Strings: Σ∗, s · t = st, 1 = ε.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 5 / 27

Preliminaries on Mathematical Structures: Monoids

A monoid is a structure (M, ·, 1) where M is a set,

− · − : M ×M −→ M

is a binary operation, and 1 ∈ M, satisfying the following axioms:

(x · y) · z = x · (y · z) 1 · x = x = x · 1

Examples:

Groups

(N,+, 0)

Strings: Σ∗, s · t = st, 1 = ε.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 5 / 27

Preliminaries on Mathematical Structures: Monoids

A monoid is a structure (M, ·, 1) where M is a set,

− · − : M ×M −→ M

is a binary operation, and 1 ∈ M, satisfying the following axioms:

(x · y) · z = x · (y · z) 1 · x = x = x · 1

Examples:

Groups

(N,+, 0)

Strings: Σ∗, s · t = st, 1 = ε.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 5 / 27

Preliminaries on Mathematical Structures: Monoids

A monoid is a structure (M, ·, 1) where M is a set,

− · − : M ×M −→ M

is a binary operation, and 1 ∈ M, satisfying the following axioms:

(x · y) · z = x · (y · z) 1 · x = x = x · 1

Examples:

Groups

(N,+, 0)

Strings: Σ∗, s · t = st, 1 = ε.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 5 / 27

Preliminaries on Mathematical Structures: Monoids

A monoid is a structure (M, ·, 1) where M is a set,

− · − : M ×M −→ M

is a binary operation, and 1 ∈ M, satisfying the following axioms:

(x · y) · z = x · (y · z) 1 · x = x = x · 1

Examples:

Groups

(N,+, 0)

Strings: Σ∗, s · t = st, 1 = ε.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 5 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Partial Orders

A partial order is a structure (P,≤) where P is a set, and ≤ is a binary relationon P satisfying:

x ≤ x (Reflexivity)

x ≤ y ∧ y ≤ x ⇒ x = y (Antisymmetry)

x ≤ y ∧ y ≤ z ⇒ x ≤ z (Transitivity).

Examples:

(R,≤)

(P(X ),⊆)

Strings, the sub-string relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 6 / 27

Homomorphisms

Monoid Homomorphisms

If M1, M2 are monoids, a map h : M1 −→ M2 is a monoid homomorphism iff:

h(x · y) = h(x) · h(y) h(1) = 1.

Partial order Homomorphisms

If P, Q are partial orders,, a map h : P −→ Q is a partial order homomorphism(or monotone function) if:

x ≤ y ⇒ h(x) ≤ h(y).

Note that homomorphisms are closed under composition, and that identitymaps are homomorphisms.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 7 / 27

Homomorphisms

Monoid Homomorphisms

If M1, M2 are monoids, a map h : M1 −→ M2 is a monoid homomorphism iff:

h(x · y) = h(x) · h(y) h(1) = 1.

Partial order Homomorphisms

If P, Q are partial orders,, a map h : P −→ Q is a partial order homomorphism(or monotone function) if:

x ≤ y ⇒ h(x) ≤ h(y).

Note that homomorphisms are closed under composition, and that identitymaps are homomorphisms.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 7 / 27

Homomorphisms

Monoid Homomorphisms

If M1, M2 are monoids, a map h : M1 −→ M2 is a monoid homomorphism iff:

h(x · y) = h(x) · h(y) h(1) = 1.

Partial order Homomorphisms

If P, Q are partial orders,, a map h : P −→ Q is a partial order homomorphism(or monotone function) if:

x ≤ y ⇒ h(x) ≤ h(y).

Note that homomorphisms are closed under composition, and that identitymaps are homomorphisms.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 7 / 27

Homomorphisms

Monoid Homomorphisms

If M1, M2 are monoids, a map h : M1 −→ M2 is a monoid homomorphism iff:

h(x · y) = h(x) · h(y) h(1) = 1.

Partial order Homomorphisms

If P, Q are partial orders,, a map h : P −→ Q is a partial order homomorphism(or monotone function) if:

x ≤ y ⇒ h(x) ≤ h(y).

Note that homomorphisms are closed under composition, and that identitymaps are homomorphisms.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 7 / 27

Homomorphisms

Monoid Homomorphisms

If M1, M2 are monoids, a map h : M1 −→ M2 is a monoid homomorphism iff:

h(x · y) = h(x) · h(y) h(1) = 1.

Partial order Homomorphisms

If P, Q are partial orders,, a map h : P −→ Q is a partial order homomorphism(or monotone function) if:

x ≤ y ⇒ h(x) ≤ h(y).

Note that homomorphisms are closed under composition, and that identitymaps are homomorphisms.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 7 / 27

Homomorphisms

Monoid Homomorphisms

If M1, M2 are monoids, a map h : M1 −→ M2 is a monoid homomorphism iff:

h(x · y) = h(x) · h(y) h(1) = 1.

Partial order Homomorphisms

If P, Q are partial orders,, a map h : P −→ Q is a partial order homomorphism(or monotone function) if:

x ≤ y ⇒ h(x) ≤ h(y).

Note that homomorphisms are closed under composition, and that identitymaps are homomorphisms.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 7 / 27

Categories: basic definitions

Category C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Categories: basic definitionsCategory C:

Objects A, B, C , . . .

Morphisms/arrows: for each pair of objects A, B, a set of morphisms C(A,B),with domain A and codomain B

Notation: f : A −→ B for f ∈ C(A,B).

Composition of morphisms: for any triple of objects A, B, Ca map

cA,B,C : C(A,B)× C(B,C ) −→ C(A,C )

Notation: cA,B,C (f , g) = f ; g = g ◦ f .

Diagrammatically: Af−→ B

g−→ C .

Identities: for each object A, a morphism idA.

Axiomsh ◦ (g ◦ f ) = (h ◦ g) ◦ f f ◦ idA = f = idB ◦ f

(f ; g); h = f ; (g ; h) f ; idB = f = idA; f

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 8 / 27

Examples

Any kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

ExamplesAny kind of mathematical structure, together with structure preservingfunctions, forms a category. E.g.

I Set (sets and functions)

I Grp (groups and group homomorphisms)

I Mon (monoids and monoid homomorphisms)

I Vectk (vector spaces over a field k, and linear maps)

I Top (topological spaces and continuous functions)

I Pos (partially ordered sets and monotone functions)

Rel: objects are sets, arrows R : X → Y are relations R ⊆ X × Y .Relational composition:

R; S(x , z) ⇐⇒ ∃y .R(x , y) ∧ S(y , z).

Monoids are one-object categories

A category in which for each pair of objects A, B there is at most onemorphism from A to B is the same thing as a preorder, i.e. a reflexive andtransitive relation.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 9 / 27

Categories as Contexts and as Structures

Our first class of examples illustrate the idea of categories as mathematicalcontexts; settings in which various mathematical theories can be developed.Thus for example, Top is the context for general topology, Grp is the contextfor group theory, etc.

This issue of “mathematics in context” should be emphasized. The idea thatany mathematical discussion is relative to the category we happen to beworking in is pervasive and fundamental. It allows us simultaneously to beboth properly specific and general: specific, in that statements aboutmathematical structures are not really precise until we have specified whichstructures we are dealing with, and which morphisms we are considering —i.e. which category we are working in. At the same time, the awareness thatwe are working in some category allows us to extract the proper generality forany definition or theorem, by identifying exactly which properties of theambient category we are using.

On the other hand, the last two examples illustrate that many importantmathematical structures themselves appear as categories of particularkinds. The fact that two such different kinds of structures as monoids andposets should appear as extremal versions of categories is also rather striking.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 10 / 27

Categories as Contexts and as StructuresOur first class of examples illustrate the idea of categories as mathematicalcontexts; settings in which various mathematical theories can be developed.Thus for example, Top is the context for general topology, Grp is the contextfor group theory, etc.

This issue of “mathematics in context” should be emphasized. The idea thatany mathematical discussion is relative to the category we happen to beworking in is pervasive and fundamental. It allows us simultaneously to beboth properly specific and general: specific, in that statements aboutmathematical structures are not really precise until we have specified whichstructures we are dealing with, and which morphisms we are considering —i.e. which category we are working in. At the same time, the awareness thatwe are working in some category allows us to extract the proper generality forany definition or theorem, by identifying exactly which properties of theambient category we are using.

On the other hand, the last two examples illustrate that many importantmathematical structures themselves appear as categories of particularkinds. The fact that two such different kinds of structures as monoids andposets should appear as extremal versions of categories is also rather striking.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 10 / 27

Categories as Contexts and as StructuresOur first class of examples illustrate the idea of categories as mathematicalcontexts; settings in which various mathematical theories can be developed.Thus for example, Top is the context for general topology, Grp is the contextfor group theory, etc.

This issue of “mathematics in context” should be emphasized. The idea thatany mathematical discussion is relative to the category we happen to beworking in is pervasive and fundamental. It allows us simultaneously to beboth properly specific and general: specific, in that statements aboutmathematical structures are not really precise until we have specified whichstructures we are dealing with, and which morphisms we are considering —i.e. which category we are working in. At the same time, the awareness thatwe are working in some category allows us to extract the proper generality forany definition or theorem, by identifying exactly which properties of theambient category we are using.

On the other hand, the last two examples illustrate that many importantmathematical structures themselves appear as categories of particularkinds. The fact that two such different kinds of structures as monoids andposets should appear as extremal versions of categories is also rather striking.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 10 / 27

Categories as Contexts and as StructuresOur first class of examples illustrate the idea of categories as mathematicalcontexts; settings in which various mathematical theories can be developed.Thus for example, Top is the context for general topology, Grp is the contextfor group theory, etc.

This issue of “mathematics in context” should be emphasized. The idea thatany mathematical discussion is relative to the category we happen to beworking in is pervasive and fundamental. It allows us simultaneously to beboth properly specific and general: specific, in that statements aboutmathematical structures are not really precise until we have specified whichstructures we are dealing with, and which morphisms we are considering —i.e. which category we are working in. At the same time, the awareness thatwe are working in some category allows us to extract the proper generality forany definition or theorem, by identifying exactly which properties of theambient category we are using.

On the other hand, the last two examples illustrate that many importantmathematical structures themselves appear as categories of particularkinds. The fact that two such different kinds of structures as monoids andposets should appear as extremal versions of categories is also rather striking.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 10 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition

1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Learning to think with arrows

A function f : X −→ Y is:

injective iff (x) = f (y) ⇒ x = y .

surjective if∀y ∈ Y .∃x ∈ X . f (x) = y .

monic iff ◦ g = f ◦ h ⇒ g = h.

epic ifg ◦ f = h ◦ f ⇒ g = h.

Proposition1 m is injective iff m is monic.

2 e is surjective iff e is epic.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 11 / 27

Duality

The opposite of a category C, written Cop, has the same objects as C, and

Cop(A,B) = C(B,A).

If we haveA

f−→ Bg−→ C

in Cop, this means

Af←− B

g←− C

in C, so composition g ◦ f in Cop is defined as f ◦ g in C!

This leads to a principle of duality: dualize a statement about C by making thesame statement about Cop.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 12 / 27

Duality

The opposite of a category C, written Cop, has the same objects as C, and

Cop(A,B) = C(B,A).

If we haveA

f−→ Bg−→ C

in Cop, this means

Af←− B

g←− C

in C, so composition g ◦ f in Cop is defined as f ◦ g in C!

This leads to a principle of duality: dualize a statement about C by making thesame statement about Cop.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 12 / 27

Duality

The opposite of a category C, written Cop, has the same objects as C, and

Cop(A,B) = C(B,A).

If we haveA

f−→ Bg−→ C

in Cop, this means

Af←− B

g←− C

in C, so composition g ◦ f in Cop is defined as f ◦ g in C!

This leads to a principle of duality: dualize a statement about C by making thesame statement about Cop.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 12 / 27

Duality

The opposite of a category C, written Cop, has the same objects as C, and

Cop(A,B) = C(B,A).

If we haveA

f−→ Bg−→ C

in Cop, this means

Af←− B

g←− C

in C, so composition g ◦ f in Cop is defined as f ◦ g in C!

This leads to a principle of duality: dualize a statement about C by making thesame statement about Cop.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 12 / 27

Duality

The opposite of a category C, written Cop, has the same objects as C, and

Cop(A,B) = C(B,A).

If we haveA

f−→ Bg−→ C

in Cop, this means

Af←− B

g←− C

in C, so composition g ◦ f in Cop is defined as f ◦ g in C!

This leads to a principle of duality: dualize a statement about C by making thesame statement about Cop.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 12 / 27

Example of Duality

A morphism f is monic in Cop iff it is epic in C; so monic and epic are dualnotions.

f : A −→ B in C iff f : B −→ A in Cop.

Thus f is monic in Cop iff for all g , h : C −→ B in Cop,

f ◦ g = f ◦ h ⇒ g = h,

iff for all g , h : B −→ C in C,

g ◦ f = h ◦ f ⇒ g = h,

iff f is epic in C.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 13 / 27

Example of Duality

A morphism f is monic in Cop iff it is epic in C; so monic and epic are dualnotions.

f : A −→ B in C iff f : B −→ A in Cop.

Thus f is monic in Cop iff for all g , h : C −→ B in Cop,

f ◦ g = f ◦ h ⇒ g = h,

iff for all g , h : B −→ C in C,

g ◦ f = h ◦ f ⇒ g = h,

iff f is epic in C.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 13 / 27

Example of Duality

A morphism f is monic in Cop iff it is epic in C; so monic and epic are dualnotions.

f : A −→ B in C iff f : B −→ A in Cop.

Thus f is monic in Cop iff for all g , h : C −→ B in Cop,

f ◦ g = f ◦ h ⇒ g = h,

iff for all g , h : B −→ C in C,

g ◦ f = h ◦ f ⇒ g = h,

iff f is epic in C.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 13 / 27

Example of Duality

A morphism f is monic in Cop iff it is epic in C; so monic and epic are dualnotions.

f : A −→ B in C iff f : B −→ A in Cop.

Thus f is monic in Cop iff for all g , h : C −→ B in Cop,

f ◦ g = f ◦ h ⇒ g = h,

iff for all g , h : B −→ C in C,

g ◦ f = h ◦ f ⇒ g = h,

iff f is epic in C.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 13 / 27

Example of Duality

A morphism f is monic in Cop iff it is epic in C; so monic and epic are dualnotions.

f : A −→ B in C iff f : B −→ A in Cop.

Thus f is monic in Cop iff for all g , h : C −→ B in Cop,

f ◦ g = f ◦ h ⇒ g = h,

iff for all g , h : B −→ C in C,

g ◦ f = h ◦ f ⇒ g = h,

iff f is epic in C.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 13 / 27

Example of Duality

A morphism f is monic in Cop iff it is epic in C; so monic and epic are dualnotions.

f : A −→ B in C iff f : B −→ A in Cop.

Thus f is monic in Cop iff for all g , h : C −→ B in Cop,

f ◦ g = f ◦ h ⇒ g = h,

iff for all g , h : B −→ C in C,

g ◦ f = h ◦ f ⇒ g = h,

iff f is epic in C.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 13 / 27

Generality of Notions: Isomorphisms

Many important mathematical notions can be expressed at the general level ofcategories.

An isomorphism in a category C is an arrow

i : A −→ B

such that there exists an arrow j : B −→ A satisfying

j ◦ i = idA i ◦ j = idB

Notation: i : A∼=−→ B, j = i−1.

In Set this gives bijection, in Grp, group isomorphism, in Top, homeomorphism,in Pos, order isomorphism, etc. etc.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 14 / 27

Generality of Notions: Isomorphisms

Many important mathematical notions can be expressed at the general level ofcategories.

An isomorphism in a category C is an arrow

i : A −→ B

such that there exists an arrow j : B −→ A satisfying

j ◦ i = idA i ◦ j = idB

Notation: i : A∼=−→ B, j = i−1.

In Set this gives bijection, in Grp, group isomorphism, in Top, homeomorphism,in Pos, order isomorphism, etc. etc.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 14 / 27

Generality of Notions: Isomorphisms

Many important mathematical notions can be expressed at the general level ofcategories.

An isomorphism in a category C is an arrow

i : A −→ B

such that there exists an arrow j : B −→ A satisfying

j ◦ i = idA i ◦ j = idB

Notation: i : A∼=−→ B, j = i−1.

In Set this gives bijection, in Grp, group isomorphism, in Top, homeomorphism,in Pos, order isomorphism, etc. etc.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 14 / 27

Generality of Notions: Isomorphisms

Many important mathematical notions can be expressed at the general level ofcategories.

An isomorphism in a category C is an arrow

i : A −→ B

such that there exists an arrow j : B −→ A satisfying

j ◦ i = idA i ◦ j = idB

Notation: i : A∼=−→ B, j = i−1.

In Set this gives bijection, in Grp, group isomorphism, in Top, homeomorphism,in Pos, order isomorphism, etc. etc.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 14 / 27

Generality of Notions: Isomorphisms

Many important mathematical notions can be expressed at the general level ofcategories.

An isomorphism in a category C is an arrow

i : A −→ B

such that there exists an arrow j : B −→ A satisfying

j ◦ i = idA i ◦ j = idB

Notation: i : A∼=−→ B, j = i−1.

In Set this gives bijection, in Grp, group isomorphism, in Top, homeomorphism,in Pos, order isomorphism, etc. etc.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 14 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Initial and terminal objects

An object I in a category C is initial if for every object A, there exists aunique arrow ιA : I −→ A.

A terminal object in C is the dual notion (i.e. an initial object in Cop).

There is a unique isomorphism between any pair of initial objects; thus initialobjects are ‘unique up to (unique) isomorphism’, and we can (and do) speak ofthe initial object (if any such exists).

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 15 / 27

Products: Replacing Coding by Intrinsic Properties

A fundamental mathematical construction is the Cartesian product. What is theessence of this construction? How can it be made general?

In set theory, we define the ordered pair, e.g. as

〈x , y〉 := {{x , y}, y}.

In no sense is such a definition canonical.

The essential properties of ordered pairs are:

1 We can retrieve the first and second components x , y of the ordered pair〈x , y〉.

2 The information about first and second components completely determinesthe ordered pair:

〈x1, x2〉 = 〈y1, y2〉 ⇐⇒ x1 = y1 ∧ x2 = y2.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 16 / 27

Products: Replacing Coding by Intrinsic Properties

A fundamental mathematical construction is the Cartesian product. What is theessence of this construction? How can it be made general?

In set theory, we define the ordered pair, e.g. as

〈x , y〉 := {{x , y}, y}.

In no sense is such a definition canonical.

The essential properties of ordered pairs are:

1 We can retrieve the first and second components x , y of the ordered pair〈x , y〉.

2 The information about first and second components completely determinesthe ordered pair:

〈x1, x2〉 = 〈y1, y2〉 ⇐⇒ x1 = y1 ∧ x2 = y2.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 16 / 27

Products: Replacing Coding by Intrinsic Properties

A fundamental mathematical construction is the Cartesian product. What is theessence of this construction? How can it be made general?

In set theory, we define the ordered pair, e.g. as

〈x , y〉 := {{x , y}, y}.

In no sense is such a definition canonical.

The essential properties of ordered pairs are:

1 We can retrieve the first and second components x , y of the ordered pair〈x , y〉.

2 The information about first and second components completely determinesthe ordered pair:

〈x1, x2〉 = 〈y1, y2〉 ⇐⇒ x1 = y1 ∧ x2 = y2.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 16 / 27

Products: Replacing Coding by Intrinsic Properties

A fundamental mathematical construction is the Cartesian product. What is theessence of this construction? How can it be made general?

In set theory, we define the ordered pair, e.g. as

〈x , y〉 := {{x , y}, y}.

In no sense is such a definition canonical.

The essential properties of ordered pairs are:

1 We can retrieve the first and second components x , y of the ordered pair〈x , y〉.

2 The information about first and second components completely determinesthe ordered pair:

〈x1, x2〉 = 〈y1, y2〉 ⇐⇒ x1 = y1 ∧ x2 = y2.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 16 / 27

Products: Replacing Coding by Intrinsic Properties

A fundamental mathematical construction is the Cartesian product. What is theessence of this construction? How can it be made general?

In set theory, we define the ordered pair, e.g. as

〈x , y〉 := {{x , y}, y}.

In no sense is such a definition canonical.

The essential properties of ordered pairs are:

1 We can retrieve the first and second components x , y of the ordered pair〈x , y〉.

2 The information about first and second components completely determinesthe ordered pair:

〈x1, x2〉 = 〈y1, y2〉 ⇐⇒ x1 = y1 ∧ x2 = y2.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 16 / 27

Products: Replacing Coding by Intrinsic Properties

A fundamental mathematical construction is the Cartesian product. What is theessence of this construction? How can it be made general?

In set theory, we define the ordered pair, e.g. as

〈x , y〉 := {{x , y}, y}.

In no sense is such a definition canonical.

The essential properties of ordered pairs are:

1 We can retrieve the first and second components x , y of the ordered pair〈x , y〉.

2 The information about first and second components completely determinesthe ordered pair:

〈x1, x2〉 = 〈y1, y2〉 ⇐⇒ x1 = y1 ∧ x2 = y2.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 16 / 27

Products

Let A, B be objects in a category C.An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products

Let A, B be objects in a category C.

An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products

Let A, B be objects in a category C.An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.

A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products

Let A, B be objects in a category C.An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products

Let A, B be objects in a category C.An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products

Let A, B be objects in a category C.An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products

Let A, B be objects in a category C.An A, B–pairing is a triple (P, p1, p2) where P is an object, p1 : P −→ A,p2 : P −→ B.A morphism of A, B–pairings f : (P, p1, p2) −→ (Q, q1, q2) is a morphismf : P −→ Q in C such that

A �p1

Pp2 - B

Q

f

?q 2

-�

q1

q1 ◦ f = p1, q2 ◦ f = p2.

The A, B–pairings form a category Pair(A,B).

(A× B, π1, π2) is a product of A and B if it is terminal in Pair(A,B).

Thus products are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 17 / 27

Products explicitly

Unpacking the definition of product,

A �π1

A× Bπ2 - B

is a product if for every A, B-pairing

A �f

Cg - B

there exists a unique morphism

〈f , g〉 : C −→ A× B

such that the following diagram commutes:

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 18 / 27

Products continued

A �π1

A× Bπ2 - B

C

〈f , g〉

6

g

-�

f

π1 ◦ 〈f , g〉 = f , π2 ◦ 〈f , g〉 = g .

Moreover, 〈f , g〉 is the unique morphism h : C → A× B satisfying theseequations.

Uniqueness can be specified by an equation:for all h : C → A× B:

h = 〈π1 ◦ h, π2 ◦ h〉.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 19 / 27

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 20 / 27

General Products

A product for a family of objects {Ai}i∈I in a category C is an object P andmorphisms

pi : P −→ Ai (i ∈ I )

such that, for all objects B and arrows

fi : B −→ Ai (i ∈ I )

there is a unique arrowg : B −→ P

such that, for all i ∈ I ,pi ◦ g = fi .

As before, if such a product exists, it is unique up to (unique) isomorphism.

Notation We write P =∏

i∈I Ai for the product object, and g = 〈fi | i ∈ I 〉 forthe unique morphism in the definition.

What is the product of the empty family?

Fact If a category has binary and nullary products, then it has all finite products.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 21 / 27

General ProductsA product for a family of objects {Ai}i∈I in a category C is an object P andmorphisms

pi : P −→ Ai (i ∈ I )

such that, for all objects B and arrows

fi : B −→ Ai (i ∈ I )

there is a unique arrowg : B −→ P

such that, for all i ∈ I ,pi ◦ g = fi .

As before, if such a product exists, it is unique up to (unique) isomorphism.

Notation We write P =∏

i∈I Ai for the product object, and g = 〈fi | i ∈ I 〉 forthe unique morphism in the definition.

What is the product of the empty family?

Fact If a category has binary and nullary products, then it has all finite products.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 21 / 27

General ProductsA product for a family of objects {Ai}i∈I in a category C is an object P andmorphisms

pi : P −→ Ai (i ∈ I )

such that, for all objects B and arrows

fi : B −→ Ai (i ∈ I )

there is a unique arrowg : B −→ P

such that, for all i ∈ I ,pi ◦ g = fi .

As before, if such a product exists, it is unique up to (unique) isomorphism.

Notation We write P =∏

i∈I Ai for the product object, and g = 〈fi | i ∈ I 〉 forthe unique morphism in the definition.

What is the product of the empty family?

Fact If a category has binary and nullary products, then it has all finite products.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 21 / 27

General ProductsA product for a family of objects {Ai}i∈I in a category C is an object P andmorphisms

pi : P −→ Ai (i ∈ I )

such that, for all objects B and arrows

fi : B −→ Ai (i ∈ I )

there is a unique arrowg : B −→ P

such that, for all i ∈ I ,pi ◦ g = fi .

As before, if such a product exists, it is unique up to (unique) isomorphism.

Notation We write P =∏

i∈I Ai for the product object, and g = 〈fi | i ∈ I 〉 forthe unique morphism in the definition.

What is the product of the empty family?

Fact If a category has binary and nullary products, then it has all finite products.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 21 / 27

General ProductsA product for a family of objects {Ai}i∈I in a category C is an object P andmorphisms

pi : P −→ Ai (i ∈ I )

such that, for all objects B and arrows

fi : B −→ Ai (i ∈ I )

there is a unique arrowg : B −→ P

such that, for all i ∈ I ,pi ◦ g = fi .

As before, if such a product exists, it is unique up to (unique) isomorphism.

Notation We write P =∏

i∈I Ai for the product object, and g = 〈fi | i ∈ I 〉 forthe unique morphism in the definition.

What is the product of the empty family?

Fact If a category has binary and nullary products, then it has all finite products.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 21 / 27

Coproducts

We now investigate the dual notion to products: namely coproducts.Formally, coproducts in C are just products in Cop, interpreted back in C. We spellout the definition.

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 22 / 27

Coproducts

Let A, B be objects in a category C. An A, B–copairing is a triple (C , i1, i2) whereC is an object, i1 : A −→ C , i2 : B −→ C . A morphism of A, B–copairings

f : (C , i1, i2) −→ (D, j1, j2)

is a morphism f : C −→ D in C such that

Ai1 - C �

i2B

D

f

?�

j 2j1-

f ◦ i1 = j1, f ◦ i2 = j2.

The A, B–copairings form a category Copair(A,B).(A + B, i1, i2) is a coproduct of A and B if it is initial in Copair(A,B).Thus coproducts are unique up to isomorphism (if they exist).

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 23 / 27

Coproducts explicitly

Unpacking the definition of coproduct,

Ai1- A + B �

i2B

is a coproduct if for every A, B-copairing

Af - C �

gB

there exists a unique morphism

[f , g ] : A + B −→ C

such that the following diagram commutes:

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 24 / 27

Coproducts continued

Ai1 - A + B �

i2B

C

[f , g ]

?�

gf

-

[f , g ] ◦ i1 = f , [f , g ] ◦ i2 = g .

Moreover, [f , g ] is the unique morphism h : E1 + E2 → C satisfying theseequations.

Uniqueness can be specified by an equation:for all h : E1 + E2 −→ C :

h = [h ◦ i1, h ◦ i2].

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 25 / 27

Coproducts in Set

This is given by disjoint union of sets, which can be defined concretely e.g. by

X + Y = {1} × X ∪ {2} × Y .

We can define injections

Xin1- X + Y �

in2Y

in1(x) = (1, x) in2(y) = (2, y).

Also, given functions f : X −→ Z and g : Y −→ Z , we can define

[f , g ] : X + Y −→ Z

[f , g ](1, x) = f (x) [f , g ](2, y) = g(y).

We can then prove that

[f , g ] ◦ in1 = f , [f , g ] ◦ in2 = g , h = [h ◦ in1, h ◦ in2].

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 26 / 27

Other Examples

Vectk?

Pos?

Top?

In a poset?

Samson Abramsky (Oxford University Computing Laboratory)Categories, Proofs and Processes Lecture I 27 / 27