Harvard University, Math 101, Spring 2015 Binary relations and Functions
1 Binary Relations
Intuitively, a binary relation is a rule to pair elements of a sets A to element of a set B. When two elements a ∈ A is in a relation to an element b ∈ B we write a R b . Since the order is relevant, we can completely characterize a relation R by the set of ordered pairs (a, b) such that a R b. This motivates the following formal definition:
Definition A binary relation between two sets A and B is a subset of the Cartesian product A×B. In other words, a binary relation is an element of P(A × B). A binary relation on A is a subset of P(A2). It is useful to introduce the notions of domain and range of a binary relation R from a set A to a set B:
• Dom(R) = {x ∈ A : ∃ y ∈ B xRy} Ran(R) = {y ∈ B : ∃ x ∈ A : xRy}.
2 Properties of a relation on a set
Given a binary relation R on a set A, we have the following definitions:
• R is transitive iff
∀x, y, z ∈ A :(xRy and yRz) =⇒ xRz.
• R is reflexive iff ∀x ∈ A : x Rx
• R is irreflexive iff ∀x ∈ A : ¬(xRx)
• R is symmetric iff ∀x, y ∈ A : xRy =⇒ yRx
• R is asymmetric iff
∀x, y ∈ A : xRy =⇒ ¬(yRx).
1 • R is antisymmetric iff ∀x, y ∈ A :(xRy and yRx) =⇒ x = y.
In a given set A, we can always define one special relation called the identity relation. It is defined by the diagonal set:
IdA = {(x, x): x ∈ A}.
3 Partitions and Relation of equivalences
A binary relation on a set A is said to be a relation of equivalence if it is reflexive, transitive and symmetric. R is reflexive : ∀x ∈ A : xRx R is a relation of equivalence ⇐⇒ R is transitive : ∀x, y, z ∈ A xRy ∧ yRz =⇒ xRz R is symmetric : ∀x, y ∈ A : xRy =⇒ yRx A partition of a set A is by definition a union of subsets Ai that cover A but do not intersect each other: [ A = Ai, ∀i, j, Ai ∩ Aj = ∅. i Given a relation of equivalence, we denote by Cl(x) the class of equivalence of an element x: Cl(x) = {y ∈ A : xRy}. Two elements have the same class if and only if they are in relation:
Cl(x1) = Cl(x2) ⇐⇒ x1Rx2. This is a direct consequence of transitivity and symmetry. We can show (Pset 4) that given a relation of equivalence on a set A, its classes of equivalence form a partition of the set A.
4 Total and partial order
A binary relation on a set A is said to be a relation of order if it is reflexive, transitive and anti- symmetric. R is reflexive R is a relation of order ⇐⇒ R is transitive R is antisymmetric If the domain of the relation is the full set A, the order relation is said to be a total order, otherwise it is called a partial order: ( total order if and only if dom R = A A relation of order R is said to be a partial order if dom R 6= A We usually use ” ≤ ” for a relation of order. In that case we use “<’” for the corresponding strict order: x < y ⇐⇒ (x ≤ y ∧ x 6= y). A strict order is transitive,irreflexive and asymmetric: R is irreflexive R is a relation of strict order ⇐⇒ R is transitive R is asymmetric
2 • A set endowed with a partial order is sometimes called a partially ordered set or more briefly a poset.
• In a poset, two elements are said to be comparable if and only if
x ≤ y or y ≤ x.
From that point of view, a total order is an order in which all elements are comparable.
• A subset of a poset containing elements that are all comparable to each other is called a chain.
• In a poset, a subset such that any two distinct elements are not comparable to each other is called an anti-chain.
• In a poset, an element x is said to be a maximal element if and only if
∀y ∈ A : y comparable to x =⇒ y ≤ x
In other words, @y ∈ A : x ≤ y
• In a poset, an element x is called a minimal element if and only if
∀y ∈ A :(y comparable to x) =⇒ x ≤ y
or equivalently @y ∈ A : y ≤ x
• An element y is said to cover an element x if and only if
(x ≤ y) ∧ @z ∈ A : x < z < y.
In other words, the interval (x, y) is empty. We also say that x is covered by y, this is denoted by x <: y.
5 Functions
A function is a binary relation between two sets A and B such that any element of A is in a relation with one and only one element of B:
∀ x ∈ A∃! y ∈ B : xRy
We recall that the notation ∃! means “there exists one and only one”. This definition of a function implies that the domain of the relation R is all of A and that for any element y of the range of the relation, the equation xRy has one and only one solution.
Notation: If xRy and R is a function, we write y = R(x) since y is uniquely defined by x. Then y is called the image of x. We also write f : A → B for a function from a set A to a set B. In the traditional definition of a function, A is the domain of the function: any element of A admits one and only one image in B. B is sometimes called the co-domain or target space of the function.
3 • A function f : A → B is injective if
∀x1, x2 ∈ A : f(x1) = f(x2) =⇒ x1 = x2.
• A function f : A → B is surjective if
∀y ∈ B ∃x ∈ A : f(x) = y.
• A function is bijective if it is both injective and surjective: ( ∀x ∈ A ∃!y ∈ B : f(x) = y f : A → B is bijective ⇐⇒ ∀y ∈ A ∃!x ∈ A : f(x) = y
Remark A function f : A → B is surjective if and only if Im(f) = B. A function is injective if for any element y ∈ Im(A), the equation f(x) = y has one and only one solution. A function is surjective if for any element y ∈ B, the equation f(x) = y has at least one solution.
6 Pre-image
Given a subset C ⊂ B, we denote by f −1(C) the set of elements of A that are mapped to an element of C: f −1(C) = {x ∈ A : f(x) ∈ C} This is called the inverse image or the pre-image of C. Properties:
−1 −1 −1 f (C1 ∪ C2) = f (C1) ∪ f (C2) −1 −1 −1 f (C1 ∩ C2) = f (C1) ∩ f (C2) −1 −1 −1 f (C1 − C2) = f (C1) − f (C2) −1 −1 f (C1) = f (C1) −1 −1 C1 ⊂ C2 =⇒ f (C1) ⊂ f (C2)
7 Composition of functions
We denote the composition of two functions f : A → B and g : B → C by g ◦ f. By definition, we have (f ◦ g)(x) = f[g(x)]. The composition of functions is not commutative but it is associative.
A function f : A → B has a left-inverse ( a retraction) gL : B → A if
gL ◦ f = IdA.
A function f : A → B has a right-inverse ( or section) gR : B → A if
f ◦ gR = IdB.
4 A left-inverse is also called a retraction while a right-inverse is also called a section.
The left-inverse of an injective function is uniquely defined by the relation
gL(y) = x ⇐⇒ y = f(x).
The right-inverse of a surjective function is not uniquely defined, but it also satisfies the relation
gR(y) = x ⇐⇒ y = f(x).
Theorem (Pset 4) A function is injective if and only if it has a left-inverse. A function is surjective if and only if it has a right-inverse. Theorem Given an injective map f : A → B, we can always define a bijection A → Im(B) which is uniquely defined by the restriction of any left-inverse image of f restricted to Im(B).
5