\stepcounter{subsection}
\subsection{Continuity}
\compactdef{Convergence in $\R^n$} Let $(x_k)_{k \in \N}$ where $x_k \in \R^n$ with $x_k = (x_{k, 1}, \ldots, x_{k, n})$ and let $y = (y_1, \ldots, y_n) \in \R^n$.
$(x_k)$ converges to $y$ as $k \rightarrow +\infty$ if $\forall \varepsilon > 0 \smallhspace \exists N \geq 1$ s.t. $\forall n \geq N$ we have $||x_k - y|| < \varepsilon$\\
% ────────────────────────────────────────────────────────────────────
\shortlemma $(x_k)$ converges to $y$ as $k \rightarrow +\infty$ iff one of following equiv. statements holds:
\bi{(1)} $\forall 1 \leq i \leq n$, the sequence $(x_{k, i})$ with $x_{k, i} \in \R$ converges to $y_i$
\bi{(2)} $(||x_k - y||)$ converges to $0$ as $k \rightarrow +\infty$\\
% ────────────────────────────────────────────────────────────────────
\compactdef{Continuity} Let $X \subseteq \R^n$ and $f: X \rightarrow \R^m$.
\bi{(1)} Let $x_0 \in X$. $f$ continuous in $\R^n$ if $\forall \varepsilon > 0 \smallhspace \exists \delta > 0$ s.t. if $x \in X$ satisfies $||x - x_0|| < \delta$,
then $||f(x) - f(x_0)|| < \varepsilon$
\bi{(2)} $f$ continuous \textit{on} $X$ if continuous at $x_0 \smallhspace \forall x_0 \in X$
% TODO: Add tricks from TA slides here (week 05 / 04)
% ────────────────────────────────────────────────────────────────────
\shortproposition Let $X$ and $f$ as prev. Let $x_0 \in X$. $f$ continuous at $x_0$ iff $\forall (x_k)_{k \geq 1}$ in $X$ s.t.
$x_k \rightarrow x_0$ as $k \rightarrow +\infty$, $(f(x_k))_{k \geq 1}$ in $\R^m$ converges to $f(x)$\\
% ────────────────────────────────────────────────────────────────────
\compactdef{Limit} Let $X$, $f$ and $x_0$ as prev. and $y \in \R^m$. $f$ \textit{has limit} $y$ as $x \rightarrow x_0$ with $x \neq x_0$ if
$\forall \varepsilon > 0 \smallhspace \exists \delta > 0$ s.t. $\forall x \neq x_0 \in X, ||x - x_0|| < \delta$ we have $||f(x) - y|| < \varepsilon$.
We write $\lim_{\elementstack{x \rightarrow x_0}{x \neq x_0}} f(x) = y$
\shortremark Also possible without ass. that $x_0 \in X$
% ────────────────────────────────────────────────────────────────────
\shortproposition Let $X$, $f$, $x_0$ and $y$ as prev. We have $\lim_{\elementstack{x \rightarrow x_0}{x \neq x_0}} f(x) = y$
iff $\forall (x_k)$ in $X$ s.t. $x_k \rightarrow x$ as $k \rightarrow +\infty$ and $x_k \neq x_0$ $(f(x_k))$ in $\R^m$ converges to $y$
\stepLabelNumber{all}
\shortproposition Let $X \subseteq \R^n$, $y \subseteq \R^m$, $p \in \N$ and let $f: X \rightarrow Y$ and $g: Y \rightarrow \R^p$ be cont. Then $g \circ f$ is continuous
% ────────────────────────────────────────────────────────────────────
\numberingOff
\inlineremark To find the limits, we have two tricks (for $\limit{(x, y)}{(a, b)}$):
\rmvspace
\begin{enumerate}[noitemsep]
    \item \bi{(Substitution)} Substitute $y = x + (b - a)$, then limit is $\limit{x}{(a - b)}$
    \item \bi{(Polar coordinates)} Substitute $x = r \cos(\varphi)$ and $y = r \sin(\varphi)$ and the limit is $\limit{r}{0}$
\end{enumerate}

