• Nie Znaleziono Wyników

Natural transformations

N/A
N/A
Protected

Academic year: 2021

Share "Natural transformations"

Copied!
160
0
0

Pełen tekst

(1)

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 -

(2)

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 -

(3)

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 -

(4)

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 -

(5)

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 -

(6)

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 -

(7)

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 -

(8)

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 -

(9)

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 -

(10)

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 -

(11)

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 -

(12)

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 -

(13)

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 -

(14)

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 -

(15)

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 -

(16)

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 -

(17)

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 -

(18)

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 -

(19)

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 -

(20)

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 -

(21)

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 -

(22)

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 -

(23)

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 -

(24)

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 -

(25)

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 -

(26)

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 -

(27)

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 -

(28)

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 -

(29)

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 -

(30)

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 -

(31)

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 -

(32)

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 -

(33)

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 -

(34)

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 -

(35)

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 -

(36)

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 -

(37)

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 -

(38)

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 -

(39)

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 -

(40)

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 -

(41)

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 -

(42)

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 -

(43)

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 -

(44)

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 -

(45)

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 -

(46)

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 -

(47)

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 -

(48)

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 -

(49)

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 -

(50)

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 -

(51)

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 -

(52)

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 -

(53)

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 -

(54)

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 -

(55)

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 -

(56)

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 -

(57)

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 = τAA 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 -

(58)

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 = τAA 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 -

Cytaty

Powiązane dokumenty

The next two results show that certain smaller radial growths can be associated with suitable exceptional sets..

W tej procedurze instrukcję For Each umieszczono dodatkowo w strukturze obsługi błędów Try … Catch, aby uniknąć błędu wtedy, gdy funkcja konwersji CSng(Element.Text)

If we replace the category Mf m by the category Mf of all manifolds and all smooth maps, we obtain the concept of bundle functor on the category of all manifolds... This implies that

Various estimates from below for M (α) and α were obtained by Blanksby and Montgomery [1], Stewart [10], Dobrowolski [3].. In the present paper the following theorem

Explicit forms of e-type Tasoev continued fractions In this section, we shall show some explicit forms of the leaping convergents of e-type Tasoev continued fractions... Elsner,

Znajdź wszystkie pierwiastki rzeczywiste tego równania.

He proved that for every a < 0 and every natural numbers r and n ≥ 2 every natural affinor on generalized higher order tangent bundle T (r),a is a constant multiple of the

Hence, the (fc, r)-covelocities bundle functor Tk* is defined on a category of smooth n dimensional manifolds with local diffeomorphisms as morphisms and with values in a category V