text:
\begin{document}

\maketitle

\begin{abstract}
Modifications to a neural network's input and output layers are often required to accommodate the specificities of most practical learning tasks. However, the impact of such changes on architecture's approximation capabilities is largely not understood. We present general conditions describing feature and readout maps that preserve an architecture's ability to approximate any continuous functions uniformly on compacts. As an application, we show that if an architecture is capable of universal approximation, then modifying its final layer to produce binary values creates a new architecture capable of deterministically approximating any classifier. In particular, we obtain guarantees for deep CNNs and deep feed-forward networks.  Our results also have consequences within the scope of geometric deep learning. Specifically, when the input and output spaces are Cartan-Hadamard manifolds, we obtain geometrically meaningful feature and readout maps satisfying our criteria.

Consequently, commonly used non-Euclidean regression models between spaces of symmetric positive definite matrices are extended to universal DNNs. The same result allows us to show that the hyperbolic feed-forward networks, used for hierarchical learning, are universal. Our result is also used to show that the common practice of randomizing all but the last two layers of a DNN produces a universal family of functions with probability one.  We also provide conditions on a DNN's first (resp. last) few layer's connections and activation function which guarantee that these layer's can have a width equal to the input (resp. output) space's dimension while not negatively effecting the architecture's approximation capabilities.
\end{abstract}
\vspace*{-1em}
\section{Introduction}\label{s_Intro}
\vspace*{-.5em}
Modifications made to a neural network's input and output maps to extract features from a data-set or to better suit a learning task is prevalent throughout learning theory.   Typically, such changes are made by pre-(resp. post-)composing an architecture with a fixed and untrainable feature (resp. readout) map.  Examples prevail classification by neural networks, random feature maps obtained by randomizing all but the last few layers of a feed-forward network, and numerous illustrations throughout geometric deep-learning theory, which we detail below.
This motivates the central question of this paper: \textit{"Which modifications to the input and output layers of a neural network architecture preserve its universal approximation capabilities?"}

Specifically, in this paper we obtain a simple sufficient condition on a pair of a feature map $\phi:\xxx\rightarrow \rrm$ and a readout map $\rho:\rrn\rightarrow \yyy$, where $\xxx$ and $\yyy$ are topological spaces, guaranteeing that if $\fff$ is dense in $C(\rrm,\rrn)$ for the uniform convergence on compacts (ucc) topology then
\begin{equation}
\smash{
\{f \in C(\xxx,\yyy):\, \rho\circ f \circ \phi, \, f \in \fff\},
}
\label{eq_general_modified_architecture_description}
\end{equation}
is dense in $C(\xxx,\yyy)$ in the uniform convergence on compacts topology when $\yyy$ is metric and, more generally, in the compact-open topology when $\yyy$ is non-metrizable (such as in the hard classification problem).  Simplified conditions are obtained when $\yyy$ is a metrizable manifold, and characterization of $\rho$ and $\phi$ is obtained when both $\xxx$ and $\yyy$ are smooth manifolds.

The set $\fff$ represents any expressive neural network architecture.  For example, by \cite{leshno1993multilayer} $\fff$ can be taken to be the set of feed-forward networks with one hidden layer and continuous, locally-bounded, and non-polynomial activation function.  Or, by \cite{zhou2020universality}, $\fff$ can be taken to be the set of deep convolution networks with specific sparsity structures and ReLu activation function.  Throughout $\fff$ is often referred to as an architecture. The results are not limited to neural networks and remain valid when, for example, $\fff$ is taken to be the set of posterior means generated by a Gaussian processes universal kernel, as in \cite{micchelli2006universal}.
The central results are motivated by the following consequences.
\vspace*{-1em}
\subsection*{Implication: Method for Constructing Non-Euclidean Universal Approximators}\label{ss_implications}
\vspace*{-.5em}
A natural hub for our results is in \textit{geometric deep learning}, an emerging field of machine learning, which acknowledges and makes use of the latent non-Euclidean structures present in many types of data.  Applications of geometric deep learning are prevalent throughout neuroimaging \cite{fletcher2011geodesic}, computer-vision \cite{pennec2006riemannian}, covariance learning \cite{meyer2011regression}, and learning from hierarchical structures such as complex social networks \cite{krioukov2010hyperbolic}, undirected graphs \cite{munzner1997h3}, and trees \cite{SalaHyperbolicTradeoffs}.

For instance, in \cite{NIPS2017_7213}, it is shown that low-dimensional representations for complex hierarchical structures into hyperbolic space outperform the current state-of-the-art high-dimensional Euclidean embedding methods due to the tree-like geometry of the former.  Using the theory of gyro-vector space, introduced in \cite{GyroUngar}, \cite{ganea2018hyperbolic} proposed a hyperbolic-space variant of the feed-forward architecture and demonstrated its superior performance in learning hierarchical structure from these hyperbolic representations.  A direct application of our main result confirms that this non-Euclidean architecture can indeed approximate any continuous function between hyperbolic spaces.

More generally, we obtain an explicit construction of feed-forward networks between any Cartan-Hadamard manifold and a guarantee that our construction is universal.  Cartan-Hadamard manifolds appear throughout applied mathematics from the symmetric positive-definite matrix-valued regression problems of \cite{fletcher2011geodesic,meyer2011regression}, which we extend to universal approximators, to applications in mathematical finance in \cite{henry2008analysis}, Gaussian processes in \cite{mallasto2017learning}, information geometric in \cite{jostInformationGeometry}, and to the geometry of the Wasserstein space \cite{LottGeometryWassersteinNonPositive2008} commonly used in Generative Adversarial Networks as in \cite{arjovsky2017wasserstein}.

\vspace*{-1em}
\subsection*{Implication: Universal Approximation Implies Universal Classification}
\vspace*{-.5em}

Perhaps the most commonly used readout maps are those used when modifying neural-networks to perform classification tasks.  The currently available theoretical results, found in \cite{farago1993strong}, guarantee that for a random vector in $\rrm$ with random labels, the set of feed-forward networks with one hidden layer, step activation function $\sigma(x)=I_{[0,\infty)} - I_{(-\infty,0]}$, and readout map $\rho(x)_i=I_{[\frac1{2},\infty)}$ can approximate the Bayes' classifier in probability.

As an application of this paper's main results, we obtain deterministic guarantees of generic hard ($n$-ary) and soft (fuzzy) classification on $\rrm$ for any given universal approximator in $C(\rrm,\rrn)$ once it's outputs are modified by a continuous surjection $\rho$ to take values in $\{0,1\}^n$ or $(0,1)^n$, respectively.   For example, our result applies to feed-forward networks with at-least one hidden layer holds when $\rho$
the component-wise logistic $\rho(x)_i=I_{[\frac1{2},1]}\circ \frac{e^{x_i}}{1+e^{x_i}}$ readout map
.

\vspace*{-1em}
\subsection*{Implication: DNNs with Randomly Generated First Layers are Universal}
\vspace*{-.5em}
We show that the commonly employed practice of only training the final layers of a deep feed-forward network and randomizing the rest preserves its universal approximation capabilities with probability $1$.  Though widely used, this practice has only recently begun to be studied in \cite{gonon2020approximation,louart2018random}.  The link with our results arises from an observation made in \cite{louart2018random}, stating that the first portion of such a random architecture can be seen as a randomly generated feature map.
\vspace*{-1em}
\subsection*{Implication: DNNs Can be Narrowed}
\vspace*{-.5em}
In \cite{johnson2018deep,park2020minimum} the authors provide lower bounds on a DNN layer's width, under which it is no longer a universal approximator.  However, there is a wealth of literature which shows that arranging a network's neurons to create depth rather than width yields empirically superior performance.  As a final application of our theory, we provide explicit conditions on a DNN's connections and activation functions so additional initial and final few layers may be added to a DNN which do not respect the minimum width requirements of \cite{johnson2018deep,park2020minimum} but do not negatively impact the DNN's approximation capabilities.  Numerical implementations show that additional depth build using our main results improve predictive performance additional deep layers failing our assumptions reduced the network's predictive performance.

This paper is organized as follows.  Section~\ref{s_background_topology} discusses the necessary topological and geometric background needed to formulate the paper's central results.  Section~\ref{ss_general} contains the paper's main results discussed above.  The conclusion follows in section~\ref{s_Conclusion}.  The proofs of the main results are contained within this paper's supplementary material.
\vspace*{-1em}
\section{Background}\label{s_background_topology}
\vspace*{-.5em}
\subsection{General Topology}\label{ss_gen_top}
\vspace*{-.5em}
Before moving on to the main results of the paper, we will require some additional topological terminology.  The \textit{interior} of a subset $A\subseteq \xxx$ of a topological space is the largest open subset contained in $A$.  For example, in the Euclidean space $\rr$, the interior of $[0,1)$ is $(0,1)$.  The \textit{closure} of $A$ is the smallest closed-set containing $A$.  Therefore, the closure of $[0,1)$ in $\rr$ is $[0,1]$.  The difference between the closure of $A$ and its interior is called the \textit{boundary} of $A$ and is denoted by $\partial A$.  For example, the boundary of $[0,1)$ in the Euclidean space $\rr$ is $\{0,1\}$.  A subset $A\subseteq \rrm$ is called a \textit{retract} of $\rrm$ if there is a continuous map $r:\rrm\to A$ such that $r\circ \iota_A =1_{A}$, where $\iota_A:A \to \rrm$ is the inclusion map and $1_{A}$ is the identity map on $A$.  Dually, a continuous right-inverse of a continuous surjective map is called a \textit{section}.  A \textit{covering projection} $f:\rrn\to \yyy$ is a surjective continuous function such that for every $x \in \yyy$ there is an open set $U_x$, containing $x$, such that $\rho^{-1}[U]=\bigcup_{\alpha \in A} U^{\alpha}_x$ and $\{U^{\alpha}_x\}_{a \in A}$ is a disjoint collection of open sets for which $\rho|_{U^{\alpha}_x}:U^{\alpha}_x \to U_x$ is a homeomorphism.  For example, the map $x\to e^{-i \pi x}$ is a covering projection of $\rr$ onto the circle.

Lastly, since continuous maps transfer topological information then a continuous bijection with continuous inverse preserves all topological information.  Such a map is called a \textit{homeomorphism} and two topological spaces related by a homeomorphism are said to be \textit{homeomorphic}.  For example, the sigmoid (or logistic) function $x\mapsto \frac{e^x}{1+e^x}$ continuously puts $\rr$ in bijection with $(0,1)$ and its inverse is the logit function $y \mapsto \ln\left( \frac{y}{1-y}\right)$, which is continuous.  Therefore, $\rr$ and $(0,1)$ are homeomorphic.  A continuous injective map $\phi:\xxx\to \rrm$ such that $\xxx$ is homeomorphic to $\phi(\xxx)$ is called an \textit{embedding.  }

A topological space $\xxx$ is said to be \textit{locally-compact} if every $x \in \xxx$ is contained in an open subset $U_x$ of $\xxx$ which is in turn contained in an compact subset $K_U$ of $\xxx$.  For example, every point $x \in \rr$ is contained in $(x-1,x+1)$ which is in turn contained in the closed-bounded (and therefore compact-set by the Heine-Borel theorem) $[x-1,x+1]$.  A topological space is said to be \textit{simply connected}, if every two paths between points can be continuously deformed into one another.

Similarly to \cite{brown1962locally,MR267588}, we say that a subset $A$ of a topological space $\xxx$ is \textit{collared} if there exists an open subset $U\subseteq \xxx$ containing $A$ and a homeomorphism $\phi:U\rightarrow A\times [0,1)$ mapping $A$ to $A\times [0,1)$.  In this way the open set $U$ is, in a sense, topologically similar to $A$ itself since one can imagine shrinking any point $(a,t)\in A\times [0,1)$ down to $(a,0)$ and then identifying it back with $a$ via $\psi$.

We denote the set of positive integers by $\nn^+$.
\vspace*{-1em}
\subsection{Topology of Function Spaces}\label{ss_top_is_fun}
\vspace*{-.5em}
Let $C(\rrm,\rrn)$ denote the set of all continuous functions from the Euclidean space $\rrm$ to the Euclidean space $\rrn$.  Closeness in $C(\rrm,\rrn)$ can be described in a number of ways but in the context of universal approximation theorems of \cite{Cybenko,hornik1991approximation,leshno1993multilayer} two functions $f$ and $g$ are thought of as being close if they are uniformly close on compacts; that is, for a fixed $\epsilon>0$ and every non-empty compact subset $K\subseteq \rrm$
\vspace*{.5em}
\begin{equation}
\smash{\sup_{x \in K}
\sqrt{\sum_{i=1}^n \left|
	f(x)_i - g(x)_i
	\right|^2}
<\epsilon
}
.
\label{eq_ucc_definition}
\end{equation}

\vspace*{-.1em}
The topology described by~\eqref{eq_ucc_definition} is called the \textit{topology of uniform convergence on compacts}, henceforth ucc topology.  If $\rrn$ is replaced by any other topological space $\yyy$ whose notion of closeness is defined by a distance function and $\rrm$ is replaced by nearly any other topological space then closeness in the collection of continuous functions from $\xxx$ to $\yyy$, denoted by $C(\xxx,\yyy)$, can be described analogously to~\eqref{eq_ucc_definition} by replacing the Euclidean distance on $\rrn$ by another distance function $d$-on $\yyy$, the compact subsets $K\subseteq \rrm$ with compact subsets of $\xxx$, and taking $f,g \in C(\xxx,\yyy)$.  The topology on $C(\xxx,\yyy)$ defined in this way is still called the ucc topology.

