\documentclass[12pt]{article}
%New commands

\newcommand{\nat}{\mbox{${\mathbb N}$}}
\newcommand{\real}{\mbox{${\mathbb R}$}}
\newcommand{\integer}{\mbox{$\mathbb Z$}}
\newcommand{\rational}{\mbox{$\mathbb Q$}}

\newcommand{\power}[1]{{\cal P}(#1)}
\newcommand{\comp}[1]{#1^{\cal C}}

\newcommand{\forward}{\noindent $\Longrightarrow$}
\newcommand{\back}{\noindent $\Longleftarrow$}

\newenvironment{problem}[2]{\noindent {\bf Problem #1 in Chapter #2:}}
{\\
\medskip}

\newenvironment{theorem}[1]{\bigskip \noindent {\bf Theorem #1:}
\medskip}

\newenvironment{proof}{\noindent {\bf Proof:}}{\hfill
\rule{1mm}{3mm} \bigskip}

%Other important packages

\usepackage{graphicx}  %This one allows you to include graphics. Ask for details.
\usepackage{amssymb}   %This one includes some more symbols that you may want.

\begin{document}

\begin{center}
{\bf LaTeX Examples}
\end{center}
\bigskip

\noindent{\bf Special symbols} and how to make them:

\medskip

\begin{center}
\begin{tabular}{|l c|c | l|} \hline {\bf You write} & \hspace{.5in}
& {\bf \LaTeX} & {\bf Remark}
\\\hline
 $\backslash$nat  & & \nat& in or out of math mode\\
 \hline
 $\backslash$real  & & \real& in or out of math mode\\
 \hline
 $\backslash$integer  & & \integer& in or out of math mode\\
 \hline
 $\backslash$rational  & & \rational& in or out of math mode\\
 \hline
 $\backslash$comp$\{$A$\}$  & & $\comp{A}$& only in math mode\\
 \hline
 $\backslash$power$\{$A$\}$  & & $\power{A}$& only in math mode\\ \hline
 $\backslash$forward  & & \forward & not in math mode\\ \hline
 $\backslash$back  & & \back & not in math mode \\ \hline
\end{tabular}
\end{center}


\noindent{\bf Some more examples:}

\medskip

\begin{enumerate}
\item Let $A$ and $B$ be sets.  Then $A \cup B$ is the union of
the sets $A$ and $B$, $A \cap B$ is their intersection.  The set
$A \setminus B$ is the set of all elements that are in $A$ but not
in $B$.

\item If we want to talk about many sets at once, we introduce the
idea of an arbitrary indexing set.  Then we can talk about the
collection $\{ U_{\alpha} \}_{\alpha \in \Lambda}$.  Once we have
this notation, we can discuss unions and intersections of
arbitrary collections very easily.
$$ x \in \bigcap_{\alpha \in \Lambda} U_{\alpha} \mbox{ means that }
\forall \,\alpha \in \Lambda, x \in U_{\alpha}.$$
$$ x \in \bigcup_{\alpha \in \Lambda} U_{\alpha} \mbox{ means that }
\exists \,\alpha \in \Lambda \mbox{ such that } x \in
U_{\alpha}.$$

\item Suppose that $X$ and $U$ are sets with $X \subseteq U$. Then
$\comp{X}_{U} = \emptyset$ if and only if $X = U$.

\item We can also define piecewise-defined functions in the standard way:
$$f(x) = \left \{
\begin{array}{ll}
x^2 & \mbox{if } x < -2\\
-2x & \mbox{if } -2 \leq x < 1\\
-2 & \mbox{if } x \geq 1
\end{array}
\right .
$$

\item Here's the way to typeset a multi-line computation:
\begin{eqnarray*}
\frac{(ab)^{-x}}{a^{-x}+ b^{-x}} & = &
\frac{\frac{1}{(ab)^{x}}}{\frac{1}{a^{x}}+ \frac{1}{b^{x}}}\\
& = & \frac{\frac{1}{a^{x} b^{x}}}{\frac{1}{a^{x}}+ \frac{1}{b^{x}}}\\
        & = &\frac{1}{b^{x}+ a^{x}}.
\end{eqnarray*}

\end{enumerate}

\bigskip

\noindent Here's a theorem and its proof.

\begin{theorem}{2.4}
If $A \subseteq B$ and $B \cap C = \emptyset$, then $A \cap C = \emptyset$.
\end{theorem}

\begin{proof}
Suppose that $A \cap C \neq \emptyset$.  Then we know that there exists
$x \in A \cap C$.  That is, $x \in A$, and $x \in C$. We have two possible cases:

\begin{description}
\item[case i.] $x \in B$.  It follows that $x \in B \cap C$. So
$B \cap C \neq \emptyset$.
\item[case ii.] $x \not \in B$. Then $A$ cannot be a subset of $B$
since there is an element of $A$ that is not in $B$.
\end{description}
Thus either $A \not \subseteq B$ or $B \cap C \neq \emptyset$. The
theorem follows by contraposition.
\end{proof}

\noindent \underline{Problem and Theorem Environments:} You saw
above how to implement the Theorem environment. The problem
environment is almost the same. These environments are used to
state and reference the problem to be solved or the theorem to be
proved. The main difference you need to be aware of in calling
these is that the Theorem environment has {\em one} required input
and the Problem environment has {\em two}.  This is because
theorems require only a single reference (e.g. 3.4.12), whereas
problems require two: the problem number and the chapter number.
We say ``Theorem 3.4.12,'' whereas we say ``Problem 4 in Chapter
3.''

\bigskip

\noindent {\em Implementing the Problem Environment:} Notice the
two required arguments.  The first is the problem number and the
second is the chapter number.

\bigskip

\begin{problem}{1}{3}
Is there a distinction between $\emptyset$ and $\{ \emptyset \}$?
\end{problem}


\end{document}
