src/HOLCF/LowerPD.thy
author huffman
Wed Jun 18 23:03:11 2008 +0200 (2008-06-18)
changeset 27267 5ebfb7f25ebb
parent 26962 c8b20f615d6c
child 27289 c49d427867aa
permissions -rw-r--r--
add lemma compact_imp_principal to locale ideal_completion
     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_mono1:
    76   "i \<le> j \<Longrightarrow> approx_pd i t \<le>\<flat> approx_pd j t"
    77 apply (induct t rule: pd_basis_induct)
    78 apply (simp add: compact_approx_mono1)
    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_approx_le)
    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_approx_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::profinite pd_basis set. lower_le.ideal S}"
   101 apply (simp add: lower_le.adm_ideal)
   102 apply (fast intro: lower_le.ideal_principal)
   103 done
   104 
   105 lemma ideal_Rep_lower_pd: "lower_le.ideal (Rep_lower_pd x)"
   106 by (rule Rep_lower_pd [unfolded mem_Collect_eq])
   107 
   108 definition
   109   lower_principal :: "'a pd_basis \<Rightarrow> 'a lower_pd" where
   110   "lower_principal t = Abs_lower_pd {u. u \<le>\<flat> t}"
   111 
   112 lemma Rep_lower_principal:
   113   "Rep_lower_pd (lower_principal t) = {u. u \<le>\<flat> t}"
   114 unfolding lower_principal_def
   115 apply (rule Abs_lower_pd_inverse [simplified])
   116 apply (rule lower_le.ideal_principal)
   117 done
   118 
   119 interpretation lower_pd:
   120   ideal_completion [lower_le approx_pd lower_principal Rep_lower_pd]
   121 apply unfold_locales
   122 apply (rule approx_pd_lower_le)
   123 apply (rule approx_pd_idem)
   124 apply (erule approx_pd_lower_mono)
   125 apply (rule approx_pd_lower_mono1, simp)
   126 apply (rule finite_range_approx_pd)
   127 apply (rule ex_approx_pd_eq)
   128 apply (rule ideal_Rep_lower_pd)
   129 apply (rule cont_Rep_lower_pd)
   130 apply (rule Rep_lower_principal)
   131 apply (simp only: less_lower_pd_def less_set_eq)
   132 done
   133 
   134 lemma lower_principal_less_iff [simp]:
   135   "lower_principal t \<sqsubseteq> lower_principal u \<longleftrightarrow> t \<le>\<flat> u"
   136 by (rule lower_pd.principal_less_iff)
   137 
   138 lemma lower_principal_eq_iff:
   139   "lower_principal t = lower_principal u \<longleftrightarrow> t \<le>\<flat> u \<and> u \<le>\<flat> t"
   140 by (rule lower_pd.principal_eq_iff)
   141 
   142 lemma lower_principal_mono:
   143   "t \<le>\<flat> u \<Longrightarrow> lower_principal t \<sqsubseteq> lower_principal u"
   144 by (rule lower_pd.principal_mono)
   145 
   146 lemma compact_lower_principal: "compact (lower_principal t)"
   147 by (rule lower_pd.compact_principal)
   148 
   149 lemma lower_pd_minimal: "lower_principal (PDUnit compact_bot) \<sqsubseteq> ys"
   150 by (induct ys rule: lower_pd.principal_induct, simp, simp)
   151 
   152 instance lower_pd :: (bifinite) pcpo
   153 by intro_classes (fast intro: lower_pd_minimal)
   154 
   155 lemma inst_lower_pd_pcpo: "\<bottom> = lower_principal (PDUnit compact_bot)"
   156 by (rule lower_pd_minimal [THEN UU_I, symmetric])
   157 
   158 
   159 subsection {* Approximation *}
   160 
   161 instantiation lower_pd :: (profinite) profinite
   162 begin
   163 
   164 definition
   165   approx_lower_pd_def: "approx = lower_pd.completion_approx"
   166 
   167 instance
   168 apply (intro_classes, unfold approx_lower_pd_def)
   169 apply (simp add: lower_pd.chain_completion_approx)
   170 apply (rule lower_pd.lub_completion_approx)
   171 apply (rule lower_pd.completion_approx_idem)
   172 apply (rule lower_pd.finite_fixes_completion_approx)
   173 done
   174 
   175 end
   176 
   177 instance lower_pd :: (bifinite) bifinite ..
   178 
   179 lemma approx_lower_principal [simp]:
   180   "approx n\<cdot>(lower_principal t) = lower_principal (approx_pd n t)"
   181 unfolding approx_lower_pd_def
   182 by (rule lower_pd.completion_approx_principal)
   183 
   184 lemma approx_eq_lower_principal:
   185   "\<exists>t\<in>Rep_lower_pd xs. approx n\<cdot>xs = lower_principal (approx_pd n t)"
   186 unfolding approx_lower_pd_def
   187 by (rule lower_pd.completion_approx_eq_principal)
   188 
   189 lemma compact_imp_lower_principal:
   190   "compact xs \<Longrightarrow> \<exists>t. xs = lower_principal t"
   191 by (rule lower_pd.compact_imp_principal)
   192 
   193 lemma lower_principal_induct:
   194   "\<lbrakk>adm P; \<And>t. P (lower_principal t)\<rbrakk> \<Longrightarrow> P xs"
   195 by (rule lower_pd.principal_induct)
   196 
   197 lemma lower_principal_induct2:
   198   "\<lbrakk>\<And>ys. adm (\<lambda>xs. P xs ys); \<And>xs. adm (\<lambda>ys. P xs ys);
   199     \<And>t u. P (lower_principal t) (lower_principal u)\<rbrakk> \<Longrightarrow> P xs ys"
   200 apply (rule_tac x=ys in spec)
   201 apply (rule_tac xs=xs in lower_principal_induct, simp)
   202 apply (rule allI, rename_tac ys)
   203 apply (rule_tac xs=ys in lower_principal_induct, simp)
   204 apply simp
   205 done
   206 
   207 
   208 subsection {* Monadic unit and plus *}
   209 
   210 definition
   211   lower_unit :: "'a \<rightarrow> 'a lower_pd" where
   212   "lower_unit = compact_basis.basis_fun (\<lambda>a. lower_principal (PDUnit a))"
   213 
   214 definition
   215   lower_plus :: "'a lower_pd \<rightarrow> 'a lower_pd \<rightarrow> 'a lower_pd" where
   216   "lower_plus = lower_pd.basis_fun (\<lambda>t. lower_pd.basis_fun (\<lambda>u.
   217       lower_principal (PDPlus t u)))"
   218 
   219 abbreviation
   220   lower_add :: "'a lower_pd \<Rightarrow> 'a lower_pd \<Rightarrow> 'a lower_pd"
   221     (infixl "+\<flat>" 65) where
   222   "xs +\<flat> ys == lower_plus\<cdot>xs\<cdot>ys"
   223 
   224 syntax
   225   "_lower_pd" :: "args \<Rightarrow> 'a lower_pd" ("{_}\<flat>")
   226 
   227 translations
   228   "{x,xs}\<flat>" == "{x}\<flat> +\<flat> {xs}\<flat>"
   229   "{x}\<flat>" == "CONST lower_unit\<cdot>x"
   230 
   231 lemma lower_unit_Rep_compact_basis [simp]:
   232   "{Rep_compact_basis a}\<flat> = lower_principal (PDUnit a)"
   233 unfolding lower_unit_def
   234 by (simp add: compact_basis.basis_fun_principal
   235     lower_principal_mono PDUnit_lower_mono)
   236 
   237 lemma lower_plus_principal [simp]:
   238   "lower_principal t +\<flat> lower_principal u = lower_principal (PDPlus t u)"
   239 unfolding lower_plus_def
   240 by (simp add: lower_pd.basis_fun_principal
   241     lower_pd.basis_fun_mono PDPlus_lower_mono)
   242 
   243 lemma approx_lower_unit [simp]:
   244   "approx n\<cdot>{x}\<flat> = {approx n\<cdot>x}\<flat>"
   245 apply (induct x rule: compact_basis_induct, simp)
   246 apply (simp add: approx_Rep_compact_basis)
   247 done
   248 
   249 lemma approx_lower_plus [simp]:
   250   "approx n\<cdot>(xs +\<flat> ys) = (approx n\<cdot>xs) +\<flat> (approx n\<cdot>ys)"
   251 by (induct xs ys rule: lower_principal_induct2, simp, simp, simp)
   252 
   253 lemma lower_plus_assoc: "(xs +\<flat> ys) +\<flat> zs = xs +\<flat> (ys +\<flat> zs)"
   254 apply (induct xs ys arbitrary: zs rule: lower_principal_induct2, simp, simp)
   255 apply (rule_tac xs=zs in lower_principal_induct, simp)
   256 apply (simp add: PDPlus_assoc)
   257 done
   258 
   259 lemma lower_plus_commute: "xs +\<flat> ys = ys +\<flat> xs"
   260 apply (induct xs ys rule: lower_principal_induct2, simp, simp)
   261 apply (simp add: PDPlus_commute)
   262 done
   263 
   264 lemma lower_plus_absorb: "xs +\<flat> xs = xs"
   265 apply (induct xs rule: lower_principal_induct, simp)
   266 apply (simp add: PDPlus_absorb)
   267 done
   268 
   269 interpretation aci_lower_plus: ab_semigroup_idem_mult ["op +\<flat>"]
   270   by unfold_locales
   271     (rule lower_plus_assoc lower_plus_commute lower_plus_absorb)+
   272 
   273 lemma lower_plus_left_commute: "xs +\<flat> (ys +\<flat> zs) = ys +\<flat> (xs +\<flat> zs)"
   274 by (rule aci_lower_plus.mult_left_commute)
   275 
   276 lemma lower_plus_left_absorb: "xs +\<flat> (xs +\<flat> ys) = xs +\<flat> ys"
   277 by (rule aci_lower_plus.mult_left_idem)
   278 
   279 lemmas lower_plus_aci = aci_lower_plus.mult_ac_idem
   280 
   281 lemma lower_plus_less1: "xs \<sqsubseteq> xs +\<flat> ys"
   282 apply (induct xs ys rule: lower_principal_induct2, simp, simp)
   283 apply (simp add: PDPlus_lower_less)
   284 done
   285 
   286 lemma lower_plus_less2: "ys \<sqsubseteq> xs +\<flat> ys"
   287 by (subst lower_plus_commute, rule lower_plus_less1)
   288 
   289 lemma lower_plus_least: "\<lbrakk>xs \<sqsubseteq> zs; ys \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs +\<flat> ys \<sqsubseteq> zs"
   290 apply (subst lower_plus_absorb [of zs, symmetric])
   291 apply (erule (1) monofun_cfun [OF monofun_cfun_arg])
   292 done
   293 
   294 lemma lower_plus_less_iff:
   295   "xs +\<flat> ys \<sqsubseteq> zs \<longleftrightarrow> xs \<sqsubseteq> zs \<and> ys \<sqsubseteq> zs"
   296 apply safe
   297 apply (erule trans_less [OF lower_plus_less1])
   298 apply (erule trans_less [OF lower_plus_less2])
   299 apply (erule (1) lower_plus_least)
   300 done
   301 
   302 lemma lower_unit_less_plus_iff:
   303   "{x}\<flat> \<sqsubseteq> ys +\<flat> zs \<longleftrightarrow> {x}\<flat> \<sqsubseteq> ys \<or> {x}\<flat> \<sqsubseteq> zs"
   304  apply (rule iffI)
   305   apply (subgoal_tac
   306     "adm (\<lambda>f. f\<cdot>{x}\<flat> \<sqsubseteq> f\<cdot>ys \<or> f\<cdot>{x}\<flat> \<sqsubseteq> f\<cdot>zs)")
   307    apply (drule admD, rule chain_approx)
   308     apply (drule_tac f="approx i" in monofun_cfun_arg)
   309     apply (cut_tac x="approx i\<cdot>x" in compact_imp_Rep_compact_basis, simp)
   310     apply (cut_tac xs="approx i\<cdot>ys" in compact_imp_lower_principal, simp)
   311     apply (cut_tac xs="approx i\<cdot>zs" in compact_imp_lower_principal, simp)
   312     apply (clarify, simp add: lower_le_PDUnit_PDPlus_iff)
   313    apply simp
   314   apply simp
   315  apply (erule disjE)
   316   apply (erule trans_less [OF _ lower_plus_less1])
   317  apply (erule trans_less [OF _ lower_plus_less2])
   318 done
   319 
   320 lemma lower_unit_less_iff [simp]: "{x}\<flat> \<sqsubseteq> {y}\<flat> \<longleftrightarrow> x \<sqsubseteq> y"
   321  apply (rule iffI)
   322   apply (rule bifinite_less_ext)
   323   apply (drule_tac f="approx i" in monofun_cfun_arg, simp)
   324   apply (cut_tac x="approx i\<cdot>x" in compact_imp_Rep_compact_basis, simp)
   325   apply (cut_tac x="approx i\<cdot>y" in compact_imp_Rep_compact_basis, simp)
   326   apply (clarify, simp add: compact_le_def)
   327  apply (erule monofun_cfun_arg)
   328 done
   329 
   330 lemmas lower_pd_less_simps =
   331   lower_unit_less_iff
   332   lower_plus_less_iff
   333   lower_unit_less_plus_iff
   334 
   335 lemma lower_unit_eq_iff [simp]: "{x}\<flat> = {y}\<flat> \<longleftrightarrow> x = y"
   336 unfolding po_eq_conv by simp
   337 
   338 lemma lower_unit_strict [simp]: "{\<bottom>}\<flat> = \<bottom>"
   339 unfolding inst_lower_pd_pcpo Rep_compact_bot [symmetric] by simp
   340 
   341 lemma lower_unit_strict_iff [simp]: "{x}\<flat> = \<bottom> \<longleftrightarrow> x = \<bottom>"
   342 unfolding lower_unit_strict [symmetric] by (rule lower_unit_eq_iff)
   343 
   344 lemma lower_plus_strict_iff [simp]:
   345   "xs +\<flat> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<and> ys = \<bottom>"
   346 apply safe
   347 apply (rule UU_I, erule subst, rule lower_plus_less1)
   348 apply (rule UU_I, erule subst, rule lower_plus_less2)
   349 apply (rule lower_plus_absorb)
   350 done
   351 
   352 lemma lower_plus_strict1 [simp]: "\<bottom> +\<flat> ys = ys"
   353 apply (rule antisym_less [OF _ lower_plus_less2])
   354 apply (simp add: lower_plus_least)
   355 done
   356 
   357 lemma lower_plus_strict2 [simp]: "xs +\<flat> \<bottom> = xs"
   358 apply (rule antisym_less [OF _ lower_plus_less1])
   359 apply (simp add: lower_plus_least)
   360 done
   361 
   362 lemma compact_lower_unit_iff [simp]: "compact {x}\<flat> \<longleftrightarrow> compact x"
   363 unfolding bifinite_compact_iff by simp
   364 
   365 lemma compact_lower_plus [simp]:
   366   "\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<flat> ys)"
   367 apply (drule compact_imp_lower_principal)+
   368 apply (auto simp add: compact_lower_principal)
   369 done
   370 
   371 
   372 subsection {* Induction rules *}
   373 
   374 lemma lower_pd_induct1:
   375   assumes P: "adm P"
   376   assumes unit: "\<And>x. P {x}\<flat>"
   377   assumes insert:
   378     "\<And>x ys. \<lbrakk>P {x}\<flat>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<flat> +\<flat> ys)"
   379   shows "P (xs::'a lower_pd)"
   380 apply (induct xs rule: lower_principal_induct, rule P)
   381 apply (induct_tac t rule: pd_basis_induct1)
   382 apply (simp only: lower_unit_Rep_compact_basis [symmetric])
   383 apply (rule unit)
   384 apply (simp only: lower_unit_Rep_compact_basis [symmetric]
   385                   lower_plus_principal [symmetric])
   386 apply (erule insert [OF unit])
   387 done
   388 
   389 lemma lower_pd_induct:
   390   assumes P: "adm P"
   391   assumes unit: "\<And>x. P {x}\<flat>"
   392   assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<flat> ys)"
   393   shows "P (xs::'a lower_pd)"
   394 apply (induct xs rule: lower_principal_induct, rule P)
   395 apply (induct_tac t rule: pd_basis_induct)
   396 apply (simp only: lower_unit_Rep_compact_basis [symmetric] unit)
   397 apply (simp only: lower_plus_principal [symmetric] plus)
   398 done
   399 
   400 
   401 subsection {* Monadic bind *}
   402 
   403 definition
   404   lower_bind_basis ::
   405   "'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
   406   "lower_bind_basis = fold_pd
   407     (\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a))
   408     (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
   409 
   410 lemma ACI_lower_bind:
   411   "ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
   412 apply unfold_locales
   413 apply (simp add: lower_plus_assoc)
   414 apply (simp add: lower_plus_commute)
   415 apply (simp add: lower_plus_absorb eta_cfun)
   416 done
   417 
   418 lemma lower_bind_basis_simps [simp]:
   419   "lower_bind_basis (PDUnit a) =
   420     (\<Lambda> f. f\<cdot>(Rep_compact_basis a))"
   421   "lower_bind_basis (PDPlus t u) =
   422     (\<Lambda> f. lower_bind_basis t\<cdot>f +\<flat> lower_bind_basis u\<cdot>f)"
   423 unfolding lower_bind_basis_def
   424 apply -
   425 apply (rule fold_pd_PDUnit [OF ACI_lower_bind])
   426 apply (rule fold_pd_PDPlus [OF ACI_lower_bind])
   427 done
   428 
   429 lemma lower_bind_basis_mono:
   430   "t \<le>\<flat> u \<Longrightarrow> lower_bind_basis t \<sqsubseteq> lower_bind_basis u"
   431 unfolding expand_cfun_less
   432 apply (erule lower_le_induct, safe)
   433 apply (simp add: compact_le_def monofun_cfun)
   434 apply (simp add: rev_trans_less [OF lower_plus_less1])
   435 apply (simp add: lower_plus_less_iff)
   436 done
   437 
   438 definition
   439   lower_bind :: "'a lower_pd \<rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
   440   "lower_bind = lower_pd.basis_fun lower_bind_basis"
   441 
   442 lemma lower_bind_principal [simp]:
   443   "lower_bind\<cdot>(lower_principal t) = lower_bind_basis t"
   444 unfolding lower_bind_def
   445 apply (rule lower_pd.basis_fun_principal)
   446 apply (erule lower_bind_basis_mono)
   447 done
   448 
   449 lemma lower_bind_unit [simp]:
   450   "lower_bind\<cdot>{x}\<flat>\<cdot>f = f\<cdot>x"
   451 by (induct x rule: compact_basis_induct, simp, simp)
   452 
   453 lemma lower_bind_plus [simp]:
   454   "lower_bind\<cdot>(xs +\<flat> ys)\<cdot>f = lower_bind\<cdot>xs\<cdot>f +\<flat> lower_bind\<cdot>ys\<cdot>f"
   455 by (induct xs ys rule: lower_principal_induct2, simp, simp, simp)
   456 
   457 lemma lower_bind_strict [simp]: "lower_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>"
   458 unfolding lower_unit_strict [symmetric] by (rule lower_bind_unit)
   459 
   460 
   461 subsection {* Map and join *}
   462 
   463 definition
   464   lower_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a lower_pd \<rightarrow> 'b lower_pd" where
   465   "lower_map = (\<Lambda> f xs. lower_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<flat>))"
   466 
   467 definition
   468   lower_join :: "'a lower_pd lower_pd \<rightarrow> 'a lower_pd" where
   469   "lower_join = (\<Lambda> xss. lower_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))"
   470 
   471 lemma lower_map_unit [simp]:
   472   "lower_map\<cdot>f\<cdot>{x}\<flat> = {f\<cdot>x}\<flat>"
   473 unfolding lower_map_def by simp
   474 
   475 lemma lower_map_plus [simp]:
   476   "lower_map\<cdot>f\<cdot>(xs +\<flat> ys) = lower_map\<cdot>f\<cdot>xs +\<flat> lower_map\<cdot>f\<cdot>ys"
   477 unfolding lower_map_def by simp
   478 
   479 lemma lower_join_unit [simp]:
   480   "lower_join\<cdot>{xs}\<flat> = xs"
   481 unfolding lower_join_def by simp
   482 
   483 lemma lower_join_plus [simp]:
   484   "lower_join\<cdot>(xss +\<flat> yss) = lower_join\<cdot>xss +\<flat> lower_join\<cdot>yss"
   485 unfolding lower_join_def by simp
   486 
   487 lemma lower_map_ident: "lower_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs"
   488 by (induct xs rule: lower_pd_induct, simp_all)
   489 
   490 lemma lower_map_map:
   491   "lower_map\<cdot>f\<cdot>(lower_map\<cdot>g\<cdot>xs) = lower_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs"
   492 by (induct xs rule: lower_pd_induct, simp_all)
   493 
   494 lemma lower_join_map_unit:
   495   "lower_join\<cdot>(lower_map\<cdot>lower_unit\<cdot>xs) = xs"
   496 by (induct xs rule: lower_pd_induct, simp_all)
   497 
   498 lemma lower_join_map_join:
   499   "lower_join\<cdot>(lower_map\<cdot>lower_join\<cdot>xsss) = lower_join\<cdot>(lower_join\<cdot>xsss)"
   500 by (induct xsss rule: lower_pd_induct, simp_all)
   501 
   502 lemma lower_join_map_map:
   503   "lower_join\<cdot>(lower_map\<cdot>(lower_map\<cdot>f)\<cdot>xss) =
   504    lower_map\<cdot>f\<cdot>(lower_join\<cdot>xss)"
   505 by (induct xss rule: lower_pd_induct, simp_all)
   506 
   507 lemma lower_map_approx: "lower_map\<cdot>(approx n)\<cdot>xs = approx n\<cdot>xs"
   508 by (induct xs rule: lower_pd_induct, simp_all)
   509 
   510 end