%%============================
%% Appendix 4: List of Symbols
%%============================

\documentclass[../dissertation.tex]{subfiles}

\begin{document}

%%=====================
%% Fundamental Notation
%%=====================
\def\tabletitle{Fundamental Notation}
\subsection{\tabletitle}
\begin{indextable}{\tabletitle}
	$:=$ & defined to be; for example $a := b$ means ``$a$ is defined to be
			$b$''
			& p.\pageref{sym0:def} \\
		$\pv$ & Cauchy principle value; given by
			{
				\begin{teqn}
					\pv\int_{\mathbb R} f(x) \, \mathrm{d}x
						:= \lim_{\varepsilon \searrow 0} \int_{|x|>\varepsilon} f(x) \, \mathrm{d}x
				\end{teqn}
			}
			& p.\pageref{sym0:pv} \\
		\textit{a.e.} & abbreviation for almost everywhere & p.\pageref{sym:ae}\\
		$\mathbb R$ & the set of all real numbers & p.\pageref{sym:Reals} \\
		$\mathbb C$ & the set of all complex numbers & p.\pageref{sym:Complex} \\
		$\mathbb Z$ & the set of all integers &  \\
		$\chi_A$ & characteristic function on a set $A$; given by
				{\begin{teqn}
					\chi_A(x) :=
						\begin{cases}
							1, & x \in A \\
							0, & \text{otherwise}
						\end{cases}
				\end{teqn}}
			& p.\pageref{sym:chi} \\
		$m(\dotarg)$ & Lebesgue measure on $\mathbb R$ & p.\pageref{sym:lebesguemeasure} \\
		$\mathcal F$, $\hat{(\dotarg)}$ & Fourier transform defined as
			\begin{teqn}
				\hat f(\xi)
						:= \(\mathcal F f\)(\xi)
						= \int_{\mathbb R} e^{-i x \xi} f(x) \, \mathrm{d}x
			\end{teqn}
				& p.\pageref{sym:fourier} \\[-1\baselineskip]
		$\mathcal F^{-1}$, $\check{(\dotarg)}$ & inverse Fourier transform defined
			as
			\begin{teqn}
					\check g(x)
						:= \(\mathcal F^{-1}g\)(x)
						= \frac{1}{2 \pi} \int_{\mathbb R} e^{i x \xi} g(\xi) \, \mathrm{d}\xi
			\end{teqn}
			& p.\pageref{sym:fourier} \\
		$\mathscr S(\mathbb R)$ & space of all Schwartz class functions on $\mathbb R$
			& p.\pageref{sym3:schwartz} \\
		$\Res_{z=c}f$ & complex residue of a function $f$ at the pole $z = c$
			& p.\pageref{sym1:res} \\
		$(\dotarg\pm i0)$ & implied limit of $(\dotarg \pm i \varepsilon)$ as
				$\varepsilon \searrow 0$
			& p.\pageref{sym:i0} \\
		$f^+$ & lower boundary $f^+(x) :=
				\lim_{y\searrow0} f(x+ i y)$ of a function $f$ analytic on $S_\delta$,
				where $x, y \in \mathbb R$
			& p.\pageref{sym:bndries} \\
		$f^-$ & upper boundary $f^-(x) := \lim_{y\nearrow0} f(x+ i 2y)$ of a
				function $f$ analytic on $S_\delta$, where $x, y \in \mathbb R$
			& p.\pageref{sym:bndries} \\
		$\lesssim$ & $q \lesssim s$ means there exists some fixed constant $C$ so
				that $q \leq C\,s$; the constant $C$ is commonly referred to as
				``the implied constant'' & p.\pageref{sym:lesssim} \\
		$\lesssim_k$ & $q \lesssim s$ means there exists some constant
				$C := C(k)$ depending only on the parameter $k$ so that
				$q \leq C \, s$; the constant $C$ is commonly referred as ``the
				implied constant''
			& p.\pageref{sym2:lesssimdep} \\
		$\log_+ t$ & the function given by $\max\big\{ 0, \, \log(t) \big\}$
			& p.\pageref{sym:logplus} \\
		$\inn{x}$ & short-hand notation for $\big(1 + |x|^2\big)^{1/2}$
			& p.\pageref{sym:xbracket} \\
		$L^{p,s}(\mathbb R)$ & space of measurable functions with
			\begin{teqn}
				\|f\|_{L^{p,s}}
					:= \left(\int_{\mathbb R} \inn{x}^{sp} |f(x)|^p \right)^{1/p}
					< \infty
			\end{teqn}
			& p.\pageref{defn2:Lps} \\
		$\langle\dotarg\rangle L^\infty(\mathbb R)$ & space of measurable functions with
			\[
				\|f\|_{\inn{\dotarg} L^\infty}
					:= \esssup_{x\in \mathbb R} \left| \inn{x}^{-1} f(x)  \right|
					< \infty
			\]
			& p.\pageref{defn2:wLp} \\
		$B_Y(y_0, r)$ & the open ball $\{ y \in Y ~:~ \|y - y_0\|_Y < r  \}$ in
			the metric space $Y$ with radius $r$ centered at $y_0 \in Y$
			& p.\pageref{sym:ball} \\
		$Y\to Z$ & a map from a space $Y$ to a space $Z$
			& p.\pageref{sym:mapsto} \\
		$Y \toitself$ & a map from a space $Y$ into itself
			& p.\pageref{sym:toitself} \\
		$\|\dotarg\|_{Y\to Z}$ & the induced operator norm for an operator with domain
			$Y$ and co-domain $Z$
			& p.\pageref{sym:opnorm}
\end{indextable}

\newpage

%===================
% Chapter 1 Notation
%===================
\def\tabletitle{Chapter 1 Notation}
% \def\tabletitle{Chapter 0 Notation}
\subsection{\tabletitle}
\begin{indextable}{\tabletitle}
	$\delta$ & depth of stratified fluids\textemdash{}typically taken
			to be $\delta=1$
		& p.\pageref{sym:delta} \\
	$\mathcal S_\delta$ & the complex strip
			$\{z \in \mathbb C ~:~ 0 < \im z < 2\delta\}$
		& p.\pageref{sym:Sdelta} \\
	$f^+$ & lower boundary $f^+(x) :=
			\lim_{y\searrow0} f(x+ i y)$ of a function $f$ analytic on
			$\mathcal S_\delta$,
			where $x, y \in \mathbb R$
		& p.\pageref{sym:bndries} \\
	$f^-$ & upper boundary $f^-(x) := \lim_{y\nearrow0} f(x+ i 2y)$ of a
			function $f$ analytic on $\mathcal S_\delta$, where $x, y \in \mathbb R$
		& p.\pageref{sym:bndries} \\
	$L_\delta$ & operator on functions analytic in the complex strip
		$\mathcal S_\delta$; given by
		{
			\begin{teqn}
				L_\delta (\Psi)
					:= \frac{1}{i} \frac{\partial}{\partial x} \Psi^+
					- \zeta \left(\Psi^+ - \Psi^-\right) = u \Psi^+
			\end{teqn}
		}
		& p.\pageref{eq0:SpecProb} \\
	$\lambda$ & a spectral parameter for the linear spectral problem
			\eqref{eq0:SpecProb}
		& p.\pageref{sym:zeta} \\
	$\zeta$ & a spectral parameter for \eqref{eq0:SpecProb} commonly
			parameterized by $\lambda$	as
			$\displaystyle \zeta(\lambda; \delta)
				= \frac{\lambda}{1-e^{-2\delta\lambda}}$
		& p.\pageref{sym:zeta} \\
	$\lambda(\zeta)$ &  inverse of the map $\lambda \to \zeta(\lambda)$
		& p.\pageref{sym:lambda} \\
	$\inn{x}$ & short-hand notation for $\big(1 + |x|^2\big)^{1/2}$
		& p.\pageref{sym:xbracket} \\
	$B_Y(y_0, r)$ & the open ball $\{ y \in Y ~:~ \|y - y_0\|_Y < r  \}$ in
		the metric space $Y$ with radius $r$ centered at $y_0 \in Y$
		& p.\pageref{sym:ball} \\
	$M_1$, $M_e$, $N_1$, $N_e$ & depending on context, either Jost solutions
		or analytic extensions of solutions to the integral equations
		\eqref{eq0:JostIE}
		& p.\pageref{defn0:jost}, p.\pageref{eq0:JostIE} \\
	$M_1^+$, $M_e^+$, $N_1^+$, $N_e^+$ & depending on context, either solutions
		to the integral equations \eqref{eq0:JostIE} or lower boundary
		values of the Jost solutions
		& p.\pageref{eq0:JostIE}, p.\pageref{defn0:jost} \\
	$r(\lambda; \delta)$ & reflection coefficent; given by
		{
			\begin{teqn}
				r(\lambda; \delta) = \frac{b(\lambda; \delta)}{a(\lambda; \delta)},
			\end{teqn}
			where
			\begin{talign}
				b(\lambda)
				&:=
					\frac{i}{1-2\delta\zeta(-\lambda)}
					\int_{\mathbb R} e^{-i\lambda x}
						u(x) \, M_1^+(x; \lambda,\delta)
					\, \mathrm{d}x
					\\
			a(\lambda)
				&:=
					1
					+ \frac{i}{1-2\delta \zeta(\lambda)}
						\int_{\mathbb R}
							u(x) \, M_1^+(x; \lambda,\delta)
						\, \mathrm{d}x
			\end{talign}
		}
		& p.\pageref{sym0:reflection} \\
	$\mathscr D$ & the direct scattering map for the Intermediate Long Wave (ILW) equation; maps
		ILW initial data $u$ to the corresponding reflection coefficient $r$
		& p.\pageref{sym0:DSM} \\
	$G_L$, $G_R$ & formal Green's functions corresponding to the linear spectral problem
		\eqref{eq0:SpecProb}
		& p.\pageref{eq0:GFL},  p.\pageref{eq0:GFR}\\
	$\alpha(\lambda; \delta)$ & residue of $e^{iz\xi}/p(\xi)$ at the $\xi=0$
		pole; given by
		\begin{teqn}
			\alpha(\lambda; \delta)
				= \frac{1}{1-2\delta\zeta(\lambda; \delta)}
		\end{teqn}
		& p.\pageref{sym0:residues} \\
	$\beta(\lambda; \delta)$ & $e^{iz\lambda}$ times the residue of
		$e^{iz\xi}/p(\xi)$ at the $\xi=\lambda$ pole; given by
		\begin{teqn}
			\alpha(\lambda; \delta)
				= \frac{1}{1-2\delta\zeta(-\lambda; \delta)}
		\end{teqn}
		& p.\pageref{sym0:residues} \\
	$K^+$ & non-residue term resulting from shifting the integration contours of
		$G_L^+$ and $G_R^+$
		& p.\pageref{sym0:K} \\
	$T_{\star, \lambda, u}$ & bounded operators on
		$\inn{\dotarg}L^\infty(\mathbb R)$ given by
		\begin{teqn}
			T_{\star, \lambda, u} f(x)
				:= \big[ G_\star^+(\dotarg; \lambda) \big] * (u\,f)(x),
		\end{teqn}
		where $\star = L$ or $R$
		& p.\pageref{eq0:Tstar}
