--- a/doc-src/TutorialI/Misc/document/AdvancedInd.tex Tue Apr 17 15:03:41 2001 +0200
+++ b/doc-src/TutorialI/Misc/document/AdvancedInd.tex Tue Apr 17 16:54:38 2001 +0200
@@ -120,7 +120,15 @@
\isacommand{consts}\ f\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}nat\ {\isasymRightarrow}\ nat{\isachardoublequote}\isanewline
\isacommand{axioms}\ f{\isacharunderscore}ax{\isacharcolon}\ {\isachardoublequote}f{\isacharparenleft}f{\isacharparenleft}n{\isacharparenright}{\isacharparenright}\ {\isacharless}\ f{\isacharparenleft}Suc{\isacharparenleft}n{\isacharparenright}{\isacharparenright}{\isachardoublequote}%
\begin{isamarkuptext}%
-\noindent
+\begin{warn}
+We discourage the use of axioms because of the danger of
+inconsistencies. Axiom \isa{f{\isacharunderscore}ax} does
+not introduce an inconsistency because, for example, the identity function
+satisfies it. Axioms can be useful in exploratory developments, say when
+you assume some well-known theorems so that you can quickly demonstrate some
+point about methodology. If your example turns into a substantial proof
+development, you should replace axioms by theorems.
+\end{warn}\noindent
The axiom for \isa{f} implies \isa{n\ {\isasymle}\ f\ n}, which can
be proved by induction on \mbox{\isa{f\ n}}. Following the recipe outlined
above, we have to phrase the proposition as follows to allow induction:%
@@ -193,41 +201,34 @@
\end{isamarkuptext}%
\isacommand{lemma}\ f{\isacharunderscore}incr{\isacharbrackleft}rule{\isacharunderscore}format{\isacharcomma}\ OF\ refl{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymforall}i{\isachardot}\ k\ {\isacharequal}\ f\ i\ {\isasymlongrightarrow}\ i\ {\isasymle}\ f\ i{\isachardoublequote}%
\begin{isamarkuptext}%
-\begin{warn}
-We discourage the use of axioms because of the danger of
-inconsistencies. Axiom \isa{f{\isacharunderscore}ax} does
-not introduce an inconsistency because, for example, the identity function
-satisfies it. Axioms can be useful in exploratory developments, say when
-you assume some well-known theorems so that you can quickly demonstrate some
-point about methodology. If your example turns into a substantial proof
-development, you should replace the axioms by proofs.
-\end{warn}
+\begin{exercise}
+From the axiom and lemma for \isa{f}, show that \isa{f} is the
+identity function.
+\end{exercise}
-\bigskip
-In general, \isa{induct{\isacharunderscore}tac} can be applied with any rule $r$
+Method \isa{induct{\isacharunderscore}tac} can be applied with any rule $r$
whose conclusion is of the form ${?}P~?x@1 \dots ?x@n$, in which case the
format is
\begin{quote}
\isacommand{apply}\isa{{\isacharparenleft}induct{\isacharunderscore}tac} $y@1 \dots y@n$ \isa{rule{\isacharcolon}} $r$\isa{{\isacharparenright}}
\end{quote}\index{*induct_tac}%
where $y@1, \dots, y@n$ are variables in the first subgoal.
-A further example of a useful induction rule is \isa{length{\isacharunderscore}induct},
-induction on the length of a list:\indexbold{*length_induct}
-\begin{isabelle}%
-\ \ \ \ \ {\isacharparenleft}{\isasymAnd}xs{\isachardot}\ {\isasymforall}ys{\isachardot}\ length\ ys\ {\isacharless}\ length\ xs\ {\isasymlongrightarrow}\ P\ ys\ {\isasymLongrightarrow}\ P\ xs{\isacharparenright}\ {\isasymLongrightarrow}\ P\ xs%
-\end{isabelle}
-
-In fact, \isa{induct{\isacharunderscore}tac} even allows the conclusion of
-$r$ to be an (iterated) conjunction of formulae of the above form, in
-which case the application is
+The conclusion of $r$ can even be an (iterated) conjunction of formulae of
+the above form in which case the application is
\begin{quote}
\isacommand{apply}\isa{{\isacharparenleft}induct{\isacharunderscore}tac} $y@1 \dots y@n$ \isa{and} \dots\ \isa{and} $z@1 \dots z@m$ \isa{rule{\isacharcolon}} $r$\isa{{\isacharparenright}}
\end{quote}
-\begin{exercise}
-From the axiom and lemma for \isa{f}, show that \isa{f} is the
-identity function.
-\end{exercise}%
+A further useful induction rule is \isa{length{\isacharunderscore}induct},
+induction on the length of a list\indexbold{*length_induct}
+\begin{isabelle}%
+\ \ \ \ \ {\isacharparenleft}{\isasymAnd}xs{\isachardot}\ {\isasymforall}ys{\isachardot}\ length\ ys\ {\isacharless}\ length\ xs\ {\isasymlongrightarrow}\ P\ ys\ {\isasymLongrightarrow}\ P\ xs{\isacharparenright}\ {\isasymLongrightarrow}\ P\ xs%
+\end{isabelle}
+which is a special case of \isa{measure{\isacharunderscore}induct}
+\begin{isabelle}%
+\ \ \ \ \ {\isacharparenleft}{\isasymAnd}x{\isachardot}\ {\isasymforall}y{\isachardot}\ f\ y\ {\isacharless}\ f\ x\ {\isasymlongrightarrow}\ P\ y\ {\isasymLongrightarrow}\ P\ x{\isacharparenright}\ {\isasymLongrightarrow}\ P\ a%
+\end{isabelle}
+where \isa{f} may be any function into type \isa{nat}.%
\end{isamarkuptext}%
%
\isamarkupsubsection{Derivation of New Induction Schemas%
@@ -259,9 +260,9 @@
\end{isabelle}
Now it is straightforward to derive the original version of
-\isa{nat{\isacharunderscore}less{\isacharunderscore}induct} by manipulting the conclusion of the above lemma:
-instantiate \isa{n} by \isa{Suc\ n} and \isa{m} by \isa{n} and
-remove the trivial condition \isa{n\ {\isacharless}\ Suc\ n}. Fortunately, this
+\isa{nat{\isacharunderscore}less{\isacharunderscore}induct} by manipulating the conclusion of the above
+lemma: instantiate \isa{n} by \isa{Suc\ n} and \isa{m} by \isa{n}
+and remove the trivial condition \isa{n\ {\isacharless}\ Suc\ n}. Fortunately, this
happens automatically when we add the lemma as a new premise to the
desired goal:%
\end{isamarkuptext}%