src/HOLCF/Bifinite.thy
author huffman
Tue, 09 Nov 2010 16:37:13 -0800
changeset 40491 6de5839e2fb3
parent 40484 768f7e264e2b
child 40493 c45a3f8a86ea
permissions -rw-r--r--
add 'predomain' class: unpointed version of bifinite
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
    Author:     Brian Huffman
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     3
*)
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     4
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
     5
header {* Bifinite domains *}
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     6
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     7
theory Bifinite
40086
c339c0e8fdfb minimize imports
huffman
parents: 40012
diff changeset
     8
imports Algebraic Cprod Sprod Ssum Up Lift One Tr Countable
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
     9
begin
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
    10
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    11
subsection {* Class of bifinite domains *}
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    12
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    13
text {*
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    14
  We define a bifinite domain as a pcpo that is isomorphic to some
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    15
  algebraic deflation over the universal domain.
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    16
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    17
  A predomain is a cpo that, when lifted, becomes bifinite.
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    18
*}
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    19
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    20
class predomain = cpo +
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    21
  fixes liftdefl :: "('a::cpo) itself \<Rightarrow> defl"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    22
  fixes liftemb :: "'a\<^sub>\<bottom> \<rightarrow> udom"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    23
  fixes liftprj :: "udom \<rightarrow> 'a\<^sub>\<bottom>"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    24
  assumes predomain_ep: "ep_pair liftemb liftprj"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    25
  assumes cast_liftdefl: "cast\<cdot>(liftdefl TYPE('a::cpo)) = liftemb oo liftprj"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    26
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    27
syntax "_LIFTDEFL" :: "type \<Rightarrow> logic"  ("(1LIFTDEFL/(1'(_')))")
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    28
translations "LIFTDEFL('t)" \<rightleftharpoons> "CONST liftdefl TYPE('t)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    29
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
    30
class bifinite = predomain + pcpo +
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    31
  fixes emb :: "'a::pcpo \<rightarrow> udom"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    32
  fixes prj :: "udom \<rightarrow> 'a::pcpo"
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    33
  fixes defl :: "'a itself \<Rightarrow> defl"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    34
  assumes ep_pair_emb_prj: "ep_pair emb prj"
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    35
  assumes cast_DEFL: "cast\<cdot>(defl TYPE('a)) = emb oo prj"
31113
15cf300a742f move bifinite instance for product type from Cprod.thy to Bifinite.thy
huffman
parents: 31076
diff changeset
    36
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    37
syntax "_DEFL" :: "type \<Rightarrow> defl"  ("(1DEFL/(1'(_')))")
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    38
translations "DEFL('t)" \<rightleftharpoons> "CONST defl TYPE('t)"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    39
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    40
interpretation bifinite:
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    41
  pcpo_ep_pair "emb :: 'a::bifinite \<rightarrow> udom" "prj :: udom \<rightarrow> 'a::bifinite"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    42
  unfolding pcpo_ep_pair_def
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    43
  by (rule ep_pair_emb_prj)
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
    44
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    45
lemmas emb_inverse = bifinite.e_inverse
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    46
lemmas emb_prj_below = bifinite.e_p_below
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    47
lemmas emb_eq_iff = bifinite.e_eq_iff
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    48
lemmas emb_strict = bifinite.e_strict
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    49
lemmas prj_strict = bifinite.p_strict
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
    50
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    51
subsection {* Bifinite domains have a countable compact basis *}
33808
31169fdc5ae7 add map_ID lemmas
huffman
parents: 33587
diff changeset
    52
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    53
text {*
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    54
  Eventually it should be possible to generalize this to an unpointed
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    55
  variant of the bifinite class.
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    56
*}
33587
54f98d225163 add map_map lemmas
huffman
parents: 33504
diff changeset
    57
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    58
interpretation compact_basis:
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    59
  ideal_completion below Rep_compact_basis "approximants::'a::bifinite \<Rightarrow> _"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    60
proof -
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    61
  obtain Y where Y: "\<forall>i. Y i \<sqsubseteq> Y (Suc i)"
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    62
  and DEFL: "DEFL('a) = (\<Squnion>i. defl_principal (Y i))"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    63
    by (rule defl.obtain_principal_chain)
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    64
  def approx \<equiv> "\<lambda>i. (prj oo cast\<cdot>(defl_principal (Y i)) oo emb) :: 'a \<rightarrow> 'a"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    65
  interpret defl_approx: approx_chain approx
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    66
  proof (rule approx_chain.intro)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    67
    show "chain (\<lambda>i. approx i)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    68
      unfolding approx_def by (simp add: Y)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    69
    show "(\<Squnion>i. approx i) = ID"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    70
      unfolding approx_def
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39989
diff changeset
    71
      by (simp add: lub_distribs Y DEFL [symmetric] cast_DEFL cfun_eq_iff)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    72
    show "\<And>i. finite_deflation (approx i)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    73
      unfolding approx_def
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
    74
      apply (rule bifinite.finite_deflation_p_d_e)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    75
      apply (rule finite_deflation_cast)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    76
      apply (rule defl.compact_principal)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    77
      apply (rule below_trans [OF monofun_cfun_fun])
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    78
      apply (rule is_ub_thelub, simp add: Y)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
    79
      apply (simp add: lub_distribs Y DEFL [symmetric] cast_DEFL)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    80
      done
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    81
  qed
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    82
  (* FIXME: why does show ?thesis fail here? *)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
    83
  show "ideal_completion below Rep_compact_basis (approximants::'a \<Rightarrow> _)" ..
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
    84
