\documentclass[a4paper]{article}
\usepackage{amsmath,amsthm,amsfonts}
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows}

\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{environ}	% For \NewEnviron
\usepackage{bbm}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{nicefrac}
\usepackage{bm}
\usepackage{mdframed}
\usepackage{titling}	% For titlingpage
\usepackage[bookmarks=true,hidelinks]{hyperref}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}	% Use symbols for footnotes


\newtheorem*{theorem}{Theorem}

\theoremstyle{definition}
\newtheorem*{definition}{Definition}
\newtheorem*{remark}{Remark}
\newtheorem*{example}{Example}

\renewcommand{\geq}{\geqslant}
\renewcommand{\leq}{\leqslant}
\renewcommand{\epsilon}{\varepsilon}
\newcommand{\eps} {\varepsilon}
\renewcommand{\phi}{\varphi}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\ind}{{\mathbbm{1}}}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator*{\esssup}{ess\, sup}
\DeclareMathOperator*{\essinf}{ess\, inf}
\newcommand{\from}{\colon}

\newcommand{\update}[1]{{\textcolor{red}{#1}}}


\definecolor{shadecolor}{gray}{0.95}


\newcounter{oppgavenr}
\newcounter{deloppgavenr}[oppgavenr]
\renewcommand{\theoppgavenr}{\textbf{\arabic{oppgavenr}}}
\renewcommand{\thedeloppgavenr}{\textbf{(\alph{deloppgavenr})}}

\newenvironment{oppgave}[1][\theoppgavenr]{\refstepcounter{oppgavenr}\par
		\bigskip \noindent\textbf{Problem~\textbf{#1}.}}
	{\par\bigskip}
\newenvironment{deloppgave}{\par\medskip \refstepcounter{deloppgavenr}
\noindent \textbf{(\alph{deloppgavenr})}}{\par\medskip}


\begin{document}


\begin{titlingpage}
    \vspace*{-8em}
    \setlength{\parskip}{1.5ex plus 0.5ex minus 0.2ex}
    \setlength{\parindent}{0pt}

    \begin{flushright}
%        \small\today
		\small \update{Updated \today{} (with changes in red)}
    \end{flushright}

    \begin{center}
        \vspace{2em}
        {
            \bfseries\sffamily\huge
            MAT2400 -- Real Analysis
        }
        \vskip0.2ex
        \Large
        Mandatory assignment 1 of 2
        \vskip1ex
    \end{center}

    \subsubsection*{Submission deadline}
    Thursday 25 February \the\year, 14:30 in Canvas
    (\href{https://canvas.uio.no}{\underline{canvas.uio.no}}).

    \subsubsection*{Instructions}
	You can choose between writing in English or Norwegian. You will find a Norwegian--English mathematical dictionary at
\begin{center}
\href{/studier/emner/matnat/math/MAT2400/data/norsk-engelsk-ordliste.html}{/studier/emner/matnat/math/MAT2400/data/norsk-engelsk-ordliste.html}.
\end{center}

    You can choose between scanning handwritten notes or typing the solution directly on a computer (for instance with \LaTeX).
    The assignment must be submitted as a single PDF file.
    Scanned pages must be clearly legible; please use either the ``Color'' or ``Grayscale'' settings.
    The submission must contain your name, course and assignment number.

    It is expected that you give a clear presentation with all necessary explanations.
    Remember to include all relevant plots and figures.
    Students who fail the assignment, but have made a genuine effort at solving the exercises, are given a second attempt at revising their answers.
    All aids, including collaboration, are allowed, but the submission must be written by you and reflect your understanding of the subject.
    If we doubt that you have understood the content you have handed in, we may request that you give an oral account.

    \subsubsection*{Application for postponed delivery}
    If you need to apply for a postponement of the submission deadline due to illness or other reasons, you have to contact the Student Administration at the Department of Mathematics (e-mail: \href{mailto:studieinfo@math.uio.no}{studieinfo@math.uio.no}) well before the deadline.

    All mandatory assignments in this course must be approved in the same semester, before you are allowed to take the final examination.

    \subsubsection*{Complete guidelines about delivery of mandatory assignments:}
    \unskip
    \begin{center}
        \unskip
        \href{http://www.uio.no/english/studies/admin/compulsory-activities/mn-math-mandatory.html}
        {
            \resizebox{\textwidth}{!}
            {\underline{uio.no/english/studies/admin/compulsory-activities/mn-math-mandatory.html}}
        }
        \vspace{1ex}
        \vfill
        GOOD LUCK!
    \end{center}
\end{titlingpage}



\mdfdefinestyle{MyFrame}{%
    outerlinewidth=4pt,
    innertopmargin=\baselineskip,
    innerbottommargin=\baselineskip,
    innerrightmargin=20pt,
    innerleftmargin=20pt,
    backgroundcolor=red!10!white}

\begin{mdframed}[style=MyFrame]
\begin{center}
\textbf{Note:} You will find a list of hints on page \pageref{p:hintsstart}.
\end{center}
\end{mdframed}






\begin{oppgave}
\begin{deloppgave}
Show that we can always interchange two $\sup$'s: If $A$ and $B$ are sets and $f\from A\times B\to\R$ is a function, then
\begin{equation}\label{eq:supcommute}
\sup_{x\in A} \sup_{y\in B} f(x,y) = \sup_{y\in B} \sup_{x\in A} f(x,y)
\end{equation}
To avoid dealing with infinities, you can assume that $f$ is bounded from above.

\textit{Note: The same holds for two $\inf$'s.}
\end{deloppgave}

\begin{deloppgave}
We can \emph{not} always interchange an $\inf$ and a $\sup$: Show that if $f(x,y)=(x+y)^2$ then
\[
\adjustlimits\sup_{x\in A}\inf_{y\in B} f(x,y) \neq \adjustlimits\inf_{y\in B} \sup_{x\in A} f(x,y)
\]
where $A=B=[-1,1]$.
\end{deloppgave}

\textit{Recall that $\sup_{x\in A} g(x)$ (for some function $g$) means the same as $\sup\{g(x):x\in A\}$.}
\end{oppgave}




\begin{oppgave}\label{prob:limits}
In this exercise we will investigate the limit of ``double sequences'' -- sets of objects $x_{i,j}$ in some metric space $(X,d)$ indexed over $i,j\in\N$. The question is whether we can interchange limits in $i$ and $j$:
\begin{equation}\label{eq:limchange}
\lim_{i\to\infty}\lim_{j\to\infty} x_{i,j} = \lim_{j\to\infty}\lim_{i\to\infty} x_{i,j}.
\end{equation}
See Figure \ref{fig:limits} for an illustration. Note that we need to assume that all of the limits
\begin{equation}\label{eq:limits}
y_i=\lim_{j\to\infty} x_{i,j}, \quad y = \lim_{i\to\infty} y_i, \quad z_j=\lim_{i\to\infty} x_{i,j}, \quad z = \lim_{j\to\infty} z_j
\end{equation}
exist -- otherwise \eqref{eq:limchange} would not make sense.

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=1.5]
\node (A) at (0,0.6) {$x_{i,j}$};
\node (B) at (1.5,1.2) {$z_j$};
\node (C) at (1.5,0) {$y_i$};
\node (D) at (3,1.2) {$z$};
\node (E) at (3,0) {$y$};
\path[->,font=\scriptsize,>=angle 90]
(A) edge node[below,sloped]{$i\to\infty$} (B)
(A) edge node[below,sloped]{$j\to\infty$} (C)
(B) edge node[below]{$j\to\infty$} (D)
(C) edge node[below]{$i\to\infty$} (E);
\end{tikzpicture}
\caption{Is $y=z$?}\label{fig:limits}
\end{figure}

\begin{deloppgave}\label{prob:limnochange}
Consider the metric space $\R$ with the canonical metric, and let $x_{i,j} = i\min(\nicefrac1i, \nicefrac1j)$. Show that \eqref{eq:limchange} is \textit{not} true.
\end{deloppgave}

\begin{deloppgave}
We say that the limit $\lim_{i\to\infty} x_{i,j}$ is \textit{uniform in $j$} if for every $\eps>0$ there is some $M\in\N$ such that
\[
d(x_{i,j},y_i) < \eps \quad \text{for all } j\geq M \text{ and all } i\in\N.
\]
For the example in problem \ref{prob:limnochange}, show that the limit is \textit{not} uniform in $j$.
\end{deloppgave}

\begin{deloppgave}
Show that there is always some subsequence $\{x_{I(j),j}\}_{j\in\N}$ converging to $z$, and another subsequence $\{x_{i,J(i)}\}_{i\in\N}$ converging to $y$. (Here, both of $I,J\from \N\to\N$ are increasing sequences, as in the definition of a subsequence.)
\end{deloppgave}

\begin{deloppgave}\label{prob:limchange}
Show that if the $\lim_{i\to\infty} x_{i,j}$ is {uniform in $j$}, then \eqref{eq:limchange} is true.
\end{deloppgave}


\begin{remark}
The morale is: If you want to interchange two limits, then one of them has to be uniform.
\end{remark}
\end{oppgave}







\begin{oppgave}\label{prob:semicont}
Let $(X,d)$ be a metric space. A function $f\from X\to\R$ is \emph{lower semicontinuous} at $x\in X$ if for every $\eps>0$, there is some $\delta>0$ such that
\begin{equation}\label{eq:lowersemicont}
f(x) < f(y)+\eps \qquad \forall\ y\in B(x;\delta).
\end{equation}
It is \emph{upper semicontinuous} at $x\in X$ if for every $\eps>0$, there is some $\delta>0$ such that
\begin{equation}\label{eq:uppersemicont}
f(x) > f(y)-\eps \qquad \forall\ y\in B(x;\delta).
\end{equation}


\begin{deloppgave}\label{prob:contsemicont}
Show that a function is continuous at $x$ \emph{if and only if} it is both upper and lower semicontinuous at $x$.
\end{deloppgave}

\begin{deloppgave}\label{prob:semicontnotcont}
Show that the function $f\from\R\to\R$ given by
\[
f(x) = \begin{cases}
x & x<0 \\ x+1 & x\geq0
\end{cases}
\]
is upper semicontinuous, but not lower semicontinuous.
\end{deloppgave}

\begin{deloppgave}\label{prob:semicontminimum}
Show that if $K\subset X$ is compact and $f\from K\to\R$ is lower semicontinuous then $f$ attains a minimum -- there is some $\bar{x}\in K$ such that
\begin{equation}\label{eq:minimum}
f(\bar{x}) \leq f(x) \qquad \forall\ x\in K.
\end{equation}
\end{deloppgave}


\begin{remark}
Lower/upper semicontinuous functions are encountered in many places, particularly in the field of calculus of variations, where one attempts to find minima or maxima of functions. As seen in problems \ref{prob:contsemicont} and \ref{prob:semicontnotcont}, upper/lower semicontinuity is a \textit{weaker} property than continuity, but, as seen in problem \ref{prob:semicontminimum}, semicontinuous functions nonetheless have some of the important properties that continuous functions have.
\end{remark}
\end{oppgave}







\begin{oppgave}\label{prob:compactness}
In this problem we will identify some of the compact subsets of the metric space
\[
\ell^\infty(\R) = \big\{a\from\N\to\R\ :\ \|a\|_{\ell^\infty}=\sup_{i\in\N}|a(i)| < \infty \big\},
\]
equipped with the metric
\[
d_\infty(a,b) = \|a-b\|_{\ell^\infty} = \sup_{i\in\N} |a(i)-b(i)|.
\]
\begin{remark}
We can think of the elements of $\ell^\infty$ either as sequences \update{$\{a_i\}_{i\in\N}$} (for $a_i\in\R$), as functions $a\from\N\to\R$, or as infinite-dimensional vectors $a=(a_1,a_2,\dots)$.
\end{remark}

\begin{deloppgave}
Show that the closed, bounded set $\overline{B}(0;1)$ is not compact. For instance, you can let $x_n = (0,\dots,0,1,0,\dots)$ (where the ``1'' appears in the $n$th position) and show that $x_n$ lies in $\overline{B}(0;1)$ for any $n\in\N$, but that $\{x_n\}_n$ does not have a convergent subsequence.
\end{deloppgave}

\begin{deloppgave}\label{prob:linffinitedim}
Prove the following:
\begin{theorem}
Let $K\subset \ell^\infty(\R)$ be any closed subset satisfying the following: There exists some $C>0$ and $N\in\N$ such that every $a\in K$ satisfies
\[
|a(i)| \leq C \quad \forall\ i\leq N, \qquad a(i) = 0 \quad \forall\ i>N.
\]
Then $K$ is compact.
\end{theorem}
\noindent
You are allowed to use the Bolzano--Weierstrass theorem: If $A\subset\R$ is closed and bounded then it's compact.
\end{deloppgave}

\begin{remark}
What the above result illustrates is that when we are dealing with infinite-dimensional spaces, we need some additional restriction on the ``behaviour at infinity'' in order to obtain compactness.
\end{remark}
\end{oppgave}





\newpage
\section*{Hints}\label{p:hintsstart}
\begin{mdframed}[style=MyFrame]
\textbf{Warning:} Don't use these hints blindly! When writing your solution, \textit{do not assume that the person who will correct your assignment has read the hints.}
\end{mdframed}


\begin{oppgave}[\ref{prob:limits}\ref{prob:limnochange}]
Start by identifying the limits $y_i$ and $z_j$.
\end{oppgave}

\begin{oppgave}[\ref{prob:limits}\ref{prob:limchange}]
Show that $y_i \to z$ as $i\to\infty$.
\end{oppgave}

\begin{oppgave}[\ref{prob:semicont}\ref{prob:semicontminimum}]
Can you modify the proof of the extreme value theorem to fit this setting?
\end{oppgave}


\begin{oppgave}[\ref{prob:compactness}\ref{prob:linffinitedim}]
Recall the proof of the fact that the compact subsets of $\R^N$ are those that are closed and bounded.
\end{oppgave}


\end{document}
