<<

Student Responsibilities — Week 4

I Reading: Textbook, Section 2.1–2.3

Mat 2345 I Attendance: Strongly Encouraged

Week 4

I Week 4 Overview

Fall 2013 I 2.1 Sets

I 2.2 Operations

I 2.3 Functions

2.1 Sets Notation used to specify sets

I list the elements between braces; listing an object more than once does not change the set—ordering means nothing. I Set: an unordered collection or group of objects, which are said to be elements, or members of the set S = a, b, c, d = b, c, a, d, d { } { }

I Set builder notation – specify by predicate; here, S contains all I A set is said to contain its elements elements from U which make the predicate P true S = x P(x) { | } I There must be an underlying Universal Set, U, either specifically stated or understood I brace notation with ellipses; here, the negative integers: S = ..., 3, 2, 1 { − − − }

Common Universal Sets Notation

I R — Real Numbers I x S — x is a member of S, or x is an of S ∈

I x / S — x is not an element of S I N — Natural Numbers: 0, 1, 2, 3,... ∈ { }

I Z — Integers: ..., 3, 2, 1, 0, 1, 2, 3,... Set Equality — Definition #1 { − − − } I Two sets are equal if and only if they have the same elements. + I Z — Positive Integers I That is, if A and B are sets, then A and B are equal if and only if x[x A x B]. ∀ ∈ ↔ ∈ p I Q — Rational Numbers: p, q Z q = 0 { q | ∈ ∧ 6 } I We write A = B if A and B are equal sets.

I : Let A and B be sets. Then A B x [ x A x B ] I Power Set: P(A) is the set of all possible subsets of the set A ⊆ ⇔ ∀ ∈ → ∈

I If A = a, b , then I Empty, void, or Null Set: ∅ is the set with no members { } P(A) = ∅, a , b , a, b { { } { } { }} I the assertion x ∅ is always false, thus: ∈ I What is the power set of the set B = 0, 1, 2 ? x [ x ∅ x B] is always (vacuously) true, ∀ ∈ → ∈ { } and therefore ∅ is a subset of every set

I Note: a set B is always a subset of itself: B B ⊆ I How many elements would P( a, b, c, d ) have? { } I Proper subset: A B if A B, but A = B ⊂ ⊆ 6

Cardinality Example

I : A is the number of distinct elements in A | | I Let A = ∅, ∅ I If the cardinality is a natural number (in N), then the set is { { }} I A has two elements and hence four subsets: called finite; otherwise, it’s called infinite ∅, ∅ , ∅ , ∅, ∅ { } {{ }} { { }} I Example: Let A = a, b I Note that ∅ is both a member of A and a subset of A { } I A = a, b = 2 | | |{ }| I P(A) = P( a, b ) = 4 I Russell’s Paradox: Let S be the set of all sets which are not | | | { } | I A is finite, and so is P(A) members of themselves. Is S a member of itself or not? n I Note : A = n P(A) = 2 1 | | → | | I Note2: N is infinite since N is not a natural number — I The Paradox of the Barber of Seville: The (male) barber of | | it is called a transfinite Seville shaves all and only men who do not shave themselves. Who shaves the barber of Seville? I Note3: Sets can be both members and subsets of other sets

Cartesian Product

I of A with B: A B is the set of ordered I The Cartesian product of the sets A , A ,..., A , denoted by × 1 2 n pairs: < a, b > a A b B A A A is the set of ordered n– { | ∈ ∧ ∈ } 1 × 2 × · · · × n < a1, a2,..., an >, where ai Ai for 1 i n. I Notation: Πn A = < a , a ,..., a > a A , ∈ ≤ ≤ i=1 i { 1 2 n | i ∈ i } an n– I A A A = 1 × 2 × · · · × n I The Cartesian product of any set with is — why? < a1, a2,..., an > ai Ai , i = 1, 2,..., n ∅ ∅ { | ∈ }