\end{indextable}

\newpage
%===================
% Chapter 2 Notation
%===================
\def\tabletitle{Chapter 2 Notation}
% \def\tabletitle{Chapter 1 Notation}
\subsection{\tabletitle}
\begin{indextable}{\tabletitle}
		$\mathscr D$ & the direct scattering map for the Intermediate Long Wave (ILW) equation; maps
			ILW initial data $u$ to the corresponding reflection coefficient $r$
			& p.\pageref{sym0:DSM} \\
		$\star$ & used as a placeholder for both $L$ and $R$; for example, if a
			statement contains the notation
			``$G_\star$ ($\star = L \text{, or } R$),'' then it is equally
			true (or not true) for both $G_L$ and $G_R$
			& p.\pageref{rmk1:StarNotation} \\
		$f^+$ & lower boundary $f^+(x) :=
				\lim_{y\searrow0} f(x+ i y)$ of a function $f$ analytic on $S_\delta$,
				where $x, y \in \mathbb R$
			& p.\pageref{sym:bndries} \\
		$f^-$ & upper boundary $f^-(x) := \lim_{y\nearrow0} f(x+ i 2y)$ of a
				function $f$ analytic on $S_\delta$, where $x, y \in \mathbb R$
			& p.\pageref{sym:bndries} \\
		$\delta$ & depth of stratified fluids\textemdash{}typically taken
				to be $\delta=1$
			& p.\pageref{sym:delta} \\
		$\lambda$ & a spectral parameter for the linear spectral problem
				\eqref{eq0:SpecProb}
			& p.\pageref{sym:zeta} \\
		$\zeta$ & a spectral parameter for \eqref{eq0:SpecProb} commonly
				parameterized by $\lambda$	as
				$\displaystyle \zeta(\lambda; \delta)
					= \frac{\lambda}{1-e^{-2\delta\lambda}}$
			& p.\pageref{sym:zeta} \\
		$\lambda(\zeta)$ &  inverse of the map $\lambda \to \zeta(\lambda)$
			& p.\pageref{sym:lambda} \\
		$\zeta^*$ & nonlinear reflection $\zeta\big(-\lambda(\zeta)\big)$
			& p.\pageref{sym:zetastar} \\
		$G_\star^+$ & lower boundary value of the Greens' function whose contour
			of integration is $\Gamma_\star$; given by
				\begin{teqn}
						G_\star^+(x; \lambda, \delta)
							:=
								\frac{1}{2\pi}
								\int_{\Gamma_\star}
									e^{i x \xi} \,
									\frac{1}{p(\xi; \lambda, \delta)}
								\, \mathrm{d}\xi
					\end{teqn}
			& p.\pageref{sym:GFbndry} \\
		${\Gamma_L}$ & contour along the real line which bypasses the roots of $p$
				from below
			& p.\pageref{sym:Gamma} \\
		${\Gamma_R}$ & contour along the real line which bypasses the roots of $p$
				from above
			& p.\pageref{sym:Gamma} \\
		$p$ & Fourier symbol of the Green's functions;
				given by
				\[
					p(\xi; \lambda, \delta)
						= \xi - \zeta(\lambda) \( 1- e^{-2\delta \xi} \)
				\]
				and commonly denoted as $p(\xi; \lambda, \delta)$,
				$p(\xi; \zeta, \delta)$, $p(\xi; \lambda)$,
				$p(\xi; \zeta)$, and $p(\xi)$.
			& p.\pageref{sym:GFintegrand} \\
		$\Res_{z=c}f$ & complex residue of a function $f$ at the pole $z = c$
			& p.\pageref{sym1:res} \\
		$\alpha(\lambda; \delta)$ & residue of $e^{iz\xi}/p(\xi)$ at the $\xi=0$
			pole; given by
			{\begin{teqn}
				\alpha(\lambda; \delta)
					= \frac{1}{1-2\delta\zeta(\lambda; \delta)}
			\end{teqn}}
			& p.\pageref{sym:alphabeta} \\
		$\beta(\lambda; \delta)$ & $e^{iz\lambda}$ times the residue of
			$e^{iz\xi}/p(\xi)$ at the $\xi=\lambda$ pole; given by
			{\begin{teqn}
				\beta(\lambda; \delta)
					= \frac{1}{1-2\delta\zeta(-\lambda; \delta)}
			\end{teqn}}
			& p.\pageref{sym:alphabeta} \\
		$K^+$ & non-residue term resulting from shifting the integration contours of
			$G_L^+$ and $G_R^+$
			& p.\pageref{sym1:K} \\
		$\log_+ t$ & the function given by $\max\big\{ 0, \, \log(t) \big\}$
			& p.\pageref{sym:logplus} \\
		$\mathcal R_\delta$ & the complex strip
				$\{z \in \mathbb C ~:~ -\pi/\delta \leq \im z \leq \pi/\delta \}$
				about the real line
				% about the real axis given by
				% 	\begin{teqn}
				% 		:= \{z \in \mathbb C ~:~ -\pi/\delta \leq \im z \leq \pi/\delta \}
				% 	\end{teqn}
			& p.\pageref{sym1:Rcal} \\
		$\mathpzc R_\star$ & sum residues of $e^{iz\xi}/p(\xi)$ at the $\xi=0$ and $\xi=\lambda$
				poles
			& p.\pageref{sym1:ressum} \\
		$\delta_c$ & Dirac delta-function centered at $x=c$
			& p.\pageref{sym:dirac} \\
		$W_k$ & $k^{th}$ branch ($k \in \mathbb Z$) of the complex Lambert $W$ function
			& p.\pageref{sym1:Wk} \\
		$\Sigma_{c}$ & the integration contour
				$\mathbb R + i c \, \pi$
			& p.\pageref{sym1:SigRealLine} \\
		$\Sigma(R,~c)$ & the integration contour $(-R, R) + i c \,\pi$,
				where $R > 0$ and $(-R, R):= \{x \in \mathbb R ~:~ -R < x < R\}$
			& p.\pageref{sym1:SigR} \\
		$K_\zeta$ & the integral function given by
				{
					\begin{teqn}
						K_\zeta(x)
							:= \int_{\mathbb R}
								\frac{e^{ix \xi}}{\xi - \zeta\left(1-e^{-2\xi}\right)+i\pi}
							\, \mathrm{d}\xi
					\end{teqn}
				}
			& p.\pageref{sym1:Kzeta} \\
		$K_q$ & the integral function given by
				{
					\begin{teqn}
						K_q(x)
							:= \int_{\mathbb R}
								\frac{e^{ix\xi} \chi\left( 2^{-q} x \xi\right)}
									{\xi - \zeta\left(1-e^{-2\xi}\right)+i\pi}
							\, \mathrm{d}\xi
					\end{teqn}
				}
			& p.\pageref{sym1:Kq} \\
\end{indextable}

\newpage
%===================
% Chapter 3 Notation
%===================
\def\tabletitle{Chapter 3 Notation}
% \def\tabletitle{Chapter 2 Notation}
\subsection{\tabletitle}
\begin{indextable}{\tabletitle}
		$\inn{x}$ & short-hand notation for $\big(1 + |x|^2\big)^{1/2}$
			& p.\pageref{sym2:xbracket} \\
		$L^{p,s}(\mathbb R)$ & space of measurable functions with
				\[
					\|f\|_{L^{p,s}}
						:= \left(\int_{\mathbb R} \inn{x}^{sp} |f(x)|^p \right)^{1/p}
						< \infty
				\]
			& p.\pageref{defn2:Lps} \\
		$\langle\dotarg\rangle L^\infty(\mathbb R)$ & space of measurable functions with
				\begin{teqn}
					\|f\|_{\inn{\dotarg} L^\infty}
						:= \esssup_{x\in \mathbb R} \left| \inn{x}^{-1} f(x)  \right|
				\end{teqn}
				finite
			& p.\pageref{defn2:wLp} \\
		$L_\xi^p(\mathbb R)$ & space of measurable functions which are $L^p$ integrable
				with respect to the variable $\xi$; similar subscript notation
				is used for other function spaces
			& p.\pageref{sym2:Lpxi} \\
		$\star$ & used as a placeholder for both $L$ and $R$; for example, if a
				statement contains the notation
				``$G_\star$ ($\star = L \text{, or } R$),'' then it is equally
				true (or not true) for both $G_L$ and $G_R$
			& p.\pageref{rmk1:StarNotation} \\
		$T_{\star, \lambda, u}$ & bounded operator on
				$\inn{\dotarg}L^\infty(\mathbb R)$ given by
				{
				\begin{teqn}
					T_{\star, \lambda, u} f(x)
						:= \big[ G_\star^+(\dotarg; \lambda) \big] * (u\,f)(x)
				\end{teqn}
				}
				based on context, $T_{\star, \lambda, u}$ is sometimes denoted
				by $T_\star$, $T_{\star, \lambda}$, or $T_\lambda$
			& p.\pageref{eqn2:Tdefn} \\
		$X$ & space of potentials $u$ with $\nm{\inn{\dotarg}^{4} u}_{L^2} < \infty$
			& p.\pageref{defn2:X} \\
		$\lesssim_k$ & $q \lesssim s$ means there exists some constant
				$C := C(k)$ depending only on the parameter $k$ so that
				$q \leq C \, s$; the constant $C$ is commonly referred as ``the
				implied constant''
			& p.\pageref{sym2:lesssimdep} \\
		$\chi_\pm$ & the characteristic functions $\chi_-:= \chi_{(-\infty, 0)}$,
				$\chi_+:= \chi_{(0, \infty)}$ on the respective intervals
				$(-\infty, 0)$ and $(0, \infty)$
			& p.\pageref{sym2:chipm} \\
		$G$ & as specified in Remark \ref{rmk2:notation}, $G(x,\lambda)$
				and $G(\lambda)$ are occasionally used to as shorthand
				notations for $G_\star^+(x; \lambda)$
			& p.\pageref{rmk2:notation} \\
		$G_h(\lambda)$ & the difference quotient of $G_\star^+$ with respect to
				$\lambda$; given by
				\begin{teqn}
					G_h(\lambda) := \frac{G(\lambda+h) - G(\lambda)}{h}
				\end{teqn}
			& p.\pageref{sym2:Gh} \\
		$\ds\left(\frac{1}{p_\lambda(\xi)}\right)_{h}$
			& the difference quotient of $1/p$ with respect to $\lambda$;
				\begin{teqn}
					\left(\frac{1}{p_\lambda(\xi)}\right)_{h}
						:= \frac{1}{h}\,
							\left[
								\frac{1}{p(\xi; \lambda +h)}
								-\frac{1}{p(\xi; \lambda)}
							\right]
				\end{teqn}
			& p.\pageref{sym2:pdiffquot} \\
		$\Res_{z=c}f$ & complex residue of a function $f$ at the pole $z = c$
			& p.\pageref{eq2:gzerores}
