src/LCF/LCF.thy
author bulwahn
Thu, 07 Jul 2011 23:33:14 +0200
changeset 43704 47b0be18ccbe
parent 41310 65631ca437c9
child 47025 b2b8ae61d6ad
permissions -rw-r--r--
floor and ceiling definitions are not code equations -- this enables trivial evaluation of floor and ceiling
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
     1
(*  Title:      LCF/LCF.thy
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
     2
    Author:     Tobias Nipkow
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     6
header {* LCF on top of First-Order Logic *}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     8
theory LCF
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
     9
imports FOL
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    10
begin
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    12
text {* This theory is based on Lawrence Paulson's book Logic and Computation. *}
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    14
subsection {* Natural Deduction Rules for LCF *}
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    15
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    16
classes cpo < "term"
36452
d37c6eed8117 renamed command 'defaultsort' to 'default_sort';
wenzelm
parents: 35762
diff changeset
    17
default_sort cpo
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    18
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    19
typedecl tr
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    20
typedecl void
41310
65631ca437c9 proper identifiers for consts and types;
wenzelm
parents: 36452
diff changeset
    21
typedecl ('a,'b) prod  (infixl "*" 6)
65631ca437c9 proper identifiers for consts and types;
wenzelm
parents: 36452
diff changeset
    22
typedecl ('a,'b) sum  (infixl "+" 5)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
283
76caebd18756 new type declaration syntax instead of numbers
lcp
parents: 0
diff changeset
    24
arities
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 22810
diff changeset
    25
  "fun" :: (cpo, cpo) cpo
41310
65631ca437c9 proper identifiers for consts and types;
wenzelm
parents: 36452
diff changeset
    26
  prod :: (cpo, cpo) cpo
65631ca437c9 proper identifiers for consts and types;
wenzelm
parents: 36452
diff changeset
    27
  sum :: (cpo, cpo) cpo
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    28
  tr :: cpo
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    29
  void :: cpo
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
consts
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    32
 UU     :: "'a"
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    33
 TT     :: "tr"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    34
 FF     :: "tr"
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    35
 FIX    :: "('a => 'a) => 'a"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    36
 FST    :: "'a*'b => 'a"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    37
 SND    :: "'a*'b => 'b"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
 INL    :: "'a => 'a+'b"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
 INR    :: "'b => 'a+'b"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
 WHEN   :: "['a=>'c, 'b=>'c, 'a+'b] => 'c"
1474
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    41
 adm    :: "('a => o) => o"
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    42
 VOID   :: "void"               ("'(')")
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    43
 PAIR   :: "['a,'b] => 'a*'b"   ("(1<_,/_>)" [0,0] 100)
3f7d67927fe2 expanded tabs
clasohm
parents: 649
diff changeset
    44
 COND   :: "[tr,'a,'a] => 'a"   ("(_ =>/ (_ |/ _))" [60,60,60] 60)
22810
a8455ca995d6 eliminated unnamed infixes;
wenzelm
parents: 19758
diff changeset
    45
 less   :: "['a,'a] => o"       (infixl "<<" 50)
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    46
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    47
axioms
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
  (** DOMAIN THEORY **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    50
  eq_def:        "x=y == x << y & y << x"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    52
  less_trans:    "[| x << y; y << z |] ==> x << z"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    54
  less_ext:      "(ALL x. f(x) << g(x)) ==> f << g"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    56
  mono:          "[| f << g; x << y |] ==> f(x) << g(y)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    58
  minimal:       "UU << x"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    60
  FIX_eq:        "f(FIX(f)) = FIX(f)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
  (** TR **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    64
  tr_cases:      "p=UU | p=TT | p=FF"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    66
  not_TT_less_FF: "~ TT << FF"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    67
  not_FF_less_TT: "~ FF << TT"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    68
  not_TT_less_UU: "~ TT << UU"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    69
  not_FF_less_UU: "~ FF << UU"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    71
  COND_UU:       "UU => x | y  =  UU"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    72
  COND_TT:       "TT => x | y  =  x"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    73
  COND_FF:       "FF => x | y  =  y"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
  (** PAIRS **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    77
  surj_pairing:  "<FST(z),SND(z)> = z"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    79
  FST:   "FST(<x,y>) = x"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    80
  SND:   "SND(<x,y>) = y"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
  (*** STRICT SUM ***)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    84
  INL_DEF: "~x=UU ==> ~INL(x)=UU"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    85
  INR_DEF: "~x=UU ==> ~INR(x)=UU"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    87
  INL_STRICT: "INL(UU) = UU"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    88
  INR_STRICT: "INR(UU) = UU"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    90
  WHEN_UU:  "WHEN(f,g,UU) = UU"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    91
  WHEN_INL: "~x=UU ==> WHEN(f,g,INL(x)) = f(x)"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    92
  WHEN_INR: "~x=UU ==> WHEN(f,g,INR(x)) = g(x)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    94
  SUM_EXHAUSTION:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
    "z = UU | (EX x. ~x=UU & z = INL(x)) | (EX y. ~y=UU & z = INR(y))"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
  (** VOID **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
    99
  void_cases:    "(x::void) = UU"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
  (** INDUCTION **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   103
  induct:        "[| adm(P); P(UU); ALL x. P(x) --> P(f(x)) |] ==> P(FIX(f))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
  (** Admissibility / Chain Completeness **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
  (* All rules can be found on pages 199--200 of Larry's LCF book.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
     Note that "easiness" of types is not taken into account
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
     because it cannot be expressed schematically; flatness could be. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   110
  adm_less:      "adm(%x. t(x) << u(x))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   111
  adm_not_less:  "adm(%x.~ t(x) << u)"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   112
  adm_not_free:  "adm(%x. A)"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   113
  adm_subst:     "adm(P) ==> adm(%x. P(t(x)))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   114
  adm_conj:      "[| adm(P); adm(Q) |] ==> adm(%x. P(x)&Q(x))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   115
  adm_disj:      "[| adm(P); adm(Q) |] ==> adm(%x. P(x)|Q(x))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   116
  adm_imp:       "[| adm(%x.~P(x)); adm(Q) |] ==> adm(%x. P(x)-->Q(x))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   117
  adm_all:       "(!!y. adm(P(y))) ==> adm(%x. ALL y. P(y,x))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   118
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   119
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   120
lemma eq_imp_less1: "x = y ==> x << y"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   121
  by (simp add: eq_def)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   122
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   123
lemma eq_imp_less2: "x = y ==> y << x"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   124
  by (simp add: eq_def)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   125
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   126
lemma less_refl [simp]: "x << x"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   127
  apply (rule eq_imp_less1)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   128
  apply (rule refl)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   129
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   130
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   131
lemma less_anti_sym: "[| x << y; y << x |] ==> x=y"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   132
  by (simp add: eq_def)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   133
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   134
lemma ext: "(!!x::'a::cpo. f(x)=(g(x)::'b::cpo)) ==> (%x. f(x))=(%x. g(x))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   135
  apply (rule less_anti_sym)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   136
  apply (rule less_ext)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   137
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   138
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   139
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   140
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   141
lemma cong: "[| f=g; x=y |] ==> f(x)=g(y)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   142
  by simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   143
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   144
lemma less_ap_term: "x << y ==> f(x) << f(y)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   145
  by (rule less_refl [THEN mono])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   146
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   147
lemma less_ap_thm: "f << g ==> f(x) << g(x)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   148
  by (rule less_refl [THEN [2] mono])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   149
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   150
lemma ap_term: "(x::'a::cpo) = y ==> (f(x)::'b::cpo) = f(y)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   151
  apply (rule cong [OF refl])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   152
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   153
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   154
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   155
lemma ap_thm: "f = g ==> f(x) = g(x)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   156
  apply (erule cong)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   157
  apply (rule refl)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   158
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   159
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   160
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   161
lemma UU_abs: "(%x::'a::cpo. UU) = UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   162
  apply (rule less_anti_sym)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   163
  prefer 2
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   164
  apply (rule minimal)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   165
  apply (rule less_ext)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   166
  apply (rule allI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   167
  apply (rule minimal)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   168
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   169
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   170
lemma UU_app: "UU(x) = UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   171
  by (rule UU_abs [symmetric, THEN ap_thm])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   172
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   173
lemma less_UU: "x << UU ==> x=UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   174
  apply (rule less_anti_sym)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   175
  apply assumption
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   176
  apply (rule minimal)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   177
  done
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   178
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   179
lemma tr_induct: "[| P(UU); P(TT); P(FF) |] ==> ALL b. P(b)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   180
  apply (rule allI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   181
  apply (rule mp)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   182
  apply (rule_tac [2] p = b in tr_cases)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   183
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   184
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   185
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   186
lemma Contrapos: "~ B ==> (A ==> B) ==> ~A"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   187
  by blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   188
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   189
lemma not_less_imp_not_eq1: "~ x << y \<Longrightarrow> x \<noteq> y"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   190
  apply (erule Contrapos)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   191
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   192
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   193
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   194
lemma not_less_imp_not_eq2: "~ y << x \<Longrightarrow> x \<noteq> y"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   195
  apply (erule Contrapos)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   196
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   197
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   198
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   199
lemma not_UU_eq_TT: "UU \<noteq> TT"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   200
  by (rule not_less_imp_not_eq2) (rule not_TT_less_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   201
lemma not_UU_eq_FF: "UU \<noteq> FF"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   202
  by (rule not_less_imp_not_eq2) (rule not_FF_less_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   203
lemma not_TT_eq_UU: "TT \<noteq> UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   204
  by (rule not_less_imp_not_eq1) (rule not_TT_less_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   205
lemma not_TT_eq_FF: "TT \<noteq> FF"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   206
  by (rule not_less_imp_not_eq1) (rule not_TT_less_FF)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   207
lemma not_FF_eq_UU: "FF \<noteq> UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   208
  by (rule not_less_imp_not_eq1) (rule not_FF_less_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   209
lemma not_FF_eq_TT: "FF \<noteq> TT"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   210
  by (rule not_less_imp_not_eq1) (rule not_FF_less_TT)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   211
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   212
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   213
lemma COND_cases_iff [rule_format]:
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   214
    "ALL b. P(b=>x|y) <-> (b=UU-->P(UU)) & (b=TT-->P(x)) & (b=FF-->P(y))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   215
  apply (insert not_UU_eq_TT not_UU_eq_FF not_TT_eq_UU
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   216
    not_TT_eq_FF not_FF_eq_UU not_FF_eq_TT)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   217
  apply (rule tr_induct)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   218
  apply (simplesubst COND_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   219
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   220
  apply (simplesubst COND_TT)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   221
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   222
  apply (simplesubst COND_FF)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   223
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   224
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   225
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   226
lemma COND_cases: 
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   227
  "[| x = UU --> P(UU); x = TT --> P(xa); x = FF --> P(y) |] ==> P(x => xa | y)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   228
  apply (rule COND_cases_iff [THEN iffD2])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   229
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   230
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   231
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   232
lemmas [simp] =
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   233
  minimal
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   234
  UU_app
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   235
  UU_app [THEN ap_thm]
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   236
  UU_app [THEN ap_thm, THEN ap_thm]
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   237
  not_TT_less_FF not_FF_less_TT not_TT_less_UU not_FF_less_UU not_UU_eq_TT
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   238
  not_UU_eq_FF not_TT_eq_UU not_TT_eq_FF not_FF_eq_UU not_FF_eq_TT
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   239
  COND_UU COND_TT COND_FF
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   240
  surj_pairing FST SND
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   241
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   242
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   243
subsection {* Ordered pairs and products *}
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   244
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   245
lemma expand_all_PROD: "(ALL p. P(p)) <-> (ALL x y. P(<x,y>))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   246
  apply (rule iffI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   247
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   248
  apply (rule allI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   249
  apply (rule surj_pairing [THEN subst])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   250
  apply blast
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   251
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   252
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   253
lemma PROD_less: "(p::'a*'b) << q <-> FST(p) << FST(q) & SND(p) << SND(q)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   254
  apply (rule iffI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   255
  apply (rule conjI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   256
  apply (erule less_ap_term)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   257
  apply (erule less_ap_term)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   258
  apply (erule conjE)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   259
  apply (rule surj_pairing [of p, THEN subst])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   260
  apply (rule surj_pairing [of q, THEN subst])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   261
  apply (rule mono, erule less_ap_term, assumption)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   262
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   263
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   264
lemma PROD_eq: "p=q <-> FST(p)=FST(q) & SND(p)=SND(q)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   265
  apply (rule iffI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   266
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   267
  apply (unfold eq_def)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   268
  apply (simp add: PROD_less)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   269
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   270
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   271
lemma PAIR_less [simp]: "<a,b> << <c,d> <-> a<<c & b<<d"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   272
  by (simp add: PROD_less)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   273
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   274
lemma PAIR_eq [simp]: "<a,b> = <c,d> <-> a=c & b=d"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   275
  by (simp add: PROD_eq)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   276
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   277
lemma UU_is_UU_UU [simp]: "<UU,UU> = UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   278
  by (rule less_UU) (simp add: PROD_less)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   279
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   280
lemma FST_STRICT [simp]: "FST(UU) = UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   281
  apply (rule subst [OF UU_is_UU_UU])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   282
  apply (simp del: UU_is_UU_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   283
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   284
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   285
lemma SND_STRICT [simp]: "SND(UU) = UU"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   286
  apply (rule subst [OF UU_is_UU_UU])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   287
  apply (simp del: UU_is_UU_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   288
  done
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   289
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   290
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   291
subsection {* Fixedpoint theory *}
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 3837
diff changeset
   292
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   293
lemma adm_eq: "adm(%x. t(x)=(u(x)::'a::cpo))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   294
  apply (unfold eq_def)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   295
  apply (rule adm_conj adm_less)+
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   296
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   297
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   298
lemma adm_not_not: "adm(P) ==> adm(%x.~~P(x))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   299
  by simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   300
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   301
lemma not_eq_TT: "ALL p. ~p=TT <-> (p=FF | p=UU)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   302
  and not_eq_FF: "ALL p. ~p=FF <-> (p=TT | p=UU)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   303
  and not_eq_UU: "ALL p. ~p=UU <-> (p=TT | p=FF)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   304
  by (rule tr_induct, simp_all)+
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   305
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   306
lemma adm_not_eq_tr: "ALL p::tr. adm(%x. ~t(x)=p)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   307
  apply (rule tr_induct)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   308
  apply (simp_all add: not_eq_TT not_eq_FF not_eq_UU)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   309
  apply (rule adm_disj adm_eq)+
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   310
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   311
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   312
lemmas adm_lemmas =
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   313
  adm_not_free adm_eq adm_less adm_not_less
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   314
  adm_not_eq_tr adm_conj adm_disj adm_imp adm_all
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   315
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   316
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   317
ML {*
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 22810
diff changeset
   318
  fun induct_tac ctxt v i =
27239
f2f42f9fa09d pervasive RuleInsts;
wenzelm
parents: 27208
diff changeset
   319
    res_inst_tac ctxt [(("f", 0), v)] @{thm induct} i THEN
22810
a8455ca995d6 eliminated unnamed infixes;
wenzelm
parents: 19758
diff changeset
   320
    REPEAT (resolve_tac @{thms adm_lemmas} i)
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   321
*}
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   322
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   323
lemma least_FIX: "f(p) = p ==> FIX(f) << p"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 22810
diff changeset
   324
  apply (tactic {* induct_tac @{context} "f" 1 *})
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   325
  apply (rule minimal)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   326
  apply (intro strip)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   327
  apply (erule subst)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   328
  apply (erule less_ap_term)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   329
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   330
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   331
lemma lfp_is_FIX:
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   332
  assumes 1: "f(p) = p"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   333
    and 2: "ALL q. f(q)=q --> p << q"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   334
  shows "p = FIX(f)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   335
  apply (rule less_anti_sym)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   336
  apply (rule 2 [THEN spec, THEN mp])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   337
  apply (rule FIX_eq)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   338
  apply (rule least_FIX)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   339
  apply (rule 1)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   340
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   341
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   342
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   343
lemma FIX_pair: "<FIX(f),FIX(g)> = FIX(%p.<f(FST(p)),g(SND(p))>)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   344
  apply (rule lfp_is_FIX)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   345
  apply (simp add: FIX_eq [of f] FIX_eq [of g])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   346
  apply (intro strip)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   347
  apply (simp add: PROD_less)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   348
  apply (rule conjI)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   349
  apply (rule least_FIX)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   350
  apply (erule subst, rule FST [symmetric])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   351
  apply (rule least_FIX)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   352
  apply (erule subst, rule SND [symmetric])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   353
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   354
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   355
lemma FIX1: "FIX(f) = FST(FIX(%p. <f(FST(p)),g(SND(p))>))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   356
  by (rule FIX_pair [unfolded PROD_eq FST SND, THEN conjunct1])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   357
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   358
lemma FIX2: "FIX(g) = SND(FIX(%p. <f(FST(p)),g(SND(p))>))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   359
  by (rule FIX_pair [unfolded PROD_eq FST SND, THEN conjunct2])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   360
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   361
lemma induct2:
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   362
  assumes 1: "adm(%p. P(FST(p),SND(p)))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   363
    and 2: "P(UU::'a,UU::'b)"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   364
    and 3: "ALL x y. P(x,y) --> P(f(x),g(y))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   365
  shows "P(FIX(f),FIX(g))"
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   366
  apply (rule FIX1 [THEN ssubst, of _ f g])
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   367
  apply (rule FIX2 [THEN ssubst, of _ f g])
19758
wenzelm
parents: 19757
diff changeset
   368
  apply (rule induct [where ?f = "%x. <f(FST(x)),g(SND(x))>"])
wenzelm
parents: 19757
diff changeset
   369
  apply (rule 1)
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   370
  apply simp
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   371
  apply (rule 2)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   372
  apply (simp add: expand_all_PROD)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   373
  apply (rule 3)
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   374
  done
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   375
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   376
ML {*
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 22810
diff changeset
   377
fun induct2_tac ctxt (f, g) i =
27239
f2f42f9fa09d pervasive RuleInsts;
wenzelm
parents: 27208
diff changeset
   378
  res_inst_tac ctxt [(("f", 0), f), (("g", 0), g)] @{thm induct2} i THEN
22810
a8455ca995d6 eliminated unnamed infixes;
wenzelm
parents: 19758
diff changeset
   379
  REPEAT(resolve_tac @{thms adm_lemmas} i)
19757
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   380
*}
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   381
4a2a71c31968 removed obsolete ML files;
wenzelm
parents: 17249
diff changeset
   382
end