I Example 1. Let A = a, b and B = 1, 2, 3 { } { } I If A = a, b and B = 1, 2, 3 , what is A B A? A B = < a, 1 >, < a, 2 >, < a, 3 >, < b, 1 >, < b, 2 >, < b, 3 > { } { } × × × { } What is B A? ×

If A = m and B = n, what is A B ? | | | | | × | Quantifiers Truth Sets The of Discourse, also known as the Domain of Discourse, is often referred to simply as the domain. I Let P be a predicate and D a domain. The Truth Set of P is the set of elements x D P(x) is true. The domain specifies the possible values of our variables. ∈ 3 I The truth set of P(x) is denoted: x D P(x) We can use quantifiers to restrict the domain { ∈ | } I Assume the domain is the set of integers. What are the truth sets: I x S[P(x)] denotes x[x S P(x)] ∀ ∈ ∀ ∈ → I P = x Z x = 1 Truth Set: Ex: x R[x2 0] means: { ∈ | | | } ∀ ∈ ≥ 2 2 I Q = x Z x = 2 Truth Set: for every real number x, x is non-negative { ∈ | } I R = x Z x = x Truth Set: Note: The meaning of the universal quantifier changes when we { ∈ | | | } change the domain. I Note: xP(x) is true over the domain U IFF the truth set of P ∀ is U. I x S[P(x)] denotes x[x S P(x)] ∃ ∈ ∃ ∈ ∧ I Note: xP(x) is true over the domain U IFF the truth set of Ex: x Z[x2 = 1] means: ∃ ∃ ∈ P = ∅. there exists an integer x such that x2 = 1 6

2.2 Set Operations Equality of Sets

By a previous logical equivalence, we have: I Boolean Algebra: an algebraic system, instances of which are and . A = B IFF I The operators in set theory are defined in terms of the x [(x A x B) (x B x A)] corresponding operator in propositional calculus. ∀ ∈ → ∈ ∧ ∈ → ∈

— or another definition — I As before, there must be a universe, U, and all sets are assumed to be subsets of U. A = B IFF A B and B A ⊆ ⊆

Set Operations More Set Operations

I of A and B, denoted A B, is the set ∪ x x A x B { | ∈ ∨ ∈ } I Difference of A and B, or the of B relative to A, denoted A B, is the set − A B I Intersection of A and B, denoted A B, is the set ∩ ∩ Note: The absolute complement of A is U A x x A x B − { | ∈ ∧ ∈ } If the intersection is void, A and B are said to be disjoint I Symmetric Difference of A and B, denoted A B, is the set ⊕ (A B) (B A) − ∪ − I Complement of A, denoted A, is the set x (x A) = x x A { | ¬ ∈ } { | 6∈ } Examples Venn Diagrams

U = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 { } A = 1, 2, 3, 4, 5 and B = 4, 5, 6, 7, 8 Venn Diagrams are a useful geometric visualization tool for 3 or { } { } fewer sets. I A B = 1, 2, 3, 4, 5, 6, 7, 8 ∪ { } I A B = 4, 5 I The Universal set U is a rectangular box ∩ { }

I A = 0, 6, 7, 8, 9, 10 I Each set is represented by a circle and its interior { } I B = 0, 1, 2, 3, 9, 10 { } I All possible combinations of the sets must be represented I A B = 1, 2, 3 − { } I Shade the appropriate region to represent the given set operation I B A = 6, 7, 8 − { } I A B = 1, 2, 3, 6, 7, 8 ⊕ { }

Examples U U A B AB

For 2 sets A B ∩ U A B U A B

C C For 3 sets A (C B) ∪ ∩

Set Identities

Set identities correspond to the logical equivalences. We now apply an important called Example The complement of the union is the intersection of the Universal Instantiation complements: In a proof, we can eliminate the universal quantifier A B = A B ∪ ∩ which binds a variable if we do not assume anything To prove this statement, we would need to show: about the variable other than it is an arbitrary mem- x [x A B x A B] ber of the Universe. We can then treat the resulting ∀ ∈ ∪ ↔ ∈ ∩ predicate as a proposition.

