\documentclass[12pt,a4paper]{amsart}
%%%%%%%%%%% Here is where you tell LaTeX to use packages. Each
%%%%%%%%%%% package gives you access to different commands and
%%%%%%%%%%% functionality. Most of them are unnecessary for the
%%%%%%%%%%% mathematics in this document.

%%%%%%%%%%% If you hadn't figured out, the % symbol automatically
%%%%%%%%%%% nulls out all subsequent characters on that line. So
%%%%%%%%%%% it's used for commenting code.
\usepackage{hyperref}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{framed}
\usepackage{multicol}
\usepackage[OT2,T1]{fontenc}
\usepackage{graphicx}
\usepackage[all]{xy}
\usepackage{color}
\usepackage{mathrsfs}
\usepackage{mathtools}

%%%%%%%%%%% Determining margins and spacing.
\setlength\topmargin{-0.3in}
\addtolength{\oddsidemargin}{-.625in}
	\addtolength{\evensidemargin}{-.625in}
	\addtolength{\textwidth}{1.25in}
\setlength\footskip{1in}

%%%%%%%%%%% I think this command enables `sections'
\numberwithin{equation}{section}

%%%%%%%%%%% This command allows you to label things as `theorem',
%%%%%%%%%%% `conjecture', etc.
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{question}{Question}[theorem]
\newtheorem{example}{Example}[theorem]


\usepackage[utf8]{inputenc}
\title{Math 220 Class 1: A simple proof}
\begin{document}
\maketitle
This document is meant to serve two purposes. First, it includes the short proof I presented in class today (January 4). Second, it serves as a template file for you to learn some basic LaTeX typesetting. I have tried to include a variety of LaTeX commands.
\section{A theorem about divisibility}
Here's a stronger statement than the one I proved in class.
%%%% In TeX, any mathematical typing goes in $ signs
\begin{proposition}
Let $n$ be an odd integer. Then $n^2-1$ is a multiple of 8.
\end{proposition}
%%%% You can use \vskip to create vertical space in your document.
%%%% There are probably slicker, less hands-on ways to do this, but
%%%% I personally like the level of manual control it gives me over
%%%% the appearance of my document, so I stick with it. \hskip does
%%%% the same thing with horizontal space.
\vskip 0.2in
{\bf Note:} A priori, it is not even clear why $n^2-1$ should be divisible by $4$. So the above fact is quite surprising!
\vskip 0.2in
\begin{proof}
The set of odd integers can be described as
%%%% Double $ signs centers the equation and puts it on its own line
%%%% \text allows you to put normal text into an equation
%%%% For commands such as \text, \mathbb, etc you need to use {}
%%%% to specify what to apply the command to. So to create ordinary
%%%% symbols { and }, you use the commands \{ and \}.
$$\{\text{Odd integers}\} = \{2k+1| k\in\mathbb{Z}\}$$
Therefore, there is some integer $k$ such that $n=2k+1$. So one can write $n^2-1$ as

%%%% This is how you make an aligned sequence of expressions, useful
%%%% for showing a computation. The format of this command with the
%%%% &'s and \\'s is one used for many array-like commands, such as
%%%% matrices, diagrams, tables, and so on.
\begin{equation}
\begin{aligned}
n^2-1 &= (2k+1)^2-1\\
 &= 4k^2+4k+1-1\\
 &= 4k(k+1)
\end{aligned}
\end{equation}

Because $k$ and $k+1$ are consecutive integers, one of them is even, and therefore is divisible by 2. Therefore, $4k(k+1)$ is divisible by 8, as desired.
\end{proof}

Here is an alternate proof. I have written the proof more concisely, and moved the very rigorous step to a footnote.

\begin{proof}
$n^2-1$ can be factored as
$$n^2-1=(n-1)(n+1)$$
Since $n$ is odd, $(n-1)$ and $(n+1)$ must each be even. Moreover, since they are \emph{consecutive} even numbers, one of them is a multiple of $4$.\footnote{This can be seen by letting $n-1=2k$ and $n+1=2k+2$. Then if $k$ is even, $n-1$ is a multiple of $4$, while if $k$ is odd, $n+1$ is a multiple of $4$.} Therefore, $(n-1)(n+1)$ is a multiple of $2 \cdot 4=8$.
\end{proof}

\section{Is $\sqrt{2} \in \mathbb{Q}$?}
%%%% Try the following commands in mathmode: \sqrt{n}, \frac{a}{b},
%%%% 5^{2/3}, m_{21}, \in, \subset, \subseteq, \cup, \cap,
%%%% \overline{A}, \times, \ldots, \cdots, \vdots, \implies
%%%% \iff, \rightarrow , \leftarrow, \qed
One of the other mysterious questions I posed in class today was the following.
\begin{question}
Can $\sqrt{2}$ be expressed in the form $\frac{a}{b}$, where $a, b \in \mathbb{Z}$? That is, is $\sqrt{2}$ rational?
\end{question}
The answer, as it turns out, is \underline{no}. Apparently this was a big deal to some Greek mathematicians, who had the implicit assumption that all the numbers and quantities they normally would encounter would be rational numbers. But $\sqrt{2}$ appears as the hypotenuse of a right triangle with both legs of length 1. The proof is below, but the reasoning is a bit more advanced. Proceed at your own peril!
\begin{proof}
We will argue by contradiction. That is, we will assume that $\sqrt{2}$ can be written in the form $\frac{a}{b}$ for some integers $a$ and $b$, and then show that we can reach an impossible conclusion, thereby invalidating this initial assumption.
\vskip 0.2in
Suppose, for a contradiction, that $\sqrt{2}=\frac{a}{b}$ for some integers $a$ and $b$. Without loss of generality, we may assume that this fraction is \emph{reduced} - that $a$ and $b$ have no common factors. This is true because any fraction can be written in reduced form. Then,
$$\sqrt{2}=\frac{a}{b} \implies 2=\left(\frac{a}{b}\right)^2=\frac{a^2}{b^2}$$
$$\implies 2b^2=a^2$$
The left side of this equation is even, and therefore, $a$ is even. Write $a=2x$ for some integer $x$.
$$2b^2=(2x^2)=4x^2$$
$$b^2=2x^2$$
The right side of this equation is even, and therefore, $b$ is even. This means that $a$ and $b$ share a common factor of $2$. But we assumed that $a$ and $b$ have no common factors! So we have reached a contradiction.
\vskip 0.2in
Therefore, our assumption that such a fraction $\frac{a}{b}$ existed, was incorrect. Therefore, $\sqrt{2}$ is irrational.
\end{proof}

\end{document}