src/HOL/Library/Old_Recdef.thy
 author Andreas Lochbihler Wed Feb 27 10:33:30 2013 +0100 (2013-02-27) changeset 51288 be7e9a675ec9 parent 48891 c0eafbd55de3 child 55017 2df6ad1dbd66 permissions -rw-r--r--
add wellorder instance for Numeral_Type (suggested by Jesus Aransay)
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 begin
15 subsection {* Lemmas for TFL *}
17 lemma tfl_wf_induct: "ALL R. wf R -->
18        (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
19 apply clarify
20 apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
21 done
23 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
24 apply clarify
25 apply (rule cut_apply, assumption)
26 done
28 lemma tfl_wfrec:
29      "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
30 apply clarify
31 apply (erule wfrec)
32 done
34 lemma tfl_eq_True: "(x = True) --> x"
35   by blast
37 lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
38   by blast
40 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
41   by blast
43 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
44   by blast
46 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
47   by blast
49 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
50   by simp
52 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
53   by blast
55 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
56   by blast
58 ML_file "~~/src/HOL/Tools/TFL/casesplit.ML"
59 ML_file "~~/src/HOL/Tools/TFL/utils.ML"
60 ML_file "~~/src/HOL/Tools/TFL/usyntax.ML"
61 ML_file "~~/src/HOL/Tools/TFL/dcterm.ML"
62 ML_file "~~/src/HOL/Tools/TFL/thms.ML"
63 ML_file "~~/src/HOL/Tools/TFL/rules.ML"
64 ML_file "~~/src/HOL/Tools/TFL/thry.ML"
65 ML_file "~~/src/HOL/Tools/TFL/tfl.ML"
66 ML_file "~~/src/HOL/Tools/TFL/post.ML"
67 ML_file "~~/src/HOL/Tools/recdef.ML"
68 setup Recdef.setup
70 subsection {* Rule setup *}
72 lemmas [recdef_simp] =
73   inv_image_def
74   measure_def
75   lex_prod_def
76   same_fst_def
77   less_Suc_eq [THEN iffD2]
79 lemmas [recdef_cong] =
80   if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
81   map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong
83 lemmas [recdef_wf] =
84   wf_trancl
85   wf_less_than
86   wf_lex_prod
87   wf_inv_image
88   wf_measure
89   wf_measures
90   wf_pred_nat
91   wf_same_fst
92   wf_empty
94 end