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