src/HOLCF/Ffun.thy
author huffman
Thu, 31 Jan 2008 21:23:14 +0100
changeset 26025 ca6876116bb4
parent 25923 5fe4b543512e
child 26028 74668c3a8f70
permissions -rw-r--r--
instances for class discrete_cpo
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     1
(*  Title:      HOLCF/FunCpo.thy
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     2
    ID:         $Id$
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     3
    Author:     Franz Regensburger
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     4
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     5
Definition of the partial ordering for the type of all functions => (fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     6
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     7
Class instance of  => (fun) for class pcpo.
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     8
*)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
     9
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    10
header {* Class instances for the full function space *}
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    11
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    12
theory Ffun
25786
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    13
imports Cont
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    14
begin
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    15
18291
4afdf02d9831 changed section names
huffman
parents: 18092
diff changeset
    16
subsection {* Full function space is a partial order *}
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    17
25758
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    18
instantiation "fun"  :: (type, sq_ord) sq_ord
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    19
begin
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    20
25758
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    21
definition
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    22
  less_fun_def: "(op \<sqsubseteq>) \<equiv> (\<lambda>f g. \<forall>x. f x \<sqsubseteq> g x)"  
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    23
25758
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    24
instance ..
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    25
end
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    26
25758
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    27
instance "fun" :: (type, po) po
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    28
proof
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    29
  fix f :: "'a \<Rightarrow> 'b"
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    30
  show "f \<sqsubseteq> f"
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    31
    by (simp add: less_fun_def)
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    32
next
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    33
  fix f g :: "'a \<Rightarrow> 'b"
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    34
  assume "f \<sqsubseteq> g" and "g \<sqsubseteq> f" thus "f = g"
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    35
    by (simp add: less_fun_def expand_fun_eq antisym_less)
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    36
next
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    37
  fix f g h :: "'a \<Rightarrow> 'b"
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    38
  assume "f \<sqsubseteq> g" and "g \<sqsubseteq> h" thus "f \<sqsubseteq> h"
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    39
    unfolding less_fun_def by (fast elim: trans_less)
89c7c22e64b4 update instance proofs to new style
huffman
parents: 20523
diff changeset
    40
qed
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    41
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    42
text {* make the symbol @{text "<<"} accessible for type fun *}
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    43
17831
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
    44
lemma expand_fun_less: "(f \<sqsubseteq> g) = (\<forall>x. f x \<sqsubseteq> g x)"
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    45
by (simp add: less_fun_def)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    46
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    47
lemma less_fun_ext: "(\<And>x. f x \<sqsubseteq> g x) \<Longrightarrow> f \<sqsubseteq> g"
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    48
by (simp add: less_fun_def)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    49
18291
4afdf02d9831 changed section names
huffman
parents: 18092
diff changeset
    50
subsection {* Full function space is chain complete *}
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    51
25786
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    52
text {* function application is monotone *}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    53
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    54
lemma monofun_app: "monofun (\<lambda>f. f x)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    55
by (rule monofunI, simp add: less_fun_def)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    56
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    57
text {* chains of functions yield chains in the po range *}
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    58
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    59
lemma ch2ch_fun: "chain S \<Longrightarrow> chain (\<lambda>i. S i x)"
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    60
by (simp add: chain_def less_fun_def)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    61
18092
2c5d5da79a1e renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents: 17831
diff changeset
    62
lemma ch2ch_lambda: "(\<And>x. chain (\<lambda>i. S i x)) \<Longrightarrow> chain S"
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    63
by (simp add: chain_def less_fun_def)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    64
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    65
text {* upper bounds of function chains yield upper bound in the po range *}
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    66
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    67
lemma ub2ub_fun:
25786
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
    68
  "range (S::nat \<Rightarrow> 'a::type \<Rightarrow> 'b::po) <| u \<Longrightarrow> range (\<lambda>i. S i x) <| u x"
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    69
by (auto simp add: is_ub_def less_fun_def)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    70
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    71
text {* Type @{typ "'a::type => 'b::cpo"} is chain complete *}
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    72
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    73
lemma lub_fun:
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    74
  "chain (S::nat \<Rightarrow> 'a::type \<Rightarrow> 'b::cpo)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    75
    \<Longrightarrow> range S <<| (\<lambda>x. \<Squnion>i. S i x)"
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    76
apply (rule is_lubI)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    77
apply (rule ub_rangeI)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    78
apply (rule less_fun_ext)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    79
apply (rule is_ub_thelub)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    80
apply (erule ch2ch_fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    81
apply (rule less_fun_ext)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    82
apply (rule is_lub_thelub)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    83
apply (erule ch2ch_fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    84
apply (erule ub2ub_fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    85
done
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    86
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    87
lemma thelub_fun:
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    88
  "chain (S::nat \<Rightarrow> 'a::type \<Rightarrow> 'b::cpo)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    89
    \<Longrightarrow> lub (range S) = (\<lambda>x. \<Squnion>i. S i x)"
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    90
by (rule lub_fun [THEN thelubI])
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    91
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    92
lemma cpo_fun:
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    93
  "chain (S::nat \<Rightarrow> 'a::type \<Rightarrow> 'b::cpo) \<Longrightarrow> \<exists>x. range S <<| x"
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    94
by (rule exI, erule lub_fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    95
20523
36a59e5d0039 Major update to function package, including new syntax and the (only theoretical)
krauss
parents: 18291
diff changeset
    96
instance "fun"  :: (type, cpo) cpo
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    97
by intro_classes (rule cpo_fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
    98
25827
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
    99
instance "fun" :: (finite, finite_po) finite_po ..
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   100
26025
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   101
instance "fun" :: (type, discrete_cpo) discrete_cpo
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   102
proof
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   103
  fix f g :: "'a \<Rightarrow> 'b"
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   104
  show "f \<sqsubseteq> g \<longleftrightarrow> f = g" 
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   105
    unfolding expand_fun_less expand_fun_eq
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   106
    by simp
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   107
qed
ca6876116bb4 instances for class discrete_cpo
huffman
parents: 25923
diff changeset
   108
25827
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   109
text {* chain-finite function spaces *}
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   110
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   111
lemma maxinch2maxinch_lambda:
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   112
  "(\<And>x. max_in_chain n (\<lambda>i. S i x)) \<Longrightarrow> max_in_chain n S"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   113
unfolding max_in_chain_def expand_fun_eq by simp
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   114
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   115
lemma maxinch_mono:
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   116
  "\<lbrakk>max_in_chain i Y; i \<le> j\<rbrakk> \<Longrightarrow> max_in_chain j Y"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   117
unfolding max_in_chain_def
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   118
proof (intro allI impI)
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   119
  fix k
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   120
  assume Y: "\<forall>n\<ge>i. Y i = Y n"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   121
  assume ij: "i \<le> j"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   122
  assume jk: "j \<le> k"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   123
  from ij jk have ik: "i \<le> k" by simp
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   124
  from Y ij have Yij: "Y i = Y j" by simp
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   125
  from Y ik have Yik: "Y i = Y k" by simp
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   126
  from Yij Yik show "Y j = Y k" by auto
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   127
qed
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   128
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   129
instance "fun" :: (finite, chfin) chfin
25921
0ca392ab7f37 change class axiom chfin to rule_format
huffman
parents: 25906
diff changeset
   130
proof
25827
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   131
  fix Y :: "nat \<Rightarrow> 'a \<Rightarrow> 'b"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   132
  let ?n = "\<lambda>x. LEAST n. max_in_chain n (\<lambda>i. Y i x)"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   133
  assume "chain Y"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   134
  hence "\<And>x. chain (\<lambda>i. Y i x)"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   135
    by (rule ch2ch_fun)
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   136
  hence "\<And>x. \<exists>n. max_in_chain n (\<lambda>i. Y i x)"
25921
0ca392ab7f37 change class axiom chfin to rule_format
huffman
parents: 25906
diff changeset
   137
    by (rule chfin)
25827
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   138
  hence "\<And>x. max_in_chain (?n x) (\<lambda>i. Y i x)"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   139
    by (rule LeastI_ex)
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   140
  hence "\<And>x. max_in_chain (Max (range ?n)) (\<lambda>i. Y i x)"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   141
    by (rule maxinch_mono [OF _ Max_ge], simp_all)
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   142
  hence "max_in_chain (Max (range ?n)) Y"
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   143
    by (rule maxinch2maxinch_lambda)
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   144
  thus "\<exists>n. max_in_chain n Y" ..
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   145
qed
c2adeb1bae5c new instance proofs for classes finite_po, chfin, flat
huffman
parents: 25786
diff changeset
   146
18291
4afdf02d9831 changed section names
huffman
parents: 18092
diff changeset
   147
subsection {* Full function space is pointed *}
17831
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   148
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   149
lemma minimal_fun: "(\<lambda>x. \<bottom>) \<sqsubseteq> f"
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   150
by (simp add: less_fun_def)
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   151
25786
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   152
lemma least_fun: "\<exists>x::'a::type \<Rightarrow> 'b::pcpo. \<forall>y. x \<sqsubseteq> y"
17831
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   153
apply (rule_tac x = "\<lambda>x. \<bottom>" in exI)
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   154
apply (rule minimal_fun [THEN allI])
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   155
done
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   156
20523
36a59e5d0039 Major update to function package, including new syntax and the (only theoretical)
krauss
parents: 18291
diff changeset
   157
instance "fun"  :: (type, pcpo) pcpo
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   158
by intro_classes (rule least_fun)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   159
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   160
text {* for compatibility with old HOLCF-Version *}
17831
4a8c3f8b0a92 cleaned up; renamed less_fun to expand_fun_less
huffman
parents: 16202
diff changeset
   161
lemma inst_fun_pcpo: "\<bottom> = (\<lambda>x. \<bottom>)"
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   162
by (rule minimal_fun [THEN UU_I, symmetric])
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   163
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   164
text {* function application is strict in the left argument *}
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   165
lemma app_strict [simp]: "\<bottom> x = \<bottom>"
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   166
by (simp add: inst_fun_pcpo)
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   167
25786
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   168
text {*
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   169
  The following results are about application for functions in @{typ "'a=>'b"}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   170
*}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   171
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   172
lemma monofun_fun_fun: "f \<sqsubseteq> g \<Longrightarrow> f x \<sqsubseteq> g x"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   173
by (simp add: less_fun_def)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   174
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   175
lemma monofun_fun_arg: "\<lbrakk>monofun f; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> f x \<sqsubseteq> f y"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   176
by (rule monofunE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   177
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   178
lemma monofun_fun: "\<lbrakk>monofun f; monofun g; f \<sqsubseteq> g; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> f x \<sqsubseteq> g y"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   179
by (rule trans_less [OF monofun_fun_arg monofun_fun_fun])
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   180
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   181
subsection {* Propagation of monotonicity and continuity *}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   182
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   183
text {* the lub of a chain of monotone functions is monotone *}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   184
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   185
lemma monofun_lub_fun:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   186
  "\<lbrakk>chain (F::nat \<Rightarrow> 'a \<Rightarrow> 'b::cpo); \<forall>i. monofun (F i)\<rbrakk>
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   187
    \<Longrightarrow> monofun (\<Squnion>i. F i)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   188
apply (rule monofunI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   189
apply (simp add: thelub_fun)
25923
5fe4b543512e convert lemma lub_mono to rule_format
huffman
parents: 25921
diff changeset
   190
apply (rule lub_mono)
25786
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   191
apply (erule ch2ch_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   192
apply (erule ch2ch_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   193
apply (simp add: monofunE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   194
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   195
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   196
text {* the lub of a chain of continuous functions is continuous *}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   197
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   198
declare range_composition [simp del]
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   199
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   200
lemma contlub_lub_fun:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   201
  "\<lbrakk>chain F; \<forall>i. cont (F i)\<rbrakk> \<Longrightarrow> contlub (\<Squnion>i. F i)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   202
apply (rule contlubI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   203
apply (simp add: thelub_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   204
apply (simp add: cont2contlubE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   205
apply (rule ex_lub)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   206
apply (erule ch2ch_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   207
apply (simp add: ch2ch_cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   208
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   209
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   210
lemma cont_lub_fun:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   211
  "\<lbrakk>chain F; \<forall>i. cont (F i)\<rbrakk> \<Longrightarrow> cont (\<Squnion>i. F i)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   212
apply (rule monocontlub2cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   213
apply (erule monofun_lub_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   214
apply (simp add: cont2mono)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   215
apply (erule (1) contlub_lub_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   216
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   217
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   218
lemma cont2cont_lub:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   219
  "\<lbrakk>chain F; \<And>i. cont (F i)\<rbrakk> \<Longrightarrow> cont (\<lambda>x. \<Squnion>i. F i x)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   220
by (simp add: thelub_fun [symmetric] cont_lub_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   221
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   222
lemma mono2mono_fun: "monofun f \<Longrightarrow> monofun (\<lambda>x. f x y)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   223
apply (rule monofunI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   224
apply (erule (1) monofun_fun_arg [THEN monofun_fun_fun])
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   225
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   226
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   227
lemma cont2cont_fun: "cont f \<Longrightarrow> cont (\<lambda>x. f x y)"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   228
apply (rule monocontlub2cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   229
apply (erule cont2mono [THEN mono2mono_fun])
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   230
apply (rule contlubI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   231
apply (simp add: cont2contlubE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   232
apply (simp add: thelub_fun ch2ch_cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   233
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   234
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   235
text {* Note @{text "(\<lambda>x. \<lambda>y. f x y) = f"} *}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   236
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   237
lemma mono2mono_lambda: "(\<And>y. monofun (\<lambda>x. f x y)) \<Longrightarrow> monofun f"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   238
apply (rule monofunI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   239
apply (rule less_fun_ext)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   240
apply (blast dest: monofunE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   241
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   242
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   243
lemma cont2cont_lambda: "(\<And>y. cont (\<lambda>x. f x y)) \<Longrightarrow> cont f"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   244
apply (subgoal_tac "monofun f")
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   245
apply (rule monocontlub2cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   246
apply assumption
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   247
apply (rule contlubI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   248
apply (rule ext)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   249
apply (simp add: thelub_fun ch2ch_monofun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   250
apply (blast dest: cont2contlubE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   251
apply (simp add: mono2mono_lambda cont2mono)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   252
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   253
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   254
text {* What D.A.Schmidt calls continuity of abstraction; never used here *}
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   255
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   256
lemma contlub_lambda:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   257
  "(\<And>x::'a::type. chain (\<lambda>i. S i x::'b::cpo))
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   258
    \<Longrightarrow> (\<lambda>x. \<Squnion>i. S i x) = (\<Squnion>i. (\<lambda>x. S i x))"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   259
by (simp add: thelub_fun ch2ch_lambda)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   260
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   261
lemma contlub_abstraction:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   262
  "\<lbrakk>chain Y; \<forall>y. cont (\<lambda>x.(c::'a::cpo\<Rightarrow>'b::type\<Rightarrow>'c::cpo) x y)\<rbrakk> \<Longrightarrow>
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   263
    (\<lambda>y. \<Squnion>i. c (Y i) y) = (\<Squnion>i. (\<lambda>y. c (Y i) y))"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   264
apply (rule thelub_fun [symmetric])
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   265
apply (rule ch2ch_cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   266
apply (simp add: cont2cont_lambda)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   267
apply assumption
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   268
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   269
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   270
lemma mono2mono_app:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   271
  "\<lbrakk>monofun f; \<forall>x. monofun (f x); monofun t\<rbrakk> \<Longrightarrow> monofun (\<lambda>x. (f x) (t x))"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   272
apply (rule monofunI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   273
apply (simp add: monofun_fun monofunE)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   274
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   275
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   276
lemma cont2contlub_app:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   277
  "\<lbrakk>cont f; \<forall>x. cont (f x); cont t\<rbrakk> \<Longrightarrow> contlub (\<lambda>x. (f x) (t x))"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   278
apply (rule contlubI)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   279
apply (subgoal_tac "chain (\<lambda>i. f (Y i))")
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   280
apply (subgoal_tac "chain (\<lambda>i. t (Y i))")
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   281
apply (simp add: cont2contlubE thelub_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   282
apply (rule diag_lub)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   283
apply (erule ch2ch_fun)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   284
apply (drule spec)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   285
apply (erule (1) ch2ch_cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   286
apply (erule (1) ch2ch_cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   287
apply (erule (1) ch2ch_cont)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   288
done
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   289
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   290
lemma cont2cont_app:
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   291
  "\<lbrakk>cont f; \<forall>x. cont (f x); cont t\<rbrakk> \<Longrightarrow> cont (\<lambda>x. (f x) (t x))"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   292
by (blast intro: monocontlub2cont mono2mono_app cont2mono cont2contlub_app)
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   293
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   294
lemmas cont2cont_app2 = cont2cont_app [rule_format]
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   295
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   296
lemma cont2cont_app3: "\<lbrakk>cont f; cont t\<rbrakk> \<Longrightarrow> cont (\<lambda>x. f (t x))"
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   297
by (rule cont2cont_app2 [OF cont_const])
6b3c79acac1f move lemmas from Cont.thy to Ffun.thy;
huffman
parents: 25758
diff changeset
   298
16202
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   299
end
61811f31ce5a renamed FunCpo theory to Ffun; added theorems ch2ch_fun_rev and app_strict
huffman
parents:
diff changeset
   300