src/HOL/Library/Old_Recdef.thy
author wenzelm
Sun Nov 02 17:20:45 2014 +0100 (2014-11-02)
changeset 58881 b9556a055632
parent 58825 2065f49da190
child 60500 903bb1495239
permissions -rw-r--r--
modernized header;
     1 (*  Title:      HOL/Library/Old_Recdef.thy
     2     Author:     Konrad Slind and Markus Wenzel, TU Muenchen
     3 *)
     4 
     5 section {* TFL: recursive function definitions *}
     6 
     7 theory Old_Recdef
     8 imports Main
     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_def: "cut f r x \<equiv> (\<lambda>y. if (y,x) \<in> r then f y else undefined)"
    24   unfolding cut_def .
    25 
    26 lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
    27 apply clarify
    28 apply (rule cut_apply, assumption)
    29 done
    30 
    31 lemma tfl_wfrec:
    32      "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
    33 apply clarify
    34 apply (erule wfrec)
    35 done
    36 
    37 lemma tfl_eq_True: "(x = True) --> x"
    38   by blast
    39 
    40 lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
    41   by blast
    42 
    43 lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
    44   by blast
    45 
    46 lemma tfl_P_imp_P_iff_True: "P ==> P = True"
    47   by blast
    48 
    49 lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
    50   by blast
    51 
    52 lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
    53   by simp
    54 
    55 lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
    56   by blast
    57 
    58 lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
    59   by blast
    60 
    61 ML_file "~~/src/HOL/Tools/TFL/casesplit.ML"
    62 ML_file "~~/src/HOL/Tools/TFL/utils.ML"
    63 ML_file "~~/src/HOL/Tools/TFL/usyntax.ML"
    64 ML_file "~~/src/HOL/Tools/TFL/dcterm.ML"
    65 ML_file "~~/src/HOL/Tools/TFL/thms.ML"
    66 ML_file "~~/src/HOL/Tools/TFL/rules.ML"
    67 ML_file "~~/src/HOL/Tools/TFL/thry.ML"
    68 ML_file "~~/src/HOL/Tools/TFL/tfl.ML"
    69 ML_file "~~/src/HOL/Tools/TFL/post.ML"
    70 ML_file "~~/src/HOL/Tools/recdef.ML"
    71 
    72 
    73 subsection {* Rule setup *}
    74 
    75 lemmas [recdef_simp] =
    76   inv_image_def
    77   measure_def
    78   lex_prod_def
    79   same_fst_def
    80   less_Suc_eq [THEN iffD2]
    81 
    82 lemmas [recdef_cong] =
    83   if_cong let_cong image_cong INF_cong SUP_cong bex_cong ball_cong imp_cong
    84   map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong 
    85 
    86 lemmas [recdef_wf] =
    87   wf_trancl
    88   wf_less_than
    89   wf_lex_prod
    90   wf_inv_image
    91   wf_measure
    92   wf_measures
    93   wf_pred_nat
    94   wf_same_fst
    95   wf_empty
    96 
    97 end