SUNY Geneseo Department of Mathematics

Writing Proofs with LaTeX

Friday, February 1

Math 239 01
Spring 2019
Prof. Doug Baldwin

Return to Course Outline

Previous Lecture

Misc

Notice the extended date for grading problem set 1 (Monday now), due to class cancellations yesterday.

Questions?

LaTeX

Core Ideas

Workflow: LaTeX is a translator that turns text files (“source” files) containing prose and LaTeX commands into beautifully formatted PDF files.

User writes document which LaTeX processes into a PDF file

LaTeX source files consist of a “preamble” that describes what kind of document this is and broadly what it should look like, and a “body” that contains the text of the document interspersed with detailed formatting commands.

Most formatting is achieved by saying what something is, e.g., this is a theorem, this is a proof, etc., and letting LaTeX format it (e.g., insert labels, pick typefaces and sizes, etc.) consistent with the overall type of document. “Environments,” delimited by “begin” and “end,” are the main way to say what something is.

Occasionally you need to give LaTeX more detailed directions, for which there are “commands” not bracketed by begin/end.

Demonstration

Here’s what we ended up with in our example. It progressed from a minimal document with a class and one-sentence body, to one that showed how to do both in-text and displayed math, to the final version that explores theorems and proofs:

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

\newtheorem{theorem}{Crazy Conjecture}
\newtheorem{theorem2}{Sane Conjecture}

\begin{document}
This is a document.

According to Pythagoras, if $a$ and $b$ are the lengths  of the sides of a right triangle and $c$ is the length of its hypotenuse, then
\begin{equation*}
c^2 = a^2 + b^2
\end{equation*}

An important  theorem is the following:
\begin{theorem}
If $n$ is an even number, then $4n$ is also an even number.
\end{theorem}
\begin{proof}
We assume $n$ is an even number, and show that $4n$ is also an even number. Since $n$ is even, we can write it as $n = 2a$, where $a$ is an integer. Then
\begin{eqnarray*}
4n & = & 4(2a) \\
  & = & 2(4a)
\end{eqnarray*}
Since integers are closed under multiplication, we see that $4n$ is twice some integer, i.e., $4n$ is even. We have thus shown that if $n$ is an even number, then $4n$ is also an even number.
\end{proof}

\end{document}

And here’s the resulting PDF file.

To learn more, see the “Not so Short Introduction to LaTeX2e” or other online references and tutorials.

Next

Start a careful look at logic for proofs.

Read section 2.1 in the textbook.

Problem set on proofs and elementary logic. See handout for details.

Next Lecture