Under amsthm
, if the first content in a proof
environment consists of a displayed equation, or an align
or similar environment, the linebreak after the “Proof.” heading is (to my taste) rather undesirable.
In the case of a single equation, I know how to forestall this linebreak (albeit rather kludgily). How can I avoid this linebreak in the case of an align
or similar environment?
(This is a partial duplicate of Starting a theorem or a proof with an equation and vertical spacing, which also asks “Is it bad style to start a proof this way?”; the only answers there are comments are comment saying “Yes, it is bad style”, and not addressing the technical aspect.)
MWE:
\documentclass{article}
\usepackage{amssymb,amsmath,amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
For all $x \in \mathbb{R}$, it holds that $(x+1)(x-1) + 1 = x^2$.
\end{theorem}
Single equation, with initial linebreak:
%
\begin{proof}
\[ (x+1)(x-1) + 1 = (x^2 - x + x + 1) + 1 = x^2 \qedhere \]
\end{proof}
Single equation, without initial linebreak:
%
\begin{proof}
\hfill $ (x+1)(x-1) + 1 = (x^2 - x + x + 1) + 1 = x^2 $ \hfill
\end{proof}
Multiple equation, with initial linebreak:
%
\begin{proof}
\begin{align*}
(x+1)(x-1) + 1 &= x(x-1) + 1(x-1) + 1 \\
&= (x^2 - x) + (x - 1) + 1) \\
&= x^2 + (- x + x) + (-1 + 1) \\
&= x^2 && \qedhere
\end{align*}
\end{proof}
\end{document}
;-)