src/HOL/Library/Old_Recdef.thy
 author huffman Fri Mar 30 12:32:35 2012 +0200 (2012-03-30) changeset 47220 52426c62b5d0 parent 46950 d0181abdbdac child 48891 c0eafbd55de3 permissions -rw-r--r--
replace lemmas eval_nat_numeral with a simpler reformulation
1 (*  Title:      HOL/Library/Old_Recdef.thy
2     Author:     Konrad Slind and Markus Wenzel, TU Muenchen
3 *)
5 header {* TFL: recursive function definitions *}
7 theory Old_Recdef
8 imports Wfrec
9 keywords
10   "recdef" "defer_recdef" :: thy_decl and
11   "recdef_tc" :: thy_goal and
12   "permissive" "congs" "hints"
13 uses
14   ("~~/src/HOL/Tools/TFL/casesplit.ML")
15   ("~~/src/HOL/Tools/TFL/utils.ML")
16   ("~~/src/HOL/Tools/TFL/usyntax.ML")
17   ("~~/src/HOL/Tools/TFL/dcterm.ML")
18   ("~~/src/HOL/Tools/TFL/thms.ML")
19   ("~~/src/HOL/Tools/TFL/rules.ML")
20   ("~~/src/HOL/Tools/TFL/thry.ML")
21   ("~~/src/HOL/Tools/TFL/tfl.ML")
22   ("~~/src/HOL/Tools/TFL/post.ML")
23   ("~~/src/HOL/Tools/recdef.ML")
24 begin
26 subsection {* Lemmas for TFL *}
28 lemma tfl_wf_induct: "ALL R. wf R -->
29        (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
30 apply clarify
31 apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
32 done
34 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
35 apply clarify
36 apply (rule cut_apply, assumption)
37 done
39 lemma tfl_wfrec:
40      "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
41 apply clarify
42 apply (erule wfrec)
43 done
45 lemma tfl_eq_True: "(x = True) --> x"
46   by blast
48 lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
49   by blast
51 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
52   by blast
54 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
55   by blast
57 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
58   by blast
60 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
61   by simp
63 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
64   by blast
66 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
67   by blast
69 use "~~/src/HOL/Tools/TFL/casesplit.ML"
70 use "~~/src/HOL/Tools/TFL/utils.ML"
71 use "~~/src/HOL/Tools/TFL/usyntax.ML"
72 use "~~/src/HOL/Tools/TFL/dcterm.ML"
73 use "~~/src/HOL/Tools/TFL/thms.ML"
74 use "~~/src/HOL/Tools/TFL/rules.ML"
75 use "~~/src/HOL/Tools/TFL/thry.ML"
76 use "~~/src/HOL/Tools/TFL/tfl.ML"
77 use "~~/src/HOL/Tools/TFL/post.ML"
78 use "~~/src/HOL/Tools/recdef.ML"
79 setup Recdef.setup
81 subsection {* Rule setup *}
83 lemmas [recdef_simp] =
84   inv_image_def
85   measure_def
86   lex_prod_def
87   same_fst_def
88   less_Suc_eq [THEN iffD2]
90 lemmas [recdef_cong] =
91   if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
92   map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong
94 lemmas [recdef_wf] =
95   wf_trancl
96   wf_less_than
97   wf_lex_prod
98   wf_inv_image
99   wf_measure
100   wf_measures
101   wf_pred_nat
102   wf_same_fst
103   wf_empty
105 end