author | paulson |
Mon, 12 Nov 2001 10:56:38 +0100 | |
changeset 12156 | d2758965362e |
parent 11866 | fbd097aec213 |
child 14379 | ea10a8c3e9cf |
permissions | -rw-r--r-- |
10365 | 1 |
% |
11187 | 2 |
\begin{isabellebody}% |
3 |
\def\isabellecontext{Advanced}% |
|
10365 | 4 |
\isanewline |
11187 | 5 |
\isacommand{theory}\ Advanced\ {\isacharequal}\ Even{\isacharcolon}\isanewline |
10469 | 6 |
\isanewline |
7 |
\isanewline |
|
11866 | 8 |
\isamarkupfalse% |
11187 | 9 |
\isacommand{datatype}\ {\isacharprime}f\ gterm\ {\isacharequal}\ Apply\ {\isacharprime}f\ {\isachardoublequote}{\isacharprime}f\ gterm\ list{\isachardoublequote}\isanewline |
10469 | 10 |
\isanewline |
11866 | 11 |
\isamarkupfalse% |
11187 | 12 |
\isacommand{datatype}\ integer{\isacharunderscore}op\ {\isacharequal}\ Number\ int\ {\isacharbar}\ UnaryMinus\ {\isacharbar}\ Plus\isanewline |
10469 | 13 |
\isanewline |
11866 | 14 |
\isamarkupfalse% |
11187 | 15 |
\isacommand{consts}\ gterms\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}f\ set\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline |
11866 | 16 |
\isamarkupfalse% |
11187 | 17 |
\isacommand{inductive}\ {\isachardoublequote}gterms\ F{\isachardoublequote}\isanewline |
10469 | 18 |
\isakeyword{intros}\isanewline |
11187 | 19 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ args{\isachardot}\ t\ {\isasymin}\ gterms\ F{\isacharsemicolon}\ \ f\ {\isasymin}\ F{\isasymrbrakk}\isanewline |
20 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ gterms\ F{\isachardoublequote}\isanewline |
|
10469 | 21 |
\isanewline |
11866 | 22 |
\isamarkupfalse% |
11187 | 23 |
\isacommand{lemma}\ gterms{\isacharunderscore}mono{\isacharcolon}\ {\isachardoublequote}F{\isasymsubseteq}G\ {\isasymLongrightarrow}\ gterms\ F\ {\isasymsubseteq}\ gterms\ G{\isachardoublequote}\isanewline |
11866 | 24 |
\isamarkupfalse% |
10469 | 25 |
\isacommand{apply}\ clarify\isanewline |
11866 | 26 |
\isamarkupfalse% |
27 |
\isacommand{apply}\ {\isacharparenleft}erule\ gterms{\isachardot}induct{\isacharparenright}\isamarkupfalse% |
|
28 |
% |
|
11187 | 29 |
\begin{isamarkuptxt}% |
30 |
\begin{isabelle}% |
|
31 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline |
|
32 |
\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 |
|
33 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ G% |
|
34 |
\end{isabelle}% |
|
35 |
\end{isamarkuptxt}% |
|
11866 | 36 |
\isamarkuptrue% |
11187 | 37 |
\isacommand{apply}\ blast\isanewline |
11866 | 38 |
\isamarkupfalse% |
39 |
\isacommand{done}\isamarkupfalse% |
|
40 |
% |
|
11187 | 41 |
\begin{isamarkuptext}% |
42 |
\begin{isabelle}% |
|
43 |
\ \ \ \ \ {\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 | 44 |
\end{isabelle} |
45 |
\rulename{even.cases} |
|
10469 | 46 |
|
47 |
Just as a demo I include |
|
48 |
the two forms that Markus has made available. First the one for binding the |
|
49 |
result to a name% |
|
11187 | 50 |
\end{isamarkuptext}% |
11866 | 51 |
\isamarkuptrue% |
11187 | 52 |
\isacommand{inductive{\isacharunderscore}cases}\ Suc{\isacharunderscore}Suc{\isacharunderscore}cases\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\isanewline |
53 |
\ \ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}\isanewline |
|
10365 | 54 |
\isanewline |
11866 | 55 |
\isamarkupfalse% |
56 |
\isacommand{thm}\ Suc{\isacharunderscore}Suc{\isacharunderscore}cases\isamarkupfalse% |
|
57 |
% |
|
11187 | 58 |
\begin{isamarkuptext}% |
59 |
\begin{isabelle}% |
|
60 |
\ \ \ \ \ {\isasymlbrakk}Suc\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isacharsemicolon}\ n\ {\isasymin}\ even\ {\isasymLongrightarrow}\ P{\isasymrbrakk}\ {\isasymLongrightarrow}\ P% |
|
61 |
\end{isabelle} |
|
11173 | 62 |
\rulename{Suc_Suc_cases} |
10469 | 63 |
|
10457 | 64 |
and now the one for local usage:% |
11187 | 65 |
\end{isamarkuptext}% |
11866 | 66 |
\isamarkuptrue% |
11187 | 67 |
\isacommand{lemma}\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even\ {\isasymLongrightarrow}\ P\ n{\isachardoublequote}\isanewline |
11866 | 68 |
\isamarkupfalse% |
11187 | 69 |
\isacommand{apply}\ {\isacharparenleft}ind{\isacharunderscore}cases\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}{\isacharparenright}\isanewline |
11866 | 70 |
\isamarkupfalse% |
10469 | 71 |
\isacommand{oops}\isanewline |
72 |
\isanewline |
|
11866 | 73 |
\isamarkupfalse% |
74 |
\isacommand{inductive{\isacharunderscore}cases}\ gterm{\isacharunderscore}Apply{\isacharunderscore}elim\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}Apply\ f\ args\ {\isasymin}\ gterms\ F{\isachardoublequote}\isamarkupfalse% |
|
75 |
% |
|
11187 | 76 |
\begin{isamarkuptext}% |
10469 | 77 |
this is what we get: |
10457 | 78 |
|
11187 | 79 |
\begin{isabelle}% |
80 |
\ \ \ \ \ {\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 | 81 |
\end{isabelle} |
11187 | 82 |
\rulename{gterm_Apply_elim}% |
83 |
\end{isamarkuptext}% |
|
11866 | 84 |
\isamarkuptrue% |
11187 | 85 |
\isacommand{lemma}\ gterms{\isacharunderscore}IntI\ {\isacharbrackleft}rule{\isacharunderscore}format{\isacharcomma}\ intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\isanewline |
86 |
\ \ \ \ \ {\isachardoublequote}t\ {\isasymin}\ gterms\ F\ {\isasymLongrightarrow}\ t\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\ t\ {\isasymin}\ gterms\ {\isacharparenleft}F{\isasyminter}G{\isacharparenright}{\isachardoublequote}\isanewline |
|
11866 | 87 |
\isamarkupfalse% |
88 |
\isacommand{apply}\ {\isacharparenleft}erule\ gterms{\isachardot}induct{\isacharparenright}\isamarkupfalse% |
|
89 |
% |
|
11187 | 90 |
\begin{isamarkuptxt}% |
91 |
\begin{isabelle}% |
|
92 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}args\ f{\isachardot}\isanewline |
|
93 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\isanewline |
|
94 |
\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 |
|
95 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ \ \ }f\ {\isasymin}\ F{\isasymrbrakk}\isanewline |
|
96 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ gterms\ G\ {\isasymlongrightarrow}\isanewline |
|
97 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymLongrightarrow}\ }Apply\ f\ args\ {\isasymin}\ gterms\ {\isacharparenleft}F\ {\isasyminter}\ G{\isacharparenright}% |
|
98 |
\end{isabelle}% |
|
99 |
\end{isamarkuptxt}% |
|
11866 | 100 |
\isamarkuptrue% |
11187 | 101 |
\isacommand{apply}\ blast\isanewline |
11866 | 102 |
\isamarkupfalse% |
103 |
\isacommand{done}\isamarkupfalse% |
|
104 |
% |
|
11187 | 105 |
\begin{isamarkuptext}% |
106 |
\begin{isabelle}% |
|
107 |
\ \ \ \ \ mono\ f\ {\isasymLongrightarrow}\ f\ {\isacharparenleft}A\ {\isasyminter}\ B{\isacharparenright}\ {\isasymsubseteq}\ f\ A\ {\isasyminter}\ f\ B% |
|
11173 | 108 |
\end{isabelle} |
11187 | 109 |
\rulename{mono_Int}% |
110 |
\end{isamarkuptext}% |
|
11866 | 111 |
\isamarkuptrue% |
11187 | 112 |
\isacommand{lemma}\ gterms{\isacharunderscore}Int{\isacharunderscore}eq\ {\isacharbrackleft}simp{\isacharbrackright}{\isacharcolon}\isanewline |
113 |
\ \ \ \ \ {\isachardoublequote}gterms\ {\isacharparenleft}F{\isasyminter}G{\isacharparenright}\ {\isacharequal}\ gterms\ F\ {\isasyminter}\ gterms\ G{\isachardoublequote}\isanewline |
|
11866 | 114 |
\isamarkupfalse% |
12156
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
115 |
\isacommand{by}\ {\isacharparenleft}blast\ intro{\isacharbang}{\isacharcolon}\ mono{\isacharunderscore}Int\ monoI\ gterms{\isacharunderscore}mono{\isacharparenright}\isamarkupfalse% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
116 |
% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
117 |
\begin{isamarkuptext}% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
118 |
the following declaration isn't actually used% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
119 |
\end{isamarkuptext}% |
d2758965362e
new-style numerals without leading #, along with generic 0 and 1
paulson
parents:
11866
diff
changeset
|
120 |
\isamarkuptrue% |
11187 | 121 |
\isacommand{consts}\ integer{\isacharunderscore}arity\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}integer{\isacharunderscore}op\ {\isasymRightarrow}\ nat{\isachardoublequote}\isanewline |
11866 | 122 |
\isamarkupfalse% |
10469 | 123 |
\isacommand{primrec}\isanewline |
11708 | 124 |
{\isachardoublequote}integer{\isacharunderscore}arity\ {\isacharparenleft}Number\ n{\isacharparenright}\ \ \ \ \ \ \ \ {\isacharequal}\ {\isadigit{0}}{\isachardoublequote}\isanewline |
125 |
{\isachardoublequote}integer{\isacharunderscore}arity\ UnaryMinus\ \ \ \ \ \ \ \ {\isacharequal}\ {\isadigit{1}}{\isachardoublequote}\isanewline |
|
126 |
{\isachardoublequote}integer{\isacharunderscore}arity\ Plus\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharequal}\ {\isadigit{2}}{\isachardoublequote}\isanewline |
|
10469 | 127 |
\isanewline |
11866 | 128 |
\isamarkupfalse% |
11187 | 129 |
\isacommand{consts}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ nat{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}f\ gterm\ set{\isachardoublequote}\isanewline |
11866 | 130 |
\isamarkupfalse% |
11187 | 131 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline |
10365 | 132 |
\isakeyword{intros}\isanewline |
11187 | 133 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ args{\isachardot}\ t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isacharsemicolon}\ \ \isanewline |
134 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
135 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline |
|
10365 | 136 |
\isanewline |
137 |
\isanewline |
|
11866 | 138 |
\isamarkupfalse% |
11187 | 139 |
\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 | 140 |
\isamarkupfalse% |
11187 | 141 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline |
10365 | 142 |
\isakeyword{intros}\isanewline |
11187 | 143 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}args\ {\isasymin}\ lists\ {\isacharparenleft}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isacharparenright}{\isacharsemicolon}\ \ \isanewline |
144 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
145 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ args{\isacharparenright}\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline |
|
146 |
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline |
|
10469 | 147 |
\isanewline |
11866 | 148 |
\isamarkupfalse% |
11187 | 149 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isachardoublequote}\isanewline |
11866 | 150 |
\isamarkupfalse% |
151 |
\isacommand{apply}\ clarify\isamarkupfalse% |
|
152 |
% |
|
11187 | 153 |
\begin{isamarkuptxt}% |
10878 | 154 |
The situation after clarify |
11187 | 155 |
\begin{isabelle}% |
156 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymLongrightarrow}\isanewline |
|
157 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ }x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity% |
|
158 |
\end{isabelle}% |
|
159 |
\end{isamarkuptxt}% |
|
11866 | 160 |
\isamarkuptrue% |
161 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isachardot}induct{\isacharparenright}\isamarkupfalse% |
|
162 |
% |
|
11187 | 163 |
\begin{isamarkuptxt}% |
10878 | 164 |
note the induction hypothesis! |
11187 | 165 |
\begin{isabelle}% |
166 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline |
|
167 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymlbrakk}{\isasymforall}t{\isasymin}set\ args{\isachardot}\isanewline |
|
168 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}\ \ \ }t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity\ {\isasymand}\isanewline |
|
169 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}\ \ \ }t\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity{\isacharsemicolon}\isanewline |
|
170 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ \ \ }length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
171 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity% |
|
172 |
\end{isabelle}% |
|
173 |
\end{isamarkuptxt}% |
|
11866 | 174 |
\isamarkuptrue% |
10878 | 175 |
\isacommand{apply}\ auto\isanewline |
11866 | 176 |
\isamarkupfalse% |
10878 | 177 |
\isacommand{done}\isanewline |
178 |
\isanewline |
|
179 |
\isanewline |
|
180 |
\isanewline |
|
11866 | 181 |
\isamarkupfalse% |
11187 | 182 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasymsubseteq}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isachardoublequote}\isanewline |
11866 | 183 |
\isamarkupfalse% |
184 |
\isacommand{apply}\ clarify\isamarkupfalse% |
|
185 |
% |
|
11187 | 186 |
\begin{isamarkuptxt}% |
10878 | 187 |
The situation after clarify |
11187 | 188 |
\begin{isabelle}% |
189 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasymLongrightarrow}\isanewline |
|
190 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ }x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity% |
|
191 |
\end{isabelle}% |
|
192 |
\end{isamarkuptxt}% |
|
11866 | 193 |
\isamarkuptrue% |
194 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}{\isachardot}induct{\isacharparenright}\isamarkupfalse% |
|
195 |
% |
|
11187 | 196 |
\begin{isamarkuptxt}% |
10878 | 197 |
note the induction hypothesis! |
11187 | 198 |
\begin{isabelle}% |
199 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ args\ f{\isachardot}\isanewline |
|
200 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymlbrakk}args\isanewline |
|
201 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}}{\isasymin}\ lists\isanewline |
|
202 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}{\isasymin}\ \ }{\isacharparenleft}well{\isacharunderscore}formed{\isacharunderscore}gterm{\isacharprime}\ arity\ {\isasyminter}\isanewline |
|
203 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ {\isasymlbrakk}{\isasymin}\ \ {\isacharparenleft}}{\isacharbraceleft}x{\isachardot}\ x\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity{\isacharbraceright}{\isacharparenright}{\isacharsemicolon}\isanewline |
|
204 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ \ \ }length\ args\ {\isacharequal}\ arity\ f{\isasymrbrakk}\isanewline |
|
205 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isasymLongrightarrow}\ Apply\ f\ args\ {\isasymin}\ well{\isacharunderscore}formed{\isacharunderscore}gterm\ arity% |
|
206 |
\end{isabelle}% |
|
207 |
\end{isamarkuptxt}% |
|
11866 | 208 |
\isamarkuptrue% |
10469 | 209 |
\isacommand{apply}\ auto\isanewline |
11866 | 210 |
\isamarkupfalse% |
211 |
\isacommand{done}\isamarkupfalse% |
|
212 |
% |
|
11187 | 213 |
\begin{isamarkuptext}% |
214 |
\begin{isabelle}% |
|
215 |
\ \ \ \ \ lists\ {\isacharparenleft}A\ {\isasyminter}\ B{\isacharparenright}\ {\isacharequal}\ lists\ A\ {\isasyminter}\ lists\ B% |
|
216 |
\end{isabelle}% |
|
217 |
\end{isamarkuptext}% |
|
11866 | 218 |
\isamarkuptrue% |
10469 | 219 |
% |
11187 | 220 |
\begin{isamarkuptext}% |
10469 | 221 |
the rest isn't used: too complicated. OK for an exercise though.% |
11187 | 222 |
\end{isamarkuptext}% |
11866 | 223 |
\isamarkuptrue% |
11187 | 224 |
\isacommand{consts}\ integer{\isacharunderscore}signature\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}integer{\isacharunderscore}op\ {\isacharasterisk}\ {\isacharparenleft}unit\ list\ {\isacharasterisk}\ unit{\isacharparenright}{\isacharparenright}\ set{\isachardoublequote}\isanewline |
11866 | 225 |
\isamarkupfalse% |
11187 | 226 |
\isacommand{inductive}\ {\isachardoublequote}integer{\isacharunderscore}signature{\isachardoublequote}\isanewline |
10365 | 227 |
\isakeyword{intros}\isanewline |
11187 | 228 |
Number{\isacharcolon}\ \ \ \ \ {\isachardoublequote}{\isacharparenleft}Number\ n{\isacharcomma}\ \ \ {\isacharparenleft}{\isacharbrackleft}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline |
229 |
UnaryMinus{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}UnaryMinus{\isacharcomma}\ {\isacharparenleft}{\isacharbrackleft}{\isacharparenleft}{\isacharparenright}{\isacharbrackright}{\isacharcomma}\ {\isacharparenleft}{\isacharparenright}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ integer{\isacharunderscore}signature{\isachardoublequote}\isanewline |
|
230 |
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 | 231 |
\isanewline |
232 |
\isanewline |
|
11866 | 233 |
\isamarkupfalse% |
11187 | 234 |
\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 | 235 |
\isamarkupfalse% |
11187 | 236 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline |
10469 | 237 |
\isakeyword{intros}\isanewline |
11187 | 238 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ \isanewline |
239 |
\ \ \ \ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}pair\ {\isasymin}\ set\ args{\isachardot}\ pair\ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isacharsemicolon}\ \isanewline |
|
240 |
\ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ args{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline |
|
241 |
\ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ args{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ \isanewline |
|
242 |
\ \ \ \ \ \ \ \ \ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline |
|
10469 | 243 |
\isanewline |
11866 | 244 |
\isamarkupfalse% |
11187 | 245 |
\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 | 246 |
\isamarkupfalse% |
11187 | 247 |
\isacommand{inductive}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline |
10469 | 248 |
\isakeyword{intros}\isanewline |
11187 | 249 |
step{\isacharbrackleft}intro{\isacharbang}{\isacharbrackright}{\isacharcolon}\ \isanewline |
250 |
\ \ \ \ {\isachardoublequote}{\isasymlbrakk}args\ {\isasymin}\ lists{\isacharparenleft}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isacharparenright}{\isacharsemicolon}\ \isanewline |
|
251 |
\ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ args{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline |
|
252 |
\ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ args{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ \isanewline |
|
253 |
\ \ \ \ \ \ \ \ \ {\isasymin}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline |
|
254 |
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline |
|
10365 | 255 |
\isanewline |
256 |
\isanewline |
|
11866 | 257 |
\isamarkupfalse% |
11187 | 258 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig\ {\isasymsubseteq}\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig{\isachardoublequote}\isanewline |
11866 | 259 |
\isamarkupfalse% |
10365 | 260 |
\isacommand{apply}\ clarify\isanewline |
11866 | 261 |
\isamarkupfalse% |
11187 | 262 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isachardot}induct{\isacharparenright}\isanewline |
11866 | 263 |
\isamarkupfalse% |
10365 | 264 |
\isacommand{apply}\ auto\isanewline |
11866 | 265 |
\isamarkupfalse% |
10365 | 266 |
\isacommand{done}\isanewline |
267 |
\isanewline |
|
11866 | 268 |
\isamarkupfalse% |
11187 | 269 |
\isacommand{lemma}\ {\isachardoublequote}well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}\ sig\ {\isasymsubseteq}\ well{\isacharunderscore}typed{\isacharunderscore}gterm\ sig{\isachardoublequote}\isanewline |
11866 | 270 |
\isamarkupfalse% |
10365 | 271 |
\isacommand{apply}\ clarify\isanewline |
11866 | 272 |
\isamarkupfalse% |
11187 | 273 |
\isacommand{apply}\ {\isacharparenleft}erule\ well{\isacharunderscore}typed{\isacharunderscore}gterm{\isacharprime}{\isachardot}induct{\isacharparenright}\isanewline |
11866 | 274 |
\isamarkupfalse% |
10365 | 275 |
\isacommand{apply}\ auto\isanewline |
11866 | 276 |
\isamarkupfalse% |
10365 | 277 |
\isacommand{done}\isanewline |
278 |
\isanewline |
|
10469 | 279 |
\isanewline |
11866 | 280 |
\isamarkupfalse% |
10365 | 281 |
\isacommand{end}\isanewline |
282 |
\isanewline |
|
11866 | 283 |
\isamarkupfalse% |
11187 | 284 |
\end{isabellebody}% |
10365 | 285 |
%%% Local Variables: |
286 |
%%% mode: latex |
|
287 |
%%% TeX-master: "root" |
|
288 |
%%% End: |