\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{vestthm}[18/10/2012]
 \def\thm@name{thm}\def\lem@name{lem}\def\utv@name{utv}\def\predl@name{predl}\def\axiom@name{axiom}\def\defn@name{defn}\def\cor@name{cor}\def\nb@name{nb}
 \def\eg@name{eg}\def\proof@name{proof}
 \def\newtheoremname#1#2{\expandafter\def\csname #1@name\endcsname{#2}}
 \AtBeginDocument{%
    \def\newthm@i#1{\@ifnextchar[{\othm@i{#1}}{\nthm@i{#1}}}
    \def\nthm@i#1#2{\@ifnextchar[{\xnthm@i{#1}{#2}}{\ynthm@i{#1}{#2}}}
    \def\xnthm@i#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@i{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@i#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@i{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@i#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@i{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@i#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@i{#1}{#2}}{\xthm@i{#1}{#2}}}
    \def\xthm@i#1#2{\bthm@i{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@i#1#2[#3]{\bethm@i{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@ii#1{\@ifnextchar[{\othm@ii{#1}}{\nthm@ii{#1}}}
    \def\nthm@ii#1#2{\@ifnextchar[{\xnthm@ii{#1}{#2}}{\ynthm@ii{#1}{#2}}}
    \def\xnthm@ii#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@ii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@ii#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@ii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@ii#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@ii{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@ii#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@ii{#1}{#2}}{\xthm@ii{#1}{#2}}}
    \def\xthm@ii#1#2{\bthm@ii{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@ii#1#2[#3]{\bethm@ii{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@iii#1{\@ifnextchar[{\othm@iii{#1}}{\nthm@iii{#1}}}
    \def\nthm@iii#1#2{\@ifnextchar[{\xnthm@iii{#1}{#2}}{\ynthm@iii{#1}{#2}}}
    \def\xnthm@iii#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@iii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@iii#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@iii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@iii#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@iii{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@iii#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@iii{#1}{#2}}{\xthm@iii{#1}{#2}}}
    \def\xthm@iii#1#2{\bthm@iii{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@iii#1#2[#3]{\bethm@iii{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@iv#1{\@ifnextchar[{\othm@iv{#1}}{\nthm@iv{#1}}}
    \def\nthm@iv#1#2{\@ifnextchar[{\xnthm@iv{#1}{#2}}{\ynthm@iv{#1}{#2}}}
    \def\xnthm@iv#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@iv{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@iv#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@iv{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@iv#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@iv{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@iv#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@iv{#1}{#2}}{\xthm@iv{#1}{#2}}}
    \def\xthm@iv#1#2{\bthm@iv{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@iv#1#2[#3]{\bethm@iv{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@v#1{\@ifnextchar[{\othm@v{#1}}{\nthm@v{#1}}}
    \def\nthm@v#1#2{\@ifnextchar[{\xnthm@v{#1}{#2}}{\ynthm@v{#1}{#2}}}
    \def\xnthm@v#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname{\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@v{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@v#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@v{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@v#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@v{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@v#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@v{#1}{#2}}{\xthm@v{#1}{#2}}}
    \def\xthm@v#1#2{\bthm@v{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@v#1#2[#3]{\bethm@v{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@vi#1{\@ifnextchar[{\othm@vi{#1}}{\nthm@vi{#1}}}
    \def\nthm@vi#1#2{\@ifnextchar[{\xnthm@vi{#1}{#2}}{\ynthm@vi{#1}{#2}}}
    \def\xnthm@vi#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@vi{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@vi#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@vi{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@vi#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@vi{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@vi#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@vi{#1}{#2}}{\xthm@vi{#1}{#2}}}
    \def\xthm@vi#1#2{\bthm@vi{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@vi#1#2[#3]{\bethm@vi{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@vii#1{\@ifnextchar[{\othm@vii{#1}}{\nthm@vii{#1}}}
    \def\nthm@vii#1#2{\@ifnextchar[{\xnthm@vii{#1}{#2}}{\ynthm@vii{#1}{#2}}}
    \def\xnthm@vii#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@vii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@vii#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@vii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@vii#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@vii{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@vii#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@vii{#1}{#2}}{\xthm@vii{#1}{#2}}}
    \def\xthm@vii#1#2{\bthm@vii{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@vii#1#2[#3]{\bethm@vii{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\newthm@viii#1{\@ifnextchar[{\othm@viii{#1}}{\nthm@viii{#1}}}
    \def\nthm@viii#1#2{\@ifnextchar[{\xnthm@viii{#1}{#2}}{\ynthm@viii{#1}{#2}}}
    \def\xnthm@viii#1#2[#3]{\expandafter\@ifdefinable\csname #1\endcsname{\@definecounter{#1}\@newctr{#1}[#3]\expandafter\xdef\csname
        the#1\endcsname{\expandafter\noexpand\csname the#3\endcsname \@thmcountersep \@thmcounter{#1}}%
        \global\@namedef{#1}{\thm@viii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\ynthm@viii#1#2{\expandafter\@ifdefinable\csname #1\endcsname {\@definecounter{#1}\expandafter\xdef\csname
        the#1\endcsname{\@thmcounter{#1}}\global\@namedef{#1}{\thm@viii{#1}{#2}}\global\@namedef{end#1}{\@endtheorem}}}
    \def\othm@viii#1[#2]#3{\@ifundefined{c@#2}{\@nocounterr{#2}}{\expandafter\@ifdefinable\csname #1\endcsname
        {\global\@namedef{the#1}{\@nameuse{the#2}}\global\@namedef{#1}{\thm@viii{#2}{#3}}\global\@namedef{end#1}{\@endtheorem}}}}
    \def\thm@viii#1#2{\refstepcounter{#1}\@ifnextchar[{\ythm@viii{#1}{#2}}{\xthm@viii{#1}{#2}}}
    \def\xthm@viii#1#2{\bthm@viii{#2}{\csname the#1\endcsname}\ignorespaces}
    \def\ythm@viii#1#2[#3]{\bethm@viii{#2}{\csname the#1\endcsname}{#3}\ignorespaces}

    \def\bthm@i#1#2{\trivlist\item[\textbf{#1 #2.}\ ]\itshape}
    \def\bethm@i#1#2#3{\trivlist\item[\textbf{#1 #2} (#3)\textbf{.}\ ]\itshape}
    \def\bthm@ii#1#2{\trivlist\item[\textbf{#1\@gobble{ #2}.}\ ]\itshape}
    \def\bethm@ii#1#2#3{\trivlist\item[\textbf{#1\@gobble{ #2}} (#3)\textbf{.}\ ]\itshape}
    \def\bthm@iii#1#2{\trivlist\item[\textbf{#1 #2.}\ ]}
    \def\bethm@iii#1#2#3{\trivlist\item[\textbf{#1 #2} (#3)\textbf{.}\ ]}
    \def\bthm@iv#1#2{\trivlist\item[\textbf{#1\@gobble{ #2}.}\ ]}
    \def\bethm@iv#1#2#3{\trivlist\item[\textbf{#1\@gobble{ #2}} (#3)\textbf{.}\ ]}
    \def\bthm@v#1#2{\trivlist\item[\textbf{#1\kern\between@words #2.}\ ]\itshape}
    \def\bethm@v#1#2#3{\trivlist\item[\textbf{#1\kern\between@words #2} (#3)\textbf{.}\ ]\itshape}
    \def\bthm@vi#1#2{\trivlist\item[\textbf{#1\@gobble{ #2}\kern-\between@chars.}\ ]\itshape}
    \def\bethm@vi#1#2#3{\trivlist\item[\textbf{#1\@gobble{ #2}\kern-\between@chars\kern-0,13pt} (#3)\textbf{.}\ ]\itshape}
    \def\bthm@vii#1#2{\trivlist\item[#1\kern\between@words #2.\ ]}
    \def\bethm@vii#1#2#3{\trivlist\item[#1\kern\between@words #2\@gobble{ (#3)}.\ ]}
    \def\bthm@viii#1#2{\trivlist\item[#1\@gobble{ #2}\kern-\between@chars.\ ]}
    \def\bethm@viii#1#2#3{\trivlist\item[#1\@gobble{ #2 (#3)}\kern-\between@chars.\ ]}
    \newthm@i{\thm@name}{\@thmname}
    \newthm@i{\lem@name}{\@lemname}
    \newthm@i{\utv@name}{\@utvname}
    \newthm@i{\predl@name}{\@predlname}
    \newthm@i{\axiom@name}{\@axiomname}
    \newthm@ii{\thm@name*}{\@thmname}
    \newthm@ii{\lem@name*}{\@lemname}
    \newthm@ii{\utv@name*}{\@utvname}
    \newthm@ii{\predl@name*}{\@predlname}
    \newthm@ii{\axiom@name*}{\@axiomname}
    \newthm@iii{\defn@name}{\@defnname}
    \newthm@iv{\defn@name*}{\@defnname}
    \newthm@v{\cor@name}{\@corname}
    \newthm@vi{\cor@name*}{\@corname}
    \newthm@vii{\nb@name}{\@nbname}
    \newthm@vii{\eg@name}{\@egname}
    \newthm@viii{\nb@name*}{\@nbname}
    \newthm@viii{\eg@name*}{\@egname}
    \def\@axiomname{\ifeng{\indent\char65\char120\char105\char111\char109{}}{\indent\char192\char234\char241\char232\char238\char236\char224{}}}
    \def\@corname{\ifeng{\indent\innerso{{\char67}{\char111}{\char114}{\char111}{\char108}{\char108}{\char97}{\char114}{\char121}}}
        {\indent\innerso{{\char209}{\char235}{\char229}{\char228}{\char241}{\char242}{\char226}{\char232}{\char229}}}}
    \def\@defnname{\ifeng{\indent\char68\char101\char102\char105\char110\char105\char116\char105\char111\char110{}}
        {\indent\char206\char239\char240\char229\char228\char229\char235\char229\char237\char232\char229{}}}
    \def\@egname{\ifeng{\indent\innerso{{\char69}{\char120}{\char97}{\char109}{\char112}{\char108}{\char101}}}
        {\indent\innerso{{\char207}{\char240}{\char232}{\char236}{\char229}{\char240}}}}
    \def\@lemname{\ifeng{\indent\char76\char101\char109\char109\char97{}}{\indent\char203\char229\char236\char236\char224{}}}
    \def\@nbname{\ifeng{\indent\innerso{{\char78}{\char111}{\char116}{\char97}{\char116}{\char105}{\char111}{\char110}}}
        {\indent\innerso{{\char199}{\char224}{\char236}{\char229}{\char247}{\char224}{\char237}{\char232}{\char229}}}}
    \def\@predlname{\ifeng{\indent\char83\char101\char110\char116\char101\char110\char99\char101{}}
        {\indent\char207\char240\char229\char228\char235\char238\char230\char229\char237\char232\char229{}}}
    \def\@proofname{\ifeng{\indent\innerso{{\char80}{\char114}{\char111}{\char111}{\char102}}}{\indent\innerso{{\char196}{\char238}
        {\char234}{\char224}{\char231}{\char224}{\char242}{\char229}{\char235}{\char252}{\char241}{\char242}{\char226}{\char238}}}}
    \def\@thmname{\ifeng{\indent\char84\char104\char101\char111\char114\char101\char109{}}{\indent\char210\char229\char238\char240\char229\char236\char224{}}}
    \def\@utvname{\ifeng{\indent\char80\char114\char111\char112\char111\char115\char105\char116\char105\char111\char110{}}
        {\indent\char211\char242\char226\char229\char240\char230\char228\char229\char237\char232\char229{}}}
    \def\forproof@so#1{\innerso{#1}\def\auxproof@so{#1}\kern-\between@chars%
         \if\space\auxproof@so
          \kern-2\between@words
         \else
          \relax
         \fi
        \char46\egroup}
    \def\proof@so{\bgroup\catcode`\ =13 \forproof@so}
    \expandafter\def\csname\proof@name\endcsname{\trivlist\item\leavevmode\@proofname\kern\between@words\proof@so}
    \expandafter\def\csname end\proof@name\endcsname{\unskip\nobreak\hfill\space\vrule width 6pt height 6pt depth 0pt\endtrivlist}}
 \endinput
