src/HOLCF/Bifinite.thy
author ballarin
Tue, 16 Sep 2008 12:25:26 +0200
changeset 28234 fc420a5cf72e
parent 27402 253a06dfadce
child 29138 661a8db7e647
child 29237 e90d9d51106b
permissions -rw-r--r--
Do not rely on locale assumption in interpretation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     1
(*  Title:      HOLCF/Bifinite.thy
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     2
    ID:         $Id$
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     3
    Author:     Brian Huffman
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     4
*)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     5
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     6
header {* Bifinite domains and approximation *}
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     7
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     8
theory Bifinite
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
     9
imports Deflation
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    10
begin
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    11
26407
562a1d615336 rename class bifinite_cpo to profinite; generalize powerdomains from bifinite to profinite
huffman
parents: 25923
diff changeset
    12
subsection {* Omega-profinite and bifinite domains *}
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    13
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
    14
class profinite = cpo +
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
    15
  fixes approx :: "nat \<Rightarrow> 'a \<rightarrow> 'a"
27310
d0229bc6c461 simplify profinite class axioms
huffman
parents: 27309
diff changeset
    16
  assumes chain_approx [simp]: "chain approx"
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
    17
  assumes lub_approx_app [simp]: "(\<Squnion>i. approx i\<cdot>x) = x"
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
    18
  assumes approx_idem: "approx i\<cdot>(approx i\<cdot>x) = approx i\<cdot>x"
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
    19
  assumes finite_fixes_approx: "finite {x. approx i\<cdot>x = x}"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    20
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
    21
class bifinite = profinite + pcpo
25909
6b96b9392873 add class bifinite_cpo for possibly-unpointed bifinite domains
huffman
parents: 25903
diff changeset
    22
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    23
lemma approx_less: "approx i\<cdot>x \<sqsubseteq> x"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    24
proof -
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    25
  have "chain (\<lambda>i. approx i\<cdot>x)" by simp
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    26
  hence "approx i\<cdot>x \<sqsubseteq> (\<Squnion>i. approx i\<cdot>x)" by (rule is_ub_thelub)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    27
  thus "approx i\<cdot>x \<sqsubseteq> x" by simp
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    28
qed
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    29
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    30
lemma finite_deflation_approx: "finite_deflation (approx i)"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    31
proof
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    32
  fix x :: 'a
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    33
  show "approx i\<cdot>(approx i\<cdot>x) = approx i\<cdot>x"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    34
    by (rule approx_idem)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    35
  show "approx i\<cdot>x \<sqsubseteq> x"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    36
    by (rule approx_less)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    37
  show "finite {x. approx i\<cdot>x = x}"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    38
    by (rule finite_fixes_approx)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    39
qed
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    40
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    41
interpretation approx: finite_deflation ["approx i"]
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    42
by (rule finite_deflation_approx)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    43
28234
fc420a5cf72e Do not rely on locale assumption in interpretation.
ballarin
parents: 27402
diff changeset
    44
lemma (in deflation) deflation: "deflation d" ..
fc420a5cf72e Do not rely on locale assumption in interpretation.
ballarin
parents: 27402
diff changeset
    45
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    46
lemma deflation_approx: "deflation (approx i)"
28234
fc420a5cf72e Do not rely on locale assumption in interpretation.
ballarin
parents: 27402
diff changeset
    47
by (rule approx.deflation)
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    48
27186
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    49
lemma lub_approx [simp]: "(\<Squnion>i. approx i) = (\<Lambda> x. x)"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    50
by (rule ext_cfun, simp add: contlub_cfun_fun)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    51
27309
c74270fd72a8 clean up and rename some profinite lemmas
huffman
parents: 27186
diff changeset
    52
lemma approx_strict [simp]: "approx i\<cdot>\<bottom> = \<bottom>"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    53
by (rule UU_I, rule approx_less)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    54
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    55
lemma approx_approx1:
27186
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    56
  "i \<le> j \<Longrightarrow> approx i\<cdot>(approx j\<cdot>x) = approx i\<cdot>x"
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    57
apply (rule deflation_less_comp1 [OF deflation_approx deflation_approx])
25922
cb04d05e95fb rename lemma chain_mono3 -> chain_mono, chain_mono -> chain_mono_less
huffman
parents: 25909
diff changeset
    58