\end{indextable}

\newpage

%===================
% Chapter 4 Notation
%===================
\def\tabletitle{Chapter 4 Notation}
% \def\tabletitle{Chapter 3 Notation}
\subsection{\tabletitle}
\begin{indextable}{\tabletitle}
	$\mathcal S_\delta$ & the complex strip about the real axis defined by
			$\mathcal S_1 := \{z \in \mathbb C ~:~ 0 < \im z < 2 \}$
		& p.\pageref{thm3:main_result} \\
	$G_\star$ & analytic continuation of $G_\star^+$ to the analytic
			strip $\mathcal S_1$
		& p.\pageref{thm3:main_result} \\
	$G_\star^-$ & the upper boundary value of $G_\star$ defined as a
			distribution in that
			\begin{teqn}
				G_\star^- * f = \lim_{y\nearrow 2} G_\star^+(\dotarg+iy)*f
			\end{teqn}
			for $f \in L^1(\mathbb R) \cap L^p(\mathbb R)$ ($1< p \leq 2$)
		& p.\pageref{eq3:lim} \\
	$K$ & analytic continuation of $K^+$ to the $\mathcal S_1$
		& p.\pageref{thm3:main_result} \\
	$\mathfrak C$ & a portion of $K$ whose limit as $y\nearrow 2$ is
			a continuous limit operator; given by
			\begin{teqn}
				\mathfrak C(x,y)
					:= \frac{1}{2\pi} e^{-\pi|x|} \, e^{- \sign(x) \, i \pi y }
						\int_{\mathbb R} e^{ix \xi} \rho\big(\xi, y, \sign(x)\big) \, \mathrm{d}\xi,
			\end{teqn}
			where $x \in \mathbb R$ and $y\in [0, 2]$
		& p.\pageref{sym:mathfrakC} \\
	$\rho$ & a function given by
			{
				\begin{teqn}
					\rho\big(\xi, y, c; \lambda\big)
						:=
							\begin{cases}
								\dfrac{e^{-y\xi}}{p(\xi; \lambda) + i \,c\, \pi},
									& \xi > 0\\
									\\
								\dfrac{1}{\zeta(\lambda)}
								\dfrac{
									\big(\zeta(\lambda)- \xi - c \, i\pi \big)
									e^{(2-y)\xi}
								}
								{p(\xi; \lambda) + i\,  c \, \pi},
									&	\xi < 0.
							\end{cases}
				\end{teqn}
			}
		& p.\pageref{eq0:smallR} \\
	$\mathpzc R_\star$ & sum residues of $e^{iz\xi}/p(\xi)$ at the
			$\xi=0$ and $\xi=\lambda$ poles
		& p.\pageref{eq3:mathpzcR}\\
	$\mathcal E_{\varepsilon}$ & a family of convolution operators
			given by
			\begin{talign}
					\left( \mathcal E_\varepsilon f \right)(x)
					&:=  \frac{e^{-i \pi (2-\varepsilon)}}{2 \pi i}
						\int_{-\infty}^x
							\frac{e^{-\pi|x-x'|}}{(x-x') - i\varepsilon} f(x')
						\, \mathrm{d}x' \\
					&\quad + \frac{e^{i \pi (2-\varepsilon)}}{2 \pi i}
						\int_x^{\infty}
							\frac{e^{-\pi|x-x'|} }{(x-x') - i\varepsilon} f(x')
						\, \mathrm{d}x'
			\end{talign}
		& p.\pageref{sym:almostExpCauchy} \\
	$E_{\varepsilon}$ & exponentially weighted Cauchy transform; given by
			\begin{teqn}
				E_{\varepsilon} f(x)
					:= \frac{1}{2\pi i} \int_{\mathbb R}
						\frac{e^{-\pi|x-x'|}}{(x-x') - i \varepsilon} f(x') \, \mathrm{d}x'
			\end{teqn}
		& p.\pageref{sym:expCauchy} \\
	$E$ & exponentially weighted Hilbert Transform;
			given by
			\begin{teqn}
				Ef(x)
					:= \frac{1}{2\pi i}
						\pv \int_{\mathbb R} \frac{e^{-\pi|x-x'|}}{x-x'} f(x') \, \mathrm{d}x',
			\end{teqn}
			where $\pv \int (\dotarg) \, \mathrm{d}\mu$ denotes a principle value integral.
		& p.\pageref{sym:ExpHil} \\
	$\mathscr S(\mathbb R)$ & space of all Schwartz class functions on $\mathbb R$
		& p.\pageref{sym3:schwartz} \\
	$\mathpzc E_\varepsilon, ~\mathpzc P_\varepsilon$ & two families of convolution
			operators given by
			\[
				\mathpzc E_\varepsilon(y)
					:= \frac{1}{2\pi i} \frac{y}{y^2 + \varepsilon^2} e^{-\pi|y|},
				\quad \text{and} \quad
				\mathpzc P_\varepsilon(y)
					:= \frac{1}{\pi} \frac{\varepsilon}{y^2 + \varepsilon^2} e^{-\pi|y|}
			\]
		& p.\pageref{sym:badCauchy} \\
	$E^{(\varepsilon)}$ &  truncated exponentially weighted Hilbert Transform; given
			by
			\begin{teqn}
				E^{(\varepsilon)}f(x)
					:= \frac{1}{2\pi i}
						 \int_{|x'|\geq \varepsilon} \frac{e^{-\pi|x'|}}{x'} f(x-x') \, \mathrm{d}x'
			\end{teqn}
			by definition,
			$(Ef)(x) = \lim_{\varepsilon \searrow 0} E^{(\varepsilon)}f(x)$
		& p.\pageref{sym:truncExpHil} \\
	$P_\varepsilon$ & Poisson kernel; given by
			$P_\varepsilon(y) = \frac{1}{\pi}\frac{\varepsilon}{y^2+\varepsilon^2}$
		& p.\pageref{sym3:poisson} \\
	$E^*$ & the maximal operator associated with the Cauchy transform
			$E_{\varepsilon}$; given by
			\begin{teqn}
				E^*f(x)
					:= \( E_{\varepsilon} \)^* f(x)
					:= \sup_{\varepsilon>0} \left\{\left|E_{\varepsilon} f(x)\right|\right\}.
			\end{teqn}
		& p.\pageref{sym:maxCauchyT} \\
	$M$ & The Hardy-Littlewood maximal operator; given by
			\begin{teqn}
				M f(x)
	        		= \sup_{r > 0}
	        			\left\{
	        				\frac{1}{B(0, r)} \int_{B(0, r)} |f(x - x')| \, \mathrm{d}x'
		        		\right\}.
			\end{teqn}
		& p.\pageref{sym:hardy} \\
	$m_E$ & Fourier multiplier for the exponentially weighted Hilbert transform;
			given by
			\begin{teqn}
				m_E(\xi) = \frac{1}{\pi} \arctan(\xi/\pi)
			\end{teqn}
		& p.\pageref{sym3:Emult} \\
	$L^{p,\infty}$ & weak $L^p$ space; also denoted $weak$-$L^p$
		& p.\pageref{sym:weakLp} \\
\end{indextable}
\newpage

%===================
% Chapter 5 Notation
%===================
\def\tabletitle{Chapter 5 Notation}
% \def\tabletitle{Chapter 4 Notation}
\subsection{\tabletitle}
\begin{indextable}{\tabletitle}
	$M_1$, $M_e$, $N_1$, $N_e$ & depending on context, either Jost solutions
		or analytic extensions of solutions to the integral equations
		\eqref{eq4:JostIE}
		& p.\pageref{defn4:jost}, p.\pageref{eq4:JostIE} \\
	$X$ & space of potentials $u$ with $\nm{\inn{\dotarg}^{4} u}_{L^2} < \infty$
			& p.\pageref{defn2:X} \\
	$c_0$ & a strictly positive constant chosen in Proposition \ref{prop4:exist}
			to ensure the existence and uniqueness of Jost solutions for every
			potential $u \in X$ with $\|u\|_X < c_0$
		& p.\pageref{prop4:exist} \\
	$T_{\star, \lambda, u}$ & bounded operator on
			$\inn{\dotarg}L^\infty(\mathbb R)$ given by
			\begin{teqn}
				T_{\star, \lambda, u} f(x)
					:= \big[ G_\star^+(\dotarg; \lambda) \big] * (u\,f)(x)
			\end{teqn}
			based on context, $T_{\star, \lambda, u}$ is sometimes denoted
			by $T_\star$, $T_{\star, \lambda}$, or $T_\lambda$
		& p.\pageref{prop4:exist} \\
	$a$, $b$, $\breve{a}$, $\breve{b}$
		& coefficients for the scattering equations \eqref{eq3:M1N} and
			\eqref{eq3:N1M}; given by
			\begin{talign}
				a(\lambda)
					&:= 1 + i \alpha(\lambda) \,
						\int_{\mathbb R} u(x) \, M_1^+(x; \lambda, u) \, \mathrm{d}x \\
				b(\lambda)
					&= i \beta(\lambda) \,
						\int_{\mathbb R} e^{-ix\lambda} \, u(x) \, M_1^+(x; \lambda, u) \, \mathrm{d}x \\
				\breve{a}(\lambda)
					&:= 1 + \alpha(\lambda)
						\int_{\mathbb R} u(x) \, N_1(x; \lambda, u) \, \mathrm{d}x \\
				\breve{b}(\lambda)
					&= i \beta(\lambda)
						\int_{\mathbb R} e^{-ix\lambda} \, u(x) \, N_1(x; \lambda, u) \, \mathrm{d}x
			\end{talign}
		& p.\pageref{prop4:SD} \\
	$\alpha(\lambda; \delta)$ & residue of $e^{iz\xi}/p(\xi)$ at the $\xi=0$
			pole; given by
			{\begin{teqn}
				\alpha(\lambda; \delta)
					= \frac{1}{1-2\delta\zeta(\lambda; \delta)}
			\end{teqn}}
			& p.\pageref{sym:alphabeta} \\
	$\beta(\lambda; \delta)$ & $e^{iz\lambda}$ times the residue of
			$e^{iz\xi}/p(\xi)$ at the $\xi=\lambda$ pole; given by
			{\begin{teqn}
				\alpha(\lambda; \delta)
					= \frac{1}{1-2\delta\zeta(-\lambda; \delta)}
			\end{teqn}}
		& p.\pageref{sym:alphabeta} \\
	$\mathscr D$ & direct scattering map for the ILW; given by
			$\mathscr D: B_X(0, c_0) \ni u \mapsto r \in L_\lambda^\infty(\mathbb R)$
		& p.\pageref{sym4:dsm} \\
	$r$ & reflection coefficient; given by $r(\lambda) = b(\lambda) / a(\lambda)$
		& p.\pageref{sym4:dsm}
\end{indextable}

\end{document}


\documentclass{article}

\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage[margin=0.5in]{geometry}
\usepackage{mathrsfs}

\newtheorem{axiom}{Axiom}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem*{remark}{Remark}

\begin{document}
\title{Mathematical definitions for everyone... Well, not yet but that is the goal.}
\author{Miguel Angel Gomez Barrera}

\maketitle

\section{Trigonometry}

\section{Set}

\paragraph{Set} In mathematics, a set is a collection of well defined distinct objects, considered as an object in its own right.

\begin{axiom}[Axiom of Extension] Two sets are equal if and only if they have the same elements.
\end{axiom}

\paragraph{}If $A$ and $B$ are sets and if every element of $A$ is an element of $B$, we say that $A$ is a \textit{subset} of $B$, or $B$ \textit{includes} $A$, and we write
$$A \subset B$$
or
$$B \supset A$$
\begin{axiom}[Axiom of specification]
	To every set $A$ and to every condition $S(x)$ there corresponds a set $B$ whose elements are exactly those elements $x$ of $A$ for which $S(x)$ holds.
\end{axiom}

\paragraph{}For all that has been said so far, we might have been operating ina vacuum. To give discussion some substance, let us officially assume that
\begin{center}
	\textit{there exists a set.}
\end{center}
\paragraph{}The axiom of extension implies that there can only be one set with no elements, the set is called \textit{the empty set} and is represented by:
$$\emptyset.$$
\paragraph{}Another Example: $\{x\in \mathbb{N}: x \neq x\}$ y $\{x \in \mathbb{N}: \frac{1}{x} > 1\}$

\paragraph{}The empty set is a subset of every set, or, in other words, $\emptyset \subset A$ for every $A$. To establish this, we might argue as follows. It is to be proved that every element in $\emptyset$ belongs to $A$; since there are no elements in $\emptyset$, the condition is automatically fulfilled. The reasoning is correct but perhaps unsatisfying. Since it is a typical example of a frequent phenomenon, a condition holding in the "vacuous" sense, a word of advice to the inexperienced reader might be in order. To prove that something is true about the empty set, prove that it cannot be false. How, for instance, could it be false that $\emptyset \subset A$? It could be false only if $\emptyset$ had an element that did not belong to $A$. Since $\emptyset$ has no elements at all, this is absurd. Conclusion: $\emptyset \subset A$ is not false, and therefore $\emptyset \subset A$ for every A.
\begin{axiom}[Axiom of pairing]
	for any two sets there exists a set that they both belong to.
\end{axiom}
\paragraph{Note} In case $S(x)$ is $(x \in' x)$, or in case $S(x)$ is $(x = x)$, the specified x's do not constitute a set. Despite the maxim about never getting something for nothing, it seems a little harsh to be told that certain sets are not really sets and even their names must never be mentioned. Some approaches to set theory try to soften the blow by making systematic use of such illegal sets but just not calling them sets; the customary word is "class." A precise explanation of what classes really are and how they are used is irrelevant in the present approach. Roughly speaking, a class may be identified with a condition (sentence), or, rather, with the "extension" of a condition.

\begin{axiom}[Axiom of Unions]
	For every collection of sets there exists a set that contains all the elements that belong to at least one set of the given collection.
\end{axiom}
\paragraph{} Here it is again: for every collection $\mathscr{C}$ there exists a set $U$ such that $x \in X$ for some $X \in \mathscr{C}$, then $x \in U$.
\paragraph{}the comprehensive set $U$ described above may be too comprehensive; it may contain elements that belong to none of the sets $X$ in collection $\mathscr{C}$. This is easy to remedy; just apply the axiom of specification to form the set:
$$\{x \in U: x \in X \text{ for some } X \in \mathscr{C}\},$$
\paragraph{}If we change notation and call the set $U$ again, then
$$U = \{x: x \in X \text{ for some } X \in \mathscr{C}\},$$
\paragraph{}This set $U$ is called 	the \textit{union} of collection $\mathscr{C}$ of sets, note the axiom specification guarantees its uniqueness. the simplest symbol for $U$ that is in use at all is not very popular in mathematics circles; it is
$$\bigcup \mathscr{C},$$
\paragraph{}
\section{Function}
(MSC: 03E99)
\paragraph{Function} . Is a relation between sets in which one element of the set is related to another element of the second set.

$$f: A \mapsto B$$

Functions are composed by three things:

\begin{itemize}
    \item The domain.
    \item The codomain or range.
    \item The correspondence rule.
\end{itemize}

$$f(n):=$$

\paragraph{Domain}
\paragraph{Codomain or Range}

\begin{theorem}[Taylor Polinomial] Given some function $f$ with derivatives of order $n$ on the point $x=0$. Exists a only one polynomial $P$ on degree less or equal of $n$ which satisfies the $n + 1$ conditions:
	$$P(0) = f(0), P'(0)=f'(0), \dots, P^n = f^{(n)}(0)$$
, and given by the formula:
	$$P(x) = \sum_{k=0}^{n} \frac{f^{(k)}(0)}{x!}x^{k}$$
where $x \neq x_0$.
\end{theorem}

\begin{align*}
u_{xy} &= u_x u_y\\
\frac{u_{xy}}{u_x} &= u_y\\
\frac{\partial}{\partial y}\left(\ln (u_x)\right) &= \frac{\partial}{\partial y}\left(u\right)\\
c(x) + \ln(u_x) &= u\\
u_x &= e^{u - c(x)}\\
u_{xy} &= u_y e^{u-c(x)}
\end{align*}
luego,
$u_{xy} = u_x u_y$ y $u_{xy}= u_y e^{u-c(x)}$

\end{document}


\section{Finiteness Predicates}\label{finiteness-predicates}
\input{figures/finite-classification}
In this subsection, we will define and briefly describe each of the five predicates
in \Cref{finite-classification}.
We will also explain \emph{why} there are five separate predicates: how can it
be the case that so many different things describe ``finiteness''?
As we will see, some predicates are too informative (they
tell us more about the underlying type other than it just being finite), or too
restrictive (they don't allow certain finite types to be classified as finite).
These diversions won't be dead-ends, however: the final predicate we will land
on as the ``correct'' (or, more accurately, most useful) notion of finiteness
will be built out of all of the others.
\subsection{Split Enumerability}\label{split-enumerability}
We will start with a simple notion of finiteness, called split enumerability.
This predicate is perhaps the first definition of ``finite'' that someone might
come up with (it's certainly the most common in dependently-typed programming):
put simply, a split enumerable type is a type for which all of its elements can
be listed.
\begin{definition}[Split Enumerable Set]\label{split-enum-def}
  To say that some type \(A\) is split enumerable is to say that there is a list
  \(\mathit{support} : \AgdaDatatype{List}\;A\) such that any value \(x : A\) is in
  \(\mathit{support}\).
  \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable/Container.tex]{split-enum-def}
  We call the first component of this pair the ``support'' list, and the second
  component the ``cover'' proof.
  An equivalent version of this predicate was called \verb+Listable+ in
  \citet{firsovDependentlyTypedProgramming2015}.
\end{definition}

This predicate is simple and useful, but we will see later on how it is perhaps
a little imprecise.
Before we dive in to exploring the predicate itself, though, we will need to
explain some of the terms we used in its definition.
\paragraph{What is a List?}
In this paper we prefer a slightly unusual definition for the type of lists:
\twocolcode
{\ExecuteMetaDataInline[agda/Container/List.tex]{list-def}}
{\ExecuteMetaDataInline[agda/Data/Fin/Base.tex]{fin-def}}
This is the definition for a \emph{container} (\Cref{container-def}):
effectively, the above definition says that ``Lists are a datatype whose shape
is given by the natural numbers, and which can be indexed by numbers smaller
than its shape''.
If that seems needlessly complex, don't worry: this definition is precisely
equivalent to the usual inductive one.
\ExecuteMetaDataInline[agda/Data/List/Base.tex]{list-def}
And this isn't some kind of hand-waving equivalence, either: since we are
working in HoTT, we can (and do) prove that the two types are equal, allowing us
to use one or the other depending on whichever is more convenient, and
\(\AgdaFunction{subst}\) in the other representation without loss of generality.
That said, defining lists as containers will reveal several interesting
connections and proofs about split enumerability and the other predicates,
so for the remainder of the paper whenever we say \AgdaDatatype{List} we will
mean  \(\;\AgdaFunction{⟦}\Nat,\AgdaFunction{Fin}\AgdaFunction{⟧}\;\).

We still must define containers themselves, of course.
Containers are a well-studied topic in dependent type theory, with a rich
theory: we won't dive in to that here.
\begin{definition}[Containers]\label{container-def}
  A container \citep{abbottContainersConstructingStrictly2005} is a pair
  \(S , P\) where \(S\) is a type, the elements of which are called
  the \emph{shapes} of the container, and \(P\) is a type family on \(S\), where
  the elements of \(P(s)\) are called the \emph{positions} of a container.
  We ``interpret'' a container into a functor defined like so:
  \ExecuteMetaDataInline[agda/Container.tex]{container-interp}
\end{definition}

The definition of container is a little abstract: it is instructive to think of
it more concretely for the case of lists.
The container representing finite lists is a pair of a natural number \(n\)
representing the length (or ``shape'') of the list, and a function
\(\AgdaDatatype{Fin}\;n\to A\), representing the indexing function into the
list.

One of the nice things about containers is it gives us a generic way to define
``membership'':
\twocolcode
{\ExecuteMetaDataInline[agda/Container/Membership.tex]{membership-def}}
{\ExecuteMetaDataInline[agda/Snippets/Introduction.tex]{fiber}}
Here we're using the homotopy-theory notion of a \AgdaDatatype{fiber} to define
membership: a fiber for some function \(f\) and some point \(y\) in its codomain
is a value \(x\) and a proof that \(f \; x \;\AgdaDatatype{≡}\;y\).
Membership also makes more sense when described concretely in terms of lists:
\(x\;\AgdaDatatype{\ensuremath{\in}}\;\mathit{xs}\) means ``there is an index
into \(\mathit{xs}\) such that the index points at an item equal to \(x\)''.
\paragraph{Split Surjections}
Now that we have our terms defined, let's look a little at how split
enumerability relates to more traditional, classical notions of finiteness.
In a classical setting we likely wouldn't mention ``lists'' or the like, and
would instead define finiteness based on the existence of some injection or
surjection, say a surjection from a finite prefix of the natural numbers.
In HoTT, surjections (or, more precisely, \emph{split} surjections
\cite[definition 4.6.1]{hottbook}), are defined like so:

\twocolcode
{\ExecuteMetaDataInline[agda/Function/Surjective/Base.tex]{split-surjective}}
{\ExecuteMetaDataInline[agda/Function/Surjective/Base.tex]{split-surjection}}
As it turns out, our definition of finiteness here is precisely the same as a
surjection-based one, in quite a deep way!
\begin{lemma}\label{split-enum-is-split-surj}%
  A proof of split enumerability is equivalent to a split surjection from a
  finite prefix of the natural numbers.
  \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{is-split-inj-type}
\end{lemma}
\begin{proof} \let\qed\relax
   \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{is-split-inj}
\end{proof}

In the above proof syntax the
\(\AgdaDatatype{\ensuremath{\equiv \langle{} \rangle{} }}\) connects lines which
are definitionally equal, i.e. they are ``obviously'' equal from the type
checker's perspective.
Clearly, only one line isn't a definitional equality:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Data/Sigma/Properties.tex]{reassoc}
\end{agdalisting*}
This means that we could have in fact written the whole proof as follows:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{split-enum-is-split-surj-short}
\end{agdalisting*}
The simplicity of this proof, by the way, is why we preferred the
container-based definition of lists over the traditional one.

In \citet{firsovDependentlyTypedProgramming2015}, there is a proof that split
enumerability and surjections from \(\AgdaDatatype{Fin}\) are propositionally
equivalent; i.e. a function from each to the other is provided.
The fact that the two proofs are precisely equivalent is not proven (and,
indeed, it is impossible to prove in MLTT).
\paragraph{Instances}
\begin{marginagdalisting}{Proof of \(\AgdaFunction{\(\mathcal{E}!\)\;\AgdaDatatype{Bool}}\)}\label{bool-is-split-enumerable}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{bool-inst}
\end{marginagdalisting}
To actually show that a type \(A\) is finite amounts to constructing a term of
type \(\AgdaDatatype{\ensuremath{\mathcal{E}!}}\;A\).
For simple types like \AgdaDatatype{Bool}, that is simple: it just amounts to
basically listing the constructors.
As a slightly more complex example, consider the \(\AgdaDatatype{Fin}\) type
we've been using.
Remember that split enumerability is in fact the same as a split surjection from
\(\AgdaDatatype{Fin}\) (\Cref{split-enum-is-split-surj}): to show that
\(\AgdaDatatype{Fin}\) is split enumerable, then, we need only show that it has
a split surjection from itself.
We'll prove the following slightly more general statement:

\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Function/Surjective/Properties.tex]{split-surj-ident}
\end{agdalisting*}
\paragraph{Decidable Equality}
One thing that characterises all split enumerable types is that they are all
\emph{discrete}, i.e. they have decidable equality.
\begin{agdalisting*}
  \begin{multicols}{2} \null \vfill
    \ExecuteMetaDataInline[agda/Relation/Nullary/Discrete/Base.tex]{discrete-def} \vfill \null \columnbreak
    \ExecuteMetaDataInline[agda/Snippets/Dec.tex]{dec-def}
  \end{multicols}
\end{agdalisting*}
We will see later that this has implications for the space of types we're
dealing with, but for now it simply provides a useful function on split
enumerable types.
\begin{lemma}\label{split-enum-discrete}
  Split enumerability implies decidable equality.
\end{lemma}
\begin{proof}
To prove that split enumerability implies decidable equality we'll take a quick
detour through injections.
\begin{agdalisting*}
  \begin{multicols}{2}
    \ExecuteMetaDataInline[agda/Function/Injective/Base.tex]{injective} \columnbreak
    \ExecuteMetaDataInline[agda/Function/Injective/Base.tex]{injection}
  \end{multicols}
\end{agdalisting*}
These are useful because we know that any type which injects into a discrete
type is itself discrete:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Function/Injective/Properties.tex]{inj-discrete}
\end{agdalisting*}
And we can turn a split surjection from \(A\) to \(B\) into an injection from
\(B\) to \(A\):
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Function/Surjective/Properties.tex]{surj-to-inj}
\end{agdalisting*}
Yielding a simple proof that any type with a split surjection from a discrete
type is itself discrete:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Function/Surjective/Properties.tex]{discrete-surj}
\end{agdalisting*}
Since split enumerability is really just a split surjection from
\AgdaDatatype{Fin}, and since we know that \AgdaDatatype{Fin} is discrete, the
overall proof resolves quite simply:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{split-is-discrete}
\end{agdalisting*}
\end{proof}
This lemma is also proven in \citet{firsovDependentlyTypedProgramming2015},
although using a significantly different technique.
\subsection{Manifest Bishop Finiteness}\label{manifest-bishop-finiteness}
We mentioned in the introduction that occasionally in constructive mathematics
proofs will contain ``too much'' information.
With split enumerability we can see an instance of this.
Consider the following proof of the finiteness of bool:
\begin{agdalisting}\label{op-slop}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{bool-slop}
\end{agdalisting}
There is an extra \AgdaInductiveConstructor{false} at the end of the support
list.
There's nothing terribly wrong with that: it is still a valid proof of
finiteness, after all, but it does mean that this proof has some extra
information which we didn't necessarily intend to encode.

There is ``slop'' in the type of split enumerability: there are more distinct
values than there are \emph{usefully} distinct values.
To reconcile this, we will disallow duplicates in the support list.

This is where manifest Bishop finiteness comes in: this is a definition of
finiteness quite similar to split enumerability in other regards, except that it
does not allows for duplicates in the support list.

How exactly to prohibit duplicates is the next question.
One approach might be to change the definition of \(\AgdaDatatype{List}\), or
introduce a new type \(\AgdaDatatype{NoDupeList}\), and use it in the predicate
instead.
However, this would mean we lose access to the functions we have defined on
lists, and we have to change the definition of
\(\AgdaFunction{\ensuremath{\in}}\) as well.

There is a much simpler and more elegant solution: we insist that every
\emph{membership proof} must be unique.
This would disallow a definition of \(\AgdaDatatype{\ensuremath{\mathcal{E}!}}\;
\AgdaDatatype{Bool}\) with
duplicates, as there are multiple values which inhabit the type
\(\AgdaInductiveConstructor{false}\;\AgdaFunction{\ensuremath{\in}}\;
\AgdaInductiveConstructor{\ensuremath{\left[ \text{false}, \text{true},
      \text{false} \right]}}\).
It also allows us to keep most of the split enumerability definition unchanged,
just adding a condition to the returned membership proof in the cover proof.

To specify that a value must exist uniquely in HoTT we can use the concept of a
\emph{contraction} \cite[definition 3.11.1]{hottbook}.
\begin{agdalisting}\label{isContr}
  \ExecuteMetaDataInline[agda/Snippets/Introduction.tex]{isContr}
\end{agdalisting}
A contraction is a type with the least possible amount of information: it
represents the tautologies.
All contractions are isomorphic to \AgdaDatatype{\ensuremath{\top}}.

By saying that a proof of membership is a contraction, we are saying that it
must be \emph{unique}.
\begin{agdalisting}\label{uniq-memb-def}
  \ExecuteMetaDataInline[agda/Container/Membership.tex]{uniq-memb-def}
\end{agdalisting}
Now a proof of \(x\;\AgdaFunction{\ensuremath{\in}!}\;\mathit{xs}\) means that
\(x\) is not just in \(\mathit{xs}\), but it appears there \emph{only once}.

With this we can define manifest Bishop finiteness:
\begin{definition}[Manifest Bishop Finiteness] \label{bish-def}
  A type is manifest Bishop finite if there exists a list which contains each
  value in the type once.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestBishop/Container.tex]{bish-def}
  \end{agdalisting*}
  The only difference between manifest Bishop finiteness and split enumerability
  is the membership term: here we require unique membership
  (\AgdaFunction{\ensuremath{\in!}}), rather than simple membership
  (\AgdaFunction{\(\in\)}).
  An equivalent version of this predicate was called \verb+ListableNoDup+ in
  \citet{firsovDependentlyTypedProgramming2015}.
\end{definition}

We use the word ``manifest'' here to distinguish from another common
interpretation of Bishop finiteness, which we have called cardinal finiteness in
this paper: this version of the proof is ``manifest'' because we have a
concrete, non-truncated list of the elements in the proof.

\paragraph{The Relationship Between Manifest Bishop Finiteness and Split
  Enumerability}
While manifest Bishop finiteness might seem stronger than split enumerability,
it turns out this is not the case.
Both predicates imply the other.

Going from manifest Bishop finiteness is relatively straightforward:
to construct a proof of split enumerability from one of manifest Bishop
finiteness, it suffices to convert a proof of \(x\;\AgdaFunction{\ensuremath{\in!}}\;\mathit{xs}\) to
one of \(x\;\AgdaFunction{\ensuremath{\in}}\;\mathit{xs}\), for all \(x\) and \(\mathit{xs}\).
Since \AgdaFunction{\(\in!\)} is defined as a contraction of \AgdaFunction{\(\in\)}, such a conversion
is simply the \AgdaField{fst} function.

Going the other direction takes significantly more work.
\begin{lemma}\label{split-enum-to-manifest-bishop}
  Any split enumerable set is manifest Bishop finite.
\end{lemma}
This lemma is proven in \citet{firsovDependentlyTypedProgramming2015}.
We will only sketch the proof here:
the ``unique membership'' condition in
\(\AgdaDatatype{\ensuremath{\mathcal{B}}}\) means that we are not permitted
duplicates in the support list.
The first step in the proof, then, is to filter those duplicates out from the
support list of the \(\AgdaDatatype{\ensuremath{\mathcal{E}!}}\) proof: we can do this using the decidable
equality provided by \(\AgdaDatatype{\ensuremath{\mathcal{E}!}}\) (\Cref{split-enum-discrete}).
From there, we need to show that the membership proof carries over
appropriately.

We have now proved that every manifestly Bishop finite type is split enumerable,
and vice versa.
While the types are not \emph{equivalent} (there are more split enumerable
proofs than there are manifest Bishop finite proofs), they are of equal power.
\paragraph{From Manifest Bishop Finiteness to Equivalence}
We have seen that split enumerability was in fact a split-surjection in
disguise.
We will now see that manifest Bishop finiteness is in fact an \emph{equivalence}
in disguise.
We define equivalences as contractible maps \cite[definition 4.4.1]{hottbook}:
  \begin{agdalisting}\label{equiv-def}
    \begin{multicols}{2}
      \ExecuteMetaDataInline[agda/Snippets/Equivalence.tex]{is-equiv-def} \columnbreak
      \ExecuteMetaDataInline[agda/Snippets/Equivalence.tex]{equiv-def}
    \end{multicols}
  \end{agdalisting}
\begin{lemma}\label{bishop-equiv}
  Manifest bishop finiteness is equivalent to an equivalence to a finite prefix
  of the natural numbers.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestBishop.tex]{bishop-is-equiv-type}
  \end{agdalisting*}
\end{lemma}
\begin{proof} \let\qed\relax \vspace{-1\baselineskip}\phantom{Proof.} \\
  \begin{minipage}[t]{.83\textwidth}\vspace{-1.25\baselineskip}
    \begin{agdalisting*}
      \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestBishop.tex]{bishop-is-equiv}
    \end{agdalisting*}
  \end{minipage}
  \begin{minipage}[t]{.16\textwidth}

    Def.~\ref{bish-def} (\AgdaDatatype{\ensuremath{\mathcal{B}}})     \\
    Eqn.~\ref{uniq-memb-def} (\AgdaDatatype{\ensuremath{\in!}})       \\
    Eqn.~\ref{container-membership} (\AgdaDatatype{\ensuremath{\in}}) \\
    Eqn.~\ref{equiv-def} \\
    Eqn.~\ref{list-def} ({\AgdaDatatype{List}})
    Eqn.~\ref{container-interp}  \\
    Reassociation \\
    Eqn.~\ref{equiv-def}
  \end{minipage}
