# “Missing $inserted” error; can't figure out what is causing it Here is the code, getting an error involving a missing $ but I'm certain it's all correct. My guess is I am missing some subtle thing. Here is the specific error message:

Missing $inserted. <inserted text>$ l.70 \textbf{Theorem. (Cancellation)}\\


And the input:

\documentclass{article}
\usepackage{amssymb, amsmath, amstext, amscd, verbatim}

\newenvironment{parts}{\vspace{1ex}\begin{enumerate}\renewcommand{\itemsep}{1ex}

\renewcommand{\labelenumi}{(\alph{enumi})}}{\end{enumerate}}

\DeclareMathOperator*{\inter}{int}
\DeclareMathOperator*{\clos}{cl}
\DeclareMathOperator*{\bound}{bd}

%\everymath{\displaystyle}

\begin{document}

\title{Notes}
\author{}
\date{}
\maketitle

\tableofcontents
\pagebreak

\noindent
\textbf{Definition.} A \emph{group} $G$ is a pair $(S,*)$. Let $S \neq \varnothing$ be a set and $*$ a binary operation satisfying
\begin{parts}
\item $*$ is associative
\item $\exists e \in S$ such that $e*a=a*e=a \forall a \in S*$
\item $\forall a \in S, \exists b \in S$ such that $a*b=b*a=e$.
\end{parts}

\noindent
\textbf{Definition.} A group $G = (S,*)$ is \emph{abelian} if $*$ is commutative.\\

\noindent
\textbf{Examples.}\\
(1) $(\mathbb{Z},+)$ with $e=0, b=-a$ is an abelian group.
(2) $(\mathbb{Z},\cdot)$ is \textbf{not} a group.
(3) $(\mathbb{R}\setminus \{0\}, \cdot)$ with $e=1, b=a^{-1}$ is an abelian group.
(4) Let $n \in \mathbb{P}$ be a positive integer, $T = \{1,2,\ldots,n\}$, and $S =$ set of permutations of $T =$ set of bijections on $T$.
S is function composition, hence associative.
(5) $S_n$ is the symmetric group on $n$ letters.
Let $n = 3$.
$\left( \begin{matrix} 1 & 2 & 3 \\ 3 & 1 & 2 \end{matrix} \right) * \left( \begin{matrix} 1 & 2 & 3 \\ 3 & 2 & 1 \end{matrix} \right) = \left( \begin{matrix} 1 & 2 & 3 \\ 2 & 1 & 3 \end{matrix} \right) \left( \begin{matrix} 1 & 2 & 3 \\ 3 & 2 & 1\end{matrix} \right) * \left( \begin{matrix} 1 & 2 & 3 \\ 3 & 1 & 2 \end{matrix} \right) = \left( \begin{matrix} 1 & 2 & 3 \\ 1 & 3 & 2 \end{matrix} \right)$.
\textbf{Note.} $\left| S_n \right| = n!$
(6) $n \in \mathbb{P},\quad M_n(\mathbb{Q}),\quad S =$ the set of non-singular $n \times n$ matrices,\quad $*=$ matrix multiplication.\\
Have the \emph{general linear group} $GL(n,\mathbb{Q})$ and
$e = \left( \begin{matrix} 1 & 0 & \ldots & \ldots 0\\ 0 & \ddots & 0 & \ldots & 0\\ 0 & \ldots & \ldots & \ldots & 1$
$GL(n,\mathbb{Z}_p), p$ is a prime. $\mathbb{Z}_p = \left\{ [0],[1],\ldots,[p-1]\right\}$.
\textbf{Theorem. (Cancellation)}\\
If $G = (S,*)$ is a group and $a*b = a*c$, then $b=c$ (and $b*a = c*a \Rightarrow b=c$).\\
\textbf{Proof.}\\
Let $d \in S$ satisfy $d*a = a*d = e$ ($e$ is the identity element). Then $d*(a*b) = d*(a*c)$.
By associativity, we get $(d*a)*b = (d*a)*c \Rightarrow b = e*b = e*c = c$.\\

\noindent
\textbf{Corollary.}\\
If $a,b \in G$ and $a*b = a$, then $b=e$.\\
\textbf{Proof.} $a*b = a = a*e$. So $b=e$.

\noindent
\textbf{Corollary.}\\
Let $a,b,c \in G$. If $a*b=e=a*c$, then $b=c$.\\

\noindent
Therefore,
\begin{parts}
\item identity element is unique
\item for each $a \in G$, the inverse of $a$ is unique.
\end{parts}

\textbf{Notation.}\\
For multiplication, we write $a\cdot b$ and the inverse of $a$ as $a^{-1}$. Also, we have that $e=1$.\\
For addition in abelian groups, we write $a+b$ and the inverse of $a$ as $-a$. Also, we have that $e=0$.\\

\end{document}

-

## migrated from stackoverflow.comJan 6 '12 at 6:10

This question came from our site for professional and enthusiast programmers.

It's a shot in the dark, but your \begin{matrix} environment has three & chars on the first row and four & chars on the next two. Incidentally, there is a TeX - LaTeX which might be a better fit. –  sarnold Jan 6 '12 at 4:56
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Jan 6 '12 at 6:16

You're missing the closing \end{matrix} \right) for the \left( \begin{matrix} at line 65.

Also the & separator between the last and second last element of the first row of that matrix seems to be missing.

You'd do well to use more whitespaces in your tex sources to make these kind of problems easier to spot, for example:

Have the \emph{general linear group} $GL(n,\mathbb{Q})$ and
$e = \left( \begin{matrix} 1 & 0 & \ldots & \ldots 0\\ 0 & \ddots & 0 & \ldots & 0\\ 0 & \ldots & \ldots & \ldots & 1$


Format it like this:

Have the \emph{general linear group} $GL(n,\mathbb{Q})$ and
$e = \left( \begin{matrix} 1 & 0 & \ldots & \ldots & 0 \\ 0 & \ddots & 0 & \ldots & 0 \\ 0 & \ldots & \ldots & \ldots & 1 \end{matrix} \right)$

-
Thank you, I can't upvote you as my reputation is too low haha. :) –  user1133626 Jan 6 '12 at 4:55
Haha, nice catch. I saw the missing & but missed the end of the matrix completely. Hats off. :) –  sarnold Jan 6 '12 at 4:58
@user1133626: But you can accept the answer: meta.stackexchange.com/questions/5234/… –  mu is too short Jan 6 '12 at 5:06
Welcome to TeX.sx! Your answer was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or edit your answer. –  Werner Jan 6 '12 at 6:23