apply (erule chain_mono [OF chain_approx])
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    59
done
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    60
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    61
lemma approx_approx2:
27186
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    62
  "j \<le> i \<Longrightarrow> approx i\<cdot>(approx j\<cdot>x) = approx j\<cdot>x"
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    63
apply (rule deflation_less_comp2 [OF deflation_approx deflation_approx])
25922
cb04d05e95fb rename lemma chain_mono3 -> chain_mono, chain_mono -> chain_mono_less
huffman
parents: 25909
diff changeset
    64
apply (erule chain_mono [OF chain_approx])
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    65
done
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    66
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    67
lemma approx_approx [simp]:
27186
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    68
  "approx i\<cdot>(approx j\<cdot>x) = approx (min i j)\<cdot>x"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    69
apply (rule_tac x=i and y=j in linorder_le_cases)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    70
apply (simp add: approx_approx1 min_def)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    71
apply (simp add: approx_approx2 min_def)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    72
done
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    73
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    74
lemma finite_image_approx: "finite ((\<lambda>x. approx n\<cdot>x) ` A)"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    75
by (rule approx.finite_image)
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    76
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    77
lemma finite_range_approx: "finite (range (\<lambda>x. approx i\<cdot>x))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    78
by (rule approx.finite_range)
27186
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    79
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    80
lemma compact_approx [simp]: "compact (approx n\<cdot>x)"
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    81
by (rule approx.compact)
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    82
27309
c74270fd72a8 clean up and rename some profinite lemmas
huffman
parents: 27186
diff changeset
    83
lemma profinite_compact_eq_approx: "compact x \<Longrightarrow> \<exists>i. approx i\<cdot>x = x"
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
    84
by (rule admD2, simp_all)
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    85
27309
c74270fd72a8 clean up and rename some profinite lemmas
huffman
parents: 27186
diff changeset
    86
lemma profinite_compact_iff: "compact x \<longleftrightarrow> (\<exists>n. approx n\<cdot>x = x)"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    87
 apply (rule iffI)
27309
c74270fd72a8 clean up and rename some profinite lemmas
huffman
parents: 27186
diff changeset
    88
  apply (erule profinite_compact_eq_approx)
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    89
 apply (erule exE)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    90
 apply (erule subst)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    91
 apply (rule compact_approx)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    92
done
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    93
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    94
lemma approx_induct:
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    95
  assumes adm: "adm P" and P: "\<And>n x. P (approx n\<cdot>x)"
27186
416d66c36d8f add lemma finite_image_approx; remove unnecessary sort annotations
huffman
parents: 26962
diff changeset
    96
  shows "P x"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    97
proof -
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    98
  have "P (\<Squnion>n. approx n\<cdot>x)"
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    99
    by (rule admD [OF adm], simp, simp add: P)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   100
  thus "P x" by simp
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   101
qed
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   102
27309
c74270fd72a8 clean up and rename some profinite lemmas
huffman
parents: 27186
diff changeset
   103
lemma profinite_less_ext: "(\<And>i. approx i\<cdot>x \<sqsubseteq> approx i\<cdot>y) \<Longrightarrow> x \<sqsubseteq> y"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   104
apply (subgoal_tac "(\<Squnion>i. approx i\<cdot>x) \<sqsubseteq> (\<Squnion>i. approx i\<cdot>y)", simp)
25923
5fe4b543512e convert lemma lub_mono to rule_format
huffman
parents: 25922
diff changeset
   105
apply (rule lub_mono, simp, simp, simp)
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   106
done
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   107
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   108
subsection {* Instance for continuous function space *}
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   109
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   110
lemma finite_range_cfun_lemma:
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   111
  assumes a: "finite (range (\<lambda>x. a\<cdot>x))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   112
  assumes b: "finite (range (\<lambda>y. b\<cdot>y))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   113
  shows "finite (range (\<lambda>f. \<Lambda> x. b\<cdot>(f\<cdot>(a\<cdot>x))))"  (is "finite (range ?h)")
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   114
proof (rule finite_imageD)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   115
  let ?f = "\<lambda>g. range (\<lambda>x. (a\<cdot>x, g\<cdot>x))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   116
  show "finite (?f ` range ?h)"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   117
  proof (rule finite_subset)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   118
    let ?B = "Pow (range (\<lambda>x. a\<cdot>x) \<times> range (\<lambda>y. b\<cdot>y))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   119
    show "?f ` range ?h \<subseteq> ?B"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   120
      by clarsimp
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   121
    show "finite ?B"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   122
      by (simp add: a b)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   123
  qed
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   124
  show "inj_on ?f (range ?h)"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   125
  proof (rule inj_onI, rule ext_cfun, clarsimp)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   126
    fix x f g
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   127
    assume "range (\<lambda>x. (a\<cdot>x, b\<cdot>(f\<cdot>(a\<cdot>x)))) = range (\<lambda>x. (a\<cdot>x, b\<cdot>(g\<cdot>(a\<cdot>x))))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   128
    hence "range (\<lambda>x. (a\<cdot>x, b\<cdot>(f\<cdot>(a\<cdot>x)))) \<subseteq> range (\<lambda>x. (a\<cdot>x, b\<cdot>(g\<cdot>(a\<cdot>x))))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   129
      by (rule equalityD1)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   130
    hence "(a\<cdot>x, b\<cdot>(f\<cdot>(a\<cdot>x))) \<in> range (\<lambda>x. (a\<cdot>x, b\<cdot>(g\<cdot>(a\<cdot>x))))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   131
      by (simp add: subset_eq)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   132
    then obtain y where "(a\<cdot>x, b\<cdot>(f\<cdot>(a\<cdot>x))) = (a\<cdot>y, b\<cdot>(g\<cdot>(a\<cdot>y)))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   133
      by (rule rangeE)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   134
    thus "b\<cdot>(f\<cdot>(a\<cdot>x)) = b\<cdot>(g\<cdot>(a\<cdot>x))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   135
      by clarsimp
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   136
  qed
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   137
qed
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   138
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   139
instantiation "->" :: (profinite, profinite) profinite
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   140
begin
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   141
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   142
definition
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   143
  approx_cfun_def:
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   144
    "approx = (\<lambda>n. \<Lambda> f x. approx n\<cdot>(f\<cdot>(approx n\<cdot>x)))"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   145
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   146
instance proof
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   147
  show "chain (approx :: nat \<Rightarrow> ('a \<rightarrow> 'b) \<rightarrow> ('a \<rightarrow> 'b))"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   148
    unfolding approx_cfun_def by simp
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   149
next
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   150
  fix x :: "'a \<rightarrow> 'b"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   151
  show "(\<Squnion>i. approx i\<cdot>x) = x"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   152
    unfolding approx_cfun_def
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   153
    by (simp add: lub_distribs eta_cfun)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   154
next
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   155
  fix i :: nat and x :: "'a \<rightarrow> 'b"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   156
  show "approx i\<cdot>(approx i\<cdot>x) = approx i\<cdot>x"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   157
    unfolding approx_cfun_def by simp
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   158
next
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   159
  fix i :: nat
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   160
  show "finite {x::'a \<rightarrow> 'b. approx i\<cdot>x = x}"
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   161
    apply (rule finite_range_imp_finite_fixes)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   162
    apply (simp add: approx_cfun_def)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   163
    apply (intro finite_range_cfun_lemma finite_range_approx)
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   164
    done
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   165
qed
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   166
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   167
end
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   168
26407
562a1d615336 rename class bifinite_cpo to profinite; generalize powerdomains from bifinite to profinite
huffman
parents: 25923
diff changeset
   169
instance "->" :: (profinite, bifinite) bifinite ..
25909
6b96b9392873 add class bifinite_cpo for possibly-unpointed bifinite domains
huffman
parents: 25903
diff changeset
   170
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   171
lemma approx_cfun: "approx n\<cdot>f\<cdot>x = approx n\<cdot>(f\<cdot>(approx n\<cdot>x))"
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   172
by (simp add: approx_cfun_def)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   173
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   174
end