author | wenzelm |
Tue, 16 Aug 2005 13:42:23 +0200 | |
changeset 17056 | 05fc32a23b8b |
parent 16523 | f8a734dc0fbc |
child 17175 | 1eced27ee0e1 |
permissions | -rw-r--r-- |
10365 | 1 |
% |
11187 | 2 |
\begin{isabellebody}% |
3 |
\def\isabellecontext{Advanced}% |
|
17056 | 4 |
% |
5 |
\isadelimtheory |
|
10365 | 6 |
\isanewline |
17056 | 7 |
% |
8 |
\endisadelimtheory |
|
9 |
% |
|
10 |
\isatagtheory |
|
11 |
\isamarkupfalse% |
|
12 |
\isacommand{theory}\ Advanced\ \isakeyword{imports}\ Even\ \isakeyword{begin}% |
|
13 |
\endisatagtheory |
|
14 |
{\isafoldtheory}% |
|
15 |
% |
|
16 |
\isadelimtheory |
|
17 |
\isanewline |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
10469 | 20 |
\isanewline |
21 |
\isanewline |
|
11866 | 22 |
\isamarkupfalse% |
11187 | 23 |
\isacommand{datatype}\ {\isacharprime}f\ gterm\ {\isacharequal}\ Apply\ {\isacharprime}f\ {\isachardoublequote}{\isacharprime}f\ gterm\ list{\isachardoublequote}\isanewline |
10469 | 24 |
\isanewline |
11866 | 25 |
\isamarkupfalse% |
11187 | 26 |
\isacommand{datatype}\ integer{\isacharunderscore}op\ {\isacharequal}\ Number\ int\ {\isacharbar}\ UnaryMinus\ {\isacharbar}\ Plus\isanewline |
10469 | 27 |
\isanewline |
11866 | 28 |
\isamarkupfalse% |
11187 | 29 |
\isacommand{consts}\ gterms\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}f\ set\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline |
11866 | 30 |
\isamarkupfalse% |
11187 | 31 |
\isacommand{inductive}\ {\isachardoublequote}gterms\ F{\isachardoublequote}\isanewline |
10469 | 32 |
\isakeyword{intros}\isanewline |
11187 | 33 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ args{\isachardot}\ t\ {\isasymin}\ gterms\ F{\isacharsemicolon}\ \ f\ {\isasymin}\ F{\isasymrbrakk}\isanewline |
34 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ gterms\ F{\isachardoublequote}\isanewline |
|
10469 | 35 |
\isanewline |
11866 | 36 |
\isamarkupfalse% |
11187 | 37 |
\isacommand{lemma}\ gterms{\isacharunderscore}mono{\isacharcolon}\ {\isachardoublequote}F{\isasymsubseteq}G\ {\isasymLongrightarrow}\ gterms\ F\ {\isasymsubseteq}\ gterms\ G{\isachardoublequote}\isanewline |
17056 | 38 |
% |
39 |
\isadelimproof |
|
40 |
% |
|
41 |
\endisadelimproof |
|
42 |
% |
|
43 |
\isatagproof |
|
11866 | 44 |
\isamarkupfalse% |
16069 | 45 |
\isacommand{apply}\ clarify\isanewline |
15481 | 46 |
\isamarkupfalse% |
17056 | 47 |
\isacommand{apply}\ {\isacharparenleft}erule\ gterms{\isachardot}induct{\isacharparenright}\isamarkuptrue% |
16069 | 48 |
% |
49 |
\begin{isamarkuptxt}% |
|
50 |
\begin{isabelle}% |
|
51 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline |
|
52 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\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 |
|
53 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ G% |
|
54 |
\end{isabelle}% |
|
55 |
\end{isamarkuptxt}% |
|
17056 | 56 |
\isamarkupfalse% |
16069 | 57 |
\isacommand{apply}\ blast\isanewline |
11866 | 58 |
\isamarkupfalse% |
17056 | 59 |
\isacommand{done}% |
60 |
\endisatagproof |
|
61 |
{\isafoldproof}% |
|
62 |
% |
|
63 |
\isadelimproof |
|
64 |
% |
|
65 |
\endisadelimproof |
|
66 |
\isamarkuptrue% |
|
11866 | 67 |
% |
11187 | 68 |
\begin{isamarkuptext}% |
69 |
\begin{isabelle}% |
|
14470 | 70 |
\ \ \ \ \ {\isasymlbrakk}a\ {\isasymin}\ Even{\isachardot}even{\isacharsemicolon}\ a\ {\isacharequal}\ {\isadigit{0}}\ {\isasymLongrightarrow}\ P{\isacharsemicolon}\ {\isasymAnd}n{\isachardot}\ {\isasymlbrakk}a\ {\isacharequal}\ Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}{\isacharsemicolon}\ n\ {\isasymin}\ Even{\isachardot}even{\isasymrbrakk}\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\isanewline |
71 |
\isaindent{\ \ \ \ \ }{\isasymLongrightarrow}\ P% |
|
11173 | 72 |
\end{isabelle} |
73 |
\rulename{even.cases} |
|
10469 | 74 |
|
75 |
Just as a demo I include |
|
76 |
the two forms that Markus has made available. First the one for binding the |
|
77 |
result to a name% |
|
11187 | 78 |
\end{isamarkuptext}% |
17056 | 79 |
\isamarkupfalse% |
11187 | 80 |
\isacommand{inductive{\isacharunderscore}cases}\ Suc{\isacharunderscore}Suc{\isacharunderscore}cases\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\isanewline |
81 |
\ \ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}\isanewline |
|
10365 | 82 |
\isanewline |
11866 | 83 |
\isamarkupfalse% |
17056 | 84 |
\isacommand{thm}\ Suc{\isacharunderscore}Suc{\isacharunderscore}cases\isamarkuptrue% |
11866 | 85 |
% |
11187 | 86 |
\begin{isamarkuptext}% |
87 |
\begin{isabelle}% |
|
14470 | 88 |
\ \ \ \ \ {\isasymlbrakk}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ Even{\isachardot}even{\isacharsemicolon}\ n\ {\isasymin}\ Even{\isachardot}even\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ P% |
11187 | 89 |
\end{isabelle} |
11173 | 90 |
\rulename{Suc_Suc_cases} |
10469 | 91 |
|
10457 | 92 |
and now the one for local usage:% |
11187 | 93 |
\end{isamarkuptext}% |
17056 | 94 |
\isamarkupfalse% |
11187 | 95 |
\isacommand{lemma}\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even\ {\isasymLongrightarrow}\ P\ n{\isachardoublequote}\isanewline |
17056 | 96 |
% |
97 |
\isadelimproof |
|
98 |
% |
|
99 |
\endisadelimproof |
|
100 |
% |
|
101 |
\isatagproof |
|
11866 | 102 |
\isamarkupfalse% |
16069 | 103 |
\isacommand{apply}\ {\isacharparenleft}ind{\isacharunderscore}cases\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}{\isacharparenright}\isanewline |
11866 | 104 |
\isamarkupfalse% |
17056 | 105 |
\isacommand{oops}% |
106 |
\endisatagproof |
|
107 |
{\isafoldproof}% |
|
108 |
% |
|
109 |
\isadelimproof |
|
110 |
\isanewline |
|
111 |
% |
|
112 |
\endisadelimproof |
|
15481 | 113 |
\isanewline |
11866 | 114 |
\isamarkupfalse% |
17056 | 115 |
\isacommand{inductive{\isacharunderscore}cases}\ gterm{\isacharunderscore}Apply{\isacharunderscore}elim\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}Apply\ f\ args\ {\isasymin}\ gterms\ F{\isachardoublequote}\isamarkuptrue% |
11866 | 116 |
% |
11187 | 117 |
\begin{isamarkuptext}% |
10469 | 118 |
this is what we get: |
10457 | 119 |
|
11187 | 120 |
\begin{isabelle}% |
121 |
\ \ \ \ \ {\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 | 122 |
\end{isabelle} |
11187 | 123 |
\rulename{gterm_Apply_elim}% |
124 |
\end{isamarkuptext}% |
|
17056 | 125 |
\isamarkupfalse% |
11187 | 126 |
\isacommand{lemma}\ gterms{\isacharunderscore}IntI\ {\isacharbrackleft}rule{\isacharunderscore}format{\isacharcomma}\ intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\isanewline |
127 |
\ \ \ \ \ {\isachardoublequote}t\ {\isasymin}\ gterms\ F\ {\isasymLongrightarrow}\ t\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ t\ {\isasymin}\ gterms\ {\isacharparenleft}F{\isasyminter}G{\isacharparenright}{\isachardoublequote}\isanewline |
|
17056 | 128 |
% |
129 |
\isadelimproof |
|
130 |
% |
|
131 |
\endisadelimproof |
|
132 |
% |
|
133 |
\isatagproof |
|
11866 | 134 |
\isamarkupfalse% |
17056 | 135 |
\isacommand{apply}\ {\isacharparenleft}erule\ gterms{\isachardot}induct{\isacharparenright}\isamarkuptrue% |
16069 | 136 |
% |
137 |
\begin{isamarkuptxt}% |
|
138 |
\begin{isabelle}% |
|
139 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}args\ f{\isachardot}\isanewline |
|
140 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\isanewline |
|
141 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}\ \ \ }t\ {\isasymin}\ gterms\ F\ {\isasymand}\ {\isacharparenleft}t\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ t\ {\isasymin}\ gterms\ {\isacharparenleft}F\ {\isasyminter}\ G{\isacharparenright}{\isacharparenright}{\isacharsemicolon}\isanewline |
|
142 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ }f\ {\isasymin}\ F{\isasymrbrakk}\isanewline |
|
143 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\isanewline |
|
144 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymLongrightarrow}\ }Apply\ f\ args\ {\isasymin}\ gterms\ {\isacharparenleft}F\ {\isasyminter}\ G{\isacharparenright}% |
|
145 |
\end{isabelle}% |
|
146 |
\end{isamarkuptxt}% |
|
17056 | 147 |
\isamarkupfalse% |
16069 | 148 |
\isacommand{apply}\ blast\isanewline |
11866 | 149 |
\isamarkupfalse% |
17056 | 150 |
\isacommand{done}% |
151 |
\endisatagproof |
|
152 |
{\isafoldproof}% |
|
153 |
% |
|
154 |
\isadelimproof |
|
155 |
% |
|
156 |
\endisadelimproof |
|
157 |
\isamarkuptrue% |
|
11866 | 158 |
% |
11187 | 159 |
\begin{isamarkuptext}% |
160 |
\begin{isabelle}% |
|
161 |
\ \ \ \ \ mono\ f\ {\isasymLongrightarrow}\ f\ {\isacharparenleft}A\ {\isasyminter}\ B{\isacharparenright}\ {\isasymsubseteq}\ f\ A\ {\isasyminter}\ f\ B% |
|
11173 | 162 |
\end{isabelle} |
11187 | 163 |
\rulename{mono_Int}% |
164 |
\end{isamarkuptext}% |
|
17056 | 165 |
\isamarkupfalse% |
11187 | 166 |
\isacommand{lemma}\ gterms{\isacharunderscore}Int{\isacharunderscore}eq\ {\isacharbrackleft}simp{\isacharbrackright}{\isacharcolon}\isanewline |
167 |
\ \ \ \ \ {\isachardoublequote}gterms\ {\isacharparenleft}F{\isasyminter}G{\isacharparenright}\ {\isacharequal}\ gterms\ F\ {\isasyminter}\ gterms\ G{\isachardoublequote}\isanewline |
|
17056 | 168 |
% |
169 |
\isadelimproof |
|
170 |
% |
|
171 |
\endisadelimproof |
|
172 |
% |
|
173 |
\isatagproof |
|
11866 | 174 |
\isamarkupfalse% |
17056 | 175 |
\isacommand{by}\ {\isacharparenleft}blast\ intro{\isacharbang}{\isacharcolon}\ mono{\isacharunderscore}Int\ monoI\ gterms{\isacharunderscore}mono{\isacharparenright}% |
176 |
\endisatagproof |
|
177 |
{\isafoldproof}% |
|
178 |
% |
|
179 |
\isadelimproof |
|
180 |
% |
|
181 |
\endisadelimproof |
|
182 |
\isamarkuptrue% |
|
12156
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
183 |
% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
184 |
\begin{isamarkuptext}% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
185 |
the following declaration isn't actually used% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
186 |
\end{isamarkuptext}% |
17056 | 187 |
\isamarkupfalse% |
11187 | 188 |
\isacommand{consts}\ integer{\isacharunderscore}arity\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}integer{\isacharunderscore}op\ {\isasymRightarrow}\ nat{\isachardoublequote}\isanewline |
11866 | 189 |
\isamarkupfalse% |
10469 | 190 |
\isacommand{primrec}\isanewline |
11708 | 191 |
{\isachardoublequote}integer{\isacharunderscore}arity\ {\isacharparenleft}Number\ n{\isacharparenright}\ \ \ \ \ \ \ \ {\isacharequal}\ {\isadigit{0}}{\isachardoublequote}\isanewline |
192 |
{\isachardoublequote}integer{\isacharunderscore}arity\ UnaryMinus\ \ \ \ \ \ \ \ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}\isanewline |
|
193 |
{\isachardoublequote}integer{\isacharunderscore}arity\ Plus\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharequal}\ {\isadigit{2}}{\isachardoublequote}\isanewline |
|
10469 | 194 |
\isanewline |
11866 | 195 |
\isamarkupfalse% |
11187 | 196 |
\isacommand{consts}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ nat{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline |
11866 | 197 |
\isamarkupfalse% |
11187 | 198 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline |
10365 | 199 |
\isakeyword{intros}\isanewline |
11187 | 200 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ args{\isachardot}\ t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isacharsemicolon}\ \ \isanewline |
201 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
202 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline |
|
10365 | 203 |
\isanewline |
204 |
\isanewline |
|
11866 | 205 |
\isamarkupfalse% |
11187 | 206 |
\isacommand{consts}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ nat{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline |
11866 | 207 |
\isamarkupfalse% |
11187 | 208 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline |
10365 | 209 |
\isakeyword{intros}\isanewline |
11187 | 210 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}args\ {\isasymin}\ lists\ {\isacharparenleft}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isacharparenright}{\isacharsemicolon}\ \ \isanewline |
211 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
212 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline |
|
213 |
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline |
|
10469 | 214 |
\isanewline |
11866 | 215 |
\isamarkupfalse% |
11187 | 216 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline |
17056 | 217 |
% |
218 |
\isadelimproof |
|
219 |
% |
|
220 |
\endisadelimproof |
|
221 |
% |
|
222 |
\isatagproof |
|
11866 | 223 |
\isamarkupfalse% |
17056 | 224 |
\isacommand{apply}\ clarify\isamarkuptrue% |
16069 | 225 |
% |
226 |
\begin{isamarkuptxt}% |
|
227 |
The situation after clarify |
|
228 |
\begin{isabelle}% |
|
229 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymLongrightarrow}\isanewline |
|
230 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ }x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity% |
|
231 |
\end{isabelle}% |
|
232 |
\end{isamarkuptxt}% |
|
17056 | 233 |
\isamarkupfalse% |
234 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isachardot}induct{\isacharparenright}\isamarkuptrue% |
|
16069 | 235 |
% |
236 |
\begin{isamarkuptxt}% |
|
237 |
note the induction hypothesis! |
|
238 |
\begin{isabelle}% |
|
239 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline |
|
240 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\isanewline |
|
241 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}\ \ \ }t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymand}\isanewline |
|
242 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}\ \ \ }t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isacharsemicolon}\isanewline |
|
243 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ }length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
244 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity% |
|
245 |
\end{isabelle}% |
|
246 |
\end{isamarkuptxt}% |
|
17056 | 247 |
\isamarkupfalse% |
16069 | 248 |
\isacommand{apply}\ auto\isanewline |
15481 | 249 |
\isamarkupfalse% |
17056 | 250 |
\isacommand{done}% |
251 |
\endisatagproof |
|
252 |
{\isafoldproof}% |
|
253 |
% |
|
254 |
\isadelimproof |
|
255 |
\isanewline |
|
256 |
% |
|
257 |
\endisadelimproof |
|
15481 | 258 |
\isanewline |
10878 | 259 |
\isanewline |
260 |
\isanewline |
|
11866 | 261 |
\isamarkupfalse% |
11187 | 262 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline |
17056 | 263 |
% |
264 |
\isadelimproof |
|
265 |
% |
|
266 |
\endisadelimproof |
|
267 |
% |
|
268 |
\isatagproof |
|
11866 | 269 |
\isamarkupfalse% |
17056 | 270 |
\isacommand{apply}\ clarify\isamarkuptrue% |
16069 | 271 |
% |
272 |
\begin{isamarkuptxt}% |
|
273 |
The situation after clarify |
|
274 |
\begin{isabelle}% |
|
275 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasymLongrightarrow}\isanewline |
|
276 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ }x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity% |
|
277 |
\end{isabelle}% |
|
278 |
\end{isamarkuptxt}% |
|
17056 | 279 |
\isamarkupfalse% |
280 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}{\isachardot}induct{\isacharparenright}\isamarkuptrue% |
|
16069 | 281 |
% |
282 |
\begin{isamarkuptxt}% |
|
283 |
note the induction hypothesis! |
|
284 |
\begin{isabelle}% |
|
285 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline |
|
286 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymlbrakk}args\isanewline |
|
287 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}}{\isasymin}\ lists\isanewline |
|
288 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}{\isasymin}\ \ }{\isacharparenleft}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasyminter}\isanewline |
|
289 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}{\isasymin}\ \ {\isacharparenleft}}{\isacharbraceleft}x{\isachardot}\ x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isacharbraceright}{\isacharparenright}{\isacharsemicolon}\isanewline |
|
290 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ }length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
291 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity% |
|
292 |
\end{isabelle}% |
|
293 |
\end{isamarkuptxt}% |
|
17056 | 294 |
\isamarkupfalse% |
16069 | 295 |
\isacommand{apply}\ auto\isanewline |
15481 | 296 |
\isamarkupfalse% |
17056 | 297 |
\isacommand{done}% |
298 |
\endisatagproof |
|
299 |
{\isafoldproof}% |
|
300 |
% |
|
301 |
\isadelimproof |
|
302 |
% |
|
303 |
\endisadelimproof |
|
304 |
\isamarkuptrue% |
|
11866 | 305 |
% |
11187 | 306 |
\begin{isamarkuptext}% |
307 |
\begin{isabelle}% |
|
308 |
\ \ \ \ \ lists\ {\isacharparenleft}A\ {\isasyminter}\ B{\isacharparenright}\ {\isacharequal}\ lists\ A\ {\isasyminter}\ lists\ B% |
|
309 |
\end{isabelle}% |
|
310 |
\end{isamarkuptext}% |
|
11866 | 311 |
\isamarkuptrue% |
10469 | 312 |
% |
11187 | 313 |
\begin{isamarkuptext}% |
10469 | 314 |
the rest isn't used: too complicated. OK for an exercise though.% |
11187 | 315 |
\end{isamarkuptext}% |
17056 | 316 |
\isamarkupfalse% |
11187 | 317 |
\isacommand{consts}\ integer{\isacharunderscore}signature\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}integer{\isacharunderscore}op\ {\isacharasterisk}\ {\isacharparenleft}unit\ list\ {\isacharasterisk}\ unit{\isacharparenright}{\isacharparenright}\ set{\isachardoublequote}\isanewline |
11866 | 318 |
\isamarkupfalse% |
11187 | 319 |
\isacommand{inductive}\ {\isachardoublequote}integer{\isacharunderscore}signature{\isachardoublequote}\isanewline |
10365 | 320 |
\isakeyword{intros}\isanewline |
11187 | 321 |
Number{\isacharcolon}\ \ \ \ \ {\isachardoublequote}{\isacharparenleft}Number\ n{\isacharcomma}\ \ \ {\isacharparenleft}{\isacharbrackleft}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline |
322 |
UnaryMinus{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}UnaryMinus{\isacharcomma}\ {\isacharparenleft}{\isacharbrackleft}{\isacharparenleft}{\isacharparenright}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline |
|
323 |
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 |
|
10469 | 324 |
\isanewline |
325 |
\isanewline |
|
11866 | 326 |
\isamarkupfalse% |
11187 | 327 |
\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 |
11866 | 328 |
\isamarkupfalse% |
11187 | 329 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline |
10469 | 330 |
\isakeyword{intros}\isanewline |
11187 | 331 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ \isanewline |
332 |
\ \ \ \ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}pair\ {\isasymin}\ set\ args{\isachardot}\ pair\ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isacharsemicolon}\ \isanewline |
|
333 |
\ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ args{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline |
|
334 |
\ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ args{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ \isanewline |
|
335 |
\ \ \ \ \ \ \ \ \ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline |
|
10469 | 336 |
\isanewline |
11866 | 337 |
\isamarkupfalse% |
11187 | 338 |
\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 |
11866 | 339 |
\isamarkupfalse% |
11187 | 340 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline |
10469 | 341 |
\isakeyword{intros}\isanewline |
11187 | 342 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ \isanewline |
343 |
\ \ \ \ {\isachardoublequote}{\isasymlbrakk}args\ {\isasymin}\ lists{\isacharparenleft}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isacharparenright}{\isacharsemicolon}\ \isanewline |
|
344 |
\ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ args{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline |
|
345 |
\ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ args{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ \isanewline |
|
346 |
\ \ \ \ \ \ \ \ \ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline |
|
347 |
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline |
|
10365 | 348 |
\isanewline |
349 |
\isanewline |
|
11866 | 350 |
\isamarkupfalse% |
11187 | 351 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig\ {\isasymsubseteq}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline |
17056 | 352 |
% |
353 |
\isadelimproof |
|
354 |
% |
|
355 |
\endisadelimproof |
|
356 |
% |
|
357 |
\isatagproof |
|
11866 | 358 |
\isamarkupfalse% |
16069 | 359 |
\isacommand{apply}\ clarify\isanewline |
11866 | 360 |
\isamarkupfalse% |
16069 | 361 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isachardot}induct{\isacharparenright}\isanewline |
11866 | 362 |
\isamarkupfalse% |
16069 | 363 |
\isacommand{apply}\ auto\isanewline |
11866 | 364 |
\isamarkupfalse% |
17056 | 365 |
\isacommand{done}% |
366 |
\endisatagproof |
|
367 |
{\isafoldproof}% |
|
368 |
% |
|
369 |
\isadelimproof |
|
370 |
\isanewline |
|
371 |
% |
|
372 |
\endisadelimproof |
|
15481 | 373 |
\isanewline |
11866 | 374 |
\isamarkupfalse% |
11187 | 375 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig\ {\isasymsubseteq}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline |
17056 | 376 |
% |
377 |
\isadelimproof |
|
378 |
% |
|
379 |
\endisadelimproof |
|
380 |
% |
|
381 |
\isatagproof |
|
11866 | 382 |
\isamarkupfalse% |
16069 | 383 |
\isacommand{apply}\ clarify\isanewline |
11866 | 384 |
\isamarkupfalse% |
16069 | 385 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}{\isachardot}induct{\isacharparenright}\isanewline |
11866 | 386 |
\isamarkupfalse% |
16069 | 387 |
\isacommand{apply}\ auto\isanewline |
11866 | 388 |
\isamarkupfalse% |
17056 | 389 |
\isacommand{done}% |
390 |
\endisatagproof |
|
391 |
{\isafoldproof}% |
|
392 |
% |
|
393 |
\isadelimproof |
|
15481 | 394 |
\isanewline |
17056 | 395 |
% |
396 |
\endisadelimproof |
|
10365 | 397 |
\isanewline |
17056 | 398 |
% |
399 |
\isadelimtheory |
|
400 |
\isanewline |
|
401 |
% |
|
402 |
\endisadelimtheory |
|
403 |
% |
|
404 |
\isatagtheory |
|
11866 | 405 |
\isamarkupfalse% |
17056 | 406 |
\isacommand{end}% |
407 |
\endisatagtheory |
|
408 |
{\isafoldtheory}% |
|
409 |
% |
|
410 |
\isadelimtheory |
|
10365 | 411 |
\isanewline |
17056 | 412 |
% |
413 |
\endisadelimtheory |
|
414 |
\isanewline |
|
11187 | 415 |
\end{isabellebody}% |
10365 | 416 |
%%% Local Variables: |
417 |
%%% mode: latex |
|
418 |
%%% TeX-master: "root" |
|
419 |
%%% End: |