\numberingOn\rmvspace
\shortex \bi{(1)} $f_1 : \R^n \rightarrow \R^{m_1}$ and $f_2 : \R^n \rightarrow \R^{m_2}$ continuous
$\Rightarrow f = (f_1, f_2): \R^n \rightarrow \R^{m_1 + m_2}$ is continuous (Cartesian product)
\bi{(2)} Any linear map $f: \R^n \rightarrow \R^m$ is continuous. In particular, the identity map is continuous
\bi{(3)} If $f_1, \ldots, f_n$ continuous, then $f(x_1, \ldots, x_n) = f_1(x_1) \cdot \ldots \cdot f_n(x_n)$ is continuous
\bi{(4)} Polynomials in $x_1, \ldots, x_n$ are continuous
\bi{(5)} $f_1f_2$ is continuous if $f_1$ and $f_2$ are continuous and if $f_2(x) \neq 0 \smallhspace \forall x \in X$, then $f_1 \div f_2$ is continuous.
(see Theorem 2.1.8 in Analysis I)\\
\bi{(6)} If both $f$ and $g$ have limits, then $\displaystyle \limit{x}{x_0}(f(x) + g(x)) = \limit{x}{x_0} f(x) + \limit{x}{x_0} g(x)$ and analogous for $\times$
\bi{(7)} If $f: \R^2 \rightarrow \R$ continuous, then $g(x) = f(x, y_0)$ for $y_0 \in \R$ is continuous. The converse is not true\\
% ────────────────────────────────────────────────────────────────────
\shortdef \bi{(1)} $X \subseteq \R^n$ is \bi{bounded} if the set of $||x||$ for $x \in X$ is bounded in $\R$
\bi{(2)} $X \subseteq \R^n$ is \bi{closed} if $\forall (x_k)$ in $X$ that converge in $\R^n$ to some vector $y \in \R^n$, we have $y \in X$
% Closed simple explanation: "border" included or not (and is not in case of open disc because limit is outside, i.e. limit of a_n = (n / (n + 1), 0) is 1)
\bi{(3)} $X \subseteq \R^n$ is \bi{compact} if it is bounded and closed\\
% ────────────────────────────────────────────────────────────────────
\shortex \bi{(1)} $\emptyset$ and $\R^n$ are closed.
\bi{(2)} The \textit{open} disc $D = \{ x \in \R^n : ||x - x_0|| < r \}$ for $r > 0$ and $x_0 \in \R^n$ is bounded and not closed.
\bi{(3)} The \textit{closed} disc $\Delta = \{ x \in \R^n : ||x - x_0|| \leq r \}$ is bounded and closed. In particular, a closed interval is a closed set.
An interval is compact if it is bounded
\bi{(4)} If $X_1 \subseteq \R^n$ and $X_2 \subseteq \R^m$ are bounded (also closed or compact), then so is $X_1 \times X_2 \subseteq \R^{n + m}$\\
% ────────────────────────────────────────────────────────────────────
\shortproposition Let $f: \R^n \rightarrow \R^m$ be a continuous map. For any closed $Y \subseteq \R^m$,
the set $f^{-1}(Y) = \{ x \in \R^n : f(x) \in Y \} \subseteq \R^n$ is closed\\
% ────────────────────────────────────────────────────────────────────
\shortex The \bi{zero set} $Z = \{ x\in \R^n : f(x) = 0 \}$ is closed in $\R^n$ because $\{ 0 \} \subseteq \R$ is closed.
More generally: for any $r \geq 0$, $\{ x \in \R^n : |f(x)| \leq r \}$ is $f^{-1}([-r, r])$ and is closed, since $[-r, r]$ is closed.
Furthermore: $\{ x\in \R^3 : ||x - x_0|| = r \}$ is closed\\
% ────────────────────────────────────────────────────────────────────
\shorttheorem Let $(X \neq \emptyset) \subseteq \R^n$ compact and $f: X \rightarrow \R$ continuous. 
Then $f$ bounded, has $\max$ and $\min$, i.e. $\exists x_+, x_- \in X$ s.t. $\displaystyle f(x_+) = \sup_{x \in X} f(x)$ and $\displaystyle f(x_-) = \inf_{x \in X} f(x)$
% ────────────────────────────────────────────────────────────────────
\rmvspace
