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

126
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

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

Page 1: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 2: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 3: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 4: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 5: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 6: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 7: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 8: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 9: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 10: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 11: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 12: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 13: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 14: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 15: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 16: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 17: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 18: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 19: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 20: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 21: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 22: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 23: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 24: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 25: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 26: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 27: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 28: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 29: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 30: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 31: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 32: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 33: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 34: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 35: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 36: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 37: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 38: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 39: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 40: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 41: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 42: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 43: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 44: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 45: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 46: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 47: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 48: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 49: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 50: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 51: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 52: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 53: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 54: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 55: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 56: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 57: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 58: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 59: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 60: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 61: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 62: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 63: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 64: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 65: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 66: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 67: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 68: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 69: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 70: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 71: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 72: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 73: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 74: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 75: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 76: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 77: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 78: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 79: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 80: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 81: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 82: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 83: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 84: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 85: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 86: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 87: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 88: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 89: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 90: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 91: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 92: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 93: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 94: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 95: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 96: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 97: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 98: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 99: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 100: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 101: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 102: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 103: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 104: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 105: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 106: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 107: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 108: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 109: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 110: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 111: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 112: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 113: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 114: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 115: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

Examples

Set?

Vectk?

Pos?

Top?

In a poset?

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

Page 116: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 117: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 118: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 119: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 120: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 121: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 122: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 123: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 124: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 125: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

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

Page 126: Categories, Proofs and Processes Lecture I › logic › sellc-2010 › course › LectureI.pdf · Lecture II: Functors, Adjoints and Logic. Lecture III: Categories and Logic. Curry-Howard-Lambek

Other Examples

Vectk?

Pos?

Top?

In a poset?

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