\newpage
\section[Functions of Several Variables]{\hyperlink{toc}{Functions of Several Variables}}

\subsection{Banach Fixed Point Theorem}
\noindent Our goal in this chapter will be to work up to the Inverse Function Theorem. This chapter in Rudin begins by covering the necessary results in linear algebra; we will assume this has been covered in a prior course, so we will omit discussion of items 9.1-9.9. However, these can be read for a refresher of the material.

We will start off this chapter with discussion of the Banach fixed point theorem (also known as the Contraction principle), as it is independent of the rest of the chapter's content. It will be used in the proof of the inverse function theorem, but also applies in a more general setting.

\setcounter{rudin}{21}

\begin{definition}{Contractions}{9.22}
    Let $(X, d)$ be a metric space. Suppose there exists $c < 1$ such that the map $\phi: X \mapsto X$ satisfies $d(\phi(x), \phi(y)) \leq cd(x, y)$ for all $x, y \in X$ (that is, the images of $x, y$ are closer by a factor $c$ compared to the original $x, y$). Then, we call $\phi$ a \textbf{contraction} of $X$ into $X$.
\end{definition}
\begin{nlemma}{}{}
    Every contraction $\phi: X \mapsto X$ is uniformly continuous.
\end{nlemma}
\begin{nproof}
    Take $\delta = \frac{\e}{c}$ in the definition of uniform continuity. \qed
\end{nproof}

\begin{theorem}{Banach Fixed Point Theorem/Contraction Mapping Theorem}{9.23}
    Let $(X, d)$ be a complete metric space, and suppose $\phi: X \mapsto X$ is a contraction. Then, there exists a unique $x \in X$ such that $\phi(x) = x$. We call this x a \emph{fixed point}.
\end{theorem}
\noindent The proof of the above theorem gives an algorithm to find $x$ which converges exponentially fast.

\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}[scale=2]
        \draw[-latex, very thick] (0, 0) -- (2, 0);
        \draw[-latex, very thick] (0, 0) -- (0, 2);
        \draw[-latex, very thick] (0, 0) -- (-1, 0);
        \draw[blue] (-0.5, 0) .. controls (0, 0.6) and (0.5, 0.8 ).. (1.8, 1.4);
        \draw[fill = blue, draw = blue] (-0.5, 0) circle (1pt);
        \draw[fill = blue, draw = blue] (1.8, 1.4) circle (1pt);
        \draw[red] (-0.5, -0.5) -- (1.8, 1.8);
        \draw[fill = red, draw = red] (-0.5, -0.5) circle (1pt);
        \draw[fill = red, draw = red] (1.8, 1.8) circle (1pt);
        \draw[] (-0.4, 0) -- (-0.4, -0.15);
        \node[below] at (-0.4, -0.15) {$x_0$};
        \draw[dotted] (-0.4, 0) -- (-0.4, 0.12);
        \draw[dotted] (-0.4, 0.12) -- (0.13, 0.12);
        \draw[dotted] (0.11, 0) -- (0.11, 0.55);
        \draw[] (0.11, 0) -- (0.11, -0.15);
        \node[below] at (0.11, -0.15) {$x_1$};
        \draw[dotted] (0.11, 0.55) -- (0.55, 0.55);
        \draw[dotted] (0.55, 0) -- (0.55, 0.55);
        \draw[] (0.55, 0) -- (0.55, -0.15);
        \node[below] at (0.55, -0.15) {$x_2$};
    \end{tikzpicture}

    \caption{Visualization of the algorithm for finding the fixed point $x$ in Theorem \ref{thm:9.23} for the case where $X = \RR$. The fact that $\phi$ is a contraction makes it such that it has slope less than $1$. The fixed point is the point of intersection between $y = x$ and $y = \phi(x)$. The iterative algorithm sketched above gives an exponentially fast way of finding this point of intersection, by iteratively applying $\phi$ to the initial guess $x_0$.}
    \label{fig59}
\end{figure}

\begin{nproof}
    We first show uniqueness. If $\phi(x) = x$ and $\phi(y) = y$, then $d(\phi(x), \phi(y)) \leq cd(x, y)$. But since $c < 1$, $d(x, y) \leq cd(x, y)$ is only satisfied if $d(x, y) = 0$. Hence, $x = y$ and the fixed point is unique.

    We next show existence. Given $x_0 \in X$, let $x_1 = \phi(x_0)$, $x_2 = \phi(x_1) = \phi\circ \phi(x_0)$, $x_3 = \phi(x_2) = \phi\circ\phi\circ\phi(x_0)$ and so on, with $x_{n+1} = \phi(x_n) = \phi \circ \ldots \circ \phi(x_0)$ with the composition carried out $n+1$ times. The goal is to show this sequence is Cauchy, and has a limit which is a fixed point. We then have that $d(x_{n+1}, x_{n+2}) = d(\phi(x_n), \phi(x_{n+1})) \leq cd(x_{n+1}, x_n)$, so by induction, it follows that $d(x_{n+1}, x_n) \leq c^nd(x_1, x_0)$. Hence, for $n > m$ we have that:
    \begin{align*}
        d(x_n, x_m) &\leq \sum_{i=m+1}^n d(x_i, x_{i-1}) & \text{(Triangle Inequality)}
        \\ &\leq \sum_{i=m+1}^n c^{i-1}d(x_1, x_0)
        \\ &\leq \sum_{i=m+1}^\infty c^{i-1}d(x_1, x_0)
        \\ &= \frac{c^m}{1-c}d(x_1, x_0) & \text{(Convergent Geometric Series)}
    \end{align*}
    $c^m$ can be as small as we like by taking sufficiently large $m$, so $\set{x_n}$ is Cauchy, and by the completeness of $X$, $x_n \rightarrow x$ for some $x$. Since $\phi$ is a contraction, it is (uniformly) continuous by the above Lemma, and since $x_n \rightarrow x$, we have that $\phi(x_n) \rightarrow \phi(x)$, and hence:
    \begin{align*}
        \phi(x) = \linf \phi(x_n) = \linf x_{n+1} = x.
    \end{align*}
    This shows that $x$ is the desired fixed point. \qed
\end{nproof}

\subsection{Differentiation of Functions of Several Variables}
\noindent In this section we discuss the differentiation of functions $f: \RR^n \mapsto \RR^m$. It will be instructive to remind ourselves of the familiar case of $n = m = 1$. In this case, we defined the derivative as:
\begin{align*}
    f'(x) = \lim_{h \rightarrow 0}\frac{f(x + h) - f(x)}{h}
