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