CSE 1400 Applied Discrete Mathematics Proofs Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Axioms 1 Logical Axioms 2 Models 2 Number Theory 3 Graph Theory 4 Set Theory 4 Rules of Inference 5 Proof Techniques 5 Vacuous and Trivial Proofs 6 Counterexamples 6 Direct Proofs 7 Proofs by Contradiction 8 Proofs by Contraposition 9 Proofs by Resolution 10 Significant Theorems 10 Fundamental Theorem of Arithmetic 10 Euclid s Lemma 10 The Quotient Remainder Theorem 11 Bézout s Theorem 11 Lamé s Theorem 12 The Binomial Theorem 13 The Prime Number Theorem 13
proofs 2 Problems on Proofs 14 Abstract Mathematics seeks to prove statements are always True or always False, or sometimes True and sometimes False. The statements can be about almost anything, but, in computing, can often be reduced to statements about natural numbers. Starting from an initial set of axioms there are several techniques (arguments) that can be used to establish new truths: direct, indirect, Axioms An initial collection of True premises is necessary to establish a mathematical system. The premises, called axioms, model a system that is interesting to reason about. Euclid s axioms of geometry are perhaps the best known axiomatic system. The Peano axioms for the natural numbers may be less well known, but are essential ideas for building a system of discrete mathematics. The Peano axioms are 1. There is natural number called zero denoted by the symbol 0. 2. If n is a natural number, then n + 1 is a natural number. 3. Zero is not the successor of any natural number n. That is, 0 = (n + 1) for any natural number n. 4. If the successor of n equals the successor of m, then n and m are equal. 5. If set A contains zero and the successor of every element in A, then every natural number is in A, that is A = N. Peano s arithmetic also postulate the existence of an equality relation on the natural numbers that satisfies the rules 1. Reflexive: For all natural numbers n, n = n. The axioms of Euclidean geometry are roughly stated as follows. 1. There is a straight line segment between any two points. 2. A straight line segment can be extended indefinitely into a line. 3. A circle can be constructed with center at one end of a radius of a given a straight line segment. 4. All right angles are identical. 5. Two straight lines intersect if they are not parallel. Axiom 5 is called the induction axiom. It is equivalent to the well-ordering property: Every non-empty set of natural numbers has a least element. Peano s axioms are consistent if they are incapable of deriving a well-formed formula that is both True and False. Peano s axioms are complete if any well-formed formula can be proven either True or False. 2. Symmetric: For all natural numbers n and m, if n = m, then m = n. 3. Transitive: For all natural numbers n, m, and o, if n = m and m = o, then n = o. Logical Axioms Logical axioms are universally True. The following are logical axioms. Gödel proved any logical system L in which Peano axioms are True (a) Cannot be both consistent and complete (b) Cannot be proven consistent unless it is inconsistent.
proofs 3 1. True is a logical axiom. 2. Every expression p whose Boolean form is a tautology is a logical axiom. 3. Let p be an expression. Then p = p is a logical axiom. 4. Let p 0, p 1 and q 0, q 1 be expressions, and let be a relation. If p 0 = p 1 and q 0 = q 1, then (p 0 q 0 ) (p 1 q 1 ) is a logical axiom. 5. Let p and q be expressions and let f be a function. If p = q, then f (p) = f (q) is a logical axiom. 6. If p is True for all values of its variables, then p is True for any particular assignment of values to these variables. ( x)(p) ( x)(p) 7. If p is True, then p is True for all values of its variables p ( x)(p) 8. If for all variables p q, then for all variables p implies for all variables q. ( x)(p q) (( x)(p) ( x)(q)) Models The word model is overly used in English. Here it means a collection of statements (axioms) that are logically or non-logically True. Axioms come in two forms: One form is axioms that are universally True. These are called logical axioms. The other form is axioms that are True some model, but not in others. These are called non-logical axioms. Models can be loosely classified into one of two types: Discrete models that describe finite or countably infinite things, and continuous models that describe continuous things. Continuous models deal with calculus, differential equations, complex analysis, and other advanced fields. These are not the topics of this course. Computing, by what we understand of its nature, is operations on finite, but perhaps unbounded, collections of things. Numbers, graphs, sets, and languages are fundamental things on which computations are performed. Axioms that are True in no systems are rarely useful. Non-logical is not the same as illlogical. Non-logical axioms arise from a recognition of usefulness in various applications. Number Theory Numbers are a fundamental things used in computing. Number theory is the basis for arithmetic and its extensions into algebra, analysis, and other esoteric subjects. Number theory is based on the vocabulary: The set of natural numbers N = {0, 1,...}. The frequency with which esoteric subjects become useful justifies their study.
proofs 4 Four functions 1. The successor function σ(n) = n + 1, n N. 2. An addition function α(n, m) = n + m. 3. A multiplication function µ(n, m) = n m. 4. An exponentiation function ɛ(n, m) = n m. Two relations 1. An equality relation = on pairs (n, m) of natural numbers. 2. A less than relation < on pairs (n, m) of natural numbers. The non-logical axioms of number theory are: Closure of addition: If n and m are natural numbers, then n + m is a natural number. The values of equality and less than are Boolean: True or False. Closure of multiplication: If n and m are natural numbers, then n m is a natural number. Closure of exponentiation: If n and m are natural numbers, then n m is a natural number. Commutativity of addition: If n and m are natural numbers, then n + m = m + n Commutativity of multiplication: If n and m are natural numbers, then n m = m n Associativity of addition: If n, m, and p are natural numbers, then (n + m) + p = n + (m + p) Associativity of multiplication: If n, m, and p are natural numbers, then (n m) p = n (m p) Distribution of multiplication over addition If n, m, and p are natural numbers, then n (m + p) = n m + n p Trichotomy: If n and m are natural numbers, then either n < m, n = m or n > m. Well-Ordered Principle: Every non-empty set of natural numbers has a least element. (This is equivalent to induction.) Non-Triviality: 0 = 1. Existence: 0 is a natural number. The axioms of number theory hope to describe the True properties of the natural numbers N under the operations of addition (+), multiplication ( ), exponentiation ( ), and the two relations: equality (=) and less than (<). Some example expressions in number theory Fundamental questions are: What is True are about arithmetic on the natural numbers? Can we prove every True statement about arithmetic on the natural numbers? Are there True statements about the natural numbers that cannot be proven True?
proofs 5 ( n)(n + 2 < n 2 + 1) ( n)(n 2 = n + 1) ( n)( n 1 k=0 k = n(n 1)/2) ( n)( n 1 k=0 2k = 2 n 1) Graph Theory Graph theory hopes to describe the True properties about graphs. Graph theory is based on the vocabulary: The set of vertices V. Two relations 1. An equality relation = on pairs (u, v) of vertices, written u = v. 2. An edge relation E on pairs (u, v) of vertices, written E(u, v). Vertices are also called nodes. Some example expressions in number theory are E(u, u) (There is an edge from u to u, a self-loop) ( u)( v)(e(v, u)) (There is a vertex u such that every vertex v has an edge from v to u) ( u)( v)(e(u, v) E(v, u)) ( u)( v)( w)(e(u, z) E(z, y) E(x, y)) Set Theory Set theory hopes to describe the True properties about collections. Rules of Inference Inference rules allow the discovery of new truths from an initial set of axioms. The most simple sound argument has one premise p and one conclusion c. This sound argument is a demonstration that 1. if p is True, and 2. if p c is True 3. then c is True.
This basic rule of inference is called modus ponens. Modus ponens is True because its form is always True. This can be demonstrated by the truth table Input Output p c [p (p c)] c 0 0 1 0 1 1 1 0 1 1 1 1 cse 1400 applied discrete mathematics Modus ponens is often written proofs using6 the notation p p c You Read will p is gain True understanding p c isby True. constructing Thereforeac truth is True. table for the Boolean expression c (p (p c)) c There are many useful rules of inferences: modus tollens, reductio ad absurnum, syllogism, resolution, and others. A rule of inference is a statement in propositional calculus that is always True. A rule of inference is a tautology. A tautology is a propositional statement that is always True. The truth table for modus tollens is Proof Techniques Input Output p q [ q (p q)] p 0 0 1 1 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 0 1 1 0 A proof of proposition c is a sound argument that c is True. An argument in propositional calculus is a sequence of propositions p 0, p 1,..., p n 1, c. Modus tollens is written as p q p q Read "q is not True and p q is True. Therefore p is not True." Induction is written as p(0) ( n N)(p(n) p(n + 1)) ( n N)p(n) Read p(n) is True for n = 0; there is a natural number n such that if p(n) is True, then p(n + 1) is True. Therefore p is not True." The first n propositions p 0, p 1,..., p n 1 are called premises. The last proposition c is called the conclusion. An argument is valid when the conditional (p 0 p 1 p n 1 ) c is always True. A valid argument is sound when all of the premises are True. In this case, we ll write (p 0 p 1 p n 1 ) = c The argument is valid when any one of the premises is False or when all of the premises are True and the conclusion is True. In this latter case, the argument is sound. and say the premises prove the conclusion.
proofs 7 Vacuous and Trivial Proofs Consider a conditional statement. If p, then q This conditional statement is True when p is False. This is called a vacuous proof that the conditional statement If p, then q is True. A conditional statement is also True when q is True. Knowing that q is True provides a trivial proof that the conditional If p, then q is True. Counterexamples A statement of the form By definition, set X is a subset of Y if every element x X is also an element of sety. Therefore, since the statement If x, then x Y is True for every x. This conditional is vacuously True because x always False. That is, is a subset of any set Y. If x A, then x U (the universal set) is a trivial proof that the every set is a subset of the universal set. ( a)(p(a)) can be demonstrated to be False by providing a value for a where p(a) is False. The value a is said to be a counterexample to the statement ( a)(p(a)). The existence of a counterexample a proves that it is not the case that p(a) is true for all elements a, that is, Consider the statements: ( a)( p(a)) 1. For every real number x and for every real number y, the algebraic equation ( x R)( y R)(x 2 y = x + y 2 ) x 2 y = x + y 2 is True. One counterexample happens for x = y = 1, where the left-hand side of the equation is 0 and the right-hand side is 2. 2. Every natural number is the sum of squares of two natural numbers. Notice that 0 = 0 2 + 0 2 1 = 0 2 + 1 2 2 = 1 2 + 1 2 But 3 is a counterexample to the statement since 3 cannot be written as the sum of squares of two natural numbers. 3. Every natural number is a prime or composite. Both 0 and 1 are counterexamples. 4. All prime numbers are odd. The number 2 is a counterexample.
proofs 8 Direct Proofs Pretend you could prove p (p q) is True. By modus ponens you could draw the conclusion that q is True. This is called a direct proof of q. Input Output p q (p q p) q 0 0 0 1 0 0 1 0 1 1 1 0 0 1 0 1 1 1 1 1 Direct proofs use modus ponens. To prove q is True, prove or know p = True and prove p implies q is True. For instance, from the True proposition p = ( a, b Z)((a b) 2 0) we can prove the geometric mean is always less than or equal to the arithmetic mean. From p we reason as follows. 0 (a b) 2 = a 2 2ab + b 2 4ab a 2 + 2ab + b 2 = (a + b) 2 The value (a + b)/2 is arithmetic mean of a and b. The value ab is geometric mean of a and b. The direct proof states the geometric mean is less than or equal to the arithmetic mean. (a + b)2 ab 4 a + b ab 2 Proofs by Contradiction Pretend you could prove p False is a True statement. Then you could draw the conclusion that p is True, otherwise the conditional would not be True. This is called the reductio ad absurnum rule of inference: The proof reduces proposition p to an absurdity, and allows the conclusion that the p = True. The reductio ad absurnum schema is: To prove a proposition p is True use a proof by contradiction 1. Pretend p is True.
proofs 9 2. Demonstrate that p False is True. Most often the value of False is expressed as q q, where q is some proposition. 3. Conclude p is False, that is, p is True. Euclid s proof that there are infinitely many prime numbers is a classic reductio ad absurnum. Theorem 1 (Euclid s Theorem). There are infinitely many prime numbers. (Proof by contradiction). Pretend there are only finitely many prime numbers and name them p 0, p 1,..., p n 1. Consider their product plus 1. p = (p 0 p 1 p n 1 ) + 1 Assume the negation of the proposition is True. Clearly p is not one of the prime numbers p 0, p 1,..., p n 1 : It is greater than each of them. None of the prime numbers p 0, p 1,..., p n 1 divide p: There is always are remainder of 1 when p is divided by any of the primes p k. Therefore p has only two divisors: 1 and The integer p is not a prime number. This is a propostion, name it q, that is True if there are finitely many primes. p mod p k = 1 for all k = 0, 1,..., n 1. p; and therefore p is prime. Therefore, the assumption there are The statement p is prime is q and it finitely many primes leads to the construction of a natural number p that is both prime and not prime. This contradiction allows the conclusion there are an unbounded number of prime numbers. Another ancient theorem is called the Archimedean property Theorem 2 (Archimedean property). For every real number x there is an integer n such that n > x. (Proof by contradiction). Pretend there is a real number x such that n x for every integer n. Thus there must exist an integer m that is larger than every other integer. But m + 1 is an integer and m < m + 1. A third ancient theorem, that appears in Euclid s Elements is the following. Theorem 3 (Irrational Square Roots). The square root of 2 is not a rational number. Lemma 1. If a 2 is an even integer, then a is even. (Proof by contradiction). Pretend 2 is rational and write 2 = a/b were a and b are integers. We may also pretend that a/b has been reduced to lowest terms by cancelling any common factors. That is, a and b are relatively prime. must be True if there are finitely many primes.
proofs 10 Consider the equations 2 = a b 2 = a2 b 2 2b 2 = a 2 2b 2 = 4c 2 b 2 = 2c 2 square both sides clear the denominator a 2 is even, so a = 2c b 2 is even, so b is even Thus both a and b are even, contradicting that they are relatively prime. Proofs by Contraposition Pretend you could prove statement (p q) ( q) is True. You could then draw the conclusion that p is True. ((p q) ( q)) ( p) This is called a proof by contraposition. Input Proofs by Resolution Output p q (p q q) p 0 0 1 1 1 0 1 0 1 1 1 0 0 1 0 1 1 0 1 0 A proof by contraposition relies on the logical equivalence p q q p. Proofs by contraposition use modus tollens. To prove p is True, prove or know q True and prove or know p q True. Pretend you could prove the conjunction (p q) ( p r) is True. That is, both conditional statements are True. You could then draw the conclusion that q r is True. This is called the resolution rule of inference.
proofs 11 Significant Theorems There are many theorems that can be derived from many different axiomatic systems. Theorems about the natural numbers N can be important in discrete mathematics applications. There are several reasons for this. 1. The natural numbers are fundamental for arithmetic: addition and multiplication. 2. The natural numbers provide a counting system. 3. The natural numbers provide a naming or indexing system. Fundamental Theorem of Arithmetic extending the operations to include subtraction and division requires extending the natural numbers to the integers and rationals. So many things to count; so little time. A single natural number can point to a complex descriptive name. Theorem 4 (Fundamental Theorem of Arithmetic). Every natural number m greater than 1 is either prime or the product of unique prime factors. The order of the prime factors is not considered important. Proof. Let n > 1 be a natural number. For the first few values natural numbers the theorem is True. 2, 3, 2 2, 5, 2 3, 7, 2 3 So let s pretend the theorem has been establishes for each natural number k = 2, 3,..., (n 1). Consider the next natural number n. If n is prime the theorem is established. On the other hand, if n is composite there exists natural numbers n 1 and n 2 such that n = n 1 n 2 and each has a unique prime factorization. This establishes a unique factorization of n. Euclid s Lemma Another useful number theoretic fact is Euclid s lemma. Lemma 2 (Euclid s). Let p P be a prime number and let a, b N be natural numbers. If p divides ab, then p divides a or p divides b. Proof. Pretend p divides ab and p does not divide a. That is, ( c N)(pc = ab) (a mod p = r = 0) By the Fundamental Theorem of Arithmetic ab can be factored as a product of primes. Since p does not divide a, p is not one of the prime factors of a. Therefore, since the prime factorization is unique, p must be a prime factor of b. That is, p divides b. The Quotient Remainder Theorem For another instance of a direct proof recall the quotient remainder theorem.
proofs 12 Theorem 5 (Quotient-Remainder). Given an integer a Z and an integer n = 0, there exists integers q and r, called the quotient and remainder such that a = q n + r and 0 r < n. Proof. Let us pretend a, n Z, n = 0 are integers and consider the non-empty set of natural numbers A = {a nq 0 : q Z} By the well ordered principle of the natural numbers, A has a least element 0 r = a nq for some q. By contradiction we can show that r n. Consider what happens when you pretend r > n. From For instance, A = {5, 11, 17, 23, 29,...} when a = 23 and n = 6. A is not empty. To see this, let { a/n if n > 0, that is, a nq if a/n q. q = a/n if n < 0, that is, a nq if a/n q. conclude that n < r = a nq 0 < a nq n = a n(q + sgn n) A where and are the floor and ceiling functions. For the first case, q = a/n a/n straightforwardly implies a nq 0. The second case is left as an exercise. But that makes a nq n a member of A smaller than the least member r! Bézout s Theorem Theorem 6 (Bézout s Theorem). Given integers a and b there exists integers s and t such that Proof. Consider the set gcd(a, b) = as + bt A = {as + bt > 0 : s, t Z} By the well ordered principle, there is a least element g = as + bt A. By the quotient remainder theorem there exists integers q and r such that a = gq + r, with 0 r < g Notice that r = a gq = a (as + bt)q = a(1 sq) + btq If r > 0, then r A and r is smaller than g, the least element in A. Therefore r = 0 and g divides a. The same argument holds when b replaces a. Thus, g divides a and b.
proofs 13 Lamé s Theorem Lamé s theorem establishes an upper bound on the time complexity of the Euclidean algorithm for computing the greatest common divisor of two integers. The result is that Euclid s algorithm has logarithmic time complexity. Specifically, no more than 3 lg(max(a, n)) divisions are required to compute gcd(a, n), the greatest common divisor of a and n. The Fibonacci numbers are occur in the proof of Lamé s theorem. Theorem 7 (Lamé s Theorem). Let a, b Z + with a b. Let n be the number of divisions in Euclid s algorithm to compute gcd(a, b). Then n 1 3 lg b Proof. Let r 0 = a and r 1 = b. Euclid s algorithm computes r 0 = r 1 q 1 + r 2 0 r 2 < r 1 r 1 = r 2 q 2 + r 3 0 r 3 < r 2. r n 2 = r n 1 q n 1 + r n 0 r n < r n 1 r n 1 = r n q n using n divisions to compute r n = gcd(a, b). Note that q i 1, i = 1, 2,..., n 1 r n < r n 1 q n 2 Let F i denote the i th Fibonacci number. Then r n 1 = F 2 r n 1 = r n q n 2r n 2 = F 3 r n 2 r n 1 + r n F 3 + F 2 = F 4. r 2 r 3 + r 4 F n 1 + F n 2 = F n r 1 r 2 + r 3 F n + F n 1 = F n+1 Using the growth rate of the Fibonacci numbers F n+1 φ n 1, we find b = r 1 F n+1 > φ n 1 Taking the logarithm base φ of both sides of the inequality yields log φ b = lg b lg φ > n 1
proofs 14 Since (lg φ) 1 < 3 we have 3 lg b > lg b lg φ > n 1 Another way to state the result is that if b can be represented in k bits, then the number of divisions in Euclid s algorithm is less than 3 times the number of bits in b s binary representation. The Binomial Theorem Theorem 8 (Binomial Theorem). Let x and y be real numbers, and let n be a natural number. Then ( ) n (x + y) n = x n k y k k 0 k n ( ) ( ) ( ) ( ) ( ) n n n n n = x n + x n 1 y + x n 2 y 2 + + xy n 1 + y n 0 1 2 n 1 n The Prime Number Theorem Theorem 9 (Prime Number Theorem). Let P = {2, 3, 5, 7, 11,...} be the set of prime numbers. Then the number of primes less than or equal to x is approximately x/ ln x as x goes to infinity. That is, Problems on Proofs {p P : (p x)} ln x lim x = 1 x 1. Construct a truth table to prove that resolution is a tautology. [(p q) ( p r)] (q r) 2. Let n be an integer. Prove that if n is odd, then n = 4k + 1 or n = 4n + 3 for some integer k. 3. Find a counterexample to prove the statement All shapes that have four sides of equal length are squares. 4. Let a be an integer. Prove that if a 2 is odd, then a is odd. 5. If b < 0 show that the remainder r = a bq is greater than or equal to 0 when the quotient q is has value q = a/b. 6. Is the conditional statement If x then x X. True or False? Explain your answer. 7. Prove that if n is even and n is odd, then n 2 = 2n is a True statement.
proofs 15 8. Let a be a natural number. Prove that if a 2 is a multiple of 3, then a is a multiple of 3. 9. Prove that 3 is irrational. 10. Prove that the greatest common divisor of two consecutive Mersenne numbers is 1. 11. Prove or disprove: The greatest common divisor of two consecutive triangular numbers is 1. 12. Prove of disprove the statement: The 8 bit floating point numbers from the course are closed under multiplication. 13. Prove of disprove the statement: The 8 bit floating point numbers from the course obey the associative law for multiplication. 14. Prove the integers are countable by describing a one-to-one and onto function that maps the natural number to the integers. 15. Prove the Cartesian product N N is countable by describing a one-to-one and onto function that maps the natural number to the N N. (Hint: list the ordered pairs in triangular form (0, 0), (1, 0), (0, 1), (2, 0), (1, 1), (0, 2),... and use the triangular numbers to name the ordered pairs.)