CSE 1400 Applied Discrete Mathematics Proofs Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Axioms 1 Logical Axioms Models 2 2 Number Theory 3 Graph Theory Set Theory 4 4 Rules of Inference 5 Proof Techniques 5 Vacuous and Trivial Proofs Counterexamples Direct Proofs 6 6 7 Proofs by Contradiction 8 Proofs by Contraposition Proofs by Resolution 9 10 Significant Theorems 10 Fundamental Theorem of Arithmetic Euclid’s Lemma 10 The Quotient Remainder Theorem Bézout’s Theorem Lamé’s Theorem 10 11 12 The Binomial Theorem 13 The Prime Number Theorem 13 11 cse 1400 applied discrete mathematics 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 6= (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. cse 1400 applied discrete mathematics 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 p0 , p1 and q0 , q1 be expressions, and let ∼ be a relation. If p0 = p1 and q0 = q1 , then ( p0 ∼ q0 ) → ( p1 ∼ q1 ) 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. cse 1400 applied discrete mathematics 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 e(n, m) = nm . • Two relations 1. An equality relation = on pairs (n, m) of natural numbers. The values of equality and less than are Boolean: True or False. 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. • 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 nm 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 6= 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 are Fundamental questions are: What is True 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? cse 1400 applied discrete mathematics proofs 5 • (∀n)(n + 2 < n2 + 1) • ¬(∃n)(n2 = n + 1) −1 • (∀n)(∑nk= 0 k = n ( n − 1) /2) −1 k n • (∀n)(∑nk= 0 2 = 2 − 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). 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. Vertices are also called nodes. cse 1400 applied discrete mathematics Modus ponens is often written using 6 proofs the notation 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 1 0 1 0 1 1 1 1 1 p q 0 0 1 1 0 1 0 1 ∴ You gain understanding conReadwill “p is True and p → c isby True . structing table Thereforeactruth is True . for the Boolean expression Modus tollens is written as ¬q p→q Output ∴ [¬ q ∧ ( p → q )] → ¬ p 1 0 0 0 1 1 0 1 1 1 1 1 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 Input p p→c ¬p Read "q is not True and p → q is True. Therefore p is not True." 1 1 0 0 Induction is written as p (0) (∃n ∈ N)( p (n) → p (n + 1)) Proof Techniques ∴ 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. (∀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 ( p0 ∧ p1 ∧ · · · ∧ pn−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 and say the premises prove the conclusion. 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. cse 1400 applied discrete mathematics 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, (∃ a)(¬ p ( a)) Consider the statements: 1. For every real number x and for every real number y, the algebraic equation x 2 − y = x + y2 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 = 02 + 02 1 = 02 + 12 2 = 12 + 12 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. (∀ x ∈ R)(∀y ∈ R)( x2 − y = x + y2 ) cse 1400 applied discrete mathematics 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 1 1 0 1 0 1 0 0 0 1 1 1 1 1 0 1 0 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 = a2 − 2ab + b2 4ab ≤ a2 + 2ab + b2 = ( a + b)2 ( a + b )2 4 √ a+b ab ≤ 2 ab ≤ 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. 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. cse 1400 applied discrete mathematics 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 p0 , p1 , . . . , pn−1 . Consider their product plus 1. p = ( p 0 p 1 · · · p n −1 ) + 1 Clearly p is not one of the prime numbers p0 , p1 , . . . , pn−1 : It is greater than each of them. None of the prime numbers p0 , p1 , . . . , pn−1 divide p: There is always are remainder of 1 when p is divided by any of the primes pk . Therefore p has only two divisors: 1 and p; and therefore p is prime. Therefore, the assumption “there are 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 a2 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. Assume the negation of the proposition is True. 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 pk = 1 for all k = 0, 1, . . . , n − 1. The statement “p is prime” is ¬ q and it must be True if there are finitely many primes. cse 1400 applied discrete mathematics proofs 10 Consider the equations √ a b a2 2= 2 b 2b2 = a2 2= square both sides clear the denominator a2 is even, so a = 2c 2b2 = 4c2 b2 = 2c2 b2 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 A proof by contraposition relies on the logical equivalence p → q ≡ ¬ q → ¬ p. Output p q (p → q ∧ ¬q) → ¬p 0 0 1 1 0 1 0 1 1 0 0 0 1 1 1 1 1 1 0 0 Proofs by contraposition use modus tollens. To prove ¬ p is True, prove or know ¬ q ≡ True and prove or know p → q ≡ True. Proofs by Resolution 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. cse 1400 applied discrete mathematics 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 Theorem 4 (Fundamental Theorem of Arithmetic). Every natural number m greater than 1 is either prime or the product of unique prime factors. Proof. Let n > 1 be a natural number. For the first few values natural numbers the theorem is True. 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 n1 and n2 such that n = n1 n2 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 6= 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. 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. The order of the prime factors is not considered important. 2, 3, 22 , 5, 2 · 3, 7, 23 cse 1400 applied discrete mathematics proofs 12 Theorem 5 (Quotient-Remainder). Given an integer a ∈ Z and an integer n 6= 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 6= 0 are integers and consider the non-empty set of natural numbers A = { a − nq ≥ 0 : q ∈ Z} For instance, A = {5, 11, 17, 23, 29, . . .} when a = 23 and n = 6. 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 |n| < r = a − nq conclude that 0 < a − nq − |n| = a − n(q + sgn n) ∈ A 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 gcd( a, b) = as + bt Proof. Consider the set 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. A is not empty. To see this, let ( b a/nc if n > 0, that is, a ≥ nq if a/n ≥ q. q= d a/ne if n < 0, that is, a ≥ nq if a/n ≤ q. where b·c and d·e are the floor and ceiling functions. For the first case, q = b a/nc ≤ a/n straightforwardly implies a − nq ≥ 0. The second case is left as an exercise. cse 1400 applied discrete mathematics 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 r0 = a and r1 = b. Euclid’s algorithm computes r0 = r1 q1 + r2 0 ≤ r2 < r1 r1 = r2 q2 + r3 .. . 0 ≤ r3 < r2 r n −2 = r n −1 q n −1 + r n r n −1 = rn qn 0 ≤ r n < r n −1 using n divisions to compute rn = gcd( a, b). Note that • qi ≥ 1, i = 1, 2, . . . , n − 1 • r n < r n −1 ⇒ q n ≥ 2 Let Fi denote the ith Fibonacci number. Then rn ≥ 1 = F2 r n −1 = rn qn ≥ 2rn ≥ 2 = F3 r n −2 ≥ rn−1 + rn ≥ F3 + F2 = F4 .. . r2 ≥ r3 + r4 ≥ Fn−1 + Fn−2 = Fn r1 ≥ r2 + r3 ≥ Fn + Fn−1 = Fn+1 Using the growth rate of the Fibonacci numbers Fn+1 ≈ φn−1 , we find b = r1 ≥ Fn+1 > φn−1 Taking the logarithm base φ of both sides of the inequality yields logφ b = lg b > n−1 lg φ cse 1400 applied discrete mathematics proofs 14 Since (lg φ)−1 < 3 we have 3 lg b > lg b > n−1 lg φ 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 n−k k n ( x + y) = ∑ x y k 0≤ k ≤ n n n n n −1 n n −2 2 n n n n −1 = x + x y+ x y +···+ xy + y 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, lim x → ∞ | { p ∈ P : ( p ≤ x )} | ln x =1 x Problems on Proofs 1. Construct a truth table to prove that resolution [( p → q ) ∧ (¬ p → r )] → ( q ∨ r ) is a tautology. 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 a2 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 = d a/be. 6. Is the conditional statement ‘If x ∈ ∅ then x 6∈ X.’ True or False? Explain your answer. 7. Prove that “if n is even and n is odd, then n2 = 2n” is a True statement. cse 1400 applied discrete mathematics proofs 15 8. Let a be a natural number. Prove that if a2 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.)