%
% avoid complaints by LaTeX about too little text on a page
%
\renewcommand{\textfraction}{0.0}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\topfraction}{0.9}
 
%
% re-defines the ``theorem'' environment: the body is set in \rm!
%
\def\@begintheorem#1#2{\rm \trivlist \item[\hskip \labelsep{\bf #1\ #2}]}
\def\@opargbegintheorem#1#2#3{\rm \trivlist
      \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]}
 
%
% defines some theorem-like environments
%
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{observation}{Observation}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{claim}{Claim}[section]
\newtheorem{fact}{Fact}[section]
\newtheorem{assumption}{Assumption}[section]
\newtheorem{conjecture}{Conjecture}[section]
\newtheorem{problem}{Problem}[section]
\newtheorem{algo}{Algorithm}[section]
 
 
%
% defines environments for proofs and proof sketches
%
\newenvironment{proof}[1]{\noindent \textit{Proof:} #1}
{\hfill $\Box$ \newline \smallskip}
\newenvironment{sketch}[1]{\noindent \textit{Sketch of Proof:} #1}
{\hfill $\Box$ \newline \smallskip}
 
%
% defines commands for proofs and proof sketches
%
\newcommand{\Proof}[1]{{\noindent {\it Proof.} {#1} 
        \hbox{$\quad \rlap{$\sqcap$}\sqcup$} \vspace{1ex}}} %$\Box$ \vspace{1ex}}}
\newcommand{\Sketch}[1]{{\noindent {\it Sketch of 
Proof.} {#1} \qed \vspace{1ex}}} %$\Box$ \vspace{1ex}}}
  
%
% environments for taking some text temporarily out of a document
%
\newcommand{\comment}[1]{{}}
\newcommand{\old}[1]{{}}
 
%
% and finally some handy abbreviations...
% 
\newcommand{\Fr}{Fig.~\ref}              % reference to a figure
\newcommand{\Ar}{Abb.~\ref}              % reference to a figure
\newcommand{\Tr}{Table~\ref}             % reference to a table
\newcommand{\C}[1]{\ensuremath{{\mathcal{#1}}}\xspace}
\newcommand{\F}[1]{\ensuremath{{\mathfrak{#1}}}\xspace}
\newcommand{\Bb}[1]{\ensuremath{{\mathbb{#1}}}\xspace}
\newcommand{\B}[1]{\ensuremath{{\mathbf{#1}}}\xspace}
\newcommand{\Vdot}[2]{\ensuremath{{\mathfrak{#1} \cdot \mathfrak{#2}}}\xspace}
\newcommand{\Vcross}[2]{\ensuremath{{\mathfrak{#1} \times \mathfrak{#2}}}\xspace}
\newcommand{\qed}{\vrule height6pt width4pt\medskip}
\newcommand{\NP}{\ensuremath{{\cal N}{\cal P}}\xspace}
\newcommand{\OPT}{\mbox{{\em OPT}}}
\newcommand{\APX}{\mbox{{\em APX}}}
\newcommand{\defeq}{\stackrel{\rm def}{=}}
\newcommand{\N}{\ensuremath{\mathbb{N}}\xspace}
\newcommand{\R}{\ensuremath{\mathbb{R}}\xspace}
 
 
% \punkt erzeugt eine 2-dim. Koordinatenangabe
\newcommand{\punkt}[2]{\ensuremath{{ \left(\begin{array}{c} 
#1 \\ 
#2 
\end{array}\right) }}}

% \matr erzeugt ein 2x2-Matrizenfeld
\newcommand{\matr}[4]{\ensuremath{{ \left(\begin{array}{cc} 
#1 & #2 \\
#3 & #4
\end{array} \right) }}}

\newcommand{\MatrTemplate}[3]{\ensuremath{{ \left(\begin{array}{#1} 
#2 \\
#3 
\end{array} \right) }}}

% \Punkt erzeugt eine 3-dim. Koordinatenangabe
\newcommand{\Punkt}[3]{\ensuremath{{ \left(\begin{array}{c} 
#1 \\ 
#2 \\ 
#3 \end{array}\right) }}}

% \Matr erzeugt ein 3x3-Matrizenfeld
\newcommand{\Matr}[9]{\ensuremath{{ \left(\begin{array}{ccc} 
#1 & #2 & #3 \\ 
#4 & #5 & #6 \\ 
#7 & #8 & #9 \end{array} \right) }}}

% \PunktV erzeugt eine 4-dim. Koordinatenangabe
\newcommand{\PunktV}[4]{\ensuremath{\left(\begin{array}{c}
#1\\ #2 \\ #3 \\ #4 \end{array} \right)}}

% \Vpunkt erzeugt einen n-dimensionalen Vektor:   a \\ b \\ c \\ ...
\newcommand{\Vpunkt}[1]{\ensuremath{\left(\begin{array}{c}#1\end{array}\right)}}

% \Vmatr erzeugt ein 4x4-Matrizenfeld aus 4 Zeilenvektoren:
% a11 & a12 & a13 & a14 \\ a21 & a22 ...
\newcommand{\Vmatr}[4]{\ensuremath{{ \left(\begin{array}{cccc} 
#1 \\ #2 \\ #3 \\ #4
\end{array} \right) }}}


\makeatletter
\usepackage{amsopn}
\DeclareMathOperator{\ld}{ld}
\DeclareMathOperator{\sgn}{sign}
%\DeclareMathOperator{\mod}{mod}
\DeclareMathOperator{\argmin}{argmin}
\DeclareMathOperator{\argmax}{argmax}
\DeclareMathOperator{\cov}{cov}
\makeatother

% Logical implication and NAND
\def\limplies{\models}
\newcommand\lnand{\uparrow}
% This is the invisible frac
\newcommand\ifrac{\genfrac{}{}{0pt}{}}
% The already defined implies and iff are too long
\def\implies{\Rightarrow}
\def\iff{\Leftrightarrow}

\newcommand{\forallq}[2]{\ensuremath{(\forall #1 \,\,\, #2)}}
\newcommand{\existsq}[2]{\ensuremath{(\exists #1 \,\,\, #2)}}
\newcommand{\existsuq}[2]{\ensuremath{(\exists! #1 \,\,\, #2)}}
\newcommand{\forallp}[2]{\ensuremath{\forall #1 \,\,\, #2}}
\newcommand{\existsp}[2]{\ensuremath{\exists #1 \,\,\, #2}}
\newcommand{\existsup}[2]{\ensuremath{\exists! #1 \,\,\, #2}}
\newcommand{\HoareP}[3]{\ensuremath{\{ #1 \,\} \,\,\, #2  \,\,\,\, \{ #3 \,\}}}
\newcommand{\HoareT}[3]{\ensuremath{[ #1 \,] \,\,\, #2  \,\,\,\, [ #3 \,]}}
