1 (* Title: HOL/Library/Old_Recdef.thy
2 Author: Konrad Slind and Markus Wenzel, TU Muenchen
5 section \<open>TFL: recursive function definitions\<close>
10 "recdef" :: thy_decl and
11 "permissive" "congs" "hints"
14 subsection \<open>Lemmas for TFL\<close>
16 lemma tfl_wf_induct: "ALL R. wf R -->
17 (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
19 apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
22 lemma tfl_cut_def: "cut f r x \<equiv> (\<lambda>y. if (y,x) \<in> r then f y else undefined)"
25 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
27 apply (rule cut_apply, assumption)
31 "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
36 lemma tfl_eq_True: "(x = True) --> x"
39 lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
42 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
45 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
48 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
51 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
54 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
57 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
60 ML_file "old_recdef.ML"
63 subsection \<open>Rule setup\<close>
65 lemmas [recdef_simp] =
70 less_Suc_eq [THEN iffD2]
72 lemmas [recdef_cong] =
73 if_cong let_cong image_cong INF_cong SUP_cong bex_cong ball_cong imp_cong
74 map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong