Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Natural transformations
Given two parallel functors F, G : K → K0, a natural transformation from F to G τ : F → G
is a family τ = hτA: F(A) → G(A)iA∈|K| of K0-morphisms such that for all f : A → B in K (with A, B ∈ |K|), τA;G(f ) = F(f );τB
Then, τ is a natural isomorphism if for all A ∈ |K|, τA is an isomorphism.
K: K0:
A F(A) G(A)
B F(B) G(B)
τA -
τB -
? f
? F(f )
? G(f )
Andrzej Tarlecki: Category Theory, 2021 - 95 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
For all f : X → Y ,
singX;P(f ) = IdSet(f );singY , i.e. singX; ~f = f ;singY ,
i.e. for x ∈ X, ~f ({x}) = {f (x)}.
X IdSet(X) -P(X) singX
Y IdSet(Y ) -P(Y ) singY
? f
? IdSet(f )
? P(f )
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
For all f : X → Y ,
singX;P(f ) = IdSet(f );singY , i.e. singX; ~f = f ;singY ,
i.e. for x ∈ X, ~f ({x}) = {f (x)}.
X IdSet(X) -P(X) singX
Y IdSet(Y ) -P(Y ) singY
? f
? IdSet(f )
? P(f )
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
For all f : X → Y ,
singX;P(f ) = IdSet(f );singY , i.e. singX; ~f = f ;singY ,
i.e. for x ∈ X, ~f ({x}) = {f (x)}.
X X - 2X
singX
Y Y - 2Y
singY
? f
? f
? f~
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
For all f : X → Y ,
singX;P(f ) = IdSet(f );singY , i.e. singX; ~f = f ;singY ,
i.e. for x ∈ X, f ({x}) = {f (x)}.~
X X - 2X
singX
Y Y - 2Y
singY
? f
? f
? f~
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
• singleton-list functions: singList: IdSet → |List| ( : Set → Set), where
|List| = List;| | : Set(→ Monoid) → Set, and for all X ∈ |Set|,
singListX : X → X∗ is a function defined by singListX (x) = hxi for x ∈ X
• append functions: append : |List|;CP → |List| ( : Set → Set), where for all X ∈ |Set|, appendX : (X∗ × X∗) → X∗ is the usual append function (list concatenation) polymorphic functions between algebraic types
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
• singleton-list functions: singList: IdSet → |List| ( : Set → Set), where
|List| = List;| | : Set(→ Monoid) → Set, and for all X ∈ |Set|,
singListX : X → X∗ is a function defined by singListX (x) = hxi for x ∈ X
• append functions: append : |List|;CP → |List| ( : Set → Set), where for all X ∈ |Set|, appendX : (X∗ × X∗) → X∗ is the usual append function (list concatenation) polymorphic functions between algebraic types
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Examples
• identity transformations: idF: F → F, where F : K → K0 , for all objects A ∈ |K|, (idF)A = idA: F(A) → F(A)
• singleton functions: sing : IdSet → P ( : Set → Set), where for all X ∈ |Set|, singX : X → P(X) is a function defined by singX(x) = {x} for x ∈ X.
• singleton-list functions: singList: IdSet → |List| ( : Set → Set), where
|List| = List;| | : Set(→ Monoid) → Set, and for all X ∈ |Set|,
singListX : X → X∗ is a function defined by singListX (x) = hxi for x ∈ X
• append functions: append : |List|;CP → |List| ( : Set → Set), where for all X ∈ |Set|, appendX : (X∗ × X∗) → X∗ is the usual append function (list concatenation) polymorphic functions between algebraic types
X X∗ × X∗ X∗
Y Y ∗ × Y ∗ Y ∗
- appendX
- appendY
? f
? f ∗ × f ∗
? f ∗
Andrzej Tarlecki: Category Theory, 2021 - 96 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T , built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T , built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
· [[αi]](X1, . . . , Xn) = Xi
· [[int]](X1, . . . , Xn) = {. . . , −2, −1, 0, 1, 2, . . .}
· [[T1 × T2]](X1, . . . , Xn) = [[T1]](X1, . . . , Xn) × [[T2]](X1, . . . , Xn)
· [[T1 + T2]](X1, . . . , Xn) = [[T1]](X1, . . . , Xn) + [[T2]](X1, . . . , Xn)
· · · ·
· . . . recursive type definitions work as well. . .
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
− argue that in a representative subset of Standard ML, for each polymorphic expression E : ∀α1 . . . αn · T → T0 its semantics is a natural transformation [[E]] : [[T ]] → [[T0]]
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
− argue that in a representative subset of Standard ML, for each polymorphic expression E : ∀α1 . . . αn · T → T0 its semantics is a natural transformation [[E]] : [[T ]] → [[T0]]
· by induction on the structure of well-typed expressions
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
− argue that in a representative subset of Standard ML, for each polymorphic expression E : ∀α1 . . . αn · T → T0 its semantics is a natural transformation [[E]] : [[T ]] → [[T0]]
− Then for f1: X1 → Y1, . . . , fn: Xn → Yn:
[[T ]](f1, . . . , fn);[[E]]hY1,...,Yni = [[E]]hX1,...,Xni;[[T0]](f1, . . . , fn)
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
− argue that in a representative subset of Standard ML, for each polymorphic expression E : ∀α1 . . . αn · T → T0 its semantics is a natural transformation [[E]] : [[T ]] → [[T0]]
− Then for f1: X1 → Y1, . . . , fn: Xn → Yn:
[[T ]](f1, . . . , fn);[[E]]hY1,...,Yni = [[E]]hX1,...,Xni;[[T0]](f1, . . . , fn) For instance, for rev : α list → α list,
even : int → bool and l : int list:
rev (even∗(l)) = even∗(rev (l))
Theorems for free!
(see Wadler 89)
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Polymorphic functions
Work out the following generalisation of the last two examples:
− for each algebraic type scheme ∀α1 . . . αn · T, built in Standard ML using at least products and algebraic data types (no function types though), define the corresponding functor [[T ]] : Setn → Set
− argue that in a representative subset of Standard ML, for each polymorphic expression E : ∀α1 . . . αn · T → T0 its semantics is a natural transformation [[E]] : [[T ]] → [[T0]]
− Then for f1: X1 → Y1, . . . , fn: Xn → Yn:
[[T ]](f1, . . . , fn);[[E]]hY1,...,Yni = [[E]]hX1,...,Xni;[[T0]](f1, . . . , fn) For instance, for rev : α list → α list,
even : int → bool and l : int list:
rev (even∗(l)) = even∗(rev (l))
Theorems for free!
(see Wadler 89)
Andrzej Tarlecki: Category Theory, 2021 - 97 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A) EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A) EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A) EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A) EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A)
EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A)
EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Yoneda lemma
Given a locally small category K, functor F : K → Set and object A ∈ |K|:
Nat (HomK(A, ), F) ∼= F(A)
natural transformations from HomK(A, ) to F, between functors from K to Set, are given exactly by the elements of the set F(A)
EXERCISES:
• Dualise: for G : Kop → Set,
Nat (HomK( , A), G) ∼= G(A) .
• Characterise all natural transformations from HomK(A, ) to HomK(B, ), for all objects A, B ∈ |K|.
Andrzej Tarlecki: Category Theory, 2021 - 98 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
Note: F(f ) : F(A) → F(B) in Set, so F(f )(a) ∈ F(B).
F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
- τA
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ :
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Proof
• For a ∈ F(A), define τa : HomK(A, ) → F, as the family of functions
τBa : K(A, B) → F(B), B ∈ |K|, given by τBa(f ) = F(f )(a) for f : A → B in K.
This is a natural transformation, since for g : B → C and then f : A → B, F(g)(τBa(f ))= F(g)(F(f )(a))
= F(f ;g)(a) = τCa(f ;g)
= τCa(HomK(A, g)(f ))
Then τAa(idA) = a, and so for distinct a, a0 ∈ F(A), τa and τa0 differ.
K: Set:
B K(A, B) F(B)
C K(A, C) F(C)
- τBa
- τCa
? g
?
( );g = HomK(A, g)
? F(g)
• If τ : HomK(A, ) → F is a natural transformation then τ = τa, where we put a = τA(idA), since for B ∈ |K| and f : A → B, τB(f ) = F(f )(τA(idA)) by naturality of τ:
A K(A, A) F(A)
B K(A, B) F(B)
τA -
τB -
? f
?
( );f = HomK(A, f )
? F(f )
Andrzej Tarlecki: Category Theory, 2021 - 99 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Compositions
vertical composition:
From:
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ to:
K K0
? F
6
F00
ñññññññò
τ ;σ
horizontal composition:
From:
K K0
? F
6
F0
ñññññññò
τ K00
? G
6
G0
ñññññññò
σ
to:
K
? F;G
6
F0;G0
ñññññññò
τ ·σ K00
Andrzej Tarlecki: Category Theory, 2021 - 100 -
Vertical composition
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ
The vertical composition of natural transformations τ : F → F0 and σ : F0 → F00 between parallel functors F, F0, F00: K → K0
τ ;σ : F → F00
is a natural transformation given by (τ ;σ)A = τA;σA for all A ∈ |K|.
K: K0:
A F(A) F0(A) F00(A)
B F(B) F0(B) F00(B)
τA -
- τB
σA -
- σB
? f
? F(f )
? F0(f )
?
F00(f )
Andrzej Tarlecki: Category Theory, 2021 - 101 -
Vertical composition
K K0
? F
F0-
6
F00
ññò
τ
ññò
σ
The vertical composition of natural transformations τ : F → F0 and σ : F0 → F00 between parallel functors F, F0, F00: K → K0
τ ;σ : F → F00
is a natural transformation given by (τ ;σ)A = τA;σA for all A ∈ |K|.
K: K0:
A F(A) F0(A) F00(A)
B F(B) F0(B) F00(B)
τA -
- τB
σA -
- σB
? f
? F(f )
? F0(f )
?
F00(f )
Andrzej Tarlecki: Category Theory, 2021 - 101 -