Thanks again Elijah: https://elijahsong.notion.site/Lecture-8-Functions-Part-3-and-Cardinality-27e330decc5249e9946ae3228853557a
Theorem: if $f:A \to B$ is an injection, and $g:B \to C$ is an injection, then the function $g \circ f: A \to C$ is also an injection. Sidenote: when you assume a universally quantified statement, no need to introduce a variable. When we prove a universally quantified statement, as is the case here, we let the reader pick values for the variables.
Proof: Let $f:A\to B$ and $g:B\to C$ be arbitrary injections. We will prove that the function $g \circ f:A \to C$ is also injective. To do so, consider any $a_1, a_2 \in A$ where $a_1 \neq a_2$. We will prove that $(g \circ f)(a_1) \neq (g \circ f)(a_2).$ Equivalently, we need to show that $g(f(a_1)) \neq g(f(a_2)).$
Since $f$ is injective and $a_1 \neq a_2$, we see that $f(a_1) \neq f(a_2).$ Then, since $g$ is injective and $f(a_1) \neq f(a_2)$, we see that $g(f(a_1)) \neq g(f(a_2))$, as required.
Great exercise: repeat this proof using the other definition of injectivity.
Theorem: The composition of surjections is also a surjection. Proof: in the appendix.
A bijective function is a function that is both injective and surjective. Intuitively, if $f:A \to B$ is bijective, then $f$ represents a way of pairing off elements in $A$ and elements in $B$.
The cardinality of a set is the number of elements it contains, $|S|$. Difficult to give a rigorous definition of cardinality (especially when considering infinite sets), so we’ll define cardinality as a relation between two sets. The intuition is that two sets have the same cardinality if there’s a way to pair off their elements.