src/HOLCF/LowerPD.thy
author huffman
Fri Jun 20 22:51:50 2008 +0200 (2008-06-20)
changeset 27309 c74270fd72a8
parent 27297 2c42b1505f25
child 27310 d0229bc6c461
permissions -rw-r--r--
clean up and rename some profinite lemmas
     1 (*  Title:      HOLCF/LowerPD.thy
     2     ID:         $Id$
     3     Author:     Brian Huffman
     4 *)
     5 
     6 header {* Lower powerdomain *}
     7 
     8 theory LowerPD
     9 imports CompactBasis
    10 begin
    11 
    12 subsection {* Basis preorder *}
    13 
    14 definition
    15   lower_le :: "'a pd_basis \<Rightarrow> 'a pd_basis \<Rightarrow> bool" (infix "\<le>\<flat>" 50) where
    16   "lower_le = (\<lambda>u v. \<forall>x\<in>Rep_pd_basis u. \<exists>y\<in>Rep_pd_basis v. x \<sqsubseteq> y)"
    17 
    18 lemma lower_le_refl [simp]: "t \<le>\<flat> t"
    19 unfolding lower_le_def by fast
    20 
    21 lemma lower_le_trans: "\<lbrakk>t \<le>\<flat> u; u \<le>\<flat> v\<rbrakk> \<Longrightarrow> t \<le>\<flat> v"
    22 unfolding lower_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 lower_le: preorder [lower_le]
    31 by (rule preorder.intro, rule lower_le_refl, rule lower_le_trans)
    32 
    33 lemma lower_le_minimal [simp]: "PDUnit compact_bot \<le>\<flat> t"
    34 unfolding lower_le_def Rep_PDUnit
    35 by (simp, rule Rep_pd_basis_nonempty [folded ex_in_conv])
    36 
    37 lemma PDUnit_lower_mono: "x \<sqsubseteq> y \<Longrightarrow> PDUnit x \<le>\<flat> PDUnit y"
    38 unfolding lower_le_def Rep_PDUnit by fast
    39 
    40 lemma PDPlus_lower_mono: "\<lbrakk>s \<le>\<flat> t; u \<le>\<flat> v\<rbrakk> \<Longrightarrow> PDPlus s u \<le>\<flat> PDPlus t v"
    41 unfolding lower_le_def Rep_PDPlus by fast
    42 
    43 lemma PDPlus_lower_less: "t \<le>\<flat> PDPlus t u"
    44 unfolding lower_le_def Rep_PDPlus by fast
    45 
    46 lemma lower_le_PDUnit_PDUnit_iff [simp]:
    47   "(PDUnit a \<le>\<flat> PDUnit b) = a \<sqsubseteq> b"
    48 unfolding lower_le_def Rep_PDUnit by fast
    49 
    50 lemma lower_le_PDUnit_PDPlus_iff:
    51   "(PDUnit a \<le>\<flat> PDPlus t u) = (PDUnit a \<le>\<flat> t \<or> PDUnit a \<le>\<flat> u)"
    52 unfolding lower_le_def Rep_PDPlus Rep_PDUnit by fast
    53 
    54 lemma lower_le_PDPlus_iff: "(PDPlus t u \<le>\<flat> v) = (t \<le>\<flat> v \<and> u \<le>\<flat> v)"
    55 unfolding lower_le_def Rep_PDPlus by fast
    56 
    57 lemma lower_le_induct [induct set: lower_le]:
    58   assumes le: "t \<le>\<flat> u"
    59   assumes 1: "\<And>a b. a \<sqsubseteq> b \<Longrightarrow> P (PDUnit a) (PDUnit b)"
    60   assumes 2: "\<And>t u a. P (PDUnit a) t \<Longrightarrow> P (PDUnit a) (PDPlus t u)"
    61   assumes 3: "\<And>t u v. \<lbrakk>P t v; P u v\<rbrakk> \<Longrightarrow> P (PDPlus t u) v"
    62   shows "P t u"
    63 using le
    64 apply (induct t arbitrary: u rule: pd_basis_induct)
    65 apply (erule rev_mp)
    66 apply (induct_tac u rule: pd_basis_induct)
    67 apply (simp add: 1)
    68 apply (simp add: lower_le_PDUnit_PDPlus_iff)
    69 apply (simp add: 2)
    70 apply (subst PDPlus_commute)
    71 apply (simp add: 2)
    72 apply (simp add: lower_le_PDPlus_iff 3)
    73 done
    74 
    75 lemma approx_pd_lower_chain:
    76   "approx_pd n t \<le>\<flat> approx_pd (Suc n) t"
    77 apply (induct t rule: pd_basis_induct)
    78 apply (simp add: compact_basis.take_chain)
    79 apply (simp add: PDPlus_lower_mono)
    80 done
    81 
    82 lemma approx_pd_lower_le: "approx_pd i t \<le>\<flat> t"
    83 apply (induct t rule: pd_basis_induct)
    84 apply (simp add: compact_basis.take_less)
    85 apply (simp add: PDPlus_lower_mono)
    86 done
    87 
    88 lemma approx_pd_lower_mono:
    89   "t \<le>\<flat> u \<Longrightarrow> approx_pd n t \<le>\<flat> approx_pd n u"
    90 apply (erule lower_le_induct)
    91 apply (simp add: compact_basis.take_mono)
    92 apply (simp add: lower_le_PDUnit_PDPlus_iff)
    93 apply (simp add: lower_le_PDPlus_iff)
    94 done
    95 
    96 
    97 subsection {* Type definition *}
    98 
    99 cpodef (open) 'a lower_pd =
   100   "{S::'a pd_basis cset. lower_le.ideal (Rep_cset S)}"
   101 by (rule lower_le.cpodef_ideal_lemma)
   102 
   103 lemma ideal_Rep_lower_pd: "lower_le.ideal (Rep_cset (Rep_lower_pd xs))"
   104 by (rule Rep_lower_pd [unfolded mem_Collect_eq])
   105 
   106 definition
   107   lower_principal :: "'a pd_basis \<Rightarrow> 'a lower_pd" where
   108   "lower_principal t = Abs_lower_pd (Abs_cset {u. u \<le>\<flat> t})"
   109 
   110 lemma Rep_lower_principal:
   111   "Rep_cset (Rep_lower_pd (lower_principal t)) = {u. u \<le>\<flat> t}"
   112 unfolding lower_principal_def
   113 by (simp add: Abs_lower_pd_inverse lower_le.ideal_principal)
   114 
   115 interpretation lower_pd:
   116   ideal_completion
   117     [lower_le approx_pd lower_principal "\<lambda>x. Rep_cset (Rep_lower_pd x)"]
   118 apply unfold_locales
   119 apply (rule approx_pd_lower_le)
   120 apply (rule approx_pd_idem)
   121 apply (erule approx_pd_lower_mono)
   122 apply (rule approx_pd_lower_chain)
   123 apply (rule finite_range_approx_pd)
   124 apply (rule approx_pd_covers)
   125 apply (rule ideal_Rep_lower_pd)
   126 apply (simp add: cont2contlubE [OF cont_Rep_lower_pd] Rep_cset_lub)
   127 apply (rule Rep_lower_principal)
   128 apply (simp only: less_lower_pd_def sq_le_cset_def)
   129 done
   130 
   131 text {* Lower powerdomain is pointed *}
   132 
   133 lemma lower_pd_minimal: "lower_principal (PDUnit compact_bot) \<sqsubseteq> ys"
   134 by (induct ys rule: lower_pd.principal_induct, simp, simp)
   135 
   136 instance lower_pd :: (bifinite) pcpo
   137 by intro_classes (fast intro: lower_pd_minimal)
   138 
   139 lemma inst_lower_pd_pcpo: "\<bottom> = lower_principal (PDUnit compact_bot)"
   140 by (rule lower_pd_minimal [THEN UU_I, symmetric])
   141 
   142 text {* Lower powerdomain is profinite *}
   143 
   144 instantiation lower_pd :: (profinite) profinite
   145 begin
   146 
   147 definition
   148   approx_lower_pd_def: "approx = lower_pd.completion_approx"
   149 
   150 instance
   151 apply (intro_classes, unfold approx_lower_pd_def)
   152 apply (simp add: lower_pd.chain_completion_approx)
   153 apply (rule lower_pd.lub_completion_approx)
   154 apply (rule lower_pd.completion_approx_idem)
   155 apply (rule lower_pd.finite_fixes_completion_approx)
   156 done
   157 
   158 end
   159 
   160 instance lower_pd :: (bifinite) bifinite ..
   161 
   162 lemma approx_lower_principal [simp]:
   163   "approx n\<cdot>(lower_principal t) = lower_principal (approx_pd n t)"
   164 unfolding approx_lower_pd_def
   165 by (rule lower_pd.completion_approx_principal)
   166 
   167 lemma approx_eq_lower_principal:
   168   "\<exists>t\<in>Rep_cset (Rep_lower_pd xs).
   169     approx n\<cdot>xs = lower_principal (approx_pd n t)"
   170 unfolding approx_lower_pd_def
   171 by (rule lower_pd.completion_approx_eq_principal)
   172 
   173 
   174 subsection {* Monadic unit and plus *}
   175 
   176 definition
   177   lower_unit :: "'a \<rightarrow> 'a lower_pd" where
   178   "lower_unit = compact_basis.basis_fun (\<lambda>a. lower_principal (PDUnit a))"
   179 
   180 definition
   181   lower_plus :: "'a lower_pd \<rightarrow> 'a lower_pd \<rightarrow> 'a lower_pd" where
   182   "lower_plus = lower_pd.basis_fun (\<lambda>t. lower_pd.basis_fun (\<lambda>u.
   183       lower_principal (PDPlus t u)))"
   184 
   185 abbreviation
   186   lower_add :: "'a lower_pd \<Rightarrow> 'a lower_pd \<Rightarrow> 'a lower_pd"
   187     (infixl "+\<flat>" 65) where
   188   "xs +\<flat> ys == lower_plus\<cdot>xs\<cdot>ys"
   189 
   190 syntax
   191   "_lower_pd" :: "args \<Rightarrow> 'a lower_pd" ("{_}\<flat>")
   192 
   193 translations
   194   "{x,xs}\<flat>" == "{x}\<flat> +\<flat> {xs}\<flat>"
   195   "{x}\<flat>" == "CONST lower_unit\<cdot>x"
   196 
   197 lemma lower_unit_Rep_compact_basis [simp]:
   198   "{Rep_compact_basis a}\<flat> = lower_principal (PDUnit a)"
   199 unfolding lower_unit_def
   200 by (simp add: compact_basis.basis_fun_principal PDUnit_lower_mono)
   201 
   202 lemma lower_plus_principal [simp]:
   203   "lower_principal t +\<flat> lower_principal u = lower_principal (PDPlus t u)"
   204 unfolding lower_plus_def
   205 by (simp add: lower_pd.basis_fun_principal
   206     lower_pd.basis_fun_mono PDPlus_lower_mono)
   207 
   208 lemma approx_lower_unit [simp]:
   209   "approx n\<cdot>{x}\<flat> = {approx n\<cdot>x}\<flat>"
   210 apply (induct x rule: compact_basis.principal_induct, simp)
   211 apply (simp add: approx_Rep_compact_basis)
   212 done
   213 
   214 lemma approx_lower_plus [simp]:
   215   "approx n\<cdot>(xs +\<flat> ys) = (approx n\<cdot>xs) +\<flat> (approx n\<cdot>ys)"
   216 by (induct xs ys rule: lower_pd.principal_induct2, simp, simp, simp)
   217 
   218 lemma lower_plus_assoc: "(xs +\<flat> ys) +\<flat> zs = xs +\<flat> (ys +\<flat> zs)"
   219 apply (induct xs ys arbitrary: zs rule: lower_pd.principal_induct2, simp, simp)
   220 apply (rule_tac x=zs in lower_pd.principal_induct, simp)
   221 apply (simp add: PDPlus_assoc)
   222 done
   223 
   224 lemma lower_plus_commute: "xs +\<flat> ys = ys +\<flat> xs"
   225 apply (induct xs ys rule: lower_pd.principal_induct2, simp, simp)
   226 apply (simp add: PDPlus_commute)
   227 done
   228 
   229 lemma lower_plus_absorb: "xs +\<flat> xs = xs"
   230 apply (induct xs rule: lower_pd.principal_induct, simp)
   231 apply (simp add: PDPlus_absorb)
   232 done
   233 
   234 interpretation aci_lower_plus: ab_semigroup_idem_mult ["op +\<flat>"]
   235   by unfold_locales
   236     (rule lower_plus_assoc lower_plus_commute lower_plus_absorb)+
   237 
   238 lemma lower_plus_left_commute: "xs +\<flat> (ys +\<flat> zs) = ys +\<flat> (xs +\<flat> zs)"
   239 by (rule aci_lower_plus.mult_left_commute)
   240 
   241 lemma lower_plus_left_absorb: "xs +\<flat> (xs +\<flat> ys) = xs +\<flat> ys"
   242 by (rule aci_lower_plus.mult_left_idem)
   243 
   244 lemmas lower_plus_aci = aci_lower_plus.mult_ac_idem
   245 
   246 lemma lower_plus_less1: "xs \<sqsubseteq> xs +\<flat> ys"
   247 apply (induct xs ys rule: lower_pd.principal_induct2, simp, simp)
   248 apply (simp add: PDPlus_lower_less)
   249 done
   250 
   251 lemma lower_plus_less2: "ys \<sqsubseteq> xs +\<flat> ys"
   252 by (subst lower_plus_commute, rule lower_plus_less1)
   253 
   254 lemma lower_plus_least: "\<lbrakk>xs \<sqsubseteq> zs; ys \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs +\<flat> ys \<sqsubseteq> zs"
   255 apply (subst lower_plus_absorb [of zs, symmetric])
   256 apply (erule (1) monofun_cfun [OF monofun_cfun_arg])
   257 done
   258 
   259 lemma lower_plus_less_iff:
   260   "xs +\<flat> ys \<sqsubseteq> zs \<longleftrightarrow> xs \<sqsubseteq> zs \<and> ys \<sqsubseteq> zs"
   261 apply safe
   262 apply (erule trans_less [OF lower_plus_less1])
   263 apply (erule trans_less [OF lower_plus_less2])
   264 apply (erule (1) lower_plus_least)
   265 done
   266 
   267 lemma lower_unit_less_plus_iff:
   268   "{x}\<flat> \<sqsubseteq> ys +\<flat> zs \<longleftrightarrow> {x}\<flat> \<sqsubseteq> ys \<or> {x}\<flat> \<sqsubseteq> zs"
   269  apply (rule iffI)
   270   apply (subgoal_tac
   271     "adm (\<lambda>f. f\<cdot>{x}\<flat> \<sqsubseteq> f\<cdot>ys \<or> f\<cdot>{x}\<flat> \<sqsubseteq> f\<cdot>zs)")
   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>x" in compact_basis.compact_imp_principal, simp)
   275     apply (cut_tac x="approx i\<cdot>ys" in lower_pd.compact_imp_principal, simp)
   276     apply (cut_tac x="approx i\<cdot>zs" in lower_pd.compact_imp_principal, simp)
   277     apply (clarify, simp add: lower_le_PDUnit_PDPlus_iff)
   278    apply simp
   279   apply simp
   280  apply (erule disjE)
   281   apply (erule trans_less [OF _ lower_plus_less1])
   282  apply (erule trans_less [OF _ lower_plus_less2])
   283 done
   284 
   285 lemma lower_unit_less_iff [simp]: "{x}\<flat> \<sqsubseteq> {y}\<flat> \<longleftrightarrow> x \<sqsubseteq> y"
   286  apply (rule iffI)
   287   apply (rule profinite_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 lower_pd_less_simps =
   296   lower_unit_less_iff
   297   lower_plus_less_iff
   298   lower_unit_less_plus_iff
   299 
   300 lemma fooble:
   301   fixes f :: "'a::po \<Rightarrow> 'b::po"
   302   assumes f: "\<And>x y. f x \<sqsubseteq> f y \<longleftrightarrow> x \<sqsubseteq> y"
   303   shows "f x = f y \<longleftrightarrow> x = y"
   304 unfolding po_eq_conv by (simp add: f)
   305 
   306 lemma lower_unit_eq_iff [simp]: "{x}\<flat> = {y}\<flat> \<longleftrightarrow> x = y"
   307 by (rule lower_unit_less_iff [THEN fooble])
   308 
   309 lemma lower_unit_strict [simp]: "{\<bottom>}\<flat> = \<bottom>"
   310 unfolding inst_lower_pd_pcpo Rep_compact_bot [symmetric] by simp
   311 
   312 lemma lower_unit_strict_iff [simp]: "{x}\<flat> = \<bottom> \<longleftrightarrow> x = \<bottom>"
   313 unfolding lower_unit_strict [symmetric] by (rule lower_unit_eq_iff)
   314 
   315 lemma lower_plus_strict_iff [simp]:
   316   "xs +\<flat> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<and> ys = \<bottom>"
   317 apply safe
   318 apply (rule UU_I, erule subst, rule lower_plus_less1)
   319 apply (rule UU_I, erule subst, rule lower_plus_less2)
   320 apply (rule lower_plus_absorb)
   321 done
   322 
   323 lemma lower_plus_strict1 [simp]: "\<bottom> +\<flat> ys = ys"
   324 apply (rule antisym_less [OF _ lower_plus_less2])
   325 apply (simp add: lower_plus_least)
   326 done
   327 
   328 lemma lower_plus_strict2 [simp]: "xs +\<flat> \<bottom> = xs"
   329 apply (rule antisym_less [OF _ lower_plus_less1])
   330 apply (simp add: lower_plus_least)
   331 done
   332 
   333 lemma compact_lower_unit_iff [simp]: "compact {x}\<flat> \<longleftrightarrow> compact x"
   334 unfolding profinite_compact_iff by simp
   335 
   336 lemma compact_lower_plus [simp]:
   337   "\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<flat> ys)"
   338 by (auto dest!: lower_pd.compact_imp_principal)
   339 
   340 
   341 subsection {* Induction rules *}
   342 
   343 lemma lower_pd_induct1:
   344   assumes P: "adm P"
   345   assumes unit: "\<And>x. P {x}\<flat>"
   346   assumes insert:
   347     "\<And>x ys. \<lbrakk>P {x}\<flat>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<flat> +\<flat> ys)"
   348   shows "P (xs::'a lower_pd)"
   349 apply (induct xs rule: lower_pd.principal_induct, rule P)
   350 apply (induct_tac a rule: pd_basis_induct1)
   351 apply (simp only: lower_unit_Rep_compact_basis [symmetric])
   352 apply (rule unit)
   353 apply (simp only: lower_unit_Rep_compact_basis [symmetric]
   354                   lower_plus_principal [symmetric])
   355 apply (erule insert [OF unit])
   356 done
   357 
   358 lemma lower_pd_induct:
   359   assumes P: "adm P"
   360   assumes unit: "\<And>x. P {x}\<flat>"
   361   assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<flat> ys)"
   362   shows "P (xs::'a lower_pd)"
   363 apply (induct xs rule: lower_pd.principal_induct, rule P)
   364 apply (induct_tac a rule: pd_basis_induct)
   365 apply (simp only: lower_unit_Rep_compact_basis [symmetric] unit)
   366 apply (simp only: lower_plus_principal [symmetric] plus)
   367 done
   368 
   369 
   370 subsection {* Monadic bind *}
   371 
   372 definition
   373   lower_bind_basis ::
   374   "'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
   375   "lower_bind_basis = fold_pd
   376     (\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a))
   377     (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
   378 
   379 lemma ACI_lower_bind:
   380   "ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
   381 apply unfold_locales
   382 apply (simp add: lower_plus_assoc)
   383 apply (simp add: lower_plus_commute)
   384 apply (simp add: lower_plus_absorb eta_cfun)
   385 done
   386 
   387 lemma lower_bind_basis_simps [simp]:
   388   "lower_bind_basis (PDUnit a) =
   389     (\<Lambda> f. f\<cdot>(Rep_compact_basis a))"
   390   "lower_bind_basis (PDPlus t u) =
   391     (\<Lambda> f. lower_bind_basis t\<cdot>f +\<flat> lower_bind_basis u\<cdot>f)"
   392 unfolding lower_bind_basis_def
   393 apply -
   394 apply (rule fold_pd_PDUnit [OF ACI_lower_bind])
   395 apply (rule fold_pd_PDPlus [OF ACI_lower_bind])
   396 done
   397 
   398 lemma lower_bind_basis_mono:
   399   "t \<le>\<flat> u \<Longrightarrow> lower_bind_basis t \<sqsubseteq> lower_bind_basis u"
   400 unfolding expand_cfun_less
   401 apply (erule lower_le_induct, safe)
   402 apply (simp add: monofun_cfun)
   403 apply (simp add: rev_trans_less [OF lower_plus_less1])
   404 apply (simp add: lower_plus_less_iff)
   405 done
   406 
   407 definition
   408   lower_bind :: "'a lower_pd \<rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
   409   "lower_bind = lower_pd.basis_fun lower_bind_basis"
   410 
   411 lemma lower_bind_principal [simp]:
   412   "lower_bind\<cdot>(lower_principal t) = lower_bind_basis t"
   413 unfolding lower_bind_def
   414 apply (rule lower_pd.basis_fun_principal)
   415 apply (erule lower_bind_basis_mono)
   416 done
   417 
   418 lemma lower_bind_unit [simp]:
   419   "lower_bind\<cdot>{x}\<flat>\<cdot>f = f\<cdot>x"
   420 by (induct x rule: compact_basis.principal_induct, simp, simp)
   421 
   422 lemma lower_bind_plus [simp]:
   423   "lower_bind\<cdot>(xs +\<flat> ys)\<cdot>f = lower_bind\<cdot>xs\<cdot>f +\<flat> lower_bind\<cdot>ys\<cdot>f"
   424 by (induct xs ys rule: lower_pd.principal_induct2, simp, simp, simp)
   425 
   426 lemma lower_bind_strict [simp]: "lower_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>"
   427 unfolding lower_unit_strict [symmetric] by (rule lower_bind_unit)
   428 
   429 
   430 subsection {* Map and join *}
   431 
   432 definition
   433   lower_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a lower_pd \<rightarrow> 'b lower_pd" where
   434   "lower_map = (\<Lambda> f xs. lower_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<flat>))"
   435 
   436 definition
   437   lower_join :: "'a lower_pd lower_pd \<rightarrow> 'a lower_pd" where
   438   "lower_join = (\<Lambda> xss. lower_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))"
   439 
   440 lemma lower_map_unit [simp]:
   441   "lower_map\<cdot>f\<cdot>{x}\<flat> = {f\<cdot>x}\<flat>"
   442 unfolding lower_map_def by simp
   443 
   444 lemma lower_map_plus [simp]:
   445   "lower_map\<cdot>f\<cdot>(xs +\<flat> ys) = lower_map\<cdot>f\<cdot>xs +\<flat> lower_map\<cdot>f\<cdot>ys"
   446 unfolding lower_map_def by simp
   447 
   448 lemma lower_join_unit [simp]:
   449   "lower_join\<cdot>{xs}\<flat> = xs"
   450 unfolding lower_join_def by simp
   451 
   452 lemma lower_join_plus [simp]:
   453   "lower_join\<cdot>(xss +\<flat> yss) = lower_join\<cdot>xss +\<flat> lower_join\<cdot>yss"
   454 unfolding lower_join_def by simp
   455 
   456 lemma lower_map_ident: "lower_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs"
   457 by (induct xs rule: lower_pd_induct, simp_all)
   458 
   459 lemma lower_map_map:
   460   "lower_map\<cdot>f\<cdot>(lower_map\<cdot>g\<cdot>xs) = lower_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs"
   461 by (induct xs rule: lower_pd_induct, simp_all)
   462 
   463 lemma lower_join_map_unit:
   464   "lower_join\<cdot>(lower_map\<cdot>lower_unit\<cdot>xs) = xs"
   465 by (induct xs rule: lower_pd_induct, simp_all)
   466 
   467 lemma lower_join_map_join:
   468   "lower_join\<cdot>(lower_map\<cdot>lower_join\<cdot>xsss) = lower_join\<cdot>(lower_join\<cdot>xsss)"
   469 by (induct xsss rule: lower_pd_induct, simp_all)
   470 
   471 lemma lower_join_map_map:
   472   "lower_join\<cdot>(lower_map\<cdot>(lower_map\<cdot>f)\<cdot>xss) =
   473    lower_map\<cdot>f\<cdot>(lower_join\<cdot>xss)"
   474 by (induct xss rule: lower_pd_induct, simp_all)
   475 
   476 lemma lower_map_approx: "lower_map\<cdot>(approx n)\<cdot>xs = approx n\<cdot>xs"
   477 by (induct xs rule: lower_pd_induct, simp_all)
   478 
   479 end