• Nie Znaleziono Wyników

Category Theory in Foundations of Computer Science Andrzej Tarlecki

N/A
N/A
Protected

Academic year: 2021

Share "Category Theory in Foundations of Computer Science Andrzej Tarlecki"

Copied!
264
0
0

Pełen tekst

(1)

(Universal Algebra and)

Category Theory

in Foundations of Computer Science

Andrzej Tarlecki

Institute of Informatics

Faculty of Mathematics, Informatics and Mechanics University of Warsaw

http://www.mimuw.edu.pl/~tarlecki office: 4750 tarlecki@mimuw.edu.pl phone (office): (48)(22)(55) 44475

(2)

Universal algebra and category theory:

basic ideas, notions and some results

• Algebras, homomorphisms, equations: basic definitions and results

• Categories; examples and simple categorical definitions

• Limits and colimits

• Functors and natural transformations

• Adjunctions

• Cartesian closed categories

• Monads

• Institutions (abstract model theory, abstract specification theory)

BUT: Tell me what you want to learn!

(3)

Universal algebra and category theory:

basic ideas, notions and some results

• Algebras, homomorphisms, equations: basic definitions and results

• Categories; examples and simple categorical definitions

• Limits and colimits

• Functors and natural transformations

• Adjunctions

• Cartesian closed categories

• Monads

• Institutions (abstract model theory, abstract specification theory)

(4)

Universal algebra and category theory:

basic ideas, notions and some results

• Algebras, homomorphisms, equations: basic definitions and results

• Categories; examples and simple categorical definitions

• Limits and colimits

• Functors and natural transformations

• Adjunctions

• Cartesian closed categories

• Monads

• Institutions (abstract model theory, abstract specification theory)

BUT: Tell me what you want to learn!

(5)

Universal algebra and category theory:

basic ideas, notions and some results

• Algebras, homomorphisms, equations: basic definitions and results

• Categories; examples and simple categorical definitions

• Limits and colimits

• Functors and natural transformations

• Adjunctions

• Cartesian closed categories

• Monads

• Institutions (abstract model theory, abstract specification theory)

(6)

Universal algebra and category theory:

basic ideas, notions and some results

• Algebras, homomorphisms, equations: basic definitions and results

• Categories; examples and simple categorical definitions

• Limits and colimits

• Functors and natural transformations

• Adjunctions

• Cartesian closed categories

• Monads

• Institutions (abstract model theory, abstract specification theory)

BUT: Tell me what you want to learn!

(7)

Literature

Plenty of standard textbooks But this will be roughly based on:

• D.T. Sannella, A. Tarlecki.

Foundations of Algebraic Specifications and Formal Program Development. Springer, 2012.

− Chap. 1: Universal algebra

− Chap. 2: Simple equational specifications

− Chap. 3: Category theory

(8)

One motivation

Software systems (modules, programs, databases. . . ):

sets of data with operations on them

• Disregarding: code, efficiency, robustness, reliability, . . .

• Focusing on: CORRECTNESS

Universal algebra from rough analogy

module interface ; signature module; algebra

module specification; class of algebras

Category theory

A language to further abstract away from the standard notions of univer- sal algebra, to deal with their numer- ous variants needed in foundations of computer science.

(9)

One motivation

Software systems (modules, programs, databases. . . ):

sets of data with operations on them

• Disregarding: code, efficiency, robustness, reliability, . . .

• Focusing on: CORRECTNESS

Universal algebra from rough analogy

module interface ;signature module;algebra

Category theory

A language to further abstract away from the standard notions of univer- sal algebra, to deal with their numer- ous variants needed in foundations of

(10)

One motivation

Software systems (modules, programs, databases. . . ):

sets of data with operations on them

• Disregarding: code, efficiency, robustness, reliability, . . .

• Focusing on: CORRECTNESS

Universal algebra from rough analogy

module interface ;signature module;algebra

module specification;class of algebras

Category theory

A language to further abstract away from the standard notions of univer- sal algebra, to deal with their numer- ous variants needed in foundations of computer science.

(11)

Signatures

Algebraic signature:

Σ = (S, Ω)

• sort names: S

• operation names, classified by arities and result sorts: Ω = hΩw,siw∈S,s∈S Alternatively:

