Set Theory/Relations
From Wikibooks, the open-content textbooks collection
Contents |
[edit] Ordered pairs
To define relations on sets we must have a concept of an ordered pair, as opposed to the unordered pairs the axiom of pair gives. To have a rigorous definition of ordered pair, we aim to satisfy one important property, namely, for sets a,b,c and d,
.
As it stands, there are many ways to define an ordered pair to satisfy this property. A simple definition, then is (a,b) = {{a},{a,b}}. (This is true simply by definition. It is a convention that we can usefully build upon, and has no deeper significance.)
Theorem

Proof
If a = c and b = d, then (a,b) = {{a},{a,b}} = {{c},{c,d}} = (c,d).
Now, if (a,b) = (c,d) then {{a},{a,b}} = {{c},{c,d}}. Then
, so {a} = {c} and a=c.
So we have (a,b) = (a,d). Thus
meaning {a,b} = {a,d}.
- If a = b, we have {a} = {a,d} and thus
so a = d. - If
, note
, so b = d
[edit] Relations
Using the definiton of ordered pairs, we now introduce the notion of a binary relation.
The simplest definition of a binary relation is a set of ordered pairs. More formally, a set
is a relation if
for some x,y. We can simplify the notation and write
or simply xRy.
We give a few useful definitions of sets used when speaking of relations.
- The domain of a relation R is defined as
, or all sets that are the initial member of an ordered pair contained in R.
- The range of a relation R is defined as
, or all sets that are the final member of an ordered pair contained in R.
- The union of the domain and range,
, is called the field of R.
- A relation R is a relation on a set X if
.
- The inverse of R is the set

- The image of a set A under a relation R is defined as
.
- The preimage of a set B under a relation R is the image of B over R-1 or
![R^{-1}[B] = \{x\in \mbox{dom}\ R \mid \exists y \in B, (x,y)\in R\}](http://upload.wikimedia.org/math/7/e/d/7edf5f8081878998b65b1ba2783bad35.png)
It is intuitive, when considering a relation to seek to construct more relations from it, or to combine it with others.
We can compose two relations, R and S to form one relation
. So
means that there is some y such that
.
We can define a few useful binary relations as examples:
- The Cartesian Product of two sets is
, or the set where all elements of A are related to all elements of B. As an excercise, show that all relations from A to B are subsets of
. Notationally
is written A2 - The membership relation on a set A,

- The identity relation on A,

The following properties may or may not hold for a relation R on a set X:
- R is reflexive if xRx holds for all x in X.
- R is symmetric if xRy implies yRx for all x and y in X.
- R is antisymmetric if xRy and yRx together imply that x = y for all x and y in X.
- R is transitive if xRy and yRz together imply that xRz holds for all x, y, and z in X.
- R is total if xRy, yRx, or both hold for all x and y in X.
[edit] Functions
[edit] Definitions
A function may be defined as a particular type of relation. We define a partial function
as some mapping from a set X to another set Y that assigns to each
no more than one
. Alternatively, f is a function if and only if 
If on each
, f assigns exactly one
, then f is called total function or just function. The following definitions are commonly used when discussing functions.
- If
and f is a function, then we can denote this by writing
. The set X is known as the domain and the set Y is known as the codomain. - For a function
, the image of an element
is
such that f(x) = y. Alternatively, we can say that y is the value of f evaluated at x. - For a function
, the image of a subset A of X is the set
. This set is denoted by f(A). Be careful not to confuse this with f(x) for
, which is an element of Y. - The range of a function
is f(X), or all of the values
where we can find an
such that f(x) = y. - For a function
, the preimage of a subset B of Y is the set
. This is denoted by f - 1(B).
[edit] Properties of functions
A function
is onto, or surjective, if for each
exists
such that f(x) = y. It is easy to show that a function is surjective if and only if its codomain is equal to its range. It is one-to-one, or injective, if different elements of X are mapped to different elements of Y, that is
. A function that is both injective and surjective is intuitively termed bijective.
[edit] Composition of functions
Given two functions
and
, we may be interested in first evaluating f at some
and then evaluating g at f(x). To this end, we define the composition' of these functions, written
, as
Note that the composition of these functions maps an element in X to an element in Z, so we would write
.
[edit] Inverses of functions
If there exists a function
such that for
,
, we call g a left inverse of f. If a left inverse for f exists, we say that f is left invertible. Similarly, if there exists a function
such that
then we call h a right inverse of f. If such an h exists, we say that f is right invertible. If there exists an element which is both a left and right inverse of f, we say that such an element is the inverse of f and denote it by f - 1. Be careful not to confuse this with the preimage of f; the preimage of f always exists while the inverse may not. Proof of the following theorems is left as an exercise to the reader.
Theorem: If a function has both a left inverse g and a right inverse h, then g = h = f − 1.
Theorem: A function is invertible if and only if it is bijective.
