Topology (Munkres)
Standard Library: Functions
$f$ is a function iff $f$ is right-unique and $f$ is a relation.
LaTeX source
\begin{abbreviation}
\label{function}
$f$ is a function iff $f$ is right-unique and $f$ is a relation.
\end{abbreviation}
$\apply{f}{x} = \unions{\img{f}{\{x\}}}$.
LaTeX source
\begin{definition}
\label{apply}
$\apply{f}{x} = \unions{\img{f}{\{x\}}}$.
\end{definition}
Let $f$ be a function.
Suppose $(a,b), (a, b')\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then $b = b'$.
LaTeX source
\begin{proposition}
\label{function_rightunique}
Let $f$ be a function.
Suppose $(a,b), (a, b')\in f$.
Then $b = b'$.
\end{proposition}
Proof
Follows by Definition 51.
LaTeX source
\begin{proof}
Follows by \cref{rightunique}.
\end{proof}
Let $f$ be a function.
Suppose $(a,b)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then $f(a) = b$.
LaTeX source
\begin{proposition}
\label{function_apply_intro}
Let $f$ be a function.
Suppose $(a,b)\in f$.
Then $f(a) = b$.
\end{proposition}
Proof
Let $B = \img{f}{\{a\}}$.
$B = \{b'\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}\mid (a,b')\class{latex-symbol-tip latex-symbol-id-in}{\in} f \}$ by Proposition 244.
$b\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$.
For all $b'\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ we have $(a, b')\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
For all $b', b''\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ we have $b' = b''$ by Definition 51.
Then $B = \{b\}$ by Proposition 24.
Then $\unions{B} = b$.
Thus $f(a) = b$ by Definition 54.
LaTeX source
\begin{proof}
Let $B = \img{f}{\{a\}}$.
$B = \{b'\in\ran{f}\mid (a,b')\in f \}$ by \cref{img_singleton}.
$b\in\ran{f}$.
For all $b'\in B$ we have $(a, b')\in f$.
For all $b', b''\in B$ we have $b' = b''$ by \cref{rightunique}.
Then $B = \{b\}$ by \cref{singleton_iff_inhabited_subsingleton}.
Then $\unions{B} = b$.
Thus $f(a) = b$ by \cref{apply}.
\end{proof}
Let $f$ be a function.
Suppose $w\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then there exists $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $w = (x, f(x))$.
LaTeX source
\begin{proposition}
\label{function_member_elim}
Let $f$ be a function.
Suppose $w\in f$.
Then there exists $x\in\dom{f}$ such that $w = (x, f(x))$.
\end{proposition}
Proof
Follows by Definition 12, Definition 15, Definition 54, Proposition 346.
LaTeX source
\begin{proof}
Follows by \cref{apply,function_apply_intro,dom,relation}.
\end{proof}
Let $f$ be a function.
Suppose $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$.
Then $(x,f(x))\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
LaTeX source
\begin{proposition}
\label{function_apply_elim}
Let $f$ be a function.
Suppose $x\in\dom{f}$.
Then $(x,f(x))\in f$.
\end{proposition}
Proof
Follows by Proposition 199, Proposition 346.
LaTeX source
\begin{proof}
Follows by \cref{dom_iff,function_apply_intro}.
\end{proof}
Let $f$ be a function.
$(a,b)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ iff $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ and $f(a) = b$.
LaTeX source
\begin{proposition}
\label{function_apply_iff}
Let $f$ be a function.
$(a,b)\in f$ iff $a\in\dom{f}$ and $f(a) = b$.
\end{proposition}
Let $f, g$ be functions.
Suppose $\dom{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} \dom{g}$.
Suppose for all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $f(x) = g(x)$.
Then $f\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} g$.
LaTeX source
\begin{proposition}
\label{fun_subseteq}
Let $f, g$ be functions.
Suppose $\dom{f}\subseteq \dom{g}$.
Suppose for all $x\in\dom{f}$ we have $f(x) = g(x)$.
Then $f\subseteq g$.
\end{proposition}
Proof
For all $x,y$ such that $(x,y)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ we have $(x,y)\class{latex-symbol-tip latex-symbol-id-in}{\in} g$ by Definition 1, Definition 15, Definition 54, Proposition 346, Proposition 348.
Follows by Definition 1, Definition 12.
LaTeX source
\begin{proof}
For all $x,y$ such that $(x,y)\in f$ we have $(x,y)\in g$ by \cref{dom,function_apply_intro,function_apply_elim,apply,subseteq}.
Follows by \cref{subseteq,relation}.
\end{proof}
Let $f, g$ be functions.
Suppose $\dom{f} = \dom{g}$.
Suppose for all $x$ we have $f(x) = g(x)$.
Then $f = g$.
LaTeX source
\begin{proposition}
[Function extensionality]\label{funext}
Let $f, g$ be functions.
Suppose $\dom{f} = \dom{g}$.
Suppose for all $x$ we have $f(x) = g(x)$.
Then $f = g$.
\end{proposition}
Proof
$\dom{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} \dom{g}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} \dom{f}$.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $f(x) = g(x)$.
Thus $f\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} g$.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{g}$ we have $f(x) = g(x)$.
Thus $g\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f$.
LaTeX source
\begin{proof}
$\dom{f}\subseteq \dom{g}\subseteq \dom{f}$.
For all $x\in\dom{f}$ we have $f(x) = g(x)$.
Thus $f\subseteq g$.
For all $x\in\dom{g}$ we have $f(x) = g(x)$.
Thus $g\subseteq f$.
\end{proof}
Let $f$ be a function.
$b\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$ iff there exists $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $f(a) = b$.
LaTeX source
\begin{proposition}
\label{fun_ran_iff}
Let $f$ be a function.
$b\in\ran{f}$ iff there exists $a\in\dom{f}$ such that $f(a) = b$.
\end{proposition}
Proof
Follows by Definition 16, Proposition 349.
LaTeX source
\begin{proof}
Follows by \cref{ran,function_apply_iff}.
\end{proof}
$f$ is a function on $X$ iff $f$ is a function and $X = \dom{f}$.
LaTeX source
\begin{abbreviation}
\label{function_on}
$f$ is a function on $X$ iff $f$ is a function and $X = \dom{f}$.
\end{abbreviation}
$f$ is a function to $Y$ iff $f$ is a function and for all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $f(x)\class{latex-symbol-tip latex-symbol-id-in}{\in} Y$.
LaTeX source
\begin{abbreviation}
\label{function_to}
$f$ is a function to $Y$ iff $f$ is a function and for all $x\in\dom{f}$ we have $f(x)\in Y$.
\end{abbreviation}
Let $f$ be a function to $B$.
Suppose $B\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} C$.
Then $f$ is a function to $C$.
LaTeX source
\begin{proposition}
\label{function_on_weaken_codom}
Let $f$ be a function to $B$.
Suppose $B\subseteq C$.
Then $f$ is a function to $C$.
\end{proposition}
Let $f$ be a function to $B$.
Then $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} B$.
LaTeX source
\begin{proposition}
\label{function_to_ran}
Let $f$ be a function to $B$.
Then $\ran{f}\subseteq B$.
\end{proposition}
Proof
Follows by Axiom 6, Definition 1, Definition 15, Definition 16, Definition 54, Proposition 347.
LaTeX source
\begin{proof}
Follows by \cref{ran,subseteq,apply,function_member_elim,pair_eq_iff,dom}.
\end{proof}
$\funs{A}{B} = \{ f\class{latex-symbol-tip latex-symbol-id-in}{\in}\rels{A}{B}\mid \text{$A= \dom{f}$ and $f$ is right-unique}\}$.
LaTeX source
\begin{definition}
\label{funs}
$\funs{A}{B} = \{ f\in\rels{A}{B}\mid \text{$A= \dom{f}$ and $f$ is right-unique}\}$.
\end{definition}
$f$ is a function from $X$ to $Y$ iff $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{X}{Y}$.
LaTeX source
\begin{abbreviation}
\label{function_from_to}
$f$ is a function from $X$ to $Y$ iff $f\in\funs{X}{Y}$.
\end{abbreviation}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Then $f$ is a relation.
LaTeX source
\begin{proposition}
\label{funs_is_relation}
Let $f\in\funs{A}{B}$.
Then $f$ is a relation.
\end{proposition}
Proof
Follows by Definition 55, Proposition 285.
LaTeX source
\begin{proof}
Follows by \cref{funs,rels_is_relation}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Then $f$ is a function.
LaTeX source
\begin{proposition}
\label{funs_is_function}
Let $f\in\funs{A}{B}$.
Then $f$ is a function.
\end{proposition}
$\funs{A}{B}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq}\rels{A}{B}$.
LaTeX source
\begin{proposition}
\label{funs_subseteq_rels}
$\funs{A}{B}\subseteq\rels{A}{B}$.
\end{proposition}
Proof
Follows by Definition 1, Definition 55.
LaTeX source
\begin{proof}
Follows by \cref{funs,subseteq}.
\end{proof}
Let $f$ be a function to $B$ such that $A=\dom{f}$.
Then $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
LaTeX source
\begin{proposition}
\label{funs_intro}
Let $f$ be a function to $B$ such that $A=\dom{f}$.
Then $f\in\funs{A}{B}$.
\end{proposition}
Proof
$\dom{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} A$ by Proposition 2.
$\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} B$ by Proposition 354.
Thus $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\rels{A}{B}$ by Proposition 281.
Thus $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$ by Definition 55.
LaTeX source
\begin{proof}
$\dom{f}\subseteq A$ by \cref{subseteq_refl}.
$\ran{f}\subseteq B$ by \cref{function_to_ran}.
Thus $f\in\rels{A}{B}$ by \cref{rels_intro_dom_and_ran}.
Thus $f\in\funs{A}{B}$ by \cref{funs}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Then $f$ is a function to $B$ such that $A= \dom{f}$.
LaTeX source
\begin{proposition}
\label{funs_elim}
Let $f\in\funs{A}{B}$.
Then $f$ is a function to $B$ such that $A= \dom{f}$.
\end{proposition}
Proof
$f$ is a function by Proposition 356.
It suffices to show that for all $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $f(a)\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ by Definition 55.
Fix $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$.
Take $b$ such that $f(a) = b$.
Thus $(a,b)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ by Proposition 348.
Now $b\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$ by Proposition 208.
Finally $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} B$ by Definition 55, Proposition 284.
LaTeX source
\begin{proof}
$f$ is a function by \cref{funs_is_function}.
It suffices to show that for all $a\in\dom{f}$ we have $f(a)\in B$ by \cref{funs}.
Fix $a\in\dom{f}$.
Take $b$ such that $f(a) = b$.
Thus $(a,b)\in f$ by \cref{function_apply_elim}.
Now $b\in\ran{f}$ by \cref{ran_iff}.
Finally $\ran{f}\subseteq B$ by \cref{funs,rels_ran_subseteq}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Suppose $B\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} D$.
Then $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{D}$.
LaTeX source
\begin{proposition}
\label{funs_weaken_codom}
Let $f\in\funs{A}{B}$.
Suppose $B\subseteq D$.
Then $f\in\funs{A}{D}$.
\end{proposition}
Proof
$f\class{latex-symbol-tip latex-symbol-id-in}{\in}\rels{A}{D}$ by Definition 55, Proposition 287.
Follows by Definition 55.
LaTeX source
\begin{proof}
$f\in\rels{A}{D}$ by \cref{funs,rels_weaken_codom}.
Follows by \cref{funs}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Let $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$.
Then $f(a)\class{latex-symbol-tip latex-symbol-id-in}{\in} B$.
LaTeX source
\begin{proposition}
\label{funs_type_apply}
Let $f\in\funs{A}{B}$.
Let $a\in A$.
Then $f(a)\in B$.
\end{proposition}
Proof
$(a,f(a)) \class{latex-symbol-tip latex-symbol-id-in}{\in} f$ by Proposition 349, Proposition 359.
Thus $f(a)\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ by Definition 55, Proposition 290.
LaTeX source
\begin{proof}
$(a,f(a)) \in f$ by \cref{funs_elim,function_apply_iff}.
Thus $f(a)\in B$ by \cref{funs,rels_type_ran}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Let $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$.
Then there exists $b\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ such that $(a,b)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
LaTeX source
\begin{proposition}
\label{funs_tuple_intro}
Let $f\in\funs{A}{B}$.
Let $a\in A$.
Then there exists $b\in B$ such that $(a,b)\in f$.
\end{proposition}
Proof
$(a,f(a)) \class{latex-symbol-tip latex-symbol-id-in}{\in} f$ by Proposition 349, Proposition 359.
$f(a)\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ by Proposition 361.
LaTeX source
\begin{proof}
$(a,f(a)) \in f$ by \cref{funs_elim,function_apply_iff}.
$f(a)\in B$ by \cref{funs_type_apply}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Then $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} B$.
LaTeX source
\begin{proposition}
\label{funs_ran}
Let $f\in\funs{A}{B}$.
Then $\ran{f}\subseteq B$.
\end{proposition}
Proof
$f$ is a function to $B$.
LaTeX source
\begin{proof}
$f$ is a function to $B$.
\end{proof}
Image of a function
Let $f$ be a function.
Suppose $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}\inter X$.
Then $f(x)\class{latex-symbol-tip latex-symbol-id-in}{\in} \img{f}{X}$.
LaTeX source
\begin{proposition}
\label{img_of_function_intro}
Let $f$ be a function.
Suppose $x\in\dom{f}\inter X$.
Then $f(x)\in \img{f}{X}$.
\end{proposition}
Proof
$x\class{latex-symbol-tip latex-symbol-id-in}{\in} X$ by Proposition 63.
Thus $(x,f(x))\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ by Proposition 62, Proposition 348.
LaTeX source
\begin{proof}
$x\in X$ by \cref{inter_elim_right}.
Thus $(x,f(x))\in f$ by \cref{function_apply_elim,inter_elim_left}.
\end{proof}
Let $f$ be a function.
Suppose $y\class{latex-symbol-tip latex-symbol-id-in}{\in} \img{f}{X}$.
Then there exists $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}\inter X$ such that $y = f(x)$.
LaTeX source
\begin{proposition}
\label{img_of_function_elim}
Let $f$ be a function.
Suppose $y\in \img{f}{X}$.
Then there exists $x\in\dom{f}\inter X$ such that $y = f(x)$.
\end{proposition}
Proof
Take $x\class{latex-symbol-tip latex-symbol-id-in}{\in} X$ such that $(x,y)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ and $y = f(x)$ by Proposition 200, Proposition 349.
LaTeX source
\begin{proof}
Take $x\in X$ such that $(x,y)\in f$.
Then $x\in\dom{f}$ and $y = f(x)$ by \cref{dom_intro,function_apply_iff}.
\end{proof}
Suppose $f$ is a function.
$\img{f}{X} = \{ f(x) \mid x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}\inter X\}$.
LaTeX source
\begin{proposition}
\label{img_of_function}
Suppose $f$ is a function.
$\img{f}{X} = \{ f(x) \mid x\in\dom{f}\inter X\}$.
\end{proposition}
Proof
Follows by Proposition 364, Proposition 365.
LaTeX source
\begin{proof}
Follows by \cref{img_of_function_intro,img_of_function_elim}.
\end{proof}
Families of functions
$F$ is a family of functions iff every element of $F$ is a function.
LaTeX source
\begin{abbreviation}
\label{family_of_functions}
$F$ is a family of functions iff
every element of $F$ is a function.
\end{abbreviation}
Let $F$ be a family of functions.
Suppose that for all $f,g \class{latex-symbol-tip latex-symbol-id-in}{\in} F$ we have $f\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} g$ or $g\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f$.
Then $\unions{F}$ is a function.
LaTeX source
\begin{proposition}
\label{unions_of_compatible_family_of_function_is_function}
Let $F$ be a family of functions.
Suppose that for all $f,g \in F$ we have $f\subseteq g$ or $g\subseteq f$.
Then $\unions{F}$ is a function.
\end{proposition}
Proof
$\unions{F}$ is a relation by Proposition 178.
For all $x,y, y'$ such that $(x,y),(x,y')\class{latex-symbol-tip latex-symbol-id-in}{\in} \unions{F}$ there exists $f\class{latex-symbol-tip latex-symbol-id-in}{\in} F$ such that $(x,y),(x,y')\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ by Axiom 4, Definition 1.
Thus $\unions{F}$ is right-unique by Definition 51.
LaTeX source
\begin{proof}
$\unions{F}$ is a relation by \cref{unions_of_family_of_relations_is_relation}.
For all $x,y, y'$ such that $(x,y),(x,y')\in \unions{F}$
there exists $f\in F$ such that $(x,y),(x,y')\in f$
by \cref{unions_iff,subseteq}.
Thus $\unions{F}$ is right-unique by \cref{rightunique}.
\end{proof}
The empty function
$\class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$ is a function.
LaTeX source
\begin{proposition}
\label{emptyset_is_function}
$\emptyset$ is a function.
\end{proposition}
$\class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$ is a function on $\class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$.
LaTeX source
\begin{proposition}
\label{emptyset_is_function_on_emptyset}
$\emptyset$ is a function on $\emptyset$.
\end{proposition}
$\class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$ is a function to $X$.
LaTeX source
\begin{proposition}
\label{codom_of_emptyset_can_be_anything}
$\emptyset$ is a function to $X$.
\end{proposition}
$\class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$ is injective.
LaTeX source
\begin{proposition}
\label{emptyset_is_injective}
$\emptyset$ is injective.
\end{proposition}
Function composition
$g$ is composable with $f$ iff $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} \dom{g}$.
LaTeX source
\begin{abbreviation}
\label{composable}
$g$ is composable with $f$ iff $\ran{f}\subseteq \dom{g}$.
\end{abbreviation}
Suppose $f$ and $g$ are right-unique.
Then $g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is a function.
LaTeX source
\begin{proposition}
\label{function_circ}
Suppose $f$ and $g$ are right-unique.
Then $g\circ f$ is a function.
\end{proposition}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Let $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$.
Then $(g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f)(x) = g(f(x))$.
LaTeX source
\begin{proposition}
\label{circ_apply}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Let $x\in\dom{f}$.
Then $(g\circ f)(x) = g(f(x))$.
\end{proposition}
Proof
$(x, g(f(x)))\class{latex-symbol-tip latex-symbol-id-in}{\in} g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ by Definition 1, Definition 16, Definition 22, Proposition 348.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is a function by Proposition 372.
Thus $(g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f)(x) = g(f(x))$ by Proposition 346.
LaTeX source
\begin{proof}
$(x, g(f(x)))\in g\circ f$ by \cref{circ,ran,subseteq,function_apply_elim}.
$g\circ f$ is a function by \cref{function_circ}.
Thus $(g\circ f)(x) = g(f(x))$ by \cref{function_apply_intro}.
\end{proof}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
$\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f} = \preimg{f}{\dom{g}}$.
LaTeX source
\begin{proposition}
\label{dom_of_circ}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
$\dom{g\circ f} = \preimg{f}{\dom{g}}$.
\end{proposition}
Proof
Every element of $\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}$ is an element of $\preimg{f}{\dom{g}}$ by Axiom 6, Definition 15, Definition 19, Definition 22.
Follows by set extensionality.
LaTeX source
\begin{proof}
Every element of $\dom{g\circ f}$ is an element of $\preimg{f}{\dom{g}}$
by \cref{preimg,circ,dom,pair_eq_iff}.
Follows by set extensionality.
\end{proof}
Let $f, g$ be functions.
Suppose $\ran{f} = \dom{g}$.
$\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f} = \dom{f}$.
LaTeX source
\begin{proposition}
\label{dom_circ_exact}
Let $f, g$ be functions.
Suppose $\ran{f} = \dom{g}$.
$\dom{g\circ f} = \dom{f}$.
\end{proposition}
Proof
Every element of $\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}$ is an element of $\dom{f}$.
Follows by set extensionality.
LaTeX source
\begin{proof}
Every element of $\dom{g\circ f}$ is an element of $\dom{f}$.
Follows by set extensionality.
\end{proof}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Suppose $y\class{latex-symbol-tip latex-symbol-id-in}{\in} \img{g}{\ran{f}}$.
Then $y\class{latex-symbol-tip latex-symbol-id-in}{\in} \ran{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}$.
LaTeX source
\begin{proposition}
\label{ran_of_circ_intro}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Suppose $y\in \img{g}{\ran{f}}$.
Then $y\in \ran{g\circ f}$.
\end{proposition}
Proof
Take $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$ such that $(x, y)\class{latex-symbol-tip latex-symbol-id-in}{\in} g$.
Take $x'\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $(x', x)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then $(x', y) \class{latex-symbol-tip latex-symbol-id-in}{\in} g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$.
Follows by Proposition 209.
LaTeX source
\begin{proof}
Take $x\in\ran{f}$ such that $(x, y)\in g$.
Take $x'\in\dom{f}$ such that $(x', x)\in f$.
Then $(x', y) \in g\circ f$.
Follows by \cref{ran_intro}.
\end{proof}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Suppose $y\class{latex-symbol-tip latex-symbol-id-in}{\in} \ran{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}$.
Then $y\class{latex-symbol-tip latex-symbol-id-in}{\in} \img{g}{\ran{f}}$.
LaTeX source
\begin{proposition}
\label{ran_of_circ_elim}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Suppose $y\in \ran{g\circ f}$.
Then $y\in \img{g}{\ran{f}}$.
\end{proposition}
Proof
Take $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $(x, y)\class{latex-symbol-tip latex-symbol-id-in}{\in} g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ by Definition 15, Definition 16, Definition 22, Proposition 257.
$f(x)\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$.
$(f(x), y)\class{latex-symbol-tip latex-symbol-id-in}{\in} g$ by Definition 54, Proposition 257, Proposition 346.
Follows by Proposition 235.
LaTeX source
\begin{proof}
Take $x\in\dom{f}$ such that $(x, y)\in g\circ f$
by \cref{circ,circ_iff,ran,dom}.
$f(x)\in\ran{f}$.
$(f(x), y)\in g$
by \cref{function_apply_intro,apply,circ_iff}.
Follows by \cref{img_iff}.
\end{proof}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Then $\ran{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f} = \img{g}{\ran{f}}$.
LaTeX source
\begin{proposition}
\label{ran_of_circ}
Let $f, g$ be functions.
Suppose $g$ is composable with $f$.
Then $\ran{g\circ f} = \img{g}{\ran{f}}$.
\end{proposition}
Proof
Follows by set extensionality.
LaTeX source
\begin{proof}
Follows by set extensionality.
\end{proof}
Let $f, g$ be functions.
Suppose $\ran{f} = \dom{g}$.
Then $\ran{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f} = \ran{g}$.
LaTeX source
\begin{proposition}
\label{ran_circ_exact}
Let $f, g$ be functions.
Suppose $\ran{f} = \dom{g}$.
Then $\ran{g\circ f} = \ran{g}$.
\end{proposition}
Proof
\begin{align*} \ran{g\circ f} &= \img{g}{\ran{f}} \explanation{by Proposition 2, Proposition 378}\\ &= \img{g}{\dom{g}} \\ &= \ran{g} \explanation{by Proposition 238} \end{align*}
LaTeX source
\begin{proof}
\begin{align*}
\ran{g\circ f}
&= \img{g}{\ran{f}}
\explanation{by \cref{subseteq_refl,ran_of_circ}}\\
&= \img{g}{\dom{g}}
\\
&= \ran{g}
\explanation{by \cref{img_dom}}
\end{align*}
\end{proof}
Let $f, g$ be functions.
Let $A$ be a set.
Suppose $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} \dom{g}$.
Suppose $c\class{latex-symbol-tip latex-symbol-id-in}{\in}\img{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}{A}$.
Then $c\class{latex-symbol-tip latex-symbol-id-in}{\in}\img{g}{\img{f}{A}}$.
LaTeX source
\begin{proposition}
\label{img_of_circ_elim}
Let $f, g$ be functions.
Let $A$ be a set.
Suppose $\ran{f}\subseteq \dom{g}$.
Suppose $c\in\img{g\circ f}{A}$.
Then $c\in\img{g}{\img{f}{A}}$.
\end{proposition}
Proof
Take $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ such that $(a,c)\class{latex-symbol-tip latex-symbol-id-in}{\in} g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$.
Take $b$ such that $(a,b)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ and $(b, c)\class{latex-symbol-tip latex-symbol-id-in}{\in} g$.
Then $b\class{latex-symbol-tip latex-symbol-id-in}{\in}\img{f}{A}$.
Follows by Proposition 235.
LaTeX source
\begin{proof}
Take $a\in A$ such that $(a,c)\in g\circ f$.
Take $b$ such that $(a,b)\in f$ and $(b, c)\in g$.
Then $b\in\img{f}{A}$.
Follows by \cref{img_iff}.
\end{proof}
Let $f, g$ be functions.
Let $A$ be a set.
Suppose $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq}\dom{g}$.
Then $\img{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}{A} = \img{g}{\img{f}{A}}$.
LaTeX source
\begin{proposition}
\label{img_of_circ}
Let $f, g$ be functions.
Let $A$ be a set.
Suppose $\ran{f}\subseteq\dom{g}$.
Then $\img{g\circ f}{A} = \img{g}{\img{f}{A}}$.
\end{proposition}
Proof
For all $c$ we have $c\class{latex-symbol-tip latex-symbol-id-in}{\in}\img{g}{\img{f}{A}}$ iff $c\class{latex-symbol-tip latex-symbol-id-in}{\in}\img{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}{A}$ by Proposition 235, Proposition 257.
Follows byAxiom 1 [Set extensionality].
LaTeX source
\begin{proof}
For all $c$ we have $c\in\img{g}{\img{f}{A}}$
iff $c\in\img{g\circ f}{A}$
by \cref{circ_iff,img_iff}.
Follows by\cref{setext}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Let $g\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{B}{C}$.
Then $g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{C}$.
LaTeX source
\begin{proposition}
\label{funs_circ}
Let $f\in\funs{A}{B}$.
Let $g\in\funs{B}{C}$.
Then $g\circ f\in\funs{A}{C}$.
\end{proposition}
Proof
$\dom{f} = A$ by Definition 55.
$\dom{g} = B$ by Definition 55.
$f$ is a function and $g$ is a function by Proposition 356.
$g$ is composable with $f$.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is a function by Proposition 356, Proposition 372.
$\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f} = A$ by set extensionality.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ we have $f(x)\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ by Proposition 361.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ we have $g(f(x))\class{latex-symbol-tip latex-symbol-id-in}{\in} C$ by Proposition 361.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ we have $(g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f)(x)=g(f(x))$ by Proposition 373.
Thus for all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}$ we have $(g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f)(x)\class{latex-symbol-tip latex-symbol-id-in}{\in} C$.
Thus $g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is a function to $C$.
Follows by Proposition 358.
LaTeX source
\begin{proof}
$\dom{f} = A$ by \cref{funs}.
$\dom{g} = B$ by \cref{funs}.
$f$ is a function and $g$ is a function by \cref{funs_is_function}.
$g$ is composable with $f$.
$g\circ f$ is a function by \cref{function_circ,funs_is_function}.
$\dom{g\circ f} = A$ by set extensionality.
For all $x\in A$ we have $f(x)\in B$ by \cref{funs_type_apply}.
For all $x\in A$ we have $g(f(x))\in C$ by \cref{funs_type_apply}.
For all $x\in A$ we have $(g\circ f)(x)=g(f(x))$ by \cref{circ_apply}.
Thus for all $x\in\dom{g\circ f}$ we have $(g\circ f)(x)\in C$.
Thus $g\circ f$ is a function to $C$.
Follows by \cref{funs_intro}.
\end{proof}
Function restriction
Let $f$ be a function.
Let $A$ be a set.
$\restrl{f}{A}$ is a function.
LaTeX source
\begin{proposition}
\label{restrl_of_function_is_function}
Let $f$ be a function.
Let $A$ be a set.
$\restrl{f}{A}$ is a function.
\end{proposition}
Let $f$ be a function.
Suppose $A\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq}\dom{f}$.
Let $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$.
Then $(\restrl{f}{A})(a) = f(a)$.
LaTeX source
\begin{proposition}
\label{restrl_of_function_apply}
Let $f$ be a function.
Suppose $A\subseteq\dom{f}$.
Let $a\in A$.
Then $(\restrl{f}{A})(a) = f(a)$.
\end{proposition}
Proof
Then $(a,f(a))\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then $(a,f(a))\class{latex-symbol-tip latex-symbol-id-in}{\in} \restrl{f}{A}$ by Proposition 262.
Thus $(\restrl{f}{A})(a) = f(a)$.
LaTeX source
\begin{proof}
Then $(a,f(a))\in f$.
Then $(a,f(a))\in \restrl{f}{A}$ by \cref{restrl_iff}.
Thus $(\restrl{f}{A})(a) = f(a)$.
\end{proof}
Suppose $x\class{latex-symbol-tip latex-symbol-id-notin}{\notin}\dom{f}$.
Then $f(x) = \class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$.
LaTeX source
\begin{proposition}
\label{function_apply_default}
Suppose $x\notin\dom{f}$.
Then $f(x) = \emptyset$.
\end{proposition}
Proof
$\img{f}{\{x\}} = \class{latex-symbol-tip latex-symbol-id-emptyset}{\emptyset}$ by Axiom 1 [Set extensionality], Axiom 2, Proposition 200, Proposition 242.
Follows by Definition 54, Proposition 28.
LaTeX source
\begin{proof}
$\img{f}{\{x\}} = \emptyset$ by \cref{setext,emptyset,img_singleton_iff,dom_intro}.
Follows by \cref{apply,unions_emptyset}.
\end{proof}
Injections
Suppose $f$ is a function.
$f$ is injective iff for all $x,y\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $f(x) = f(y) \class{latex-symbol-tip latex-symbol-id-implies}{\implies} x = y$.
LaTeX source
\begin{proposition}
\label{injective_function}
Suppose $f$ is a function.
$f$ is injective iff for all $x,y\in\dom{f}$ we have $f(x) = f(y) \implies x = y$.
\end{proposition}
Proof
Follows by Definition 50, Proposition 349.
LaTeX source
\begin{proof}
Follows by \cref{injective,function_apply_iff}.
\end{proof}
$f$ is an injection iff $f$ is an injective function.
LaTeX source
\begin{abbreviation}
\label{injection}
$f$ is an injection iff $f$ is an injective function.
\end{abbreviation}
$\inj{A}{B} = \{f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}\mid \text{for all $x,y\in A$ such that $f(x)=f(y)$ we have $x = y$}\}$.
LaTeX source
\begin{definition}
\label{inj}
$\inj{A}{B} = \{f\in\funs{A}{B}\mid \text{for all $x,y\in A$ such that $f(x)=f(y)$ we have $x = y$}\}$.
\end{definition}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\inj{A}{B}$.
Let $g\class{latex-symbol-tip latex-symbol-id-in}{\in}\inj{B}{C}$.
Then $g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f\class{latex-symbol-tip latex-symbol-id-in}{\in}\inj{A}{C}$.
LaTeX source
\begin{proposition}
\label{inj_circ}
Let $f\in\inj{A}{B}$.
Let $g\in\inj{B}{C}$.
Then $g\circ f\in\inj{A}{C}$.
\end{proposition}
Proof
$f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$ and $g\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{B}{C}$ by Definition 56.
$f$ is a function and $g$ is a function by Proposition 356.
$\dom{f}=A$ and $\dom{g}=B$ by Definition 55.
$f$ is injective and $g$ is injective by Definition 56, Proposition 386.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{C}$ by Proposition 382.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is injective by Proposition 341.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is a function by Proposition 356.
$\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}=A$ by Definition 55.
Follows by Definition 55, Definition 56, Proposition 386.
LaTeX source
\begin{proof}
$f\in\funs{A}{B}$ and $g\in\funs{B}{C}$ by \cref{inj}.
$f$ is a function and $g$ is a function by \cref{funs_is_function}.
$\dom{f}=A$ and $\dom{g}=B$ by \cref{funs}.
$f$ is injective and $g$ is injective by \cref{inj,injective_function}.
$g\circ f\in\funs{A}{C}$ by \cref{funs_circ}.
$g\circ f$ is injective by \cref{circ_injective}.
$g\circ f$ is a function by \cref{funs_is_function}.
$\dom{g\circ f}=A$ by \cref{funs}.
Follows by \cref{inj,injective_function,funs}.
\end{proof}
Surjections
$f$ is a surjection onto $Y$ iff $f$ is a function such that $f$ is surjective on $Y$.
LaTeX source
\begin{abbreviation}
\label{surjection}
$f$ is a surjection onto $Y$ iff $f$ is a function such that $f$ is surjective on $Y$.
\end{abbreviation}
$\surj{A}{B} = \{f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}\mid \text{for all $b\in B$ there exists $a\in A$ such that $f(a) = b$}\}$.
LaTeX source
\begin{definition}
\label{surj}
$\surj{A}{B} = \{f\in\funs{A}{B}\mid \text{for all $b\in B$ there exists $a\in A$ such that $f(a) = b$}\}$.
\end{definition}
$f$ is a surjection from $A$ to $B$ iff $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{B}$.
LaTeX source
\begin{abbreviation}
\label{surjection_from_to}
$f$ is a surjection from $A$ to $B$ iff $f\in\surj{A}{B}$.
\end{abbreviation}
Let $f$ be a function.
Then $f$ is surjective on $\ran{f}$.
LaTeX source
\begin{lemma}
\label{surjection_ran}
Let $f$ be a function.
Then $f$ is surjective on $\ran{f}$.
\end{lemma}
Proof
It suffices to show that for all $y\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$ there exists $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $f(x) = y$.
Fix $y\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$.
Take $x$ such that $(x,y)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Then $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ and $f(x) = y$ by Definition 15, Proposition 349.
LaTeX source
\begin{proof}
It suffices to show that for all $y\in\ran{f}$ there exists $x\in\dom{f}$ such that $f(x) = y$.
Fix $y\in\ran{f}$.
Take $x$ such that $(x,y)\in f$.
Then $x\in\dom{f}$ and $f(x) = y$ by \cref{dom,function_apply_iff}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{B}$.
Then $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
LaTeX source
\begin{lemma}
\label{surj_to_fun}
Let $f\in\surj{A}{B}$.
Then $f\in\funs{A}{B}$.
\end{lemma}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Then $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{\ran{f}}$.
LaTeX source
\begin{lemma}
\label{fun_to_surj}
Let $f\in\funs{A}{B}$.
Then $f\in\surj{A}{\ran{f}}$.
\end{lemma}
Proof
$f\class{latex-symbol-tip latex-symbol-id-in}{\in}\rels{A}{\ran{f}}$ by Definition 55, Proposition 292.
Thus $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{\ran{f}}$ by Definition 55.
It suffices to show that for all $b\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$ there exists $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ such that $f(a) = b$ by Definition 57.
Fix $b\class{latex-symbol-tip latex-symbol-id-in}{\in}\ran{f}$.
Take $a$ such that $(a,b)\class{latex-symbol-tip latex-symbol-id-in}{\in} f$.
Thus $f(a)=b$ by Proposition 349, Proposition 359.
We have $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f} = A$.
Follows by assumption.
LaTeX source
\begin{proof}
$f\in\rels{A}{\ran{f}}$ by \cref{funs,rels_restrict_ran}.
Thus $f\in\funs{A}{\ran{f}}$ by \cref{funs}.
It suffices to show that for all $b\in\ran{f}$ there exists $a\in A$ such that $f(a) = b$ by \cref{surj}.
Fix $b\in\ran{f}$.
Take $a$ such that $(a,b)\in f$.
Thus $f(a)=b$ by \cref{function_apply_iff,funs_elim}.
We have $a\in\dom{f} = A$.
Follows by assumption.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{B}$.
Then $\ran{f} = B$.
LaTeX source
\begin{corollary}
\label{ran_of_surj}
Let $f\in\surj{A}{B}$.
Then $\ran{f} = B$.
\end{corollary}
Proof
We have $f$ is a function by Definition 57, Proposition 356.
Now $\ran{f}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} B$ by Definition 57, Proposition 363.
It suffices to show that every element of $B$ is an element of $\ran{f}$.
It suffices to show that for all $b\class{latex-symbol-tip latex-symbol-id-in}{\in} B$ there exists $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $f(a) = b$ by Proposition 352.
Fix $b\class{latex-symbol-tip latex-symbol-id-in}{\in} B$.
Take $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ such that $f(a) = b$ by Definition 57.
Now $A=\dom{f}$.
LaTeX source
\begin{proof}
We have $f$ is a function by \cref{surj,funs_is_function}.
Now $\ran{f}\subseteq B$ by \cref{surj,funs_ran}.
It suffices to show that every element of $B$ is an element of $\ran{f}$.
It suffices to show that for all $b\in B$
there exists $a\in\dom{f}$ such that $f(a) = b$ by \cref{fun_ran_iff}.
Fix $b\in B$.
Take $a\in A$ such that $f(a) = b$ by \cref{surj}.
Now $A=\dom{f}$.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$.
Then $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{B}$ iff $\ran{f} = B$.
LaTeX source
\begin{corollary}
\label{funs_surj_iff}
Let $f\in\funs{A}{B}$.
Then $f\in\surj{A}{B}$ iff $\ran{f} = B$.
\end{corollary}
Proof
Follows by Definition 57, Lemma 6, Corollary 7.
LaTeX source
\begin{proof}
Follows by \cref{surj,fun_to_surj,ran_of_surj}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{B}$.
Let $g\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{B}{C}$.
Then $g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{C}$.
LaTeX source
\begin{proposition}
\label{surjections_circ}
Let $f\in\surj{A}{B}$.
Let $g\in\surj{B}{C}$.
Then $g\circ f\in\surj{A}{C}$.
\end{proposition}
Proof
$\dom{f} = A$ by Definition 55, Definition 57.
$\dom{g} = B = \ran{f}$ by Definition 55, Definition 57, Corollary 7.
$\dom{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f} = A$ by Lemma 5, Proposition 356, Proposition 375.
$f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$ and $g\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{B}{C}$ by Lemma 5.
$f$ is a function and $g$ is a function by Proposition 356.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{C}$ by Proposition 382.
$\ran{g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f}=\ran{g}$ by Proposition 379.
$\ran{g}=C$ by Corollary 7.
Follows by Corollary 8.
LaTeX source
\begin{proof}
$\dom{f} = A$ by \cref{surj,funs}.
$\dom{g} = B = \ran{f}$ by \cref{surj,funs,ran_of_surj}.
$\dom{g\circ f} = A$ by \cref{surj_to_fun,funs_is_function,dom_circ_exact}.
$f\in\funs{A}{B}$ and $g\in\funs{B}{C}$ by \cref{surj_to_fun}.
$f$ is a function and $g$ is a function by \cref{funs_is_function}.
$g\circ f\in\funs{A}{C}$ by \cref{funs_circ}.
$\ran{g\circ f}=\ran{g}$ by \cref{ran_circ_exact}.
$\ran{g}=C$ by \cref{ran_of_surj}.
Follows by \cref{funs_surj_iff}.
\end{proof}
Bijections
$\bijections{A}{B} = \{ f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{B} \mid \text{$f$ is injective}\}$.
LaTeX source
\begin{definition}
\label{bijections}
$\bijections{A}{B} = \{ f\in\surj{A}{B} \mid \text{$f$ is injective}\}$.
\end{definition}
$f$ is a bijection from $A$ to $B$ iff $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\bijections{A}{B}$.
LaTeX source
\begin{abbreviation}
\label{bijection}
$f$ is a bijection from $A$ to $B$ iff $f\in\bijections{A}{B}$.
\end{abbreviation}
Every element of $\bijections{A}{B}$ is an element of $\funs{A}{B}$.
LaTeX source
\begin{proposition}
\label{bijections_to_funs}
Every element of $\bijections{A}{B}$ is an element of $\funs{A}{B}$.
\end{proposition}
Proof
Follows by Definition 57, Definition 58.
LaTeX source
\begin{proof}
Follows by \cref{bijections,surj}.
\end{proof}
Every element of $\bijections{A}{B}$ is a function.
LaTeX source
\begin{proposition}
\label{bijection_is_function}
Every element of $\bijections{A}{B}$ is a function.
\end{proposition}
Proof
Follows by Proposition 356, Proposition 389.
LaTeX source
\begin{proof}
Follows by \cref{bijections_to_funs,funs_is_function}.
\end{proof}
Let $f\class{latex-symbol-tip latex-symbol-id-in}{\in}\bijections{A}{B}$.
Then $\dom{f} = A$.
LaTeX source
\begin{proposition}
\label{bijections_dom}
Let $f\in\bijections{A}{B}$.
Then $\dom{f} = A$.
\end{proposition}
Proof
$f\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{B}$ by Proposition 389.
Follows by Definition 55.
LaTeX source
\begin{proof}
$f\in\funs{A}{B}$ by \cref{bijections_to_funs}.
Follows by \cref{funs}.
\end{proof}
Let $f$ be a bijection from $A$ to $B$.
Let $g$ be a bijection from $B$ to $C$.
Then $g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is a bijection from $A$ to $C$.
LaTeX source
\begin{proposition}
\label{bijection_circ}
Let $f$ be a bijection from $A$ to $B$.
Let $g$ be a bijection from $B$ to $C$.
Then $g\circ f$ is a bijection from $A$ to $C$.
\end{proposition}
Proof
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{C}$ by Definition 58, Proposition 388.
$g\class{latex-symbol-tip latex-symbol-id-circ}{\circ} f$ is injective by Definition 58, Proposition 341.
Follows by Definition 58.
LaTeX source
\begin{proof}
$g\circ f\in\surj{A}{C}$ by \cref{bijections,surjections_circ}.
$g\circ f$ is injective by \cref{bijections,circ_injective}.
Follows by \cref{bijections}.
\end{proof}
Converse as a function
Let $f$ be a function.
Then $\converse{f}$ is injective.
LaTeX source
\begin{proposition}
\label{converse_of_function_is_injective}
Let $f$ be a function.
Then $\converse{f}$ is injective.
\end{proposition}
Suppose $f$ is injective.
Then $\converse{f}$ is a function.
LaTeX source
\begin{proposition}
\label{injective_converse_is_function}
Suppose $f$ is injective.
Then $\converse{f}$ is a function.
\end{proposition}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}$ is a function.
LaTeX source
\begin{proposition}
\label{bijective_converse_is_function}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}$ is a function.
\end{proposition}
Proof
Follows by Definition 58, Proposition 394.
LaTeX source
\begin{proof}
Follows by \cref{bijections,injective_converse_is_function}.
\end{proof}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{B}{A}$.
LaTeX source
\begin{proposition}
\label{bijective_converse_are_funs}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}\in\funs{B}{A}$.
\end{proposition}
Proof
$\dom{\converse{f}} = \ran{f} = B$ by Definition 58, Proposition 217, Corollary 7.
$\converse{f}$ is a function by Proposition 395.
$\ran{\converse{f}}=\dom{f}=A$ by Proposition 218, Proposition 391.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{\converse{f}}$ we have $(\converse{f})(x)\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ by Proposition 352.
Thus $\converse{f}$ is a function to $A$.
Follows by Proposition 358.
LaTeX source
\begin{proof}
$\dom{\converse{f}} = \ran{f} = B$ by \cref{bijections,dom_converse,ran_of_surj}.
$\converse{f}$ is a function by \cref{bijective_converse_is_function}.
$\ran{\converse{f}}=\dom{f}=A$ by \cref{ran_converse,bijections_dom}.
For all $x\in\dom{\converse{f}}$ we have $(\converse{f})(x)\in A$
by \cref{fun_ran_iff}.
Thus $\converse{f}$ is a function to $A$.
Follows by \cref{funs_intro}.
\end{proof}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{B}{A}$.
LaTeX source
\begin{proposition}
\label{bijective_converse_are_surjs}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}\in\surj{B}{A}$.
\end{proposition}
Proof
We have $\converse{f}\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{B}{A}$ by Proposition 396.
It suffices to show that $\ran{\converse{f}} = A$ by Corollary 8.
We have $\dom{f} = A$ by Proposition 391.
Thus $\ran{\converse{f}} = A$ by Proposition 218.
LaTeX source
\begin{proof}
We have $\converse{f}\in\funs{B}{A}$ by \cref{bijective_converse_are_funs}.
It suffices to show that $\ran{\converse{f}} = A$ by \cref{funs_surj_iff}.
We have $\dom{f} = A$ by \cref{bijections_dom}.
Thus $\ran{\converse{f}} = A$ by \cref{ran_converse}.
\end{proof}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}$ is a bijection from $B$ to $A$.
LaTeX source
\begin{proposition}
\label{bijection_converse_is_bijection}
Let $f$ be a bijection from $A$ to $B$.
Then $\converse{f}$ is a bijection from $B$ to $A$.
\end{proposition}
Proof
$\converse{f}\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{B}{A}$ by Proposition 396.
$\converse{f}$ is injective by Proposition 390, Proposition 393.
$\converse{f}\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{B}{A}$ by Proposition 397.
Follows by Definition 58.
LaTeX source
\begin{proof}
$\converse{f}\in\funs{B}{A}$ by \cref{bijective_converse_are_funs}.
$\converse{f}$ is injective by \cref{bijection_is_function,converse_of_function_is_injective}.
$\converse{f}\in\surj{B}{A}$ by \cref{bijective_converse_are_surjs}.
Follows by \cref{bijections}.
\end{proof}
Inverses of a function
$g$ is a left inverse of $f$ iff for all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $g(f(x)) = x$.
LaTeX source
\begin{abbreviation}
\label{leftinverse}
$g$ is a left inverse of $f$ iff for all $x\in\dom{f}$ we have $g(f(x)) = x$.
\end{abbreviation}
$g$ is a right inverse of $f$ iff $f\class{latex-symbol-tip latex-symbol-id-circ}{\circ} g = \identity{\dom{g}}$.
LaTeX source
\begin{abbreviation}
\label{rightinverse}
$g$ is a right inverse of $f$ iff $f\circ g = \identity{\dom{g}}$.
\end{abbreviation}
$g$ is a right inverse of $f$ on $B$ iff $f\class{latex-symbol-tip latex-symbol-id-circ}{\circ} g = \identity{B}$.
LaTeX source
\begin{abbreviation}
\label{rightinverseon}
$g$ is a right inverse of $f$ on $B$ iff $f\circ g = \identity{B}$.
\end{abbreviation}
Let $f$ be an injection.
Then $\converse{f}$ is a left inverse of $f$.
LaTeX source
\begin{proposition}
\label{injective_converse_is_leftinverse}
Let $f$ be an injection.
Then $\converse{f}$ is a left inverse of $f$.
\end{proposition}
Proof
$\converse{f}$ is a function by Proposition 394.
$f$ is a function.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $(x,f(x))\class{latex-symbol-tip latex-symbol-id-in}{\in} f$ by Proposition 348.
For all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $(f(x),x)\class{latex-symbol-tip latex-symbol-id-in}{\in}\converse{f}$ by Proposition 186.
Thus for all $x\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ we have $(\converse{f})(f(x))=x$ by Proposition 346.
Follows by definition.
LaTeX source
\begin{proof}
$\converse{f}$ is a function by \cref{injective_converse_is_function}.
$f$ is a function.
For all $x\in\dom{f}$ we have $(x,f(x))\in f$
by \cref{function_apply_elim}.
For all $x\in\dom{f}$ we have $(f(x),x)\in\converse{f}$
by \cref{converse_iff}.
Thus for all $x\in\dom{f}$ we have $(\converse{f})(f(x))=x$
by \cref{function_apply_intro}.
Follows by definition.
\end{proof}
Identity function
$\identity{A}$ is right-unique.
LaTeX source
\begin{proposition}
\label{id_rightunique}
$\identity{A}$ is right-unique.
\end{proposition}
Proof
Follows by Axiom 6, Definition 25, Definition 51.
LaTeX source
\begin{proof}
Follows by \cref{id,rightunique,pair_eq_iff}.
\end{proof}
$\identity{A}$ is a function.
LaTeX source
\begin{proposition}
\label{id_is_function}
$\identity{A}$ is a function.
\end{proposition}
$\identity{A}$ is a function on $A$.
LaTeX source
\begin{proposition}
\label{id_is_function_on}
$\identity{A}$ is a function on $A$.
\end{proposition}
$\identity{A}$ is a function to $A$.
LaTeX source
\begin{proposition}
\label{id_is_function_to}
$\identity{A}$ is a function to $A$.
\end{proposition}
$\identity{A}$ is a function from $A$ to $A$.
LaTeX source
\begin{proposition}
\label{id_is_function_from_to}
$\identity{A}$ is a function from $A$ to $A$.
\end{proposition}
Proof
$\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\rels{A}{A}$ by Proposition 300.
Follows by Definition 55, Proposition 402, Proposition 403.
LaTeX source
\begin{proof}
$\identity{A}\in\rels{A}{A}$ by \cref{id_elem_rels}.
Follows by \cref{funs,id_is_function_on,id_is_function_to}.
\end{proof}
Suppose $a\class{latex-symbol-tip latex-symbol-id-in}{\in} A$.
Suppose $f = \identity{A}$.
Then $f(a) = a$.
LaTeX source
\begin{proposition}
\label{id_apply}
Suppose $a\in A$.
Suppose $f = \identity{A}$.
Then $f(a) = a$.
\end{proposition}
Proof
$(a,a)\class{latex-symbol-tip latex-symbol-id-in}{\in}\identity{A}$ by Proposition 293.
Follows by Proposition 346, Proposition 401.
LaTeX source
\begin{proof}
$(a,a)\in\identity{A}$ by \cref{id_iff}.
Follows by \cref{id_is_function,function_apply_intro}.
\end{proof}
$\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{A}$.
LaTeX source
\begin{proposition}
\label{id_elem_funs}
$\identity{A}\in\funs{A}{A}$.
\end{proposition}
Proof
$\identity{A}$ is a function.
$\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\rels{A}{A}$.
$\dom{\identity{A}}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} A$.
LaTeX source
\begin{proof}
$\identity{A}$ is a function.
$\identity{A}\in\rels{A}{A}$.
$\dom{\identity{A}}\subseteq A$.
\end{proof}
$\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{A}$.
LaTeX source
\begin{proposition}
\label{id_elem_surjections}
$\identity{A}\in\surj{A}{A}$.
\end{proposition}
Proof
We have $\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\funs{A}{A}$ by Proposition 406.
$\ran{\identity{A}}=A$ by Proposition 298.
Follows by Corollary 8.
LaTeX source
\begin{proof}
We have $\identity{A}\in\funs{A}{A}$ by \cref{id_elem_funs}.
$\ran{\identity{A}}=A$ by \cref{id_ran}.
Follows by \cref{funs_surj_iff}.
\end{proof}
$\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\bijections{A}{A}$.
LaTeX source
\begin{proposition}
\label{id_elem_bijections}
$\identity{A}\in\bijections{A}{A}$.
\end{proposition}
Proof
$\identity{A}\class{latex-symbol-tip latex-symbol-id-in}{\in}\surj{A}{A}$ by Proposition 407.
$\identity{A}$ is injective by Proposition 342.
Follows by Definition 58.
LaTeX source
\begin{proof}
$\identity{A}\in\surj{A}{A}$ by \cref{id_elem_surjections}.
$\identity{A}$ is injective by \cref{identity_injective}.
Follows by \cref{bijections}.
\end{proof}
Fixpoints
$a$ is a fixpoint of $f$ iff $a\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ and $f(a) = a$.
LaTeX source
\begin{definition}
\label{fixpoint}
$a$ is a fixpoint of $f$ iff $a\in\dom{f}$ and $f(a) = a$.
\end{definition}
$f$ is \subseteq-preserving iff for all $A, B\class{latex-symbol-tip latex-symbol-id-in}{\in}\dom{f}$ such that $A\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} B$ we have $f(A)\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f(B)$.
LaTeX source
\begin{definition}
\label{subseteqpreserving}
$f$ is \subseteq-preserving iff
for all $A, B\in\dom{f}$ such that $A\subseteq B$ we have $f(A)\subseteq f(B)$.
\end{definition}
Let $f$ be a \subseteq-preserving function from $\pow{A}$ to $\pow{A}$.
Then there exists a fixpoint of $f$.
LaTeX source
\begin{theorem}
[Knaster--Tarski]\label{knastertarski}
Let $f$ be a \subseteq-preserving function from $\pow{A}$ to $\pow{A}$.
Then there exists a fixpoint of $f$.
\end{theorem}
Proof
$\dom{f} = \pow{A}$.
Let $P = \{a\class{latex-symbol-tip latex-symbol-id-in}{\in}\pow{A}\mid a\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f(a)\}$.
$P\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq}\pow{A}$.
Thus $\unions{P}\class{latex-symbol-tip latex-symbol-id-in}{\in}\pow{A}$.
Hence $f(\unions{P})\class{latex-symbol-tip latex-symbol-id-in}{\in}\pow{A}$ by Proposition 361.
Claim: $\unions{P}\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f(\unions{P})$.
It suffices to show that every element of $\unions{P}$ is an element of $f(\unions{P})$.
Fix $u\class{latex-symbol-tip latex-symbol-id-in}{\in}\unions{P}$.
Take $p\class{latex-symbol-tip latex-symbol-id-in}{\in} P$ such that $u\class{latex-symbol-tip latex-symbol-id-in}{\in} p$.
Then $u\class{latex-symbol-tip latex-symbol-id-in}{\in} f(p)$.
$p\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq}\unions{P}$.
$f(p)\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f(\unions{P})$ by Definition 60.
Thus $u\class{latex-symbol-tip latex-symbol-id-in}{\in} f(\unions{P})$.
Now $f(\unions{P})\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} f(f(\unions{P}))$ by Definition 60.
Thus $f(\unions{P})\class{latex-symbol-tip latex-symbol-id-in}{\in} P$ by definition.
Hence $f(\unions{P})\class{latex-symbol-tip latex-symbol-id-subseteq}{\subseteq} \unions{P}$.
Thus $f(\unions{P}) = \unions{P}$ by Proposition 3.
Follows by Definition 59.
LaTeX source
\begin{proof}
$\dom{f} = \pow{A}$.
Let $P = \{a\in\pow{A}\mid a\subseteq f(a)\}$.
$P\subseteq\pow{A}$.
Thus $\unions{P}\in\pow{A}$.
Hence $f(\unions{P})\in\pow{A}$ by \cref{funs_type_apply}.
Show $\unions{P}\subseteq f(\unions{P})$.
\begin{subproof}
It suffices to show that every element of $\unions{P}$ is an element of $f(\unions{P})$.
Fix $u\in\unions{P}$.
Take $p\in P$ such that $u\in p$.
Then $u\in f(p)$.
$p\subseteq\unions{P}$.
$f(p)\subseteq f(\unions{P})$ by \cref{subseteqpreserving}.
Thus $u\in f(\unions{P})$.
\end{subproof}
Now $f(\unions{P})\subseteq f(f(\unions{P}))$ by \cref{subseteqpreserving}.
Thus $f(\unions{P})\in P$ by definition.
Hence $f(\unions{P})\subseteq \unions{P}$.
Thus $f(\unions{P}) = \unions{P}$ by \cref{subseteq_antisymmetric}.
Follows by \cref{fixpoint}.
\end{proof}
Cantor's theorem
There exists no surjection from $A$ to $\pow{A}$.
LaTeX source
\begin{theorem}
[Cantor]\label{cantor}
There exists no surjection from $A$ to $\pow{A}$.
\end{theorem}
Proof
Suppose not.
Consider a surjection $f$ from $A$ to $\pow{A}$.
Let $B = \{a \class{latex-symbol-tip latex-symbol-id-in}{\in} A \mid a\class{latex-symbol-tip latex-symbol-id-notin}{\notin} f(a)\}$.
Then $B\class{latex-symbol-tip latex-symbol-id-in}{\in}\pow{A}$.
There exists $a'\class{latex-symbol-tip latex-symbol-id-in}{\in} A$ such that $f(a') = B$ by Definition 57.
Now $a' \class{latex-symbol-tip latex-symbol-id-in}{\in} B$ iff $a' \class{latex-symbol-tip latex-symbol-id-notin}{\notin} f(a') = B$.
Contradiction.
LaTeX source
\begin{proof}
Suppose not.
Consider a surjection $f$ from $A$ to $\pow{A}$.
Let $B = \{a \in A \mid a\notin f(a)\}$.
Then $B\in\pow{A}$.
There exists $a'\in A$ such that $f(a') = B$ by \cref{surj}.
Now $a' \in B$ iff $a' \notin f(a') = B$.
Contradiction.
\end{proof}