# Lecture 018

## Surjection - horizontal line test at least once

Surjection(surjectivity): everything in the codomain gets hit by something

• Definition Let A and B be sets and $f: A \rightarrow B$ be a function. f is surjective (or onto) iff $Im_f(A) = B$.

• $(\forall b \in B)(\exists a \in A)(f(a) = b)$

• $f:A \rightarrowtail B$

• then |A|>=|B| (B got all mapped even though there may be a overlap)

## Injection - horizontal line test at most once

Definition: let A, and B be set and $f: A \to B$ be a function, we say that f is injective(1-to-1).

• $(\forall x, y \in A)(f(x) = f(y) \implies x=y)$

• informal notation: $f: A \hookrightarrow B$

• Proof: let x, y s.t. f(x)=f(y), show x=y. You can show f(x)!=f(y) to by pass case check for piece-wise function.

• then |A|<=|B| (one to one, but not all B gets mapped)

## Bijection (Both Injection and Surjection)

Definition: let A, and B be set and $f: A \to B$ be a function, we say that f is bijection iff f is both injection and surjection.

• Proof: in two parts or

## Function Composition

Definition: Let A, B, C be sets and $f:A\to B \land g:B\to C$ be functions. The function $k:A\to C$ are defined by $(\forall a \in A)(h(a) = g(f(a)))$ is called the composition of g and f, denoted $h=g \circ f$.

Theorem: Let A, B, C, D be sets and $f:A\to B \land g:B\to C, h:C\to D$ be functions. Then $f \circ (g \circ f) = (h \circ g) \circ f$

• proof: $(h \circ (g \circ f))(a) = h((g\circ f)(a)) = h(g(f(a))) = (h \circ g)(f(a)) = ((h \circ g) \circ f)(a)$

observe: if $f: A\to A$, then $id_A \circ f = f \circ id_A = f$

## Identity Function

$id_A: A \to A, a |-> a$ TODO what is this notation TODO what is identity on a function

## Inverse

Definition: Let A, B be sets and $f: A \to B$ and $g: B \to A$ be functions. g is the inverse of f ($g = f^{-1})$ iff $f \circ g = id_B \land g \circ f = id_A$

Theorem: Let $f: A \to B$ be a function. f is invertible iff f is a bijection.

• prove forward: f is invertible -> f is a bijection

• prove 1-to-1
• invertible $(\exists g: B \to A)(g \circ f = id_A \land f \circ g = id_B)$
• let $a_1, a_2 \in A \land f(a_1) = f(a_2)$
• $g(f(a_1)) = g(f(a_2))$ by g well defined
• $id_A(a_1) = id_A(a_2)$ by $g \circ f = id_A$
• $a_1 = a_2$
• prove on-to
• let $b \in B$. Consider $a = g(b) \in A$. Since f and g are inverse. $f(a) = f(g(b)) = Id_B(b) = b$. Then f is subjective.
• prove backward: assume 1-to-1, onto.

• onto: $(\exists a \in A)(f(a) = b)$ -> at least one f(a) = b, fix such a
• 1-to-1: $(\forall x \in A)(x \neq a \implies f(x) \neq f(a) = b)$ -> at most one f(a) = b
• define $g = \{ (b, a) \in B \times A | f(a) = b\}$
• so g is a well defined
• let $a = g(b)$, then $f(a) = b$, then $f(g(b)) = b$ then $f \circ g = id_B$
• let $b = f(a)$, then $g(b) = a$, then $g(f(a)) = a$ then $g \circ f = id_A$
• $g = f^{-1}$

Corollary: if f is invertible, then f^-1 is unique

## Prove Bijection by Proving Invertible

Claim: $f: \mathbb{R} / \{3\} \to \mathbb{R} / \{1\}$ is a bijection by $f(x) = \frac{x-2}{x-3}$

Scratch:

• solve $x = \frac{3y - 2}{y - 1}$

• so $x \neq 3 \land y \neq 1$

Proof:

• define $g(x) = \frac{3x - 2}{x - 1}$

• observe $(\forall x \in \mathbb{R} \ \{1\})(g(x) \in \mathbb{R})$ because $x \neq 1$

• observe $g(x) \neq 3$ because $g(x)=3 \iff \frac{3x-2}{x-1} = 3 \iff 3x-2=3x-3 \iff -2=-3$

• so g is well-defined

• then $g(f(x)) = \frac{3\frac{3-2}{x-3}-2}{\frac{x-2}{x-3}-1} = x$ so $g \circ f = id_{\mathbb{R} \ \{3\}}$ holds

• show the same thing for $f(g(x))$

• f is invertible -> f is a bijection

Table of Content