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