src/HOL/Wellfounded_Recursion.thy
author haftmann
Tue, 10 Jul 2007 17:30:45 +0200
changeset 23706 b7abba3c230e
parent 23389 aaca6a8e5414
child 23744 7c9e6e2fe249
permissions -rw-r--r--
moved some finite lemmas here
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
     1
(*  ID:         $Id$
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     2
    Author:     Tobias Nipkow
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     3
    Copyright   1992  University of Cambridge
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     4
*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     5
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
     6
header {*Well-founded Recursion*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
     7
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
     8
theory Wellfounded_Recursion
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
     9
imports Transitive_Closure
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    10
begin
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    11
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    12
inductive2
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    13
  wfrec_rel :: "('a * 'a) set => (('a => 'b) => 'a => 'b) => 'a => 'b => bool"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    14
  for R :: "('a * 'a) set"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    15
  and F :: "('a => 'b) => 'a => 'b"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    16
where
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    17
  wfrecI: "ALL z. (z, x) : R --> wfrec_rel R F z (g z) ==>
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    18
            wfrec_rel R F x (F g x)"
11328
956ec01b46e0 Inductive characterization of wfrec combinator.
berghofe
parents: 11137
diff changeset
    19
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    20
constdefs
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    21
  wf         :: "('a * 'a)set => bool"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    22
  "wf(r) == (!P. (!x. (!y. (y,x):r --> P(y)) --> P(x)) --> (!x. P(x)))"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    23
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    24
  wfP :: "('a => 'a => bool) => bool"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    25
  "wfP r == wf (Collect2 r)"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    26
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    27
  acyclic :: "('a*'a)set => bool"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    28
  "acyclic r == !x. (x,x) ~: r^+"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    29
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    30
  cut        :: "('a => 'b) => ('a * 'a)set => 'a => 'a => 'b"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    31
  "cut f r x == (%y. if (y,x):r then f y else arbitrary)"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    32
11328
956ec01b46e0 Inductive characterization of wfrec combinator.
berghofe
parents: 11137
diff changeset
    33
  adm_wf :: "('a * 'a) set => (('a => 'b) => 'a => 'b) => bool"
956ec01b46e0 Inductive characterization of wfrec combinator.
berghofe
parents: 11137
diff changeset
    34
  "adm_wf R F == ALL f g x.
956ec01b46e0 Inductive characterization of wfrec combinator.
berghofe
parents: 11137
diff changeset
    35
     (ALL z. (z, x) : R --> f z = g z) --> F f x = F g x"
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    36
11328
956ec01b46e0 Inductive characterization of wfrec combinator.
berghofe
parents: 11137
diff changeset
    37
  wfrec :: "('a * 'a) set => (('a => 'b) => 'a => 'b) => 'a => 'b"
22845
5f9138bcb3d7 changed code generator invocation syntax
haftmann
parents: 22766
diff changeset
    38
  [code func del]: "wfrec R F == %x. THE y. wfrec_rel R (%f x. F (cut f R x) x) x y"
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    39
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    40
abbreviation acyclicP :: "('a => 'a => bool) => bool" where
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    41
  "acyclicP r == acyclic (Collect2 r)"
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    42
22390
378f34b1e380 now using "class"
haftmann
parents: 22263
diff changeset
    43
class wellorder = linorder +
378f34b1e380 now using "class"
haftmann
parents: 22263
diff changeset
    44
  assumes wf: "wf {(x, y). x \<sqsubset> y}"
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    45
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    46
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    47
lemma wfP_wf_eq [pred_set_conv]: "wfP (member2 r) = wf r"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    48
  by (simp add: wfP_def)
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    49
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    50
lemma wf_implies_wfP: "wf r \<Longrightarrow> wfP (member2 r)"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    51
  by (simp add: wfP_def)
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    52
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    53
lemma wfP_implies_wf: "wfP r \<Longrightarrow> wf (Collect2 r)"
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    54
  by (simp add: wfP_def)
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    55
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    56
lemma wfUNIVI: 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    57
   "(!!P x. (ALL x. (ALL y. (y,x) : r --> P(y)) --> P(x)) ==> P(x)) ==> wf(r)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    58
by (unfold wf_def, blast)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    59
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    60
lemmas wfPUNIVI = wfUNIVI [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    61
19766
031e0dde31f1 generalized wfI
paulson
parents: 19602
diff changeset
    62
text{*Restriction to domain @{term A} and range @{term B}.  If @{term r} is
031e0dde31f1 generalized wfI
paulson
parents: 19602
diff changeset
    63
    well-founded over their intersection, then @{term "wf r"}*}
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    64
lemma wfI: 
19766
031e0dde31f1 generalized wfI
paulson
parents: 19602
diff changeset
    65
 "[| r \<subseteq> A <*> B; 
031e0dde31f1 generalized wfI
paulson
parents: 19602
diff changeset
    66
     !!x P. [|\<forall>x. (\<forall>y. (y,x) : r --> P y) --> P x;  x : A; x : B |] ==> P x |]
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    67
  ==>  wf r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    68
by (unfold wf_def, blast)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    69
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    70
lemma wf_induct: 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    71
    "[| wf(r);           
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    72
        !!x.[| ALL y. (y,x): r --> P(y) |] ==> P(x)  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    73
     |]  ==>  P(a)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    74
by (unfold wf_def, blast)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    75
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    76
lemmas wfP_induct = wf_induct [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    77
18458
c0794cdbc6d1 wf_induct_rule: consumes 1;
wenzelm
parents: 17654
diff changeset
    78
lemmas wf_induct_rule = wf_induct [rule_format, consumes 1, case_names less, induct set: wf]
17042
da5cfaa258f7 moved wf_induct_rule from PreList.thy to Wellfounded_Recursion.thy
nipkow
parents: 15950
diff changeset
    79
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    80
lemmas wfP_induct_rule =
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    81
  wf_induct_rule [to_pred, consumes 1, case_names less, induct set: wfP]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
    82
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    83
lemma wf_not_sym [rule_format]: "wf(r) ==> ALL x. (a,x):r --> (x,a)~:r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    84
by (erule_tac a=a in wf_induct, blast)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    85
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    86
(* [| wf r;  ~Z ==> (a,x) : r;  (x,a) ~: r ==> Z |] ==> Z *)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    87
lemmas wf_asym = wf_not_sym [elim_format]
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    88
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    89
lemma wf_not_refl [simp]: "wf(r) ==> (a,a) ~: r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    90
by (blast elim: wf_asym)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    91
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    92
(* [| wf r;  (a,a) ~: r ==> PROP W |] ==> PROP W *)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    93
lemmas wf_irrefl = wf_not_refl [elim_format]
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    94
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    95
text{*transitive closure of a well-founded relation is well-founded! *}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    96
lemma wf_trancl: "wf(r) ==> wf(r^+)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    97
apply (subst wf_def, clarify)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    98
apply (rule allE, assumption)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
    99
  --{*Retains the universal formula for later use!*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   100
apply (erule mp)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   101
apply (erule_tac a = x in wf_induct)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   102
apply (blast elim: tranclE)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   103
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   104
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   105
lemmas wfP_trancl = wf_trancl [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   106
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   107
lemma wf_converse_trancl: "wf (r^-1) ==> wf ((r^+)^-1)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   108
apply (subst trancl_converse [symmetric])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   109
apply (erule wf_trancl)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   110
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   111
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   112
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   113
subsubsection{*Other simple well-foundedness results*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   114
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   115
19870
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   116
text{*Minimal-element characterization of well-foundedness*}
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   117
lemma wf_eq_minimal: "wf r = (\<forall>Q x. x\<in>Q --> (\<exists>z\<in>Q. \<forall>y. (y,z)\<in>r --> y\<notin>Q))"
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   118
proof (intro iffI strip)
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   119
  fix Q::"'a set" and x
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   120
  assume "wf r" and "x \<in> Q"
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   121
  thus "\<exists>z\<in>Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> Q"
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   122
    by (unfold wf_def, 
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   123
        blast dest: spec [of _ "%x. x\<in>Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y,z) \<in> r \<longrightarrow> y\<notin>Q)"]) 
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   124
next
22766
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   125
  assume 1: "\<forall>Q x. x \<in> Q \<longrightarrow> (\<exists>z\<in>Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> Q)"
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   126
  show "wf r"
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   127
  proof (rule wfUNIVI)
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   128
    fix P :: "'a \<Rightarrow> bool" and x
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   129
    assume 2: "\<forall>x. (\<forall>y. (y, x) \<in> r \<longrightarrow> P y) \<longrightarrow> P x"
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   130
    let ?Q = "{x. \<not> P x}"
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   131
    have "x \<in> ?Q \<longrightarrow> (\<exists>z\<in>?Q. \<forall>y. (y, z) \<in> r \<longrightarrow> y \<notin> ?Q)"
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   132
      by (rule 1 [THEN spec, THEN spec])
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   133
    hence "\<not> P x \<longrightarrow> (\<exists>z. \<not> P z \<and> (\<forall>y. (y, z) \<in> r \<longrightarrow> P y))" by simp
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   134
    with 2 have "\<not> P x \<longrightarrow> (\<exists>z. \<not> P z \<and> P z)" by fast
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   135
    thus "P x" by simp
116c1d6b4026 faster proof of wf_eq_minimal
huffman
parents: 22390
diff changeset
   136
  qed
19870
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   137
qed
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   138
23186
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   139
lemma wfE_min: 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   140
  assumes p:"wf R" "x \<in> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   141
  obtains z where "z \<in> Q" "\<And>y. (y, z) \<in> R \<Longrightarrow> y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   142
  using p
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   143
  unfolding wf_eq_minimal
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   144
  by blast
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   145
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   146
lemma wfI_min:
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   147
  "(\<And>x Q. x \<in> Q \<Longrightarrow> \<exists>z\<in>Q. \<forall>y. (y, z) \<in> R \<longrightarrow> y \<notin> Q)
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   148
  \<Longrightarrow> wf R"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   149
  unfolding wf_eq_minimal
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   150
  by blast
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   151
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   152
lemmas wfP_eq_minimal = wf_eq_minimal [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   153
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   154
text{*Well-foundedness of subsets*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   155
lemma wf_subset: "[| wf(r);  p<=r |] ==> wf(p)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   156
apply (simp (no_asm_use) add: wf_eq_minimal)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   157
apply fast
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   158
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   159
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   160
lemmas wfP_subset = wf_subset [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   161
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   162
text{*Well-foundedness of the empty relation*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   163
lemma wf_empty [iff]: "wf({})"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   164
by (simp add: wf_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   165
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   166
lemmas wfP_empty [iff] = wf_empty [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   167
19870
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   168
lemma wf_Int1: "wf r ==> wf (r Int r')"
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   169
by (erule wf_subset, rule Int_lower1)
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   170
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   171
lemma wf_Int2: "wf r ==> wf (r' Int r)"
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   172
by (erule wf_subset, rule Int_lower2)
ef037d1b32d1 new results
paulson
parents: 19766
diff changeset
   173
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   174
text{*Well-foundedness of insert*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   175
lemma wf_insert [iff]: "wf(insert (y,x) r) = (wf(r) & (x,y) ~: r^*)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   176
apply (rule iffI)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   177
 apply (blast elim: wf_trancl [THEN wf_irrefl]
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   178
              intro: rtrancl_into_trancl1 wf_subset 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   179
                     rtrancl_mono [THEN [2] rev_subsetD])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   180
apply (simp add: wf_eq_minimal, safe)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   181
apply (rule allE, assumption, erule impE, blast) 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   182
apply (erule bexE)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   183
apply (rename_tac "a", case_tac "a = x")
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   184
 prefer 2
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   185
apply blast 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   186
apply (case_tac "y:Q")
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   187
 prefer 2 apply blast
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   188
apply (rule_tac x = "{z. z:Q & (z,y) : r^*}" in allE)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   189
 apply assumption
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   190
apply (erule_tac V = "ALL Q. (EX x. x : Q) --> ?P Q" in thin_rl) 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   191
  --{*essential for speed*}
15343
444bb25d3da0 blast_tac -> blast in comment (fix latex error)
kleing
parents: 15341
diff changeset
   192
txt{*Blast with new substOccur fails*}
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   193
apply (fast intro: converse_rtrancl_into_rtrancl)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   194
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   195
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   196
text{*Well-foundedness of image*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   197
lemma wf_prod_fun_image: "[| wf r; inj f |] ==> wf(prod_fun f f ` r)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   198
apply (simp only: wf_eq_minimal, clarify)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   199
apply (case_tac "EX p. f p : Q")
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   200
apply (erule_tac x = "{p. f p : Q}" in allE)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   201
apply (fast dest: inj_onD, blast)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   202
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   203
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   204
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   205
subsubsection{*Well-Foundedness Results for Unions*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   206
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   207
text{*Well-foundedness of indexed union with disjoint domains and ranges*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   208
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   209
lemma wf_UN: "[| ALL i:I. wf(r i);  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   210
         ALL i:I. ALL j:I. r i ~= r j --> Domain(r i) Int Range(r j) = {}  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   211
      |] ==> wf(UN i:I. r i)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   212
apply (simp only: wf_eq_minimal, clarify)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   213
apply (rename_tac A a, case_tac "EX i:I. EX a:A. EX b:A. (b,a) : r i")
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   214
 prefer 2
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   215
 apply force 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   216
apply clarify
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   217
apply (drule bspec, assumption)  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   218
apply (erule_tac x="{a. a:A & (EX b:A. (b,a) : r i) }" in allE)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   219
apply (blast elim!: allE)  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   220
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   221
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   222
lemmas wfP_SUP = wf_UN [where I=UNIV and r="\<lambda>i. Collect2 (r i)",
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   223
  to_pred member2_SUP, simplified, standard]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   224
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   225
lemma wf_Union: 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   226
 "[| ALL r:R. wf r;  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   227
     ALL r:R. ALL s:R. r ~= s --> Domain r Int Range s = {}  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   228
  |] ==> wf(Union R)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   229
apply (simp add: Union_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   230
apply (blast intro: wf_UN)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   231
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   232
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   233
(*Intuition: we find an (R u S)-min element of a nonempty subset A
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   234
             by case distinction.
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   235
  1. There is a step a -R-> b with a,b : A.
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   236
     Pick an R-min element z of the (nonempty) set {a:A | EX b:A. a -R-> b}.
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   237
     By definition, there is z':A s.t. z -R-> z'. Because z is R-min in the
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   238
     subset, z' must be R-min in A. Because z' has an R-predecessor, it cannot
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   239
     have an S-successor and is thus S-min in A as well.
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   240
  2. There is no such step.
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   241
     Pick an S-min element of A. In this case it must be an R-min
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   242
     element of A as well.
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   243
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   244
*)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   245
lemma wf_Un:
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   246
     "[| wf r; wf s; Domain r Int Range s = {} |] ==> wf(r Un s)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   247
apply (simp only: wf_eq_minimal, clarify) 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   248
apply (rename_tac A a)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   249
apply (case_tac "EX a:A. EX b:A. (b,a) : r") 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   250
 prefer 2
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   251
 apply simp
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   252
 apply (drule_tac x=A in spec)+
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   253
 apply blast 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   254
apply (erule_tac x="{a. a:A & (EX b:A. (b,a) : r) }" in allE)+
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   255
apply (blast elim!: allE)  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   256
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   257
23186
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   258
lemma wf_union_merge: 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   259
  "wf (R \<union> S) = wf (R O R \<union> R O S \<union> S)" (is "wf ?A = wf ?B")
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   260
proof
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   261
  assume "wf ?A"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   262
  with wf_trancl have wfT: "wf (?A^+)" .
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   263
  moreover have "?B \<subseteq> ?A^+"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   264
    by  (subst trancl_unfold, subst trancl_unfold) blast
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   265
  ultimately show "wf ?B" by (rule wf_subset)
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   266
next
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   267
  assume "wf ?B"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   268
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   269
  show "wf ?A"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   270
  proof (rule wfI_min)
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   271
    fix Q :: "'a set" and x 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   272
    assume "x \<in> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   273
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   274
    with `wf ?B`
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   275
    obtain z where "z \<in> Q" and "\<And>y. (y, z) \<in> ?B \<Longrightarrow> y \<notin> Q" 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   276
      by (erule wfE_min)
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   277
    hence A1: "\<And>y. (y, z) \<in> R O R \<Longrightarrow> y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   278
      and A2: "\<And>y. (y, z) \<in> R O S \<Longrightarrow> y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   279
      and A3: "\<And>y. (y, z) \<in> S \<Longrightarrow> y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   280
      by auto
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   281
    
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   282
    show "\<exists>z\<in>Q. \<forall>y. (y, z) \<in> ?A \<longrightarrow> y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   283
    proof (cases "\<forall>y. (y, z) \<in> R \<longrightarrow> y \<notin> Q")
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   284
      case True
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   285
      with `z \<in> Q` A3 show ?thesis by blast
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   286
    next
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   287
      case False 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   288
      then obtain z' where "z'\<in>Q" "(z', z) \<in> R" by blast
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   289
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   290
      have "\<forall>y. (y, z') \<in> ?A \<longrightarrow> y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   291
      proof (intro allI impI)
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   292
        fix y assume "(y, z') \<in> ?A"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   293
        thus "y \<notin> Q"
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   294
        proof
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   295
          assume "(y, z') \<in> R" 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   296
          hence "(y, z) \<in> R O R" using `(z', z) \<in> R` ..
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   297
          with A1 show "y \<notin> Q" .
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   298
        next
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   299
          assume "(y, z') \<in> S" 
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   300
          hence "(y, z) \<in> R O S" using  `(z', z) \<in> R` ..
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   301
          with A2 show "y \<notin> Q" .
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   302
        qed
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   303
      qed
23389
aaca6a8e5414 tuned proofs: avoid implicit prems;
wenzelm
parents: 23186
diff changeset
   304
      with `z' \<in> Q` show ?thesis ..
23186
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   305
    qed
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   306
  qed
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   307
qed
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   308
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   309
lemma wf_comp_self: "wf R = wf (R O R)" (* special case *)
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   310
  by (fact wf_union_merge[where S = "{}", simplified])
f948708bc100 Added "merge-lemma" about wellfoundedness of unions (useful for some termination proofs)
krauss
parents: 22845
diff changeset
   311
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   312
subsubsection {*acyclic*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   313
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   314
lemma acyclicI: "ALL x. (x, x) ~: r^+ ==> acyclic r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   315
by (simp add: acyclic_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   316
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   317
lemma wf_acyclic: "wf r ==> acyclic r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   318
apply (simp add: acyclic_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   319
apply (blast elim: wf_trancl [THEN wf_irrefl])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   320
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   321
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   322
lemmas wfP_acyclicP = wf_acyclic [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   323
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   324
lemma acyclic_insert [iff]:
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   325
     "acyclic(insert (y,x) r) = (acyclic r & (x,y) ~: r^*)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   326
apply (simp add: acyclic_def trancl_insert)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   327
apply (blast intro: rtrancl_trans)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   328
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   329
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   330
lemma acyclic_converse [iff]: "acyclic(r^-1) = acyclic r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   331
by (simp add: acyclic_def trancl_converse)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   332
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   333
lemmas acyclicP_converse [iff] = acyclic_converse [to_pred]
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   334
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   335
lemma acyclic_impl_antisym_rtrancl: "acyclic r ==> antisym(r^*)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   336
apply (simp add: acyclic_def antisym_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   337
apply (blast elim: rtranclE intro: rtrancl_into_trancl1 rtrancl_trancl_trancl)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   338
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   339
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   340
(* Other direction:
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   341
acyclic = no loops
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   342
antisym = only self loops
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   343
Goalw [acyclic_def,antisym_def] "antisym( r^* ) ==> acyclic(r - Id)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   344
==> antisym( r^* ) = acyclic(r - Id)";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   345
*)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   346
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   347
lemma acyclic_subset: "[| acyclic s; r <= s |] ==> acyclic r"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   348
apply (simp add: acyclic_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   349
apply (blast intro: trancl_mono)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   350
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   351
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   352
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   353
subsection{*Well-Founded Recursion*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   354
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   355
text{*cut*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   356
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   357
lemma cuts_eq: "(cut f r x = cut g r x) = (ALL y. (y,x):r --> f(y)=g(y))"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   358
by (simp add: expand_fun_eq cut_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   359
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   360
lemma cut_apply: "(x,a):r ==> (cut f r a)(x) = f(x)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   361
by (simp add: cut_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   362
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   363
text{*Inductive characterization of wfrec combinator; for details see:  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   364
John Harrison, "Inductive definitions: automation and application"*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   365
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   366
lemma wfrec_unique: "[| adm_wf R F; wf R |] ==> EX! y. wfrec_rel R F x y"
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   367
apply (simp add: adm_wf_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   368
apply (erule_tac a=x in wf_induct) 
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   369
apply (rule ex1I)
22263
990a638e6f69 - Adapted to new inductive definition package
berghofe
parents: 20592
diff changeset
   370
apply (rule_tac g = "%x. THE y. wfrec_rel R F x y" in wfrec_rel.wfrecI)
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   371
apply (fast dest!: theI')
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   372
apply (erule wfrec_rel.cases, simp)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   373
apply (erule allE, erule allE, erule allE, erule mp)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   374
apply (fast intro: the_equality [symmetric])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   375
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   376
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   377
lemma adm_lemma: "adm_wf R (%f x. F (cut f R x) x)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   378
apply (simp add: adm_wf_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   379
apply (intro strip)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   380
apply (rule cuts_eq [THEN iffD2, THEN subst], assumption)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   381
apply (rule refl)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   382
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   383
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   384
lemma wfrec: "wf(r) ==> wfrec r H a = H (cut (wfrec r H) r a) a"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   385
apply (simp add: wfrec_def)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   386
apply (rule adm_lemma [THEN wfrec_unique, THEN the1_equality], assumption)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   387
apply (rule wfrec_rel.wfrecI)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   388
apply (intro strip)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   389
apply (erule adm_lemma [THEN wfrec_unique, THEN theI'])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   390
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   391
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   392
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   393
text{** This form avoids giant explosions in proofs.  NOTE USE OF ==*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   394
lemma def_wfrec: "[| f==wfrec r H;  wf(r) |] ==> f(a) = H (cut f r a) a"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   395
apply auto
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   396
apply (blast intro: wfrec)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   397
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   398
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   399
17459
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   400
subsection {* Code generator setup *}
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   401
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   402
consts_code
17654
38496187809d Renamed wf_rec to wfrec in consts_code declaration.
berghofe
parents: 17459
diff changeset
   403
  "wfrec"   ("\<module>wfrec?")
17459
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   404
attach {*
17654
38496187809d Renamed wf_rec to wfrec in consts_code declaration.
berghofe
parents: 17459
diff changeset
   405
fun wfrec f x = f (wfrec f) x;
17459
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   406
*}
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   407
9a3925c07392 added code generator setup (from Main.thy);
wenzelm
parents: 17042
diff changeset
   408
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   409
subsection{*Variants for TFL: the Recdef Package*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   410
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   411
lemma tfl_wf_induct: "ALL R. wf R -->  
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   412
       (ALL P. (ALL x. (ALL y. (y,x):R --> P y) --> P x) --> (ALL x. P x))"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   413
apply clarify
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   414
apply (rule_tac r = R and P = P and a = x in wf_induct, assumption, blast)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   415
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   416
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   417
lemma tfl_cut_apply: "ALL f R. (x,a):R --> (cut f R a)(x) = f(x)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   418
apply clarify
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   419
apply (rule cut_apply, assumption)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   420
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   421
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   422
lemma tfl_wfrec:
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   423
     "ALL M R f. (f=wfrec R M) --> wf R --> (ALL x. f x = M (cut f R x) x)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   424
apply clarify
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   425
apply (erule wfrec)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   426
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   427
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   428
subsection {*LEAST and wellorderings*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   429
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   430
text{* See also @{text wf_linord_ex_has_least} and its consequences in
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   431
 @{text Wellfounded_Relations.ML}*}
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   432
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   433
lemma wellorder_Least_lemma [rule_format]:
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   434
     "P (k::'a::wellorder) --> P (LEAST x. P(x)) & (LEAST x. P(x)) <= k"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   435
apply (rule_tac a = k in wf [THEN wf_induct])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   436
apply (rule impI)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   437
apply (rule classical)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   438
apply (rule_tac s = x in Least_equality [THEN ssubst], auto)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   439
apply (auto simp add: linorder_not_less [symmetric])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   440
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   441
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   442
lemmas LeastI   = wellorder_Least_lemma [THEN conjunct1, standard]
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   443
lemmas Least_le = wellorder_Least_lemma [THEN conjunct2, standard]
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   444
15950
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   445
-- "The following 3 lemmas are due to Brian Huffman"
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   446
lemma LeastI_ex: "EX x::'a::wellorder. P x ==> P (Least P)"
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   447
apply (erule exE)
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   448
apply (erule LeastI)
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   449
done
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   450
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   451
lemma LeastI2:
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   452
  "[| P (a::'a::wellorder); !!x. P x ==> Q x |] ==> Q (Least P)"
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   453
by (blast intro: LeastI)
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   454
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   455
lemma LeastI2_ex:
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   456
  "[| EX a::'a::wellorder. P a; !!x. P x ==> Q x |] ==> Q (Least P)"
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   457
by (blast intro: LeastI_ex)
5c067c956a20 Added thms by Brian Huffmann
nipkow
parents: 15343
diff changeset
   458
15341
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   459
lemma not_less_Least: "[| k < (LEAST x. P x) |] ==> ~P (k::'a::wellorder)"
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   460
apply (simp (no_asm_use) add: linorder_not_le [symmetric])
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   461
apply (erule contrapos_nn)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   462
apply (erule Least_le)
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   463
done
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   464
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   465
ML
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   466
{*
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   467
val wf_def = thm "wf_def";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   468
val wfUNIVI = thm "wfUNIVI";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   469
val wfI = thm "wfI";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   470
val wf_induct = thm "wf_induct";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   471
val wf_not_sym = thm "wf_not_sym";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   472
val wf_asym = thm "wf_asym";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   473
val wf_not_refl = thm "wf_not_refl";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   474
val wf_irrefl = thm "wf_irrefl";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   475
val wf_trancl = thm "wf_trancl";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   476
val wf_converse_trancl = thm "wf_converse_trancl";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   477
val wf_eq_minimal = thm "wf_eq_minimal";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   478
val wf_subset = thm "wf_subset";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   479
val wf_empty = thm "wf_empty";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   480
val wf_insert = thm "wf_insert";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   481
val wf_UN = thm "wf_UN";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   482
val wf_Union = thm "wf_Union";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   483
val wf_Un = thm "wf_Un";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   484
val wf_prod_fun_image = thm "wf_prod_fun_image";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   485
val acyclicI = thm "acyclicI";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   486
val wf_acyclic = thm "wf_acyclic";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   487
val acyclic_insert = thm "acyclic_insert";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   488
val acyclic_converse = thm "acyclic_converse";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   489
val acyclic_impl_antisym_rtrancl = thm "acyclic_impl_antisym_rtrancl";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   490
val acyclic_subset = thm "acyclic_subset";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   491
val cuts_eq = thm "cuts_eq";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   492
val cut_apply = thm "cut_apply";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   493
val wfrec_unique = thm "wfrec_unique";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   494
val wfrec = thm "wfrec";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   495
val def_wfrec = thm "def_wfrec";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   496
val tfl_wf_induct = thm "tfl_wf_induct";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   497
val tfl_cut_apply = thm "tfl_cut_apply";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   498
val tfl_wfrec = thm "tfl_wfrec";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   499
val LeastI = thm "LeastI";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   500
val Least_le = thm "Least_le";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   501
val not_less_Least = thm "not_less_Least";
254f6f00b60e converted to Isar script, simplifying some results
paulson
parents: 11451
diff changeset
   502
*}
11137
9265b6415d76 added wellorder axclass
oheimb
parents: 10213
diff changeset
   503
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
   504
end