author | wenzelm |
Sat, 13 May 2006 02:51:48 +0200 | |
changeset 19635 | f7aa7d174343 |
parent 19564 | d3e2f532459a |
child 19770 | be5c23ebe1eb |
permissions | -rw-r--r-- |
7701 | 1 |
(* Title: HOL/Recdef.thy |
2 |
ID: $Id$ |
|
10773 | 3 |
Author: Konrad Slind and Markus Wenzel, TU Muenchen |
12023 | 4 |
*) |
5123 | 5 |
|
12023 | 6 |
header {* TFL: recursive function definitions *} |
7701 | 7 |
|
15131 | 8 |
theory Recdef |
15140 | 9 |
imports Wellfounded_Relations Datatype |
16417 | 10 |
uses |
15150
c7af682b9ee5
fix to eliminate excessive case-splits in the recursion equations, by Luca Dixon
paulson
parents:
15140
diff
changeset
|
11 |
("../TFL/casesplit.ML") |
10773 | 12 |
("../TFL/utils.ML") |
13 |
("../TFL/usyntax.ML") |
|
14 |
("../TFL/dcterm.ML") |
|
15 |
("../TFL/thms.ML") |
|
16 |
("../TFL/rules.ML") |
|
17 |
("../TFL/thry.ML") |
|
18 |
("../TFL/tfl.ML") |
|
19 |
("../TFL/post.ML") |
|
15131 | 20 |
("Tools/recdef_package.ML") |
19564
d3e2f532459a
First usable version of the new function definition package (HOL/function_packake/...).
krauss
parents:
18336
diff
changeset
|
21 |
("Tools/function_package/auto_term.ML") |
15131 | 22 |
begin |
10773 | 23 |
|
24 |
lemma tfl_eq_True: "(x = True) --> x" |
|
25 |
by blast |
|
26 |
||
27 |
lemma tfl_rev_eq_mp: "(x = y) --> y --> x"; |
|
28 |
by blast |
|
29 |
||
30 |
lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)" |
|
31 |
by blast |
|
6438 | 32 |
|
10773 | 33 |
lemma tfl_P_imp_P_iff_True: "P ==> P = True" |
34 |
by blast |
|
35 |
||
36 |
lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)" |
|
37 |
by blast |
|
38 |
||
12023 | 39 |
lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)" |
10773 | 40 |
by simp |
41 |
||
12023 | 42 |
lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R" |
10773 | 43 |
by blast |
44 |
||
12023 | 45 |
lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q" |
10773 | 46 |
by blast |
47 |
||
15150
c7af682b9ee5
fix to eliminate excessive case-splits in the recursion equations, by Luca Dixon
paulson
parents:
15140
diff
changeset
|
48 |
use "../TFL/casesplit.ML" |
10773 | 49 |
use "../TFL/utils.ML" |
50 |
use "../TFL/usyntax.ML" |
|
51 |
use "../TFL/dcterm.ML" |
|
52 |
use "../TFL/thms.ML" |
|
53 |
use "../TFL/rules.ML" |
|
54 |
use "../TFL/thry.ML" |
|
55 |
use "../TFL/tfl.ML" |
|
56 |
use "../TFL/post.ML" |
|
57 |
use "Tools/recdef_package.ML" |
|
6438 | 58 |
setup RecdefPackage.setup |
59 |
||
9855 | 60 |
lemmas [recdef_simp] = |
61 |
inv_image_def |
|
62 |
measure_def |
|
63 |
lex_prod_def |
|
11284 | 64 |
same_fst_def |
9855 | 65 |
less_Suc_eq [THEN iffD2] |
66 |
||
18336
1a2e30b37ed3
Added recdef congruence rules for bounded quantifiers and commonly used
krauss
parents:
17040
diff
changeset
|
67 |
lemmas [recdef_cong] = |
1a2e30b37ed3
Added recdef congruence rules for bounded quantifiers and commonly used
krauss
parents:
17040
diff
changeset
|
68 |
if_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong |
9855 | 69 |
|
70 |
lemma let_cong [recdef_cong]: |
|
71 |
"M = N ==> (!!x. x = N ==> f x = g x) ==> Let M f = Let N g" |
|
72 |
by (unfold Let_def) blast |
|
73 |
||
74 |
lemmas [recdef_wf] = |
|
75 |
wf_trancl |
|
76 |
wf_less_than |
|
77 |
wf_lex_prod |
|
78 |
wf_inv_image |
|
79 |
wf_measure |
|
80 |
wf_pred_nat |
|
10653 | 81 |
wf_same_fst |
9855 | 82 |
wf_empty |
83 |
||
17040 | 84 |
(* The following should really go into Datatype or Finite_Set, but |
85 |
each one lacks the other theory as a parent . . . *) |
|
86 |
||
87 |
lemma insert_None_conv_UNIV: "insert None (range Some) = UNIV" |
|
88 |
by (rule set_ext, case_tac x, auto) |
|
89 |
||
90 |
instance option :: (finite) finite |
|
91 |
proof |
|
92 |
have "finite (UNIV :: 'a set)" by (rule finite) |
|
93 |
hence "finite (insert None (Some ` (UNIV :: 'a set)))" by simp |
|
94 |
also have "insert None (Some ` (UNIV :: 'a set)) = UNIV" |
|
95 |
by (rule insert_None_conv_UNIV) |
|
96 |
finally show "finite (UNIV :: 'a option set)" . |
|
97 |
qed |
|
98 |
||
19564
d3e2f532459a
First usable version of the new function definition package (HOL/function_packake/...).
krauss
parents:
18336
diff
changeset
|
99 |
|
d3e2f532459a
First usable version of the new function definition package (HOL/function_packake/...).
krauss
parents:
18336
diff
changeset
|
100 |
use "Tools/function_package/auto_term.ML" |
d3e2f532459a
First usable version of the new function definition package (HOL/function_packake/...).
krauss
parents:
18336
diff
changeset
|
101 |
setup FundefAutoTerm.setup |
d3e2f532459a
First usable version of the new function definition package (HOL/function_packake/...).
krauss
parents:
18336
diff
changeset
|
102 |
|
6438 | 103 |
end |