# How to put an image on the right side of a proof?

I tried but I don't know how to put an image beside a proof like this

Edit: Please don't worry about the mathematics and the shape of the figure. My question is; How can I put a "proof"(\begin{proof}) and a figure side by side. You may use this one

• Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – darthbith Nov 10 '15 at 18:00
• \marginpar{...\captionof{figure}{...}} in conjunction with the package caption. – Henri Menke Nov 10 '15 at 19:17
• Did you try to use wrapfigure? – Anton Petrunin Nov 10 '15 at 20:37
• Or minipages with \captionof if it shouldn't go in the margin but take space from the body text. – cfr Nov 11 '15 at 2:44
• @AntonPetrunin proof is probably defined as a list which means you cannot use wrapfigure anywhere near it, let alone alongside it. – cfr Nov 11 '15 at 2:47

I have found this solution (without claiming to be complete):

\documentclass{article}

\usepackage[demo]{graphicx}
\usepackage{wrapfig}

\usepackage{amsthm}
\newtheorem{theorem}{Theorem}

\makeatletter
\renewenvironment{proof}[3][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\begin{wrapfigure}{r}{.5\textwidth}
\centering
#2
\caption{#3}
\end{wrapfigure}%
\ignorespaces
}{%
\popQED\@endpefalse
\par
\vspace*{\the\parsep}
}
\makeatother

\begin{document}

\begin{theorem}
This is a theorem. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit.
\end{theorem}

\begin{proof}{\includegraphics{}}{This is caption.\label{fig:1}}
This is a proof. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit. Lorem ipsum dolor sit amet, consecteruer adipiscing elit.