21.01.2014 Views

# How to prove it (version 0.2.alpha :-) - IDA

How to prove it (version 0.2.alpha :-) - IDA

### Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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 is a subset of a set we must show that every

element in is also an element in . That is, if Ü ¾ , then Ü ¾ , for all

elements Ü (in some universe).

To prove that is not a subset of it is sufficient to find one element belonging

to , but not . Then we have found a so-called counter example.

Problem 1.1 Prove that Ò .

Solution: For instance, take , and Í . Then

and Ò . Then ¾ but ¾ Ò .

To show that two sets, and , areequal, i.e. we show that and

. For instance

Problem 1.2 Show that for arbitrary sets Í.

Solution: Let be arbitrary subsets of Í. We first show that ,

and then the converse.

1

For any sets Í:

½ Law of double negation

¾ DeMorgan’s laws

¿

Commutative laws

´ µ ´ µ Associative laws

´ µ ´ µ

´ µ ´ µ ´ µ Distributive laws

´ µ ´ µ ´ µ

½¼ Idempotent laws

½½

½¾ Identity laws

½¿

Í

½ Í Inverse laws

½

½ Í Í Domination laws

½

½ ´ µ Absorption laws

½

´ µ

Figure 1: Laws of set theory

First assume that Ü ¾ . Then Ü ¾ . Then neither Ü ¾ nor Ü ¾ .

That is, Ü ¾ and Ü ¾ . Then Ü ¾ and Ü ¾ , and finally Ü ¾ .

Next assume that Ü ¾ . Then Ü ¾ and Ü ¾ . Then Ü ¾ and Ü ¾ .

Then Ü ¾ , and finally Ü ¾ .

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 from

some universe Í. Using laws such as these 1 we may do proofs more or less mechanically,

as illustrated below.

Problem 1.3 Show that ´ µ ´´ µ µ .

1 Different books usually list different laws.

2

Solution: We use the laws in Figure 1:

´ µ ´´ µ µ ´ µ ´ ´ µµ Associativity

´ ´ µµ Distributivity

Absorption

2 Functions

Problem 2.1 Consider the function Z· Z· defined as 2

Show that is injective.

´Òµ Ò ¡ ´Ò ½µ ¡ ¡ ¾ ¡ ½

Solution: We have to show that if Ü Ý then ´Üµ ´Ýµ. (This is equivalent to

proving that Ü Ý if ´Üµ ´Ýµ.)

Assume that Ü Ý (where Ü Ý ¾ Z·). Then there are two possibilities: either

ÜÝ ½ or Ý Ü ½. We have to show that both cases imply that ´Üµ

´Ýµ.

Consider the first case: if ÜÝthen

´Üµ Ü´Ü ½µ ´Ý ·½µÝ´Ý ½µ ½Ü´Ü ½µ ´Ý ·½µ ´Ýµ

Since Ü½ it follows that ´Üµ ´Ýµ.

The second case is analoguous.

Remark: How do we prove that a function, e.g. the factorial function 3 N

N, is not injective? In this case it is sufficient to find Ü Ý ¾ N such that Ü Ý,

and ´Üµ ´Ýµ. This is easy in our particular case, since ´¼µ ´½µ ½.

Problem 2.2 Show that if and are surjective, then ´ Æ µ

must be surjective.

2 This is the factorial function, restricted to the positive integers.

3 The factorial function N N can be defined inductively/recursively as follows

´¼µ ½

´Òµ Ò ¡ ´Ò ½µ ´Ò ¼µ

3

Solution: Assume that and are surjective. Remember that

´ Æ µ is a function from to defined as ´ Æ µ´Üµ ´ ´Üµµ. We must

show that every element in is the image of some element in . Hence, take

an arbitrary element Þ ¾ . Since is surjective, there must be some element,

say Ý ¾ , such that Þ ´Ýµ. Moreover since is also surjective there must be

some element, say Ü ¾ , such that Ý ´Üµ. That is, Þ ´ ´Üµµ ´ Æ µ´Üµ.

Hence, for any element Þ ¾ there exists at least one element Ü ¾ such that

Þ ´ Æ µ´Üµ, which means that ´ Æ µ is surjective.

3 Relations

Problem 3.1 Assume that ´ µ is a poset (partially ordered set). Let Ú be a

relation on ¢ defined as follows

Show that ´ ¢ Úµ is a poset.

´Ü ½ Ü ¾ µ Ú ´Ý ½ Ý ¾ µ iff Ü ½ Ý ½ and Ü ¾ Ý ¾

Solution: To prove this you have to show that Ú is reflexive, transitive and

antisymmetric. (Before reading on, make sure that you understand what these

properties mean.)

Take an arbitrary ´Ü ½ Ü ¾ µ ¾ ¢ . Since Ü ½ ¾ and since is reflexive, it

follows that Ü ½ Ü ½ . For the same reason, Ü ¾ Ü ¾ . Since both Ü ½ Ü ½ and

Ü ¾ Ü ¾ it must follow that ´Ü ½ Ü ¾ µ Ú ´Ü ½ Ü ¾ µ. That is, Ú is reflexive.

Next assume that ´Ü ½ Ü ¾ µ Ú ´Ý ½ Ý ¾ µ and that ´Ý ½ Ý ¾ µ Ú ´Þ ½ Þ ¾ µ. Then Ü ½ Ý ½

Þ ½ and Ü ¾ Ý ¾ Þ ¾ . Since is transitive, it follows that Ü ½ Þ ½ and Ü ¾ Þ ¾ .

It must follow that ´Ü ½ Ü ¾ µ Ú ´Þ ½ Þ ¾ µ. That is, Ú is also transitive.

