edaa40 edaa40 discrete structures in computer science
play

EDAA40 EDAA40 Discrete Structures in Computer Science Discrete - PDF document

EDAA40 EDAA40 Discrete Structures in Computer Science Discrete Structures in Computer Science 1: Sets 1: Sets Jrn W. Janneck, Dept. of Computer Science, Lund University axiomatic vs nave set theory Zermelo-Fraenkel Set Theory w/Choice


  1. EDAA40 EDAA40 Discrete Structures in Computer Science Discrete Structures in Computer Science 1: Sets 1: Sets Jörn W. Janneck, Dept. of Computer Science, Lund University axiomatic vs naïve set theory Zermelo-Fraenkel Set Theory w/Choice (ZFC) s extensionality i regularity specification d union e replacement infinity b power set choice a This course will be about “naïve” set theory. r However, at its end, you should be able to read and understand most of the above. 2 sets: collections of stufg, empty set sets are collections of stuff any kind of stuff some sets are pretty large (we'll talk more about just how large later) this is the empty set there is but one of those 3

  2. element of Given a set A, any given thing x either is, or is not, an element of A. elementhood depends on a concept of equality 4 extensionality A set is defined by the elements it contains (its extension ). order, repetition do not matter equal sets must contain exactly the same elements 1-element sets are singleton sets 5 cardinality The number of elements in a set A is called its cardinality . alternative syntax For now, we will only consider the cardinality of finite sets. We will discuss infinite sets, including their cardinality, in more detail later. (Also, we haven't yet precisely defined these terms.) 6

  3. inclusion subset superset this means that A and B might be the same, in fact “iff” is jargon for “if and only if”, meaning both sides are logically equivalent For any set A, it's always the case that We use to denote proper (or strict) inclusion : A and B are proper (or strict) subset and superset , respectively. Sometimes, is used to mean . Here, we always use it to mean proper inclusion. 7 properties of inclusion inclusion is transitive :* therefore inclusion is partial:* There are sets A and B for which neither or is true. Example? * We will discuss transitivity and partiality more generally later 8 specifying sets enumeration of its elements set builder notation / set comprehensions flavor 1 flavor 2 bad flavor recursive definition (we will discuss this later) enumeration w/ suspension points/ellipsis (informal stand-in for a recursive definition) 9

  4. building sets, examples 10 not everything that looks like a set... s Is R an element of R? i Let's assume it is, i.e. This means that R satisfies the property defining R, in other words: d e Okay, obviously that can't be right. Clearly that means R cannot be an element of R, i.e. b But, oy veh, that means R would satisfy the property defining it, and that implies, dangnabbit: a This contradiction is known as Russel's paradox. r 11 set building done right So isn't a well-defined set. What went wrong? The trouble is with the variable, x. It can literally stand for anything. (And “anything” appears to include things that aren't sets.) When using set builder notation, make sure the variables are limited to elements of a set you already know to be well-defined. NB: This form also automatically implies a superset! 12

  5. drawing sets: Euler diagrams B A,B A can be ambiguous B A regions of overlap are C assumed to be non-empty D 13 drawing sets: Venn diagrams special case of Euler diagrams gets very messy very quickly for showing all combinations of overlap anything more than three sets between sets (even if empty) C A B A B A B empty / non-empty regions need to be explicitly marked: A B 14 operations on sets A B union all elements that are in A or B or both A B intersection all elements that are both in A and B A B difference all elements that are in A and not in B 15

  6. difgerence and complement A B set difference There is in general no “inverse” set -A for a given set A. However, often we work in a local universe , Examples of U? i.e. a set of everything we are potentially Number theory? interested in. Let's call it U. Programming languages? U Then we can give the complement of a set a meaning: A alternative syntaxes: 16 disjointness Two sets A and B are disjoint if they do not have any common elements, i.e. their intersection is empty: A B A B Note that every set A is disjoint from the empty set . Even the empty set! For multiple sets A 1 , …, A n , we say they are pairwise disjoint iff for any i, j, such that i  j, A i and A j are disjoint, i.e. 17 set algebra some properties of intersection and union: idempotence commutativity commutativity associativity associativity distributivity distributivity (more in the exercises of 1.4.1, 1.4.2, and 1.4.3 in SLAM) 18

  7. family matters index index set A family of sets is a way of referring to a set of sets, usually indexed by an index set.* sets alternative syntax Examples: What is (a) What is the extension? (b) What does it mean? * We will come back to this notion in the lecture on functions. 19 large families Often, the index set is something like the natural numbers: natural numbers starting at i multiples of i (excluding i) divisors of i (excl. 1 and i) What are these sets? What is the prime numbers 20 generalized union & intersection Let S be a set of sets. Often, S is a family of sets. Then we write... When the index set is infinite, strange things can happen: (a) What is the biggest number in each A i ? (b) What is the biggest number in their union? 21

  8. power sets The power set of a set A is the set of all its subsets. alternative syntax Some properties: Why is that? 22 structure of power sets Power sets have a peculiar structure with respect to inclusion: This is a Hasse diagram of the inclusion relation on a power set. We will come back to this when we talk about relations. A connection means that the upper set properly includes the lower one. Implied connections are omitted. 23 how stufg is represented: numbers In axiomatic set theory, everything is a set. s (Except, occasionally, collections that aren't, such as “all sets” etc.) What about numbers? i They are encoded as sets. A common encoding is the von Neumann construction: d n + : hoity-toity way of writing “n + 1” e The set representing n contains b all the sets representing all smaller numbers as elements. a Some properties: r 24

Recommend


More recommend