CS 2742 (Logic in Computer Science) - Fall 2008: Antonina Kolokolova
CS 2742 (Logic in Computer Science) - Fall 2008: Antonina Kolokolova
Lecture 20
Antonina Kolokolova
November 10, 2008
7.1
Relations
Recall that a relation on n variables is just a subset of a Cartesian products of n sets which
are domains of the variables. In this respect, a binary relation on a set A is a just a subset
of A A.
For example, R(x, y) Z Z such that R(x, y) if and only if x y is a binary relation.
In this case, we often write directly x y, rather than writing R(x, y). The relation x = y
is also a binary relation, which can be defined for many different domains such as integers,
reals, strings and so on.
Another common binary relation is congruence mod n for a natural number n: in that
case, R(x, y), written as x y mod n, if z Z such that x y = zn. This is the same
as saying that x and y have the same remainder from division by n. For every n there is a
different mod n relation.
Yet another binary relation is P arent(x, y), which contains all pairs x, y such that x is a
parent of y. At this point you may ask what is the difference between a predicate P arent(x, y)
and a binary relation P arent(x, y): the predicate is true on the pairs (x, y) that belong to
the set which is the binary relation.
There are several major types of binary relations. In this case, it is often more convenient
to view a binary relation R(x, y) as taking a x into y. Binary relations can be:
Reflexive: x A R(x, x).
For example, x = y, x y, x y mod n are reflexive, but P arent9(x, y) and x < y
are not.
Symmetric: x, y A R(x, y) R(y, x).
57
as 3, -5 as 5 and so on. For the names of the equivalence classes we can pick any element
of them, but it is convenient to choose 0, 1, 2, 3, 4, and in general, we represent equivalence
classes mod n as 0, 1, . . . , n 1.
There is a special term to denote relations which are reflexive, transitive and antisymmetric:
they are called partial order relations (e.g., subset relation). A total order is a subclass of
partial orders with an additional property that any two elements are related: that is, for any
x, y either R(x,y) or R(y,x). E.g.: on numbers.
7.2
Application to cryptography
59