src/HOL/Library/Old_Recdef.thy
author krauss
Tue Aug 02 11:52:57 2011 +0200 (2011-08-02)
changeset 44014 88bd7d74a2c1
parent 44013 5cfc1c36ae97
child 46942 f5c2d66faa04
permissions -rw-r--r--
moved recursion combinator to HOL/Library/Wfrec.thy -- it is so fundamental and well-known that it should survive recdef
     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 uses
    10   ("~~/src/HOL/Tools/TFL/casesplit.ML")
    11   ("~~/src/HOL/Tools/TFL/utils.ML")
    12   ("~~/src/HOL/Tools/TFL/usyntax.ML")
    13   ("~~/src/HOL/Tools/TFL/dcterm.ML")
    14   ("~~/src/HOL/Tools/TFL/thms.ML")
    15   ("~~/src/HOL/Tools/TFL/rules.ML")
    16   ("~~/src/HOL/Tools/TFL/thry.ML")
    17   ("~~/src/HOL/Tools/TFL/tfl.ML")
    18   ("~~/src/HOL/Tools/TFL/post.ML")
    19   ("~~/src/HOL/Tools/recdef.ML")
    20 begin
    21 
    22 subsection {* Lemmas for TFL *}
    23 
    24 lemma tfl_wf_induct: "ALL R. wf R -->  
    25        (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
    26 apply clarify
    27 apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
    28 done
    29 
    30 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
    31 apply clarify
    32 apply (rule cut_apply, assumption)
    33 done
    34 
    35 lemma tfl_wfrec:
    36      "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
    37 apply clarify
    38 apply (erule wfrec)
    39 done
    40 
    41 lemma tfl_eq_True: "(x = True) --> x"
    42   by blast
    43 
    44 lemma tfl_rev_eq_mp: "(x = y) --> y --> x";
    45   by blast
    46 
    47 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
    48   by blast
    49 
    50 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
    51   by blast
    52 
    53 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
    54   by blast
    55 
    56 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
    57   by simp
    58 
    59 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
    60   by blast
    61 
    62 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
    63   by blast
    64 
    65 use "~~/src/HOL/Tools/TFL/casesplit.ML"
    66 use "~~/src/HOL/Tools/TFL/utils.ML"
    67 use "~~/src/HOL/Tools/TFL/usyntax.ML"
    68 use "~~/src/HOL/Tools/TFL/dcterm.ML"
    69 use "~~/src/HOL/Tools/TFL/thms.ML"
    70 use "~~/src/HOL/Tools/TFL/rules.ML"
    71 use "~~/src/HOL/Tools/TFL/thry.ML"
    72 use "~~/src/HOL/Tools/TFL/tfl.ML"
    73 use "~~/src/HOL/Tools/TFL/post.ML"
    74 use "~~/src/HOL/Tools/recdef.ML"
    75 setup Recdef.setup
    76 
    77 subsection {* Rule setup *}
    78 
    79 lemmas [recdef_simp] =
    80   inv_image_def
    81   measure_def
    82   lex_prod_def
    83   same_fst_def
    84   less_Suc_eq [THEN iffD2]
    85 
    86 lemmas [recdef_cong] =
    87   if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
    88   map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong 
    89 
    90 lemmas [recdef_wf] =
    91   wf_trancl
    92   wf_less_than
    93   wf_lex_prod
    94   wf_inv_image
    95   wf_measure
    96   wf_measures
    97   wf_pred_nat
    98   wf_same_fst
    99   wf_empty
   100 
   101 end