Finally assume that ´Ü ½ Ü ¾ µ Ú ´Ý ½ Ý ¾ µ and that ´Ý ½ Ý ¾ µ Ú ´Ü ½ Ü ¾ µ. Then Ü ½

Ý ½ Ü ½ and Ü ¾ Ý ¾ Ü ¾ . Since is antisymmetric, it follows that Ü ½ Ý ½

and Ü ¾ Ý ¾ . In that case ´Ü ½ Ü ¾ µ´Ý ½ Ý ¾ µ. (Here you must understand what

it means for two tuples to be equal.) That is, Ú is antisymmetric.

4 Inductive definitions and proofs

The Fibonacci numbers is an infinite sequence ¼ ½ ¾ of natural numbers

such that each number is the sum of the two preceeding numbers in the

sequence (the first two numbers are ¼ and ½). We often describe the Fibonacci

4

numbers by the following inductive/recursive definition.

¼ ¼

½ ½

½ · ¾ ´Ò ¾µ

That is ¾ ½ ¿ ¾ ¿ Inductive definition often

lead to inductive proofs.

Problem 4.1 Show that

for every Ò ¼.

Ò

¼

Ò·¾ ½

Solution: We have to show that the equality holds for Ò ¼ ½ ¾. 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, Ò ¼. Secondly we show

that if the equality holds for the case Ò ¼, then it must hold also for the case

Ò ·½. Hence, if the equality holds for Ò ¼, then it must hold also for Ò ½,

in which case it must hold for Ò ¾, in which case it must hold for Ò ¿, etc.

We first prove the so-called base case, Ò ¼. For Ò ¼we have

¼

¼

¼ ¼½ ½ ¾

Ò

Next we show the inductive case, that is we assume that

We then want to show that

¼

Ò·¾ ½ ´Ò ¼µ

Ò·½

¼

´Ò·½µ·¾ ½

We show this by a sequence of equalities. First

Ò

Ò·½

¼

Ò

¼

· Ò·½

According to our initial assumption (the so-called induction hypothesis)

¼

· Ò·½ ´ Ò·¾ ½µ · Ò·½

5

½

The next step is trivial

´ Ò·¾ ½µ · Ò·½ ´ Ò·¾ · Ò·½ µ ½

Finally using the definition of the Fibonacci numbers

The proof is now complete.

´ Ò·¾ · Ò·½ µ ½ Ò·¿ ½´Ò·½µ·¾ ½

Problem 4.2 Show that if is a finite set, then ¾ ¾ .

Solution: We prove the equality using an inductive argument. That is, we first

prove that the equality holds for all sets of size ¼ and then we prove that if the

equality holds for all sets of size Ò ¼ then it must hold for all sets of size Ò·½.

We begin with all sets of size 0; there is only one set such that ¼; namely

. We know that

¾ ½¾ ¼ ¾

Hence the equality holds for all sets of size 0.

Now assume that Ò is an arbitrary set of size Ò ¼ and that ¾ Ò ¾ Ò

¾ Ò . Moreover assume that Ò·½ is Ò extended with one arbitrary new element,

that is Ò·½ Ò ·½Ò ·½. We now want to prove that ¾ Ò·½

¾ Ò·½ .

How many subsets does Ò·½ have? Well, every subset of Ò is also a subset

of Ò·½ . But since Ò·½ contains one new element (say Ü) in addition to those

in Ò every subset (say ) in Ò gives rise to two subsets in Ò·½ (namely

and Ü). That is Ò·½ contains twice as many subsets as Ò . That is,

which completes the proof.

¾ Ò·½ ¾¡¾ Ò ¾´¾ Ò µ¾ Ò·½ ¾ Ò·½

5 Boolean algebra

A Boolean algebra is a structure ´¡ · ¼ ¼ ½µ where

¯ is a set with at least two elements ¼ ½,

¯ ¡ ¢ ,

6

¯ · ¢ ,

¯ ¼ ,

satisfying the following ten laws for all Ü Ý Þ ¾ :

Ü ·¼ Ü

Ü ¡ ½ Ü

Ü · Ü ¼ ½

Ü ¡ Ü ¼ ¼

´Ü · Ýµ ·Þ Ü ·´Ý · Þµ

´Ü ¡ Ýµ ¡ Þ Ü ¡ ´Ý ¡ Þµ

Ü · Ý Ý · Ü

Ü ¡ Ý Ý ¡ Ü

Ü ·´Ý ¡ Þµ ´Ü · Ýµ ¡ ´Ü · Þµ

Ü ¡ ´Ý · Þµ ´Ü ¡ Ýµ ·´Ü ¡ Þµ

Identity laws

Domination laws

Associative laws

Commutative laws

Distributive laws

Problem 5.1 Show that Ü ¡ ¼¼for any Ü ¾ .

Solution: In case of the binary Boolean algebra we can prove this using e.g.

truth tables because ¼ ½ and we can simply investigate all possibilities;

however, in the general case we cannot because all we know is that ¼ ½ ¾ ,

but 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:

Ü ¡ ¼ Ü ¡ ¼·¼ identity

´Ü ¡ ¼µ·´Ü ¡ Ü ¼ µ domination

Ü ¡ ´¼ · Ü ¼ µ distributivity

Ü ¡ ´Ü ¼ ·¼µ commutatitivity

Ü ¡ Ü ¼ identity

¼ domination

In this case the proof is fairly simple, but to prove more complex equalities

(e.g. ´Ü · Ýµ ¼ Ü ¼ Ý ¼ ) 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