[Tex/LaTex] How to reduce vertical spacing between proof environment and enumerate environment

#enumerateenumitemspacing

How can I reduce the space between the proof environment head and the enumerate
environment in the minimal example below?

Note: This is most likely not a duplicate question. Some while ago, I posted this problem here
(How to suppress vertical space between theorem heads and enumitem environments?). A fix concerning nested enumerate environments was then provided under
(Nested enumerate (enumitem) interferes with suppressing vertical space after theorem heads.). Finally, there was a follow-up flaw, corrected under
Weird vertical spacing problem with (adjusted) enumerate
to which I refer to here. This worked for me for quite some time, but suddenly (I have no idea why), the space is too large again. I tried to adjust the +0.3em, but that doesn't change any vertical space.

\documentclass{scrartcl}

\usepackage[american]{babel}
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage{amsthm}

\newif\ifstarttheorem

% proofs
% see https://tex.stackexchange.com/questions/66739/how-to-suppress-vertical-space-between-proof-environment-heads-and-itemize-envir/makeatletter
\makeatletter% q.e.d. adjustment (posted by ???)
\renewenvironment{proof}[1][Proof]{\par
  \pushQED{\qed}%
  \normalfont\topsep2\p@\@plus2\p@\relax
  \trivlist
\item[\hskip\labelsep
  \sffamily\bfseries #1]\gdef\mycurrenvir{proof}\global\starttheoremtrue\mbox{}\hfill\\*\ignorespaces
}{%
 \gdef\mycurrenvir{\relax}
  \popQED\endtrivlist\@endpefalse
}
\makeatother

% suppress vertical spacing (for itemize) when newtheorems start with an environment
% see https://tex.stackexchange.com/questions/122018/weird-vertical-spacing-problem-with-adjusted-enumerate
\makeatletter
\preto\enumerate{%
  \if@inlabel
    \ifstarttheorem
      \mbox{}\par\nobreak\vskip\glueexpr-\parskip-\baselineskip+0.3em\relax\hrule\@height\z@
    \fi
  \fi
  \global\starttheoremfalse
 \def\tempa{proof}%
 \ifx\tempa\mycurrenvir
    \ifstarttheorem
      \mbox{}\par\nobreak\vskip\glueexpr-\parskip-\baselineskip+0.3em\relax\hrule\@height\z@
    \fi
 \fi
 \global\starttheoremfalse
}
\preto\endenumerate{\global\starttheoremfalse}
\makeatother

\begin{document}
Some text
\begin{proof}
  \begin{enumerate}
  \item Proof ...
  \end{enumerate}
\end{proof}
\end{document}

enter image description here

Update:

The second part of Karl's answer works, surprisingly without the \appto-part. However, I realized that there is a spurious (horizontal) space/indent introduced. Minimizing this example, I ended up with the following:

\documentclass{scrartcl}

\usepackage[american]{babel}
\usepackage{amsthm}
\newif\ifstarttheorem

% proofs
% see https://tex.stackexchange.com/questions/173158/how-to-reduce-vertical-spacing-between-proof-environment-and-enumerate-environme
\makeatletter
\renewenvironment{proof}[1][Proof]{\par
  \pushQED{\qed}%
  \normalfont\topsep2\p@\@plus2\p@\relax
  \trivlist\item[\hskip\labelsep\sffamily\bfseries #1]\ignorespaces\global\starttheoremtrue\mbox{}\vskip0pt\noindent
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother


\begin{document}
\noindent Proof with an optional argument:
\begin{proof}[Alternative]
  Why is there a space before "Why"?
\end{proof}
\end{document}

Best Answer

You can simply redefine proof

in this way

\makeatletter% q.e.d. adjustment (posted by ???)
\renewenvironment{proof}[1][Proof]{\par
  \pushQED{\qed}%
  \normalfont\topsep2\p@\@plus2\p@\relax
  \trivlist
\item[\hskip\labelsep
  \sffamily\bfseries #1]\ignorespaces\mbox{}\vskip0pt\noindent
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother

and use topsep=0 when calling enumerate.

MWE

\documentclass{scrartcl}

\usepackage[american]{babel}
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage{amsthm}


% proofs
% see http://tex.stackexchange.com/questions/66739/how-to-suppress-vertical-space-between-proof-environment-heads-and-itemize-envir/makeatletter
\makeatletter% q.e.d. adjustment (posted by ???)
\renewenvironment{proof}[1][Proof]{\par
  \pushQED{\qed}%
  \normalfont\topsep2\p@\@plus2\p@\relax
  \trivlist
\item[\hskip\labelsep
  \sffamily\bfseries #1]\ignorespaces\mbox{}\vskip0pt\noindent
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother

% suppress vertical spacing (for itemize) when newtheorems start with an environment
% see http://tex.stackexchange.com/questions/122018/weird-vertical-spacing-problem-with-adjusted-enumerate

\begin{document}
Some text
\begin{proof}
  \begin{enumerate}[topsep=0pt]
  \item Proof ...
  \end{enumerate}
\end{proof}

Some text
\begin{proof}
Some text
\end{proof}
\end{document} 

Output

enter image description here


EDIT

A solution without enumitem

\documentclass{scrartcl}

\usepackage[american]{babel}
\usepackage{etoolbox}
\usepackage{amsthm}

\newif\ifstarttheorem

% proofs
% see http://tex.stackexchange.com/questions/66739/how-to-suppress-vertical-space-between-proof-environment-heads-and-itemize-envir/makeatletter
\makeatletter% q.e.d. adjustment (posted by ???)
\renewenvironment{proof}[1][Proof]{\par
  \pushQED{\qed}%
  \normalfont\topsep2\p@\@plus2\p@\relax
  \trivlist
\item[\hskip\labelsep
  \sffamily\bfseries #1]\ignorespaces\global\starttheoremtrue\mbox{}\vskip0pt\noindent
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother

% suppress vertical spacing (for itemize) when newtheorems start with an environment
% see http://tex.stackexchange.com/questions/122018/weird-vertical-spacing-problem-with-adjusted-enumerate
\makeatletter
\appto\enumerate{%
  \ifstarttheorem
    \vspace{-.5\baselineskip}
  \fi
  \global\starttheoremfalse
}
\preto\endenumerate{\global\starttheoremfalse}
\makeatother

\begin{document}
Some text
\begin{proof}
  \begin{enumerate}
  \item Proof ...
  \end{enumerate}
\end{proof}

Some text
\begin{proof}
Some text
\end{proof}
\end{document} 

Output:

enter image description here

Related Question