\end{proof}

This proof is almost identical to the proof for
\Cref{split-enum-is-split-surj}: it reveals that
enumeration-based finiteness predicates are simply another perspective on
relation-based ones.

\citet{firsovDependentlyTypedProgramming2015} provides a proof of the
related statement; that manifest Bishop finiteness implies an equivalence to a
prefix of the natural number (and vice versa), but similarly to split
enumerability they cannot show that the two are equivalent as we have done here.

As we are working in CuTT, a proof of equivalence between two types gives us the
ability to \emph{transport} proofs from one type to the other.
This is extremely powerful, as we will see.
\subsection{Cardinal Finiteness}\label{cardinal-finiteness}
While we have removed some of the unnecessary information from our finiteness
predicates, one piece still remains.
The two following proofs are both valid proofs of the finiteness of
\(\AgdaDatatype{Bool}\), and both do not include any duplicates:

\begin{minipage}{\textwidth}
\begin{multicols}{2}
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{bool-inst}
  \end{agdalisting*} \columnbreak
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/SplitEnumerable.tex]{bool-rev}
  \end{agdalisting*}
\end{multicols}
\end{minipage}
Clearly they're not the same though: the order of their support lists differs.
Each finiteness predicate so far has contained an \emph{ordering} of the
underlying type.
For our purposes, this is too much information: it means that when constructing
the ``category of finite sets'' later on, instead of each type having one
canonical representative, it will have \(n!\), where \(n\) is the cardinality of
the type\footnotemark.