qed
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
    85
40484
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    86
subsection {* Chains of approx functions *}
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    87
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    88
definition u_approx :: "nat \<Rightarrow> udom\<^sub>\<bottom> \<rightarrow> udom\<^sub>\<bottom>"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    89
  where "u_approx = (\<lambda>i. u_map\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    90
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    91
definition cfun_approx :: "nat \<Rightarrow> (udom \<rightarrow> udom) \<rightarrow> (udom \<rightarrow> udom)"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    92
  where "cfun_approx = (\<lambda>i. cfun_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    93
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    94
definition prod_approx :: "nat \<Rightarrow> udom \<times> udom \<rightarrow> udom \<times> udom"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    95
  where "prod_approx = (\<lambda>i. cprod_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    96
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    97
definition sprod_approx :: "nat \<Rightarrow> udom \<otimes> udom \<rightarrow> udom \<otimes> udom"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    98
  where "sprod_approx = (\<lambda>i. sprod_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
    99
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   100
definition ssum_approx :: "nat \<Rightarrow> udom \<oplus> udom \<rightarrow> udom \<oplus> udom"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   101
  where "ssum_approx = (\<lambda>i. ssum_map\<cdot>(udom_approx i)\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   102
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   103
lemma approx_chain_lemma1:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   104
  assumes "m\<cdot>ID = ID"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   105
  assumes "\<And>d. finite_deflation d \<Longrightarrow> finite_deflation (m\<cdot>d)"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   106
  shows "approx_chain (\<lambda>i. m\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   107
by (rule approx_chain.intro)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   108
   (simp_all add: lub_distribs finite_deflation_udom_approx assms)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   109
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   110
lemma approx_chain_lemma2:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   111
  assumes "m\<cdot>ID\<cdot>ID = ID"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   112
  assumes "\<And>a b. \<lbrakk>finite_deflation a; finite_deflation b\<rbrakk>
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   113
    \<Longrightarrow> finite_deflation (m\<cdot>a\<cdot>b)"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   114
  shows "approx_chain (\<lambda>i. m\<cdot>(udom_approx i)\<cdot>(udom_approx i))"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   115
