doc-src/TutorialI/Inductive/document/Even.tex
author berghofe
Wed, 11 Jul 2007 10:53:39 +0200
changeset 23733 3f8ad7418e55
parent 21261 58223c67fd8b
child 23848 ca73e86c22bb
permissions -rw-r--r--
Adapted to new inductive definition package.
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{Even}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
     4
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
     5
\isadelimtheory
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
     6
\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
     7
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
     8
\endisadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
     9
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    10
\isatagtheory
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    11
\isacommand{theory}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    12
\ Even\ \isakeyword{imports}\ Main\ \isakeyword{begin}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    13
\endisatagtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    14
{\isafoldtheory}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    15
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    16
\isadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    17
\isanewline
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    18
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    19
\endisadelimtheory
10878
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
    20
\isanewline
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
    21
\isanewline
23733
3f8ad7418e55 Adapted to new inductive definition package.
berghofe
parents: 21261
diff changeset
    22
\isacommand{inductive{\isacharunderscore}set}\isamarkupfalse%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    23
\ even\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}nat\ set{\isachardoublequoteclose}\isanewline
23733
3f8ad7418e55 Adapted to new inductive definition package.
berghofe
parents: 21261
diff changeset
    24
\isakeyword{where}\isanewline
3f8ad7418e55 Adapted to new inductive definition package.
berghofe
parents: 21261
diff changeset
    25
\ \ zero{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequoteopen}{\isadigit{0}}\ {\isasymin}\ even{\isachardoublequoteclose}\isanewline
3f8ad7418e55 Adapted to new inductive definition package.
berghofe
parents: 21261
diff changeset
    26
{\isacharbar}\ step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequoteopen}n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ {\isacharparenleft}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}{\isacharparenright}\ {\isasymin}\ even{\isachardoublequoteclose}%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    27
\begin{isamarkuptext}%
10878
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
    28
An inductive definition consists of introduction rules. 
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    29
a17cf465d29a auto generated
paulson
parents:
diff changeset
    30
\begin{isabelle}%
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
    31
\ \ \ \ \ n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    32
\end{isabelle}
a17cf465d29a auto generated
paulson
parents:
diff changeset
    33
\rulename{even.step}
a17cf465d29a auto generated
paulson
parents:
diff changeset
    34
a17cf465d29a auto generated
paulson
parents:
diff changeset
    35
\begin{isabelle}%
23733
3f8ad7418e55 Adapted to new inductive definition package.
berghofe
parents: 21261
diff changeset
    36
\ \ \ \ \ {\isasymlbrakk}x\ {\isasymin}\ even{\isacharsemicolon}\ P\ {\isadigit{0}}{\isacharsemicolon}\ {\isasymAnd}n{\isachardot}\ {\isasymlbrakk}n\ {\isasymin}\ even{\isacharsemicolon}\ P\ n{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ {\isacharparenleft}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}{\isacharparenright}{\isasymrbrakk}\ {\isasymLongrightarrow}\ P\ x%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    37
\end{isabelle}
a17cf465d29a auto generated
paulson
parents:
diff changeset
    38
\rulename{even.induct}
a17cf465d29a auto generated
paulson
parents:
diff changeset
    39
a17cf465d29a auto generated
paulson
parents:
diff changeset
    40
Attributes can be given to the introduction rules.  Here both rules are
10878
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
    41
specified as \isa{intro!}
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
    42
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
    43
Our first lemma states that numbers of the form $2\times k$ are even.%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    44
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    45
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    46
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    47
\ two{\isacharunderscore}times{\isacharunderscore}even{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequoteopen}{\isadigit{2}}{\isacharasterisk}k\ {\isasymin}\ even{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    48
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    49
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    50
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    51
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    52
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    53
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    54
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    55
\ {\isacharparenleft}induct{\isacharunderscore}tac\ k{\isacharparenright}%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    56
\begin{isamarkuptxt}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    57
The first step is induction on the natural number \isa{k}, which leaves
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    58
two subgoals:
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    59
\begin{isabelle}%
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
    60
\ {\isadigit{1}}{\isachardot}\ {\isadigit{2}}\ {\isacharasterisk}\ {\isadigit{0}}\ {\isasymin}\ even\isanewline
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
    61
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}n{\isachardot}\ {\isadigit{2}}\ {\isacharasterisk}\ n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ {\isadigit{2}}\ {\isacharasterisk}\ Suc\ n\ {\isasymin}\ even%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    62
\end{isabelle}
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    63
Here \isa{auto} simplifies both subgoals so that they match the introduction
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    64
rules, which then are applied automatically.%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
    65
\end{isamarkuptxt}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    66
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    67
\ \isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    68
\ auto\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    69
\isacommand{done}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    70
%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    71
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    72
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    73
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    74
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    75
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    76
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11708
diff changeset
    77
%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
    78
\begin{isamarkuptext}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
    79
Our goal is to prove the equivalence between the traditional definition
a17cf465d29a auto generated
paulson
parents:
diff changeset
    80
of even (using the divides relation) and our inductive definition.  Half of
a17cf465d29a auto generated
paulson
parents:
diff changeset
    81
