src/ZF/ex/Limit.thy
author wenzelm
Thu, 22 Nov 2007 14:51:34 +0100
changeset 25456 6f79698f294d
parent 24893 b8ef7afe3a6b
child 32380 f3fed9cc423f
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/ex/Limit
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     3
    Author:     Sten Agerholm
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     4
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     5
    A formalization of the inverse limit construction of domain theory.
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     6
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     7
    The following paper comments on the formalization:
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     8
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
     9
    "A Comparison of HOL-ST and Isabelle/ZF" by Sten Agerholm
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    10
    In Proceedings of the First Isabelle Users Workshop, Technical 
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    11
    Report No. 379, University of Cambridge Computer Laboratory, 1995.
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    12
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    13
    This is a condensed version of:
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    14
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    15
    "A Comparison of HOL-ST and Isabelle/ZF" by Sten Agerholm
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    16
    Technical Report No. 369, University of Cambridge Computer 
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    17
    Laboratory, 1995.
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    18
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    19
(Proofs converted to Isar and tidied up considerably by lcp)
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    20
*)
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    21
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15481
diff changeset
    22
theory Limit  imports  Main begin
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    23
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    24
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    25
  rel :: "[i,i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    26
    "rel(D,x,y) == <x,y>:snd(D)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    27
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    28
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    29
  set :: "i=>i"  where
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    30
    "set(D) == fst(D)"
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    31
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    32
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    33
  po  :: "i=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    34
    "po(D) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    35
     (\<forall>x \<in> set(D). rel(D,x,x)) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    36
     (\<forall>x \<in> set(D). \<forall>y \<in> set(D). \<forall>z \<in> set(D).
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    37
       rel(D,x,y) --> rel(D,y,z) --> rel(D,x,z)) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    38
     (\<forall>x \<in> set(D). \<forall>y \<in> set(D). rel(D,x,y) --> rel(D,y,x) --> x = y)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    39
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    40
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    41
  chain :: "[i,i]=>o"  where
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    42
    (* Chains are object level functions nat->set(D) *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    43
    "chain(D,X) == X \<in> nat->set(D) & (\<forall>n \<in> nat. rel(D,X`n,X`(succ(n))))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    44
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    45
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    46
  isub :: "[i,i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    47
    "isub(D,X,x) == x \<in> set(D) & (\<forall>n \<in> nat. rel(D,X`n,x))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    48
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    49
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    50
  islub :: "[i,i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    51
    "islub(D,X,x) == isub(D,X,x) & (\<forall>y. isub(D,X,y) --> rel(D,x,y))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    52
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    53
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    54
  lub :: "[i,i]=>i"  where
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    55
    "lub(D,X) == THE x. islub(D,X,x)"
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    56
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    57
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    58
  cpo :: "i=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    59
    "cpo(D) == po(D) & (\<forall>X. chain(D,X) --> (\<exists>x. islub(D,X,x)))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    60
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    61
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    62
  pcpo :: "i=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    63
    "pcpo(D) == cpo(D) & (\<exists>x \<in> set(D). \<forall>y \<in> set(D). rel(D,x,y))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    64
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    65
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    66
  bot :: "i=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    67
    "bot(D) == THE x. x \<in> set(D) & (\<forall>y \<in> set(D). rel(D,x,y))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    68
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    69
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    70
  mono :: "[i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    71
    "mono(D,E) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    72
     {f \<in> set(D)->set(E).
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    73
      \<forall>x \<in> set(D). \<forall>y \<in> set(D). rel(D,x,y) --> rel(E,f`x,f`y)}"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    74
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    75
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    76
  cont :: "[i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    77
    "cont(D,E) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    78
     {f \<in> mono(D,E).
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    79
      \<forall>X. chain(D,X) --> f`(lub(D,X)) = lub(E,\<lambda>n \<in> nat. f`(X`n))}"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    80
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    81
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    82
  cf :: "[i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    83
    "cf(D,E) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    84
     <cont(D,E),
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    85
      {y \<in> cont(D,E)*cont(D,E). \<forall>x \<in> set(D). rel(E,(fst(y))`x,(snd(y))`x)}>"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    86
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    87
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    88
  suffix :: "[i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    89
    "suffix(X,n) == \<lambda>m \<in> nat. X`(n #+ m)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    90
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    91
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    92
  subchain :: "[i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    93
    "subchain(X,Y) == \<forall>m \<in> nat. \<exists>n \<in> nat. X`m = Y`(m #+ n)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    94
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    95
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    96
  dominate :: "[i,i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
    97
    "dominate(D,X,Y) == \<forall>m \<in> nat. \<exists>n \<in> nat. rel(D,X`m,Y`n)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
    98
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    99
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   100
  matrix :: "[i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   101
    "matrix(D,M) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   102
     M \<in> nat -> (nat -> set(D)) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   103
     (\<forall>n \<in> nat. \<forall>m \<in> nat. rel(D,M`n`m,M`succ(n)`m)) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   104
     (\<forall>n \<in> nat. \<forall>m \<in> nat. rel(D,M`n`m,M`n`succ(m))) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   105
     (\<forall>n \<in> nat. \<forall>m \<in> nat. rel(D,M`n`m,M`succ(n)`succ(m)))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   106
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   107
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   108
  projpair  :: "[i,i,i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   109
    "projpair(D,E,e,p) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   110
     e \<in> cont(D,E) & p \<in> cont(E,D) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   111
     p O e = id(set(D)) & rel(cf(E,E),e O p,id(set(E)))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   112
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   113
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   114
  emb       :: "[i,i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   115
    "emb(D,E,e) == \<exists>p. projpair(D,E,e,p)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   116
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   117
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   118
  Rp        :: "[i,i,i]=>i"  where
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   119
    "Rp(D,E,e) == THE p. projpair(D,E,e,p)"
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   120
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   121
definition
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   122
  (* Twice, constructions on cpos are more difficult. *)
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   123
  iprod     :: "i=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   124
    "iprod(DD) ==
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
   125
     <(\<Pi> n \<in> nat. set(DD`n)),
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
   126
      {x:(\<Pi> n \<in> nat. set(DD`n))*(\<Pi> n \<in> nat. set(DD`n)).
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   127
       \<forall>n \<in> nat. rel(DD`n,fst(x)`n,snd(x)`n)}>"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   128
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   129
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   130
  mkcpo     :: "[i,i=>o]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   131
    (* Cannot use rel(D), is meta fun, need two more args *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   132
    "mkcpo(D,P) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   133
     <{x \<in> set(D). P(x)},{x \<in> set(D)*set(D). rel(D,fst(x),snd(x))}>"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   134
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   135
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   136
  subcpo    :: "[i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   137
    "subcpo(D,E) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   138
     set(D) \<subseteq> set(E) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   139
     (\<forall>x \<in> set(D). \<forall>y \<in> set(D). rel(D,x,y) <-> rel(E,x,y)) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   140
     (\<forall>X. chain(D,X) --> lub(E,X):set(D))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   141
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   142
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   143
  subpcpo   :: "[i,i]=>o"  where
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   144
    "subpcpo(D,E) == subcpo(D,E) & bot(E):set(D)"
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   145
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   146
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   147
  emb_chain :: "[i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   148
    "emb_chain(DD,ee) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   149
     (\<forall>n \<in> nat. cpo(DD`n)) & (\<forall>n \<in> nat. emb(DD`n,DD`succ(n),ee`n))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   150
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   151
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   152
  Dinf      :: "[i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   153
    "Dinf(DD,ee) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   154
     mkcpo(iprod(DD))
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   155
     (%x. \<forall>n \<in> nat. Rp(DD`n,DD`succ(n),ee`n)`(x`succ(n)) = x`n)"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   156
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   157
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   158
  e_less    :: "[i,i,i,i]=>i"  where
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   159
  (* Valid for m le n only. *)
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   160
    "e_less(DD,ee,m,n) == rec(n#-m,id(set(DD`m)),%x y. ee`(m#+x) O y)"
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   161
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   162
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   163
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   164
  e_gr      :: "[i,i,i,i]=>i"  where
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   165
  (* Valid for n le m only. *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   166
    "e_gr(DD,ee,m,n) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   167
     rec(m#-n,id(set(DD`n)),
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   168
         %x y. y O Rp(DD`(n#+x),DD`(succ(n#+x)),ee`(n#+x)))"
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   169
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   170
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   171
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   172
  eps       :: "[i,i,i,i]=>i"  where
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   173
    "eps(DD,ee,m,n) == if(m le n,e_less(DD,ee,m,n),e_gr(DD,ee,m,n))"
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
   174
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   175
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   176
  rho_emb   :: "[i,i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   177
    "rho_emb(DD,ee,n) == \<lambda>x \<in> set(DD`n). \<lambda>m \<in> nat. eps(DD,ee,n,m)`x"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   178
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   179
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   180
  rho_proj  :: "[i,i,i]=>i"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   181
    "rho_proj(DD,ee,n) == \<lambda>x \<in> set(Dinf(DD,ee)). x`n"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   182
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   183
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   184
  commute   :: "[i,i,i,i=>i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   185
    "commute(DD,ee,E,r) ==
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   186
     (\<forall>n \<in> nat. emb(DD`n,E,r(n))) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   187
     (\<forall>m \<in> nat. \<forall>n \<in> nat. m le n --> r(n) O eps(DD,ee,m,n) = r(m))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   188
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   189
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
   190
  mediating :: "[i,i,i=>i,i=>i,i]=>o"  where
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   191
    "mediating(E,G,r,f,t) == emb(E,G,t) & (\<forall>n \<in> nat. f(n) = t O r(n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   192
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   193
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   194
lemmas nat_linear_le = Ord_linear_le [OF nat_into_Ord nat_into_Ord]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   195
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   196
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   197
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   198
(* Basic results.                                                       *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   199
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   200
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   201
lemma set_I: "x \<in> fst(D) ==> x \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   202
by (simp add: set_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   203
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   204
lemma rel_I: "<x,y>:snd(D) ==> rel(D,x,y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   205
by (simp add: rel_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   206
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   207
lemma rel_E: "rel(D,x,y) ==> <x,y>:snd(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   208
by (simp add: rel_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   209
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   210
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   211
(* I/E/D rules for po and cpo.                                          *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   212
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   213
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   214
lemma po_refl: "[|po(D); x \<in> set(D)|] ==> rel(D,x,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   215
by (unfold po_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   216
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   217
lemma po_trans: "[|po(D); rel(D,x,y); rel(D,y,z); x \<in> set(D);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   218
                  y \<in> set(D); z \<in> set(D)|] ==> rel(D,x,z)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   219
by (unfold po_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   220
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   221
lemma po_antisym:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   222
    "[|po(D); rel(D,x,y); rel(D,y,x); x \<in> set(D); y \<in> set(D)|] ==> x = y"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   223
by (unfold po_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   224
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   225
lemma poI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   226
  "[| !!x. x \<in> set(D) ==> rel(D,x,x);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   227
      !!x y z. [| rel(D,x,y); rel(D,y,z); x \<in> set(D); y \<in> set(D); z \<in> set(D)|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   228
               ==> rel(D,x,z);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   229
      !!x y. [| rel(D,x,y); rel(D,y,x); x \<in> set(D); y \<in> set(D)|] ==> x=y |] 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   230
   ==> po(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   231
by (unfold po_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   232
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   233
lemma cpoI: "[| po(D); !!X. chain(D,X) ==> islub(D,X,x(D,X))|] ==> cpo(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   234
by (simp add: cpo_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   235
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   236
lemma cpo_po: "cpo(D) ==> po(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   237
by (simp add: cpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   238
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   239
lemma cpo_refl [simp,intro!,TC]: "[|cpo(D); x \<in> set(D)|] ==> rel(D,x,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   240
by (blast intro: po_refl cpo_po)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   241
13128
paulson
parents: 13085
diff changeset
   242
lemma cpo_trans:
paulson
parents: 13085
diff changeset
   243
     "[|cpo(D); rel(D,x,y); rel(D,y,z); x \<in> set(D);
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   244
        y \<in> set(D); z \<in> set(D)|] ==> rel(D,x,z)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   245
by (blast intro: cpo_po po_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   246
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   247
lemma cpo_antisym:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   248
     "[|cpo(D); rel(D,x,y); rel(D,y,x); x \<in> set(D); y \<in> set(D)|] ==> x = y"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   249
by (blast intro: cpo_po po_antisym)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   250
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   251
lemma cpo_islub: "[|cpo(D); chain(D,X);  !!x. islub(D,X,x) ==> R|] ==> R"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   252
by (simp add: cpo_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   253
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   254
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   255
(* Theorems about isub and islub.                                       *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   256
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   257
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   258
lemma islub_isub: "islub(D,X,x) ==> isub(D,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   259
by (simp add: islub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   260
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   261
lemma islub_in: "islub(D,X,x) ==> x \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   262
by (simp add: islub_def isub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   263
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   264
lemma islub_ub: "[|islub(D,X,x); n \<in> nat|] ==> rel(D,X`n,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   265
by (simp add: islub_def isub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   266
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   267
lemma islub_least: "[|islub(D,X,x); isub(D,X,y)|] ==> rel(D,x,y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   268
by (simp add: islub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   269
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   270
lemma islubI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   271
    "[|isub(D,X,x); !!y. isub(D,X,y) ==> rel(D,x,y)|] ==> islub(D,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   272
by (simp add: islub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   273
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   274
lemma isubI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   275
    "[|x \<in> set(D);  !!n. n \<in> nat ==> rel(D,X`n,x)|] ==> isub(D,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   276
by (simp add: isub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   277
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   278
lemma isubE:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   279
    "[|isub(D,X,x); [|x \<in> set(D);  !!n. n \<in> nat==>rel(D,X`n,x)|] ==> P
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   280
     |] ==> P"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   281
by (simp add: isub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   282
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   283
lemma isubD1: "isub(D,X,x) ==> x \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   284
by (simp add: isub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   285
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   286
lemma isubD2: "[|isub(D,X,x); n \<in> nat|]==>rel(D,X`n,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   287
by (simp add: isub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   288
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   289
lemma islub_unique: "[|islub(D,X,x); islub(D,X,y); cpo(D)|] ==> x = y"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   290
by (blast intro: cpo_antisym islub_least islub_isub islub_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   291
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   292
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   293
(* lub gives the least upper bound of chains.                           *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   294
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   295
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   296
lemma cpo_lub: "[|chain(D,X); cpo(D)|] ==> islub(D,X,lub(D,X))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   297
apply (simp add: lub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   298
apply (best elim: cpo_islub intro: theI islub_unique)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   299
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   300
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   301
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   302
(* Theorems about chains.                                               *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   303
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   304
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   305
lemma chainI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   306
  "[|X \<in> nat->set(D);  !!n. n \<in> nat ==> rel(D,X`n,X`succ(n))|] ==> chain(D,X)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   307
by (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   308
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   309
lemma chain_fun: "chain(D,X) ==> X \<in> nat -> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   310
by (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   311
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   312
lemma chain_in [simp,TC]: "[|chain(D,X); n \<in> nat|] ==> X`n \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   313
apply (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   314
apply (blast dest: apply_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   315
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   316
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   317
lemma chain_rel [simp,TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   318
     "[|chain(D,X); n \<in> nat|] ==> rel(D, X ` n, X ` succ(n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   319
by (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   320
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   321
lemma chain_rel_gen_add:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   322
     "[|chain(D,X); cpo(D); n \<in> nat; m \<in> nat|] ==> rel(D,X`n,(X`(m #+ n)))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   323
apply (induct_tac m)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   324
apply (auto intro: cpo_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   325
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   326
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   327
lemma chain_rel_gen:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   328
    "[|n le m; chain(D,X); cpo(D); m \<in> nat|] ==> rel(D,X`n,X`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   329
apply (frule lt_nat_in_nat, erule nat_succI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   330
apply (erule rev_mp) (*prepare the induction*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   331
apply (induct_tac m)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   332
apply (auto intro: cpo_trans simp add: le_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   333
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   334
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   335
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   336
(* Theorems about pcpos and bottom.                                     *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   337
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   338
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   339
lemma pcpoI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   340
    "[|!!y. y \<in> set(D)==>rel(D,x,y); x \<in> set(D); cpo(D)|]==>pcpo(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   341
by (simp add: pcpo_def, auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   342
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   343
lemma pcpo_cpo [TC]: "pcpo(D) ==> cpo(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   344
by (simp add: pcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   345
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   346
lemma pcpo_bot_ex1:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   347
    "pcpo(D) ==> \<exists>! x. x \<in> set(D) & (\<forall>y \<in> set(D). rel(D,x,y))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   348
apply (simp add: pcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   349
apply (blast intro: cpo_antisym)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   350
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   351
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   352
lemma bot_least [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   353
    "[| pcpo(D); y \<in> set(D)|] ==> rel(D,bot(D),y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   354
apply (simp add: bot_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   355
apply (best intro: pcpo_bot_ex1 [THEN theI2])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   356
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   357
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   358
lemma bot_in [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   359
    "pcpo(D) ==> bot(D):set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   360
apply (simp add: bot_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   361
apply (best intro: pcpo_bot_ex1 [THEN theI2])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   362
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   363
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   364
lemma bot_unique:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   365
    "[| pcpo(D); x \<in> set(D); !!y. y \<in> set(D) ==> rel(D,x,y)|] ==> x = bot(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   366
by (blast intro: cpo_antisym pcpo_cpo bot_in bot_least)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   367
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   368
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   369
(* Constant chains and lubs and cpos.                                   *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   370
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   371
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   372
lemma chain_const: "[|x \<in> set(D); cpo(D)|] ==> chain(D,(\<lambda>n \<in> nat. x))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   373
by (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   374
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   375
lemma islub_const:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   376
   "[|x \<in> set(D); cpo(D)|] ==> islub(D,(\<lambda>n \<in> nat. x),x)"
13128
paulson
parents: 13085
diff changeset
   377
by (simp add: islub_def isub_def, blast)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   378
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   379
lemma lub_const: "[|x \<in> set(D); cpo(D)|] ==> lub(D,\<lambda>n \<in> nat. x) = x"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   380
by (blast intro: islub_unique cpo_lub chain_const islub_const)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   381
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   382
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   383
(* Taking the suffix of chains has no effect on ub's.                   *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   384
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   385
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   386
lemma isub_suffix:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   387
    "[| chain(D,X); cpo(D) |] ==> isub(D,suffix(X,n),x) <-> isub(D,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   388
apply (simp add: isub_def suffix_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   389
apply (drule_tac x = na in bspec)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   390
apply (auto intro: cpo_trans chain_rel_gen_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   391
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   392
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   393
lemma islub_suffix:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   394
  "[|chain(D,X); cpo(D)|] ==> islub(D,suffix(X,n),x) <-> islub(D,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   395
by (simp add: islub_def isub_suffix)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   396
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   397
lemma lub_suffix:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   398
    "[|chain(D,X); cpo(D)|] ==> lub(D,suffix(X,n)) = lub(D,X)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   399
by (simp add: lub_def islub_suffix)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   400
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   401
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   402
(* Dominate and subchain.                                               *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   403
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   404
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   405
lemma dominateI:
13128
paulson
parents: 13085
diff changeset
   406
  "[| !!m. m \<in> nat ==> n(m):nat; !!m. m \<in> nat ==> rel(D,X`m,Y`n(m))|] 
paulson
parents: 13085
diff changeset
   407
   ==> dominate(D,X,Y)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   408
by (simp add: dominate_def, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   409
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   410
lemma dominate_isub:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   411
  "[|dominate(D,X,Y); isub(D,Y,x); cpo(D);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   412
     X \<in> nat->set(D); Y \<in> nat->set(D)|] ==> isub(D,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   413
apply (simp add: isub_def dominate_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   414
apply (blast intro: cpo_trans intro!: apply_funtype)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   415
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   416
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   417
lemma dominate_islub:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   418
  "[|dominate(D,X,Y); islub(D,X,x); islub(D,Y,y); cpo(D);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   419
     X \<in> nat->set(D); Y \<in> nat->set(D)|] ==> rel(D,x,y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   420
apply (simp add: islub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   421
apply (blast intro: dominate_isub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   422
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   423
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   424
lemma subchain_isub:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   425
     "[|subchain(Y,X); isub(D,X,x)|] ==> isub(D,Y,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   426
by (simp add: isub_def subchain_def, force)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   427
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   428
lemma dominate_islub_eq:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   429
     "[|dominate(D,X,Y); subchain(Y,X); islub(D,X,x); islub(D,Y,y); cpo(D);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   430
        X \<in> nat->set(D); Y \<in> nat->set(D)|] ==> x = y"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   431
by (blast intro: cpo_antisym dominate_islub islub_least subchain_isub 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   432
                 islub_isub islub_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   433
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   434
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   435
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   436
(* Matrix.                                                              *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   437
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   438
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   439
lemma matrix_fun: "matrix(D,M) ==> M \<in> nat -> (nat -> set(D))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   440
by (simp add: matrix_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   441
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   442
lemma matrix_in_fun: "[|matrix(D,M); n \<in> nat|] ==> M`n \<in> nat -> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   443
by (blast intro: apply_funtype matrix_fun)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   444
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   445
lemma matrix_in: "[|matrix(D,M); n \<in> nat; m \<in> nat|] ==> M`n`m \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   446
by (blast intro: apply_funtype matrix_in_fun)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   447
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   448
lemma matrix_rel_1_0:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   449
    "[|matrix(D,M); n \<in> nat; m \<in> nat|] ==> rel(D,M`n`m,M`succ(n)`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   450
by (simp add: matrix_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   451
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   452
lemma matrix_rel_0_1:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   453
    "[|matrix(D,M); n \<in> nat; m \<in> nat|] ==> rel(D,M`n`m,M`n`succ(m))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   454
by (simp add: matrix_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   455
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   456
lemma matrix_rel_1_1:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   457
    "[|matrix(D,M); n \<in> nat; m \<in> nat|] ==> rel(D,M`n`m,M`succ(n)`succ(m))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   458
by (simp add: matrix_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   459
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   460
lemma fun_swap: "f \<in> X->Y->Z ==> (\<lambda>y \<in> Y. \<lambda>x \<in> X. f`x`y):Y->X->Z"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   461
by (blast intro: lam_type apply_funtype)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   462
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   463
lemma matrix_sym_axis:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   464
    "matrix(D,M) ==> matrix(D,\<lambda>m \<in> nat. \<lambda>n \<in> nat. M`n`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   465
by (simp add: matrix_def fun_swap)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   466
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   467
lemma matrix_chain_diag:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   468
    "matrix(D,M) ==> chain(D,\<lambda>n \<in> nat. M`n`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   469
apply (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   470
apply (auto intro: lam_type matrix_in matrix_rel_1_1)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   471
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   472
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   473
lemma matrix_chain_left:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   474
    "[|matrix(D,M); n \<in> nat|] ==> chain(D,M`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   475
apply (unfold chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   476
apply (auto intro: matrix_fun [THEN apply_type] matrix_in matrix_rel_0_1)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   477
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   478
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   479
lemma matrix_chain_right:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   480
    "[|matrix(D,M); m \<in> nat|] ==> chain(D,\<lambda>n \<in> nat. M`n`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   481
apply (simp add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   482
apply (auto intro: lam_type matrix_in matrix_rel_1_0)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   483
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   484
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   485
lemma matrix_chainI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   486
  assumes xprem: "!!x. x \<in> nat==>chain(D,M`x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   487
      and yprem: "!!y. y \<in> nat==>chain(D,\<lambda>x \<in> nat. M`x`y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   488
      and Mfun:  "M \<in> nat->nat->set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   489
      and cpoD:  "cpo(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   490
  shows "matrix(D,M)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   491
apply (simp add: matrix_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   492
apply (rule Mfun)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   493
apply (cut_tac y1 = m and n = n in yprem [THEN chain_rel], simp+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   494
apply (simp add: chain_rel xprem)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   495
apply (rule cpo_trans [OF cpoD])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   496
apply (cut_tac y1 = m and n = n in yprem [THEN chain_rel], simp+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   497
apply (simp_all add: chain_fun [THEN apply_type] xprem)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   498
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   499
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   500
lemma lemma_rel_rel:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   501
     "[|m \<in> nat; rel(D, (\<lambda>n \<in> nat. M`n`n)`m, y)|] ==> rel(D,M`m`m, y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   502
by simp
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   503
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   504
lemma lemma2:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   505
     "[|x \<in> nat; m \<in> nat; rel(D,(\<lambda>n \<in> nat. M`n`m1)`x,(\<lambda>n \<in> nat. M`n`m1)`m)|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   506
      ==> rel(D,M`x`m1,M`m`m1)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   507
by simp
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   508
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   509
lemma isub_lemma:
13128
paulson
parents: 13085
diff changeset
   510
    "[|isub(D, \<lambda>n \<in> nat. M`n`n, y); matrix(D,M); cpo(D)|] 
paulson
parents: 13085
diff changeset
   511
     ==> isub(D, \<lambda>n \<in> nat. lub(D,\<lambda>m \<in> nat. M`n`m), y)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   512
apply (unfold isub_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   513
apply (simp (no_asm_simp))
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   514
apply (frule matrix_fun [THEN apply_type], assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   515
apply (simp (no_asm_simp))
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   516
apply (rule matrix_chain_left [THEN cpo_lub, THEN islub_least], assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   517
apply (unfold isub_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   518
(*???VERY indirect proof: beta-redexes could be simplified now!*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   519
apply (rename_tac k n)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   520
apply (case_tac "k le n")
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   521
apply (rule cpo_trans, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   522
apply (rule lemma2)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   523
apply (rule_tac [4] lemma_rel_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   524
prefer 5 apply blast
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   525
apply (assumption | rule chain_rel_gen matrix_chain_right matrix_in isubD1)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   526
txt{*opposite case*}
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   527
apply (rule cpo_trans, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   528
apply (rule not_le_iff_lt [THEN iffD1, THEN leI, THEN chain_rel_gen])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   529
prefer 3 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   530
apply (assumption | rule nat_into_Ord matrix_chain_left)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   531
apply (rule lemma_rel_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   532
apply (simp_all add: matrix_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   533
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   534
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   535
lemma matrix_chain_lub:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   536
    "[|matrix(D,M); cpo(D)|] ==> chain(D,\<lambda>n \<in> nat. lub(D,\<lambda>m \<in> nat. M`n`m))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   537
apply (simp add: chain_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   538
apply (rule lam_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   539
apply (rule islub_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   540
apply (rule cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   541
prefer 2 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   542
apply (rule chainI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   543
apply (rule lam_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   544
apply (simp_all add: matrix_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   545
apply (rule matrix_rel_0_1, assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   546
apply (simp add: matrix_chain_left [THEN chain_fun, THEN eta])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   547
apply (rule dominate_islub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   548
apply (rule_tac [3] cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   549
apply (rule_tac [2] cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   550
apply (simp add: dominate_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   551
apply (blast intro: matrix_rel_1_0)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   552
apply (simp_all add: matrix_chain_left nat_succI chain_fun)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   553
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   554
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   555
lemma isub_eq:
13128
paulson
parents: 13085
diff changeset
   556
    "[|matrix(D,M); cpo(D)|] 
paulson
parents: 13085
diff changeset
   557
     ==> isub(D,(\<lambda>n \<in> nat. lub(D,\<lambda>m \<in> nat. M`n`m)),y) <->
paulson
parents: 13085
diff changeset
   558
         isub(D,(\<lambda>n \<in> nat. M`n`n),y)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   559
apply (rule iffI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   560
apply (rule dominate_isub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   561
prefer 2 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   562
apply (simp add: dominate_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   563
apply (rule ballI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   564
apply (rule bexI, auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   565
apply (simp add: matrix_chain_left [THEN chain_fun, THEN eta])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   566
apply (rule islub_ub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   567
apply (rule cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   568
apply (simp_all add: matrix_chain_left matrix_chain_diag chain_fun 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   569
                     matrix_chain_lub isub_lemma)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   570
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   571
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
   572
lemma lub_matrix_diag_aux1:
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   573
    "lub(D,(\<lambda>n \<in> nat. lub(D,\<lambda>m \<in> nat. M`n`m))) =
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   574
     (THE x. islub(D, (\<lambda>n \<in> nat. lub(D,\<lambda>m \<in> nat. M`n`m)), x))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   575
by (simp add: lub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   576
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
   577
lemma lub_matrix_diag_aux2:
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   578
    "lub(D,(\<lambda>n \<in> nat. M`n`n)) =
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   579
     (THE x. islub(D, (\<lambda>n \<in> nat. M`n`n), x))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   580
by (simp add: lub_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   581
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   582
lemma lub_matrix_diag:
13128
paulson
parents: 13085
diff changeset
   583
    "[|matrix(D,M); cpo(D)|] 
paulson
parents: 13085
diff changeset
   584
     ==> lub(D,(\<lambda>n \<in> nat. lub(D,\<lambda>m \<in> nat. M`n`m))) =
paulson
parents: 13085
diff changeset
   585
         lub(D,(\<lambda>n \<in> nat. M`n`n))"
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
   586
apply (simp (no_asm) add: lub_matrix_diag_aux1 lub_matrix_diag_aux2)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   587
apply (simp add: islub_def isub_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   588
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   589
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   590
lemma lub_matrix_diag_sym:
13128
paulson
parents: 13085
diff changeset
   591
    "[|matrix(D,M); cpo(D)|] 
paulson
parents: 13085
diff changeset
   592
     ==> lub(D,(\<lambda>m \<in> nat. lub(D,\<lambda>n \<in> nat. M`n`m))) =
paulson
parents: 13085
diff changeset
   593
         lub(D,(\<lambda>n \<in> nat. M`n`n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   594
by (drule matrix_sym_axis [THEN lub_matrix_diag], auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   595
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   596
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   597
(* I/E/D rules for mono and cont.                                       *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   598
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   599
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   600
lemma monoI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   601
    "[|f \<in> set(D)->set(E);
13128
paulson
parents: 13085
diff changeset
   602
       !!x y. [|rel(D,x,y); x \<in> set(D); y \<in> set(D)|] ==> rel(E,f`x,f`y)|] 
paulson
parents: 13085
diff changeset
   603
     ==> f \<in> mono(D,E)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   604
by (simp add: mono_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   605
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   606
lemma mono_fun: "f \<in> mono(D,E) ==> f \<in> set(D)->set(E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   607
by (simp add: mono_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   608
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   609
lemma mono_map: "[|f \<in> mono(D,E); x \<in> set(D)|] ==> f`x \<in> set(E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   610
by (blast intro!: mono_fun [THEN apply_type])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   611
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   612
lemma mono_mono:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   613
    "[|f \<in> mono(D,E); rel(D,x,y); x \<in> set(D); y \<in> set(D)|] ==> rel(E,f`x,f`y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   614
by (simp add: mono_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   615
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   616
lemma contI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   617
    "[|f \<in> set(D)->set(E);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   618
       !!x y. [|rel(D,x,y); x \<in> set(D); y \<in> set(D)|] ==> rel(E,f`x,f`y);
13128
paulson
parents: 13085
diff changeset
   619
       !!X. chain(D,X) ==> f`lub(D,X) = lub(E,\<lambda>n \<in> nat. f`(X`n))|] 
paulson
parents: 13085
diff changeset
   620
     ==> f \<in> cont(D,E)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   621
by (simp add: cont_def mono_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   622
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   623
lemma cont2mono: "f \<in> cont(D,E) ==> f \<in> mono(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   624
by (simp add: cont_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   625
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   626
lemma cont_fun [TC] : "f \<in> cont(D,E) ==> f \<in> set(D)->set(E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   627
apply (simp add: cont_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   628
apply (rule mono_fun, blast)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   629
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   630
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   631
lemma cont_map [TC]: "[|f \<in> cont(D,E); x \<in> set(D)|] ==> f`x \<in> set(E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   632
by (blast intro!: cont_fun [THEN apply_type])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   633
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   634
declare comp_fun [TC]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   635
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   636
lemma cont_mono:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   637
    "[|f \<in> cont(D,E); rel(D,x,y); x \<in> set(D); y \<in> set(D)|] ==> rel(E,f`x,f`y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   638
apply (simp add: cont_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   639
apply (blast intro!: mono_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   640
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   641
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   642
lemma cont_lub:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   643
   "[|f \<in> cont(D,E); chain(D,X)|] ==> f`(lub(D,X)) = lub(E,\<lambda>n \<in> nat. f`(X`n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   644
by (simp add: cont_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   645
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   646
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   647
(* Continuity and chains.                                               *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   648
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   649
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   650
lemma mono_chain:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   651
     "[|f \<in> mono(D,E); chain(D,X)|] ==> chain(E,\<lambda>n \<in> nat. f`(X`n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   652
apply (simp (no_asm) add: chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   653
apply (blast intro: lam_type mono_map chain_in mono_mono chain_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   654
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   655
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   656
lemma cont_chain:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   657
     "[|f \<in> cont(D,E); chain(D,X)|] ==> chain(E,\<lambda>n \<in> nat. f`(X`n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   658
by (blast intro: mono_chain cont2mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   659
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   660
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   661
(* I/E/D rules about (set+rel) cf, the continuous function space.       *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   662
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   663
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   664
(* The following development more difficult with cpo-as-relation approach. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   665
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   666
lemma cf_cont: "f \<in> set(cf(D,E)) ==> f \<in> cont(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   667
by (simp add: set_def cf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   668
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   669
lemma cont_cf: (* Non-trivial with relation *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   670
    "f \<in> cont(D,E) ==> f \<in> set(cf(D,E))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   671
by (simp add: set_def cf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   672
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   673
(* rel_cf originally an equality. Now stated as two rules. Seemed easiest. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   674
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   675
lemma rel_cfI:
13128
paulson
parents: 13085
diff changeset
   676
    "[|!!x. x \<in> set(D) ==> rel(E,f`x,g`x); f \<in> cont(D,E); g \<in> cont(D,E)|] 
paulson
parents: 13085
diff changeset
   677
     ==> rel(cf(D,E),f,g)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   678
by (simp add: rel_I cf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   679
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   680
lemma rel_cf: "[|rel(cf(D,E),f,g); x \<in> set(D)|] ==> rel(E,f`x,g`x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   681
by (simp add: rel_def cf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   682
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   683
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   684
(* Theorems about the continuous function space.                        *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   685
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   686
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   687
lemma chain_cf:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   688
    "[| chain(cf(D,E),X); x \<in> set(D)|] ==> chain(E,\<lambda>n \<in> nat. X`n`x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   689
apply (rule chainI)
13128
paulson
parents: 13085
diff changeset
   690
apply (blast intro: lam_type apply_funtype cont_fun cf_cont chain_in, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   691
apply (blast intro: rel_cf chain_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   692
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   693
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   694
lemma matrix_lemma:
13128
paulson
parents: 13085
diff changeset
   695
    "[|chain(cf(D,E),X); chain(D,Xa); cpo(D); cpo(E) |] 
paulson
parents: 13085
diff changeset
   696
     ==> matrix(E,\<lambda>x \<in> nat. \<lambda>xa \<in> nat. X`x`(Xa`xa))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   697
apply (rule matrix_chainI, auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   698
apply (rule chainI)
13128
paulson
parents: 13085
diff changeset
   699
apply (blast intro: lam_type apply_funtype cont_fun cf_cont chain_in, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   700
apply (blast intro: cont_mono nat_succI chain_rel cf_cont chain_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   701
apply (rule chainI)
13128
paulson
parents: 13085
diff changeset
   702
apply (blast intro: lam_type apply_funtype cont_fun cf_cont chain_in, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   703
apply (rule rel_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   704
apply (simp_all add: chain_in chain_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   705
apply (blast intro: lam_type apply_funtype cont_fun cf_cont chain_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   706
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   707
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   708
lemma chain_cf_lub_cont:
13128
paulson
parents: 13085
diff changeset
   709
    "[|chain(cf(D,E),X); cpo(D); cpo(E) |] 
paulson
parents: 13085
diff changeset
   710
     ==> (\<lambda>x \<in> set(D). lub(E, \<lambda>n \<in> nat. X ` n ` x)) \<in> cont(D, E)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   711
apply (rule contI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   712
apply (rule lam_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   713
apply (assumption | rule chain_cf [THEN cpo_lub, THEN islub_in])+
13128
paulson
parents: 13085
diff changeset
   714
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   715
apply (rule dominate_islub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   716
apply (erule_tac [2] chain_cf [THEN cpo_lub], simp_all)+
13128
paulson
parents: 13085
diff changeset
   717
apply (rule dominateI, assumption, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   718
apply (assumption | rule chain_in [THEN cf_cont, THEN cont_mono])+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   719
apply (assumption | rule chain_cf [THEN chain_fun])+
13128
paulson
parents: 13085
diff changeset
   720
apply (simp add: cpo_lub [THEN islub_in] 
paulson
parents: 13085
diff changeset
   721
                 chain_in [THEN cf_cont, THEN cont_lub])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   722
apply (frule matrix_lemma [THEN lub_matrix_diag], assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   723
apply (simp add: chain_in [THEN beta])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   724
apply (drule matrix_lemma [THEN lub_matrix_diag_sym], auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   725
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   726
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   727
lemma islub_cf:
13128
paulson
parents: 13085
diff changeset
   728
    "[| chain(cf(D,E),X); cpo(D); cpo(E)|] 
paulson
parents: 13085
diff changeset
   729
     ==> islub(cf(D,E), X, \<lambda>x \<in> set(D). lub(E,\<lambda>n \<in> nat. X`n`x))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   730
apply (rule islubI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   731
apply (rule isubI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   732
apply (rule chain_cf_lub_cont [THEN cont_cf], assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   733
apply (rule rel_cfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   734
apply (force dest!: chain_cf [THEN cpo_lub, THEN islub_ub])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   735
apply (blast intro: cf_cont chain_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   736
apply (blast intro: cont_cf chain_cf_lub_cont)
13128
paulson
parents: 13085
diff changeset
   737
apply (rule rel_cfI, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   738
apply (force intro: chain_cf [THEN cpo_lub, THEN islub_least]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   739
                   cf_cont [THEN cont_fun, THEN apply_type] isubI
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   740
            elim: isubD2 [THEN rel_cf] isubD1)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   741
apply (blast intro: chain_cf_lub_cont isubD1 cf_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   742
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   743
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   744
lemma cpo_cf [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   745
    "[| cpo(D); cpo(E)|] ==> cpo(cf(D,E))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   746
apply (rule poI [THEN cpoI])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   747
apply (rule rel_cfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   748
apply (assumption | rule cpo_refl cf_cont [THEN cont_fun, THEN apply_type]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   749
                         cf_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   750
apply (rule rel_cfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   751
apply (rule cpo_trans, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   752
apply (erule rel_cf, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   753
apply (rule rel_cf, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   754
apply (assumption | rule cf_cont [THEN cont_fun, THEN apply_type] cf_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   755
apply (rule fun_extension)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   756
apply (assumption | rule cf_cont [THEN cont_fun])+
13128
paulson
parents: 13085
diff changeset
   757
apply (blast intro: cpo_antisym rel_cf 
paulson
parents: 13085
diff changeset
   758
                    cf_cont [THEN cont_fun, THEN apply_type])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   759
apply (fast intro: islub_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   760
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   761
13128
paulson
parents: 13085
diff changeset
   762
lemma lub_cf:
paulson
parents: 13085
diff changeset
   763
     "[| chain(cf(D,E),X); cpo(D); cpo(E)|] 
paulson
parents: 13085
diff changeset
   764
      ==> lub(cf(D,E), X) = (\<lambda>x \<in> set(D). lub(E,\<lambda>n \<in> nat. X`n`x))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   765
by (blast intro: islub_unique cpo_lub islub_cf cpo_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   766
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   767
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   768
lemma const_cont [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   769
     "[|y \<in> set(E); cpo(D); cpo(E)|] ==> (\<lambda>x \<in> set(D).y) \<in> cont(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   770
apply (rule contI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   771
prefer 2 apply simp
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   772
apply (blast intro: lam_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   773
apply (simp add: chain_in cpo_lub [THEN islub_in] lub_const)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   774
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   775
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   776
lemma cf_least:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   777
    "[|cpo(D); pcpo(E); y \<in> cont(D,E)|]==>rel(cf(D,E),(\<lambda>x \<in> set(D).bot(E)),y)"
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13176
diff changeset
   778
apply (rule rel_cfI, simp, typecheck)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   779
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   780
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   781
lemma pcpo_cf:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   782
    "[|cpo(D); pcpo(E)|] ==> pcpo(cf(D,E))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   783
apply (rule pcpoI)
13128
paulson
parents: 13085
diff changeset
   784
apply (assumption | 
paulson
parents: 13085
diff changeset
   785
       rule cf_least bot_in const_cont [THEN cont_cf] cf_cont cpo_cf pcpo_cpo)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   786
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   787
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   788
lemma bot_cf:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   789
    "[|cpo(D); pcpo(E)|] ==> bot(cf(D,E)) = (\<lambda>x \<in> set(D).bot(E))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   790
by (blast intro: bot_unique [symmetric] pcpo_cf cf_least 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   791
                 bot_in [THEN const_cont, THEN cont_cf] cf_cont pcpo_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   792
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   793
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   794
(* Identity and composition.                                            *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   795
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   796
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   797
lemma id_cont [TC,intro!]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   798
    "cpo(D) ==> id(set(D)) \<in> cont(D,D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   799
by (simp add: id_type contI cpo_lub [THEN islub_in] chain_fun [THEN eta])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   800
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   801
lemmas comp_cont_apply =  cont_fun [THEN comp_fun_apply]
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   802
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   803
lemma comp_pres_cont [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   804
    "[| f \<in> cont(D',E); g \<in> cont(D,D'); cpo(D)|] ==> f O g \<in> cont(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   805
apply (rule contI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   806
apply (rule_tac [2] comp_cont_apply [THEN ssubst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   807
apply (rule_tac [4] comp_cont_apply [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   808
apply (rule_tac [6] cont_mono)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   809
apply (rule_tac [7] cont_mono) (* 13 subgoals *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   810
apply typecheck (* proves all but the lub case *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   811
apply (subst comp_cont_apply)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   812
apply (rule_tac [3] cont_lub [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   813
apply (rule_tac [5] cont_lub [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   814
prefer 7 apply (simp add: comp_cont_apply chain_in)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   815
apply (auto intro: cpo_lub [THEN islub_in] cont_chain)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   816
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   817
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   818
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   819
lemma comp_mono:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   820
    "[| f \<in> cont(D',E); g \<in> cont(D,D'); f':cont(D',E); g':cont(D,D');
13128
paulson
parents: 13085
diff changeset
   821
        rel(cf(D',E),f,f'); rel(cf(D,D'),g,g'); cpo(D); cpo(E) |] 
paulson
parents: 13085
diff changeset
   822
     ==> rel(cf(D,E),f O g,f' O g')"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   823
apply (rule rel_cfI) 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   824
apply (subst comp_cont_apply)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   825
apply (rule_tac [3] comp_cont_apply [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   826
apply (rule_tac [5] cpo_trans)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   827
apply (assumption | rule rel_cf cont_mono cont_map comp_pres_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   828
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   829
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   830
lemma chain_cf_comp:
13128
paulson
parents: 13085
diff changeset
   831
    "[| chain(cf(D',E),X); chain(cf(D,D'),Y); cpo(D); cpo(E)|] 
paulson
parents: 13085
diff changeset
   832
     ==> chain(cf(D,E),\<lambda>n \<in> nat. X`n O Y`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   833
apply (rule chainI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   834
defer 1
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   835
apply simp
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   836
apply (rule rel_cfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   837
apply (rule comp_cont_apply [THEN ssubst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   838
apply (rule_tac [3] comp_cont_apply [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   839
apply (rule_tac [5] cpo_trans)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   840
apply (rule_tac [6] rel_cf)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   841
apply (rule_tac [8] cont_mono) 
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   842
apply (blast intro: lam_type comp_pres_cont cont_cf chain_in [THEN cf_cont] 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   843
                    cont_map chain_rel rel_cf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   844
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   845
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   846
lemma comp_lubs:
13128
paulson
parents: 13085
diff changeset
   847
    "[| chain(cf(D',E),X); chain(cf(D,D'),Y); cpo(D); cpo(D'); cpo(E)|] 
paulson
parents: 13085
diff changeset
   848
     ==> lub(cf(D',E),X) O lub(cf(D,D'),Y) = lub(cf(D,E),\<lambda>n \<in> nat. X`n O Y`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   849
apply (rule fun_extension)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   850
apply (rule_tac [3] lub_cf [THEN ssubst])
13128
paulson
parents: 13085
diff changeset
   851
apply (assumption | 
paulson
parents: 13085
diff changeset
   852
       rule comp_fun cf_cont [THEN cont_fun]  cpo_lub [THEN islub_in]  
paulson
parents: 13085
diff changeset
   853
            cpo_cf chain_cf_comp)+
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
   854
apply (simp add: chain_in [THEN cf_cont, THEN comp_cont_apply])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   855
apply (subst comp_cont_apply)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   856
apply (assumption | rule cpo_lub [THEN islub_in, THEN cf_cont]  cpo_cf)+
13128
paulson
parents: 13085
diff changeset
   857
apply (simp add: lub_cf chain_cf chain_in [THEN cf_cont, THEN cont_lub] 
paulson
parents: 13085
diff changeset
   858
                 chain_cf [THEN cpo_lub, THEN islub_in])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   859
apply (cut_tac M = "\<lambda>xa \<in> nat. \<lambda>xb \<in> nat. X`xa` (Y`xb`x)" in lub_matrix_diag)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   860
prefer 3 apply simp
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   861
apply (rule matrix_chainI, simp_all)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   862
apply (drule chain_in [THEN cf_cont], assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   863
apply (force dest: cont_chain [OF _ chain_cf])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   864
apply (rule chain_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   865
apply (assumption |
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   866
       rule cont_fun [THEN apply_type] chain_in [THEN cf_cont] lam_type)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   867
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   868
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   869
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   870
(* Theorems about projpair.                                             *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   871
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   872
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   873
lemma projpairI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   874
    "[| e \<in> cont(D,E); p \<in> cont(E,D); p O e = id(set(D));
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   875
        rel(cf(E,E))(e O p)(id(set(E)))|] ==> projpair(D,E,e,p)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   876
by (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   877
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   878
lemma projpair_e_cont: "projpair(D,E,e,p) ==> e \<in> cont(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   879
by (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   880
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   881
lemma projpair_p_cont: "projpair(D,E,e,p) ==> p \<in> cont(E,D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   882
by (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   883
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   884
lemma projpair_ep_cont: "projpair(D,E,e,p) ==> e \<in> cont(D,E) & p \<in> cont(E,D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   885
by (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   886
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   887
lemma projpair_eq: "projpair(D,E,e,p) ==> p O e = id(set(D))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   888
by (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   889
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   890
lemma projpair_rel: "projpair(D,E,e,p) ==> rel(cf(E,E))(e O p)(id(set(E)))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   891
by (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   892
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   893
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   894
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   895
(* NB! projpair_e_cont and projpair_p_cont cannot be used repeatedly    *)
13128
paulson
parents: 13085
diff changeset
   896
(*   at the same time since both match a goal of the form f \<in> cont(X,Y).*)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   897
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   898
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   899
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   900
(* Uniqueness of embedding projection pairs.                            *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   901
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   902
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   903
lemmas id_comp = fun_is_rel [THEN left_comp_id]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   904
and    comp_id = fun_is_rel [THEN right_comp_id]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   905
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
   906
lemma projpair_unique_aux1:
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   907
    "[|cpo(D); cpo(E); projpair(D,E,e,p); projpair(D,E,e',p');
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   908
       rel(cf(D,E),e,e')|] ==> rel(cf(E,D),p',p)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   909
apply (rule_tac b=p' in
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   910
       projpair_p_cont [THEN cont_fun, THEN id_comp, THEN subst], assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   911
apply (rule projpair_eq [THEN subst], assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   912
apply (rule cpo_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   913
apply (assumption | rule cpo_cf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   914
(* The following corresponds to EXISTS_TAC, non-trivial instantiation. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   915
apply (rule_tac [4] f = "p O (e' O p')" in cont_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   916
apply (subst comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   917
apply (blast intro:  cpo_cf cont_cf comp_mono comp_pres_cont
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   918
             dest: projpair_ep_cont)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   919
apply (rule_tac P = "%x. rel (cf (E,D),p O e' O p',x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   920
         in projpair_p_cont [THEN cont_fun, THEN comp_id, THEN subst],
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   921
       assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   922
apply (rule comp_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   923
apply (blast intro: cpo_cf cont_cf comp_pres_cont projpair_rel
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   924
             dest: projpair_ep_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   925
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   926
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   927
text{*Proof's very like the previous one.  Is there a pattern that
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   928
      could be exploited?*}
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
   929
lemma projpair_unique_aux2:
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   930
    "[|cpo(D); cpo(E); projpair(D,E,e,p); projpair(D,E,e',p');
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   931
       rel(cf(E,D),p',p)|] ==> rel(cf(D,E),e,e')"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   932
apply (rule_tac b=e
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   933
	 in projpair_e_cont [THEN cont_fun, THEN comp_id, THEN subst],
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   934
       assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   935
apply (rule_tac e1=e' in projpair_eq [THEN subst], assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   936
apply (rule cpo_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   937
apply (assumption | rule cpo_cf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   938
apply (rule_tac [4] f = "(e O p) O e'" in cont_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   939
apply (subst comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   940
apply (blast intro:  cpo_cf cont_cf comp_mono comp_pres_cont
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   941
             dest: projpair_ep_cont)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   942
apply (rule_tac P = "%x. rel (cf (D,E), (e O p) O e',x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   943
         in projpair_e_cont [THEN cont_fun, THEN id_comp, THEN subst],
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   944
       assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   945
apply (blast intro: cpo_cf cont_cf comp_pres_cont projpair_rel comp_mono
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   946
             dest: projpair_ep_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   947
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   948
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   949
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   950
lemma projpair_unique:
13128
paulson
parents: 13085
diff changeset
   951
    "[|cpo(D); cpo(E); projpair(D,E,e,p); projpair(D,E,e',p')|] 
paulson
parents: 13085
diff changeset
   952
     ==> (e=e')<->(p=p')"
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
   953
by (blast intro: cpo_antisym projpair_unique_aux1 projpair_unique_aux2 cpo_cf cont_cf
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   954
          dest: projpair_ep_cont)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   955
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   956
(* Slightly different, more asms, since THE chooses the unique element. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   957
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   958
lemma embRp:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   959
    "[|emb(D,E,e); cpo(D); cpo(E)|] ==> projpair(D,E,e,Rp(D,E,e))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   960
apply (simp add: emb_def Rp_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   961
apply (blast intro: theI2 projpair_unique [THEN iffD1])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   962
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   963
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   964
lemma embI: "projpair(D,E,e,p) ==> emb(D,E,e)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   965
by (simp add: emb_def, auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   966
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   967
lemma Rp_unique: "[|projpair(D,E,e,p); cpo(D); cpo(E)|] ==> Rp(D,E,e) = p"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   968
by (blast intro: embRp embI projpair_unique [THEN iffD1])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   969
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   970
lemma emb_cont [TC]: "emb(D,E,e) ==> e \<in> cont(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   971
apply (simp add: emb_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   972
apply (blast intro: projpair_e_cont)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   973
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   974
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   975
(* The following three theorems have cpo asms due to THE (uniqueness). *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   976
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   977
lemmas Rp_cont [TC] = embRp [THEN projpair_p_cont, standard]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   978
lemmas embRp_eq = embRp [THEN projpair_eq, standard]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   979
lemmas embRp_rel = embRp [THEN projpair_rel, standard]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   980
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   981
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   982
lemma embRp_eq_thm:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   983
    "[|emb(D,E,e); x \<in> set(D); cpo(D); cpo(E)|] ==> Rp(D,E,e)`(e`x) = x"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   984
apply (rule comp_fun_apply [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   985
apply (assumption | rule Rp_cont emb_cont cont_fun)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   986
apply (subst embRp_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   987
apply (auto intro: id_conv)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   988
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   989
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   990
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   991
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   992
(* The identity embedding.                                              *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   993
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   994
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   995
lemma projpair_id:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   996
    "cpo(D) ==> projpair(D,D,id(set(D)),id(set(D)))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   997
apply (simp add: projpair_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   998
apply (blast intro: cpo_cf cont_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
   999
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1000
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1001
lemma emb_id:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1002
    "cpo(D) ==> emb(D,D,id(set(D)))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1003
by (auto intro: embI projpair_id)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1004
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1005
lemma Rp_id:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1006
    "cpo(D) ==> Rp(D,D,id(set(D))) = id(set(D))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1007
by (auto intro: Rp_unique projpair_id)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1008
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1009
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1010
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1011
(* Composition preserves embeddings.                                    *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1012
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1013
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1014
(* Considerably shorter, only partly due to a simpler comp_assoc. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1015
(* Proof in HOL-ST: 70 lines (minus 14 due to comp_assoc complication). *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1016
(* Proof in Isa/ZF: 23 lines (compared to 56: 60% reduction). *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1017
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1018
lemma comp_lemma:
13128
paulson
parents: 13085
diff changeset
  1019
    "[|emb(D,D',e); emb(D',E,e'); cpo(D); cpo(D'); cpo(E)|] 
paulson
parents: 13085
diff changeset
  1020
     ==> projpair(D,E,e' O e,(Rp(D,D',e)) O (Rp(D',E,e')))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1021
apply (simp add: projpair_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1022
apply (assumption | rule comp_pres_cont Rp_cont emb_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1023
apply (rule comp_assoc [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1024
apply (rule_tac t1 = e' in comp_assoc [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1025
apply (subst embRp_eq) (* Matches everything due to subst/ssubst. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1026
apply assumption+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1027
apply (subst comp_id)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1028
apply (assumption | rule cont_fun Rp_cont embRp_eq)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1029
apply (rule comp_assoc [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1030
apply (rule_tac t1 = "Rp (D,D',e)" in comp_assoc [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1031
apply (rule cpo_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1032
apply (assumption | rule cpo_cf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1033
apply (rule comp_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1034
apply (rule_tac [6] cpo_refl)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1035
apply (erule_tac [7] asm_rl | rule_tac [7] cont_cf Rp_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1036
prefer 6 apply (blast intro: cpo_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1037
apply (rule_tac [5] comp_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1038
apply (rule_tac [10] embRp_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1039
apply (rule_tac [9] cpo_cf [THEN cpo_refl])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1040
apply (simp_all add: comp_id embRp_rel comp_pres_cont Rp_cont
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1041
                     id_cont emb_cont cont_fun cont_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1042
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1043
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1044
(* The use of THEN is great in places like the following, both ugly in HOL. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1045
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1046
lemmas emb_comp = comp_lemma [THEN embI]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1047
lemmas Rp_comp = comp_lemma [THEN Rp_unique]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1048
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1049
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1050
(* Infinite cartesian product.                                          *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1051
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1052
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1053
lemma iprodI:
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1054
    "x:(\<Pi> n \<in> nat. set(DD`n)) ==> x \<in> set(iprod(DD))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1055
by (simp add: set_def iprod_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1056
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1057
lemma iprodE:
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1058
    "x \<in> set(iprod(DD)) ==> x:(\<Pi> n \<in> nat. set(DD`n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1059
by (simp add: set_def iprod_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1060
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1061
(* Contains typing conditions in contrast to HOL-ST *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1062
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1063
lemma rel_iprodI:
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1064
    "[|!!n. n \<in> nat ==> rel(DD`n,f`n,g`n); f:(\<Pi> n \<in> nat. set(DD`n));
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1065
       g:(\<Pi> n \<in> nat. set(DD`n))|] ==> rel(iprod(DD),f,g)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1066
by (simp add: iprod_def rel_I)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1067
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1068
lemma rel_iprodE:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1069
    "[|rel(iprod(DD),f,g); n \<in> nat|] ==> rel(DD`n,f`n,g`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1070
by (simp add: iprod_def rel_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1071
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1072
lemma chain_iprod:
13128
paulson
parents: 13085
diff changeset
  1073
    "[|chain(iprod(DD),X);  !!n. n \<in> nat ==> cpo(DD`n); n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1074
     ==> chain(DD`n,\<lambda>m \<in> nat. X`m`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1075
apply (unfold chain_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1076
apply (rule lam_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1077
apply (rule apply_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1078
apply (rule iprodE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1079
apply (blast intro: apply_funtype, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1080
apply (simp add: rel_iprodE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1081
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1082
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1083
lemma islub_iprod:
13128
paulson
parents: 13085
diff changeset
  1084
    "[|chain(iprod(DD),X);  !!n. n \<in> nat ==> cpo(DD`n)|] 
paulson
parents: 13085
diff changeset
  1085
     ==> islub(iprod(DD),X,\<lambda>n \<in> nat. lub(DD`n,\<lambda>m \<in> nat. X`m`n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1086
apply (simp add: islub_def isub_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1087
apply (rule iprodI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1088
apply (blast intro: lam_type chain_iprod [THEN cpo_lub, THEN islub_in])
13128
paulson
parents: 13085
diff changeset
  1089
apply (rule rel_iprodI, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1090
(*looks like something should be inserted into the assumptions!*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1091
apply (rule_tac P = "%t. rel (DD`na,t,lub (DD`na,\<lambda>x \<in> nat. X`x`na))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1092
            and b1 = "%n. X`n`na" in beta [THEN subst])
13175
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 13128
diff changeset
  1093
apply (simp del: beta_if
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1094
	    add: chain_iprod [THEN cpo_lub, THEN islub_ub] iprodE
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1095
                chain_in)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1096
apply (blast intro: iprodI lam_type chain_iprod [THEN cpo_lub, THEN islub_in])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1097
apply (rule rel_iprodI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1098
apply (simp | rule islub_least chain_iprod [THEN cpo_lub])+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1099
apply (simp add: isub_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1100
apply (erule iprodE [THEN apply_type])
13128
paulson
parents: 13085
diff changeset
  1101
apply (simp_all add: rel_iprodE lam_type iprodE
paulson
parents: 13085
diff changeset
  1102
                     chain_iprod [THEN cpo_lub, THEN islub_in])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1103
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1104
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1105
lemma cpo_iprod [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1106
    "(!!n. n \<in> nat ==> cpo(DD`n)) ==> cpo(iprod(DD))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1107
apply (assumption | rule cpoI poI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1108
apply (rule rel_iprodI) (*not repeated: want to solve 1, leave 2 unchanged *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1109
apply (simp | rule cpo_refl iprodE [THEN apply_type] iprodE)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1110
apply (rule rel_iprodI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1111
apply (drule rel_iprodE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1112
apply (drule_tac [2] rel_iprodE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1113
apply (simp | rule cpo_trans iprodE [THEN apply_type] iprodE)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1114
apply (rule fun_extension)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1115
apply (blast intro: iprodE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1116
apply (blast intro: iprodE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1117
apply (blast intro: cpo_antisym rel_iprodE iprodE [THEN apply_type])+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1118
apply (auto intro: islub_iprod)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1119
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1120
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1121
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1122
lemma lub_iprod:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1123
    "[|chain(iprod(DD),X);  !!n. n \<in> nat ==> cpo(DD`n)|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1124
     ==> lub(iprod(DD),X) = (\<lambda>n \<in> nat. lub(DD`n,\<lambda>m \<in> nat. X`m`n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1125
by (blast intro: cpo_lub [THEN islub_unique] islub_iprod cpo_iprod)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1126
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1127
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1128
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1129
(* The notion of subcpo.                                                *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1130
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1131
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1132
lemma subcpoI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1133
    "[|set(D)<=set(E);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1134
       !!x y. [|x \<in> set(D); y \<in> set(D)|] ==> rel(D,x,y)<->rel(E,x,y);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1135
       !!X. chain(D,X) ==> lub(E,X) \<in> set(D)|] ==> subcpo(D,E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1136
by (simp add: subcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1137
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1138
lemma subcpo_subset: "subcpo(D,E) ==> set(D)<=set(E)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1139
by (simp add: subcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1140
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1141
lemma subcpo_rel_eq:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1142
    "[|subcpo(D,E); x \<in> set(D); y \<in> set(D)|] ==> rel(D,x,y)<->rel(E,x,y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1143
by (simp add: subcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1144
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1145
lemmas subcpo_relD1 = subcpo_rel_eq [THEN iffD1]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1146
lemmas subcpo_relD2 = subcpo_rel_eq [THEN iffD2]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1147
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1148
lemma subcpo_lub: "[|subcpo(D,E); chain(D,X)|] ==> lub(E,X) \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1149
by (simp add: subcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1150
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1151
lemma chain_subcpo: "[|subcpo(D,E); chain(D,X)|] ==> chain(E,X)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1152
by (blast intro: Pi_type [THEN chainI] chain_fun subcpo_relD1
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1153
                    subcpo_subset [THEN subsetD]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1154
                    chain_in chain_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1155
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1156
lemma ub_subcpo: "[|subcpo(D,E); chain(D,X); isub(D,X,x)|] ==> isub(E,X,x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1157
by (blast intro: isubI subcpo_relD1 subcpo_relD1 chain_in isubD1 isubD2
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1158
                    subcpo_subset [THEN subsetD] chain_in chain_rel)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1159
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1160
lemma islub_subcpo:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1161
     "[|subcpo(D,E); cpo(E); chain(D,X)|] ==> islub(D,X,lub(E,X))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1162
by (blast intro: islubI isubI subcpo_lub subcpo_relD2 chain_in islub_ub
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1163
                 islub_least cpo_lub chain_subcpo isubD1 ub_subcpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1164
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1165
lemma subcpo_cpo: "[|subcpo(D,E); cpo(E)|] ==> cpo(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1166
apply (assumption | rule cpoI poI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1167
apply (simp add: subcpo_rel_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1168
apply (assumption | rule cpo_refl subcpo_subset [THEN subsetD])+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1169
apply (simp add: subcpo_rel_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1170
apply (blast intro: subcpo_subset [THEN subsetD] cpo_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1171
apply (simp add: subcpo_rel_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1172
apply (blast intro: cpo_antisym subcpo_subset [THEN subsetD])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1173
apply (fast intro: islub_subcpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1174
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1175
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1176
lemma lub_subcpo: "[|subcpo(D,E); cpo(E); chain(D,X)|] ==> lub(D,X) = lub(E,X)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1177
by (blast intro: cpo_lub [THEN islub_unique] islub_subcpo subcpo_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1178
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1179
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1180
(* Making subcpos using mkcpo.                                          *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1181
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1182
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1183
lemma mkcpoI: "[|x \<in> set(D); P(x)|] ==> x \<in> set(mkcpo(D,P))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1184
by (simp add: set_def mkcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1185
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1186
lemma mkcpoD1: "x \<in> set(mkcpo(D,P))==> x \<in> set(D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1187
by (simp add: set_def mkcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1188
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1189
lemma mkcpoD2: "x \<in> set(mkcpo(D,P))==> P(x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1190
by (simp add: set_def mkcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1191
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1192
lemma rel_mkcpoE: "rel(mkcpo(D,P),x,y) ==> rel(D,x,y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1193
by (simp add: rel_def mkcpo_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1194
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1195
lemma rel_mkcpo:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1196
    "[|x \<in> set(D); y \<in> set(D)|] ==> rel(mkcpo(D,P),x,y) <-> rel(D,x,y)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1197
by (simp add: mkcpo_def rel_def set_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1198
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1199
lemma chain_mkcpo:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1200
    "chain(mkcpo(D,P),X) ==> chain(D,X)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1201
apply (rule chainI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1202
apply (blast intro: Pi_type chain_fun chain_in [THEN mkcpoD1])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1203
apply (blast intro: rel_mkcpo [THEN iffD1] chain_rel mkcpoD1 chain_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1204
done
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
  1205
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1206
lemma subcpo_mkcpo:
13128
paulson
parents: 13085
diff changeset
  1207
     "[|!!X. chain(mkcpo(D,P),X) ==> P(lub(D,X)); cpo(D)|]
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1208
      ==> subcpo(mkcpo(D,P),D)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1209
apply (intro subcpoI subsetI rel_mkcpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1210
apply (erule mkcpoD1)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1211
apply (blast intro: mkcpoI cpo_lub [THEN islub_in] chain_mkcpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1212
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1213
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1214
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1215
(* Embedding projection chains of cpos.                                 *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1216
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1217
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1218
lemma emb_chainI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1219
    "[|!!n. n \<in> nat ==> cpo(DD`n);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1220
       !!n. n \<in> nat ==> emb(DD`n,DD`succ(n),ee`n)|] ==> emb_chain(DD,ee)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1221
by (simp add: emb_chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1222
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1223
lemma emb_chain_cpo [TC]: "[|emb_chain(DD,ee); n \<in> nat|] ==> cpo(DD`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1224
by (simp add: emb_chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1225
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1226
lemma emb_chain_emb:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1227
    "[|emb_chain(DD,ee); n \<in> nat|] ==> emb(DD`n,DD`succ(n),ee`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1228
by (simp add: emb_chain_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1229
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1230
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1231
(* Dinf, the inverse Limit.                                             *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1232
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1233
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1234
lemma DinfI:
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1235
    "[|x:(\<Pi> n \<in> nat. set(DD`n));
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1236
       !!n. n \<in> nat ==> Rp(DD`n,DD`succ(n),ee`n)`(x`succ(n)) = x`n|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1237
     ==> x \<in> set(Dinf(DD,ee))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1238
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1239
apply (blast intro: mkcpoI iprodI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1240
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1241
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1242
lemma Dinf_prod: "x \<in> set(Dinf(DD,ee)) ==> x:(\<Pi> n \<in> nat. set(DD`n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1243
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1244
apply (erule mkcpoD1 [THEN iprodE])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1245
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1246
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1247
lemma Dinf_eq:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1248
    "[|x \<in> set(Dinf(DD,ee)); n \<in> nat|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1249
     ==> Rp(DD`n,DD`succ(n),ee`n)`(x`succ(n)) = x`n"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1250
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1251
apply (blast dest: mkcpoD2)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1252
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1253
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1254
lemma rel_DinfI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1255
    "[|!!n. n \<in> nat ==> rel(DD`n,x`n,y`n);
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 14046
diff changeset
  1256
       x:(\<Pi> n \<in> nat. set(DD`n)); y:(\<Pi> n \<in> nat. set(DD`n))|] 
13128
paulson
parents: 13085
diff changeset
  1257
     ==> rel(Dinf(DD,ee),x,y)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1258
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1259
apply (blast intro: rel_mkcpo [THEN iffD2] rel_iprodI iprodI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1260
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1261
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1262
lemma rel_Dinf: "[|rel(Dinf(DD,ee),x,y); n \<in> nat|] ==> rel(DD`n,x`n,y`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1263
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1264
apply (erule rel_mkcpoE [THEN rel_iprodE], assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1265
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1266
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1267
lemma chain_Dinf: "chain(Dinf(DD,ee),X) ==> chain(iprod(DD),X)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1268
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1269
apply (erule chain_mkcpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1270
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1271
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 14171
diff changeset
  1272
lemma subcpo_Dinf: "emb_chain(DD,ee) ==> subcpo(Dinf(DD,ee),iprod(DD))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1273
apply (simp add: Dinf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1274
apply (rule subcpo_mkcpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1275
apply (simp add: Dinf_def [symmetric])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1276
apply (rule ballI)
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 14171
diff changeset
  1277
apply (simplesubst lub_iprod)
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 14171
diff changeset
  1278
  --{*Subst would rewrite the lhs. We want to change the rhs.*}
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1279
apply (assumption | rule chain_Dinf emb_chain_cpo)+
13128
paulson
parents: 13085
diff changeset
  1280
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1281
apply (subst Rp_cont [THEN cont_lub])
13128
paulson
parents: 13085
diff changeset
  1282
apply (assumption | 
paulson
parents: 13085
diff changeset
  1283
       rule emb_chain_cpo emb_chain_emb nat_succI chain_iprod chain_Dinf)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1284
(* Useful simplification, ugly in HOL. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1285
apply (simp add: Dinf_eq chain_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1286
apply (auto intro: cpo_iprod emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1287
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1288
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1289
(* Simple example of existential reasoning in Isabelle versus HOL. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1290
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1291
lemma cpo_Dinf: "emb_chain(DD,ee) ==> cpo(Dinf(DD,ee))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1292
apply (rule subcpo_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1293
apply (erule subcpo_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1294
apply (auto intro: cpo_iprod emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1295
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1296
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1297
(* Again and again the proofs are much easier to WRITE in Isabelle, but
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1298
  the proof steps are essentially the same (I think). *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1299
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1300
lemma lub_Dinf:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1301
    "[|chain(Dinf(DD,ee),X); emb_chain(DD,ee)|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1302
     ==> lub(Dinf(DD,ee),X) = (\<lambda>n \<in> nat. lub(DD`n,\<lambda>m \<in> nat. X`m`n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1303
apply (subst subcpo_Dinf [THEN lub_subcpo])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1304
apply (auto intro: cpo_iprod emb_chain_cpo lub_iprod chain_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1305
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1306
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1307
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1308
(* Generalising embedddings D_m -> D_{m+1} to embeddings D_m -> D_n,    *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1309
(* defined as eps(DD,ee,m,n), via e_less and e_gr.                      *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1310
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1311
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1312
lemma e_less_eq:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1313
    "m \<in> nat ==> e_less(DD,ee,m,m) = id(set(DD`m))"
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13615
diff changeset
  1314
by (simp add: e_less_def)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1315
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1316
lemma lemma_succ_sub: "succ(m#+n)#-m = succ(natify(n))"
13128
paulson
parents: 13085
diff changeset
  1317
by simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1318
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1319
lemma e_less_add:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1320
     "e_less(DD,ee,m,succ(m#+k)) = (ee`(m#+k))O(e_less(DD,ee,m,m#+k))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1321
by (simp add: e_less_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1322
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1323
lemma le_exists:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1324
    "[| m le n;  !!x. [|n=m#+x; x \<in> nat|] ==> Q;  n \<in> nat |] ==> Q"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1325
apply (drule less_imp_succ_add, auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1326
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1327
13128
paulson
parents: 13085
diff changeset
  1328
lemma e_less_le: "[| m le n;  n \<in> nat |] 
paulson
parents: 13085
diff changeset
  1329
     ==> e_less(DD,ee,m,succ(n)) = ee`n O e_less(DD,ee,m,n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1330
apply (rule le_exists, assumption)
13128
paulson
parents: 13085
diff changeset
  1331
apply (simp add: e_less_add, assumption)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1332
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1333
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1334
(* All theorems assume variables m and n are natural numbers. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1335
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1336
lemma e_less_succ:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1337
     "m \<in> nat ==> e_less(DD,ee,m,succ(m)) = ee`m O id(set(DD`m))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1338
by (simp add: e_less_le e_less_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1339
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1340
lemma e_less_succ_emb:
13128
paulson
parents: 13085
diff changeset
  1341
    "[|!!n. n \<in> nat ==> emb(DD`n,DD`succ(n),ee`n); m \<in> nat|] 
paulson
parents: 13085
diff changeset
  1342
     ==> e_less(DD,ee,m,succ(m)) = ee`m"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1343
apply (simp add: e_less_succ)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1344
apply (blast intro: emb_cont cont_fun comp_id)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1345
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1346
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1347
(* Compare this proof with the HOL one, here we do type checking. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1348
(* In any case the one below was very easy to write. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1349
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1350
lemma emb_e_less_add:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1351
     "[| emb_chain(DD,ee); m \<in> nat |]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1352
      ==> emb(DD`m, DD`(m#+k), e_less(DD,ee,m,m#+k))"
13128
paulson
parents: 13085
diff changeset
  1353
apply (subgoal_tac "emb (DD`m, DD` (m#+natify (k)), 
paulson
parents: 13085
diff changeset
  1354
                         e_less (DD,ee,m,m#+natify (k))) ")
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1355
apply (rule_tac [2] n = "natify (k) " in nat_induct)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1356
apply (simp_all add: e_less_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1357
apply (assumption | rule emb_id emb_chain_cpo)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1358
apply (simp add: e_less_add)
13128
paulson
parents: 13085
diff changeset
  1359
apply (auto intro: emb_comp emb_chain_emb emb_chain_cpo)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1360
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1361
13128
paulson
parents: 13085
diff changeset
  1362
lemma emb_e_less:
paulson
parents: 13085
diff changeset
  1363
     "[| m le n;  emb_chain(DD,ee);  n \<in> nat |] 
paulson
parents: 13085
diff changeset
  1364
      ==> emb(DD`m, DD`n, e_less(DD,ee,m,n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1365
apply (frule lt_nat_in_nat)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1366
apply (erule nat_succI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1367
(* same proof as e_less_le *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1368
apply (rule le_exists, assumption)
13128
paulson
parents: 13085
diff changeset
  1369
apply (simp add: emb_e_less_add, assumption)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1370
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1371
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1372
lemma comp_mono_eq: "[|f=f'; g=g'|] ==> f O g = f' O g'"
13128
paulson
parents: 13085
diff changeset
  1373
by simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1374
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1375
(* Note the object-level implication for induction on k. This
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1376
   must be removed later to allow the theorems to be used for simp.
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1377
   Therefore this theorem is only a lemma. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1378
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1379
lemma e_less_split_add_lemma [rule_format]:
13128
paulson
parents: 13085
diff changeset
  1380
    "[| emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1381
     ==> n le k -->
paulson
parents: 13085
diff changeset
  1382
         e_less(DD,ee,m,m#+k) = e_less(DD,ee,m#+n,m#+k) O e_less(DD,ee,m,m#+n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1383
apply (induct_tac k)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1384
apply (simp add: e_less_eq id_type [THEN id_comp])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1385
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1386
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1387
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1388
apply (erule impE, assumption)
13128
paulson
parents: 13085
diff changeset
  1389
apply (simp add: e_less_add)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1390
apply (subst e_less_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1391
apply (assumption | rule add_le_mono nat_le_refl add_type nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1392
apply (subst comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1393
apply (assumption | rule comp_mono_eq refl)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1394
apply (simp del: add_succ_right add: add_succ_right [symmetric]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1395
	    add: e_less_eq add_type nat_succI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1396
apply (subst id_comp) (* simp cannot unify/inst right, use brr below (?) . *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1397
apply (assumption |
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1398
       rule emb_e_less_add [THEN emb_cont, THEN cont_fun] refl nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1399
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1400
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1401
lemma e_less_split_add:
13128
paulson
parents: 13085
diff changeset
  1402
    "[| n le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1403
     ==> e_less(DD,ee,m,m#+k) = e_less(DD,ee,m#+n,m#+k) O e_less(DD,ee,m,m#+n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1404
by (blast intro: e_less_split_add_lemma)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1405
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1406
lemma e_gr_eq:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1407
    "m \<in> nat ==> e_gr(DD,ee,m,m) = id(set(DD`m))"
14046
6616e6c53d48 updating ZF-UNITY with Sidi's new material
paulson
parents: 13615
diff changeset
  1408
by (simp add: e_gr_def)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1409
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1410
lemma e_gr_add:
13128
paulson
parents: 13085
diff changeset
  1411
    "[|n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1412
     ==> e_gr(DD,ee,succ(n#+k),n) =
paulson
parents: 13085
diff changeset
  1413
         e_gr(DD,ee,n#+k,n) O Rp(DD`(n#+k),DD`succ(n#+k),ee`(n#+k))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1414
by (simp add: e_gr_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1415
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1416
lemma e_gr_le:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1417
     "[|n le m; m \<in> nat; n \<in> nat|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1418
      ==> e_gr(DD,ee,succ(m),n) = e_gr(DD,ee,m,n) O Rp(DD`m,DD`succ(m),ee`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1419
apply (erule le_exists)
13128
paulson
parents: 13085
diff changeset
  1420
apply (simp add: e_gr_add, assumption+)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1421
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1422
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1423
lemma e_gr_succ:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1424
 "m \<in> nat ==> e_gr(DD,ee,succ(m),m) = id(set(DD`m)) O Rp(DD`m,DD`succ(m),ee`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1425
by (simp add: e_gr_le e_gr_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1426
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1427
(* Cpo asm's due to THE uniqueness. *)
13128
paulson
parents: 13085
diff changeset
  1428
lemma e_gr_succ_emb: "[|emb_chain(DD,ee); m \<in> nat|] 
paulson
parents: 13085
diff changeset
  1429
     ==> e_gr(DD,ee,succ(m),m) = Rp(DD`m,DD`succ(m),ee`m)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1430
apply (simp add: e_gr_succ)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1431
apply (blast intro: id_comp Rp_cont cont_fun emb_chain_cpo emb_chain_emb)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1432
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1433
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1434
lemma e_gr_fun_add:
13128
paulson
parents: 13085
diff changeset
  1435
    "[|emb_chain(DD,ee); n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1436
     ==> e_gr(DD,ee,n#+k,n): set(DD`(n#+k))->set(DD`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1437
apply (induct_tac k)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1438
apply (simp add: e_gr_eq id_type)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1439
apply (simp add: e_gr_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1440
apply (blast intro: comp_fun Rp_cont cont_fun emb_chain_emb emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1441
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1442
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1443
lemma e_gr_fun:
13128
paulson
parents: 13085
diff changeset
  1444
    "[|n le m; emb_chain(DD,ee); m \<in> nat; n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1445
     ==> e_gr(DD,ee,m,n): set(DD`m)->set(DD`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1446
apply (rule le_exists, assumption)
13128
paulson
parents: 13085
diff changeset
  1447
apply (simp add: e_gr_fun_add, assumption+)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1448
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1449
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1450
lemma e_gr_split_add_lemma:
13128
paulson
parents: 13085
diff changeset
  1451
    "[| emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1452
     ==> m le k -->
paulson
parents: 13085
diff changeset
  1453
         e_gr(DD,ee,n#+k,n) = e_gr(DD,ee,n#+m,n) O e_gr(DD,ee,n#+k,n#+m)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1454
apply (induct_tac k)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1455
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1456
apply (simp add: le0_iff e_gr_eq id_type [THEN comp_id])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1457
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1458
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1459
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1460
apply (erule impE, assumption)
13128
paulson
parents: 13085
diff changeset
  1461
apply (simp add: e_gr_add)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1462
apply (subst e_gr_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1463
apply (assumption | rule add_le_mono nat_le_refl add_type nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1464
apply (subst comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1465
apply (assumption | rule comp_mono_eq refl)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1466
(* New direct subgoal *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1467
apply (simp del: add_succ_right add: add_succ_right [symmetric]
13128
paulson
parents: 13085
diff changeset
  1468
	    add: e_gr_eq)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1469
apply (subst comp_id) (* simp cannot unify/inst right, use brr below (?) . *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1470
apply (assumption | rule e_gr_fun add_type refl add_le_self nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1471
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1472
13128
paulson
parents: 13085
diff changeset
  1473
lemma e_gr_split_add:
paulson
parents: 13085
diff changeset
  1474
     "[| m le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1475
      ==> e_gr(DD,ee,n#+k,n) = e_gr(DD,ee,n#+m,n) O e_gr(DD,ee,n#+k,n#+m)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1476
apply (blast intro: e_gr_split_add_lemma [THEN mp])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1477
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1478
13128
paulson
parents: 13085
diff changeset
  1479
lemma e_less_cont:
paulson
parents: 13085
diff changeset
  1480
     "[|m le n; emb_chain(DD,ee); m \<in> nat; n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1481
      ==> e_less(DD,ee,m,n):cont(DD`m,DD`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1482
apply (blast intro: emb_cont emb_e_less)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1483
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1484
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1485
lemma e_gr_cont:
13128
paulson
parents: 13085
diff changeset
  1486
    "[|n le m; emb_chain(DD,ee); m \<in> nat; n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1487
     ==> e_gr(DD,ee,m,n):cont(DD`m,DD`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1488
apply (erule rev_mp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1489
apply (induct_tac m)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1490
apply (simp add: le0_iff e_gr_eq nat_0I)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1491
apply (assumption | rule impI id_cont emb_chain_cpo nat_0I)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1492
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1493
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1494
apply (erule impE, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1495
apply (simp add: e_gr_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1496
apply (blast intro: comp_pres_cont Rp_cont emb_chain_cpo emb_chain_emb)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1497
apply (simp add: e_gr_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1498
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1499
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1500
(* Considerably shorter.... 57 against 26 *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1501
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1502
lemma e_less_e_gr_split_add:
13128
paulson
parents: 13085
diff changeset
  1503
    "[|n le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1504
     ==> e_less(DD,ee,m,m#+n) = e_gr(DD,ee,m#+k,m#+n) O e_less(DD,ee,m,m#+k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1505
(* Use mp to prepare for induction. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1506
apply (erule rev_mp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1507
apply (induct_tac k)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1508
apply (simp add: e_gr_eq e_less_eq id_type [THEN id_comp])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1509
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1510
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1511
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1512
apply (erule impE, assumption)
13128
paulson
parents: 13085
diff changeset
  1513
apply (simp add: e_gr_le e_less_le add_le_mono)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1514
apply (subst comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1515
apply (rule_tac s1 = "ee` (m#+x)" in comp_assoc [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1516
apply (subst embRp_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1517
apply (assumption | rule emb_chain_emb add_type emb_chain_cpo nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1518
apply (subst id_comp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1519
apply (blast intro: e_less_cont [THEN cont_fun] add_le_self)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1520
apply (rule refl)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1521
apply (simp del: add_succ_right add: add_succ_right [symmetric]
13128
paulson
parents: 13085
diff changeset
  1522
	    add: e_gr_eq)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1523
apply (blast intro: id_comp [symmetric] e_less_cont [THEN cont_fun]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1524
                    add_le_self)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1525
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1526
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1527
(* Again considerably shorter, and easy to obtain from the previous thm. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1528
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1529
lemma e_gr_e_less_split_add:
13128
paulson
parents: 13085
diff changeset
  1530
    "[|m le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1531
     ==> e_gr(DD,ee,n#+m,n) = e_gr(DD,ee,n#+k,n) O e_less(DD,ee,n#+m,n#+k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1532
(* Use mp to prepare for induction. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1533
apply (erule rev_mp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1534
apply (induct_tac k)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1535
apply (simp add: e_gr_eq e_less_eq id_type [THEN id_comp])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1536
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1537
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1538
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1539
apply (erule impE, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1540
apply (simp add: e_gr_le e_less_le add_le_self nat_le_refl add_le_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1541
apply (subst comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1542
apply (rule_tac s1 = "ee` (n#+x)" in comp_assoc [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1543
apply (subst embRp_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1544
apply (assumption | rule emb_chain_emb add_type emb_chain_cpo nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1545
apply (subst id_comp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1546
apply (blast intro!: e_less_cont [THEN cont_fun] add_le_mono nat_le_refl)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1547
apply (rule refl)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1548
apply (simp del: add_succ_right add: add_succ_right [symmetric]
13128
paulson
parents: 13085
diff changeset
  1549
	    add: e_less_eq)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1550
apply (blast intro: comp_id [symmetric] e_gr_cont [THEN cont_fun] add_le_self)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1551
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1552
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1553
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1554
lemma emb_eps:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1555
    "[|m le n; emb_chain(DD,ee); m \<in> nat; n \<in> nat|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1556
     ==> emb(DD`m,DD`n,eps(DD,ee,m,n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1557
apply (simp add: eps_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1558
apply (blast intro: emb_e_less)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1559
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1560
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1561
lemma eps_fun:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1562
    "[|emb_chain(DD,ee); m \<in> nat; n \<in> nat|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1563
     ==> eps(DD,ee,m,n): set(DD`m)->set(DD`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1564
apply (simp add: eps_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1565
apply (auto intro: e_less_cont [THEN cont_fun]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1566
                   not_le_iff_lt [THEN iffD1, THEN leI]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1567
                   e_gr_fun nat_into_Ord)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1568
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1569
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1570
lemma eps_id: "n \<in> nat ==> eps(DD,ee,n,n) = id(set(DD`n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1571
by (simp add: eps_def e_less_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1572
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1573
lemma eps_e_less_add:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1574
    "[|m \<in> nat; n \<in> nat|] ==> eps(DD,ee,m,m#+n) = e_less(DD,ee,m,m#+n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1575
by (simp add: eps_def add_le_self)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1576
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1577
lemma eps_e_less:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1578
    "[|m le n; m \<in> nat; n \<in> nat|] ==> eps(DD,ee,m,n) = e_less(DD,ee,m,n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1579
by (simp add: eps_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1580
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1581
lemma eps_e_gr_add:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1582
    "[|n \<in> nat; k \<in> nat|] ==> eps(DD,ee,n#+k,n) = e_gr(DD,ee,n#+k,n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1583
by (simp add: eps_def e_less_eq e_gr_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1584
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1585
lemma eps_e_gr:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1586
    "[|n le m; m \<in> nat; n \<in> nat|] ==> eps(DD,ee,m,n) = e_gr(DD,ee,m,n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1587
apply (erule le_exists)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1588
apply (simp_all add: eps_e_gr_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1589
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1590
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1591
lemma eps_succ_ee:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1592
    "[|!!n. n \<in> nat ==> emb(DD`n,DD`succ(n),ee`n); m \<in> nat|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1593
     ==> eps(DD,ee,m,succ(m)) = ee`m"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1594
by (simp add: eps_e_less le_succ_iff e_less_succ_emb)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1595
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1596
lemma eps_succ_Rp:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1597
    "[|emb_chain(DD,ee); m \<in> nat|]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1598
     ==> eps(DD,ee,succ(m),m) = Rp(DD`m,DD`succ(m),ee`m)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1599
by (simp add: eps_e_gr le_succ_iff e_gr_succ_emb)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1600
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1601
lemma eps_cont:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1602
  "[|emb_chain(DD,ee); m \<in> nat; n \<in> nat|] ==> eps(DD,ee,m,n): cont(DD`m,DD`n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1603
apply (rule_tac i = m and j = n in nat_linear_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1604
apply (simp_all add: eps_e_less e_less_cont eps_e_gr e_gr_cont)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1605
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1606
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1607
(* Theorems about splitting. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1608
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1609
lemma eps_split_add_left:
13128
paulson
parents: 13085
diff changeset
  1610
    "[|n le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1611
     ==> eps(DD,ee,m,m#+k) = eps(DD,ee,m#+n,m#+k) O eps(DD,ee,m,m#+n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1612
apply (simp add: eps_e_less add_le_self add_le_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1613
apply (auto intro: e_less_split_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1614
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1615
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1616
lemma eps_split_add_left_rev:
13128
paulson
parents: 13085
diff changeset
  1617
    "[|n le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1618
     ==> eps(DD,ee,m,m#+n) = eps(DD,ee,m#+k,m#+n) O eps(DD,ee,m,m#+k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1619
apply (simp add: eps_e_less_add eps_e_gr add_le_self add_le_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1620
apply (auto intro: e_less_e_gr_split_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1621
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1622
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1623
lemma eps_split_add_right:
13128
paulson
parents: 13085
diff changeset
  1624
    "[|m le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1625
     ==> eps(DD,ee,n#+k,n) = eps(DD,ee,n#+m,n) O eps(DD,ee,n#+k,n#+m)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1626
apply (simp add: eps_e_gr add_le_self add_le_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1627
apply (auto intro: e_gr_split_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1628
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1629
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1630
lemma eps_split_add_right_rev:
13128
paulson
parents: 13085
diff changeset
  1631
    "[|m le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1632
     ==> eps(DD,ee,n#+m,n) = eps(DD,ee,n#+k,n) O eps(DD,ee,n#+m,n#+k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1633
apply (simp add: eps_e_gr_add eps_e_less add_le_self add_le_mono)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1634
apply (auto intro: e_gr_e_less_split_add)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1635
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1636
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1637
(* Arithmetic *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1638
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1639
lemma le_exists_lemma:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1640
    "[| n le k; k le m;
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1641
        !!p q. [|p le q; k=n#+p; m=n#+q; p \<in> nat; q \<in> nat|] ==> R;
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1642
        m \<in> nat |]==>R"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1643
apply (rule le_exists, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1644
prefer 2 apply (simp add: lt_nat_in_nat)
13612
55d32e76ef4e Adapted to new simplifier.
berghofe
parents: 13535
diff changeset
  1645
apply (rule le_trans [THEN le_exists], assumption+, force+)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1646
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1647
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1648
lemma eps_split_left_le:
13128
paulson
parents: 13085
diff changeset
  1649
    "[|m le k; k le n; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1650
     ==> eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1651
apply (rule le_exists_lemma, assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1652
apply (auto intro: eps_split_add_left)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1653
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1654
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1655
lemma eps_split_left_le_rev:
13128
paulson
parents: 13085
diff changeset
  1656
    "[|m le n; n le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1657
     ==> eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1658
apply (rule le_exists_lemma, assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1659
apply (auto intro: eps_split_add_left_rev)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1660
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1661
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1662
lemma eps_split_right_le:
13128
paulson
parents: 13085
diff changeset
  1663
    "[|n le k; k le m; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1664
     ==> eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1665
apply (rule le_exists_lemma, assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1666
apply (auto intro: eps_split_add_right)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1667
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1668
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1669
lemma eps_split_right_le_rev:
13128
paulson
parents: 13085
diff changeset
  1670
    "[|n le m; m le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1671
     ==> eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1672
apply (rule le_exists_lemma, assumption+)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1673
apply (auto intro: eps_split_add_right_rev)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1674
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1675
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1676
(* The desired two theorems about `splitting'. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1677
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1678
lemma eps_split_left:
13128
paulson
parents: 13085
diff changeset
  1679
    "[|m le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1680
     ==> eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1681
apply (rule nat_linear_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1682
apply (rule_tac [4] eps_split_right_le_rev)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1683
prefer 4 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1684
apply (rule_tac [3] nat_linear_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1685
apply (rule_tac [5] eps_split_left_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1686
prefer 6 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1687
apply (simp_all add: eps_split_left_le_rev)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1688
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1689
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1690
lemma eps_split_right:
13128
paulson
parents: 13085
diff changeset
  1691
    "[|n le k; emb_chain(DD,ee); m \<in> nat; n \<in> nat; k \<in> nat|] 
paulson
parents: 13085
diff changeset
  1692
     ==> eps(DD,ee,m,n) = eps(DD,ee,k,n) O eps(DD,ee,m,k)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1693
apply (rule nat_linear_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1694
apply (rule_tac [3] eps_split_left_le_rev)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1695
prefer 3 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1696
apply (rule_tac [8] nat_linear_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1697
apply (rule_tac [10] eps_split_right_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1698
prefer 11 apply assumption
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1699
apply (simp_all add: eps_split_right_le_rev)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1700
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1701
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1702
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1703
(* That was eps: D_m -> D_n, NEXT rho_emb: D_n -> Dinf.                 *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1704
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1705
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1706
(* Considerably shorter. *)
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
  1707
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1708
lemma rho_emb_fun:
13128
paulson
parents: 13085
diff changeset
  1709
    "[|emb_chain(DD,ee); n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1710
     ==> rho_emb(DD,ee,n): set(DD`n) -> set(Dinf(DD,ee))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1711
apply (simp add: rho_emb_def)
13128
paulson
parents: 13085
diff changeset
  1712
apply (assumption |
paulson
parents: 13085
diff changeset
  1713
       rule lam_type DinfI eps_cont [THEN cont_fun, THEN apply_type])+
paulson
parents: 13085
diff changeset
  1714
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1715
apply (rule_tac i = "succ (na) " and j = n in nat_linear_le)
13128
paulson
parents: 13085
diff changeset
  1716
   apply blast
paulson
parents: 13085
diff changeset
  1717
  apply assumption
15481
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 14171
diff changeset
  1718
 apply (simplesubst eps_split_right_le)
fc075ae929e4 the new subst tactic, by Lucas Dixon
paulson
parents: 14171
diff changeset
  1719
    --{*Subst would rewrite the lhs. We want to change the rhs.*}
13128
paulson
parents: 13085
diff changeset
  1720
       prefer 2 apply assumption
paulson
parents: 13085
diff changeset
  1721
      apply simp
paulson
parents: 13085
diff changeset
  1722
     apply (assumption | rule add_le_self nat_0I nat_succI)+
paulson
parents: 13085
diff changeset
  1723
 apply (simp add: eps_succ_Rp)
paulson
parents: 13085
diff changeset
  1724
 apply (subst comp_fun_apply)
paulson
parents: 13085
diff changeset
  1725
    apply (assumption | 
paulson
parents: 13085
diff changeset
  1726
           rule eps_fun nat_succI Rp_cont [THEN cont_fun] 
paulson
parents: 13085
diff changeset
  1727
                emb_chain_emb emb_chain_cpo refl)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1728
(* Now the second part of the proof. Slightly different than HOL. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1729
apply (simp add: eps_e_less nat_succI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1730
apply (erule le_iff [THEN iffD1, THEN disjE])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1731
apply (simp add: e_less_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1732
apply (subst comp_fun_apply)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1733
apply (assumption | rule e_less_cont cont_fun emb_chain_emb emb_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1734
apply (subst embRp_eq_thm)
13128
paulson
parents: 13085
diff changeset
  1735
apply (assumption | 
paulson
parents: 13085
diff changeset
  1736
       rule emb_chain_emb e_less_cont [THEN cont_fun, THEN apply_type]
paulson
parents: 13085
diff changeset
  1737
            emb_chain_cpo nat_succI)+
paulson
parents: 13085
diff changeset
  1738
 apply (simp add: eps_e_less)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1739
apply (simp add: eps_succ_Rp e_less_eq id_conv nat_succI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1740
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1741
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1742
lemma rho_emb_apply1:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1743
    "x \<in> set(DD`n) ==> rho_emb(DD,ee,n)`x = (\<lambda>m \<in> nat. eps(DD,ee,n,m)`x)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1744
by (simp add: rho_emb_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1745
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1746
lemma rho_emb_apply2:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1747
    "[|x \<in> set(DD`n); m \<in> nat|] ==> rho_emb(DD,ee,n)`x`m = eps(DD,ee,n,m)`x"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1748
by (simp add: rho_emb_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1749
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1750
lemma rho_emb_id: "[| x \<in> set(DD`n); n \<in> nat|] ==> rho_emb(DD,ee,n)`x`n = x"
13128
paulson
parents: 13085
diff changeset
  1751
by (simp add: rho_emb_apply2 eps_id)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1752
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1753
(* Shorter proof, 23 against 62. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1754
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1755
lemma rho_emb_cont:
13128
paulson
parents: 13085
diff changeset
  1756
    "[|emb_chain(DD,ee); n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1757
     ==> rho_emb(DD,ee,n): cont(DD`n,Dinf(DD,ee))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1758
apply (rule contI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1759
apply (assumption | rule rho_emb_fun)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1760
apply (rule rel_DinfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1761
apply (simp add: rho_emb_def)
13128
paulson
parents: 13085
diff changeset
  1762
apply (assumption | 
paulson
parents: 13085
diff changeset
  1763
       rule eps_cont [THEN cont_mono]  Dinf_prod apply_type rho_emb_fun)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1764
(* Continuity, different order, slightly different proofs. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1765
apply (subst lub_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1766
apply (rule chainI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1767
apply (assumption | rule lam_type rho_emb_fun [THEN apply_type]  chain_in)+
13128
paulson
parents: 13085
diff changeset
  1768
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1769
apply (rule rel_DinfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1770
apply (simp add: rho_emb_apply2 chain_in)
13128
paulson
parents: 13085
diff changeset
  1771
apply (assumption | 
paulson
parents: 13085
diff changeset
  1772
       rule eps_cont [THEN cont_mono]  chain_rel Dinf_prod 
paulson
parents: 13085
diff changeset
  1773
            rho_emb_fun [THEN apply_type]  chain_in nat_succI)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1774
(* Now, back to the result of applying lub_Dinf *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1775
apply (simp add: rho_emb_apply2 chain_in)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1776
apply (subst rho_emb_apply1)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1777
apply (assumption | rule cpo_lub [THEN islub_in]  emb_chain_cpo)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1778
apply (rule fun_extension)
13128
paulson
parents: 13085
diff changeset
  1779
apply (assumption | 
paulson
parents: 13085
diff changeset
  1780
       rule lam_type eps_cont [THEN cont_fun, THEN apply_type]  
paulson
parents: 13085
diff changeset
  1781
            cpo_lub [THEN islub_in]  emb_chain_cpo)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1782
apply (assumption | rule cont_chain eps_cont emb_chain_cpo)+
13128
paulson
parents: 13085
diff changeset
  1783
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1784
apply (simp add: eps_cont [THEN cont_lub])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1785
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1786
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1787
(* 32 vs 61, using safe_tac with imp in asm would be unfortunate (5steps) *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1788
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
  1789
lemma eps1_aux1:
13128
paulson
parents: 13085
diff changeset
  1790
    "[|m le n; emb_chain(DD,ee); x \<in> set(Dinf(DD,ee)); m \<in> nat; n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1791
     ==> rel(DD`n,e_less(DD,ee,m,n)`(x`m),x`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1792
apply (erule rev_mp) (* For induction proof *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1793
apply (induct_tac n)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1794
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1795
apply (simp add: e_less_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1796
apply (subst id_conv)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1797
apply (assumption | rule apply_type Dinf_prod cpo_refl emb_chain_cpo nat_0I)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1798
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1799
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1800
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1801
apply (drule mp, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1802
apply (rule cpo_trans)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1803
apply (rule_tac [2] e_less_le [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1804
apply (assumption | rule emb_chain_cpo nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1805
apply (subst comp_fun_apply)
13128
paulson
parents: 13085
diff changeset
  1806
apply (assumption | 
paulson
parents: 13085
diff changeset
  1807
       rule emb_chain_emb [THEN emb_cont]  e_less_cont cont_fun apply_type 
paulson
parents: 13085
diff changeset
  1808
            Dinf_prod)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1809
apply (rule_tac y = "x`xa" in emb_chain_emb [THEN emb_cont, THEN cont_mono])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1810
apply (assumption | rule e_less_cont [THEN cont_fun]  apply_type Dinf_prod)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1811
apply (rule_tac x1 = x and n1 = xa in Dinf_eq [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1812
apply (rule_tac [3] comp_fun_apply [THEN subst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1813
apply (rename_tac [5] y)
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1814
apply (rule_tac [5] P = 
13128
paulson
parents: 13085
diff changeset
  1815
         "%z. rel(DD`succ(y), 
paulson
parents: 13085
diff changeset
  1816
                  (ee`y O Rp(?DD(y)`y,?DD(y)`succ(y),?ee(y)`y)) ` (x`succ(y)),
paulson
parents: 13085
diff changeset
  1817
                  z)"
paulson
parents: 13085
diff changeset
  1818
       in id_conv [THEN subst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1819
apply (rule_tac [6] rel_cf)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1820
(* Dinf and cont_fun doesn't go well together, both Pi(_,%x._). *)
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1821
(* solves 10 of 11 subgoals *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1822
apply (assumption |
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1823
       rule Dinf_prod [THEN apply_type] cont_fun Rp_cont e_less_cont
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1824
            emb_cont emb_chain_emb emb_chain_cpo apply_type embRp_rel
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1825
            disjI1 [THEN le_succ_iff [THEN iffD2]]  nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1826
apply (simp add: e_less_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1827
apply (subst id_conv)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1828
apply (auto intro: apply_type Dinf_prod emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1829
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1830
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1831
(* 18 vs 40 *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1832
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
  1833
lemma eps1_aux2:
13128
paulson
parents: 13085
diff changeset
  1834
    "[|n le m; emb_chain(DD,ee); x \<in> set(Dinf(DD,ee)); m \<in> nat; n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1835
     ==> rel(DD`n,e_gr(DD,ee,m,n)`(x`m),x`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1836
apply (erule rev_mp) (* For induction proof *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1837
apply (induct_tac m)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1838
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1839
apply (simp add: e_gr_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1840
apply (subst id_conv)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1841
apply (assumption | rule apply_type Dinf_prod cpo_refl emb_chain_cpo nat_0I)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1842
apply (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1843
apply (rule impI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1844
apply (erule disjE)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1845
apply (drule mp, assumption)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1846
apply (subst e_gr_le)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1847
apply (rule_tac [4] comp_fun_apply [THEN ssubst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1848
apply (rule_tac [6] Dinf_eq [THEN ssubst])
13128
paulson
parents: 13085
diff changeset
  1849
apply (assumption | 
paulson
parents: 13085
diff changeset
  1850
       rule emb_chain_emb emb_chain_cpo Rp_cont e_gr_cont cont_fun emb_cont 
paulson
parents: 13085
diff changeset
  1851
            apply_type Dinf_prod nat_succI)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1852
apply (simp add: e_gr_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1853
apply (subst id_conv)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1854
apply (auto intro: apply_type Dinf_prod emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1855
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1856
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1857
lemma eps1:
13128
paulson
parents: 13085
diff changeset
  1858
    "[|emb_chain(DD,ee); x \<in> set(Dinf(DD,ee)); m \<in> nat; n \<in> nat|] 
paulson
parents: 13085
diff changeset
  1859
     ==> rel(DD`n,eps(DD,ee,m,n)`(x`m),x`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1860
apply (simp add: eps_def)
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
  1861
apply (blast intro: eps1_aux1 not_le_iff_lt [THEN iffD1, THEN leI, THEN eps1_aux2]
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1862
                    nat_into_Ord)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1863
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1864
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1865
(* The following theorem is needed/useful due to type check for rel_cfI,
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1866
   but also elsewhere.
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1867
   Look for occurences of rel_cfI, rel_DinfI, etc to evaluate the problem. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1868
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1869
lemma lam_Dinf_cont:
13128
paulson
parents: 13085
diff changeset
  1870
  "[| emb_chain(DD,ee); n \<in> nat |] 
paulson
parents: 13085
diff changeset
  1871
     ==> (\<lambda>x \<in> set(Dinf(DD,ee)). x`n) \<in> cont(Dinf(DD,ee),DD`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1872
apply (rule contI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1873
apply (assumption | rule lam_type apply_type Dinf_prod)+
13128
paulson
parents: 13085
diff changeset
  1874
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1875
apply (assumption | rule rel_Dinf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1876
apply (subst beta)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1877
apply (auto intro: cpo_Dinf islub_in cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1878
apply (simp add: chain_in lub_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1879
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1880
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1881
lemma rho_projpair:
13128
paulson
parents: 13085
diff changeset
  1882
    "[| emb_chain(DD,ee); n \<in> nat |] 
paulson
parents: 13085
diff changeset
  1883
     ==> projpair(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n),rho_proj(DD,ee,n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1884
apply (simp add: rho_proj_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1885
apply (rule projpairI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1886
apply (assumption | rule rho_emb_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1887
(* lemma used, introduced because same fact needed below due to rel_cfI. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1888
apply (assumption | rule lam_Dinf_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1889
(*-----------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1890
(* This part is 7 lines, but 30 in HOL (75% reduction!) *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1891
apply (rule fun_extension)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1892
apply (rule_tac [3] id_conv [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1893
apply (rule_tac [4] comp_fun_apply [THEN ssubst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1894
apply (rule_tac [6] beta [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1895
apply (rule_tac [7] rho_emb_id [THEN ssubst])
13128
paulson
parents: 13085
diff changeset
  1896
apply (assumption | 
paulson
parents: 13085
diff changeset
  1897
       rule comp_fun id_type lam_type rho_emb_fun Dinf_prod [THEN apply_type]
paulson
parents: 13085
diff changeset
  1898
            apply_type refl)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1899
(*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1900
apply (rule rel_cfI) (* ------------------>>>Yields type cond, not in HOL *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1901
apply (subst id_conv)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1902
apply (rule_tac [2] comp_fun_apply [THEN ssubst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1903
apply (rule_tac [4] beta [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1904
apply (rule_tac [5] rho_emb_apply1 [THEN ssubst])
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1905
apply (rule_tac [6] rel_DinfI) 
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1906
apply (rule_tac [6] beta [THEN ssubst])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1907
(* Dinf_prod bad with lam_type *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1908
apply (assumption |
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1909
       rule eps1 lam_type rho_emb_fun eps_fun
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1910
            Dinf_prod [THEN apply_type] refl)+
13128
paulson
parents: 13085
diff changeset
  1911
apply (assumption | 
paulson
parents: 13085
diff changeset
  1912
       rule apply_type eps_fun Dinf_prod comp_pres_cont rho_emb_cont 
paulson
parents: 13085
diff changeset
  1913
            lam_Dinf_cont id_cont cpo_Dinf emb_chain_cpo)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1914
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1915
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1916
lemma emb_rho_emb:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1917
  "[| emb_chain(DD,ee); n \<in> nat |] ==> emb(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1918
by (auto simp add: emb_def intro: exI rho_projpair)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1919
13535
007559e981c7 *** empty log message ***
wenzelm
parents: 13339
diff changeset
  1920
lemma rho_proj_cont: "[| emb_chain(DD,ee); n \<in> nat |] 
13128
paulson
parents: 13085
diff changeset
  1921
     ==> rho_proj(DD,ee,n) \<in> cont(Dinf(DD,ee),DD`n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1922
by (auto intro: rho_projpair projpair_p_cont)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1923
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1924
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1925
(* Commutivity and universality.                                        *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1926
(*----------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1927
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1928
lemma commuteI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1929
  "[| !!n. n \<in> nat ==> emb(DD`n,E,r(n));
13128
paulson
parents: 13085
diff changeset
  1930
      !!m n. [|m le n; m \<in> nat; n \<in> nat|] ==> r(n) O eps(DD,ee,m,n) = r(m) |] 
paulson
parents: 13085
diff changeset
  1931
     ==> commute(DD,ee,E,r)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1932
by (simp add: commute_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1933
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1934
lemma commute_emb [TC]:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1935
  "[| commute(DD,ee,E,r); n \<in> nat |] ==> emb(DD`n,E,r(n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1936
by (simp add: commute_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1937
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1938
lemma commute_eq:
13128
paulson
parents: 13085
diff changeset
  1939
  "[| commute(DD,ee,E,r); m le n; m \<in> nat; n \<in> nat |] 
paulson
parents: 13085
diff changeset
  1940
     ==> r(n) O eps(DD,ee,m,n) = r(m) "
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1941
by (simp add: commute_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1942
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1943
(* Shorter proof: 11 vs 46 lines. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1944
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1945
lemma rho_emb_commute:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1946
  "emb_chain(DD,ee) ==> commute(DD,ee,Dinf(DD,ee),rho_emb(DD,ee))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1947
apply (rule commuteI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1948
apply (assumption | rule emb_rho_emb)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1949
apply (rule fun_extension) (* Manual instantiation in HOL. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1950
apply (rule_tac [3] comp_fun_apply [THEN ssubst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1951
apply (rule_tac [5] fun_extension) (*Next, clean up and instantiate unknowns *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1952
apply (assumption | rule comp_fun rho_emb_fun eps_fun Dinf_prod apply_type)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1953
apply (simp add: rho_emb_apply2 eps_fun [THEN apply_type])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1954
apply (rule comp_fun_apply [THEN subst])
13176
312bd350579b conversion of Perm to Isar. Strengthening of comp_fun_apply
paulson
parents: 13175
diff changeset
  1955
apply (rule_tac [3] eps_split_left [THEN subst])
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1956
apply (auto intro: eps_fun)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1957
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1958
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1959
lemma le_succ: "n \<in> nat ==> n le succ(n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1960
by (simp add: le_succ_iff)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1961
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1962
(* Shorter proof: 21 vs 83 (106 - 23, due to OAssoc complication) *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1963
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1964
lemma commute_chain:
13128
paulson
parents: 13085
diff changeset
  1965
    "[| commute(DD,ee,E,r); emb_chain(DD,ee); cpo(E) |] 
paulson
parents: 13085
diff changeset
  1966
     ==> chain(cf(E,E),\<lambda>n \<in> nat. r(n) O Rp(DD`n,E,r(n)))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1967
apply (rule chainI)
13128
paulson
parents: 13085
diff changeset
  1968
apply (blast intro: lam_type cont_cf comp_pres_cont commute_emb Rp_cont 
paulson
parents: 13085
diff changeset
  1969
                    emb_cont emb_chain_cpo, 
paulson
parents: 13085
diff changeset
  1970
       simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1971
apply (rule_tac r1 = r and m1 = n in commute_eq [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1972
apply (assumption | rule le_succ nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1973
apply (subst Rp_comp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1974
apply (assumption | rule emb_eps commute_emb emb_chain_cpo le_succ nat_succI)+
13128
paulson
parents: 13085
diff changeset
  1975
apply (rule comp_assoc [THEN subst]) (* comp_assoc is simpler in Isa *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1976
apply (rule_tac r1 = "r (succ (n))" in comp_assoc [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1977
apply (rule comp_mono)
13128
paulson
parents: 13085
diff changeset
  1978
apply (blast intro: comp_pres_cont eps_cont emb_eps commute_emb Rp_cont 
paulson
parents: 13085
diff changeset
  1979
                    emb_cont emb_chain_cpo le_succ)+
paulson
parents: 13085
diff changeset
  1980
apply (rule_tac b="r(succ(n))" in comp_id [THEN subst]) (* 1 subst too much *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1981
apply (rule_tac [2] comp_mono)
13128
paulson
parents: 13085
diff changeset
  1982
apply (blast intro: comp_pres_cont eps_cont emb_eps emb_id commute_emb 
paulson
parents: 13085
diff changeset
  1983
                    Rp_cont emb_cont cont_fun emb_chain_cpo le_succ)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1984
apply (subst comp_id) (* Undoes "1 subst too much", typing next anyway *)
13128
paulson
parents: 13085
diff changeset
  1985
apply (blast intro: cont_fun Rp_cont emb_cont commute_emb cont_cf cpo_cf 
paulson
parents: 13085
diff changeset
  1986
                    emb_chain_cpo embRp_rel emb_eps le_succ)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1987
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1988
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1989
lemma rho_emb_chain:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1990
  "emb_chain(DD,ee) ==>
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1991
   chain(cf(Dinf(DD,ee),Dinf(DD,ee)),
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1992
         \<lambda>n \<in> nat. rho_emb(DD,ee,n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n)))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1993
by (auto intro: commute_chain rho_emb_commute cpo_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  1994
13128
paulson
parents: 13085
diff changeset
  1995
lemma rho_emb_chain_apply1:
paulson
parents: 13085
diff changeset
  1996
     "[| emb_chain(DD,ee); x \<in> set(Dinf(DD,ee)) |] 
paulson
parents: 13085
diff changeset
  1997
      ==> chain(Dinf(DD,ee),
paulson
parents: 13085
diff changeset
  1998
                \<lambda>n \<in> nat.
paulson
parents: 13085
diff changeset
  1999
                 (rho_emb(DD,ee,n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n)))`x)"
paulson
parents: 13085
diff changeset
  2000
by (drule rho_emb_chain [THEN chain_cf], assumption, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2001
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2002
lemma chain_iprod_emb_chain:
13128
paulson
parents: 13085
diff changeset
  2003
     "[| chain(iprod(DD),X); emb_chain(DD,ee); n \<in> nat |] 
paulson
parents: 13085
diff changeset
  2004
      ==> chain(DD`n,\<lambda>m \<in> nat. X `m `n)"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2005
by (auto intro: chain_iprod emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2006
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2007
lemma rho_emb_chain_apply2:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2008
  "[| emb_chain(DD,ee); x \<in> set(Dinf(DD,ee)); n \<in> nat |] ==>
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2009
   chain
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2010
    (DD`n,
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2011
     \<lambda>xa \<in> nat.
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2012
      (rho_emb(DD, ee, xa) O Rp(DD ` xa, Dinf(DD, ee),rho_emb(DD, ee, xa))) `
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2013
       x ` n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2014
by (frule rho_emb_chain_apply1 [THEN chain_Dinf, THEN chain_iprod_emb_chain], 
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2015
    auto)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2016
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2017
(* Shorter proof: 32 vs 72 (roughly), Isabelle proof has lemmas. *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2018
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2019
lemma rho_emb_lub:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2020
  "emb_chain(DD,ee) ==>
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2021
   lub(cf(Dinf(DD,ee),Dinf(DD,ee)),
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2022
       \<lambda>n \<in> nat. rho_emb(DD,ee,n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n))) =
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2023
   id(set(Dinf(DD,ee)))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2024
apply (rule cpo_antisym)
13128
paulson
parents: 13085
diff changeset
  2025
apply (rule cpo_cf) (*Instantiate variable, continued below (loops otherwise)*)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2026
apply (assumption | rule cpo_Dinf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2027
apply (rule islub_least)
13128
paulson
parents: 13085
diff changeset
  2028
apply (assumption | 
paulson
parents: 13085
diff changeset
  2029
       rule cpo_lub rho_emb_chain cpo_cf cpo_Dinf isubI cont_cf id_cont)+
paulson
parents: 13085
diff changeset
  2030
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2031
apply (assumption | rule embRp_rel emb_rho_emb emb_chain_cpo cpo_Dinf)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2032
apply (rule rel_cfI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2033
apply (simp add: lub_cf rho_emb_chain cpo_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2034
apply (rule rel_DinfI) (* Additional assumptions *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2035
apply (subst lub_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2036
apply (assumption | rule rho_emb_chain_apply1)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2037
defer 1
13128
paulson
parents: 13085
diff changeset
  2038
apply (assumption | 
paulson
parents: 13085
diff changeset
  2039
       rule Dinf_prod cpo_lub [THEN islub_in]  id_cont cpo_Dinf cpo_cf cf_cont
paulson
parents: 13085
diff changeset
  2040
            rho_emb_chain rho_emb_chain_apply1 id_cont [THEN cont_cf])+
paulson
parents: 13085
diff changeset
  2041
apply simp
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2042
apply (rule dominate_islub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2043
apply (rule_tac [3] cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2044
apply (rule_tac [6] x1 = "x`n" in chain_const [THEN chain_fun])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2045
defer 1
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2046
apply (assumption |
13128
paulson
parents: 13085
diff changeset
  2047
       rule rho_emb_chain_apply2 emb_chain_cpo islub_const apply_type 
paulson
parents: 13085
diff changeset
  2048
            Dinf_prod emb_chain_cpo chain_fun rho_emb_chain_apply2)+
paulson
parents: 13085
diff changeset
  2049
apply (rule dominateI, assumption, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2050
apply (subst comp_fun_apply)
13128
paulson
parents: 13085
diff changeset
  2051
apply (assumption | 
paulson
parents: 13085
diff changeset
  2052
       rule cont_fun Rp_cont emb_cont emb_rho_emb cpo_Dinf emb_chain_cpo)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2053
apply (subst rho_projpair [THEN Rp_unique])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2054
prefer 5
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2055
apply (simp add: rho_proj_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2056
apply (rule rho_emb_id [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2057
apply (auto intro: cpo_Dinf apply_type Dinf_prod emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2058
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2059
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2060
lemma theta_chain: (* almost same proof as commute_chain *)
13128
paulson
parents: 13085
diff changeset
  2061
    "[| commute(DD,ee,E,r); commute(DD,ee,G,f);
paulson
parents: 13085
diff changeset
  2062
        emb_chain(DD,ee); cpo(E); cpo(G) |] 
paulson
parents: 13085
diff changeset
  2063
     ==> chain(cf(E,G),\<lambda>n \<in> nat. f(n) O Rp(DD`n,E,r(n)))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2064
apply (rule chainI)
13128
paulson
parents: 13085
diff changeset
  2065
apply (blast intro: lam_type cont_cf comp_pres_cont commute_emb Rp_cont 
paulson
parents: 13085
diff changeset
  2066
                    emb_cont emb_chain_cpo, 
paulson
parents: 13085
diff changeset
  2067
       simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2068
apply (rule_tac r1 = r and m1 = n in commute_eq [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2069
apply (rule_tac [5] r1 = f and m1 = n in commute_eq [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2070
apply (assumption | rule le_succ nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2071
apply (subst Rp_comp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2072
apply (assumption | rule emb_eps commute_emb emb_chain_cpo le_succ nat_succI)+
13128
paulson
parents: 13085
diff changeset
  2073
apply (rule comp_assoc [THEN subst]) 
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2074
apply (rule_tac r1 = "f (succ (n))" in comp_assoc [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2075
apply (rule comp_mono)
13128
paulson
parents: 13085
diff changeset
  2076
apply (blast intro: comp_pres_cont eps_cont emb_eps commute_emb Rp_cont
paulson
parents: 13085
diff changeset
  2077
                     emb_cont emb_chain_cpo le_succ)+
paulson
parents: 13085
diff changeset
  2078
apply (rule_tac b="f(succ(n))" in comp_id [THEN subst]) (* 1 subst too much *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2079
apply (rule_tac [2] comp_mono)
13128
paulson
parents: 13085
diff changeset
  2080
apply (blast intro: comp_pres_cont eps_cont emb_eps emb_id commute_emb 
paulson
parents: 13085
diff changeset
  2081
                    Rp_cont emb_cont cont_fun emb_chain_cpo le_succ)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2082
apply (subst comp_id) (* Undoes "1 subst too much", typing next anyway *)
13128
paulson
parents: 13085
diff changeset
  2083
apply (blast intro: cont_fun Rp_cont emb_cont commute_emb cont_cf cpo_cf 
paulson
parents: 13085
diff changeset
  2084
                    emb_chain_cpo embRp_rel emb_eps le_succ)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2085
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2086
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2087
lemma theta_proj_chain: (* similar proof to theta_chain *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2088
  "[| commute(DD,ee,E,r); commute(DD,ee,G,f);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2089
      emb_chain(DD,ee); cpo(E); cpo(G) |]
13128
paulson
parents: 13085
diff changeset
  2090
     ==> chain(cf(G,E),\<lambda>n \<in> nat. r(n) O Rp(DD`n,G,f(n)))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2091
apply (rule chainI)
13128
paulson
parents: 13085
diff changeset
  2092
apply (blast intro: lam_type cont_cf comp_pres_cont commute_emb Rp_cont 
paulson
parents: 13085
diff changeset
  2093
		    emb_cont emb_chain_cpo, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2094
apply (rule_tac r1 = r and m1 = n in commute_eq [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2095
apply (rule_tac [5] r1 = f and m1 = n in commute_eq [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2096
apply (assumption | rule le_succ nat_succI)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2097
apply (subst Rp_comp)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2098
apply (assumption | rule emb_eps commute_emb emb_chain_cpo le_succ nat_succI)+
13128
paulson
parents: 13085
diff changeset
  2099
apply (rule comp_assoc [THEN subst]) (* comp_assoc is simpler in Isa *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2100
apply (rule_tac r1 = "r (succ (n))" in comp_assoc [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2101
apply (rule comp_mono)
13128
paulson
parents: 13085
diff changeset
  2102
apply (blast intro: comp_pres_cont eps_cont emb_eps commute_emb Rp_cont 
paulson
parents: 13085
diff changeset
  2103
		    emb_cont emb_chain_cpo le_succ)+
paulson
parents: 13085
diff changeset
  2104
apply (rule_tac b="r(succ(n))" in comp_id [THEN subst]) (* 1 subst too much *)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2105
apply (rule_tac [2] comp_mono)
13128
paulson
parents: 13085
diff changeset
  2106
apply (blast intro: comp_pres_cont eps_cont emb_eps emb_id commute_emb 
paulson
parents: 13085
diff changeset
  2107
		    Rp_cont emb_cont cont_fun emb_chain_cpo le_succ)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2108
apply (subst comp_id) (* Undoes "1 subst too much", typing next anyway *)
13128
paulson
parents: 13085
diff changeset
  2109
apply (blast intro: cont_fun Rp_cont emb_cont commute_emb cont_cf cpo_cf 
paulson
parents: 13085
diff changeset
  2110
                    emb_chain_cpo embRp_rel emb_eps le_succ)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2111
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2112
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2113
(* Simplification with comp_assoc is possible inside a \<lambda>-abstraction,
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2114
   because it does not have assumptions. If it had, as the HOL-ST theorem
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2115
   too strongly has, we would be in deep trouble due to HOL's lack of proper
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2116
   conditional rewriting (a HOL contrib provides something that works). *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2117
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2118
(* Controlled simplification inside lambda: introduce lemmas *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2119
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2120
lemma commute_O_lemma:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2121
     "[| commute(DD,ee,E,r); commute(DD,ee,G,f);
13128
paulson
parents: 13085
diff changeset
  2122
         emb_chain(DD,ee); cpo(E); cpo(G); x \<in> nat |] 
paulson
parents: 13085
diff changeset
  2123
      ==> r(x) O Rp(DD ` x, G, f(x)) O f(x) O Rp(DD ` x, E, r(x)) =
paulson
parents: 13085
diff changeset
  2124
          r(x) O Rp(DD ` x, E, r(x))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2125
apply (rule_tac s1 = "f (x) " in comp_assoc [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2126
apply (subst embRp_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2127
apply (rule_tac [4] id_comp [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2128
apply (auto intro: cont_fun Rp_cont commute_emb emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2129
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2130
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2131
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2132
(* Shorter proof (but lemmas): 19 vs 79 (103 - 24, due to OAssoc)  *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2133
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2134
lemma theta_projpair:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2135
  "[| lub(cf(E,E), \<lambda>n \<in> nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E));
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2136
      commute(DD,ee,E,r); commute(DD,ee,G,f);
13128
paulson
parents: 13085
diff changeset
  2137
      emb_chain(DD,ee); cpo(E); cpo(G) |]
paulson
parents: 13085
diff changeset
  2138
   ==> projpair
paulson
parents: 13085
diff changeset
  2139
	(E,G,
paulson
parents: 13085
diff changeset
  2140
	 lub(cf(E,G), \<lambda>n \<in> nat. f(n) O Rp(DD`n,E,r(n))),
paulson
parents: 13085
diff changeset
  2141
	 lub(cf(G,E), \<lambda>n \<in> nat. r(n) O Rp(DD`n,G,f(n))))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2142
apply (simp add: projpair_def rho_proj_def, safe)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2143
apply (rule_tac [3] comp_lubs [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2144
(* The following one line is 15 lines in HOL, and includes existentials. *)
13128
paulson
parents: 13085
diff changeset
  2145
apply (assumption | 
paulson
parents: 13085
diff changeset
  2146
       rule cf_cont islub_in cpo_lub cpo_cf theta_chain theta_proj_chain)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2147
apply (simp (no_asm) add: comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2148
apply (simp add: commute_O_lemma)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2149
apply (subst comp_lubs)
13128
paulson
parents: 13085
diff changeset
  2150
apply (assumption | 
paulson
parents: 13085
diff changeset
  2151
       rule cf_cont islub_in cpo_lub cpo_cf theta_chain theta_proj_chain)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2152
apply (simp (no_asm) add: comp_assoc)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2153
apply (simp add: commute_O_lemma)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2154
apply (rule dominate_islub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2155
defer 1
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2156
apply (rule cpo_lub)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2157
apply (assumption |
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2158
       rule commute_chain commute_emb islub_const cont_cf id_cont
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2159
    cpo_cf chain_fun chain_const)+
13128
paulson
parents: 13085
diff changeset
  2160
apply (rule dominateI, assumption, simp)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2161
apply (blast intro: embRp_rel commute_emb emb_chain_cpo)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2162
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2163
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2164
lemma emb_theta:
13128
paulson
parents: 13085
diff changeset
  2165
    "[| lub(cf(E,E), \<lambda>n \<in> nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E));
paulson
parents: 13085
diff changeset
  2166
	commute(DD,ee,E,r); commute(DD,ee,G,f);
paulson
parents: 13085
diff changeset
  2167
	emb_chain(DD,ee); cpo(E); cpo(G) |] 
paulson
parents: 13085
diff changeset
  2168
     ==> emb(E,G,lub(cf(E,G), \<lambda>n \<in> nat. f(n) O Rp(DD`n,E,r(n))))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2169
apply (simp add: emb_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2170
apply (blast intro: theta_projpair)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2171
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2172
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2173
lemma mono_lemma:
13128
paulson
parents: 13085
diff changeset
  2174
    "[| g \<in> cont(D,D'); cpo(D); cpo(D'); cpo(E) |] 
paulson
parents: 13085
diff changeset
  2175
     ==> (\<lambda>f \<in> cont(D',E). f O g) \<in> mono(cf(D',E),cf(D,E))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2176
apply (rule monoI)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2177
apply (simp add: set_def cf_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2178
apply (drule cf_cont)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2179
apply simp
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2180
apply (blast intro: comp_mono lam_type comp_pres_cont cpo_cf cont_cf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2181
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2182
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2183
lemma commute_lam_lemma:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2184
     "[| commute(DD,ee,E,r); commute(DD,ee,G,f);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2185
         emb_chain(DD,ee); cpo(E); cpo(G); n \<in> nat |]
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2186
      ==> (\<lambda>na \<in> nat. (\<lambda>f \<in> cont(E, G). f O r(n)) `
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2187
           ((\<lambda>n \<in> nat. f(n) O Rp(DD ` n, E, r(n))) ` na))  =
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2188
          (\<lambda>na \<in> nat. (f(na) O Rp(DD ` na, E, r(na))) O r(n))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2189
apply (rule fun_extension)
13175
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 13128
diff changeset
  2190
(*something wrong here*) 
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 13128
diff changeset
  2191
apply (auto simp del: beta_if simp add: beta intro: lam_type)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2192
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2193
13128
paulson
parents: 13085
diff changeset
  2194
lemma chain_lemma:
paulson
parents: 13085
diff changeset
  2195
     "[| commute(DD,ee,E,r); commute(DD,ee,G,f);
paulson
parents: 13085
diff changeset
  2196
         emb_chain(DD,ee); cpo(E); cpo(G); n \<in> nat |] 
paulson
parents: 13085
diff changeset
  2197
      ==> chain(cf(DD`n,G),\<lambda>x \<in> nat. (f(x) O Rp(DD ` x, E, r(x))) O r(n))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2198
apply (rule commute_lam_lemma [THEN subst])
13128
paulson
parents: 13085
diff changeset
  2199
apply (blast intro: theta_chain emb_chain_cpo 
paulson
parents: 13085
diff changeset
  2200
               commute_emb [THEN emb_cont, THEN mono_lemma, THEN mono_chain])+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2201
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2202
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2203
lemma suffix_lemma:
13128
paulson
parents: 13085
diff changeset
  2204
    "[| commute(DD,ee,E,r); commute(DD,ee,G,f);
paulson
parents: 13085
diff changeset
  2205
        emb_chain(DD,ee); cpo(E); cpo(G); cpo(DD`x); x \<in> nat |] 
paulson
parents: 13085
diff changeset
  2206
     ==> suffix(\<lambda>n \<in> nat. (f(n) O Rp(DD`n,E,r(n))) O r(x),x) = 
paulson
parents: 13085
diff changeset
  2207
         (\<lambda>n \<in> nat. f(x))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2208
apply (simp add: suffix_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2209
apply (rule lam_type [THEN fun_extension])
13128
paulson
parents: 13085
diff changeset
  2210
apply (blast intro: lam_type comp_fun cont_fun Rp_cont emb_cont 
paulson
parents: 13085
diff changeset
  2211
                    commute_emb emb_chain_cpo)+
paulson
parents: 13085
diff changeset
  2212
apply simp
paulson
parents: 13085
diff changeset
  2213
apply (rename_tac y)
paulson
parents: 13085
diff changeset
  2214
apply (subgoal_tac 
paulson
parents: 13085
diff changeset
  2215
       "f(x#+y) O (Rp(DD`(x#+y), E, r(x#+y)) O r (x#+y)) O eps(DD, ee, x, x#+y)
paulson
parents: 13085
diff changeset
  2216
        = f(x)")
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2217
apply (simp add: comp_assoc commute_eq add_le_self)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2218
apply (simp add: embRp_eq eps_fun [THEN id_comp] commute_emb emb_chain_cpo)
13128
paulson
parents: 13085
diff changeset
  2219
apply (blast intro: commute_eq add_le_self)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2220
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2221
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2222
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2223
lemma mediatingI:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2224
  "[|emb(E,G,t);  !!n. n \<in> nat ==> f(n) = t O r(n) |]==>mediating(E,G,r,f,t)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2225
by (simp add: mediating_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2226
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2227
lemma mediating_emb: "mediating(E,G,r,f,t) ==> emb(E,G,t)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2228
by (simp add: mediating_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2229
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2230
lemma mediating_eq: "[| mediating(E,G,r,f,t); n \<in> nat |] ==> f(n) = t O r(n)"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2231
by (simp add: mediating_def)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2232
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2233
lemma lub_universal_mediating:
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2234
  "[| lub(cf(E,E), \<lambda>n \<in> nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E));
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2235
      commute(DD,ee,E,r); commute(DD,ee,G,f);
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2236
      emb_chain(DD,ee); cpo(E); cpo(G) |]
13128
paulson
parents: 13085
diff changeset
  2237
     ==> mediating(E,G,r,f,lub(cf(E,G), \<lambda>n \<in> nat. f(n) O Rp(DD`n,E,r(n))))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2238
apply (assumption | rule mediatingI emb_theta)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2239
apply (rule_tac b = "r (n) " in lub_const [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2240
apply (rule_tac [3] comp_lubs [THEN ssubst])
13128
paulson
parents: 13085
diff changeset
  2241
apply (blast intro: cont_cf emb_cont commute_emb cpo_cf theta_chain 
paulson
parents: 13085
diff changeset
  2242
                    chain_const emb_chain_cpo)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2243
apply (simp (no_asm))
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2244
apply (rule_tac n1 = n in lub_suffix [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2245
apply (assumption | rule chain_lemma cpo_cf emb_chain_cpo)+
13128
paulson
parents: 13085
diff changeset
  2246
apply (simp add: suffix_lemma lub_const cont_cf emb_cont commute_emb cpo_cf 
paulson
parents: 13085
diff changeset
  2247
                 emb_chain_cpo)
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2248
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2249
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2250
lemma lub_universal_unique:
13128
paulson
parents: 13085
diff changeset
  2251
    "[| mediating(E,G,r,f,t);
paulson
parents: 13085
diff changeset
  2252
	lub(cf(E,E), \<lambda>n \<in> nat. r(n) O Rp(DD`n,E,r(n))) = id(set(E));
paulson
parents: 13085
diff changeset
  2253
	commute(DD,ee,E,r); commute(DD,ee,G,f);
paulson
parents: 13085
diff changeset
  2254
	emb_chain(DD,ee); cpo(E); cpo(G) |] 
paulson
parents: 13085
diff changeset
  2255
     ==> t = lub(cf(E,G), \<lambda>n \<in> nat. f(n) O Rp(DD`n,E,r(n)))"
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2256
apply (rule_tac b = t in comp_id [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2257
apply (erule_tac [2] subst)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2258
apply (rule_tac [2] b = t in lub_const [THEN subst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2259
apply (rule_tac [4] comp_lubs [THEN ssubst])
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2260
prefer 9 apply (simp add: comp_assoc mediating_eq)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2261
apply (assumption |
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2262
       rule cont_fun emb_cont mediating_emb cont_cf cpo_cf chain_const
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2263
            commute_chain emb_chain_cpo)+
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2264
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2265
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2266
(*---------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2267
(* Dinf yields the inverse_limit, stated as rho_emb_commute and        *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2268
(* Dinf_universal.                                                     *)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2269
(*---------------------------------------------------------------------*)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2270
13128
paulson
parents: 13085
diff changeset
  2271
theorem Dinf_universal:
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2272
  "[| commute(DD,ee,G,f); emb_chain(DD,ee); cpo(G) |] ==>
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2273
   mediating
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2274
    (Dinf(DD,ee),G,rho_emb(DD,ee),f,
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2275
     lub(cf(Dinf(DD,ee),G),
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2276
         \<lambda>n \<in> nat. f(n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n)))) &
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2277
   (\<forall>t. mediating(Dinf(DD,ee),G,rho_emb(DD,ee),f,t) -->
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2278
     t = lub(cf(Dinf(DD,ee),G),
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2279
         \<lambda>n \<in> nat. f(n) O Rp(DD`n,Dinf(DD,ee),rho_emb(DD,ee,n))))"
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2280
apply safe
13128
paulson
parents: 13085
diff changeset
  2281
apply (assumption | 
paulson
parents: 13085
diff changeset
  2282
       rule lub_universal_mediating rho_emb_commute rho_emb_lub cpo_Dinf)+
13085
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2283
apply (auto intro: lub_universal_unique rho_emb_commute rho_emb_lub cpo_Dinf)
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2284
done
bfdb0534c8ec converted theory ex/Limit to Isar script, but it still needs work!
paulson
parents: 11316
diff changeset
  2285
1281
68f6be60ab1c The inverse limit construction -- thanks to Sten Agerholm
paulson
parents:
diff changeset
  2286
end