# reference in theorem environment

I am using theorem environment and want to put reference near the lemma, however, instead of [18] I am getting (18), how I can fix it?

\documentclass{article}
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\newtheorem{lemma}{Lemma}%
\AtEndEnvironment{theorem}{\null\hfill\qedsymbol}%
\begin{document}
\begin{lemma}[18]
This is an important theorem.
\end{lemma}
\end{document}

• Welcome! I'd like to remark that \null\hfill\qedsymbol is not the right way for adding a tombstone at the end of a theorem statement. – egreg Feb 11 at 11:34

The default for \thmhead's plain style is to set its argument inside (parentheses). Below is an updated version of \thmhead that sets the note using [brackets] instead.

\documentclass{article}

\usepackage{amsthm}

\newtheorem{lemma}{Lemma}%