% This is a demonstration of writing proofs in general, and writing them with LaTeX in
% particular.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\newtheorem{thm}{Theorem}

\title{An Introductory Proof}
\author{Doug Baldwin}
\date{Spring 2021}



\begin{document}

\maketitle

This document shows how to write theorems and proofs, The specific example is a theorem about rational numbers:

\begin{thm}
If $q$ is a rational number and $n$ is an integer, then $q+n$ is rational.
\end{thm}

\begin{proof}
We assume that $q$ is a rational number and $n$ is an integer, and will show that $q+n$ must be rational. Since $q$ is rational, we can write $q = \frac{a}{b}$ where $a$ and $b$ are integers and $b \ne 0$. We also observe that $n = \frac{nb}{b}$. Therefore
\begin{equation*}
q + n = \frac{a + bn}{b}
\end{equation*}
Since integers are closed under addition and multiplication, $a + bn$ is an integer. Furthermore, $b$ is a non-zero integer, and so $\frac{a+bn}{b}$ is a rational number. We have now shown that if $q$ is a rational number and $n$ is an integer, that $q+n$ is rational.
\end{proof}

\end{document}