
Mathematical Foundations of Computing -1 / 74- Mathematical Foundations of Computing Preliminary Course Notes Keith Schwarz Spring 2012 This is a work-in-progress draft of what I hope will become a full set of course notes for CS103. Right now, the notes only cover up through the end of the first week. I hope that you find these notes useful! If you have any comments, criticisms, or suggestions, please email me at [email protected]. I'd love to make these notes as good as possible for future quarters. Mathematical Foundations of Computing -2 / 74- Table of Contents Mathematical Foundations of Computing.......................................................................................1 Chapter One: Set Theory and Cantor's Theorem.............................................................................4 What is a Set?..............................................................................................................................4 Operations on Sets.......................................................................................................................6 Special Sets...............................................................................................................................10 Set-Builder Notation.................................................................................................................12 Filtering Sets.........................................................................................................................12 Transforming Sets.................................................................................................................14 Relations on Sets.......................................................................................................................15 Set Equality..........................................................................................................................15 Subsets and Supersets...........................................................................................................16 The Empty Set and Vacuous Truths......................................................................................17 The Power Set...........................................................................................................................19 Cardinality.................................................................................................................................21 What is Cardinality?.............................................................................................................21 The Difficulty With Infinite Cardinalities............................................................................22 A Formal Definition of Cardinality......................................................................................24 Cantor's Theorem......................................................................................................................28 How Large is the Power Set?...............................................................................................28 Cantor's Diagonal Argument................................................................................................30 Formalizing the Diagonal Argument....................................................................................33 Proving Cantor's Theorem....................................................................................................35 Why Cantor's Theorem Matters................................................................................................36 The Limits of Computation.......................................................................................................37 What Does This Mean?........................................................................................................38 Chapter Summary......................................................................................................................39 Chapter Two: Introduction to Formal Proofs.................................................................................40 What is a Proof?........................................................................................................................40 What Can We Assume?........................................................................................................41 Direct Proofs.............................................................................................................................41 Proof by Cases......................................................................................................................44 Proofs about Sets..................................................................................................................46 Lemmas................................................................................................................................49 Proofs with Vacuous Truths..................................................................................................53 Indirect Proofs...........................................................................................................................55 Logical Implication..............................................................................................................55 Proof by Contradiction.........................................................................................................57 Rational and Irrational Numbers..........................................................................................61 Proof by Contrapositive........................................................................................................64 Chapter Three: Graphs, Functions, and Relations.........................................................................67 Chapter Four: The Pigeonhole Principle........................................................................................69 Chapter Five: Mathematical Induction..........................................................................................70 Chapter Six: Proofs about Programs..............................................................................................71 Mathematical Foundations of Computing -3 / 74- Chapter Seven: Formal Logic........................................................................................................72 Chapter One: Set Theory and Cantor's Theorem -4 / 74- Chapter One: Set Theory and Cantor's Theorem Our journey into the realm of mathematics begins with an exploration of a surprisingly nuanced concept: the set. Informally, a set is just a collection of things, whether it's a set of numbers, a set of clothes, a set of nodes in a network, or a set of other sets. Amazingly, given this very simple starting point, it is possible to prove a result known as Cantor's Theorem that provides a striking and profound limit on what problems a computer program can solve. In this introductory chapter, we'll build up some basic mathematical machinery around sets, then will see how the simple notion of asking how big a set can lead to incredible and shocking results. What is a Set? Let's begin with a simple definition: A set is an unordered collection of distinct elements. What exactly does this mean? Intuitively, you can think of a set as a group of things. Those things must be distinct, which means that you can't have multiple copies of the same object in a set. Additionally, those things are unordered, so there's no notion of a “first” thing in the group, a “second” thing in a group, etc. We need two additional pieces of terminology to talk about sets: An element is something contained within a set. To denote a set, we write the elements of the set within curly braces. For example, the set {1, 2, 3} is a set with three elements: 1, 2, and 3. The set { cat, dog } is a set containing the two elements “cat” and “dog.” Because sets are unordered collections, the order in which we list the elements of a set doesn't matter. This means that the sets {1, 2, 3}, {2, 1, 3}, and {3, 2, 1} are all descriptions of exactly the same set. Also, because sets are unordered collections of distinct elements, no element can appear more than once in the same set. In particular, this means that if we write out a set like {1, 1, 1, 1, 1}, it's completely equivalent to writing out the set {1}, since sets can't contain duplicates. Similarly, {1, 2, 2, 2, 3} and {3, 2, 1} are the same set, since ordering doesn't matter and duplicates are ignored. When working with sets, we are often interested in determining whether or not some object is an element of a set. We use the notation x ∈ S to denote that x is an element of the set S. For example, we would write that 1 ∈ {1, 2, 3}, or that cat ∈ { cat, dog }. If spoken aloud, you'd read x ∈ S as “x is an element of S.” Similarly, we use the notation x ∉ S to denote that x is not an element of S. So, we would have 1 ∉ {2, 3, 4}, dog ∉ {1, 2, 3}, and ibex ∉ {cat, dog}. You can read x ∉ S as “x is not an element of S.” Chapter One: Set Theory and Cantor's Theorem -5 / 74- Sets appear almost everywhere in mathematics because they capture the very simple notion of a group of things. If you'll notice, there aren't any requirements about what can be in a set. You can have sets of integers, set of real numbers, sets of lines, sets of programs, and even sets of other sets. Through the remainder of your mathematical career, you'll see sets used as building blocks for larger and more complicated objects. As we just mentioned, it's possible
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages74 Page
-
File Size-