To show two sets are equal:

I we can show for all x that x is a member of one set IFF it is a We say, “Let x be arbitrary.” Then we can treat the predicates member of the other, or as propositions. I show that each is a subset of the other Universal Generalization Assertion Reason x A B x / (A B) Defn of complement We can apply another rule of inference ∈ ∪ ⇔ ∈ ∪ [x (A B)] Defn of / ⇔ ¬ ∈ ∪ ∈ [(x A) (x B)] Defn of union ⇔ ¬ ∈ ∨ ∈ (x A) (x B) DeMorgan’s Laws Universal Generalization ⇔ ¬ ∈ ∧ ¬ ∈ (x / A) (x / B) Defn of / ⇔ ∈ ∧ ∈ ∈ We can apply a universal quantifier to bind a variable (x A) (x B) Defn of complement ⇔ ∈ ∧ ∈ if we have shown the predicate to be true for all values x (A B) Defn of intersection of the variable in the Universe ⇔ ∈ ∩

Hence, x A B x A B is a tautology since and claim the assertion is true for all x, i.e., ∈ ∪ ↔ ∈ ∩ I x was arbitrary, and x[x A B x A B] I we have used only logically equivalent assertions and definitions ∀ ∈ ∪ ↔ ∈ ∩ Q.E.D. — an abbreviation for the Latin phrase “Quod Erat Demonstrandum” – “which was to be demonstrated” – used to signal the end of a proof.

Alternative Identity

Note: as an alternative which might be easier in some cases, use the identity: A = B [A B and B A] Now we need to show ⇔ ⊆ ⊆ x A (B A) x Example ∈ ∩ − → ∈ is a tautology. Show A (B A) = ∩ − The is a subset of every set. Hence, But the consequent is always false. A (B A) ∩ − ⊇ Therefore, the antecedent (or premise) must also be false. Therefore, it suffices to show A (B A) ∩ − ⊆ or x[x A (B A) x ] ∀ ∈ ∩ − → ∈ So, as before, we say “let x be arbitrary”

Indexed Collections

We proceed by applying the definitions: Let A1, A2,..., An be an indexed collection of sets. Union and intersection are associative (because and and or are), Assertion Reason we have: x A (B A) (x A) [x (B A)] Defn of intersection n A = A A A ∈ ∩ − ⇔ ∈ ∧ ∈ − i=1 i 1 ∪ 2 ∪ · · · ∪ n (x A) [(x B) (x / A)] Defn of difference ⇔ ∈ ∧ ∈ ∧ ∈ S and [(x A) (x / A)] (x B) Comm Prop of and ⇔ ∈ ∧ ∈ ∧ ∈ n F (x B) Table 6 in textbook Ai = A1 A2 An ⇔ ∧ ∈ i=1 ∩ ∩ · · · ∩ F Domination ⇔ T Examples Let A = [ i, ), 1 i < Hence, because P P is always false, the implication is a i ∞ ≤ ∞ ∧ ¬ tautology. The result follows by Universal Generalization. n A = [1, ) Q.E.D. i=1 i ∞ S n A = [n, ) i=1 i ∞ T 2.3 Functions

I If F (x) = y: I Function: Let A and B be sets. Then a function (mapping, map) f from A to B, denoted f : A B, is a subset of A B → × I y is called the image of x under f such that I x is called a preimage of y x [x A y [ y B < x, y > f ]] ∀ ∈ → ∃ ∈ ∧ ∈ and I Note: there may be more than one preimage of y, but there is [ < x, y1 > f < x, y2 > f ] y1 = y2 only one image of x. ∈ ∧ ∈ →

I Note: f associates with each x A one and only one y B. ∈ ∈ I The range of f is the set of all images of points in A under f ; it is denoted by f (A) I A is called the domain of f

I B is called the codomain of f

Injections, Surjections, and Example I