\footnotetext{
  We actually do get a category (a groupoid, even) from manifest Bishop
  finiteness \citep{yorgeyCombinatorialSpeciesLabelled2014}: it's the groupoid of
  finite sets equipped with a linear order, whose morphisms are order-preserving
  bijections.
  We do not explore this particular construction in any detail.
}

What we want is a proof of finiteness that is a proposition.
\begin{agdalisting}\label{isProp}
  \ExecuteMetaDataInline[agda/Snippets/Introduction.tex]{isProp}
\end{agdalisting}
The mere propositions are one homotopy level higher than the contractions
(\Cref{isContr}), the types for which all values are equal to some value.
They represent the types for which all values are equal, or, the types
isomorphic to \agdabot\;or \agdatop.
You can also define propositions in terms of the contractions: propositions are
the types whose paths are contractions.
Soon (\Cref{isSet}) we will see the next homotopy level, which are
defined in terms of the propositions.

Despite now knowing the precise property we want our finiteness predicate to
have, we're not much closer to achieving it.
To remedy the problem, we will use the following type:
\begin{agdalisting}\label{prop-trunc}
  \ExecuteMetaDataInline[agda/Snippets/PropTrunc.tex]{prop-trunc-def}
\end{agdalisting}
This is a \emph{higher inductive type}.
Normal inductive types have \emph{point} constructors: constructors which
construct values of the type.
The first constructor here (\AgdaInductiveConstructor{\ensuremath{\lvert \_
    \rvert}}), or the constructor \AgdaInductiveConstructor{true} for
