src/CCL/Fix.thy
author blanchet
Mon, 15 Sep 2014 10:49:07 +0200
changeset 58335 a5a3b576fcfb
parent 42156 df219e736a5d
child 58889 5b7a9633cfa8
permissions -rw-r--r--
generate 'code' attribute only if 'code' plugin is enabled
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     1
(*  Title:      CCL/Fix.thy
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 0
diff changeset
     2
    Author:     Martin Coen
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     6
header {* Tentative attempt at including fixed point induction; justified by Smith *}
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     7
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     8
theory Fix
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     9
imports Type
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    10
begin
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
42156
df219e736a5d modernized specifications -- less axioms;
wenzelm
parents: 36319
diff changeset
    12
definition idgen :: "i => i"
df219e736a5d modernized specifications -- less axioms;
wenzelm
parents: 36319
diff changeset
    13
  where "idgen(f) == lam t. case(t,true,false,%x y.<f`x, f`y>,%u. lam x. f ` u(x))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
42156
df219e736a5d modernized specifications -- less axioms;
wenzelm
parents: 36319
diff changeset
    15
axiomatization INCL :: "[i=>o]=>o" where
df219e736a5d modernized specifications -- less axioms;
wenzelm
parents: 36319
diff changeset
    16
  INCL_def: "INCL(%x. P(x)) == (ALL f.(ALL n:Nat. P(f^n`bot)) --> P(fix(f)))" and
df219e736a5d modernized specifications -- less axioms;
wenzelm
parents: 36319
diff changeset
    17
  po_INCL: "INCL(%x. a(x) [= b(x))" and
17456
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    18
  INCL_subst: "INCL(P) ==> INCL(%x. P((g::i=>i)(x)))"
bcf7544875b2 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    19
20140
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    20
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    21
subsection {* Fixed Point Induction *}
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    22
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    23
lemma fix_ind:
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    24
  assumes base: "P(bot)"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    25
    and step: "!!x. P(x) ==> P(f(x))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    26
    and incl: "INCL(P)"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    27
  shows "P(fix(f))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    28
  apply (rule incl [unfolded INCL_def, rule_format])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    29
  apply (rule Nat_ind [THEN ballI], assumption)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    30
   apply simp_all
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    31
   apply (rule base)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    32
  apply (erule step)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    33
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    34
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    35
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    36
subsection {* Inclusive Predicates *}
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    37
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    38
lemma inclXH: "INCL(P) <-> (ALL f. (ALL n:Nat. P(f ^ n ` bot)) --> P(fix(f)))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    39
  by (simp add: INCL_def)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    40
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    41
lemma inclI: "[| !!f. ALL n:Nat. P(f^n`bot) ==> P(fix(f)) |] ==> INCL(%x. P(x))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    42
  unfolding inclXH by blast
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    43
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    44
lemma inclD: "[| INCL(P);  !!n. n:Nat ==> P(f^n`bot) |] ==> P(fix(f))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    45
  unfolding inclXH by blast
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    46
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    47
lemma inclE: "[| INCL(P);  (ALL n:Nat. P(f^n`bot))-->P(fix(f)) ==> R |] ==> R"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    48
  by (blast dest: inclD)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    49
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    50
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    51
subsection {* Lemmas for Inclusive Predicates *}
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    52
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    53
lemma npo_INCL: "INCL(%x.~ a(x) [= t)"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    54
  apply (rule inclI)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    55
  apply (drule bspec)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    56
   apply (rule zeroT)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    57
  apply (erule contrapos)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    58
  apply (rule po_trans)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    59
   prefer 2
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    60
   apply assumption
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    61
  apply (subst napplyBzero)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    62
  apply (rule po_cong, rule po_bot)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    63
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    64
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    65
lemma conj_INCL: "[| INCL(P);  INCL(Q) |] ==> INCL(%x. P(x) & Q(x))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    66
  by (blast intro!: inclI dest!: inclD)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    67
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    68
lemma all_INCL: "[| !!a. INCL(P(a)) |] ==> INCL(%x. ALL a. P(a,x))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    69
  by (blast intro!: inclI dest!: inclD)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    70
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    71
lemma ball_INCL: "[| !!a. a:A ==> INCL(P(a)) |] ==> INCL(%x. ALL a:A. P(a,x))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    72
  by (blast intro!: inclI dest!: inclD)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    73
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    74
lemma eq_INCL: "INCL(%x. a(x) = (b(x)::'a::prog))"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    75
  apply (simp add: eq_iff)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    76
  apply (rule conj_INCL po_INCL)+
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    77
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    78
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    79
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    80
subsection {* Derivation of Reachability Condition *}
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    81
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    82
(* Fixed points of idgen *)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    83
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    84
lemma fix_idgenfp: "idgen(fix(idgen)) = fix(idgen)"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    85
  apply (rule fixB [symmetric])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    86
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    87
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    88
lemma id_idgenfp: "idgen(lam x. x) = lam x. x"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    89
  apply (simp add: idgen_def)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    90
  apply (rule term_case [THEN allI])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    91
      apply simp_all
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    92
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    93
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    94
(* All fixed points are lam-expressions *)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    95
36319
8feb2c4bef1a mark schematic statements explicitly;
wenzelm
parents: 32153
diff changeset
    96
schematic_lemma idgenfp_lam: "idgen(d) = d ==> d = lam x. ?f(x)"
20140
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    97
  apply (unfold idgen_def)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    98
  apply (erule ssubst)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
    99
  apply (rule refl)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   100
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   101
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   102
(* Lemmas for rewriting fixed points of idgen *)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   103
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   104
lemma l_lemma: "[| a = b;  a ` t = u |] ==> b ` t = u"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   105
  by (simp add: idgen_def)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   106
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   107
lemma idgen_lemmas:
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   108
  "idgen(d) = d ==> d ` bot = bot"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   109
  "idgen(d) = d ==> d ` true = true"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   110
  "idgen(d) = d ==> d ` false = false"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   111
  "idgen(d) = d ==> d ` <a,b> = <d ` a,d ` b>"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   112
  "idgen(d) = d ==> d ` (lam x. f(x)) = lam x. d ` f(x)"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   113
  by (erule l_lemma, simp add: idgen_def)+
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   114
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   115
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   116
(* Proof of Reachability law - show that fix and lam x.x both give LEAST fixed points
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   117
  of idgen and hence are they same *)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   118
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   119
lemma po_eta:
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   120
  "[| ALL x. t ` x [= u ` x;  EX f. t=lam x. f(x);  EX f. u=lam x. f(x) |] ==> t [= u"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   121
  apply (drule cond_eta)+
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   122
  apply (erule ssubst)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   123
  apply (erule ssubst)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   124
  apply (rule po_lam [THEN iffD2])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   125
  apply simp
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   126
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   127
36319
8feb2c4bef1a mark schematic statements explicitly;
wenzelm
parents: 32153
diff changeset
   128
schematic_lemma po_eta_lemma: "idgen(d) = d ==> d = lam x. ?f(x)"
20140
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   129
  apply (unfold idgen_def)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   130
  apply (erule sym)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   131
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   132
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   133
lemma lemma1:
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   134
  "idgen(d) = d ==>
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   135
    {p. EX a b. p=<a,b> & (EX t. a=fix(idgen) ` t & b = d ` t)} <=
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   136
      POgen({p. EX a b. p=<a,b> & (EX t. a=fix(idgen) ` t  & b = d ` t)})"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   137
  apply clarify
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   138
  apply (rule_tac t = t in term_case)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   139
      apply (simp_all add: POgenXH idgen_lemmas idgen_lemmas [OF fix_idgenfp])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   140
   apply blast
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   141
  apply fast
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   142
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   143
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   144
lemma fix_least_idgen: "idgen(d) = d ==> fix(idgen) [= d"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   145
  apply (rule allI [THEN po_eta])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   146
    apply (rule lemma1 [THEN [2] po_coinduct])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   147
     apply (blast intro: po_eta_lemma fix_idgenfp)+
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   148
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   149
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   150
lemma lemma2:
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   151
  "idgen(d) = d ==>
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   152
    {p. EX a b. p=<a,b> & b = d ` a} <= POgen({p. EX a b. p=<a,b> & b = d ` a})"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   153
  apply clarify
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   154
  apply (rule_tac t = a in term_case)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   155
      apply (simp_all add: POgenXH idgen_lemmas)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   156
  apply fast
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   157
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   158
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   159
lemma id_least_idgen: "idgen(d) = d ==> lam x. x [= d"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   160
  apply (rule allI [THEN po_eta])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   161
    apply (rule lemma2 [THEN [2] po_coinduct])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   162
     apply simp
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   163
    apply (fast intro: po_eta_lemma fix_idgenfp)+
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   164
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   165
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   166
lemma reachability: "fix(idgen) = lam x. x"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   167
  apply (fast intro: eq_iff [THEN iffD2]
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   168
    id_idgenfp [THEN fix_least_idgen] fix_idgenfp [THEN id_least_idgen])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   169
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   170
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   171
(********)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   172
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   173
lemma id_apply: "f = lam x. x ==> f`t = t"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   174
  apply (erule ssubst)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   175
  apply (rule applyB)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   176
  done
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   177
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   178
lemma term_ind:
23467
d1b97708d5eb tuned proofs -- avoid implicit prems;
wenzelm
parents: 20140
diff changeset
   179
  assumes 1: "P(bot)" and 2: "P(true)" and 3: "P(false)"
d1b97708d5eb tuned proofs -- avoid implicit prems;
wenzelm
parents: 20140
diff changeset
   180
    and 4: "!!x y.[| P(x);  P(y) |] ==> P(<x,y>)"
d1b97708d5eb tuned proofs -- avoid implicit prems;
wenzelm
parents: 20140
diff changeset
   181
    and 5: "!!u.(!!x. P(u(x))) ==> P(lam x. u(x))"
d1b97708d5eb tuned proofs -- avoid implicit prems;
wenzelm
parents: 20140
diff changeset
   182
    and 6: "INCL(P)"
20140
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   183
  shows "P(t)"
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   184
  apply (rule reachability [THEN id_apply, THEN subst])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   185
  apply (rule_tac x = t in spec)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   186
  apply (rule fix_ind)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   187
    apply (unfold idgen_def)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   188
    apply (rule allI)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   189
    apply (subst applyBbot)
23467
d1b97708d5eb tuned proofs -- avoid implicit prems;
wenzelm
parents: 20140
diff changeset
   190
    apply (rule 1)
20140
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   191
   apply (rule allI)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   192
   apply (rule applyB [THEN ssubst])
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   193
    apply (rule_tac t = "xa" in term_case)
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   194
       apply simp_all
23467
d1b97708d5eb tuned proofs -- avoid implicit prems;
wenzelm
parents: 20140
diff changeset
   195
       apply (fast intro: assms INCL_subst all_INCL)+
20140
98acc6d0fab6 removed obsolete ML files;
wenzelm
parents: 17456
diff changeset
   196
  done
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
end