A B Let f be a function from A to B f I Injection: f is one–to–one (denoted 1–1) or Injective if a preimages are unique X

Note: this means that if x1 = x2 then f (x1) = f (x2) b 6 6 Y c I Surjection: f is onto or surjective if every y in B has a preimage Z d Note: this means that for every y in B there must be an x in A such that f (x) = y 1. Is this an injection? I : f is bijective if it is surjective and injective, in other 2. Is this a surjection? words, 1–1 and onto. 3. Is this a bijection? 4. How do we determine the answers?

Example II If S is a subset of A, then f (S) = f (s) s S A B { | ∈ } f a A B X f a b X Y b c Y Z c d Z d

I the codomain is B = X , Y , Z { } I f (a) = Z; the image of d is Z I the preimage of Y is b

I f ( a, d ) = Z I the preimages of Z are a, c, and d { } { } I the domain of f is A = a, b, c, d I f ( a, b ) = Y , Z { } { } { } I The range of f is f (A) = Y , Z { } Example III Example IV

A B g A B h a V a V b W b W c X c X d Y d Y Z

1. Is this an injection? 1. Is this an injection? 2. Is this a surjection? 2. Is this a surjection? 3. Is this a bijection? 3. Is this a bijection?

Cardinality

I Note: whenever there is a bijection from A to B, the two sets Let E be the set of even nonnegative integers, 0, 2, 4, 6,... { } must have the same number of elements or the same cardinality Then there is a bijection f from N to E, the even nonnegative integers, defined by: I That will become our definition, especially for infinite sets. f (x) = 2x Let A = B = R, the reals Determine which are injections, surjections, bijections: Hence, the set of even nonnegative integers has the same Function Injection? Surjection? Bijection? cardinality as the set of natural numbers. . . 1—1 onto

f (x) = x OH, NOES! IT CAN’T BE. . . E is only half as big!! f (x) = x2 (But it’s TRUE.) f (x) = x3 f (x) = x | |

Inverse Functions Example Let f be defined by the diagram: A f B a V

b W I Inverse Function: Let f be a bijection from A to B. Then the 1 inverse of f , denoted f − , is the function from B to A defined c X as: d Y 1 f − (y) = x iff f (x) = y

1 −1 Then f − is defined as: A f B a V

I Note: no inverse exists unless f is a bijection. b W

c X

d Y Inverse Applied to a Subset Composition

I Composition: Let f : B C, g : A B. I Inverse Function over Subsets: Let S be a subset of B. Then → → 1 The composition of f with g, denoted f g, is the function f − (S) = x f (x) S ◦ { | ∈ } from A to C defined by I Example: Let f be the following function – f g(x) = f (g(x)) ◦ A f B I Example: a X A g f C A f g C b Y B a V a c Z H H b W b d I I c X c J J f 1( X , Y ) = a, b d Y d − { } { }

Other Examples Discussion

Let f (x) = x2 and g(x) = 2x + 1 I Suppose f : B C, g : A B, and f g is injective → → ◦ I What can we say about f and g? f g(x)= f (g(x)) ◦ I Using the definition of injective, we know that if a = b, then = f (2x + 1) 6 f (g(a)) = f (g(b)), since the composition is injective = (2x + 1)2 6 = 4x2 + 4x + 1 I Since f is a function, it cannot be the case that g(a) = g(b), since f would have two different images for the same point.

I Hence, g(a) = g(b) 6 g f (x)= g(f (x)) ◦ I It follows that g must be an injection = g(x2) I However, f need not be an injection. . . how could you show this? 2 = 2x + 1 (counterexample)

floor and ceiling Functions

I Floor: The floor function, denoted f (x) = x or f (x) = floor(x) b c is the largest integer less than or equal to x.

I Ceiling: The ceiling function, denoted f (x) = x or f (x) = ceiling(x) d e is the smallest integer greater than or equal to x.

I Examples: 3.5 = 3, 3.5 = 4 b c d e

I Note: The floor function is equivalent to truncation for positive numbers