\documentclass[12pt,a4paper]{article}   

\usepackage[english]{babel}

\usepackage{amssymb,amsmath,amsfonts,amsthm}
\usepackage{a4wide}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\setlength{\parskip}{0.3pc}
\setlength{\parindent}{0pc}
\setlength{\textwidth}{16cm}
\pagestyle{empty}

% Copied and modified from amsthm.sty:
% No space between kind of theorem (lemma, definition, ...)
% and number
\makeatletter
\def\thmhead@plain#1#2#3{%
  \thmname{#1}\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}%
  \thmnote{ {\the\thm@notefont(#3)}}}
\let\thmhead\thmhead@plain
\makeatother

\theoremstyle{definition}
\newtheorem{exercise}{}
\newtheorem{texercise}{T}

\renewcommand{\theexercise}{\arabic{blatt}.\arabic{exercise}}
\renewcommand{\thetexercise}{\arabic{blatt}.\arabic{texercise}}
%\newcommand\nr[1]{\vspace{0.1ex}\noindent\hspace*{9mm}\llap{\rm(#1)}}
%\newcommand\snr[1]{\ifvmode\vspace{0.1ex}\noindent\hspace*{15mm}\else
%\hspace*{6mm}\fi\llap{\rm(#1)}}

%\newcommand\set[2]{\bigl\{#1;\:#2\bigr\}}
%\newcommand\sset[2]{\{#1;\:#2\}}
\newcommand\from{\colon}
%%\newcommand\from{{:}\,\,}
%\newcommand\from{:}
\newcommand\+{\hspace{0.05em}}
%\newcommand\skpr{(\cdot\+|\+\cdot)}
%%\newcommand\ind{\hbox{\rm 1\hskip -4.5pt 1}}
%\newcommand\ind{\mathbf1}
%\newcommand\aint{\rlap{\;\rule{1ex}{0.7pt}}\int}

\newlength{\sqrtdown}
\newcommand\mysqrt[3]{%
\setlength\sqrtdown{-\ifcase#2 0\or.35\or.9\or1.6\or2.3\fi ex}
\addtolength\sqrtdown{-#3}
\sqrt{\rule[\sqrtdown]{0ex}{\ifcase#2 1\or2.2\or2.6\or4\or5.4\fi ex}\smash{#1}}}

\renewcommand{\labelenumi}{(\alph{enumi})}
\renewcommand{\labelenumii}{(\roman{enumii})}


%\expandafter\def\csname selectlanguage \endcsname#1{%
%  %\edef\bbl@pop@language{%
%  %  \noexpand\bbl@set@language{\languagename}}%
%  %\aftergroup\bbl@pop@language
%  \bbl@set@language{#1}}
%\def\env@cases{%
%  \let\@ifnextchar\new@ifnextchar
%  \left\lbrace
%  \def\arraystretch{1.1}%
%  \array{@{\,}l@{\quad}l@{}}%
%}

\newcommand{\german}{\selectlanguage{german}\frenchspacing}
\newcommand{\english}{\selectlanguage{english}\frenchspacing}

%
% Heiners math macros
%

% from amsldoc, page 17.
\providecommand{\abs}[1]{\lvert#1\rvert}
\providecommand{\norm}[1]{\lVert#1\rVert}
% von mir ausgedacht :). Oder Fall (1) mit \bigg? Vgl. amsldoc, PDF-Seite 20
\providecommand{\Abs}[1]{
  \mathchoice{\Bigl\lvert#1\Bigr\rvert}%
             {\bigl\lvert#1\bigr\rvert}%
             {\lvert#1\rvert}%
             {\lvert#1\rvert}}

% This one with optional argument for indices. Extra { } doesn't work
% since the contents are potentially bigger.
\providecommand{\Norm}[2][]{
  \mathchoice{\Bigl\lVert#2\Bigr\rVert_{#1}}%
             {\bigl\lVert#2\bigr\rVert_{#1}}%
             {\lVert#2\rVert_{#1}}%
             {\lVert#2\rVert_{#1}}}

% Hand selection. (Experimental)
\providecommand{\bigabs}[1]{\bigl\lvert#1\bigr\rvert}
\providecommand{\Bigabs}[1]{\Bigl\lvert#1\Bigr\rvert}
\providecommand{\biggabs}[1]{\biggl\lvert#1\biggr\rvert}
\providecommand{\Biggabs}[1]{\Biggl\lvert#1\Biggr\rvert}

\providecommand{\bignorm}[1]{\bigl\lVert#1\bigr\rVert}
\providecommand{\Bignorm}[1]{\Bigl\lVert#1\Bigr\rVert}
\providecommand{\biggnorm}[1]{\biggl\lVert#1\biggr\rVert}
\providecommand{\Biggnorm}[1]{\Biggl\lVert#1\Biggr\rVert}


% The same for sets
\providecommand{\set}[1]{\{#1\}}
\providecommand{\Set}[1]{
  \mathchoice{\bigl\{#1\bigr\}}%
             {\{#1\}}%
             {\{#1\}}%
             {\{#1\}}}
\providecommand{\bigset}[1]{\bigl\{#1\bigr\}}
\providecommand{\Bigset}[1]{\Bigl\{#1\Bigr\}}
\providecommand{\biggset}[1]{\biggl\{#1\biggr\}}
\providecommand{\Biggset}[1]{\Biggl\{#1\Biggr\}}

% The same for parentheses and brackets
\providecommand{\parens}[1]{(#1)}
%\providecommand{\Parens}[1]{
%  \mathchoice{\bigl(#1\bigr)}%
%             {(#1)}%
%             {(#1)}%
%             {(#1)}}
\providecommand{\bigparens}[1]{\bigl(#1\bigr)}
\providecommand{\Bigparens}[1]{\Bigl(#1\Bigr)}
\providecommand{\biggparens}[1]{\biggl(#1\biggr)}
\providecommand{\Biggparens}[1]{\Biggl(#1\Biggr)}
\let\Parens\bigparens

\providecommand{\brackets}[1]{[#1]}
%\providecommand{\Brackets}[1]{
%  \mathchoice{\bigl[#1\bigr]}%
%             {[#1]}%
%             {[#1]}%
%             {[#1]}}
\providecommand{\bigbrackets}[1]{\bigl[#1\bigr]}
\providecommand{\Bigbrackets}[1]{\Bigl[#1\Bigr]}
\providecommand{\biggbrackets}[1]{\biggl[#1\biggr]}
\providecommand{\Biggbrackets}[1]{\Biggl[#1\Biggr]}
\let\Brackets\bigbrackets

% Way easier to type (idea of Dr. H. Vogt)
\let\<\langle
\let\>\rangle

% Angular brackets pair
\providecommand{\apair}[2]{\<#1,#2\>}
\providecommand{\Apair}[2]{
  \mathchoice{\Bigl\<#1,#2\Bigr\>}%
             {\bigl\<#1,#2\bigr\>}%
             {\<#1,#2\>}%
             {\<#1,#2\>}}

\providecommand{\bigmid}{\bigm\vert}
\providecommand{\Bigmid}{\Bigm\vert}
\providecommand{\biggmid}{\biggm\vert}
\providecommand{\Biggmid}{\Biggm\vert}


\DeclareMathOperator{\lin}{lin}          % Lineare HÃ¼lle
\DeclareMathOperator{\sgn}{sgn}          % Signum
\DeclareMathOperator{\id}{id}            % IdentitÃ¤t
\DeclareMathOperator{\grad}{grad}        % Gradient
\DeclareMathOperator{\diam}{diam}        % Diameter
\DeclareMathOperator{\spt}{spt}          % Support
\DeclareMathOperator*{\esssup}{ess\,sup} % Wesentliches Supremum
\DeclareMathOperator{\dist}{dist}        % Distance
\DeclareMathOperator{\ran}{ran}

%\newcommand\essim{\operatorname{ess\,im}}
%\newcommand\tr{\operatorname{tr}}
%\renewcommand\div{\operatorname{div}}
%\newcommand\Arg{\operatorname{Arg}}
%\newcommand\Ln{\operatorname{Ln}}
%\newcommand\co{\operatorname{co}}

\newcommand{\1}{\textrm{1}} % Indikatorfunktion
\newcommand{\dotid}{\,\cdot\,}           % Hier-Einsetzen-IdentitÃ¤t

\let\textdef\textit
\newcommand{\where}[1]{
  \mathchoice{\qquad(#1)}%
             {\,\ (#1)}%     % Dr. Vogt version
             {\,(#1)}%       % Last two really shouldn't be used
             {\,(#1)}}
\newcommand{\bigwhere}[1]{
  \mathchoice{\qquad\bigl(#1\bigr)}%
             {\,\ \bigl(#1\bigr)}%     % Dr. Vogt version
             {\,(#1)}%       % Last two really shouldn't be used
             {\,(#1)}}


% A complement to \smash, \llap, and \rlap. TUGboat 22 (2001), 350--352.
% See http://math.arizona.edu/~aprl/publications/mathclap/
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
\def\mathllap{\mathpalette\mathllapinternal}
\def\mathrlap{\mathpalette\mathrlapinternal}
\def\mathclap{\mathpalette\mathclapinternal}
\def\mathllapinternal#1#2{%
           \llap{$\mathsurround=0pt#1{#2}$}}
\def\mathrlapinternal#1#2{%
           \rlap{$\mathsurround=0pt#1{#2}$}}
\def\mathclapinternal#1#2{%
           \clap{$\mathsurround=0pt#1{#2}$}}


% Abschluss, Inneres
\providecommand{\cl}[1]{\overline{#1}}
\DeclareMathOperator{\interior}{int}

% amsldoc, page 22 (PDF page 26)
\providecommand{\field}[1]{\mathbb{#1}}

% Normales \mathbb _scheint_ zu klein fÃ¼r die anderen Symbole
%\providecommand{\field}[1]{%
%  {\mathchoice{\mbox{\small$\mathbb{#1}$}}%
%              {\mbox{\small$\mathbb{#1}$}}%
%              {\mbox{\large$\scriptscriptstyle\mathbb{#1}$}}%
%              {\mbox{\footnotesize$\scriptscriptstyle\mathbb{#1}$}}}}

\providecommand{\N}{\field{N}}
\providecommand{\Z}{\field{Z}} % true fields following now :)
\providecommand{\Q}{\field{Q}}
\providecommand{\R}{\field{R}}
\providecommand{\C}{\field{C}}
\providecommand{\K}{\field{K}} % generic Field == KÃ¶rper

\DeclareMathOperator{\TextRe}{Re}
\DeclareMathOperator{\TextIm}{Im}
\renewcommand{\Re}{\TextRe}
\renewcommand{\Im}{\TextIm}

\newcommand{\A}{\mathcal{A}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\F}{\mathcal{F}}
\newcommand{\G}{\mathcal{G}}
\newcommand{\I}{\mathcal{I}}
\newcommand{\J}{\mathcal{J}}
\let\suppressedL\L
\renewcommand{\L}{\mathcal{L}}
\newcommand{\Zz}{\mathcal{Z}}
\newcommand{\M}{\mathcal{M}}
\newcommand{\Nn}{\mathcal{N}}
\newcommand{\Cee}{\mathcal{C}}
\newcommand{\eps}{\varepsilon}
\newcommand{\wto}{\rightharpoonup}
\newcommand{\rH}{\mathscr{H}}

\let\longHungarianUmlaut\H
\renewcommand{\H}{\mathcal{H}}

\newcommand{\Pot}{\mathfrak{P}}

\newcommand{\T}{\mathcal{T}}
%\let\sectionsymbol\S
%\DeclareInputText{167}{\sectionsymbol} % for latin1
%\renewcommand{\S}{\mathcal{S}}
%\newcommand{\U}{\mathcal{U}}

% "Such that" fÃ¼r Mengen
\providecommand{\st}{\colon}

% "d" fÃ¼r Integrale. Roman?
\newcommand{\upd}{\mathrm{d}}
\let\underdot\d
\renewcommand{\d}{\,\upd}
\newcommand{\dx}{\d x}
\newcommand{\dt}{\d t}
\newcommand{\ds}{\d s}
\newcommand{\dy}{\d y}
\newcommand{\dr}{\d r}
% Ghosts of departed quantities
\newcommand{\dbyd}[1]{\frac{\upd}{\upd{#1}}}

\newcommand{\fin}{\mathrm{fin}}
\newcommand{\loc}{\mathrm{loc}}

\newcommand{\textimplies}{\ensuremath{\,\Rightarrow\,}}

\newcommand{\sigmaAlg}{\sigma}

% Für Ana 1
\renewcommand{\c}{\mathrm{c}}

\let\oldrestriction\restriction
\renewcommand{\restriction}[1]{\,\bigr\rvert_{#1}}

\newcounter{blatt}

