I have created a tcolorbox environment to write proofs.
Here is my code:
\usepackage{tcolorbox}
\tcbuselibrary{most}
\newtcolorbox{proof}{
fonttitle=\bfseries,
enhanced,
top=0mm,
boxrule=0pt,frame empty,
borderline west={4pt}{0pt}{blue},
coltitle=blue,
colback=white,
sharp corners,
title=Proof
}
\begin{proof}
Let's show that girls are Evil.
\begin{adjustwidth}{5mm}{0mm}
Girls require time and money
\begin{equation}
girls = time \times money
\end{equation}
Time is money
\begin{equation}
time = money
\end{equation}
So girls are money squared:
\begin{equation}
girls = money^2
\end{equation}
Money is the root of all evil
\begin{equation}
money = \sqrt{evil}
\end{equation}
So, girls are evil:
\begin{equation}
girls = \left(\sqrt{evil}\right)^2 = evil
\end{equation}
\end{adjustwidth}
We have shown that girls are Evil.
\end{proof}
% From https://www.onlinemathlearning.com/funny-math-proofs.html
Now, I would like that a blue square is automatically added at the end of the proof (at the very end of the last line) like here. I do not know how to specify this in the proof environment definition.


tcolorboxv4.42, sec. 17.4 Using other theorem environments with tcolorbox. – muzimuzhi Z Dec 25 '20 at 10:57after upper={\qed}option to\newtcolorboxwith the\usepackage{amsthm}package will do what you want. I would also suggest you not use the nameproofas your envuronment name. Also, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that sets up the problem including the\documentclassand the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Dec 25 '20 at 10:58\text… – Someone Dec 25 '20 at 16:32