Solutions to exercise 2

Solutions to exercise 2
Suprema, infima and Galois connections
Program Analysis and Synthesis 2016
ETH Zürich
March 7, 2017
1 Partially ordered sets
Problem 1. Prove that the set of all natural numbers that divide 60 becomes a poset
when equipped with the relation m v n iff m divides n.
Proof. We’ll show that the “divides” relation m|n ⇐⇒ ∃k. km = n is a partial order.
1. (Reflexivity) m|m because 1.m = m;
2. (Transitivity) If m|n and n|o, then there are k1 , k2 such that k1 m = n, k2 n = o.
It follows that k2 k1 m = o, and therefore m|o.
3. (Antisymmetricity) If m|n and n|m, then m ≤ m and m ≤ n, i.e., m = n.
Problem (opt.) 2. Let X and Y be two posets. Prove that their Cartesian product
X × Y is a poset when equipped with the pointwise ordering:
(x1 , y1 ) v (x2 , y2 ) ⇐⇒ x1 v x2 , y1 v y2 .
Proof. We’ll show that v is a partial order.
1. (Reflexivity) (x, y) v (x, y) holds because x v x and y v y.
1
2. (Transitivity)
=⇒
(x1 , y1 ) v (x2 , y2 ) v (x3 , y3 ) ⇐⇒ x1 v x2 v x3 , y1 v y2 v y3
x1 v x3 , y1 v y3 ⇐⇒ (x1 , y1 ) v (x3 , y3 ).
=⇒
3. (Antisymmetricity)
(x1 , y1 ) v (x2 , y2 ), (x2 , y2 ) v (x1 , y2 ) ⇐⇒ x1 v x2 , y1 v y2 , x2 v x1 , y2 v y1 ⇐⇒
⇐⇒ x1 = x2 , y1 = y2 ⇐⇒
⇐⇒ (x1 , y1 ) = (x2 , y2 )
.
Problem 3. Recall that a map f : X → Y between two posets is monotone iff it
preserves the order of X, that is iff x1 v x2 =⇒ f (x1 ) v f (x2 ) for all x1 , x2 ∈ X.
1. Prove that the monotone maps are closed under composition. In other words,
prove that the composition of any two monotone maps is again monotone.
f
g
Proof. Let X −
→Y →
− Z be a pair of monotone maps, and also let x, x0 ∈ X be
any two elements in the domain of f .
f – monot.
g– monot
x v x0 ======⇒ f (x) v f (x0 ) =====⇒ g(f (x)) v g(f (x0 )).
2. & 3. Give examples and non-examples of monotone maps X → X, where X is
a) the reals R equipped with the standard ordering on numbers:
– x 7→ x3 (monotone)
– x 7→ x2 (non-monotone)
b) the strings Σ∗ equipped with the lexicographic ordering over the alphabet Σ;
– a1 a2 . . . an−1 an 7→ a1 a1 a2 a2 . . . an−1 an−1 an an (monotone)
– a1 a2 . . . an−1 an 7→ an an−1 . . . a2 a1 (non-monotone)
c) the powerset PN of the naturals N equipped with the subset inclusion ⊆.
2
– S 7→ S ∪ {0, 2, 4, . . . } (monotone)
– S 7→ N \ S (non-monotone)
4. Let R ⊆ D × E be a relation between the sets D and E. Prove that the following
map is monotone with respect to subset inclusion:
R[−] : PD → PE
S 7→ R[S] = {e | ∃d ∈ S. (d, e) ∈ R}.
Proof. If S ⊆ T , then:
def. of R[S]
def. of R[T ]
S⊆T
e ∈ R[S] =======⇒ ∃d ∈ S. (d, e) ∈ R ==⇒ ∃d ∈ T.(d, e) ∈ R =======⇒ e ∈ R[T ].
Problem (opt.) 4. Recall that a monotone map f : X → Y is an isomorphism between
two posets iff its inverse f −1 : Y → X exists and is, moreover, monotone.
1. Prove that isomorphisms are closed under composition.
Proof. Let f and g be a pair of isomorphisms with inverses f −1 and g −1 :
f −1
X
g −1
Y
Z .
g
f
By the definition of an inverse function, the composition f −1 ◦ g −1 is an inverse of
g ◦ f . It is, moreover, monotone because monotone functions compose.
2. Prove that a map f : X → Y is an isomorphism iff for all x, x0 ∈ X
x v x0 ⇐⇒ f (x) v f (x0 ).
Proof. Actually, the statement to be proved is incorrect: it holds only if the map is
surjective as well. Let us prove the “if” direction under this additional assumption.
The “only if” direction is similar. Let us first observe that f is injective:
f (x) = f (x0 ) ⇐⇒
⇐⇒
f (x) v f (x0 ), f (x0 ) v f (x)
x v x0 , x0 v x
⇐⇒
⇐⇒ x = x0 .
Now, by the assumption of surjectivity we conclude that f is bijective. This implies
that it has an inverse map f −1 . This inverse is clearly monotone:
y v y 0 ⇐⇒
⇐⇒
∃x, x0 . f (x) = y v y 0 = f (x0 )
∃x, x0 . x = f −1 (y) v f −1 (y 0 ) = x0
3
⇐⇒
⇐⇒ f −1 (y) v f −1 (y 0 ).
3. Give an example of a monotone bijection that is not an isomorphism.
Let n be an integer greater than 0. Consider the posets: X = {0, . . . , n} equipped
with bare equality = as a partial ordering; Y = {0, . . . , n} equipped with the
standard numeric ordering. No two elements in X are comparable, and therefore
every bijection from X to Y is monotone. In particular, the map m 7→ m from X
to Y is monotone. However, its inverse (again m 7→ m) is clearly not.
2 Suprema and infima
The concepts of suprema and infima (that should be familiar from calculus) prove to be
fundamental everywhere the notion of approximation appears, and theFfield of program
analysis is no exception. Recall that, given a poset X, the supremum S of any subset
S ⊆ X, if it exists, is the least of all the upper bounds of S in X. In a symmetric fashion,
the infimum S of S, if it exists, is the greatest lower bound of S in X:
F
u1
u2
S
s0
s1
lower bounds
l1
F
u0 =
l0 =
l2
u4
S
s2
F
upper bounds
u3
...
s3
S
l3
l4
Figure 1: An example of a supremum and an infimum.
F
Definition 1. A poset L is called a lattice iff S and S exist for all subsets S ⊆ L
that are both finite and non-empty. If suprema and infima exist for all of the lattice
subsets, no matter of their cardinality, then the lattice is called complete.
F
Problem 5. For each of the following posets: determine whether they form a (complete)
F
lattice; give an example if some suprema/infima fail to exist; give a formula for S and
S whenever possible.
F
4
1. The Cartesian square Z × Z of the integers (see Problem (opt.) 2).
This is a lattice that is not complete. For a non-empty set {(mi , ni )}n1 we have
G
{(mi , ni )}n1 = (max{mi }n1 , max{ni }n1 )
{(mi , ni )}n1 = (min{mi }n1 , min{ni }n1 ).
G
The lattice is not complete because it has neither least (infimum of the whole
lattice) nor greatest (supremum of the whole lattice) elements.
2. The interval [0, 1] ⊆ R.
The unit interval is bounded and closed, and therefore is a complete lattice by the
least-upper-bound property.
3. The set [0, 1] ∩ Q of all rational numbers between 0 and 1 included.
This is a lattice but not a complete one. The problem is that certain subsets do
not have suprema inside the lattice. For example, the approximations to 1/π
0, 0.3, 0.31, 0.318, 0.3183, 0.31830, 0.318309, . . .
have their supremum equal precisely to 1/π. However, this number is irrational,
and therefore does not belong to the lattice [0, 1] ∩ Q.
4. The powerset PZ of the integers.
Every powerset equipped with ⊆ (this one in particular) is a complete lattice with
G
[
F=
F = {n | ∃S ∈ F. n ∈ S}
\
F=
F = {n | ∀S ∈ F. n ∈ S}.
G
5. The family of convex polyhedra in Rn , partially ordered by subset inclusion ⊆.
Convex polyhedra form a lattice, which is, however, not complete. For every
collection F that has a supremum/infimum inside the lattice, we have:
G
[
F = convex hull of
F
\
F=
F.
G
For a counter-example to completeness, consider R2 and a family F = {R3 , R4 , . . . }
where each Rn is a regular n-sided polygon that circumscribes the unit circle. By
the above formula, F should equal the unit circle. But the unit circle is not
inside our lattice because it is not a polygon.
F
5
Problem (opt.) 6. What are the supremum and infimum of the empty set?
By definition every element of a lattice L is both an upper and a lower bound of the
empty set, thus:
G
∅ = the smallest element of L
∅ = the greatest element of L.
G
Problem 7. Prove that the following conditions on a poset X are equivalent:
1. X is a complete lattice;
2. every subset of X has a supremum;
3. every subset of X has an infimum.
Proof. By definition 1. ⇐⇒ 2., 3.. Therefore, it is sufficient to prove that 2. ⇐⇒ 3.
For any two subsets L, U of a poset, let L v U mean that l v u for all l ∈ L and u ∈ U .
Then, the following holds whenever the respective suprema/infima exist:
G
L v U ⇐⇒ L v U ⇐⇒ L v
U.
G
(2. =⇒ 3.) Now, if we know that all suprema exist, and U is an arbitrary
subset, then
F
let L = {l | l v U } be the set of lower bounds of U . By the above, L is also a lower
bound of U but then by the definition of supremum it is the greatest lower bound of U .
(3. =⇒ 2.) Similarly, if all infima exist in our lattice, and L is an arbitrary subset, then
let U = {u | L v u} be the set of upper bounds of L. Again by the above, U is an
upper bound of L and therefore it is the least of all the upper bounds of L.
F
Problem (opt.) 8. Prove that the Cartesian product X × Y of two posets X and Y is
a lattice iff both X and Y are lattices. What about the completeness of X × Y ?
The product X × Y of two posets is a (complete) lattice iff both X and Y are (complete)
lattices. The following two formulas establish this fact. We’ll prove the first one only.
G
G
G
{(xi , yi )}i∈I =
{xi }i∈I , {yi }i∈I ,
{(xi , yi )}i∈I =
{xi }i∈I , {yi }i∈I
G
G
G
Proof. First, observe that u = v ⇐⇒ (∀w. u v w ⇐⇒ v v w) for all u, v. Now,
G
{(xi , yi )}i∈I v (x, y) ⇐⇒ {(xi , yi )}i∈I v (x, y) ⇐⇒ {xi }i∈I v x, {yi }i∈I v y ⇐⇒
G
G
G
G
⇐⇒
{xi }i∈I v x, {yi }i∈I v y ⇐⇒
{xi }i∈I , {yi }i∈I v (x, y).
6
3 Galois connections
When we deal with inequalities, we often need to transform them from one specific form
to another equivalent one. Here are two examples familiar from school:
x + c ≤ y ⇐⇒ x ≤ y − c
xc ≤ y ⇐⇒ x ≤ yc−1 provided c > 0.
The concept of a Galois connection captures such transformations, allowing one to start
with an equality and obtain an equivalent one, in a possibly different poset.
Definition 2. A Galois connection (α, γ) from one poset X to another Y consists of a
γ
α
pair of mappings X −
→Y −
→ X such that for all x ∈ X, y ∈ Y
α(x) v y ⇐⇒ x v γ(y).
The mapping α is called the lower adjoint and γ the upper adjoint of the connection:
γ
X
Y.
α
Problem (opt.) 9. Given a connection from X to Y and a connection from Y to Z,
find out (and prove) how the two could be composed into a connection from X to Z:
γ1
X
γ2
Z .
Y
α2
α1
Proof. One can compose (α1 , γ1 ) and (α2 , γ2 ) into the connection (α2 ◦ α1 , γ1 ◦ γ2 ):
α2 (α1 (x)) v z ⇐⇒ α1 (x) v γ2 (z) ⇐⇒ x v γ1 (γ2 (z)).
Problem 10. Find suitable lower/upper adjoints (if possible) to each of the maps:
1. The real logarithm map log : (0, +∞) → R.
The logarithm together with its inverse, the exponential map exp : R → (0, ∞),
form a Galois connection. Either can play the role of a lower and an upper adjoint.
7
2. The map ι : Z → R defined as x 7→ x.
The ceiling map x 7→ dxe is a lower adjoint of ι, while the floor map x 7→ bxc is an
upper adjoint of ι:
dxe ≤ n ⇐⇒ x ≤ n
n ≤ bxc ⇐⇒ n ≤ x
3. the map ι : X → Y defined as x 7→ x, where
a) X = {I1 × · · · × In ⊆ Rn | Ij is a closed interval of R},
b) Y is the collection of all closed subsets of Rn ,
and both are ordered by subset inclusion;
Let πj : Y → R be the projection on the j-th coordinate axis:
πi (F ) = {f ∈ R | ∃~x, ~y . (~x, f, ~y ) ∈ F }.
We define α : Y → X as (where inf and sup can reach −∞ or +∞);
α
F 7−
→ [inf π1 (F ), sup π1 (F )] × · · · × [inf πn (F ), sup πn (F )].
One can readily check that the pair (α, ι) forms a Galois connection.
4. The unique map ! : L → {?} from any complete lattice L to the trivial poset {?}.
The map ? 7→ ⊥ is a lower adjoint of !, while ? 7→ > is an upper adjoint of !:
⊥ ≤ x ⇐⇒ ? ≤ ? = !(x)
!(x) = ? ≤ ? ⇐⇒ x ≤ >
5. the diagonal map ∆ : L → L2 defined as x 7→ (x, x) (L is again a complete lattice).
The map (x, y) 7→ x t y is a lower adjoint of ∆, while the map (x, y) 7→ x u y is an
upper adjoint of ∆:
x t y v z ⇐⇒ (x, y) v (z, z) = ∆(z)
∆(z) = (z, z) v (x, y) ⇐⇒ z v x u y
Problem 11. The examples from Problem 10 suggest that each adjoint in a Galois
connection uniquely determines the other. Prove that this is indeed the case by showing
8
the following identities for a connection (α, γ) between two posets X and Y :
{y ∈ Y | x v γ(y)},
G
γ(y) = {x ∈ X | α(x) v y}.
{y ∈ Y | α(x) v y} and γ(y) =
F
Hint. Observe that α(x) =
G
α(x) =
F
{x ∈ X | x v γ(y)}.
Proof. The two formulas follow immediately from the observation:
{y ∈ Y | x v γ(y)} = {y ∈ Y | α(x) v y} for all x ∈ X
{x ∈ X | α(x) v y} = {x ∈ X | x v γ(y)} for all y ∈ Y
α
γ
Problem (opt.) 12. Consider a pair of mappings X −
→Y −
→ X between two posets.
1. Prove that (α, γ) form a Galois connection iff
a) α and γ are both monotone, and moreover
b) x v γ(α(x)) and α(γ(y)) v y for all x ∈ X and y ∈ Y .
Proof. If (α, γ) form a Galois connection, then
b)
α(x) v α(x) ⇐⇒ x v γ(α(x))
γ(y) v γ(y) ⇐⇒ α(γ(y)) v y
a)
x1 v x2 v γ(α(x2 )) =⇒ α(x1 ) v α(x2 )
α(γ(y1 )) v y1 v y2 =⇒ γ(y1 ) v γ(y2 ).
Conversely, if (α, γ) satisfy a) and b), then
α(x) v y =⇒ γ(α(x)) v γ(y) =⇒ x v γ(y)
x v γ(y) =⇒ α(x) v α(γ(y)) =⇒ α(x) v y.
9
2. Prove that if (α, γ) is a Galois connection, then for all x ∈ X and y ∈ X
a) α(γ(α(x))) = α(x),
b) γ(α(γ(y))) = γ(y).
Proof. The two cases are analogous, and so we will prove the first one only:
x v γ(α(x)) =⇒ α(x) v α(γ(α(x))) x v γ(α(x)) for all x, and monotonicity
α(γ(α(x))) v α(x) α(γ(y)) v y for all y, where y = α(x)
3. Find the largest subsets of X and Y on which α and γ are inverses of each other
given that they form a Galois connection.
These are the subsets X 0 = {γ(y) | y ∈ Y } ⊆ X and Y 0 = {α(x) | x ∈ X} ⊆ Y :
a) by the previous point α and γ are inverses of each other on these subsets;
b) inverses must be surjective, and these are largest subsets where α and γ are.
10