src/HOL/HOLCF/LowerPD.thy
author huffman
Fri, 17 Dec 2010 16:43:45 -0800
changeset 41284 6d66975b711f
parent 41111 b497cc48e563
child 41286 3d7685a4a5ff
permissions -rw-r--r--
renamed CompactBasis.thy to Compact_Basis.thy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     1
(*  Title:      HOLCF/LowerPD.thy
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     2
    Author:     Brian Huffman
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     3
*)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     4
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     5
header {* Lower powerdomain *}
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     6
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     7
theory LowerPD
41284
6d66975b711f renamed CompactBasis.thy to Compact_Basis.thy
huffman
parents: 41111
diff changeset
     8
imports Compact_Basis
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
     9
begin
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    10
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    11
subsection {* Basis preorder *}
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    12
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    13
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    14
  lower_le :: "'a pd_basis \<Rightarrow> 'a pd_basis \<Rightarrow> bool" (infix "\<le>\<flat>" 50) where
26420
57a626f64875 make preorder locale into a superclass of class po
huffman
parents: 26407
diff changeset
    15
  "lower_le = (\<lambda>u v. \<forall>x\<in>Rep_pd_basis u. \<exists>y\<in>Rep_pd_basis v. x \<sqsubseteq> y)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    16
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    17
lemma lower_le_refl [simp]: "t \<le>\<flat> t"
26420
57a626f64875 make preorder locale into a superclass of class po
huffman
parents: 26407
diff changeset
    18
unfolding lower_le_def by fast
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    19
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    20
lemma lower_le_trans: "\<lbrakk>t \<le>\<flat> u; u \<le>\<flat> v\<rbrakk> \<Longrightarrow> t \<le>\<flat> v"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    21
unfolding lower_le_def
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    22
apply (rule ballI)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    23
apply (drule (1) bspec, erule bexE)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    24
apply (drule (1) bspec, erule bexE)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    25
apply (erule rev_bexI)
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
    26
apply (erule (1) below_trans)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    27
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    28
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29990
diff changeset
    29
interpretation lower_le: preorder lower_le
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    30
by (rule preorder.intro, rule lower_le_refl, rule lower_le_trans)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    31
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    32
lemma lower_le_minimal [simp]: "PDUnit compact_bot \<le>\<flat> t"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    33
unfolding lower_le_def Rep_PDUnit
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    34
by (simp, rule Rep_pd_basis_nonempty [folded ex_in_conv])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    35
26420
57a626f64875 make preorder locale into a superclass of class po
huffman
parents: 26407
diff changeset
    36
lemma PDUnit_lower_mono: "x \<sqsubseteq> y \<Longrightarrow> PDUnit x \<le>\<flat> PDUnit y"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    37
unfolding lower_le_def Rep_PDUnit by fast
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    38
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    39
lemma PDPlus_lower_mono: "\<lbrakk>s \<le>\<flat> t; u \<le>\<flat> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<flat> PDPlus t v"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    40
unfolding lower_le_def Rep_PDPlus by fast
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    41
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
    42
lemma PDPlus_lower_le: "t \<le>\<flat> PDPlus t u"
26420
57a626f64875 make preorder locale into a superclass of class po
huffman
parents: 26407
diff changeset
    43
unfolding lower_le_def Rep_PDPlus by fast
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    44
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    45
lemma lower_le_PDUnit_PDUnit_iff [simp]:
40436
adb22dbb5242 (infixl "<<" 55) -> (infix "<<" 50)
huffman
parents: 40327
diff changeset
    46
  "(PDUnit a \<le>\<flat> PDUnit b) = (a \<sqsubseteq> b)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    47
unfolding lower_le_def Rep_PDUnit by fast
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    48
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    49
lemma lower_le_PDUnit_PDPlus_iff:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    50
  "(PDUnit a \<le>\<flat> PDPlus t u) = (PDUnit a \<le>\<flat> t \<or> PDUnit a \<le>\<flat> u)"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    51
unfolding lower_le_def Rep_PDPlus Rep_PDUnit by fast
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    52
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    53
lemma lower_le_PDPlus_iff: "(PDPlus t u \<le>\<flat> v) = (t \<le>\<flat> v \<and> u \<le>\<flat> v)"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    54
unfolding lower_le_def Rep_PDPlus by fast
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    55
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    56
lemma lower_le_induct [induct set: lower_le]:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    57
  assumes le: "t \<le>\<flat> u"
26420
57a626f64875 make preorder locale into a superclass of class po
huffman
parents: 26407
diff changeset
    58
  assumes 1: "\<And>a b. a \<sqsubseteq> b \<Longrightarrow> P (PDUnit a) (PDUnit b)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    59
  assumes 2: "\<And>t u a. P (PDUnit a) t \<Longrightarrow> P (PDUnit a) (PDPlus t u)"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    60
  assumes 3: "\<And>t u v. \<lbrakk>P t v; P u v\<rbrakk> \<Longrightarrow> P (PDPlus t u) v"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    61
  shows "P t u"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    62
using le
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    63
apply (induct t arbitrary: u rule: pd_basis_induct)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    64
apply (erule rev_mp)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    65
apply (induct_tac u rule: pd_basis_induct)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    66
apply (simp add: 1)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    67
apply (simp add: lower_le_PDUnit_PDPlus_iff)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    68
apply (simp add: 2)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    69
apply (subst PDPlus_commute)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    70
apply (simp add: 2)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    71
apply (simp add: lower_le_PDPlus_iff 3)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    72
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    73
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    74
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    75
subsection {* Type definition *}
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    76
27373
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    77
typedef (open) 'a lower_pd =
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    78
  "{S::'a pd_basis set. lower_le.ideal S}"
40888
28cd51cff70c reformulate lemma preorder.ex_ideal, and use it for typedefs
huffman
parents: 40774
diff changeset
    79
by (rule lower_le.ex_ideal)
27373
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    80
41111
b497cc48e563 xsymbol notation for powerdomain types
huffman
parents: 41110
diff changeset
    81
type_notation (xsymbols) lower_pd ("('(_')\<flat>)")
b497cc48e563 xsymbol notation for powerdomain types
huffman
parents: 41110
diff changeset
    82
40497
d2e876d6da8c rename class 'bifinite' to 'domain'
huffman
parents: 40494
diff changeset
    83
instantiation lower_pd :: ("domain") below
27373
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    84
begin
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    85
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    86
definition
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    87
  "x \<sqsubseteq> y \<longleftrightarrow> Rep_lower_pd x \<subseteq> Rep_lower_pd y"
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    88
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    89
instance ..
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    90
end
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    91
40497
d2e876d6da8c rename class 'bifinite' to 'domain'
huffman
parents: 40494
diff changeset
    92
instance lower_pd :: ("domain") po
39984
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
    93
using type_definition_lower_pd below_lower_pd_def
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
    94
by (rule lower_le.typedef_ideal_po)
27373
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
    95
40497
d2e876d6da8c rename class 'bifinite' to 'domain'
huffman
parents: 40494
diff changeset
    96
instance lower_pd :: ("domain") cpo
39984
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
    97
using type_definition_lower_pd below_lower_pd_def
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
    98
by (rule lower_le.typedef_ideal_cpo)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
    99
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   100
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   101
  lower_principal :: "'a pd_basis \<Rightarrow> 'a lower_pd" where
27373
5794a0e3e26c remove cset theory; define ideal completions using typedef instead of cpodef
huffman
parents: 27310
diff changeset
   102
  "lower_principal t = Abs_lower_pd {u. u \<le>\<flat> t}"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   103
30729
461ee3e49ad3 interpretation/interpret: prefixes are mandatory by default;
wenzelm
parents: 29990
diff changeset
   104
interpretation lower_pd:
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   105
  ideal_completion lower_le lower_principal Rep_lower_pd
39984
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
   106
using type_definition_lower_pd below_lower_pd_def
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
   107
using lower_principal_def pd_basis_countable
0300d5170622 add lemma typedef_ideal_completion
huffman
parents: 39974
diff changeset
   108
by (rule lower_le.typedef_ideal_completion)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   109
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   110
text {* Lower powerdomain is pointed *}
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   111
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   112
lemma lower_pd_minimal: "lower_principal (PDUnit compact_bot) \<sqsubseteq> ys"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   113
by (induct ys rule: lower_pd.principal_induct, simp, simp)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   114
40497
d2e876d6da8c rename class 'bifinite' to 'domain'
huffman
parents: 40494
diff changeset
   115
