Tuples Another Example

Total Page:16

File Type:pdf, Size:1020Kb

Tuples Another Example Tuples CMSC 330: Organization of Constructed using (e1, ..., en) Programming Languages Deconstructed using pattern matching • Patterns involve parens and commas, e.g., (p1,p2, …) Tuples are like C structs • But without field labels OCaml 2 • Allocated on the heap Higher Order Functions Tuples can be heterogenous • Unlike lists, which must be homogenous • (1, ["string1"; "string2"]) is a valid tuple CMSC 330 - Spr ing 2016 1 CMSC 330 - Spr ing 2016 2 Examples With Tuples Another Example let plusThree (x, y, z) = x + y + z let addOne (x, y, z) = (x+1, y+1, z+1) let f l = match l with x::(_::y) -> (x,y) • plusThree (addOne (3, 4, 5)) (* returns 15 *) What is f [1;2;3;4]? Possibilities: ([1],[3]) let sum ((a, b), c) = (a+c, b+c) • sum ((1, 2), 3) = (4, 5) (1,3) (1,[3]) let plusFirstTwo (x::y::_, a) = (x + a, y + a) (1,4) • plusFirstTwo ([1; 2; 3], 4) = (5, 6) (1,[3;4]) let tls (_::xs, _::ys) = (xs, ys) • tls ([1; 2; 3], [4; 5; 6; 7]) = ([2; 3], [5; 6; 7]) Remember, semicolon for lists, comma for tuples • [1, 2] = [(1, 2)] = a list of size one • (1; 2) = Warning: This expression should have type unit CMSC 330 - Spr ing 2016 3 CMSC 330 - Spr ing 2016 4 1 List And Tuple Types List And Tuple Types Tuple types use * to separate components Tuple types use * to separate components Examples Examples • (1, 2) : • (1, 2) : int * int • (1, "string", 3.5) : • (1, "string", 3.5) : int * string * float • (1, ["a"; "b"], 'c') : • (1, ["a"; "b"], 'c') : int * string list * char • [(1,2)] : • [(1,2)] : (int * int) list • [(1, 2); (3, 4)] : • [(1, 2); (3, 4)] : (int * int) list • [(1,2); (1,2,3)] : • [(1,2); (1,2,3)] : error Ø Because the first list element has type int * int, but the second has type int * int * int – list elements must all be of the same type CMSC 330 - Spr ing 2016 5 CMSC 330 - Spr ing 2016 6 Polymorphic Types Examples Of Polymorphic Types Some functions we saw require specific list types let tl (_::t) = t • let plusFirstTwo (x::y::_, a) = (x + a, y + a) • tl : 'a list -> 'a list • plusFirstTwo : int list * int -> (int * int) let swap (x, y) = (y, x) But other functions work for any list • swap : 'a * 'b -> 'b * 'a • let hd (h::_) = h • hd [1; 2; 3] (* returns 1 *) let tls (_::xs, _::ys) = (xs, ys) • hd ["a"; "b"; "c"] (* returns "a" *) • tls : 'a list * 'b list -> 'a list * 'b list OCaml gives such functions polymorphic types • hd : 'a list -> 'a let eq (x,y) = x = y • this says the function takes a list of any element type • eq : 'a * ’a -> bool 'a, and returns something of that type CMSC 330 - Spr ing 2016 7 CMSC 330 - Spr ing 2016 8 2 Tuples Are A Fixed Size Conditionals This OCaml definition Use if...then...else like C/Java/Ruby • # let foo x = match x with • But no parentheses, no elsif, and no end (a, b) -> a + b if grade >= 90 then | (a, b, c) -> a + b + c;; print_string "You got an A" else if grade >= 80 then Would yield this error message print_string "You got a B" • This pattern matches values of type 'a * 'b * 'c else if grade >= 70 then but is here used to match values of type 'd * 'e print_string "You got a C" else print_string "You’re not doing so well" Tuples of different size have different types • Thus never more than one match case with tuples CMSC 330 - Spr ing 2016 9 CMSC 330 - Spr ing 2016 10 Conditionals (cont.) The Factorial Function In OCaml, conditionals return a result Using conditionals & functions • The value of whichever branch is true/false • Can you write fact, the factorial function? • Like ? : in C, C++, and Java let rec fact n = # if 7 > 42 then "hello" else “goodbye";; if n = 0 then - : string = "goodbye" 1 # let x = if true then 3 else 4;; else n * fact (n-1);; x : int = 3 # if false then 3 else 3.0;; This expression has type float but is Notice no return statements here used with type int • This is pretty much how it needs to be written CMSC 330 - Spr ing 2016 11 CMSC 330 - Spr ing 2016 12 3 Let Rec Let – More Examples The rec part means “define a recursive let f n = 10;; function” let f n = if n = 0 then 1 else n * f (n – 1);; Let vs. let rec • let x = e1 in e2 x in scope within e2 • f 0;; (* 1 *) • f 1;; • let rec x = e1 in e2 x in scope within e2 and e1 (* 10 *) Why use let rec? let f x = … f … in … f … If you used let instead of let rec to define fact • • (* Unbound value f *) let fact n = if n = 0 then 1 let rec f x = … f … in … f … else n * fact (n-1) in e2 • (* Bound value f *) Fact is not bound here! CMSC 330 - Spr ing 2016 13 CMSC 330 - Spr ing 2016 14 Recursion = Looping Lists and Recursion Recursion is essentially the only way to iterate Lists have a recursive structure • (The only way we’re going to talk about) • And so most functions over lists will be recursive let rec length l = match l with Another example [] -> 0 | (_::t) -> 1 + (length t) let rec print_up_to (n, m) = print_int n; print_string "\n"; if n < m then print_up_to (n + 1, m) • This is just like an inductive definition Ø The length of the empty list is zero Ø The length of a nonempty list is 1 plus the length of the tail • Type of length? CMSC 330 - Spr ing 2016 15 CMSC 330 - Spr ing 2016 16 4 More Examples More Examples (cont.) sum l (* sum of elts in l *) (* return a list containing all the elements in the let rec sum l = match l with list l followed by all the elements in list m *) [] -> 0 append (l, m) | (x::xs) -> x + (sum xs) let rec append (l, m) = match l with [] -> m negate l (* negate elements in list *) | (x::xs) -> x::(append (xs, m)) let rec negate l = match l with [] -> [] rev l (* reverse list; hint: use append *) | (x::xs) -> (-x) :: (negate xs) let rec rev l = match l with [] -> [] last l (* last element of l *) | (x::xs) -> append ((rev xs), [x]) let rec last l = match l with [x] -> x rev takes O(n2) time. Can you do better? | (x::xs) -> last xs CMSC 330 - Spr ing 2016 17 CMSC 330 - Spr ing 2016 18 A Clever Version of Reverse More Examples let rec rev_helper (l, a) = match l with flattenPairs l (* ('a * 'a) list -> 'a list *) [] -> a let rec flattenPairs l = match l with | (x::xs) -> rev_helper (xs, (x::a)) [] -> [] let rev l = rev_helper (l, []) | ((a, b)::t) -> a :: b :: (flattenPairs t) Let’s give it a try take (n, l) (* return first n elts of l *) let rec take (n, l) = rev [1; 2; 3] → if n = 0 then [] rev_helper ([1;2;3], []) → else match l with rev_helper ([2;3], [1]) → [] -> [] rev_helper ([3], [2;1]) → | (x::xs) -> x :: (take (n-1, xs)) rev_helper ([], [3;2;1]) → [3;2;1] CMSC 330 - Spr ing 2016 19 CMSC 330 - Spr ing 2016 20 5 Working With Lists Anonymous Functions Several of these examples have the same flavor Recall code blocks in Ruby • Walk through the list and do something to every (1..10).each { |x| print x } element • Here, we can think of { |x| print x } as a function • Walk through the list and keep track of something We can do this (and more) in Ocaml Recall the following example code from Ruby: range_each (1,10) (fun x -> print_int x) a = [1,2,3,4,5] b = a.collect { |x| -x } let rec range_each (i,j) f = • where if i > j then () • Here we passed a code block into the collect method else • Wouldn’t it be nice to do the same in OCaml? let _ = f i in (* ignore result *) range_each (i+1,j) f CMSC 330 - Spr ing 2016 21 CMSC 330 - Spr ing 2016 22 Anonymous Functions All Functions Are Anonymous Passing functions around is very common Functions are first-class, so you can bind them • So often we don’t want to bother to give them names to other names as you like let f x = x + 3 Use fun to make a function with no name let g = f Parameter Body g 5 = 8 In fact, let for functions is just shorthand fun x -> x + 3 let f x = body (fun x -> x + 3) 5 = 8 ↓ stands for let f = fun x -> body CMSC 330 - Spr ing 2016 23 CMSC 330 - Spr ing 2016 24 6 Examples Higher-Order Functions let next x = x + 1 In OCaml you can pass functions as arguments, • Short for let next = fun x -> x + 1 and return functions as results let plus (x, y) = x + y let plus_three x = x + 3 • Short for let plus = fun (x, y) -> x + y let twice f z = f (f z) twice plus_three 5 • Which is short for twice : ('a->'a) -> 'a -> 'a Ø let plus = fun z -> (match z with (x, y) -> x + y) let plus_four x = x + 4 let pick_fn n = let rec fact n = if n > 0 then plus_three else plus_four if n = 0 then 1 else n * fact (n-1) (pick_fn 5) 0 • Short for let rec fact = fun n -> pick_fn : int -> (int->int) (if n = 0 then 1 else n * fact (n-1)) CMSC 330 - Spr ing 2016 25 CMSC 330 - Spr ing 2016 26 Currying Curried Functions In OCaml We just saw a way for a function to take multiple OCaml has a really simple syntax for currying arguments let add x y = x + y • The function consumes one argument at a time, • This is identical to all of the following: returning a function that takes the rest let add = (fun x -> (fun y -> x + y)) let add = (fun x y -> x + y) let add x = (fun y -> x+y) This is called curryingthe function Thus: • Named after the logician Haskell B.
Recommended publications
  • 1 Elementary Set Theory
    1 Elementary Set Theory Notation: fg enclose a set. f1; 2; 3g = f3; 2; 2; 1; 3g because a set is not defined by order or multiplicity. f0; 2; 4;:::g = fxjx is an even natural numberg because two ways of writing a set are equivalent. ; is the empty set. x 2 A denotes x is an element of A. N = f0; 1; 2;:::g are the natural numbers. Z = f:::; −2; −1; 0; 1; 2;:::g are the integers. m Q = f n jm; n 2 Z and n 6= 0g are the rational numbers. R are the real numbers. Axiom 1.1. Axiom of Extensionality Let A; B be sets. If (8x)x 2 A iff x 2 B then A = B. Definition 1.1 (Subset). Let A; B be sets. Then A is a subset of B, written A ⊆ B iff (8x) if x 2 A then x 2 B. Theorem 1.1. If A ⊆ B and B ⊆ A then A = B. Proof. Let x be arbitrary. Because A ⊆ B if x 2 A then x 2 B Because B ⊆ A if x 2 B then x 2 A Hence, x 2 A iff x 2 B, thus A = B. Definition 1.2 (Union). Let A; B be sets. The Union A [ B of A and B is defined by x 2 A [ B if x 2 A or x 2 B. Theorem 1.2. A [ (B [ C) = (A [ B) [ C Proof. Let x be arbitrary. x 2 A [ (B [ C) iff x 2 A or x 2 B [ C iff x 2 A or (x 2 B or x 2 C) iff x 2 A or x 2 B or x 2 C iff (x 2 A or x 2 B) or x 2 C iff x 2 A [ B or x 2 C iff x 2 (A [ B) [ C Definition 1.3 (Intersection).
    [Show full text]
  • Determinacy in Linear Rational Expectations Models
    Journal of Mathematical Economics 40 (2004) 815–830 Determinacy in linear rational expectations models Stéphane Gauthier∗ CREST, Laboratoire de Macroéconomie (Timbre J-360), 15 bd Gabriel Péri, 92245 Malakoff Cedex, France Received 15 February 2002; received in revised form 5 June 2003; accepted 17 July 2003 Available online 21 January 2004 Abstract The purpose of this paper is to assess the relevance of rational expectations solutions to the class of linear univariate models where both the number of leads in expectations and the number of lags in predetermined variables are arbitrary. It recommends to rule out all the solutions that would fail to be locally unique, or equivalently, locally determinate. So far, this determinacy criterion has been applied to particular solutions, in general some steady state or periodic cycle. However solutions to linear models with rational expectations typically do not conform to such simple dynamic patterns but express instead the current state of the economic system as a linear difference equation of lagged states. The innovation of this paper is to apply the determinacy criterion to the sets of coefficients of these linear difference equations. Its main result shows that only one set of such coefficients, or the corresponding solution, is locally determinate. This solution is commonly referred to as the fundamental one in the literature. In particular, in the saddle point configuration, it coincides with the saddle stable (pure forward) equilibrium trajectory. © 2004 Published by Elsevier B.V. JEL classification: C32; E32 Keywords: Rational expectations; Selection; Determinacy; Saddle point property 1. Introduction The rational expectations hypothesis is commonly justified by the fact that individual forecasts are based on the relevant theory of the economic system.
    [Show full text]
  • PROBLEM SET 1. the AXIOM of FOUNDATION Early on in the Book
    PROBLEM SET 1. THE AXIOM OF FOUNDATION Early on in the book (page 6) it is indicated that throughout the formal development ‘set’ is going to mean ‘pure set’, or set whose elements, elements of elements, and so on, are all sets and not items of any other kind such as chairs or tables. This convention applies also to these problems. 1. A set y is called an epsilon-minimal element of a set x if y Î x, but there is no z Î x such that z Î y, or equivalently x Ç y = Ø. The axiom of foundation, also called the axiom of regularity, asserts that any set that has any element at all (any nonempty set) has an epsilon-minimal element. Show that this axiom implies the following: (a) There is no set x such that x Î x. (b) There are no sets x and y such that x Î y and y Î x. (c) There are no sets x and y and z such that x Î y and y Î z and z Î x. 2. In the book the axiom of foundation or regularity is considered only in a late chapter, and until that point no use of it is made of it in proofs. But some results earlier in the book become significantly easier to prove if one does use it. Show, for example, how to use it to give an easy proof of the existence for any sets x and y of a set x* such that x* and y are disjoint (have empty intersection) and there is a bijection (one-to-one onto function) from x to x*, a result called the exchange principle.
    [Show full text]
  • The Axiom of Choice and Its Implications
    THE AXIOM OF CHOICE AND ITS IMPLICATIONS KEVIN BARNUM Abstract. In this paper we will look at the Axiom of Choice and some of the various implications it has. These implications include a number of equivalent statements, and also some less accepted ideas. The proofs discussed will give us an idea of why the Axiom of Choice is so powerful, but also so controversial. Contents 1. Introduction 1 2. The Axiom of Choice and Its Equivalents 1 2.1. The Axiom of Choice and its Well-known Equivalents 1 2.2. Some Other Less Well-known Equivalents of the Axiom of Choice 3 3. Applications of the Axiom of Choice 5 3.1. Equivalence Between The Axiom of Choice and the Claim that Every Vector Space has a Basis 5 3.2. Some More Applications of the Axiom of Choice 6 4. Controversial Results 10 Acknowledgments 11 References 11 1. Introduction The Axiom of Choice states that for any family of nonempty disjoint sets, there exists a set that consists of exactly one element from each element of the family. It seems strange at first that such an innocuous sounding idea can be so powerful and controversial, but it certainly is both. To understand why, we will start by looking at some statements that are equivalent to the axiom of choice. Many of these equivalences are very useful, and we devote much time to one, namely, that every vector space has a basis. We go on from there to see a few more applications of the Axiom of Choice and its equivalents, and finish by looking at some of the reasons why the Axiom of Choice is so controversial.
    [Show full text]
  • Equivalents to the Axiom of Choice and Their Uses A
    EQUIVALENTS TO THE AXIOM OF CHOICE AND THEIR USES A Thesis Presented to The Faculty of the Department of Mathematics California State University, Los Angeles In Partial Fulfillment of the Requirements for the Degree Master of Science in Mathematics By James Szufu Yang c 2015 James Szufu Yang ALL RIGHTS RESERVED ii The thesis of James Szufu Yang is approved. Mike Krebs, Ph.D. Kristin Webster, Ph.D. Michael Hoffman, Ph.D., Committee Chair Grant Fraser, Ph.D., Department Chair California State University, Los Angeles June 2015 iii ABSTRACT Equivalents to the Axiom of Choice and Their Uses By James Szufu Yang In set theory, the Axiom of Choice (AC) was formulated in 1904 by Ernst Zermelo. It is an addition to the older Zermelo-Fraenkel (ZF) set theory. We call it Zermelo-Fraenkel set theory with the Axiom of Choice and abbreviate it as ZFC. This paper starts with an introduction to the foundations of ZFC set the- ory, which includes the Zermelo-Fraenkel axioms, partially ordered sets (posets), the Cartesian product, the Axiom of Choice, and their related proofs. It then intro- duces several equivalent forms of the Axiom of Choice and proves that they are all equivalent. In the end, equivalents to the Axiom of Choice are used to prove a few fundamental theorems in set theory, linear analysis, and abstract algebra. This paper is concluded by a brief review of the work in it, followed by a few points of interest for further study in mathematics and/or set theory. iv ACKNOWLEDGMENTS Between the two department requirements to complete a master's degree in mathematics − the comprehensive exams and a thesis, I really wanted to experience doing a research and writing a serious academic paper.
    [Show full text]
  • Bijections and Infinities 1 Key Ideas
    INTRODUCTION TO MATHEMATICAL REASONING Worksheet 6 Bijections and Infinities 1 Key Ideas This week we are going to focus on the notion of bijection. This is a way we have to compare two different sets, and say that they have \the same number of elements". Of course, when sets are finite everything goes smoothly, but when they are not... things get spiced up! But let us start, as usual, with some definitions. Definition 1. A bijection between a set X and a set Y consists of matching elements of X with elements of Y in such a way that every element of X has a unique match, and every element of Y has a unique match. Example 1. Let X = f1; 2; 3g and Y = fa; b; cg. An example of a bijection between X and Y consists of matching 1 with a, 2 with b and 3 with c. A NOT example would match 1 and 2 with a and 3 with c. In this case, two things fail: a has two partners, and b has no partner. Note: if you are familiar with these concepts, you may have recognized a bijection as a function between X and Y which is both injective (1:1) and surjective (onto). We will revisit the notion of bijection in this language in a few weeks. For now, we content ourselves of a slightly lower level approach. However, you may be a little unhappy with the use of the word \matching" in a mathematical definition. Here is a more formal definition for the same concept.
    [Show full text]
  • Axioms of Set Theory and Equivalents of Axiom of Choice Farighon Abdul Rahim Boise State University, [email protected]
    Boise State University ScholarWorks Mathematics Undergraduate Theses Department of Mathematics 5-2014 Axioms of Set Theory and Equivalents of Axiom of Choice Farighon Abdul Rahim Boise State University, [email protected] Follow this and additional works at: http://scholarworks.boisestate.edu/ math_undergraduate_theses Part of the Set Theory Commons Recommended Citation Rahim, Farighon Abdul, "Axioms of Set Theory and Equivalents of Axiom of Choice" (2014). Mathematics Undergraduate Theses. Paper 1. Axioms of Set Theory and Equivalents of Axiom of Choice Farighon Abdul Rahim Advisor: Samuel Coskey Boise State University May 2014 1 Introduction Sets are all around us. A bag of potato chips, for instance, is a set containing certain number of individual chip’s that are its elements. University is another example of a set with students as its elements. By elements, we mean members. But sets should not be confused as to what they really are. A daughter of a blacksmith is an element of a set that contains her mother, father, and her siblings. Then this set is an element of a set that contains all the other families that live in the nearby town. So a set itself can be an element of a bigger set. In mathematics, axiom is defined to be a rule or a statement that is accepted to be true regardless of having to prove it. In a sense, axioms are self evident. In set theory, we deal with sets. Each time we state an axiom, we will do so by considering sets. Example of the set containing the blacksmith family might make it seem as if sets are finite.
    [Show full text]
  • Set (Mathematics) from Wikipedia, the Free Encyclopedia
    Set (mathematics) From Wikipedia, the free encyclopedia A set in mathematics is a collection of well defined and distinct objects, considered as an object in its own right. Sets are one of the most fundamental concepts in mathematics. Developed at the end of the 19th century, set theory is now a ubiquitous part of mathematics, and can be used as a foundation from which nearly all of mathematics can be derived. In mathematics education, elementary topics such as Venn diagrams are taught at a young age, while more advanced concepts are taught as part of a university degree. Contents The intersection of two sets is made up of the objects contained in 1 Definition both sets, shown in a Venn 2 Describing sets diagram. 3 Membership 3.1 Subsets 3.2 Power sets 4 Cardinality 5 Special sets 6 Basic operations 6.1 Unions 6.2 Intersections 6.3 Complements 6.4 Cartesian product 7 Applications 8 Axiomatic set theory 9 Principle of inclusion and exclusion 10 See also 11 Notes 12 References 13 External links Definition A set is a well defined collection of objects. Georg Cantor, the founder of set theory, gave the following definition of a set at the beginning of his Beiträge zur Begründung der transfiniten Mengenlehre:[1] A set is a gathering together into a whole of definite, distinct objects of our perception [Anschauung] and of our thought – which are called elements of the set. The elements or members of a set can be anything: numbers, people, letters of the alphabet, other sets, and so on.
    [Show full text]
  • Set Notation and Concepts
    Appendix Set Notation and Concepts “In mathematics you don’t understand things. You just get used to them.” John von Neumann (1903–1957) This appendix is primarily a brief run-through of basic concepts from set theory, but it also in Sect. A.4 mentions set equations, which are not always covered when introducing set theory. A.1 Basic Concepts and Notation A set is a collection of items. You can write a set by listing its elements (the items it contains) inside curly braces. For example, the set that contains the numbers 1, 2 and 3 can be written as {1, 2, 3}. The order of elements do not matter in a set, so the same set can be written as {2, 1, 3}, {2, 3, 1} or using any permutation of the elements. The number of occurrences also does not matter, so we could also write the set as {2, 1, 2, 3, 1, 1} or in an infinity of other ways. All of these describe the same set. We will normally write sets without repetition, but the fact that repetitions do not matter is important to understand the operations on sets. We will typically use uppercase letters to denote sets and lowercase letters to denote elements in a set, so we could write M ={2, 1, 3} and x = 2 as an element of M. The empty set can be written either as an empty list of elements ({})orusing the special symbol ∅. The latter is more common in mathematical texts. A.1.1 Operations and Predicates We will often need to check if an element belongs to a set or select an element from a set.
    [Show full text]
  • SET THEORY Andrea K. Dieterly a Thesis Submitted to the Graduate
    SET THEORY Andrea K. Dieterly A Thesis Submitted to the Graduate College of Bowling Green State University in partial fulfillment of the requirements for the degree of MASTER OF ARTS August 2011 Committee: Warren Wm. McGovern, Advisor Juan Bes Rieuwert Blok i Abstract Warren Wm. McGovern, Advisor This manuscript was to show the equivalency of the Axiom of Choice, Zorn's Lemma and Zermelo's Well-Ordering Principle. Starting with a brief history of the development of set history, this work introduced the Axioms of Zermelo-Fraenkel, common applications of the axioms, and set theoretic descriptions of sets of numbers. The book, Introduction to Set Theory, by Karel Hrbacek and Thomas Jech was the primary resource with other sources providing additional background information. ii Acknowledgements I would like to thank Warren Wm. McGovern for his assistance and guidance while working and writing this thesis. I also want to thank Reiuwert Blok and Juan Bes for being on my committee. Thank you to Dan Shifflet and Nate Iverson for help with the typesetting program LATEX. A personal thank you to my husband, Don, for his love and support. iii Contents Contents . iii 1 Introduction 1 1.1 Naive Set Theory . 2 1.2 The Axiom of Choice . 4 1.3 Russell's Paradox . 5 2 Axioms of Zermelo-Fraenkel 7 2.1 First Order Logic . 7 2.2 The Axioms of Zermelo-Fraenkel . 8 2.3 The Recursive Theorem . 13 3 Development of Numbers 16 3.1 Natural Numbers and Integers . 16 3.2 Rational Numbers . 20 3.3 Real Numbers .
    [Show full text]
  • An Introduction to Elementary Set Theory
    An Introduction to Elementary Set Theory Guram Bezhanishvili and Eachan Landreth∗ 1 Introduction In this project we will learn elementary set theory from the original historical sources by two key figures in the development of set theory, Georg Cantor (1845{1918) and Richard Dedekind (1831{ 1916). We will learn the basic properties of sets, how to define the size of a set, and how to compare different sizes of sets. This will enable us to give precise definitions of finite and infinite sets. We will conclude the project by exploring a rather unusual world of infinite sets. Georg Cantor, the founder of set theory, considered by many as one of the most original minds in the history of mathematics, was born in St. Petersburg, Russia in 1845. His parents moved the family to Frankfurt, Germany in 1856. Cantor entered the Wiesbaden Gymnasium at the age of 15, and two years later began his university career in Z¨urich, Switzerland. In 1863 he moved to the University of Berlin, which during Cantor's time was considered the world's leading center of mathematical research. Four years later Cantor received his doctorate under the supervision of the great Karl Weierstrass (1815{1897). In 1869 Cantor obtained an unpaid lecturing post at the University of Halle. Ten years later he was promoted to a full professor. However, Cantor never achieved his dream of holding a Chair of Mathematics at Berlin. It is believed that one of the main reasons was the nonacceptance of his theories of infinite sets by the leading mathematicians of that time, most noticeably by Leopold Kronecker (1823{1891), a professor at the University of Berlin and a very influential figure in German mathematics, both mathematically and politically.
    [Show full text]
  • Set Theory Axioms
    Mathematics for Computer Science Zermelo-Frankel Set Theory MIT 6.042J/18.062J Axioms of Zermelo-Frankel Set Theory: with the Choice axiom (ZFC) define the standard ZFC Theory of Sets Albert R Meyer, March 4, 2015 ZF.1 Albert R Meyer, March 4, 2015 ZF.2 Some Axioms of Set Theory Some Axioms of Set Theory Extensionality Extensionality x and y have the same elements ∀x[x ∈ y IFF x ∈ z] iff x and y are members of the same sets Albert R Meyer, March 4, 2015 ZF.3 Albert R Meyer, March 4, 2015 ZF.4 1 Some Axioms of Set Theory Some Axioms of Set Theory Extensionality Power set ∀x[x ∈ y IFF x ∈ z] Every set has a power set iff ∀ ∃ ∀ ⊆ ∈ x p s.s x IFF s p ∀x[y ∈ x IFF z ∈ x] Albert R Meyer, March 4, 2015 ZF.5 Albert R Meyer, March 4, 2015 ZF.6 Some Axioms of Set Theory Sets are Well Founded Comprehension According to ZF, the elements If S is a set, and P(x) is a of a set have to be “simpler” predicate of set theory, than the set itself. In then particular, {x ∈ s| P(x)} no set is a member of itself, is a set or a member of a member… Albert R Meyer, March 4, 2015 ZF.7 Albert R Meyer, March 4, 2015 ZF.8 2 Sets are Well Founded Sets are Well Founded Def: x is ∈-minimal in y Def: x is ∈-minimal in y ∈ x is in y, but no element x y AND of x is in y [∀z.z ∈ x IMPLIES z ∉ y] Albert R Meyer, March 4, 2015 ZF.9 Albert R Meyer, March 4, 2015 ZF.10 Some Axioms of Set Theory Some Axioms of Set Theory Foundation Foundation Every nonempty set has Every nonempty set has an ∈-minimal element an ∈-minimal element ∀x.[x ≠∅ IMPLIES ∃y.
    [Show full text]