
\usepackage{amsmath, amssymb, amscd, russcorr,russlh, theorem, fancyhdr, epsfig}

\newcommand{\arrow}{{\:\longrightarrow\:}}
\newcommand{\restrict}[1]{{\left|_{{\phantom{|}\!\!}_{#1}}\right.}}
\def\endproof{\hbox{\vrule width 5pt height 5pt depth 0pt}}

\renewcommand{\leq}{\leqslant}
\renewcommand{\geq}{\geqslant}

\addtolength{\topmargin}{-5mm}
\addtolength{\textheight}{40mm}
\addtolength{\oddsidemargin}{-20mm}
\addtolength{\evensidemargin}{-35mm}
\addtolength{\textwidth}{45mm}
\def\eqref#1{(\ref{#1})}

\newcommand{\version}{NO VERSION}

\setlength{\headheight}{15pt}
\pagestyle{fancy} \lfoot{\tiny НМУ, осень 2010, второй курс} 
\cfoot{-- \thepage \ -- } \rfoot{\tiny \sc\version}
\rhead{{\small  Миша Вербицкий}}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  equations                          %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\makeatletter
\@addtoreset{equation}{section}
\@addtoreset{footnote}{section}
\makeatother



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  listki-new.tex                     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\def\1{\sqrt{-1}}
\def\rad{\operatorname{\sf rad}}
\def\Alt{\operatorname{\sf Alt}}
\def\Sym{\operatorname{\sf Sym}}
\def\Id{\operatorname{\sf Id}}
\def\Hom{\operatorname{Hom}}
\def\Vol{\operatorname{Vol}}
\def\Lie{\operatorname{Lie}}
\def\Map{\operatorname{Map}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Mat}{\operatorname{Mat}}
\newcommand{\cchar}{\operatorname{\sf char}}

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


\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}{Задача}[chapter]

\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}[zadacha]{Определение}
\newtheorem{ukazanie}[zadacha]{Указание}
\newtheorem{zamechanie}[zadacha]{Замечание}

\renewcommand{\labelenumi}{\ralph{enumi}.}


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

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

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

\makeatother



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Chapter                         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



  \renewcommand{\chapter}{%
     \secdef\ChapterNumbered\ChapterStarred}

  \def\ChapterNumbered[#1]#2{%
      \addcontentsline{toc}{chapter}{\thechapter. #1}
      \refstepcounter{chapter}
      {
\vspace{\baselineskip}
\chaptermark{#2}
          { {{\noindent\bf\huge \thechapter. \ #2\par}}}
      }
    \vspace{\baselineskip}
}

  \newcommand{\ChapterStarred}[1]{%
      \refstepcounter{chapter}
      \chaptermark{#1}%
      \vspace{\baselineskip}}

  \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
                             



\newcommand{\пример}{%
     \refstepcounter{zadacha}
     {\noindent\bf Пример \thechapter.\arabic{zadacha}:\ }}
\newcommand{\предложение}{%
     \refstepcounter{zadacha}
     {\noindent\bf Предложение \thechapter.\arabic{zadacha}:\ }}
\newcommand{\лемма}{%
     \refstepcounter{zadacha}
     {\noindent\bf Лемма \thechapter.\arabic{zadacha}:\ }}
\newcommand{\теорема}{%
     \refstepcounter{zadacha}
     {\noindent\bf Теорема \thechapter.\arabic{zadacha}:\ }}
\newcommand{\утверждение}{%
     \refstepcounter{zadacha}
     {\noindent\bf Утверждение \thechapter.\arabic{zadacha}:\ }}

\def\хфилл{\hfill}
\def\бф{\bf}
\def\ем{\em}
\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 $\bullet$ %
    \writevedomost{\string & \ralph{enumi} \string &\string & \string \\ \string \hline } }