Σ = (S, Ω, arity, sort )

with sort names S, operation names Ω, and arity and result sort functions

arity : Ω → S and sort : Ω → S.

• f : s1 × . . . × sn → s stands for s1, . . . , sn, s ∈ S and f ∈ Ωs1...sn,s

• f : s1 × . . . × sn → s and f : s01 × . . . × s0m → s0 — overloading allowed

(12)

Signatures

Algebraic signature:

Σ = (S, Ω)

• sort names: S

• operation names, classified by arities and result sorts: Ω = hΩw,siw∈S,s∈S Alternatively:

Σ = (S, Ω, arity, sort )

with sort names S, operation names Ω, and arity and result sort functions

arity : Ω → S and sort : Ω → S.

• f : s1 × . . . × sn → s stands for s1, . . . , sn, s ∈ S and f ∈ Ωs1...sn,s

• f : s1 × . . . × sn → s and f : s01 × . . . × s0m → s0 — overloading allowed

Compare the two notions

(13)

Signatures

Algebraic signature:

Σ = (S, Ω)

• sort names: S

• operation names, classified by arities and result sorts: Ω = hΩw,siw∈S,s∈S Alternatively:

Σ = (S, Ω, arity, sort )

with sort names S, operation names Ω, and arity and result sort functions

arity : Ω → S and sort : Ω → S.

• f : s1 × . . . × sn → s stands for s1, . . . , sn, s ∈ S and f ∈ Ωs1...sn,s

• f : s1 × . . . × sn → s and f : s01 × . . . × s0m → s0 — overloading allowed

(14)

Signatures

Algebraic signature:

Σ = (S, Ω)

• sort names: S

• operation names, classified by arities and result sorts: Ω = hΩw,siw∈S,s∈S Alternatively:

Σ = (S, Ω, arity, sort )

with sort names S, operation names Ω, and arity and result sort functions

arity : Ω → S and sort : Ω → S.

• f : s1 × . . . × sn → s stands for s1, . . . , sn, s ∈ S and f ∈ Ωs1...sn,s

• f : s1 × . . . × sn → s and f : s10 × . . . × s0m → s0 — overloading allowed

Compare the two notions

(15)

Signatures

Algebraic signature:

Σ = (S, Ω)

• sort names: S

• operation names, classified by arities and result sorts: Ω = hΩw,siw∈S,s∈S Alternatively:

Σ = (S, Ω, arity, sort )

with sort names S, operation names Ω, and arity and result sort functions

arity : Ω → S and sort : Ω → S.

• f : s1 × . . . × sn → s stands for s1, . . . , sn, s ∈ S and f ∈ Ωs1...sn,s

• f : s × . . . × s → s and f : s0 × . . . × s0 → s0 — overloading allowed

(16)

Fix a signature Σ = (S, Ω) for a while.

Algebras

• Σ-algebra:

A = (|A|, hfAif ∈Ω)

• carrier sets: |A| = h|A|sis∈S

• operations: fA: |A|s1 × . . . × |A|sn → |A|s, for f : s1 × . . . × sn → s

• the class of all Σ-algebras:

Alg(Σ)

(17)

Fix a signature Σ = (S, Ω) for a while.

Algebras

• Σ-algebra:

A = (|A|, hfAif ∈Ω)

• carrier sets: |A| = h|A|sis∈S

• operations: fA: |A|s1 × . . . × |A|sn → |A|s, for f : s1 × . . . × sn → s

• the class of all Σ-algebras:

Alg(Σ)

(18)

Fix a signature Σ = (S, Ω) for a while.

Algebras

• Σ-algebra:

A = (|A|, hfAif ∈Ω)

• carrier sets: |A| = h|A|sis∈S

• operations: fA: |A|s1 × . . . × |A|sn → |A|s, for f : s1 × . . . × sn → s BTW: constants: fA: {hi} → |A|s, i.e. fA ∈ |A|s, for f : s

• the class of all Σ-algebras:

Alg(Σ)

(19)

Fix a signature Σ = (S, Ω) for a while.

Algebras

• Σ-algebra:

A = (|A|, hfAif ∈Ω)

• carrier sets: |A| = h|A|sis∈S

• operations: fA: |A|s1 × . . . × |A|sn → |A|s, for f : s1 × . . . × sn → s