\AgdaDatatype{Bool}, are both ``point'' constructors.

What makes this type higher inductive is that it also has \emph{path}
constructors: constructors which add new equalities to the type.
The \AgdaInductiveConstructor{squash} constructor here says that all elements of
\proptrunc{A}
are equal, regardless of what \(A\) is.
In this way it allows us to propositionally truncate types, turning
information-containing proofs into mere propositions.
Put another way, a proof of type \proptrunc{A}
is a proof that some \(A\) exists, without revealing \emph{which} \(A\).

To actually use values of this type we have the following eliminator:
\begin{agdalisting}\label{elim-prop}
  \ExecuteMetaDataInline[agda/HITs/PropositionalTruncation/Display.tex]{rec-prop-trunc}
\end{agdalisting}
This says that we can eliminate into any proposition: interestingly, this allows
us to define a monad instance for \AgdaDatatype{\(\lVert \_ \rVert\)}, meaning
we can use things like do-notation.

With this, we can define cardinal finiteness:
\begin{definition}[Cardinal Finiteness]
  A type \(A\) is cardinally finite if there exists a propositionally truncated
  proof that \(A\) is manifest Bishop finite or equivalent to a finite prefix of
  the natural numbers.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{cardinal-def}
  \end{agdalisting*}
  This predicate is called Bishop finiteness in \cite{fruminFiniteSetsHomotopy2018}.
\end{definition}
\paragraph{Deriving Uniquely-Determined Quantities}
At first glance, it might seem that we lose any useful properties we could
derive from \(\AgdaDatatype{\ensuremath{\mathcal{B}}}\).
Luckily, this is not the case: we will show here how to derive decidable
equality (\Cref{cardinal-finite-discrete}) and cardinality
(\Cref{card-finite-cardinality}) out from under the
truncation.
Those two lemmas are proven in
\citep{yorgeyCombinatorialSpeciesLabelled2014} (Proposition 2.4.9 and 2.4.10,
respectively), in much the same way as we have done here.
Our contribution for this subsection is simply the formalisation.

First we'll show that decidable equality carries over from manifest Bishop
finiteness.
Before we do, note that the fact that we can do this says something interesting
about propositional truncation: it has computational, or algorithmic, content.
That is in contrast to other ways to ``truncate'' types: \(\neg \neg P\), for
instance, is a way to provide a ``proof'' of \(P\) without revealing anything
about \(P\) in MLTT.
No matter how much we prove that a function from \(P\) doesn't care about which
\(P\) it got, though, we can never extract any kind of algorithm or computation
from \(\neg \neg P\).
\begin{lemma}\label{cardinal-finite-discrete}
  Any cardinal-finite set has decidable equality.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{card-discrete}
  \end{agdalisting*}
\end{lemma}
\begin{proof}
We already know that manifest Bishop finiteness implies decidable equality;
to apply that proof to cardinal finiteness we'll use the
eliminator in \Cref{elim-prop}.
Our task, in other words, is to prove the following:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Relation/Nullary/Discrete/Properties.tex]{is-prop-discrete}
\end{agdalisting*}

