author | chaieb |
Tue, 20 Sep 2005 10:36:33 +0200 | |
changeset 17499 | 5274ecba8fea |
parent 17187 | 45bee2f6e61f |
child 26698 | ca558202ffa5 |
permissions | -rw-r--r-- |
10560 | 1 |
% |
2 |
\begin{isabellebody}% |
|
3 |
\def\isabellecontext{Pairs}% |
|
17056 | 4 |
% |
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
% |
|
11 |
\endisatagtheory |
|
12 |
{\isafoldtheory}% |
|
13 |
% |
|
14 |
\isadelimtheory |
|
15 |
% |
|
16 |
\endisadelimtheory |
|
10560 | 17 |
% |
11428 | 18 |
\isamarkupsection{Pairs and Tuples% |
10560 | 19 |
} |
11866 | 20 |
\isamarkuptrue% |
10560 | 21 |
% |
22 |
\begin{isamarkuptext}% |
|
23 |
\label{sec:products} |
|
11428 | 24 |
Ordered pairs were already introduced in \S\ref{sec:pairs}, but only with a minimal |
10560 | 25 |
repertoire of operations: pairing and the two projections \isa{fst} and |
11149 | 26 |
\isa{snd}. In any non-trivial application of pairs you will find that this |
11494 | 27 |
quickly leads to unreadable nests of projections. This |
28 |
section introduces syntactic sugar to overcome this |
|
10560 | 29 |
problem: pattern matching with tuples.% |
30 |
\end{isamarkuptext}% |
|
11866 | 31 |
\isamarkuptrue% |
10560 | 32 |
% |
10878 | 33 |
\isamarkupsubsection{Pattern Matching with Tuples% |
10560 | 34 |
} |
11866 | 35 |
\isamarkuptrue% |
10560 | 36 |
% |
37 |
\begin{isamarkuptext}% |
|
10878 | 38 |
Tuples may be used as patterns in $\lambda$-abstractions, |
10560 | 39 |
for example \isa{{\isasymlambda}{\isacharparenleft}x{\isacharcomma}y{\isacharcomma}z{\isacharparenright}{\isachardot}x{\isacharplus}y{\isacharplus}z} and \isa{{\isasymlambda}{\isacharparenleft}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isacharcomma}z{\isacharparenright}{\isachardot}x{\isacharplus}y{\isacharplus}z}. In fact, |
10878 | 40 |
tuple patterns can be used in most variable binding constructs, |
41 |
and they can be nested. Here are |
|
10560 | 42 |
some typical examples: |
43 |
\begin{quote} |
|
44 |
\isa{let\ {\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}\ {\isacharequal}\ f\ z\ in\ {\isacharparenleft}y{\isacharcomma}\ x{\isacharparenright}}\\ |
|
12699 | 45 |
\isa{case\ xs\ of\ {\isacharbrackleft}{\isacharbrackright}\ {\isasymRightarrow}\ {\isadigit{0}}\ {\isacharbar}\ {\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}\ {\isacharhash}\ zs\ {\isasymRightarrow}\ x\ {\isacharplus}\ y}\\ |
10560 | 46 |
\isa{{\isasymforall}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isasymin}A{\isachardot}\ x{\isacharequal}y}\\ |
10878 | 47 |
\isa{{\isacharbraceleft}{\isacharparenleft}x{\isacharcomma}y{\isacharcomma}z{\isacharparenright}{\isachardot}\ x{\isacharequal}z{\isacharbraceright}}\\ |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
13791
diff
changeset
|
48 |
\isa{{\isasymUnion}\isactrlbsub {\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}{\isasymin}A\isactrlesub \ {\isacharbraceleft}x\ {\isacharplus}\ y{\isacharbraceright}} |
11149 | 49 |
\end{quote} |
10878 | 50 |
The intuitive meanings of these expressions should be obvious. |
10560 | 51 |
Unfortunately, we need to know in more detail what the notation really stands |
10878 | 52 |
for once we have to reason about it. Abstraction |
10560 | 53 |
over pairs and tuples is merely a convenient shorthand for a more complex |
54 |
internal representation. Thus the internal and external form of a term may |
|
55 |
differ, which can affect proofs. If you want to avoid this complication, |
|
56 |
stick to \isa{fst} and \isa{snd} and write \isa{{\isasymlambda}p{\isachardot}\ fst\ p\ {\isacharplus}\ snd\ p} |
|
11494 | 57 |
instead of \isa{{\isasymlambda}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isachardot}\ x{\isacharplus}y}. These terms are distinct even though they |
58 |
denote the same function. |
|
10560 | 59 |
|
60 |
Internally, \isa{{\isasymlambda}{\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}{\isachardot}\ t} becomes \isa{split\ {\isacharparenleft}{\isasymlambda}x\ y{\isachardot}\ t{\isacharparenright}}, where |
|
11494 | 61 |
\cdx{split} is the uncurrying function of type \isa{{\isacharparenleft}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}b\ {\isasymRightarrow}\ {\isacharprime}c{\isacharparenright}\ {\isasymRightarrow}\ {\isacharprime}a\ {\isasymtimes}\ {\isacharprime}b\ {\isasymRightarrow}\ {\isacharprime}c} defined as |
10560 | 62 |
\begin{center} |
63 |
\isa{split\ {\isasymequiv}\ {\isasymlambda}c\ p{\isachardot}\ c\ {\isacharparenleft}fst\ p{\isacharparenright}\ {\isacharparenleft}snd\ p{\isacharparenright}} |
|
64 |
\hfill(\isa{split{\isacharunderscore}def}) |
|
65 |
\end{center} |
|
66 |
Pattern matching in |
|
67 |
other variable binding constructs is translated similarly. Thus we need to |
|
68 |
understand how to reason about such constructs.% |
|
69 |
\end{isamarkuptext}% |
|
11866 | 70 |
\isamarkuptrue% |
10560 | 71 |
% |
10878 | 72 |
\isamarkupsubsection{Theorem Proving% |
10560 | 73 |
} |
11866 | 74 |
\isamarkuptrue% |
10560 | 75 |
% |
76 |
\begin{isamarkuptext}% |
|
77 |
The most obvious approach is the brute force expansion of \isa{split}:% |
|
78 |
\end{isamarkuptext}% |
|
17175 | 79 |
\isamarkuptrue% |
80 |
\isacommand{lemma}\isamarkupfalse% |
|
81 |
\ {\isachardoublequoteopen}{\isacharparenleft}{\isasymlambda}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isachardot}x{\isacharparenright}\ p\ {\isacharequal}\ fst\ p{\isachardoublequoteclose}\isanewline |
|
17056 | 82 |
% |
83 |
\isadelimproof |
|
84 |
% |
|
85 |
\endisadelimproof |
|
86 |
% |
|
87 |
\isatagproof |
|
17175 | 88 |
\isacommand{by}\isamarkupfalse% |
89 |
{\isacharparenleft}simp\ add{\isacharcolon}\ split{\isacharunderscore}def{\isacharparenright}% |
|
17056 | 90 |
\endisatagproof |
91 |
{\isafoldproof}% |
|
92 |
% |
|
93 |
\isadelimproof |
|
94 |
% |
|
95 |
\endisadelimproof |
|
11866 | 96 |
% |
10560 | 97 |
\begin{isamarkuptext}% |
98 |
This works well if rewriting with \isa{split{\isacharunderscore}def} finishes the |
|
11149 | 99 |
proof, as it does above. But if it does not, you end up with exactly what |
10560 | 100 |
we are trying to avoid: nests of \isa{fst} and \isa{snd}. Thus this |
101 |
approach is neither elegant nor very practical in large examples, although it |
|
102 |
can be effective in small ones. |
|
103 |
||
11494 | 104 |
If we consider why this lemma presents a problem, |
105 |
we quickly realize that we need to replace the variable~\isa{p} by some pair \isa{{\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}}. Then both sides of the |
|
106 |
equation would simplify to \isa{a} by the simplification rules |
|
107 |
\isa{split\ c\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}\ {\isacharequal}\ c\ a\ b} and \isa{fst\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}\ {\isacharequal}\ a}. |
|
108 |
To reason about tuple patterns requires some way of |
|
109 |
converting a variable of product type into a pair. |
|
10560 | 110 |
|
111 |
In case of a subterm of the form \isa{split\ f\ p} this is easy: the split |
|
112 |
rule \isa{split{\isacharunderscore}split} replaces \isa{p} by a pair:% |
|
11494 | 113 |
\index{*split (method)}% |
10560 | 114 |
\end{isamarkuptext}% |
17175 | 115 |
\isamarkuptrue% |
116 |
\isacommand{lemma}\isamarkupfalse% |
|
117 |
\ {\isachardoublequoteopen}{\isacharparenleft}{\isasymlambda}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isachardot}y{\isacharparenright}\ p\ {\isacharequal}\ snd\ p{\isachardoublequoteclose}\isanewline |
|
17056 | 118 |
% |
119 |
\isadelimproof |
|
120 |
% |
|
121 |
\endisadelimproof |
|
122 |
% |
|
123 |
\isatagproof |
|
17175 | 124 |
\isacommand{apply}\isamarkupfalse% |
125 |
{\isacharparenleft}split\ split{\isacharunderscore}split{\isacharparenright}% |
|
16353 | 126 |
\begin{isamarkuptxt}% |
127 |
\begin{isabelle}% |
|
128 |
\ {\isadigit{1}}{\isachardot}\ {\isasymforall}x\ y{\isachardot}\ p\ {\isacharequal}\ {\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}\ {\isasymlongrightarrow}\ y\ {\isacharequal}\ snd\ p% |
|
129 |
\end{isabelle} |
|
130 |
This subgoal is easily proved by simplification. Thus we could have combined |
|
131 |
simplification and splitting in one command that proves the goal outright:% |
|
132 |
\end{isamarkuptxt}% |
|
17175 | 133 |
\isamarkuptrue% |
17056 | 134 |
% |
135 |
\endisatagproof |
|
136 |
{\isafoldproof}% |
|
137 |
% |
|
138 |
\isadelimproof |
|
139 |
% |
|
140 |
\endisadelimproof |
|
17175 | 141 |
% |
142 |
\isadelimproof |
|
143 |
% |
|
144 |
\endisadelimproof |
|
145 |
% |
|
146 |
\isatagproof |
|
147 |
\isacommand{by}\isamarkupfalse% |
|
148 |
{\isacharparenleft}simp\ split{\isacharcolon}\ split{\isacharunderscore}split{\isacharparenright}% |
|
149 |
\endisatagproof |
|
150 |
{\isafoldproof}% |
|
151 |
% |
|
152 |
\isadelimproof |
|
153 |
% |
|
154 |
\endisadelimproof |
|
155 |
% |
|
156 |
\begin{isamarkuptext}% |
|
157 |
Let us look at a second example:% |
|
158 |
\end{isamarkuptext}% |
|
159 |
\isamarkuptrue% |
|
160 |
\isacommand{lemma}\isamarkupfalse% |
|
161 |
\ {\isachardoublequoteopen}let\ {\isacharparenleft}x{\isacharcomma}y{\isacharparenright}\ {\isacharequal}\ p\ in\ fst\ p\ {\isacharequal}\ x{\isachardoublequoteclose}\isanewline |
|
17056 | 162 |
% |
163 |
\isadelimproof |
|
164 |
% |
|
165 |
\endisadelimproof |
|
166 |
% |
|
167 |
\isatagproof |
|
17175 | 168 |
\isacommand{apply}\isamarkupfalse% |
169 |
{\isacharparenleft}simp\ only{\isacharcolon}\ Let{\isacharunderscore}def{\isacharparenright}% |
|
170 |
\begin{isamarkuptxt}% |
|
171 |
\begin{isabelle}% |
|
172 |
\ {\isadigit{1}}{\isachardot}\ {\isacharparenleft}{\isasymlambda}{\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}{\isachardot}\ fst\ p\ {\isacharequal}\ x{\isacharparenright}\ p% |
|
173 |
\end{isabelle} |
|
174 |
A paired \isa{let} reduces to a paired $\lambda$-abstraction, which |
|
175 |
can be split as above. The same is true for paired set comprehension:% |
|
176 |
\end{isamarkuptxt}% |
|
177 |
\isamarkuptrue% |
|
178 |
% |
|
179 |
\endisatagproof |
|
180 |
{\isafoldproof}% |
|
181 |
% |
|
182 |
\isadelimproof |
|
16353 | 183 |
% |
17175 | 184 |
\endisadelimproof |
185 |
\isacommand{lemma}\isamarkupfalse% |
|
186 |
\ {\isachardoublequoteopen}p\ {\isasymin}\ {\isacharbraceleft}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isachardot}\ x{\isacharequal}y{\isacharbraceright}\ {\isasymlongrightarrow}\ fst\ p\ {\isacharequal}\ snd\ p{\isachardoublequoteclose}\isanewline |
|
187 |
% |
|
188 |
\isadelimproof |
|
189 |
% |
|
190 |
\endisadelimproof |
|
191 |
% |
|
192 |
\isatagproof |
|
193 |
\isacommand{apply}\isamarkupfalse% |
|
194 |
\ simp% |
|
16353 | 195 |
\begin{isamarkuptxt}% |
196 |
\begin{isabelle}% |
|
197 |
\ {\isadigit{1}}{\isachardot}\ split\ op\ {\isacharequal}\ p\ {\isasymlongrightarrow}\ fst\ p\ {\isacharequal}\ snd\ p% |
|
198 |
\end{isabelle} |
|
199 |
Again, simplification produces a term suitable for \isa{split{\isacharunderscore}split} |
|
200 |
as above. If you are worried about the strange form of the premise: |
|
201 |
\isa{{\isasymlambda}{\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}{\isachardot}\ x\ {\isacharequal}\ y} is short for \isa{{\isasymlambda}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isachardot}\ x{\isacharequal}y}. |
|
202 |
The same proof procedure works for% |
|
203 |
\end{isamarkuptxt}% |
|
17175 | 204 |
\isamarkuptrue% |
17056 | 205 |
% |
206 |
\endisatagproof |
|
207 |
{\isafoldproof}% |
|
208 |
% |
|
209 |
\isadelimproof |
|
210 |
% |
|
211 |
\endisadelimproof |
|
17175 | 212 |
\isacommand{lemma}\isamarkupfalse% |
213 |
\ {\isachardoublequoteopen}p\ {\isasymin}\ {\isacharbraceleft}{\isacharparenleft}x{\isacharcomma}y{\isacharparenright}{\isachardot}\ x{\isacharequal}y{\isacharbraceright}\ {\isasymLongrightarrow}\ fst\ p\ {\isacharequal}\ snd\ p{\isachardoublequoteclose}% |
|
17056 | 214 |
\isadelimproof |
215 |
% |
|
216 |
\endisadelimproof |
|
217 |
% |
|
218 |
\isatagproof |
|
16353 | 219 |
% |
220 |
\begin{isamarkuptxt}% |
|
221 |
\noindent |
|
222 |
except that we now have to use \isa{split{\isacharunderscore}split{\isacharunderscore}asm}, because |
|
223 |
\isa{split} occurs in the assumptions. |
|
224 |
||
225 |
However, splitting \isa{split} is not always a solution, as no \isa{split} |
|
226 |
may be present in the goal. Consider the following function:% |
|
227 |
\end{isamarkuptxt}% |
|
17175 | 228 |
\isamarkuptrue% |
17056 | 229 |
% |
230 |
\endisatagproof |
|
231 |
{\isafoldproof}% |
|
232 |
% |
|
233 |
\isadelimproof |
|
234 |
% |
|
235 |
\endisadelimproof |
|
17175 | 236 |
\isacommand{consts}\isamarkupfalse% |
237 |
\ swap\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}{\isacharprime}a\ {\isasymtimes}\ {\isacharprime}b\ {\isasymRightarrow}\ {\isacharprime}b\ {\isasymtimes}\ {\isacharprime}a{\isachardoublequoteclose}\isanewline |
|
238 |
\isacommand{primrec}\isamarkupfalse% |
|
239 |
\isanewline |
|
240 |
\ \ {\isachardoublequoteopen}swap\ {\isacharparenleft}x{\isacharcomma}y{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}y{\isacharcomma}x{\isacharparenright}{\isachardoublequoteclose}% |
|
10560 | 241 |
\begin{isamarkuptext}% |
242 |
\noindent |
|
243 |
Note that the above \isacommand{primrec} definition is admissible |
|
244 |
because \isa{{\isasymtimes}} is a datatype. When we now try to prove% |
|
245 |
\end{isamarkuptext}% |
|
17175 | 246 |
\isamarkuptrue% |
247 |
\isacommand{lemma}\isamarkupfalse% |
|
248 |
\ {\isachardoublequoteopen}swap{\isacharparenleft}swap\ p{\isacharparenright}\ {\isacharequal}\ p{\isachardoublequoteclose}% |
|
17056 | 249 |
\isadelimproof |
250 |
% |
|
251 |
\endisadelimproof |
|
252 |
% |
|
253 |
\isatagproof |
|
16353 | 254 |
% |
255 |
\begin{isamarkuptxt}% |
|
256 |
\noindent |
|
257 |
simplification will do nothing, because the defining equation for \isa{Pairs{\isachardot}swap} |
|
258 |
expects a pair. Again, we need to turn \isa{p} into a pair first, but this |
|
259 |
time there is no \isa{split} in sight. In this case the only thing we can do |
|
260 |
is to split the term by hand:% |
|
261 |
\end{isamarkuptxt}% |
|
17175 | 262 |
\isamarkuptrue% |
263 |
\isacommand{apply}\isamarkupfalse% |
|
264 |
{\isacharparenleft}case{\isacharunderscore}tac\ p{\isacharparenright}% |
|
16353 | 265 |
\begin{isamarkuptxt}% |
266 |
\noindent |
|
267 |
\begin{isabelle}% |
|
268 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}a\ b{\isachardot}\ p\ {\isacharequal}\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}\ {\isasymLongrightarrow}\ Pairs{\isachardot}swap\ {\isacharparenleft}Pairs{\isachardot}swap\ p{\isacharparenright}\ {\isacharequal}\ p% |
|
269 |
\end{isabelle} |
|
270 |
Again, \methdx{case_tac} is applicable because \isa{{\isasymtimes}} is a datatype. |
|
271 |
The subgoal is easily proved by \isa{simp}. |
|
272 |
||
273 |
Splitting by \isa{case{\isacharunderscore}tac} also solves the previous examples and may thus |
|
274 |
appear preferable to the more arcane methods introduced first. However, see |
|
275 |
the warning about \isa{case{\isacharunderscore}tac} in \S\ref{sec:struct-ind-case}. |
|
276 |
||
277 |
In case the term to be split is a quantified variable, there are more options. |
|
278 |
You can split \emph{all} \isa{{\isasymAnd}}-quantified variables in a goal |
|
279 |
with the rewrite rule \isa{split{\isacharunderscore}paired{\isacharunderscore}all}:% |
|
280 |
\end{isamarkuptxt}% |
|
17175 | 281 |
\isamarkuptrue% |
17056 | 282 |
% |
283 |
\endisatagproof |
|
284 |
{\isafoldproof}% |
|
285 |
% |
|
286 |
\isadelimproof |
|
287 |
% |
|
288 |
\endisadelimproof |
|
17175 | 289 |
\isacommand{lemma}\isamarkupfalse% |
290 |
\ {\isachardoublequoteopen}{\isasymAnd}p\ q{\isachardot}\ swap{\isacharparenleft}swap\ p{\isacharparenright}\ {\isacharequal}\ q\ {\isasymlongrightarrow}\ p\ {\isacharequal}\ q{\isachardoublequoteclose}\isanewline |
|
17056 | 291 |
% |
292 |
\isadelimproof |
|
293 |
% |
|
294 |
\endisadelimproof |
|
295 |
% |
|
296 |
\isatagproof |
|
17175 | 297 |
\isacommand{apply}\isamarkupfalse% |
298 |
{\isacharparenleft}simp\ only{\isacharcolon}\ split{\isacharunderscore}paired{\isacharunderscore}all{\isacharparenright}% |
|
16353 | 299 |
\begin{isamarkuptxt}% |
300 |
\noindent |
|
301 |
\begin{isabelle}% |
|
302 |
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}a\ b\ aa\ ba{\isachardot}\isanewline |
|
303 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }Pairs{\isachardot}swap\ {\isacharparenleft}Pairs{\isachardot}swap\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}aa{\isacharcomma}\ ba{\isacharparenright}\ {\isasymlongrightarrow}\isanewline |
|
304 |
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }{\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}aa{\isacharcomma}\ ba{\isacharparenright}% |
|
305 |
\end{isabelle}% |
|
306 |
\end{isamarkuptxt}% |
|
17175 | 307 |
\isamarkuptrue% |
308 |
\isacommand{apply}\isamarkupfalse% |
|
309 |
\ simp\isanewline |
|
310 |
\isacommand{done}\isamarkupfalse% |
|
311 |
% |
|
17056 | 312 |
\endisatagproof |
313 |
{\isafoldproof}% |
|
314 |
% |
|
315 |
\isadelimproof |
|
316 |
% |
|
317 |
\endisadelimproof |
|
11866 | 318 |
% |
10560 | 319 |
\begin{isamarkuptext}% |
320 |
\noindent |
|
321 |
Note that we have intentionally included only \isa{split{\isacharunderscore}paired{\isacharunderscore}all} |
|
11494 | 322 |
in the first simplification step, and then we simplify again. |
323 |
This time the reason was not merely |
|
10560 | 324 |
pedagogical: |
11494 | 325 |
\isa{split{\isacharunderscore}paired{\isacharunderscore}all} may interfere with other functions |
326 |
of the simplifier. |
|
327 |
The following command could fail (here it does not) |
|
328 |
where two separate \isa{simp} applications succeed.% |
|
10560 | 329 |
\end{isamarkuptext}% |
17175 | 330 |
\isamarkuptrue% |
17056 | 331 |
% |
332 |
\isadelimproof |
|
333 |
% |
|
334 |
\endisadelimproof |
|
335 |
% |
|
336 |
\isatagproof |
|
17175 | 337 |
\isacommand{apply}\isamarkupfalse% |
17181 | 338 |
{\isacharparenleft}simp\ add{\isacharcolon}\ split{\isacharunderscore}paired{\isacharunderscore}all{\isacharparenright}% |
17056 | 339 |
\endisatagproof |
340 |
{\isafoldproof}% |
|
341 |
% |
|
342 |
\isadelimproof |
|
343 |
% |
|
344 |
\endisadelimproof |
|
11866 | 345 |
% |
10560 | 346 |
\begin{isamarkuptext}% |
347 |
\noindent |
|
11494 | 348 |
Finally, the simplifier automatically splits all \isa{{\isasymforall}} and |
349 |
\isa{{\isasymexists}}-quantified variables:% |
|
10560 | 350 |
\end{isamarkuptext}% |
17175 | 351 |
\isamarkuptrue% |
352 |
\isacommand{lemma}\isamarkupfalse% |
|
353 |
\ {\isachardoublequoteopen}{\isasymforall}p{\isachardot}\ {\isasymexists}q{\isachardot}\ swap\ p\ {\isacharequal}\ swap\ q{\isachardoublequoteclose}\isanewline |
|
17056 | 354 |
% |
355 |
\isadelimproof |
|
356 |
% |
|
357 |
\endisadelimproof |
|
358 |
% |
|
359 |
\isatagproof |
|
17175 | 360 |
\isacommand{by}\isamarkupfalse% |
361 |
\ simp% |
|
17056 | 362 |
\endisatagproof |
363 |
{\isafoldproof}% |
|
364 |
% |
|
365 |
\isadelimproof |
|
366 |
% |
|
367 |
\endisadelimproof |
|
11866 | 368 |
% |
10560 | 369 |
\begin{isamarkuptext}% |
370 |
\noindent |
|
11494 | 371 |
To turn off this automatic splitting, just disable the |
10560 | 372 |
responsible simplification rules: |
373 |
\begin{center} |
|
10654 | 374 |
\isa{{\isacharparenleft}{\isasymforall}x{\isachardot}\ P\ x{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}{\isasymforall}a\ b{\isachardot}\ P\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}{\isacharparenright}} |
10560 | 375 |
\hfill |
376 |
(\isa{split{\isacharunderscore}paired{\isacharunderscore}All})\\ |
|
10654 | 377 |
\isa{{\isacharparenleft}{\isasymexists}x{\isachardot}\ P\ x{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}{\isasymexists}a\ b{\isachardot}\ P\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}{\isacharparenright}} |
10560 | 378 |
\hfill |
379 |
(\isa{split{\isacharunderscore}paired{\isacharunderscore}Ex}) |
|
380 |
\end{center}% |
|
381 |
\end{isamarkuptext}% |
|
17175 | 382 |
\isamarkuptrue% |
17056 | 383 |
% |
384 |
\isadelimtheory |
|
385 |
% |
|
386 |
\endisadelimtheory |
|
387 |
% |
|
388 |
\isatagtheory |
|
389 |
% |
|
390 |
\endisatagtheory |
|
391 |
{\isafoldtheory}% |
|
392 |
% |
|
393 |
\isadelimtheory |
|
394 |
% |
|
395 |
\endisadelimtheory |
|
10560 | 396 |
\end{isabellebody}% |
397 |
%%% Local Variables: |
|
398 |
%%% mode: latex |
|
399 |
%%% TeX-master: "root" |
|
400 |
%%% End: |