* Definition.* A * binary
relation* from a set X to a set Y is a subset of the product .

X is called the * domain* of the relation and Y
is called the * codomain*.

A * binary relation* on a set S is a subset of
the Cartesian product .

This definition is so abstract that you may find it difficult to see how this is connected to the ordinary idea of things being "related". Here's the idea.

A *relationship* between two objects is something like

"x is the father of y"

"x is greater than y"

"x and y have the same color"

"

Look at "x is the father of y". Your experience in the real
world tells you what this means --- how you would *verify*
that a given person is the father of another person. But another way
to *define* the "father" relationship would be to
make a list of *all* father-child pairs. For example, if Bonzo
has a son named Wickersham and a daughter named Gordinier, then the
foolowing pairs would be on the "father" list:

You can see that these are *ordered pairs* --- elements of the
Cartesian product

And a little thought shows that *any* binary (two-element)
relationship can be defined in this way. That's why the formal
definition I gave above makes sense.

* Example.* Suppose . List
the elements of the relation on S, then draw a picture of the
relation.

For example, is in the set, because .

The picture of the points in a relation is called its * graph*. Here's the graph of on S:

As usual, I'm using the horizontal axis for the first component and the vertical axis for the second component.

* Example.* A relation R is defined on by

Show that . Sketch the graph of R. (You might need a computer to do this.)

is in the relation, because

The graph of the relation looks something like this

Notice that this is not the graph of a function.

* Example.* List the elements of the relation on
the set whose graph is shown below:

The relation is the set of pairs

It's common in math to use * infix notation* for
relations. This means that instead of writing an ordered pair , you put a * relation symbol*
between x and y --- for example,

It's best to avoid symbols like " " or " " which have special meanings --- unless that special meaning is what you want.

For example, consider the relation in the previous example:

Using as the infix relation symbol, you'd write

* Example.* Consider the relation
on defined by

(a) Prove that .

(b) Prove that .

(a) and . Since , I have .

(b) and . Since , I have .

* Example.* Consider the relation
on defined by

(a) Prove that .

(b) Prove that .

(a) and . Since , I have .

(b) and . Since , I have .

Very often additional axioms or assumptions are added to the definition of binary relation in order to obtain useful structures. Here are some that we'll consider in detail.

* Definition.* A relation
on a set S is an * equivalence relation* if:

1. (Reflexivity) for all .

2. (Symmetry) For all , if , then .

3. (Transitivity) For all , if and , then .

An equivalence relation is meant to capture the idea of things
"being the same" for the purposes of a given discussion.
Here's a real-world example. Suppose you plan to drive to the movies.
With that intention alone in mind, there are many things about the
car you drive that aren't important --- what color it is, how many
miles it's been driven, whether the windshield is tinted, and so on.
You care only about the car being suitable for transporting you to
the movies. So any two cars --- whatever their color, mileage, or
windshield tint, for instance --- *are the same for your
purposes* if either will get you to the movies. The equivalence
relation on the set of cars is that two cars are equivalent if both
will get you to the movies or both will *not* get you to the
movies.

"Equality" is an obvious example of "being the same". Thus, equality of integers, rational numbers, real numbers, or complex numbers is an equivalence relation.

* Definition.* Let n be a positive integer.
Integers x and y are * congruent mod n* if is divisible by n. Notation: .

Congruence mod n is an equivalence relation on . Another way to express congruence mod n is: x and y
are * congruent mod n* if x and y leave the same
remainder on division by n. But the first definition is easier to
use.

For example, , because , and . And , because and .

Most of the earlier examples been examples of relations on a single set; that is, subsets of a for some set X. Here's an important example of a relation from a set X to a set Y where X and Y might be different.

* Definition.* A * function*
is a relation f from a set X to a set Y which satisfies the following
property: If and are elements of f, then
.

You may have a little trouble telling how this is the definition of a
function you're accustomed to. First, this is a case where we usually
use * prefix notation* for the relation. So
instead of writing " " or even " ", we write " ".

Using prefix notation, the defining condition can be *translated
to this*: If and , then . This is the familiar idea that a function produces
a *single output* for each input. Graphically, this is the
"vertical line test".

It's interesting to note that, since a function is a relation, and a
relation is a set of ordered pairs (i.e. "points" in the
product ), a function has actually been
*defined* as its *graph*.

Copyright 2018 by Bruce Ikenaga