src/HOL/Recdef.thy
author haftmann
Mon, 12 Jul 2010 10:48:37 +0200
changeset 37767 a2b7a20d6ea3
parent 35416 d8d7d1b785af
child 38554 f8999e19dd49
permissions -rw-r--r--
dropped superfluous [code del]s
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7701
2c8c3b7003e5 load / setup recdef package (TFL);
wenzelm
parents: 7357
diff changeset
     1
(*  Title:      HOL/Recdef.thy
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
     2
    Author:     Konrad Slind and Markus Wenzel, TU Muenchen
12023
wenzelm
parents: 11533
diff changeset
     3
*)
5123
97c1d5c7b701 stepping stones;
wenzelm
parents:
diff changeset
     4
12023
wenzelm
parents: 11533
diff changeset
     5
header {* TFL: recursive function definitions *}
7701
2c8c3b7003e5 load / setup recdef package (TFL);
wenzelm
parents: 7357
diff changeset
     6
15131
c69542757a4d New theory header syntax.
nipkow
parents: 12437
diff changeset
     7
theory Recdef
29654
24e73987bfe2 Plain, Main form meeting points in import hierarchy
haftmann
parents: 26748
diff changeset
     8
imports FunDef Plain
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15481
diff changeset
     9
uses
23150
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    10
  ("Tools/TFL/casesplit.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    11
  ("Tools/TFL/utils.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    12
  ("Tools/TFL/usyntax.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    13
  ("Tools/TFL/dcterm.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    14
  ("Tools/TFL/thms.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    15
  ("Tools/TFL/rules.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    16
  ("Tools/TFL/thry.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    17
  ("Tools/TFL/tfl.ML")
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
    18
  ("Tools/TFL/post.ML")
31723
f5cafe803b55 discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents: 29654
diff changeset
    19
  ("Tools/recdef.ML")
15131
c69542757a4d New theory header syntax.
nipkow
parents: 12437
diff changeset
    20
begin
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
    21
32462
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    22
inductive
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    23
  wfrec_rel :: "('a * 'a) set => (('a => 'b) => 'a => 'b) => 'a => 'b => bool"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    24
  for R :: "('a * 'a) set"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    25
  and F :: "('a => 'b) => 'a => 'b"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    26
where
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    27
  wfrecI: "ALL z. (z, x) : R --> wfrec_rel R F z (g z) ==>
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    28
            wfrec_rel R F x (F g x)"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    29
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32462
diff changeset
    30
definition
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32462
diff changeset
    31
  cut        :: "('a => 'b) => ('a * 'a)set => 'a => 'a => 'b" where
32462
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    32
  "cut f r x == (%y. if (y,x):r then f y else undefined)"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    33
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32462
diff changeset
    34
definition
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32462
diff changeset
    35
  adm_wf :: "('a * 'a) set => (('a => 'b) => 'a => 'b) => bool" where
32462
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    36
  "adm_wf R F == ALL f g x.
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    37
     (ALL z. (z, x) : R --> f z = g z) --> F f x = F g x"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    38
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32462
diff changeset
    39
definition
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32462
diff changeset
    40
  wfrec :: "('a * 'a) set => (('a => 'b) => 'a => 'b) => 'a => 'b" where
37767
a2b7a20d6ea3 dropped superfluous [code del]s
haftmann
parents: 35416
diff changeset
    41
  "wfrec R F == %x. THE y. wfrec_rel R (%f x. F (cut f R x) x) x y"
32462
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    42
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    43
subsection{*Well-Founded Recursion*}
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    44
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    45
text{*cut*}
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    46
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    47
lemma cuts_eq: "(cut f r x = cut g r x) = (ALL y. (y,x):r --> f(y)=g(y))"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    48
by (simp add: expand_fun_eq cut_def)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    49
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    50
lemma cut_apply: "(x,a):r ==> (cut f r a)(x) = f(x)"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    51
by (simp add: cut_def)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    52
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    53
text{*Inductive characterization of wfrec combinator; for details see:
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    54
John Harrison, "Inductive definitions: automation and application"*}
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    55
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    56
lemma wfrec_unique: "[| adm_wf R F; wf R |] ==> EX! y. wfrec_rel R F x y"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    57
apply (simp add: adm_wf_def)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    58
apply (erule_tac a=x in wf_induct)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    59
apply (rule ex1I)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    60
apply (rule_tac g = "%x. THE y. wfrec_rel R F x y" in wfrec_rel.wfrecI)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    61
apply (fast dest!: theI')
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    62
apply (erule wfrec_rel.cases, simp)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    63
apply (erule allE, erule allE, erule allE, erule mp)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    64
apply (fast intro: the_equality [symmetric])
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    65
done
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    66
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    67
lemma adm_lemma: "adm_wf R (%f x. F (cut f R x) x)"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    68
apply (simp add: adm_wf_def)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    69
apply (intro strip)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    70
apply (rule cuts_eq [THEN iffD2, THEN subst], assumption)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    71
apply (rule refl)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    72
done
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    73
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    74
lemma wfrec: "wf(r) ==> wfrec r H a = H (cut (wfrec r H) r a) a"
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    75
apply (simp add: wfrec_def)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    76
apply (rule adm_lemma [THEN wfrec_unique, THEN the1_equality], assumption)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    77
apply (rule wfrec_rel.wfrecI)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    78
apply (intro strip)
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    79
apply (erule adm_lemma [THEN wfrec_unique, THEN theI'])
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    80
done
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    81
c33faa289520 moved wfrec to Recdef.thy
krauss
parents: 32244
diff changeset
    82
26748
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    83
text{** This form avoids giant explosions in proofs.  NOTE USE OF ==*}
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    84
lemma def_wfrec: "[| f==wfrec r H;  wf(r) |] ==> f(a) = H (cut f r a) a"
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    85
apply auto
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    86
apply (blast intro: wfrec)
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    87
done
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    88
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    89
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    90
lemma tfl_wf_induct: "ALL R. wf R -->  
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    91
       (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    92
apply clarify
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    93
apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    94
done
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    95
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    96
lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    97
apply clarify
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    98
apply (rule cut_apply, assumption)
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
    99
done
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   100
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   101
lemma tfl_wfrec:
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   102
     "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   103
apply clarify
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   104
apply (erule wfrec)
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   105
done
4d51ddd6aa5c Merged theories about wellfoundedness into one: Wellfounded.thy
krauss
parents: 23742
diff changeset
   106
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   107
lemma tfl_eq_True: "(x = True) --> x"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   108
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   109
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   110
lemma tfl_rev_eq_mp: "(x = y) --> y --> x";
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   111
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   112
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   113
lemma tfl_simp_thm: "(x --> y) --> (x = x') --> (x' --> y)"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   114
  by blast
6438
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
   115
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   116
lemma tfl_P_imp_P_iff_True: "P ==> P = True"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   117
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   118
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   119
lemma tfl_imp_trans: "(A --> B) ==> (B --> C) ==> (A --> C)"
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   120
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   121
12023
wenzelm
parents: 11533
diff changeset
   122
lemma tfl_disj_assoc: "(a \<or> b) \<or> c == a \<or> (b \<or> c)"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   123
  by simp
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   124
12023
wenzelm
parents: 11533
diff changeset
   125
lemma tfl_disjE: "P \<or> Q ==> P --> R ==> Q --> R ==> R"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   126
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   127
12023
wenzelm
parents: 11533
diff changeset
   128
lemma tfl_exE: "\<exists>x. P x ==> \<forall>x. P x --> Q ==> Q"
10773
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   129
  by blast
0deff0197496 renamed .sml files to .ML;
wenzelm
parents: 10653
diff changeset
   130
23150
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   131
use "Tools/TFL/casesplit.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   132
use "Tools/TFL/utils.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   133
use "Tools/TFL/usyntax.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   134
use "Tools/TFL/dcterm.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   135
use "Tools/TFL/thms.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   136
use "Tools/TFL/rules.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   137
use "Tools/TFL/thry.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   138
use "Tools/TFL/tfl.ML"
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   139
use "Tools/TFL/post.ML"
31723
f5cafe803b55 discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents: 29654
diff changeset
   140
use "Tools/recdef.ML"
f5cafe803b55 discontinued ancient tradition to suffix certain ML module names with "_package"
haftmann
parents: 29654
diff changeset
   141
setup Recdef.setup
6438
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
   142
32244
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   143
text {*Wellfoundedness of @{text same_fst}*}
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   144
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   145
definition
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   146
 same_fst :: "('a => bool) => ('a => ('b * 'b)set) => (('a*'b)*('a*'b))set"
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   147
where
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   148
    "same_fst P R == {((x',y'),(x,y)) . x'=x & P x & (y',y) : R x}"
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   149
   --{*For @{text rec_def} declarations where the first n parameters
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   150
       stay unchanged in the recursive call. *}
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   151
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   152
lemma same_fstI [intro!]:
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   153
     "[| P x; (y',y) : R x |] ==> ((x,y'),(x,y)) : same_fst P R"
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   154
by (simp add: same_fst_def)
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   155
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   156
lemma wf_same_fst:
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   157
  assumes prem: "(!!x. P x ==> wf(R x))"
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   158
  shows "wf(same_fst P R)"
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   159
apply (simp cong del: imp_cong add: wf_def same_fst_def)
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   160
apply (intro strip)
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   161
apply (rename_tac a b)
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   162
apply (case_tac "wf (R a)")
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   163
 apply (erule_tac a = b in wf_induct, blast)
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   164
apply (blast intro: prem)
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   165
done
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   166
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   167
text {*Rule setup*}
a99723d77ae0 moved obsolete same_fst to Recdef.thy
krauss
parents: 31723
diff changeset
   168
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   169
lemmas [recdef_simp] =
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   170
  inv_image_def
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   171
  measure_def
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   172
  lex_prod_def
11284
981ea92a86dd made same_fst recdef_simp
nipkow
parents: 11165
diff changeset
   173
  same_fst_def
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   174
  less_Suc_eq [THEN iffD2]
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   175
23150
073a65f0bc40 moved TFL files to canonical place;
wenzelm
parents: 22622
diff changeset
   176
lemmas [recdef_cong] =
22622
25693088396b Moving "FunDef" up in the HOL development graph, since it is independent from "Recdef" and "Datatype" now.
krauss
parents: 22399
diff changeset
   177
  if_cong let_cong image_cong INT_cong UN_cong bex_cong ball_cong imp_cong
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   178
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   179
lemmas [recdef_wf] =
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   180
  wf_trancl
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   181
  wf_less_than
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   182
  wf_lex_prod
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   183
  wf_inv_image
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   184
  wf_measure
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   185
  wf_pred_nat
10653
55f33da63366 small mods.
nipkow
parents: 10212
diff changeset
   186
  wf_same_fst
9855
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   187
  wf_empty
709a295731e2 improved recdef setup;
wenzelm
parents: 8303
diff changeset
   188
6438
e55a1869ed38 'HOL/recdef' theory data;
wenzelm
parents: 5123
diff changeset
   189
end