• the class of all Σ-algebras:

Alg(Σ)

Can Alg(Σ) be empty? Finite?

(20)

Fix a signature Σ = (S, Ω) for a while.

Algebras

• Σ-algebra:

A = (|A|, hfAif ∈Ω)

• carrier sets: |A| = h|A|sis∈S

• operations: fA: |A|s1 × . . . × |A|sn → |A|s, for f : s1 × . . . × sn → s

• the class of all Σ-algebras:

Alg(Σ)

Can Alg(Σ) be empty? Finite?

Can A ∈ Alg(Σ) have empty carriers?

(21)

Fix a signature Σ = (S, Ω) for a while.

Algebras

• Σ-algebra:

A = (|A|, hfAif ∈Ω)

• carrier sets: |A| = h|A|sis∈S

• operations: fA: |A|s1 × . . . × |A|sn → |A|s, for f : s1 × . . . × sn → s

• the class of all Σ-algebras:

Alg(Σ)

Can Alg(Σ) be empty? Finite?

(22)

Intermezzo: many-sorted sets

Given a set (of sort names) S,

S-sorted set X = hXsis∈S is a family of sets Xs, s ∈ S. The usual set-theoretic concepts and notations apply component-wise.

For instance, given X = hXsis∈S, Y = hYsis∈S, Z = hZsis∈S:

• X ∩ Y = hXs ∩ Ysis∈S, X × Y = hXs × Ysis∈S, etc

• X ⊆ Y iff Xs ⊆ Ys, for s ∈ S

• R ⊆ X × Y means R = hRs ⊆ Xs × Ysis∈S

• f : X → Y means f = hfs: Xs → Ysis∈S

• for f : X → Y , g : Y → Z, f ;g = hfs;gs: Xs → Zsis∈S : X → Z

BTW: (f ;g)(x) = g(f (x)), where by abuse of notation for x ∈ Xs, f (x) = fs(x)

(23)

Intermezzo: many-sorted sets

Given a set (of sort names) S,

S-sorted set X = hXsis∈S is a family of sets Xs, s ∈ S. The usual set-theoretic concepts and notations apply component-wise.

For instance, given X = hXsis∈S, Y = hYsis∈S, Z = hZsis∈S:

• X ∩ Y = hXs ∩ Ysis∈S, X × Y = hXs × Ysis∈S, etc

• X ⊆ Y iff Xs ⊆ Ys, for s ∈ S

• R ⊆ X × Y means R = hRs ⊆ Xs × Ysis∈S

• f : X → Y means f = hfs: Xs → Ysis∈S

• for f : X → Y , g : Y → Z, f ;g = hfs;gs: Xs → Zsis∈S : X → Z

(24)

Intermezzo: many-sorted sets

Given a set (of sort names) S,

S-sorted set X = hXsis∈S is a family of sets Xs, s ∈ S. The usual set-theoretic concepts and notations apply component-wise.

For instance, given X = hXsis∈S, Y = hYsis∈S, Z = hZsis∈S:

• X ∩ Y = hXs ∩ Ysis∈S, X × Y = hXs × Ysis∈S, etc

• X ⊆ Y iff Xs ⊆ Ys, for s ∈ S

• R ⊆ X × Y means R = hRs ⊆ Xs × Ysis∈S

• f : X → Y means f = hfs: Xs → Ysis∈S

• for f : X → Y , g : Y → Z, f ;g = hfs;gs: Xs → Zsis∈S : X → Z

BTW: (f ;g)(x) = g(f (x)), where by abuse of notation for x ∈ Xs, f (x) = fs(x)

(25)

Intermezzo: many-sorted sets

Given a set (of sort names) S,

S-sorted set X = hXsis∈S is a family of sets Xs, s ∈ S. The usual set-theoretic concepts and notations apply component-wise.

For instance, given X = hXsis∈S, Y = hYsis∈S, Z = hZsis∈S:

• X ∩ Y = hXs ∩ Ysis∈S, X × Y = hXs × Ysis∈S, etc

• X ⊆ Y iff Xs ⊆ Ys, for s ∈ S

• R ⊆ X × Y means R = hRs ⊆ Xs × Ysis∈S

• f : X → Y means f = hfs: Xs → Ysis∈S