instance lower_pd :: ("domain") pcpo
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   116
by intro_classes (fast intro: lower_pd_minimal)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   117
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   118
lemma inst_lower_pd_pcpo: "\<bottom> = lower_principal (PDUnit compact_bot)"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   119
by (rule lower_pd_minimal [THEN UU_I, symmetric])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   120
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   121
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   122
subsection {* Monadic unit and plus *}
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   123
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   124
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   125
  lower_unit :: "'a \<rightarrow> 'a lower_pd" where
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   126
  "lower_unit = compact_basis.basis_fun (\<lambda>a. lower_principal (PDUnit a))"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   127
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   128
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   129
  lower_plus :: "'a lower_pd \<rightarrow> 'a lower_pd \<rightarrow> 'a lower_pd" where
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   130
  "lower_plus = lower_pd.basis_fun (\<lambda>t. lower_pd.basis_fun (\<lambda>u.
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   131
      lower_principal (PDPlus t u)))"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   132
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   133
abbreviation
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   134
  lower_add :: "'a lower_pd \<Rightarrow> 'a lower_pd \<Rightarrow> 'a lower_pd"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   135
    (infixl "+\<flat>" 65) where
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   136
  "xs +\<flat> ys == lower_plus\<cdot>xs\<cdot>ys"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   137
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   138
syntax
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   139
  "_lower_pd" :: "args \<Rightarrow> 'a lower_pd" ("{_}\<flat>")
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   140
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   141
translations
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   142
  "{x,xs}\<flat>" == "{x}\<flat> +\<flat> {xs}\<flat>"
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   143
  "{x}\<flat>" == "CONST lower_unit\<cdot>x"
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   144
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   145
lemma lower_unit_Rep_compact_basis [simp]:
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   146
  "{Rep_compact_basis a}\<flat> = lower_principal (PDUnit a)"
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   147
unfolding lower_unit_def
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   148
by (simp add: compact_basis.basis_fun_principal PDUnit_lower_mono)
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   149
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   150
lemma lower_plus_principal [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   151
  "lower_principal t +\<flat> lower_principal u = lower_principal (PDPlus t u)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   152
unfolding lower_plus_def
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   153
by (simp add: lower_pd.basis_fun_principal
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   154
    lower_pd.basis_fun_mono PDPlus_lower_mono)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   155
37770
cddb3106adb8 avoid explicit mandatory prefix markers when prefixes are mandatory implicitly
haftmann
parents: 36635
diff changeset
   156
interpretation lower_add: semilattice lower_add proof
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   157
  fix xs ys zs :: "'a lower_pd"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   158
  show "(xs +\<flat> ys) +\<flat> zs = xs +\<flat> (ys +\<flat> zs)"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   159
    apply (induct xs ys arbitrary: zs rule: lower_pd.principal_induct2, simp, simp)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   160
    apply (rule_tac x=zs in lower_pd.principal_induct, simp)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   161
    apply (simp add: PDPlus_assoc)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   162
    done
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   163
  show "xs +\<flat> ys = ys +\<flat> xs"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   164
    apply (induct xs ys rule: lower_pd.principal_induct2, simp, simp)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   165
    apply (simp add: PDPlus_commute)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   166
    done
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   167
  show "xs +\<flat> xs = xs"
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   168
    apply (induct xs rule: lower_pd.principal_induct, simp)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   169
    apply (simp add: PDPlus_absorb)
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   170
    done
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   171
qed
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   172
34973
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   173
lemmas lower_plus_assoc = lower_add.assoc
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   174
lemmas lower_plus_commute = lower_add.commute
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   175
lemmas lower_plus_absorb = lower_add.idem
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   176
lemmas lower_plus_left_commute = lower_add.left_commute
ae634fad947e dropped mk_left_commute; use interpretation of locale abel_semigroup instead
haftmann
parents: 33808
diff changeset
   177
lemmas lower_plus_left_absorb = lower_add.left_idem
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   178
29990
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   179
text {* Useful for @{text "simp add: lower_plus_ac"} *}
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   180
lemmas lower_plus_ac =
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   181
  lower_plus_assoc lower_plus_commute lower_plus_left_commute
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   182
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   183
text {* Useful for @{text "simp only: lower_plus_aci"} *}
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   184
lemmas lower_plus_aci =
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   185
  lower_plus_ac lower_plus_absorb lower_plus_left_absorb
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   186
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   187
lemma lower_plus_below1: "xs \<sqsubseteq> xs +\<flat> ys"
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   188
apply (induct xs ys rule: lower_pd.principal_induct2, simp, simp)
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   189
apply (simp add: PDPlus_lower_le)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   190
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   191
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   192
lemma lower_plus_below2: "ys \<sqsubseteq> xs +\<flat> ys"
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   193
by (subst lower_plus_commute, rule lower_plus_below1)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   194
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   195
lemma lower_plus_least: "\<lbrakk>xs \<sqsubseteq> zs; ys \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs +\<flat> ys \<sqsubseteq> zs"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   196
apply (subst lower_plus_absorb [of zs, symmetric])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   197
apply (erule (1) monofun_cfun [OF monofun_cfun_arg])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   198
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   199
40734
a292fc5157f8 declare more simp rules for powerdomains
huffman
parents: 40589
diff changeset
   200
lemma lower_plus_below_iff [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   201
  "xs +\<flat> ys \<sqsubseteq> zs \<longleftrightarrow> xs \<sqsubseteq> zs \<and> ys \<sqsubseteq> zs"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   202
apply safe
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   203
apply (erule below_trans [OF lower_plus_below1])
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   204
apply (erule below_trans [OF lower_plus_below2])
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   205
apply (erule (1) lower_plus_least)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   206
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   207
40734
a292fc5157f8 declare more simp rules for powerdomains
huffman
parents: 40589
diff changeset
   208
lemma lower_unit_below_plus_iff [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   209
  "{x}\<flat> \<sqsubseteq> ys +\<flat> zs \<longleftrightarrow> {x}\<flat> \<sqsubseteq> ys \<or> {x}\<flat> \<sqsubseteq> zs"
39970
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   210
apply (induct x rule: compact_basis.principal_induct, simp)
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   211
apply (induct ys rule: lower_pd.principal_induct, simp)
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   212
apply (induct zs rule: lower_pd.principal_induct, simp)
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   213
apply (simp add: lower_le_PDUnit_PDPlus_iff)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   214
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   215
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   216
lemma lower_unit_below_iff [simp]: "{x}\<flat> \<sqsubseteq> {y}\<flat> \<longleftrightarrow> x \<sqsubseteq> y"
39970
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   217
apply (induct x rule: compact_basis.principal_induct, simp)
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   218
apply (induct y rule: compact_basis.principal_induct, simp)
9023b897e67a simplify proofs of powerdomain inequalities
Brian Huffman <brianh@cs.pdx.edu>
parents: 37770
diff changeset
   219
apply simp
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   220
done
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   221
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   222
lemmas lower_pd_below_simps =
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   223
  lower_unit_below_iff
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   224
  lower_plus_below_iff
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   225
  lower_unit_below_plus_iff
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   226
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   227
lemma lower_unit_eq_iff [simp]: "{x}\<flat> = {y}\<flat> \<longleftrightarrow> x = y"
29990
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   228
by (simp add: po_eq_conv)
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   229
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   230
lemma lower_unit_strict [simp]: "{\<bottom>}\<flat> = \<bottom>"
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   231
using lower_unit_Rep_compact_basis [of compact_bot]
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   232
by (simp add: inst_lower_pd_pcpo)
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   233
40321
d065b195ec89 rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents: 40002
diff changeset
   234
lemma lower_unit_bottom_iff [simp]: "{x}\<flat> = \<bottom> \<longleftrightarrow> x = \<bottom>"
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   235
unfolding lower_unit_strict [symmetric] by (rule lower_unit_eq_iff)
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   236
40321
d065b195ec89 rename lemmas *_defined_iff and *_strict_iff to *_bottom_iff
huffman
parents: 40002
diff changeset
   237
lemma lower_plus_bottom_iff [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   238
  "xs +\<flat> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<and> ys = \<bottom>"
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   239
apply safe
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   240
apply (rule UU_I, erule subst, rule lower_plus_below1)
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   241
apply (rule UU_I, erule subst, rule lower_plus_below2)
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   242
apply (rule lower_plus_absorb)
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   243
done
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   244
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   245
lemma lower_plus_strict1 [simp]: "\<bottom> +\<flat> ys = ys"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   246
apply (rule below_antisym [OF _ lower_plus_below2])
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   247
apply (simp add: lower_plus_least)
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   248
done
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   249
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   250
lemma lower_plus_strict2 [simp]: "xs +\<flat> \<bottom> = xs"
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   251
apply (rule below_antisym [OF _ lower_plus_below1])
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   252
apply (simp add: lower_plus_least)
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   253
done
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   254
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   255
lemma compact_lower_unit: "compact x \<Longrightarrow> compact {x}\<flat>"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   256
by (auto dest!: compact_basis.compact_imp_principal)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   257
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   258
lemma compact_lower_unit_iff [simp]: "compact {x}\<flat> \<longleftrightarrow> compact x"
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   259
apply (safe elim!: compact_lower_unit)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   260
apply (simp only: compact_def lower_unit_below_iff [symmetric])
40327
1dfdbd66093a renamed {Rep,Abs}_CFun to {Rep,Abs}_cfun
huffman
parents: 40321
diff changeset
   261
apply (erule adm_subst [OF cont_Rep_cfun2])
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   262
done
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   263
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   264
lemma compact_lower_plus [simp]:
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   265
  "\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<flat> ys)"
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   266
by (auto dest!: lower_pd.compact_imp_principal)
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   267
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   268
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   269
subsection {* Induction rules *}
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   270
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   271
lemma lower_pd_induct1:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   272
  assumes P: "adm P"
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   273
  assumes unit: "\<And>x. P {x}\<flat>"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   274
  assumes insert:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   275
    "\<And>x ys. \<lbrakk>P {x}\<flat>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<flat> +\<flat> ys)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   276
  shows "P (xs::'a lower_pd)"
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   277
apply (induct xs rule: lower_pd.principal_induct, rule P)
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   278
apply (induct_tac a rule: pd_basis_induct1)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   279
apply (simp only: lower_unit_Rep_compact_basis [symmetric])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   280
apply (rule unit)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   281
apply (simp only: lower_unit_Rep_compact_basis [symmetric]
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   282
                  lower_plus_principal [symmetric])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   283
apply (erule insert [OF unit])
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   284
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   285
40576
fa5e0cacd5e7 declare {upper,lower,convex}_pd_induct as default induction rules
huffman
parents: 40497
diff changeset
   286
lemma lower_pd_induct
fa5e0cacd5e7 declare {upper,lower,convex}_pd_induct as default induction rules
huffman
parents: 40497
diff changeset
   287
  [case_names adm lower_unit lower_plus, induct type: lower_pd]:
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   288
  assumes P: "adm P"
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   289
  assumes unit: "\<And>x. P {x}\<flat>"
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   290
  assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<flat> ys)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   291
  shows "P (xs::'a lower_pd)"
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   292
apply (induct xs rule: lower_pd.principal_induct, rule P)
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   293
apply (induct_tac a rule: pd_basis_induct)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   294
apply (simp only: lower_unit_Rep_compact_basis [symmetric] unit)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   295
apply (simp only: lower_plus_principal [symmetric] plus)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   296
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   297
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   298
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   299
subsection {* Monadic bind *}
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   300
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   301
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   302
  lower_bind_basis ::
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   303
  "'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   304
  "lower_bind_basis = fold_pd
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   305
    (\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a))
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   306
    (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   307
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   308
lemma ACI_lower_bind:
36635
080b755377c0 locale predicates of classes carry a mandatory "class" prefix
haftmann
parents: 35901
diff changeset
   309
  "class.ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   310
apply unfold_locales
26041
c2e15e65165f locales ACf, ACIf, ACIfSL and ACIfSLlin have been abandoned in favour of the existing algebraic classes ab_semigroup_mult, ab_semigroup_idem_mult, lower_semilattice (resp. uper_semilattice) and linorder
haftmann
parents: 25925
diff changeset
   311
apply (simp add: lower_plus_assoc)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   312
apply (simp add: lower_plus_commute)
29990
b11793ea15a3 avoid using ab_semigroup_idem_mult locale for powerdomains
huffman
parents: 29672
diff changeset
   313
apply (simp add: eta_cfun)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   314
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   315
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   316
lemma lower_bind_basis_simps [simp]:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   317
  "lower_bind_basis (PDUnit a) =
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   318
    (\<Lambda> f. f\<cdot>(Rep_compact_basis a))"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   319
  "lower_bind_basis (PDPlus t u) =
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   320
    (\<Lambda> f. lower_bind_basis t\<cdot>f +\<flat> lower_bind_basis u\<cdot>f)"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   321
unfolding lower_bind_basis_def
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   322
apply -
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   323
apply (rule fold_pd_PDUnit [OF ACI_lower_bind])
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   324
apply (rule fold_pd_PDPlus [OF ACI_lower_bind])
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   325
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   326
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   327
lemma lower_bind_basis_mono:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   328
  "t \<le>\<flat> u \<Longrightarrow> lower_bind_basis t \<sqsubseteq> lower_bind_basis u"
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
   329
unfolding cfun_below_iff
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   330
apply (erule lower_le_induct, safe)
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   331
apply (simp add: monofun_cfun)
31076
99fe356cbbc2 rename constant sq_le to below; rename class sq_ord to below; less->below in many lemma names
huffman
parents: 30729
diff changeset
   332
apply (simp add: rev_below_trans [OF lower_plus_below1])
40734
a292fc5157f8 declare more simp rules for powerdomains
huffman
parents: 40589
diff changeset
   333
apply simp
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   334
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   335
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   336
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   337
  lower_bind :: "'a lower_pd \<rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   338
  "lower_bind = lower_pd.basis_fun lower_bind_basis"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   339
41036
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   340
syntax
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   341
  "_lower_bind" :: "[logic, logic, logic] \<Rightarrow> logic"
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   342
    ("(3\<Union>\<flat>_\<in>_./ _)" [0, 0, 10] 10)
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   343
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   344
translations
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   345
  "\<Union>\<flat>x\<in>xs. e" == "CONST lower_bind\<cdot>xs\<cdot>(\<Lambda> x. e)"
4acbacd6c5bc add set-union-like syntax for powerdomain bind operators
huffman
parents: 40888
diff changeset
   346
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   347
lemma lower_bind_principal [simp]:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   348
  "lower_bind\<cdot>(lower_principal t) = lower_bind_basis t"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   349
unfolding lower_bind_def
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   350
apply (rule lower_pd.basis_fun_principal)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   351
apply (erule lower_bind_basis_mono)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   352
done
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   353
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   354
lemma lower_bind_unit [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   355
  "lower_bind\<cdot>{x}\<flat>\<cdot>f = f\<cdot>x"
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   356
by (induct x rule: compact_basis.principal_induct, simp, simp)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   357
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   358
lemma lower_bind_plus [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   359
  "lower_bind\<cdot>(xs +\<flat> ys)\<cdot>f = lower_bind\<cdot>xs\<cdot>f +\<flat> lower_bind\<cdot>ys\<cdot>f"
27289
c49d427867aa move lemmas into locales;
huffman
parents: 27267
diff changeset
   360
by (induct xs ys rule: lower_pd.principal_induct2, simp, simp, simp)
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   361
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   362
lemma lower_bind_strict [simp]: "lower_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   363
unfolding lower_unit_strict [symmetric] by (rule lower_bind_unit)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   364
40589
0e77e45d2ffc add bind_bind rules for powerdomains
huffman
parents: 40577
diff changeset
   365
lemma lower_bind_bind:
0e77e45d2ffc add bind_bind rules for powerdomains
huffman
parents: 40577
diff changeset
   366
  "lower_bind\<cdot>(lower_bind\<cdot>xs\<cdot>f)\<cdot>g = lower_bind\<cdot>xs\<cdot>(\<Lambda> x. lower_bind\<cdot>(f\<cdot>x)\<cdot>g)"
0e77e45d2ffc add bind_bind rules for powerdomains
huffman
parents: 40577
diff changeset
   367
by (induct xs, simp_all)
0e77e45d2ffc add bind_bind rules for powerdomains
huffman
parents: 40577
diff changeset
   368
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   369
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   370
subsection {* Map *}
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   371
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   372
definition
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   373
  lower_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a lower_pd \<rightarrow> 'b lower_pd" where
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   374
  "lower_map = (\<Lambda> f xs. lower_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<flat>))"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   375
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   376
lemma lower_map_unit [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   377
  "lower_map\<cdot>f\<cdot>{x}\<flat> = {f\<cdot>x}\<flat>"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   378
unfolding lower_map_def by simp
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   379
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   380
lemma lower_map_plus [simp]:
26927
8684b5240f11 rename locales;
huffman
parents: 26806
diff changeset
   381
  "lower_map\<cdot>f\<cdot>(xs +\<flat> ys) = lower_map\<cdot>f\<cdot>xs +\<flat> lower_map\<cdot>f\<cdot>ys"
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   382
unfolding lower_map_def by simp
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   383
40577
5c6225a1c2c0 add lemmas about powerdomains
huffman
parents: 40576
diff changeset
   384
lemma lower_map_bottom [simp]: "lower_map\<cdot>f\<cdot>\<bottom> = {f\<cdot>\<bottom>}\<flat>"
5c6225a1c2c0 add lemmas about powerdomains
huffman
parents: 40576
diff changeset
   385
unfolding lower_map_def by simp
5c6225a1c2c0 add lemmas about powerdomains
huffman
parents: 40576
diff changeset
   386
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   387
lemma lower_map_ident: "lower_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   388
by (induct xs rule: lower_pd_induct, simp_all)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   389
33808
31169fdc5ae7 add map_ID lemmas
huffman
parents: 33585
diff changeset
   390
lemma lower_map_ID: "lower_map\<cdot>ID = 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
   391
by (simp add: cfun_eq_iff ID_def lower_map_ident)
33808
31169fdc5ae7 add map_ID lemmas
huffman
parents: 33585
diff changeset
   392
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   393
lemma lower_map_map:
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   394
  "lower_map\<cdot>f\<cdot>(lower_map\<cdot>g\<cdot>xs) = lower_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs"
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   395
by (induct xs rule: lower_pd_induct, simp_all)
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   396
41110
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   397
lemma lower_bind_map:
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   398
  "lower_bind\<cdot>(lower_map\<cdot>f\<cdot>xs)\<cdot>g = lower_bind\<cdot>xs\<cdot>(\<Lambda> x. g\<cdot>(f\<cdot>x))"
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   399
by (simp add: lower_map_def lower_bind_bind)
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   400
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   401
lemma lower_map_bind:
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   402
  "lower_map\<cdot>f\<cdot>(lower_bind\<cdot>xs\<cdot>g) = lower_bind\<cdot>xs\<cdot>(\<Lambda> x. lower_map\<cdot>f\<cdot>(g\<cdot>x))"
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   403
by (simp add: lower_map_def lower_bind_bind)
32099ee71a2f new powerdomain lemmas
huffman
parents: 41036
diff changeset
   404
33585
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   405
lemma ep_pair_lower_map: "ep_pair e p \<Longrightarrow> ep_pair (lower_map\<cdot>e) (lower_map\<cdot>p)"
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   406
apply default
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   407
apply (induct_tac x rule: lower_pd_induct, simp_all add: ep_pair.e_inverse)
35901
12f09bf2c77f fix LaTeX overfull hbox warnings in HOLCF document
huffman
parents: 34973
diff changeset
   408
apply (induct_tac y rule: lower_pd_induct)
40734
a292fc5157f8 declare more simp rules for powerdomains
huffman
parents: 40589
diff changeset
   409
apply (simp_all add: ep_pair.e_p_below monofun_cfun del: lower_plus_below_iff)
33585
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   410
done
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   411
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   412
lemma deflation_lower_map: "deflation d \<Longrightarrow> deflation (lower_map\<cdot>d)"
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   413
apply default
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   414
apply (induct_tac x rule: lower_pd_induct, simp_all add: deflation.idem)
35901
12f09bf2c77f fix LaTeX overfull hbox warnings in HOLCF document
huffman
parents: 34973
diff changeset
   415
apply (induct_tac x rule: lower_pd_induct)
40734
a292fc5157f8 declare more simp rules for powerdomains
huffman
parents: 40589
diff changeset
   416
apply (simp_all add: deflation.below monofun_cfun del: lower_plus_below_iff)
33585
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   417
done
8d39394fe5cf ep_pair and deflation lemmas for powerdomain map functions
huffman
parents: 31076
diff changeset
   418
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   419
(* FIXME: long proof! *)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   420
lemma finite_deflation_lower_map:
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   421
  assumes "finite_deflation d" shows "finite_deflation (lower_map\<cdot>d)"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   422
proof (rule finite_deflation_intro)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   423
  interpret d: finite_deflation d by fact
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   424
  have "deflation d" by fact
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   425
  thus "deflation (lower_map\<cdot>d)" by (rule deflation_lower_map)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   426
  have "finite (range (\<lambda>x. d\<cdot>x))" by (rule d.finite_range)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   427
  hence "finite (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   428
    by (rule finite_vimageI, simp add: inj_on_def Rep_compact_basis_inject)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   429
  hence "finite (Pow (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x)))" by simp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   430
  hence "finite (Rep_pd_basis -` (Pow (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))))"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   431
    by (rule finite_vimageI, simp add: inj_on_def Rep_pd_basis_inject)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   432
  hence *: "finite (lower_principal ` Rep_pd_basis -` (Pow (Rep_compact_basis -` range (\<lambda>x. d\<cdot>x))))" by simp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   433
  hence "finite (range (\<lambda>xs. lower_map\<cdot>d\<cdot>xs))"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   434
    apply (rule rev_finite_subset)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   435
    apply clarsimp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   436
    apply (induct_tac xs rule: lower_pd.principal_induct)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   437
    apply (simp add: adm_mem_finite *)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   438
    apply (rename_tac t, induct_tac t rule: pd_basis_induct)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   439
    apply (simp only: lower_unit_Rep_compact_basis [symmetric] lower_map_unit)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   440
    apply simp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   441
    apply (subgoal_tac "\<exists>b. d\<cdot>(Rep_compact_basis a) = Rep_compact_basis b")
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   442
    apply clarsimp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   443
    apply (rule imageI)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   444
    apply (rule vimageI2)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   445
    apply (simp add: Rep_PDUnit)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   446
    apply (rule range_eqI)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   447
    apply (erule sym)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   448
    apply (rule exI)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   449
    apply (rule Abs_compact_basis_inverse [symmetric])
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   450
    apply (simp add: d.compact)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   451
    apply (simp only: lower_plus_principal [symmetric] lower_map_plus)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   452
    apply clarsimp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   453
    apply (rule imageI)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   454
    apply (rule vimageI2)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   455
    apply (simp add: Rep_PDPlus)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   456
    done
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   457
  thus "finite {xs. lower_map\<cdot>d\<cdot>xs = xs}"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   458
    by (rule finite_range_imp_finite_fixes)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   459
qed
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   460
40497
d2e876d6da8c rename class 'bifinite' to 'domain'
huffman
parents: 40494
diff changeset
   461
subsection {* Lower powerdomain is a domain *}
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   462
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   463
definition
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   464
  lower_approx :: "nat \<Rightarrow> udom lower_pd \<rightarrow> udom lower_pd"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   465
where
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   466
  "lower_approx = (\<lambda>i. lower_map\<cdot>(udom_approx i))"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   467
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   468
lemma lower_approx: "approx_chain lower_approx"
40484
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40436
diff changeset
   469
using lower_map_ID finite_deflation_lower_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40436
diff changeset
   470
unfolding lower_approx_def by (rule approx_chain_lemma1)
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   471
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   472
definition lower_defl :: "defl \<rightarrow> defl"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   473
where "lower_defl = defl_fun1 lower_approx lower_map"
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   474
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   475
lemma cast_lower_defl:
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   476
  "cast\<cdot>(lower_defl\<cdot>A) =
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   477
    udom_emb lower_approx oo lower_map\<cdot>(cast\<cdot>A) oo udom_prj lower_approx"
40484
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40436
diff changeset
   478
using lower_approx finite_deflation_lower_map
768f7e264e2b reorganize Bifinite.thy; simplify some proofs related to bifinite class instances
huffman
parents: 40436
diff changeset
   479
unfolding lower_defl_def by (rule cast_defl_fun1)
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   480
40497
d2e876d6da8c rename class 'bifinite' to 'domain'
huffman
parents: 40494
diff changeset
   481
instantiation lower_pd :: ("domain") liftdomain
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   482
begin
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   483
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   484
definition
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   485
  "emb = udom_emb lower_approx oo lower_map\<cdot>emb"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   486
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   487
definition
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   488
  "prj = lower_map\<cdot>prj oo udom_prj lower_approx"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   489
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   490
definition
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   491
  "defl (t::'a lower_pd itself) = lower_defl\<cdot>DEFL('a)"
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   492
40491
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   493
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   494
  "(liftemb :: 'a lower_pd 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
   495
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   496
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   497
  "(liftprj :: udom \<rightarrow> 'a lower_pd u) = u_map\<cdot>prj oo udom_prj u_approx"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   498
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   499
definition
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   500
  "liftdefl (t::'a lower_pd itself) = u_defl\<cdot>DEFL('a lower_pd)"
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   501
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   502
instance
6de5839e2fb3 add 'predomain' class: unpointed version of bifinite
huffman
parents: 40484
diff changeset
   503
using liftemb_lower_pd_def liftprj_lower_pd_def liftdefl_lower_pd_def
40494
db8a09daba7b add class liftdomain, for bifinite domains where DEFL('a u) = u_defl('a)
huffman
parents: 40491
diff changeset
   504
proof (rule liftdomain_class_intro)
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   505
  show "ep_pair emb (prj :: udom \<rightarrow> 'a lower_pd)"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   506
    unfolding emb_lower_pd_def prj_lower_pd_def
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   507
    using ep_pair_udom [OF lower_approx]
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   508
    by (intro ep_pair_comp ep_pair_lower_map ep_pair_emb_prj)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   509
next
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   510
  show "cast\<cdot>DEFL('a lower_pd) = emb oo (prj :: udom \<rightarrow> 'a lower_pd)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   511
    unfolding emb_lower_pd_def prj_lower_pd_def defl_lower_pd_def cast_lower_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
   512
    by (simp add: cast_DEFL oo_def cfun_eq_iff lower_map_map)
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   513
qed
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   514
25904
8161f137b0e9 new theory of powerdomains
huffman
parents:
diff changeset
   515
end
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   516
39989
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   517
lemma DEFL_lower: "DEFL('a lower_pd) = lower_defl\<cdot>DEFL('a)"
ad60d7311f43 renamed type and constant 'sfp' to 'defl'; replaced syntax SFP('a) with DEFL('a)
huffman
parents: 39986
diff changeset
   518
by (rule defl_lower_pd_def)
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   519
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   520
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   521
subsection {* Join *}
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   522
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   523
definition
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   524
  lower_join :: "'a lower_pd lower_pd \<rightarrow> 'a lower_pd" where
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   525
  "lower_join = (\<Lambda> xss. lower_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   526
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   527
lemma lower_join_unit [simp]:
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   528
  "lower_join\<cdot>{xs}\<flat> = xs"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   529
unfolding lower_join_def by simp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   530
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   531
lemma lower_join_plus [simp]:
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   532
  "lower_join\<cdot>(xss +\<flat> yss) = lower_join\<cdot>xss +\<flat> lower_join\<cdot>yss"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   533
unfolding lower_join_def by simp
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   534
40577
5c6225a1c2c0 add lemmas about powerdomains
huffman
parents: 40576
diff changeset
   535
lemma lower_join_bottom [simp]: "lower_join\<cdot>\<bottom> = \<bottom>"
5c6225a1c2c0 add lemmas about powerdomains
huffman
parents: 40576
diff changeset
   536
unfolding lower_join_def by simp
5c6225a1c2c0 add lemmas about powerdomains
huffman
parents: 40576
diff changeset
   537
39974
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   538
lemma lower_join_map_unit:
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   539
  "lower_join\<cdot>(lower_map\<cdot>lower_unit\<cdot>xs) = xs"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   540
by (induct xs rule: lower_pd_induct, simp_all)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   541
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   542
lemma lower_join_map_join:
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   543
  "lower_join\<cdot>(lower_map\<cdot>lower_join\<cdot>xsss) = lower_join\<cdot>(lower_join\<cdot>xsss)"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   544
by (induct xsss rule: lower_pd_induct, simp_all)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   545
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   546
lemma lower_join_map_map:
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   547
  "lower_join\<cdot>(lower_map\<cdot>(lower_map\<cdot>f)\<cdot>xss) =
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   548
   lower_map\<cdot>f\<cdot>(lower_join\<cdot>xss)"
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   549
by (induct xss rule: lower_pd_induct, simp_all)
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   550
b525988432e9 major reorganization/simplification of HOLCF type classes:
huffman
parents: 39970
diff changeset
   551
end