src/HOL/Recdef.thy
author nipkow
Fri Mar 06 17:38:47 2009 +0100 (2009-03-06)
changeset 30313 b2441b0c8d38
parent 29654 24e73987bfe2
child 31723 f5cafe803b55
permissions -rw-r--r--
added lemmas
     1 (*  Title:      HOL/Recdef.thy
     2     Author:     Konrad Slind and Markus Wenzel, TU Muenchen
     3 *)
     4 
     5 header {* TFL: recursive function definitions *}
     6 
     7 theory Recdef
     8 imports FunDef Plain
     9 uses
    10   ("Tools/TFL/casesplit.ML")
    11   ("Tools/TFL/utils.ML")
    12   ("Tools/TFL/usyntax.ML")
    13   ("Tools/TFL/dcterm.ML")
    14   ("Tools/TFL/thms.ML")
    15   ("Tools/TFL/rules.ML")
    16   ("Tools/TFL/thry.ML")
    17   ("Tools/TFL/tfl.ML")
    18   ("Tools/TFL/post.ML")
    19   ("Tools/recdef_package.ML")
    20 begin
    21 
    22 text{** This form avoids giant explosions in proofs.  NOTE USE OF ==*}
    23 lemma def_wfrec: "[| f==wfrec r H;  wf(r) |] ==> f(a) = H (cut f r a) a"
    24 apply auto
    25 apply (blast intro: wfrec)
    26 done
    27 
    28 
    29 lemma tfl_wf_induct: "ALL R. wf R -->  
    30        (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
    31 apply clarify
    32 apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
    33 done
    34 
    35 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
    36 apply clarify
    37 apply (rule cut_apply, assumption)
    38 done
    39 
    40 lemma tfl_wfrec:
    41      "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
    42 apply clarify
    43 apply (erule wfrec)
    44 done
    45 
    46 lemma tfl_eq_True: "(x = True) --> x"
    47   by blast
    48 
    49 lemma tfl_rev_eq_mp: "(x = y) --> y --> x";
    50   by blast
    51 
    52 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
    53   by blast
    54 
    55 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
    56   by blast
    57 
    58 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
    59   by blast
    60 
    61 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
    62   by simp
    63 
    64 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
    65   by blast
    66 
    67 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
    68   by blast
    69 
    70 use "Tools/TFL/casesplit.ML"
    71 use "Tools/TFL/utils.ML"
    72 use "Tools/TFL/usyntax.ML"
    73 use "Tools/TFL/dcterm.ML"
    74 use "Tools/TFL/thms.ML"
    75 use "Tools/TFL/rules.ML"
    76 use "Tools/TFL/thry.ML"
    77 use "Tools/TFL/tfl.ML"
    78 use "Tools/TFL/post.ML"
    79 use "Tools/recdef_package.ML"
    80 setup RecdefPackage.setup
    81 
    82 lemmas [recdef_simp] =
    83   inv_image_def
    84   measure_def
    85   lex_prod_def
    86   same_fst_def
    87   less_Suc_eq [THEN iffD2]
    88 
    89 lemmas [recdef_cong] =
    90   if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
    91 
    92 lemmas [recdef_wf] =
    93   wf_trancl
    94   wf_less_than
    95   wf_lex_prod
    96   wf_inv_image
    97   wf_measure
    98   wf_pred_nat
    99   wf_same_fst
   100   wf_empty
   101 
   102 end