src/HOL/Library/Old_Recdef.thy
author wenzelm
Wed Aug 22 22:55:41 2012 +0200 (2012-08-22)
changeset 48891 c0eafbd55de3
parent 46950 d0181abdbdac
child 55017 2df6ad1dbd66
permissions -rw-r--r--
prefer ML_file over old uses;
     1 (*  Title:      HOL/Library/Old_Recdef.thy
     2     Author:     Konrad Slind and Markus Wenzel, TU Muenchen
     3 *)
     4 
     5 header {* TFL: recursive function definitions *}
     6 
     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
    14 
    15 subsection {* Lemmas for TFL *}
    16 
    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
    22 
    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
    27 
    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
    33 
    34 lemma tfl_eq_True: "(x = True) --> x"
    35   by blast
    36 
    37 lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
    38   by blast
    39 
    40 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
    41   by blast
    42 
    43 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
    44   by blast
    45 
    46 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
    47   by blast
    48 
    49 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
    50   by simp
    51 
    52 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
    53   by blast
    54 
    55 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
    56   by blast
    57 
    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
    69 
    70 subsection {* Rule setup *}
    71 
    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]
    78 
    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 
    82 
    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
    93 
    94 end