If a distance function cannot describe the topology on $\yyy$, for example, we will see that this is the case for reasonable topologies on $C(\xxx,\{0,1\}^n)$, then one cannot define the ucc topology.  Instead, consider the smallest topology on $C(\xxx,\yyy)$ containing the sets
\begin{equation}
\hspace*{-1.25em}
\smash{
\begin{aligned}
&\left\{V_{K,O}:\, \emptyset\neq K\subseteq \xxx \mbox{ compact and } \emptyset\neq O\subseteq \yyy \mbox{ open}\right\},
V_{K,O}\triangleq \left\{
f \in C(\xxx,\yyy):\,
f(K)\subseteq O
\right\}.
\end{aligned}
}
\label{eq_co_topology_definition}
\end{equation}
When the topology on $\yyy$ is defined by a distance function and $\xxx$ is a locally-compact Hausdorff space, then the smallest topology containing~\eqref{eq_co_topology_definition} coincides with the ucc topology.  However, unlike the ucc topology, the smallest topology containing~\eqref{eq_co_topology_definition} is well-defined on $C(\xxx,\yyy)$ for any topological spaces $\xxx$ and $\yyy$.  This generalized ucc topology is called the \textit{compact-open topology} (co-topology).
\vspace*{-1em}
\subsection{Manifolds}\label{ss_Manifolds}
\vspace*{-.5em}
A (topological) \textit{manifold} is a topological space which "closeup" looks like a a path in Euclidean space, whereas a manifold with boundary locally looks like a path of Euclidean space but may have a hard edge.
\begin{defn}[Metrizable Manifold with Boundary; {\citep{brown1962locally}}]\label{defn_Manifold_with_boundary}
	A topological space $\yyy$ is said to be a metrizable manifold with boundary if
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item For every $y \in \yyy$, there is an open $U_y\subseteq \yyy$ containing $y$ which is homeomorphic to
		\begin{equation}
		\left\{
		(z_1,\dots,z_{n}) \in \rrn:\,
		\sqrt{
			\sum_{i=1}^{n} z_i^2
		}
		<1 \mbox{ and } z_n\geq 0
		\right\},
		\label{eq_upper_Euclidean}
		\end{equation}
		\item There exists a distance function (metric) $d:\yyy^2\rightarrow \yyy$ such that the topology on $\yyy$ coincides with the smallest topology on $\yyy$ containing the open balls $\left\{
		B_{\epsilon}(y)
		\right\}_{\epsilon>0,y \in \yyy}
		$; where
		$$
		\smash{

			B_{\epsilon}(y) \triangleq

			\left\{
			z \in \yyy:\, d(z,y)<\epsilon
			\right\}
			.

		}
		$$
	\end{enumerate}
	We say that $d$ is a metric for $\yyy$.
	The subset of $\yyy$ consisting of all points $y$ contained in some open set $U_y$ which is homeomorphic to the interior of~\eqref{eq_upper_Euclidean} is denoted by $\inter{\yyy}$.
\end{defn}
\vspace*{-.25em}

A \textit{smooth manifold} without boundary, is a manifold for which there is a well-defined differential calculus admitting arbitrarily many derivatives and which can locally be deformed into Euclidean space via infinitely differentiable maps with infinitely differentiable inverses.

An $m$-dimensional \textit{Riemannian manifold} $\mmm$ is a manifold without boundary which can be locally smoothly deformed into Euclidean space such that curvature and length can be meaningfully compared, locally, between $\rrm$ and $\mmm$.  Amongst other things, this allows the definition of minimal-length curves connecting points on $\mmm$, called \textit{geodesics}.  If any two points on $\mmm$ can be connected by such a minimal length curve then $\mmm$ is said to be \textit{complete}.  Moreover, when $\mmm$ is complete and connected, the function mapping any two points $p,q \in \mmm$ to the length of a geodesic connecting them defines a metric $d_{\mmm}$.  Thus, $\mmm$ has a geometrically meaningful metric structure where distance represents the length of maximally efficient trajectories and $C(X,\mmm)$.  The existence of $d_{\mmm}$ also implies that $C(\xxx,\mmm)$ is equipped with the ucc-topology.

Further, when $\mmm$ is complete and connected the Hopf-Rinow Theorem, of \cite{HopfRinow1931}, affirms that for any given $p \in \mmm$, the map sending any $v \in \rrm$ lying tangent to $p$ to the point on $\mmm$ arrived at time $t=1$ by traveling along a the geodesic with initial velocity $v$ defines a surjection from $\rrm$ onto $\mmm$.  This map is called the \textit{Riemannian Exponential map} on $\mmm$ at $p$ and is denoted by $\operatorname{Exp}^{\mmm}_p$.  In \cite{itoh1998dimension}, it is shown that, in this case, $\operatorname{Exp}_p^{\mmm}$ has a smooth inverse outside a low-dimensional subset $C_p$.  This inverse is denoted by $\operatorname{Log}_p^{\mmm}$ and is known to locally preserve length between $\rrm$ and $\mmm$ along geodesics emanating from $p$.
This means that $\operatorname{Log}_p^{\mmm}$ and $\operatorname{Exp}_p^{\mmm}$ are geometrically meaningful feature and readout maps, respectively.

However, the set $\partial C_p$ can be pathological or difficult to deal with.  This issue is overcome by turning to the sub-class of \textit{Cartan-Hadamard manifolds}.  A Riemannian manifold $\mmm$ is Cartan-Hadamard if it is simply connected and has \textit{non-positive curvature}.  Non-positive curvature mean that all triangles drawn on $\mmm$ by geodesics have internal angles adding-up at-most $180^{\circ}$.
\vspace*{-1em}
\section{Main Results}\label{ss_general}
\vspace*{-.5em}
Let $\phi:\xxx\rightarrow \rrm$ and $\rho:\rrn\rightarrow \yyy$. Subsets of $\rrn$ (resp $\rrm$) will be equipped with the (relative) Euclidean topology unless explicitly stated otherwise.  Equip $C(\xxx,\yyy)$ with the co-topology, $C(\rrm,\rrn)$ with the ucc topology,
let $\fff$ be a \textit{dense} subset of $C(\rrm,\rrn)$ such as the architectures studied in \cite{leshno1993multilayer,lu2017expressive,zhou2020universality} or the posterior means of a Gaussian process with universal kernel as in \cite{micchelli2006universal}, and define the subset $\fff_{\rho,\phi}\subseteq C(\xxx,\yyy)$ by
\begin{equation}
\smash{
\fff_{\rho,\phi} \triangleq \left\{
g \in C(\xxx,\yyy):\, g= \rho \circ f\circ \phi \,\mbox{ where }
f \in \fff
\right\}
.
}
\label{eq_lift_of_fff}
\end{equation}
The set $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$ under the following assumptions on $\phi$ and $\rho$.
\begin{ass}[Feature Map Regularity]\label{ass_regularity_feature}
The map $\phi$ is a continuous and injective.

\end{ass}
\begin{ass}[Readout Map Regularity]\label{ass_regularity_readout}
	Suppose that the readout map $\rho$ satisfies the following:
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item Either of the following hold:
		\begin{enumerate}[(a)]
		\vspace*{-1em}
		\itemsep -.25em
		    \item $\rho$ is a continuous and it has a section on $\im{\rho}$,
		    \item $\rho$ is a covering projection of $\rrm$ onto $\im{\rho}$ and $\xxx$ is connected and simply connected,
		\end{enumerate}
		\item $\im{\rho}$ is dense in $\yyy$,
		\item $\partial\im{\rho}$ is collared
		.
	\end{enumerate}
\end{ass}
\begin{thrm}[General Version]\label{thrm_main_General_version}
	Suppose that $\fff$ is dense in $C(\rrm,\rrn)$.
	If Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} hold then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{thrm}
\vspace*{-.75em}

Just as in the filtering literature of \cite{clark2005robust}, one would hope that the outputs of any learning model should depend continuously on its inputs.  Therefore, we only consider feature maps $\phi$ which are continuous functions.  In this case, Assumption~\ref{ass_regularity_feature} is \textit{sharp}.  We denote the identity map $x\mapsto x$ on $\rrn$ by $1_{\rrn}$.
\begin{thrm}[Assumption~\ref{ass_regularity_feature} is Sharp]\label{thrm_sharpness_of_injectivity}
Let $\xxx$ be a metrizable manifold with boundary, let $\phi$ be continuous, and $\fff\subseteq C(\rrm,\rrn)$.  Then $\fff_{1_{\rrn},\phi}$ is dense in $C(\xxx,\rrn)$ if and only if $\phi$ is injective.
\end{thrm}
\vspace*{-.25em}
\begin{rremark}[{Sharpening Assumption~\ref{ass_regularity_readout}}]\label{rremark}
Assumption~\ref{ass_regularity_readout} is almost sharp and a characterization can be obtained using the $\zzz$-sets studied in \cite{TorunczyykHlocallyhomotopynegligeablesets,MR3091356}. However, it is unlikely that a
non-pathological example can be generated which falls outside the scope of Assumption~\ref{ass_regularity_readout}.
\end{rremark}
\vspace*{-1em}
Theorem~\ref{thrm_sharpness_of_injectivity} shows that it is easy to verify if a feature map preserves the universal approximation property.  However, it can be much more challenging to verify if and when the readout map $\rho$ does so.

The following presents a readily applicable case of Theorem~\ref{thrm_main_General_version}.  They highlight the convenient fact that if $\rho$ is surjective then only Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} (i) need to be verified.
\vspace*{-.25em}
\begin{cor}\label{cor_surjective_trick_A}
	If $\phi$ is a continuous injective map, $\rho$ is a surjective covering projection, and $\fff$ is dense in $C(\rrd,\rrD)$ then ${\fff}_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.  In particular, $\phi$ and $\rho$ may be homeomorphisms.
\end{cor}
\vspace*{-.5em}
When both $\phi$ and $\rho$ fully preserve topological structure then Corollary~\ref{cor_surjective_trick_A} sharpens.
\vspace*{-.25em}
\begin{prop}[Homeomorphic case is Sharp]\label{prop_homeomorphisms}
	Let $\phi$ and $\rho$ be homeomorphisms.  Then $\fff$ is dense in $C(\rrm,\rrn)$ if and only if $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{prop}
\vspace*{-.25em}
\begin{cor}\label{cor_surjective_trick}
	If $\phi$ is a continuous injective map, $\rho$ is a continuous surjection with a section, $\xxx$ is connected and simply connected, and $\fff$ is dense in $C(\rrd,\rrD)$ then ${\fff}_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{cor}
\vspace*{-.25em}
When additional structure is assumed of $\yyy$, as is common in most applications, Assumption~\ref{ass_regularity_readout} (ii) and (iii) can be omitted and the other assumptions can be simplified.  Specifically, the case where $\yyy$ is a manifold with boundary is considered.  In the case where $\xxx$ and $\inter{\yyy}$ are smooth, then Theorem~\ref{thrm_main_General_version} can be further streamlined as follows.
\begin{ass}[Readout Map Regularity: Geometric Version]\label{ass_readout_geometric_version}
	Suppose that $\rho$ satisfies:
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item $\rho$ satisfies Assumption~\ref{ass_regularity_readout} (i) and $\im{\rho}\subseteq \inter{\yyy}$,
		\item $
		\inter{\yyy}- \im{\rho}$ is a (possibly empty) smooth submanifold of $\inter{\yyy}$ of dimension strictly less-than
		$
		\dim(\inter{\yyy}) - n.
		$
	\end{enumerate}
\end{ass}
\begin{thrm}[Geometric Version]\label{thrm_main_Geometric_version}
	Let $\yyy$ be a metrizable manifold with boundary, for which $\inter{\yyy}$ is a smooth manifold, $\xxx$ is locally-compact, and $\fff$ is dense in $C(\rrm,\rrn)$.
	If $\phi$ satisfies Assumption~\ref{ass_regularity_feature} and $\rho$ satisfies Assumption~\ref{ass_readout_geometric_version} then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{thrm}
\vspace*{-.75em}
Consequences of these results in various areas of machine-learning are now considered.
\vspace*{-1em}
\subsection{Dense Families in {$C(\rrm,\rrn)$} Induce Universal Classifiers}\label{s_Uni_class_ff}
\vspace*{-.5em}
Let $\xxx$ be a set, $\phi:\xxx\to \rrm$ be a bijection, and $\{L_i\}_{i=1}^n$ be a collection of labels describing elements of $\xxx$.  Let $\xxx_i\triangleq \left\{x \in \xxx:\, x \mbox{ has label }L_i\right\}$.  For example, $\{\xxx_i\}_{i=1}^n$ are disjoint and cover $\xxx$ then we obtain the $n$-ary classification problem, but in general, any $x \in \xxx$ may simultaneously have distinct multiple labels.
Without loss of generality, we may assume that $\xxx$ is a topological space which is homeomorphic to $\rrm$ since we may equip it with the topology $\{\phi^{-1}[U]: U\mbox{ open in } \rrm\}$.  Assume that the sets $\{\xxx_i\}_{i=1}^n$ are open subsets of $\xxx$.

In the stochastic case, the Bayes classifier is the golden standard for classification.  In the deterministic case, the standard is clearly the \textit{ideal classifier} $\hat{h}:\xxx\to \{0,1\}^n$, introduced here, and defined by
\begin{equation}
\smash{
	\hat{h}(x)_i \triangleq I_{\xxx_i}(x),
}
\label{eq_definition_ideal_classifier}
\end{equation}
where $I_{\xxx_i}$ is the indicator function of $\xxx_i$, taking value $1$ if $x \in \xxx_i$ and $0$ otherwise.

Since the usual Euclidean topology on $\{0,1\}^n$ coincides with the discrete topology on $\{0,1\}^n$ and since a continuous functions to a discrete topological space are constant, see \cite{rudin1987real}, then $\hat{h}$ only belongs to $C(\xxx,\{0,1\}^n)$ if it is trivial, i.e.: either $\xxx_i=\xxx$ or $\xxx_i = \emptyset$ for each $i$.  Moreover, a direct computation shows that there are exactly $2^n$ functions in $C(\xxx,\{0,1\}^n)$.  Thus, other topologies must be considered on $\{0,1\}^n$ in order to have a meaningful deterministic classification theory.

When $n=1$, there are two other choices of topologies on $\{0,1\}$, up to homeomorphism.  These are the trivial topology $\{\emptyset,\{0,1\}\}$ and the \textit{Sierpi\'{n}ski topology} $\{\emptyset,\{1\},\{0,1\}\}$.  The trivial topology is uninteresting since a direct computation shows that with it every function in $C(\xxx,\{0,1\})$ becomes indistinguishable, i.e.: the co-topology on $C(\xxx,\{0,1\})$ becomes trivial and therefore density in $C(\xxx,\{0,1\})$ holds trivially for any non-empty subset.  In the case of the Sierpiński topology
in \citep[Chapter 7]{taylor2011foundations} it is shown that all indicator functions of any open set $\xxx$ from any sufficiently regular topological space, such as $\xxx$, is a continuous function to $\{0,1\}$ with the Sherpiński topology.  This latter property has lead to widespread use of this space in semantics.

The next result shows that $\hat{h}$ can be approximated on two fronts simultaneously.  First, by showing that $\hat{h}$ has a natural decomposition as $I_{(\frac1{2},1]}$ applied component-wise to continuous \textit{soft (fuzzy) classifier} $\hat{s}$, i.e. $\hat{s}\in C(\xxx,[0,1]^n)$, satisfying
\begin{equation}
\smash{
\hat{s}^{-1}_i[(1/2,1]] = \xxx_i, \qquad(\forall i=1,\dots,n)
.
}
\label{eq_soft_hard_decomposition}
\end{equation}
Subsequently, the architecture $\fff_{\rho,\phi}$ is shown to simultaneously approximate $\hat{s}$ uniformly on compacts in $C(\xxx,[0,1]^n)$ and $\hat{h}$ in the compact-open topology on $C(\xxx,\{0,1\}^n)$.  Intuitively,~\eqref{eq_soft_hard_decomposition} represents the philosophy of logistic regression where one approximates on the interval and the thresholds the logistic classifier to obtain a strict decision rule, and thus a hard classifier.
\begin{thrm}[Universal Classification: General Case]\label{thrm_universal_hard_classification}
	Let $\{0,1\}^n$ be equipped with the $n$-fold product of the Sierpi\'{n}ski topology on $\{0,1\}$, $\phi$ be continuous and injective, $\rho:\rrn \to (0,1)^n$ be a homeomorphism, $\alpha \in (0,1)$, and $\fff\subseteq C(\rrm,\rrn)$ be dense.  Let $\{\xxx_i\}_{i=1}^n$ be a set of open subsets of a metric space $\xxx$ and let $\hat{h}$ be its associated ideal classifier defined by~\eqref{eq_definition_ideal_classifier}.  Then the following hold:
		\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item (Hard-Soft Decomposition) There exist continuous functions $\hat{s}_i\in C(\xxx,[0,1])$ such that
	$$
	\smash{
	\hat{h} = I_{(\alpha,1]}\bullet \left(
	\hat{s}_1,\dots,\hat{s}_n
	\right)
	\qquad \hat{s}^{-1}_i[(\alpha,1]] = \xxx_i , (\forall i =1,\dots,n)
	}
	$$
	\item (Universal Classification) There exists a sequence $\{f_k\}_{k \in \nn}$ in $\fff$ such that:
	\begin{enumerate}[(a)]
	\vspace*{-.5em}
	\itemsep -.1em
		\item (Soft Classification) For each non-empty compact subset $\kappa\subseteq \xxx$ and every $\epsilon>0$, there is some $K \in \nn^+$ such that
		$$
		\smash{
		\sup_{x \in \kappa} \max_{i=1,\dots,n}\,
		\left|
		\rho \circ f_k \circ \phi (x)_i
			-
		\hat{s}_i(x_i)
		\right|<\epsilon
		,\qquad (\forall k \geq K)
		}
		$$
		\item (Hard Classification) $I_{(\alpha,1]}\bullet \rho \circ f_k \circ \phi$ converges to $\hat{h}$ in $C(\xxx,\{0,1\}^n)$ for the co-topology.
		\end{enumerate}
	\end{enumerate}
Furthermore, $\fff_{\rho,\phi}$ is dense in $C(\xxx,[0,1]^n)$.
\end{thrm}
As an application, we now show that most feed-forward DNNs and deep CNNs used in practice for classifications, are indeed universal classifiers in the sense of Theorem~\ref{thrm_universal_hard_classification}.

Let $\sigma:\rr\to\rr$ be a continuous \textit{activation} function, and let $\NN$ denote the set of feed-forward networks from $\rrm$ to $\rrn$, i.e.: continuous functions with representation
\begin{equation}
\smash{
	\begin{aligned}
	&f(x) = W \circ f^{(J)}
	,
	& \, f^{(j)}(x) = \sigma \bullet \left(
	W^{(j)}\circ f^{(j-1)}(x)
	\right),
	& \, f^{(0)}(x)=x
	,
	&\, j=1,\dots,J
	\end{aligned}
}
\label{eq_deep_classifier_hard}
\end{equation}
where $W$ and $W^j$ are affine maps and $\bullet$ denotes component-wise composition.
The following results directly follow from Theorem~\ref{thrm_universal_hard_classification} and the central result of \cite{leshno1993multilayer}, and validates the principle way neural networks are used for classification.

\begin{cor}[Universal Classification: Deep Feed-Forward Networks]\label{cor_univ_class}
Let $\{\xxx_i\}_{i=1}^n$ be open subsets of $\xxx$, and $\hat{h}$ be their associated ideal classifier.  Let $\phi:\xxx\to \rrn$ be a continuous injective feature map.  Let $\sigma$ be a continuous, locally-bounded, and non-constant activation function.  Let $\rho$ either be the
component-wise logistic function.  Then there exists a sequence $\{f_k\}_{k \in \nn^+}$ of DNNs satisfying the conclusions of Theorem~\ref{thrm_universal_hard_classification}.
\end{cor}
Define the set of deep CNNs with ReLu activation and sparsity $2\leq s\leq m$, denoted by $Conv^{s}$, to be the collection of all functions from $\rrn$ to $\rr$ represented by
$$
\smash{
\begin{aligned}
&f(x) = W \circ f^{(J)}
,
& \, f^{(j)}(x) = \sigma\bullet\left(
w^{(j)}\star (f^{(j-1)}(x)) - b^j
\right),
& \, f^{(0)}(x)=x
,
&\, j=1,\dots,J
,
\end{aligned}
}
$$
where $W$ is an affine map from $\rrflex{d + Js}$ to $\rr$, $b^{(j)}\in \rrflex{d + js}$, $w^{(j)}=\{w_k^{(j)}\}_{k=-\infty}^{\infty}$ is a \textit{convolutional filter mask} where $w_k \in \rr$ and $w_k \neq 0$ only if $0\leq k\leq s$, and the \textit{convolutional operation} of $w^{(j)}$ with the vectors $\{v_j\}_{j=1}^J$ is the sequence defined by
$
(w\star v)_i = \sum_{j=0}^{J-1}
w_{i-j} v_j
$ and $\sigma(x)=\max\{0,x\}$.
\vspace*{-.5em}
\begin{cor}[Universal Classification: Deep CNNs]\label{ex_dCNNs_Uinv_class}
Let $2\leq s\leq n$, $\{\xxx_i\}_{i=1}^n$ be open subsets of $\xxx$, and $\hat{h}$ be their associated ideal classifier.  Let $\phi:\xxx\to \rrn$ be a continuous injective feature map and let $\rho:\rr \to (0,1)$ be the logistic function.  Then there is a sequence of deep CNNS $\{f_k\}_{k \in \nn^+}$ in $Conv^s_{\rho,\phi}$ satisfying the conclusion of Theorem~\ref{thrm_universal_hard_classification}.
\end{cor}
\vspace*{-1em}
\subsection{Applications in Geometric Deep Learning}\label{ss_geom_deep}
\vspace*{-.5em}
This subsection illustrates the applicability of the main results to geometric deep learning.  Our examples focus on two illustrative points, first that many commonly used non-Euclidean regression models can be extended to non-Euclidean architectures capable of universal approximation and second, we illustrate how our results can be used to validate the approximation capabilities of certain geometric deep learning architectures.

For Cartan-Hadamard manifolds, the Cartan-Hadamard Theorem, \citep[Corollary 6.9.1]{jost2008riemannian}, guarantees that $\partial C_p = \emptyset$ and in particular $\operatorname{Log}_p^{\mmm}$ is a globally-defined homeomorphism between $\mmm$ and $\rrm$.  Thus, the following result follows from Corollary~\ref{cor_surjective_trick}.
\begin{cor}[Cartan-Hadamard Version]\label{cor_Riemannian_Version}
	Let $\fff$ be dense in $C(\rrm,\rrn)$, let $\mmm$ and $\nnn$ be Cartan-Hadamard manifolds of dimension $m$ and $n$.  Then, $\fff_{\operatorname{Log}_p^{\mmm},\operatorname{Exp}_q^{\nnn}}$ is dense in $C(\mmm,\nnn)$.
\end{cor}
\vspace*{-1em}
We consider here two consequences of this result.
\vspace*{-1em}
\subsubsection{Symmetric Positive-Definite Matrix Learning}
\vspace*{-.5em}
Symmetric positive-definite matrices play a prominent role in many applied sciences, largely due to their relationship to covariance matrices, in areas ranging from computational anatomy in \cite{pennec2008statistical}, computer vision in \cite{pennec2006intrinsic}, and in finance \cite{baes2019low}.  The space $P_d^+$ of $d\times d$ symmetric positive-definite matrices is a non-Euclidean subspace of $\rrflex{d^2}$.
In \cite{absil2009optimization}, $P_d^+$ is shown to be a Cartan-Hadamard manifold whose Riemannian exponential and logarithm maps are, respectively, given by
\begin{equation}
\smash{
\begin{aligned}
\operatorname{Exp}_{A}(B) = & \sqrt{A} \exp\left(
\sqrt{A}^{-1}
B
\sqrt{A}^{-1}
\right)
\sqrt{A} ,\,
\operatorname{Log}_{A}(B) = & \sqrt{A} \log\left(
\sqrt{A}^{-1}
B
\sqrt{A}^{-1}
\right)
\sqrt{A}
,
\end{aligned}
}
\label{eq_Riemannian_exp_log_PSD}
\end{equation}
where $\exp$ and $\log$ denote the matrix exponential and logarithms, respectively.

Moreover, the distance function on this space is given by
$$
\smash{
d_+(A,B)\triangleq \left\|\sqrt{A}\log\left(
\sqrt{A}^{-1}
	B
\sqrt{A}^{-1}
\right)
\sqrt{A}
\right\|_F
,
}
$$
where $\|\cdot\|_F$ denotes the Fr\"{o}benius norm and $\sqrt{A}$ is well-defined for any matrix in $P_d^+$.  Using this distance, \cite{meyer2011regression} developed non-Euclidean least-squares regression on $P_d^+$.

The parameters involved in these models are typically optimized either using the non-Euclidean line search algorithms of \cite{meyer2011regression} or the non-Euclidean stochastic gradient approach on $P_d^+$ of \cite{BonnabelPSD}.  The aforementioned regression models can be extended to form a ucc-dense architecture in $C(P_d^+,P_D^+)$.
\begin{cor}[Universal Approximation for Symmetric Positive-Definite Matrices]\label{cor_UAT_SPD}
	Let $d,D \in \nn^+$ and $\fff\subseteq C(\rrflex{d(d+1)/2},\rrflex{D(D+1)/2})$
	be ucc-dense.  Then, for any $A\in P_d^+$ and $B\in P_D^+$,
	$\fff_{\operatorname{Log}_A,\operatorname{Exp}_B}$ is ucc-dense in $C(P_d^+,P_D^+)$.  In particular, if $\sigma$ is a continuous, locally-bounded, and non-polynomial activation function then $\NN_{\operatorname{Log}_A,\operatorname{Exp}_B}$ is ucc-dense in $C(P_d^+,P_D^+)$.
\end{cor}

\vspace*{-1em}
\subsubsection{Hyperbolic Feed-Forward Networks}
\vspace*{-.5em}
For $c>0$, the \textit{generalized hyperbolic spaces} $\mathbb{D}^n_c$ of \cite{ganea2018hyperbolic} have underlying set $\{x \in \rrn:\, c\|x\|^2 <1\}$ and their topology is induced by the following non-Euclidean metric
$$

d_c(x,y) \triangleq \frac{2}{\sqrt{c}}\tanh^{-1}\left(
\sqrt{c}
\left\|
\frac{
	(1-c\|x\|^2)y	-(1 - 2c x^{\top}y + c \|y\|^2)
}{
	1 - 2c x^{\top}y + c^2 \|x\|^2\|y\|^2
}
\right\|
\right)
.

$$
Though a direct description of hyperbolic feed-forward neural networks would be lengthy, on \citep[page 6]{ganea2018hyperbolic}, it is shown any hyperbolic feed-forward network from $\mathbb{D}^m_c$ to $\mathbb{D}^n_c$ can be represented as
\begin{equation}
\smash{
\left\{
\operatorname{Exp}^{\mathbb{D}^k_c}_0
\circ
f
\circ
\operatorname{Log}^{\mathbb{D}^k_c}_0
:f \in \NN
\right\},
}
\label{eq_hyperbolic_NNs}
\end{equation}
where $\operatorname{Exp}^{\mathbb{D}^k_c}_0$ is the Riemmanian Exponential map on $\mathbb{D}^k_c$ about $0$, as in Corollary~\ref{cor_Riemannian_Version}.  Closed-form expressions are obtained in \citep[Lemma 2]{ganea2018hyperbolic} for these feature and readout maps.  Since, as discussed in \cite{ganea2018hyperbolic}, $\mathbb{D}_c^k$ is a complete connected Riemannian manifold of non-positive curvature then the Cartan-Hadamard Theorem implies that $C_0=\emptyset$.  Whence, Corollary~\ref{cor_Riemannian_Version} yields the following.
\begin{cor}[Hyperbolic Neural Networks are Universal]\label{ex_HNN_univ}
	Let $\sigma$ be a continuous, non-polynomial, locally-bounded activation function and $c>0$.  Then for every $g \in C(\mathbb{D}^m_c,\mathbb{D}^n_c)$, every $\epsilon>0$, and every compact subset $K\subseteq \mathbb{D}^m_c$ there exists a hyperbolic neural network $g_{\epsilon,K,c}$ in~\eqref{eq_hyperbolic_NNs} satisfying
	$$
	\smash{\sup_{x \in K} d_c(g(x),g_{\epsilon,K,c})<\epsilon
	.
}
	$$
\end{cor}

Next, applications of Theorems~\ref{thrm_main_General_version} and~\ref{thrm_main_Geometric_version} with Euclidean input and output spaces are considered.
\vspace*{-1em}
\subsection{Universality of Deep Networks with First Layers Randomized}\label{ss_random_init}
\vspace*{-.5em}
Fix $\rr$-valued random variables $\{X_i\}_{i=1}^k$ and $\{Z_i\}_{i=1}^k$ defined on a common probability space $(\Omega,\Sigma,\pp)$.  Fix an activation function $\sigma:\rr\rightarrow [0,1]$, and positive integers $\{d_i\}_{i=1}^k$.   Using this data, for each $i=1,\dots,k$ define random affine maps $W_i: \rrflex{d_i}\times \Omega \rightarrow \rrflex{d_{i+1}},$ defined by
\begin{equation}
\smash{
	\begin{aligned}

	(x,\omega)
	 \mapsto A_i(\omega)x + b_i(\omega)
	,
	\end{aligned}
}
\label{eq_random_affines}
\end{equation}
where the entries of $A_i$ are i.i.d. copies of $X_i$ and the entries of $b_i$ are i.i.d. copies of $Z_i$.

The random affine maps~\eqref{eq_random_affines} define the (random) set of deep feed-forward neural networks with first $k$ layers randomized and last $2$ layers trainable to be the (random) subset of $C(\rrd,\rrD)$ via
$$
\smash{
	\begin{aligned}
	\NN[2,k](\omega)\triangleq
	\left\{
	f \in C(\rrm,\rrn):\,
	(\exists g \in \NN[2][\sigma]) f(x) = g \circ \left[\sigma \bullet W_k(x,\omega) \circ  \sigma \bullet \dots \circ \sigma \bullet W_1(x,\omega)\right]
	\right\},
	\end{aligned}
}
$$
where $\NN[2][\sigma]$ is the collection of feed-forward neural networks of the form
$
W_2\circ \sigma \bullet W_1
,
$
where $W_1:\rrm\rightarrow \rrflex{d}$ and $W_2:\rrflex{d}\rightarrow \rrn$ are affine maps and $d$ is a positive integer.
Under the following mild assumptions, the random set $\NN[2,k]$ is dense in $C(\rrm,\rrn)$ with probability $1$.
\begin{ass}\label{ass_broad_regularity_random_init_disc}For each $i=1,\dots,k$
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item $d_i\leq  d_{i+1}$ for each $i=1,\dots,k$,
		\item $\sigma$ is a strictly increasing and continuous,
		\item $\ee[X_i]=\ee[Z_i]=0$, $\ee[X_i^2]=\ee[Z_i^2]=1$,
		\item For every $C>1$, $\ee[|X_i|^C],\ee[|Z_i|^C]<\infty$.
	\end{enumerate}
\end{ass}
\begin{thrm}\label{thrm_random_init_disc}
	If Assumption~\ref{ass_broad_regularity_random_init_disc} holds, then there exists a measurable subset $\Omega'\subseteq \left\{
	\omega \in \Omega:\, \overline{\NN[2,k](\omega)}=C(\rrd,\rrD)
	\right\}$ satisfying
	$
	\pp\left(
	\Omega'
	\right) =1
	.
	$
\end{thrm}
\vspace*{-1em}
\begin{cor}[Sub-Gaussian Case with Sigmoid Activation]\label{cor_random_guassian_init}
	Let $X_i=Z_i$ for each $i=1,\dots,k$ be independent standardized sub-Gaussian random-variables, $\sigma(x)=\frac1{1+e^{-x}}$, and $d_i=d$ for each $i=1,\dots,k$.  Then the conclusion of Theorem~\ref{thrm_random_init_disc} holds.
\end{cor}
\begin{cor}[Bernoulli Case with PReLU Activation]\label{ex_Bernoulli_Initialization}
	Suppose that for every $i,j=1,\dots,k$, $X_i$ and $Z_j$ i.i.d. copies of a random variable taking values $\{-1,1\}$ with probabilities $\{\frac1{2},\frac1{2}\}$.  Let $d_i=d$ for each $i=1,\dots,k$ and $\sigma$ be the PReLU activation function of \cite{he2015delving}.  Then Assumptions~\ref{ass_broad_regularity_random_init_disc} are met; thus the conclusion of Theorem~\ref{thrm_random_init_disc} holds.
\end{cor}

\vspace*{-1em}
\subsection{Feed-Forward Layers of Sub-Minimal Width}\label{ss_f_r_contruction}
\vspace*{-.5em}
In this section, we use Theorem~\ref{thrm_main_Geometric_version} to describe how additional layers can be incorporated into a DNN, which violate the minimum width requirements of $m+1$ in its hidden layers (see \cite{johnson2018deep,park2020minimum}) but do not negatively impact the architecture's approximation capabilities.  We say that such layers have \textit{sub-minimal width}.

We derive specific conditions on the activation functions and structure of the connections between sub-minimal width layer ensuring that Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} are met.
\begin{prop}[Input Layers of Sub-Minimal Width: Continuous Monotone Activations and Invertible Connections]\label{prop_deep_feed_forward_representations}
Let $\sigma$ be a continuous and strictly increasing activation function, $J\in \nn_+$, $A_1,\dots,A_J$ be $m\times m$ matrices, and $b_1,\dots,b_J\in \rrd$.  Let $\phi(x)\triangleq \phi_J(x)$ where
\begin{equation}
\smash{
	\phi_j(x) \triangleq  \sigma\bullet
	\left(
	\exp\left(
	A_j\right) \phi_{j-1}(x) + b_j
	\right) \qquad \phi_0(x)\triangleq x,\quad j=1,\dots,J
}
\label{eq_dNN_layer}
,
\end{equation}
where $\exp$ is the matrix exponential.  Then $\phi$ satisfies Assumption~\ref{ass_regularity_feature}.
\end{prop}
\begin{prop}[Output Layers of Sub-Minimal Width: Invertible Feed-Forward Layers]\label{prop_deep_feed_forward_representations_readout}
	In the setting of Proposition~\ref{prop_deep_feed_forward_representations}, if $\sigma$ is also surjective then $\phi$ is a homeomorphism, and in particular it satisfies Assumption~\ref{ass_regularity_readout}.
\end{prop}
\begin{ex}[Sub-Minimal Width via Generalized PReLU Activation]\label{ex_GPreLU}
Fix $\alpha,\beta \in (0,\infty),\,\alpha\neq \beta$.  Then the activation function $\sigma = \beta xI_{x\geq 0} + \alpha xI_{x<0}$ is monotone increasing and surjective.
\end{ex}

\begin{ex}[ReLU Feed-Forward Layers Cannot Achieve Sub-Minimal Width]\label{ex_DNN_ReLU}
Let $\phi$ be as in~\eqref{eq_dNN_layer} and let $\sigma(x)\triangleq \max\{0,x\}$.  By Theorem~\ref{thrm_sharpness_of_injectivity}, $\fff_{1_{\rrn},\phi}$ is not dense in $C(\rrm,\rrn)$.
\end{ex}
\vspace*{-1em}
\subsubsection{Numerical Illustration}
\vspace*{-0.25em}
The following numerical illustration will also make use of the following method for constructing feature maps satisfying Assumption~\ref{ass_regularity_feature}.  The method can be interpreted as passing the inputs through an arbitrary function and feeding them into the model's input via a skip connection.
\vspace*{-.25em}
\begin{prop}[Skip Connections Using Arbitrary Continuous Functions are Good Feature Maps]\label{prop_skip_connections}
	Let $d\in \nn_+$ and $g\in C(\rrm,\rrd)$.  Then $\phi_g(x)\triangleq (x,g(x))$ satisfies Assumption~\ref{ass_regularity_feature}.
\end{prop}
\begin{ex}[Pre-Trained DNN with a Skip Connection are Good Feature Maps]\label{ex_Pre_trianed_DNN}
	Let $g\in \NN$.  Then $\phi_g(x)\triangleq (x,g(x))$ satisfies Assumption~\ref{ass_regularity_feature}.
\end{ex}
To illustrate the effect of (in)correctly choosing the networks’ input and output layers we implement different DNNs whose initial or final layers are build using the above examples or intentionally fail Assumptions~\ref{ass_regularity_feature} or~\ref{ass_regularity_readout}.  Our implementations are on the California housing dataset \cite{KaggleCaliHousePrices}, with the objective of predicting the median housing value given a set of economic and geo-spacial factors as described in \cite{KaggleExpertDiscussion}.  The test-set consists of $30\%$ percent of the total 20k training instances.  The implemented networks are of the form $\rho \circ f\circ \phi$, where $f=W_2\circ \sigma \bullet W_1$ is a shallow feed-forward network with ReLU activation and $\rho,\phi$ are built using the above examples.

Our reference model (Vanilla) is simply the shallow feed-forward network $f$.  For the first DNN, which we denote (Bad), $\rho$ and $\phi$ are given by as in Example~\ref{ex_DNN_ReLU} and therefore violate Assumption~\ref{ass_regularity_feature}.  For the second DNN, denoted by (Good), $\rho$ and $\phi$ are as in Example~\eqref{ex_GPreLU} and Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} are met.  The final DNN, denoted by (Rand), $\rho$ is as in Example~\ref{ex_GPreLU} and $\phi$ is as in Example~\ref{ex_Pre_trianed_DNN} where the pre-trained network is generated randomly following in Corollary~\ref{ex_Bernoulli_Initialization}.
\vspace*{-1em}

\begin{table}[H]
	\centering
\begin{tabular}{l*{8}{r}}
	\toprule
	&\multicolumn{4}{c}{Test}&\multicolumn{4}{c}{Train} \\
	\cmidrule(lr){2-5}\cmidrule(lr){6-9}
	Model & Good & Rand & Bad & Vanilla  &  Good & Rand & Bad & Vanilla  \\
	\midrule

MAE  &  0.318 &  0.320 &  0.876 &  0.320 & 0.252  & 0.296 &  0.887  & 0.284 \\
MSE  &  0.247 &  0.259 &  1.355 &  0.257 & 0.174  & 0.234 &  1.409  & 0.209 \\
MAPE & 16.714 & 17.626 & 48.051 & 17.427 & 12.921 & 15.668 & 48.698 & 14.878 \\
	\bottomrule
\end{tabular}
	\caption{Training and test predictive performance.}
	\label{tab_results}
\end{table}
\vspace*{-2.5em}
As anticipated, Table~\ref{tab_results} shows that selecting the networks' initial and final layers according to our method either improves performance (Good) when all involved parameters are trainable or does not significantly affect it even if nearly every parameter is random (Rand).  However, disregarding Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} when adding additional deep layers dramatically degrades predictive performance, as is the case for (Bad).  Table~\ref{tab_results} shows that if a DNN's first and final layers are structured according to Theorem~\ref{thrm_main_Geometric_version} then expressibility can be improved, even if these layers violate the minimum width bounds of \cite{johnson2018deep,park2020minimum}.  Python code for these implementations is available at \cite{KratsiosNEUATNeurIPS2020}.
\vspace*{-1em}
\section{Conclusion}\label{s_Conclusion}
\vspace*{-.5em}
Modifications to the input and output layers of any neural networks, using carefully chosen feature $\phi:\xxx\to \rrm$ and readout $\rho:\rrn\to \yyy$ maps, are common in practice.  Theorems~\ref{thrm_main_General_version},~\ref{thrm_main_Geometric_version}, and Corollary~\ref{cor_Riemannian_Version} provided general conditions on these maps guaranteeing that the new, modified, architecture can approximate any function in the uniform convergence on compacts (or more generally the compact-open) topologies between their new input and output spaces.

\vspace*{-.5em}
As a consequence of our main results, we showed that universal approximation implies universal classification once a component-wise logistic map is applied.  This is a deterministic strengthening of the probabilistic results of \cite{farago1993strong}.  We derived a method for constructing universal approximators between a wide class of manifolds.  In particular, we extended the symmetric positive-definite matrix-valued regressor of \cite{meyer2011regression} to a universal approximator and we showed that the hyperbolic feed-forward networks of \cite{ganea2018hyperbolic} are universal approximators between hyperbolic spaces.

\vspace*{-.5em}
Our main results also described how to structure the first and final layers of a DNN between Euclidean spaces, so as to preserve the approximation capabilities of the network's middle layers.  In particular, we provided conditions on a network's activation function and connections so that these layers can be made narrower than the specifications of \cite{johnson2018deep,park2020minimum} while maintaining the architecture's expressibility.  Lastly, we showed that randomly generated DNNs are good feature maps with probability $1$.

\section*{Broader Impact}

A large portion of available data is non-Euclidean, either in the form of social network data to imaging data relevant in health applications of deep learning.  The tools in this paper open up a generic means of translating the currently available deep learning technology to those milieus.  The automation of tools in the medical sciences is important to helping reducing waiting times in hospitals and help make healthcare more accessible to all, so in that way, any automatizing of health science tools helps move society in that direction.  Therefore, we hope that the methods presented in paper form a small step towards a greater positive advancement of the social and natural sciences.

\begin{ack}

The authors would like to thank Ga\"{e}l Meigniez for his insightful surrounding the differential topology tools used in the proof of Theorem~\ref{thrm_main_General_version}.  The authors would also like to thank Josef Teichmann, Behnoosh Zamanlooy, and Philippe Casgrain for their feedback and suggestions.

This research was funded by the ETH Z\"{u}rich foundation.  The authors are grateful for its financial support of the project.
\end{ack}

\begin{appendices}
	\pagenumbering{roman}
	\setcounter{page}{1}

This supplement provides theoretical justification of the claims made in this paper.  We repeat the assumptions needed for our results and we repeat the statement of each theorem before it's proof for a smoother read.
\section{Assumptions}
\begin{ass*}[Feature Map Regularity]
The map $\phi$ is a continuous and injective.
\end{ass*}
\begin{ass*}[Readout Map Regularity]
	Suppose that the readout map $\rho$ satisfies the following:
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item Either of the following hold:
		\begin{enumerate}[(a)]
		\vspace*{-1em}
		\itemsep -.25em
		    \item $\rho$ is a continuous and it has a section on $\im{\rho}$,
		    \item $\rho$ is a covering projection of $\rrm$ onto $\im{\rho}$ and $\xxx$ is connected and simply connected,
		\end{enumerate}
		\item $\im{\rho}$ is dense in $\yyy$,
		\item $\partial\im{\rho}$ is collared; i.e$.$: there exists an open subset $U\subseteq \yyy$ containing $\partial \im{\rho}$ and a homeomorphism $\psi:U \rightarrow \partial \im{\rho} \times [0,1)$ mapping $\partial \im{\rho}$ to $\partial \im{\rho}\times \{0\}$.
	\end{enumerate}
\end{ass*}
\begin{ass*}[Readout Map Regularity: Geometric Version]
	Suppose that $\rho$ satisfies:
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item $\rho$ satisfies Assumption~\ref{ass_regularity_readout} (i) and $\im{\rho}\subseteq \inter{\yyy}$,
		\item $
		\inter{\yyy}- \im{\rho}$ is a (possibly empty) smooth submanifold of $\inter{\yyy}$ of dimension strictly less-than
		$
		\dim(\inter{\yyy}) - n.
		$
	\end{enumerate}
\end{ass*}
\begin{ass*}[Regularity of Randomized Deep Networks]
For each $i=1,\dots,k$
	\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item $d_i\leq  d_{i+1}$ for each $i=1,\dots,k$,
		\item $\sigma$ is a strictly increasing and continuous,
		\item $\ee[X_i]=\ee[Z_i]=0$, $\ee[X_i^2]=\ee[Z_i^2]=1$,
		\item For every $C>1$, $\ee[|X_i|^C],\ee[|Z_i|^C]<\infty$.
	\end{enumerate}
\end{ass*}
\section{Proofs}\label{s_Proofs_appendices}
	\subsection{Proof of Main Results}\label{ss_Proofs_Main}
	In the next lemma, we use the term algebra in the sense of the Stone-Weirestrass theorem, see \citep[V.8]{conway2013course} for details.
	\begin{lem}\label{lem_density_feature}
