EDAA40 EDAA40 Discrete Structures in Computer Science Discrete - - PDF document

edaa40 edaa40 discrete structures in computer science
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

2

axiomatic vs naïve set theory

s i d e b a r

Zermelo-Fraenkel Set Theory w/Choice (ZFC)

extensionality regularity specification union replacement infinity power set choice

This course will be about “naïve” set theory. However, at its end, you should be able to read and understand most of the above. 3

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

slide-2
SLIDE 2

4

element of

elementhood depends on a concept of equality Given a set A, any given thing x either is, or is not, an element of A. 5

extensionality

  • rder, repetition do not matter

equal sets must contain exactly the same elements 1-element sets are singleton sets A set is defined by the elements it contains (its extension). 6

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.)

slide-3
SLIDE 3

7

inclusion

subset superset this means that A and B might be the same, in fact We use to denote proper (or strict) inclusion :

“iff” is jargon for “if and only if”, meaning both sides are logically equivalent 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. For any set A, it's always the case that 8

properties of inclusion

inclusion is transitive:*

* We will discuss transitivity and partiality more generally later

inclusion is partial:*

There are sets A and B for which neither or is true.

Example? therefore 9

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)

slide-4
SLIDE 4

10

building sets, examples

11

not everything that looks like a set...

s i d e b a r

Is R an element of R? Let's assume it is, i.e. Okay, obviously that can't be right. Clearly that means R cannot be an element of R, i.e. This means that R satisfies the property defining R, in other words: But, oy veh, that means R would satisfy the property defining it, and that implies, dangnabbit: This contradiction is known as Russel's paradox. 12

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. 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! (And “anything” appears to include things that aren't sets.)

slide-5
SLIDE 5

13

drawing sets: Euler diagrams

A B A,B A B C D can be ambiguous regions of overlap are assumed to be non-empty 14

drawing sets: Venn diagrams

A B special case of Euler diagrams showing all combinations of overlap between sets (even if empty) gets very messy very quickly for anything more than three sets A B C empty / non-empty regions need to be explicitly marked: A B A B 15

  • perations on sets

A B A B A B

union

all elements that are in A or B or both

difference

all elements that are in A and not in B

intersection

all elements that are both in A and B

slide-6
SLIDE 6

16

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, i.e. a set of everything we are potentially interested in. Let's call it U. Examples of U? A U Then we can give the complement of a set a meaning:

alternative syntaxes: Number theory? Programming languages?

17

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 For multiple sets A1, …, An, we say they are pairwise disjoint iff for any i, j, such that i  j, Ai and Aj are disjoint, i.e. Note that every set A is disjoint from the empty set . Even the empty set! 18

set algebra

some properties of intersection and union:

(more in the exercises of 1.4.1, 1.4.2, and 1.4.3 in SLAM) idempotence commutativity commutativity associativity associativity distributivity distributivity

slide-7
SLIDE 7

19

family matters

A family of sets is a way of referring to a set of sets, usually indexed by an index set.* index set index sets

* We will come back to this notion in the lecture on functions.

Examples:

alternative syntax

What is (a) What is the extension? (b) What does it mean? 20

large families

Often, the index set is something like the natural numbers: What are these sets? What is natural numbers starting at i multiples of i (excluding i) divisors of i (excl. 1 and i) the prime numbers 21

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?

slide-8
SLIDE 8

22

power sets

The power set of a set A is the set of all its subsets.

alternative syntax

Some properties: Why is that? 23

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.

24

how stufg is represented: numbers

s i d e b a r

In axiomatic set theory, everything is a set. (Except, occasionally, collections that aren't, such as “all sets” etc.) What about numbers? They are encoded as sets. A common encoding is the von Neumann construction: The set representing n contains all the sets representing all smaller numbers as elements. Some properties: n+: hoity-toity way

  • f writing “n + 1”