• for f : X → Y , g : Y → Z, f ;g = hfs;gs: Xs → Zsis∈S : X → Z

(26)

Subalgebras

Definition: For A, Asub ∈ Alg(Σ), Asub is a Σ-subalgebra of A, written Asub ⊆ A, if

− |Asub| ⊆ |A|, and

− for f : s1 × . . . × sn → s, and a1 ∈ |Asub|s1, . . . , an ∈ |Asub|sn,

fAsub(a1, . . . , an) = fA(a1, . . . , an)

(27)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |Asub|s1, . . . , an ∈ |Asub|sn,

fA(a1, . . . , an) ∈ |Asub| .

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

(28)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

(29)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

(30)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

Proof: Let X0 = X, and for i ≥ 0,

Xi+1 = Xi ∪ {fA(x1, . . . , xn) | f : s1 × . . . × sn → s, x1 ∈ (Xi)s1, . . . , xn ∈ (Xi)sn}.

Then |hAiX| = S

i≥0 Xi contains X (clearly) and is closed under the operations.

Moreover, if a subset of |A| contains X and is closed under the operations then it contains each Xi, i ≥ 0, and hence so defined |hAiX| as well.

(31)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

Proof: Let X0 = X, and for i ≥ 0,

Xi+1 = Xi ∪ {fA(x1, . . . , xn) | f : s1 × . . . × sn → s, x1 ∈ (Xi)s1, . . . , xn ∈ (Xi)sn}.

Then |hAiX| = S

i≥0 Xi contains X (clearly) and is closed under the operations.

Moreover, if a subset of |A| contains X and is closed under the operations then it

(32)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

Proof:

Lemma: The intersection of any family of subsets of |A| closed under the operations is closed under the operations as well.

Then |hAiX| = T{|Asub| | X ⊆ |Asub|, Asub ⊆ A} is closed under the operations and contains X. Moreover, it is contained in every subalgebra of A that contains X.

(33)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

Proof:

Lemma: The intersection of any family of subsets of |A| closed under the operations is closed under the operations as well.

Then |hAi | = T{|A | | X ⊆ |A |, A ⊆ A} is closed under the operations and

(34)

Subalgebras

• for A ∈ Alg(Σ), a Σ-subalgebra Asub ⊆ A is given by subset |Asub| ⊆ |A| closed under the operations.

• for A ∈ Alg(Σ) and X ⊆ |A|, the subalgebra of A genereted by X, hAiX, is the least subalgebra of A that contains X.

• A ∈ Alg(Σ) is reachable if hAi coincides with A.

Theorem: For any A ∈ Alg(Σ) and X ⊆ |A|, hAiX exists.

Proof (idea):

• generate the generated subalgebra from X by closing it under operations in A; or

• the intersection of any family of subalgebras of A is a subalgebra of A.

(35)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an))

|A|s1 × . . . × |A|sn

|B|s1 × . . . × |B|sn

|A|s

|B|s -

-

?

?

fA

fB

hs1 × . . . × hsn hs

(36)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

(37)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

Proof: Check that:

− h−1(|Bsub|) is closed under the operations (in A) – easy!

− h(|Asub|) is closed under the operations (in B) – just a tiny bit more difficult. . .

(38)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

Theorem: Given a homomorphism h : A → B and X ⊆ |A|, h(hAiX) = hBih(X).

(39)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

Theorem: Given a homomorphism h : A → B and X ⊆ |A|, h(hAiX) = hBih(X). Proof:

− h(hAiX) ⊇ hBih(X), since h(hAiX) is a subalgebra of B and contains h(X);

− hAi ⊆ h−1 −1

(40)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

Theorem: Given a homomorphism h : A → B and X ⊆ |A|, h(hAiX) = hBih(X). Theorem: If two homomorphisms h1, h2: A → B coincide on X ⊆ |A|, then they coincide on hAiX.

(41)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

Theorem: Given a homomorphism h : A → B and X ⊆ |A|, h(hAiX) = hBih(X). Theorem: If two homomorphisms h1, h2: A → B coincide on X ⊆ |A|, then they coincide on hAiX.

(42)

Homomorphisms

• for A, B ∈ Alg(Σ), a Σ-homomorphism h : A → B is a function h : |A| → |B|

