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