src/HOLCF/UpperPD.thy
author ballarin
Tue Dec 16 21:10:53 2008 +0100 (2008-12-16)
changeset 29237 e90d9d51106b
parent 27405 785f5dbec8f4
child 29244 95d591908d8d
permissions -rw-r--r--
More porting to new locales.
     1 (*  Title:      HOLCF/UpperPD.thy
     2     Author:     Brian Huffman
     3 *)
     4 
     5 header {* Upper powerdomain *}
     6 
     7 theory UpperPD
     8 imports CompactBasis
     9 begin
    10 
    11 subsection {* Basis preorder *}
    12 
    13 definition
    14   upper_le :: "'a pd_basis \<Rightarrow> 'a pd_basis \<Rightarrow> bool" (infix "\<le>\<sharp>" 50) where
    15   "upper_le = (\<lambda>u v. \<forall>y\<in>Rep_pd_basis v. \<exists>x\<in>Rep_pd_basis u. x \<sqsubseteq> y)"
    16 
    17 lemma upper_le_refl [simp]: "t \<le>\<sharp> t"
    18 unfolding upper_le_def by fast
    19 
    20 lemma upper_le_trans: "\<lbrakk>t \<le>\<sharp> u; u \<le>\<sharp> v\<rbrakk> \<Longrightarrow> t \<le>\<sharp> v"
    21 unfolding upper_le_def
    22 apply (rule ballI)
    23 apply (drule (1) bspec, erule bexE)
    24 apply (drule (1) bspec, erule bexE)
    25 apply (erule rev_bexI)
    26 apply (erule (1) trans_less)
    27 done
    28 
    29 interpretation upper_le!: preorder upper_le
    30 by (rule preorder.intro, rule upper_le_refl, rule upper_le_trans)
    31 
    32 lemma upper_le_minimal [simp]: "PDUnit compact_bot \<le>\<sharp> t"
    33 unfolding upper_le_def Rep_PDUnit by simp
    34 
    35 lemma PDUnit_upper_mono: "x \<sqsubseteq> y \<Longrightarrow> PDUnit x \<le>\<sharp> PDUnit y"
    36 unfolding upper_le_def Rep_PDUnit by simp
    37 
    38 lemma PDPlus_upper_mono: "\<lbrakk>s \<le>\<sharp> t; u \<le>\<sharp> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<sharp> PDPlus t v"
    39 unfolding upper_le_def Rep_PDPlus by fast
    40 
    41 lemma PDPlus_upper_less: "PDPlus t u \<le>\<sharp> t"
    42 unfolding upper_le_def Rep_PDPlus by fast
    43 
    44 lemma upper_le_PDUnit_PDUnit_iff [simp]:
    45   "(PDUnit a \<le>\<sharp> PDUnit b) = a \<sqsubseteq> b"
    46 unfolding upper_le_def Rep_PDUnit by fast
    47 
    48 lemma upper_le_PDPlus_PDUnit_iff:
    49   "(PDPlus t u \<le>\<sharp> PDUnit a) = (t \<le>\<sharp> PDUnit a \<or> u \<le>\<sharp> PDUnit a)"
    50 unfolding upper_le_def Rep_PDPlus Rep_PDUnit by fast
    51 
    52 lemma upper_le_PDPlus_iff: "(t \<le>\<sharp> PDPlus u v) = (t \<le>\<sharp> u \<and> t \<le>\<sharp> v)"
    53 unfolding upper_le_def Rep_PDPlus by fast
    54 
    55 lemma upper_le_induct [induct set: upper_le]:
    56   assumes le: "t \<le>\<sharp> u"
    57   assumes 1: "\<And>a b. a \<sqsubseteq> b \<Longrightarrow> P (PDUnit a) (PDUnit b)"
    58   assumes 2: "\<And>t u a. P t (PDUnit a) \<Longrightarrow> P (PDPlus t u) (PDUnit a)"
    59   assumes 3: "\<And>t u v. \<lbrakk>P t u; P t v\<rbrakk> \<Longrightarrow> P t (PDPlus u v)"
    60   shows "P t u"
    61 using le apply (induct u arbitrary: t rule: pd_basis_induct)
    62 apply (erule rev_mp)
    63 apply (induct_tac t rule: pd_basis_induct)
    64 apply (simp add: 1)
    65 apply (simp add: upper_le_PDPlus_PDUnit_iff)
    66 apply (simp add: 2)
    67 apply (subst PDPlus_commute)
    68 apply (simp add: 2)
    69 apply (simp add: upper_le_PDPlus_iff 3)
    70 done
    71 
    72 lemma pd_take_upper_chain:
    73   "pd_take n t \<le>\<sharp> pd_take (Suc n) t"
    74 apply (induct t rule: pd_basis_induct)
    75 apply (simp add: compact_basis.take_chain)
    76 apply (simp add: PDPlus_upper_mono)
    77 done
    78 
    79 lemma pd_take_upper_le: "pd_take i t \<le>\<sharp> t"
    80 apply (induct t rule: pd_basis_induct)
    81 apply (simp add: compact_basis.take_less)
    82 apply (simp add: PDPlus_upper_mono)
    83 done
    84 
    85 lemma pd_take_upper_mono:
    86   "t \<le>\<sharp> u \<Longrightarrow> pd_take n t \<le>\<sharp> pd_take n u"
    87 apply (erule upper_le_induct)
    88 apply (simp add: compact_basis.take_mono)
    89 apply (simp add: upper_le_PDPlus_PDUnit_iff)
    90 apply (simp add: upper_le_PDPlus_iff)
    91 done
    92 
    93 
    94 subsection {* Type definition *}
    95 
    96 typedef (open) 'a upper_pd =
    97   "{S::'a pd_basis set. upper_le.ideal S}"
    98 by (fast intro: upper_le.ideal_principal)
    99 
   100 instantiation upper_pd :: (profinite) sq_ord
   101 begin
   102 
   103 definition
   104   "x \<sqsubseteq> y \<longleftrightarrow> Rep_upper_pd x \<subseteq> Rep_upper_pd y"
   105 
   106 instance ..
   107 end
   108 
   109 instance upper_pd :: (profinite) po
   110 by (rule upper_le.typedef_ideal_po
   111     [OF type_definition_upper_pd sq_le_upper_pd_def])
   112 
   113 instance upper_pd :: (profinite) cpo
   114 by (rule upper_le.typedef_ideal_cpo
   115     [OF type_definition_upper_pd sq_le_upper_pd_def])
   116 
   117 lemma Rep_upper_pd_lub:
   118   "chain Y \<Longrightarrow> Rep_upper_pd (\<Squnion>i. Y i) = (\<Union>i. Rep_upper_pd (Y i))"
   119 by (rule upper_le.typedef_ideal_rep_contlub
   120     [OF type_definition_upper_pd sq_le_upper_pd_def])
   121 
   122 lemma ideal_Rep_upper_pd: "upper_le.ideal (Rep_upper_pd xs)"
   123 by (rule Rep_upper_pd [unfolded mem_Collect_eq])
   124 
   125 definition
   126   upper_principal :: "'a pd_basis \<Rightarrow> 'a upper_pd" where
   127   "upper_principal t = Abs_upper_pd {u. u \<le>\<sharp> t}"
   128 
   129 lemma Rep_upper_principal:
   130   "Rep_upper_pd (upper_principal t) = {u. u \<le>\<sharp> t}"
   131 unfolding upper_principal_def
   132 by (simp add: Abs_upper_pd_inverse upper_le.ideal_principal)
   133 
   134 interpretation upper_pd!:
   135   ideal_completion upper_le pd_take upper_principal Rep_upper_pd
   136 apply unfold_locales
   137 apply (rule pd_take_upper_le)
   138 apply (rule pd_take_idem)
   139 apply (erule pd_take_upper_mono)
   140 apply (rule pd_take_upper_chain)
   141 apply (rule finite_range_pd_take)
   142 apply (rule pd_take_covers)
   143 apply (rule ideal_Rep_upper_pd)
   144 apply (erule Rep_upper_pd_lub)
   145 apply (rule Rep_upper_principal)
   146 apply (simp only: sq_le_upper_pd_def)
   147 done
   148 
   149 text {* Upper powerdomain is pointed *}
   150 
   151 lemma upper_pd_minimal: "upper_principal (PDUnit compact_bot) \<sqsubseteq> ys"
   152 by (induct ys rule: upper_pd.principal_induct, simp, simp)
   153 
   154 instance upper_pd :: (bifinite) pcpo
   155 by intro_classes (fast intro: upper_pd_minimal)
   156 
   157 lemma inst_upper_pd_pcpo: "\<bottom> = upper_principal (PDUnit compact_bot)"
   158 by (rule upper_pd_minimal [THEN UU_I, symmetric])
   159 
   160 text {* Upper powerdomain is profinite *}
   161 
   162 instantiation upper_pd :: (profinite) profinite
   163 begin
   164 
   165 definition
   166   approx_upper_pd_def: "approx = upper_pd.completion_approx"
   167 
   168 instance
   169 apply (intro_classes, unfold approx_upper_pd_def)
   170 apply (rule upper_pd.chain_completion_approx)
   171 apply (rule upper_pd.lub_completion_approx)
   172 apply (rule upper_pd.completion_approx_idem)
   173 apply (rule upper_pd.finite_fixes_completion_approx)
   174 done
   175 
   176 end
   177 
   178 instance upper_pd :: (bifinite) bifinite ..
   179 
   180 lemma approx_upper_principal [simp]:
   181   "approx n\<cdot>(upper_principal t) = upper_principal (pd_take n t)"
   182 unfolding approx_upper_pd_def
   183 by (rule upper_pd.completion_approx_principal)
   184 
   185 lemma approx_eq_upper_principal:
   186   "\<exists>t\<in>Rep_upper_pd xs. approx n\<cdot>xs = upper_principal (pd_take n t)"
   187 unfolding approx_upper_pd_def
   188 by (rule upper_pd.completion_approx_eq_principal)
   189 
   190 
   191 subsection {* Monadic unit and plus *}
   192 
   193 definition
   194   upper_unit :: "'a \<rightarrow> 'a upper_pd" where
   195   "upper_unit = compact_basis.basis_fun (\<lambda>a. upper_principal (PDUnit a))"
   196 
   197 definition
   198   upper_plus :: "'a upper_pd \<rightarrow> 'a upper_pd \<rightarrow> 'a upper_pd" where
   199   "upper_plus = upper_pd.basis_fun (\<lambda>t. upper_pd.basis_fun (\<lambda>u.
   200       upper_principal (PDPlus t u)))"
   201 
   202 abbreviation
   203   upper_add :: "'a upper_pd \<Rightarrow> 'a upper_pd \<Rightarrow> 'a upper_pd"
   204     (infixl "+\<sharp>" 65) where
   205   "xs +\<sharp> ys == upper_plus\<cdot>xs\<cdot>ys"
   206 
   207 syntax
   208   "_upper_pd" :: "args \<Rightarrow> 'a upper_pd" ("{_}\<sharp>")
   209 
   210 translations
   211   "{x,xs}\<sharp>" == "{x}\<sharp> +\<sharp> {xs}\<sharp>"
   212   "{x}\<sharp>" == "CONST upper_unit\<cdot>x"
   213 
   214 lemma upper_unit_Rep_compact_basis [simp]:
   215   "{Rep_compact_basis a}\<sharp> = upper_principal (PDUnit a)"
   216 unfolding upper_unit_def
   217 by (simp add: compact_basis.basis_fun_principal PDUnit_upper_mono)
   218 
   219 lemma upper_plus_principal [simp]:
   220   "upper_principal t +\<sharp> upper_principal u = upper_principal (PDPlus t u)"
   221 unfolding upper_plus_def
   222 by (simp add: upper_pd.basis_fun_principal
   223     upper_pd.basis_fun_mono PDPlus_upper_mono)
   224 
   225 lemma approx_upper_unit [simp]:
   226   "approx n\<cdot>{x}\<sharp> = {approx n\<cdot>x}\<sharp>"
   227 apply (induct x rule: compact_basis.principal_induct, simp)
   228 apply (simp add: approx_Rep_compact_basis)
   229 done
   230 
   231 lemma approx_upper_plus [simp]:
   232   "approx n\<cdot>(xs +\<sharp> ys) = (approx n\<cdot>xs) +\<sharp> (approx n\<cdot>ys)"
   233 by (induct xs ys rule: upper_pd.principal_induct2, simp, simp, simp)
   234 
   235 lemma upper_plus_assoc: "(xs +\<sharp> ys) +\<sharp> zs = xs +\<sharp> (ys +\<sharp> zs)"
   236 apply (induct xs ys arbitrary: zs rule: upper_pd.principal_induct2, simp, simp)
   237 apply (rule_tac x=zs in upper_pd.principal_induct, simp)
   238 apply (simp add: PDPlus_assoc)
   239 done
   240 
   241 lemma upper_plus_commute: "xs +\<sharp> ys = ys +\<sharp> xs"
   242 apply (induct xs ys rule: upper_pd.principal_induct2, simp, simp)
   243 apply (simp add: PDPlus_commute)
   244 done
   245 
   246 lemma upper_plus_absorb: "xs +\<sharp> xs = xs"
   247 apply (induct xs rule: upper_pd.principal_induct, simp)
   248 apply (simp add: PDPlus_absorb)
   249 done
   250 
   251 interpretation aci_upper_plus!: ab_semigroup_idem_mult "op +\<sharp>"
   252   by unfold_locales
   253     (rule upper_plus_assoc upper_plus_commute upper_plus_absorb)+
   254 
   255 lemma upper_plus_left_commute: "xs +\<sharp> (ys +\<sharp> zs) = ys +\<sharp> (xs +\<sharp> zs)"
   256 by (rule aci_upper_plus.mult_left_commute)
   257 
   258 lemma upper_plus_left_absorb: "xs +\<sharp> (xs +\<sharp> ys) = xs +\<sharp> ys"
   259 by (rule aci_upper_plus.mult_left_idem)
   260 
   261 lemmas upper_plus_aci = aci_upper_plus.mult_ac_idem
   262 
   263 lemma upper_plus_less1: "xs +\<sharp> ys \<sqsubseteq> xs"
   264 apply (induct xs ys rule: upper_pd.principal_induct2, simp, simp)
   265 apply (simp add: PDPlus_upper_less)
   266 done
   267 
   268 lemma upper_plus_less2: "xs +\<sharp> ys \<sqsubseteq> ys"
   269 by (subst upper_plus_commute, rule upper_plus_less1)
   270 
   271 lemma upper_plus_greatest: "\<lbrakk>xs \<sqsubseteq> ys; xs \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs \<sqsubseteq> ys +\<sharp> zs"
   272 apply (subst upper_plus_absorb [of xs, symmetric])
   273 apply (erule (1) monofun_cfun [OF monofun_cfun_arg])
   274 done
   275 
   276 lemma upper_less_plus_iff:
   277   "xs \<sqsubseteq> ys +\<sharp> zs \<longleftrightarrow> xs \<sqsubseteq> ys \<and> xs \<sqsubseteq> zs"
   278 apply safe
   279 apply (erule trans_less [OF _ upper_plus_less1])
   280 apply (erule trans_less [OF _ upper_plus_less2])
   281 apply (erule (1) upper_plus_greatest)
   282 done
   283 
   284 lemma upper_plus_less_unit_iff:
   285   "xs +\<sharp> ys \<sqsubseteq> {z}\<sharp> \<longleftrightarrow> xs \<sqsubseteq> {z}\<sharp> \<or> ys \<sqsubseteq> {z}\<sharp>"
   286  apply (rule iffI)
   287   apply (subgoal_tac
   288     "adm (\<lambda>f. f\<cdot>xs \<sqsubseteq> f\<cdot>{z}\<sharp> \<or> f\<cdot>ys \<sqsubseteq> f\<cdot>{z}\<sharp>)")
   289    apply (drule admD, rule chain_approx)
   290     apply (drule_tac f="approx i" in monofun_cfun_arg)
   291     apply (cut_tac x="approx i\<cdot>xs" in upper_pd.compact_imp_principal, simp)
   292     apply (cut_tac x="approx i\<cdot>ys" in upper_pd.compact_imp_principal, simp)
   293     apply (cut_tac x="approx i\<cdot>z" in compact_basis.compact_imp_principal, simp)
   294     apply (clarify, simp add: upper_le_PDPlus_PDUnit_iff)
   295    apply simp
   296   apply simp
   297  apply (erule disjE)
   298   apply (erule trans_less [OF upper_plus_less1])
   299  apply (erule trans_less [OF upper_plus_less2])
   300 done
   301 
   302 lemma upper_unit_less_iff [simp]: "{x}\<sharp> \<sqsubseteq> {y}\<sharp> \<longleftrightarrow> x \<sqsubseteq> y"
   303  apply (rule iffI)
   304   apply (rule profinite_less_ext)
   305   apply (drule_tac f="approx i" in monofun_cfun_arg, simp)
   306   apply (cut_tac x="approx i\<cdot>x" in compact_basis.compact_imp_principal, simp)
   307   apply (cut_tac x="approx i\<cdot>y" in compact_basis.compact_imp_principal, simp)
   308   apply clarsimp
   309  apply (erule monofun_cfun_arg)
   310 done
   311 
   312 lemmas upper_pd_less_simps =
   313   upper_unit_less_iff
   314   upper_less_plus_iff
   315   upper_plus_less_unit_iff
   316 
   317 lemma upper_unit_eq_iff [simp]: "{x}\<sharp> = {y}\<sharp> \<longleftrightarrow> x = y"
   318 unfolding po_eq_conv by simp
   319 
   320 lemma upper_unit_strict [simp]: "{\<bottom>}\<sharp> = \<bottom>"
   321 unfolding inst_upper_pd_pcpo Rep_compact_bot [symmetric] by simp
   322 
   323 lemma upper_plus_strict1 [simp]: "\<bottom> +\<sharp> ys = \<bottom>"
   324 by (rule UU_I, rule upper_plus_less1)
   325 
   326 lemma upper_plus_strict2 [simp]: "xs +\<sharp> \<bottom> = \<bottom>"
   327 by (rule UU_I, rule upper_plus_less2)
   328 
   329 lemma upper_unit_strict_iff [simp]: "{x}\<sharp> = \<bottom> \<longleftrightarrow> x = \<bottom>"
   330 unfolding upper_unit_strict [symmetric] by (rule upper_unit_eq_iff)
   331 
   332 lemma upper_plus_strict_iff [simp]:
   333   "xs +\<sharp> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<or> ys = \<bottom>"
   334 apply (rule iffI)
   335 apply (erule rev_mp)
   336 apply (rule upper_pd.principal_induct2 [where x=xs and y=ys], simp, simp)
   337 apply (simp add: inst_upper_pd_pcpo upper_pd.principal_eq_iff
   338                  upper_le_PDPlus_PDUnit_iff)
   339 apply auto
   340 done
   341 
   342 lemma compact_upper_unit_iff [simp]: "compact {x}\<sharp> \<longleftrightarrow> compact x"
   343 unfolding profinite_compact_iff by simp
   344 
   345 lemma compact_upper_plus [simp]:
   346   "\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<sharp> ys)"
   347 by (auto dest!: upper_pd.compact_imp_principal)
   348 
   349 
   350 subsection {* Induction rules *}
   351 
   352 lemma upper_pd_induct1:
   353   assumes P: "adm P"
   354   assumes unit: "\<And>x. P {x}\<sharp>"
   355   assumes insert: "\<And>x ys. \<lbrakk>P {x}\<sharp>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<sharp> +\<sharp> ys)"
   356   shows "P (xs::'a upper_pd)"
   357 apply (induct xs rule: upper_pd.principal_induct, rule P)
   358 apply (induct_tac a rule: pd_basis_induct1)
   359 apply (simp only: upper_unit_Rep_compact_basis [symmetric])
   360 apply (rule unit)
   361 apply (simp only: upper_unit_Rep_compact_basis [symmetric]
   362                   upper_plus_principal [symmetric])
   363 apply (erule insert [OF unit])
   364 done
   365 
   366 lemma upper_pd_induct:
   367   assumes P: "adm P"
   368   assumes unit: "\<And>x. P {x}\<sharp>"
   369   assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<sharp> ys)"
   370   shows "P (xs::'a upper_pd)"
   371 apply (induct xs rule: upper_pd.principal_induct, rule P)
   372 apply (induct_tac a rule: pd_basis_induct)
   373 apply (simp only: upper_unit_Rep_compact_basis [symmetric] unit)
   374 apply (simp only: upper_plus_principal [symmetric] plus)
   375 done
   376 
   377 
   378 subsection {* Monadic bind *}
   379 
   380 definition
   381   upper_bind_basis ::
   382   "'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b upper_pd) \<rightarrow> 'b upper_pd" where
   383   "upper_bind_basis = fold_pd
   384     (\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a))
   385     (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<sharp> y\<cdot>f)"
   386 
   387 lemma ACI_upper_bind:
   388   "ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<sharp> y\<cdot>f)"
   389 apply unfold_locales
   390 apply (simp add: upper_plus_assoc)
   391 apply (simp add: upper_plus_commute)
   392 apply (simp add: upper_plus_absorb eta_cfun)
   393 done
   394 
   395 lemma upper_bind_basis_simps [simp]:
   396   "upper_bind_basis (PDUnit a) =
   397     (\<Lambda> f. f\<cdot>(Rep_compact_basis a))"
   398   "upper_bind_basis (PDPlus t u) =
   399     (\<Lambda> f. upper_bind_basis t\<cdot>f +\<sharp> upper_bind_basis u\<cdot>f)"
   400 unfolding upper_bind_basis_def
   401 apply -
   402 apply (rule fold_pd_PDUnit [OF ACI_upper_bind])
   403 apply (rule fold_pd_PDPlus [OF ACI_upper_bind])
   404 done
   405 
   406 lemma upper_bind_basis_mono:
   407   "t \<le>\<sharp> u \<Longrightarrow> upper_bind_basis t \<sqsubseteq> upper_bind_basis u"
   408 unfolding expand_cfun_less
   409 apply (erule upper_le_induct, safe)
   410 apply (simp add: monofun_cfun)
   411 apply (simp add: trans_less [OF upper_plus_less1])
   412 apply (simp add: upper_less_plus_iff)
   413 done
   414 
   415 definition
   416   upper_bind :: "'a upper_pd \<rightarrow> ('a \<rightarrow> 'b upper_pd) \<rightarrow> 'b upper_pd" where
   417   "upper_bind = upper_pd.basis_fun upper_bind_basis"
   418 
   419 lemma upper_bind_principal [simp]:
   420   "upper_bind\<cdot>(upper_principal t) = upper_bind_basis t"
   421 unfolding upper_bind_def
   422 apply (rule upper_pd.basis_fun_principal)
   423 apply (erule upper_bind_basis_mono)
   424 done
   425 
   426 lemma upper_bind_unit [simp]:
   427   "upper_bind\<cdot>{x}\<sharp>\<cdot>f = f\<cdot>x"
   428 by (induct x rule: compact_basis.principal_induct, simp, simp)
   429 
   430 lemma upper_bind_plus [simp]:
   431   "upper_bind\<cdot>(xs +\<sharp> ys)\<cdot>f = upper_bind\<cdot>xs\<cdot>f +\<sharp> upper_bind\<cdot>ys\<cdot>f"
   432 by (induct xs ys rule: upper_pd.principal_induct2, simp, simp, simp)
   433 
   434 lemma upper_bind_strict [simp]: "upper_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>"
   435 unfolding upper_unit_strict [symmetric] by (rule upper_bind_unit)
   436 
   437 
   438 subsection {* Map and join *}
   439 
   440 definition
   441   upper_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a upper_pd \<rightarrow> 'b upper_pd" where
   442   "upper_map = (\<Lambda> f xs. upper_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<sharp>))"
   443 
   444 definition
   445   upper_join :: "'a upper_pd upper_pd \<rightarrow> 'a upper_pd" where
   446   "upper_join = (\<Lambda> xss. upper_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))"
   447 
   448 lemma upper_map_unit [simp]:
   449   "upper_map\<cdot>f\<cdot>{x}\<sharp> = {f\<cdot>x}\<sharp>"
   450 unfolding upper_map_def by simp
   451 
   452 lemma upper_map_plus [simp]:
   453   "upper_map\<cdot>f\<cdot>(xs +\<sharp> ys) = upper_map\<cdot>f\<cdot>xs +\<sharp> upper_map\<cdot>f\<cdot>ys"
   454 unfolding upper_map_def by simp
   455 
   456 lemma upper_join_unit [simp]:
   457   "upper_join\<cdot>{xs}\<sharp> = xs"
   458 unfolding upper_join_def by simp
   459 
   460 lemma upper_join_plus [simp]:
   461   "upper_join\<cdot>(xss +\<sharp> yss) = upper_join\<cdot>xss +\<sharp> upper_join\<cdot>yss"
   462 unfolding upper_join_def by simp
   463 
   464 lemma upper_map_ident: "upper_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs"
   465 by (induct xs rule: upper_pd_induct, simp_all)
   466 
   467 lemma upper_map_map:
   468   "upper_map\<cdot>f\<cdot>(upper_map\<cdot>g\<cdot>xs) = upper_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs"
   469 by (induct xs rule: upper_pd_induct, simp_all)
   470 
   471 lemma upper_join_map_unit:
   472   "upper_join\<cdot>(upper_map\<cdot>upper_unit\<cdot>xs) = xs"
   473 by (induct xs rule: upper_pd_induct, simp_all)
   474 
   475 lemma upper_join_map_join:
   476   "upper_join\<cdot>(upper_map\<cdot>upper_join\<cdot>xsss) = upper_join\<cdot>(upper_join\<cdot>xsss)"
   477 by (induct xsss rule: upper_pd_induct, simp_all)
   478 
   479 lemma upper_join_map_map:
   480   "upper_join\<cdot>(upper_map\<cdot>(upper_map\<cdot>f)\<cdot>xss) =
   481    upper_map\<cdot>f\<cdot>(upper_join\<cdot>xss)"
   482 by (induct xss rule: upper_pd_induct, simp_all)
   483 
   484 lemma upper_map_approx: "upper_map\<cdot>(approx n)\<cdot>xs = approx n\<cdot>xs"
   485 by (induct xs rule: upper_pd_induct, simp_all)
   486 
   487 end