\documentclass[12pt]{article}
\usepackage[margin=0.5in,foot=0.1in]{geometry}
\usepackage{amsmath,amssymb,graphicx,txfonts,multicol}
\usepackage[setpagesize=false]{hyperref}
\usepackage[usenames,dvipsnames]{xcolor}
% Following http://tex.stackexchange.com/a/847/22475:
\usepackage[setpagesize=false]{hyperref}\hypersetup{colorlinks,
  linkcolor={blue!50!black},
  citecolor={blue!50!black},
  urlcolor=blue
}

\def\myurl{http://www.math.toronto.edu/~drorbn/}

\def\red{\color{red}}

\def\bbC{{\mathbb C}}
\def\bbF{{\mathbb F}}
\def\bbQ{{\mathbb Q}}
\def\bbR{{\mathbb R}}
\def\bbV{{\mathbb V}}
\def\bbZ{{\mathbb Z}}
\def\Aut{\operatorname{Aut}}

\def\problempage{{
  \newpage\noindent\parbox{0.5\linewidth}{
    \footnotesize Solve all 4 problems. Write your solutions only where indicated, or write explicitly, ``continued on page $X$''.
    \newline{\bf Neatness counts! Language counts!}
  }
  \vskip 2mm
}}
\def\yoursolution#1{{
  \vskip 2mm \noindent{\bf Your solution of Problem #1.}
  \newpage\noindent\hfill{\bf Your solution of Problem #1, continued.}
}}
\def\scratchright{{
  \newpage\noindent\hfill\parbox{0.35\linewidth}{\bf
    Scratch work --- this page will not be read unless you explicitly request it.
  }
}}
\def\scratchleft{{
  \newpage\noindent\parbox{0.35\linewidth}{\bf
    Scratch work --- this page will not be read unless you explicitly request it.
  }
}}
\def\scratchboth{{\scratchleft\scratchright}}

% Comment out the following line for the Crowdmark version:
\pagestyle{empty} \def\problempage{\vskip 5mm} \def\yoursolution#1{} \def\scratchright{} \def\scratchleft{} \def\scratchboth{}

\begin{document}
\noindent{\small
  \url{http://drorbn.net/2122-257}
  \newline\href{\myurl}{Dror Bar-Natan}:
  \href{\myurl/classes/}{Classes}:
  \href{\myurl/classes/\#2122}{2021-22}:
}

\vskip 4mm
\noindent{\bf Do not open this notebook until instructed.}
\vskip 4mm
\begin{center}
  \href{http://drorbn.net/2122-257}{\large Math 257 Analysis II}
  \vskip 4mm
  {\LARGE Term Test 1}
  \vskip 4mm
  University of Toronto, November 2, 2021
  \vskip 5mm{\bf Solve all 4 problems on this booklet. }\\
  The problems are of equal weight.\\You have an hour and fifty minutes to
  write this test.
\end{center}

\vskip 9cm

\noindent{\bf Notes}
\begin{itemize}
\item No outside material allowed other than stationary, minimal hydration and snacks, and stuffed animals.
\item Write your solution of each problem on the problem page and on the back of the problem page. If you run out of space you may continue into the scratch pages, but you {\bf must} indicate this on the problem page or else the scratch pages will not be read.
\item {\bf Neatness counts! Language counts!} The {\em ideal} written solution to a problem looks like a page from a textbook; neat and clean and consisting of complete and grammatical sentences. Definitely phrases like ``there exists'' or ``for every'' cannot be skipped. Lectures are mostly made of spoken words, and so the blackboard part of proofs given during lectures often omits or shortens key phrases. The ideal written solution to a problem does not do that.
\end{itemize}

\vfill\begin{center} {\bf Good Luck!} \end{center}\vfill

\scratchright

\problempage
\parshape 4 0in 0.5\linewidth 0in 0.5\linewidth 0in 0.5\linewidth 0in \linewidth
\noindent{\bf Problem 1. } A continuous function $f\colon\bbR^n\to\bbR^n$ satisfies
\[ \left|(x_1-x_2)-(f(x_1)-f(x_2))\right| \leq \frac17\left|x_1-x_2\right| \]
for every $x_1$ and $x_2$ in $\bbR^n$. Prove that for every $y\in\bbR^n$ there is an $x\in\bbR^n$ such that $f(x)=y$.

\vskip 2mm\noindent{\small {\bf Tip. } Don't start working! Read the whole exam first. You may wish to start with the questions that are easiest for you.}

\vskip 2mm\noindent{\small {\bf Tip. } You may want to start by writing ``draft solutions'' on the last pages of this notebook and only then write the perfected versions in the space left here for solutions.}

\yoursolution{1}

\problempage
\parshape 4 0in 0.5\linewidth 0in 0.5\linewidth 0in 0.5\linewidth 0in \linewidth
\noindent{\bf Problem 2. } Show that if a function $f$ is defined near a point $a\in\bbR^n$ and has continuous partial derivatives near $a$, then it is differentiable at $a$.

\vskip 2mm\noindent{\small {\bf Tip. } In math exams, ``show'' means ``prove''.}

\yoursolution{2}

\problempage
\parshape 4 0in 0.5\linewidth 0in 0.5\linewidth 0in 0.5\linewidth 0in \linewidth
\noindent{\bf Problem 3. } A set $A\subset[0,1]$ is a (possibly infinite) union of open intervals and it contains all the rational numbers in $[0,1]$. Show that the boundary of $A$ is $[0,1]\setminus A$.

\yoursolution{3}

\problempage
\parshape 4 0in 0.5\linewidth 0in 0.5\linewidth 0in 0.5\linewidth 0in \linewidth
\noindent{\bf Problem 4. } Let $f\colon[0,1]\times[0,1]\to\bbR$ be given by
\[ f(x,y)=\begin{cases}1 & x>y \\ 0 & x\leq y\end{cases}. \]
Prove that $f$ is integrable on $[0,1]\times[0,1]$ directly by using partitions (namely, without using theorems about continuity and integrability).

\yoursolution{4}

%\problempage
%\parshape 4 0in 0.5\linewidth 0in 0.5\linewidth 0in 0.5\linewidth 0in \linewidth
%\noindent{\bf Problem 5. } Prove that if $C\subset\bbR^n$ is compact and $f\colon C\to\bbR$ is continuous, then there is a point $x\in C$ such that $f(x)\geq f(y)$ for every $y\in C$.
%
%\vskip 2mm\noindent{\small {\bf Hint. } You may use the fact that $f(C)$ is [something].}
%
%\vskip 2mm\noindent{\small {\bf Tip. } Quote any theorem you use!}
%
%\yoursolution{5}

\scratchboth
\scratchboth
\scratchboth
\scratchboth

\end{document}

