% Theorem styles
%----------------------------------------------------------------
\newtheoremstyle{plain}%style name
  {\medskipamount}%space before
  {\smallskipamount}%space after
  {\normalfont}%font used
  {0pt}%indentation
  {\bfseries}%modifier theorem head
  {.}%punctuation between theorem head and body
  { }%space after punctuation
  {\thmname{#1}\thmnumber{ #2}{\normalfont\thmnote{ (#3)}}}%theorem specifier

\newtheoremstyle{slanted}%style name
  {\medskipamount}%space before
  {\smallskipamount}%space after
  {\slshape}%font used
  {0pt}%indentation
  {\bfseries}%modifier theorem head
  {.}%punctuation between theorem head and body
  { }%space after punctuation
  {\thmname{#1}\thmnumber{ #2}{\normalfont\thmnote{ (#3)}}}%theorem specifier
  
\renewcommand{\qedsymbol}{\ensuremath{\blacksquare}}
%----------------------------------------------------------------

% Both non-starred and starred versions
%----------------------------------------------------------------
\theoremstyle{plain}
\newboththeorems{problem}{Problem}
\newboththeorems{question}[problem]{Question}
\newboththeorems{exercise}[problem]{Exercise}

\theoremstyle{slanted}
\newboththeorems{theorem}{Theorem}[problem]
\newboththeorems{lemma}[theorem]{Lemma}
\newboththeorems{proposition}[theorem]{Proposition}
\newboththeorems{corollary}[theorem]{Corollary}
\newboththeorems{afirmation}[theorem]{Afirmation}
\newboththeorems{fact}[theorem]{Fact}
\newboththeorems{claim}[theorem]{Claim}
\newboththeorems{conjecture}[theorem]{Conjecture}
\newboththeorems{observation}[theorem]{Observation}
\newboththeorems{remark}[theorem]{Remark}
\newboththeorems{definition}[theorem]{Definition}
\newboththeorems{notation}[theorem]{Notation}
\newboththeorems{example}[theorem]{Example}
%----------------------------------------------------------------

% Only starred versions
%----------------------------------------------------------------
\newtheorem*{note}{Note}
\newtheorem*{curiosity}{Curiosity}
%----------------------------------------------------------------

% Proof environment customizations
%----------------------------------------------------------------
\newenvironment{proofsketch}[1][Proof (sketch)]{%
\begingroup\renewcommand{\qedsymbol}{\ensuremath{\Box}}
\begin{proof}[#1]}%
{\end{proof}\endgroup}

\newenvironment{handwaveproof}[1][Proof]{%
\begin{proofsketch}[#1]}%
{\end{proofsketch}}

\newenvironment{solution}{%
\begingroup\renewcommand{\qedsymbol}{\ensuremath{\triangleleft}}
\begin{proof}[Solution]}%
{\end{proof}\endgroup}

\newenvironment{answer}{%
\begingroup\renewcommand{\qedsymbol}{\ensuremath{\triangleleft}}
\begin{proof}[Answer]}%
{\end{proof}\endgroup}

\newenvironment{proofcases}[1][label*={\emph{Case~\arabic*}}, ref={case~\arabic*}, wide]{%
\begingroup\def\case{\item}
\begin{enumerate}[#1]}%
{\end{enumerate}\medskip\endgroup}
%----------------------------------------------------------------

%% Local Variables:
%% mode: latex
%% tab-width: 2
%% auto-fill-function: nil
%% End:
