src/HOL/Analysis/Polytope.thy
changeset 72302 d7d90ed4c74e
parent 71840 8ed78bb0b915
child 72324 7bb074cceefe
equal deleted inserted replaced
72301:c5d1a01d2d6c 72302:d7d90ed4c74e
  2781     assumes "card S = Suc (DIM('a))"
  2781     assumes "card S = Suc (DIM('a))"
  2782       shows "frontier(convex hull S) = \<Union> {convex hull (S - {a}) | a. a \<in> S}"
  2782       shows "frontier(convex hull S) = \<Union> {convex hull (S - {a}) | a. a \<in> S}"
  2783 proof (cases "affine_dependent S")
  2783 proof (cases "affine_dependent S")
  2784   case True
  2784   case True
  2785     have [iff]: "finite S"
  2785     have [iff]: "finite S"
  2786       using assms using card_infinite by force
  2786       using assms using card.infinite by force
  2787     then have ccs: "closed (convex hull S)"
  2787     then have ccs: "closed (convex hull S)"
  2788       by (simp add: compact_imp_closed finite_imp_compact_convex_hull)
  2788       by (simp add: compact_imp_closed finite_imp_compact_convex_hull)
  2789     { fix x T
  2789     { fix x T
  2790       assume "finite T" "T \<subseteq> S" "int (card T) \<le> aff_dim S + 1" "x \<in> convex hull T"
  2790       assume "finite T" "T \<subseteq> S" "int (card T) \<le> aff_dim S + 1" "x \<in> convex hull T"
  2791       then have "S \<noteq> T"
  2791       then have "S \<noteq> T"
  2837 proof (cases "b = a \<or> c = a \<or> c = b")
  2837 proof (cases "b = a \<or> c = a \<or> c = b")
  2838   case True then show ?thesis
  2838   case True then show ?thesis
  2839     by (auto simp: assms segment_convex_hull frontier_def empty_interior_convex_hull insert_commute card_insert_le_m1 hull_inc insert_absorb)
  2839     by (auto simp: assms segment_convex_hull frontier_def empty_interior_convex_hull insert_commute card_insert_le_m1 hull_inc insert_absorb)
  2840 next
  2840 next
  2841   case False then have [simp]: "card {a, b, c} = Suc (DIM('a))"
  2841   case False then have [simp]: "card {a, b, c} = Suc (DIM('a))"
  2842     by (simp add: card_insert Set.insert_Diff_if assms)
  2842     by (simp add: card.insert_remove Set.insert_Diff_if assms)
  2843   show ?thesis
  2843   show ?thesis
  2844   proof
  2844   proof
  2845     show "?lhs \<subseteq> ?rhs"
  2845     show "?lhs \<subseteq> ?rhs"
  2846       using False
  2846       using False
  2847       by (force simp: segment_convex_hull frontier_of_convex_hull insert_Diff_if insert_commute split: if_split_asm)
  2847       by (force simp: segment_convex_hull frontier_of_convex_hull insert_Diff_if insert_commute split: if_split_asm)
  3123 
  3123 
  3124 lemma simplex_empty [simp]: "n simplex {} \<longleftrightarrow> n = -1"
  3124 lemma simplex_empty [simp]: "n simplex {} \<longleftrightarrow> n = -1"
  3125 proof
  3125 proof
  3126   assume "n simplex {}"
  3126   assume "n simplex {}"
  3127   then show "n = -1"
  3127   then show "n = -1"
  3128     unfolding simplex by (metis card_empty convex_hull_eq_empty diff_0 diff_eq_eq of_nat_0)
  3128     unfolding simplex by (metis card.empty convex_hull_eq_empty diff_0 diff_eq_eq of_nat_0)
  3129 next
  3129 next
  3130   assume "n = -1" then show "n simplex {}"
  3130   assume "n = -1" then show "n simplex {}"
  3131     by (fastforce simp: simplex)
  3131     by (fastforce simp: simplex)
  3132 qed
  3132 qed
  3133 
  3133 
  3139    "n simplex S \<Longrightarrow> aff_dim S = n"
  3139    "n simplex S \<Longrightarrow> aff_dim S = n"
  3140   by (metis simplex add.commute add_diff_cancel_left' aff_dim_convex_hull affine_independent_iff_card)
  3140   by (metis simplex add.commute add_diff_cancel_left' aff_dim_convex_hull affine_independent_iff_card)
  3141 
  3141 
  3142 lemma zero_simplex_sing: "0 simplex {a}"
  3142 lemma zero_simplex_sing: "0 simplex {a}"
  3143   apply (simp add: simplex_def)
  3143   apply (simp add: simplex_def)
  3144   by (metis affine_independent_1 card_empty card_insert_disjoint convex_hull_singleton empty_iff finite.emptyI)
  3144   by (metis affine_independent_1 card.empty card_insert_disjoint convex_hull_singleton empty_iff finite.emptyI)
  3145 
  3145 
  3146 lemma simplex_sing [simp]: "n simplex {a} \<longleftrightarrow> n = 0"
  3146 lemma simplex_sing [simp]: "n simplex {a} \<longleftrightarrow> n = 0"
  3147   using aff_dim_simplex aff_dim_sing zero_simplex_sing by blast
  3147   using aff_dim_simplex aff_dim_sing zero_simplex_sing by blast
  3148 
  3148 
  3149 lemma simplex_zero: "0 simplex S \<longleftrightarrow> (\<exists>a. S = {a})"
  3149 lemma simplex_zero: "0 simplex S \<longleftrightarrow> (\<exists>a. S = {a})"