%=====================================================================================================================================
% Package akkmathproof by Igor Akkerman (c) 2000, 2001, 2002, 2003, 2004, 2005
% Package providing utilities for typesetting mathematical proofs.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License (latest version).
%
% The latest version of this license can be found at
%     http://www.latex-project.org/lppl.txt
%
% This file may only be distributed together with the full 'AkkTeX' bundle.
%=====================================================================================================================================
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{akkmathproof}[2005/04/30 1.2.0 by Igor Akkerman (c) 2000, 2001, 2002, 2003, 2004, 2005 Package providing utilities for typesetting mathematical proofs]
%=====================================================================================================================================

\RequirePackage{ifthen}

\makeatletter

%------------------------------------------------------------------------------
% Universal proof utilities
%------------------------------------------------------------------------------
\newcommand \akk@prooflabel {Proof}

\newcommand \prooflabel[1] {\renewcommand \akk@prooflabel {#1}}

\newcommand \proofendsymbol {\ensuremath{\Box}}

\newboolean{proofended}

\newcommand \proofend {%
    \ifbool{mmode}{%
        \tag*{\proofendsymbol}%
    }{%
        \hspace*{\fill}\proofendsymbol%
    }%
    \global\proofendedtrue%
}

\newenvironment{proof}{%
    \unskip\par%
    \textit{\textbf{\akk@prooflabel:}}\\%
    \begin{proof*}%
}{%
    \end{proof*}%
    \par%
}

\newenvironment{Proof}{%
    \unskip\par%
    \textit{\textbf{\akk@prooflabel:}}%
    \begin{proof*}%
}{%
    \end{proof*}%
    \par%
}

\newenvironment{proof*}{%
    \setboolean{proofended}{false}%
}{
    \ifboolfalse{proofended}{%
        \proofend%
    }%
}

\prooflabel{Beweis}

\newenvironment {beweis} {%
    \begin{proof}%
}{%
    \end{proof}%
}

\newenvironment {Beweis} {%
    \begin{Proof}%
}{%
    \end{Proof}%
}

%------------------------------------------------------------------------------
% Induction environments
%------------------------------------------------------------------------------
\newcommand \vind[2]{\textit{Beweis mittels vollst�ndiger Induktion �ber $#1$:}\\}
\newcommand \vindende {\indende{vollst�ndige}}

\newcommand \sind {\textit{Beweis durch strukturelle Induktion:\\}}
\newcommand \sindende {\indende{strukturelle}}

\newcommand{\indanf}[2]
{Induktionsanfang ($#1=#2$):}

\newcommand{\indanfs}
{Induktionsanfang:}

\newcommand{\indvor}
{Induktionsvoraussetzung:}

\newcommand{\indschritt}
{Induktionsschritt:}

\newcommand{\indende}[1]
{Nach dem Prinzip der #1n Induktion folgt die Behauptung.\proofend}

%------------------------------------------------------------------------------
% equivalence and set equality proofs
%------------------------------------------------------------------------------
\newcommand \hinsymb       {\glqq$\mathbf{\Rightarrow}$\grqq}
\newcommand \ruecksymb     {\glqq$\mathbf{\Leftarrow}$\grqq}
\newcommand \sethinsymb    {\glqq$\mathbf{\subseteq}$\grqq}
\newcommand \setruecksymb  {\glqq$\mathbf{\supseteq}$\grqq}
\newcommand \ssethinsymb   {\glqq$\mathbf{\subset}$\grqq}
\newcommand \ssetruecksymb {\glqq$\mathbf{\supset}$\grqq}
\newcommand \hin           {\hinsymb \\*[2pt]}
\newcommand \rueck         {\ruecksymb \\*[2pt]}
\newcommand \sethin        {\sethinsymb \\*[2pt]}
\newcommand \setrueck      {\setruecksymb \\*[2pt]}
\newcommand \ssethin       {\ssethinsymb \\*[2pt]}
\newcommand \ssetrueck     {\ssetruecksymb \\*[2pt]}

\newenvironment{equivproof}{%
	\begin{proof}%
		\begin{equivproof**}%
}{%
		\proofend%
		\end{equivproof**}%
	\end{proof}%
}

\newenvironment{equivproof*}{%
	\begin{proof*}%
		\begin{equivproof**}%
}{%
		\proofend%
		\end{equivproof**}%
	\end{proof*}%
}

\newenvironment{equivproof**}{%
	\renewcommand \hin   {\item[\hinsymb]}%
	\renewcommand \rueck {\item[\ruecksymb]}%
	\begin{itemize}%
}{%
	\end{itemize}%
}

\newenvironment{setequalproof}{%
	\begin{proof}%
		\begin{setequalproof**}%
}{%
		\proofend%
		\end{setequalproof**}%
	\end{proof}%
}

\newenvironment{setequalproof*}{%
	\begin{proof*}%
		\begin{setequalproof**}%
}{%
		\proofend%
		\end{setequalproof**}%
	\end{proof*}%
}

\newenvironment{setequalproof**}{%
	\renewcommand \sethin   {\item[\sethinsymb]}%
	\renewcommand \setrueck {\item[\setruecksymb]}%
	\begin{itemize}%
}{%
	\end{itemize}%
}

% infer
\newcommand \dinfer[2] {\text{$\displaystyle\infer{#1}{#2}$}}

\makeatother
