% You can use this document as a template for your homeworks and projects. Just copy and paste it into a new document and delete all the stuff you don't need.
% the percent symbol is for comments. It does not get typeset.
\documentclass{article} %this needs to be at the top of each document
% margins, size, formatting
\oddsidemargin=.25in
\evensidemargin=.25in
\topmargin=-.5in
\textwidth=6in
\textheight=9in
\pagestyle{empty}
% packages for fancy fonts, symbols, theoremm/proof environments, etc - go ahead and use this in your template, whether you need it or not!
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\begin{document}
% header =================================================================
% PLEASE FILL IN YOUR OWN NAME HERE AND THE PROJECT OR HOMEWORK SECTION
% THE CORRECT SECTION OF THE BOOK, AND YOUR NAME HERE
{\large \bf Math 475 Project 1 Section 1.3 \hfill Sally Student}
\vspace{.2in} %This command leaves blank vertical space of the amount described. I usually use inches. This is useful if you need to leave space to draw a diagram. It does not work well at the end of a page.
% problem ================================================================
\begin{enumerate} %This command will start listing things in numerical order.
\item %Starting with number 1.
This sample document provides a template for writing a \LaTeX document suitable for homework assignments and projects in Math 475. First be sure to put your name and the assignment above. The first few ``problems'' % Notice the quotes here
will explain how the document works. Then there will be some ``problems'' that illustrate various notations and formatting environments. Compare what is in the typeset version of this document to the file {\tt latexsample.tex}. Note in particular that anything typed after a percent sign in the text file is treated as a comment and is ignored by the compiler. Comments in the text file refer both to \LaTeX and to hints about writing good solutions and proofs.
\begin{enumerate} %Nested enumerate! This will start listing things with a., b., c., I've never nested more than about 3 enumerates, so I'm not sure what counting symbols they use after that. I just looked it up. Latex will do up to 4 nested lists.
\item To list things in numerical order, use the ``enumerate" command. This can be nested as shown.
\item To list things that are not in numerical order, you can use the ``itemize" command.
\begin{itemize}
\item If you don't put anything after the item, it will look like this with a bullet.
\end{itemize}
\begin{description}
\item[Problem 1.3.1] If you want to put something else, other than a number, letter or bullet, use the description command, and put what you want in square brackets.
\item[Problem 1.3.2] This is what you should use if you need numbers that aren't in numerical order, such as homework or project exercises.
\end{description}
\item Don't forget to end each enumerate and itemize loop.
\item If you don't, you will get an error when you compile.
\end{enumerate}
\item
The very basics of \LaTeX (compare the typeset document and the text file):\\ % Double slash followed by a carriage return skips a line.
Extra spaces in the text file do not appear in the typeset document.
Except for a double carriage-return, that makes a new line.
Single
carriage
returns
don't
do
anything.
\item
Mathematical expressions are typed between dollar signs like this: $y=x^2+1$. To make a centered equation on its own line, use double dollar signs, like this:
$$y=x^2+1.$$
Double dollar signs also make things larger, like integral signs and fractions. Inline text with only one dollar sign give you this: $\int_0^1 x^2$ But double dollar signs give you this. $$\int_0^1 x^2$$ Fractions can be very hard to read inline. $\frac{1}{2}x^2 - \frac{3}{4}x + \frac{1}{8}$. To get the same effect as the double dollar signs, but without the centering, use the ``displaystyle" command.\\
$\displaystyle{\frac{1}{2}x^2 - \frac{3}{4}x + \frac{1}{8}}$
\item
\begin{enumerate}
\item Many \LaTeX commands and math symbols start with a backslash symbol. For example, $\sin x$ and $\{x \in \mathbb{R} \mid x \geq 0\}$. Notice that the set-notation parentheses need to have backslashes before them (while regular parentheses do not). This is because in \LaTeX, those squiggly parentheses often have other uses. In order to print a backslash, you need to use the {\em command} backslash, rather than the symbol!
\item If you need to put something in italics you do it {\em like this}. Or maybe you need to have something in {\bf boldface}. Or maybe {\bf \em both}.
\item Don't forget to end each of your environments. In other words, don't
forget your $\backslash$end\{enumerate\}, or you will get a compiling error. Also make sure to end dollar sign environments and parentheses.
\end{enumerate}
\item
Here is some random notation you might need:
\vspace{.5\baselineskip}
% this "vspace" above just adds some vertical space. note that
% we can't add vertical space with carriage returns, so we have to
% add it this way instead. here "baselineskip" is the space of a line,
% so we're skipping by half that.
$x_2$,
$x_{25}$, % note parentheses needed to get both digits in subscript
$x^2$,
$x^{25}$, % note parentheses needed to get both digits in exponent
$\pm 4$,
$x \not = 17$, % you can put "not" in front of lots of different operators
$x > 5$,
$x < 5$,
$x \geq 5$,
$x \leq 5$,
$\{ 1, 2, 3 \}$, % note curly brackets need a backslash or they are invisible
$\{ x \mid \sqrt{x} > 2 \}$,
$\infty$.
\vspace{.5\baselineskip}
$A \subset B$,
$A \subseteq B$,
$A \not \subset B$,
$A \not \subseteq B$,
$A \setminus B$,
$A^{\rm c}$, % "rm" changes the font to "roman", i.e. non-math, font
$A \cap B$,
$A \cup B$,
$x \in A$,
$x \not \in A$,
$|A|$,
$\mathcal{P}(A)$,
$\emptyset$.
\vspace{.5\baselineskip}
$\frac{5}{1+x}$,
$\displaystyle\frac{5}{1+x}$, % anything in $$ is automatically displaystyle
$\bigcap_{i=1}^n S_i$,
$\displaystyle\bigcap_{i=1}^n S_i$,
$\bigcup_{i=1}^n S_i$,
$\displaystyle\bigcup_{i=1}^n S_i$,
$\sum_{k=1}^{10} a_k$,
$\displaystyle\sum_{k=1}^{10} a_k$,
$\prod_{k=1}^{10} a_k$,
$\displaystyle\prod_{k=1}^{10} a_k$.
\vspace{.5\baselineskip}
% "displaystyle" is the default when using double dollar signs.
% so you only need to use "displaystyle" in the rare case where you
% want one of these oversized notations right in the middle of a line
% of text, which is not usually what you want. for centered equations,
% everything will automatically be in "displaystyle".
$\mathbb{R}$, % use this ONLY to denote the real numbers
$\mathbb{Q}$, % rational numbers
$\mathbb{Z}$, % integers
$\mathbb{N}$, % natural numbers
$\clubsuit$,
$\diamondsuit$,
$\heartsuit$,
$\spadesuit$,
$\rightarrow$,
$\leftarrow$,
$\leftrightarrow$,
$\longrightarrow$,
$\longleftarrow$,
$\longleftrightarrow$,
$\Rightarrow$, % the "implies" arrow
$\Leftarrow$,
$\Leftrightarrow$, % the "if and only if" arrow
$\Longrightarrow$, % longer "implies" arrow
$\Longleftarrow$,
$\Longleftrightarrow$, % longer "if and only if" arrow
$\mapsto$,
$\longmapsto$.
\vspace{.5\baselineskip}
$\mathcal{P}$, % "mathcal" is a fancy font that can be applied to any letter.
$\mathcal{S}$,
$\mathcal{F}$,
$\forall$,
$\exists$,
$\lor$, % think "logical or"
$\land$, % think "logical and"
$\neg$, % \lnot also works. use this for logical negation (\sim looks funny)
$\sim$, % use this for equivalence relations, it's made to be a binary operation
$\approx$,
$\equiv$,
$\times$, % for cartesian products
$\ast$,
$\star$,
$\mid$, % use this for "such that"
$a | b$, % use this for "divides"
$|x|$, % use this for absolute value
$\|x\|$,
$\lceil x \rceil$,
$\lfloor x \rfloor$,
$\{x \in \mathbb{Z} \mid x \mbox{ is prime} \}$. % note use of "mbox"
% the "mbox" is needed so that we can have non-math type inside of the
% math environment. without the "mbox" the words would be in math/italics,
% and all smushed together with no spaces between words. notice also
% the space before the word "is".
\vspace{.5\baselineskip}
$\gcd$, % in math mode, just "gcd" would be in italics, but "\gcd" is not
${\rm lcm}$, % there isn't a command for "lcm" in tex so we just roman it
$n \choose k$,
$n+1 \choose k$, % no brackets needed, the n+1 is all assumed to be on top
$a = {n+1 \choose k}$, % we need brackets or else "a=" would be in the choose
$\prec$, % think "precedes"
$\preceq$,
$\succ$, % think "succeeds"
$\succeq$,
$f \colon [0,\infty) \rightarrow \mathbb{R}$,
$f \circ g$ % composition
\{, % these next few symbols mean particular things to latex
\}, % so to get them to appear in your document you precede them with backslash
\$, % notice that these are NOT in math mode
\%,
\&,
\_,
\#.
\vspace{.5\baselineskip}
$\bigtriangleup ABC$, $\circ$, %so to make degrees use
$90^{\circ}$, % note the parentheses needed
$\overline{AB}$,
$\overrightarrow{AB}$,
$\overleftrightarrow{AB}$
\item You write in tables by hand by using the vspace command to leave space. But in case you are interested in making a table, this is how to do it (Truth table from Math 245):
\begin{center}
\begin{tabular}{|c|c||c|c|c|c|}
\hline
$P$ & $Q$ & $P \land Q$ & $\neg(P \land Q)$ & $\neg Q$ & $\neg(P \land Q) \land \neg Q$ \\
\hline
T & T & T & F & F & F \\
T & F & F & T & T & T \\
F & T & F & T & F & F \\
F & F & F & T & T & T \\
\hline
\end{tabular}
\end{center}
Since the truth-values for $\neg Q$ and $\neg(P \land Q) \land \neg Q$ are the same for all possible truth-values of $P$ and $Q$, the two statements are logicaly equivalent.
\item
In this problem will will prove a theorem two different ways, to illustrate two different formats for writing proofs with steps and reasons clearly written out.
\begin{enumerate}
\item Prove that $n^3+n$ is even for every integer $n$.
\begin{proof} % notice there is a built-in proof environment - use it!
Suppose $n$ is any integer. We will examine two cases:
\vspace{.5\baselineskip}
If $n$ is even, then $n=2k$ for some $k \in \mathbb{Z}$, and therefore:
%
\begin{align*} % the "%" on the line above just prevents added linespace
n^3+n
&= (2k)^3 + (2k) % "&=" gives an aligned equals. the "&" is like "tab"
&\mbox{(since $n=2k$)} \\ % this is how you might provide a reason
&= 8k^3 + 2k \\
&= 2(4k^3+k). % notice we are still using punctuation, even here!
&\mbox{(factor out a $2$)}
\end{align*}
% the "*" in the align environment just makes it so the equations are not
% numbered. in this example the reasons/justifications given for the
% steps aren't really mathematically needed - they are pretty obvious - but
% i put them here so you could see how to include them when necessary.
Since $4k^3+k \in \mathbb{Z}$, this means $n^3+n$ is divisible by $2$ and therefore is even.
% notice that i am explaining the conclusion here
\vspace{.5\baselineskip}
On the other hand, suppose $n$ is odd. Then $n=2k+1$ for some $k \in \mathbb{Z}$, and thus:
%
\begin{align*}
n^3+n
&= (2k+1)^3 + (2k+1)
&\mbox{(since $n=2k+1$)} \\
&= (8k^3+12k^2+6k+1) + (2k+1)
&\mbox{(multiply out)} \\
&= 8k^3+12k^2+8k+2 \\
&= 2(4k^3+6k^2+4k+1).
&\mbox{(factor out a $2$)}
\end{align*}
Once again, $n^3+n$ is a multiple of $2$ and therefore is even.
\end{proof} % ending the proof environment automatically adds the "box"
\item
Prove that $n^3+n$ is even for every integer $n$.
\begin{proof}
Note that $n^3+n = n(n^2+1)$. It suffices to show that for any $n \in \mathbb{Z}$, either $n$ is even or $n^2+1$ is even. (Since then the product of $n$ and $n^2+1$ will have to be even.) For any integer $n$ we have:
% notice that at the beginning of the proof i am very clearly laying out
% the strategy of the proof. this makes the proof much easier to read.
% think about what kind of proof YOU would like to read. you don't want
% to be thinking "what are they doing here???" all the time. so don't be
% afraid to lay out the game plan for the proof or explain why you're about
% to do the calculation or argument that you're about to do.
%
\begin{align*}
n \mbox{ is even}
&\Longleftrightarrow n^2 \mbox{ is even}
&\mbox{(Theorem 2.1.9)} \\
&\Longleftrightarrow n^2+1 \mbox{ is odd.}
\end{align*}
% we didn't HAVE to use the format above, but it can make proofs
% easier to read. notice the reason given at the important step.
Therefore if $n$ is even, $n^2+1$ is odd; and if $n$ is odd, then $n^2+1$ is even. (The second implication is the contrapositive of the backwards part of the ``if-and-only-if'' statement: If $n^2+1$ is odd, then $n$ is even.) In any case, one of $n$ or $n^2+1$ must be even, and therefore $n^3+n=n(n^2+1)$ must be even.
% even though i said what would be sufficient at the start of the proof,
% i thought it made it clearer to give a good wrap-up here.
\end{proof}
\end{enumerate} %nested
\item A {\bf GREAT} reference for \LaTeX is {\em \LaTeX User's Guide and Reference Manual} by Leslie Lamport. There are many, many other things you can do with \LaTeX including diagrams and importing pictures. I am not an expert on this, but play around with it, and you can create some amazing things. To import a picture into your document, use the ``includegraphics" command. Make sure that the file you want to import is in the same directory as the document that you are compiling. Here is a diagram from Geometry Explorer.\\
%\includegraphics[height=2in, width=2in]{myimage.jpg}
%In order to get the image to show up, I need to use PDFLaTeX and the Acrobat Viewer. You will need to close the Adobe file before you compile it again, otherwise you will get an error that says "I can't write on file `file.pdf'. Just close the file and compile again. To save an image from Geometry explorer, type ``Save As Image" and then click the .jpg box. Save as myimage.jpg. Note the sizing. You can make the image any size that you want, or leave the size option off, but the image may be large.
\end{enumerate} %the original enuerate
Thanks again to Laura Taalman for assistance with this document.
\end{document} % every document must end with this.