src/HOL/Library/Old_Recdef.thy
author Christian Sternagel
Wed Aug 29 12:23:14 2012 +0900 (2012-08-29)
changeset 49083 01081bca31b6
parent 48891 c0eafbd55de3
child 55017 2df6ad1dbd66
permissions -rw-r--r--
dropped ord and bot instance for list prefixes (use locale interpretation instead, which allows users to decide what order to use on lists)
krauss@44013
     1
(*  Title:      HOL/Library/Old_Recdef.thy
wenzelm@10773
     2
    Author:     Konrad Slind and Markus Wenzel, TU Muenchen
wenzelm@12023
     3
*)
wenzelm@5123
     4
wenzelm@12023
     5
header {* TFL: recursive function definitions *}
wenzelm@7701
     6
krauss@44013
     7
theory Old_Recdef
krauss@44014
     8
imports Wfrec
wenzelm@46950
     9
keywords
wenzelm@46950
    10
  "recdef" "defer_recdef" :: thy_decl and
wenzelm@46950
    11
  "recdef_tc" :: thy_goal and
wenzelm@46950
    12
  "permissive" "congs" "hints"
nipkow@15131
    13
begin
wenzelm@10773
    14
krauss@44013
    15
subsection {* Lemmas for TFL *}
krauss@44013
    16
krauss@26748
    17
lemma tfl_wf_induct: "ALL R. wf R -->  
krauss@26748
    18
       (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
krauss@26748
    19
apply clarify
krauss@26748
    20
apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
krauss@26748
    21
done
krauss@26748
    22
krauss@26748
    23
lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
krauss@26748
    24
apply clarify
krauss@26748
    25
apply (rule cut_apply, assumption)
krauss@26748
    26
done
krauss@26748
    27
krauss@26748
    28
lemma tfl_wfrec:
krauss@26748
    29
     "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
krauss@26748
    30
apply clarify
krauss@26748
    31
apply (erule wfrec)
krauss@26748
    32
done
krauss@26748
    33
wenzelm@10773
    34
lemma tfl_eq_True: "(x = True) --> x"
wenzelm@10773
    35
  by blast
wenzelm@10773
    36
wenzelm@46947
    37
lemma tfl_rev_eq_mp: "(x = y) --> y --> x"
wenzelm@10773
    38
  by blast
wenzelm@10773
    39
wenzelm@10773
    40
lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
wenzelm@10773
    41
  by blast
wenzelm@6438
    42
wenzelm@10773
    43
lemma tfl_P_imp_P_iff_True: "P ==> P = True"
wenzelm@10773
    44
  by blast
wenzelm@10773
    45
wenzelm@10773
    46
lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
wenzelm@10773
    47
  by blast
wenzelm@10773
    48
wenzelm@12023
    49
lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
wenzelm@10773
    50
  by simp
wenzelm@10773
    51
wenzelm@12023
    52
lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
wenzelm@10773
    53
  by blast
wenzelm@10773
    54
wenzelm@12023
    55
lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
wenzelm@10773
    56
  by blast
wenzelm@10773
    57
wenzelm@48891
    58
ML_file "~~/src/HOL/Tools/TFL/casesplit.ML"
wenzelm@48891
    59
ML_file "~~/src/HOL/Tools/TFL/utils.ML"
wenzelm@48891
    60
ML_file "~~/src/HOL/Tools/TFL/usyntax.ML"
wenzelm@48891
    61
ML_file "~~/src/HOL/Tools/TFL/dcterm.ML"
wenzelm@48891
    62
ML_file "~~/src/HOL/Tools/TFL/thms.ML"
wenzelm@48891
    63
ML_file "~~/src/HOL/Tools/TFL/rules.ML"
wenzelm@48891
    64
ML_file "~~/src/HOL/Tools/TFL/thry.ML"
wenzelm@48891
    65
ML_file "~~/src/HOL/Tools/TFL/tfl.ML"
wenzelm@48891
    66
ML_file "~~/src/HOL/Tools/TFL/post.ML"
wenzelm@48891
    67
ML_file "~~/src/HOL/Tools/recdef.ML"
haftmann@31723
    68
setup Recdef.setup
wenzelm@6438
    69
krauss@44014
    70
subsection {* Rule setup *}
krauss@32244
    71
wenzelm@9855
    72
lemmas [recdef_simp] =
wenzelm@9855
    73
  inv_image_def
wenzelm@9855
    74
  measure_def
wenzelm@9855
    75
  lex_prod_def
nipkow@11284
    76
  same_fst_def
wenzelm@9855
    77
  less_Suc_eq [THEN iffD2]
wenzelm@9855
    78
wenzelm@23150
    79
lemmas [recdef_cong] =
krauss@22622
    80
  if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
krauss@44013
    81
  map_cong filter_cong takeWhile_cong dropWhile_cong foldl_cong foldr_cong 
wenzelm@9855
    82
wenzelm@9855
    83
lemmas [recdef_wf] =
wenzelm@9855
    84
  wf_trancl
wenzelm@9855
    85
  wf_less_than
wenzelm@9855
    86
  wf_lex_prod
wenzelm@9855
    87
  wf_inv_image
wenzelm@9855
    88
  wf_measure
krauss@44013
    89
  wf_measures
wenzelm@9855
    90
  wf_pred_nat
nipkow@10653
    91
  wf_same_fst
wenzelm@9855
    92
  wf_empty
wenzelm@9855
    93
wenzelm@6438
    94
end