\usepackage{libertine}
\usepackage{listings}
\usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{bussproofs}
\usepackage{tikz}
\usepackage{tikz-qtree,tikz-qtree-compat,circuitikz}
\usepackage{translations}
\usepackage{float}
\usepackage{csquotes}
\usepackage{stmaryrd}
\usepackage{cancel}
\usepackage{array}
\usepackage{xfrac}

\usetikzlibrary{positioning}

\newcolumntype{L}{>{$}l<{$}}
\newcolumntype{C}{>{$}c<{$}}

\DeclareTranslation{English}{float-algorithm}{Algorithm}
\DeclareTranslation{German}{float-algorithm}{Algorithmus}

\floatstyle{ruled}
\newfloat{algorithm}{tbp}{lop}
\floatname{algorithm}{\GetTranslation{float-algorithm}}

\lstset{
frame=tb,
numbers=left,
numberstyle=\tiny,
breaklines=true,
postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}},
extendedchars=true,
inputencoding=utf8,
keywordstyle=
}

\DeclareMathOperator{\Hom}{Hom}
%\DeclareMathOperator{\P}{\frak{P}}
%\DeclareMathOperator{\exp}{exp}
%\DeclareMathOperator{\ln}{ln}
\providecommand{\N}{\ensuremath{\mathbb{N}}}
\providecommand{\lequiv}{\ensuremath{\Leftrightarrow}}
\providecommand{\limplies}{\ensuremath{\Rightarrow}}
\providecommand{\seq}{\ensuremath{\Longrightarrow}}

\DeclareTranslation{English}{thm-definition}{Definition}
\DeclareTranslation{German}{thm-definition}{Definition}
\DeclareTranslation{English}{thm-theorem}{Theorem}
\DeclareTranslation{German}{thm-theorem}{Satz}
\DeclareTranslation{English}{thm-example}{Example}
\DeclareTranslation{German}{thm-example}{Beispiel}
\DeclareTranslation{English}{thm-remark}{Remark}
\DeclareTranslation{German}{thm-remark}{Anmerkung}
\DeclareTranslation{English}{thm-lemma}{Lemma}
\DeclareTranslation{German}{thm-lemma}{Lemma}
\DeclareTranslation{English}{thm-proofsketch}{Proof Sketch}
\DeclareTranslation{German}{thm-proofsketch}{Beweisskizze}
\DeclareTranslation{English}{thm-show}{To show}
\DeclareTranslation{German}{thm-show}{Zu Zeigen}

\makeatletter
\newtheoremstyle{definition.indented}
  {3pt}% space before
  {3pt}% space after
  {\addtolength{\@totalleftmargin}{2.5em}
   \addtolength{\linewidth}{-2.5em}
   \parshape 1 2.5em \linewidth}% body font
  {}% indent
  {\bfseries}% header font
  {.}% punctuation
  {.5em}% after theorem header
  {}% header specification (empty for default)
\newtheoremstyle{plain.indented}
  {3pt}% space before
  {3pt}% space after
  {\addtolength{\@totalleftmargin}{2.5em}
   \addtolength{\linewidth}{-2.5em}
   \parshape 1 2.5em \linewidth
   \itshape}% body font
  {}% indent
  {\bfseries}% header font
  {.}% punctuation
  {.5em}% after theorem header
  {}% header specification (empty for default)
\newtheoremstyle{remark.indented}
  {3pt}% space before
  {3pt}% space after
  {\addtolength{\@totalleftmargin}{2.5em}
   \addtolength{\linewidth}{-2.5em}
   \parshape 1 2.5em \linewidth}% body font
  {}% indent
  {\itshape}% header font
  {.}% punctuation
  {.5em}% after theorem header
  {}% header specification (empty for default)
\makeatother

\makeatletter
\@ifclassloaded{article}{\theoremstyle{definition.indented}}{\theoremstyle{definition}}
\newtheorem{defn}{\GetTranslation{thm-definition}}
\newtheorem*{defn*}{\GetTranslation{thm-definition}}

\@ifclassloaded{article}{\theoremstyle{plain.indented}}{\theoremstyle{plain}}
\newtheorem{thm}{\GetTranslation{thm-theorem}}
\newtheorem*{thm*}{\GetTranslation{thm-theorem}}
\newtheorem{lem}[thm]{\GetTranslation{thm-lemma}}
\newtheorem*{lem*}{\GetTranslation{thm-lemma}}

\@ifclassloaded{article}{\theoremstyle{remark.indented}}{\theoremstyle{remark}}
\newtheorem{rem}{\GetTranslation{thm-remark}}
\newtheorem*{rem*}{\GetTranslation{thm-remark}}
\newtheorem{eg}[rem]{\GetTranslation{thm-example}}
\newtheorem*{eg*}{\GetTranslation{thm-example}}
\newtheorem*{sketch}{\GetTranslation{thm-proofsketch}}
\newtheorem*{tshow}{\GetTranslation{thm-show}}
\makeatother

\newcommand\restr[2]{{% we make the whole thing an ordinary symbol
  \left.\kern-\nulldelimiterspace % automatically resize the bar with \right
  #1 % the function
  \vphantom{\big|} % pretend it's a little taller at normal size
  \right|_{#2} % this is the delimiter
  }}

\makeatletter
\@ifclassloaded{article}{
  \usepackage{abstract}
  \AtBeginDocument{\setlength{\absparindent}{0em}}
}{}
\makeatother
