How to prove it (version 0.2.alpha :-) Ulf Nilsson September 25, 2000

advertisement
How to prove it (version 0.2.alpha :-)
Ulf Nilsson
September 25, 2000
The following are some examples illustrating how to prove certain typical
problems in discrete mathematics. Note that it’s not a complete list and that
there may be typos (please let me know if, or rather when, you find any). It is
recommended that you take a second look at the proofs below when studying
natural deduction in the last part of the course.
1 Sets
In order to show that a set A is a subset of a set B we must show that every
element in A is also an element in B . That is, if x 2 A, then x 2 B , for all
elements x (in some universe).
To prove that A is not a subset of B it is sufficient to find one element belonging
to A, but not B . Then we have found a so-called counter example.
Problem 1.1 Prove that B
6 n
A
B
.
Solution: For instance, take A = fag, B = fa; bg and U
and A n B = fag. Then b 2 B but b 62 A n B .
To show that two sets, A and B , are equal, i.e.
B A. For instance
Problem 1.2 Show that A [ B
=
A
\
B
A
=
B
=
f
g. Then
a; b; c
we show that A
for arbitrary sets A; B
U
=
B
fg
c
and
.
Solution: Let A; B be arbitrary subsets of U . We first show that A [ B
and then the converse.
1
B
\
A
B
,
For any sets A; B; C
1:
A
2:
A
3:
A
4:
A
5:
A
6:
A
7:
A
8:
A
9:
A
10:
A
11:
A
12:
A
13:
A
14:
A
15:
A
16:
A
17:
A
18:
A
19:
A
=
A
[ =
\ =
[ =
\ =
[( [
\( \
[( \
\( [
[ =
\ =
[;=
\ =
[ =
\ =;
[ =
\;=;
[( \
\( [
B
A
B
A
B
B
B
B
U
:
\
[
[
\
Law of double negation
DeMorgan’s laws
B
B
A
B
C)
= (A
B
C)
= (A
B
C)
= (A
B
C)
= (A
A
A
A
A
Commutative laws
A
[
\
[
\
[
\
)\( [
)[( \
B)
C
B)
C
B
B
Associative laws
A
C)
A
C)
Distributive laws
Idempotent laws
Identity laws
A
U
A
A
U
Inverse laws
U
Domination laws
A
U
A
B)
=
A
A
B)
=
A
Absorption laws
Figure 1: Laws of set theory
First assume that x 2 A [ B . Then x 62 A [ B . Then neither x 62 A nor x
That is, x 62 A and x 62 B . Then x 2 A and x 2 B , and finally x 2 A \ B .
62
Next assume that x 2 A \ B . Then x 2
Then x 62 A [ B , and finally x 2 A [ B .
62
A
and x
2
B
. Then x
62
A
and x
B
.
B
.
It is sometimes easier to use Venn diagrams to solve this type of problems. Yet
another technique which can be used is that of equivalence preserving rewriting; i.e. to replace expressions by expressions which are known to be equal.
Figure 1 contains a collection of laws which hold for arbitrary sets A; B; C from
some universe U . Using laws such as these1 we may do proofs more or less mechanically, as illustrated below.
Problem 1.3 Show that (A [ B ) \ ((A [ B ) [ C ) = A [ B .
1 Different
books usually list different laws.
2
Solution: We use the laws in Figure 1:
(A
[
B)
\ (( [
A
B)
[
C)
[ )\( [( [
[ ( \ ( [ ))
[
=
(A
B
=
A
B
=
A
A
B
B
C ))
C
B
Associativity
Distributivity
Absorption
2 Functions
! Z defined as2
1) 21
Problem 2.1 Consider the function f : Z+
f (n)
=
n
(
n
+
:::
Show that f is injective.
Solution: We have to show that if x 6= y then f (x) 6= f (y ). (This is equivalent to
proving that x = y if f (x) = f (y ).)
Assume that x 6= y (where x; y 2 Z+ ). Then there are two possibilities: either
x > y 1 or y > x 1. We have to show that both cases imply that f (x) 6=
f (y ).
Consider the first case: if x > y then
f (x)
=
x(x
1) : : : (y + 1)y (y
1) : : : 1 =
x(x
1) : : : (y + 1)f (y )
Since x > 1 it follows that f (x) 6= f (y ).
The second case is analoguous.
Remark: How do we prove that a function, e.g. the factorial function3 f : N !
N, is not injective? In this case it is sufficient to find x; y 2 N such that x 6= y ,
and f (x) = f (y ). This is easy in our particular case, since f (0) = f (1) = 1.
Problem 2.2 Show that if
must be surjective.
2 This
3 The
f: A
!
B
and
g: B
!
C
are surjective, then
is the factorial function, restricted to the positive integers.
factorial function : N
N can be defined inductively/recursively as follows
f
!
f (0)
f (n)
=
=
1
n f (n
3
1)
n > 0)
(
(g
Æ
f)
Solution: Assume that f : A ! B and g : B ! C are surjective. Remember that
(g Æ f ) is a function from A to C defined as (g Æ f )(x) = g (f (x)). We must
show that every element in C is the image of some element in A. Hence, take
an arbitrary element z 2 C . Since g is surjective, there must be some element,
say y 2 B , such that z = g (y ). Moreover since f is also surjective there must be
some element, say x 2 A, such that y = f (x). That is, z = g (f (x)) = (g Æ f )(x).
Hence, for any element z 2 C there exists at least one element x 2 A such that
z = (g Æ f )(x), which means that (g Æ f ) is surjective.
3 Relations
Problem 3.1 Assume that (A; ) is a poset (partially ordered set). Let
relation on A A defined as follows
(x1 ; x2 )
v(
y1 ; y2 )
iff x1
y1
and x2
v be a
y2
Show that (A A; v) is a poset.
Solution: To prove this you have to show that v is reflexive, transitive and
antisymmetric. (Before reading on, make sure that you understand what these
properties mean.)
Take an arbitrary (x1 ; x2 ) 2 A A. Since x1 2 A and since is reflexive, it
follows that x1 x1 . For the same reason, x2 x2 . Since both x1 x1 and
x2 x2 it must follow that (x1 ; x2 ) v (x1 ; x2 ). That is, v is reflexive.
Next assume that (x1 ; x2 ) v (y1 ; y2 ) and that (y1 ; y2 ) v (z1 ; z2 ). Then x1 y1 and x2 y2 z2 . Since is transitive, it follows that x1 z1 and x2 z2 .
It must follow that (x1 ; x2 ) v (z1 ; z2 ). That is, v is also transitive.
z1
Finally assume that (x1 ; x2 ) v (y1 ; y2 ) and that (y1 ; y2 ) v (x1 ; x2 ). Then x1 x1 and x2 y2 x2 . Since is antisymmetric, it follows that x1 = y1
and x2 = y2 . In that case (x1 ; x2 ) = (y1 ; y2 ). (Here you must understand what
it means for two tuples to be equal.) That is, v is antisymmetric.
y1
4 Inductive definitions and proofs
The Fibonacci numbers is an infinite sequence F0 ; F1 ; F2 ; : : : of natural numbers such that each number is the sum of the two preceeding numbers in the
sequence (the first two numbers are 0 and 1). We often describe the Fibonacci
4
numbers by the following inductive/recursive definition.
F0
=
0
F1
=
1
F
=
F
i
That is F2 = 1; F3 = 2; F4
lead to inductive proofs.
i
1
+ Fi 2
(n
2)
= 3; F5 = 5; F6 = 8; : : :
Xn i
Problem 4.1 Show that
i=0
for every n 0.
F
=
n
Inductive definition often
1
F +2
Solution: We have to show that the equality holds for n = 0; 1; 2; : : :. That is,
an infinite number of cases. We prove this using an inductive proof: We first
show that the equality holds for the extremal case, n = 0. Secondly we show
that if the equality holds for the case n 0, then it must hold also for the case
n + 1. Hence, if the equality holds for n = 0, then it must hold also for n = 1,
in which case it must hold for n = 2, in which case it must hold for n = 3, etc.
We first prove the so-called base case, n = 0. For n = 0 we have
Xi
0
i=0
=
F
F0
Xn i
=0=1
1=
F2
1
Next we show the inductive case, that is we assume that
i=0
We then want to show that
=
F
Xi
n
n+1
i=0
F
1
F +2
=
(n
n
F( +1)+2
0)
1
We show this by a sequence of equalities. First
X i Xn i
n+1
i=0
Xn i
F
=
i=0
F
+ Fn+1
According to our initial assumption (the so-called induction hypothesis)
i=0
F
+ Fn+1 = (Fn+2
5
1) + Fn+1
The next step is trivial
(Fn+2
1) + Fn+1 = (Fn+2 + Fn+1 )
1
Finally using the definition of the Fibonacci numbers
(Fn+2 + Fn+1 )
1=
n
1=
F +3
n
F( +1)+2
1
The proof is now complete.
Problem 4.2 Show that if A is a finite set, then j2A j = 2jAj .
Solution: We prove the equality using an inductive argument. That is, we first
prove that the equality holds for all sets of size 0 and then we prove that if the
equality holds for all sets of size n 0 then it must hold for all sets of size n + 1.
We begin with all sets of size 0; there is only one set A such that jAj = 0; namely
= ;. We know that
A
j2; j = jf;gj = 1 = 2
0
j;j:
=2
Hence the equality holds for all sets of size 0.
Now assume that An is an arbitrary set of size n 0 and that j2An j = 2jAn j =
2n . Moreover assume that An+1 is An extended with one arbitrary new element, that is jAn+1 j = jAn j + 1 = n + 1. We now want to prove that j2An+1 j =
2jAn+1 j .
How many subsets does An+1 have? Well, every subset of An is also a subset
of An+1 . But since An+1 contains one new element (say x) in addition to those
in An every subset (say A) in An gives rise to two subsets in An+1 (namely A
and A [ fxg). That is An+1 contains twice as many subsets as An . That is,
j2An+1 j = 2 j2An j = 2(2n ) = 2n
+1
=2
which completes the proof.
5 Boolean algebra
A Boolean algebra is a structure (B; ; +; 0 ; 0; 1) where
is a set with at least two elements 0 1,
: ! ,
B
B
;
B
B
6
jAn+1j
!
! ,
+: B
B
0: B
B
B
,
satisfying the following ten laws for all x; y; z
x
x
x
+0
1
0
+x
0
x x
=
x
=
x
=
1
=
0
=
x
=
x
z
x
+y
=
y
+x
x
y
=
y
x
x
x
+ (y
(
y
:
Domination laws
(x
y
B
Identity laws
(x + y ) + z
)
2
+ (y + z )
( Associative laws
z)
y
Commutative laws
z)
=
(x + y ) (x + z )
+ z)
=
(x
y)
+ (x
Distributive laws
z)
Problem 5.1 Show that x 0 = 0 for any x 2 B .
Solution: In case of the binary Boolean algebra we can prove this using e.g.
truth tables because B = f0; 1g and we can simply investigate all possibilities;
however, in the general case we cannot because all we know is that 0; 1 2 B ,
but B may contain also other elements (it may even be infinite).
However, we can always use the laws above which are laws that hold for all
Boolean algebras. (Since they characterize what a Boolean algebra is!) Using
these laws we can replace expressions by equal expressions in the same way as
in “ordinary calculus”, or when using the laws of set theory:
x
0
0+0
(0 + 0 )
( 0 + 0)
0
=
x
=
(x 0) + (x
=
x
=
x
=
x
=
0
x
x
x
0)
x
identity
domination
distributivity
commutatitivity
identity
domination
In this case the proof is fairly simple, but to prove more complex equalities
(e.g. (x + y )0 = x0 y 0 ) is usually quite complicated, having only the ten laws
above at our disposal. On the other hand, once we have proven a new law that
law can be used as a derived law, to shortcut proofs; if we have a sufficient number of such derived laws, proofs become much easier. This is why many text
books list many more laws than the ten laws above when introducing Boolean
algebras. However, all of these extra laws can be proven using only the primitive ones.
7
Download