Sets 2/36 We will not give a precise definition of what is a set, - - PowerPoint PPT Presentation

sets
SMART_READER_LITE
LIVE PREVIEW

Sets 2/36 We will not give a precise definition of what is a set, - - PowerPoint PPT Presentation

Sets 2/36 We will not give a precise definition of what is a set, but we will say precisely what you can do with it. (Think of a set as a collection of things of which order and multiplicity Sets do not matter.) Lectures 7 and 8 (Chapter 16)


slide-1
SLIDE 1

/ department of mathematics and computer science

Sets

Lectures 7 and 8 (Chapter 16)

2/36 / department of mathematics and computer science

Sets

We will not give a precise definition of what is a set, but we will say precisely what you can do with it. (Think of a set as a collection of things of which order and multiplicity do not matter.)

Examples:

◮ {0, 1, 2, 3} = {3, 1, 0, 2} = {3, 1, 1, 1, 0, 0, 2}. ◮ {6} is the singleton set (NB: {6} = 6). ◮ ∅ denotes the empty set (i.e., the set without elements). ◮ N, Z: standard set-theoretic notations for sets of numbers. 3/36 / department of mathematics and computer science

Specifying sets, membership

We write t ∈ X for “t is an element of the set X”.

Specifying a set using a predicate

{x ∈ D | P(x)} : the set of all x ∈ D such that P(x).

Examples

◮ {n ∈ N | n > 10} is the set of all natural numbers greater than 10; ◮ {x ∈ Z | x2 + x ≤ 0} = {−1, 0}.

Membership

The element-of predicate ∈ is a binary predicate. Property of ∈: t ∈ {x ∈ D | P(x)}

val

= = t ∈ D ∧ P(t)

4/36 / department of mathematics and computer science

Subset, universe

A ⊆ B def = ∀x[x ∈ A : x ∈ B] A is a subset of B (notation: A ⊆ B) if every element of A is also an element of B Property of ⊆: (A ⊆ B) ∧ t ∈ A |

val

= = t ∈ B The universe, denoted by U, is a set of which all sets in a particular context are subsets. Property of U: t ∈ U

val

= = True

U E A C D B

slide-2
SLIDE 2

6/36 / department of mathematics and computer science

Equality of sets

Two sets are equal if they have exactly the same elements.

Example

{x ∈ Z | x > 0} = {n ∈ N | n = 0} A = B def = A ⊆ B ∧ B ⊆ A Property of =: A = B

val

= = ∀x[x ∈ A ⇔ x ∈ B] A = B ∧ t ∈ A |

val

= = t ∈ B A = B ∧ t ∈ B |

val

= = t ∈ A Leibniz for =: A = B · · · A · · · = · · · B · · ·

7/36 / department of mathematics and computer science

Intersection

The intersection of A and B is the set of everything that is both in A and in B A ∩ B def = {x ∈ U | x ∈ A ∧ x ∈ B}

A B A ∩ B Example

{n ∈ N | n > 5} ∩ {n ∈ N | n < 10} = {6, 7, 8, 9} Property of ∩: t ∈ A ∩ B

val

= = t ∈ A ∧ t ∈ B

8/36 / department of mathematics and computer science

Union

The union of A and B is the set of everything that is in A or in B A ∪ B def = {x ∈ U | x ∈ A ∨ x ∈ B}

B A A ∪ B Example

{n ∈ N | n > 5} ∪ {n ∈ N | n < 10} = N Property of ∪: t ∈ A ∪ B

val

= = t ∈ A ∨ t ∈ B

9/36 / department of mathematics and computer science

Commutativity and associativity of ∩ and ∪

◮ ∩ and ∪ are commutative:

A ∩ B = B ∩ A , and A ∪ B = B ∪ A ;

◮ ∩ and ∪ are associative:

(A ∩ B) ∩ C = A ∩ (B ∩ C) , and (A ∪ B) ∪ C = A ∪ (B ∪ C) .

slide-3
SLIDE 3

10/36 / department of mathematics and computer science

Example

(A ∩ B) ∪ C = A ∩ (B ∪ C) does not hold for all sets A, B and C!

8 5 4 6 7

(A ∩ B) ∪ C C

1 3 2

A B

8 4 5 6 7

A ∩ (B ∪ C) C

1 2 3

A B Counterexample:

Let A = {1, 2, 4, 5}, B = {2, 3, 5, 6} and C = {4, 5, 6, 7}. Then A ∩ B = {2, 5}, (A ∩ B) ∪ C = {2, 4, 5, 6, 7}, B ∪ C = {2, 3, 4, 5, 6, 7}, and A ∩ (B ∪ C) = {2, 4, 5}. So (A ∩ B) ∪ C = {2, 4, 5, 6, 7} = {2, 4, 5} = A ∩ (B ∪ C).

