
\newcommand{\arrow}{{\:\longrightarrow\:}}
\newcommand{\restrict}[1]{{\left|_{{\phantom{|}\!\!}_{#1}}\right.}}
\newcommand{\cntrct}                % contraction with a vector field
{\hspace{2pt}\raisebox{1pt}{\text{$\lrcorner$}}\hspace{2pt}}


%\addtolength{\topmargin}{-23mm}
%\addtolength{\textheight}{60mm}
%\addtolength{\oddsidemargin}{-20mm}
%\addtolength{\textwidth}{40mm}

\def\1{\sqrt{-1}}
\def\rad{\operatorname{\sf rad}}
\def\Alt{\operatorname{\sf Alt}}
\def\Sym{\operatorname{\sf Sym}}
\def\Sup{\operatorname{\sf Sup}}
\def\Id{\operatorname{\sf Id}}
\def\Hom{\operatorname{Hom}}
\def\Diff{\operatorname{Diff}}
\def\Vol{\operatorname{Vol}}
\def\Lie{\operatorname{Lie}}
\def\Map{\operatorname{Map}}
\newcommand{\Der}{\operatorname{Der}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Mat}{\operatorname{Mat}}
\newcommand{\Symb}{\operatorname{Symb}}

\def\Z{{\mathbb Z}}
\def\R{{\mathbb R}}
\def\C{{\mathbb C}}
\def\Q{{\mathbb Q}}
\def\N{{\mathbb N}}

\renewcommand{\phi}{\varphi}
\renewcommand{\epsilon}{\varepsilon}
\renewcommand{\geq}{\geqslant}
\renewcommand{\leq}{\leqslant}


\renewcommand{\theequation}{\thesection.\arabic{equation}}


\makeatletter
\begingroup
\gdef\th@upshape{\normalfont
  \def\@begintheorem##1##2{%
        \item[\hskip\labelsep \theorem@headerfont ##1\ ##2.]
        \writevedomost{\string\mc{\thezadacha} \string & \string & \string 
        \\ \string \hline}
   }%
\def\@opargbegintheorem##1##2##3{%
   \item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3).]
   \writevedomost{\string\mc{\thezadacha ##3}  \string & \string \grd \string & \string\grp
   \string \\ \string \hline}
    }}
\endgroup

\theoremstyle{upshape}

\newtheorem{zadacha}{Задача}[section]

\begingroup
\gdef\th@generic{\normalfont
  \def\@begintheorem##1##2{%
        \item[\hskip\labelsep \theorem@headerfont ##1\ ##2.]
     }%
\def\@opargbegintheorem##1##2##3{%
   \item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ (##3).]
    }}
\endgroup

\theoremstyle{generic}

\newtheorem{opredelenie}{Определение}[section]

\begingroup
\gdef\th@upshapenonumber{\normalfont
  \def\@begintheorem##1##2{%
        \item[\hskip\labelsep \theorem@headerfont ##1.]}%
\def\@opargbegintheorem##1##2##3{%
   \item[\hskip\labelsep \theorem@headerfont ##1\ (##3).]}}
\endgroup

\theoremstyle{upshapenonumber}

\newtheorem{ukazanie}{Указание}[section]
\newtheorem{zamechanie}{Замечание}[section]

\renewcommand{\labelenumi}{\ralph{enumi}.}
\newcommand{\subs}[1]{{\bigskip \bf\large {\centerline #1}\bigskip}}
\newcommand{\sttr}{{\bf(*)}}
\newcommand{\shrk}{{\bf(!)}}
\newcommand{\doublesttr}{{\bf(**)}}

\newcommand{\listok}[2]{%
\setcounter{page}{1}
\renewcommand{\@oddhead}{\hfil #2 \hfil}
\renewcommand{\@evenhead}{\hfil #2 \hfil}
\section*{#2}
\refstepcounter{section}
\setcounter{section}{#1}
}

\pagestyle{fancy}
\lfoot{\tiny \sc printed: \today}
\cfoot{-- \thepage \ -- }
\rfoot{\tiny \sc\version}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% VEDOMOST GENERATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newwrite\Vedomost
\immediate\openout\Vedomost = \jobname.vdm
\newcommand{\writevedomost}[1]{\immediate\write\Vedomost{ #1 }}

\def\grd{\psboxit{box .7 setgray fill}{\phantom{\dtt}}\vphantom{666}}
\def\grp{\psboxit{box .7 setgray fill}{\phantom{\pdp}}\vphantom{666}}


\makeatother

\def\бф{\bf}
\def\ит{\it}
\def\задача{\begin{zadacha}}
\def\ез{\end{zadacha}}
\def\замечание{\begin{zamechanie}}
\def\еза{\end{zamechanie}}
\def\указание{\begin{ukazanie}}
\def\еу{\end{ukazanie}}
\def\eu{\end{ukazanie}}
\def\определение{\begin{opredelenie}}
\def\ео{\end{opredelenie}}
\def\eo{\end{opredelenie}}
\def\goth{\mathfrak}
\def\енум{\begin{enumerate}} 
\def\ее{\end{enumerate}}
\def\ee{\end{enumerate}}
\def\итем{\item   \writevedomost{\string & \ralph{enumi} \string &\string & \string \\ \string \hline } }