by (rule approx_chain.intro)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   116
   (simp_all add: lub_distribs finite_deflation_udom_approx assms)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   117
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   118
lemma u_approx: "approx_chain u_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   119
using u_map_ID finite_deflation_u_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   120
unfolding u_approx_def by (rule approx_chain_lemma1)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   121
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   122
lemma cfun_approx: "approx_chain cfun_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   123
using cfun_map_ID finite_deflation_cfun_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   124
unfolding cfun_approx_def by (rule approx_chain_lemma2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   125
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   126
lemma prod_approx: "approx_chain prod_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   127
using cprod_map_ID finite_deflation_cprod_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   128
unfolding prod_approx_def by (rule approx_chain_lemma2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   129
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   130
lemma sprod_approx: "approx_chain sprod_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   131
using sprod_map_ID finite_deflation_sprod_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   132
unfolding sprod_approx_def by (rule approx_chain_lemma2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   133
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   134
lemma ssum_approx: "approx_chain ssum_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   135
using ssum_map_ID finite_deflation_ssum_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   136
unfolding ssum_approx_def by (rule approx_chain_lemma2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   137
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   138
subsection {* Type combinators *}
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   139
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   140
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   141
  defl_fun1 ::
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   142
    "(nat \<Rightarrow> 'a \<rightarrow> 'a) \<Rightarrow> ((udom \<rightarrow> udom) \<rightarrow> ('a \<rightarrow> 'a)) \<Rightarrow> (defl \<rightarrow> defl)"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   143
where
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   144
  "defl_fun1 approx f =
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   145
    defl.basis_fun (\<lambda>a.
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   146
      defl_principal (Abs_fin_defl
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   147
        (udom_emb approx oo f\<cdot>(Rep_fin_defl a) oo udom_prj approx)))"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   148
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   149
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   150
  defl_fun2 ::
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   151
    "(nat \<Rightarrow> 'a \<rightarrow> 'a) \<Rightarrow> ((udom \<rightarrow> udom) \<rightarrow> (udom \<rightarrow> udom) \<rightarrow> ('a \<rightarrow> 'a))
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   152
      \<Rightarrow> (defl \<rightarrow> defl \<rightarrow> defl)"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   153
where
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   154
  "defl_fun2 approx f =
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   155
    defl.basis_fun (\<lambda>a.
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   156
      defl.basis_fun (\<lambda>b.
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   157
        defl_principal (Abs_fin_defl
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   158
          (udom_emb approx oo
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   159
            f\<cdot>(Rep_fin_defl a)\<cdot>(Rep_fin_defl b) oo udom_prj approx))))"
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   160
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   161
lemma cast_defl_fun1:
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   162
  assumes approx: "approx_chain approx"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   163
  assumes f: "\<And>a. finite_deflation a \<Longrightarrow> finite_deflation (f\<cdot>a)"
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   164
  shows "cast\<cdot>(defl_fun1 approx f\<cdot>A) = udom_emb approx oo f\<cdot>(cast\<cdot>A) oo udom_prj approx"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   165
proof -
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   166
  have 1: "\<And>a. finite_deflation
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   167
        (udom_emb approx oo f\<cdot>(Rep_fin_defl a) oo udom_prj approx)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   168
    apply (rule ep_pair.finite_deflation_e_d_p)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   169
    apply (rule approx_chain.ep_pair_udom [OF approx])
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   170
    apply (rule f, rule finite_deflation_Rep_fin_defl)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   171
    done
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   172
  show ?thesis
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   173
    by (induct A rule: defl.principal_induct, simp)
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   174
       (simp only: defl_fun1_def
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   175
                   defl.basis_fun_principal
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   176
                   defl.basis_fun_mono
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   177
                   defl.principal_mono
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   178
                   Abs_fin_defl_mono [OF 1 1]
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   179
                   monofun_cfun below_refl
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   180
                   Rep_fin_defl_mono
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   181
                   cast_defl_principal
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   182
                   Abs_fin_defl_inverse [unfolded mem_Collect_eq, OF 1])
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   183
qed
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   184
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   185
lemma cast_defl_fun2:
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   186
  assumes approx: "approx_chain approx"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   187
  assumes f: "\<And>a b. finite_deflation a \<Longrightarrow> finite_deflation b \<Longrightarrow>
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   188
                finite_deflation (f\<cdot>a\<cdot>b)"
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   189
  shows "cast\<cdot>(defl_fun2 approx f\<cdot>A\<cdot>B) =
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   190
    udom_emb approx oo f\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo udom_prj approx"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   191
proof -
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   192
  have 1: "\<And>a b. finite_deflation (udom_emb approx oo
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   193
      f\<cdot>(Rep_fin_defl a)\<cdot>(Rep_fin_defl b) oo udom_prj approx)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   194
    apply (rule ep_pair.finite_deflation_e_d_p)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   195
    apply (rule ep_pair_udom [OF approx])
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   196
    apply (rule f, (rule finite_deflation_Rep_fin_defl)+)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   197
    done
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   198
  show ?thesis
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   199
    by (induct A B rule: defl.principal_induct2, simp, simp)
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   200
       (simp only: defl_fun2_def
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   201
                   defl.basis_fun_principal
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   202
                   defl.basis_fun_mono
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   203
                   defl.principal_mono
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   204
                   Abs_fin_defl_mono [OF 1 1]
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   205
                   monofun_cfun below_refl
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   206
                   Rep_fin_defl_mono
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   207
                   cast_defl_principal
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   208
                   Abs_fin_defl_inverse [unfolded mem_Collect_eq, OF 1])
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   209
qed
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   210
40484
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   211
definition u_defl :: "defl \<rightarrow> defl"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   212
  where "u_defl = defl_fun1 u_approx u_map"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   213
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   214
definition cfun_defl :: "defl \<rightarrow> defl \<rightarrow> defl"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   215
  where "cfun_defl = defl_fun2 cfun_approx cfun_map"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   216
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   217
definition prod_defl :: "defl \<rightarrow> defl \<rightarrow> defl"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   218
  where "prod_defl = defl_fun2 prod_approx cprod_map"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   219
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   220
definition sprod_defl :: "defl \<rightarrow> defl \<rightarrow> defl"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   221
  where "sprod_defl = defl_fun2 sprod_approx sprod_map"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   222
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   223
definition ssum_defl :: "defl \<rightarrow> defl \<rightarrow> defl"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   224
where "ssum_defl = defl_fun2 ssum_approx ssum_map"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   225
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   226
lemma cast_u_defl:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   227
  "cast\<cdot>(u_defl\<cdot>A) =
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   228
    udom_emb u_approx oo u_map\<cdot>(cast\<cdot>A) oo udom_prj u_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   229
using u_approx finite_deflation_u_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   230
unfolding u_defl_def by (rule cast_defl_fun1)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   231
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   232
lemma cast_cfun_defl:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   233
  "cast\<cdot>(cfun_defl\<cdot>A\<cdot>B) =
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   234
    udom_emb cfun_approx oo cfun_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo udom_prj cfun_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   235
using cfun_approx finite_deflation_cfun_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   236
unfolding cfun_defl_def by (rule cast_defl_fun2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   237
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   238
lemma cast_prod_defl:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   239
  "cast\<cdot>(prod_defl\<cdot>A\<cdot>B) = udom_emb prod_approx oo
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   240
    cprod_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo udom_prj prod_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   241
using prod_approx finite_deflation_cprod_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   242
unfolding prod_defl_def by (rule cast_defl_fun2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   243
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   244
lemma cast_sprod_defl:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   245
  "cast\<cdot>(sprod_defl\<cdot>A\<cdot>B) =
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   246
    udom_emb sprod_approx oo
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   247
      sprod_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   248
        udom_prj sprod_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   249
using sprod_approx finite_deflation_sprod_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   250
unfolding sprod_defl_def by (rule cast_defl_fun2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   251
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   252
lemma cast_ssum_defl:
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   253
  "cast\<cdot>(ssum_defl\<cdot>A\<cdot>B) =
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   254
    udom_emb ssum_approx oo ssum_map\<cdot>(cast\<cdot>A)\<cdot>(cast\<cdot>B) oo udom_prj ssum_approx"
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   255
using ssum_approx finite_deflation_ssum_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   256
unfolding ssum_defl_def by (rule cast_defl_fun2)
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40086
diff changeset
   257
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   258
subsection {* Lemma for proving bifinite instances *}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   259
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   260
text {* Temporarily relax type constraints. *}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   261
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   262
setup {*
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   263
  fold Sign.add_const_constraint
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   264
  [ (@{const_name defl}, SOME @{typ "'a::pcpo itself \<Rightarrow> defl"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   265
  , (@{const_name emb}, SOME @{typ "'a::pcpo \<rightarrow> udom"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   266
  , (@{const_name prj}, SOME @{typ "udom \<rightarrow> 'a::pcpo"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   267
  , (@{const_name liftdefl}, SOME @{typ "'a::pcpo itself \<Rightarrow> defl"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   268
  , (@{const_name liftemb}, SOME @{typ "'a::pcpo u \<rightarrow> udom"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   269
  , (@{const_name liftprj}, SOME @{typ "udom \<rightarrow> 'a::pcpo u"}) ]
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   270
*}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   271
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   272
lemma bifinite_class_intro:
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   273
  assumes liftemb: "(liftemb :: 'a u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   274
  assumes liftprj: "(liftprj :: udom \<rightarrow> 'a u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   275
  assumes liftdefl: "liftdefl TYPE('a) = u_defl\<cdot>DEFL('a)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   276
  assumes ep_pair: "ep_pair emb (prj :: udom \<rightarrow> 'a)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   277
  assumes cast_defl: "cast\<cdot>DEFL('a) = emb oo (prj :: udom \<rightarrow> 'a)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   278
  shows "OFCLASS('a, bifinite_class)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   279
proof
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   280
  show "ep_pair liftemb (liftprj :: udom \<rightarrow> 'a u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   281
    unfolding liftemb liftprj
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   282
    by (intro ep_pair_comp ep_pair_u_map ep_pair ep_pair_udom u_approx)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   283
  show "cast\<cdot>LIFTDEFL('a) = liftemb oo (liftprj :: udom \<rightarrow> 'a u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   284
    unfolding liftemb liftprj liftdefl
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   285
    by (simp add: cfcomp1 cast_u_defl cast_defl u_map_map)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   286
qed fact+
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   287
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   288
text {* Restore original type constraints. *}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   289
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   290
setup {*
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   291
  fold Sign.add_const_constraint
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   292
  [ (@{const_name defl}, SOME @{typ "'a::bifinite itself \<Rightarrow> defl"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   293
  , (@{const_name emb}, SOME @{typ "'a::bifinite \<rightarrow> udom"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   294
  , (@{const_name prj}, SOME @{typ "udom \<rightarrow> 'a::bifinite"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   295
  , (@{const_name liftdefl}, SOME @{typ "'a::predomain itself \<Rightarrow> defl"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   296
  , (@{const_name liftemb}, SOME @{typ "'a::predomain u \<rightarrow> udom"})
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   297
  , (@{const_name liftprj}, SOME @{typ "udom \<rightarrow> 'a::predomain u"}) ]
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   298
*}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   299
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   300
subsection {* The universal domain is bifinite *}
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   301
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
   302
instantiation udom :: bifinite
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   303
begin
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   304
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   305
definition [simp]:
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   306
  "emb = (ID :: udom \<rightarrow> udom)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   307
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   308
definition [simp]:
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   309
  "prj = (ID :: udom \<rightarrow> udom)"
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   310
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   311
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   312
  "defl (t::udom itself) = (\<Squnion>i. defl_principal (Abs_fin_defl (udom_approx i)))"
33808
31169fdc5ae7 add map_ID lemmas
huffman
parents: 33587
diff changeset
   313
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   314
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   315
  "(liftemb :: udom u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   316
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   317
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   318
  "(liftprj :: udom \<rightarrow> udom u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   319
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   320
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   321
  "liftdefl (t::udom itself) = u_defl\<cdot>DEFL(udom)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   322
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   323
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   324
using liftemb_udom_def liftprj_udom_def liftdefl_udom_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   325
proof (rule bifinite_class_intro)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   326
  show "ep_pair emb (prj :: udom \<rightarrow> udom)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   327
    by (simp add: ep_pair.intro)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   328
  show "cast\<cdot>DEFL(udom) = emb oo (prj :: udom \<rightarrow> udom)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   329
    unfolding defl_udom_def
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   330
    apply (subst contlub_cfun_arg)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   331
    apply (rule chainI)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   332
    apply (rule defl.principal_mono)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   333
    apply (simp add: below_fin_defl_def)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   334
    apply (simp add: Abs_fin_defl_inverse finite_deflation_udom_approx)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   335
    apply (rule chainE)
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   336
    apply (rule chain_udom_approx)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   337
    apply (subst cast_defl_principal)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   338
    apply (simp add: Abs_fin_defl_inverse finite_deflation_udom_approx)
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   339
    done
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   340
qed
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   341
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   342
end
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   343
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   344
subsection {* Lifted predomains are bifinite *}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   345
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   346
instantiation u :: (predomain) bifinite
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   347
begin
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   348
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   349
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   350
  "emb = liftemb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   351
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   352
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   353
  "prj = liftprj"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   354
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   355
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   356
  "defl (t::'a u itself) = LIFTDEFL('a)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   357
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   358
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   359
  "(liftemb :: 'a u u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   360
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   361
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   362
  "(liftprj :: udom \<rightarrow> 'a u u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   363
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   364
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   365
  "liftdefl (t::'a u itself) = u_defl\<cdot>DEFL('a u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   366
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   367
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   368
using liftemb_u_def liftprj_u_def liftdefl_u_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   369
proof (rule bifinite_class_intro)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   370
  show "ep_pair emb (prj :: udom \<rightarrow> 'a u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   371
    unfolding emb_u_def prj_u_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   372
    by (rule predomain_ep)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   373
  show "cast\<cdot>DEFL('a u) = emb oo (prj :: udom \<rightarrow> 'a u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   374
    unfolding emb_u_def prj_u_def defl_u_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   375
    by (rule cast_liftdefl)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   376
qed
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   377
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   378
end
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   379
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   380
lemma DEFL_u: "DEFL('a::predomain u) = LIFTDEFL('a)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   381
by (rule defl_u_def)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   382
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   383
lemma LIFTDEFL_u: "LIFTDEFL('a::predomain u) = u_defl\<cdot>DEFL('a u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   384
by (rule liftdefl_u_def)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   385
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   386
subsection {* Continuous function space is a bifinite domain *}
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   387
39986
38677db30cad rename class 'sfp' to 'bifinite'
huffman
parents: 39985
diff changeset
   388
instantiation cfun :: (bifinite, bifinite) bifinite
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   389
begin
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   390
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   391
definition
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   392
  "emb = udom_emb cfun_approx oo cfun_map\<cdot>prj\<cdot>emb"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   393
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   394
definition
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   395
  "prj = cfun_map\<cdot>emb\<cdot>prj oo udom_prj cfun_approx"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   396
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   397
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   398
  "defl (t::('a \<rightarrow> 'b) itself) = cfun_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   399
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   400
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   401
  "(liftemb :: ('a \<rightarrow> 'b) u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   402
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   403
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   404
  "(liftprj :: udom \<rightarrow> ('a \<rightarrow> 'b) u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   405
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   406
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   407
  "liftdefl (t::('a \<rightarrow> 'b) itself) = u_defl\<cdot>DEFL('a \<rightarrow> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   408
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   409
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   410
using liftemb_cfun_def liftprj_cfun_def liftdefl_cfun_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   411
proof (rule bifinite_class_intro)
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   412
  show "ep_pair emb (prj :: udom \<rightarrow> 'a \<rightarrow> 'b)"
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   413
    unfolding emb_cfun_def prj_cfun_def
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   414
    using ep_pair_udom [OF cfun_approx]
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   415
    by (intro ep_pair_comp ep_pair_cfun_map ep_pair_emb_prj)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   416
  show "cast\<cdot>DEFL('a \<rightarrow> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<rightarrow> 'b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   417
    unfolding emb_cfun_def prj_cfun_def defl_cfun_def cast_cfun_defl
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39989
diff changeset
   418
    by (simp add: cast_DEFL oo_def cfun_eq_iff cfun_map_map)
27402
253a06dfadce reuse proofs from Deflation.thy; clean up proof of finite_range_cfun_lemma
huffman
parents: 27310
diff changeset
   419
qed
25903
5e59af604d4f new theory of bifinite domains
huffman
parents:
diff changeset
   420
39985
310f98585107 move stuff from Algebraic.thy to Bifinite.thy and elsewhere
huffman
parents: 39974
diff changeset
   421
end
33504
b4210cc3ac97 map functions for various types, with ep_pair/deflation/finite_deflation lemmas
huffman
parents: 31113
diff changeset
   422
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   423
lemma DEFL_cfun:
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   424
  "DEFL('a::bifinite \<rightarrow> 'b::bifinite) = cfun_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   425
by (rule defl_cfun_def)
39972
4244ff4f9649 add lemmas finite_deflation_imp_compact, cast_below_cast_iff
Brian Huffman <brianh@cs.pdx.edu>
parents: 37678
diff changeset
   426
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   427
lemma LIFTDEFL_cfun:
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   428
  "LIFTDEFL('a::bifinite \<rightarrow> 'b::bifinite) = u_defl\<cdot>DEFL('a \<rightarrow> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   429
by (rule liftdefl_cfun_def)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   430
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   431
subsection {* Cartesian product is a bifinite domain *}
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   432
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   433
instantiation prod :: (bifinite, bifinite) bifinite
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   434
begin
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   435
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   436
definition
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   437
  "emb = udom_emb prod_approx oo cprod_map\<cdot>emb\<cdot>emb"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   438
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   439
definition
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   440
  "prj = cprod_map\<cdot>prj\<cdot>prj oo udom_prj prod_approx"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   441
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   442
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   443
  "defl (t::('a \<times> 'b) itself) = prod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   444
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   445
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   446
  "(liftemb :: ('a \<times> 'b) u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   447
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   448
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   449
  "(liftprj :: udom \<rightarrow> ('a \<times> 'b) u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   450
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   451
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   452
  "liftdefl (t::('a \<times> 'b) itself) = u_defl\<cdot>DEFL('a \<times> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   453
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   454
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   455
using liftemb_prod_def liftprj_prod_def liftdefl_prod_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   456
proof (rule bifinite_class_intro)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   457
  show "ep_pair emb (prj :: udom \<rightarrow> 'a \<times> 'b)"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   458
    unfolding emb_prod_def prj_prod_def
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   459
    using ep_pair_udom [OF prod_approx]
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   460
    by (intro ep_pair_comp ep_pair_cprod_map ep_pair_emb_prj)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   461
next
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   462
  show "cast\<cdot>DEFL('a \<times> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<times> 'b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   463
    unfolding emb_prod_def prj_prod_def defl_prod_def cast_prod_defl
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39989
diff changeset
   464
    by (simp add: cast_DEFL oo_def cfun_eq_iff cprod_map_map)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   465
qed
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   466
26962
c8b20f615d6c use new class package for classes profinite, bifinite; remove approx class
huffman
parents: 26407
diff changeset
   467
end
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   468
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   469
lemma DEFL_prod:
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   470
  "DEFL('a::bifinite \<times> 'b::bifinite) = prod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   471
by (rule defl_prod_def)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   472
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   473
lemma LIFTDEFL_prod:
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   474
  "LIFTDEFL('a::bifinite \<times> 'b::bifinite) = u_defl\<cdot>DEFL('a \<times> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   475
by (rule liftdefl_prod_def)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   476
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   477
subsection {* Strict product is a bifinite domain *}
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   478
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   479
instantiation sprod :: (bifinite, bifinite) bifinite
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   480
begin
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   481
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   482
definition
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   483
  "emb = udom_emb sprod_approx oo sprod_map\<cdot>emb\<cdot>emb"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   484
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   485
definition
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   486
  "prj = sprod_map\<cdot>prj\<cdot>prj oo udom_prj sprod_approx"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   487
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   488
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   489
  "defl (t::('a \<otimes> 'b) itself) = sprod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   490
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   491
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   492
  "(liftemb :: ('a \<otimes> 'b) u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   493
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   494
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   495
  "(liftprj :: udom \<rightarrow> ('a \<otimes> 'b) u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   496
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   497
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   498
  "liftdefl (t::('a \<otimes> 'b) itself) = u_defl\<cdot>DEFL('a \<otimes> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   499
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   500
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   501
using liftemb_sprod_def liftprj_sprod_def liftdefl_sprod_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   502
proof (rule bifinite_class_intro)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   503
  show "ep_pair emb (prj :: udom \<rightarrow> 'a \<otimes> 'b)"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   504
    unfolding emb_sprod_def prj_sprod_def
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   505
    using ep_pair_udom [OF sprod_approx]
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   506
    by (intro ep_pair_comp ep_pair_sprod_map ep_pair_emb_prj)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   507
next
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   508
  show "cast\<cdot>DEFL('a \<otimes> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<otimes> 'b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   509
    unfolding emb_sprod_def prj_sprod_def defl_sprod_def cast_sprod_defl
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39989
diff changeset
   510
    by (simp add: cast_DEFL oo_def cfun_eq_iff sprod_map_map)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   511
qed
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   512
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   513
end
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   514
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   515
lemma DEFL_sprod:
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   516
  "DEFL('a::bifinite \<otimes> 'b::bifinite) = sprod_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   517
by (rule defl_sprod_def)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   518
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   519
lemma LIFTDEFL_sprod:
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   520
  "LIFTDEFL('a::bifinite \<otimes> 'b::bifinite) = u_defl\<cdot>DEFL('a \<otimes> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   521
by (rule liftdefl_sprod_def)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   522
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   523
subsection {* Countable discrete cpos are predomains *}
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   524
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   525
definition discr_approx :: "nat \<Rightarrow> 'a::countable discr u \<rightarrow> 'a discr u"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   526
  where "discr_approx = (\<lambda>i. \<Lambda>(up\<cdot>x). if to_nat (undiscr x) < i then up\<cdot>x else \<bottom>)"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   527
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   528
lemma chain_discr_approx [simp]: "chain discr_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   529
unfolding discr_approx_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   530
by (rule chainI, simp add: monofun_cfun monofun_LAM)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   531
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   532
lemma lub_discr_approx [simp]: "(\<Squnion>i. discr_approx i) = ID"
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39989
diff changeset
   533
apply (rule cfun_eqI)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   534
apply (simp add: contlub_cfun_fun)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   535
apply (simp add: discr_approx_def)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   536
apply (case_tac x, simp)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   537
apply (rule thelubI)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   538
apply (rule is_lubI)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   539
apply (rule ub_rangeI, simp)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   540
apply (drule ub_rangeD)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   541
apply (erule rev_below_trans)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   542
apply simp
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   543
apply (rule lessI)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   544
done
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   545
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   546
lemma inj_on_undiscr [simp]: "inj_on undiscr A"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   547
using Discr_undiscr by (rule inj_on_inverseI)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   548
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   549
lemma finite_deflation_discr_approx: "finite_deflation (discr_approx i)"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   550
proof
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   551
  fix x :: "'a discr u"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   552
  show "discr_approx i\<cdot>x \<sqsubseteq> x"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   553
    unfolding discr_approx_def
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   554
    by (cases x, simp, simp)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   555
  show "discr_approx i\<cdot>(discr_approx i\<cdot>x) = discr_approx i\<cdot>x"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   556
    unfolding discr_approx_def
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   557
    by (cases x, simp, simp)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   558
  show "finite {x::'a discr u. discr_approx i\<cdot>x = x}"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   559
  proof (rule finite_subset)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   560
    let ?S = "insert (\<bottom>::'a discr u) ((\<lambda>x. up\<cdot>x) ` undiscr -` to_nat -` {..<i})"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   561
    show "{x::'a discr u. discr_approx i\<cdot>x = x} \<subseteq> ?S"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   562
      unfolding discr_approx_def
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   563
      by (rule subsetI, case_tac x, simp, simp split: split_if_asm)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   564
    show "finite ?S"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   565
      by (simp add: finite_vimageI)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   566
  qed
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   567
qed
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   568
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   569
lemma discr_approx: "approx_chain discr_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   570
using chain_discr_approx lub_discr_approx finite_deflation_discr_approx
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   571
by (rule approx_chain.intro)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   572
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   573
instantiation discr :: (countable) predomain
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   574
begin
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   575
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   576
definition
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   577
  "liftemb = udom_emb discr_approx"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   578
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   579
definition
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   580
  "liftprj = udom_prj discr_approx"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   581
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   582
definition
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   583
  "liftdefl (t::'a discr itself) =
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   584
    (\<Squnion>i. defl_principal (Abs_fin_defl (liftemb oo discr_approx i oo liftprj)))"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   585
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   586
instance proof
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   587
  show "ep_pair liftemb (liftprj :: udom \<rightarrow> 'a discr u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   588
    unfolding liftemb_discr_def liftprj_discr_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   589
    by (rule ep_pair_udom [OF discr_approx])
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   590
  show "cast\<cdot>LIFTDEFL('a discr) = liftemb oo (liftprj :: udom \<rightarrow> 'a discr u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   591
    unfolding liftemb_discr_def liftprj_discr_def liftdefl_discr_def
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   592
    apply (subst contlub_cfun_arg)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   593
    apply (rule chainI)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   594
    apply (rule defl.principal_mono)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   595
    apply (simp add: below_fin_defl_def)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   596
    apply (simp add: Abs_fin_defl_inverse
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   597
        ep_pair.finite_deflation_e_d_p [OF ep_pair_udom [OF discr_approx]]
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   598
        approx_chain.finite_deflation_approx [OF discr_approx])
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   599
    apply (intro monofun_cfun below_refl)
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   600
    apply (rule chainE)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   601
    apply (rule chain_discr_approx)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   602
    apply (subst cast_defl_principal)
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   603
    apply (simp add: Abs_fin_defl_inverse
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   604
        ep_pair.finite_deflation_e_d_p [OF ep_pair_udom [OF discr_approx]]
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   605
        approx_chain.finite_deflation_approx [OF discr_approx])
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   606
    apply (simp add: lub_distribs)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   607
    done
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   608
qed
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   609
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   610
end
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   611
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   612
subsection {* Strict sum is a bifinite domain *}
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   613
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   614
instantiation ssum :: (bifinite, bifinite) bifinite
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   615
begin
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   616
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   617
definition
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   618
  "emb = udom_emb ssum_approx oo ssum_map\<cdot>emb\<cdot>emb"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   619
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   620
definition
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   621
  "prj = ssum_map\<cdot>prj\<cdot>prj oo udom_prj ssum_approx"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   622
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   623
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   624
  "defl (t::('a \<oplus> 'b) itself) = ssum_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   625
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   626
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   627
  "(liftemb :: ('a \<oplus> 'b) u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   628
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   629
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   630
  "(liftprj :: udom \<rightarrow> ('a \<oplus> 'b) u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   631
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   632
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   633
  "liftdefl (t::('a \<oplus> 'b) itself) = u_defl\<cdot>DEFL('a \<oplus> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   634
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   635
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   636
using liftemb_ssum_def liftprj_ssum_def liftdefl_ssum_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   637
proof (rule bifinite_class_intro)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   638
  show "ep_pair emb (prj :: udom \<rightarrow> 'a \<oplus> 'b)"
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   639
    unfolding emb_ssum_def prj_ssum_def
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   640
    using ep_pair_udom [OF ssum_approx]
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   641
    by (intro ep_pair_comp ep_pair_ssum_map ep_pair_emb_prj)
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   642
  show "cast\<cdot>DEFL('a \<oplus> 'b) = emb oo (prj :: udom \<rightarrow> 'a \<oplus> 'b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   643
    unfolding emb_ssum_def prj_ssum_def defl_ssum_def cast_ssum_defl
40002
c5b5f7a3a3b1 new theorem names: fun_below_iff, fun_belowI, cfun_eq_iff, cfun_eqI, cfun_below_iff, cfun_belowI
huffman
parents: 39989
diff changeset
   644
    by (simp add: cast_DEFL oo_def cfun_eq_iff ssum_map_map)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   645
qed
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   646
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   647
end
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   648
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   649
lemma DEFL_ssum:
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   650
  "DEFL('a::bifinite \<oplus> 'b::bifinite) = ssum_defl\<cdot>DEFL('a)\<cdot>DEFL('b)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39987
diff changeset
   651
by (rule defl_ssum_def)
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   652
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   653
lemma LIFTDEFL_ssum:
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   654
  "LIFTDEFL('a::bifinite \<oplus> 'b::bifinite) = u_defl\<cdot>DEFL('a \<oplus> 'b)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   655
by (rule liftdefl_ssum_def)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   656
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   657
subsection {* Lifted countable types are bifinite domains *}
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   658
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   659
instantiation lift :: (countable) bifinite
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   660
begin
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   661
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   662
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   663
  "emb = emb oo (\<Lambda> x. Rep_lift x)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   664
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   665
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   666
  "prj = (\<Lambda> y. Abs_lift y) oo prj"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   667
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   668
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   669
  "defl (t::'a lift itself) = DEFL('a discr u)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   670
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   671
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   672
  "(liftemb :: 'a lift u \<rightarrow> udom) = udom_emb u_approx oo u_map\<cdot>emb"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   673
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   674
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   675
  "(liftprj :: udom \<rightarrow> 'a lift u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   676
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   677
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   678
  "liftdefl (t::'a lift itself) = u_defl\<cdot>DEFL('a lift)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   679
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   680
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   681
using liftemb_lift_def liftprj_lift_def liftdefl_lift_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   682
proof (rule bifinite_class_intro)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   683
  note [simp] = cont_Rep_lift cont_Abs_lift Rep_lift_inverse Abs_lift_inverse
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   684
  have "ep_pair (\<Lambda>(x::'a lift). Rep_lift x) (\<Lambda> y. Abs_lift y)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   685
    by (simp add: ep_pair_def)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   686
  thus "ep_pair emb (prj :: udom \<rightarrow> 'a lift)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   687
    unfolding emb_lift_def prj_lift_def
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   688
    using ep_pair_emb_prj by (rule ep_pair_comp)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   689
  show "cast\<cdot>DEFL('a lift) = emb oo (prj :: udom \<rightarrow> 'a lift)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   690
    unfolding emb_lift_def prj_lift_def defl_lift_def cast_DEFL
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   691
    by (simp add: cfcomp1)
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   692
qed
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   693
39987
8c2f449af35a move all bifinite class instances to Bifinite.thy
huffman
parents: 39986
diff changeset
   694
end
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   695
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   696
end