src/HOL/Homology/Simplices.thy
changeset 70113 c8deb8ba6d05
parent 70097 4005298550a6
child 70178 4900351361b0
equal deleted inserted replaced
70097:4005298550a6 70113:c8deb8ba6d05
  1188   then have S: "\<And>x. \<lbrakk>\<And>i. 0 \<le> x i \<and> x i \<le> 1; \<And>i. i>p \<Longrightarrow> x i = 0; sum x {..p} = 1\<rbrakk>
  1188   then have S: "\<And>x. \<lbrakk>\<And>i. 0 \<le> x i \<and> x i \<le> 1; \<And>i. i>p \<Longrightarrow> x i = 0; sum x {..p} = 1\<rbrakk>
  1189                  \<Longrightarrow> (\<lambda>i. \<Sum>j\<le>p. l j i * x j) \<in> S"
  1189                  \<Longrightarrow> (\<lambda>i. \<Sum>j\<le>p. l j i * x j) \<in> S"
  1190     by (simp add: oriented_simplex_def standard_simplex_def)
  1190     by (simp add: oriented_simplex_def standard_simplex_def)
  1191   have "oriented_simplex (Suc p) (\<lambda>i. if i = 0 then v else l (i -1)) x \<in> T"
  1191   have "oriented_simplex (Suc p) (\<lambda>i. if i = 0 then v else l (i -1)) x \<in> T"
  1192     if "x \<in> standard_simplex (Suc p)" for x
  1192     if "x \<in> standard_simplex (Suc p)" for x
  1193   proof (simp add: that oriented_simplex_def sum_atMost_Suc_shift del: sum.atMost_Suc)
  1193   proof (simp add: that oriented_simplex_def sum.atMost_Suc_shift del: sum.atMost_Suc)
  1194     have x01: "\<And>i. 0 \<le> x i \<and> x i \<le> 1" and x0: "\<And>i. i > Suc p \<Longrightarrow> x i = 0" and x1: "sum x {..Suc p} = 1"
  1194     have x01: "\<And>i. 0 \<le> x i \<and> x i \<le> 1" and x0: "\<And>i. i > Suc p \<Longrightarrow> x i = 0" and x1: "sum x {..Suc p} = 1"
  1195       using that by (auto simp: oriented_simplex_def standard_simplex_def)
  1195       using that by (auto simp: oriented_simplex_def standard_simplex_def)
  1196     obtain a where "a \<in> S"
  1196     obtain a where "a \<in> S"
  1197       using f by force
  1197       using f by force
  1198     show "(\<lambda>i. v i * x 0 + (\<Sum>j\<le>p. l j i * x (Suc j))) \<in> T"
  1198     show "(\<lambda>i. v i * x 0 + (\<Sum>j\<le>p. l j i * x (Suc j))) \<in> T"
  1222            using x1 x01 by (simp add: algebra_simps not_less)
  1222            using x1 x01 by (simp add: algebra_simps not_less)
  1223         qed (simp add: x0 x01)
  1223         qed (simp add: x0 x01)
  1224         have "(\<lambda>i. (\<Sum>j\<le>p. l j i * (x (Suc j) * inverse (1 - x 0)))) \<in> S"
  1224         have "(\<lambda>i. (\<Sum>j\<le>p. l j i * (x (Suc j) * inverse (1 - x 0)))) \<in> S"
  1225         proof (rule S)
  1225         proof (rule S)
  1226           have "x 0 + (\<Sum>j\<le>p. x (Suc j)) = sum x {..Suc p}"
  1226           have "x 0 + (\<Sum>j\<le>p. x (Suc j)) = sum x {..Suc p}"
  1227             by (metis sum_atMost_Suc_shift)
  1227             by (metis sum.atMost_Suc_shift)
  1228           with x1 have "(\<Sum>j\<le>p. x (Suc j)) = 1 - x 0"
  1228           with x1 have "(\<Sum>j\<le>p. x (Suc j)) = 1 - x 0"
  1229             by simp
  1229             by simp
  1230           with False show "(\<Sum>j\<le>p. x (Suc j) * inverse (1 - x 0)) = 1"
  1230           with False show "(\<Sum>j\<le>p. x (Suc j) * inverse (1 - x 0)) = 1"
  1231             by (metis add_diff_cancel_left' diff_diff_eq2 diff_zero right_inverse sum_distrib_right)
  1231             by (metis add_diff_cancel_left' diff_diff_eq2 diff_zero right_inverse sum_distrib_right)
  1232       qed (use x01 x0 xle \<open>x 0 < 1\<close> in \<open>auto simp: divide_simps\<close>)
  1232       qed (use x01 x0 xle \<open>x 0 < 1\<close> in \<open>auto simp: divide_simps\<close>)
  2934           = restrict (g \<circ> m) (standard_simplex q)"
  2934           = restrict (g \<circ> m) (standard_simplex q)"
  2935         proof (rule restrict_ext)
  2935         proof (rule restrict_ext)
  2936           fix x
  2936           fix x
  2937           assume x: "x \<in> standard_simplex q"
  2937           assume x: "x \<in> standard_simplex q"
  2938           have "(\<Sum>j\<le>Suc q. if j = 0 then 0 else x (j - Suc 0)) = (\<Sum>j\<le>q. x j)"
  2938           have "(\<Sum>j\<le>Suc q. if j = 0 then 0 else x (j - Suc 0)) = (\<Sum>j\<le>q. x j)"
  2939             by (simp add: sum_atMost_Suc_shift)
  2939             by (simp add: sum.atMost_Suc_shift)
  2940           with x have "simp q 0 (simplical_face 0 x) 0 = 1"
  2940           with x have "simp q 0 (simplical_face 0 x) 0 = 1"
  2941             apply (simp add: oriented_simplex_def simp_def simplical_face_in_standard_simplex)
  2941             apply (simp add: oriented_simplex_def simp_def simplical_face_in_standard_simplex)
  2942             apply (simp add: simplical_face_def if_distrib ww_def standard_simplex_def cong: if_cong)
  2942             apply (simp add: simplical_face_def if_distrib ww_def standard_simplex_def cong: if_cong)
  2943             done
  2943             done
  2944           moreover
  2944           moreover
  3228       show ?case
  3228       show ?case
  3229         apply (subst pr_def)
  3229         apply (subst pr_def)
  3230         apply (simp add: chain_boundary_sum chain_boundary_cmul)
  3230         apply (simp add: chain_boundary_sum chain_boundary_cmul)
  3231         apply (subst chain_boundary_def)
  3231         apply (subst chain_boundary_def)
  3232         apply (simp add: frag_cmul_sum sum.cartesian_product eq sum.union_disjoint disjoint_iff_not_equal
  3232         apply (simp add: frag_cmul_sum sum.cartesian_product eq sum.union_disjoint disjoint_iff_not_equal
  3233                      sum.atLeast_Suc_atMost_Suc_shift del: sum_cl_ivl_Suc flip: comm_monoid_add_class.sum.Sigma)
  3233                      sum.atLeast_Suc_atMost_Suc_shift del: sum.cl_ivl_Suc flip: comm_monoid_add_class.sum.Sigma)
  3234         apply (simp add: comm_monoid_add_class.sum.Sigma eq2 [of _ "\<lambda>i. {_ i.._ i}"])
  3234         apply (simp add: comm_monoid_add_class.sum.Sigma eq2 [of _ "\<lambda>i. {_ i.._ i}"])
  3235         apply (simp add: sum.union_disjoint disjoint_iff_not_equal * [OF 1 2])
  3235         apply (simp add: sum.union_disjoint disjoint_iff_not_equal * [OF 1 2])
  3236         done
  3236         done
  3237     next
  3237     next
  3238       case (diff a b)
  3238       case (diff a b)