that preserves the operations:

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) Theorem: Given a homomorphism h : A → B and subalgebras Asub of A and Bsub of B, the image of Asub under h, h(Asub), is a subalgebra of B, and the coimage of Bsub under h, h−1(Bsub), is a subalgebra of A.

Theorem: Given a homomorphism h : A → B and X ⊆ |A|, h(hAiX) = hBih(X). Theorem: If two homomorphisms h1, h2: A → B coincide on X ⊆ |A|, then they coincide on hAiX.

Theorem: Identity function on the carrier of A ∈ Alg(Σ) is a homomorphism idA: A → A. Composition of homomorphisms h : A → B and g : B → C is a homomorphism h;g : A → C.

(43)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

(44)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

(45)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

(46)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

(47)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

(48)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

Proof (“⇐=”): For f : s1 × . . . × sn → s and b1 ∈ |B|s1, . . . , bn ∈ |B|sn, i−1s (fB(b1, . . . , bn)) = is−1(fB(i(i−1(b1)), . . . , i(i−1(bn)))) =

i−1s (i(fA(i−1(b1), . . . , i−1(bn)))) = fA(i−1(b1), . . . , i−1(bn))

(49)

Isomorphisms

• for A, B ∈ Alg(Σ), a Σ-isomorphism is any Σ-homomorphism i : A → B that has an inverse, i.e., a Σ-homomorphism i−1: B → A such that i;i−1 = idA and i−1;i = idB.

A -B

6 

i

i−1





^





idA  idB

• Σ-algebras are isomorphic if there exists an isomorphism between them.

Theorem: A Σ-homomorphism is a Σ-isomorphism iff it is bijective (“1-1” and

“onto”).

Theorem: Identities are isomorphisms, and any composition of isomorphisms is an isomorphism.

(50)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

(51)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

BTW:

equivalence

(52)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

BTW:

equivalence

≈ ⊆ X × X

− reflexivity: x ≈ x

− symmetry: if x ≈ y then y ≈ x

− transitivity: if x ≈ y and y ≈ z then x ≈ z Then:

− equivalence class: [x] = {y ∈ X | y ≈ x}

− quotient set: X/≈ = {[x] | x ∈ X}

(53)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

(54)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

(a1, . . . , an)

(a01, . . . , a0n)

fA(a1, . . . , an)

fA(a01, . . . , a0n)

≡6s1 · · · ≡sn

?

6

?

-

- fA

fA

s 6

?

(55)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

(a1, . . . , an)

(a01, . . . , a0n)

fA(a1, . . . , an)

fA(a01, . . . , a0n)

≡6s1 · · · ≡sn

?

6

?

-

- fA

fA

s 6

?

(56)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

(a1, . . . , an)

(a01, . . . , a0n)

fA(a1, . . . , an)

fA(a01, . . . , a0n)

≡6s1 · · · ≡sn

?

6

?

-

- fA

fA

s 6

?

(57)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

Theorem: For any relation R ⊆ |A| × |A| on the carrier of a Σ-algebra A, there exists the least congruence on A that conatins R.

(58)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

Theorem: For any relation R ⊆ |A| × |A| on the carrier of a Σ-algebra A, there exists the least congruence on A that conatins R.

Proof (idea):

• generate the least congruence from R by closing it under reflexivity, symmetry, transitivity and the operations in A; or

• the intersection of any family of congruences on A is a congruence on A.

(59)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

Theorem: For any relation R ⊆ |A| × |A| on the carrier of a Σ-algebra A, there exists the least congruence on A that conatins R.

Theorem: For any Σ-homomorphism h : A → B, the kernel of h, K(h) ⊆ |A| × |A|, where a K(h) a0 iff h(a) = h(a0), is a Σ-congruence on A.

Proof: For f : s1 × . . . × sn → s and a1, a01 ∈ |A|s1, . . . , an, a0n ∈ |A|sn, if a1 K(h)s

1 a01, . . . , an K(h)s

n a0n then fA(a1, . . . , an) K(h)s fA(a01, . . . , a0n), since h (f (a , . . . , a )) = f (h (a ), . . . , h (a )) = f (h (a0 ), . . . , h (a0 )) =

(60)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

