The following code works fine
\begin{theorem}[Euler] Blah
\end{theorem}
But whenever I try to use square brackets in the description I get an error.
\begin{theorem}[The set $[0, 1]$ is compact] Blah
\end{theorem}
Can anybody tell me how to avoid the error, please?

...{$[0, 1]$}...? – Werner Jul 13 '14 at 15:53[]within optional argument [] brackets must be surrounded by{}pair. – Jul 13 '14 at 16:13\documentclass{...}and ending with\end{document}. – Jul 13 '14 at 16:21