this equivalence is trivial using the lemma just proved, whose \isa{intro!}
a17cf465d29a auto generated
paulson
parents:
diff changeset
    82
attribute ensures it will be applied automatically.%
a17cf465d29a auto generated
paulson
parents:
diff changeset
    83
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    84
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    85
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    86
\ dvd{\isacharunderscore}imp{\isacharunderscore}even{\isacharcolon}\ {\isachardoublequoteopen}{\isadigit{2}}\ dvd\ n\ {\isasymLongrightarrow}\ n\ {\isasymin}\ even{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    87
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    88
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    89
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    90
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    91
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    92
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    93
\isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    94
\ {\isacharparenleft}auto\ simp\ add{\isacharcolon}\ dvd{\isacharunderscore}def{\isacharparenright}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    95
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    96
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    97
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    98
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
    99
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   100
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11708
diff changeset
   101
%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   102
\begin{isamarkuptext}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   103
our first rule induction!%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   104
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   105
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   106
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   107
\ even{\isacharunderscore}imp{\isacharunderscore}dvd{\isacharcolon}\ {\isachardoublequoteopen}n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ {\isadigit{2}}\ dvd\ n{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   108
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   109
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   110
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   111
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   112
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   113
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   114
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   115
\ {\isacharparenleft}erule\ even{\isachardot}induct{\isacharparenright}%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   116
\begin{isamarkuptxt}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   117
\begin{isabelle}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   118
\ {\isadigit{1}}{\isachardot}\ {\isadigit{2}}\ dvd\ {\isadigit{0}}\isanewline
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   119
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}n{\isachardot}\ {\isasymlbrakk}n\ {\isasymin}\ even{\isacharsemicolon}\ {\isadigit{2}}\ dvd\ n{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isadigit{2}}\ dvd\ Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   120
\end{isabelle}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   121
\end{isamarkuptxt}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   122
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   123
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   124
\ {\isacharparenleft}simp{\isacharunderscore}all\ add{\isacharcolon}\ dvd{\isacharunderscore}def{\isacharparenright}%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   125
\begin{isamarkuptxt}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   126
\begin{isabelle}%
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   127
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}n{\isachardot}\ {\isasymlbrakk}n\ {\isasymin}\ even{\isacharsemicolon}\ {\isasymexists}k{\isachardot}\ n\ {\isacharequal}\ {\isadigit{2}}\ {\isacharasterisk}\ k{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isasymexists}k{\isachardot}\ Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isacharequal}\ {\isadigit{2}}\ {\isacharasterisk}\ k%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   128
\end{isabelle}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   129
\end{isamarkuptxt}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   130
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   131
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   132
\ clarify%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   133
\begin{isamarkuptxt}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   134
\begin{isabelle}%
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   135
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}n\ k{\isachardot}\ {\isadigit{2}}\ {\isacharasterisk}\ k\ {\isasymin}\ even\ {\isasymLongrightarrow}\ {\isasymexists}ka{\isachardot}\ Suc\ {\isacharparenleft}Suc\ {\isacharparenleft}{\isadigit{2}}\ {\isacharasterisk}\ k{\isacharparenright}{\isacharparenright}\ {\isacharequal}\ {\isadigit{2}}\ {\isacharasterisk}\ ka%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   136
\end{isabelle}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   137
\end{isamarkuptxt}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   138
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   139
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   140
\ {\isacharparenleft}rule{\isacharunderscore}tac\ x\ {\isacharequal}\ {\isachardoublequoteopen}Suc\ k{\isachardoublequoteclose}\ \isakeyword{in}\ exI{\isacharcomma}\ simp{\isacharparenright}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   141
\isacommand{done}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   142
%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   143
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   144
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   145
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   146
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   147
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   148
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11708
diff changeset
   149
