src/HOLCF/Cfun.thy
author huffman
Tue, 11 Oct 2005 23:22:12 +0200
changeset 17832 e18fc1a9a0e0
parent 17817 405fb812e738
child 18076 e2e626b673b3
permissions -rw-r--r--
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15600
a59f07556a8d fixed filename in header
huffman
parents: 15589
diff changeset
     1
(*  Title:      HOLCF/Cfun.thy
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     2
    ID:         $Id$
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     3
    Author:     Franz Regensburger
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     4
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     5
Definition of the type ->  of continuous functions.
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     6
*)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     7
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     8
header {* The type of continuous functions *}
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
     9
15577
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
    10
theory Cfun
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    11
imports Pcpodef
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 16386
diff changeset
    12
uses ("cont_proc.ML")
15577
e16da3068ad6 fix headers
huffman
parents: 15576
diff changeset
    13
begin
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    14
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    15
defaultsort cpo
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    16
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
    17
subsection {* Definition of continuous function type *}
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
    18
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    19
lemma Ex_cont: "\<exists>f. cont f"
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    20
by (rule exI, rule cont_const)
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    21
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    22
lemma adm_cont: "adm cont"
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    23
by (rule admI, rule cont_lub_fun)
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    24
17817
405fb812e738 add names to infix declarations
huffman
parents: 17816
diff changeset
    25
cpodef (CFun)  ('a, 'b) "->" (infixr "->" 0) = "{f::'a => 'b. cont f}"
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    26
by (simp add: Ex_cont adm_cont)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    27
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    28
syntax (xsymbols)
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    29
  "->"     :: "[type, type] => type"      ("(_ \<rightarrow>/ _)" [1,0]0)
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    30
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    31
syntax
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    32
  Rep_CFun :: "('a \<rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b)" ("_$_" [999,1000] 999)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    33
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    34
syntax (xsymbols)
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    35
  Rep_CFun :: "('a \<rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b)" ("(_\<cdot>_)" [999,1000] 999)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    36
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
    37
syntax (HTML output)
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    38
  Rep_CFun :: "('a \<rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'b)" ("(_\<cdot>_)" [999,1000] 999)
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    39
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    40
subsection {* Syntax for continuous lambda abstraction *}
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    41
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    42
syntax
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    43
  "_cabs" :: "[pttrn, 'a] \<Rightarrow> logic"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    44
