Skip to content

Commit 93420ef

Browse files
committed
Added a law for distributing a power through a nondeterministic choice
1 parent 2aa0973 commit 93420ef

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

utp_rel_laws.thy

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,29 @@ lemma SUP_atLeastAtMost_first:
453453
lemma upower_seqr_iter: "P \<^bold>^ n = (;; Q : replicate n P \<bullet> Q)"
454454
by (induct n, simp_all add: power.power.power_Suc)
455455

456+
lemma power_SUP:
457+
"(\<Sqinter>x\<in>A. P x)\<^bold>^j = (\<Sqinter>xs\<in>{ys. set ys \<subseteq> A \<and> length ys = j}. seqr_iter xs P)"
458+
proof (induct j)
459+
case 0
460+
then show ?case by simp
461+
next
462+
case (Suc j)
463+
then show ?case
464+
proof -
465+
have "\<Sqinter> (P ` A) \<^bold>^ Suc j = \<Sqinter> (P ` A) ;; \<Sqinter> (P ` A) \<^bold>^ j"
466+
by (meson power.power.power_Suc)
467+
also have "... = \<Sqinter> (P ` A) ;; (\<Sqinter>xs\<in>{ys. set ys \<subseteq> A \<and> length ys = j}. seqr_iter xs P)"
468+
by (simp add: Suc del:SUP_apply Sup_apply)
469+
also have "... = (\<Sqinter>xs\<in>{ys. set ys \<subseteq> A \<and> length ys = j}. \<Sqinter>x\<in>A. seqr_iter (x # xs) P)"
470+
by (simp add: seq_SUP_distl seq_SUP_distr)
471+
also have "... = (\<Sqinter>(xs,x)\<in>{ys. set ys \<subseteq> A \<and> length ys = j}\<times>A. seqr_iter (x # xs) P)"
472+
by (simp add: SUPs_combine)
473+
also have "... = (\<Sqinter>xs\<in>{ys. set ys \<subseteq> A \<and> length ys = Suc j}. seqr_iter xs P)"
474+
by (simp add: lists_length_Suc_eq image_comp prod.case_eq_if)
475+
finally show ?thesis .
476+
qed
477+
qed
478+
456479
subsection \<open> Relation Algebra Laws \<close>
457480

458481
theorem seqr_disj_cancel: "((P\<^sup>- ;; (\<not>(P ;; Q))) \<or> (\<not>Q)) = (\<not>Q)"

0 commit comments

Comments
 (0)