discrete mathematics lecture slides

614
Ve203 Discrete Mathematics Dr. Horst Hohberger University of Michigan - Shanghai Jiaotong University Joint Institute Fall Term 2013 Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 1 / 614

Upload: hatetheschool

Post on 16-Dec-2015

104 views

Category:

Documents


8 download

DESCRIPTION

Ve203

TRANSCRIPT

  • Ve203 Discrete Mathematics

    Dr. Horst Hohberger

    University of Michigan - Shanghai Jiaotong UniversityJoint Institute

    Fall Term 2013

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 1 / 614

  • Introduction

    Oce Hours, Email, TAsI Please read the Course prole, which has been uploaded to the

    Resources section on the SAKAI course site.I My oce is Room 218 in in the Law School Building.I My email is [email protected] and Ill try to answer email queries

    within 24 hours.I Oce hours will be announced on SAKAI.I Please also make use of the chat room on SAKAI for asking

    questions, making comments or giving feedback on the course.I The recitation class schedule and the TA oce hours and contact

    details will be announced on SAKAI.I Of course, you can also contact the TA with questions outside of

    oce hours, but please observe basic rules of politeness. It is notappropriate to phone your TA at 10 pm in the evening and requesthelp for the exercise set due the next day. Your TA is there to helpyou, but is not a 24/7 help line.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 2 / 614

  • Introduction

    Coursework PolicyThe following applies mostly to the paper-based homework at thebeginning of this term:I Hand in your coursework on time, by the date given on each set of

    course work. Late work will not be accepted unless you come to mepersonally and I nd your explanation for the lateness acceptable.

    I You can be deducted up to 10% of the awarded marks for anassignment if you fail to write neatly and legibly. Messiness will bepenalized!

    I You are encouraged to compose your coursework solutions in LATEX.While this is optional, there will be a 10% bonus to the awardedmarks for those assignment handed in as typed LATEX manuscripts.LATEXis open-source software for mathematical typesetting, and thereare various implementations available. I suggest that you use Baidu orGoogle to nd a suitable implementation for your computer and OS.LATEXis widely used for writing theses and scientic papers, so it maybe quite useful for you to learn it.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 3 / 614

  • Introduction

    Use of Wikipedia and Other Sources; Honor Code PolicyWhen faced with a particularly dicult problem, you may want to refer toother textbooks or online sources such as Wikipedia. Here are a fewguidelines:I Outside sources may treat a similar sounding subject matter at a

    much more advanced or a much simpler level than this course. Thismeans that explanations you nd are much more complicated or fartoo simple to help you. For example, when looking up the inductionaxiom you may nd many high-school level explanations that are notsucient for our problems; on the other hand, wikipedia contains alot of information relating to formal logic that is far beyond what weare discussing here.

    I If you do use any outside sources to help you solve a homeworkproblem, you are not allowed to just copy the solution; this isconsidered a violation of the Honor Code.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 4 / 614

  • Introduction

    Use of Wikipedia and Other Sources; Honor Code Policy

    I The correct way of using outside sources is to understand thecontents of your source and then to write in your own words andwithout referring back to the source the solution of the problem. Yoursolution should dier in style signicantly from the published solution.If you are not sure whether you are incorporating too much materialfrom your source in your solutions, then you must cite the source thatyou used.

    I You may cooperate with other students in nding solutions toassignments, but you must write your own answers. Do not simplycopy answers from other students. It is acceptable to discuss theproblems orally, but you may not look at each others written notes.Do not show your written solutions to any other student. This wouldbe considered a violation of the Honor Code. Please also refer to theCourse Prole.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 5 / 614

  • Introduction

    Course Grade

    Please note that the grading policy for this course has been updated.Please read the following passage carefully.The course contains four grade components:I Three examinations,I Course work.

    The course grade will be calculated from these components using thefollowing weighting:I First midterm exam: 25%I Second midterm exam: 25%I Final exam: 30%I Course work: 20%

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 6 / 614

  • Introduction

    Class Attendance and Absence for Medical Reasons

    I do not formally require that you attend every class. However, if you areunable to attend a signicant number of lecture, you should notify me.The following rules have been laid down by the Academic Oce:I A student who has been absent from studies for more than one week

    because of illness or other emergency should consult the programadvisor. [and also talk to me!]

    I Absence for illness should be supported by a hospital/doctorscerticate. A note that a student visited a medical facility is notsucient excuse for missing an assignment or an exam. The notemust specically indicate that the student was incapable ofcompleting an assignment or taking the exam due to medicalproblems.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 7 / 614

  • Introduction

    Class Attendance and Absence for Medical Reasons

    I Late medical excuses must satisfy the following criteria to be valid:(i) The problem must be conrmed by the doctor to be so severe that the

    student could not participate in the exam.(ii) The problem must have occurred so suddenly that it was impractical to

    contact me in advance.(iii) The student must be in contact with me immediately after the exam

    with the required documentation.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 8 / 614

  • Introduction

    LATEX Policy and Textbook

    As engineers, you are strongly encouraged to familiarize yourselves with amathematical typesetting program called LATEX. This is open-sourcesoftware, and there are various implementations available. I suggest thatyou use Baidu or Google to nd a suitable implementation for yourcomputer and OS.While the use of LATEX is optional, there will be a 10% bonus to theawarded marks for those assignments handed in as typed LATEXmanuscripts.The main textbook for this course isI Rosen, K. H., Discrete Mathematics and its Applications, 6th Ed.,

    McGraw-Hill International Edition 2007.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 9 / 614

  • Basic Concepts in Discrete Mathematics

    Part I

    Basic Concepts in Discrete Mathematics

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 10 / 614

  • Basic Concepts in Discrete Mathematics

    Basic Concepts in Logic

    Basic Concepts in Set Theory

    Natural Numbers, Integers, Rationals

    Mathematical Induction

    Functions and Sequences

    Algorithms

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 11 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Basic Concepts in Logic

    Basic Concepts in Set Theory

    Natural Numbers, Integers, Rationals

    Mathematical Induction

    Functions and Sequences

    Algorithms

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 12 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Propositional Logic, StatementsA statement (also called a proposition) is anything we can regard as beingeither true or false. We do not dene here what the words statement,true or false mean. This is beyond the purview of mathematics andfalls into the realm of philosophy. Instead, we apply the principle that weknow it when we see it.Contrary to the textbook, we will generally not use examples from thereal world as statements. The reason is that in general objects in thereal world are much to loosely dene for the application of strict logic tomake any sense. For example, the statement It is raining. may beconsidered true by some people (Yes, raindrops are falling out of thesky.) while at the same time false by others (No, it is merely drizzling.)Furthermore, important information is missing (Where is it raining? Whenis it raining?). Some people may consider this information to be implicit inthe statement (It is raining here and now.) but others may not, and thiscauses all sorts of problems. Generally, applying strict logic to colloquialexpressions is pointless.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 13 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    The Natural Numbers

    Instead, our examples will be based on numbers. For now, we assume thatthe set of natural numbers

    N := f0, 1, 2, 3, ...g

    has been constructed. In particular, we assume that we know what a setis! If n is a natural number, we write n 2 N. (We will later discuss naiveset theory and give a formal construction of the natural numbers.) Wealso assume that on N we have dened the operations of addition+: N N! N and multiplication : N N! N and that their variousproperties (commutativity, associativity, distributivity) hold.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 14 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    The Natural Numbers

    1.1.1. Denition. Let m, n 2 N be natural numbers.(i) We say that n is greater than or equal to m, writing n m, if there

    exists some k 2 N such that n = m + k. If we can choose k 6= 0, wesay n is greater than m and write n > m.

    (ii) We say that m divides n, writing m j n, if there exists some k 2 Nsuch that n = m k.

    (iii) If 2 j n, we say that n is even.(iv) If there exists some k 2 N such that n = 2k +1, we say that n is odd.(v) Suppose that n > 1. If there does not exist any k 2 N with

    1 < k < n such that k j n, we say that n is prime.It can be proven that every number is either even or odd and not both.We also assume this for the purposes of our examples.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 15 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Statements1.1.2. Examples.I 3 > 2 is a true statement.I x3 > 10 is not a statement, because we can not decide whether it is

    true or not.I the cube of any natural number is greater than 10 is a false

    statement.

    The last example can be written using a statement variable n:I For any natural number n, n3 > 10

    The rst part of the statement is a quantier (for any natural numbern), while the second part is called a statement form or predicate(n3 > 10).A statement form becomes a statement (which can then be either true orfalse) when the variable takes on a specic value; for example, 33 > 10 is atrue statement and 13 > 10 is a false statement.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 16 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Working with StatementsWe will denote statements by capital letters such as A,B,C , ... andstatement forms by symbols such as A(x) or B(x , y , z) etc.1.1.3. Examples.I A : 4 is an even number.I B : 2 > 3.I A(n) : 1 + 2 + 3 + ... + n = n(n + 1)/2.

    We will now introduce logical operations on statements. The simplestpossible type of operation is a unary operation, i.e., it takes a statement Aand returns a statement B.1.1.4. Denition. Let A be a statement. Then we dene the negation of A,written as :A, to be the statement that is true if A is false and false if Ais true.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 17 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Negation

    1.1.5. Example. If A is the statement A : 2 > 3, then the negation of A is:A : 2 6> 3.We can describe the action of the unary operation : through the followingtable:

    A :AT FF T

    If A is true (T), then :A is false (F) and vice-versa. Such a table is calleda truth table.We will use truth tables to dene all our operations on statements.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 18 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    ConjunctionThe next simplest type of operations on statements are binary operations.The have two statements as arguments and return a single statement,called a compound statement, whose truth or falsehood depends on thetruth or falsehood of the original two statements.1.1.6. Denition. Let A and B be two statements. Then we dene theconjunction of A and B, written A ^ B, by the following truth table:

    A B A ^ BT T TT F FF T FF F F

    The conjunction A ^ B is spoken A and B. It is true only if both A andB are true, false otherwise.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 19 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Disjunction1.1.7. Denition. Let A and B be two statements. Then we dene thedisjunction of A and B, written A _ B, by the following truth table:

    A B A _ BT T TT F TF T TF F F

    The conjunction A _ B is spoken A or B. It is true only if either A or Bis true, false otherwise.1.1.8. Example.I Let A : 2 > 0 and B : 1+1 = 1. Then A^B is false and A_B is true.I Let A be a statement. Then the compound statement A _ (:A) is

    always true, and A ^ (:A) is always false.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 20 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Proofs using Truth TablesHow do we prove that A _ (:A) is an always true statement? We areclaiming that A _ (:A) will be a true statement, regardless of whether thestatement A is true or not. To prove this, we go through all possibilitiesusing a truth table:

    A :A A _ (:A)T F TF T T

    Since the column for A _ (:A) only lists T for true, we see thatA _ (:A) is always true. A compound statement that is always true iscalled a tautology.Correspondingly, the truth table for A ^ (:A) is

    A :A A ^ (:A)T F FF T F

    so A ^ (:A) is always false. A compound statement that is always false iscalled a contradiction.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 21 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Implication1.1.9. Denition. Let A and B be two statements. Then we dene theimplication of B and A, written A) B, by the following truth table:

    A B A) BT T TT F FF T TF F T

    We read A) B as A implies B, if A, then B or A only if B. (Thelast formulation refers to the fact that A can not be true unless B is true.)To illustrate why the implication is dened the way it is, it is useful to lookat a specic implication of predicates: we expect the predicate

    A(n) : n is prime) n is odd, n 2 N, (1.1.1)to be false if and only if we can nd a prime number n that is not odd.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 22 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Implication

    By selecting dierent values of n we obtain the following types ofstatementsI n = 3. Then n is prime and n is odd, so we have T) T.I n = 4. Then n is not prime and n is not odd, so we have F) F.I n = 9. Then n is not prime, but n is odd. We have F) T.

    None of these values of n would cause us to designate (1.1.1) asgenerating false statements. Therefore, we should assign the truth valueT to each of these three cases.However, let us takeI n = 2. Then n is prime, but n is not odd. We have T) F.

    This is clearly a value of n for which (1.1.1) should be false. Hence, we weshould assign the truth value F to the implication T) F.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 23 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Equivalence

    1.1.10. Denition. Let A and B be two statements. Then we dene theequivalence of A and B, written A, B, by the following truth table:

    A B A, BT T TT F FF T FF F T

    We read A, B as A is equivalent to B or A if and only if B. Sometextbooks abbreviate if and only if by i.If A and B are both true or both false, then they are equivalent.Otherwise, they are not equivalent. In propositional logic, equivalence isthe closest thing to the equality of arithmetic.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 24 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    EquivalenceOn the one hand, logical equivalence is strange; two statements A and Bdo not need to have anything to do with each other to be equivalent. Forexample, the statements 2 > 0 and 100 = 99 + 1 are both true, sothey are equivalent.On the other hand, we use equivalence to manipulate compoundstatements.1.1.11. Denition. Two compound statements A and B are called logicallyequivalent if A, B is a tautology. We then write A B.

    1.1.12. Example. The two de Morgan rules are the tautologies

    :(A _ B), (:A) ^ (:B), :(A ^ B), (:A) _ (:B).

    In other words, they state that :(A _ B) is logically equivalent to(:A) ^ (:B) and :(A ^ B) is logically equivalent to (:A) _ (:B).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 25 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    ContrapositionAn important tautology is the contrapositive of the compound statementA) B.

    (A) B), (:B ) :A).For example, for any natural number n, the statement n > 0) n3 > 0is equivalent to n3 6> 0) n 6> 0. This principle is used in proofs bycontradiction.We prove the contrapositive using a truth table:

    A B :A :B :B ) :A A) B (A) B), (:B ) :A)T T F F T T TT F F T F F TF T T F T T TF F T T T T T

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 26 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Rye Whiskey

    The following song is an old Western-style song, called Rye Whiskey andperformed by Tex Ritter in the 1930s and 1940s.

    If the ocean was whiskey and I was a duck,Id swim to the bottom and never come up.But the ocean aint whiskey, and I aint no duck,So Ill play jack-of-diamonds and trust to my luck.For its whiskey, rye whiskey, rye whiskey I cry.If I dont get rye whiskey I surely will die.

    The lyrics make sense (at least as much as song lyrics generally do).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 27 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Rye Whiskey

    We can use de Morgans rules and the contrapositive to re-write the songlyrics as follows

    If I never reach bottom or sometimes come up,Then the oceans not whiskey, or Im not a duck.But my luck cant be trusted, or the cards Ill not buck,So the ocean is whiskey or I am a duck.For its whiskey, rye whiskey, rye whiskey I cry.If my death is uncertain, then I get whiskey (rye).

    These lyrics seem to be logically equivalent to the original song, but arejust humorous nonsense. This again illustrates clearly why it is futile toapply mathematical logic to everyday language.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 28 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Some Logical EquivalenciesThe following logical equivalencies can be established using truth tables orby using previously proven equivalencies. Here T is the compoundstatement that is always true, T : A _ (:A) and F is the compoundstatement that is always false, F : A ^ (:A)

    Equivalence NameA ^ T A Identity for ^A _ F A Identity for _A ^ F F Dominator for ^A _ T T Dominator for _A ^ A A Idempotency of ^A _ A A Idempotency of _:(:A) A Double negation

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 29 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Some Logical Equivalencies

    Equivalence NameA ^ B B ^ A Commutativity of ^A _ B B _ A Commutativity of _

    (A ^ B) ^ C A ^ (B ^ C ) Associativity of ^(A _ B) _ C A _ (B _ C ) Associativity of _

    A _ (B ^ C ) (A _ B) ^ (A _ C ) DistributivityA ^ (B _ C ) (A ^ B) _ (A ^ C ) Distributivity

    A _ (A ^ B) A AbsorptionA ^ (A _ B) A Absorption

    These laws include all that are necessary for a boolean algebra generatedby ^ and _ (identity element, commutativity, associativity, distributivity).Hence the name boolean logic for this calculus of logical statements.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 30 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Some Logical EquivalenciesWe omitted de Morgans laws from the previous table. We now list someequivalences involving conditional statements.

    EquivalenceA) B :A _ B :B ) :A(A) B) ^ (A) C ) A) (B ^ C )(A) B) _ (A) C ) A) (B _ C )(A) C ) ^ (B ) C ) (A _ B)) C(A) C ) _ (B ) C ) (A ^ B)) C(A, B) ((:A), (:B))(A, B) (A) B) ^ (B ) A)(A, B) (A ^ B) _ ((:A) ^ (:B)):(A, B) A, (:B)

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 31 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Logical QuantiersIn the previous examples we have used predicates A(x) with the words forall x . This is an instance of a logical quantier that indicates for which xa predicate A(x) is to be evaluated to a statement.In order to use quantiers properly, we clearly need a universe of objects xwhich we can insert into A(x) (a domain for A(x)). This leads usimmediately to the denition of a set. We will discuss set theory in detaillater. For the moment it is sucient for us to view a set as a collection ofobjects and assume that the following sets are known:I the set of natural numbers N (which includes the number 0),I the set of integers Z,I the set of real numbers R,I the empty set ; (also written ? or fg) that does not contain any

    objects.If M is a set containing x , we write x 2 M and call x an element of M.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 32 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Logical QuantiersThere are two types of quantiers:I the universal quantier, denoted by the symbol 8, read as for all andI the existential quantier, denoted by 9, read as there exists.

    1.1.13. Denition. Let M be a set and A(x) be a predicate. Then wedene the quantier 8 by

    8x2M

    A(x) , A(x) is true for all x 2 M

    We dene the quantier 9 by

    9x2M

    A(x) , A(x) is true for at least one x 2 M

    We may also write 8x 2 M : A(x) instead of 8x2M

    A(x) and similarly for 9.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 33 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Logical QuantiersWe may also state the domain before making the statements, as in thefollowing example.1.1.14. Examples. Let x be a real number. ThenI 8x : x > 0) x3 > 0 is a true statement;I 8x : x > 0, x2 > 0 is a false statement;I 9x : x > 0, x2 > 0 is a true statement.

    Sometimes mathematicians put a quantier at the end of a statementform; this is known as a hanging quantier. Such a hanging quantier willbe interpreted as being located just before the statement form:

    9y : y + x2 > 0 8x

    is equivalent to 9y8x : y + x2 > 0.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 34 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Contraposition and Negation of QuantiersWe do not actually need the quantier 9 since

    9x2M

    A(x) , A(x) is true for at least one x 2 M, A(x) is not false for all x 2 M, : 8

    x2M(:A(x)) (1.1.2)

    The equivalence (1.1.2) is called contraposition of quaniers. It impliesthat the negation of 9x 2 M : A(x) is equivalent to 8x 2 M : :A(x). Forexample,

    : 9x 2 R : x2 < 0 , 8x 2 R : x2 6< 0.Conversely,

    : (8x 2 M : A(x)) , 9x 2 M : :A(x).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 35 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Vacuous Truth

    If the domain of the universal quantier 8 is the empty set M = ?, thenthe statement 8x 2 M : A(x) is dened to be true regardless of thepredicate A(x). It is then said that A(x) is vacuously true.1.1.15. Example. Let M be the set of real numbers x such that x = x + 1.Then the statement

    8x2M

    x > x

    is true.This convention reects the philosophy that a universal statement is trueunless there is a counterexample to prove it false. While this may seem astrange point of view, it proves useful in practice.This is similar to saying that All pink elephants can y. is a truestatement, because it is impossible to nd a pink elephant that cant y.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 36 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Nesting Quantiers

    We can also treat predicates with more than one variable as shown in thefollowing example.1.1.16. Examples. In the following examples, x , y are taken from the realnumbers.I 8x8y : x2 + y2 2xy 0 is equivalent to 8y8x : x2 + y2 2xy 0.

    Therefore, one often writes 8x , y : x2 + y2 2xy 0.I 9x9y : x + y > 0 is equivalent to 9y9x : x + y > 0, often abbreviated

    to 9x , y : x + y > 0.I 8x9y : x + y > 0 is a true statement.I 9x8y : x + y > 0 is a false statement.

    As is clear from these examples, the order of the quantiers is important ifthey are dierent.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 37 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Examples from CalculusLet I be an interval in R. Then a function f : I ! R is said to becontinuous on I if and only if

    8">0

    8x2I

    9>0

    8y2I

    jx y j < ) jf (x) f (y)j < ".

    The function f is uniformly continuous on I if and only if

    8">0

    9>0

    8x2I

    8y2I

    jx y j < ) jf (x) f (y)j < ".

    It is easy to see that a function that is uniformly continuous on I mustalso be continuous on I .If I is a closed interval, I = [a, b], it can also be shown that a continuousfunction is also uniformly continuous. However, that requires techniquesfrom calculus and is not obvious just by looking at the logical structure ofthe denitions.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 38 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Examples from CalculusNegating complicated expressions can be done step-by-step. For example,the statement that f is not continuous on I is equivalent to

    :8">0

    8x2I

    9>0

    8y2I

    jx y j < ) jf (x) f (y)j < "

    ,9">0

    : 8x2I

    9>0

    8y2I

    jx y j < ) jf (x) f (y)j < "

    ,9">0

    9x2I

    : 9>0

    8y2I

    jx y j < ) jf (x) f (y)j < "

    ,9">0

    9x2I

    8>0

    : 8y2I

    jx y j < ) jf (x) f (y)j < "

    ,9">0

    9x2I

    8>0

    9y2I

    (jx y j < ) ^ :(jf (x) f (y)j < ")

    ,9">0

    9x2I

    8>0

    9y2I

    (jx y j < ) ^ (jf (x) f (y)j ")

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 39 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Examples from Calculus

    1.1.17. Example. The Heaviside function H : R! R,

    H(x) :=

    (1 if x 0,0 if x < 0,

    is not continuous on I = R. To see this, we need to show that there existsan " > 0 (take " = 1/2) and an x 2 R (take x = 0) such that for any > 0 there exists a y 2 R such that

    jx y j = jy j < and jH(x) H(y)j = j1 H(y)j " = 12

    .

    Given any > 0 we can choose y = /2. Then jy j = /2 < andj1 H(y)j = 1 > 1/2. This proves that H is not continuous on R.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 40 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Arguments in MathematicsThe previous example contains a mathematical argument to show that theHeaviside function is not continuous on its domain. The argument boilsdown to the following:(i) We know that

    A : 9">0

    9x2R

    8>0

    9y2R

    (jx y j < ) ^ (jH(x) H(y)j ")

    implies

    B : H is not continuous on its domain.(ii) We show that A is true.(iii) Therefore, B is true.Logically, we can express this argument as

    A ^ (A) B)) B.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 41 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Arguments and Argument Forms1.1.18. Denition.(i) An argument is a nite sequence of statements. All statements

    except for the nal statement are called premises while the nalstatement is called the conclusion. We say that an argument is validif the truth of all premises implies the truth of the conclusion.

    (ii) An argument form is a nite sequence of predicates (statementforms). An argument form is valid if it yields a valid argumentwhenever statements are substituted for the predicates.

    From the denition of an argument it is clear that an argument consistingof a sequence of premises P1, ... ,Pn and a conclusion C is valid of andonly if

    (P1 ^ P2 ^ ^ Pn)) C (1.1.3)is a tautology, i.e., a true statement for any values of the premises an theconclusion.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 42 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Arguments and Argument FormsAn argument is a nite list of premises P1, ... ,Pn followed by a conclusionC . We usually write this list as

    P1P2...Pn

    ) C

    where the symbol ) is pronounced therefore. You may only use thissymbol when constructing a logical argument in the notation above. Donot use it as a general-purpose abbreviation of therefore.Certain basic valid arguments in mathematics are given latin names andcalled rules of inference.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 43 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Modus Ponendo Ponens1.1.19. Example. The rule of inference

    AA) B

    ) Bis called modus ponendo ponens (latin for mode that arms byariming); it is often abbreviated simply modus ponens. The associatedtautology is

    A ^ (A) B)) B (1.1.4)We verify that (1.1.4) actually is a tautology using the truth table:

    A B A) B A ^ (A) B) A ^ (A) B)) BT T T T TT F F F TF T T T TF F T T T

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 44 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Hypothetical SyllogismsA syllogism is an argument that has exactly two premises. We rst givethree hypothetical syllogisms, i.e., syllogisms involving the implication).

    Rule of Inference NameAA) B

    ) B

    Modus (Ponendo) PonensMode that arms (by arming)

    :BA) B

    ) :A

    Modus (Tollendo) TollensMode that denies (by denying)

    A) BB ) C

    ) A) C

    TransitiveHypothetical Syllogism

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 45 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Hypothetical Syllogisms1.1.20. Examples.(i) Modus ponendo ponens:

    3 is both prime and greater than 2If 3 is both prime and greater than 2, then 3 is odd

    ) 3 is odd.(ii) Modus tollendo tollens:

    4 is not oddIf 4 is both prime and greater than 2, then 4 is odd

    ) 4 is not both prime and greater than 2.(iii) Transitive hypothetical syllogism:

    If 5 is greater than 4, then 5 is greater than 3If 5 is greater than 3, then 5 is greater than 2

    ) If 5 is greater than 4, then 5 is greater than 2.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 46 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Disjunctive and Conjunctive Syllogisms

    There are two important syllogisms involving the disjunction _ and theconjunction ^:

    Rule of Inference NameA _ B:A

    ) B

    Modus Tollendo PonensMode that arms by denying

    :(A ^ B)A

    ) :B

    Modus Ponendo TollensMode that denies by arming

    A _ B:A _ C

    ) B _ CResolution

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 47 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Disjunctive and Conjunctive Syllogisms1.1.21. Examples.(i) Modus tollendo ponens:

    4 is odd or even4 is not odd

    ) 4 is even.(ii) Modus ponendo tollens:

    4 is not both even and odd4 is even

    ) 4 is not odd.(iii) Resolution:

    4 is even or 4 is greater than 24 is odd or 4 is prime

    ) 4 is greater than 2 or 4 is prime.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 48 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Some Simple Arguments

    Finally, we give some seemingly obvious, but nevertheless useful,arguments:

    Rule of Inference NameAB

    ) A ^ BConjunction

    A ^ B) A

    SimplicationA

    ) A _ BAddition

    Examples for these are left to the reader!

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 49 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Validity and SoundnessThe previous rules of inference are all valid arguments. In the examples wegave, the arguments always led to a correct conclusion. This was, however,only because all the premises were true statements. It is possible for avalid argument to lead to a wrong conclusion if one or more of its premisesare false.If, in addition to being valid, an argument has only true premises, we saythat the argument is sound. In that case, its conclusion is true.1.1.22. Example. The following argument is valid (it is based on the rule ofresolution), but not sound:

    4 is even or 4 is prime4 is odd or 4 is prime

    ) 4 is prime.

    (The second premise is false, so the conclusion doesnt have to be true.)

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 50 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Non SequiturThe term non sequitur (latin for it does not follow) is often used todescribe logical fallacies, i.e., inferences that invalid because they are notbased on tautologies. Some common fallacies are listed below:

    Rule of Inference NameBA) B

    ) AArming the Consequent

    :AA) B

    ) :BDenying the Antecedent

    A _ BA

    ) :BArming a Disjunct

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 51 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Non Sequitur1.1.23. Examples.(i) Arming the consequent:

    If 9 is prime, then it is odd9 is odd

    ) 9 is prime.(ii) Denying the antecedent

    If 9 is prime, then it is odd9 is not prime

    ) 9 is not odd.(iii) Arming a disjunct:

    2 is even or 2 is prime2 is even

    ) 2 is not prime.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 52 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Rules of Inference for Quantied StatementsWithout proof or justication, we give the following rules of inference forquantied statements. They are often assumed as axioms in abstract logicsystems.

    Rule of Inference Name8

    x2MP(x)

    ) P(x0) for any x0 2 MUniversal Instantiation

    P(x) for any arbitrarily chosen x 2 M) 8

    x2MP(x)

    Universal Generalization

    9x2M

    P(x)

    ) P(x0) for a certain (unknown) x0 2 MExistential Instantiation

    P(x0) for some (known) x0 2 M) 9

    x2MP(x)

    Existential Generalization

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 53 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Constructing ArgumentsOften, complex arguments can be broken down into syllogisms. As anexample, we give a logical proof of the following theorem:1.1.24. Theorem. Let n 2 N be a natural number and suppose that n2 iseven. Then n is even.Proof.We use the following premises:

    P1 : 8n2N

    :(n even ^ n odd),P2 : n odd) n2 odd,P3 : n

    2 even ^ (n even _ n odd)

    and we wish to arrive at the conclusion

    C : n even.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 54 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Constructing ArgumentsProof (continued).Premise P2 can be easily checked: if n is odd, there exists some k suchthat n = 2k + 1, so

    n2 = (2k + 1)2 = 2(2k2 + 2k) + 1 = 2k 0 + 1

    where k 0 = 2k2 + 2k. Hence n2 is also odd. We haveP3 : n

    2 even ^ (n even _ n odd)) P4 : n2 even.

    by the Rule of Simplication. By Universal Instantiation, we obtainP1 : 8

    n2N:(n even ^ n odd)

    ) P5 : :(n2 even ^ n2 odd).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 55 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Constructing ArgumentsProof (continued).Furthermore, by Modus Ponendo Tollens,

    P4 : n2 even

    P5 : :(n2 even ^ n2 odd)) P6 : :(n2 odd).

    Using Modus Tollendo Tollens,P6 : :(n2 odd)P2 : n odd) n2 odd

    ) P7 : :(n odd).Simplication yields

    P3 : n2 even ^ (n even _ n odd)

    ) P8 : n even _ n odd.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 56 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Logic

    Constructing ArgumentsProof (continued).Finally, Modus Tollendo Ponens gives

    P7 : :(n odd)P8 : n even _ n odd

    ) C : n even.This completes the proof.1.1.25. Remark. Of course, this proof could have been shortened andsimplied if we had replaced odd with not even throughout, and wemight have formulated premise P3 slightly dierently (as two separatepremises) to avoid using the rule of simplication. However, our goal wasto illustrate the usage of a wide variety of rules of inference and thatwriting down a logically valid proof is in most cases extremely tedious; inmost mathematics, many of the mentioned rules of inference are usedimplicitly without being stated.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 57 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Basic Concepts in Logic

    Basic Concepts in Set Theory

    Natural Numbers, Integers, Rationals

    Mathematical Induction

    Functions and Sequences

    Algorithms

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 58 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Naive Set Theory: Sets via Predicates

    We want to be able to talk about collections of objects; however, we willbe unable to strictly dene what an object or a collection is (exceptthat we also want any collection to qualify as an object). The problemwith naive set theory is that any attempt to make a formal denitionwill lead to a contradiction - we will see an example of this later. However,for our practical purposes we can live with this, as we wont generallyencounter these contradictions.We indicate that an object (called an element) x is part of a collection(called a set) X by writing x 2 X . We characterize the elements of a setX by some predicate P :

    x 2 X , P(x). (1.2.1)

    We write X = fx : P(x)g.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 59 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Notation for SetsWe dene the empty set ? := fx : x 6= xg. The empty set has noelements, because the predicate x 6= x is never true.We may also use the notation X = fx1, x2, ... , xng to denote a set. In thiscase, X is understood to be the set

    X = fx : (x = x1) _ (x = x2) _ _ (x = xn)g.

    We will frequently use the convention

    fx 2 A : P(x)g = fx : x 2 A ^ P(x)g

    1.2.1. Example. The set of even positive integers is

    fn 2 N : 9k2Z

    n = 2kg

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 60 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Subsets and Equality of Sets

    If every object x 2 X is also an element of a set Y , we say that X is asubset of Y , writing X Y ; in other words,

    X Y , 8x 2 X : x 2 Y .

    We say that X = Y if and only if X Y and Y X .We say that X is a proper subset of Y if X Y but X 6= Y . In that casewe write X $ Y .Some authors write for and for $. Pay attention to the conventionused when referring to literature.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 61 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Examples of Sets and Subsets1.2.2. Examples.1. For any set X , ? X . Since ? does not contain any elements, the

    domain of the statement 8x 2 X : x 2 Y is empty. Therefore, it isvacuously true and hence ? X .

    2. Consider the set A = fa, b, cg where a, b, c are arbitrary objects, forexample, numbers. The set

    B = fa, b, a, b, c , cgis equal to A, because it satises A B and B A as follows:

    x 2 A , (x = a) _ (x = b) _ (x = c) , x 2 B.Therefore, neither order nor repetition of the elements aects thecontents of a set.If C = fa, bg, then C A and in fact C $ A. Setting D = fb, cg wehave D $ A but C 6 D and D 6 C .

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 62 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Power Set and CardinalityIf a set X has a nite number of elements, we dene the cardinality of Xto be this number, denoted by #X , jX j or cardX .We dene the power set

    P(M) := fA : A Mg.Here the elements of the set P(M) are themselves sets; P(M) is the setof all subsets of M. Therefore, the statements

    A M and A 2 P(M)are equivalent.1.2.3. Example. The power set of fa, b, cg is

    P(fa, b, cg) = ?, fag, fbg, fcg, fa, bg, fb, cg, fa, cg, fa, b, cg.The cardinality of fa, b, cg is 3, the cardinality of the power set isjP(fa, b, cg)j = 8.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 63 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Operations on SetsIf A = fx : P1(x)g, B = fx : P2(x)g we dene the union, intersection anddierence of A and B by

    A [ B := fx : P1(x) _ P2(x)g, A \ B := fx : P1(x) ^ P2(x)g,A n B := fx : P1(x) ^ (:P2(x))g.

    Let A M. We then dene the complement of A byAc := M n A.

    If A \ B = ;, we say that the sets A and B are disjoint.Occasionally, the notation A B is used for A n B and Ac is sometimesdenoted by A.1.2.4. Example. Let A = fa, b, cg and B = fc , dg. Then

    A [ B = fa, b, c , dg, A \ B = fcg, A n B = fa, bg.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 64 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Operations on Sets

    The laws for logical equivalencies immediately lead to several rules for setoperations. For example, the distributive laws for ^ and _ implyI A \ (B [ C ) = (A \ B) [ (A \ C )I A [ (B \ C ) = (A [ B) \ (A [ C )

    Other such rules are, for example,I (A [ B) n C = (A n C ) [ (B n C )I (A \ B) n C = (A n C ) \ (B n C )I A n (B [ C ) = (A n B) \ (A n C )I A n (B \ C ) = (A n B) [ (A n C )

    Some of these will be proved in the recitation class and the exercises.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 65 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Operations on SetsOccasionally we will need the following notation for the union andintersection of a nite number n 2 N of sets:

    n[k=0

    Ak := A0 [ A1 [ A2 [ [ An,n\

    k=0

    Ak := A0 \ A1 \ A2 \ \ An.

    This notation even extends to n =1, but needs to be properly dened:

    x 21[k=0

    Ak :, 9k2N

    x 2 Ak ,

    x 21\k=0

    Ak :, 8k2N

    x 2 Ak .

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 66 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Operations on SetsIn particular,

    1\k=0

    Ak 1[k=0

    Ak .

    1.2.5. Example. Let Ak = f0, 1, 2, ... , kg for k 2 N. Then1[k=0

    Ak = N,1\k=0

    Ak = f0g.

    To see the rst statement, note that N S1k=0 Ak since x 2 N impliesx 2 Ax implies x 2

    S1k=0 Ak . Furthermore,

    S1k=0 Ak N since

    x 2 S1k=0 Ak implies x 2 Ak for some k 2 N implies x 2 N.For the second statement, note that T1k=0 Ak N. Now 0 2 Ak for allk 2 N. Thus f0g T1k=0 Ak . On the other hand, for any x 2 N n f0g wehave x /2 Ax1 whence x /2

    T1k=0 Ak .

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 67 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Ordered PairsA set does not contain any information about the order of its elements,e.g.,

    fa, bg = fb, ag.Thus, there is no such a thing as the rst element of a set. However,sometimes it is convenient or necessary to have such an ordering. This isachieved by dening an ordered pair, denoted by

    (a, b)

    and having the property that

    (a, b) = (c , d) , (a = c) ^ (b = d). (1.2.2)

    We dene(a, b) := ffag, fa, bgg.

    It is not dicult to see that this denition guarantees that (1.2.2) holds.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 68 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Cartesian Product of Sets

    If A,B are sets and a 2 A, b 2 B, then we denote the set of all orderedpairs by

    A B := f(a, b) : a 2 A, b 2 Bg.A B is called the cartesian product of A and B.

    In this manner we can dene an ordered triple (a, b, c) or, more generally,an ordered n-tuple (a1, ... , an) and the n-fold cartesian productA1 An of sets Ak , k = 1, ... , n.If we take the cartesian product of a set with itself, we may abbreviate itusing exponents, e.g.,

    N2 := N N.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 69 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Problems in Naive Set TheoryIf one simply views sets as arbitrary collections and allows a set tocontain arbitrary objects, including other sets, then fundamental problemsarise. We rst illustrate this by an analogy:Suppose a library contains not only books but also catalogs of books, i.e.,books listing other books. For example, there might be a catalog listing allmathematics books in the library, a catalog listing all history books, etc.Suppose that there are so many catalogs, that you are asked to createcatalogs of catalogs, i.e., catalogs listing other catalogs. In particular, youare asked to create the following:(i) A catalog of all catalogs in the library. This catalog lists all catalogs

    contained in the library, so it must of course also list itself.(ii) A catalog of all catalogs that list themselves. Does this catalog also

    list itself?(iii) A catalog of all catalogs that do not list themselves. Does this

    catalog also list itself?Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 70 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    The Russel Antinomy

    In the previous analogy, we can view catalogs as sets and being listedin a catalog as being an element of a set. Then we have(i) The set of all sets must have itself as an element.(ii) The set of all sets that have themselves as elements may or may not

    contain itself. (This may be decidable by adding some rule to settheory.)

    (iii) It is not decidable whether the set of all sets that do not havethemselves as elements has itself as an element.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 71 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    The Russel Antinomy

    Formally, this paradox is known as the Russel antinomy:

    1.2.6. Russel Antinomy. The predicate P(x) : x /2 x does not dene a setA = fx : P(x)g.

    Proof.If A = fx : x /2 xg were a set, then we should be able to decide for any sety whether y 2 A or y /2 A. We show that for y = A this is not possiblebecause either assumption leads to a contradiction:(i) Assume A 2 A. Then P(A) by (1.2.1), i.e., A /2 A. (ii) Assume A /2 A. Then :P(A) by (1.2.1), therefore A 2 A. Since we cannot decide whether A 2 A or A /2 A, A can not be a set.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 72 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    The Russel Antinomy

    There are several examples in classical literature and philosophy of theRussel antimony:1. A person says: This sentence is a lie. Is he lying or telling the truth?2. In a mountain village, there is a barber. Some villagers shave

    themselves (always) while the others never shave themselves. Thebarber shaves those and only those villagers that never shavethemselves. Who shaves the barber?

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 73 / 614

  • Basic Concepts in Discrete Mathematics Basic Concepts in Set Theory

    Russel Antinomy

    We will simply ignore the existence of such contradictions and build onnaive set theory. There are further paradoxes (antinomies) in naive settheory, such as Cantors paradox and the Burali-Forti paradox. All of theseare resolved if naive set theory is replaced by a modern axiomatic settheory such as Zermelo-Fraenkel set theory.

    Further Information:Set Theory, Stanford Encyclopedia of Philosophy,http://plato.stanford.edu/entries/set-theory/.T. Jech, Set Theory: The Third Millennium Edition, Revised andExpanded, Reprinted by World Publishing Corporation Beijing, 78.00

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 74 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Basic Concepts in Logic

    Basic Concepts in Set Theory

    Natural Numbers, Integers, Rationals

    Mathematical Induction

    Functions and Sequences

    Algorithms

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 75 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The Natural Numbers

    The counting numbers 0, 1, 2, 3, ... are the basis of discretemathematics. We refer to their totality as the set of natural numbers anddenote it by N. We have up to now used them to supply examples for ourintroduction to logic and to enumerate sets. It is time we briey discusshow they can be formally dened.We will represent the natural numbers as set of objects (denoted by N)together with a relation called succession: If n is a natural numbers, thesuccessor of n, succ(n), is dened and also in N. In elementary terms, 1is the successor to 0, 2 is the successor to 1, etc.There is no unique set of natural numbers in the sense that we can exhibitthe set N. Rather, any pair (N, succ), can qualify as a realization of thenatural numbers if it satises certain axioms.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 76 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The Peano Axioms and the Induction Axiom

    1.3.1. Denition. Let N be any set and suppose that the successor of anyelement of N has been dened. The Peano axioms are1. N contains at least one object, called zero.2. If n is in N, the successor of n is in N.3. Zero is not the successor of a number.4. Two numbers of which the successors are equal are themselves equal.5. Induction axiom. If a set S N contains zero and also the successor

    of every number in S , then S = N.Any set with a successor relation satisfying these axioms is called arealization of the natural numbers.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 77 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann RealizationThe Hungarian mathematician John von Neumann gave a very elegantrealization of the natural numbers that is based on set theory:Assume the empty set ; exists. Our idea is to dene

    0 := ;,1 := f0g = f;g,2 := f0, 1g = f;, f;gg,3 := f0, 1, 2g = f;, f;g, f;, f;ggg

    and so on. It is clear that we want 1 to be the successor of 0, 2 thesuccessor of 1 and so on. We therefore dene

    succ(n) := n [ fng, (1.3.1a)N := f;g [ n : 9

    m2Nn = succ(m)

    . (1.3.1b)

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 78 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann RealizationOne interesting feature of this realization is that

    n 2 succ(n) and n $ succ(n).

    Furthermore, we have a natural denition of the ordering relation

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann RealizationWe have skipped over the fourth Peano axiom: We need to showsucc(m) = succ(n) implies m = n. This is a little complicated and requirestwo further lemmas, which we discuss below.1.3.2. Lemma. Let n be a natural number in the von Neumann realization(1.3.1). Then

    8m2N

    m 2 n ) n 6 m, (1.3.2)or, equivalently,

    8m2N

    n m ) m /2 n (1.3.3)

    Proof.Let S be the set of natural numbers such that (1.3.2) holds,

    S :=nn 2 N : 8

    m2Nm 2 n ) n 6 m

    o.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 80 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann RealizationProof (continued).Our goal is to show that S = N, so that (1.3.2) is established for alln 2 N. Of course, at rst it is possible that S = ;.We rst show that 0 2 S . Since 0 = ;, m 2 0 is false for all m 2 N and sothe implication

    m 2 0 ) 0 6 mis true for all m 2 N. Hence, 0 2 S .We next aim to show that if n 2 S , then succ(n) 2 S . This then yieldsS = N by the induction axiom.Let n 2 S . We rst derive a basic fact: since n = n, we have, in particular,that n n so n /2 n by (1.3.3) for m = n. Then

    succ(n) = n [ fng 6 n.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 81 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann Realization

    Proof (continued).Now suppose that succ(n) m for some m. Then n succ(n) m.Since n 2 S , it follows that m /2 n. By contraposition, if m 2 n, thensucc(n) 6 m.Hence, succ(n) 6 n and succ(n) 6 m for all m 2 n. Since the elements ofsucc(n) consist of n and the elements of n, it follows that

    m 2 succ(n) ) succ(n) 6 m

    Therefore, if n 2 S , then succ(n) 2 S .We have shown that the set S contains 0 and the successor of everyelement of S . By the induction axiom (which we have already establishedfor the von Neumann construction) it follows that S = N.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 82 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann Realization

    1.3.3. Denition. A set A is called transitive if

    y 2 x ^ x 2 A ) y 2 A.

    In particular, a set A is transitive if and only if x A for all x 2 A.1.3.4. Lemma. Let n be a natural number in the von Neumann realization(1.3.1). Then n is transitive.

    Proof.We again proceed by induction. Let S be the set of transitive naturalnumbers. Then 0 2 S is vacuously true. Now let n 2 S . If x 2 succ(n),then either x 2 n or x = n. If x 2 n, then x n succ(n), becausen 2 S . If x = n, then x n [ fng = succ(n). Hence, succ(n) 2 S and weagain deduce S = N by the induction axiom.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 83 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The von Neumann Realization

    Finally, we can prove that the von Neumann numbers satisfy the fourthPeano axiom:1.3.5. Lemma. Let m and n be natural numbers in the von Neumannrealization (1.3.1). Then n

    succ(m) = succ(n) ) m = n

    Proof.Let n[fng = m[fmg. Then n 2 m or n = m. Similarly, m = n or m 2 n.Suppose that m 6= n. Then n 2 m and m 2 n. By Lemma 1.3.4, n 2 n.However, Lemma 1.3.2 then implies n 6 n, which is a contradiction.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 84 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Addition

    Once the set of natural numbers is established (e.g., through the Peanoaxioms), it is possible to dene the operation of addition on N. A detailedprocedure is given in E. Landaus book Foundations of Analysis. Here, werestrict ourselves to listing the properties that this operation then has.For any two natural numbers a, b 2 N we can dene the natural numberc = a+ b 2 N called the sum of a and b. This addition has the followingproperties (here a, b, c 2 N):1. a+ (b + c) = (a+ b) + c (Associativity)2. a+ 0 = 0 + a = a (Existence of a neutral element)3. a+ b = b + a (Commutativity)

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 85 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Multiplication

    Similarly, we can dene multiplication, where a b 2 N is called theproduct of a and b. We have the following properties (here a, b, c 2 N):1. a (b c) = (a b) c (Associativity)2. a 1 = 1 a = a (Existence of a neutral element)3. a b = b a (Commutativity)

    We also have a property that essentially states that addition andmultiplication are consistent,

    a (b + c) = a b + a c . (Distributivity)

    Note that we are not able to dene subtraction or division for all naturalnumbers.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 86 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Notation for Addition and Multiplication

    For numbers a1, a2, ... , an we dene the notation

    a1 + a2 + + an =:nX

    j=1

    aj =:X

    1jnaj

    anda1 a2 an =:

    nYj=1

    aj =:Y

    1jnaj .

    For n 2 N we dene

    0! := 1 and n! := n (n 1)! for n > 1.

    This is an example of a recursive denition.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 87 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Powers and Divisors

    We are also able to dene the exponential

    ab = a a ... a| {z }b times

    for a, b 2 N

    by setting a0 := 1 and an := a an1. (This is another recursivedenition.) We note that

    ab+c = ab ac and (ab)c = abc .

    For a, b 2 N dene the statement

    a j b , 9c 2 N : c a = b,

    read as a divides b. If a j b, then a is called a divisor of b.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 88 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    RelationsWe will now work to introduce further sets of numbers, such as integersand quotients. This requires some further set-theoretic background. Forthis, we will preview some of the material of Chapter 8 of the textbook.Given two sets, the elements of these sets may be paired together in acertain way. A more precise formulation is given by the concept of arelation, which we now introduce. First, here are some examples toillustrate what we mean:1.3.6. Examples.I For n 2 N, n 7! n2 associates to every number n its square n2.I n3 7! n associates to some numbers n3 = p 2 N the number n.

    We implement this by dening a relation R to be a set of ordered pairs. Inthe above examples, we might dene

    R = f(a, b) 2 N2 : b = a2g,R = f(a, b) 2 N2 : a = b3g,

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 89 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    RelationsIn general, we dene a relation R between two sets M and N as

    R = f(m, n) 2 M N : P(m, n)g (1.3.4)where P is a statement frame (predicate). If M = N, we say that R is arelation on M.Thereby the active concept of a relation (we associate one number toanother; we do something) is dened by the static concept of a set (noaction takes place; R is just an object). This is a fairly modern idea inmathematics.Instead of writing (a, b) 2 R , we often write a R b (or a b if therelation R is clear from context).We dene the domain of a relation R by

    domR = fa : 9b : (a, b) 2 Rgand the range by

    ranR = fb : 9a : (a, b) 2 Rg.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 90 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Equivalence Relations

    1.3.7. Denition. We say that a relation R on a set M is1. reexive if (a, a) 2 R for all a 2 M;2. symmetric if (a, b) 2 R implies (b, a) 2 R for all a, b 2 M;3. transitive if (a, b) 2 R and (b, c) 2 R implies (a, c) 2 R for all

    a, b, c 2 M.A reexive, symmetric and transitive relation on M is called an equivalencerelation on M. In more intuitive notationI reexivity means a a for all a 2 M,I symmetry means a b ) b a,I transitivity means a b ^ b c ) a c .

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 91 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Relations1.3.8. Examples.I The relation R = f(a, b) 2 N2 : a > bg includes the pairs

    (1, 0), (2, 1), (2, 0) but not the pair (0, 1). We write(a, b) 2 R , a b , a > b and notice that is transitive (sincea > b and b > c implies a > c), but not symmetric (a > b 6) b > a)or reexive (a 6> a).

    I For n 2 N we dene the integer sum I (n) as the sum of all integersthat compose the number, e.g. I (125) = 1 + 2 + 5 = 8,I (78) = 7 + 8 = 15.Then the relation R = f(a, b) 2 N2 : I (a) = I (b)g includes the pairs(22, 4), (14, 5), (3, 30) but not the pair (4, 1). We note that R isreexive (I (a) = I (a)), symmetric (if I (a) = I (b), then alsoI (b) = I (a)) and transitive if I (a) = I (b) and I (b) = I (c), thenI (a) = I (c)), so R is an equivalence relation. We may then call allnumbers with equal integer sums equivalent in this sense.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 92 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Equivalence ClassesA partition of a set A is a family F of disjoint subsets of A such that theirunion is A. An element of a partition is called a ber or an equivalenceclass. An element of such an equivalence class is called a representative ofthe class.

    1.3.9. Example. Denote by 2N = f0, 2, 4, 6, ...g N the set of all evennatural numbers and by 2N+ 1 = f1, 3, 5, 7, ...g N the set of all oddnatural numbers. Since

    2N \ (2N+ 1) = ; and 2N [ (2N+ 1) = N

    it follows that F = f2N, 2N+ 1g is a partition of N and 2N and 2N+ 1are the two equivalence classes of this partition. The number 4 is arepresentative of 2N, as are 0, 128 and 456, and the numbers 1, 7, 457 arerepresentatives of 2N+ 1.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 93 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Equivalence ClassesWe often denote equivalence classes by one of their representativesenclosed in square brackets, so we might write

    2N = [0] and 2N+ 1 = [1].

    1.3.10. Theorem. Every partition F of M induces an equivalence relation on a set M by

    a b :, a, b 2 M are in the same equivalence class. (1.3.5)

    Proof.It is easily seen that the relation dened by (1.3.5) is reexive,symmetric and transitive.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 94 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Fundamental Theorem on Partitions and EquivalenceRelations1.3.11. Theorem. Every equivalence relation on a set M induces apartition F = f[a] : a 2 Mg of M by

    a 2 [b] :, a b. (1.3.6)

    We write F = M/ .

    Proof.Since is reexive, it follows that a 2 [a] for every a 2 M. Thus, theunion of all classes is M. We need to show that the classes are disjoint.Let [a], [b] be two classes. Assume that there is an element c 2 M suchthat c 2 [a] and c 2 [b]. Then c b and c a for every a 2 [a]. Bysymmetry, a c for every a 2 [a] and by transitivity a b, i.e., a 2 [b]for every a 2 [a]. It follows that [a] [b]. Changing the roles of a and b,we have [b] [a], hence [a] = [b].

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 95 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The IntegersWe will now introduce the negative numbers. One big deciency in thenatural numbers is that there is no inverse element for addition, i.e., forevery n 2 N we would like to have an element n such that

    n + (n) = 0

    Such an element does not exist in N. We therefore consider the set ofordered pairs

    N2 = f(n,m) : m, n 2 Ng.We can consider N as a natural subset of N2 by replacing n 2 N with(n, 0) 2 N2. Furthermore, we dene the following equivalence relation onN2:

    (n,m) (p, q) :, n + q = m + p. (1.3.7)

    Therefore, the pair (5, 0) (which corresponds to 5 2 N) is equivalent to(6, 1), because 5 + 1 = 0 + 6.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 96 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The Integers

    We have the following facts:I (1.3.7) denes an equivalence relation, which induces a partitionZ = N2/ on N2.

    I Every pair of the form (n, 0) 2 N2, n 2 N, is in a dierent equivalenceclass of this partition. We denote these equivalence classes by[+n] 3 (n, 0).

    I Every pair of the form (0, n) 2 N2, n 2 N, n 1, is in yet anotherequivalence class, denoted by [n] 3 (0, n).

    I Any other pair is in a class [+n] or a class [n] for some n 2 N.I It follows that

    Z = f[+n] : n 2 Ng [ f[n] : n 2 N n f0gg.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 97 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The IntegersWe now want to dene addition for elements of N2 by

    (n,m) + (p, q) = (n + p,m + q). (1.3.8)

    If (n,m) (en, em) and (p, q) (ep, eq), then(n,m) + (p, q) (en, em) + (ep, eq). (1.3.9)

    This means that we can dene the sum of two equivalence classes by(1.3.8): let [n], [m] 2 Z. Then we dene [n] + [m] as the classwhose representatives are obtained by adding any representative of [n] toany representative of [m] according to (1.3.8). The fact that the resultdoes not depend on which representative we choose is expressed by(1.3.9).We say that the so dened addition on Z is independent of the chosenrepresentative and therefore well-dened.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 98 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The IntegersNote that

    (n,m) + (0, 0) = (n,m), (n,m) + (p, q) = (p, q) + (n,m)

    and we also have the associative law of addition.Therefore, the addition onZ also has these properties and [0] 2 Z is the neutral element of addition.Furthermore, let (n,m) 2 N2. Then

    (n,m) + (m, n) = (n +m, n +m) (0, 0).

    In particular, [n] + [n] = [0], so we now have an inverse element for theaddition dened on Z.The set Z is known as the set of integers. We write n instead of [n] andn instead of [n]. Furthermore, we abbreviate n + (m) by n m andcall the operation subtraction. The letter Z is used for historicalreasons: it stands for the German word for numbers, Zahlen.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 99 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    The IntegersLet us review our strategy:I The set of natural numbers was too small, because it didnt include

    an inverse element of addition.I We introduce pairs of natural numbers and identify the natural

    numbers with certain pairs (n$ (n, 0)).I We introduce a suitable equivalence relation on N2 and takeZ = N2/ to be the induced partition.

    I We characterize the partition Z = f[n]g [ f[n]g.I We dene addition on N2 so that it is compatible with the previously

    dened addition on N, i.e., we have n$ (n, 0), m$ (m, 0) and(n, 0) + (m, 0) = (n +m, 0)$ n +m.

    I We show that the addition on N2 is compatible with the equivalenceclasses and can hence be used to dene the sum of two classes in Z.

    I We see that for the addition in Z we now have an inverse element forevery element of Z.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 100 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Rational Numbers

    We now repeat this strategy for the operation of multiplication: we still donot have an inverse element of multiplication in Z.We consider Z2, the set of pairs of integers. We dene the equivalencerelation

    (n,m) (p, q) :, n q = m p. (1.3.10)

    for (n,m), (p, q) 2 Z2.Furthermore, we dene the product of two pairs of integers by

    (n,m) (p, q) = (n p,m q) (1.3.11)

    and we consider Z as a subset of Z2 by associating n$ (n, 1).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 101 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Rational NumbersIn the same way as previously it can now be shown that the multiplication(1.3.10) can be used to dene a multiplication on Q := Z2/ and thatthis multiplication is well-dened, commutative, associative, has neutralelement [(1, 1)] and every element [(n,m)] 2 Q has an inverse element[(n,m)1] = [(m, n)].We further dene addition on Q by

    (m, n) + (p, q) = (q m + p n, nq).

    We will ordinarily identify a representative (n,m) with its class [(n,m)]and further write

    (n,m) =:n

    m2 Q.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 102 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Comments on the Literature

    The book by Landau is quite old (1929) and therefore very classical in itsapproach. Our constructions are essentially the same as those in thatbook, but there are some dierences:I Landau introduces natural numbers from the Peano axioms, without

    the set-theoretic construction we used.I Landau starts with the positive natural numbers, then introduces

    fractions and then integers and rational numbers as equivalenceclasses of fractions. He then uses ordering relations , = tointroduce negative numbers.

    I While Landau uses classes and equivalence, he does notintroduce them as formally as we do.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 103 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Basic Properties of Numbers - AdditionFrom now on we assume that the natural numbers are constructed as in(1.3.1) and that from them we have obtained the integers and the rationalnumbers.We briey recapitulate the basic properties of the rational numbers. Foraddition we have

    associativity 8a,b,c2Q

    a+ (b + c) = (a+ b) + c (P1)

    neutral element 902Q

    8a2Q

    a+ 0 = 0 + a = a (P2)

    inverse element 8a2Q

    9a2Q

    (a) + a = a+ (a) = 0 (P3)

    commutativity 8a,b2Q

    a+ b = b + a. (P4)

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 104 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Multiplication

    For multiplication, we have a similar set of properties

    associativity 8a,b,c2Q

    a (b c) = (a b) c , (P5)

    neutral element 912Q1 6=0

    8a2Q

    a 1 = 1 a = a, (P6)

    inverse element 8a2Q

    9a12Q

    a a1 = a1 a = 1, (P7)

    commutativity 8a,b2Q

    a b = b a. (P8)

    With these properties we can prove that if a 6= 0 and a b = a c , thenb = c .

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 105 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Combining Addition and Multiplication

    These twice four properties for addition and multiplication are basicallyindependent of each other (the only connection was that 0 6= 1). Thefollowing property ensures that the two operations work well together,

    distributivity 8a,b,c2Q

    a (b + c) = a b + a c . (P9)

    It is this relation that allows us to prove that a b = b a only if a = b,and it is also the law of distributivity that we employ to do elementarymultiplications. Furthermore, we can now prove that if a b = 0, theneither a = 0 or b = 0.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 106 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Size ComparisonsWe will discuss general ordering relations in detail at a later time. Fornow, we dene

    m < n :, m ( n for m, n 2 N,[(0,m)] < [(n, 0)] for all [(0,m)] 2 Z n N, n 2 N.[(0,m)] < [(0, n)] :, n < m for [(0,m)], [(0, n)] 2 Z n N.

    For rational numbers m 2 Q, we rst dene0 < m =

    p

    q:, (p < 0 ^ q < 0) _ (0 < p ^ 0 < q) for p, q 2 Z,

    and then setm < n :, 0 < n m for m, n 2 Q.

    We also denem n :, (m < n) _ (m = n) for m, n 2 Q.

    Lastly, we write m > n if n < m and m n if n m.Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 107 / 614

  • Basic Concepts in Discrete Mathematics Natural Numbers, Integers, Rationals

    Further Perspectives

    The set of rational numbers is complete with respect to addition andmultiplication. However, it is not so with respect to operations such assquaring: there is no inverse element for operation of squaring. Givenb 2 Q, it may not be possible to nd a 2 Q such that a2 = b.To remedy this, the rational numbers can be extended further to the set ofreal numbers. As we will discuss later, while the set of rational numbers iscountable, this extension will be uncountable. In particular, the realnumbers do not fall within the purview of discrete mathematics, but ratherin that of calculus and analysis. We will therefore not treat this furtherextension (and the subsequent extension to complex numbers) here. Wedo note that one way of dening real numbers involves equivalence classesof convergent and Cauchy sequences.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 108 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Basic Concepts in Logic

    Basic Concepts in Set Theory

    Natural Numbers, Integers, Rationals

    Mathematical Induction

    Functions and Sequences

    Algorithms

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 109 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Mathematical InductionTypically one wants to show that some statement frame A(n) is true for alln 2 N with n n0 for some n0 2 N. Mathematical induction works byestablishing two statements:

    (I) A(n0) is true.(II) A(n + 1) is true whenever A(n) is true for n n0, i.e.,

    8n2Nnn0

    A(n)) A(n + 1)

    Note that (II) does not make a statement on the situation when A(n) isfalse; it is permitted for A(n + 1) to be true even if A(n) is false.The principle of mathematical induction now claims that A(n) is true forall n n0 if (I) and (II) are true. This follows from the fth Peano axiom(the induction axiom).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 110 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Introductory Example

    1.4.1. Example. Consider the statementnX

    k=1

    (2k 1) = n2 for all n 2 N n f0g.

    This is a typical example, in that A(n) : Pnk=1(2k 1) = n2 is a predicatewhich is to be shown to hold for all natural numbers n > 0.We rst establish that A(1) is true:

    1Xk=1

    (2k 1) = 2 1 1 = 1 and 12 = 1,

    so A(1) : 1 = 1 is true.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 111 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Introductory Example

    We next show that A(n)) A(n + 1) for all n 2 N n f0g. This means weshow that Pn+1k=1(2k 1) = (n + 1)2 if Pnk=1(2k 1) = n2. Let n now beany n for which A(n) is true. We then write

    n+1Xk=1

    (2k 1) =nX

    k=1

    (2k 1) + 2(n + 1) 1

    If A(n) is true for this specic n, we can replace the sum on the right byn2, yielding

    n+1Xk=1

    (2k 1) = n2 + 2n + 1 = (n + 1)2

    But this is just the statement A(n + 1). Therefore, if A(n) is true, thenA(n + 1) will also be true. We have shown that A(n)) A(n + 1).

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 112 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Foundations of InductionEssentially, mathematical induction claims that for all n0 2 N,

    A(n0) ^ 8n2Nnn0

    (A(n)) A(n + 1))) 8

    n2Nnn0

    A(n). (1.4.1)

    To simplify the discussion, let us consider rst the case n0 = 0. Why is theconclusion (1.4.1) justied? Recall the 5th Peano axiom for the naturalnumbers:

    Induction axiom: If a set S N contains zero and also thesuccessor of every number in S , then S = N.

    Let us take S = fn 2 N : A(n)g. Then we rst show that A(0) is true, so0 2 S . Next we show that A(n)) A(n + 1) for all n 2 N. This meansthat if n 2 S , then n + 1 (the successor of n) is also in S . By theinduction axiom, this means that S = N. Thus, by showing the hypothesisin (1.4.1) we arrive at the conclusion, A(n) is true for all n 2 N.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 113 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Foundations of InductionTo adapt the previous argument to the case where n0 > 0, we can just take

    S = fn 2 N : n < n0 _ ((n n0) ^ A(n))g.

    The details are left to you!We observe that the 5th Peano axiom is basically tailor-made to ensurethe validity of induction. We could paraphrase the axiom as inductionworks! In fact, there are alternative choices for the 5th axiom, such asthe so-called

    Well-Ordering Principle: Every non-empty set S N has a leastelement.

    This axiom presupposes that we know what least, or, more precisely,less than means for the natural numbers. While we will discuss orderingrelations in detail later, for now we make a provisional denition as follows.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 114 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Foundations of Induction

    Let Sm be the set containing m as well as the successor of any element ofSm. Then

    m < n :, (n 2 Sm) ^ (n 6= m).Of course, if we use the set-theoretic construction of the natural numbers(1.3.1) then we simply have m n, m n.We now take a least element of a set M to be an element m0 2 M suchthat M Sm0 , or in other words, m0 m for all m 2 M. We then havethe Well-Ordering Principle can then be written as

    8MN

    9m2M

    M Sm.

    (The Well-Ordering Principle is sometimes also called the Least ElementPrinciple.)

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 115 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Foundations of Induction

    1.4.2. Theorem. Assume that a system of numbers satises the rst fourPeano axioms and the Well-Ordering Principle. Then the Induction Axiomholds.

    Proof.Let S N satisfy the property that 0 2 S and that if n 2 S , thensucc(n2S . We need to show that S = N. Suppose that there exists ann0 2 N such that n0 /2 S . Then the set M = fn 2 N : n /2 Sg is non-empty.By the well-ordering principle, M must have a least element m0. Since0 2 S , m0 6= 0. Since m0 > 0 and m0 2 N, there exists a number m0 1preceding m0. This number is not in M, because m0 is the least element ofM. Therefore, m0 1 2 S . However, by the denition of S , the successorof m0 1 must also be in S . Since the successor of every number isunique, m0 2 S and hence m0 /2 M. We arrive at a contradiction.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 116 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Foundations of Induction

    In fact, the Induction Axiom and the Well-Ordering Principle areequivalent: you will prove in the assignments that the Induction Axiomalso implies the Well-Ordering Principle. This means that if we take one ofthe two as an axiom, the other becomes a theorem that can be proven. Itis a common situation in mathematics that we have several equivalentchoices for a system of axioms.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 117 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Further Examples of InductionMathematical induction can be used to prove any sort of statement on thenatural numbers in a variety of contexts. Some examples follow:1.4.3. Examples.1. 8

    n2N(1 + 12)

    n 1 + n/2.2. 8

    n2N8

    a,b2Q(a+ b)n =

    Pnk=0

    n!(nk)!k!a

    nbnk .

    3. 8n2N

    8r2Qr=p/qq2>p2

    Pnk=0 r

    k = rk+11r1 .

    4. Let Hk =nP

    k=1

    1k for n 2 N n f0g. Then 8

    n2NH2n 1 + n/2.

    5. Let M be a set and A1, ... ,An M. Then n\i=1

    Ai

    c=

    n[i=1

    Aci .

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 118 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Further Examples of Induction6. Let M be a set with cardinality cardM = n, n 2 N. Then

    cardP(M) = 2n.7. Shootout at the O.K. Corral: an odd number of lawless individuals,

    standing at mutually distinct distances to each other, re pistols ateach other in exactly the same instant. Every person res at theirnearest neighbor, hitting and killing this person. Then there is at leastone survivor.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 119 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    The ShootoutLet us discuss the last example in more detail: Let P(n) be the statementthat there is at least one survivor whenever 2n + 1 people, re pistols ateach other in the same instant. Each person res at his nearest neighbor,and all people stand at mutually distinct distances to each other.For n = 1, there are three people, A, B and C. Suppose that the distancebetween A and B is the smallest distance of any two of them. Then A resat B and vice-versa. C res at either A or B and will not be red at, so Csurvives.Suppose P(n). Let 2n+3 people participate in the shootout. Suppose thatA and B are the closest pair of people. The A and B re at each other.I If at least one other person res at A or B, then there remain 2n

    shots red among the remaining 2n + 1 people, so there is at leastone survivor.

    I If no-one else res at A or B, then there are 2n + 1 shots red amongthe 2n + 1 people and by P(n), there is at least one survivor.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 120 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Pitfalls in InductionWhile mathematical induction is an extremely powerful technique, it mustbe executed most carefully. In proceeding through an induction proof itcan happen quite easily that implicit assumptions are made that are notjustied, thereby invalidating the result.1.4.4. Example. Let us use mathematical induction to argue that every setof n 2 lines in the plane, no two of which are parallel, meet in acommon point.The statement is true n = 2, since two lines are not parallel if and only ifthey meet at some point. Since these are the only lines underconsiderations, this is the common meeting point of the lines.We next assume that the statement is true for n lines, i.e., any nnon-parallel lines meet in a common point. Let us now consider n + 1lines, which we number 1 through n+ 1. Take the set of lines 1 through n;by the induction hypothesis, they meet in a common point. The same istrue of the lines 2, ... , n + 1. We will now show that these points must beidentical.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 121 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Pitfalls in Induction

    Assume that the points are distinct. Then all lines 2, ... , n must be thesame line, because any two points determine a line completely. Since wecan choose our original lines in such a way that we consider distinct lines,we arrive at a contradiction. Therefore, the points must be identical, so alln + 1 lines meet in a common point. This completes the induction proof.Where is the mistake in the above proof of our (obviously false)supposition?

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 122 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Strong (Complete) InductionThe method of induction can be strengthened. We can replace(I) A(n0) is true.(II) A(n + 1) is true whenever A(n) is true for n n0.with(I) A(n0) is true.

    (II) A(n + 1) is true whenever all the statementsA(n0),A(n0 + 1), ... ,A(n) are true.

    1.4.5. Example. We will show the following statement: Every naturalnumber n 2 is a prime number or the product of primes.Clearly the statement is true for n = 2, which is prime. Next assume that2, 3, ... , n are all prime or the product of prime numbers. Then n + 1 iseither prime or not prime. If it is prime, we are nished. If it is not prime,it is the product of two numbers a, b < n + 1. However, a and b arethemselves products of prime numbers by our assumption, and hence so isn + 1 = a b.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 123 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Induction vs. Strong InductionWhile induction is the principle that

    A(n0) ^ 8n2Nnn0

    (A(n)) A(n + 1))) 8

    n2Nnn0

    A(n) (1.4.2)

    strong induction statesA(n0) ^ 8

    n2Nnn0

    (A(n0) ^ ^ A(n))) A(n + 1)

    ) 8n2Nnn0

    A(n). (1.4.3)

    It is clear that (1.4.3) implies (1.4.2), since of course(A(n0) ^ ^ A(n))) A(n + 1)

    ) A(n)) A(n + 1)Thus the usual induction is a special case of strong induction. However,the converse is also true, as we shall see.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 124 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Induction vs. Strong InductionWe now show that (1.4.2) implies (1.4.3), i.e., strong induction followsfrom induction.We x n0 2 N and dene B(n) : A(n0) ^ ^ A(n) for n n0. ThenA(n0) = B(n0) and we can write strong induction as

    B(n0) ^ 8n2Nnn0

    B(n)) A(n + 1)) 8

    n2Nnn0

    A(n).

    We can writeB(n)) A(n+ 1) B(n)) (A(n+ 1) ^ B(n)) B(n)) B(n+ 1)so strong induction becomes

    B(n0) ^ 8n2Nnn0

    B(n)) B(n + 1)) 8

    n2Nnn0

    A(n). (1.4.4)

    Since 8n2Nnn0

    A(n) 8n2Nnn0

    B(n) we see that (1.4.4) is just induction in B.

    Dr. Hohberger (UM-SJTU JI) Ve203 Discrete Mathematics Fall 2013 125 / 614

  • Basic Concepts in Discrete Mathematics Mathematical Induction

    Recursive DenitionsThe induction axiom also allows us to make recursive denitions. Forexample, instead of dening 0! := 1 and then setting

    n! :=nY

    k=1

    k , n 2 N