5821 moreover have "{x + y |x y. x \<in> s \<and> y \<in> t} = s + t" |
5821 moreover have "{x + y |x y. x \<in> s \<and> y \<in> t} = s + t" |
5822 unfolding set_plus_def by auto |
5822 unfolding set_plus_def by auto |
5823 finally show "convex (s + t)" . |
5823 finally show "convex (s + t)" . |
5824 qed |
5824 qed |
5825 |
5825 |
|
5826 lemma convex_set_setsum: |
|
5827 assumes "\<And>i. i \<in> A \<Longrightarrow> convex (B i)" |
|
5828 shows "convex (\<Sum>i\<in>A. B i)" |
|
5829 proof (cases "finite A") |
|
5830 case True then show ?thesis using assms |
|
5831 by induct (auto simp: convex_set_plus) |
|
5832 qed auto |
|
5833 |
5826 lemma finite_set_setsum: |
5834 lemma finite_set_setsum: |
5827 assumes "finite A" and "\<forall>i\<in>A. finite (B i)" shows "finite (\<Sum>i\<in>A. B i)" |
5835 assumes "finite A" and "\<forall>i\<in>A. finite (B i)" shows "finite (\<Sum>i\<in>A. B i)" |
5828 using assms by (induct set: finite, simp, simp add: finite_set_plus) |
5836 using assms by (induct set: finite, simp, simp add: finite_set_plus) |
5829 |
5837 |
5830 lemma set_setsum_eq: |
5838 lemma set_setsum_eq: |
8593 shows "closure S + closure T \<subseteq> closure (S + T)" |
8601 shows "closure S + closure T \<subseteq> closure (S + T)" |
8594 unfolding set_plus_image closure_Times [symmetric] split_def |
8602 unfolding set_plus_image closure_Times [symmetric] split_def |
8595 by (intro closure_bounded_linear_image bounded_linear_add |
8603 by (intro closure_bounded_linear_image bounded_linear_add |
8596 bounded_linear_fst bounded_linear_snd) |
8604 bounded_linear_fst bounded_linear_snd) |
8597 |
8605 |
8598 lemma convex_oplus: |
|
8599 fixes S T :: "'n::euclidean_space set" |
|
8600 assumes "convex S" |
|
8601 and "convex T" |
|
8602 shows "convex (S + T)" |
|
8603 proof - |
|
8604 have "{x + y |x y. x \<in> S \<and> y \<in> T} = {c. \<exists>a\<in>S. \<exists>b\<in>T. c = a + b}" |
|
8605 by auto |
|
8606 then show ?thesis |
|
8607 unfolding set_plus_def |
|
8608 using convex_sums[of S T] assms |
|
8609 by auto |
|
8610 qed |
|
8611 |
|
8612 lemma convex_hull_sum: |
|
8613 fixes S T :: "'n::euclidean_space set" |
|
8614 shows "convex hull (S + T) = convex hull S + convex hull T" |
|
8615 proof - |
|
8616 have "convex hull S + convex hull T = (\<lambda>(x,y). x + y) ` ((convex hull S) \<times> (convex hull T))" |
|
8617 by (simp add: set_plus_image) |
|
8618 also have "\<dots> = (\<lambda>(x,y). x + y) ` (convex hull (S \<times> T))" |
|
8619 using convex_hull_Times by auto |
|
8620 also have "\<dots> = convex hull (S + T)" |
|
8621 using fst_snd_linear linear_conv_bounded_linear |
|
8622 convex_hull_linear_image[of "(\<lambda>(x,y). x + y)" "S \<times> T"] |
|
8623 by (auto simp add: set_plus_image) |
|
8624 finally show ?thesis .. |
|
8625 qed |
|
8626 |
|
8627 lemma rel_interior_sum: |
8606 lemma rel_interior_sum: |
8628 fixes S T :: "'n::euclidean_space set" |
8607 fixes S T :: "'n::euclidean_space set" |
8629 assumes "convex S" |
8608 assumes "convex S" |
8630 and "convex T" |
8609 and "convex T" |
8631 shows "rel_interior (S + T) = rel_interior S + rel_interior T" |
8610 shows "rel_interior (S + T) = rel_interior S + rel_interior T" |
8639 rel_interior_convex_linear_image[of "(\<lambda>(x,y). x + y)" "S \<times> T"] |
8618 rel_interior_convex_linear_image[of "(\<lambda>(x,y). x + y)" "S \<times> T"] |
8640 by (auto simp add: set_plus_image) |
8619 by (auto simp add: set_plus_image) |
8641 finally show ?thesis .. |
8620 finally show ?thesis .. |
8642 qed |
8621 qed |
8643 |
8622 |
8644 lemma convex_sum_gen: |
|
8645 fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" |
|
8646 assumes "\<And>i. i \<in> I \<Longrightarrow> (convex (S i))" |
|
8647 shows "convex (setsum S I)" |
|
8648 proof (cases "finite I") |
|
8649 case True |
|
8650 from this and assms show ?thesis |
|
8651 by induct (auto simp: convex_oplus) |
|
8652 next |
|
8653 case False |
|
8654 then show ?thesis by auto |
|
8655 qed |
|
8656 |
|
8657 lemma convex_hull_sum_gen: |
|
8658 fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" |
|
8659 shows "convex hull (setsum S I) = setsum (\<lambda>i. convex hull (S i)) I" |
|
8660 apply (subst setsum_set_linear) |
|
8661 using convex_hull_sum convex_hull_singleton |
|
8662 apply auto |
|
8663 done |
|
8664 |
|
8665 lemma rel_interior_sum_gen: |
8623 lemma rel_interior_sum_gen: |
8666 fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" |
8624 fixes S :: "'a \<Rightarrow> 'n::euclidean_space set" |
8667 assumes "\<forall>i\<in>I. convex (S i)" |
8625 assumes "\<forall>i\<in>I. convex (S i)" |
8668 shows "rel_interior (setsum S I) = setsum (\<lambda>i. rel_interior (S i)) I" |
8626 shows "rel_interior (setsum S I) = setsum (\<lambda>i. rel_interior (S i)) I" |
8669 apply (subst setsum_set_cond_linear[of convex]) |
8627 apply (subst setsum_set_cond_linear[of convex]) |
8670 using rel_interior_sum rel_interior_sing[of "0"] assms |
8628 using rel_interior_sum rel_interior_sing[of "0"] assms |
8671 apply (auto simp add: convex_oplus) |
8629 apply (auto simp add: convex_set_plus) |
8672 done |
8630 done |
8673 |
8631 |
8674 lemma convex_rel_open_direct_sum: |
8632 lemma convex_rel_open_direct_sum: |
8675 fixes S T :: "'n::euclidean_space set" |
8633 fixes S T :: "'n::euclidean_space set" |
8676 assumes "convex S" |
8634 assumes "convex S" |