Theorem: For any relation R ⊆ |A| × |A| on the carrier of a Σ-algebra A, there exists the least congruence on A that conatins R.

Theorem: For any Σ-homomorphism h : A → B, the kernel of h, K(h) ⊆ |A| × |A|, where a K(h) a0 iff h(a) = h(a0), is a Σ-congruence on A.

Proof: For f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn, if a1 K(h)s

1 a01, . . . , an K(h)s

n a0n then fA(a1, . . . , an) K(h)s fA(a01, . . . , a0n), since hs(fA(a1, . . . , an)) = fB(hs1(a1), . . . , hsn(an)) = fB(hs1(a01), . . . , hsn(a0n)) =

hs(fA(a01, . . . , a0n)).

(61)

Congruences

• for A ∈ Alg(Σ), a Σ-congruence on A is an equivalence ≡ ⊆ |A| × |A| that is closed under the operations:

− for f : s1 × . . . × sn → s and a1, a10 ∈ |A|s1, . . . , an, a0n ∈ |A|sn,

if a1s1 a10 , . . . , ansn a0n then fA(a1, . . . , an) ≡s fA(a01, . . . , a0n).

Theorem: For any relation R ⊆ |A| × |A| on the carrier of a Σ-algebra A, there exists the least congruence on A that conatins R.

Theorem: For any Σ-homomorphism h : A → B, the kernel of h, K(h) ⊆ |A| × |A|, where a K(h) a0 iff h(a) = h(a0), is a Σ-congruence on A.

Proof: For f : s1 × . . . × sn → s and a1, a01 ∈ |A|s1, . . . , an, a0n ∈ |A|sn, if a1 K(h)s

1 a01, . . . , an K(h)s

n a0n then fA(a1, . . . , an) K(h)s fA(a01, . . . , a0n), since h (f (a , . . . , a )) = f (h (a ), . . . , h (a )) = f (h (a0 ), . . . , h (a0 )) =

(62)

Quotients

• for A ∈ Alg(Σ) and Σ-congruence ≡ ⊆ |A| × |A| on A, the quotient algebra A/≡ is built in the natural way on the equivalence classes of ≡:

− for s ∈ S, |A/≡|s = {[a] | a ∈ |A|s}, with [a] = {a0 ∈ |A|s | a ≡s a0}

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

fA/≡([a1], . . . , [an]) = [fA(a1, . . . , an)] Theorem: The above is well-defined.

(63)

Quotients

• for A ∈ Alg(Σ) and Σ-congruence ≡ ⊆ |A| × |A| on A, the quotient algebra A/≡ is built in the natural way on the equivalence classes of ≡:

− for s ∈ S, |A/≡|s = {[a] | a ∈ |A|s}, with [a] = {a0 ∈ |A|s | a ≡s a0}

− for f : s1 × . . . × sn → s and a1 ∈ |A|s1, . . . , an ∈ |A|sn,

fA/≡([a1], . . . , [an]) = [fA(a1, . . . , an)] Theorem: The above is well-defined.

Cytaty

Powiązane dokumenty

A finite space represented as a zero-one (2- or 3-dimensional) array, is filled with zeros, only near the center we put one 1 – an immobile “nucleus”, a small grain in a

• congruence ≡ on A: equivalence ≡ ⊆ |A| × |A| closed under the operations whenever they are defined; it is strong if in addition it reflects definedness of operations;

• For any signature Σ, partial Σ-algebras (as objects) and their weak homomorphisms (as morphisms) form the category PAlg(Σ).. • For any signature Σ, partial Σ-algebras (as

Give “natural” examples of categories where monos need not be “injective”.... In Set, a function is iso iff it is both epi

Thanks to the kind attitude of the Stefan Banach International Mathematical Center in Warsaw, the conference took the shape of a mini-semester held there, December 2–22, 1996, under

The experiment with ninth-grade pupils proved the positive impact of using dynamic geometry software and appropriate mathematical tools on the level of pupils’ mathematical

A Nash equilibrium captures the notation of a stable solution and is the solution from which no user (demand/player) can individually improve his utility by deviating. In this

W każdym razie wszystkie były udane, nawet cieszyłam się, że mogę się przed kimś obcym pochwalić swoją lekcją.. Nigdy nie byłam zaskoczona, zawsze przygotowana i