I have lines of equations that run over the boundary of the PDF, I would like them to fit in the PDF. However, this is what happens instead: 
I have the code:
\documentclass[11pt,fleqn]{article}
\setlength {\topmargin} {-.15in}
\setlength {\textheight} {8.6in}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\renewcommand{\labelenumii}{\theenumii.}
\newcommand{\mname}[1]{\mbox{\sf #1}}
\newcommand{\pnote}[1]{{\langle \text{#1} \rangle}}
\begin{document}
\medskip
\noindent
\subsection*{Required Problems}
\begin{enumerate}
\item \textbf{[10 points]} Prove by weak induction
that \[\sum^{n}_{i=0}i^2 = \frac{n(n+1)(2n +1)}{6}\] for all $n
\in \mathbb{N}$.
\bigskip
\begin{proof}
Let $P\,n \equiv \sum^{n}_{i=0}i^2 = \frac{n(n+1)(2n +1)}{6}$. Proving $P\,n$
for all $n \in \mathbb{N}$ by weak induction.
\emph{Base case}: $n = 0$.
\begin{align*}
P\,0 & \equiv \sum_{i=0}^{0} {i}^2 = \frac{0(0+1)(2*0 +1)}{6} &
\pnote{definition of $P$}\\
& \equiv 0^2 = \frac{0(0+1)(2*0 +1)}{6} & \pnote{definition of $\sum_{i=m}^{n} f\,i$}\\
& \equiv 0 = \frac{0(1)(1)}{6} & \pnote{arithmetic}\\
& \equiv 0 = 0 & \pnote{arithmetic}
\end{align*}
\emph{Induction step}: Assuming $P\,n$. Proving $P\,(n + 1)$.
\begin{flalign*}
P\,(n+1) & \equiv \sum_{i=0}^{n + 1} {i}^2 = \frac{(n+1)(n+2)(2(n+1) +1)}{6} & \pnote{definition of $P$}\\
& \equiv {(n+1)}^2 + \sum_{i=0}^{n} {i}^2 = \frac{(n+1)(n+2)(2(n+1) +1)}{6} & \pnote{definition of $\sum_{i=m}^{n} f\,i$}\\
& \equiv {(n^2+2n+1)} + \sum_{i=0}^{n} {i}^2 =
\frac{(n^2+3n+2)(2n+3)}{6} & \pnote{arithmetic}\\
& \equiv {(n^2+2n+1)} + \sum_{i=0}^{n} {i}^2 =
\frac{(2n^3+9n^2+13n+6)}{6} & \pnote{arithmetic}\\
& \equiv {(n^2+2n+1)} + \frac{n(n+1)(2n +1)}{6} =
\frac{(2n^3+9n^2+13n+6)}{6} & \pnote{induction hypothesis}\\
& \equiv \frac{(6n^2+12n+6)}{6} + \frac{(n^2+n)(2n +1)}{6} =
\frac{(2n^3+9n^2+13n+6)}{6} & \pnote{arithmetic}\\
& \equiv \frac{(6n^2+12n+6+2n^3+n^2+2n^2+n)}{6} =
\frac{(2n^3+9n^2+13n+6)}{6} & \pnote{arithmetic}\\
& \equiv \frac{(2n^3+9n^2+13n+6)}{6} =
\frac{(2n^3+9n^2+13n+6)}{6} & \pnote{arithmetic}\\
\end{flalign*}
\end{proof}
\end{enumerate}
\end{document}
Please realize that I am a complete beginner to LaTeX.


\documentclassand ends with\end{document}? – Jan 15 '18 at 03:10\documentclassline, load all relevant packages, and thus make the code compilable, see here. – Jan 15 '18 at 03:19\usepackage{geometry}\geometry{height=8.6in,top=0.85in}. – cfr Jan 15 '18 at 03:44\sfis a few decades obsolete. Use\sffamilyor\textsf{}. – cfr Jan 15 '18 at 03:47