Let $\phi:X\rightarrow Z$ be a continuous injection between topological spaces. Let $\mathcal{F}\subset C(Z,\mathbb{R}^n)$ be dense in the compact-open topology. Then $\{f\circ\phi|~f\in\mathcal{F}$ is dense in $C(X,\mathbb{R}^n)$.
\end{lem}
\begin{proof}
Let $\Phi:C(Z,\mathbb{R}^n)\to C(X,\mathbb{R}^n)$ be defined by $[\Phi(f)](x)=f(\phi(x))$, which by \citep[Theorem 46.11]{munkres2014topology} is a continuous map. Hence, $\overline{\Phi(\mathcal{F})}=\overline{\Phi(C(Z,\mathbb{R}^n))}$, because $\mathcal{F}$ is dense. Therefore, in order to show that $\Phi(\mathcal{F})$ is dense, it is enough to prove density of $\Phi(C(Z,\mathbb{R}^n))$.

Observe that $C(X,\mathbb{R}^n)=C(X)\oplus...\oplus C(X)$, $C(Z,\mathbb{R}^n)=C(Z)\oplus...\oplus C(Z)$ and $\Phi:C(Z)\to C(X)$ on every component independently. Hence, we just need to show that $\Phi(C(Z))$ is dense in $C(X)$.

To that end, observe that since $\Phi$ is an algebra homomorphism, $\Phi(C(Z))$ is a subalgebra of $C(X)$. Clearly, $1\in \Phi(C(Z))$, and since $\phi$ is an injection, it is easy to see that $\Phi(C(Z))$ separates points of $X$. Thus, $\Phi(C(Z))$ is dense by the Stone-Weierstrass theorem.
\end{proof}
	\begin{lem}\label{lem_density_readout}
	Let $\xxx$ be a topological space, $\rho:\rrn\to \yyy$ be a map satisfying Assumption~\ref{ass_regularity_readout}, and $\fff$ be dense in $C(X,\rrn)$ for the compact-open topology.  Then the set
\begin{equation}
    	\left\{
	g \in C(\xxx,\im{\rho}:\,
	(\exists f \in \fff)\, g = \rho \circ f
	\right\},
	\label{eq_push_forward_of_fff}
\end{equation}
	is dense in $C(\xxx,\im{\rho})$.  In particular, if $\yyy$ is a metric space then the set~\eqref{eq_push_forward_of_fff} is dense in $C(\xxx,\im{\rho})$ for the ucc topology.
	\end{lem}
	\begin{proof}
	First, suppose that Assumption~\ref{ass_regularity_readout} (i.a), (ii), and (iii) hold and that $\rho$ is continuous with continuous section.  Define the map $F:C(\phi(\xxx),\rrn)\rightarrow C(\xxx,\inter{\rho})$ by $f \to \rho\circ f$.  Since $\rho$ is continuous then by \citep[Theorem 46.11]{munkres2014topology} $F$ is also continuous.

	Moreover, by Assumption~\ref{ass_regularity_readout} (i.a), since there is a section $R$ to $\rho$, i.e. a continuous map $R:\inter{\rho}\to \rrn$ such that $\rho\circ R = 1_{\yyy}$ then by \citep[Theorem 46.11]{munkres2014topology} the map $G:C(\xxx,\inter{\rho}) \rightarrow C(\xxx,\rrn)$ defined by $g\to R\circ g$ is well-defined and continuous.  Furthermore, for every $g \in C(\xxx,\inter{\rho})$ it follows that
	$$
\begin{aligned}
	F\circ G(g) & =  F\left(R\circ g\right) \\
	&= \rho \circ (R \circ g) \\
	& = (\rho\circ R) \circ g  \\
	& = g \\
	& = 1_{\inter{\rho}}(g)
,
\end{aligned}
	$$
	therefore $F$ is a continuous surjection.  Since continuous surjections map dense sets to dense sets in their codomain, then since $\fff$ is dense in $C(\xxx,\rrn)$ and the image of $\fff$ under $F$ is the set of~\eqref{eq_push_forward_of_fff} then the set described in ~\eqref{eq_push_forward_of_fff} is dense in $C(\xxx,\inter{\rho})$.

	Now, suppose that Assumption~\ref{ass_regularity_readout} (i.b), (ii), and (iii) hold.  Since $\xxx$ is simply connected and $\rho$ is a covering map, then the conditions for \citep[Chapter 2, Section 2, Theorem 5]{spanier1994algebraic} are met (since simply connectedness means a trivial fundamental group), therefore, for every $f \in C(\xxx,\im{\rho})$ there exists some $\hat{f}\in C(\xxx,\rrn)$ such that
	\begin{equation}
	    \rho\circ \hat{f} = f
	    .
	    \label{eq_lift_covering_condition}
	\end{equation}
	Since $\fff$ is dense in $C(\xxx,\rrn)$ then exists a sequence $\{f_k\}_{k \in \nn}$ in $\fff$ converging to $\hat{f}$ in the compact-open topology.  Since $\rho$ is continuous the continuity of $F$, following the same notation as the first part of the proof, implies that
	$\{F(f_k)\}_{k \in \nn}$ converges to $F(\hat{f})$ in the compact-open topology.  By~\eqref{eq_lift_covering_condition} this implies that $\{F(f_k)\}_{k \in \nn}=\{\rho\circ f_k\}_{k \in \nn}$ converges to
	$$
	f=F(f) = f
	$$
	in the compact-open topology.  Therefore,~\eqref{eq_push_forward_of_fff} is dense in $C(\xxx,\im{\rho})$.

	In particular, if $\yyy$ is a metric space, then $\im{\rho}$ is a metric space.  Thus, by \citep[Theorem 46.8]{munkres2014topology} the compact-open and ucc topologies coincide on $C(\xxx,\im{\rho})$.  This gives the final claim.
	\end{proof}
	It is convenient to sumamrize the above lemmas into a single lemma.
	\begin{lem}\label{lem_density_co}
	If Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} both hold, and if $\fff$ is dense in $C(\rrm,\rrn)$ then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\im{\rho})$ for the compact-open topology.  Moreover, if $\yyy$ is a metric space then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\im{\rho})$ for the ucc-topology.
	\end{lem}
	\begin{proof}
	    The result follows directly from Lemmas~\ref{lem_density_readout} and~\ref{lem_density_feature}.
	\end{proof}

		\begin{lem}\label{lem_redux_to_imrho}
		If $\xxx$ is locally-compact and Assumption~\ref{ass_regularity_readout} holds then $C(\xxx,\im{\rho})$ is dense in $C(\xxx,\yyy)$ in the compact-open topology.
	\end{lem}
	\begin{proof}[{Proof of Lemma~\ref{lem_redux_to_imrho}}]
		By Assumption~\ref{ass_regularity_readout} (iii) there is a homeomorphism $\psi:U \rightarrow \partial \im{\rho}\times [0,1)$ and a (continuous) inclusion map $i:U\rightarrow \yyy$.  Therefore, \cite[Chapter 1, Exercise B.1]{spanier1994algebraic} there exists a unique topological space (up to homeomorphism) $\yyy'$ containing $\partial \im{\rho} \times [0,1)$ as a subspace for which there exists a continuous map $\Psi:\yyy\rightarrow \yyy'$ satisfying
		\begin{equation}
		\Psi \circ i = j \circ \psi
		,
		\label{eq_adjunction}
		\end{equation}
		where $j$ is the (continuous) inclusion map of $\partial \im{\rho} \times [0,1)$ into $\yyy'$, such that for any other topological space $\yyy''$ satisfying~\eqref{eq_adjunction} there exists a continuous map $I:\yyy'\rightarrow \yyy''$. Since $\psi$ is a homeomorphism then this maximality property implies that $\Psi$ is also a homeomorphism.  Therefore, $C(\xxx,\partial \inter{\Psi\circ \rho})$ is dense in $C(\xxx,\yyy')$ if and only if $C(\xxx,\partial \im{\rho})$ is dense in $C(\xxx,\yyy)$.  Thus, without loss of generality we identify $\yyy$ with $\yyy'$ and thus $U$ with $\partial \im{\rho}\times [0,1)$.

		For every $n \in \nn$, $f_n$ and $f$ map $\tilde{X}\triangleq f^{-1}[\partial \im{\rho}\times [0,1)]$ to $\partial \im{\rho}\times [0,1)$.  We show that $f_n$ converges to $f$ in $C(\tilde{X},\partial \im{\rho}\times [0,1))$.  Since $\phi$ is a continuous injection into the locally-compact space $\rrm$ then $\xxx$, and therefore $\tilde{X}$, are locally-compact.  Therefore, $C(\tilde{X},\partial \im{\rho}\times [0,1))$ is homeomorphic to $C(\tilde{X},\partial \im{\rho})\times C(\tilde{X},[0,1))$.
		By \citep[Section 19.2, Exercise 6]{munkres2014topology}, $f_n$ converges to $f$ on the product space $C(\tilde{X},\partial \im{\rho})\times C(\tilde{X},[0,1))$ if and only if $p_i(f_n)$ converges to $p_i(f)$ for $i=1,2$ where $p_1$ is the canonical projection of $C(\tilde{X},\partial \im{\rho})\times C(\tilde{X},[0,1))$ onto $C(\tilde{X},\partial \im{\rho})$ and $p_2$ is the canonical projection of $C(\tilde{X},\partial \im{\rho})\times C(\tilde{X},[0,1))$ onto $C(\tilde{X},[0,1))$.  First observed that,
		$$
		p_1(f_n)=f=p_1(f),
		$$
		for each $n \in \nn$.  Next,
		$$
		p_2(f_n) = \frac{1}{n}I_{[0,\frac1{n}]} + t I_{[\frac1{n},\infty)} \mbox{ and } p_2(f) =t.
		$$
		Since $[0,1)$ is topologized with the (relative) Euclidean topology which is metric then \citep[Theorem 46.8]{munkres2014topology} implies that compact-open topology on $C(\tilde{X},[0,1))$ agrees with the topology of uniform convergence on compacts in $C(\tilde{X},[0,1))$.  Fix $\epsilon>0$ and $n\geq \frac{1}{\epsilon}$.  Thus, for every compact $\tilde{K}\subseteq \tilde{X}$
		$$
		\sup_{x \in \tilde{K}} \left\|
		p_2(f_n)(x)-p_2(f)(x)
		\right\| = \max_{t \in [0,\frac1{n}]} \left|\frac1{n}-t\right| \leq \frac1{n} <\epsilon.
		$$
		Therefore, $p_2(f_n)$ converges to $p_2(f)$ in the compact-open topology on $C(\tilde{X},[0,1))$.  Hence, $f_n$ converges to $f$ in the compact-open topology on $C(\tilde{X},\partial \im{\rho})\times C(\tilde{X},[0,1))$ and therefore on $C(\tilde{X},\partial \im{\rho}\times [0,1))$.  Since
		\begin{equation}
		\begin{aligned}
		&\left\{U_{\tilde{K},\tilde{O}}:\, \emptyset\neq \tilde{K}\subseteq \tilde{\xxx} \mbox{ compact and } \emptyset\neq \tilde{O}\subseteq \partial \im{\rho}\times [0,1) \mbox{ open}\right\}\\
		&U_{\tilde{K},\tilde{O}}\triangleq \left\{
		f \in C(\tilde{\xxx},\partial \im{\rho}\times [0,1)):\,
		f(\tilde{K})\subseteq \tilde{O}
		\right\}
		\end{aligned}
		\label{eq_co_topology_definition_2}
		\end{equation}
		is a sub-base for the compact-open topology on $C(\tilde{\xxx},\partial \im{\rho}\times [0,1))$ then by definition of convergence, for every $\tilde{K}_1,\dots,\tilde{K}_n\subseteq \tilde{\xxx}$ compact and $\tilde{O}_1,\dots,\tilde{O}_n\subseteq \partial \im{\rho}\times [0,1)$ open if $f \in \bigcap_{i=1}^n U_{\tilde{K}_i,\tilde{O}_i}$ then there exists some $N \in \nn$ for which $f_N \in \bigcap_{i=1}^n U_{\tilde{K}_i,\tilde{O}_i}$.

		Since every compact subset $K\subseteq \xxx$ is relatively compact in $\tilde{X}$ and every open subset $O\subseteq \yyy$ is relatively compact in $\partial \im{\rho})\times C(\tilde{X},[0,1)$ then if $f \in \bigcap_{i=1}^n V_{K_i,O_i}$ where $V_{K_i,O_i}$ are as in~\eqref{eq_co_topology_definition} then
		$$
		f(K_i)\subseteq O_i \qquad i=1,\dots,n.
		$$
		Therefore, there exists some $N \in \nn$ satisfying
		$$
		f_N(K_i \cap \tilde{\xxx}) \subseteq O_i \cap \partial \im{\rho}\times [0,1) \qquad i=1,\dots,n.
		$$
		However, by construction, $f_N=f$ on $\xxx-\tilde{\xxx}$ and therefore on each $K_i - K_i \cap \xxx$.  Therefore,
		$$
		f_N(K_i)\subseteq O_i \qquad i=1,\dots,n.
		$$
		Thus, $f_N \in \bigcap_{i=1}^n V_{K_i,O_i}$ and $f_n$ converge to $f$ in $C(\xxx,\yyy)$ for the compact-open topology.
	\end{proof}

We may now prove the following result and its consequences.
\begin{thrm*}[General Version]
	Suppose that $\fff$ is dense in $C(\rrm,\rrn)$.
	If Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} hold then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{thrm*}
	\begin{proof}
		Since Assumptions~\ref{ass_regularity_feature} and~\ref{ass_regularity_readout} hold and since $\fff$ is dense in $C(\rrm,\rrn)$ then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\im{\rho})$ according to Lemma~\eqref{lem_density_co}.  By Lemma~\ref{lem_redux_to_imrho}, $C(\xxx,\im{\rho})$ is dense in $C(\xxx,\yyy)$.  Since density is transitive, then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
	\end{proof}

\begin{thrm*}[Sharpness of Assumption~\ref{ass_regularity_feature}]
	Let $\xxx$ be a metrizable manifold with boundary, let $\phi$ be continuous, and $\fff\subseteq C(\rrm,\rrn)$.  Then $\fff_{1_{\rrn},\phi}$ is dense in $C(\xxx,\rrn)$ if and only if $\phi$ is injective.
