Definition 6.1 A binary relation R on a set X is called 1. reflexive if

Definition 6.1 A binary relation R on a set X is called
1. reflexive if xRx for all x in X
2. anti-symmetric if, whenever xRy and yRx, it follows that x = y
3. transitive if, whenever xRy and yRz, it follows that xRz.
Definition 6.2 A partial order is a set P together with a reflexive, anti-symmetric,
and transitive binary relation on it.
The binary relation in a partial order is typically written as ≤.
Example 6.3 Typical examples of partial orders are as follows:
1. the set of integers Int together with the usual ordering of integers
2. the set of integers Int with the ordering given by equality
3. the set P(X) of subsets of a set X, with ordering determined by inclusion,
i.e., A ≤ B precisely when A ⊆ B.
We now proceed to the example of a partial order of primary importance to
us in these notes.
Definition 6.4 Given sets X and Y , a partial function from X to Y is given
by a subset X 0 of X together with a function f : X 0 −→ Y . We normally write
the partial function (X 0 , f ) simply as f . The set X 0 is called the domain of the
partial function f and is written dom(f ). We denote the set of partial functions
from X to Y by X * Y (note that there is only half an arrowhead in X * Y ).
So every function from X to Y can be seen as a partial function with domain
X 0 = X. There is also a partial function with empty domain, i.e., with X 0 the
empty subset of X. A common example of a partial function is that from the set
of natural numbers N at to itself that sends n to n − 1 if n ≥ 1 but is undefined
if n = 0.
We can now describe our leading example of a partial order:
Example 6.5 Given partial functions f, g : X * Y , put f ≤ g if
1. dom(f ) ⊆ dom(g) and
2. whenever f (x) is defined (and therefore g(x) is also defined), f (x) = g(x).
It is routine to check that ≤ satisfies the axioms required to make it a partial
order, i.e., that ≤ is reflexive, anti-symmetric, and transitive.
For instance, for reflexivity, given a partial function from X to Y , i.e.,
given a subset X 0 of X and a function f : X 0 −→ Y , it is trivially the case that
dom(f ) = dom(f ), and that, whenever f (x) is defined, f (x) = f (x), and so, by
our definition, f ≤ f .
This partial order is called the partial order of partial functions from X to
Y.
16
For a specific example of this, let X = Y be the set N at of natural numbers.
Let f send all even numbers 2n to 2n + 1 but be undefined on odd numbers.
And let g send all numbers m to m + 1. Then f is less than or equal to g in the
partial order given by Example 6.5.
Definition 6.6 Given partial orders (P, ≤P ) and (Q, ≤Q ), a function h : P −→
Q is called order preserving if h preserves the partial order, i.e., if x ≤P y
implies that h(x) ≤Q h(y).
For an example, consider the discrete partial order on the natural numbers,
i.e., n is put less than or equal to m if and only if n = m. Call this partial order
N . Now consider the ordinary partial order on the natural numbers: call it N 0 .
Then the identity map from N to N 0 is order preserving.
Definition 6.7 Given an order preserving function h : P −→ P from a partially ordered set P to itself:
• a fixed point for h is an element x of P for which h(x) = x
• a least fixed point for h is a fixed point lf p(h) of h for which, for any
fixed point F of h, one has lf p(h) ≤ F .
An order preserving function might not have any fixed points: for example,
the function from Int to Int, with the usual partial order, that sends an integer
n to n + 1 has no fixed points. Or it might have many fixed points, for instance
the identity function on Int. And if it does have a fixed point, there is not
necessarily a least one, e.g., for identity maps as above. But if there does exist
a least fixed point, it is necessarily unique.
In order to give denotational semantics for while, we shall use the least
fixed point of an order preserving function on the partial order of partial maps
Σ * Σ.
Definition 6.8 Given a partial order (P, ≤) and a subset A of P , a least upper
bound of A is an element lub(A) of P such that
• a ≤ lub(A) for every a ∈ A and
• for any element c such that a ≤ c for all a ∈ A, it follows that lub(A) ≤ c.
Definition 6.9
1. ω denotes the partially ordered set given by the set of
natural numbers with the usual ordering, cf 6.3.
2. An ω-chain in a poset P is an order preserving function c : ω −→ P , i.e.,
a sequence of elements of P of the form c0 ≤ c1 ≤ c2 ≤ . . .. (In this
setting, c(n) is usually written cn .)
3. A poset P is ω-complete if every ω-chain c0 ≤ c1 ≤ c2 ≤ . . . in P has a
least upper bound cω .
17
Theorem 6.10 For any sets X and Y , the partial order of partial functions
from X to Y has a least element and is ω-complete.
Proof The least element of X * Y is given by the partial function with empty
domain.
For ω-completeness, suppose we are given an ω-chain f0 ≤ f1 ≤ f2 ≤ . . . in
X * Y . We must find a partial function h : X * Y that is a least upper bound
for it.
Let H be the subset of X given by the union over all n ∈ ω of dom(fn ). So,
for any x ∈ H, there must be at least one n ∈ ω such that x ∈ dom(fn ). Choose
one such n and define h(x) = fn (x).
For any n and m, either fn ≤ fm or fm ≤ fn . So either dom(fn ) ⊆ dom(fm )
or dom(fm ) ⊆ dom(fn ), and the values of fn (x) and fm (x) agree on their
common domain. So for any x, any choice of n will yield the same definition of
h(x).
So, for every n ∈ ω, we have dom(fn ) ⊆ dom(h) and, for every x ∈ dom(fn ),
we have fn (x) = h(x). So fn ≤ h, making h an upper bound.
It remains to check that h is the least upper bound. For that, suppose k is
a partial function from X to Y and fn ≤ k for each n. So dom(fn ) ⊆ dom(k)
and for each x in dom(fn ), we have fn (x) = k(x). But dom(h) is the union of
the dom(fn )’s, so dom(h) is a subset of dom(k). Any element x of dom(h) is an
element of dom(fn ) for some n, and so h(x) = fn (x) = k(x). Thus h ≤ k.
Definition 6.11 Given ω-complete partial orders (P, ≤P ) and (Q, ≤Q ), an order preserving function h : P −→ Q is called ω-continuous if h preserves least
upper bounds of ω-chains, i.e., for any ω-chain c0 ≤ c1 ≤ c2 ≤ . . . in P , one
has h(cω ) is the least upper bound of h(c0 ) ≤ h(c1 ) ≤ h(c2 ) ≤ . . ..
Proposition 6.12 Given an ω-complete partial order P with a least element,
every ω-continuous function h : P −→ P has a least fixed point, which we denote
by f ix(h).
Proof Define h0 to be the least element 0 of P . Then inductively put hn+1 =
h(hn ). By induction and because h preserves the partial order, it follows, for
every n, that hn ≤ hn+1 . So the set {h0 , h1 , . . .} forms an ω-chain. So h
preserves its least upper bound hω .
Thus h(hω ) is the least upper bound of h(h0 ) ≤ h(h1 ) ≤ h(h2 ) ≤ . . ., but by
construction, that chain is precisely h1 ≤ h2 ≤ h3 ≤ . . ., which has least upper
bound hω . So h(hω ) = hω , making hω a fixed point of h.
It remains to check that hω is the least fixed point. Suppose h(x) = x.
We defined h0 to be the least element 0 of P , so h0 ≤ x. In order to apply
induction, assume hn ≤ x. Then, since h is order preserving, h(hn ) ≤ h(x).
But hn+1 = h(hn ) and h(x) = x, so hn+1 ≤ x. Thus, by induction, for all n, we
have hn ≤ x. So the least upper bound hω is less than or equal to x, completing
the proof.
18