src/HOLCF/LowerPD.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/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::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_chain)
   126 apply (rule finite_range_approx_pd)
   127 apply (rule approx_pd_covers)
   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 text {* Lower powerdomain is pointed *}
   135 
   136 lemma lower_pd_minimal: "lower_principal (PDUnit compact_bot) \<sqsubseteq> ys"
   137 by (induct ys rule: lower_pd.principal_induct, simp, simp)
   138 
   139 instance lower_pd :: (bifinite) pcpo
   140 by intro_classes (fast intro: lower_pd_minimal)
   141 
   142 lemma inst_lower_pd_pcpo: "\<bottom> = lower_principal (PDUnit compact_bot)"
   143 by (rule lower_pd_minimal [THEN UU_I, symmetric])
   144 
   145 text {* Lower powerdomain is profinite *}
   146 
   147 instantiation lower_pd :: (profinite) profinite
   148 begin
   149 
   150 definition
   151   approx_lower_pd_def: "approx = lower_pd.completion_approx"
   152 
   153 instance
   154 apply (intro_classes, unfold approx_lower_pd_def)
   155 apply (simp add: lower_pd.chain_completion_approx)
   156 apply (rule lower_pd.lub_completion_approx)
   157 apply (rule lower_pd.completion_approx_idem)
   158 apply (rule lower_pd.finite_fixes_completion_approx)
   159 done
   160 
   161 end
   162 
   163 instance lower_pd :: (bifinite) bifinite ..
   164 
   165 lemma approx_lower_principal [simp]:
   166   "approx n\<cdot>(lower_principal t) = lower_principal (approx_pd n t)"
   167 unfolding approx_lower_pd_def
   168 by (rule lower_pd.completion_approx_principal)
   169 
   170 lemma approx_eq_lower_principal:
   171   "\<exists>t\<in>Rep_lower_pd xs. approx n\<cdot>xs = lower_principal (approx_pd n t)"
   172 unfolding approx_lower_pd_def
   173 by (rule lower_pd.completion_approx_eq_principal)
   174 
   175 
   176 subsection {* Monadic unit and plus *}
   177 
   178 definition
   179   lower_unit :: "'a \<rightarrow> 'a lower_pd" where
   180   "lower_unit = compact_basis.basis_fun (\<lambda>a. lower_principal (PDUnit a))"
   181 
   182 definition
   183   lower_plus :: "'a lower_pd \<rightarrow> 'a lower_pd \<rightarrow> 'a lower_pd" where
   184   "lower_plus = lower_pd.basis_fun (\<lambda>t. lower_pd.basis_fun (\<lambda>u.
   185       lower_principal (PDPlus t u)))"
   186 
   187 abbreviation
   188   lower_add :: "'a lower_pd \<Rightarrow> 'a lower_pd \<Rightarrow> 'a lower_pd"
   189     (infixl "+\<flat>" 65) where
   190   "xs +\<flat> ys == lower_plus\<cdot>xs\<cdot>ys"
   191 
   192 syntax
   193   "_lower_pd" :: "args \<Rightarrow> 'a lower_pd" ("{_}\<flat>")
   194 
   195 translations
   196   "{x,xs}\<flat>" == "{x}\<flat> +\<flat> {xs}\<flat>"
   197   "{x}\<flat>" == "CONST lower_unit\<cdot>x"
   198 
   199 lemma lower_unit_Rep_compact_basis [simp]:
   200   "{Rep_compact_basis a}\<flat> = lower_principal (PDUnit a)"
   201 unfolding lower_unit_def
   202 by (simp add: compact_basis.basis_fun_principal PDUnit_lower_mono)
   203 
   204 lemma lower_plus_principal [simp]:
   205   "lower_principal t +\<flat> lower_principal u = lower_principal (PDPlus t u)"
   206 unfolding lower_plus_def
   207 by (simp add: lower_pd.basis_fun_principal
   208     lower_pd.basis_fun_mono PDPlus_lower_mono)
   209 
   210 lemma approx_lower_unit [simp]:
   211   "approx n\<cdot>{x}\<flat> = {approx n\<cdot>x}\<flat>"
   212 apply (induct x rule: compact_basis.principal_induct, simp)
   213 apply (simp add: approx_Rep_compact_basis)
   214 done
   215 
   216 lemma approx_lower_plus [simp]:
   217   "approx n\<cdot>(xs +\<flat> ys) = (approx n\<cdot>xs) +\<flat> (approx n\<cdot>ys)"
   218 by (induct xs ys rule: lower_pd.principal_induct2, simp, simp, simp)
   219 
   220 lemma lower_plus_assoc: "(xs +\<flat> ys) +\<flat> zs = xs +\<flat> (ys +\<flat> zs)"
   221 apply (induct xs ys arbitrary: zs rule: lower_pd.principal_induct2, simp, simp)
   222 apply (rule_tac x=zs in lower_pd.principal_induct, simp)
   223 apply (simp add: PDPlus_assoc)
   224 done
   225 
   226 lemma lower_plus_commute: "xs +\<flat> ys = ys +\<flat> xs"
   227 apply (induct xs ys rule: lower_pd.principal_induct2, simp, simp)
   228 apply (simp add: PDPlus_commute)
   229 done
   230 
   231 lemma lower_plus_absorb: "xs +\<flat> xs = xs"
   232 apply (induct xs rule: lower_pd.principal_induct, simp)
   233 apply (simp add: PDPlus_absorb)
   234 done
   235 
   236 interpretation aci_lower_plus: ab_semigroup_idem_mult ["op +\<flat>"]
   237   by unfold_locales
   238     (rule lower_plus_assoc lower_plus_commute lower_plus_absorb)+
   239 
   240 lemma lower_plus_left_commute: "xs +\<flat> (ys +\<flat> zs) = ys +\<flat> (xs +\<flat> zs)"
   241 by (rule aci_lower_plus.mult_left_commute)
   242 
   243 lemma lower_plus_left_absorb: "xs +\<flat> (xs +\<flat> ys) = xs +\<flat> ys"
   244 by (rule aci_lower_plus.mult_left_idem)
   245 
   246 lemmas lower_plus_aci = aci_lower_plus.mult_ac_idem
   247 
   248 lemma lower_plus_less1: "xs \<sqsubseteq> xs +\<flat> ys"
   249 apply (induct xs ys rule: lower_pd.principal_induct2, simp, simp)
   250 apply (simp add: PDPlus_lower_less)
   251 done
   252 
   253 lemma lower_plus_less2: "ys \<sqsubseteq> xs +\<flat> ys"
   254 by (subst lower_plus_commute, rule lower_plus_less1)
   255 
   256 lemma lower_plus_least: "\<lbrakk>xs \<sqsubseteq> zs; ys \<sqsubseteq> zs\<rbrakk> \<Longrightarrow> xs +\<flat> ys \<sqsubseteq> zs"
   257 apply (subst lower_plus_absorb [of zs, symmetric])
   258 apply (erule (1) monofun_cfun [OF monofun_cfun_arg])
   259 done
   260 
   261 lemma lower_plus_less_iff:
   262   "xs +\<flat> ys \<sqsubseteq> zs \<longleftrightarrow> xs \<sqsubseteq> zs \<and> ys \<sqsubseteq> zs"
   263 apply safe
   264 apply (erule trans_less [OF lower_plus_less1])
   265 apply (erule trans_less [OF lower_plus_less2])
   266 apply (erule (1) lower_plus_least)
   267 done
   268 
   269 lemma lower_unit_less_plus_iff:
   270   "{x}\<flat> \<sqsubseteq> ys +\<flat> zs \<longleftrightarrow> {x}\<flat> \<sqsubseteq> ys \<or> {x}\<flat> \<sqsubseteq> zs"
   271  apply (rule iffI)
   272   apply (subgoal_tac
   273     "adm (\<lambda>f. f\<cdot>{x}\<flat> \<sqsubseteq> f\<cdot>ys \<or> f\<cdot>{x}\<flat> \<sqsubseteq> f\<cdot>zs)")
   274    apply (drule admD, rule chain_approx)
   275     apply (drule_tac f="approx i" in monofun_cfun_arg)
   276     apply (cut_tac x="approx i\<cdot>x" in compact_basis.compact_imp_principal, simp)
   277     apply (cut_tac x="approx i\<cdot>ys" in lower_pd.compact_imp_principal, simp)
   278     apply (cut_tac x="approx i\<cdot>zs" in lower_pd.compact_imp_principal, simp)
   279     apply (clarify, simp add: lower_le_PDUnit_PDPlus_iff)
   280    apply simp
   281   apply simp
   282  apply (erule disjE)
   283   apply (erule trans_less [OF _ lower_plus_less1])
   284  apply (erule trans_less [OF _ lower_plus_less2])
   285 done
   286 
   287 lemma lower_unit_less_iff [simp]: "{x}\<flat> \<sqsubseteq> {y}\<flat> \<longleftrightarrow> x \<sqsubseteq> y"
   288  apply (rule iffI)
   289   apply (rule bifinite_less_ext)
   290   apply (drule_tac f="approx i" in monofun_cfun_arg, simp)
   291   apply (cut_tac x="approx i\<cdot>x" in compact_basis.compact_imp_principal, simp)
   292   apply (cut_tac x="approx i\<cdot>y" in compact_basis.compact_imp_principal, simp)
   293   apply clarsimp
   294  apply (erule monofun_cfun_arg)
   295 done
   296 
   297 lemmas lower_pd_less_simps =
   298   lower_unit_less_iff
   299   lower_plus_less_iff
   300   lower_unit_less_plus_iff
   301 
   302 lemma fooble:
   303   fixes f :: "'a::po \<Rightarrow> 'b::po"
   304   assumes f: "\<And>x y. f x \<sqsubseteq> f y \<longleftrightarrow> x \<sqsubseteq> y"
   305   shows "f x = f y \<longleftrightarrow> x = y"
   306 unfolding po_eq_conv by (simp add: f)
   307 
   308 lemma lower_unit_eq_iff [simp]: "{x}\<flat> = {y}\<flat> \<longleftrightarrow> x = y"
   309 by (rule lower_unit_less_iff [THEN fooble])
   310 
   311 lemma lower_unit_strict [simp]: "{\<bottom>}\<flat> = \<bottom>"
   312 unfolding inst_lower_pd_pcpo Rep_compact_bot [symmetric] by simp
   313 
   314 lemma lower_unit_strict_iff [simp]: "{x}\<flat> = \<bottom> \<longleftrightarrow> x = \<bottom>"
   315 unfolding lower_unit_strict [symmetric] by (rule lower_unit_eq_iff)
   316 
   317 lemma lower_plus_strict_iff [simp]:
   318   "xs +\<flat> ys = \<bottom> \<longleftrightarrow> xs = \<bottom> \<and> ys = \<bottom>"
   319 apply safe
   320 apply (rule UU_I, erule subst, rule lower_plus_less1)
   321 apply (rule UU_I, erule subst, rule lower_plus_less2)
   322 apply (rule lower_plus_absorb)
   323 done
   324 
   325 lemma lower_plus_strict1 [simp]: "\<bottom> +\<flat> ys = ys"
   326 apply (rule antisym_less [OF _ lower_plus_less2])
   327 apply (simp add: lower_plus_least)
   328 done
   329 
   330 lemma lower_plus_strict2 [simp]: "xs +\<flat> \<bottom> = xs"
   331 apply (rule antisym_less [OF _ lower_plus_less1])
   332 apply (simp add: lower_plus_least)
   333 done
   334 
   335 lemma compact_lower_unit_iff [simp]: "compact {x}\<flat> \<longleftrightarrow> compact x"
   336 unfolding bifinite_compact_iff by simp
   337 
   338 lemma compact_lower_plus [simp]:
   339   "\<lbrakk>compact xs; compact ys\<rbrakk> \<Longrightarrow> compact (xs +\<flat> ys)"
   340 by (auto dest!: lower_pd.compact_imp_principal)
   341 
   342 
   343 subsection {* Induction rules *}
   344 
   345 lemma lower_pd_induct1:
   346   assumes P: "adm P"
   347   assumes unit: "\<And>x. P {x}\<flat>"
   348   assumes insert:
   349     "\<And>x ys. \<lbrakk>P {x}\<flat>; P ys\<rbrakk> \<Longrightarrow> P ({x}\<flat> +\<flat> ys)"
   350   shows "P (xs::'a lower_pd)"
   351 apply (induct xs rule: lower_pd.principal_induct, rule P)
   352 apply (induct_tac a rule: pd_basis_induct1)
   353 apply (simp only: lower_unit_Rep_compact_basis [symmetric])
   354 apply (rule unit)
   355 apply (simp only: lower_unit_Rep_compact_basis [symmetric]
   356                   lower_plus_principal [symmetric])
   357 apply (erule insert [OF unit])
   358 done
   359 
   360 lemma lower_pd_induct:
   361   assumes P: "adm P"
   362   assumes unit: "\<And>x. P {x}\<flat>"
   363   assumes plus: "\<And>xs ys. \<lbrakk>P xs; P ys\<rbrakk> \<Longrightarrow> P (xs +\<flat> ys)"
   364   shows "P (xs::'a lower_pd)"
   365 apply (induct xs rule: lower_pd.principal_induct, rule P)
   366 apply (induct_tac a rule: pd_basis_induct)
   367 apply (simp only: lower_unit_Rep_compact_basis [symmetric] unit)
   368 apply (simp only: lower_plus_principal [symmetric] plus)
   369 done
   370 
   371 
   372 subsection {* Monadic bind *}
   373 
   374 definition
   375   lower_bind_basis ::
   376   "'a pd_basis \<Rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
   377   "lower_bind_basis = fold_pd
   378     (\<lambda>a. \<Lambda> f. f\<cdot>(Rep_compact_basis a))
   379     (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
   380 
   381 lemma ACI_lower_bind:
   382   "ab_semigroup_idem_mult (\<lambda>x y. \<Lambda> f. x\<cdot>f +\<flat> y\<cdot>f)"
   383 apply unfold_locales
   384 apply (simp add: lower_plus_assoc)
   385 apply (simp add: lower_plus_commute)
   386 apply (simp add: lower_plus_absorb eta_cfun)
   387 done
   388 
   389 lemma lower_bind_basis_simps [simp]:
   390   "lower_bind_basis (PDUnit a) =
   391     (\<Lambda> f. f\<cdot>(Rep_compact_basis a))"
   392   "lower_bind_basis (PDPlus t u) =
   393     (\<Lambda> f. lower_bind_basis t\<cdot>f +\<flat> lower_bind_basis u\<cdot>f)"
   394 unfolding lower_bind_basis_def
   395 apply -
   396 apply (rule fold_pd_PDUnit [OF ACI_lower_bind])
   397 apply (rule fold_pd_PDPlus [OF ACI_lower_bind])
   398 done
   399 
   400 lemma lower_bind_basis_mono:
   401   "t \<le>\<flat> u \<Longrightarrow> lower_bind_basis t \<sqsubseteq> lower_bind_basis u"
   402 unfolding expand_cfun_less
   403 apply (erule lower_le_induct, safe)
   404 apply (simp add: monofun_cfun)
   405 apply (simp add: rev_trans_less [OF lower_plus_less1])
   406 apply (simp add: lower_plus_less_iff)
   407 done
   408 
   409 definition
   410   lower_bind :: "'a lower_pd \<rightarrow> ('a \<rightarrow> 'b lower_pd) \<rightarrow> 'b lower_pd" where
   411   "lower_bind = lower_pd.basis_fun lower_bind_basis"
   412 
   413 lemma lower_bind_principal [simp]:
   414   "lower_bind\<cdot>(lower_principal t) = lower_bind_basis t"
   415 unfolding lower_bind_def
   416 apply (rule lower_pd.basis_fun_principal)
   417 apply (erule lower_bind_basis_mono)
   418 done
   419 
   420 lemma lower_bind_unit [simp]:
   421   "lower_bind\<cdot>{x}\<flat>\<cdot>f = f\<cdot>x"
   422 by (induct x rule: compact_basis.principal_induct, simp, simp)
   423 
   424 lemma lower_bind_plus [simp]:
   425   "lower_bind\<cdot>(xs +\<flat> ys)\<cdot>f = lower_bind\<cdot>xs\<cdot>f +\<flat> lower_bind\<cdot>ys\<cdot>f"
   426 by (induct xs ys rule: lower_pd.principal_induct2, simp, simp, simp)
   427 
   428 lemma lower_bind_strict [simp]: "lower_bind\<cdot>\<bottom>\<cdot>f = f\<cdot>\<bottom>"
   429 unfolding lower_unit_strict [symmetric] by (rule lower_bind_unit)
   430 
   431 
   432 subsection {* Map and join *}
   433 
   434 definition
   435   lower_map :: "('a \<rightarrow> 'b) \<rightarrow> 'a lower_pd \<rightarrow> 'b lower_pd" where
   436   "lower_map = (\<Lambda> f xs. lower_bind\<cdot>xs\<cdot>(\<Lambda> x. {f\<cdot>x}\<flat>))"
   437 
   438 definition
   439   lower_join :: "'a lower_pd lower_pd \<rightarrow> 'a lower_pd" where
   440   "lower_join = (\<Lambda> xss. lower_bind\<cdot>xss\<cdot>(\<Lambda> xs. xs))"
   441 
   442 lemma lower_map_unit [simp]:
   443   "lower_map\<cdot>f\<cdot>{x}\<flat> = {f\<cdot>x}\<flat>"
   444 unfolding lower_map_def by simp
   445 
   446 lemma lower_map_plus [simp]:
   447   "lower_map\<cdot>f\<cdot>(xs +\<flat> ys) = lower_map\<cdot>f\<cdot>xs +\<flat> lower_map\<cdot>f\<cdot>ys"
   448 unfolding lower_map_def by simp
   449 
   450 lemma lower_join_unit [simp]:
   451   "lower_join\<cdot>{xs}\<flat> = xs"
   452 unfolding lower_join_def by simp
   453 
   454 lemma lower_join_plus [simp]:
   455   "lower_join\<cdot>(xss +\<flat> yss) = lower_join\<cdot>xss +\<flat> lower_join\<cdot>yss"
   456 unfolding lower_join_def by simp
   457 
   458 lemma lower_map_ident: "lower_map\<cdot>(\<Lambda> x. x)\<cdot>xs = xs"
   459 by (induct xs rule: lower_pd_induct, simp_all)
   460 
   461 lemma lower_map_map:
   462   "lower_map\<cdot>f\<cdot>(lower_map\<cdot>g\<cdot>xs) = lower_map\<cdot>(\<Lambda> x. f\<cdot>(g\<cdot>x))\<cdot>xs"
   463 by (induct xs rule: lower_pd_induct, simp_all)
   464 
   465 lemma lower_join_map_unit:
   466   "lower_join\<cdot>(lower_map\<cdot>lower_unit\<cdot>xs) = xs"
   467 by (induct xs rule: lower_pd_induct, simp_all)
   468 
   469 lemma lower_join_map_join:
   470   "lower_join\<cdot>(lower_map\<cdot>lower_join\<cdot>xsss) = lower_join\<cdot>(lower_join\<cdot>xsss)"
   471 by (induct xsss rule: lower_pd_induct, simp_all)
   472 
   473 lemma lower_join_map_map:
   474   "lower_join\<cdot>(lower_map\<cdot>(lower_map\<cdot>f)\<cdot>xss) =
   475    lower_map\<cdot>f\<cdot>(lower_join\<cdot>xss)"
   476 by (induct xss rule: lower_pd_induct, simp_all)
   477 
   478 lemma lower_map_approx: "lower_map\<cdot>(approx n)\<cdot>xs = approx n\<cdot>xs"
   479 by (induct xs rule: lower_pd_induct, simp_all)
   480 
   481 end