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