\end{align*}
where we would say $f$ was differentiable at $x$ if the above limit existed. We want to now try to generalize this notion to higher dimensions. It obviously does not apply directly, as in this general setting, $\v{f}(\v{x} + \v{h}) - \v{f}(\v{x})$ is a vector in $\RR^m$ and $\v{h}$ is a vector in $\RR^n$, and the division of such vectors is not well defined. Let us try to recast the $n = m = 1$ derivative into a form that lends itself better to generalization. We could equivalently write the above derivative expression as:
\begin{align*}
    \lim_{h \rightarrow 0}\frac{f(x + h) - f(x) - f'(x)h}{h} = 0
\end{align*}
and hence:
\begin{align*}
    \lim_{h \rightarrow 0}\abs{\frac{f(x + h) - f(x) - f'(x)h}{h}} = 0.
\end{align*}
Equivalently, we can say that $f(x + h) = f(x) + f'(x)h + r(h)$ with $\lim_{h \rightarrow \infty}\frac{r(h)}{h} = 0$; $r(h)$ is then the ``remainder term''. With this interpretation, $f'(x)h$ is the best linear approximation to $f(x + h) - f(x)$. This last characterization makes sense for general vectors in $\RR^k$, so let us define derivatives with this notion!

\setcounter{rudin}{10}

\begin{definition}{Derivatives of $f: \RR^n \mapsto \RR^n$}{9.11}
    Let $m, n \in \NN$ and $E \subset \RR^n$ be open. Define a function $\v{f}$ such that $\v{f}: E \mapsto \RR^m$, and let $\v{x} \in E$. We say that $f$ is \textbf{differentiable} at $\v{x}$ and has \textbf{derivative} $A \in L(\RR^n, \RR^m)$ ($\v{f}'(\v{x}) = A$) if:
    \begin{align*}
        \lim_{\v{h} \rightarrow \v{0}} \frac{\abs{\v{f}(\v{x} + \v{h}) - \v{f}(\v{x}) - A\v{h}}}{\abs{\v{h}}} = 0
    \end{align*}
\end{definition}
\noindent Note that the $\abs{}$ in the above definition refer to the $L_2$/Euclidean norm of $\RR^m$ (in the numerator) and $\RR^m$ (in the denominator) respectively. Furthermore, observe that $A$ is not just a number (as it is in the linear case) but an \emph{linear transformation} such that $A \in L(\RR^n, \RR^m)$, where $L(\RR^n, \RR^m)$ is the vector space of linear maps from $\RR^n$ to $\RR^m$. Equivalently, the above definition can be phrased as:
\begin{align*}
    \v{f}(\v{x} + \v{h}) = \v{f}(\v{x}) + A\v{h} + \v{r}(\v{h}) \text{ with } \lim_{\v{h} \rightarrow \v{0}} \frac{\abs{\v{r}(\v{h})}}{\abs{\v{h}}} = 0
\end{align*}
where again, $A\v{h}$ is the ``best linear approximation'' to $\v{f}(\v{x} + \v{h}) - \v{f}(\v{x})$.

\begin{theorem}{Uniqueness of Higher Dimensional Derivatives}{9.12}
    The derivative $A$ defined above is unique.
\end{theorem}
\begin{nproof}
    Suppose $\v{f}(\v{x} + \v{h}) = \v{f}(\v{x}) + A_1\v{h} + \v{r}_1(\v{h})$ and $\v{f}(\v{x} + \v{h}) = \v{f}(\v{x}) + A_2\v{h} + \v{r}_2(\v{h})$ with $\v{r}_1(\v{h}) \in O(\v{h})$ and $\v{r}_2(\v{h}) \in O(\v{h})$. Let $B = A_1 - A_2$. Then, $0 = (A_1 - A_2)\v{h} + (\v{r}_1 - \v{r}_2)$. Therefore, $B\v{h} = \v{r}_2 - \v{r}_1$, so for $\v{h} \neq \v{0}$ and scalar $t \neq 0$ we have that:
    \begin{align*}
        \frac{\abs{B\v{h}}}{\abs{\v{h}}} = \frac{\abs{B(t\v{h})}}{\abs{t\v{h}}} \leq \frac{\abs{\v{r}_1(t\v{h})}}{\abs{t\v{h}}} + \frac{\abs{\v{r}_2(t\v{h})}}{\abs{t\v{h}}} \quad \text{(Triangle Inequality)}
    \end{align*}
    Letting $t$ go to zero, we have that the RHS goes to zero. Hence, $\frac{\abs{B\v{h}}}{\abs{\v{h}}} \rightarrow 0$. But $\frac{\abs{B\v{h}}}{\abs{\v{h}}}$ is independent of $t$, so it must be zero. Hence, $B$ is the zero map and hence $A_1 = A_2$. We conclude that the derivative $A$ is unique. \qed
\end{nproof}

\noindent Note that if $f'(x)$ exists for all $x$ in $E$, then we can regard $\v{f}'$ as a function $\v{f}': E \mapsto L(\RR^n, \RR^m)$. Let us clarify that $\v{f}'$ is \emph{not} a vector valued function, but a linear map; we use the notation $\v{f}'$ to denote it as the derivative of a vector valued function.

\setcounter{rudin}{13}
\begin{example}{}{9.14}
    Suppose $f: \RR^n \mapsto \RR^m$ is linear. Then:
    \begin{align*}
        \v{f}(\v{x} + \v{h}) = \v{f}(\v{x}) + \v{f}(\v{h}) + 0
    \end{align*}
    for all $\v{x}, \v{h} \in \RR^n$. Hence, $\v{f}'(x) = \v{f}$ for all $\v{x}, \v{h} \in \RR^n$. The derivative is the function itself (\emph{not} the value $\v{f}(\v{x})$) when $\v{f}$ is linear.

    Note that for $n = m = 1$, we can identify a linear map $f: \RR \mapsto \RR$ as $f(x) = \alpha x$, with $\alpha \in \RR$. Then, $f'(x) = \alpha$ is consistent with the above general result.
\end{example}
\begin{ntheorem}{}{}
    If $\v{f}'(\v{x})$ exists, then $\v{f}$ is continuous at $\v{x}$.
\end{ntheorem}
\begin{nproof}
    $\lim_{\v{h} \rightarrow 0}\v{f}(\v{x} + \v{h}) = \lim_{\v{h} \rightarrow 0}\left(\v{f}(\v{x}) + \v{f}'(\v{x})\v{h} + O(\v{h})\right) = \v{f}(\v{x})$. \qed
\end{nproof}

\begin{ndef}{: Norm of a linear map}{}
    Let $A: \RR^n \mapsto \RR^m$ be a linear map. We then define:
    \begin{align*}
        \norm{A} = \sup\set{\abs{A\v{x}}: \abs{\v{x}} \leq 1}.
    \end{align*}
\end{ndef}
\noindent In other words, we have that $\abs{A\v{x}} = \abs{A\frac{\v{x}}{\abs{\v{x}}}}\abs{\v{x}} \leq \norm{A}\v{x}$ for all $\v{x} \in \RR^n$. $\norm{A}$ is the best constant bound. Before moving onto the next theorem, we note a couple facts about $\norm{A}$:
\begin{enumerate}
    \item $\norm{A} < \infty$ for any linear map $A$.
    \item $\norm{AB} \leq \norm{A}\norm{B}$.
    \item $d(A, B) = \norm{A - B}$, which defines a metric on the space of linear maps.
\end{enumerate}

\begin{theorem}{Chain Rule}{9.15}
    Suppose that $E \subset \RR^n$, $E$ is open, and $\v{f}: E \mapsto \RR^m$. Furthermore, suppose $V \subset \RR^m$ is open and $\v{f}(E) \subset V$. Define $\v{g}: V \mapsto \RR^k$, and suppose $\v{f}'(\v{x}_0)$ exists and $\v{g}'(\v{f}'(\v{x}_0))$ exists for some $\v{x}_0 \in E$. Let $\v{F} = \v{g} \circ \v{f}: E \mapsto \RR^k$. Then, we have that $\v{F}'(\v{x}_0)$ exists, and $\v{F}'(\v{x}_0) = \v{g}'(\v{f}(\v{x}_0))\v{f}'(\v{x}_0) \in L(\RR^n, \RR^k)$.
\end{theorem}
\noindent As a point of clarification, note that $\v{g}'(f(\v{x}_0))\v{f}'(\v{x}_0)$ denotes a composition of linear operators, where $\v{f}': \in L(\RR^n, \RR^m)$ and $\v{g}' \in L(\RR^m, \RR^k)$.
\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}[scale=2.5]
        \draw[] (0, 0) -- (1, 0) -- (1, 1) -- (0, 1) -- (0, 0);
        \draw[draw= white, fill = white!60!black, fill opacity = 0.3] (3, 0.25) -- (3, 1) -- (2, 1) -- (2, 0.25) -- (3, 0.25);
        \draw[] (2, 0) -- (3, 0) -- (3, 1) -- (2, 1) -- (2, 0);
        \draw[] (4, 0) -- (5, 0) -- (5, 1) -- (4, 1) -- (4, 0);
        \draw[->, thick] (1.1, 0.75) -- (1.9, 0.75);
        \draw[->, thick] (3.1, 0.75) -- (3.9, 0.75);
        \draw[->, thick] (1.1, -0.1) .. controls (2.5, -0.5) .. (3.9, -0.1);
        \draw[dotted, fill = white!60!black, fill opacity=0.3] (0.5, 0.5) circle (10pt);
        \draw[dotted] (2, 0.25) -- (3, 0.25);
        \draw[dotted, fill = white!60!black, fill opacity=0.3] (2.6, 0.6) circle (8pt);
        \node[right] at (0, 0.15) {$\RR^n$};
        \node[right] at (2, 0.15) {$\RR^m$};
        \node[right] at (4, 0.15) {$\RR^k$};
        \node[right] at (2, 0.35) {$V$};
        \node[] at (0.32, 0.32) {$E$};
        \node[] at (2.55, 0.45) {$\v{f}(E)$};
        \node[above] at (1.5, 0.75) {$\v{f}$};
        \node[above] at (3.5, 0.75) {$\v{g}$};
        \node[above] at (2.5, -0.4) {$\v{F}$};
        \filldraw[] (0.4, 0.6) circle (0.5pt);
        \node[above] at (0.4, 0.6) {$\v{x}_0$};
        \filldraw[] (2.65, 0.6) circle (0.5pt);
        \node[above] at (2.65, 0.6) {$\v{f}(\v{x}_0)$};
    \end{tikzpicture}
    \caption{Visualization of the sets and functions in Theorem \ref{thm:9.15}.}
    \label{fig60}
\end{figure}
\begin{nproof}
    The proof is very similar to the one dimensional case. We observe that:
    \begin{align*}
        \v{F}(\v{x}_0 + \v{h}) - \v{F}(\v{x}_0) &= \v{g}(\v{f}(\v{x}_0 + \v{h})) - \v{g}(\v{f}(\v{x}_0)).
    \end{align*}
    We can then write $\v{f}(\v{x}_0 + \v{h})$ as $\v{f}(\v{x}_0) + \v{K}$ where $\v{K} = \v{f}'(\v{x}_0)\v{h} + \v{u}(\v{h})$ with $\v{u}(\v{h}) \in O(\v{h})$. We can then write:
    \begin{align*}
        \v{F}(\v{x}_0 + \v{h}) - \v{F}(\v{x}_0) &= \v{g}'(\v{f}(\v{x}_0))\v{K} + \v{V}(\v{K})
        \\ &= \v{g}'(\v{f}(x_0))\left[\v{f}'(x_0)\v{h} + \v{u}(\v{h})\right] + \v{V}(\v{K})
        \\ &= \v{g}'(\v{f}(x_0))\v{f}'(x_0)\v{h} + \v{g}'(\v{f}(x_0))\v{u}(\v{h}) + \v{V}(\v{K})
    \end{align*}
    where $\v{g}'(\v{f}(x_0))\v{u}(\v{h}) + \v{V}(\v{K}) = \v{r}(\v{h})$ is our remainder term. We want to prove that $\v{r}(\v{h})  \in O(\v{h})$, i.e. that $\frac{\abs{\v{r}(\v{h})}}{\abs{\v{h}}} \rightarrow 0$ as $\v{h} \rightarrow \v{0}$. To this end, we observe that:
    \begin{align*}
        \frac{\abs{\v{g}'(\v{f}(x_0))\v{u}(\v{h})}}{\v{h}} \leq \norm{\v{g}'(\v{f}(\v{x_0}))}\frac{\abs{\v{u}(\v{h})}}{\abs{\v{h}}}
    \end{align*}
    where we have that $\norm{\v{g}'(\v{f}(\v{x_0}))} < \infty$ and $\frac{\abs{\v{u}(\v{h})}}{\abs{\v{h}}} \rightarrow 0$ as $\v{h} \rightarrow \v{0}$ as $\v{u}(\v{h}) \in O(\v{h})$. Furthermore, let $\gv{\eta}(\v{K}) = \frac{\abs{\v{V}(\v{K})}}{\abs{\v{K}}}$ and then we have that:
    \begin{align*}
        \frac{\abs{\v{V}(\v{K})}}{\v{h}}\frac{\abs{\v{K}}}{\abs{\v{K}}} = \gv{\eta}(\v{K})\frac{\abs{\v{K}}}{\v{h}} \leq \gv{\eta}(\v{K})\left(\frac{\abs{\v{f'(x_0)\v{h}}}}{\abs{\v{h}}} + \frac{\abs{\v{u}(\v{h})}}{\abs{\v{h}}}\right) \leq \gv{\eta}(\v{K})\left(\norm{\v{f}'(\v{x}_0)}\frac{\abs{\v{h}}}{\abs{\v{h}}} + \frac{\abs{\v{u}(\v{h})}}{\abs{\v{h}}}\right)
    \end{align*}
    where we have that $\norm{\v{f}'(\v{x}_0)} < \infty$ and $\frac{\abs{\v{u}(\v{h})}}{\abs{\v{h}}} \rightarrow 0$ as $\v{h} \rightarrow \v{0}$. Furthermore, Since $\v{K} \rightarrow \v{0}$ as $\v{h} \rightarrow \v{0}$ (since $\v{K} = \v{f}'(\v{x}_0) + \v{u}(\v{h})$ and $\v{f}'(\v{x}_0) \rightarrow 0$ as $\v{f}'(\v{x}_0)$ is continuous and $\v{u}(\v{h}) \in O(\v{h})$, we have that $\gv{\eta}(\v{K}) \rightarrow \v{0}$. Hence, $\v{r}(\v{h}) \in O(\v{h})$, so we conclude that:
    \begin{align*}
        \lim_{h \rightarrow \v{0}} \frac{\abs{\v{F}(\v{x_0} - \v{h}) - \v{F}(\v{x}_0) - \v{g}'(\v{f}(\v{x}_0))\v{f}'(\v{x}_0)\v{h}}}{\abs{\v{h}}} = 0
    \end{align*} \qed
\end{nproof}
\noindent Next, we recall the Jacobian matrix/determinant that was introduced in second year multivariable calculus. Is it equivalent to what we have defined here? Well, not quite; $\v{F}'(\v{x})$ is not a matrix, but a linear operator. However, linear operators do have a matrix representation. Up until now, we have done things basis-agnostically, but we will now start to work in particular bases to probe this question further.

\begin{ndef}{: Canonical Basis}{}
    The \textbf{canonical bases} (also known as the standard basis) of $\RR^n$ and $\RR^m$ are defined to be $\set{\v{e}_1, \ldots, \v{e}_n}$ and $\set{\v{u}_1, \ldots \v{u}_m}$ where $\v{e}_1 = (1, 0, \ldots 0)$ (length $n$) and $\v{u}_1 = (1, 0, \ldots, 0)$ (length $m$).
\end{ndef}

\begin{ndef}{: Function Components}{}
    Let $\v{f}: \RR^n \mapsto \RR^m$. We can then write $\v{f}(\v{x}) = \sum_{i=1}^m f_i(\v{x})\v{u}_i$. So, $\v{f} = (f_1, \ldots, f_n)$ where $f_i$ is the $i$th \textbf{component} of $\v{f}$. Hence, $f_i: \RR^n \mapsto \RR$.
\end{ndef}

\begin{definition}{Partial Derivatives}{9.16}
    We define the \textbf{partial derivative} as
    \begin{align*}
        \dpd{f_i}{x_j}(\v{x}) = (D_jf_i)(\v{x}) = \lim_{t \rightarrow 0} \frac{f_i(\v{x} + t\v{e}_j) - f_i(\v{x})}{t}
    \end{align*}
    where $i \in \set{1, \ldots, m}$ and $j \in \set{1, \ldots, n}$.
\end{definition}
\noindent We observe that $D_jf_i$ is just the derivative of $f_i$ with respect to $x_j$.

\begin{theorem}{}{9.17}
    If $\v{f}: \RR^n \mapsto \RR^m$ is differentiable at $\v{x} \in \RR^n$, then $(D_jf_i)(\v{x})$ exists for $i \in \set{1, \ldots, m}$ and $j \in \set{1, \ldots, n}$, and:
    \begin{align*}
        [\v{f}'(\v{x})] = \m{(D_1f_1)(\v{x}) & \cdots & (D_nf_1)(\v{x})
        \\ \vdots & \ddots & \vdots
        \\ (D_1f_m)(\v{x}) & \cdots & (D_nf_m)(\v{x})}.
    \end{align*}
    In other words, we have $\v{f}'(\v{x})\v{e}_j = \sum_{i=1} (D_if_i)(\v{x})\v{u}_i$, and hence $[\v{f}'(\v{x})]_{ij} = (D_jf_i)(\v{x})$.
\end{theorem}
\begin{nproof}
    We want to show that the linear operator $A = \v{f}'(\v{x})$ has matrix elements:
    \begin{align*}
        \v{u}_iA\v{e}_j = A_{ij} = \dpd{f_i}{x_j}.
    \end{align*}
    In other words, that $f_i(\v{x} + t\v{e}_j) = f_i(\v{x}) + A_{ij}t + O(t)$, which identifies $A_{ij}$ as $\pd{f_i}{x_j}$. To this end, let $\e(t) = f_i(\v{x} + t\v{e}_j) - f_i(\v{x}) - A_{ij}t$. We then have that:
    \begin{align*}
        \abs{\e(t)} &= \abs{\v{u}_i(\v{f}(\v{x} + t\v{e}_j) - \v{f}(\v{x}) - A(t\v{e}_j))} & \text{(Linearity to say $A_{ij}t = A(t\v{e}_j)$)}
        \\ &\leq \abs{\v{u}_j}\abs{\v{f}(\v{x} + t\v{e}_j) - \v{f}(\v{x}) - A(t\v{e}_j)} & \text{(Cauchy-Shwartz inequality on $\RR^n$)}
        \\ &= \abs{\v{f}(\v{x} + t\v{e}_j) - \v{f}(\v{x}) - A(t\v{e}_j)} & \text{$\v{u}_i$ is of unit length}
        \\ &\in O(t\v{e}_j) \text{ and therefore } O(t) & \text{(Definition of derivative)}
    \end{align*}
    which proves the claim. \qed
\end{nproof}
\noindent As a remark, note that if $\v{f}$ is differentiable at $\v{x}$, then the above theorem implies that all partial derivatives exist at that point. The converse is \emph{not} true (see the discussion on page 215). But, the converse is true with an extra additional condition that the partial derivatives are continuous.

\begin{ndef}{: Gradient}{}
    Let $E \subset \RR^n$ be open and $f: E \mapsto \RR$. Suppose all partial derivatives of $f$ exist. Then, we define the \textbf{gradient} of $f$ to be $\grad{f}: E \mapsto \RR^n$, where:
    \begin{align*}
        \grad{f}(\v{x}) = \sum_{i=1}^n \dpd{f}{x_i}(\v{x})\v{e}_i = \left(\dpd{f}{x_1}(\v{x}), \ldots, \dpd{f}{x_n}(\v{x})\right).
    \end{align*}
\end{ndef}
\noindent Note that this is the matrix representation of $f'(\v{x})$ for real valued $f$. In particular, for $\v{h} = (h_1, \ldots, h_n) \in \RR^n$, we have that:
\begin{align*}
    f'(\v{x})\v{h} = \grad{f}\cdot\v{h} = \begin{pmatrix}
    \dpd{f}{x_1}(\v{x}) & \ldots & \dpd{f}{x_n}(\v{x})
    \end{pmatrix}
    \begin{pmatrix}
        h_1
        \\ \vdots
        \\ h_n
    \end{pmatrix}
\end{align*}
\noindent By the chain rule, for $\v{u} \in \RR^n$ with $\abs{\v{u}} = 1$, we have that:
\begin{align*}
    \lim_{t \rightarrow 0} \frac{f(\v{x} + t\v{u}) - f(\v{x})}{t} = \dod{}{t}_{t = 0}f(\v{x} + t\v{u}) = f'(\v{x})\v{u} = \grad{f}\cdot \v{u}
\end{align*}
\noindent We use this to define the directional derivative:

\begin{ndef}{: Directional Derivatives}{}
    The \textbf{directional derivative} of $f$ in direction $\v{u}$ (where $\v{u}$ is a unit length vector in $\RR^n$) at $\v{x}$, denoted as $(D_{\v{u}}f)(\v{x})$, is defined as:
    \begin{align*}
        (D_{\v{u}}f)(\v{x}) = \grad{f}\cdot\v{u}
    \end{align*}
\end{ndef}
\noindent We note that $(D_{\v{u}}f)(\v{x})$ is maximal when $\v{u} \parallel \grad{f}(\v{x})$; hence, $\grad{f}(\v{x})$ points in the direction of maximal increase of $f$ at $\v{x}$. This illustrated in the example below.

\begin{figure}[htbp]
    \centering
    \includegraphics[scale=0.4]{Images/zxy.png}

    \caption{Visualized is the surface $z = f(x, y) = x^2 + y^2$. At any given $(x, y)$, we have that $\grad{f} = (2x, 2y)$. The direction of $\grad{f}$ gives the direction for which $f$ has a maximal rate of increase at $(x, y)$.}
    \label{fig61}
\end{figure}

\begin{ndef}{: Convex Sets}{}
    Let $E \subset \RR^n$. We say that $E$ is \textbf{convex} if for all $\v{x}, \v{y}  \in E$ and for all $\lambda \in [0, 1]$, $\lambda \v{x} + (1 - \lambda)\v{y} \in E$.
\end{ndef}
\noindent Geometrically, $\lambda \v{x} + (1 - \lambda)\v{y}$ represents the points on the line segment that joins $\v{x}, \v{y}$. In this picture, convexity means that for any two points in a set, all points in the line segment that joins them is also in the set. This turns out to be a useful notion.

\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}
        \draw[red, thick, fill = white!60!red] (0,0) ellipse (2cm and 1cm);
        \filldraw[] (-1, 0.25) circle (1pt);
        \filldraw[] (1, -0.25) circle (1pt);
        \node[above] at (-1, 0.25) {$x$};
        \node[above] at (1, -0.25) {$y$};
        \draw[dotted] (-1, 0.25) -- (1, -0.25);
        \draw[blue, thick, fill = white!60!blue] (3, 0) to [curve through ={(4, -1)..(5, 0)..(4.5,1)..(4,0)..(3.5,1)..(3,0.5)..(3,0.2)}] (3, 0);
        \filldraw[] (3.25, 0.5) circle (1pt);
        \filldraw[] (4.75, 0.5) circle (1pt);
        \node[above] at (3.25, 0.5) {$x$};
        \node[above] at (4.75, 0.5) {$y$};
        \draw[dotted] (3.25, 0.5) -- (4.75, 0.5);
    \end{tikzpicture}
    \caption{A picture of a convex set (left) and non-convex set (right) in $\RR^2$.}
    \label{fig62}
\end{figure}

\setcounter{rudin}{18}
\begin{theorem}{}{9.19}
    Let $E \subset \RR^n$ be convex and $\v{f}: E \mapsto \RR^m$. Suppose $\v{f}$ is differentiable on $E$ and $\norm{\v{f}'(\v{x})} \leq M$ for all $x \in E$. Then, for all $\v{a}, \v{b} \in E$, we have that $\abs{\v{f}(\v{b}) - \v{f}(\v{a})} \leq M\abs{\v{b} - \v{a}}$.
\end{theorem}
\begin{nproof}
    By convexity, component-wise integration (Rudin 6.23) and the FTC applied component-wise (Rudin 6.24) we have that:
    \begin{align*}
        \v{f}(\v{b}) - \v{f}(\v{a}) = \int_0^1\v{f}((1 - t)\v{a} + t\v{b})dt.
    \end{align*}
    By the chain rule (Theorem \ref{thm:9.15}), we then have that:
    \begin{align*}
        \v{f}(\v{b}) - \v{f}(\v{a}) = \int_0^1\v{f}'((1-t)\v{a} + t\v{b})(\v{b} - \v{a})dt.
    \end{align*}
    Applying the multidimensional ML bound (Rudin 6.25), we have that:
    \begin{align*}
        \abs{\v{f}(\v{b}) - \v{f}(\v{a})} \leq \int_0^1\abs{\v{f}'((1-t)\v{a} + t\v{b})(\v{b} - \v{a})}dt
    \end{align*}
    but then using the bound on $\norm{\v{f}'(\v{x})}$ we have that:
    \begin{align*}
        \abs{\v{f}(\v{b}) - \v{f}(\v{a})} \leq M\abs{\v{b} - \v{a}}
    \end{align*}
    which is exactly what we wanted to show. \qed
\end{nproof}

\begin{ncorollary}{}{}
    If $\v{f}'(\v{x}) = 0$ for all $\v{x} \in E$, then $\v{f}$ is constant on $E$.
\end{ncorollary}
\noindent Note that convexity of $E$ is not actually needed for this Corollary; we can instead consider a finite sequence of closed disks and apply Theorem \ref{thm:9.19} to each of them.

\begin{definition}{: Continuous Differentiability}{9.20}
    Let $E \subset \RR^n$ be open. $\v{f}: E \mapsto \RR^m$ is \textbf{continuously differentiable} on $E$ (denoted $\v{f} \in C^1(E)$) if $\v{f}'(\v{x})$ exists for every $\v{x} \in E$ and $\v{f}'$ is continuous on $E$.
\end{definition}
\noindent Note that (as always), $\v{f}': E \mapsto L(\RR^n, \RR^m)$. To phrase the above definition another way, for all $\v{x} \in E$ and for all $\e > 0$, there exists $\delta > 0$ such that for all $\v{y} \in E$ that satisfy $\abs{\v{x} - \v{y}} < \delta$, we have that $\norm{\v{f}'(\v{x}) - \v{f}'(\v{y})} < \e$.

\begin{theorem}{}{9.21}
    Suppose $\v{f}: E \mapsto \RR^m$ where $E \subset \RR^n$ is open. Then, $\v{f} \in C^1(E)$ if and only if $\pd{f_i}{x_j}$ exist for all $i \in \set{1, \ldots m}, j \in \set{1, \ldots, n}$ and all are continuous.
\end{theorem}
\begin{nproof}
    Not covered in lecture, see Rudin. \qed
\end{nproof}

\begin{nexample}{}{}
    Consider the function $f: \RR^2 \mapsto \RR$ where:
    \begin{align*}
        f(x, y) = \begin{cases}
            \frac{xy}{x^2 + y^2} & (x, y) \neq (0, 0)
            \\ 0 & (x, y) = (0, 0)
        \end{cases}.
    \end{align*}
    Calculating the partial derivatives of $f$ at $(0, 0)$ with respect to $x$ and $y$, we have:
    \begin{align*}
        \left.\dpd{f}{x}\right|_{(0, 0)} &= \lim_{t \rightarrow 0}\frac{f(0 + t, 0) - f(0, 0)}{t} = \lim_{t \rightarrow 0} \frac{0 - 0}{t} = 0
        \\ \left.\dpd{f}{y}\right|_{(0, 0)} &= \lim_{t \rightarrow 0}\frac{f(0, 0 + t) - f(0, 0)}{t} = \lim_{t \rightarrow 0} \frac{0 - 0}{t} = 0.
    \end{align*}
    However, $f$ is not even continuous at $(0, 0)$; to see this, approach $(0, 0)$ by the line $(t, at)$:
    \begin{align*}
        \lim_{t \rightarrow 0}f(t, at) = \lim_{t \rightarrow 0}\frac{at^2}{t^2 + a^2t^2} = \lim_{t \rightarrow 0}\frac{a}{1+a^2} = \frac{a}{1+a^2} \neq 0 = f(0, 0).
    \end{align*}
    As $f$ is not continuous at $(0, 0)$, it is therefore not differentiable at $(0, 0)$. Note that $f$ \emph{is} continuous differentiable on $\RR^2 \setminus \set{0}$. Also note that if we try to compute the derivative along the ray $(t, at)$, we get $\infty$:
    \begin{align*}
        \lim_{t \rightarrow 0} \frac{f(t, at) - f(0, 0)}{t} = \lim_{t \rightarrow 0}\frac{1}{t}\frac{a}{1+a^2} = \infty.
    \end{align*}
    This example shows the partial derivatives are not continuous everywhere as $f$ is not continuous differentiable. $\pd{f}{x}$ and $\pd{f}{y}$ exist everywhere, but this itself does not imply much.
\end{nexample}

\subsection{The Inverse Function Theorem}
\noindent Before we give the statement and proof of the Inverse function theorem, it is instructive to revist the one-dimensional case.

\begin{ntheorem}{ (Problem 5.2)}{}
    Let $f: [a, b] \mapsto \RR$. Suppose $f'$ exists for all $(a, b)$, and suppose $f'(x) > 0$ (or alternatively $f'(x) < 0$) for all $x \in (a, b)$. Then, $f$ is strictly increasing, and has an inverse function $g$. This $g$ is differentiable and has derivative $g'(f(x)) = \frac{1}{f'(x)}$.
\end{ntheorem}
\begin{nproof}
    Left as an exercise. Solution can be found at \url{https://minds.wisconsin.edu/bitstream/handle/1793/67009/rudin%20ch%205.pdf?sequence=7&isAllowed=y}. \qed
\end{nproof}

\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}[scale=1.5]
        \draw[very thick, -latex] (0, 0) -- (0, 2);
        \draw[very thick, -latex] (0, 0) -- (2, 0);
        \draw[very thick, -latex] (3, 0) -- (3, 2);
        \draw[very thick, -latex] (3, 0) -- (5, 0);
        \draw[] (0.5, 0) -- (0.5, -0.15);
        \node[below] at (0.5, -0.18) {$a$};
        \draw[] (1, 0) -- (1, -0.15);
        \node[below] at (1, -0.18) {$x_0$};
        \draw[] (1.5, 0) -- (1.5, -0.15);
        \node[below] at (1.5, -0.15) {$b$};
        \draw[] (3.5, 0) -- (3.5, -0.15);
        \node[below] at (3.5, -0.18) {$a$};
        \draw[] (4, 0) -- (4, -0.15);
        \node[below] at (4, -0.18) {$x_0$};
        \draw[] (4.5, 0) -- (4.5, -0.15);
        \node[below] at (4.5, -0.15) {$b$};
        \draw[thick] (0.5, 0.5) .. controls(1, 1.2) .. (1.5, 1.5);
        \filldraw[] (0.5, 0.5) circle (0.5pt);
        \filldraw[] (1.5, 1.5) circle (0.5pt);
        \draw[dotted] (1, 0) -- (1, 1.15);
        \draw[red] (0.75, 0.93) -- (1, 1.17) -- (1.25, 1.41);
        \draw[dotted, red] (0.75, 0.93) -- (0.75, 1.41) -- (1.25, 1.41);
        \node[left, text = red] at (0.75, 1.17) {$\Delta y$};
        \node[above, text = red] at (1, 1.41) {$\Delta x$};
        \draw[thick] (3.5, 0.5) .. controls(3.95, 1.5) .. (4.5, 1);
        \filldraw[] (3.5, 0.5) circle (0.5pt);
        \filldraw[] (4.5, 1) circle (0.5pt);
        \draw[dotted] (4, 0) -- (4, 1.3);
        \end{tikzpicture}

    \caption{Example demonstrating the above theorem. For the left function, we have that $g = f^{-1}$ exists, and $g'(f(x_0)) = \frac{1}{f'(x_0)} = \frac{1}{\frac{\Delta y}{\Delta x}} = \frac{\Delta x}{\Delta y}$. For the left function, we have that $f'(x_0) = 0$, so no inverse exists near this point (the inverse does not exist on $(x_0 - \e, x_0 + \e)$ for some $\e$).}
    \label{fig63}
\end{figure}

\setcounter{rudin}{23}
\begin{theorem}{The Inverse Function Theorem}{9.24}
    Suppose $\v{f}: E \mapsto \RR^n$ where $E \subset \RR^n$ is open. Suppose $\v{f} \in C^1(E)$, $\v{a} \in E$, and $\v{f}'(\v{a})$ is invertible (c.f. $f'(a) \neq 0$ for the $n = 1$ case). Let $\v{b} = \v{f}(\v{a})$. Then:
    \begin{enumerate}[label = (\arabic*)]
        \item There exists an open set $U, V$ with $\v{a} \in U, \v{b} \in V$ such that $\v{f}: U \mapsto V$ is a bijection. Hence, the inverse function $\v{g} = \v{f}^{-1}$ exists with $\v{g}: V \mapsto U$ and $\v{g}(\v{f}(\v{x})) = \v{x}$ for all $\v{x} \in U$.
        \item $\v{g} \in C^1(V)$.
    \end{enumerate}
\end{theorem}
\noindent Note in the above theorem that both the domain and codomain are $n$-dimensional; the dimensions must match for an inverse to exist (there would be no inverse for $f: \RR^2 \mapsto \RR$, for example). Now, a couple more remarks before we move onto the proof.
\begin{enumerate}[label = \alph*)]
    \item By the chain rule, we have that $\v{g}'(\v{f}(\v{x}))\v{f}'(x) = I$, so $\v{g}'(\v{f}(\v{x})) = \left(\v{f}'(\v{x})\right)^{-1}$ for $\v{x} \in U$.
    \item Let us write $\v{y} = \v{f}(\v{x})$ as $\v{y} = (y_1, \ldots, y_n)$ where $y_1 = f_1(x_1, \ldots, x_n)$, $y_2 = f_2(x_1, \ldots, x_n)$ and so on (up to $y_n = f_n(x_1, \ldots x_n)$). Note that $f_1, \ldots f_n$ could (in general) be horrible nonlinear functions. Writing $\v{y}$ in this way, we generate a system of equations. In math, we are often interested in whether a system of equations is solvable. If $\v{f}'(\v{a})$ is indeed invertible, then for $\v{y}$ near $\v{b} = \v{f}'(\v{a})$, there exists a unique $C^1$ solution $x_1 = g_1(y_1, \ldots y_n), x_2 = g_2(y_1, \ldots, y_n), \ldots, x_n = g_n(y_1, \ldots, y_n)$. $\v{f}$ is a bijection from $U \mapsto V$, and hence there is an inverse function that gives a unique solution $\v{x}$ to any $\v{y}$. And this function is continuously differentiable!
    \item $\v{f} \in C^1$ is assumed. So, the invertibility of $\v{f}'(\v{a})$ is equivalent to the determinant of the matrix representation of the linear operator being non-zero:
    \begin{align*}
        J\v{f}(\v{a}) = \det\m{\dpd{f_1}{x_1}(\v{x}) & \cdots & \dpd{f_n}{x_1}(\v{x})
        \\ \vdots & \ddots & \vdots
        \\ \dpd{f_1}{x_n}(\v{x}) & \cdots & \dpd{f_n}{x_n}(\v{x})} \neq 0
    \end{align*}
    this is because $\v{f}'(\v{a})$ being invertible if and only if the matrix representation is invertible if and only if the matrix representation has nonzero determiant. This determinant is known as the \emph{Jacobian determinant} of $\v{f}$ at $\v{a}$.
\end{enumerate}

\begin{nblank}{Proof of (1)}
    For the first step, we show that there exists open $U \ni \v{a}$ such that $\v{f}$ is one-to-one on $U$. Write $A = \v{f}'(\v{a})$. We will now used the Banach fixed point theorem/Theorem \ref{thm:9.23} (Note: This requires some ingenuity). Given $\v{y} \in \RR^n$, let $\gv{\phi}(\v{x}) = \v{x} + A^{-1}(\v{y} - \v{f}(\v{x}))$ (note that $\gv{\phi}$ depends on $\v{y}$). Then, $\gv{\phi} = \v{x}$ if and only if $\v{y} = \v{f}(\v{x})$ (as $A^{-1}\v{z} = 0$ if and only if $\v{z} = \v{0}$). Hence, the uniqueness of the fixed point of $\gv{\phi}$ implies a fixed point of $\v{x}$ such that $\v{y} = \v{f}(\v{x})$, which is the claim. It therefore suffices to show that $\gv{\phi}$ is a contraction. We will demonstrate this via the derivative. We have that $\gv{\phi}'(\v{x}) = I - A^{-1}\v{f}'(\v{x})$. We can factor out $A^{-1}$ to write $\gv{\phi}'(\v{x}) = A^{-1}(\v{f}'(\v{a}) - \v{f}'(\v{x}))$. We therefore have that $\norm{\gv{\phi}'(\v{x})} \leq \norm{A^{-1}}\norm{\v{f}'(\v{a}) - \v{f}'(\v{x})}$. Since $\v{f}'$ is continuous, there exists $\delta > 0$ such that $\norm{\v{f}'(\v{a}) - \v{f}'(\v{x})} \leq \frac{1}{2\norm{A^{-1}}}$ if $\abs{x - a} < \delta$. Hence, $\norm{\gv{\phi}'(\v{x})} \leq \frac{1}{2}$ if $\v{x} \in N(\v{a})$ which identifies the desired set $U$. For $\v{x}_1, \v{x}_2 \in U$, we have that $\abs{\gv{\phi}(\v{x}_1) - \gv{\phi}(\v{x}_2)} \leq \frac{1}{2}\abs{\v{x}_1 - \v{x}_2}$ by Theorem \ref{thm:9.19}. So, $\gv{\phi}$ is a contraction of $U$, and hence $\gv{\phi}$ has at most one fixed point. Therefore, $\v{f}$ is one-to-one on $U$.

    Fo the second step, let $V = \v{f}(U)$. We show that $V$ is open (as this proves (1)). Let $\v{y}_0 \in V$, say, $\v{y}_0 = \v{f}(\v{x}_0)$ ($\v{x}_0 \in U$). We need to find $\e > 0$ such that $N_\e(\v{y}_0) \subset V$, i.e. for every $\v{y} \in N_\e(\v{y}_0)$, there exists $\v{x} \in U$ such that $\v{f}(\v{x}) = \v{y}$. Given $\v{y} \in \RR^n$, as before, define $\gv{\phi}_\v{y}: \RR^n \mapsto \RR^n$ by $\gv{\phi}_{\v{y}}(\v{x}) = \v{x} + A^{-1}(\v{y} - \v{f}(\v{x}))$ (with $\v{x} \in U$). Note that this neighbourhood of $U$ is \emph{not} complete (unless it happens to be all of $\RR^n$). Next, choose $r > 0$ such that $\overline{B} = N_r(\v{x}_0) \subset U$ which is possible as $U$ is open. For $\v{x} \in \overline{B}$, we show that $\abs{\gv{\phi}_\v{y}(\v{x}) - \v{x}_0} < r$. For this, we observe that:
    \begin{align*}
        \abs{\gv{\phi}_{\v{y}}(\v{x}) - \v{x}_0} \leq \abs{\gv{\phi}_{\v{y}}(\v{x}) - \gv{\phi}_{\v{y}}(\v{x}_0)} + \abs{\gv{\phi}_{\v{y}}(\v{x}_0) - \v{x}_0}
        &\leq \frac{1}{2}\abs{\v{x} - \v{x}_0} + \abs{\v{x}_0 + A^{-1}(\v{y} - \v{f}(\v{x}_0)) - \v{x}_0}
        \\ &= \frac{1}{2}\abs{\v{x} - \v{x}_0} + \abs{A^{-1}(\v{y} - \v{f}(\v{x}_0))}
        \\ &\leq \frac{1}{2}\abs{\v{x} - \v{x}_0} + \norm{A^{-1}}\abs{\v{y} - \v{f}(\v{x}_0)}
        \\ &= \frac{1}{2}\abs{\v{x} - \v{x}_0} + \norm{A^{-1}}\abs{\v{y} - \v{y}_0}
    \end{align*}
    We choose $\e = \frac{r}{2\norm{A^{-1}}} < \frac{1}{2}r + \norm{A^{-1}}\frac{r}{2\norm{A^{-1}}}$. Therefore, $\gv{\phi}_{\v{y}}(\v{x}) \in \overline{B}$, that is, $\gv{\phi}_{\v{y}}: \overline{B} \mapsto \overline{B}$. We know from step 1 that $\gv{\phi}_{\v{y}}$ is a contraction on $\overline{B}$, and $\overline{B}$ is complete, so by the fixed point theorem/Theorem \ref{thm:9.23}, there exist a unique fixed point $\v{x} \in B \subset U$ such that $\gv{\phi}_{\v{y}}(\v{x}) = \v{x}$. This $\v{x}$ obeys $\v{y} = \v{f}(\v{x})$ so $\v{y} \in V$. \qed
\end{nblank}

\noindent As a remark, note that coming up with $\gv{\phi}$ in the above first part of the proof is quite difficult/inspired; this is definitely not a simple proof to come up with! After this first part, we have shown the existence of an open $U \ni \v{a}$ such that $\v{f}: U \mapsto V$ is a bijection. Note that we need $V$ to be open for the proof of the second part of the theorem, as we need the derivative (which we only defined on open sets) to make sense.

\begin{nblank}{Proof of (2)}
    We show that $\v{g} = \v{f}^{-1}: V \mapsto U$ is in $C^1(V)$. Let $\v{y} \in V$. Then, $\v{y} = \v{f}(\v{x})$ sor some unique $\v{x}$. Since $U$ is open, take $\v{k}$ small enough such that $\v{y} + \v{k} \in V$. Say, $\v{y} + \v{k} = f(\v{x}_{\v{k}})$ where $\v{x}_{\v{K}} \in U$. Let $S = \v{f}'(\v{x})$ and $T = S^{-1}$. Note that $(\v{f}'(\v{x}))^{-1}$ exists by a continuity argument ($\v{f}'(\v{x})$ is close to $\v{f}'(\v{a})$ and $\v{f}'(\v{a})$ is invertible; see Rudin 9.8). Consider the expression:
    \begin{align*}
        \frac{\abs{\v{g}(\v{y} + \v{k}) - \v{g}(\v{y}) - T(\v{k})}}{\abs{\v{k}}}.
    \end{align*}
    We want to show that this goes to zero as $\v{k} \rightarrow \v{0}$. The idea is that somehow, we will turn this ratio into the derivative of $\v{f}$. Doing some algebra, we have that:
    \begin{align*}
        \v{g}(\v{y} + \v{k}) - \v{g}(\v{y}) - T(\v{k}) = \v{g}(\v{f}(\v{x}_{\v{k}})) - \v{g}(\v{f}(\v{y})) - T\v{k} &= \v{x}_{\v{k}} - \v{x} - T\v{k}
        \\ &= -T\left((\v{f}(\v{x}_{\v{k}}) - \v{f}(\v{x})) - S(\v{x}_{\v{k}} - \v{x})\right)
    \end{align*}
    Taking the norm of both sides, we have:
    \begin{align*}
        \abs{\v{g}(\v{y} + \v{k}) - \v{g}(\v{y}) - T(\v{k})} \leq \norm{T}\abs{\v{f}(\v{x}_{\v{k}}) - \v{f}(\v{x}) - S(\v{x}_{\v{k}} - \v{x})}
    \end{align*}
    Note that $\v{f}(\v{x}_{\v{k}}) - \v{f}(\v{x}) = \v{k}$. Also, we want to prove $\abs{\v{x}_\v{k} - \v{x}} \leq 2\norm{A^{-1}}\abs{\v{k}}$. Next, we have that:
    \begin{align*}
        \gv{\phi}_\v{y}(\v{x}_\v{k}) - \gv{\phi}_\v{y}(\v{x}) = \v{x}_\v{k} - \v{x} + A^{-1}(\v{f}(\v{x}) - \v{f}(\v{x}_\v{k}))
    \end{align*}
    So therefore:
    \begin{align*}
        \v{x}_\v{k} - \v{x} = \gv{\phi}_\v{y} - \gv{\phi}_\v{y} + A^{-1}\v{k} \implies \abs{\v{x}_\v{k} - \v{x}} &\leq \abs{\gv{\phi}_\v{y} - \gv{\phi}_\v{y}} + \norm{A^{-1}}\abs{\v{k}}
        \\ &\leq \frac{1}{2}\abs{\v{x}_\v{k} - \v{x}} + \norm{A^{-1}}\abs{\v{k}}
    \end{align*}
    where in the last inequality we use the result from step 1 of the proof ($\gv{\phi}$ is a contraction with constant $\frac{1}{2}$). From this, we obtain that $\abs{\v{x}_\v{k} - \v{x}} \leq 2\norm{A^{-1}}\abs{\v{k}}$ (as we wanted!) and hence $\frac{1}{\abs{\v{k}}} \leq \frac{2\norm{A^{-1}}}{\abs{\v{x}_\v{k} - \v{x}}}$.We therefore have that:
    \begin{align*}
        \abs{\v{g}(\v{y} + \v{k}) - \v{g}(\v{y}) - T\v{k}} &\leq \frac{2\norm{A^{-1}}}{\abs{\v{x}_\v{k} - \v{x}}}\norm{T}\abs{\v{f}(\v{x}_\v{k}) - \v{f}(\v{x}) - S(\v{x}_\v{k} - \v{x})}
        \\ &= 2\norm{A^{-1}}\norm{T}\frac{\abs{\v{f}(\v{x}_\v{k}) - \v{f}(\v{x}) - S(\v{x}_\v{k} - \v{x})}}{\abs{\v{x}_\v{k} - \v{x}}}
    \end{align*}
    Now, let $\v{k} \rightarrow \v{0}$. Then, $\v{x}_\v{k} - \v{x} \rightarrow \v{0}$, so the RHS goes to $0$ as $S$ is $\v{f}'$ and hence this is just the definition of the derivative. Continuity follows from the fact that when you move an operator in a continuous way, so too does its image. \qed
\end{nblank}
\begin{center}
    \textbf{THE END}
\end{center}


\chapter{Compositions}
\label{chap-compositions}

A composition $c = c(1) \cdots c(n)$ is a finite sequence of positive integers, which are called the \emph{parts} of $c$. The \emph{length} of $c$, denoted $\len(c)$ is the length of the sequence, the \emph{size} of a composition, denoted $\size{c}$, is the sum of its parts. We say a composition $c = c(1) c(2) \cdots c(m)$ is contained in another composition $d = d(1) d(2) \cdots d(n)$ if there is a subsequence $d(i_1) d(i_2) \cdots d(i_m)$ of $d$ such that $c(j) \le d(i_j)$ for all $j$, and such a sequence of indices is called an \emph{embedding} of $c$ into $d$. Note that with this definition, when determining whether $c$ is contained in $d$, it suffices to take a greedy approach: embed the first part of $c$ as far left as possible in $d$, then embed the second part of $c$ as far left as possible after that, and so on.

This partial order may be exhibited visually by way of skyline diagrams, which are simply a symmetry of the Ferrers diagrams of Chapter~\ref{chap-partitions}. The \emph{skyline diagram} of the composition $c = c(1) \cdots c(n)$ consists of $n$ columns of cells, with the $i\th$ column (from the left) having $c(i)$ cells. For compositions $c$ and $d$, we have $c \le d$ if the skyline diagram of $c$ can be embedded into that of $d$. An example of composition containment displayed through skyline diagrams is shown in Figure~\ref{fig-comp-skyline}.

\begin{figure}[ht]
\captionsetup{justification=centering}
	\begin{tikzpicture}[scale={1/3}]
		\skylinelabeled{3,4,1,3}

		\node at (6.5,3) {$\le$};
		\node at (6.5,0) {$\le$};

		\begin{scope}[shift={(7,0)}]
			\skylinelabeled{1,4,1,4,2,1,1,4,3}
			\skylinefilledunderlines{0,3,0,4,1,0,0,3,0}
		\end{scope}
	\end{tikzpicture}
\caption{An example of composition containment presented by way of skyline diagrams.}
\label{fig-comp-skyline}
\end{figure}

This partial order on compositions is called the \emph{generalized subword order} for words over the positive integers $\mathbb{P}$. It was first considered by Bergeron, Bousquet-M{\'e}lou, and Dulucq~\cite{bergeron:standard-paths-:}, who studied the saturated chains in this poset. Later, Sagan and Vatter~\cite{sagan:the-mobius-func:} determined the M{\"o}bius function of this poset, and Bj{\"o}rner and Sagan~\cite{bjorner:rationality-of-:comp} showed that this M{\"o}bius function has a rational generating function. Finally, Vatter~\cite{vatter:reconstructing-:} considered the analogue of the reconstruction conjecture in this poset, and Engen and Vatter~\cite{engen:on-the-dimensio:} characterized the finite-dimensional classes in this poset with respect to Dushnik--Miller dimension.

The following result shows that smallest universal compositions can be constructed recursively, leading to an explicit formula on their size, and has been adapted from~\cite{albert:universal-layer:}.

\begin{theorem}[Albert, Engen, Pantone, and Vatter~\cite{albert:universal-layer:}]
\label{thm-comp-universal}
	Let $\ell(m)$ be the size of a smallest $m$-universal composition. Then $\ell(0) = 0$ and for $m \ge 1$,
	\begin{equation}
	\label{eqn-composition}
		\ell(m)
		=
		m + \min\{\ell(k) + \ell(m-k-1) \st 0 \le k \le m-1\}
		\footnote{Up to shifting indices by $1$, the sequence $\ell(m)$ in Theorem~\ref{thm-comp-universal} is sequence \OEISlink{A001855} in the OEIS~\cite{sloane:the-on-line-enc:}.}
		.
	\end{equation}
\end{theorem}

\begin{proof}
	We prove the theorem by induction on $m$. As the base case of $m = 0$ is trivial, suppose that the statement is true for all values less than $m$.

	We begin by showing that
	\[
		\ell(m)
		\le
		m + \min\{\ell(k) + \ell(m-k-1) \st 0 \le k \le m-1\}
	\]
	by constructing an $m$-universal composition of this size. To this end, choose $k$ so that $\ell(k) + \ell(m-k-1)$ is minimized and then choose a composition $c$ of size $\ell(k)$ that is $k$-universal and a composition $d$ of size $\ell(m-k-1)$ that is $(m-k-1)$-universal. We claim that the composition $c m d$ is $m$-universal.

	Consider any composition $e = e(1) e(2) \cdots e(n)$ of size $m$, and choose $j$ such that
	\[
		\begin{array}{lccclclcl}
			e(1) &+& \cdots &+& e(j-1) & &      &\le& k,\\
			e(1) &+& \cdots &+& e(j-1) &+& e(j) & > & k.
		\end{array}
	\]
	Since $c$ is $k$-universal and $\size{e(1) \cdots e(j-1)} \le k$, we have that $c$ contains the composition $e(1) \cdots e(j-1)$. Moreover, the part $e(j)$ embeds into the part $m$. Finally, since $d$ is $(m-k-1)$-universal, it necessarily contains $e(j+1) \cdots e(n)$ as $\size{e(j+1) \cdots e(n)} \le m - k -1$. Thus $e(1) \cdots e(n)$ is contained in the composition $c m d$, and as $e$ was an arbitrary composition of size $m$, we have that $c m d$ is $m$-universal.

	To establish the reverse inequality
	\[
		\ell(m)
		\ge
		m + \min\{\ell(k) + \ell(m-k-1) \st 0 \le k \le m-1\},
	\]
	we prove that every $m$-universal composition must have size at least $m + \ell(k) + \ell(m-k-1)$ for some $0 \le k \le m-1$. Let $c$ be an $m$-universal composition. As $c$ contains the composition $m$, we may choose some index $j$ so that $c(j) \ge m$. Choose $k$ so that
	\[
		\ell(k) \le c(1) + \cdots + c(j-1) < \ell(k+1),
	\]
	meaning that there is some composition $d$ of size $k+1$ that does not embed into $c(1) \cdots c(j-1)$, and thus the earliest that $d$ may embed into $c$ is into $c(1) \cdots c(j)$.

	We claim that $c(j+1) \cdots c(n)$ must be $(m-k-1)$-universal. Let $e$ be an arbitrary composition of size $m-k-1$. As $c$ is $m$-universal, it must contain the composition $de$. Since $d$ can embed no earlier than into $c(1) \cdots c(j)$, $e$ must embed entirely within $c(j+1) \cdots c(n)$. As $e$ was an arbitrary composition of size $m-k-1$, the composition $c(j+1) \cdots c(n)$ is therefore $(m-k-1)$-universal, and thus $c(j+1) + \cdots + c(n) \ge \ell(m-k-1)$. Together, this shows
	\begin{align*}
		\size{c}
			&= \size{c(1) \cdots c(j-1)} + \size{c(j)} + \size{c(j+1) \cdots c(n)} \\
			&\ge \ell(k) + m + \ell(m-k-1),
	\end{align*}
	completing the proof.
\end{proof}

By showing that $\ell$ is a convex sequence, we may obtain an explicit formula for $\ell(m)$. In~\cite{morris:some-theorems-on:}, Morris proves that the sequence defined by $G(1) = 0$ and, for $m > 1$
\[
	G(m)
	=
	n + \min\{G(k) + G(m-k) \st 1 \le k \le m-1\}
\]
is convex, and it is elementary to show that $G(m+1) = \ell(m) + m$. For completeness, we present a proof of the convexity of $\ell$, adapted from Morris's proof of the convexity of $G$.

\begin{proposition}
\label{prop-ell-convex}
	The sequence $\ell(m)$ is convex, ie. $2\ell(m) \le \ell(m-1) + \ell(m+1)$ for all $m \ge 1$.
\end{proposition}
\begin{proof}
	We prove that $\ell$ is convex at $m$, ie. $2\ell(m) \le \ell(m-1) + \ell(m+1)$ by induction on $m$. Our base case of $m = 1$ follows from computing $\ell(0) = 0$, $\ell(1) = 1$, and $\ell(2) = 3$, so assume that the statement holds for all values less than $m$. We proceed in two cases based on the parity of $m$.

	First, assume that $m$ is even, with $m = 2n$. We may compute the formulas for $\ell(m-1)$, $\ell(m)$, and $\ell(m+1)$ using that convexity of $\ell$ at values $m' < m$ implies that the minimum of $\ell(k) + \ell(m'-k)$ over all values of $k$ occurs when $k = \floor{m'/2}$.
	\begin{align*}
		\ell(2n-1)
			&= 2n-1 + \min\{\ell(k) + \ell(2n-2-k) \st 0 \le k \le 2n-2\} \\
			&= 2n-1 + \ell(n-1) + \ell(n-1) \\
		\ell(2n)
			&= 2n   + \min\{\ell(k) + \ell(2n-1-k) \st 0 \le k \le 2n-1\} \\
			&= 2n   + \ell(n-1) + \ell(n) \\
		\ell(2n+1)
			&= 2n+1 + \min\{\ell(k) + \ell(2n  -k) \st 0 \le k \le 2n  \} \\
			&= 2n+1 + \ell(n) + \ell(n)
	\end{align*}
	These formulas show that in this case, we in fact have equality: $2\ell(2n) = \ell(2n-1) + \ell(2n+1)$.

	On the other hand, assume that $m$ is odd, with $m = 2n+1$. As before, the convexity of $\ell$ at values less than $m$ allows us to write explicit recursive formulas for $\ell(2n)$, $\ell(2n+1)$, and $\ell(2n+2)$.
	\begin{align*}
		\ell(2n)
			&= 2n   + \min\{\ell(k) + \ell(2n-1-k) \st 0 \le k \le 2n-1\} \\
			&= 2n   + \ell(n-1) + \ell(n) \\
		\ell(2n+1)
			&= 2n+1 + \min\{\ell(k) + \ell(2n  -k) \st 0 \le k \le 2n  \} \\
			&= 2n+1 + \ell(n) + \ell(n) \\
		\ell(2n+2)
			&= 2n+2 + \min\{\ell(k) + \ell(2n+1-k) \st 0 \le k \le 2n+1\} \\
			&= 2n+2 + \ell(n) + \ell(n+1)
	\end{align*}
	Some arithmetic reveals that the inequality $2 \ell(2n+1) \le \ell(2n) + \ell(2n+2)$ is equivalent to the inequality $2\ell(n) \le \ell(n-1) + \ell(n+1)$, which is true by induction, completing the proof.
\end{proof}

Proposition~\ref{prop-ell-convex} allows us to recursively define an explicit sequence of smallest $m$-universal compositions. Let $w_0$ be the empty composition, and for $m \ge 1$, define $w_m$ as the concatenation $w_{\floor{(m-1)/2}} m w_{\ceil{(m-1)/2}}$. Then, as $\ell(k) + \ell(m-1-k)$ is minimized at $k = \floor{(m-1)/2}$, $w_m$ is $m$-universal by the proof of Theorem~\ref{thm-comp-universal} and has length $m$ and size $\ell(m)$. Figure~\ref{fig-comp-universal} shows the skyline diagram of $w_{63}$.

Knuth gave an explicit formula for $\ell(m)$ in \emph{The Art of Computer Programming, Volume 3}~\cite[Section 5.3.1, Eq. (3)]{knuth:the-art-of-comp:3}, where it is related to sorting by binary insertion. Knuth shows there that,
\[
	\ell(m)
	=
	(m+1)\ceil{\log_2 (m+1)} - 2^{\ceil{\log_2 (m+1)}} + 1,
\]
so $\ell(m) \sim m \log_2(m)$.

\begin{figure}[ht]
\captionsetup{justification=centering}
	\begin{tikzpicture}[scale=0.1]
		% from functools import lru_cache
		%
		% @lru_cache
		% def w(n):
		%     if n == 0: return []
		%     return w((n-1)//2) + [n] + w(n//2)
		%
		% inner = ','.join(str(val) for val in w(63))
		%
		% print(r'\skyline{' + inner + r'}')

		% \skyline{1,3,1,7,1,3,1,15,1,3,1,7,1,3,1,31,1,3,1,7,1,3,1,15,1,3,1,7,1,3,1} % 31
		\skyline{1,3,1,7,1,3,1,15,1,3,1,7,1,3,1,31,1,3,1,7,1,3,1,15,1,3,1,7,1,3,1,63,1,3,1,7,1,3,1,15,1,3,1,7,1,3,1,31,1,3,1,7,1,3,1,15,1,3,1,7,1,3,1} % 63
	\end{tikzpicture}
\caption{The $63$-universal composition $w_{63}$ of length $63$ and size $\ell(63) = 321$.}
\label{fig-comp-universal}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Proper Classes of Compositions}
\label{sec-comp-classes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In this section, we examine the problem of universality for proper classes of compositions. As we will see, every proper composition class admits universal compositions of linear size. Moreover, we study universality of two natural families of compositions as well as for the class of compositions with at most one large part. For reference, some known or computed values of minimum sizes for universal compositions for various classes are presented in Appendix~\ref{appendix-compositions}.

As in Chapter~\ref{chap-partitions}, we define infinite structures to aid discussion of proper classes. We define a \emph{potentially infinite} composition to be a word over the alphabet $\mathbb{P} \cup \{n^\omega \st n \in \mathbb{P}\} \cup \{\omega, \omega^\omega\}$. As in the case of partitions, the symbol $\omega$ stands for an infinite part, the symbol $n^\omega$ stands for an infinite number of parts equal to $n$, and the symbol $\omega^\omega$ stands for an infinite number of infinite parts. Given a potentially infinite composition $c$, the \emph{age} of $c$, denoted $\Age(c)$, is the set of all compositions whose skyline diagrams embed into the skyline diagram of $c$ (the term \emph{age} dates to Fra{\"i}ss{\'e}~\cite{fraisse:sur-lextension-:}.) An example of containment of a finite skyline diagram in an infinite one, together with the corresponding set containment, is presented in Figure~\ref{fig-comp-age}.

\begin{figure}[ht]
\captionsetup{justification=centering}
	\begin{tikzpicture}[scale={1/2}]
		\skylinelabeled{1,3,2,3,1}

		\node at ( 7,3) {$\le$};
		\node at ( 7,0) {$\in$};
		\node at (14,0) {$\Age(1^\omega \omega 2 1 3 1^\omega)$};

		\begin{scope}[shift={(8,0)}]
			\skyline{1,1,1,4,2,1,3,1,1,1}
			\foreach \d in {0.25, 0.50, 0.75} {
				\filldraw[black] (     \d,   1.5) circle [radius=0.05cm];
				\filldraw[black] ({11+\d},   1.5) circle [radius=0.05cm];
				\filldraw[black] (    4.5,{5+\d}) circle [radius=0.05cm];
			}
			\skylinefilled{0,0,1,3,2,0,3,1}
		\end{scope}
	\end{tikzpicture}
\caption{Containment of a finite skyline diagram into an infinite one.}
\label{fig-comp-age}
\end{figure}

The following proposition shows that any proper composition class admits universal compositions of linear size.

\begin{theorem}
\label{thm-comp-universal-proper}
	For any proper class of compositions $\C$, there is a positive constant $c$ so that there are $\C_m$-universal compositions of size $cm$ for all positive integers $m$.
\end{theorem}
\begin{proof}
	We show that $\C$ admits linear-size universal compositions by first showing that $\C$ is contained in an age of the form $\Age(\ell^\omega (\omega \ell^\omega)^k)$, which in turn admits linear-size universal compositions.

	Let $\ell$ be the largest integer such that $\C$ contains $\ell^n$ for all $n$, and let $k$ be the largest integer such that $\C$ contains $(\ell + 1)^k$. We claim that $\C \subseteq \Age(\ell^\omega (\omega \ell^\omega)^k)$. If $c \in \C$, then $c$ does not contain $(\ell + 1)^k$, and thus $c$ has at most $k$ parts of size larger than $\ell$. The class $\Age(\ell^\omega (\omega \ell^\omega)^k)$ is precisely the class of compositions that have at most $k$ parts larger than $\ell$, and thus we have $c \in \Age(\ell^\omega (\omega \ell^\omega)^k)$.

	To construct an $m$-universal composition for $\Age(\ell^\omega (\omega \ell^\omega)^k)$, note that if $c$ and $d$ are $m$-universal compositions for $\Age(u)$ and $\Age(v)$ respectively, then $cd$ is $m$-universal for $\Age(uv)$. Thus, as the composition $\ell^m$ is $m$-universal for $\Age(\ell^\omega)$ and the composition $m$ is $m$-universal for $\Age(\omega)$, we may conclude that $\ell^m (m \ell^m)^k$ is $m$-universal for $\Age(\ell^\omega (\omega \ell^\omega)^k)$.
\end{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Compositions with Bounded Part Sizes}
\label{subsec-comp-bdd-pt-size}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Fix a positive integer $t$, and consider the class $\Age(t^\omega)$ of compositions whose parts are all of size at most $t$. In a composition $c$, each part of size larger than $t$ may be replaced one of size $t$ without disturbing any of the embeddings of compositions in $\Age(t^\omega)$.
\begin{observation}
	Let $c$ be a composition of size $n$. For each positive integer $t$, there is composition $c'$ of size at most $n$ in $\Age(t^\omega)$ that contains every composition in $\Age(t^\omega)$ that $c$ does.
\end{observation}

In particular, if $c$ is any $\Age(t^\omega)_m$-universal composition, then there is a weakly smaller proper $\Age(t^\omega)_m$-universal composition, and thus the smallest $\Age(t^\omega)_m$-universal compositions and the smallest proper $\Age(t^\omega)_m$-universal compositions have the same size.

Smallest proper universal compositions for $\Age(t^\omega)$ can be constructed in a manner similar that of the proof of Theorem~\ref{thm-comp-universal}. The construction only differs in that the ``large'' part of size $m$ used in the proof of Theorem~\ref{thm-comp-universal} needs to only have size $\min\{t, m\}$ in this case.
\begin{theorem}
\label{thm-comp-bdd-part-size}
	Let $\ell_t(m)$ denote the size of the smallest (proper) $\Age(t^\omega)_m$-universal compositions. Then $\ell_t(0) = 0$ and for $m \ge 1$,
	\[
		\ell_t(m)
		=
		\min\{t,m\} + \min\{\ell_t(k) + \ell_t(m-k-1) \st 0 \le k \le m-1\}.
	\]
\end{theorem}
\begin{proof}
	We prove the theorem by induction on $m$. As the base case of $m = 0$ is trivial, suppose that the statement is true for all values less than $m$.

	We begin by showing that
	\[
		\ell_t(m)
		\le
		\min\{t, m\} + \min\{\ell_t(k) + \ell_t(m-k-1) \st 0 \le k \le m-1\}.
	\]
	by constructing an $\Age(t^\omega)_m$-universal composition of this size. To this end, choose $k$ so that $\ell_t(k) + \ell_t(m-k-1)$ is minimized and then choose a proper $\Age(t^\omega)_k$-universal composition $c$ of size $\ell_t(k)$ and a proper $\Age(t^\omega)_{m-k-1}$-universal composition $d$ of size $\ell_t(m-k-1)$. We claim that the composition $c (\min\{t, m\}) d \in \Age(t^\omega)$ is $\Age(t^\omega)_m$-universal.

	Consider any composition $e = e(1) e(2) \cdots e(n) \in \Age(t^\omega)$ of size $m$, and choose $j$ such that
	\[
		\begin{array}{lccclclcl}
			e(1) &+& \cdots &+& e(j-1) & &      &\le& k,\\
			e(1) &+& \cdots &+& e(j-1) &+& e(j) & > & k.
		\end{array}
	\]
	Since $c$ is $\Age(t^\omega)_k$-universal and $\size{e(1) \cdots e(j-1)} \le k$, we have that $c$ contains the composition $e(1) \cdots e(j-1)$. Moreover, the part $e(j)$ embeds in the part $\min\{t, m\}$. Finally, since $d$ is $\Age(t^\omega)_{m-k-1}$-universal, it contains the composition $e(j+1) \cdots e(n)$ as $\size{e(j+1)\cdots e(n)} \le m-k-1$. Thus $e(1) \cdots e(n)$ is contained in the composition $c (\min\{t, m\}) d$, and as $e$ was an arbitrary composition of size $m$, we have that $c (\min\{t, m\}) d$ is $\Age(t^\omega)_m$-universal.

	To establish the reverse inequality
	\[
		\ell_t(m)
		\ge
		\min\{t, m\} + \min\{\ell_t(k) + \ell_t(m-k-1) \st 0 \le k \le m-1\},
	\]
	we prove that every proper $\Age(t^\omega)_m$-universal composition must have size at least $\min\{t, m\} + \ell_t(k) + \ell_t(m-k-1)$ for some $k$. Let $c$ be an $\Age(t^\omega)_m$-universal composition. As $c$ contains the composition $\min\{t, m\}$, so there must be some index $j$ so that $c(j) \ge \min\{t, m\}$. Choose $k$ so that
	\[
		\ell_t(k)
		\le
		c(1) + \cdots + c(j-1)
		<
		\ell_t(k+1),
	\]
	meaning that there is some composition $d$ of size $k+1$ that does not embed into $c(1) \cdots c(j)$, and thus the earliest $d$ may embed into $c$ is into $c(1) \cdots c(j)$.

	We claim that $c(j+1) \cdots c(n)$ must be $(m-k-1)$-universal for $\Age(t^\omega)$. Let $e$ be an arbitrary composition in $\Age(t^\omega)$ of size $m-k-1$. As $c$ is $\Age(t^\omega)_m$-universal, it must contain the composition $de$. Since $d$ can embed no earlier than into $c(1) \cdots c(j)$, $e$ must embed entirely within $c(j+1) \cdots c(n)$. As $e$ was an abitrary composition of size $m-k-1$, the composition $c(j+1) \cdots c(n)$ is therefore $(m-k-1)$-universal for $\Age(t^\omega)$, and thus $c(j+1) + \cdots + c(n) \ge \ell_t(m-k-1)$. Finally, we have
	\begin{align*}
		\size{c}
			&= \size{c(1) \cdots c(j-1)} + \size{c(j)} + \size{c(j+1) \cdots c(n)} \\
			&\ge \ell_t(k) + \min\{t, m\} + \ell_t(m-k-1),
	\end{align*}
	completing the proof.
\end{proof}

\begin{figure}[ht]
	\captionsetup{justification=centering}
	\begin{tikzpicture}[scale=0.2]
		\skyline{1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1,7,1,3,1}
	\end{tikzpicture}
	\caption{A proper $\Age(7^\omega)_{63}$-universal composition of length $63$ and size $\ell_7(63) = 185$.}
	\label{fig-bdd-part-size}
\end{figure}

Figure~\ref{fig-bdd-part-size} shows a smallest (proper) $\Age(7^\omega)_{63}$-universal composition of the above construction. Unlike the sequence $\ell(m)$, the sequences $\ell_t(m)$ do not appear to be convex. Through tedious casework, the explicit formulas for the sequences $\ell_t(m)$ may be determined for small values of $t$, and computation supports the following conjecture:

\begin{conjecture}
\label{conj-comp-bdd-part-size}
	Let $t = 2^k + r$ with $0 \le r < 2^k$. Then for $m \ge k$ we have
	\[
		\ell_t(m)
		=
		km + k - 2^k + 1 + \sum_{i = 0}^{r-1} \floor{\dfrac{m-i}{2^k}}.
	\]
\end{conjecture}

In particular, if $t = 2^k - 1$, then for $m \ge k$ we conjecture
\[
	\ell_t(m)
	=
	km + k - 2^k + 1.
\]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Compositions with a Bounded Number of Parts}
\label{subsec-comp-bdd-num-pts}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Fix a positive integer $t$, and consider the class $\Age(\omega^t)$ of compositions that have at most $t$ parts. For $m \le t$, $\Age(\omega^t)$ contains all compositions of size $m$, and the composition $w_m$ is in $\Age(\omega^t)$, so the smallest proper $\Age(\omega^t)_m$-universal compositions are smallest $m$-universal compositions for $m \le t$.

\begin{proposition}
\label{thm-comp-bdd-num-parts-small}
	For all $m \le t$, the smallest proper $\Age(\omega^t)_m$-universal compositions have size $\ell(m)$.
\end{proposition}

Given an $(m-1)$-universal composition $c$ for $\Age(\omega^t)$, we may form an $m$-universal composition for $\Age(\omega^t)$ of the same length by incrementing each of its parts, as the next result shows.
\begin{proposition}
\label{prop-comp-bdd-num-parts-proper}
	For all $m > t$, if $c$ is a $\Age(\omega^t)_{m-1}$-universal composition, then the composition $c^{+1}$ formed by incrementing each part of $c$ is $m$-universal for $\Age(\omega^t)$.
\end{proposition}
Before presenting the proof of Proposition~\ref{prop-comp-bdd-num-parts-proper}, we note that it implies the existence of proper $\Age(\omega^t)_m$-universal compositions of size $t(m-t) + \ell(t)$ by simply incrementing each part of $w_t$ a total of $m-t$ times. For any composition $c$, let $c^{+n}$ denote the composition formed by adding $n$ to each part of $c$. A proper universal composition for $\Age(\omega^7)$ formed in this way is drawn in Figure~\ref{fig-comp-bdd-num-parts}.
\begin{corollary}
	For all $m > t$, $w_t^{+(m-t)}$ is a proper $\Age(\omega^t)_m$-universal of size $tm - t^2 + \ell(t)$.
\label{cor-comp-bdd-num-parts-proper}
\end{corollary}
%
\newenvironment{proof-of-prop-comp-bdd-num-parts-proper}{%
	\medskip\noindent {\it Proof of Proposition~\ref{prop-comp-bdd-num-parts-proper}.\/}%
}{%
	\qed\bigskip%
}
\begin{proof-of-prop-comp-bdd-num-parts-proper}
	Suppose that $m > t$ and that $c$ is a proper $\Age(\omega^t)_{m-1}$-universal composition. Let $c^{+1}$ be the composition formed by incrementing each part of $c$ and let $d = d(1) \cdots d(n)$ be an arbitrary composition in $\Age(\omega^t)$ of size $m$. As $m > t$, there is some part $d(j)$ of $d$ such that $d(j) > 1$. Thus, the composition $d_{j}^{-1}$ formed from $d$ by decrementing its $j\th$ part is a composition of size $m-1$ in $\Age(\omega^t)$, and thus embeds into $c$, ie. there is a subsequence $c(i_1) c(i_2) \cdots c(i_n)$ of $c$ such that $d_{j}^{-1}(k) \le c(i_k)$ for all $k$. Then, as $d(k) \le d_{j}^{-1}(k) + 1$ for all $k$, we have that $d(k) \le c(i_k) + 1$ for all $k$, so $d$ embeds into $c^{+1}$, completing the proof.
\end{proof-of-prop-comp-bdd-num-parts-proper}

\begin{figure}[ht]
\captionsetup{justification=centering}
	\begin{tikzpicture}[scale=0.2]
		\skyline{7, 9, 7, 13, 7, 9, 7}
	\end{tikzpicture}
\caption{The proper $\Age(\omega^7)_{13}$-universal composition $w_7^{+6}$ of length $7$ and size $59$.}
\label{fig-comp-bdd-num-parts}
\end{figure}

In the case that $t = 2$, Corollary~\ref{cor-comp-bdd-num-parts-proper} shows that there are proper $\Age(\omega^2)_m$-universal compositions of size $2m-1$. In fact, the smallest $\Age(\omega^2)_m$-universal compositions of arbitrary length have this size as well:

\begin{proposition}
\label{prop-comp-length-2-improper}
	The smallest (proper) $\Age(\omega^2)_m$-universal compositions have size $2m-1$.
\end{proposition}
\begin{proof}
	Let $c = c(1) \cdots c(\ell)$ be an $\Age(\omega^2)_m$-universal composition for $m \ge 2$. As $c$ must contain the composition $m$, there must be some $j$ such that $c(j) \ge m$. Let $a$ be the size of the largest part before $c(i)$ and $0$ if $i = 1$. Similarly, let $b$ be the size of the largest part after $c(i)$ and $0$ if $i = \ell$. There are now two cases to consider: if $a < m-1$ and if $a \ge m-1$. If $a < m-1$, then $c$ contains the composition $(a+1)(m-a-1)$. As $a$ is the largest part to the left of $c(i)$, we must have $b \ge m-a-1$. Thus
	\begin{align*}
		\size{c}
			&\ge a + m + b \\
			&\ge a + m + (m-a-1) \\
			&= 2m-1.
	\end{align*}
	On the other hand, if $a \ge m-1$, then we have
	\begin{align*}
		\size{c}
			&\ge   a   + m + b \\
			&\ge (m-1) + m + 0 \\
			&= 2m-1,
	\end{align*}
	as well, completing the proof.
\end{proof}

% Not every smallest $\Age(\omega^2)_m$-universal composition lies in $\Age(\omega^2)$. The composition $\floor{\frac{m-1}{2}} m \ceil{\frac{m-1}{2}}$ of size $2m-1$ may be shown to be $\Age(\omega^2)_m$-universal but does not lie in $\Age(\omega^2)$.

Computational evidence indicates that each smallest $m$-universal composition for $\Age(\omega^t)$ for $m > t$ can be constructed with Proposition~\ref{prop-comp-bdd-num-parts-proper}, and thus we make the following conjecture.
\begin{conjecture}
\label{conj-comp-bdd-num-parts-proper}
	For $m > t$, the smallest proper $m$-universal compositions for $\Age(\omega^t)$ have size $tm - t^2 + \ell(t)$.
\end{conjecture}

In the case that $t = 3$, Corollary~\ref{cor-comp-bdd-num-parts-proper} shows that there are proper $\Age(\omega^3)_m$-universal compositions of size $3m-4$, and empirical evidence suggests---and we conjecture---that the smallest $\Age(\omega^3)_m$-universal compositions of arbitrary length have this size as well. However, for $t \ge 4$, computations reveal that the smallest $\Age(\omega^t)_m$-universal compositions are strictly smaller than the proper $\Age(\omega^t)_m$-universal composition presented in Corollary~\ref{cor-comp-bdd-num-parts-proper}, and thus the size of smallest $\Age(\omega^t)_m$-universal compositions for $t > 4$ is unknown.

\begin{conjecture}
\label{conj-comp-length-3-improper}
	For all $m \ge 3$, there are smallest $\Age(\omega^3)_m$-universal compositions of length $3$.
\end{conjecture}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Compositions with at Most One Large Part}
\label{subsec-comp-one-large-part}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

As one final case study, consider the class $\C = \Age(1^\omega \omega 1^\omega)$ of compositions with at most one part of size greater than $1$.

\begin{theorem}
	For $m \ge 3$, the smallest (proper) $\C_m$-universal compositions have size $3m-4$.
\end{theorem}
\begin{proof}
	To begin, we claim that the composition $c = 1^{m-2} m 1^{m-2}$ is a proper $\C_m$-universal composition. Let $d$ be an arbitrary composition in $\C_m$. If $d$ has a part that is at least $2$, then it must decompose as $1^i j 1^k$, where $2 \le j \le m$ and both $i$ and $k$ are at most $m-2$. Thus $d$ embeds into $1^{m-2} m 1^{m-2}$. Otherwise, $d$ must be the composition $1^m$, and as the $c$ has length $2m-3 \ge m$, we have that $d$ embeds into $c$, and thus $c$ is $\C_m$-universal.

	Now, suppose $c$ is any $\C_m$-universal composition. We claim that $c$ must have size at least $3m-4$. As $c$ contains the composition $m$, there must some index $j$ so that $c(j) \ge m$. Let $a$ denote the prefix of $c$ before the part $c(j)$ and let $b$ denote the suffix of $c$ after the part $c(j)$ so that $c = a c(j) b$. Let $\operatorname{h}(a)$ and $\operatorname{h}(b)$ denote the largest parts of $a$ and $b$, respectively. If $\operatorname{h}(a) < m$, then $c$ must contain the composition $(\operatorname{h}(a)+1)1^{m-\operatorname{h}(a)-1}$, and as the earliest that the part $\operatorname{h}(a)+1$ may embed into $c$ is into $c(i)$, the composition $1^{m-\operatorname{h}(a)-1}$ must embed into $b$, and thus $\len(b) \ge m-\operatorname{h}(a)-1$. If $\operatorname{h}(a) \ge m$, then $\len(b) \ge 0 > m - \operatorname{h}(a) - 1$ anyways. Similarly, we must have $\len(a) \ge m - \operatorname{h}(b) - 1$ in any case. For any composition $d$, we have $\size{d} \ge \len(d) + \operatorname{h}(d) - 1$, and thus
	\begin{align*}
		\size{c}
			&= c(i) + \size{a} + \size{b} \\
			&\ge m +  \len(a) + \operatorname{h}(a) - 1 + \len(b) + \operatorname{h}(b)  - 1 \\
			&=   m + (\len(a) + \operatorname{h}(b)) +   (\len(b) + \operatorname{h}(a)) - 2 \\
			&\ge m + (m-1) + (m-1) - 2 \\
			&= 3m-4,
	\end{align*}
	as desired.
\end{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Concluding Remarks}
\label{sec-comp-conclusion}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In its proof, Theorem~\ref{thm-comp-universal} provides a recursive strategy for constructing smallest $m$-universal compositions, leading to a precise formula for their size asymptotic to $m \log m$. As in the case of integer partitions discussed in Chapter~\ref{chap-partitions}, any proper class of compositions $\C$ admits proper $\C_m$-universal compositions if and only if $\C$ satisfies the joint-embedding property. This property is equivalent to $\C$ being the age of some potentially infinite composition $u$, as the following result of Fra{\"i}ss{\'e} shows:

\begin{theorem}[Fra{\"i}ss{\'e}~\cite{fraisse:sur-lextension-:}; see also Hodges~{\cite[Section 7.1]{hodges:model-theory:}}]
	The following are equivalent for a class $\P$ of integer partitions or compositions:
	\begin{enumerate}
		\item $\P$ cannot be expressed as the union of two proper subclasses,
		\item $\P$ satisfies the \emph{joint embedding property}, meaning that for every $a, b \in \P$ there is some $c \in \P$ such that $a, b \le c$, and
		\item $\P = \Age(u)$ for some word $u \in (\mathbb{P} \cup \{n^\omega \st n \in \mathbb{P}\} \cup \{\omega, \omega^\omega\})^\ast$.
	\end{enumerate}
\end{theorem}

While Theorem~\ref{thm-comp-bdd-part-size} provides a recursive formula for the size of the smallest (proper) universal compositions for the classes of compositions whose part sizes are bounded, an explicit formula exists only in Conjecture~\ref{conj-comp-bdd-part-size}. For the classes of compositions of bounded size, the both the sizes of the smallest proper and not-necessarily-proper universal compositions remain unknown, but Conjecture~\ref{conj-comp-bdd-num-parts-proper} provides a guess in the former case.


\documentclass{article}
\usepackage{algorithm} %format of the algorithm
\usepackage{algorithmic} %format of the algorithm
\usepackage{graphics}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{abstract}
In our work, we explore the Steepest Descent method, which could be seen as an variation of the well-studied Gradient Descent method. First, we will give the exact definition of the Steepest Descent method, then we will give convergence analysis for both these two methods, which are very similar. \\
Then, through our experiment, we showed the drastic impact on the performance of the Steepest Descent method by the choice norm we use. Finally, we try to use the Hessian to automatically construct the norm, which we put the G-S descent, but sadly failed.
\end{abstract}

\section{INTRODUCTION}
In the field of solving unconstrained optimization problem, one most well-known and well-studied method, is the Gradient Descent method, we first briefly introduce the Gradient Descent, which is shown in Algorithm \ref{alg:A}.\\
In the step 2 of the Gradient Descent method, we must choose exact line search or backtracking line search, while exact line search is preferred, in our experiments we will use the backtracking line search, which is more easy to implement. The backtracking line search is shown in Algorithm \ref{alg:B}.
\begin{algorithm}\caption{\label{alg:A}Gradient descent method.}
\begin{algorithmic}
\STATE \textbf{Given} a starting point $x \in \textbf{dom} f$
\REPEAT
\STATE 1. $\Delta x:=-\nabla f\left( x\right) $.
\STATE 2. \textit{Line search.} Choose step size t via exact or backtracking line search.
\STATE 3. \textit{Update.} $x:=x+t\Delta x$
\UNTIL{stopping criterion is satisfied.}
\end{algorithmic}
\end{algorithm}

\begin{algorithm}\caption{\label{alg:B}Backtracking line search.}
\begin{algorithmic}
\STATE \textbf{Given} a starting point $\bigtriangleup x$ for f at $x \in \textbf{dom} f, \alpha \in (0,0.5), \beta \in (0,1)$
\STATE \textbf{While} $f(x + t\bigtriangleup x) > f(x) + \alpha t \nabla f(x)^T \bigtriangleup x$ \\
{$t = \beta t$}
\end{algorithmic}
\end{algorithm}
We have to mention due to some historical reasons the Gradient Descent is also called the Steepest Descent method$[1]$(Well, its direction is truly locally 'steepest'). However, the Steepest Descent method is another story.\\
Let $||\cdot||$ be any norm on $R^n$. We define a normalized steepest descent direction(with respect to the norm $||\cdot||$) as
\begin{displaymath}
\Delta x _{nsd} = argmin\{ \nabla f(x)^Tv| ||v|| = 1\}
\end{displaymath}
Now we can give the Steepest descent method in Algorithm \ref{alg:C}.
\begin{algorithm}\caption{\label{alg:C}Steepest descent method}
\begin{algorithmic}
\STATE \textbf{Given} a starting point $x \in \textbf{dom} f$
\REPEAT
\STATE 1. Compute steepest descent direction $\Delta x _{nsd}$.
\STATE 2. \textit{Line search.} Choose step size t via exact or backtracking line search.
\STATE 3. \textit{Update.} $x:=x+t\Delta x$
\UNTIL{stopping criterion is satisfied.}
\end{algorithmic}
\end{algorithm}
To get a better understanding of the Steepest Descent Method, let's look at some examples.
\subsection{Steepest Descent for Euclidean and quadratic norms}
If  we take the norm $||\cdot||$ to be the Euclidean norm, then the steepest descent direction is simply the negative gradient.\\
Given a $P \in S^n_{++}$, now we consider the quadratic norm
\begin{displaymath}
||z||_P = (z^TPz)^{1/2} = ||P^{1/2}||_2
\end{displaymath}
The normalized steepest descent direction is given by
\begin{displaymath}
\Delta x_{nsd} = -(\nabla f(x) ^ T P ^{-1} \nabla f(x))^{-1/2} P ^{-1} \nabla f(x)
\end{displaymath}

\section{Discussion and examples}
\subsection{choice of norm for steepest descent}
One important thing for the steepest descent method is to choose a good norm. In our convergence analysis, we know that the gradient method works well when the condition number of the sublevel sets are moderate, and poorly otherwise. Let's begin with the quadratic $P$-norm, we know that using the quadratic $P$-norm means that we change coordinates by $\overline{x} = P^{1/2}x$. So, a good idea would be to make the ellipsoid
\begin{displaymath}
\varepsilon = \{ x | x^TPx \leq 1\}
\end{displaymath}
be a good approximation of the shape of the sublevel set.(In other words, it gives a good approximation after appropriate scaling and translation.) \\
Let's consider the following function :
\begin{displaymath}
g_1(x_1, x_2) = e ^ {x_1 + 3x_2 -0.1} + e ^ {x_1-3x_2-0.1} + e^{-x_1-0.1}
\end{displaymath}
For all three tries, we start at point$(-0.4,1)$, and use the backtracking line search with $\alpha=0.2$, $\beta=0.8$, and let the initial step be 1, the tolerance is 0.01. For the two steepest descent tries, we choose $P_1 = \begin{array}{cc} 1/2 & 0 \\ 0 & 1/4\end{array}$ and
$P_2 = \begin{array}{cc} 1/4 & 0 \\ 0 & 1/2\end{array}$, the results are shown in Figure \ref{fig:htx1}.\\
We also add the shape of the norms on the graphs. From the results, we can clearly see that the norm $P_1$, which is a better
approximate of the sublevel set, give the best result. And we we use $P_2$, it becomes worse than the original gradient descent. \\
\begin{figure}
        \begin{tabular}{cc}
            \includegraphics[width=40mm]{htx1-1.jpg} &
            \includegraphics[width=40mm]{htx1-2.jpg} \\
            G-descent : 11 iterations&
            S-descent with $P_1$ : 6 iterations \\
            \includegraphics[width=40mm]{htx1-3.jpg} \\
            S-descent with $P_2$ : 29 iterations
        \end{tabular}
    \caption{\label{fig:htx1}Three methods for $g_1$.}
\end{figure}
To further illustrate the power of the steepest descent method, we choose a function which is exactly a ellipse:
\begin{displaymath}
g_2(x_1, x_2) = x_1 ^ 2 + 8 * x_2 ^ 2
\end{displaymath}
The result are shown in Figure \ref{fig:htx2}, from which we can see the drastic effect imposed by the choice of the norm, we omit the parameters here.
\begin{figure}
        \begin{tabular}{cc}
            \includegraphics[width=40mm]{htx2-1.jpg} &
            \includegraphics[width=40mm]{htx2-2.jpg} \\
            G-descent : 23 iterations&
            S-descent with $P_1$ : 10 iterations \\
            \includegraphics[width=40mm]{htx2-3.jpg} \\
            S-descent with $P_2$ : 134 iterations
        \end{tabular}
    \caption{\label{fig:htx2}Three methods for $g_2$.}
\end{figure}
\subsection{attempts to construct the norm using Hessian}
Now we know how could we use norm to aid the gradient descent method. One important issue still remains: how could we find the best norm? From the Taylor series, we know that around the local optima $x^{\star}$,
\begin{displaymath}
f(y) \approx p^{\star} + \frac{1}{2} (y - x^\star)^T\nabla^2f(x^\star)(y-x^\star)
\end{displaymath}
So we know the sublevel set near the local optima is well approximated by an elliposid. Now we try to use the Hessian as the $P$, which means, let
\begin{displaymath}
P = \nabla^2f(x)
\end{displaymath}
However, this is sometimes invalid: we need the $P$ to be semi-definite.\\
Given this insight, let's consider the simplified $g_1$
\begin{displaymath}
g_3(x_1, x_2) = e ^ {x_1 + 3x_2} + e ^ {x_1-3x_2} + e^{-x_1}
\end{displaymath}
First we want to let the $P = \nabla^2f(x)$ every step, but we failed, when we peek at the results, we found that the $P$s are really ill-presented, we concluded that the reason is that we are not near the optima.\\
To get the hessian be a good approximation, a second thought is that we can exploit the long-tail property of the descent methods, that is: The start point is (0.9,0.9), At first we set the $P$ to be the identity matrix, i.e, exactly do the gradient descent, however, when $\nabla f(x) < tolerance * 10$, we switch the $P$ to be the local Hessian, let's call this the G-S descent.
\begin{figure}
        \begin{tabular}{cc}
            \includegraphics[width=40mm]{htx3-1.jpg} &
            \includegraphics[width=40mm]{htx3-2.jpg} \\
            G-descent : 15 iterations&
            G-S-descent with Hessian : 19 iterations \\
        \end{tabular}
    \caption{\label{fig:htx3}Two methods for $g_3$.}
\end{figure}
Sadly, the G-S only slow downs the process, which is not hard to understand, when the x converges to the optima, the direction of the gradient becomes stable, so the norm won't do any good. So, if we choose to use the Steepest Descent, we should use the norm we choose from the beginning.
\section{CONCLUSIONS}

\section{REFERENCES}
Nonlinear Programming: Analysis and Methods Dover Publishing\\
Convex Optimization Stephen Boyd and Lieven Vandenberghe\\
\balancecolumns
% That's all folks!
\end{document}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CS671: Machine Learning
% Copyright 2015 Pejman Ghorbanzade <pejman@ghorbanzade.com>
% Creative Commons Attribution-ShareAlike 4.0 International License
% More info: https://github.com/ghorbanzade/beacon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{Question 3}

What happens if the perceptron algorithm is applied to the training dataset shown in Figure \ref{fig1}? Modify the \texttt{perceptron} function to stop when a time limit is reached.
The limit should be added as a parameter to the \texttt{perceptron} function.

\subsection*{Solution}

Since the \texttt{perceptron} kernel function requires subsets of positive and negative samples in training dataset to be completely separable, application of the \texttt{perceptron} function on the training dataset given in \ref{fig1} will not yield to any result.
Since there exists one negative sample which is surrounded by positive samples, it is not possible for any vector to divide the training dataset to two sets of positive and negative samples.
Consequently, the \texttt{perceptron} function will continue to calculate the distances in a never-ending sequence.

The kernel can be modified to cease after a specified duration of time, using an iterator which imposes a limit to number of allowed computations in the kernel.
However, the resulting vector would not be accurate and cannot be used.
This hints of the advantage of SVM-classifiers over the \texttt{perceptron} function.