CSCI 301 L19 Notes

Lecture 19 - Notes

Relations

Announcements

Equivalence Relations and Equivalence Classes

equivdef

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)\).

Equivalence Classes

Example: Consider the relation on \(A = \{-1, 1, 2, 3, 4\}\) that means “has the same sign as”:

Do Exercises Part A

Relations Between Sets

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.

Functions

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 an element of \(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

Properties of Functions

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:

injective_proof

And here is an approach for proving that a function is surjective:

surjective_proof