410 likes | 425 Vues
Lesson 15: Rela tions a nd algebr as. Compile d by : Ondřej Kohut (within the Theory of formal systems course). Contents. T heory of sets ( revision ) Rela tions a nd mappings ( revision ) Relations Binar y relations on a set Mappings Partitions, equivalence s Orderings
E N D
Lesson 15:Relations and algebras Compiled by: Ondřej Kohut (within the Theory of formal systems course)
Contents • Theory of sets (revision) • Relations andmappings (revision) • Relations • Binary relations on a set • Mappings • Partitions, equivalences • Orderings • Algebras • Algebraswith oneoperation • Algebraswith twooperations • Lattices Relace a algebry
Naive theory of sets • Language: • Special symbols: • Binary predicates: (is an element of), (is a proper subset of), (is a subset of) • Binary function symbols: (intersection), (union) • Cantor – the naive set theory (without axiomatization) • There are many formal axiomatizations, but none of them is complete. • Examples: von Neumann-Bernays-Gödel, Zermelo-Fränkel + axiom of choice Relace a algebry
Zermelo-Fränkel set-theory Axiom of extensionality: Two sets are the same if and only if they have the same elements. Axiom of empty set: There is a set with no elements. Axiom of pairing: If x, y are sets, then so is {x,y}, a set containing x and y as its only elements. Axiom of union: Every set has a union. That is, for any set x there is a set y whose elements are precisely the elements of the elements of x. Axiom of infinity: There exists a set x such that {} is in x and whenever y is in x, so is the union y U {y}. Axiom of separation (or subset axiom): Given any set and any proposition P(x), there is a subset of the original set containing precisely those elements x for which P(x) holds. Axiom of replacement: Given any set and any mapping, formally defined as a proposition P(x,y) where P(x,y) and P(x,z) implies y = z, there is a set containing precisely the images of the original set's elements. Axiom of power set: Every set has a power set. That is, for any set x there exists a set y, such that the elements of y are precisely the subsets of x. Axiom of regularity (or axiom of foundation): Every non-empty set x contains some element y such that x and y are disjoint sets. Axiom of choice: (Zermelo's version) Given a set x of mutually disjoint nonempty sets, there is a set y (a choice set for x) containing exactly one element from each member of x. Relace a algebry
Naive theory of sets • Ø – an empty set • Cardinality of a set A: |A| Relations between sets (axioms): • Equality • Inclusion Relace a algebry
Naive theory of sets – set theoretical operations • Intersection • Union • Difference • Symetrical difference • Complement with respect to universe U Relace a algebry
Naive theory of sets – set theoretical operations • Potential set • Cartesian product • Cartesian power A1=A, A0={Ø} n Relace a algebry
Relations • n-ary relation between the sets A1, A2, ..., An • Examples: • D = a set of possible days • M = a set of VŠB rooms • Z = a set of VŠB employees A ternary relation meeting (when, where, who): Relace a algebry
Binary relations • Inverse relation to r: • Composition of relations Relace a algebry
Binary relations A binary relation r on a set A is called: • Reflexive: x A: (x,x) r • Irreflexive: x A: (x,x) r • Symmetric: x,y A: (x,y) r (y,x) r • Antisymmetric: x,y A: (x,y) r and(y,x) r x=y • Asymmetric: x,y A: (x,y) r (y,x) r • Transitive: x,y,z A: (x,y) r and(y,z) r (x,z) r • Cyclic: x,y,z A: (x,y) r and(y,z) r (z,x) r • Linear: x,y A: x=y or (x,y) ror (y,x) r Relace a algebry
Binary relations The important types of binary relations: • Tolerance – reflexive, symmetric • Quasi-ordering – reflexive, transitive • Equivalence – reflexive, symmetric, transitive • Partial ordering – reflexive, antisymmetric, transitive Relace a algebry
Binary relations Examples: • Tolerance: • „to be akin to“ on a set of people, • „to have a different age no more than one year“ on the set of people, ... • Quasi-ordering: • „if it holds |X||Y|, then sets X and Y are in relation“ on a set of sets, • divisibility relation on a set of integers, • „not to be older“ on the set of people, ... • Equivalence: • „to be the same age“ on the set of people, • equivalence on a set of natural numbers, ... • Ordering: • inclusion relation, • divisibility relation on the set of natural numbers, ... Relace a algebry
Mappings (functions) • f A B is called a mappingfrom a set A into a set B (partial mapping), iff: (x A, y1,y2B) ( (x,y1) f and(x,y2) f y1 = y2) • f is called amapping of a set A into a set B (total mapping,written as:f: AB), iff: • f is mapping from A to B • (x A)(y A) ( (x,y) f) • If f is a mapping and (x,y) f, then we write:f(x)=y Relace a algebry
Mapping (functions) • Examples: u = {(x,y)ZZ; x=y2}, v = {(x,y)NN; x=y2}, w = {(x,y)ZZ; y=x2} • r, u – are not mappings • s, v – are partial mappings from A to B, (not total mappings) • t, w – are total mappings r A B s A B t A B Relace a algebry
Mapping (functions) Mapping f: AB is called • Injection (one to onemapping A intoB), iff: x1,x2A, y B: (x1,y) f and(x2,y) f x1 = x2 • Surjection (mapping A ontoB), iff: y B xA: (x,y) f • Bijection (one to onemapping A ontoB)(mutually single-valued), iff it is an injection and surjection. Relace a algebry
Mapping (functions) • Examples: j: ZZ, j(n)=n2, k: ZN, k(n)=|n|, l: NN, l(n)=n+1,m: RR, j(x)=x3 • f, j – is neither an injection nor a surjection • h, k – are surjections, but not injections • g, l – are injections, but not surjections • I,m – is an injection and a surjection bijections f: A B g: A B h: A B i: A B Relace a algebry
Partitions and equivalences • Partition on a set A is such a system that:X = {Xi; i I } • Xi A pro i I • XiXj = Ø pro i,j I, i j • U X = A Xi – classes of the partition • Refininment of a partition X = {Xi; i I } is a system that: Y = {Yj; j J }, iff: • j J, i I so that Yj Xi Relace a algebry
Partitions and equivalences • Let r be an equivalence relation on a set A, X is a partition on A, then it holds: • Xr = {[x]r; xA} – the partition on A (the partition induced by equivalence r, the factor setof the set A according to the equivalence r) • rX = {(x,y); x and y belongs to the same class of the partition X} – equivalence on A (induced by partition X) Examples: • r ZZ; r = {(x,y); 3 divides x-y} X={X1, X2, X3} • X1={…-6, -3, 0, 3, 6, …} • X2={…-5, -2, 1, 4, 7, …} • X3={…-4, -1, 2, 5, 8, …} Relace a algebry
Orderings • If r is an order relation on A, then a couple (A,r) is called an ordered set • Written as: (A, ) • Examples: (N, ), (2M, ) • Coverrelation Let (A, ) be an ordered set, (a,b)A a –< b („b covers a“), iff: a < b and c A: a c a c b • Examples: (N, ), –< ={(n,n+1); n N} Relace a algebry
Orderings • Hasse diagram –graphicalpicturing • Example: (A, ), A={a,b,c,d,e} r = {(a,b), (a,c), (a,d), (b,d)}idA idA={(a,a): aA} Relace a algebry
Orderings An element a of an ordered set (A, ) is called: • The least: for xA: a x • The greatest: for xA: x a • Minimal: for xA: (x a x = a) • Maximal: for xA: (a x x = a) • Examples: • The least: does not exist • The greatest: does not exist • Minimal: a, e • Maximal: d, c, e Relace a algebry
Orderings • A mapping of the ordered sets (A, ), (B, ) is called isomorphic, iff the bijection f: AB exists such that: x,yA: x y, iff f(x) f(y) • A mapping of the ordered sets (A, ), (B, ) is called isotonef: AB, when it holds: x,yA: x y f(x) f(y) • Examples: • f: NZ, f(x)=kx, k Z, k 0 is isotone • g: NZ, g(x)=kx, k Z, k 0 is not isotone Relace a algebry
Orderings • Let(A, ) be an ordered set, M A, then • LA(M)={x A;mM: x m} • A set of lower bounds • UA(M)={x A;mM: m x} • A set of upper bounds • InfA(M) – The greatest element of the set LA(M) • Infimum of the set M • SupA(M) – The least element of the set UA(M) • Supremum of the set M Relace a algebry
Lattices - lattice ordered sets • A set(A, ) is called a lattice (lattice ordered set), iff: x,yA s,i A : s = sup({x,y}), i = inf({x,y}) • Notation: • x y = sup({x,y}) • x y = inf({x,y}) • If sup(M) a inf(M) exist for everyM A, then (A, ) is called a complete lattice Relace a algebry
Algebras Algebra (abstract algebra) is couple: (A, FA): • A Ø – an underlying set of algebra • FA = {fi: Ap(fi)A; iI} – a set of operations on A • p(fi) – an arity of operation fi • Examples: • (N, +2,2) the set of natural numbers with the addition and multiplication operations • (2M, , )the set of all subsets of a set M with the intersection and union operations • (F, , ) The set (F) of the propositional logic formulas with the conjunction and disjunction operations Relace a algebry
Algebras with one binary operation Grupoid G=(G,) • : G G G • If a set G is finite, then the grupoid G is called finite • Order of a grupoid = |G| Examples of grupoids: • G1=(R,+), G2=(R,), G3=(N,+) ... Relace a algebry
Algebras with one binary operation • We can express the finite grupoid G=(G,) byCayley table • Example: • G = {a,b,c} • For example: a b = b, b a = a, c c = b ... Relace a algebry
Algebras with one binary operation Let G=(G,) is grupoid, G is called: • Commutative, if it holds: • (a,bG)(a b = b a) • Associative, if it holds: • (a,b,cG)((a b) c = a (b c)) • With a neutral element, if it holds: • (e G aG)(a e = a = e a) • With an aggressive element, if it holds: • (o G aG)(a o = o = o a) • With inverse elements, if it holds: • (aG b G)(a b = e = b a) Relace a algebry
Algebras with one binary operation Examples: • (R,), (N,+) – commutative and associative • (R,), a b = (a+b) / 2 – commutative, not associative • (R,), a b = ab– neither commutative nor associative • (R,) – 1 = the neutral element, 0 = the aggressive element Relace a algebry
Algebras with one binary operation Let G=(G,G) be a grupoid. HG is called closed (with respect to the operation G), if it holds: • (a,bH)(a Gb H) A Grupoid H=(H,H) is a subgrupoid of a grupoid G=(G,G), if it holds: • Ø H G is closed • a,bH: a Hb = a Gb • Examples: • (N,+N) is a subgrupoid of (Z,+Z) • {0,1,2} is not the base set of a podgrupoid (Z,+Z) Relace a algebry
Algebras with one binary operation • Let G1=(G1, 1), G2=(G2, 2) be a grupoids. • G1 G2 =(G1 G2, ) – direct product G1 andG2, where: • (a1, a2) (b1, b2) = (a1 1b1, a2 2b2) Examples: • G1=(Z,+), G2=(Z,). • G1 G2 =(Z Z, ), • (a1, a2) (b1, b2) = (a1 + b1, a2 b2) • (1,2)(3,4) = (1+3, 2 4) = (4,8) and so on. Relace a algebry
Algebras with one binary operation • Let G =(G, G), H =(H, H) be grupoids and h:GHbe a mapping. • h is called homomorphism of grupoid G into grupoid H, if it holds: • a,bG: h(a Gb) = h(a) Hh(b) The types of homomorphism: • Monomorphism – h is injective • Epimorphism – h is surjective • Isomorphism – h is bijective • Endomorphism – H=G • Automorphism – is bijective and H=G Examples: • (R,+), h(x)= -x , h is automorfismus (R,+) into itself • h(x+y) = -(x+y) = (-x) + (-y) = h(x) + h(y) Relace a algebry
Algebras with one binary operation r is called a congruence on a grupoid G=(G,G), iff: • r is a binary relation: θ GG • r is an equivalence • (a1, a2), (b1, b2) r (a1 Gb1, a2 Gb2) r A factor grupoid of grupoid G according to the congruence r: G/r=(G/r,G/r), [a]rG/r[b]r = [a Gb]r Examples: • r ZZ; r = {(x,y); 3 divides x-y} • r is a congruence on (Z,+) Relace a algebry
Algebras with one binary operation The types of grupoids: • Semigroup – an associative grupoid • Monoid – a semigroupwith the neutral element • Group – a monoid with the inverse elements • Abelian group– a commutative group Examples: • (Z, –) – grupoid, not a semigroup • (N – {0}, +) – semigroup, not a monoid • (N,) – monoid, not a group • (Z, +) – Abelian group Relace a algebry
Algebras with two binary operation Algebra (A,+,·) is called a Ring, if it holds: • (A,+) is commutative group • (A,·) is monoid • For a,b,cA it holds: a·(b+c)=a·b+a·c, (b+c)·a=b·a + c·a • If |A|>1, then (A,+,·) is called a non-trivial ring. • Let 0 A is the neutral element of group (A,+). Then 0 is called the ring zero (A,+,·). • Let 1A is the neutral element of monoid (A,·). Then 1 is called the ringunit (A,+,·). Relace a algebry
Algebras with two binary operation A ring (A,+,·) is called afield, if it holds: • (A - {0},·) is a commutative group Examples: • (Z,+,·) – a ring, not a field • (R,+,·), (C,+,·) – fields Relace a algebry
Lattice – algebraic structure • Lattice L = (L, , ) • : L LL, : L LL • x, y, z L it holds: Relace a algebry
Lattice – algebraic structure Let (A, , ) be a lattice, (B, ) be a lattice ordered set • Let us define a relation on A : a b, iff a b = b • Let us define the relations and on B a b = sup{a,b}, a b = inf{a,b}, Then itholds: • (A, ) is a lattice ordered set, where: sup{a,b}= a b, inf{a,b}= a b • (B, , ) is a lattice • (A, , ) = (A, , ) Relace a algebry
Lattice – algebraic structure A lattice (L, , ) is called: • Modular, if it holds: x, y, z L : x z x (y z) = (x y) z • Distributive, if it holds: x, y, z L : x (y z) = (x y) (x z) x (y z) = (x y) (x z) • Complementary, if it holds: : There is the least element 0 L and the greatest element 1 L x L x’ L : x x’ = 0, x x’= 1 x’ iscalled a complement of an element x Relace a algebry
Lattice – algebraic structure • Each distributive lattice is modular Examples: • M5 (diamond) – a modular lattice which is not distributive • N5 (pentagon) – is not modular M5 N5 Relace a algebry
Lattice – algebraic structure Lattice (L, , ) is called Boolean lattice, when it is: • Complementary, distributive, with the least element 0 L and with thegreatest element 1 L Boolean algebra: • (L, , , –, 0, 1), – : LL is an operation of complement in L Example: • (2A, , ), A = {1,2,3,4,5,6,7} Relace a algebry