%\documentclass[a4paper]{article}
%\usepackage{doc,txfonts}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage[mystyles]{amsthm}
%\usepackage{verbatim}
%\usepackage{enumerate}
%\usepackage[screen,leftpanel,paneltoc]{pdfscreen}
%\margins{.5in}{.5in}{.5in}{.5in}
%\screensize{6.25in}{8in}
\MakeShortVerb{\"}
\chapter{Typesetting Theorems}
\section{Theorems in \LaTeX}
In Mathematical documents we often have special statements such as
\textit{axioms} (which are nothing but the assumptions made) and
\textit{theorems} (which are the conclusions obtained, sometimes
known by other names like \textit{propositions} or
\textit{lemmas}). These are often typeset in different font to
distinguish them from surrounding text and given a name and a number
for subsequent reference. Such distinguished statements are now
increasingly seen in other subjects also. We use the term
\emph{theorem-like statements} for all such statements.
\LaTeX\ provides the declaration "\newtheorem" to define the theorem-like
statements needed in a document. This command has two arguments, the
first for \emph{the name we assign to the environment} and the second,
\emph{the name to be printed with the statement}. Thus if you want
\begin{thm}
The sum of the angles of a triangle is $180^\circ$.
\end{thm}
\noindent you first specify
\begin{decl}
"\newtheorem{thm}{Theorem}"
\end{decl}
and then type
\begin{screen}
\clearpage
\end{screen}
\begin{decl}
|\begin|\Arg{thm}\\
|The sum of the angles of a triangle is $180^\circ$.|\\
|\end|\Arg{thm}
\end{decl}
Note that in the command "\newtheorem" the first argument can be any
name you fancy, instead of the "thm" given here. Also, it is a good
idea to keep all your "\newtheorem" commands together in the
preamble.
The "\newtheorem" command has a couple of optional arguments which
control the way the corresponding statement is numbered. For example
if you want the above theorem to be numbered 1.1 (the first theorem of
the first section) rather than a plain 1, then you must specify
\begin{decl}
|\newtheorem|\Arg{thm}\Arg{Theorem}\Oarg{section}
\end{decl}
in the "\newtheorem" command. Then the same input as above for the
theorem produces
\begin{thmsec}
The sum of the angles of a triangle is $180^\circ$.
\end{thmsec}
The next \textbf{Theorem} will be numbered 1.2, the third \textbf{Theorem} in
the fourth section will be numbered 4.3 and so on.
The other optional argument of the "\newtheorem" command is useful
when you have several different types of theorem-like statements (such
as lemmas and corollaries) and you want some of them to share the same
numbering sequence. For example if you want
\begin{thmsec}
The sum of the angles of a triangle is $180^\circ$.
\end{thmsec}
An immediate consequence of the result is the following
\begin{cor}
The sum of the angles of a quadrilateral is $360^\circ$.
\end{cor}
\noindent Then you must specify
\begin{decl}
"\newtheorem"\Arg{cor}\Oarg{thm}\Arg{Corollary}
\end{decl}
\emph{after} the specification "\newtheorem"\Arg{thm}\Oarg{section} and then type
\begin{decl}
|\begin|\Arg{thm}\\
|The sum of the angles of a triangle is $180^\circ$.|\\
|\end|\Arg{thm}\\
||\\
|An immediate consequence of the result is the following|\\
|\begin|\Arg{cor}\\
|The sum of the angles of a quadrilateral is $360^\circ$.|\\
|\end|\Arg{cor}
\end{decl}
The optional argument "thm" in the definition of the "cor" environment
specifies that ``Corollaries'' and ``Theorems'' are to be numbered in
the same sequence.
A theorem-like environment defined using the
"\newtheorem" command has also an optional argument which is used to
give a \emph{note} about the theorem such as the name of its
discoverer or its own common name. For example, to get
\begin{thmsec}[Euclid]
The sum of the angles of a triangle is $180^\circ$.
\end{thmsec}
\noindent you must type
\begin{decl}
|\begin|\Arg{thm}\Oarg{Euclid}\\
|The sum of the angles of a triangle is $180^\circ$.|\\
|\end|\Arg{thm}
\end{decl}
Note the optional argument "Euclid" after the "\begin"\Arg{thm}. This use
of [...] for optional notes sometimes lead to unintended results. For
example, to get
\begin{thmsec}
$[0,1]$ is a compact subset of $\mathbb{R}$.
\end{thmsec}
\noindent if you type
\begin{decl}
|\begin|\Arg{thm}\\
|[0,1] is a compact subset of $\mathbb{R}$.|\\
|\end|\Arg{thm}
\end{decl}
then you get
\begin{thmsec}
[0,1] is a compact subset of $\mathbb{R}$.
\end{thmsec}
\noindent Do you see what happened? The string 0,1 within [ ] at the
beginning of the theorem is considered an optional note by \LaTeX\,!
The correct way is to type
\begin{decl}
|\begin|\Arg{thm}\\
|$[0,1]$ is a compact subset of $\mathbb{R}$.|\\
|\end|\Arg{thm}
\end{decl}
Now all the theorem-like statements produced above have the \emph{same
typographical form}--- name and number in \textbf{boldface} and the body of the
statement in \textit{italics}. What if you need something like
\begin{mythm}[Euclid]\label{mythm}
The sum of the angles of a triangle is $180^\circ$.
\end{mythm}
Such customization is necessitated not only by the aesthetics of the
author but often by the whims of the designers in publishing houses also.
\section{Designer Theorems--- The \textsf{amsthm} package}
The package \textsf{amsthm} affords a high level of customization in
formatting theorem-like statements. Let's first look at the predefined
\textit{s2tyles} available in this package.
\subsection{Ready made styles}
The default style
(this is what you get if you don't say anything about the style) is termed
"plain" and it is what we have seen so far---name and number in
boldface and body in italic. Then there is the "definition" style
which gives name and number in boldface and body in roman.
And finally there is the "remark" style which gives number and
name in italics and body in roman.
For example if you put in the preamble
\begin{decl}
|\usepackage|\Arg{amsthm}\\
|\newtheorem|\Arg{thm}\Arg{Theorem}\Oarg{section}\\
|\theoremstyle|\Arg{definition}\\
|\newtheorem|\Arg{dfn}\Arg{Definition}\Oarg{section}\\
|\theoremstyle|\Arg{remark}\\
|\newtheorem|\Arg{note}\Arg{Note}\Oarg{section}\\
|\theoremstyle|\Arg{plain}\\
|\newtheorem|\Arg{lem}\Oarg{thm}\Arg{Lemma}
\end{decl}
and then type somewhere in your document
\begin{Decl}
|\begin|\Arg{dfn}\\
|A triangle is the figure formed by joining each pair |\\
|of three non collinear points by line segments. |\\
|\end|\Arg{dfn}\\
\\
|\begin|\Arg{note}\\
|A triangle has three angles.|\\
|\end|\Arg{note}\\
\\
|\begin|\Arg{thm}\\
|The sum of the angles of a triangle is $180^\circ$.|\\
|\end|\Arg{thm}\\
\\
|\begin|\Arg{lem}\\
|The sum of any two sides of a triangle is greater |\\
|than or equal to the third. |\\
|\end|\Arg{lem}
\end{Decl}
then you get
\begin{dfn}
A triangle is the figure formed by joining each pair of three non
collinear points by line segments.
\end{dfn}
\begin{note}
A triangle has three angles.
\end{note}
\begin{thmsec}
The sum of the angles of a triangle is $180^\circ$.
\end{thmsec}
\begin{lem}
The sum of any two sides of a triangle is greater than or equal to the
third.
\end{lem}
Note how the "\theoremstyle" command is used to switch between various
styles, especially the last "\theoremstyle{plain}" command. Without
it, the previous "\theoremstyle{remark}" will still be in force when "lem"
is defined and so ``Lemma'' will be typeset in the "remark" style.
\subsection{Custom made theorems}
Now we are ready to roll our own ``theorem styles''. This is done via
the "\newtheoremstyle" command, which allows us to control almost all
aspects of typesetting theorem like statements. this command has nine
parameters and the general syntax is
\begin{decl}
"\newtheoremstyle%"\\
\arg{name}"%"\\
\arg{abovespace}"%"\\
\arg{belowspace}"%"\\
\arg{bodyfont}"%"\\
\arg{indent}"%"\\
\arg{headfont}"%"\\
\arg{headpunct}"%"\\
\arg{headspace}"%"\\
\arg{custom-head-spec}"%"
\end{decl}
The first parameter \textit{name} is the name of the new \emph{style}.
Note that it is \emph{not} the name of the \emph{environment} which is to be
used later. Thus in the example above "remark" is the name of a new
style for typesetting theorem like statements and "note" is the name
of the environment subsequently defined to have this style. (and
"Note" is the name of the statement itself).
The next two parameters determine the vertical space between the
theorem and the surrounding text---the \textit{abovespace} is the
space from the preceding text and the \textit{belowspace} the space
from the following text. You can specify either a rigid length (such
as 12pt) or a rubber length (such as "\baselineskip") as a value for
either of these. Leaving either of these empty sets them to the
``usual values''. (Technically the "\topsep").
The fourth parameter \textit{bodyfont} specifies the font to be used
for the body of the theorem-like statement. This is to be given as
a \emph{declaration} such as "\scshape" or "\bfseries" and \emph{not} as
a \emph{command} such as "\textsc" or "\textbf". If this is
left empty, then the main text font of the document is used.
The next four parameters refer to the \textit{theoremhead}---the part
of the theorem like statement consisting of the name, number and the
optional note. The fifth parameter \textit{indent} specifies the
indentation of \textit{theoremhead} from the left margin. If this is empty, then
there is no indentation of the \textit{theoremhead} from the left margin. The
next parameter specifies the font to be used for the
\textit{theoremhead}. The comments about the parameter \textit{bodyfont},
made in the previous paragraph holds for this also. The parameter
\textit{headpunct} (the seventh in our list) is for specifying the
\textit{punctuation} after the theoremhead. If you don't want any, you
can leave this empty. The last parameter in this category (the last
but one in the entire list), namely \textit{headspace}, determines the
(horizontal) space to be left between the \textit{theoremhead} and the
\textit{theorembody}. If you want only a normal interword space here
put a \emph{single blank space} as "{ }" in this place. (Note that it is
not the same as leaving this \emph{empty} as in "{}").
Another option here is to put the
command "\newline" here. Then instead of a space, you get a linebreak
in the output; that is, the \textit{theoremhead} will be printed in
a line by itself and the \textit{theorembody} starts from the next
line.
The last parameter \textit{custom-head-spec} is for customizing
\textit{theoremheads}. Since it needs some explanation (and since we
are definitely in need of some breathing space), let's now look
at a few examples using the eight parameters we've already discussed.
It's almost obvious now how the last theorem in Section 1 (see
Page~\pageref{mythm}) was designed. It was generated by
\begin{decl}
|\newtheoremstyle|\Arg{mystyle}|{}{}{\slshape}%|\\
|{}{\scshape}{.}{ }{}|\\
\\
|\theoremstyle|\Arg{mystyle}\\
|\newtheorem|\Arg{mythm}\Arg{Theorem}\Oarg{section}\\
\\
|\begin|\Arg{mythm}\\
|The sum of the angles of a triangle is $180^\circ$.|\\
|\end|\Arg{mythm}
\end{decl}
\begin{screen}
\clearpage
\end{screen}
As another example, consider the following
\begin{decl}
|\newtheoremstyle|\Arg{mynewstyle}\Arg{12pt}\Arg{12pt}|{\itshape}%|\\
| {}{\sffamily}{:}{\newline}{}|\\
\\
|\theoremstyle|\Arg{mynewstyle}\\
|\newtheorem|\Arg{mythm}\Arg{Theorem}\Oarg{section}\\
\\
|\begin|\Arg{mynewthm}\Oarg{Euclid}\\
|The sum of the angles of a triangle is $180^\circ$.|\\
|\end|\Arg{mynewthm}
\end{decl}
This produces
\begin{mynewthm}[Euclid]
The sum of the angles of a triangle is $180^\circ$.
\end{mynewthm}
Do you need anything more? Perhaps yes. Note that
\textit{theoremhead} includes the optional note to the theorem also,
so that the font of the number and name of the theorem-like statement
and that of the optional note are always the same. What if you need
something like
\begin{Cauchy}[Third Version]\label{Cauchy}
If $G$ is a simply connected open subset of $\mathbb{C}$, then for
every closed rectifiable curve $\gamma$ in $G$, we have
\begin{equation*}
\int_\gamma f=0
\end{equation*}
\end{Cauchy}
It is in such cases, that the last parameter of "\newtheoremstyle" is
needed. Using it we can separately customize the name and number of
the theorem-like statement and also the optional note. The basic
syntax is for setting this parameter is
\begin{decl}
"{"\textit{commands}"#1"\textit{commands}"#2"\textit{commands}"#3}"
\end{decl}
where "#1" corresponds to the name of the theorem-like statement, "#2"
corresponds to its number and "#3" corresponds to the optional
note. We are here actually supplying the replacement text for a
command "\thmhead" which has three arguments. It's as if we are defining
\begin{decl}
|\renewcommand{\thmhead}|\Oarg{3}\Arg{...\string#1...\string#2...\string#3}
\end{decl}
but without actually typing the "\renewcommand{\thmhead}[3]". For
example the theorem above (Cauchy's Theorem) was produced by
\begin{decl}
|\newtheoremstyle|\Arg{diffnotenonum}|{}{}{\itshape}{}%|\\
| {\bfseries}{.}{ }{#1 (\mdseries #3)}|\\
\\
|\theoremstyle|\Arg{diffnotenonum}\\
|\newtheorem|\Arg{Cauchy}\Arg{Cauchy's Theorem}\\
\\
|\begin|\Arg{Cauchy}\Oarg{Third Version}\\
|If $G$ is a simply connected open subset of |\\
|$\mathbb{C}$, then for every closed rectifiable |\\
|curve $\gamma$ in $G$, we have |\\
|\begin|\Arg{equation*}\\
|\int_\gamma f=0|\\
|\end|\Arg{equation*}\\
|\end|\Arg{Cauchy}
\end{decl}
Note that the absence of "#2" in the \textit{custom-head-spec},
suppresses the theorem number and that the \emph{space} after "#1"
and the command "(\mdseries#3)" sets the optional note in medium size
within parentheses and with a preceding space.
Now if you try to produce
\begin{newRiemann}\label{corrRiemann}
Every open simply connected proper subset of $\mathbb{C}$ is
analytically homeomorphic to the open unit disk in $\mathbb{C}$.
\end{newRiemann}
by typing
\begin{decl}
|\theoremstyle|\Arg{diffnotenonum}\\
|\newtheorem|\Arg{Riemann}\Arg{Riemann Mapping THeorem}\\
\\
|\begin|\Arg{Riemann}\\
|Every open simply connected proper subset of |\\
|$\mathbb{C}$ is analytically homeomorphic to |\\
|the open unit disk in $\mathbb{C}$. |\\
|\end|\Arg{Riemann}
\end{decl}
you'll get
\begin{Riemann}
Every open simply connected proper subset of $\mathbb{C}$ is
analytically homeomorphic to the open unit disk in $\mathbb{C}$.
\end{Riemann}
Do you see what's happened? In the "\theoremstyle{diffnotenonum}", the
parameter controlling the \textit{note} part of the
\textit{theoremhead} was defined as "(\mdseries #3)" and in the
"\newtheorem"\allowbreak\Arg{Riemann}, there is no optional note, so that in the
output, you get an empty ``note'', \emph{enclosed in parantheses} (and
also with a preceding space).
To get around these difficulties, you can use the commands "\thmname",
"\thmnumber" and "\thmnote" \emph{within} the
\arg{custom-head-spec} as
\begin{decl}
|{\thmname|\arg{commands\string#1}|%|\\
| \thmnumber|\arg{commands\string#2}|%|\\
| \thmnote|\arg{commands\string#3}
\end{decl}
Each of these three commands will typeset its argument
\emph{if and only if the corresponding argument in the} "\thmhead"
\emph{is non empty}. Thus the correct way to get the \textbf{Riemann
Mapping theorem} in Page~\pageref{corrRiemann} is to input
\begin{decl}
|\newtheoremstyle|\Arg{newdiffnotenonum}|{}{}%|\\
| {\itshape}{}{\bfseries}{.}{ }%|\\
| {\thmname{#1}\thmnote{ (\mdseries #3)}}|\\
\\
|\theoremstyle|\Arg{newdiffnotenonum}\\
|\newtheorem|\Arg{newRiemann}\Arg{Riemann Mapping Theorem}\\
\\
|\begin|\Arg{newRiemann}\\
|Every open simply connected proper subset of |\\
|$\mathbb{C}$ is analytically homeomorphic to the|\\
|open unit disk in $\mathbb{C}$. |\\
|\end|\Arg{newRiemann}
\end{decl}
Then you can also produce \textbf{Cauchy's Theorem} in
Page~\pageref{Cauchy} by typing
\begin{decl}
|\theoremstyle|\Arg{newdiffnotenonum}\\
|\newtheorem|\Arg{newCuchy}\Arg{Cauchy's Theorem}\\
\\
|\begin|\Arg{newCauchy}\Oarg{Third Version}\\
|If $G$ is a simply connected open subset of $\mathbb{C}$, then for|\\
|every closed rectifiable curve $\gamma$ in $G$, we have|\\
|\begin|\Arg{equation*}\\
| \int_\gamma f=0|\\
|\end|\Arg{equation*}\\
|\end|\Arg{newCauchy}
\end{decl}
The output will be exactly the same as that seen in
Page~\pageref{Cauchy}.
Now suppose you want to highlight certain theorems
from other sources in your document, such as
\begin{cit}[Axiom 1 in \cite{eu}]
Things that are equal to the same thing are equal to one another.
\end{cit}
\noindent This can be done as follows
\begin{decl}
|\newtheoremstyle|\Arg{citing}|{}{}{\itshape}{}%|\\
| {\bfseries}{.}{ }{\thmnote{#3}} |\\
\\
|\theoremstyle|\Arg{citing}\\
|\newtheorem|\Arg{cit}|{}|\\
\\
|\begin|\Arg{cit}|[Axiom 1 in \cite{eu}]|\\
|Things that are equal to the same thing are equal to one another.|\\
|\end|\Arg{cit}
\end{decl}
Of course, your \textit{bibliography} should include the citation with
\textit{label} "eu".
\subsection{There's more!}
There are some more predefined features in \textsf{amsthm} package. In
all the different examples we've seen so far, the \textit{theorem number}
comes after the \textit{theorem name}. Some prefer to have it the
other way round as in
\begin{numfirstthm}[Euclid]
The sum of the angles in a triangle is $180^\circ$
\end{numfirstthm}
\noindent This effect is produced by the command "\swapnumbers" as
shown below
\begin{screen}
\clearpage
\end{screen}
\begin{decl}
|\swapnumbers|\\
|\theoremstyle|\Arg{plain}\\
|\newtheorem|\Arg{numfirstthm}\Arg{Theorem}\Oarg{section}\\
\\
|\begin|\Arg{numfirstthm}\Oarg{Euclid}\\
|The sum of the angles in a triangle is $180^\circ$|\\
|\end|\Arg{numfirstthm}
\end{decl}
Note that the "\swapnumbers" command is sort of toggle-switch, so
that once it is given, \emph{all subsequent theorem-like statements}
will have their numbers first. If you want it the other way for some
other theorem, then give "\swapnumbers" again before its definition.
A quick way to suppress \textit{theoremnumbers} is to use the
"\newtheorem*" command as in
\begin{decl}
|\newtheorem*|\Arg{numlessthm}\Arg{Theorem}\Oarg{section}\\
\\
|\begin|\Arg{numlessthm}\Oarg{Euclid}\\
|The sum of the angles in a triangle is $180^$. |\\
|\end|\Arg{numlessthm}
\end{decl}
to produce
\begin{numlessthm}[Euclid]
The sum of the angles in a triangle is $180^\circ$.
\end{numlessthm}
\noindent Note that this could also be done by leaving out "#2" in
the \textit{custom-head-spec} parameter of "\newtheoremstyle", as seen
earlier.
We've been talking only about \emph{theorems} so far, but
Mathematicians do not live by theorems alone; they need \emph{proofs}.
The \textsf{amsthm} package contains a predefined "proof" environment
so that the proof of a theorem-like statement can be enclosed within
"\begin{proof}...\end{proof}" commands as shown below
\medskip
\begin{Decl}
|\begin|\Arg{thmsec} \\
|The number of primes is infinite|\\
|\end|\Arg{thmsec}\\
\\
|\begin|\Arg{proof}\\
|Let $\{p_1,p_2,\dotsc p_k\}$ be a finite set of primes. Define |\\
|$n=p_1p_2\dotsm p_k+1$. Then either $n$ itself is a prime or has |\\
|a prime factor. Now $n$ is neither equal to nor is divisible by |\\
|any of the primes $p_1,p_2,\dotsc p_k$ so that in either case, |\\
|we get a prime different from $p_1,p_2\dotsc p_k$. Thus no finite|\\
|set of primes includes all the primes. |\\
|\end|\Arg{proof}
\end{Decl}
to produce the following output
\begin{thmsec}
The number of primes is infinite
\end{thmsec}
\begin{proof}
Let $\{p_1,p_2,\dotsc p_k\}$ be a finite set of primes. Define
$n=p_1p_2\dotsm p_k+1$. Then either $n$ itself is a prime or has a
prime factor. Now $n$ is neither equal to nor is divisible by any of
the primes $p_1,p_2,\dotsc p_k$ so that in either case, we get a prime
different from $p_1,p_2\dotsc p_k$. Thus no finite set of primes can
include all the primes.
\end{proof}
There is an optional argument to the "proof" environment which can be
used to change the \textit{proofhead}. For example,
\begin{decl}
|\begin|\Arg{proof}|[\textsc{Proof\,(Euclid)}:]|\\
|Let $\{p_1,p_2,\dotsc p_k\}$ be a finite set of primes. Define |\\
|$n=p_1p_2\dotsm p_k+1$. Then either $n$ itself is a prime or has |\\
|a prime factor. Now $n$ is neither equal to nor is divisible by |\\
|any of the primes $p_1,p_2,\dotsc p_k$ so that in either case, we |\\
|get a prime different from $p_1,p_2\dotsc p_k$. Thus no finite |\\
|set of primes includes all the primes. |\\
|\end|\Arg{proof}
\end{decl}
produces the following
\begin{proof}[\textsc{Proof\,(Euclid):}]
Let $\{p_1,p_2,\dotsc p_k\}$ be a finite set of primes. Define
$n=p_1p_2\dotsm p_k+1$. Then either $n$ itself is a prime or has a
prime factor. Now $n$ is neither equal to nor is divisible by any of
the primes $p_1,p_2,\dotsc p_k$ so that in either case, we get a prime
different from $p_1,p_2\dotsc p_k$. Thus no finite set of primes can
include all the primes.
\end{proof}
\noindent Note that the end of a proof is \emph{automatically}
marked with a \qedsymbol\ which is defined in the package by the
command "\qedsymbol". If you wish to change it, use "\renewcommand" to
redefine the "\qedsymbol". Thus if you like the original ``Halmos
symbol''\quad {\rule{1mm}{2.5mm}}\quad to mark the ends of your proofs, include
\begin{decl}
|\newcommand{\halmos}{\rule{1mm}{2.5mm}}|\\
|\renewcommand{\qedsymbol}{\halmos}|\\
\end{decl}
in the preamble to your document.
Again, the placement of the "\qedsymbol" at the \emph{end} of the last
line of the proof is done via the command "\qed". The default
placement may not be very pleasing in some cases as in
\begin{thmsec}
The square of the sum of two numbers is equal to the sum of their
squares and twice their product.
\end{thmsec}
\begin{proof}
This follows easily from the equation
\begin{equation*}
(x+y)^2=x^2+y^2+2xy
\end{equation*}
\end{proof}
\noindent It'd be better if this is typeset as
\begin{thmsec}
The square of the sum of two numbers is equal to the sum of their
squares and twice their product.
\end{thmsec}
\begin{proof}
This follows easily from the equation
\begin{equation}
(x+y)^2=x^2+y^2+2xy\tag*{\qed}
\end{equation}
\renewcommand{\qed}{}
\end{proof}
\noindent which is achieved by the input shown below:
\begin{decl}
|\begin|\Arg{proof}\\
|This follows easily from the equation|\\
|\begin|\Arg{equation}\\
| (x+y)^2=x^2+y^2+2xy\tag*{\qed}|\\
|\end|\Arg{equation}\\
|\renewcommand{\qed}{}|
|\end|\Arg{proof}
\end{decl}
For this trick to work, you must have loaded the package "amsmath"
\emph{without} the "leqno" option. Or, if you prefer
\begin{proof}
This follows easily from the equation
\begin{equation*}
(x+y)^2=x^2+y^2+2xy\qed
\end{equation*}
\renewcommand{\qed}{}
\end{proof}
\noindent Then you can use
\begin{Decl}
|\begin|\Arg{proof}\\
|This follows easily from the equation|\\
|\begin|\Arg{equation*}\\
| (x+y)^2=x^2+y^2+2xy\qed|\\
|\end|\Arg{equation*}\\
|\renewcommand{\qed}{}|\\
|\end|\Arg{proof}
\end{Decl}
\section{Housekeeping}
It's better to keep all "\newtheoremstyle" commands in the preamble
than scattering them all over the document.
Then you can divide your "\newtheorem" commands into groups and
preface each group with the appropriate "\theoremstyle".
Moreover, you can keep all your "\newtheoremstyle" in a ".thm" file,
for instance "mystyles.thm", and load it on demand in various documents
using
\begin{decl}
|\usepackage|\Oarg{mystyles}\Arg{amsthm}
\end{decl}
This method fails if the "amsthm" has already been loaded by the
documentclass such as "amsart". In that case, you will have to use
\begin{decl}
|\PassOptionsToPackage|\Arg{mystyles}\Arg{amsthm}
\end{decl}
Have fun!
%\enddocument
\begin{thebibliography}{9}
\bibitem{eu} Euclid, \textit{The Elements}, Greece 300 BC
\end{thebibliography}
\end{document}