760 likes | 995 Views
2.1 Sets Sets Common Universal Sets Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations. A set is a collection or group of objects or elements or members . (Cantor 1895) A set is said to contain its elements.
E N D
2.1 Sets • Sets • Common Universal Sets • Subsets • 2.2 Set Operations • 2.3 Functions • 2.4 Sequences and Summations
A set is a collection or group of objects or elements ormembers. (Cantor 1895) A set is said to contain its elements. There must be an underlying universal set U, eitherspecifically stated or understood. Sets
Sets • Notation: • list the elements between braces: S = {a, b, c, d}={b, c, a, d, d} (Note: listing an object more than once does not changethe set. Ordering means nothing.) • specification by predicates: S= {x| P(x)} • S contains all the elements from U which make thepredicate P true. • brace notation with ellipses: S = { . . . , -3, -2, -1}, the negative integers.
R = reals N = natural numbers = {0,1, 2, 3, . . . }, the counting numbers. Z = all integers = {. . , -3, -2, -1, 0, 1, 2, 3,4, . .}. Z+={1,2,3,…},the set of positive integers. Q={P/q | p Z,q Zand q≠0},the set of rational numbers. Q+={x R| x=p/q, for some positive integers p and q} Common Universal Sets
Notation: x is a member of S or x is an element of S: x S x is not an element of S: x S Common Universal Sets
Definition: The set A is a subset of the set B, denoted A B, iffx[xA→xB] Definition: The void set, the null set, the empty set,denoted Ø, is the set with no members. Note: the assertion x Ø is always false. Hence x[x Ø → x B]is always true. Therefore, Ø is a subset ofevery set. Note: Set B is always a subset of itself. Subsets
Definition: If A B but A B the we say A is a propersubset of B, denoted A B. Definition: The set of all subset of set A, denoted P(A),is called the power set of A. Subsets
Example: If A = {a, b} then P(A) = {Ø, {a}, {b}, {a,b}} Subsets
Definition: The number of (distinct) elements in A,denoted |A|, is called the cardinality of A. If the cardinality is a natural number (in N), then the set iscalled finite, else infinite. Subsets
Example: A = {a, b}, |{a, b}| = 2, |P({a, b})| = 4. A is finite and so is P(A). Useful Fact: |A|=n implies |P(A)| = 2n N is infinite since |N| is not a natural number. It is called atransfinite cardinal number. Note: Sets can be both members and subsets of other sets. Subsets
Example: A = {Ø,{Ø}}. A has two elements and hence four subsets: Ø , {Ø} , {{Ø}} , {Ø,{Ø}} Note that Ø is both a member of A and a subset of A! Subsets P. 1
Example: A = {Ø}. Which one of the follow is incorrect: (a) ØA (b) ØA (c) {Ø} A (d) {Ø} A Subsets P. 1
Russell's paradox: Let S be the set of all sets which are not members of themselves. Is S a member of itself? Another paradox: Henry is a barber who shaves all people who do not shave themselves. Does Henry shave himself? Subsets P. 1
Definition: The Cartesian product of A with B, denoted AB, is the set of ordered pairs {<a, b> | a A Λb B} Notation: Ai={<a1,a2,...,an>|aiAi} Note: The Cartesian product of anything with Ø is Ø. (why?) Subsets P. 1
Example: A = {a,b} , B = {1, 2, 3} AxB = {<a, 1>, <a, 2>, <a, 3>, <b, 1>, <b, 2>, <b,3>} What is BxA? AxBxA? If |A| = m and |B| = n, what is |AxB|? Subsets P. 1
Sets Subset Terms P. 1
2.1 Sets • 2.2 Set Operations • Set Operations • Venn Diagrams • Set Identities • Union and Intersection of Indexed Collections • 2.3 Functions • 2.4 Sequences and Summations P. 1
Propositional calculus and set theory are both instances ofan algebraic system called aBoolean Algebra. The operators in set theory are defined in terms of thecorresponding operator in propositional calculus. As always there must be a universe U. All sets areassumed to be subsets of U. Set Operations P. 1
Definition: Two sets A and B are equal, denoted A = B,iffx[x A↔x B]. Note: By a previous logical equivalence we have A = B iffx[(x A→ x B) Λ (x B → x A)] or A = BiffA B and B A Set Operations P. 1
Definitions: The union of A and B, denoted AB, is the set {x | xAV xB} The intersection of A and B, denoted AB, is the set {x | xAΛxB} Set Operations FIGURE 1 FIGURE 2 P. 1
Note: If the intersection is void, A and B are said to be disjoint. The complement of A, denoted , is the set {x | x A}={x | ¬(xA)} Note: Alternative notation is , and {x|xA}. The difference of A and B, or the complement of B relative to A, denoted A - B, is the set A Note: The complement of A is U - A. The symmetric difference of A and B, denoted AB, is the set (A - B)(B - A). Set Operations P. 1
Examples: U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} A= {1, 2, 3, 4, 5}, B = {4, 5, 6, 7, 8}. Then AB = {1, 2, 3, 4, 5, 6, 7, 8} AB = {4, 5} = {0, 6, 7, 8, 9, 10} = {0, 1, 2, 3, 9, 10} A - B = {1, 2, 3} B - A = {6, 7, 8} A B = {1, 2, 3, 6, 7, 8} Set Operations P. 1
A useful geometric visualization tool (for 3 or less sets) The Universe U is the rectangular box. Each set is represented by a circle and its interior. All possible combinations of the sets must be represented. Shade the appropriate region to represent the given set operation. Venn Diagrams P. 1
Set identities correspond to the logical equivalences. Example: The complement of the union is the intersection of the complements Set Identities P. 1
Set Identities • Proof: To show To show two sets are equal we show for all x that x is a member of one set if and only if it is a member of the other. • We now apply an important rule of inference (defined later) called Universal Instantiation
Set Identities • Universal Instantiation In a proof we can eliminate the universal quantifier which binds a variable if we do not assume anything about the variable other than it is an arbitrary member of the Universe. We can then treat the resulting predicate as a proposition.
We say 'Let x be arbitrary. ' Then we can treat the predicates as propositions: Assertion Reason Def. of complement ¬ Def. of ¬ Def. of union ¬xAΛ ¬xBDeMorgan's Laws Def. of Def. of complement Def. of intersection Hence is a tautology. Set Identities P. 1
Since x was arbitrary we have used only logically equivalent assertions and definitions we can apply another rule of inference called Universal Generalization We can apply a universal quantifier to bind a variable if we have shown the predicate to be true for all values of the variable in the Universe. and claim the assertion is true for all x, i.e., Set Identities P. 1
Set Identities • 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) • Note: As an alternative which might be easier in some cases, use the identity
Example: Show A(B - A) = Ø The void set is a subset of every set.Hence, A (B - A) Ø Therefore, it suffices to show A(B - A) Ø or x[x A (B - A) → x Ø] Set Identities P. 1
Set Identities So as before we say 'let x be arbitrary’. Show x A (B- A) → x Ø is a tautology. But the consequent is always false. Therefore, the antecedent better always be false also.
Solution: Apply the definitions: Assertion Reason x A(B- A)x A Λ x (B- A) by Def. of x A Λ (x B Λ x A) by Def. of - (x A Λx A) Λx B by Def. of Associative 0 Λx B by Def. of Complement 0 (false) by Def. of Domination Set Identities P. 1
Let A1,A2 ,..., Anbe an indexed collection of sets. Definition: The union of a collection of sets is the set that contains those elements that are members of at least one set in the collection. we use the notation to denote the union of the sets A1,A2 ,..., An Union and Intersection of Indexed Collections P. 1
Union and Intersection of Indexed Collections • Definition: The intersection of a collection of sets is the set that contains those elements that are members of all the set in the collection. we use the notation to denote the intersection of the sets A1,A2 ,..., An
Examples: Let Union and Intersection of Indexed Collections P. 1
Boolean Algebra Set operations Union Intersection Complement Difference Terms • Symmetric difference • Venn Diagram • Set Identities • Universal Instantiation • Universal Generalization P. 1
2.1 Sets • 2.2 Set Operations • 2.3 Functions • Functions • Injections, Surjections and Bijections • Inverse Functions • Composition • 2.4 Sequences and Summations P. 1
Definition: Let A and B be sets. A function (mapping,map) f from A to B, denoted f :A→ B, is a subset of A×Bsuch that and Functions P. 1
Note: f associates with each x in A one and only one y in B. A is called the domain B is called the codomain. If f(x) = y y is called the image of x under f x is called a preimageof y (note there may be more than one preimage of y but there is only one image of x). Functions P. 1
The range of f is the set of all images of points in A under f. We denote it by f(A). If S is a subset of A then f(S) = {f(s) | s in S}. Q: What is the difference between range and codomain? Functions P. 1
Functions • Example: • f(a) = • the image of d is • the domain of f is • the codomain is • f(A) = • the preimage of Y is • the preimages of Z are • f({c,d}) = • Z • Z • A = {a, b, c, d} • B = {X, Y, Z} • {Y, Z} • b • a, c ,d • {Z} P. 1
Let f be a function from A to B. Definition: f is one-to-one (denoted 1-1) or injective if preimages are unique. Note: this means that if a b then f(a) f(b). Definition: f is onto or surjectiveif every y in B has a preimage. Note: this means that for every y in B there must be an x in A such that f(x) = y. Definition: f is bijectiveif it is surjective and injective (one-to-one and onto). Injections, Surjections and Bijections P. 1
Examples: The previous Example function is neither an injection nor a surjection. Hence it is not a bijection. Injections, Surjections and Bijections P. 1
Note: Whenever there is a bijection from A to B, the two sets must have the same number of elements or the same cardinality. That will become our definition, especially for infinite sets. Injections, Surjections and Bijections P. 1
Examples: Let A = B = R, the reals. Determine which are injections, surjections, bijections: f(x) = x, f(x) = x2, f(x) = x3, f(x) = | x |, f(x) = x + sin(x) Injections, Surjections and Bijections P. 1
Let E be the set of even integers {0, 2, 4, 6, . . . .}. Then there is a bijection f from N to E , the even nonnegative integers, defined by f(x) = 2x. Hence, the set of even integers has the same cardinality as the set of natural numbers. OH, NO! IT CAN’T BE....E IS ONLY HALF AS BIG!!! Sorry! It gets worse before it gets better. (見山是山,見水是水前,會先見山不是山,見水不是水) Injections, Surjections and Bijections P. 1
Definition: Let f be a bijection from A to B. Then the inverse of f, denoted f-1, is the function from B to A defined as f-1(y) = x iff f(x) = y Inverse Functions P. 1
Inverse Functions • Example: Let f be defined by the diagram: • Note: No inverse exists unless f is a bijection. P. 1
Definition: Let S be a subset of B. Then f-1(S) = {x | f(x) S} Note: f need not be a bijection for this definition to hold. Inverse Functions P. 1
Inverse Functions {c, d} {a, b} • Example: Let f be the following function: f-1({Z}) = f-1({X, Y}) = P. 1