I am using thmtools and amsthm to create custom theorem environments with custom qed symbols, like so:
\declaretheoremstyle[
spacebelow=2\topsep,
spaceabove=2\topsep,
headfont=\normalfont\bfseries,
bodyfont=\normalfont,
postheadspace=\newline,
qed=${\lrcorner}$,
headpunct={},
notebraces={[}{]}
]{breakup}
Normally these behave fine, for example
but I start to have problems if the text in my environment ends with either an enumerate or some math display content:

As you can see, an extra line is being inserted before the qed symbol is being printed. I've tried searching for a solution, but haven't managed to find a question that deals with this exact problem.
\qedherebefore\end{enumerate}or\end{equation*}– egreg Sep 10 '15 at 19:59ntheorempackage purports to be able to do it, but I don't like it for several reasons. – egreg Sep 10 '15 at 20:32\qedhere) works for the enumerate problem, it doesn't work for display math. – Tim Sep 10 '15 at 21:17$$in LaTeX. See Why is\[ … \]preferable to$$?. This is one of the reasons, by the way. – egreg Sep 10 '15 at 21:23