11/36 / department of mathematics and computer science

Reasoning with the subset predicate

⊆-introduction:

{ Assume: } (k) var x; x ∈ A . . . (ℓ − 2) x ∈ B { ∀-intro on (k) and (ℓ − 2): } (ℓ − 1) ∀x[x ∈ A : x ∈ B] { Definition of ⊆ on (ℓ − 1): } (ℓ) A ⊆ B (↑)

⊆-elimination:

  • (k)

A ⊆ B

  • (ℓ)

t ∈ A

  • { Property of ⊆ on (k)

and (ℓ): } (m) t ∈ B (↓)

12/36 / department of mathematics and computer science

Example

(A ∩ B) ∪ C C A B A ∩ (B ∪ C) C A B Fact

A ∩ (B ∪ C) ⊆ (A ∩ B) ∪ C does hold. [Proof on blackboard]

15/36 / department of mathematics and computer science

Complement

The complement AC of A is the set of everything not in A AC def = {x ∈ U | ¬(x ∈ A)}

U

A AC Example

(Suppose that U = Z) {x ∈ Z | x ≥ 0}C = {x ∈ Z | x < 0} Property of C: t ∈ AC

val

= = ¬(t ∈ A) NB: For computing C it is important to know what is the universe:

◮ If U = N, then {0, 1}C = {n ∈ N | n ≥ 2} ◮ If U = Z, then {0, 1}C = {x ∈ Z | x < 0 ∨ x ≥ 2}.

slide-4
SLIDE 4

16/36 / department of mathematics and computer science

Difference

The difference of A and B is the set of everything that is in A, but not also in B A \ B def = {x ∈ U | x ∈ A ∧ ¬(x ∈ B)}

A B A \ B Example

{n ∈ N | n > 5} \ {n ∈ N | n < 10} = {n ∈ N | n ≥ 10} Property of \: t ∈ A \ B

val

= = t ∈ A ∧ ¬(t ∈ B)

17/36 / department of mathematics and computer science

Equality of sets (reasoning)

=-introduction:

. . . (k) A ⊆ B . . . (ℓ − 2) B ⊆ A { ∧-intro on (k) and (ℓ − 2): } (ℓ − 1) A ⊆ B ∧ B ⊆ A { Definition of = on (ℓ − 1): } (ℓ) A = B (↑)

=-elimination:

  • (k)

A = B

  • { Definition of = on (k): }

(ℓ) A ⊆ B ∧ B ⊆ A (↓)

18/36 / department of mathematics and computer science

Examples

Assume U = Z.

◮ Prove that A \ BC = A ∩ B for all sets A and B.

[Proof on blackboard]

◮ Determine for each of the following formulas whether it holds for

all sets A and B. If so, then give a proof; if not, then give a counterexample:

  • A \ B = A ⇒ A = BC;
  • A = BC ⇒ A \ B = A.

24/36 / department of mathematics and computer science

Notation

0 ∈ {{0}} {0} ∈ {{0}} ∅ ∈ {{0}} {{0}} ∈ {{0}} 0 ⊆ {{0}} {0} ⊆ {{0}} ∅ ⊆ {{0}} {{0}} ⊆ {{0}}

slide-5
SLIDE 5

26/36 / department of mathematics and computer science

Empty set

The empty set ∅ is the unique set without elements. ∅ = {x ∈ U | False} Property of ∅: t ∈ ∅

val

= = False

∅ ⊆ A

val

= = True ∅ ⊆ A

val

= = { Definition ⊆ } ∀x[x ∈ ∅ : x ∈ A]

val

= = { Property of ∅ } ∀x[False : x ∈ A]

val

= = { Empty domain } True A ⊆ ∅

val

= = ∀x[x ∈ A : False] A ⊆ ∅

val

= = { Definition of ⊆ } ∀x[x ∈ A : x ∈ ∅]

val

= = { Property of ∅ } ∀x[x ∈ A : False]

27/36 / department of mathematics and computer science

Alternative property of empty set

From previous slide: (*) ∅ ⊆ A

val

= = True (**) A ⊆ ∅

val

= = ∀x[x ∈ A : False] So: A = ∅

val

= = { Definition of = } A ⊆ ∅ ∧ ∅ ⊆ A

val

= = { (*) + True/False-elimination } A ⊆ ∅

val

= = { (**) } ∀x[x ∈ A : False] Property of ∅: A = ∅

val

