Discrete mathematics I - Relations

Discrete mathematics I - Relations
Emil Vatai <[email protected]> (based on hungarian slides by László Mérai)∗
February 21, 2017
Outline
Contents
1 Ordered pairs
1
2 Relations
2
3 Composition
5
4 Properties of relations
6
5 Equivalence and classification
7
6 Ordering
9
7 Functions
15
1
Ordered pairs
The idea of a relation
Describes:
• Connection/relation between objects
• Generalized function/maping
• “Multivalued” functions
Examples:
• equals, is less or equal, divides, is sitting next to etc.
∗ Financed
from the financial support ELTE won from the Higher Education Restructuring
Fund of the Hungarian Government.
1
Ordered pairs, Cartesian product
Definition (Ordered pair)
• The ordered pair (x, y) is defined as the set {x}, {x, y}
• x is the first and y is the second element (or coordinate)
• Important: (x, y) = (u, v) ⇔ (x = u) ∧ (y = v)
• If x, y ∈ X then (x, y) ∈ ℘ ℘(X)
• Counter example: {x, y} is not an ordered pair because {x, y} = {y, x}
but (x, y) 6= (y, x). (which we don’t want!)
Cartesian product
Definition (Cartesian product)
• The Cartesian product of two sets X and Y is the set of all possible ordered
pairs with the first element from X and the second from Y i.e.
X × Y = (x, y) ∈ ℘ ℘(X ∪ Y ) : x ∈ X ∧ y ∈ Y
Example
• {a, b} × {1, 2, 3} = (a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)
2
Relations
Binary relations
Definition (Binary relation)
• A binary relation is a set of ordered pairs.
• If the binary relation R is a subset of X × Y , that it is a relation between
X and Y .
– If X = Y then it is said to be a homogeneous relation
• The fact that (x, y) ∈ R is often written as xRy
Examples:
• IX = {(x, x) ∈ X × X : x ∈ X} is the equation relation.
• {(x, y) ∈ Z × Z : x | y} is the divisibility relation.
• For the system of sets F the set {(X, Y ) ∈ F × F : X ⊂ Y } is the subset
relation.
• Given a f : R → R function, the graph of the function {(x, f (x)) ∈ R × R :
x ∈ R}.
2
Domain and range
Definition (Domain and range)
The domain of a the binary relation R ⊂ X × Y is dmn(R) = {x : ∃y(x, y) ∈ R}
and the range of R is rng(R) = {y : ∃x(x, y) ∈ R}.
Example
• If R = {(x, 1/x2 ) : x ∈ R}, then dmn(R) = {x ∈ R : x 6= 0}, rng(R) =
{x ∈ R : x > 0}.
• If R = {(1/x2 , x) : x ∈ R}, then dmn(R) = {x ∈ R : x > 0}, rng(R) =
{x ∈ R : x 6= 0}.
• If R = (a, 1), (b, 1), (b, 3) , then dmn(R) = {a, b}, rng(R) = {1, 3}.
Extension, restriction and inverse of relations
Definition (Extension, restriction)
A binary relation R is the extension of the binary relation S, or S is a restriction
of R, if S ⊂ R. If A is a set, then the restriction of R to A is R|A = {(x, y) ∈
R : x ∈ A}.
Example
√
Let R = {(x2 , x) ∈ R × R : x ∈ R}, S = {(x, x) ∈ R × R : x ∈ R}.
Then R is the extension of S, and S is a restriction of R and S = R|R+
0
(where R+
0 is the set of non-negative real numbers).
Definition (Inverse)
The inverse of a relation R is R−1 = {(y, x) : (x, y) ∈ R}.
Example
√
R−1 = {(x, x2 ) ∈ R × R : x ∈ R}, S −1 = {( x, x) ∈ R × R : x ∈ R}
Image and preimage
Definition (Image and inverse image)
• Let R ⊂ X × Y be a binary relation, A ⊂ X. The image of A under R is
R(A) = {y ∈ Y : ∃x(x ∈ A ∧ (x, y) ∈ R)}.
• The inverse image or preimage of a given set B, is R−1 (B), i.e. the image
of the set B under the relation R−1 .
Example
√
Let R = {(x2 , x) ∈ R × R : x ∈ R}, S = {(x, x) ∈ R × R : x ∈ R}.
• R({9}) = {−3, +3} (or more compact R(9) = {−3, +3}),
• S(9) = {+3}.
3
Example (Domain, Range, Restriction)
Example
Let R be a relation on the set X = {A, B, C, . . . , P } and let T → T 0 , if (T, T 0 ) ∈
R.
• dmn(R) = {A, B, C, D, F, . . . , H}.
• rng(R) = {A, B, C, E, . . . , J, L}.
• R|{A,B,C,D} = {(A, B), (B, C), (C, A), (D, E), (D, F )}
A
M
C
D
G
I
B
E
F
H
J
L
K
4
N
O
P
3
Composition
Composition
Definition (Composition)
Let S ⊂ X × Y and R ⊂ Y × Z be binary relations.
n Then the R ◦ S composition
(or product) is the following relation: R ◦ S = (x, z) ∈ X × Z : ∃y (x, y) ∈
o
S ∧ (y, z) ∈ R .
• Note: For composition we write the relations “from right to left”:
• Note: (R ◦ S)(A) = R(S(A))
Example
Let Rsin = {(x, y) ∈ R × R : sin x = y}, Slog = {(x, y) ∈ R × R : log x = y}.
Then
• Rsin ◦ Slog = {(x, y) : ∃z(log x = z ∧ sin z = y)}
• Rsin ◦ Slog = {(x, y) ∈ R × R : sin log x = y}.
Example (Composition)
A
B
C
D
E
F
G
K
L
H
I
J N
M
O
Composition
R ◦ S = {(x, z) : ∃y((x, y) ∈ S ∧ (y, z) ∈ R)}
Let S, R be two relations, and let us consider the T = R ◦ S composition:
Database example
In a company let a, b, c, . . . , j denote the employees. The company is working
on two projects: bank, game
assignment
manager
programmer
tester
hr
tech.employee
5
employee
a, b
c, d, e
f, g, h
i
j
project
bank
game
employee
a, c, d, f
b, d, e, f, g, h
deadline
31. dec. 2014
31. jan. 2015
Let α be the assignment relation: e.g. bαmanager, π the project relation: e.g.
aπbank, δ the deadline relation: e.g. bankδ31.dec
• Questions: Who is working on the bank project? π −1 (bank) Who are the
testers?
α−1 (tester) What is the bank projects deadline? δ(bank) Which deadlines do
the employees have? δ◦π Which deadlines do the testers have? δ◦π◦α−1 (tester)
Properties of conditions
Theorem 1 (Properties of composition). Let T ⊂ W × X, S ⊂ X × Y , R ⊂
Y × Z be binary relations. Then
1. If rng(S) ⊃ dmn(R), then rng(R ◦ S) = rng(R).
2. R ◦ (S ◦ T ) = (R ◦ S) ◦ T (the composition is associative).
3. (R ◦ S)−1 = S −1 ◦ R−1 .
Proof.
1. rng(R) = {z : ∃y (y, z) ∈ R}. Since rng(S) ⊃ dmn(R), then for
each (y, z) ∈ R we have ∃x : (x, y) ∈ S, so (x, z) ∈ R ◦ S
2. S ◦ T = {(w, y) : ∃x((w, x) ∈ T ∧ (x, y) ∈ S)}, so R ◦ (S ◦ T ) = {(w, z) :
∃y((w, y) ∈ S ◦ T ∧ (y, z) ∈ R)} = {(w, z) : ∃y∃x((w, x) ∈ T ∧ (x, y) ∈
S ∧ (y, z) ∈ R)} = (R ◦ S) ◦ T
3. (R ◦ S)−1 = {(z, x) : ∃y((x, y) ∈ S ∧ (y, z) ∈ R)} = {(z, x) : ∃y((y, x) ∈
S −1 ∧ (z, y) ∈ R−1 )} = S −1 ◦ R−1
4
Properties of relations
Properties of relations
Example relations: =, <, ≤, |, ⊂ and T = {(x, y) ∈ R × R : |x − y| < 1}.
Definition (Relation properties)
Let R ⊂ X × X. ∀x, y, z the relation is
1. R tansitive, if xRy ∧ yRz ⇒ xRz;
2. R symmetric, if xRy ⇒ yRx;
(=, <, ≤, |, ⊂)
(=, T )
3. R anti-symmetric, if xRy ∧ yRx ⇒ x = y;
(=, ≤, ⊂)
4. R strictly anti-symmetric, xRy ⇒ ¬yRx; (<)
5. R reflexive, if x ∈ X ⇒ xRx;
(=, ≤, |, ⊂, T )
6. R irreflexive, if x ∈ X ⇒ ¬xRx;
(<)
7. R trichotomous, if x, y ∈ X implies that from x = y, xRy and yRx exactly
one is true; (<)
8. R dichotomous, if x ∈ X ∧ y ∈ X ⇒ xRy ∨ yRx;
6
(=, ≤)
Properties of relations
The properties reflexive, irreflexive, trichotomous, dichotomous don’t depend
only on the relation but the base sets also:
The relation {(x, x) ∈ R × R, x ∈ R} ⊂ R × R ⊂ C × C defined on R is
reflexive, but if defined on C then it is not reflexive.
X
a
X
a
b
b
c
c
transitive: NO
symmetric: NO
anti-symmetic: Y ES
X
a
b
c
strictly anti-symmetric: NO
reflexive: NO
irreflexive: NO
trichotomous: NO
dichotomous: NO
Graph of relations
The graph of a relation can be simplified:
• If a relation is reflexive, the loops can be omitted. x | y:
2
3
4
5
6
7
8
• If a relation is transitive, implied edges can be omitted. x | y
2
3
4
5
6
7
8
• If a relation is symmetric, directed edges can be replaced with directionless
edges (lines). 3 | x − y
2
5
3
4
5
6
7
8
Equivalence and classification
Equivalence relations and Classification
Definition (equivalence relation)
Let X be a set, R ⊂ X × X a relation on X. The relation R is an equivalence
relation, if it is reflexive, symmetric, transitive.
Example
7
• 1. =
2. 3 | x − y
3. two similar triangles.
Definition (Classification)
A system of sets C containing subsets of the set X is a classification of X, if C
is pairwise disjoint system of non-empty sets and ∪C = X.
Examples
Equivalence relations
1. Equality on R.
2. x ∼ y ⇔ 3 | x − y for x, y ∈ Z.
3. Two lines in the two-dimensional plane are in relation if they have the
same length.
4. Two lines in the two-dimensional plane are in relation if they are parallel
to each other.
Corresponding classes
{a} : a ∈ R ;
2. A classification of Z: {0, 3, 6, . . .}, {1, 4, 7, . . .}, {2, 5, 8, . . .} ;
1. A classification of R:
3. Different lengths in the two-dimensional plane.
4. Different directions
Equivalence relations imply classification
Theorem 2 (Each equivalence relation defines a classifications). For every
equivalence relation ∼ on the set X the equivalence classes x̃ = {y ∈ X : y ∼ x}
(for x ∈ X), yield a classification of X, which is denoted by X/∼.
Proof. Let ∼ be an equivalence relation on X. We have to show that X/∼ =
{x̃ : x ∈ X} is a classification of X.
S
• Since ∼ is reflexive, x ∈ x̃ ⇒ x x̃ = X.
• Equivalence classes are pairwise disjoint. Suppos x̃ ∩ ỹ 6= ∅, let z ∈ x̃ ∩ ỹ.
Since z ∈ x̃ ⇒ z ∼ x, implying because of symmetry that x ∼ z. Similarly
z ∈ ỹ ⇒ z ∼ y. Because of transitivity x ∼ z ∼ y ⇒ x ∼ y ⇒ x ∈ ỹ.
Simmilarly y ∈ x̃ ⇒ x̃ = ỹ.
8
Classifications imply equivalence relations
Theorem 3 (Each classification defines an equivalence relation). Foe each classification C of X the relation R = ∪{Y × Y : Y ∈ C} is an equivalence relation,
with C as its associated equivalence classes.
Proof.
• R is reflexive: let the class of x be Y : x ∈ Y ∈ C. Then (x, x) ∈
Y ×Y.
• R is symmetric: let (x, y) ∈ R. Then x, y ∈ Y for some Y class, in
particular (y, x) ∈ Y × Y .
• R is transitive: similarly let (x, y), (y, z) ∈ R, therefore x, y ∈ Y , y, z ∈ Y 0 .
Since the classes are pairwise disjoint, Y = Y 0 , in particular z ∈ Y , i.e.
(x, z) ∈ Y × Y .
6
Ordering
Partial ordering
Definition (Partial ordering)
A reflexive, transitive and anti-symmetric relation defined on the set X is a
partial ordering. (symbol: ≤, 4, . . . )
Elements x, y ∈ X are comparable if x y or y x.
Definition (Total ordering)
If all elements are comparable, the relation is dichotomous.
A reflexive, transitive, anti-symmetric and dichotomous relation defined on
the set X is a total ordering (or just ordering).
Examples
• R with ≤ is a total ordering: ∀x, y ∈ R: x ≤ y or y ≤ x.
• On Z the | (divisor) relation is a partial ordering: 4 - 5, 5 - 4.
• On ℘(X) the ⊂ relation is a partial ordering X = {a, b, c}, {a} 6⊂ {b, c},
{b, c} 6⊂ {a}
Strict and non-strict relations
Definition (Strict and non-strict relations)
The strict relation associated with the relation R defined on the set X is S if
xSy ⇔ xRy ∧ x 6= y.
The non-strict relation associated with the relation R defined on the set X
is T if xT y ⇔ xRy ∨ x = y.
Another formulation: S = R \ IX , T = R ∪ IX , where IX = {(x, x) : x ∈ X}.
Examples
• The strict relation associated with ≤ is: <.
9
• The strict relation associated with ⊂ is: (.
• The strict relation associated with the divisor relation is: non-trivial divisor.
Strict and non-strict partial ordering
Definition (Strict partial ordering)
A transitive and irreflexive relation defined on the set X is a strict partial
ordering. (symbol: < , ≺, . . . )
Remark
• Transitive and irreflexive implies strictly anti-symmetric: x ≺ y, y ≺ x
and transitivity implies x ≺ x, which is a contradiction.
• The strict version of a partial ordering is the associated stric ordering and
conversely: ≺= \IX , =≺ ∪IX .
Strict and non-strict ordering
Statement
If the relation is an ordering, then ≺ is trichotomous.
Conversely, if ≺ is a trichotomous strict partial ordering, then the corresponding non-strict partial ordering is a (total) ordering.
Proof
We need x = y, x ≺ y and y ≺ x not to be true simultaneously. If x = y, then
the statement is true because of the definition of ≺. But x ≺ y and y ≺ x can
not be true simultaneously because of strict anti-symmetry.
Conversely, because of the trichotous property, for each pair of elements we
have x ≺ y ∨ x = y or y ≺ x ∨ x = y, which is the definition of x y or y x.
Intervals
Definition (Intervals)
Let (X, ) be a partially ordered set.
• z is between x and y if x z and z y,
• z is strictly between x and y if x ≺ z and z ≺ y.
The set of such elements is denoted by [x, y] that is (x, y) or ]x, y[.
• [x, y] = {z ∈ X : x z ∧ z y}
• (x, y) =]x, y[= {z ∈ X : x ≺ z ∧ z ≺ y}
Analog notations are [x, y), and (x, y].
• [x, y) = [x, y[= {z ∈ X : x z ∧ z ≺ y}
• (x, y] =]x, y] = {z ∈ X : x ≺ z ∧ z y}
10
Examples
Examples
Let X = ℘({a, b, c}) with the subset relation.
• [{a}, {a, b, c}] = {a}, {a, b}, {a, c}, {a, b, c}
• ({a}, {a, b, c}) = {a, b}, {a, c},
Let X be the set of positive integers with the divisor relation.
• [2, 12] = 2, 4, 6, 12
• (2, 12) = 4, 6
Immediate predecessor and successor
Definition (Immediate predecessor and successor)
If x ≺ y, but there are no elements strictly between x and y, then x precedes y
and y succeeds x i.e. x is the predecessor of y and y is the successor of x.
Example
• For ℘({a, b, c}) with ⊂: {a} precedes {a, b} and {a, c}.
• For N with divisibility: 2 precedes 4, 6, 10, 14.
Definition (Initial segment)
The subset {y ∈ X : y ≤ x} is the initial segment associated with the element
x.
Example
Let X the power set of {a, b, c} with the subset
relation. Then the initial segment
associated with {a, b} is: ∅, {a}, {b}, {a, b}
Hasse-diagram
In a Hasse-diagram of a partially ordered set, the elements are represented
as dots and there is a directed edge (an arrow) from every x to y if x is the
immediate predecessor of y. Alternatively, the arrows can be omitted if the
“smaller” elements are lower on the diagram. Example: divisibility on [1, 8].
5
1
7
2
8
3
6
4
11
8
7
4
6
5
2
3
1
Least, greatest, minimum, maximum element
Definition(Least, greatest, minimal, maximal elements)
In the partially ordered set X we define x ∈ X to be the
• least element if ∀y (y ∈ X ⇒ x y);
• greatest element if ∀y (y ∈ X ⇒ y x);
• min. elem. if ∀y (y ∈ X ⇒ ¬(y x)) i.e. ¬∃y (y ∈ X ∧ y ≺ x);
• max. elem. if ∀y (y ∈ X ⇒ ¬(x y)) i.e. ¬∃y (y ∈ X ∧ x ≺ y);
Example
Let X = {1, 2, . . . , 8} with divisibility:
• least element: 1
• greatest element: none
• minimal element: 1
• maximal elements: 5, 6, 7, 8
8
7
4
6
5
2
3
1
12
Least, greatest, minimum, maximum element
Remarks
• There is at least one minimal and maximal element.
• There can be at most one least and greatest element.
• If the set is (totally) ordered, then
– minimal = least element, maximal = greatest element
• If the set X has a unique minimal or maximal element, then it is denoted
by min X and max X.
Example
Let X = {1, 2, . . . , 8} with divisibility:
• minimal element: 1, so min X = 1
• maximal elements: 5, 6, 7, 8 there is no max X
8
7
4
6
5
2
3
1
Bounds
Definition (Bounds)
Let (X, ) be a partially ordered set x ∈ X and Y ⊂ X.
• x is a lower bound of Y if ∀y (y ∈ Y ⇒ x y),
• x is an upper bound of Y if ∀y (y ∈ Y ⇒ y x),
• The least upper bound of Y is the supremum of Y i.e. sup Y ,
• The greatest lower bound of Y is the infimum of Y i.e. inf Y .
Example
Let X = {1, 2, . . . , 8} with divisibility:
• for Y = {1, 2, 3}
– lower bound: 1, upper bound: 6,
13
– infimum: 1, supremum: 6.
• for Y = {2, 3, 4}
– lower bound: 1, upper bound: ∅,
– infimum: 1, supremum: none.
8
7
4
6
5
2
3
1
Least-upper-bound property
Definition (LUB and GLB property)
Let (X, ) be a partially ordered set.
• X has the least-upper-bound property, if every non-empty Y ⊂ X has a
supremum,
• X has the greatest-lower-bound property, if every non-empty Y ⊂ X has
an infimum,
Examples
The set N with divisibility has the least-upper-bound property:
• If Y = {n1 , n2 , . . . , nk } then inf Y = gcd(n1 , n2 , . . . , nk ) and sup Y =
lcm(n1 , n2 , . . . , nk ).
The set (Q, ≤) does not have the least-upper-bound property:
√
• If Y = {y ∈ Q : y 2 ≤ 2} = {y ∈ Q : y ≤ 2} then √
Y has upper
bounds
√
(e.g. 2, 10, 42) but the least upper bound would be 2 and 2 6∈ Q.
Well ordered sets
Definition
A partially ordered set (X, ) is well ordered if every non-empty subset of X
has a least element.
Examples
• (N, ≤) is well ordered
• (R, ≤) is not well ordered: e.g. (0, 1) has no least element.
14
7
Functions
Definition
Definition (Functions)
• A relation f ⊂ X × Y is a function (or map, operator, transformation) if
(x, y) ∈ f ∧ (x, y 0 ) ∈ f ⇒ y = y 0 (for all x ∈ X and y ∈ Y ).
• Since f ({x}) has at most one element the f (x) = y (of x 7→ y or fx = y)
notation is used.
Examples
• f = {(x, x2 ) ∈ R × R : x ∈ R} is a function, and f is the x 7→ x2 map or
f (x) = x2 .
• The inverse f −1 is not a function because (4, 2), (4, −2) ∈ f −1 .
• Any sequence is a mapping from N. E.g. the Fibonacci sequence F is a
mapping from N to N and F0 = 0, F1 = 1 and Fn+2 = Fn+1 + Fn .
Set of functions
Notation
The set of functions f ⊂ X × Y is denoted as X → Y . So f ∈ X → Y is a
map from X to Y and if dmn(f ) = X then the f : X → Y notation is used. (If
f : X → Y , then rng(f ) ( Y is still possible.)
Examples
√
If f (x) = x then,
• f ∈ R → R is correct.
• f : R → R is NOT correct because dmn(f ) = [0, ∞) = R+
0.
• f : R+
0 → R is correct!
Injective, surjective and bijective
Definition (Injective, surjective and bijective)
• The function f : X → Y is
– injective (or invertable), if f (x) = y ∧ f (x0 ) = y ⇒ x = x0 ;
– surjective, if rng(f ) = Y ;
– bijective, if it is injective and surjective.
• A bijective function f : X → X is a permutation of X.
Remarks:
• f is injective if and only if the relation f −1 is a function.
• Whether a function f : X → Y is surjective, depends on Y . If Y ( Y 0 ,
then f ⊂ X × Y ⊂ X × Y 0 , and f : X → Y 0 is surely not surjective.
15
Example
Example
• The function f : R → R, f (x) = x2 is not injective and not surjective:
f (−1) = f (1), rng(f ) = R+
0.
2
• The function f : R → R+
0 , f = x 7→ x is not injective but it is surjective.
+
2
• The function f : R+
0 → R0 , f : x 7→ x is injective and surjective, therefor
it is also bijective.
Composition of functions
Theorem 4 (Properties of the composition of functions).
functions, then g ◦ f is also a function.
1. If f and g are
2. If f and g are injective, then g ◦ f is also injective.
3. If f : X → Y , g : Y → Z, then g ◦ f : X → Z.
Proof. Let h = g ◦ f .
1. Let (x, y) ∈ h, (x, y 0 ) ∈ h: ∃z ((x, z) ∈ f ∧ (z, y) ∈ g), ∃z 0 ((x, z 0 ) ∈
f, (z 0 , y 0 ) ∈ g). Since f is a function z = z 0 , since g is a function y = y 0 .
2. Let h(x) = h(x0 ). Let f (x) = y, f (x0 ) = y 0 , so g(y) = g(y 0 ). Since g is
injective: y = y 0 . Since f injective: x = x0 .
3. HW.
Monotonic functions
Definition (Monotonic functions)
Let X, Y be partially ordered sets. The function f : X → Y is
• monotonically increasing, if x, y ∈ X ∧ x y ⇒ f (x) f (y);
• strictly increasing, if x, y ∈ X ∧ x ≺ y ⇒ f (x) ≺ f (y);
• monotonically decreasing, if x, y ∈ X ∧ x y ⇒ f (x) f (y);
• strictly decreasing, if x, y ∈ X ∧ x ≺ y ⇒ f (x) f (y).
Example
Example
• Let X = R with the usual ordering. Then f (x) = x3 is a strictly increasing
function.
• Let X = Z with the divisor relation. Then f (x) = 5x is a strictly increasing function: x | y ⇒ 5x | 5y.
• Let X = ℘({a, b, c}) with the subset partial ordering. Then
– f (A) = A\{a} monotonically increasing: A ⊂ B ⇒ A\{a} ⊂ B\{a};
– g(A) = A is strictly decreasing: A ( B ⇒ A ) B.
16
Monotonic functions
Remarks
Let X, Y be ordered sets and f : X → Y .
• If f is a strictly increasing (or decreasing) function then f is also injective:
If x 6= y then x ≺ y ∨y ≺ x then f (x) ≺ f (y)∨f (y) ≺ f (x) so f (x) 6= f (y).
• If f is a strictly increasing (or decreasing) function then f −1 is also a
strictly increasing (or decreasing) function: Since f is injective, f −1 is a
function. If f (x) ≺ f (y), then x y can not be true.
Operations
Definition (Binary operation)
A binary operation (operation with two variables) defined on the set X is a
⊗ : X × X → X function. Often x ⊗ y is used instead of ⊗(x, y).
A unary operation defined on the set X is a ⊗ : X → X function.
Example
• +, · are binary and z 7→ −z is a unary operation on the set R.
• ÷ (division) is not an operation on R, because dmn(÷) 6= R × R.
• ÷ is a binary, and x 7→ 1/x (reciprocal) is a unary operation on the set
R∗ = R \ {0}.
Operations
On a finite set, operations can be given with the operation table.
∧
0
1
0
0
0
∨
0
1
1
0
1
0
0
1
⊕
0
1
1
1
1
0
0
1
1
1
0
¬
0
1
1
0
Definition (Operations on functions)
Let X be an arbitrary set, Y a set with the ⊗ : Y × Y → Y operation, f, g :
X → Y two functions. Then
(f ⊗ g)(x) = f (x) ⊗ g(x)
Example
(sin + cos)(x) = sin x + cos x
17
Properties of operations
Definition (Properties of operations)
The operation ⊗ is associative, if (a ⊗ b) ⊗ c = a ⊗ (b ⊗ c); commutative, if
a ⊗ b = b ⊗ a.
Example
• The operations + and · operation is associative and commutative on the
set R.
• The function composition as an operation, is associative: (f ◦ g) ◦ h =
f ◦ (g ◦ h).
• The function composition as an operation, is not commutative: f (x) =
x + 1, g(x) = x2 : x2 + 1 = (f ◦ g)(x) 6= (g ◦ f )(x) = (x + 1)2 .
• Division is not associative:
a
bc
= (a ÷ b) ÷ c 6= a ÷ (b ÷ c) =
ac
b .
Structure preserving maps
Definition
Let X be a set with the ⊗ operation, Y with the ⊕ operation. The ϕ : X → Y
function is structure-preserving or a homomorphism, if ϕ(x ⊗ y) = ϕ(x) ⊕ ϕ(y).
Example
• Let X = R with the + operation, Y = R+ with the · operation. Then
x 7→ ax is a homomorphism ax+y = ax · ay .
• Let X = Z with the + operation, Y = Z3 with the +3 (addition modulo
3) operation. Then n 7→ n mod 3 is homomorphism: k + n mod 3 =
(k mod 3) +3 (n mod 3).
• Let X = {>, ⊥} with the ⊕ or ∧ operation, Z2 with the +2 or ·2 operation.
Then ⊥7→ 0, > 7→ 1 is a homomorphism.
18