To show that this type is a proposition we must show that any two given members
of the type are equal, i.e. we are given two proofs of decidable equality on
\(A\) and we must show that they are equal.
Remember that \(\AgdaFunction{Discrete}\;A\) is a function of two arguments
returning a \AgdaDatatype{Dec} of whether those two arguments are equal or not.
\todo{ref for wherever this definition was}
By function extensionality, to prove that that is a proposition we have to prove
that \(\AgdaDatatype{Dec}\;(\agdaequiv{x}{y})\) is a proposition.
This proof requires that we show that the payload of each of the constructors
(\AgdaInductiveConstructor{yes} and \AgdaInductiveConstructor{no}) are
propositions.
\AgdaInductiveConstructor{no}'s payload is
\(\agdaequiv{x}{y}\rightarrow\agdabot\), which is a
proposition because \agdabot\; is a proposition.

\AgdaInductiveConstructor{yes} is a little more interesting: its payload is
\agdaequiv{x}{y}.
How can we prove that the path between \(x\) and \(y\) is a proposition?
It turns out that there is a class of types for which all paths are
propositions: the \emph{sets}.
\begin{agdalisting}\label{isSet}
  \ExecuteMetaDataInline[agda/Snippets/Introduction.tex]{isSet}
\end{agdalisting}
This is the next homotopy level up from the propositions (\Cref{isProp}).
More importantly, there is an important theorem relating to sets which
\emph{also} relates to decidable equality: Hedberg's theorem
\citep{hedbergCoherenceTheoremMartinLof1998}.
This tells us that any type with decidable equality is a set.
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Relation/Nullary/Discrete/Properties.tex]{discrete-isset}
\end{agdalisting*}
And of course we know that \(A\) here has decidable equality: we were just given
two proofs of that fact at the beginning of this proof!

This suffices to prove that decidable equality is itself a proposition, and
therefore that we can apply \Cref{elim-prop} and the proof that bishop
finiteness implies decidable equality to cardinal finiteness, proving our goal.
\end{proof}

The next thing we can derive from underneath the truncation in cardinal
finiteness is a natural number representing the actual cardinality of the finite
type.
Of course \Nat isn't a proposition, so the eliminator in
equation~\ref{elim-prop} won't work for us here.
Instead we will use the following:
\begin{agdalisting}\label{elim-prop-coh}
  \ExecuteMetaDataInline[agda/HITs/PropositionalTruncation/Display.tex]{rec-prop-trunc-set}
\end{agdalisting}
This says that we can eliminate into a set as long as the function we use
doesn't care about which value it's given: formally, \(f\) in this example has
to be ``coherently constant'' \citep{krausGeneralUniversalProperty2015}.

With that, we can move on to the proof:
\begin{lemma}\label{card-finite-cardinality}
  Given a cardinally finite type, we can derive the type's cardinality, as well
  as a propositionally truncated proof of equivalence with \AgdaDatatype{Fin}s of
  the same cardinality.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{cardinality-is-unique}
  \end{agdalisting*}
\end{lemma}
\begin{proof}
  The high-level overview of our proof is as follows:
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{cardinality-is-unique-impl}
  \end{agdalisting*}
  It is the composition of two operations: first, with
  \AgdaFunction{\ensuremath{\lVert \text{map} \rVert}}, we change the truncated
  proof of manifest bishop finiteness to a proof of equivalence with fin.

  Then we use the eliminator from \Cref{elim-prop-coh} with three
  parameters.
  The first simply proves that that the output is a set:
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{card-isSet}
  \end{agdalisting*}
  The second is the function we apply to the truncated value:
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{alg}
  \end{agdalisting*}
  And the third is a proof that that function is itself coherently constant:
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{const-alg}
  \end{agdalisting*}

  The tricky part of the proof is \AgdaFunction{const-alg}: here we need to show
  that \AgdaFunction{alg} returns the same value no matter its input.
  That output is a pair, the first component of which is the cardinality, and
  the second the truncated equivalence proof.
  The truncated proofs in the output are trivially equal by the truncation, so
  our obligation now has been reduced to:
  \begin{equation*}
    \frac{(n :\;\AgdaDatatype{\ensuremath{\mathbb{N}}}) \; \; \; (p : \AgdaDatatype{Fin}\;n\;\AgdaFunction{\ensuremath{\simeq}}\;A) \; \; \;
      (m :\;\AgdaDatatype{\ensuremath{\mathbb{N}}}) \; \; \; (q : \AgdaDatatype{Fin}\;m\;\AgdaFunction{\ensuremath{\simeq}}\;A)
    }{
      \agdaequiv{n}{m}
    }
  \end{equation*}
  Given univalence we have \(\AgdaDatatype{Fin}\;n \;\AgdaFunction{\ensuremath{\equiv}}\; \AgdaDatatype{Fin}\;m\),
  and the rest of our task is to prove:
  \begin{equation*}
    \frac{\agdaequiv{\AgdaDatatype{Fin}\;n}{\AgdaDatatype{Fin}\;m}}{\agdaequiv{n}{m}}
  \end{equation*}

  This is a well-known puzzle in dependently-typed programming, and one that
  has a surprisingly tricky and complex proof.
  We do not include it here, since it has already been explored elsewhere, but
  it is present in our formalisation.
\end{proof}

\paragraph{Going from Cardinal Finiteness to Manifest Bishop Finiteness}
We know of course that we can convert any proof of manifest Bishop finiteness to
a proof of Cardinal finiteness: it's just the truncation function
\AgdaInductiveConstructor{\(\lvert \_ \rvert\)}.
It's the other direction which presents a difficulty:
\begin{theorem}\label{cardinal-to-manifest-bishop}
  Any cardinal finite type with a total order is Bishop finite.
\end{theorem}
\begin{proof}
The proof for this particular theorem is quite involved in the formalisation, so
we only give its sketch here.

Our strategy will be to \emph{sort} the support list of the proof for Bishop
finiteness, and then prove that the sorting function is coherently constant,
thereby satisfying the eliminator in \Cref{elim-prop-coh}.
We need to show, in other words, that sorting two support lists from proofs of
manifest Bishop finiteness on the same type with the same order always returns
the same result.
For simplicity's sake we will use insertion sort:

\begin{minipage}{\linewidth}
\begin{multicols}{2}
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Data/List/Sort.tex]{insert}
  \end{agdalisting*} \columnbreak \vfill \null \vfill
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Data/List/Sort.tex]{insertion-sort}
  \end{agdalisting*} \vfill \null
\end{multicols}
\end{minipage} \noindent
And we prove that \AgdaFunction{sort} produces a list which is sorted, and a
permutation of its input.
\begin{multicols}{2}
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Data/List/Sort.tex]{sort-sorts}
  \end{agdalisting*} \columnbreak
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Data/List/Sort.tex]{sort-perm}
  \end{agdalisting*}
\end{multicols} \vspace{-\baselineskip}
We've introduced two new types here: \AgdaFunction{Sorted} is a predicate
enforcing that the given list is sorted, and
\AgdaFunction{\(\leftrightsquigarrow\)} is a permutation relation between two
lists.
We take the definition of permutations from
\citep{danielssonBagEquivalenceProofRelevant2012}: two lists are permutations of
each other if their membership proofs are all equivalent.
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Data/List/Relation/Binary/Permutation.tex]{perm-def}
\end{agdalisting*}
This definition fits particularly well for two reasons: first, it is defined on
containers generically, which fits well with our finiteness predicates.
Secondly, it is extremely straightforward to show that the support lists of any
two proofs of manifest Bishop finiteness must be permutations of each other:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{perm-bish}
\end{agdalisting*}

Almost all of the pieces are in place now: we know that the support lists of all
proofs of \(\agdacal{B}\;A\) are permutations of each other, and we know that
\AgdaFunction{sort} returns a sorted permutation of its input.
The final piece of the puzzle is the following:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Data/List/Sort.tex]{sorted-perm-eq}
\end{agdalisting*}
If two sorted lists are both permutations of each other they must be equal.
Connecting up all the pieces we get the following:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Data/List/Sort.tex]{perm-invar}
\end{agdalisting*}
Because we know that all support lists of \(\agdacal{B}\;A\) are permutations of
each other this is enough to prove that \AgdaFunction{sort} is coherently
constant, and therefore can eliminate from within a truncation.
The second component of the output pair (the cover proof) follows quite
naturally from the definition of permutations.
\end{proof}
To the best of our knowledge, this is the first explicit proof of this theorem.
\paragraph{Restrictiveness}
So far our explorations into finiteness predicates have pushed us in the
direction of ``less informative'': however, as mentioned in the introduction, we
can \emph{also} ask how \emph{restrictive} certain predicates are.
Since split enumerability and manifest Bishop finiteness imply each other we
know that there can be no type which satisfies one but not the other.
We also know that manifest Bishop finiteness implies cardinal finiteness, but we
do \emph{not} have a function in the other direction:
\begin{agdalisting}\label{c-to-b}
  \(\agdacal{C}\;A\rightarrow\agdacal{B}\;A\)
\end{agdalisting} \todo{Solve the mystery of the mathcal difference for C and B}
So the question arises naturally: is there a cardinally finite type which is
\emph{not} manifest Bishop finite?

It turns out the answer is no!
The proof of this fact is relatively short:
\begin{agdalisting}\label{no-gap-card-bishop}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/Cardinal.tex]{no-gap-card-bishop}
\end{agdalisting}
We can apply the function of type \(\agdacal{B}\;A\rightarrow\agdabot\)
(i.e. \(\AgdaFunction{\(\neg\)}\;\agdacal{B}\;A\)) to the value of type
\(\AgdaDatatype{\(\lVert\)}\;\agdacal{B}\;A\;\AgdaDatatype{\(\rVert\)}\) (i.e.
\(\agdacal{C}\;A\)) using \Cref{elim-prop}, since \agdabot\;is itself a
proposition.
This tells us that manifest bishop finiteness, cardinal finiteness, and split
enumerability all refer to the same class of types.

Interestingly, while we cannot construct a function with the type in
\Cref{c-to-b}, it does exist \emph{classically}.
In fact we can derive it from \Cref{no-gap-card-bishop} using
the classical monad we developed in the introduction, since
\Cref{no-gap-card-bishop} is actually equivalent to classical
implication.
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Snippets/Classical.tex]{classical-impl}
\end{agdalisting*}
\subsection{Manifest Enumerability}\label{manifest-enumerability}
Given that we have just proven that all of our finiteness predicates apply to
the same types, the natural next step is to try find a predicate which applies
to a different class of types.
Let's first talk about what this new class of types might look like:
what we're looking for is a type which is in some sense finite, but doesn't
conform to any of the predicates we've seen so far.
The \emph{circle} (Listing~\ref{circle-def}) is such a type.
The thing that this type has which precludes it from being, say, split
enumerable, is its \emph{higher homotopy structure}.