translations
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    45
  "_cabs x t" == "Abs_CFun (%x. t)"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    46
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    47
text {* To avoid eta-contraction of body: *}
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    48
print_translation {*
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    49
let
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    50
  fun cabs_tr' [Abs abs] =
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    51
    let val (x,t) = atomic_abs_tr' abs
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    52
    in Syntax.const "_cabs" $ x $ t end
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    53
in [("Abs_CFun", cabs_tr')] end
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    54
*}
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    55
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    56
text {* syntax for nested abstractions *}
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    57
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    58
syntax
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    59
  "_Lambda" :: "[pttrns, 'a] \<Rightarrow> logic"  ("(3LAM _./ _)" [0, 10] 10)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    60
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    61
syntax (xsymbols)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    62
  "_Lambda" :: "[pttrns, 'a] \<Rightarrow> logic" ("(3\<Lambda>_./ _)" [0, 10] 10)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    63
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    64
parse_ast_translation {*
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    65
(* rewrites (LAM x y z. t) --> (_cabs x (_cabs y (_cabs z t))) *)
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    66
(* c.f. Syntax.lambda_ast_tr from Syntax/syn_trans.ML *)
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    67
let
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    68
  fun Lambda_ast_tr [pats, body] =
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    69
        Syntax.fold_ast_p "_cabs" (Syntax.unfold_ast "_pttrns" pats, body)
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    70
    | Lambda_ast_tr asts = raise Syntax.AST ("Lambda_ast_tr", asts);
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    71
in [("_Lambda", Lambda_ast_tr)] end
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    72
*}
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    73
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    74
print_ast_translation {*
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    75
(* rewrites (_cabs x (_cabs y (_cabs z t))) --> (LAM x y z. t) *)
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    76
(* c.f. Syntax.abs_ast_tr' from Syntax/syn_trans.ML *)
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    77
let
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    78
  fun cabs_ast_tr' asts =
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    79
    (case Syntax.unfold_ast_p "_cabs"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    80
        (Syntax.Appl (Syntax.Constant "_cabs" :: asts)) of
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    81
      ([], _) => raise Syntax.AST ("cabs_ast_tr'", asts)
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    82
    | (xs, body) => Syntax.Appl
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    83
        [Syntax.Constant "_Lambda", Syntax.fold_ast "_pttrns" xs, body]);
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    84
in [("_cabs", cabs_ast_tr')] end
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
    85
*}
15641
b389f108c485 added theorems eta_cfun and cont2cont_eta
huffman
parents: 15600
diff changeset
    86
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
    87
subsection {* Continuous function space is pointed *}
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
    88
16098
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
    89
lemma UU_CFun: "\<bottom> \<in> CFun"
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
    90
by (simp add: CFun_def inst_fun_pcpo cont_const)
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
    91
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
    92
instance "->" :: (cpo, pcpo) pcpo
16920
ded12c9e88c2 cleaned up
huffman
parents: 16699
diff changeset
    93
by (rule typedef_pcpo [OF type_definition_CFun less_CFun_def UU_CFun])
16098
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
    94
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
    95
lemmas Rep_CFun_strict =
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    96
  typedef_Rep_strict [OF type_definition_CFun less_CFun_def UU_CFun]
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
    97
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
    98
lemmas Abs_CFun_strict =
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
    99
  typedef_Abs_strict [OF type_definition_CFun less_CFun_def UU_CFun]
16098
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
   100
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   101
text {* function application is strict in its first argument *}
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   102
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   103
lemma Rep_CFun_strict1 [simp]: "\<bottom>\<cdot>x = \<bottom>"
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   104
by (simp add: Rep_CFun_strict)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   105
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   106
text {* for compatibility with old HOLCF-Version *}
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   107
lemma inst_cfun_pcpo: "\<bottom> = (\<Lambda> x. \<bottom>)"
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   108
by (simp add: inst_fun_pcpo [symmetric] Abs_CFun_strict)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   109
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   110
subsection {* Basic properties of continuous functions *}
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   111
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   112
text {* Beta-equality for continuous functions *}
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   113
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   114
lemma Abs_CFun_inverse2: "cont f \<Longrightarrow> Rep_CFun (Abs_CFun f) = f"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   115
by (simp add: Abs_CFun_inverse CFun_def)
16098
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
   116
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   117
lemma beta_cfun [simp]: "cont f \<Longrightarrow> (\<Lambda> x. f x)\<cdot>u = f u"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   118
by (simp add: Abs_CFun_inverse2)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   119
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   120
text {* Eta-equality for continuous functions *}
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   121
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   122
lemma eta_cfun: "(\<Lambda> x. f\<cdot>x) = f"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   123
by (rule Rep_CFun_inverse)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   124
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   125
text {* Extensionality for continuous functions *}
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   126
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   127
lemma expand_cfun_eq: "(f = g) = (\<forall>x. f\<cdot>x = g\<cdot>x)"
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   128
by (simp add: Rep_CFun_inject [symmetric] expand_fun_eq)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   129
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   130
lemma ext_cfun: "(\<And>x. f\<cdot>x = g\<cdot>x) \<Longrightarrow> f = g"
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   131
by (simp add: expand_cfun_eq)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   132
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   133
text {* Extensionality wrt. ordering for continuous functions *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   134
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   135
lemma expand_cfun_less: "f \<sqsubseteq> g = (\<forall>x. f\<cdot>x \<sqsubseteq> g\<cdot>x)" 
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   136
by (simp add: less_CFun_def expand_fun_less)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   137
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   138
lemma less_cfun_ext: "(\<And>x. f\<cdot>x \<sqsubseteq> g\<cdot>x) \<Longrightarrow> f \<sqsubseteq> g"
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   139
by (simp add: expand_cfun_less)
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   140
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   141
text {* Congruence for continuous function application *}
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   142
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   143
lemma cfun_cong: "\<lbrakk>f = g; x = y\<rbrakk> \<Longrightarrow> f\<cdot>x = g\<cdot>y"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   144
by simp
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   145
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   146
lemma cfun_fun_cong: "f = g \<Longrightarrow> f\<cdot>x = g\<cdot>x"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   147
by simp
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   148
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   149
lemma cfun_arg_cong: "x = y \<Longrightarrow> f\<cdot>x = f\<cdot>y"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   150
by simp
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   151
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   152
subsection {* Continuity of application *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   153
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   154
lemma cont_Rep_CFun1: "cont (\<lambda>f. f\<cdot>x)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   155
by (rule cont_Rep_CFun [THEN cont2cont_CF1L])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   156
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   157
lemma cont_Rep_CFun2: "cont (\<lambda>x. f\<cdot>x)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   158
apply (rule_tac P = "cont" in CollectD)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   159
apply (fold CFun_def)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   160
apply (rule Rep_CFun)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   161
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   162
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   163
lemmas monofun_Rep_CFun = cont_Rep_CFun [THEN cont2mono]
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   164
lemmas contlub_Rep_CFun = cont_Rep_CFun [THEN cont2contlub]
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   165
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   166
lemmas monofun_Rep_CFun1 = cont_Rep_CFun1 [THEN cont2mono, standard]
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   167
lemmas contlub_Rep_CFun1 = cont_Rep_CFun1 [THEN cont2contlub, standard]
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   168
lemmas monofun_Rep_CFun2 = cont_Rep_CFun2 [THEN cont2mono, standard]
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   169
lemmas contlub_Rep_CFun2 = cont_Rep_CFun2 [THEN cont2contlub, standard]
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   170
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   171
text {* contlub, cont properties of @{term Rep_CFun} in each argument *}
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   172
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   173
lemma contlub_cfun_arg: "chain Y \<Longrightarrow> f\<cdot>(lub (range Y)) = (\<Squnion>i. f\<cdot>(Y i))"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   174
by (rule contlub_Rep_CFun2 [THEN contlubE])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   175
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   176
lemma cont_cfun_arg: "chain Y \<Longrightarrow> range (\<lambda>i. f\<cdot>(Y i)) <<| f\<cdot>(lub (range Y))"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   177
by (rule cont_Rep_CFun2 [THEN contE])
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   178
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   179
lemma contlub_cfun_fun: "chain F \<Longrightarrow> lub (range F)\<cdot>x = (\<Squnion>i. F i\<cdot>x)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   180
by (rule contlub_Rep_CFun1 [THEN contlubE])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   181
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   182
lemma cont_cfun_fun: "chain F \<Longrightarrow> range (\<lambda>i. F i\<cdot>x) <<| lub (range F)\<cdot>x"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   183
by (rule cont_Rep_CFun1 [THEN contE])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   184
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   185
text {* monotonicity of application *}
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   186
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   187
lemma monofun_cfun_fun: "f \<sqsubseteq> g \<Longrightarrow> f\<cdot>x \<sqsubseteq> g\<cdot>x"
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   188
by (simp add: expand_cfun_less)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   189
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   190
lemma monofun_cfun_arg: "x \<sqsubseteq> y \<Longrightarrow> f\<cdot>x \<sqsubseteq> f\<cdot>y"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   191
by (rule monofun_Rep_CFun2 [THEN monofunE])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   192
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   193
lemma monofun_cfun: "\<lbrakk>f \<sqsubseteq> g; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> f\<cdot>x \<sqsubseteq> g\<cdot>y"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   194
by (rule trans_less [OF monofun_cfun_fun monofun_cfun_arg])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   195
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   196
text {* ch2ch - rules for the type @{typ "'a -> 'b"} *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   197
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   198
lemma chain_monofun: "chain Y \<Longrightarrow> chain (\<lambda>i. f\<cdot>(Y i))"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   199
by (erule monofun_Rep_CFun2 [THEN ch2ch_monofun])
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   200
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   201
lemma ch2ch_Rep_CFunR: "chain Y \<Longrightarrow> chain (\<lambda>i. f\<cdot>(Y i))"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   202
by (rule monofun_Rep_CFun2 [THEN ch2ch_monofun])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   203
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   204
lemma ch2ch_Rep_CFunL: "chain F \<Longrightarrow> chain (\<lambda>i. (F i)\<cdot>x)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   205
by (rule monofun_Rep_CFun1 [THEN ch2ch_monofun])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   206
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   207
lemma ch2ch_Rep_CFun: "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> chain (\<lambda>i. (F i)\<cdot>(Y i))"
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   208
apply (rule chainI)
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   209
apply (rule monofun_cfun)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   210
apply (erule chainE)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   211
apply (erule chainE)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   212
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   213
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   214
text {* contlub, cont properties of @{term Rep_CFun} in both arguments *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   215
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   216
lemma contlub_cfun: 
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   217
  "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. F i)\<cdot>(\<Squnion>i. Y i) = (\<Squnion>i. F i\<cdot>(Y i))"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   218
apply (simp only: contlub_cfun_fun)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   219
apply (simp only: contlub_cfun_arg)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   220
apply (rule diag_lub)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   221
apply (erule monofun_Rep_CFun1 [THEN ch2ch_monofun])
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   222
apply (erule monofun_Rep_CFun2 [THEN ch2ch_monofun])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   223
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   224
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   225
lemma cont_cfun: 
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   226
  "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> range (\<lambda>i. F i\<cdot>(Y i)) <<| (\<Squnion>i. F i)\<cdot>(\<Squnion>i. Y i)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   227
apply (rule thelubE)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   228
apply (simp only: ch2ch_Rep_CFun)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   229
apply (simp only: contlub_cfun)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   230
done
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   231
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   232
text {* strictness *}
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   233
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   234
lemma strictI: "f\<cdot>x = \<bottom> \<Longrightarrow> f\<cdot>\<bottom> = \<bottom>"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   235
apply (rule UU_I)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   236
apply (erule subst)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   237
apply (rule minimal [THEN monofun_cfun_arg])
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   238
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   239
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   240
text {* the lub of a chain of continous functions is monotone *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   241
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   242
lemma lub_cfun_mono: "chain F \<Longrightarrow> monofun (\<lambda>x. \<Squnion>i. F i\<cdot>x)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   243
apply (drule ch2ch_monofun [OF monofun_Rep_CFun])
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   244
apply (simp add: thelub_fun [symmetric])
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   245
apply (erule monofun_lub_fun)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   246
apply (simp add: monofun_Rep_CFun2)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   247
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   248
16386
c6f5ade29608 moved continuity simproc to a separate file
huffman
parents: 16314
diff changeset
   249
text {* a lemma about the exchange of lubs for type @{typ "'a -> 'b"} *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   250
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
   251
lemma ex_lub_cfun:
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
   252
  "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> (\<Squnion>j. \<Squnion>i. F j\<cdot>(Y i)) = (\<Squnion>i. \<Squnion>j. F j\<cdot>(Y i))"
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   253
by (simp add: diag_lub ch2ch_Rep_CFunL ch2ch_Rep_CFunR)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   254
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   255
text {* the lub of a chain of cont. functions is continuous *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   256
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   257
lemma cont_lub_cfun: "chain F \<Longrightarrow> cont (\<lambda>x. \<Squnion>i. F i\<cdot>x)"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   258
apply (rule cont2cont_lub)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   259
apply (erule monofun_Rep_CFun [THEN ch2ch_monofun])
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   260
apply (rule cont_Rep_CFun2)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   261
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   262
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   263
text {* type @{typ "'a -> 'b"} is chain complete *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   264
16920
ded12c9e88c2 cleaned up
huffman
parents: 16699
diff changeset
   265
lemma lub_cfun: "chain F \<Longrightarrow> range F <<| (\<Lambda> x. \<Squnion>i. F i\<cdot>x)"
ded12c9e88c2 cleaned up
huffman
parents: 16699
diff changeset
   266
by (simp only: contlub_cfun_fun [symmetric] eta_cfun thelubE)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   267
16920
ded12c9e88c2 cleaned up
huffman
parents: 16699
diff changeset
   268
lemma thelub_cfun: "chain F \<Longrightarrow> lub (range F) = (\<Lambda> x. \<Squnion>i. F i\<cdot>x)"
ded12c9e88c2 cleaned up
huffman
parents: 16699
diff changeset
   269
by (rule lub_cfun [THEN thelubI])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   270
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   271
subsection {* Continuity simplification procedure *}
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   272
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   273
text {* cont2cont lemma for @{term Rep_CFun} *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   274
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   275
lemma cont2cont_Rep_CFun:
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   276
  "\<lbrakk>cont f; cont t\<rbrakk> \<Longrightarrow> cont (\<lambda>x. (f x)\<cdot>(t x))"
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   277
by (best intro: cont2cont_app2 cont_const cont_Rep_CFun cont_Rep_CFun2)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   278
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   279
text {* cont2mono Lemma for @{term "%x. LAM y. c1(x)(y)"} *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   280
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   281
lemma cont2mono_LAM:
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   282
assumes p1: "!!x. cont(c1 x)"
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   283
assumes p2: "!!y. monofun(%x. c1 x y)"
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   284
shows "monofun(%x. LAM y. c1 x y)"
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   285
apply (rule monofunI)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   286
apply (rule less_cfun_ext)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   287
apply (simp add: p1)
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   288
apply (erule p2 [THEN monofunE])
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   289
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   290
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   291
text {* cont2cont Lemma for @{term "%x. LAM y. c1 x y"} *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   292
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   293
lemma cont2cont_LAM:
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   294
assumes p1: "!!x. cont(c1 x)"
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   295
assumes p2: "!!y. cont(%x. c1 x y)"
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   296
shows "cont(%x. LAM y. c1 x y)"
16098
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
   297
apply (rule cont_Abs_CFun)
6aef81a6ddd3 use TypedefPcpo for all class instances
huffman
parents: 16094
diff changeset
   298
apply (simp add: p1 CFun_def)
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   299
apply (simp add: p2 cont2cont_lambda)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   300
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   301
16386
c6f5ade29608 moved continuity simproc to a separate file
huffman
parents: 16314
diff changeset
   302
text {* continuity simplification procedure *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   303
16055
58186c507750 moved continuity simproc to Cfun.thy
huffman
parents: 15641
diff changeset
   304
lemmas cont_lemmas1 =
58186c507750 moved continuity simproc to Cfun.thy
huffman
parents: 15641
diff changeset
   305
  cont_const cont_id cont_Rep_CFun2 cont2cont_Rep_CFun cont2cont_LAM
58186c507750 moved continuity simproc to Cfun.thy
huffman
parents: 15641
diff changeset
   306
16386
c6f5ade29608 moved continuity simproc to a separate file
huffman
parents: 16314
diff changeset
   307
use "cont_proc.ML";
c6f5ade29608 moved continuity simproc to a separate file
huffman
parents: 16314
diff changeset
   308
setup ContProc.setup;
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   309
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   310
(*val cont_tac = (fn i => (resolve_tac cont_lemmas i));*)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   311
(*val cont_tacR = (fn i => (REPEAT (cont_tac i)));*)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   312
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   313
subsection {* Miscellaneous *}
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   314
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   315
text {* Monotonicity of @{term Abs_CFun} *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   316
17832
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   317
lemma semi_monofun_Abs_CFun:
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   318
  "\<lbrakk>cont f; cont g; f \<sqsubseteq> g\<rbrakk> \<Longrightarrow> Abs_CFun f \<sqsubseteq> Abs_CFun g"
e18fc1a9a0e0 rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents: 17817
diff changeset
   319
by (simp add: less_CFun_def Abs_CFun_inverse2)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   320
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   321
text {* some lemmata for functions with flat/chfin domain/range types *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   322
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   323
lemma chfin_Rep_CFunR: "chain (Y::nat => 'a::cpo->'b::chfin)  
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   324
      ==> !s. ? n. lub(range(Y))$s = Y n$s"
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   325
apply (rule allI)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   326
apply (subst contlub_cfun_fun)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   327
apply assumption
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   328
apply (fast intro!: thelubI chfin lub_finch2 chfin2finch ch2ch_Rep_CFunL)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   329
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   330
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   331
subsection {* Continuous injection-retraction pairs *}
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   332
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   333
text {* Continuous retractions are strict. *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   334
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   335
lemma retraction_strict:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   336
  "\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> f\<cdot>\<bottom> = \<bottom>"
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   337
apply (rule UU_I)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   338
apply (drule_tac x="\<bottom>" in spec)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   339
apply (erule subst)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   340
apply (rule monofun_cfun_arg)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   341
apply (rule minimal)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   342
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   343
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   344
lemma injection_eq:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   345
  "\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> (g\<cdot>x = g\<cdot>y) = (x = y)"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   346
apply (rule iffI)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   347
apply (drule_tac f=f in cfun_arg_cong)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   348
apply simp
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   349
apply simp
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   350
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   351
16314
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   352
lemma injection_less:
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   353
  "\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> (g\<cdot>x \<sqsubseteq> g\<cdot>y) = (x \<sqsubseteq> y)"
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   354
apply (rule iffI)
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   355
apply (drule_tac f=f in monofun_cfun_arg)
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   356
apply simp
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   357
apply (erule monofun_cfun_arg)
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   358
done
7102a1aaecfd added theorem injection_less
huffman
parents: 16209
diff changeset
   359
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   360
lemma injection_defined_rev:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   361
  "\<lbrakk>\<forall>x. f\<cdot>(g\<cdot>x) = x; g\<cdot>z = \<bottom>\<rbrakk> \<Longrightarrow> z = \<bottom>"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   362
apply (drule_tac f=f in cfun_arg_cong)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   363
apply (simp add: retraction_strict)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   364
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   365
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   366
lemma injection_defined:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   367
  "\<lbrakk>\<forall>x. f\<cdot>(g\<cdot>x) = x; z \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> g\<cdot>z \<noteq> \<bottom>"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   368
by (erule contrapos_nn, rule injection_defined_rev)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   369
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   370
text {* propagation of flatness and chain-finiteness by retractions *}
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   371
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   372
lemma chfin2chfin:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   373
  "\<forall>y. (f::'a::chfin \<rightarrow> 'b)\<cdot>(g\<cdot>y) = y
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   374
    \<Longrightarrow> \<forall>Y::nat \<Rightarrow> 'b. chain Y \<longrightarrow> (\<exists>n. max_in_chain n Y)"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   375
apply clarify
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   376
apply (drule_tac f=g in chain_monofun)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   377
apply (drule chfin [rule_format])
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   378
apply (unfold max_in_chain_def)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   379
apply (simp add: injection_eq)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   380
done
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   381
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   382
lemma flat2flat:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   383
  "\<forall>y. (f::'a::flat \<rightarrow> 'b::pcpo)\<cdot>(g\<cdot>y) = y
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   384
    \<Longrightarrow> \<forall>x y::'b. x \<sqsubseteq> y \<longrightarrow> x = \<bottom> \<or> x = y"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   385
apply clarify
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   386
apply (drule_tac f=g in monofun_cfun_arg)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   387
apply (drule ax_flat [rule_format])
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   388
apply (erule disjE)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   389
apply (simp add: injection_defined_rev)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   390
apply (simp add: injection_eq)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   391
done
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   392
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   393
text {* a result about functions with flat codomain *}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   394
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   395
lemma flat_eqI: "\<lbrakk>(x::'a::flat) \<sqsubseteq> y; x \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> x = y"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   396
by (drule ax_flat [rule_format], simp)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   397
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   398
lemma flat_codom:
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   399
  "f\<cdot>x = (c::'b::flat) \<Longrightarrow> f\<cdot>\<bottom> = \<bottom> \<or> (\<forall>z. f\<cdot>z = c)"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   400
apply (case_tac "f\<cdot>x = \<bottom>")
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   401
apply (rule disjI1)
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   402
apply (rule UU_I)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   403
apply (erule_tac t="\<bottom>" in subst)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   404
apply (rule minimal [THEN monofun_cfun_arg])
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   405
apply clarify
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   406
apply (rule_tac a = "f\<cdot>\<bottom>" in refl [THEN box_equals])
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   407
apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI])
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   408
apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI])
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   409
done
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   410
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   411
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   412
subsection {* Identity and composition *}
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   413
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   414
consts
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   415
  ID      :: "'a \<rightarrow> 'a"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   416
  cfcomp  :: "('b \<rightarrow> 'c) \<rightarrow> ('a \<rightarrow> 'b) \<rightarrow> 'a \<rightarrow> 'c"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   417
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   418
syntax  "@oo" :: "['b \<rightarrow> 'c, 'a \<rightarrow> 'b] \<Rightarrow> 'a \<rightarrow> 'c" (infixr "oo" 100)
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   419
     
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   420
translations  "f1 oo f2" == "cfcomp$f1$f2"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   421
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   422
defs
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   423
  ID_def: "ID \<equiv> (\<Lambda> x. x)"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   424
  oo_def: "cfcomp \<equiv> (\<Lambda> f g x. f\<cdot>(g\<cdot>x))" 
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   425
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   426
lemma ID1 [simp]: "ID\<cdot>x = x"
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   427
by (simp add: ID_def)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   428
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   429
lemma cfcomp1: "(f oo g) = (\<Lambda> x. f\<cdot>(g\<cdot>x))"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   430
by (simp add: oo_def)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   431
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   432
lemma cfcomp2 [simp]: "(f oo g)\<cdot>x = f\<cdot>(g\<cdot>x)"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   433
by (simp add: cfcomp1)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   434
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   435
text {*
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   436
  Show that interpretation of (pcpo,@{text "_->_"}) is a category.
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   437
  The class of objects is interpretation of syntactical class pcpo.
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   438
  The class of arrows  between objects @{typ 'a} and @{typ 'b} is interpret. of @{typ "'a -> 'b"}.
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   439
  The identity arrow is interpretation of @{term ID}.
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   440
  The composition of f and g is interpretation of @{text "oo"}.
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   441
*}
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   442
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   443
lemma ID2 [simp]: "f oo ID = f"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   444
by (rule ext_cfun, simp)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   445
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   446
lemma ID3 [simp]: "ID oo f = f"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   447
by (rule ext_cfun, simp)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   448
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   449
lemma assoc_oo: "f oo (g oo h) = (f oo g) oo h"
15589
69bea57212ef reordered and arranged for document generation, cleaned up some proofs
huffman
parents: 15577
diff changeset
   450
by (rule ext_cfun, simp)
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   451
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   452
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   453
subsection {* Strictified functions *}
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   454
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   455
defaultsort pcpo
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   456
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   457
constdefs
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   458
  strictify  :: "('a \<rightarrow> 'b) \<rightarrow> 'a \<rightarrow> 'b"
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   459
  "strictify \<equiv> (\<Lambda> f x. if x = \<bottom> then \<bottom> else f\<cdot>x)"
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   460
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   461
text {* results about strictify *}
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   462
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   463
lemma cont_strictify1: "cont (\<lambda>f. if x = \<bottom> then \<bottom> else f\<cdot>x)"
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   464
by (simp add: cont_if)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   465
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   466
lemma monofun_strictify2: "monofun (\<lambda>x. if x = \<bottom> then \<bottom> else f\<cdot>x)"
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   467
apply (rule monofunI)
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   468
apply (auto simp add: monofun_cfun_arg eq_UU_iff [symmetric])
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   469
done
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   470
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   471
(*FIXME: long proof*)
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   472
lemma contlub_strictify2: "contlub (\<lambda>x. if x = \<bottom> then \<bottom> else f\<cdot>x)"
16209
36ee7f6af79f removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents: 16098
diff changeset
   473
apply (rule contlubI)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   474
apply (case_tac "lub (range Y) = \<bottom>")
16699
24b494ff8f0f use new pcpodef package
huffman
parents: 16417
diff changeset
   475
apply (drule (1) chain_UU_I)
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   476
apply (simp add: thelub_const)
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   477
apply (simp del: if_image_distrib)
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   478
apply (simp only: contlub_cfun_arg)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   479
apply (rule lub_equal2)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   480
apply (rule chain_mono2 [THEN exE])
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   481
apply (erule chain_UU_I_inverse2)
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   482
apply (assumption)
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   483
apply (rule_tac x=x in exI, clarsimp)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   484
apply (erule chain_monofun)
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   485
apply (erule monofun_strictify2 [THEN ch2ch_monofun])
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   486
done
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   487
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   488
lemmas cont_strictify2 =
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   489
  monocontlub2cont [OF monofun_strictify2 contlub_strictify2, standard]
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   490
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   491
lemma strictify_conv_if: "strictify\<cdot>f\<cdot>x = (if x = \<bottom> then \<bottom> else f\<cdot>x)"
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   492
by (unfold strictify_def, simp add: cont_strictify1 cont_strictify2)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   493
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   494
lemma strictify1 [simp]: "strictify\<cdot>f\<cdot>\<bottom> = \<bottom>"
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   495
by (simp add: strictify_conv_if)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   496
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   497
lemma strictify2 [simp]: "x \<noteq> \<bottom> \<Longrightarrow> strictify\<cdot>f\<cdot>x = f\<cdot>x"
17815
ccf54e3cabfa removed Istrictify; simplified some proofs
huffman
parents: 16920
diff changeset
   498
by (simp add: strictify_conv_if)
16085
c004b9bc970e rewrote continuous isomorphism section, cleaned up
huffman
parents: 16070
diff changeset
   499
17816
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   500
subsection {* Continuous let-bindings *}
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   501
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   502
constdefs
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   503
  CLet :: "'a \<rightarrow> ('a \<rightarrow> 'b) \<rightarrow> 'b"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   504
  "CLet \<equiv> \<Lambda> s f. f\<cdot>s"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   505
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   506
syntax
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   507
  "_CLet" :: "[letbinds, 'a] => 'a" ("(Let (_)/ in (_))" 10)
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   508
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   509
translations
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   510
  "_CLet (_binds b bs) e" == "_CLet b (_CLet bs e)"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   511
  "Let x = a in e" == "CLet$a$(LAM x. e)"
9942c5ed866a new syntax translations for continuous lambda abstraction
huffman
parents: 17815
diff changeset
   512
15576
efb95d0d01f7 converted to new-style theories, and combined numbered files
huffman
parents:
diff changeset
   513
end