\documentclass{article}
\usepackage{amsmath, amssymb,verbatim, amsthm, graphicx}

%exercise environment
\newcounter{exercise}
\setcounter{exercise}{0}
\newenvironment{exercise}{\addtocounter{exercise}{1} \noindent{\bf{Exercise \theexercise.}}}{\vspace{.5cm}}

\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}


\textwidth 6.5in
\textheight 9in
\oddsidemargin 0in
\evensidemargin 0in
\headsep -0.5in

\setlength{\parskip}{0.25cm}

\pagenumbering{gobble}

\begin{document}


\noindent{\Large{\textsc{Number Theory \hfill Assignment $1.2$  \\ Fall 2022 \hfill Due February 7}}}

\large

\vspace{1cm}

\begin{exercise}
Let $n \in \N$ and let $a,b \in \Z$.  Prove that $a$ and $b$ leave the same remainder when divided by $n$ if and only if $n | a-b$.
\end{exercise}

\begin{exercise}
Given $(a,b),(c,d) \in \Z \times \N$, define $(a,b) \sim (c,d)$ if and only if $ad=bc$.  One can show (and you should check) that $\sim$ is an equivalence relation on $\Z \times \N$.  An equivalence class under $\sim$ is called a {\em fraction}, and we let $\frac{a}{b}$ denote the fraction containing $(a,b)$.  Then, by definition,
\[
\Q = \left\{  \frac{a}{b} \,\bigg| \, (a,b) \in \Z \times \N \right\}
\]
is the set of all fractions (is this starting to sound familiar?).  Show that the map $\Z \to \Q$ defined by $n \mapsto \frac{n}{1}$ is injective.  
\end{exercise}

Strictly speaking, an integer {\em is not} a rational number.  However, Exercise 3 shows that there is a bijection between $\Z$ and the set 
\[
\Z_{\Q} = \left\{ \frac{n}{1} \, \bigg| \, n \in \Z \right\}.
\]
We will call a fraction in $\Z_{\Q}$ a {\em rational integer}.  

%Once addition and multiplication are defined in $\Q$ (which turns the set of fractions into a {\em field}), one can show that the injection of Exercise 3 also respects the operations in $\Z$ and $\Z_{\Q}$.  It therefore provides an {\em isomorphism} between $\Z$ and $\Z_{\Q}$.  So, arithmetically speaking, $\Z$ and $\Z_{\Q}$ are ``the same,'' and there's no harm in simply pretending $\Z$ is a subset of $\Q$.  And we usually will.  That being said, since $\Q$ and its binary operations are built using $\Z$ and its binary operations, any arithmetic statement in $\Q$ can be translated into an equivalent statement in $\Z$, and vice versa.  So one must be {\em extremely} cautious when proving statements about integers by using fractions instead, since this can very easily lead to circular reasoning, as we have seen.  

\begin{exercise}
Let $a \in \Z$ and let $b \in \N$.  
\begin{itemize}

\item[\bf a.]  Identifying $a$ and $b$ with their images in $\Z_{\Q}$, show that the equation $a = b \cdot \frac{a}{b}$ holds.

\item[\bf b.]  Show that $b|a$ if and only if $\frac{a}{b} \in \Z_{\Q}$.

\item[\bf c.]  Show that when $b|a$, $\frac{a}{b}$ is (the rational integer corresponding to) the divisor of $a$ complementary to $b$.  This is handy, since it provides (meaningful) notation for the complementary divisor that doesn't introduce a third variable.  

\end{itemize}
\end{exercise}

\begin{exercise}
For any real number $x$, let $\lfloor x \rfloor$ denote the greatest integer not exceeding $x$, which is the unique integer satisfying the inequality
\[
\lfloor x \rfloor \le x < \lfloor x \rfloor + 1.
\]
Let $a \in \Z$ and let $b \in \N$, and use the division algorithm to write $a = bq + r$ with $q , r \in \Z$ and $0 \le r < b$.  Prove that $q = \lfloor \frac{a}{b} \rfloor$ and derive a similar expression for $r$.  Explain how you can use this to compute $q$ and $r$ using a (very simple) hand held calculator.
\end{exercise}

\begin{exercise}
Let $a,b \in \N$.  Prove that the natural numbers $\frac{a}{(a,b)}$ and $\frac{b}{(a,b)}$ are relatively prime.  
\end{exercise}

\end{document}