\begin{marginagdalisting}{The Circle}\label{circle-def}
  \ExecuteMetaDataInline[agda/Snippets/Circle.tex]{circle-def}
\end{marginagdalisting}

So far we have seen three levels of homotopy structure: the contractions
(\Cref{isContr}), the propositions (\Cref{isProp}), and the sets
(\Cref{isSet}).
You may have noticed the pattern that each new level is generated by saying its
paths are members of the previous level; if we apply that pattern again, we get
to the next homotopy level: the groupoids.
\begin{agdalisting}
  \ExecuteMetaDataInline[agda/Snippets/Introduction.tex]{isGroupoid}
\end{agdalisting}
These types do not necessarily have unique identity proofs: there is more than
one value which can inhabit the type \agdaequiv{x}{y}.
The circle is one of the simplest examples of non-set groupoids: the constructor
\AgdaInductiveConstructor{loop} is the extra path in the type which isn't the
identity path.

We now need to recall two facts: first, Hedberg's theorem tells us that every
discrete type is a set.
Second, every finiteness predicate we've seen thus far implies decidable
equality.
From this it's clear that all of the previous predicates are restricted to sets,
and can't include types like the circle.

But the type certainly \emph{seems} finite!
It has finitely many points, for instance.
In order to explore the ``restrictiveness'' axis in
\Cref{finite-classification}, then, we'll need to construct a predicate
which admits the circle.
Manifest enumerability is one such predicate.
\begin{definition}[Manifest Enumerability]
  Manifest enumerability is an enumeration predicate like Bishop finiteness or
  split enumerability with the only difference being a propositionally truncated
  membership proof.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestEnumerable/Container.tex]{manifest-enum-def}
  \end{agdalisting*}
\end{definition}
This predicate is novel, to the best of our knowledge.

It might not be immediately clear why this definition of enumerability allows
the circle to conform while the others do not.
The crux of the issue was that the cover proofs of the previous definitions
didn't just tell us that some element was in the support list, they told us
\emph{where} it was in the support list.
From the position we were able to derive decidable equality: that position is
precisely what's hidden in manifest enumerability.

And indeed this means that the circle is manifestly enumerable.
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestEnumerable.tex]{circle-is-manifest-enum}
\end{agdalisting*}
We use a lemma here, proven in the Cubical Agda library, that
\AgdaDatatype{S\(^1\)} is \emph{connected}:
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestEnumerable.tex]{s1-connected}
\end{agdalisting*}
\paragraph{Surjections}
We already saw that split enumerability was the listed form of a split
surjection: what we didn't explain was why the word ``split'' was placed before
surjection.
In the presence of higher homotopies than sets, split surjections are actually
\emph{not} a satisfactory definition of surjection.
And we are most certainly in the presence of higher homotopies: just moments ago
we were introduced to the circle.
In these cases, the following definition of surjections is
preferred~\cite[definition 4.6.1]{hottbook}:
\begin{agdalisting}\label{surj-eqn}
  \begin{multicols}{2}
    \ExecuteMetaDataInline[agda/Function/Surjective/Base.tex]{surjective} \columnbreak
    \ExecuteMetaDataInline[agda/Function/Surjective/Base.tex]{surjection}
  \end{multicols}
\end{agdalisting}

Much in the same way that split enumerability were split surjections, our new
predicate of manifest enumerability corresponds to the proper surjections.
\begin{lemma}
  Manifest enumerability is equivalent to a surjection from a finite prefix of
  the natural numbers.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/ManifestEnumerable.tex]{manifest-enum-surj}
  \end{agdalisting*}
\end{lemma}
\paragraph{Relation To Split Enumerability}
It is trivially easy to construct a proof that any split enumerable type is
manifest enumerable: we simply truncate the membership proof.
Going the other way is more difficult, as we need to extract the membership
proof from under a truncation.
We do know what we need, however: the key difference between manifest
enumerability and split enumerability is that the latter implied decidable
equality.
So that's the missing piece we should require in order to go from one to the
other:
\begin{lemma}\label{manifest-enum-to-split-enum}
  A manifestly enumerable type with decidable equality is split enumerable.
\end{lemma}

Now that we know what extra bit of information we are allowed use in this proof,
the path forward becomes a little more clear.
In terms of the actual conversion function, the support list will stay the same,
and only the return type of the cover proof needs to change: from
\(\AgdaDatatype{\(\lVert\)}\;x\;\AgdaFunction{\(\in\)}\;\mathit{xs}\;\AgdaDatatype{\(\rVert\)}\)
to \(x\;\AgdaFunction{\(\in\)}\;\mathit{xs}\).

That can be accomplished with the help of the following function:
\begin{agdalisting}
  \ExecuteMetaDataInline[agda/HITs/PropositionalTruncation/Properties.tex]{recompute}
\end{agdalisting}
Given a decision procedure for some type, and a propositionally truncated value
of that type, we can construct an element of the type.

In the case of \(x\;\AgdaFunction{\(\in\)}\;\mathit{xs}\) we can construct a
decision procedure for membership of a list, since we already have decidable
equality on the elements of the list, proving our obligation.
\subsection{Kuratowski Finiteness}\label{kuratowski}
We now finally arrive at the most important definition of finiteness: Kuratowski
finiteness.
As a definition, it is quite different from the predicates we've seen (it
doesn't involve lists, for instance), but it plays a much larger role in the
literature on finiteness predicates than, say, manifest enumerability.

We start with the definition of Kuratowski-finite subsets.
\begin{agdalisting}
  \ExecuteMetaDataInline[agda/Algebra/Construct/Free/Semilattice/Definition.tex]{kuratowski-def}
\end{agdalisting}
The first two constructors are point constructors, giving ways to create
values of type \(\agdacal{K}\;A\).
They are also recognisable as the two constructors for finite lists, a type
which represents the free monoid.
The next two constructors add extra paths to the type: equations that usage of
the type must obey.
These extra paths turn the free monoid into the free \emph{commutative}
(\AgdaInductiveConstructor{com}) \emph{idempotent}
(\AgdaInductiveConstructor{dup}) monoid.
The final constructor truncates the type \(\agdacal{K}\;A\) to a set.

The Kuratowski finite subset is a free join semilattice (or, equivalently, a
free commutative idempotent monoid).
More prosaically, \(\agdacal{K}\) is the abstract data type for finite sets, as
defined in the Boom hierarchy \citep{boomFurtherThoughtsAbstracto1981,
  bunkenburgBoomHierarchy1994}.
However, rather than just being a specification, \(\agdacal{K}\) is fully usable
as a data type in its own right, thanks to HITs.

Other definitions of \(\agdacal{K}\) exist (such as the one in
\citep{fruminFiniteSetsHomotopy2018}) which make the fact that \(\agdacal{K}\) is
the free join semilattice more obvious.
We have included such a definition in our formalisation, and proven it
equivalent to the one above.
\begin{agdalisting*}
  \ExecuteMetaDataInline[agda/Algebra/Construct/Free/Semilattice/Direct.tex]{direct-def}
\end{agdalisting*}

Next, we need a way to say that an entire type is Kuratowski finite.
For that, we will need to define membership of \(\agdacal{K}\).
\begin{equation*}
  \begin{alignedat}{2}
    x\;\AgdaFunction{\ensuremath{\in}}& \; \AgdaInductiveConstructor{[]}                      &&= \agdabot \\
    x\;\AgdaFunction{\ensuremath{\in}}& \; y \;\AgdaInductiveConstructor{\ensuremath{\dblcolon}}\; \mathit{ys} &&= \AgdaDatatype{\ensuremath{\lVert}}\;\agdaequiv{x}{y}\;\AgdaDatatype{\ensuremath{\uplus}}\;x\;\AgdaFunction{\ensuremath{\in}}\;\mathit{ys}\;\AgdaDatatype{\ensuremath{\rVert}}
  \end{alignedat}
\end{equation*}
The \AgdaInductiveConstructor{com} and \AgdaInductiveConstructor{dup}
constructors are handled by proving that the truncated form of \AgdaDatatype{\ensuremath{\uplus}}
itself commutative and idempotent.
The type of propositions is itself a set, satisfying the \AgdaInductiveConstructor{trunc}
constructor.
This gives us enough to define Kuratowski finiteness.
\begin{definition}[Kuratowski Finiteness]
  A type is Kuratowski finite if there exists a Kuratowski-finite subset of that
  type which contains every element of the type.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Kuratowski.tex]{kuratowski-finite-def}
  \end{agdalisting*}
\end{definition}

While Kuratowski finiteness is something of the standard formal definition of
finiteness, it is quite separated from the enumeration-based definitions we have
presented so far.
It's difficult to relate to surjections and equivalences, and requires a
different style of proof to reason about.
As such, we want to get \emph{away} from Kuratowski finiteness as quickly as
possible.
To do so we use the following lemma:
\begin{lemma} \label{manifest-enum-kuratowski}
  Kuratowski finiteness is equivalent to truncated manifest enumerability.
  \begin{agdalisting*}
    \ExecuteMetaDataInline[agda/Cardinality/Finite/Kuratowski.tex]{manifest-enum-kuratowski}
  \end{agdalisting*}
\end{lemma}
\begin{proof}
  This proof is constructed by providing a pair of functions, to and from each
  side of the equivalence.
  This pair implies an equivalence, because both source and target are
  propositions.
  This proof, as well as its auxiliary lemmas, are also provided in
  \citet{fruminFiniteSetsHomotopy2018}, although there the setting is HoTT
  rather than CuTT.
\end{proof}
By relating Kuratowski finiteness---with a full equivalence, no less---to an
enumerated predicate, we have made it possible to talk about Kuratowski
finiteness without interacting with the type at all.

In the next subsection, we will explore the category of discrete Kuratowski finite
sets.
Under the hood, however, we will really be working with cardinal finite sets.
We can do this in a fully rigorous way because
\Cref{manifest-enum-kuratowski} allows us to prove the following:
\begin{agdalisting}\label{cardinal-kuratowski}
  \ExecuteMetaDataInline[agda/Cardinality/Finite/Kuratowski.tex]{card-iso-kuratowski}
\end{agdalisting}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../paper"
%%% End: