%%
%%  File: math.sty
%%
%%  Author: Mariusz \.Zynel
%%
%%  Description: LaTeX package providing general mathematical macros.
%%
%%  Create date: April 29, 1998
%%
%%  Last modified: Jan 6, 2014
%%
%%
%%  Copyright (c) 1998-2014 Mariusz Zynel <mariusz@math.uwb.edu.pl>.
%%
%%  This  software  is  FREE.  You can use  and/or  redistribute  it for any
%%  purpose in either,  modified, or unmodified form, under the terms of the
%%  GNU General Public License as published by the Free Software Foundation.
%%
%%  The above copyright notice and this permission  notice shall be included
%%  in all copies or substantial portions of this software.
%%
%%  THIS  SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY  OF ANY KIND,
%%  EITHER  EXPRESSED OR IMPLIED.  IN NO EVENT WILL THE COPYRIGHT  HOLDER BE
%%  LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{math}[2014/01/06 v3.24 Mathematical Package]
\typeout{Mathematical Package v3.24 <2014/01/06> (MZ)}

\DeclareOption{regquant}{%
  \def\forall#1{\forallsymb\;#1}
  \def\exists#1{\existssymb\;#1}
  \def\pforall#1{(\forall{#1})}
  \def\pexists#1{(\exists{#1})}}
\DeclareOption{subquant}{%
  \def\forall#1{\mathord{\forallsymb}_{#1}}
  \def\exists#1{\mathord{\existssymb}_{#1}}
  \def\pforall#1{(\kern0.1em \forall{#1})}
  \def\pexists#1{(\kern0.1em \exists{#1})}}
\DeclareOption{limquant}{%
  \def\forall#1{\forallsymb\limits_{#1}}
  \def\exists#1{\existssymb\limits_{#1}}
  \def\pforall#1{\Bigl(\kern0.1em \forall{#1} \kern0.05em\Bigr)}
  \def\pexists#1{\Bigl(\kern0.1em \exists{#1} \kern0.05em\Bigr)}}
\DeclareOption{newcolumns}{\AtEndOfClass{%
  \RequirePackage{array}
  \newcolumntype{C}{>{$}c<{$}}
  \newcolumntype{L}{>{$}l<{$}}
  \newcolumntype{R}{>{$}r<{$}}}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}}

\ExecuteOptions{regquant}
\ProcessOptions\relax
\RequirePackage{latexsym}[1995/12/01 v2.2e]
\RequirePackage{amsmath}[1997/03/20 v1.2d]
\RequirePackage{amsthm}[1996/10/24 v1.2d]
\RequirePackage{amssymb}[1996/11/03 v2.2b]
\RequirePackage{amsfonts}[1997/09/17 v2.2e]

\DeclareMathSymbol{\forallsymb}{\mathop}{symbols}{"38}
\DeclareMathSymbol{\existssymb}{\mathop}{symbols}{"39}

\newcommand*{\field}[1]{\mathbb{#1}}
\newcommand*{\N}{\field{N}}
\newcommand*{\Z}{\field{Z}}
\newcommand*{\Q}{\field{Q}}
\newcommand*{\R}{\field{R}}
\newcommand*{\C}{\field{C}}
\let\goth\mathfrak
\let\vec\overrightarrow
\let\division\div
\let\div\mid
\let\ndiv\nmid
\newcommand*{\lto}{\mathrel{\longrightarrow}}
\newcommand*{\gto}{\mathrel{\mapstochar\rightsquigarrow}}
\newcommand*{\restr}{\bigr\rvert}
\newcommand*{\evalat}[1]{\bigr\rvert_{#1}\mkern-1mu}
\newcommand*{\diff}[2]{\frac{\partial #1}{\partial #2}}
\newcommand*{\sub}{\raise.5ex\hbox{$\wp$}}
\newcommand*{\set}[1]{{\ensuremath{\{ #1 \}}}}
\newcommand*{\bset}[1]{{\ensuremath{\bigl\{ #1 \bigr\}}}}
\newcommand*{\Bset}[1]{{\ensuremath{\Bigl\{ #1 \Bigr\}}}}
\newcommand*{\abs}[1]{{\ensuremath{\lvert #1 \rvert}}}
\newcommand*{\babs}[1]{{\ensuremath{\bigl\lvert #1 \bigr\rvert}}}
\newcommand*{\Babs}[1]{{\ensuremath{\Bigl\lvert #1 \Bigr\rvert}}}
\newcommand*{\norm}[1]{{\ensuremath{\lVert #1 \rVert}}}
\newcommand*{\bnorm}[1]{{\ensuremath{\bigl\lVert #1 \bigr\rVert}}}
\newcommand*{\Bnorm}[1]{{\ensuremath{\Bigl\lVert #1 \Bigr\rVert}}}
\newcommand*{\struct}[1]{{\ensuremath{\langle #1 \rangle}}}
\newcommand*{\bstruct}[1]{{\ensuremath{\bigl\langle #1 \bigr\rangle}}}
\newcommand*{\Bstruct}[1]{{\ensuremath{\Bigl\langle #1 \Bigr\rangle}}}
\let\gen\struct
\let\bgen\bstruct
\let\Bgen\Bstruct
\newcommand*{\seg}[2]{\ensuremath{[#1, #2]}}
\newcommand*{\bseg}[2]{\ensuremath{\bigl[#1, #2\bigr]}}
\newcommand*{\Bseg}[2]{\ensuremath{\Bigl[#1, #2\Bigr]}}
\newcommand*{\pmodeq}[3]{\ensuremath{#1 \equiv #2 \pmod{#3}}}
\newcommand*{\tpmodeq}[3]{%
  \ensuremath{\@displayfalse #1 \equiv #2 \pmod{#3}}}
\newcommand*{\podeq}[3]{\ensuremath{#1 \equiv #2 \pod{#3}}}
\newcommand*{\tpodeq}[3]{%
  \ensuremath{\@displayfalse #1 \equiv #2 \pod{#3}}}
\newcommand*{\map}[4]{\ensuremath{(#1\gto#2)\colon #3\lto#4}}
\newcommand*{\bmap}[4]{\ensuremath{\bigl(#1\gto#2\bigr)\colon #3\lto#4}}
\newcommand*{\Bmap}[4]{\ensuremath{\Bigl(#1\gto#2\Bigr)\colon #3\lto#4}}
\newcommand*{\seq}[2][n]{%
  \ensuremath{%
  #2_1, #2_2,\dots, #2_{#1} }}
\newcommand*{\zseq}[2][n]{%
  \ensuremath{%
  #2_0, #2_1,\dots, #2_{#1} }}
\newcommand*{\basis}[2][n]{%
  \ensuremath{%
  \lbrace #2_1, #2_2,\dots, #2_{#1}\rbrace }}
\newcommand*{\poly}[3][n]{%
  \ensuremath{%
  #2_{#1}#3^{#1}+\dots+#2_1#3+#2_0}}
\newcommand*{\oppoly}[3][n]{%
  \ensuremath{%
  #2_0+#2_1#3+\dots+#2_{#1}#3^{#1}}}
\newcommand*{\bydef}{\stackrel{\textrm{\footnotesize def}}{:=}}
\newcommand*{\ltgt}{%
  \mathrel{\null\,\vcenter{\baselineskip5\ex@%
    \hbox{$\scriptstyle<$}\hbox{$\scriptstyle>$}}}}

\newcommand*{\Lor}{\mathrel{\lor}}
\newcommand*{\Land}{\mathrel{\land}}
\newcommand*{\Lnot}{\mathop{\lnot}}

\def\tquot#1#2{#1\mkern-3mu/#2}
\def\dquot#1#2{\raise.15ex\hbox{$\textstyle#1$}%
  \mkern-3mu/\lower.52ex\hbox{$\textstyle#2$}}
\def\squot#1#2{\scriptstyle\raise.1ex\hbox{$\scriptstyle#1$}%
  \mkern-3mu/\lower.4ex\hbox{$\scriptstyle#2$}}
\def\ssquot#1#2{\scriptscriptstyle\raise.07ex\hbox{$\scriptscriptstyle#1$}%
  \mkern-3mu/\lower.3ex\hbox{$\scriptscriptstyle#2$}}
\newcommand*{\quot}[2]{{\ensuremath{%
  \mathchoice{\dquot{#1}{#2}}{\tquot{#1}{#2}}%
    {\squot{#1}{#2}}{\ssquot{#1}{#2}}}}}

\newcommand*{\op}[1]{{#1}^{\mathrm{op}}\relax}
\newcommand*{\latt}{{\goth L}}
\newcommand*{\oplatt}{\op{\goth L}}
\newcommand*{\T}[1]{{#1}^{\mathrm{T}}\relax}

\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\Fix}{Fix}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Img}{Im}
\DeclareMathOperator{\Ker}{Ker}
\DeclareMathOperator{\Lin}{Lin}
\DeclareMathOperator{\Sub}{Sub}
\DeclareMathOperator{\Sup}{Sup}
\DeclareMathOperator{\codim}{codim}
\DeclareMathOperator{\const}{const}
\DeclareMathOperator{\fchar}{char}
\DeclareMathOperator{\graph}{graph}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\ind}{ind}
\DeclareMathOperator{\rad}{rad}
\DeclareMathOperator{\sign}{sign}

\def\newnotation#1{%
  \count@\escapechar \escapechar\m@ne
  \edef\@tempa{\csname at\string#1\endcsname}%
  \expandafter\edef\csname\string#1\endcsname{%
    \noexpand\@ifnextchar[%
      {\noexpand\@definedelims\@tempa}%
      {\noexpand\@defaultdelims\@tempa}}%
  \escapechar\count@
  \expandafter\def\@tempa}
\def\@definedelims#1[#2]{%
  \def\ldelim{\csname #2l\endcsname}%
  \def\rdelim{\csname #2r\endcsname}#1}
\def\@defaultdelims{%
  \let\ldelim\relax%
  \let\rdelim\relax}

\let\theequation@org\theequation
\newenvironment{displaystatement}[1][]{%
  \def\theequation{#1}
  \equation
}{%
  \endequation
  \let\theequation\theequation@org}

\newcommand\theoremname{Theorem}
\newcommand\lemmaname{Lemma}
\newcommand\corollaryname{Corollary}
\newcommand\propositionname{Proposition}
\newcommand\conjecturename{Conjecture}
\newcommand\criterionname{Criterion}
\newcommand\algorithname{Algorithm}
\newcommand\factname{Fact}
\newcommand\hypothesisname{Hypothesis}
\newcommand\definitionname{Definition}
\newcommand\conditionname{Condition}
\newcommand\problemname{Problem}
\newcommand\examplename{Example}
\newcommand\exercisename{Exercise}
\newcommand\remarkname{Remark}
\newcommand\notename{Note}
\newcommand\notationname{Notation}
\newcommand\claimname{Claim}
\newcommand\summaryname{Summary}
\newcommand\acknowledgmentname{Acknowledgment}
\newcommand\casename{Case}
\newcommand\conclusionname{Conclusion}

\newcommand\hintname{Hint}

\newcommand*{\ltor}{\mbox{$\Rightarrow\colon$}}
\newcommand*{\rtol}{\mbox{$\Leftarrow\colon$}}
\newcommand*{\lincr}{\mbox{$\subseteq\colon$}}
\newcommand*{\rincl}{\mbox{$\supseteq\colon$}}

\renewenvironment{proof}[1][\proofname]{\par
  \normalfont
  \topsep6\p@\@plus6\p@ \trivlist
  \item[\hskip\labelsep\scshape
    #1\@addpunct{.}]\ignorespaces
}{%
  \qed\endtrivlist
}

\newenvironment{hint}[1][\hintname]{\par
  \normalfont
  \topsep6\p@\@plus6\p@ \trivlist
  \item[\hskip\labelsep\indent\scshape
    #1\@addpunct{.}]\ignorespaces
}{%
  \endtrivlist
}

\newcount\@conddepth \@conddepth = 0
\@definecounter{condition}
\def\thecondition{\@roman\c@condition}
\def\labelcondition{\upshape(\thecondition)}

\newenvironment{conditions}{%
    \ifnum \@conddepth >0 \@toodeep\else
      \advance\@conddepth\@ne
        \list{\labelcondition}
          {\usecounter{condition}\def\makelabel##1{\hss\llap{##1}}
            \topsep3\p@\leftmargin50\p@\labelsep8\p@}%
    \fi
  }{%
    \endlist}

\newenvironment{conditions*}{%
    \ifnum \@conddepth >0 \@toodeep\else
      \advance\@conddepth\@ne
        \list{\labelcondition}
          {\usecounter{condition}\def\makelabel##1{\hss\llap{##1}}
            \topsep3\p@\leftmargin0\p@\itemindent50\p@\labelsep8\p@}%
    \fi
  }{%
    \endlist}

\newcount\@sentdepth \@sentdepth = 0
\@definecounter{sentence}
\def\thesentence{\@roman\c@sentence}
\def\labelsentence{\upshape(\thesentence)}

\newenvironment{sentences}{%
    \ifnum \@sentdepth >0 \@toodeep\else
      \advance\@sentdepth\@ne
        \list{\labelsentence}
          {\usecounter{sentence}\def\makelabel##1{\hss\llap{##1}}
            \topsep3\p@\leftmargin0\p@\itemindent40\p@\labelsep8\p@}%
    \fi
  }{%
    \endlist}

\newenvironment{sentences*}{%
    \ifnum \@sentdepth >0 \@toodeep\else
      \advance\@sentdepth\@ne
        \list{\labelsentence}
          {\usecounter{sentence}\def\makelabel##1{\hss\llap{##1}}
            \topsep3\p@\leftmargin40\p@\labelsep8\p@}%
    \fi
  }{%
    \endlist}

\def\mathstyle#1{%
  \@ifundefined{ms@#1}{%
    \PackageWarning{Math}{Unknown mathstyle `#1'}%
    \gdef\m@thstyle{plain}
    \ms@plain
  }{%
    \gdef\m@thstyle{#1}
    \@nameuse{ms@#1}}}
\@onlypreamble\mathstyle

\def\ms@plain{%
  \def\th@plaintheorem{%
    \th@plain}
  \def\th@plaindefinition{%
    \th@definition}
  \def\th@plainremark{%
    \th@remark}}

\def\ms@heads{%
  \def\th@headstheorem{%
    \th@plain
    \thm@headfont{\bfseries\scshape}}
  \def\th@headsdefinition{%
    \th@definition
    \thm@headfont{\bfseries\scshape}}
  \def\th@headsremark{%
    \th@remark
    \thm@headfont{\bfseries\itshape}}}

\def\ms@simple{%
  \def\th@simpletheorem{%
    \th@plain
    \normalfont
    \thm@headfont{\bfseries\scshape}}
  \def\th@simpledefinition{%
    \th@definition
    \thm@headfont{\bfseries\scshape}}
  \def\th@simpleremark{%
    \th@remark
    \thm@headfont{\bfseries\itshape}}}

\mathstyle{heads}

\def\settheoremstyle{\theoremstyle{\m@thstyle theorem}}
\def\setdefinitionstyle{\theoremstyle{\m@thstyle definition}}
\def\setremarkstyle{\theoremstyle{\m@thstyle remark}}

\def\thmsupcounter#1{%
   \gdef\@thmsupcounter{#1}}

\let\@thmsupcounter\@empty

\providecommand{\xqedsymbol}{$\Diamond$}
\DeclareRobustCommand{\xqed}{%
  \ifmmode
    \quad\hbox{\xqedsymbol}%
  \else
    \leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill
    \quad\hbox{\xqedsymbol}%
  \fi
}

\newenvironment{probx}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{\xqedsymbol}\begin{prob}}
  {\popQED\end{prob}}
\newenvironment{probx*}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{\xqedsymbol}\begin{prob*}}
  {\popQED\end{prob*}}
\newenvironment{exmx}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{\xqedsymbol}\begin{exm}}
  {\popQED\end{exm}}
\newenvironment{exmx*}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{\xqedsymbol}\begin{exm*}}
  {\popQED\end{exm*}}
\newenvironment{exrx}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{\xqedsymbol}\begin{exr}}
  {\popQED\end{exr}}
\newenvironment{exrx*}
  {\pushQED{\qed}\renewcommand{\qedsymbol}{\xqedsymbol}\begin{exr*}}
  {\popQED\end{exr*}}

\AtBeginDocument{%
  \settheoremstyle
  \ifx\@thmsupcounter\@empty
    \let\@notdefinable@org\@notdefinable
    \let\@notdefinable\relax
    \def\@newprithm{\newtheorem{thm}{\theoremname}[chapter]}
    \@ifdefinable\c@chapter{%
      \gdef\@newprithm{\newtheorem{thm}{\theoremname}[section]}}
    \@ifdefinable\c@section{%
      \gdef\@newprithm{\newtheorem{thm}{\theoremname}}}
    \let\@notdefinable\@notdefinable@org
    \@newprithm
    \let\@newprithm\@empty
  \else
    \newtheorem{thm}{\theoremname}[\@thmsupcounter]
  \fi
  \newtheorem{lem}[thm]{\lemmaname}
  \newtheorem{cor}[thm]{\corollaryname}
  \newtheorem{prop}[thm]{\propositionname}
  \newtheorem{conj}[thm]{\conjecturename}
  \newtheorem{crit}[thm]{\criterionname}
  \newtheorem{alg}[thm]{\algorithmname}
  \newtheorem{fact}[thm]{\factname}
  \newtheorem{hypo}[thm]{\hypothesisname}
  \newtheorem{note}[thm]{\notename}

  \newtheorem*{thm*}{\theoremname}
  \newtheorem*{lem*}{\lemmaname}
  \newtheorem*{cor*}{\corollaryname}
  \newtheorem*{prop*}{\propositionname}
  \newtheorem*{conj*}{\conjecturename}
  \newtheorem*{crit*}{\criterionname}
  \newtheorem*{alg*}{\algorithmname}
  \newtheorem*{fact*}{\factname}
  \newtheorem*{hypo*}{\hypothesisname}
  \newtheorem*{note*}{\notename}

  \setdefinitionstyle
  \newtheorem{dfn}[thm]{\definitionname}
  \newtheorem{nota}[thm]{\notationname}
  \newtheorem{cond}[thm]{\conditionname}
  \newtheorem{prob}[thm]{\problemname}
  \newtheorem{exm}[thm]{\examplename}
  \newtheorem{exr}[thm]{\exercisename}
  \newtheorem{rem}[thm]{\remarkname}

  \newtheorem*{dfn*}{\definitionname}
  \newtheorem*{nota*}{\notationname}
  \newtheorem*{cond*}{\conditionname}
  \newtheorem*{prob*}{\problemname}
  \newtheorem*{exm*}{\examplename}
  \newtheorem*{exr*}{\exercisename}
  \newtheorem*{rem*}{\remarkname}

  \setremarkstyle
  \newtheorem{remk}[thm]{\remarkname}
  \newtheorem{claim}[thm]{\claimname}
  \newtheorem{summ}[thm]{\summaryname}
  \newtheorem{ack}[thm]{\acknowledgmentname}
  \newtheorem{case}[thm]{\casename}
  \newtheorem{conc}[thm]{\conclusionname}}

  \setremarkstyle
  \newtheorem*{remk*}{\remarkname}
  \newtheorem*{claim*}{\claimname}
  \newtheorem*{summ*}{\summaryname}
  \newtheorem*{ack*}{\acknowledgmentname}
  \newtheorem*{case*}{\casename}
  \newtheorem*{conc*}{\conclusionname}

\newcommand*{\math@err}{\PackageError{Math}}

\endinput
%%
%% End of file `math.sty'.
