13202
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{Tutorial}%
|
|
4 |
\isamarkupfalse%
|
|
5 |
%
|
|
6 |
\isamarkupchapter{Introduction%
|
|
7 |
}
|
|
8 |
\isamarkuptrue%
|
|
9 |
%
|
13228
|
10 |
\isamarkupchapter{Technical issues%
|
|
11 |
}
|
|
12 |
\isamarkuptrue%
|
|
13 |
%
|
|
14 |
\isamarkupsection{Source texts%
|
|
15 |
}
|
|
16 |
\isamarkuptrue%
|
|
17 |
%
|
|
18 |
\isamarkupsection{Interaction and debugging%
|
13202
|
19 |
}
|
|
20 |
\isamarkuptrue%
|
|
21 |
%
|
|
22 |
\isamarkupchapter{Calculational reasoning%
|
|
23 |
}
|
|
24 |
\isamarkuptrue%
|
|
25 |
%
|
|
26 |
\isamarkupchapter{Proof by cases and induction%
|
|
27 |
}
|
|
28 |
\isamarkuptrue%
|
|
29 |
%
|
|
30 |
\isamarkupchapter{General natural deduction%
|
|
31 |
}
|
|
32 |
\isamarkuptrue%
|
|
33 |
%
|
|
34 |
\isamarkupchapter{Example: FIXME%
|
|
35 |
}
|
|
36 |
\isamarkuptrue%
|
|
37 |
%
|
|
38 |
\isamarkupchapter{FIXME%
|
|
39 |
}
|
|
40 |
\isamarkuptrue%
|
|
41 |
%
|
|
42 |
\isamarkupsection{Formal document preparation%
|
|
43 |
}
|
|
44 |
\isamarkuptrue%
|
|
45 |
%
|
|
46 |
\isamarkupsubsection{Example%
|
|
47 |
}
|
|
48 |
\isamarkuptrue%
|
|
49 |
%
|
|
50 |
\begin{isamarkuptext}%
|
|
51 |
See this very document itself.%
|
|
52 |
\end{isamarkuptext}%
|
|
53 |
\isamarkuptrue%
|
|
54 |
%
|
|
55 |
\isamarkupsubsection{Getting started%
|
|
56 |
}
|
|
57 |
\isamarkuptrue%
|
|
58 |
%
|
|
59 |
\begin{isamarkuptext}%
|
|
60 |
\verb"isatool mkdir Test && isatool make"%
|
|
61 |
\end{isamarkuptext}%
|
|
62 |
\isamarkuptrue%
|
|
63 |
%
|
|
64 |
\isamarkupsection{Human-readable proof composition in Isar%
|
|
65 |
}
|
|
66 |
\isamarkuptrue%
|
|
67 |
%
|
|
68 |
\isamarkupsubsection{Getting started%
|
|
69 |
}
|
|
70 |
\isamarkuptrue%
|
|
71 |
%
|
|
72 |
\begin{isamarkuptext}%
|
|
73 |
Claim a trivial goal in order to enter proof mode \isa{{\isasymdots}}%
|
|
74 |
\end{isamarkuptext}%
|
|
75 |
\isamarkuptrue%
|
|
76 |
\isacommand{lemma}\ True\isanewline
|
|
77 |
\isamarkupfalse%
|
|
78 |
\isacommand{proof}\isamarkupfalse%
|
|
79 |
%
|
|
80 |
\begin{isamarkuptxt}%
|
|
81 |
After the canonical initial refinement step we are left
|
|
82 |
within an \emph{proof body}.%
|
|
83 |
\end{isamarkuptxt}%
|
|
84 |
\isamarkuptrue%
|
|
85 |
%
|
|
86 |
\begin{isamarkuptxt}%
|
|
87 |
Here we may augment the present local {proof context} as we
|
|
88 |
please.%
|
|
89 |
\end{isamarkuptxt}%
|
|
90 |
\ \ \isamarkuptrue%
|
|
91 |
\isacommand{fix}\ something\isanewline
|
|
92 |
\ \ \isamarkupfalse%
|
|
93 |
\isacommand{assume}\ a{\isacharcolon}\ {\isachardoublequote}anything\ something{\isachardoublequote}\isamarkupfalse%
|
|
94 |
%
|
|
95 |
\begin{isamarkuptxt}%
|
|
96 |
Note that the present configuration may be inspected by
|
|
97 |
several \emph{diagnostic commands}.%
|
|
98 |
\end{isamarkuptxt}%
|
|
99 |
\ \ \isamarkuptrue%
|
|
100 |
\isacommand{term}\ something\ \ %
|
|
101 |
\isamarkupcmt{\isa{something{\isasymColon}{\isacharprime}a}%
|
|
102 |
}
|
|
103 |
\isanewline
|
|
104 |
\ \ \isamarkupfalse%
|
|
105 |
\isacommand{term}\ anything\ \ %
|
|
106 |
\isamarkupcmt{\isa{anything{\isasymColon}{\isacharprime}a\ {\isasymRightarrow}\ bool}%
|
|
107 |
}
|
|
108 |
\isanewline
|
|
109 |
\ \ \isamarkupfalse%
|
|
110 |
\isacommand{thm}\ a\ \ %
|
|
111 |
\isamarkupcmt{\isa{anything\ something}%
|
|
112 |
}
|
|
113 |
\isamarkupfalse%
|
|
114 |
%
|
|
115 |
\begin{isamarkuptxt}%
|
|
116 |
We may state local (auxiliary) results as well.%
|
|
117 |
\end{isamarkuptxt}%
|
|
118 |
\ \ \isamarkuptrue%
|
|
119 |
\isacommand{have}\ True\ \isamarkupfalse%
|
|
120 |
\isacommand{proof}\ \isamarkupfalse%
|
|
121 |
\isacommand{qed}\isamarkupfalse%
|
|
122 |
%
|
|
123 |
\begin{isamarkuptxt}%
|
|
124 |
We are now satisfied.%
|
|
125 |
\end{isamarkuptxt}%
|
|
126 |
\isamarkuptrue%
|
|
127 |
\isacommand{qed}\isamarkupfalse%
|
|
128 |
%
|
|
129 |
\isamarkupsubsection{Calculational Reasoning%
|
|
130 |
}
|
|
131 |
\isamarkuptrue%
|
|
132 |
%
|
|
133 |
\begin{isamarkuptext}%
|
|
134 |
Isar is mainly about Natural Deduction, but Calculational Reasoning
|
|
135 |
turns out as a simplified instance of that, so we demonstrate it
|
|
136 |
first.%
|
|
137 |
\end{isamarkuptext}%
|
|
138 |
\isamarkuptrue%
|
|
139 |
%
|
|
140 |
\isamarkupsubsubsection{Transitive chains%
|
|
141 |
}
|
|
142 |
\isamarkuptrue%
|
|
143 |
%
|
|
144 |
\begin{isamarkuptext}%
|
|
145 |
Technique: establish a chain of local facts, separated by \cmd{also}
|
|
146 |
and terminated by \cmd{finally}; another goal has to follow to point
|
|
147 |
out the final result.%
|
|
148 |
\end{isamarkuptext}%
|
|
149 |
\isamarkuptrue%
|
|
150 |
\isacommand{lemma}\ {\isachardoublequote}x{\isadigit{1}}\ {\isacharequal}\ x{\isadigit{4}}{\isachardoublequote}\isanewline
|
|
151 |
\isamarkupfalse%
|
|
152 |
\isacommand{proof}\ {\isacharminus}\ \ %
|
|
153 |
\isamarkupcmt{do nothing yet%
|
|
154 |
}
|
|
155 |
\isanewline
|
|
156 |
\ \ \isamarkupfalse%
|
|
157 |
\isacommand{have}\ {\isachardoublequote}x{\isadigit{1}}\ {\isacharequal}\ x{\isadigit{2}}{\isachardoublequote}\ \isamarkupfalse%
|
|
158 |
\isacommand{sorry}\isanewline
|
|
159 |
\ \ \isamarkupfalse%
|
|
160 |
\isacommand{also}\isanewline
|
|
161 |
\ \ \isamarkupfalse%
|
|
162 |
\isacommand{have}\ {\isachardoublequote}x{\isadigit{2}}\ {\isacharequal}\ x{\isadigit{3}}{\isachardoublequote}\ \isamarkupfalse%
|
|
163 |
\isacommand{sorry}\isanewline
|
|
164 |
\ \ \isamarkupfalse%
|
|
165 |
\isacommand{also}\isanewline
|
|
166 |
\ \ \isamarkupfalse%
|
|
167 |
\isacommand{have}\ {\isachardoublequote}x{\isadigit{3}}\ {\isacharequal}\ x{\isadigit{4}}{\isachardoublequote}\ \isamarkupfalse%
|
|
168 |
\isacommand{sorry}\isanewline
|
|
169 |
\ \ \isamarkupfalse%
|
|
170 |
\isacommand{finally}\isanewline
|
|
171 |
\ \ \isamarkupfalse%
|
|
172 |
\isacommand{show}\ {\isachardoublequote}x{\isadigit{1}}\ {\isacharequal}\ x{\isadigit{4}}{\isachardoublequote}\ \isamarkupfalse%
|
|
173 |
\isacommand{{\isachardot}}\isanewline
|
|
174 |
\isamarkupfalse%
|
|
175 |
\isacommand{qed}\isamarkupfalse%
|
|
176 |
%
|
|
177 |
\begin{isamarkuptext}%
|
|
178 |
This may be written more succinctly, using the special term binds
|
|
179 |
``\isa{{\isasymdots}}'' (for the right-hand side of the last statement) and
|
|
180 |
``\isa{{\isacharquery}thesis}'' (for the original claim at the head of the
|
|
181 |
proof).%
|
|
182 |
\end{isamarkuptext}%
|
|
183 |
\isamarkuptrue%
|
|
184 |
\isacommand{lemma}\ {\isachardoublequote}x{\isadigit{1}}\ {\isacharequal}\ x{\isadigit{4}}{\isachardoublequote}\isanewline
|
|
185 |
\isamarkupfalse%
|
|
186 |
\isacommand{proof}\ {\isacharminus}\isanewline
|
|
187 |
\ \ \isamarkupfalse%
|
|
188 |
\isacommand{have}\ {\isachardoublequote}x{\isadigit{1}}\ {\isacharequal}\ x{\isadigit{2}}{\isachardoublequote}\ \isamarkupfalse%
|
|
189 |
\isacommand{sorry}\isanewline
|
|
190 |
\ \ \isamarkupfalse%
|
|
191 |
\isacommand{also}\ \isamarkupfalse%
|
|
192 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isacharequal}\ x{\isadigit{3}}{\isachardoublequote}\ \isamarkupfalse%
|
|
193 |
\isacommand{sorry}\isanewline
|
|
194 |
\ \ \isamarkupfalse%
|
|
195 |
\isacommand{also}\ \isamarkupfalse%
|
|
196 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isacharequal}\ x{\isadigit{4}}{\isachardoublequote}\ \isamarkupfalse%
|
|
197 |
\isacommand{sorry}\isanewline
|
|
198 |
\ \ \isamarkupfalse%
|
|
199 |
\isacommand{finally}\ \isamarkupfalse%
|
|
200 |
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
|
|
201 |
\isacommand{{\isachardot}}\isanewline
|
|
202 |
\isamarkupfalse%
|
|
203 |
\isacommand{qed}\isamarkupfalse%
|
|
204 |
%
|
|
205 |
\begin{isamarkuptext}%
|
|
206 |
The (implicit) forward-chaining steps involved in \cmd{also} and
|
|
207 |
\cmd{finally} are declared in the current context. The main library
|
|
208 |
of Isabelle/HOL already knows about (mixed) transitivities of \isa{{\isacharequal}}, \isa{{\isacharless}}, \isa{{\isasymle}} etc.%
|
|
209 |
\end{isamarkuptext}%
|
|
210 |
\isamarkuptrue%
|
|
211 |
\isacommand{lemma}\ {\isachardoublequote}{\isacharparenleft}x{\isadigit{1}}{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ {\isacharless}\ x{\isadigit{6}}{\isachardoublequote}\isanewline
|
|
212 |
\ \ %
|
|
213 |
\isamarkupcmt{restriction to type \isa{nat} ensures that \isa{{\isacharless}} is really transitive%
|
|
214 |
}
|
|
215 |
\isanewline
|
|
216 |
\isamarkupfalse%
|
|
217 |
\isacommand{proof}\ {\isacharminus}\isanewline
|
|
218 |
\ \ \isamarkupfalse%
|
|
219 |
\isacommand{have}\ {\isachardoublequote}x{\isadigit{1}}\ {\isacharless}\ x{\isadigit{2}}{\isachardoublequote}\ \isamarkupfalse%
|
|
220 |
\isacommand{sorry}\isanewline
|
|
221 |
\ \ \isamarkupfalse%
|
|
222 |
\isacommand{also}\ \isamarkupfalse%
|
|
223 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isasymle}\ x{\isadigit{3}}{\isachardoublequote}\ \isamarkupfalse%
|
|
224 |
\isacommand{sorry}\isanewline
|
|
225 |
\ \ \isamarkupfalse%
|
|
226 |
\isacommand{also}\ \isamarkupfalse%
|
|
227 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isacharequal}\ x{\isadigit{4}}{\isachardoublequote}\ \isamarkupfalse%
|
|
228 |
\isacommand{sorry}\isanewline
|
|
229 |
\ \ \isamarkupfalse%
|
|
230 |
\isacommand{also}\ \isamarkupfalse%
|
|
231 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isacharless}\ x{\isadigit{5}}{\isachardoublequote}\ \isamarkupfalse%
|
|
232 |
\isacommand{sorry}\isanewline
|
|
233 |
\ \ \isamarkupfalse%
|
|
234 |
\isacommand{also}\ \isamarkupfalse%
|
|
235 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isacharequal}\ x{\isadigit{6}}{\isachardoublequote}\ \isamarkupfalse%
|
|
236 |
\isacommand{sorry}\isanewline
|
|
237 |
\ \ \isamarkupfalse%
|
|
238 |
\isacommand{finally}\ \isamarkupfalse%
|
|
239 |
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
|
|
240 |
\isacommand{{\isachardot}}\isanewline
|
|
241 |
\isamarkupfalse%
|
|
242 |
\isacommand{qed}\isamarkupfalse%
|
|
243 |
%
|
|
244 |
\begin{isamarkuptext}%
|
|
245 |
We may also calculate on propositions.%
|
|
246 |
\end{isamarkuptext}%
|
|
247 |
\isamarkuptrue%
|
|
248 |
\isacommand{lemma}\ True\isanewline
|
|
249 |
\isamarkupfalse%
|
|
250 |
\isacommand{proof}\isanewline
|
|
251 |
\ \ \isamarkupfalse%
|
|
252 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ B\ {\isasymlongrightarrow}\ C{\isachardoublequote}\ \isamarkupfalse%
|
|
253 |
\isacommand{sorry}\isanewline
|
|
254 |
\ \ \isamarkupfalse%
|
|
255 |
\isacommand{also}\ \isamarkupfalse%
|
|
256 |
\isacommand{have}\ A\ \isamarkupfalse%
|
|
257 |
\isacommand{sorry}\isanewline
|
|
258 |
\ \ \isamarkupfalse%
|
|
259 |
\isacommand{also}\ \isamarkupfalse%
|
|
260 |
\isacommand{have}\ B\ \isamarkupfalse%
|
|
261 |
\isacommand{sorry}\isanewline
|
|
262 |
\ \ \isamarkupfalse%
|
|
263 |
\isacommand{finally}\ \isamarkupfalse%
|
|
264 |
\isacommand{have}\ C\ \isamarkupfalse%
|
|
265 |
\isacommand{{\isachardot}}\isanewline
|
|
266 |
\isamarkupfalse%
|
|
267 |
\isacommand{qed}\isamarkupfalse%
|
|
268 |
%
|
|
269 |
\begin{isamarkuptext}%
|
|
270 |
This is getting pretty close to Dijkstra's preferred proof style.%
|
|
271 |
\end{isamarkuptext}%
|
|
272 |
\isamarkuptrue%
|
|
273 |
\isacommand{lemma}\ True\isanewline
|
|
274 |
\isamarkupfalse%
|
|
275 |
\isacommand{proof}\isanewline
|
|
276 |
\ \ \isamarkupfalse%
|
|
277 |
\isacommand{have}\ {\isacharbrackleft}trans{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymAnd}X\ Y\ Z{\isachardot}\ X\ {\isasymlongrightarrow}\ Y\ {\isasymLongrightarrow}\ Y\ {\isasymlongrightarrow}\ Z\ {\isasymLongrightarrow}\ X\ {\isasymlongrightarrow}\ Z{\isachardoublequote}\ \isamarkupfalse%
|
|
278 |
\isacommand{by}\ rules\isanewline
|
|
279 |
\ \ \isamarkupfalse%
|
|
280 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ B{\isachardoublequote}\ \isamarkupfalse%
|
|
281 |
\isacommand{sorry}\isanewline
|
|
282 |
\ \ \isamarkupfalse%
|
|
283 |
\isacommand{also}\ \isamarkupfalse%
|
|
284 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isasymlongrightarrow}\ C{\isachardoublequote}\ \isamarkupfalse%
|
|
285 |
\isacommand{sorry}\isanewline
|
|
286 |
\ \ \isamarkupfalse%
|
|
287 |
\isacommand{also}\ \isamarkupfalse%
|
|
288 |
\isacommand{have}\ {\isachardoublequote}{\isasymdots}\ {\isasymlongrightarrow}\ D{\isachardoublequote}\ \isamarkupfalse%
|
|
289 |
\isacommand{sorry}\isanewline
|
|
290 |
\ \ \isamarkupfalse%
|
|
291 |
\isacommand{finally}\ \isamarkupfalse%
|
|
292 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ D{\isachardoublequote}\ \isamarkupfalse%
|
|
293 |
\isacommand{{\isachardot}}\isanewline
|
|
294 |
\isamarkupfalse%
|
|
295 |
\isacommand{qed}\isamarkupfalse%
|
|
296 |
%
|
|
297 |
\isamarkupsubsubsection{Degenerate calculations and bigstep reasoning%
|
|
298 |
}
|
|
299 |
\isamarkuptrue%
|
|
300 |
%
|
|
301 |
\begin{isamarkuptext}%
|
|
302 |
Instead of \cmd{also}/\cmd{finally} we may use degenerative steps
|
|
303 |
\cmd{moreover}/\cmd{ultimately} to accumulate facts, without
|
|
304 |
applying any forward rules yet.%
|
|
305 |
\end{isamarkuptext}%
|
|
306 |
\isamarkuptrue%
|
|
307 |
\isacommand{lemma}\ True\isanewline
|
|
308 |
\isamarkupfalse%
|
|
309 |
\isacommand{proof}\isanewline
|
|
310 |
\ \ \isamarkupfalse%
|
|
311 |
\isacommand{have}\ A\ \isamarkupfalse%
|
|
312 |
\isacommand{sorry}\isanewline
|
|
313 |
\ \ \isamarkupfalse%
|
|
314 |
\isacommand{moreover}\ \isamarkupfalse%
|
|
315 |
\isacommand{have}\ B\ \isamarkupfalse%
|
|
316 |
\isacommand{sorry}\isanewline
|
|
317 |
\ \ \isamarkupfalse%
|
|
318 |
\isacommand{moreover}\ \isamarkupfalse%
|
|
319 |
\isacommand{have}\ C\ \isamarkupfalse%
|
|
320 |
\isacommand{sorry}\isanewline
|
|
321 |
\ \ \isamarkupfalse%
|
|
322 |
\isacommand{ultimately}\ \isamarkupfalse%
|
|
323 |
\isacommand{have}\ A\ \isakeyword{and}\ B\ \isakeyword{and}\ C\ \isamarkupfalse%
|
|
324 |
\isacommand{{\isachardot}}\ \ %
|
|
325 |
\isamarkupcmt{Pretty obvious, right?%
|
|
326 |
}
|
|
327 |
\isanewline
|
|
328 |
\isamarkupfalse%
|
|
329 |
\isacommand{qed}\isamarkupfalse%
|
|
330 |
%
|
|
331 |
\begin{isamarkuptext}%
|
|
332 |
Both kinds of calculational elements may be used together.%
|
|
333 |
\end{isamarkuptext}%
|
|
334 |
\isamarkuptrue%
|
|
335 |
\isacommand{lemma}\ True\isanewline
|
|
336 |
\isamarkupfalse%
|
|
337 |
\isacommand{proof}\isanewline
|
|
338 |
\ \ \isamarkupfalse%
|
|
339 |
\isacommand{assume}\ reasoning{\isacharunderscore}pattern\ {\isacharbrackleft}trans{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}A\ {\isasymLongrightarrow}\ B\ {\isasymLongrightarrow}\ C\ {\isasymLongrightarrow}\ D{\isachardoublequote}\isanewline
|
|
340 |
\ \ \isamarkupfalse%
|
|
341 |
\isacommand{have}\ A\ \isamarkupfalse%
|
|
342 |
\isacommand{sorry}\isanewline
|
|
343 |
\ \ \isamarkupfalse%
|
|
344 |
\isacommand{moreover}\ \isamarkupfalse%
|
|
345 |
\isacommand{have}\ B\ \isamarkupfalse%
|
|
346 |
\isacommand{sorry}\isanewline
|
|
347 |
\ \ \isamarkupfalse%
|
|
348 |
\isacommand{moreover}\ \isamarkupfalse%
|
|
349 |
\isacommand{have}\ C\ \isamarkupfalse%
|
|
350 |
\isacommand{sorry}\isanewline
|
|
351 |
\ \ \isamarkupfalse%
|
|
352 |
\isacommand{finally}\ \isamarkupfalse%
|
|
353 |
\isacommand{have}\ D\ \isamarkupfalse%
|
|
354 |
\isacommand{{\isachardot}}\isanewline
|
|
355 |
\isamarkupfalse%
|
|
356 |
\isacommand{qed}\isamarkupfalse%
|
|
357 |
%
|
|
358 |
\isamarkupsubsection{Natural deduction%
|
|
359 |
}
|
|
360 |
\isamarkuptrue%
|
|
361 |
%
|
|
362 |
\isamarkupsubsubsection{Primitive patterns%
|
|
363 |
}
|
|
364 |
\isamarkuptrue%
|
|
365 |
%
|
|
366 |
\begin{isamarkuptext}%
|
|
367 |
The default theory context admits to perform canonical single-step
|
|
368 |
reasoning (similar to Gentzen) without further ado.%
|
|
369 |
\end{isamarkuptext}%
|
|
370 |
\isamarkuptrue%
|
|
371 |
\isacommand{lemma}\ True\isanewline
|
|
372 |
\isamarkupfalse%
|
|
373 |
\isacommand{proof}\isanewline
|
|
374 |
\isanewline
|
|
375 |
\ \ \isamarkupfalse%
|
|
376 |
\isacommand{have}\ True\ \isamarkupfalse%
|
|
377 |
\isacommand{{\isachardot}{\isachardot}}\isanewline
|
|
378 |
\isanewline
|
|
379 |
\ \ \isamarkupfalse%
|
|
380 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
381 |
\isacommand{assume}\ False\isanewline
|
|
382 |
\ \ \ \ \isamarkupfalse%
|
|
383 |
\isacommand{then}\ \isamarkupfalse%
|
|
384 |
\isacommand{have}\ C\ \isamarkupfalse%
|
|
385 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
386 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
387 |
\isanewline
|
|
388 |
\ \ \isamarkupfalse%
|
|
389 |
\isacommand{have}\ {\isachardoublequote}{\isasymnot}\ A{\isachardoublequote}\isanewline
|
|
390 |
\ \ \isamarkupfalse%
|
|
391 |
\isacommand{proof}\isanewline
|
|
392 |
\ \ \ \ \isamarkupfalse%
|
|
393 |
\isacommand{assume}\ A\isanewline
|
|
394 |
\ \ \ \ \isamarkupfalse%
|
|
395 |
\isacommand{show}\ False\ \isamarkupfalse%
|
|
396 |
\isacommand{sorry}\isanewline
|
|
397 |
\ \ \isamarkupfalse%
|
|
398 |
\isacommand{qed}\isanewline
|
|
399 |
\isanewline
|
|
400 |
\ \ \isamarkupfalse%
|
|
401 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
402 |
\isacommand{assume}\ {\isachardoublequote}{\isasymnot}\ A{\isachardoublequote}\ \isakeyword{and}\ A\isanewline
|
|
403 |
\ \ \ \ \isamarkupfalse%
|
|
404 |
\isacommand{then}\ \isamarkupfalse%
|
|
405 |
\isacommand{have}\ C\ \isamarkupfalse%
|
|
406 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
407 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
408 |
\isanewline
|
|
409 |
\ \ \isamarkupfalse%
|
|
410 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ B{\isachardoublequote}\isanewline
|
|
411 |
\ \ \isamarkupfalse%
|
|
412 |
\isacommand{proof}\isanewline
|
|
413 |
\ \ \ \ \isamarkupfalse%
|
|
414 |
\isacommand{assume}\ A\isanewline
|
|
415 |
\ \ \ \ \isamarkupfalse%
|
|
416 |
\isacommand{show}\ B\ \isamarkupfalse%
|
|
417 |
\isacommand{sorry}\isanewline
|
|
418 |
\ \ \isamarkupfalse%
|
|
419 |
\isacommand{qed}\isanewline
|
|
420 |
\isanewline
|
|
421 |
\ \ \isamarkupfalse%
|
|
422 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
423 |
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymlongrightarrow}\ B{\isachardoublequote}\ \isakeyword{and}\ A\isanewline
|
|
424 |
\ \ \ \ \isamarkupfalse%
|
|
425 |
\isacommand{then}\ \isamarkupfalse%
|
|
426 |
\isacommand{have}\ B\ \isamarkupfalse%
|
|
427 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
428 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
429 |
\isanewline
|
|
430 |
\ \ \isamarkupfalse%
|
|
431 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
|
|
432 |
\ \ \isamarkupfalse%
|
|
433 |
\isacommand{proof}\isanewline
|
|
434 |
\ \ \ \ \isamarkupfalse%
|
|
435 |
\isacommand{show}\ A\ \isamarkupfalse%
|
|
436 |
\isacommand{sorry}\isanewline
|
|
437 |
\ \ \ \ \isamarkupfalse%
|
|
438 |
\isacommand{show}\ B\ \isamarkupfalse%
|
|
439 |
\isacommand{sorry}\isanewline
|
|
440 |
\ \ \isamarkupfalse%
|
|
441 |
\isacommand{qed}\isanewline
|
|
442 |
\isanewline
|
|
443 |
\ \ \isamarkupfalse%
|
|
444 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
445 |
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
|
|
446 |
\ \ \ \ \isamarkupfalse%
|
|
447 |
\isacommand{then}\ \isamarkupfalse%
|
|
448 |
\isacommand{have}\ A\ \isamarkupfalse%
|
|
449 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
450 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
451 |
\isanewline
|
|
452 |
\ \ \isamarkupfalse%
|
|
453 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
454 |
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymand}\ B{\isachardoublequote}\isanewline
|
|
455 |
\ \ \ \ \isamarkupfalse%
|
|
456 |
\isacommand{then}\ \isamarkupfalse%
|
|
457 |
\isacommand{have}\ B\ \isamarkupfalse%
|
|
458 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
459 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
460 |
\isanewline
|
|
461 |
\ \ \isamarkupfalse%
|
|
462 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
463 |
\isacommand{assume}\ A\isanewline
|
|
464 |
\ \ \ \ \isamarkupfalse%
|
|
465 |
\isacommand{then}\ \isamarkupfalse%
|
|
466 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymor}\ B{\isachardoublequote}\ \isamarkupfalse%
|
|
467 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
468 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
469 |
\isanewline
|
|
470 |
\ \ \isamarkupfalse%
|
|
471 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
472 |
\isacommand{assume}\ B\isanewline
|
|
473 |
\ \ \ \ \isamarkupfalse%
|
|
474 |
\isacommand{then}\ \isamarkupfalse%
|
|
475 |
\isacommand{have}\ {\isachardoublequote}A\ {\isasymor}\ B{\isachardoublequote}\ \isamarkupfalse%
|
|
476 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
477 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
478 |
\isanewline
|
|
479 |
\ \ \isamarkupfalse%
|
|
480 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
481 |
\isacommand{assume}\ {\isachardoublequote}A\ {\isasymor}\ B{\isachardoublequote}\isanewline
|
|
482 |
\ \ \ \ \isamarkupfalse%
|
|
483 |
\isacommand{then}\ \isamarkupfalse%
|
|
484 |
\isacommand{have}\ C\isanewline
|
|
485 |
\ \ \ \ \isamarkupfalse%
|
|
486 |
\isacommand{proof}\isanewline
|
|
487 |
\ \ \ \ \ \ \isamarkupfalse%
|
|
488 |
\isacommand{assume}\ A\isanewline
|
|
489 |
\ \ \ \ \ \ \isamarkupfalse%
|
|
490 |
\isacommand{then}\ \isamarkupfalse%
|
|
491 |
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
|
|
492 |
\isacommand{sorry}\isanewline
|
|
493 |
\ \ \ \ \isamarkupfalse%
|
|
494 |
\isacommand{next}\isanewline
|
|
495 |
\ \ \ \ \ \ \isamarkupfalse%
|
|
496 |
\isacommand{assume}\ B\isanewline
|
|
497 |
\ \ \ \ \ \ \isamarkupfalse%
|
|
498 |
\isacommand{then}\ \isamarkupfalse%
|
|
499 |
\isacommand{show}\ {\isacharquery}thesis\ \isamarkupfalse%
|
|
500 |
\isacommand{sorry}\isanewline
|
|
501 |
\ \ \ \ \isamarkupfalse%
|
|
502 |
\isacommand{qed}\ \isamarkupfalse%
|
|
503 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
504 |
\isanewline
|
|
505 |
\ \ \isamarkupfalse%
|
|
506 |
\isacommand{have}\ {\isachardoublequote}{\isasymforall}x{\isachardot}\ P\ x{\isachardoublequote}\isanewline
|
|
507 |
\ \ \isamarkupfalse%
|
|
508 |
\isacommand{proof}\isanewline
|
|
509 |
\ \ \ \ \isamarkupfalse%
|
|
510 |
\isacommand{fix}\ x\isanewline
|
|
511 |
\ \ \ \ \isamarkupfalse%
|
|
512 |
\isacommand{show}\ {\isachardoublequote}P\ x{\isachardoublequote}\ \isamarkupfalse%
|
|
513 |
\isacommand{sorry}\isanewline
|
|
514 |
\ \ \isamarkupfalse%
|
|
515 |
\isacommand{qed}\isanewline
|
|
516 |
\isanewline
|
|
517 |
\ \ \isamarkupfalse%
|
|
518 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
519 |
\isacommand{assume}\ {\isachardoublequote}{\isasymforall}x{\isachardot}\ P\ x{\isachardoublequote}\isanewline
|
|
520 |
\ \ \ \ \isamarkupfalse%
|
|
521 |
\isacommand{then}\ \isamarkupfalse%
|
|
522 |
\isacommand{have}\ {\isachardoublequote}P\ t{\isachardoublequote}\ \isamarkupfalse%
|
|
523 |
\isacommand{{\isachardot}{\isachardot}}\ \isamarkupfalse%
|
|
524 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
525 |
\isanewline
|
|
526 |
\ \ \isamarkupfalse%
|
|
527 |
\isacommand{have}\ {\isachardoublequote}{\isasymexists}x{\isachardot}\ P\ x{\isachardoublequote}\isanewline
|
|
528 |
\ \ \isamarkupfalse%
|
|
529 |
\isacommand{proof}\isanewline
|
|
530 |
\ \ \ \ \isamarkupfalse%
|
|
531 |
\isacommand{show}\ {\isachardoublequote}P\ t{\isachardoublequote}\ \isamarkupfalse%
|
|
532 |
\isacommand{sorry}\isanewline
|
|
533 |
\ \ \isamarkupfalse%
|
|
534 |
\isacommand{qed}\isanewline
|
|
535 |
\ \ \isanewline
|
|
536 |
\ \ \isamarkupfalse%
|
|
537 |
\isacommand{{\isacharbraceleft}}\ \isamarkupfalse%
|
|
538 |
\isacommand{assume}\ {\isachardoublequote}{\isasymexists}x{\isachardot}\ P\ x{\isachardoublequote}\isanewline
|
|
539 |
\ \ \ \ \isamarkupfalse%
|
|
540 |
\isacommand{then}\ \isamarkupfalse%
|
|
541 |
\isacommand{obtain}\ x\ \isakeyword{where}\ {\isachardoublequote}P\ x{\isachardoublequote}\ \isamarkupfalse%
|
|
542 |
\isacommand{{\isachardot}{\isachardot}}\isanewline
|
|
543 |
\ \ \ \ \isamarkupfalse%
|
|
544 |
\isacommand{note}\ nothing\ \ %
|
|
545 |
\isamarkupcmt{relax%
|
|
546 |
}
|
|
547 |
\ \isamarkupfalse%
|
|
548 |
\isacommand{{\isacharbraceright}}\isanewline
|
|
549 |
\isamarkupfalse%
|
|
550 |
\isacommand{qed}\isamarkupfalse%
|
|
551 |
%
|
|
552 |
\begin{isamarkuptext}%
|
|
553 |
Certainly, this works with derived rules for defined concepts in the
|
|
554 |
same manner. E.g.\ use the simple-typed set-theory of Isabelle/HOL.%
|
|
555 |
\end{isamarkuptext}%
|
|
556 |
\isamarkuptrue%
|
|
557 |
\isacommand{lemma}\ True\isanewline
|
|
558 |
\isamarkupfalse%
|
|
559 |
\isacommand{proof}\isanewline
|
|
560 |
\ \ \isamarkupfalse%
|
|
561 |
\isacommand{have}\ {\isachardoublequote}y\ {\isasymin}\ {\isacharparenleft}{\isasymInter}x\ {\isasymin}\ A{\isachardot}\ B\ x{\isacharparenright}{\isachardoublequote}\isanewline
|
|
562 |
\ \ \isamarkupfalse%
|
|
563 |
\isacommand{proof}\isanewline
|
|
564 |
\ \ \ \ \isamarkupfalse%
|
|
565 |
\isacommand{fix}\ x\isanewline
|
|
566 |
\ \ \ \ \isamarkupfalse%
|
|
567 |
\isacommand{assume}\ {\isachardoublequote}x\ {\isasymin}\ A{\isachardoublequote}\isanewline
|
|
568 |
\ \ \ \ \isamarkupfalse%
|
|
569 |
\isacommand{show}\ {\isachardoublequote}y\ {\isasymin}\ B\ x{\isachardoublequote}\ \isamarkupfalse%
|
|
570 |
\isacommand{sorry}\isanewline
|
|
571 |
\ \ \isamarkupfalse%
|
|
572 |
\isacommand{qed}\isanewline
|
|
573 |
\isanewline
|
|
574 |
\ \ \isamarkupfalse%
|
|
575 |
\isacommand{have}\ {\isachardoublequote}y\ {\isasymin}\ {\isacharparenleft}{\isasymUnion}x\ {\isasymin}\ A{\isachardot}\ B\ x{\isacharparenright}{\isachardoublequote}\isanewline
|
|
576 |
\ \ \isamarkupfalse%
|
|
577 |
\isacommand{proof}\isanewline
|
|
578 |
\ \ \ \ \isamarkupfalse%
|
|
579 |
\isacommand{show}\ {\isachardoublequote}a\ {\isasymin}\ A{\isachardoublequote}\ \isamarkupfalse%
|
|
580 |
\isacommand{sorry}\isanewline
|
|
581 |
\ \ \ \ \isamarkupfalse%
|
|
582 |
\isacommand{show}\ {\isachardoublequote}y\ {\isasymin}\ B\ a{\isachardoublequote}\ \isamarkupfalse%
|
|
583 |
\isacommand{sorry}\isanewline
|
|
584 |
\ \ \isamarkupfalse%
|
|
585 |
\isacommand{qed}\isanewline
|
|
586 |
\isamarkupfalse%
|
|
587 |
\isacommand{qed}\isamarkupfalse%
|
|
588 |
%
|
|
589 |
\isamarkupsubsubsection{Variations in structure%
|
|
590 |
}
|
|
591 |
\isamarkuptrue%
|
|
592 |
%
|
|
593 |
\begin{isamarkuptext}%
|
|
594 |
The design of the Isar language takes the user seriously%
|
|
595 |
\end{isamarkuptext}%
|
|
596 |
\isamarkuptrue%
|
|
597 |
%
|
|
598 |
\isamarkupsubsubsection{Generalized elimination%
|
|
599 |
}
|
|
600 |
\isamarkuptrue%
|
|
601 |
%
|
|
602 |
\isamarkupsubsubsection{Scalable cases and induction%
|
|
603 |
}
|
|
604 |
\isamarkuptrue%
|
|
605 |
%
|
|
606 |
\isamarkupsection{Assimilating the old tactical style%
|
|
607 |
}
|
|
608 |
\isamarkuptrue%
|
|
609 |
%
|
|
610 |
\begin{isamarkuptext}%
|
|
611 |
Improper commands:
|
|
612 |
Observation: every Isar subproof may start with a ``script'' of%
|
|
613 |
\end{isamarkuptext}%
|
|
614 |
\isamarkuptrue%
|
|
615 |
\isamarkupfalse%
|
|
616 |
\end{isabellebody}%
|
|
617 |
%%% Local Variables:
|
|
618 |
%%% mode: latex
|
|
619 |
%%% TeX-master: "root"
|
|
620 |
%%% End:
|