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