\end{thrm*}
\begin{proof}
	Let $\phi:\xxx\rightarrow \rrm$ be a continuous function.

	Assume that $\fff$ is dense in $C(\rrm,\rrn)$.  Since $1_{\rrn}$ is a homeomorphism of $\rrn$ onto itself it satisfies Assumption~\ref{ass_regularity_readout} (i) and (ii).  Since $\im{1_{\rrn}}=\emptyset$ then Assumption~\ref{ass_regularity_readout} (iii) holds.  Therefore, Theorem~\ref{thrm_main_General_version} implies that $\fff_{1_{\rrn},\phi}$ is dense in $C(\xxx,\rrn)$.

	Conversely, assume that $\phi$ is not injective.  Suppose that $\fff_{1_{\rrn},\phi}$ is dense in $C(\xxx,\rrn)$.  Since $\phi$ is not injective, then there exists distinct $x_1^{\star},x_2^{\star}\in \xxx$ such that
	\begin{equation}
	\phi(x_1^{\star})\neq \phi(x_2^{\star})
	\label{eq_initial_separation}
	.
	\end{equation}

	Since $\xxx$ is metrizable then \citep[Theorem 32.2]{munkres2014topology} implies that $\xxx$ is normal; i.e$.:$ if $K_1,K_2\subseteq \xxx$ are disjoint closed subsets then there exist disjoint open subsets $U_1,U_2\subseteq \xxx$ such that $K_i\subseteq U_i$ for $i=1,2$.  Since $\xxx$ is normal then \citep[Urysohn's Lemma; Theorem 33.1]{munkres2014topology} implies that $C(\xxx,\rr)$ separates points in $\xxx$; i.e.$:$ for every distinct $x_1,x_2$ there exists some $\tilde{f}_{x_1,x_2}\in C(\xxx,\rr)$ such that
	\begin{equation}
	\tilde{f}_{x_1,x_2}(x_1) \neq \tilde{f}_{x_1,x_2}(x_2)
	\label{eq_first_Urysohn_separation}
	.
	\end{equation}
	Since $\rr$ is a metric subspace of $\rrm$ then the inclusion map $\iota:\rr\rightarrow \rrm$ taking $x$ to $(x,0,\dots,0)$ is continuous and by definition it is injective.  Therefore, by~\eqref{eq_first_Urysohn_separation} the function $f\triangleq \iota\circ \tilde{f}_{x_1^{\star},x_2^{\star}}:\xxx\rightarrow \rrn$ satisfies
	\begin{equation}
	f(x_1) \neq f(x_2)
	\label{eq_first_Urysohn_separation_proper}
	.
	\end{equation}
	Since $\fff_{1_{\rrn},\phi}$ was assumed to be dense in $C(\xxx,\rrn)$ then there exists a sequence $\{f_k\}_{k \in \nn}$ in $\fff_{1_{\rrn},\phi}$ converging to $f$ in $C(\xxx,\rrn)$.  Since $\xxx$ is locally-compact then \citep[Theorem 46.10]{munkres2014topology} implies that the evaluation function $e:\xxx\times C(\xxx,\rrn)$ mapping $(x,g)\mapsto g(x)$ is continuous.  Since $\rrm$ is a metric space then $C(\xxx,\rrm)$ is a metric and since continuity in metric spaces is equivalent to sequential continuity then in particular
	\begin{equation}
	\lim\limits_{k \uparrow \infty} e\left(x_i^{\star},f_k\right) = e\left(x_i^{\star},\lim\limits_{k \uparrow \infty} f_k\right) =
	e(x_i^{\star},f)=f(x_i^{\star})
	\label{eq_first_convergence_contradictor}
	,
	\end{equation}
	for $i=1,2$.
	Since, for each $k \in \nn$, $f_k\in \fff_{1_{\rrn},\phi}$ then there exists some $g_k \in C(\rrm,\rrn)$ satisfying $f_k=g_k\circ \phi$.  Hence,~\eqref{eq_initial_separation} implies that, for each $k\in \nn$, $f_k(x_1^{\star}) = g_k\circ \phi(x_1^{\star})=g_k\circ \phi(x_2^{\star})=f_k(x_2^{\star})$; thus,\eqref{eq_first_convergence_contradictor} implies that
	\begin{equation*}
	f(x_2^{\star})=\lim\limits_{k \uparrow \infty} e\left(x_2^{\star},f_k\right)=
	e\left(x_2^{\star},f_k\right) =
	f_k(x_2^{\star})
	=
	f_k(x_1^{\star})
	=
	e\left(x_1^{\star},f_k\right) =
	\lim\limits_{k \uparrow \infty} e\left(x_1^{\star},f_k\right) =
	e(x_1^{\star},f)=f(x_1^{\star})

	.
	\end{equation*}
	However, $f(x_1^{\star})\neq f(x_2^{\star})$ according to~\eqref{eq_first_Urysohn_separation_proper}; a contradiction.  Therefore, $\fff_{1_{\rrn},\phi}$ cannot be dense in $C(\xxx,\rrn)$.
\end{proof}

\begin{cor*}
	If $\phi$ is a continuous injective map, $\rho$ is a surjective covering projection, and $\fff$ is dense in $C(\rrd,\rrD)$ then ${\fff}_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.  In particular, $\phi$ and $\rho$ may be homeomorphisms.
\end{cor*}
\begin{proof}
	Since $\rho$ is a continuous surjection then $\inter{\rho}$ is trivially dense in $\yyy$, since
	$$
	\yyy-\inter{\rho}=\yyy-\yyy=\emptyset
	.
	$$
	Therefore, Assumptions~\ref{ass_regularity_readout} (ii) holds.  Similarly, since $\yyy-\inter{\rho}=\emptyset$ then $\partial \im{\rho} = \emptyset$.  Since the Cartesian product between any set and an empty-set is the empty-set, then let
	$$
	U\triangleq	\emptyset=\partial \im{\rho} = \partial \im{\rho}\times [0,1).
	$$
	Therefore, $\psi(x)=\emptyset$ satisfies Assumption~\ref{ass_regularity_readout} (ii).

	By assumption, $\rho$ is continuous and has a section.
	Therefore Assumption~\ref{ass_regularity_readout} (i.a) holds.

	Thus, Assumptions~\ref{ass_regularity_readout} holds.

	Likewise, $\phi$ was taken to be continuous and injective.  Therefore, Assumption~\ref{ass_regularity_feature} holds.
	Thus, the result follows from Theorem~\ref{thrm_main_General_version} since $\fff$ is dense in $C(\rrm,\rrn)$.

    Note, that if $\phi$ and $\rho$ are homeomorphisms then both are continuous bijections.  Moreover, $\rho$ has a continuous two-sided inverse, and in particular, a continuous section.
\end{proof}
\begin{prop}[Homeomorphic case is Sharp]
	Let $\phi$ and $\rho$ be homeomorphisms.  Then $\fff$ is dense in $C(\rrm,\rrn)$ if and only if $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{prop}
\begin{proof}
	Since every homeomorphism $\rho$ has a continuous section, namely $\phi^{-1}$, then by Corollary~\ref{cor_surjective_trick_A} if $\fff$ is dense in $C(\rrm,\rrn)$ then so is $\fff_{\rho,\phi}$.  Since $\phi$ is a homeomorphism and $\rrm$ is a locally-compact Hausdorff space then $\xxx$ is locally-compact and since $\rho$ is also a homeomorphism then similarly $\yyy$ is a locally-compact Hausdorff space, since $\rrn$ is.  Therefore, by \citep[Exercise 46.10]{munkres2014topology}the maps
	$\Phi_{\rho,\phi}: C(\rrm,\rrn)\rightarrow C(\xxx,\yyy)$ mapping $f \mapsto \rho\circ f\circ \phi$ and $\Psi_{\rho,\phi}:C(\xxx,\yyy)$ mapping $g\mapsto \rho^{-1}\circ g\circ \phi^{-1}$ are continuous with respect to the compact-open topology, because $\rho,\rho^{-1},\phi,$ and $\phi^{-1}$ are all continuous.  Observe that $\Phi_{\rho,\phi}\circ \Psi_{\rho,\phi} = 1_{C(\xxx,\yyy)}$, the identity map on $C(\xxx,\yyy)$, and $\Psi_{\rho,\phi}\circ \Phi_{\rho,\phi} = 1_{C(\rrm,\rrn)}$, the identity map on $C(\rrm,\rrn)$.  Hence, $\Phi_{\rho,\phi}$ is a homeomorphism with inverse $\Psi_{\rho,\phi}$.  Now, since $\fff_{\rho,\phi}=\Phi\left(\fff\right)$, $\fff=\Psi_{\rho,\phi}\left(\fff_{\rho,\phi}\right)$, and since homeomorphisms take dense sets to dense sets then $\fff$ is dense in $C(\rrm,\rrn)$ if and only if $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{proof}
\begin{cor*}
	If $\phi$ is a continuous injective map, $\rho$ is a continuous surjection with a section, $\xxx$ is connected and simply connected, and $\fff$ is dense in $C(\rrd,\rrD)$ then ${\fff}_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{cor*}
\begin{proof}
    The proof is identical to the proof of Corollary~\ref{cor_surjective_trick} with the only difference that Assumption~\ref{ass_regularity_readout} (i.b) holds by assumption instead of Assumption~\ref{ass_regularity_readout} (i.a).
\end{proof}
	We now establish Theorem~\ref{thrm_main_Geometric_version}.
\begin{thrm*}[Geometric Version]
	Let $\yyy$ be a metrizable manifold with boundary, for which $\inter{\yyy}$ is a smooth manifold, $\xxx$ is locally-compact, and $\fff$ is dense in $C(\rrm,\rrn)$.
	If $\phi$ satisfies Assumption~\ref{ass_regularity_feature} and $\rho$ satisfies Assumption~\ref{ass_readout_geometric_version} then $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$.
\end{thrm*}
	\begin{proof}
		For the first portion of the proof we show that $C(\rrn,\im{\rho})$ is dense in $C(\rrn,\yyy)$.  This is achieved in the following steps.  First, $C(\rrn,\im{\rho})$ is shown to be dense in $C(\rrn,\inter{\yyy})$, then that $C(\rrn,\inter{\yyy})$ is dense in $C(\rrn,\yyy)$, and then by the transitivity of density it follows that that $C(\rrn,\im{\rho})$ is dense in $C(\rrn,\yyy)$.

		Since $\rrn$ and $\inter{\yyy}$ are smooth manifolds without boundary then, \citep[Theorem 2.2]{HirschDifferentialTopology1994} implies that $C^{\infty}(\rrn,\yyy)$ is dense in $C(\rrn,\yyy)$ for a strictly stronger topology than the topology of uniform convergence on compacts.  Thus, in particular, $C^{\infty}(\rrn,\yyy)$ is dense in $C(\rrn,\yyy)$ for the topology of uniform convergence on compacts.
		By the transitivity of density it is therefore sufficient to show, under Assumption~\ref{ass_readout_geometric_version}, that $C^{\infty}\left(
		\rrn,\im{\rho}
		\right)$ is dense in $C^{\infty}\left(
		\rrn,\inter{\yyy}
		\right)$ to conclude that $C(\rrn,\im{\rho})$ is dense in $C(\rrn,\inter{\yyy})$.

		If $\inter{\yyy}=\im{\rho}$ then the claim holds vacuously.  Therefore, assume that $\inter{\yyy}\neq \im{\rho}$.  By definition, a smooth map $f:\rrn \to \inter{\yyy}$ is transverse to some $\inter{\yyy}- \im{\rho}$ (i.e.: the inclusion map $\iota_{\inter{\yyy}- \im{\rho}}:\inter{\yyy}- \im{\rho}\to \inter{\yyy}$) if for every $y \in \inter{\yyy}- \im{\rho}$
		\begin{equation}
		\im{df_x} + T_{f(x)}(\inter{\yyy}- \im{\rho}) = T_{f(x)}(\inter{\yyy})
		.
		\label{eq_transverse_definition}
		\end{equation}
		However, Assumption~\ref{ass_readout_geometric_version} (ii) requires that $\dim(\inter{\yyy}) -\dim(\inter{\yyy}- \im{\rho})> n$, which implies that~\eqref{eq_transverse_definition} can only hold when, for each $y \in \inter{\yyy}- \im{\rho}$
		\begin{equation}
		\{0\}
		=
		\im{df_x} \cap T_{f(x)}(\inter{\yyy}- \im{\rho})
		\label{eq_transversal_definition_reforumaiton_under_assumption}
		.
		\end{equation}
		By~\citep[Chapter 1, Excersize 4]{PollackGuilleminDiffTop}
		,~\eqref{eq_transversal_definition_reforumaiton_under_assumption} implies that $f(\rrn)\cap \inter{\yyy}- \im{\rho} = \emptyset$.  Therefore, $f \in C^{\infty}(\rrn,\inter{\yyy})$ is transversal to $\inter{\yyy}- \im{\rho}$ only if $f \in C(\rrn,\im{\rho})$.   Since the set of all $f \in C^{\infty}(\rrn,\inter{\yyy})$ is dense in $C^{\infty}(\rrn,\inter{\yyy})$, by \citep[Theorem 2.1]{HirschDifferentialTopology1994}, then $C^{\infty}(\rrn,\im{\rho})$ is dense in $C^{\infty}(\rrn,\inter{\yyy})$.
		Consequentially, $C(\rrn,\im{\rho})$ is dense in $C(\rrn,\inter{\yyy})$.

		Consider the inclusion map $\iota_{\inter{\yyy}} \to \yyy$.  Then $\iota_{\inter{\yyy}}$ is an embedding of $\inter{\yyy}$ into with section the identity map and it is dense in $\yyy$.  Therefore, Assumption~\ref{ass_regularity_readout} (i)-(ii) hold.
		Assumption~\ref{ass_regularity_readout} (iii) is precisely the definition of a $\partial \im{\iota_{\inter{\yyy}}}=\partial \inter{\yyy}$ being collared (see \citep[Section II; page 332]{brown1962locally}).  By definition, $\partial\inter{\yyy}$ is the \textit{boundary}, in the sense of manifolds with boundary, of the manifold with boundary $\yyy$.  Since $\iota_{\inter{\yyy}}$ is a surjection onto $\inter{\yyy}$ then Assumption~\ref{ass_regularity_readout} (iii) states that the boundary of the manifold with boundary $\yyy$ must be collared.  However, since $\yyy$ is metrizable then this is guaranteed by \citep[Theorem 2]{brown1962locally}.  Thus, Assumption~\ref{ass_regularity_readout} (iii) holds.  Therefore, Assumption~\ref{ass_regularity_readout} holds and Lemma~\ref{lem_redux_to_imrho} guarantees that $C(\rrn,\inter{\yyy})$ is dense in $C(\rrn,\yyy)$.  Hence, $C(\rrn,\im{\rho})$ is dense in $C(\rrn,\yyy)$.

		Since $\fff$ is dense in $C(\rrm,\rrn)$, since the identity map satisfies Assumption~\ref{ass_regularity_feature}, then Assumption~\ref{ass_regularity_readout} implies that Lemma~\ref{lem_density_co} applies.  Whence, $\fff_{\rho,1_{\rrm}}$ is dense in $C(\rrn,\im{\rho})$.  Therefore, $\fff_{\rho,1_{\rrm}}$ is dense in $C(\rrn,\yyy)$.  Applying Lemma~\ref{lem_density_readout}, we conclude that
		$
		\fff_{\rho,\phi}
		$ is dense in $C(\xxx,\im{\rho})$ and therefore in $C(\xxx,\yyy)$ for the compact-open topology by Lemma~\ref{lem_redux_to_imrho}.

		Finally, notice that, since Assumptions~\ref{ass_regularity_readout} (i)-(ii) were assumed to hold then Theorem~\ref{thrm_main_General_version} implies that $\fff_{\rho,\phi}$ is dense in $C(\xxx,\yyy)$ for the co topology.  Since every singleton is closed in $\rrm$ and $\phi$ is continuous and injective then every $x \in \xxx$, $\{x\}$ is the continuous pre-image of the singleton $\{\phi(x)\} \in \rrm$ by $\phi$.  Since $\phi$ is continuous, then $\{x\}$ is closed therefore \citep[Theorem 17.8]{munkres2014topology} implies that $\xxx$ is Hausdorff.  Since $\xxx$ was assumed to be locally-compact and $\yyy$ is metrizable then \citep[Theorem 46.8]{munkres2014topology} implies that the co topology and the ucc topology on $C(\xxx,\yyy)$ coincide for any metric topologizing $\yyy$.
	\end{proof}

\begin{thrm}[Universal Classification: General Case]
	Let $\{0,1\}^n$ be equipped with the $n$-fold product of the Sierpi\'{n}ski topology on $\{0,1\}$, $\phi$ satisfy Assumption~\ref{ass_regularity_feature}, $\rho:\rrn \to (0,1)^n$ be a homeomorphism, $\alpha \in (0,1)$, and $\fff\subseteq C(\rrm,\rrn)$ be dense.  Let $\{\xxx_i\}_{i=1}^n$ be a set of open subsets of a metric space $\xxx$ and let $\hat{h}$ be its associated ideal classifier defined by~\eqref{eq_definition_ideal_classifier}.  Then the following hold:
		\begin{enumerate}[(i)]
		\vspace*{-1em}
		\itemsep -.5em
		\item (Hard-Soft Decomposition) There exist continuous functions $\hat{s}_i\in C(\xxx,[0,1])$ such that
	$$
	\smash{
	\hat{h} = I_{(\alpha,1]}\bullet \left(
	s_1,\dots,s_n
	\right)
	\qquad \hat{s}^{-1}_i[(\alpha,1]] = \xxx_i , (\forall i =1,\dots,n)
	}
	$$
	\item (Universal Classification) There exists a sequence $\{f_k\}_{k \in \nn}$ in $\fff$ such that:
	\begin{enumerate}[(a)]
	\vspace*{-.5em}
	\itemsep -.1em
		\item (Soft Classification) For each non-empty compact subset $\kappa\subseteq \xxx$ and every $\epsilon>0$, there is some $K \in \nn^+$ such that
		$$
		\smash{
		\sup_{x \in \kappa} \max_{i=1,\dots,n}\,
		\left|
		\rho \circ f_k \circ \phi (x)_i
			-
		\hat{s}_i(x_i)
		\right|<\epsilon
		,\qquad (\forall k \geq K)
		}
		$$
		\item (Hard Classification) $I_{(\alpha,1]}\bullet \rho \circ f_k \circ \phi$ converges to $\hat{h}$ in $C(\xxx,\{0,1\}^n)$ for the co-topology.
		\end{enumerate}
	\end{enumerate}
Furthermore, $\fff_{\rho,\phi}$ is dense in $C(\xxx,[0,1]^n)$.
\end{thrm}
\begin{proof}
	Since $\xxx$ is a metric space and since each $\xxx_i$ is open then by \citep[Corollary 3.19]{InfiniteHitchhiker2006} $\xxx_i$ is an open $F_{\sigma}$ set, i.e.: an open set which is the countable intersection of closed sets.  By \citep[Corollary 1.5.13]{engelking1977general} there exists continuous function $\tilde{s}_i:\xxx\to [0,1]$ such that $\tilde{s}_i^{-1}[(0,1]] = \xxx_i$.  Since $\alpha \in (0,1)$, then for each $i=1,\dots,n$, let $s_i(x) = \alpha + (1-\alpha)\tilde{s}_i(x)$.  Then, $s_i$ is continuous from $\xxx$ to $[0,1]$ and satisfies $s_i^{-1}[(\alpha,1]]= \xxx_i$.  Define $\hat{s}\triangleq \left(
	s_1,\dots,s_n\right)$.  Note $\hat{s}$ is continuous from $\xxx$ to $[0,1]^n$ since its components continuously map $\xxx$ to $[0,1]$.  Next, define the map
	$$
	\begin{aligned}
	\Phi_{\alpha}: [0,1]^n &\rightarrow \{0,1\}^n
	\\
	x &\to (I_{(\alpha,1]}(x_i))_{i=1}^n,
	\end{aligned}
	$$
	and note that $\Phi \circ \hat{s} = I_{(\alpha,1]}\bullet \hat{s} = \hat{h}$, by construction. Thus, (i) holds.

	Since $\phi$ is an embedding of $\xxx$ into $\rrm$ for which $\phi(\xxx)$ is a retract, $\rho$ is a homeomorphism of $\rrn$ onto $(0,1)^n$, and since $[0,1]^n$ is a metrizable manifold with boundary whose interior is $\inter{[0,1]^n} = (0,1)^n$ then Theorem~\ref{thrm_main_Geometric_version} implies that $\fff_{\rho,\phi}$ is dense in $C(\xxx,[0,1]^n)$.

	In particular, this implies that, since $\hat{s}\in C(\xxx,[0,1]^n)$, and $\fff_{\rho,\phi}$ is dense therein, then there exists a sequence $\{f_k\}_{k \in \nn}$ in $\fff$ such that, for every non-empty compact-subset $\kappa \subseteq \xxx$, every $\tilde{\epsilon}>0$
	\begin{equation}
	\sup_{x \in \kappa} \,
	\|
	\rho \circ f_k \circ \phi (x)_i
	-
	s_i(x_i)
	\|<\tilde{\epsilon}
	\qquad (\forall k \geq K)
	.
	\label{eq_proof_univ_classification_iia}
	\end{equation}
	Applying \citep[Theorem 3.1]{conway2013course} to~\eqref{eq_proof_univ_classification_iia} yields a constant $C>0$, independent of $x,\{f_k\}_{k\in \nn}$, and of $\hat{s}$, satisfying
	$$
	\sup_{x \in \kappa} \max_{i=1,\dots,n}\,
	\left|
	\rho \circ f_k \circ \phi (x)_i
	-
	s_i(x_i)
	\right|
	\leq
	C\sup_{x \in \kappa} \,
	\|
	\rho \circ f_k \circ \phi (x)_i
	-
	s_i(x_i)
	\|<C\epsilon
	\qquad (\forall k \geq K)
	.
	$$
	Setting $\epsilon\triangleq C \tilde{\epsilon}$ yields (ii.a).
	Thus, we only need to verify (ii.b).

	Equip $\{0,1\}$ with the Sierpi\'{n}ski topology $\left\{\emptyset,\{1\},\{0,1\}\right\}$ and denote this space by $S$.  Then, for any $T_1$ space, and any open set $U$, the indicator function $I_U$ of $U$ is continuous to $\{0,1\}$, see \citep[Chapter 7]{taylor2011foundations}.  In particular, since $[0,1]$ with the Euclidean topology is a metric space, then in particular, it is $T_1$.  Moreover, for any $\alpha \in (0,1)$, the set $(\alpha,1]$ is open in $[0,1]$.  Therefore, the map $I_{(\alpha,1]}:[0,1]\to S$ is continuous and thus the map $\Phi_{\alpha}$ is continuous.  By \cite{munkres2014topology}, since post-composition by continuous functions defines a continuous map between $C(\xxx,[0,1]^n)$ and $C(\xxx,\{0,1\}^n)$ when both are equipped with the compact-open topology then the map
	$$
	\begin{aligned}
	\Phi :  C(\xxx,[0,1]^n) & \rightarrow C(\xxx,\{0,1\}^n)\\
	f & \to \Phi_{\alpha}\circ f
	\end{aligned},
	$$
	is continuous.  Since continuous functions preserve convergent sequences and since $\{\rho\circ f_k \circ \phi\}_{k \in \nn}$ converges to $\hat{s}$ in the compact-open topology on $C(\xxx,[0,1]^n)$ then
	$$
	\left\{
	\Phi(\rho\circ f_k \circ \phi)
	\right\}_{k \in \nn}
	= \left\{
	\Phi_{\alpha}\circ \rho\circ f_k \circ \phi
	\right\}_{k \in \nn}
	=\left\{
	I_{(\alpha,1]}\bullet \rho\circ f_k \circ \phi
	\right\}_{k \in \nn}
	$$ converges to $\Phi(\hat{s})=\Phi_{\alpha}\circ \hat{s} = I_{(\alpha,1]}\bullet \hat{s}$ in the compact-open topology on $C(\xxx,{0,1}^n)$.  This verifies (ii.b). Thus, (ii) holds.
\end{proof}
\begin{cor*}[Universal Classification: Deep Feed-Forward Networks]
Let $\{\xxx_i\}_{i=1}^n$ be open subsets of $\xxx$, and $\hat{h}$ be their associated ideal classifier.  Let $\phi:\xxx\to \rrn$ be a continuous injective feature map.  Let $\sigma$ be a continuous, locally-bounded, and non-constant activation function.  Let $\rho$ either be the component-wise logistic function.  Then there exists a sequence $\{f_k\}_{k \in \nn^+}$ of DNNs satisfying the conclusions of Theorem~\ref{thrm_universal_hard_classification}.
\end{cor*}
\begin{proof}
By \cite{leshno1993multilayer} the set $\NN$ of all feed-forward DNNs is dense in $C(\rrm,\rrn)$.  Moreover, the identity map $1_{\rrm}$ on $\rrm$ satisfies Assumption~\ref{ass_regularity_feature}.  Furthermore, both the soft-max
$$
x\to \left(\frac{e^{x_j}}{\sum_{i=1}^n e^{x_i}}\right)_{j=1}^n
$$
and the component-wise logistic function
$$
x\to \left(
\frac{e^{x_j}}{1+ e^{x_j}}
\right)_{j=1}^n,
$$
are continuous bijections with continuous inverses, from $\rrn$ onto $(0,1)^n$.  In particular, they satisfy Assumption~\ref{ass_regularity_readout}.  Therefore Theorem~\ref{thrm_universal_hard_classification} applies and the conclusion holds.
\end{proof}
\begin{cor*}[Universal Classification: Deep CNNs]
Let $2\leq s\leq n$, $\{\xxx_i\}_{i=1}^n$ be open subsets of $\xxx$, and $\hat{h}$ be their associated ideal classifier.  Let $\phi:\xxx\to \rrn$ be a continuous injective feature map and let $\rho:\rr \to (0,1)$ be the logistic function.  Then there is a sequence of deep CNNS $\{f_k\}_{k \in \nn^+}$ in $Conv^s_{\rho,\phi}$ satisfying the conclusion of Theorem~\ref{thrm_universal_hard_classification}.
\end{cor*}
\begin{proof}
    Since $Conv^{s}$ with these specifications is dense in $C(\rrd,\rr)$ by \cite{zhou2020universality}, $\phi$ is a continuous injection, and $\rho$ is a homeomorphism of $\rr$ onto $(0,1)$ then the result follos from Theorem~\ref{thrm_universal_hard_classification}.
\end{proof}

\begin{cor*}[Cartan-Hadamard Version]
	Let $\fff$ be dense in $C(\rrm,\rrn)$, let $\mmm$ and $\nnn$ be Cartan-Hadamard manifolds of dimension $m$ and $n$.  Then, $\fff_{\operatorname{Log}_p^{\mmm},\operatorname{Exp}_q^{\nnn}}$ is dense in $C(\mmm,\nnn)$.
\end{cor*}
\begin{proof}
	Since $\nnn$ and $\mmm$ are Hadamard manifolds then the Cartan-Hadamard Theorem, see \citep[Corollary 6.9.1]{jost2008riemannian}, implies that $\operatorname{Exp}_p^{\mmm}$ and $\operatorname{Log}_q^{\nnn}$ are diffeomorphisms and in particular are homeomorphisms.
	Since $\nnn$ and $\mmm$ have no boundary then the result follows from Corollary~\ref{cor_surjective_trick}.
\end{proof}
\begin{cor*}[Universal Approximation for Symmetric Positive-Definite Matrices]
	Let $d,D \in \nn^+$ and $\fff\subseteq C(\rrflex{d(d+1)/2},\rrflex{D(D+1)/2})$
	be ucc-dense.  Then, for any $A\in P_d^+$ and $B\in P_D^+$,
	$\fff_{\operatorname{Log}_A,\operatorname{Exp}_B}$ is ucc-dense in $C(P_d^+,P_D^+)$.  In particular, if $\sigma$ is a continuous, locally-bounded, and non-polynomial activation function then $\NN_{\operatorname{Log}_A,\operatorname{Exp}_B}$ is ucc-dense in $C(P_d^+,P_D^+)$.
\end{cor*}
\begin{proof}
	As discussed in \citep[Section 3.3]{bonnabel2013rank}, the space $P_d^+$ under the metric $d_+$ is a complete, connected, and simply connected Riemannian manifold with non-positive curvature.  Therefore, Corollary~\ref{cor_Riemannian_Version} applies.
\end{proof}
\begin{cor*}[Hyperbolic Neural Networks are Universal]\label{ex_HNN_univ}
	Let $\sigma$ be a continuous, non-polynomial, locally-bounded activation function and $c>0$.  Then for every $g \in C(\mathbb{D}^m_c,\mathbb{D}^n_c)$, every $\epsilon>0$, and every compact subset $K\subseteq \mathbb{D}^m_c$ there exists a hyperbolic neural network $g_{\epsilon,K,c}$ in~\eqref{eq_hyperbolic_NNs} satisfying
	$$
	\smash{\sup_{x \in K} d_c(g(x),g_{\epsilon,K,c})<\epsilon
	.
}
	$$
\end{cor*}
\begin{proof}
Since $\mathbb{D}_c^n$ is a complete, connected, simply connected, of non-positive sectional curvature Riemannian manifold then it is of Cartan-Hadamard type.  Therefore, the result follows directly form Corollary~\ref{cor_Riemannian_Version}.
\end{proof}
\begin{thrm*}
	If Assumption~\ref{ass_broad_regularity_random_init_disc} holds, then there exists a measurable subset $\Omega'\subseteq \left\{
	\omega \in \Omega:\, \overline{\NN[2,k](\omega)}=C(\rrd,\rrD)
	\right\}$ satisfying
	$
	\pp\left(
	\Omega'
	\right) =1
	.
	$