= = ∀x[x ∈ A : False]

28/36 / department of mathematics and computer science

Example

Prove that A ∪ B = A ⇒ B \ A = ∅ for all sets A and B. [Proof on blackboard. (Also available as detailed example of a derivation-style proof of a set-theoretic property from Course Material section of the website)]

29/36 / department of mathematics and computer science

Powerset

The powerset P(A) of A is the set of all subsets of A.

Examples

◮ P({4, 6}) = {∅, {4}, {6}, {4, 6}} ◮ P({1, 2, 3}) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} ◮ ∅ ∈ P(R), [0, 5] ∈ P(R) ◮ 1 ∈ P(R), {1} ∈ P(R), {2, 5, 7} ∈ P(R) ◮ N ∈ P(R), R ∈ P(R) ◮ P({∅, {∅}}) = {∅, {∅}, {{∅}}, {∅, {∅}}}

If #A = n, then #P(A) = 2n.

slide-6
SLIDE 6

30/36 / department of mathematics and computer science

Powerset in proofs

Property of P: C ∈ P(A)

val

= = C ⊆ A

Examples

◮ Prove that P(A) ⊆ P(A ∪ B) for all sets A and B.

[Exercise]

◮ Does P(A) \ P(B) ⊆ P(A \ B) hold for all sets A and B?

[Answer on next slide]

31/36 / department of mathematics and computer science

P(A) \ P(B) ⊆ P(A \ B)

X ∈ P(A) \ P(B)

val

= = { Property of \ } X ∈ P(A) ∧ ¬(X ∈ P(B))

val

= = { Property of P (2×) } X ⊆ A ∧ ¬(X ⊆ B) X ∈ P(A \ B)

val

= = { Property of P } X ⊆ A \ B

Counterexample:

Let A = {1, 2}, B = {2} and X = {1, 2}. Then X ⊆ A, so X ∈ P(A). And ¬(X ⊆ B), so ¬(X ∈ P(B)). Hence, X ∈ P(A) \ P(B). On the other hand, A \ B = {1}, so ¬(X ⊆ A \ B). Hence, X ∈ P(A \ B).

X 1 2 A B

32/36 / department of mathematics and computer science

Cartesian product

The Cartesian product A × B is the set of pairs (a, b) with a ∈ A and b ∈ B.

Examples

◮ {0, 1} × {3, 5, 7} = {(0, 3), (0, 5), (0, 7), (1, 3), (1, 5), (1, 7)} ◮ N × Z = {(n, x) | n ∈ N ∧ x ∈ Z} ◮ (3, −2) ∈ N × Z ◮ (−2, 3) ∈ N × Z

NB: A2 = A × A, A3 = A × A × A, etc.

33/36 / department of mathematics and computer science

Cartesian product in proofs

Property of ×: (a, b) ∈ A × B

val

= = a ∈ A ∧ b ∈ B

Example

Prove that A ⊆ B ⇒ A2 ⊆ A × B for all sets A and B. [See Section 16.9 of the book for the construction of a very similar proof.]

slide-7
SLIDE 7

34/36 / department of mathematics and computer science

Mind the Brackets

In set theory, brackets have a meaning, and different brackets have different meanings! : a number {0} : a set (containing a number) {{0}} : a set (containing a set containing a number) {0, 1} : a set (containing two numbers, order does not matter) (0, 1) : a pair of numbers (order does matter!) {(0, 1)} : a set (containing a pair of numbers) ∅ : a set (containing nothing) {∅} : a set (containing the empty set)

35/36 / department of mathematics and computer science

Proofs in Set Theory

A proof of a set-theoretic property is a convincing argument based on given definitions and properties of sets (see table on p. 381*) The logical reasoning structure of the proof must be clear and valid, but you may omit references to the names of the logical reasoning steps (∧-intro, ⇒-elim, ∀-elim, etc.). You may also mix styles (derivations, calculations, natural language). You should, however, explicitly refer to the set-theoretic properties (Property of ∩, Definition of ⊆, etc.) in your proof.

* Leibniz for equality of sets may be used as well, although it is not in the table. 36/36 / department of mathematics and computer science

Counterexamples in Set Theory

To refute the validity of a set-theoretic property, it is not enough to provide a diagram, or an informal reasoning of another kind. A counterexample consists of

  • 1. clear and concrete declarations of the sets involved (e.g., let

A = . . . , let B = . . . );

  • 2. evaluation of the expressions involved (e.g., then A ∪ B = . . . );
  • 3. a convincing argument why the property is refuted (e.g., since

the left-hand side of the implication is true, but the right-hand side is not, it follows that the implication is false).