doc-src/TutorialI/Inductive/document/Advanced.tex
author paulson
Tue, 12 Dec 2000 11:57:33 +0100
changeset 10645 175ccbd5415a
parent 10617 adc0ed64a120
child 10668 3b84288e60b7
permissions -rw-r--r--
auto-updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
     1
%
a17cf465d29a auto generated
paulson
parents:
diff changeset
     2
\begin{isabellebody}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
     3
\def\isabellecontext{Advanced}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
     4
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
     5
\isacommand{theory}\ Advanced\ {\isacharequal}\ Even{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
     6
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
     7
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
     8
\isacommand{datatype}\ {\isacharprime}f\ gterm\ {\isacharequal}\ Apply\ {\isacharprime}f\ {\isachardoublequote}{\isacharprime}f\ gterm\ list{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
     9
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    10
\isacommand{datatype}\ integer{\isacharunderscore}op\ {\isacharequal}\ Number\ int\ {\isacharbar}\ UnaryMinus\ {\isacharbar}\ Plus\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    11
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    12
\isacommand{consts}\ gterms\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}f\ set\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    13
\isacommand{inductive}\ {\isachardoublequote}gterms\ F{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    14
\isakeyword{intros}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    15
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ args{\isachardot}\ t\ {\isasymin}\ gterms\ F{\isacharsemicolon}\ \ f\ {\isasymin}\ F{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    16
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ gterms\ F{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    17
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    18
\isacommand{lemma}\ gterms{\isacharunderscore}mono{\isacharcolon}\ {\isachardoublequote}F{\isasymsubseteq}G\ {\isasymLongrightarrow}\ gterms\ F\ {\isasymsubseteq}\ gterms\ G{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    19
\isacommand{apply}\ clarify\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    20
\isacommand{apply}\ {\isacharparenleft}erule\ gterms{\isachardot}induct{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    21
\isacommand{apply}\ blast\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    22
\isacommand{done}%
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    23
\begin{isamarkuptext}%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    24
The situation after induction
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    25
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    26
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{2}}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    27
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    28
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    29
F\ {\isasymsubseteq}\ G\ {\isasymLongrightarrow}\ gterms\ F\ {\isasymsubseteq}\ gterms\ G\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    30
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    31
\ \ \ \ \ \ \ {\isasymlbrakk}F\ {\isasymsubseteq}\ G{\isacharsemicolon}\ {\isasymforall}t{\isasymin}set\ args{\isachardot}\ t\ {\isasymin}\ gterms\ F\ {\isasymand}\ t\ {\isasymin}\ gterms\ G{\isacharsemicolon}\ f\ {\isasymin}\ F{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    32
\ \ \ \ \ \ \ {\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ G%
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    33
\end{isamarkuptext}%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    34
%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    35
\begin{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    36
We completely forgot about "rule inversion". 
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    37
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    38
\begin{isabelle}%
10645
175ccbd5415a auto-updated
paulson
parents: 10617
diff changeset
    39
\ \ \ \ \ {\isasymlbrakk}a\ {\isasymin}\ even{\isacharsemicolon}\ a\ {\isacharequal}\ {\isadigit{0}}\ {\isasymLongrightarrow}\ P{\isacharsemicolon}\ {\isasymAnd}n{\isachardot}\ {\isasymlbrakk}a\ {\isacharequal}\ Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}{\isacharsemicolon}\ n\ {\isasymin}\ even{\isasymrbrakk}\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ P%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    40
\end{isabelle}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    41
\rulename{even.cases}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    42
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    43
Just as a demo I include
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    44
the two forms that Markus has made available. First the one for binding the
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    45
result to a name%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    46
\end{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    47
\isacommand{inductive{\isacharunderscore}cases}\ Suc{\isacharunderscore}Suc{\isacharunderscore}cases\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\isanewline
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    48
\ \ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    49
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    50
\isacommand{thm}\ Suc{\isacharunderscore}Suc{\isacharunderscore}cases%
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    51
\begin{isamarkuptext}%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    52
\begin{isabelle}%
10645
175ccbd5415a auto-updated
paulson
parents: 10617
diff changeset
    53
\ \ \ \ \ {\isasymlbrakk}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isacharsemicolon}\ n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ P%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    54
\end{isabelle}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    55
\rulename{Suc_Suc_cases}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    56
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    57
and now the one for local usage:%
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    58
\end{isamarkuptext}%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    59
\isacommand{lemma}\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even\ {\isasymLongrightarrow}\ P\ n{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    60
\isacommand{apply}\ {\isacharparenleft}ind{\isacharunderscore}cases\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    61
\isacommand{oops}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    62
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    63
\isacommand{inductive{\isacharunderscore}cases}\ gterm{\isacharunderscore}Apply{\isacharunderscore}elim\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}Apply\ f\ args\ {\isasymin}\ gterms\ F{\isachardoublequote}%
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    64
\begin{isamarkuptext}%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    65
this is what we get:
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    66
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    67
\begin{isabelle}%
10645
175ccbd5415a auto-updated
paulson
parents: 10617
diff changeset
    68
\ \ \ \ \ {\isasymlbrakk}Apply\ f\ args\ {\isasymin}\ gterms\ F{\isacharsemicolon}\ {\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\ t\ {\isasymin}\ gterms\ F{\isacharsemicolon}\ f\ {\isasymin}\ F{\isasymrbrakk}\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ P%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    69
\end{isabelle}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    70
\rulename{gterm_Apply_elim}%
10457
dd669bda2b0c updated;
wenzelm
parents: 10365
diff changeset
    71
\end{isamarkuptext}%
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    72
\isacommand{lemma}\ gterms{\isacharunderscore}IntI\ {\isacharbrackleft}rule{\isacharunderscore}format{\isacharbrackright}{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    73
\ \ \ \ \ {\isachardoublequote}t\ {\isasymin}\ gterms\ F\ {\isasymLongrightarrow}\ t\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ t\ {\isasymin}\ gterms\ {\isacharparenleft}F{\isasyminter}G{\isacharparenright}{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    74
\isacommand{apply}\ {\isacharparenleft}erule\ gterms{\isachardot}induct{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    75
\isacommand{apply}\ blast\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    76
\isacommand{done}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    77
\begin{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    78
Subgoal after induction.  How would we cope without rule inversion?
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    79
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    80
pr(latex xsymbols symbols)
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    81
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    82
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{1}}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    83
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    84
goal\ {\isacharparenleft}lemma\ gterms{\isacharunderscore}IntI{\isacharparenright}{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    85
t\ {\isasymin}\ gterms\ F\ {\isasymLongrightarrow}\ t\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ t\ {\isasymin}\ gterms\ {\isacharparenleft}F\ {\isasyminter}\ G{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    86
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}args\ f{\isachardot}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    87
\ \ \ \ \ \ \ {\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\ t\ {\isasymin}\ gterms\ F\ {\isasymand}\ {\isacharparenleft}t\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ t\ {\isasymin}\ gterms\ {\isacharparenleft}F\ {\isasyminter}\ G{\isacharparenright}{\isacharparenright}{\isacharsemicolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    88
\ \ \ \ \ \ \ \ \ \ f\ {\isasymin}\ F{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    89
\ \ \ \ \ \ \ {\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ {\isacharparenleft}F\ {\isasyminter}\ G{\isacharparenright}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    90
\end{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    91
%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    92
\begin{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    93
\begin{isabelle}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    94
\ \ \ \ \ mono\ f\ {\isasymLongrightarrow}\ f\ {\isacharparenleft}A\ {\isasyminter}\ B{\isacharparenright}\ {\isasymsubseteq}\ f\ A\ {\isasyminter}\ f\ B%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    95
\end{isabelle}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    96
\rulename{mono_Int}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    97
\end{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    98
\isacommand{lemma}\ gterms{\isacharunderscore}Int{\isacharunderscore}eq\ {\isacharbrackleft}simp{\isacharbrackright}{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
    99
\ \ \ \ \ {\isachardoublequote}gterms\ {\isacharparenleft}F{\isasyminter}G{\isacharparenright}\ {\isacharequal}\ gterms\ F\ {\isasyminter}\ gterms\ G{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   100
\isacommand{apply}\ {\isacharparenleft}rule\ equalityI{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   101
\isacommand{apply}\ {\isacharparenleft}blast\ intro{\isacharbang}{\isacharcolon}\ mono{\isacharunderscore}Int\ monoI\ gterms{\isacharunderscore}mono{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   102
\isacommand{apply}\ {\isacharparenleft}blast\ intro{\isacharbang}{\isacharcolon}\ gterms{\isacharunderscore}IntI{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   103
\isacommand{done}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   104
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   105
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   106
\isacommand{consts}\ integer{\isacharunderscore}arity\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}integer{\isacharunderscore}op\ {\isasymRightarrow}\ nat{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   107
\isacommand{primrec}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   108
{\isachardoublequote}integer{\isacharunderscore}arity\ {\isacharparenleft}Number\ n{\isacharparenright}\ \ \ \ \ \ \ \ {\isacharequal}\ {\isacharhash}{\isadigit{0}}{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   109
{\isachardoublequote}integer{\isacharunderscore}arity\ UnaryMinus\ \ \ \ \ \ \ \ {\isacharequal}\ {\isacharhash}{\isadigit{1}}{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   110
{\isachardoublequote}integer{\isacharunderscore}arity\ Plus\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharequal}\ {\isacharhash}{\isadigit{2}}{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   111
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   112
\isacommand{consts}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ nat{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   113
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   114
\isakeyword{intros}\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   115
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ args{\isachardot}\ t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isacharsemicolon}\ \ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   116
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   117
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   118
\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   119
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   120
\isacommand{consts}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ nat{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   121
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   122
\isakeyword{intros}\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   123
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}args\ {\isasymin}\ lists\ {\isacharparenleft}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isacharparenright}{\isacharsemicolon}\ \ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   124
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   125
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   126
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   127
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   128
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   129
\isacommand{apply}\ clarify\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   130
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isachardot}induct{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   131
\isacommand{apply}\ auto\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   132
\isacommand{done}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   133
\begin{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   134
The situation after clarify (note the induction hypothesis!)
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   135
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   136
pr(latex xsymbols symbols)
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   137
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   138
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{2}}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   139
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   140
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   141
well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   142
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   143
\ \ \ \ \ \ \ {\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   144
\ \ \ \ \ \ \ \ \ \ \ t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymand}\ t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isacharsemicolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   145
\ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   146
\ \ \ \ \ \ \ {\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   147
\end{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   148
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   149
\isacommand{apply}\ clarify\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   150
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}{\isachardot}induct{\isacharparenright}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   151
\isacommand{apply}\ auto\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   152
\isacommand{done}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   153
\begin{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   154
\begin{isabelle}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   155
\ \ \ \ \ lists\ {\isacharparenleft}A\ {\isasyminter}\ B{\isacharparenright}\ {\isacharequal}\ lists\ A\ {\isasyminter}\ lists\ B%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   156
\end{isabelle}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   157
\rulename{lists_Int_eq}
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   158
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   159
The situation after clarify (note the strange induction hypothesis!)
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   160
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   161
pr(latex xsymbols symbols)
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   162
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   163
proof\ {\isacharparenleft}prove{\isacharparenright}{\isacharcolon}\ step\ {\isadigit{2}}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   164
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   165
goal\ {\isacharparenleft}lemma{\isacharparenright}{\isacharcolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   166
well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   167
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   168
\ \ \ \ \ \ \ {\isasymlbrakk}args\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   169
\ \ \ \ \ \ \ \ {\isasymin}\ lists\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   170
\ \ \ \ \ \ \ \ \ \ \ {\isacharparenleft}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasyminter}\ {\isacharbraceleft}u{\isachardot}\ u\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isacharbraceright}{\isacharparenright}{\isacharsemicolon}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   171
\ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   172
\ \ \ \ \ \ \ {\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   173
\end{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   174
%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   175
\begin{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   176
the rest isn't used: too complicated.  OK for an exercise though.%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   177
\end{isamarkuptext}%
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   178
\isacommand{consts}\ integer{\isacharunderscore}signature\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}integer{\isacharunderscore}op\ {\isacharasterisk}\ {\isacharparenleft}unit\ list\ {\isacharasterisk}\ unit{\isacharparenright}{\isacharparenright}\ set{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   179
\isacommand{inductive}\ {\isachardoublequote}integer{\isacharunderscore}signature{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   180
\isakeyword{intros}\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   181
Number{\isacharcolon}\ \ \ \ \ {\isachardoublequote}{\isacharparenleft}Number\ n{\isacharcomma}\ \ \ {\isacharparenleft}{\isacharbrackleft}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   182
UnaryMinus{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}UnaryMinus{\isacharcomma}\ {\isacharparenleft}{\isacharbrackleft}{\isacharparenleft}{\isacharparenright}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   183
Plus{\isacharcolon}\ \ \ \ \ \ \ {\isachardoublequote}{\isacharparenleft}Plus{\isacharcomma}\ \ \ \ \ \ \ {\isacharparenleft}{\isacharbrackleft}{\isacharparenleft}{\isacharparenright}{\isacharcomma}{\isacharparenleft}{\isacharparenright}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   184
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   185
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   186
\isacommand{consts}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ {\isacharprime}t\ list\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}f\ gterm\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}set{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   187
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   188
\isakeyword{intros}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   189
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   190
\ \ \ \ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}pair\ {\isasymin}\ set\ args{\isachardot}\ pair\ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isacharsemicolon}\ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   191
\ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ args{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   192
\ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ args{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   193
\ \ \ \ \ \ \ \ \ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   194
\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   195
\isacommand{consts}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ {\isacharprime}t\ list\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}f\ gterm\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}set{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   196
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   197
\isakeyword{intros}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   198
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   199
\ \ \ \ {\isachardoublequote}{\isasymlbrakk}args\ {\isasymin}\ lists{\isacharparenleft}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isacharparenright}{\isacharsemicolon}\ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   200
\ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ args{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   201
\ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ args{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ \isanewline
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   202
\ \ \ \ \ \ \ \ \ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   203
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   204
\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   205
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   206
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig\ {\isasymsubseteq}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   207
\isacommand{apply}\ clarify\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   208
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isachardot}induct{\isacharparenright}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   209
\isacommand{apply}\ auto\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   210
\isacommand{done}\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   211
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   212
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig\ {\isasymsubseteq}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   213
\isacommand{apply}\ clarify\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   214
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}{\isachardot}induct{\isacharparenright}\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   215
\isacommand{apply}\ auto\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   216
\isacommand{done}\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   217
\isanewline
10469
7813f5ccfb18 auto update
paulson
parents: 10457
diff changeset
   218
\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   219
\isacommand{end}\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   220
\isanewline
a17cf465d29a auto generated
paulson
parents:
diff changeset
   221
\end{isabellebody}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   222
%%% Local Variables:
a17cf465d29a auto generated
paulson
parents:
diff changeset
   223
%%% mode: latex
a17cf465d29a auto generated
paulson
parents:
diff changeset
   224
%%% TeX-master: "root"
a17cf465d29a auto generated
paulson
parents:
diff changeset
   225
%%% End: