Elijah’s notes (thanks bro): https://elijahsong.notion.site/Lecture-7-Functions-Part-2-b1908b2aae8a49a2b9971d4c61af6a65
Just as an overview of the main topics (in no way representative of all the notes):
Injections
- Definition: A function $f:A\to B$ is injective (one-to-one) if
$\forall a_1 \in A.~\forall a_2 \in A.~(a_1 \neq a_2 \to f(a_1) \neq f(a_2)).$
- “if inputs are different, outputs are different”
- Alternate, equivalent definition: A function $f:A\to B$ is injective if
$\forall a_1 \in A.~\forall a_2 \in A.~(f(a_1)=f(a_2) \to a_1=a_2).$
- contrapositive, essentially: “If outputs are same, inputs are same”
Surjections
- Definition: A function $f:A\to B$ is surjective if $\forall b \in B.~\exists a \in A.~f(a)=b$
- “for every output, there’s an input that produces it”
- check appendix for proofs on surjections
A Proof about Birds
- Theorem: If all birds can fly, then all herons can fly.
- Proof: Assume that all birds can fly. We will show that all herons can fly.
Consider an arbitrary heron $h$. We will show that $h$ can fly. To do so, note that since $h$ is a heron, we know $h$ is a bird. Therefore, by our earlier assumption, $h$ can fly. $\blacksquare$
- Notice what we did here in the proof was essentially show this first order logic statement:
$$
(\forall b.~(\text{Bird}(b)\to \text{CanFly}(b))) \to (\forall h.~(\text{Heron}(h) \to \text{CanFly}(h)))
$$
- Here, we assumed that birds can fly, and we proved that herons can fly. Note that because we are assuming that birds can fly, we never introduce a variable $b$ representing any arbitrary bird, because that is of no use to us. However, if we were trying to prove that birds can fly, then we would introduce $b$ representing any arbitrary bird.
Important Table
Connecting Function Types
Theorem: For any function $f:A \to A$, if $f$ is an involution, then $f$ is surjective.
In FOL: $(\forall x \in A.~f(f(x))=x) \to (\forall b \in A.~\exists a \in A.~f(a)=b).$