src/HOLCF/UpperPD.thy
author haftmann
Fri Jan 16 14:58:56 2009 +0100 (2009-01-16)
changeset 29511 7071b017cb35
parent 29252 ea97aa6aeba2
child 29672 07f3da9fd2a0
permissions -rw-r--r--
migrated class package to new locale implementation
     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   proof qed (rule upper_plus_assoc upper_plus_commute upper_plus_absorb)+
   253 
   254 lemma upper_plus_left_commute: "xs +\<sharp> (ys +\<sharp> zs) = ys +\<sharp> (xs +\<sharp> zs)"
   255 by (rule aci_upper_plus.mult_left_commute)
   256 
   257 lemma upper_plus_left_absorb: "xs +\<sharp> (xs +\<sharp> ys) = xs +\<sharp> ys"
   258 by (rule aci_upper_plus.mult_left_idem)
   259 
   260 lemmas upper_plus_aci = aci_upper_plus.mult_ac_idem
   261 
   262 lemma upper_plus_less1: "xs +\<sharp> ys \<sqsubseteq> xs"
   263 apply (induct xs ys rule: upper_pd.principal_induct2, simp, simp)
   264 apply (simp add: PDPlus_upper_less)
   265 done
   266 
   267 lemma upper_plus_less2: "xs +\<sharp> ys \<sqsubseteq> ys"
   268 by (subst upper_plus_commute, rule upper_plus_less1)
   269 
   270 lemma upper_plus_greatest: "\<lbrakk>xs \<sqsubseteq> ys; xs \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs \<sqsubseteq> ys +\<sharp> zs"
   271 apply (subst upper_plus_absorb [of xs, symmetric])
   272 apply (erule (1) monofun_cfun [OF monofun_cfun_arg])
   273 done
   274 
   275 lemma upper_less_plus_iff:
   276   "xs \<sqsubseteq> ys +\<sharp> zs \<longleftrightarrow> xs \<sqsubseteq> ys \<and> xs \<sqsubseteq> zs"
   277 apply safe
   278 apply (erule trans_less [OF _ upper_plus_less1])
   279 apply (erule trans_less [OF _ upper_plus_less2])
   280 apply (erule (1) upper_plus_greatest)
   281 done
   282 
   283 lemma upper_plus_less_unit_iff:
   284   "xs +\<sharp> ys \<sqsubseteq> {z}\<sharp> \<longleftrightarrow> xs \<sqsubseteq> {z}\<sharp> \<or> ys \<sqsubseteq> {z}\<sharp>"
   285  apply (rule iffI)
   286   apply (subgoal_tac
   287     "adm (\<lambda>f. f\<cdot>xs \<sqsubseteq> f\<cdot>{z}\<sharp> \<or> f\<cdot>ys \<sqsubseteq> f\<cdot>{z}\<sharp>)")
   288    apply (drule admD, rule chain_approx)
   289     apply (drule_tac f="approx i" in monofun_cfun_arg)
   290     apply (cut_tac x="approx i\<cdot>xs" in upper_pd.compact_imp_principal, simp)
   291     apply (cut_tac x="approx i\<cdot>ys" in upper_pd.compact_imp_principal, simp)
   292     apply (cut_tac x="approx i\<cdot>z" in compact_basis.compact_imp_principal, simp)
   293     apply (clarify, simp add: upper_le_PDPlus_PDUnit_iff)
   294    apply simp
   295   apply simp
   296  apply (erule disjE)
   297   apply (erule trans_less [OF upper_plus_less1])
   298  apply (erule trans_less [OF upper_plus_less2])
   299 done
   300 
   301 lemma upper_unit_less_iff [simp]: "{x}\<sharp> \<sqsubseteq> {y}\<sharp> \<longleftrightarrow> x \<sqsubseteq> y"
   302  apply (rule iffI)
   303   apply (rule profinite_less_ext)
   304   apply (drule_tac f="approx i" in monofun_cfun_arg, simp)
   305   apply (cut_tac x="approx i\<cdot>x" in compact_basis.compact_imp_principal, simp)
   306   apply (cut_tac x="approx i\<cdot>y" in compact_basis.compact_imp_principal, simp)
   307   apply clarsimp
   308  apply (erule monofun_cfun_arg)
   309 done
   310 
   311 lemmas upper_pd_less_simps =
   312   upper_unit_less_iff
   313   upper_less_plus_iff
   314   upper_plus_less_unit_iff
   315 
   316 lemma upper_unit_eq_iff [simp]: "{x}\<sharp> = {y}\<sharp> \<longleftrightarrow> x = y"
   317 unfolding po_eq_conv by simp
   318 
   319 lemma upper_unit_strict [simp]: "{\<bottom>}\<sharp> = \<bottom>"
   320 unfolding inst_upper_pd_pcpo Rep_compact_bot [symmetric] by simp
   321 
   322 lemma upper_plus_strict1 [simp]: "\<bottom> +\<sharp> ys = \<bottom>"
   323 by (rule UU_I, rule upper_plus_less1)
   324 
   325 lemma upper_plus_strict2 [simp]: "xs +\<sharp> \<bottom> = \<bottom>"
   326 by (rule UU_I, rule upper_plus_less2)
   327 
   328 lemma upper_unit_strict_iff [simp]: "{x}\<sharp> = \<bottom> \<longleftrightarrow> x = \<bottom>"
   329 unfolding upper_unit_strict [symmetric] by (rule upper_unit_eq_iff)
   330 
   331 lemma upper_plus_strict_iff [simp]:
   332   "xs +\<sharp> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<or> ys = \<bottom>"
   333 apply (rule iffI)
   334 apply (erule rev_mp)
   335 apply (rule upper_pd.principal_induct2 [where x=xs and y=ys], simp, simp)
   336 apply (simp add: inst_upper_pd_pcpo upper_pd.principal_eq_iff
   337                  upper_le_PDPlus_PDUnit_iff)
   338 apply auto
   339 done
   340 
   341 lemma compact_upper_unit_iff [simp]: "compact {x}\<sharp> \<longleftrightarrow> compact x"
   342 unfolding profinite_compact_iff by simp
   343 
   344 lemma compact_upper_plus [simp]:
   345   "\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<sharp> ys)"
   346 by (auto dest!: upper_pd.compact_imp_principal)
   347 
   348 
   349 subsection {* Induction rules *}
   350 
   351 lemma upper_pd_induct1:
   352   assumes P: "adm P"
   353   assumes unit: "\<And>x. P {x}\<sharp>"
   354   assumes insert: "\<And>x ys. \<lbrakk>P {x}\<sharp>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<sharp> +\<sharp> ys)"
   355   shows "P (xs::'a upper_pd)"
   356 apply (induct xs rule: upper_pd.principal_induct, rule P)
   357 apply (induct_tac a rule: pd_basis_induct1)
   358 apply (simp only: upper_unit_Rep_compact_basis [symmetric])
   359 apply (rule unit)
   360 apply (simp only: upper_unit_Rep_compact_basis [symmetric]
   361                   upper_plus_principal [symmetric])
   362 apply (erule insert [OF unit])
   363 done
   364 
   365 lemma upper_pd_induct:
   366   assumes P: "adm P"
   367   assumes unit: "\<And>x. P {x}\<sharp>"
   368   assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<sharp> ys)"
   369   shows "P (xs::'a upper_pd)"
   370 apply (induct xs rule: upper_pd.principal_induct, rule P)
   371 apply (induct_tac a rule: pd_basis_induct)
   372 apply (simp only: upper_unit_Rep_compact_basis [symmetric] unit)
   373 apply (simp only: upper_plus_principal [symmetric] plus)
   374 done
   375 
   376 
   377 subsection {* Monadic bind *}
   378 
   379 definition
   380   upper_bind_basis ::
   381   "'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b upper_pd) \<rightarrow> 'b upper_pd" where
   382   "upper_bind_basis = fold_pd
   383     (\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a))
   384     (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<sharp> y\<cdot>f)"
   385 
   386 lemma ACI_upper_bind:
   387   "ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<sharp> y\<cdot>f)"
   388 apply unfold_locales
   389 apply (simp add: upper_plus_assoc)
   390 apply (simp add: upper_plus_commute)
   391 apply (simp add: upper_plus_absorb eta_cfun)
   392 done
   393 
   394 lemma upper_bind_basis_simps [simp]:
   395   "upper_bind_basis (PDUnit a) =
   396     (\<Lambda> f. f\<cdot>(Rep_compact_basis a))"
   397   "upper_bind_basis (PDPlus t u) =
   398     (\<Lambda> f. upper_bind_basis t\<cdot>f +\<sharp> upper_bind_basis u\<cdot>f)"
   399 unfolding upper_bind_basis_def
   400 apply -
   401 apply (rule fold_pd_PDUnit [OF ACI_upper_bind])
   402 apply (rule fold_pd_PDPlus [OF ACI_upper_bind])
   403 done
   404 
   405 lemma upper_bind_basis_mono:
   406   "t \<le>\<sharp> u \<Longrightarrow> upper_bind_basis t \<sqsubseteq> upper_bind_basis u"
   407 unfolding expand_cfun_less
   408 apply (erule upper_le_induct, safe)
   409 apply (simp add: monofun_cfun)
   410 apply (simp add: trans_less [OF upper_plus_less1])
   411 apply (simp add: upper_less_plus_iff)
   412 done
   413 
   414 definition
   415   upper_bind :: "'a upper_pd \<rightarrow> ('a \<rightarrow> 'b upper_pd) \<rightarrow> 'b upper_pd" where
   416   "upper_bind = upper_pd.basis_fun upper_bind_basis"
   417 
   418 lemma upper_bind_principal [simp]:
   419   "upper_bind\<cdot>(upper_principal t) = upper_bind_basis t"
   420 unfolding upper_bind_def
   421 apply (rule upper_pd.basis_fun_principal)
   422 apply (erule upper_bind_basis_mono)
   423 done
   424 
   425 lemma upper_bind_unit [simp]:
   426   "upper_bind\<cdot>{x}\<sharp>\<cdot>f = f\<cdot>x"
   427 by (induct x rule: compact_basis.principal_induct, simp, simp)
   428 
   429 lemma upper_bind_plus [simp]:
   430   "upper_bind\<cdot>(xs +\<sharp> ys)\<cdot>f = upper_bind\<cdot>xs\<cdot>f +\<sharp> upper_bind\<cdot>ys\<cdot>f"
   431 by (induct xs ys rule: upper_pd.principal_induct2, simp, simp, simp)
   432 
   433 lemma upper_bind_strict [simp]: "upper_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>"
   434 unfolding upper_unit_strict [symmetric] by (rule upper_bind_unit)
   435 
   436 
   437 subsection {* Map and join *}
   438 
   439 definition
   440   upper_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a upper_pd \<rightarrow> 'b upper_pd" where
   441   "upper_map = (\<Lambda> f xs. upper_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<sharp>))"
   442 
   443 definition
   444   upper_join :: "'a upper_pd upper_pd \<rightarrow> 'a upper_pd" where
   445   "upper_join = (\<Lambda> xss. upper_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))"
   446 
   447 lemma upper_map_unit [simp]:
   448   "upper_map\<cdot>f\<cdot>{x}\<sharp> = {f\<cdot>x}\<sharp>"
   449 unfolding upper_map_def by simp
   450 
   451 lemma upper_map_plus [simp]:
   452   "upper_map\<cdot>f\<cdot>(xs +\<sharp> ys) = upper_map\<cdot>f\<cdot>xs +\<sharp> upper_map\<cdot>f\<cdot>ys"
   453 unfolding upper_map_def by simp
   454 
   455 lemma upper_join_unit [simp]:
   456   "upper_join\<cdot>{xs}\<sharp> = xs"
   457 unfolding upper_join_def by simp
   458 
   459 lemma upper_join_plus [simp]:
   460   "upper_join\<cdot>(xss +\<sharp> yss) = upper_join\<cdot>xss +\<sharp> upper_join\<cdot>yss"
   461 unfolding upper_join_def by simp
   462 
   463 lemma upper_map_ident: "upper_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs"
   464 by (induct xs rule: upper_pd_induct, simp_all)
   465 
   466 lemma upper_map_map:
   467   "upper_map\<cdot>f\<cdot>(upper_map\<cdot>g\<cdot>xs) = upper_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs"
   468 by (induct xs rule: upper_pd_induct, simp_all)
   469 
   470 lemma upper_join_map_unit:
   471   "upper_join\<cdot>(upper_map\<cdot>upper_unit\<cdot>xs) = xs"
   472 by (induct xs rule: upper_pd_induct, simp_all)
   473 
   474 lemma upper_join_map_join:
   475   "upper_join\<cdot>(upper_map\<cdot>upper_join\<cdot>xsss) = upper_join\<cdot>(upper_join\<cdot>xsss)"
   476 by (induct xsss rule: upper_pd_induct, simp_all)
   477 
   478 lemma upper_join_map_map:
   479   "upper_join\<cdot>(upper_map\<cdot>(upper_map\<cdot>f)\<cdot>xss) =
   480    upper_map\<cdot>f\<cdot>(upper_join\<cdot>xss)"
   481 by (induct xss rule: upper_pd_induct, simp_all)
   482 
   483 lemma upper_map_approx: "upper_map\<cdot>(approx n)\<cdot>xs = approx n\<cdot>xs"
   484 by (induct xs rule: upper_pd_induct, simp_all)
   485 
   486 end