10365
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{Advanced}%
|
|
4 |
\isanewline
|
10457
|
5 |
\isacommand{theory}\ Advanced\ {\isacharequal}\ Even{\isacharcolon}%
|
|
6 |
\begin{isamarkuptext}%
|
|
7 |
We completely forgot about "rule inversion", or whatever we may want
|
|
8 |
to call it. Just as a demo I include the two forms that Markus has made available. First the one for binding the result to a name%
|
|
9 |
\end{isamarkuptext}%
|
|
10 |
\isacommand{inductive{\isacharunderscore}cases}\ even{\isacharunderscore}cases\ {\isacharbrackleft}elim{\isacharbang}{\isacharbrackright}{\isacharcolon}\isanewline
|
|
11 |
\ \ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}\isanewline
|
10365
|
12 |
\isanewline
|
10457
|
13 |
\isacommand{thm}\ even{\isacharunderscore}cases%
|
|
14 |
\begin{isamarkuptext}%
|
|
15 |
and now the one for local usage:%
|
|
16 |
\end{isamarkuptext}%
|
|
17 |
\isacommand{lemma}\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even\ {\isasymLongrightarrow}\ n\ {\isasymin}\ even{\isachardoublequote}\isanewline
|
|
18 |
\isacommand{by}{\isacharparenleft}ind{\isacharunderscore}cases\ {\isachardoublequote}Suc{\isacharparenleft}Suc\ n{\isacharparenright}\ {\isasymin}\ even{\isachardoublequote}{\isacharparenright}%
|
|
19 |
\begin{isamarkuptext}%
|
|
20 |
Both forms accept lists of strings.
|
|
21 |
|
|
22 |
Hope you can find some more exciting examples, although these may do%
|
|
23 |
\end{isamarkuptext}%
|
10365
|
24 |
\isacommand{datatype}\ {\isacharprime}f\ {\isachardoublequote}term{\isachardoublequote}\ {\isacharequal}\ Apply\ {\isacharprime}f\ {\isachardoublequote}{\isacharprime}f\ term\ list{\isachardoublequote}\isanewline
|
|
25 |
\isanewline
|
|
26 |
\isacommand{consts}\ terms\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharprime}f\ set\ {\isasymRightarrow}\ {\isacharprime}f\ term\ set{\isachardoublequote}\isanewline
|
|
27 |
\isacommand{inductive}\ {\isachardoublequote}terms\ F{\isachardoublequote}\isanewline
|
|
28 |
\isakeyword{intros}\isanewline
|
|
29 |
step{\isacharbrackleft}intro{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}t\ {\isasymin}\ set\ term{\isacharunderscore}list{\isachardot}\ t\ {\isasymin}\ terms\ F{\isacharsemicolon}\ \ f\ {\isasymin}\ F{\isasymrbrakk}\isanewline
|
|
30 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ term{\isacharunderscore}list{\isacharparenright}\ {\isasymin}\ terms\ F{\isachardoublequote}\isanewline
|
|
31 |
\isanewline
|
|
32 |
\isanewline
|
|
33 |
\isacommand{lemma}\ {\isachardoublequote}F{\isasymsubseteq}G\ {\isasymLongrightarrow}\ terms\ F\ {\isasymsubseteq}\ terms\ G{\isachardoublequote}\isanewline
|
|
34 |
\isacommand{apply}\ clarify\isanewline
|
|
35 |
\isacommand{apply}\ {\isacharparenleft}erule\ terms{\isachardot}induct{\isacharparenright}\isanewline
|
|
36 |
\isacommand{apply}\ blast\isanewline
|
|
37 |
\isacommand{done}\isanewline
|
|
38 |
\isanewline
|
|
39 |
\isacommand{consts}\ term{\isacharunderscore}type\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ {\isacharprime}t\ list\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}f\ term\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}set{\isachardoublequote}\isanewline
|
|
40 |
\isacommand{inductive}\ {\isachardoublequote}term{\isacharunderscore}type\ sig{\isachardoublequote}\isanewline
|
|
41 |
\isakeyword{intros}\isanewline
|
|
42 |
step{\isacharbrackleft}intro{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}{\isasymforall}et\ {\isasymin}\ set\ term{\isacharunderscore}type{\isacharunderscore}list{\isachardot}\ et\ {\isasymin}\ term{\isacharunderscore}type\ sig{\isacharsemicolon}\ \isanewline
|
|
43 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ term{\isacharunderscore}type{\isacharunderscore}list{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline
|
|
44 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ term{\isacharunderscore}type{\isacharunderscore}list{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ {\isasymin}\ term{\isacharunderscore}type\ sig{\isachardoublequote}\isanewline
|
|
45 |
\isanewline
|
|
46 |
\isacommand{consts}\ term{\isacharunderscore}type{\isacharprime}\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}{\isacharparenleft}{\isacharprime}f\ {\isasymRightarrow}\ {\isacharprime}t\ list\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}\ {\isasymRightarrow}\ {\isacharparenleft}{\isacharprime}f\ term\ {\isacharasterisk}\ {\isacharprime}t{\isacharparenright}set{\isachardoublequote}\isanewline
|
|
47 |
\isacommand{inductive}\ {\isachardoublequote}term{\isacharunderscore}type{\isacharprime}\ sig{\isachardoublequote}\isanewline
|
|
48 |
\isakeyword{intros}\isanewline
|
|
49 |
step{\isacharbrackleft}intro{\isacharbrackright}{\isacharcolon}\ {\isachardoublequote}{\isasymlbrakk}term{\isacharunderscore}type{\isacharunderscore}list\ {\isasymin}\ lists{\isacharparenleft}term{\isacharunderscore}type{\isacharprime}\ sig{\isacharparenright}{\isacharsemicolon}\ \isanewline
|
|
50 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ sig\ f\ {\isacharequal}\ {\isacharparenleft}map\ snd\ term{\isacharunderscore}type{\isacharunderscore}list{\isacharcomma}\ rtype{\isacharparenright}{\isasymrbrakk}\isanewline
|
|
51 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isasymLongrightarrow}\ {\isacharparenleft}Apply\ f\ {\isacharparenleft}map\ fst\ term{\isacharunderscore}type{\isacharunderscore}list{\isacharparenright}{\isacharcomma}\ rtype{\isacharparenright}\ {\isasymin}\ term{\isacharunderscore}type{\isacharprime}\ sig{\isachardoublequote}\isanewline
|
|
52 |
\isakeyword{monos}\ lists{\isacharunderscore}mono\isanewline
|
|
53 |
\isanewline
|
|
54 |
\isanewline
|
|
55 |
\isacommand{lemma}\ {\isachardoublequote}term{\isacharunderscore}type\ sig\ {\isasymsubseteq}\ term{\isacharunderscore}type{\isacharprime}\ sig{\isachardoublequote}\isanewline
|
|
56 |
\isacommand{apply}\ clarify\isanewline
|
|
57 |
\isacommand{apply}\ {\isacharparenleft}erule\ term{\isacharunderscore}type{\isachardot}induct{\isacharparenright}\isanewline
|
|
58 |
\isacommand{apply}\ auto\isanewline
|
|
59 |
\isacommand{done}\isanewline
|
|
60 |
\isanewline
|
|
61 |
\isacommand{lemma}\ {\isachardoublequote}term{\isacharunderscore}type{\isacharprime}\ sig\ {\isasymsubseteq}\ term{\isacharunderscore}type\ sig{\isachardoublequote}\isanewline
|
|
62 |
\isacommand{apply}\ clarify\isanewline
|
|
63 |
\isacommand{apply}\ {\isacharparenleft}erule\ term{\isacharunderscore}type{\isacharprime}{\isachardot}induct{\isacharparenright}\isanewline
|
|
64 |
\isacommand{apply}\ auto\isanewline
|
|
65 |
\isacommand{done}\isanewline
|
|
66 |
\isanewline
|
|
67 |
\isacommand{end}\isanewline
|
|
68 |
\isanewline
|
|
69 |
\end{isabellebody}%
|
|
70 |
%%% Local Variables:
|
|
71 |
%%% mode: latex
|
|
72 |
%%% TeX-master: "root"
|
|
73 |
%%% End:
|