Sets and Functions
Overlap sets in pictures to see unions and intersections. Judge by eye whether a map is injective or surjective.
A union takes anything in at least one set. An intersection needs both. A complement is everything outside. Colliding or missing arrows decide injective versus surjective.
For example, some π§ classmates love π books, while others love β½ soccer. Friends loving both stand in the overlap. Loving at least one puts you in the union.
( A βͺ B ) c = A c β© B c (A \cup B)^c = A^c \cap B^c ( A βͺ B ) c = A c β© B c
f Β bijective β
β βΊ β
β β g : g β f = i d f \text{ bijective} \iff \exists g: g \circ f = \mathrm{id} f Β bijective βΊ β g : g β f = id
Part of these learning paths
Examples & Exercises
Prove ( A βͺ B ) c = A c β© B c (A \cup B)^c = A^c \cap B^c ( A βͺ B ) c = A c β© B c element by element.
x β ( A βͺ B ) c β
β βΊ β
β x β A βͺ B β
β βΊ β
β x β A Β andΒ x β B β
β βΊ β
β x β A c β© B c x \in (A \cup B)^c \iff x \notin A \cup B \iff x \notin A \text{ and } x \notin B \iff x \in A^c \cap B^c x β ( A βͺ B ) c βΊ x β / A βͺ B βΊ x β / A Β andΒ x β / B βΊ x β A c β© B c
Venn diagram with the union lit β complementing leaves only the outside region.
Show proof
Take an element x x x . By the definition of complement, x β ( A βͺ B ) c β
β βΊ β
β x β A βͺ B x \in (A \cup B)^c \iff x \notin A \cup B x β ( A βͺ B ) c βΊ x β / A βͺ B .
x β A βͺ B β
β βΊ β
β Β¬ ( x β A β¨ x β B ) x \notin A \cup B \iff \lnot(x \in A \lor x \in B) x β / A βͺ B βΊ Β¬ ( x β A β¨ x β B ) . By the propositional De Morgan's law this is Β¬ ( x β A ) β§ Β¬ ( x β B ) \lnot(x \in A) \land \lnot(x \in B) Β¬ ( x β A ) β§ Β¬ ( x β B ) , i.e. ( x β A ) β§ ( x β B ) (x \notin A) \land (x \notin B) ( x β / A ) β§ ( x β / B ) .
( x β A ) β§ ( x β B ) β
β βΊ β
β x β A c β§ x β B c β
β βΊ β
β x β A c β© B c (x \notin A) \land (x \notin B) \iff x \in A^c \land x \in B^c \iff x \in A^c \cap B^c ( x β / A ) β§ ( x β / B ) βΊ x β A c β§ x β B c βΊ x β A c β© B c . Since x x x was arbitrary, ( A βͺ B ) c = A c β© B c (A \cup B)^c = A^c \cap B^c ( A βͺ B ) c = A c β© B c .
Prove f : A β B f: A \to B f : A β B is bijective iff a two-sided inverse g : B β A g: B \to A g : B β A exists.
Bijective mode β every dot is hit exactly once.
Show proof
(β) For each b β B b \in B b β B there is an a a a with f ( a ) = b f(a) = b f ( a ) = b (surjective), and by injectivity that a a a is unique. Call it g ( b ) g(b) g ( b ) ; this defines g : B β A g: B \to A g : B β A .
g ( f ( a ) ) = a g(f(a)) = a g ( f ( a )) = a because the unique element mapping to f ( a ) f(a) f ( a ) is a a a itself; and f ( g ( b ) ) = b f(g(b)) = b f ( g ( b )) = b is exactly the definition of g ( b ) g(b) g ( b ) .
(β) Suppose such a g g g exists. If f ( a 1 ) = f ( a 2 ) f(a_1) = f(a_2) f ( a 1 β ) = f ( a 2 β ) , applying g g g gives a 1 = g ( f ( a 1 ) ) = g ( f ( a 2 ) ) = a 2 a_1 = g(f(a_1)) = g(f(a_2)) = a_2 a 1 β = g ( f ( a 1 β )) = g ( f ( a 2 β )) = a 2 β β injective.
And for b β B b \in B b β B , putting a = g ( b ) a = g(b) a = g ( b ) gives f ( a ) = f ( g ( b ) ) = b f(a) = f(g(b)) = b f ( a ) = f ( g ( b )) = b β surjective. Hence f f f is bijective.
Prove β£ A βͺ B β£ = β£ A β£ + β£ B β£ β β£ A β© B β£ \lvert A \cup B\rvert = \lvert A\rvert + \lvert B\rvert - \lvert A \cap B\rvert β£ A βͺ B β£ = β£ A β£ + β£ B β£ β β£ A β© B β£ for finite sets, and evaluate it for β£ A β£ = 5 \lvert A\rvert=5 β£ A β£ = 5 , β£ B β£ = 4 \lvert B\rvert=4 β£ B β£ = 4 , β£ A β© B β£ = 2 \lvert A\cap B\rvert=2 β£ A β© B β£ = 2 .
β£ A βͺ B β£ = 5 + 4 β 2 = 7 \lvert A \cup B\rvert = 5 + 4 - 2 = 7 β£ A βͺ B β£ = 5 + 4 β 2 = 7
β£ A β£ = 5 \lvert A\rvert=5 β£ A β£ = 5 , β£ B β£ = 4 \lvert B\rvert=4 β£ B β£ = 4 , overlap 2 2 2 β the union has 7 7 7 .
Show proof
A βͺ B A \cup B A βͺ B is the disjoint union of the three pairwise-disjoint pieces A β B A \setminus B A β B , B β A B \setminus A B β A , and A β© B A \cap B A β© B .
β£ A β£ = β£ A β B β£ + β£ A β© B β£ \lvert A \rvert = \lvert A \setminus B \rvert + \lvert A \cap B \rvert β£ A β£ = β£ A β B β£ + β£ A β© B β£ and β£ B β£ = β£ B β A β£ + β£ A β© B β£ \lvert B \rvert = \lvert B \setminus A \rvert + \lvert A \cap B \rvert β£ B β£ = β£ B β A β£ + β£ A β© B β£ (both are disjoint unions).
Adding the two equations gives β£ A β£ + β£ B β£ = β£ A βͺ B β£ + β£ A β© B β£ \lvert A \rvert + \lvert B \rvert = \lvert A \cup B \rvert + \lvert A \cap B \rvert β£ A β£ + β£ B β£ = β£ A βͺ B β£ + β£ A β© B β£ β the overlap was counted twice. Rearranging yields β£ A βͺ B β£ = β£ A β£ + β£ B β£ β β£ A β© B β£ \lvert A \cup B \rvert = \lvert A \rvert + \lvert B \rvert - \lvert A \cap B \rvert β£ A βͺ B β£ = β£ A β£ + β£ B β£ β β£ A β© B β£ .
Substituting β£ A β£ = 5 \lvert A \rvert = 5 β£ A β£ = 5 , β£ B β£ = 4 \lvert B \rvert = 4 β£ B β£ = 4 , β£ A β© B β£ = 2 \lvert A \cap B \rvert = 2 β£ A β© B β£ = 2 gives β£ A βͺ B β£ = 5 + 4 β 2 = 7 \lvert A \cup B \rvert = 5 + 4 - 2 = 7 β£ A βͺ B β£ = 5 + 4 β 2 = 7 .
2. Number Systems