Subsection Proofs about Sets
Recall that a set is an unordered collection of elements. We can describe a set by listing these elements, or by specifying a property that all elements in the set satisfy. For example,
\begin{equation*}
A = \{1,2,3,4,5\}\text{,}
\end{equation*}
or
\begin{equation*}
B = \{x \in \N \st x \lt 10 \}\text{.}
\end{equation*}
The second set here is the set of natural numbers (\(0, 1, 2, \ldots\)) less than 10. Notice that every element in \(A\) is also an element of \(B\text{.}\) Here is a definition that captures that idea.
Definition 1.5.1.
A set
\(A\) is a
subset of a set
\(B\text{,}\) written
\(A \subseteq B\text{,}\) provided every element of
\(A\) is also an element of
\(B\text{.}\)
The set
\(B\) is sometimes called a
superset of
\(A\text{.}\)
We say
\(A\) is a
proper subset of
\(B\text{,}\) written
\(A \subset B\text{,}\) provided
\(A \subseteq B\) and
\(A \neq B\text{.}\) In other words, if every element in
\(A\) is an element in
\(B\text{,}\) and there is at least one element in
\(B\) that is
not in
\(A\text{.}\)
Example 1.5.2.
Let
\(A = \{x \in \N \st x \lt 5\}\) and
\(B = \{ x \in \N \st x^2 \lt 10\}\text{.}\) Is
\(B \subseteq A\text{?}\) Is
\(B\) a
proper subset of
\(A\text{?}\)
Solution.
We are asking whether every natural number less than 5 is also a natural number whose square is less than 10. Okay, we could just write out the elements of the sets:
\(A = \{0,1,2,3,4\}\) and
\(B = \{0,1,2,3\}\) (since
\(3^2 = 9\) and
\(4^2 = 16\)). So
\(B \subseteq A\text{.}\) But
\(B \neq A\text{,}\) so in fact
\(B \subset A\text{.}\)
The sets in the example above were small, and it is easy enough to write down the elements of the sets. However, we can also prove subset relationships between sets if this isnβt practical or even possible (perhaps the sets are infinite). Letβs look carefully at how we could have reasoned about the example above.
We claimed that every element of
\(B\) was also an element of
\(A\text{.}\) Another way to say this: For all numbers
\(n\text{,}\) if \(n\) is an element of
\(B\text{,}\) then \(n\) is also an element of
\(A\text{.}\) Recognizing this as a conditional statement, we can proceed to give a direct, contrapositive, or contradiction proof of the fact. Here a direct proof would be perfectly acceptable. Letβs try it:
Proof.
Let
\(n\) be an element of the set
\(B\text{.}\) Then
\(n^2 \lt 10\text{,}\) by the definition of
\(B\text{.}\) Since
\(4^2 = 16\text{,}\) we must have that
\(n \lt 4\text{.}\) By the definition of
\(A\text{,}\) and the fact that
\(4 \lt 5\text{,}\) we see that
\(n \in A\text{.}\)
To be clear, this proof is
way more than we would normally do for this example, but its format should be illuminating. Proving that one set is a subset of another is really the same as proving an implication!
To give an example of how we can apply the definition of βsubsetβ in a more general setting, letβs prove a basic fact about subsets.
Proposition 1.5.3.
For any sets
\(A\text{,}\) \(B\text{,}\) and
\(C\text{,}\) if
\(A \subseteq B\) and
\(B \subseteq C\text{,}\) then
\(A \subseteq C\text{.}\)
Proof.
We will give a direct proof. Let
\(A\text{,}\) \(B\text{,}\) and
\(C\) be sets, and assume that
\(A \subseteq B\) and
\(B \subseteq C\text{.}\) We will prove that
\(A \subseteq C\text{.}\)
Let
\(x\) be an element of
\(A\text{.}\) Since
\(A \subseteq B\text{,}\) we know that
\(x \in B\text{.}\) Since
\(B \subseteq C\text{,}\) we know that
\(x \in C\text{.}\) Therefore,
\(A \subseteq C\text{.}\)
Now letβs prove a fact about numbers: Every multiple of 9100 is also a multiple of 13. We could factor 9100, but here is an easier way. The set of multiples of 9100 is a subset of the set of multiples of 91. And the set of multiples of 91 is a subset of the set of multiples of 13. Now apply the proposition above.
The proof of
PropositionΒ 1.5.3 is what is sometimes called an
element chasing proof. By the definition of subset,
\(A \subseteq B\) means every element of
\(A\) is an element of
\(B\text{,}\) or equivalently, for all
\(x\text{,}\) if
\(x\) is an element of
\(A\text{,}\) then
\(x\) is an element of
\(B\text{.}\) One way to prove this is to βchaseβ the element
\(x\) from
\(A\) to
\(B\text{.}\)
Example 1.5.4.
Prove that if
\(A \subseteq B\text{,}\) then
\(A \cup B \subseteq B\text{.}\) Recall that
\(A \cup B\) is the
union of sets
\(A\) and
\(B\text{,}\) and contains all elements that are in
\(A\) or
\(B\) or both.
Solution.
We will write a direct proof. So we will assume that
\(A \subseteq B\) and prove that
\(A \cup B \subseteq B\text{.}\) Our desired conclusion is a statement about subsets, so letβs do an element chasing proof for it.
Proof.
Let
\(A\) and
\(B\) be sets and assume
\(A \subseteq B\text{.}\) Now let
\(x\) be an element in
\(A \cup B\text{.}\) This means that
\(x\) is an element of
\(A\text{,}\) or
\(x\) is an element of
\(B\text{,}\) or both.
Consider the cases. If
\(x\) is an element of
\(A\text{,}\) then since
\(A \subseteq B\text{,}\) we know that
\(x\) is an element of
\(B\text{.}\) On the other hand, if
\(x\) is not an element of
\(A\text{,}\) then
\(x\) must be an element of
\(B\) (since
\(x\) is in
\(A \cup B\)). In either case,
\(x\) is an element of
\(B\text{.}\) Therefore,
\(A \cup B \subseteq B\text{.}\)
We can actually prove a strong statement:
\(A \subseteq B\) if and only if
\(A \cup B = B\text{.}\) You are asked to do this in the exercises.
Subsection Proofs about Functions
A function
\(f:A \to B\) is a rule that assigns each element of the set
\(A\) (the domain) to exactly one element of the set
\(B\) (the codomain). It is any rule: There doesnβt have to be a formula or rationale for it; we just need to match up elements from
\(A\) to elements in
\(B\text{.}\) For example, we could let
\(A\) be the set of students enrolled in a particular Discrete Math course and let
\(B\) be the set of months of the year. Now define the function
\(f:A \to B\) to be the rule that assigns to each student the month in which their birthday falls. Since every student has an assigned month, and no more than one month, this is a function.
Here is a definition of a particular type of function.
Definition 1.5.5.
A function
\(f:A \to B\) is
injective (or
one-to-one) provided every element in
\(B\) is the image of at most one element in
\(A\text{.}\) In other words, no element in
\(B\) is the
output for more than one
input from
\(A\text{.}\)
In the example below, we use two-line notation to describe a function. The top row contains the inputs, and the bottom row lists the corresponding outputs. So \(f:\{1,2,3,4\} \to \{a,b,c,d\}\) might be defined as,
\begin{equation*}
f = \twoline{1 \amp 2 \amp 3 \amp 4}{a \amp b \amp c \amp d}\text{,}
\end{equation*}
which means that \(f(1) = a\text{,}\) \(f(2) = b\text{,}\) \(f(3) = c\text{,}\) and \(f(4) = d\text{.}\)
Example 1.5.6.
Let \(A = \{1,2,3\}\) and \(B = \{2, 4, 6, 8\}\text{.}\) Consider the functions \(f:A \to B\) and \(g:A \to B\) defined by,
\begin{equation*}
f = \twoline{1 \amp 2 \amp 3}{2 \amp 8 \amp 6}, \qquad g = \twoline{1 \amp 2 \amp 3}{4 \amp 6 \amp 4}.
\end{equation*}
Which of these functions is injective?
Solution.
The function
\(f\) is injective: Each element of
\(B\) is the image of at most one element of
\(A\text{.}\) The function
\(g\) is not injective: The element 4 in
\(B\) is the image of both 1 and 3 in
\(A\text{.}\)
Consider the student-to-birth-month function again. Could this possibly be injective? Or put another way, must there be two students in the course with the same birth month (which would say the function is
not injective)? The answer seems to depend on how many students are in the class.
But letβs pause and think about the more general fact about functions we have here. Letβs prove the following fact. Recall that
\(|A|\) denotes the
cardinality (size) of the set
\(A\text{:}\) the number of elements in
\(A\text{.}\)
Proposition 1.5.7.
Suppose
\(f:A \to B\) is a function with
\(A\) and
\(B\) both finite sets. If
\(|A| \gt |B|\text{,}\) then
\(f\) is
not injective.
Proof.
We will give a proof of the contrapositive: If
\(f\) is injective, then
\(|A| \le |B|\text{.}\) Let
\(|B| = n\text{.}\) Since
\(f\) is injective, each element of
\(B\) must be the output for
at most one element of
\(A\text{.}\) Thus there are at most
\(n\) elements in
\(A\) that get mapped to
\(B\) by
\(f\text{.}\) But the definition of a function requires that every element of the domain is mapped to exactly one element of the codomain, so there must be at most
\(n\) elements in
\(A\text{.}\)
Does this proof remind you of our pigeonhole-like proofs? It should, since this is precisely (one of) the careful formulations of the pigeonhole principle. We could have proved the fact about students sharing a birth month, but now we can just apply the proposition above and be done. When you apply a theorem or proposition to directly prove another result, we call the latter result a
corollary.
Corollary 1.5.8.
Suppose a class has 25 students. Then at least two students share the same birth month.
Proof.
Consider the function that maps each student to their birth month. Since the domain has 25 elements and the codomain has 12 elements, the function is not injective, by
PropositionΒ 1.5.7. Therefore, at least two students share the same birth month.
Functions always have inputs from a
set (called the
domain) and outputs in a set as well (called the
codomain). This naturally leads to facts to consider about the interaction between sets and functions.
Definition 1.5.9.
Given a function
\(f:X \to Y\) and a set
\(A \subseteq X\text{,}\) we define the
image of \(A\) under \(f\) to be the set
\(f(A) = \{f(a) \in Y \st a \in A\}\text{.}\) That is,
\(f(A)\) is the set of all outputs of the function for inputs in
\(A\text{.}\)
Example 1.5.10.
Let
\(f: \N \to \N\) be defined by
\(f(n) = 2n\text{.}\) Let
\(A = \{1,2,3\}\text{.}\) Find
\(f(A)\text{.}\)
Solution.
Evaluate each element of \(A\) by \(f\text{.}\)
\begin{equation*}
f(1) = 2;\qquad f(2) = 4; \qquad f(3) = 6\text{.}
\end{equation*}
We want the set of these outputs. So \(f(A) = \{2, 4, 6\}\text{.}\)
Now letβs prove something.
Proposition 1.5.11.
Let
\(f:X \to Y\) be a function, and let
\(A\) and
\(B\) be subsets of
\(X\text{.}\) If
\(A \subseteq B\text{,}\) then
\(f(A) \subseteq f(B)\text{.}\)
Proof.
Let \(f\text{,}\) \(A\text{,}\) and \(B\) be as in the proposition. Assume that \(A \subseteq B\text{.}\) Now consider an element \(y \in f(A)\text{.}\) By definition, this means that there is some \(a \in A\) such that \(f(a) = y\text{.}\) Since \(a \in A\) and \(A \subseteq B\text{,}\) we have that \(a \in B\text{.}\) Then by definition,
\begin{equation*}
y = f(a) \in f(B)\text{.}
\end{equation*}
Since \(y\) was an arbitrary element of \(f(A)\text{,}\) we have proved that \(f(A) \subseteq f(B)\text{.}\)
Notice that the proof above is an element chasing proof again. This makes sense as soon as you remember that
\(f(A)\) and
\(f(B)\) are just the names of sets. To prove one set is a subset of another, we chase elements from the subset to the superset.
Subsection Proofs about Relations
A
relation on a set
\(A\) is a set of ordered pairs of elements from
\(A\text{.}\) We can think of a relation as a way to describe a type of relationship between elements of
\(A\text{.}\) For example, we might have a relation on the set of people at a party that describes who is friends with whom. We might have a relation on the set of natural numbers that describes which pairs of numbers are related by the relation
\(x \lt y\text{.}\)
Relations permeate all of mathematics, often without us even thinking of them. Whenever we make a statement about two elements of a set, we are implicitly defining a relation. The statement is true when the pair is in the relation. For example, the statement, β3 is less than 5,β is true because the pair
\((3,5)\) is in the relation
\(\lt\text{.}\) In fact, using the language we developed in the subsection
Quantifiers and Predicates, we can say that a relation is just a predicate, where the variables come from the same set.
Often relations have special symbols like β
\(=\)β or β
\(\le\)β or β
\(\perp\)β. When we talk about a general relation, we will either use
\(\sim\) and write
\(x \sim y\text{,}\) or use a capital letter like
\(R\text{,}\) and write
\(R(x,y)\) or
\(xRy\) or even
\((x,y) \in R\) (these all mean the same thing).
When we study relations, we try to identify properties that relations might have. Here is an example of a very common property.
Definition 1.5.12.
A relation
\(R\) on a set
\(A\) is
transitive provided for all
\(x,y,z \in A\text{,}\) if
\(xRy\) and
\(yRz\text{,}\) then
\(xRz\text{.}\)
Example 1.5.13.
Consider the relation
\(\sim\) on the set of students in your Discrete Math course that holds of two students, provided they have some other class together. Is this relation transitive?
Solution.
No, not necessarily (although for some sets of students it could be). For example, suppose Alice has another class with Bruce, say Introduction to Programming. Carlos is not in Intro to Programming, but he and Bruce are both in Organic Chemistry. So then Alice
\(\sim\)Bruce and Bruce
\(\sim\)Carlos, but it might not be the case that Alice
\(\sim\)Carlos (since Alice need not be in Organic Chemistry with Carlos).
Proving that a relation is
not transitive takes nothing more than finding a counterexample, which means finding three elements
\(a\text{,}\) \(b\text{,}\) and
\(c\) such that
\(a \sim b\text{,}\) \(b \sim c\text{,}\) but
\(a \not\sim c\) (remember, the only way for an implication to be false is for the hypothesis to be true and the conclusion to be false).
Perhaps slightly more interesting would be proof that a relation is transitive.
Example 1.5.14.
Consider the set of all students in your Discrete Mathematics class, and define the relation
\(\sim\) that holds of students
\(a\) and
\(b\) (so
\(a \sim b\) is true), provided
\(a\) is taller than
\(b\text{.}\) Prove that this relation is transitive.
Solution.
The definition of transitive is an implication, so we can try a direct proof.
Proof.
Let
\(a\text{,}\) \(b\text{,}\) and
\(c\) be arbitrary students in your Discrete Math course. Assume,
\(a \sim b\) and
\(b \sim c\text{.}\) That means that
\(a\) is taller than
\(b\text{,}\) and that
\(b\) is taller than
\(c\text{.}\) But then surely
\(a\) must be even taller than
\(c\) than they are taller than
\(b\text{,}\) so we have that
\(a \sim c\) is true as well. Thus
\(\sim\) is transitive on this set.
Subsection Proofs about Graphs
We will spend all of
ChapterΒ 2 studying proofs about graphs since this is such a rich area of mathematics. As a preview, here is an example of how graph proofs can go.
A
graph is a set
\(V\) of
vertices and a set
\(E\) of
edges. The edges are two-element subsets of the vertices, and we can think of them as representing relationships between the vertices. Note, this is an abstract definition of a graph using sets, but we often draw graphs using dots for the vertices connected by lines for the edges, as this gives us a nice picture of what is going on.
Since graphs represent a type of relationship between elements (vertices), we can use graphs to represent many real-world problems. For example, the vertices of a graph might represent people at a party. Each edge can represent a handshake between two people. So if we wondered whether it is possible for the 15 people at a party to each shake hands with exactly 3 people there, we are really asking whether there is a graph with 15 vertices where each vertex belongs to 3 edges. (βBelongs toβ?? Yes, because an edge is a two-element subset of the vertices, so if an edge βtouchesβ or βcomes out ofβ a vertex, that means the vertex belongs to that particular two-element subset.)
Here is a definition related to this idea.
Definition 1.5.15.
Let
\(v\) be a vertex in a graph
\(G\text{.}\) The
degree of
\(v\text{,}\) written
\(d(v)\text{,}\) is the number of edges that contain
\(v\text{,}\) i.e., the number of edges
incident to
\(v\text{.}\)
Example 1.5.16.
Consider the graph
\(G\) with vertices
\(V = \{1,2,3,4\}\) and edges
\(E = \{\{1,2\}, \{1,3\}, \{1,4\}, \{2,3\}\}\text{.}\) What is the degree of each vertex in
\(G\text{?}\)
Solution.
It might be helpful to picture the graph:
We have
\(d(1) = 3\text{,}\) \(d(2) = 2\text{,}\) \(d(3) = 2\text{,}\) and
\(d(4) = 1\text{.}\) You can see this by counting how many edges are incident to each vertex, or by counting how many edges (subsets) each vertex belongs to.
So is it possible for 15 people to each shake hands with exactly three people in their group? Well, is there a graph with 15 vertices, all of degree 3? The answer is no!
One way you can see this is if you ask how many edges such a graph would have. Each vertex is incident to three edges, so counting incidences, we get
\(15\cdot 3 = 45\text{.}\) But every edge is incident to two vertices, so we have counted each edge twice. So the number of edges in such a graph would be
\(45/2 = 22.5\text{.}\) But the number of edges in a graph must be a whole number, so there is no such graph.
This suggests that we can say something more in general. The following proposition is a simple consequence of the
Handshake LemmaΒ 2.1.8, which we will prove in
SectionΒ 2.1. Here we give a complete proof of this particular formulation of it.
Proposition 1.5.17.
In any graph, the number of vertices with odd degree must be even.
Proof.
We will prove this by contradiction. Suppose there was a graph with an odd number of vertices with odd degree. Consider the sum of the degrees of all the vertices. The sum for the odd-degree vertices would be odd (since the sum of an odd number of odd numbers is odd). The sum of the even-degree vertices will be even (any sum of even numbers must be even). The sum of an odd number and an even number is odd. Thus the sum of all the degrees will be odd.
However, the number of edges in a graph is half the sum of the degrees (by
LemmaΒ 2.1.8, or simply because each edge contributes one to the count of the degree of two vertices). Since the number of edges is a whole number, we see that the sum of the degrees must be even. This contradicts what we found in the previous paragraph.
Therefore, in any graph, the number of vertices with odd degree must be even.