%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   150
\begin{isamarkuptext}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   151
no iff-attribute because we don't always want to use it%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   152
\end{isamarkuptext}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   153
\isamarkuptrue%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   154
\isacommand{theorem}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   155
\ even{\isacharunderscore}iff{\isacharunderscore}dvd{\isacharcolon}\ {\isachardoublequoteopen}{\isacharparenleft}n\ {\isasymin}\ even{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}{\isadigit{2}}\ dvd\ n{\isacharparenright}{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   156
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   157
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   158
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   159
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   160
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   161
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   162
\isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   163
\ {\isacharparenleft}blast\ intro{\isacharcolon}\ dvd{\isacharunderscore}imp{\isacharunderscore}even\ even{\isacharunderscore}imp{\isacharunderscore}dvd{\isacharparenright}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   164
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   165
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   166
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   167
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   168
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   169
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11708
diff changeset
   170
%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   171
\begin{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   172
this result ISN'T inductive...%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   173
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   174
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   175
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   176
\ Suc{\isacharunderscore}Suc{\isacharunderscore}even{\isacharunderscore}imp{\isacharunderscore}even{\isacharcolon}\ {\isachardoublequoteopen}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even\ {\isasymLongrightarrow}\ n\ {\isasymin}\ even{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   177
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   178
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   179
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   180
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   181
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   182
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   183
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   184
\ {\isacharparenleft}erule\ even{\isachardot}induct{\isacharparenright}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   185
\begin{isamarkuptxt}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   186
\begin{isabelle}%
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   187
\ {\isadigit{1}}{\isachardot}\ n\ {\isasymin}\ even\isanewline
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   188
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}na{\isachardot}\ {\isasymlbrakk}na\ {\isasymin}\ even{\isacharsemicolon}\ n\ {\isasymin}\ even{\isasymrbrakk}\ {\isasymLongrightarrow}\ n\ {\isasymin}\ even%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   189
\end{isabelle}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   190
\end{isamarkuptxt}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   191
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   192
\isacommand{oops}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   193
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   194
\endisatagproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   195
{\isafoldproof}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   196
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   197
\isadelimproof
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   198
%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   199
\endisadelimproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   200
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   201
\begin{isamarkuptext}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   202
...so we need an inductive lemma...%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   203
\end{isamarkuptext}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   204
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   205
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   206
\ even{\isacharunderscore}imp{\isacharunderscore}even{\isacharunderscore}minus{\isacharunderscore}{\isadigit{2}}{\isacharcolon}\ {\isachardoublequoteopen}n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ n\ {\isacharminus}\ {\isadigit{2}}\ {\isasymin}\ even{\isachardoublequoteclose}\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   207
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   208
\isadelimproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   209
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   210
\endisadelimproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   211
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   212
\isatagproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   213
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   214
\ {\isacharparenleft}erule\ even{\isachardot}induct{\isacharparenright}%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   215
\begin{isamarkuptxt}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   216
\begin{isabelle}%
21261
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   217
\ {\isadigit{1}}{\isachardot}\ {\isadigit{0}}\ {\isacharminus}\ {\isadigit{2}}\ {\isasymin}\ even\isanewline
58223c67fd8b updated;
wenzelm
parents: 17187
diff changeset
   218
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}n{\isachardot}\ {\isasymlbrakk}n\ {\isasymin}\ even{\isacharsemicolon}\ n\ {\isacharminus}\ {\isadigit{2}}\ {\isasymin}\ even{\isasymrbrakk}\ {\isasymLongrightarrow}\ Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isacharminus}\ {\isadigit{2}}\ {\isasymin}\ even%
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   219
\end{isabelle}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   220
\end{isamarkuptxt}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   221
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   222
\isacommand{apply}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   223
\ auto\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   224
\isacommand{done}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   225
%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   226
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   227
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   228
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   229
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   230
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   231
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11708
diff changeset
   232
%
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   233
\begin{isamarkuptext}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   234
...and prove it in a separate step%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   235
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   236
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   237
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   238
\ Suc{\isacharunderscore}Suc{\isacharunderscore}even{\isacharunderscore}imp{\isacharunderscore}even{\isacharcolon}\ {\isachardoublequoteopen}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even\ {\isasymLongrightarrow}\ n\ {\isasymin}\ even{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   239
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   240
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   241
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   242
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   243
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   244
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   245
\isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   246
\ {\isacharparenleft}drule\ even{\isacharunderscore}imp{\isacharunderscore}even{\isacharunderscore}minus{\isacharunderscore}{\isadigit{2}}{\isacharcomma}\ simp{\isacharparenright}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   247
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   248
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   249
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   250
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   251
\isanewline
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   252
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   253
\endisadelimproof
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 14470
diff changeset
   254
\isanewline
10878
b254d5ad6dd4 auto update
paulson
parents: 10696
diff changeset
   255
\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   256
\isacommand{lemma}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   257
\ {\isacharbrackleft}iff{\isacharbrackright}{\isacharcolon}\ {\isachardoublequoteopen}{\isacharparenleft}{\isacharparenleft}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}{\isacharparenright}\ {\isasymin}\ even{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}n\ {\isasymin}\ even{\isacharparenright}{\isachardoublequoteclose}\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   258
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   259
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   260
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   261
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   262
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   263
\isatagproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   264
\isacommand{by}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   265
\ {\isacharparenleft}blast\ dest{\isacharcolon}\ Suc{\isacharunderscore}Suc{\isacharunderscore}even{\isacharunderscore}imp{\isacharunderscore}even{\isacharparenright}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   266
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   267
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   268
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   269
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   270
\isanewline
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   271
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   272
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   273
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   274
\isadelimtheory
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   275
\isanewline
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   276
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   277
\endisadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   278
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   279
\isatagtheory
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   280
\isacommand{end}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   281
%
17056
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   282
\endisatagtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   283
{\isafoldtheory}%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   284
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   285
\isadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   286
\isanewline
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   287
%
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   288
\endisadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16523
diff changeset
   289
\isanewline
10365
a17cf465d29a auto generated
paulson
parents:
diff changeset
   290
\end{isabellebody}%
a17cf465d29a auto generated
paulson
parents:
diff changeset
   291
%%% Local Variables:
a17cf465d29a auto generated
paulson
parents:
diff changeset
   292
%%% mode: latex
a17cf465d29a auto generated
paulson
parents:
diff changeset
   293
%%% TeX-master: "root"
a17cf465d29a auto generated
paulson
parents:
diff changeset
   294
%%% End: