Example:
Show that \(\equiv \pmod{3}\) (that is, congruence mod 3 is an equivalence relation.
Recall: \(a \equiv b \pmod{n}\) means \(n \mid (a-b)\).
Reflexive: is \(a \equiv a \pmod{n}\)?
Symmetric: \(a \equiv b \pmod{n} \Rightarrow b \equiv a \pmod{n}\)?
Transitive: \(\left(a \equiv b \pmod{n} \land b \equiv c \pmod{n}\right) \Rightarrow b \equiv a \pmod{n}\)
Example: Consider the relation on \(A = \{-1, 1, 2, 3, 4\}\) that means “has the same sign as”:
Do Exercises Part A
You can have a relation between two sets. In this case, \(R \subseteq A \times B\). Otherwise, everything’s more or less the same.
Example: Let \(A = \{1, 2\}\) and \(B = \mathcal{P}(A)\). Define \(R = \{1, \{1\}), (2, \{2\}), (1, \{1, 2\}), (2, \{1, 2\})\}\)
In this case, the relation means \(\in\).
In this case, if we draw a diagram it will have two groups of points, one for \(A\) and one for \(B\), and arrows can only go from a member of the \(A\) group to a member of the \(B\) group.
We’re used to seeing functions like: \(f(x) = x^2\). Here we’ll define them more rigorously and ground them in our existing understanding of sets as the foundation of mathematics.
Definition: Suppose \(A\) and \(B\) are sets. A function from \(A\) to \(B\), written \(f: A \rightarrow B\), is a relation \(f \subseteq A \times B\) that has the property that for each \(a \in A\), the relation \(f\) contains exactly one ordered pair of the form \((a, b)\). We abbreviate the statement \((a, b) \in f\) as \(f(a) = b\).
Intuition: A function is a special kind of relation that relates all elements of \(A\) to exactly one element of \(B\). There cannot be any \(a \in A\) that doesn’t map to any \(b\), and there can’t be any \(a \in A\) that maps to more than one \(b \in B\).
Example: Let \(f: \mathbb{Z} \rightarrow \mathbb{N} = \{(n, |n| + 2) : n \in \mathbb{Z}\}\)
Definition: If \(f : A \rightarrow B\), then
Example: For \(f: \mathbb{Z} \rightarrow \mathbb{N} = \{(n, |n| + 2) : n \in \mathbb{Z}\}\) from above:
Do Exercises Part B
Definition: A function \(f: A \rightarrow B\) is:
Example: \(f: \mathbb{Z} \rightarrow \mathbb{N} = \{(n, |n| + 2) : n \in \mathbb{Z}\}\) is:
Example: If \(f : \mathbb{Z} \rightarrow \mathbb{N}\) is defined as \(f(n) = |n|+ 1\), then \(f\) is:
Here are two ways to prove that a function is injective:
And here is an approach for proving that a function is surjective: