src/HOLCF/Pcpo.thy
author huffman
Fri, 04 Mar 2005 23:12:36 +0100
changeset 15576 efb95d0d01f7
parent 15563 9e125b675253
child 15577 e16da3068ad6
permissions -rw-r--r--
converted to new-style theories, and combined numbered files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
     1
(*  Title:      HOLCF/Pcpo.thy
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
     2
    ID:         $Id$
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
     3
    Author:     Franz Regensburger
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
     5
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
     6
introduction of the classes cpo and pcpo 
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
     7
*)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
     8
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
     9
header {* Classes cpo and pcpo *}
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
    10
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    11
theory Pcpo = Porder:
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    12
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    13
(* The class cpo of chain complete partial orders *)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    14
(* ********************************************** *)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    15
axclass cpo < po
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    16
        (* class axiom: *)
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    17
  cpo:   "chain S ==> ? x. range S <<| x" 
2394
91d8abf108be adaptions for symbol font
oheimb
parents: 2291
diff changeset
    18
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    19
(* The class pcpo of pointed cpos *)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    20
(* ****************************** *)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    21
axclass pcpo < cpo
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    22
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    23
  least:         "? x.!y. x<<y"
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    24
2394
91d8abf108be adaptions for symbol font
oheimb
parents: 2291
diff changeset
    25
consts
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    26
  UU            :: "'a::pcpo"        
2394
91d8abf108be adaptions for symbol font
oheimb
parents: 2291
diff changeset
    27
12114
a8e860c86252 eliminated old "symbols" syntax, use "xsymbols" instead;
wenzelm
parents: 12030
diff changeset
    28
syntax (xsymbols)
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    29
  UU            :: "'a::pcpo"                           ("\<bottom>")
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    30
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2394
diff changeset
    31
defs
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    32
  UU_def:        "UU == @x.!y. x<<y"       
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    33
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    34
(* further useful classes for HOLCF domains *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    35
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    36
axclass chfin<cpo
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    37
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    38
chfin: 	"!Y. chain Y-->(? n. max_in_chain n Y)"
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    39
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    40
axclass flat<pcpo
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
    41
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    42
ax_flat:	 	"! x y. x << y --> (x = UU) | (x=y)"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    43
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    44
(*  Title:      HOLCF/Pcpo.ML
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    45
    ID:         $Id$
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    46
    Author:     Franz Regensburger
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    47
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    48
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    49
introduction of the classes cpo and pcpo 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    50
*)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    51
 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    52
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    53
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    54
(* derive the old rule minimal                                              *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    55
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    56
 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    57
lemma UU_least: "ALL z. UU << z"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    58
apply (unfold UU_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    59
apply (rule some_eq_ex [THEN iffD2])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    60
apply (rule least)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    61
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    62
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    63
lemmas minimal = UU_least [THEN spec, standard]
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    64
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    65
declare minimal [iff]
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    66
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    67
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    68
(* in cpo's everthing equal to THE lub has lub properties for every chain  *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    69
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    70
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    71
lemma thelubE: "[| chain(S); lub(range(S)) = (l::'a::cpo) |] ==> range(S) <<| l "
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    72
apply (blast dest: cpo intro: lubI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    73
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    74
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    75
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    76
(* Properties of the lub                                                    *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    77
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    78
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    79
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    80
lemma is_ub_thelub: "chain (S::nat => 'a::cpo) ==> S(x) << lub(range(S))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    81
apply (blast dest: cpo intro: lubI [THEN is_ub_lub])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    82
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    83
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    84
lemma is_lub_thelub: "[| chain (S::nat => 'a::cpo); range(S) <| x |] ==> lub(range S) << x"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    85
apply (blast dest: cpo intro: lubI [THEN is_lub_lub])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    86
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    87
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    88
lemma lub_range_mono: "[| range X <= range Y;  chain Y; chain (X::nat=>'a::cpo) |] ==> lub(range X) << lub(range Y)"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    89
apply (erule is_lub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    90
apply (rule ub_rangeI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    91
apply (subgoal_tac "? j. X i = Y j")
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    92
apply  clarsimp
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    93
apply  (erule is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    94
apply auto
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    95
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    96
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    97
lemma lub_range_shift: "chain (Y::nat=>'a::cpo) ==> lub(range (%i. Y(i + j))) = lub(range Y)"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    98
apply (rule antisym_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
    99
apply (rule lub_range_mono)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   100
apply    fast
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   101
apply   assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   102
apply (erule chain_shift)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   103
apply (rule is_lub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   104
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   105
apply (rule ub_rangeI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   106
apply (rule trans_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   107
apply (rule_tac [2] is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   108
apply (erule_tac [2] chain_shift)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   109
apply (erule chain_mono3)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   110
apply (rule le_add1)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   111
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   112
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   113
lemma maxinch_is_thelub: "chain Y ==> max_in_chain i Y = (lub(range(Y)) = ((Y i)::'a::cpo))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   114
apply (rule iffI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   115
apply (fast intro!: thelubI lub_finch1)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   116
apply (unfold max_in_chain_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   117
apply (safe intro!: antisym_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   118
apply (fast elim!: chain_mono3)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   119
apply (drule sym)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   120
apply (force elim!: is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   121
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   122
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   123
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   124
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   125
(* the << relation between two chains is preserved by their lubs            *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   126
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   127
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   128
lemma lub_mono: "[|chain(C1::(nat=>'a::cpo));chain(C2); ALL k. C1(k) << C2(k)|] 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   129
      ==> lub(range(C1)) << lub(range(C2))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   130
apply (erule is_lub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   131
apply (rule ub_rangeI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   132
apply (rule trans_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   133
apply (erule spec)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   134
apply (erule is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   135
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   136
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   137
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   138
(* the = relation between two chains is preserved by their lubs            *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   139
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   140
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   141
lemma lub_equal: "[| chain(C1::(nat=>'a::cpo));chain(C2);ALL k. C1(k)=C2(k)|] 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   142
      ==> lub(range(C1))=lub(range(C2))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   143
apply (rule antisym_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   144
apply (rule lub_mono)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   145
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   146
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   147
apply (intro strip)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   148
apply (rule antisym_less_inverse [THEN conjunct1])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   149
apply (erule spec)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   150
apply (rule lub_mono)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   151
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   152
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   153
apply (intro strip)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   154
apply (rule antisym_less_inverse [THEN conjunct2])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   155
apply (erule spec)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   156
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   157
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   158
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   159
(* more results about mono and = of lubs of chains                          *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   160
(* ------------------------------------------------------------------------ *)
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 2640
diff changeset
   161
15563
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   162
lemma lub_mono2: "[|EX j. ALL i. j<i --> X(i::nat)=Y(i);chain(X::nat=>'a::cpo);chain(Y)|] 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   163
  ==> lub(range(X))<<lub(range(Y))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   164
apply (erule exE)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   165
apply (rule is_lub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   166
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   167
apply (rule ub_rangeI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   168
(* apply (intro strip) *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   169
apply (case_tac "j<i")
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   170
apply (rule_tac s = "Y (i) " and t = "X (i) " in subst)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   171
apply (rule sym)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   172
apply fast
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   173
apply (rule is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   174
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   175
apply (rule_tac y = "X (Suc (j))" in trans_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   176
apply (rule chain_mono)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   177
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   178
apply (rule not_less_eq [THEN subst])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   179
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   180
apply (rule_tac s = "Y (Suc (j))" and t = "X (Suc (j))" in subst)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   181
apply (simp (no_asm_simp))
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   182
apply (erule is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   183
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   184
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   185
lemma lub_equal2: "[|EX j. ALL i. j<i --> X(i)=Y(i); chain(X::nat=>'a::cpo); chain(Y)|] 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   186
      ==> lub(range(X))=lub(range(Y))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   187
apply (blast intro: antisym_less lub_mono2 sym)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   188
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   189
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   190
lemma lub_mono3: "[|chain(Y::nat=>'a::cpo);chain(X); 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   191
 ALL i. EX j. Y(i)<< X(j)|]==> lub(range(Y))<<lub(range(X))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   192
apply (rule is_lub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   193
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   194
apply (rule ub_rangeI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   195
(* apply (intro strip) *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   196
apply (erule allE)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   197
apply (erule exE)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   198
apply (rule trans_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   199
apply (rule_tac [2] is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   200
prefer 2 apply (assumption)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   201
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   202
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   203
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   204
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   205
(* usefull lemmas about UU                                                  *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   206
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   207
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   208
lemma eq_UU_iff: "(x=UU)=(x<<UU)"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   209
apply (rule iffI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   210
apply (erule ssubst)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   211
apply (rule refl_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   212
apply (rule antisym_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   213
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   214
apply (rule minimal)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   215
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   216
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   217
lemma UU_I: "x << UU ==> x = UU"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   218
apply (subst eq_UU_iff)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   219
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   220
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   221
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   222
lemma not_less2not_eq: "~(x::'a::po)<<y ==> ~x=y"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   223
apply auto
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   224
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   225
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   226
lemma chain_UU_I: "[|chain(Y);lub(range(Y))=UU|] ==> ALL i. Y(i)=UU"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   227
apply (rule allI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   228
apply (rule antisym_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   229
apply (rule_tac [2] minimal)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   230
apply (erule subst)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   231
apply (erule is_ub_thelub)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   232
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   233
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   234
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   235
lemma chain_UU_I_inverse: "ALL i. Y(i::nat)=UU ==> lub(range(Y::(nat=>'a::pcpo)))=UU"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   236
apply (rule lub_chain_maxelem)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   237
apply (erule spec)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   238
apply (rule allI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   239
apply (rule antisym_less_inverse [THEN conjunct1])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   240
apply (erule spec)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   241
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   242
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   243
lemma chain_UU_I_inverse2: "~lub(range(Y::(nat=>'a::pcpo)))=UU ==> EX i.~ Y(i)=UU"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   244
apply (blast intro: chain_UU_I_inverse)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   245
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   246
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   247
lemma notUU_I: "[| x<<y; ~x=UU |] ==> ~y=UU"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   248
apply (blast intro: UU_I)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   249
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   250
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   251
lemma chain_mono2: 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   252
 "[|EX j. ~Y(j)=UU;chain(Y::nat=>'a::pcpo)|] ==> EX j. ALL i. j<i-->~Y(i)=UU"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   253
apply (blast dest: notUU_I chain_mono)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   254
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   255
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   256
(**************************************)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   257
(* some properties for chfin and flat *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   258
(**************************************)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   259
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   260
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   261
(* flat types are chfin                                              *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   262
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   263
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   264
(*Used only in an "instance" declaration (Fun1.thy)*)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   265
lemma flat_imp_chfin: 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   266
     "ALL Y::nat=>'a::flat. chain Y --> (EX n. max_in_chain n Y)"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   267
apply (unfold max_in_chain_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   268
apply clarify
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   269
apply (case_tac "ALL i. Y (i) =UU")
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   270
apply (rule_tac x = "0" in exI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   271
apply (simp (no_asm_simp))
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   272
apply simp
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   273
apply (erule exE)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   274
apply (rule_tac x = "i" in exI)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   275
apply (intro strip)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   276
apply (erule le_imp_less_or_eq [THEN disjE])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   277
apply safe
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   278
apply (blast dest: chain_mono ax_flat [THEN spec, THEN spec, THEN mp])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   279
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   280
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   281
(* flat subclass of chfin --> adm_flat not needed *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   282
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   283
lemma flat_eq: "(a::'a::flat) ~= UU ==> a << b = (a = b)"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   284
apply (safe intro!: refl_less)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   285
apply (drule ax_flat [THEN spec, THEN spec, THEN mp])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   286
apply (fast intro!: refl_less ax_flat [THEN spec, THEN spec, THEN mp])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   287
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   288
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   289
lemma chfin2finch: "chain (Y::nat=>'a::chfin) ==> finite_chain Y"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   290
apply (force simp add: chfin finite_chain_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   291
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   292
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   293
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   294
(* lemmata for improved admissibility introdution rule                      *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   295
(* ------------------------------------------------------------------------ *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   296
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   297
lemma infinite_chain_adm_lemma:
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   298
"[|chain Y; ALL i. P (Y i);  
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   299
   (!!Y. [| chain Y; ALL i. P (Y i); ~ finite_chain Y |] ==> P (lub(range Y))) 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   300
  |] ==> P (lub (range Y))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   301
(* apply (cut_tac prems) *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   302
apply (case_tac "finite_chain Y")
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   303
prefer 2 apply fast
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   304
apply (unfold finite_chain_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   305
apply safe
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   306
apply (erule lub_finch1 [THEN thelubI, THEN ssubst])
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   307
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   308
apply (erule spec)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   309
done
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   310
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   311
lemma increasing_chain_adm_lemma:
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   312
"[|chain Y;  ALL i. P (Y i);  
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   313
   (!!Y. [| chain Y; ALL i. P (Y i);   
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   314
            ALL i. EX j. i < j & Y i ~= Y j & Y i << Y j|] 
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   315
  ==> P (lub (range Y))) |] ==> P (lub (range Y))"
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   316
(* apply (cut_tac prems) *)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   317
apply (erule infinite_chain_adm_lemma)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   318
apply assumption
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   319
apply (erule thin_rl)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   320
apply (unfold finite_chain_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   321
apply (unfold max_in_chain_def)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   322
apply (fast dest: le_imp_less_or_eq elim: chain_mono)
9e125b675253 converted to new-style theory
huffman
parents: 14981
diff changeset
   323
done
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
   324
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
   325
instance flat<chfin
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
   326
apply (intro_classes)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
   327
apply (rule flat_imp_chfin)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
   328
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents: 15563
diff changeset
   329
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   330
end