\end{thrm*}
\begin{proof}
	Let $\operatorname{Mat}_{k,l}$ denote the collection of $k\times l$ matrices with real coefficients, identified with the Euclidean space $\rrflex{kl}$.
	By Assumption~\ref{ass_broad_regularity_random_init_disc} (ii) $\sigma$ is a injective continuous function.  Therefore so is the function
	$$
	\begin{aligned}
	\sigma_i:\rrflex{d_{i+1}}&\rightarrow \rrflex{d_{i+1}}\\
	(x_j)_{j=1}^{d_{i+1}} &\mapsto (\sigma(x_j))_{j=1}^{d_{i+1}}
	\end{aligned}
	.
	$$
	Fix $\omega \in \Omega$.  Since $d_i= d_{i+1}$, then the map $W_i(\cdot,\omega)$ is affine injection if and only if $A_i(\omega)$ is of rank $d_i
	$.  Since the composition of continuous injections is again continuous then the map
	\begin{equation}
	\begin{aligned}
	\phi(x,\omega):\rrflex{d} &\rightarrow \rrflex{d_k}\\
	x & \mapsto \Sigma_k \circ A_k(x,\omega) \circ \dots \circ \Sigma_1 \circ A_1(x,\omega)
	,
	\end{aligned}
	\label{eq_phi_rand_proof}
	\end{equation}
	is continuous and injective if each $A_i(\omega)$ is of full rank.
	Equivalently, it is enough to show that the smallest singular value of $A_i$, which we denote by $\lambda^{\star}(A_i)$ to avoid confusion with the notation for activation functions, should be bounded away from $0$ with probability $1$.

	Since each $A_i$ is a random $d_{i+1}\times d_i$ matrix and $d_{i+1}\geq d_i$, then it contains a random $d_i\times d_i$ (square) sub-matrix.  It is enough to show that this random sub-matrix is of full-rank.  Therefore, without loss of generality, we assume that $d_{i+1}=d_i$ for all $i=1,\dots,k$.

	Since each $A_i$ is a random $d_i\times d_i$ square matrix and Assumptions~\ref{ass_broad_regularity_random_init_disc} hold then \citep[Theorem 1.3 (Universality for the Least Singular Value)]{TerryRandomMatrices} applies whence.  Therefore,
	$$
	\begin{aligned}
	\pp\left(
	\lambda^{\star}(A_i) >0 \, \forall(i=1,\dots,k)
	\right)
	= &
	1-
	\prod_{i=1}^k\pp\left(
	\lambda^{\star}(A_i) >0
	\right)\\
	= &
	1-
	\lim\limits_{t \downarrow 0^+ }
	\prod_{i=1}^k
	\pp\left(
	\lambda^{\star}(A_i) \leq \frac{t}{\sqrt{d_i}}
	\right)
	\\
	= &
	\left(
	\int_0^t
	\frac{1+ \sqrt{x}}{2\sqrt{x}}
	e^{-\frac{x}{2} -\sqrt{x}}
	dx
	+
	O\left(
	\frac1{x^c}
	\right)
	\right)^k
	\\
	=& 0,
	\end{aligned}
	$$
	where $c>0$ is an absolute constant independent of $\xi$.
	Therefore, the set
	$$
	\Omega'\triangleq \left\{
	\omega \in \Omega:\,
	\lambda_i(A_i)>0 \, \forall i=1,\dots,k
	\right\} \subseteq
	\left\{
	\omega \in \Omega:\, \overline{\NN(\omega)}=C(\rrd,\rrD)
	\right\}
	$$
	is $\Sigma$-measurable and $\pp\left(\Omega'\right)=1$.  This concludes the proof.
\end{proof}
\begin{cor*}[Sub-Gaussian Case with Sigmoid Activation]
	Let $X_i=Z_i$ for each $i=1,\dots,k$ be independent sub-Gaussian random-variables, $\sigma(x)=\frac1{1+e^{-x}}$, and $d_i=d$ for each $i=1,\dots,k$.  Then the conclusion of Theorem~\ref{thrm_random_init_disc} holds.
\end{cor*}
\begin{proof}
Since the $X_i$ and $Z_i$ are sub-Gaussian random variables, then by \citep{MR598605} all their moments are finite.  This verifies Assumption~\ref{ass_broad_regularity_random_init_disc} (iv).  Since they are assumed to be standardized then Assumption~\ref{ass_broad_regularity_random_init_disc} (iii) holds.  Since the sigmoid activation function is continuous and monotonically increasing then Assumption~\ref{ass_broad_regularity_random_init_disc} (ii) holds.  Lastly, Assumption~\ref{ass_broad_regularity_random_init_disc} (i) holds by construction.  Therefore, Theorem~\ref{thrm_random_init_disc} applies and the conclusion follows.
\end{proof}
\begin{cor*}[Bernoulli Case with PReLU Activation]
	Suppose that for every $i,j=1,\dots,k$, $X_i$ and $Z_j$ i.i.d. copies of a random variable taking values $\{-1,1\}$ with probabilities $\{\frac1{2},\frac1{2}\}$.  Let $d_i=d$ for each $i=1,\dots,k$ and $\sigma$ be the PReLU activation function of \cite{he2015delving}.  Then Assumptions~\ref{ass_broad_regularity_random_init_disc} are met; thus the conclusion of Theorem~\ref{thrm_random_init_disc} holds.
\end{cor*}
\begin{proof}
Since the PReLU activation function is continuous and strictly increasing, then Assumption~\ref{ass_broad_regularity_random_init_disc} (ii) holds.  Since, Bernoulli random variables have all finite $C^{th}$-moments, for $C>0$, then Assumption~\ref{ass_broad_regularity_random_init_disc} (iv) holds.  Since $X_i$ and $Z_i$ are taken to be standardized, then Assumption~\ref{ass_broad_regularity_random_init_disc} (iii) holds.  Assumption~\ref{ass_broad_regularity_random_init_disc} (i) holds by hypothesis.  Therefore, the result follows from Theorem~\ref{thrm_random_init_disc}.
\end{proof}

\begin{prop*}
	Let $\sigma$ be a continuous and strictly increasing activation function, $J\in \nn_+$, $A_1,\dots,A_J$ be $m\times m$ matrices, and $b_1,\dots,b_J\in \rrd$.  Let $\phi(x)\triangleq \phi_J(x)$ where
	\begin{equation}
	\smash{
		\phi_j(x) \triangleq  \sigma\bullet
		\left(
		\exp\left(
		A_j\right) \phi_{j-1}(x) + b_j
		\right) \qquad \phi_0(x)\triangleq x,\quad j=1,\dots,J
	}
	\label{eq_dNN_layerr}
	,
	\end{equation}
	where $\exp$ is the matrix exponential.  Then $\phi$ satisfies Assumption~\ref{ass_regularity_feature}.
\end{prop*}
\begin{proof}
	Since $\sigma$ is strictly increasing then it is injective.  Therefore, the map $\phi_1(x)\triangleq  \left(\sigma(x_k)\right)_{k=1}^m$ is continuous and injective from $\rrm$ to itself.  Next, for each $1\leq j\leq J$ with $j \in \nn_+$, each $A_j$ is a $d\times d$ matrix then its exponential $\exp(A_j)$ is in the general linear group (see \cite{knapp2002lie}) and therefore it is an invertible $m\times m$ matrix; hence, the map $\phi_{2,j}(x)\triangleq \exp(A_j)x$ is a continuous bijection from $\rrm$ to itself.  Finally, for each $b_j \in \rrm$, the map $\phi_3(x)\triangleq x + b_j$ is a continuous bijection, since it is affine with inverse $y \mapsto y-b_j$; hence, $\phi_{3,j}$ is a continuous injection from $\rrm$ to itself.  Since the composition of continuous functions is again continuous and the composition of injective functions is again injective then the map $\phi=\phi_1\circ \phi_{3,J}\circ \phi_{2,J}\circ \dots\circ \phi_1\circ\phi_{3,1}\circ \phi_{2,1}$ of~\eqref{eq_dNN_layerr} is a continuous injection; hence, it satisfies Assumption~\ref{ass_regularity_feature}.
\end{proof}
\begin{prop*}
	In the setting of Proposition~\ref{prop_deep_feed_forward_representations}, if $\sigma$ is also surjective then $\phi$ is a homeomorphism, and in particular it satisfies Assumption~\ref{ass_regularity_readout}.
\end{prop*}
\begin{proof}
	By Proposition~\ref{prop_deep_feed_forward_representations} the map $\phi$ is continuous and injective.  Since $\sigma$ is a continuous strictly increasing function then it is injective.  Moreover by \cite{HoffmanContinuityInverse} it is a homeomorphism onto its image.  Since $\sigma$ was assumed to be a surjection then this means that $\sigma$ is a homeomorphism from $\rr$ to itself.  Therefore, the map $\prod_{i=1}^m \sigma:\rrm\rightarrow\rrm$ sending $x$ to $(\sigma(x_i))_{i=1}^m$ is a homeomorphism by \citep[Theorem 19.6]{munkres2014topology}.  In the proof of Proposition~\ref{prop_deep_feed_forward_representations}, above, it was shown that for each $1\leq j\leq J$, $j\in \nn_+$, the maps $x\mapsto \exp(A_j)x$ and $x\mapsto x+b_j$ are homeomorphisms.  Therefore, since the composition of homeomorphisms is again a homeomorphism then $\phi$ is a homeomorphism.  In particular, it satisfies Assumption~\ref{ass_regularity_readout} since $\phi^{-1}$ exists and is continuous (thus Assumption~\ref{ass_regularity_readout} (i) holds), $\operatorname{Im}{\phi}=\rrm$ (thus Assumption~\ref{ass_regularity_readout} (ii) holds), and since $\partial\operatorname{Im}{\phi}=\emptyset$ (thus Assumption~\ref{ass_regularity_readout} (iii) holds).
\end{proof}
\begin{prop*}[Graphs of Continuous Functions are Good Feature Maps]
	Let $d\in \nn_+$ and $g\in C(\rrm,\rrd)$.  Then $\phi_g(x)\triangleq (x,g(x))$ satisfies Assumption~\ref{ass_regularity_feature}.
\end{prop*}
\begin{proof}
	Let identity map $1_{\rrm}(x)\triangleq x$ is continuous from $\rrm$ to itself and by hypothesis the map $g:\rrm\rightarrow \rrd$ is continuous, therefore, by \citep[Theorem 19.6]{munkres2014topology} the map $1_{\rrm}\times g:\rrm\times \rrm \rightarrow \rrm\times \rrd = \rrflex{m+d}$ is continuous.  A consequence of the same result shows that, for topological spaces $X,Y,$ and $Z$ and a function $F:Z\rightarrow X\times Y$ is continuous, when $X\times Y$ is equipped with the product topology, if and only if both $\pi_1\circ F:Z\rightarrow X$ and $\pi_2\circ F:Z\rightarrow Y$ are continuous, where $\pi_1(x,y)=x$ and $\pi_2(x,y)=y$.  Therefore, when $X=Y=Z=\rrm$ and $F(x)\triangleq (x,x)$ then
	\begin{equation}
	\pi_1\circ F = 1_{\rrm}=\pi_2\circ F
	,
	\label{eq_prop_skip_connection_little_redux}
	\end{equation}
	and since $1_{\rrm}$ is continuous then~\eqref{eq_prop_skip_connection_little_redux} implies that $F$ is continuous.  Since the composition of continuous functions is again continuous, then $(1_{\rrm}\times g)\circ F(x) = (x,g(x))$ is continuous from $\rrm$ to $\rrflex{m+d}$.   Lastly, notice that if $x_1\neq x_2$ in $\rrm$ then $\|x_1-x_2\|>0$ and therefore
	$$
	\left\|
	(x_1,g(x_1)) - (x_2,g(x_2))
	\right\| \geq \|x_1-x_2\|>0.
	$$
	Hence, $(x_1,g(x_1))\neq (x_2,g(x_2))$ in $\rrflex{m+d}$ and therefore, $(1_{\rrm}\times g)\circ F$ is a continuous and injective functions.  Therefore, Assumption~\ref{ass_regularity_feature} holds.
\end{proof}
\end{appendices}

\bibliographystyle{abbrvnat}
\bibliography{References_final}

\end{document}

config: arxiv


TITLE: What is the potential energy of electromagnetic waves traveling in air?
QUESTION [0 upvotes]: The Lagrangian for electromagnetic waves shows that its energy has a kinetic part as well as a potential part (just like everything else). The potential part only exists in a medium whereas in the vacuum all energy in electromagnetic waves are kinetic.
Similar formulation exists for mechanical (e.g. elastic) waves. In this case, I understand easily that the kinetic energy is simply the intensity of shaking/amplitude of waves (e.g. in an earthquake) whereas the potential energy is the so-called strain energy which is basically just the potential energy associated for a spring.
Returning back to electromagnetic waves, I can understand that the kinetic energy is, again, the amplitude of the waves that is manifested by e.g. light brightness or heat (which originates from the motion/collision of particles). However, I am having a hard time thinking of an intuitive interpretation for potential energy for electromagnetic waves. I only know that this only exists in non-vacuum space. So, what is the potential energy for all the electromagnetic waves we create here on earth, which are traveling in the air that is non-vacuum. Are there examples of familiar electromagnetic waves that does not have (or have very little) kinetic energy but is purely all potential energy?

REPLY [0 votes]: Potential energy is not an intrinsic quantity of any physical object, and therefore it is not meaningful to ask of the potential energy of an electromagnetic wave. In some sense, you can view the EM wave as a collection of photons, all of which can interact with any system (or not, i.e., for the sake of this question, we can say that photons do not interact with other photons), and thus may have potential energy with respect to that system. For example, photons interact with gravity, and will gain kinetic energy (via E = hf, for E is the energy, h is Planck's constant, an f is the frequency of the light) by changing frequency as they propagate through the gravitational field.