setprod -> prod
authornipkow
Mon Oct 17 17:33:07 2016 +0200 (2016-10-17)
changeset 64272f76b6dda2e56
parent 64269 c939cc16b605
child 64273 2e94501cbc34
setprod -> prod
src/Doc/Main/Main_Doc.thy
src/HOL/Algebra/IntRing.thy
src/HOL/Analysis/Bochner_Integration.thy
src/HOL/Analysis/Borel_Space.thy
src/HOL/Analysis/Determinants.thy
src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy
src/HOL/Analysis/Finite_Product_Measure.thy
src/HOL/Analysis/Gamma_Function.thy
src/HOL/Analysis/Generalised_Binomial_Theorem.thy
src/HOL/Analysis/Henstock_Kurzweil_Integration.thy
src/HOL/Analysis/Lebesgue_Measure.thy
src/HOL/Analysis/Weierstrass_Theorems.thy
src/HOL/Analysis/ex/Approximations.thy
src/HOL/Binomial.thy
src/HOL/Complex.thy
src/HOL/Decision_Procs/Approximation.thy
src/HOL/Deriv.thy
src/HOL/GCD.thy
src/HOL/Groups_Big.thy
src/HOL/Groups_List.thy
src/HOL/Int.thy
src/HOL/Library/Extended_Nonnegative_Real.thy
src/HOL/Library/Extended_Real.thy
src/HOL/Library/Formal_Power_Series.thy
src/HOL/Library/Groups_Big_Fun.thy
src/HOL/Library/Multiset.thy
src/HOL/Library/Multiset_Permutations.thy
src/HOL/Library/Polynomial.thy
src/HOL/Library/Polynomial_FPS.thy
src/HOL/Library/RBT_Set.thy
src/HOL/Lifting_Set.thy
src/HOL/Limits.thy
src/HOL/List.thy
src/HOL/Nat_Transfer.thy
src/HOL/Number_Theory/Cong.thy
src/HOL/Number_Theory/Factorial_Ring.thy
src/HOL/Number_Theory/Gauss.thy
src/HOL/Number_Theory/Primes.thy
src/HOL/Number_Theory/Residues.thy
src/HOL/Old_Number_Theory/Euler.thy
src/HOL/Old_Number_Theory/EulerFermat.thy
src/HOL/Old_Number_Theory/Finite2.thy
src/HOL/Old_Number_Theory/Gauss.thy
src/HOL/Old_Number_Theory/Int2.thy
src/HOL/Old_Number_Theory/Pocklington.thy
src/HOL/Old_Number_Theory/Residues.thy
src/HOL/Old_Number_Theory/WilsonBij.thy
src/HOL/Old_Number_Theory/WilsonRuss.thy
src/HOL/Probability/Central_Limit_Theorem.thy
src/HOL/Probability/Independent_Family.thy
src/HOL/Probability/Infinite_Product_Measure.thy
src/HOL/Probability/Probability_Measure.thy
src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy
src/HOL/Rat.thy
src/HOL/Real_Vector_Spaces.thy
src/HOL/Set_Interval.thy
src/HOL/Transcendental.thy
src/HOL/ex/Birthday_Paradox.thy
src/HOL/ex/Sum_of_Powers.thy
     1.1 --- a/src/Doc/Main/Main_Doc.thy	Mon Oct 17 14:37:32 2016 +0200
     1.2 +++ b/src/Doc/Main/Main_Doc.thy	Mon Oct 17 17:33:07 2016 +0200
     1.3 @@ -409,7 +409,7 @@
     1.4  @{const Finite_Set.card} & @{term_type_only Finite_Set.card "'a set \<Rightarrow> nat"}\\
     1.5  @{const Finite_Set.fold} & @{term_type_only Finite_Set.fold "('a \<Rightarrow> 'b \<Rightarrow> 'b) \<Rightarrow> 'b \<Rightarrow> 'a set \<Rightarrow> 'b"}\\
     1.6  @{const Groups_Big.sum} & @{term_type_only Groups_Big.sum "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b::comm_monoid_add"}\\
     1.7 -@{const Groups_Big.setprod} & @{term_type_only Groups_Big.setprod "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b::comm_monoid_mult"}\\
     1.8 +@{const Groups_Big.prod} & @{term_type_only Groups_Big.prod "('a \<Rightarrow> 'b) \<Rightarrow> 'a set \<Rightarrow> 'b::comm_monoid_mult"}\\
     1.9  \end{supertabular}
    1.10  
    1.11  
     2.1 --- a/src/HOL/Algebra/IntRing.thy	Mon Oct 17 14:37:32 2016 +0200
     2.2 +++ b/src/HOL/Algebra/IntRing.thy	Mon Oct 17 17:33:07 2016 +0200
     2.3 @@ -73,7 +73,7 @@
     2.4  qed
     2.5  
     2.6  interpretation int: comm_monoid \<Z>
     2.7 -  rewrites "finprod \<Z> f A = setprod f A"
     2.8 +  rewrites "finprod \<Z> f A = prod f A"
     2.9  proof -
    2.10    \<comment> "Specification"
    2.11    show "comm_monoid \<Z>" by standard auto
    2.12 @@ -83,7 +83,7 @@
    2.13    { fix x y have "mult \<Z> x y = x * y" by simp }
    2.14    note mult = this
    2.15    have one: "one \<Z> = 1" by simp
    2.16 -  show "finprod \<Z> f A = setprod f A"
    2.17 +  show "finprod \<Z> f A = prod f A"
    2.18      by (induct A rule: infinite_finite_induct, auto)
    2.19  qed
    2.20  
     3.1 --- a/src/HOL/Analysis/Bochner_Integration.thy	Mon Oct 17 14:37:32 2016 +0200
     3.2 +++ b/src/HOL/Analysis/Bochner_Integration.thy	Mon Oct 17 17:33:07 2016 +0200
     3.3 @@ -3003,7 +3003,7 @@
     3.4    finally show ?thesis .
     3.5  qed
     3.6  
     3.7 -lemma (in product_sigma_finite) product_integrable_setprod:
     3.8 +lemma (in product_sigma_finite) product_integrable_prod:
     3.9    fixes f :: "'i \<Rightarrow> 'a \<Rightarrow> _::{real_normed_field,banach,second_countable_topology}"
    3.10    assumes [simp]: "finite I" and integrable: "\<And>i. i \<in> I \<Longrightarrow> integrable (M i) (f i)"
    3.11    shows "integrable (Pi\<^sub>M I M) (\<lambda>x. (\<Prod>i\<in>I. f i (x i)))" (is "integrable _ ?f")
    3.12 @@ -3014,15 +3014,15 @@
    3.13      using assms by simp
    3.14    have "(\<integral>\<^sup>+ x. ennreal (norm (\<Prod>i\<in>I. f i (x i))) \<partial>Pi\<^sub>M I M) =
    3.15        (\<integral>\<^sup>+ x. (\<Prod>i\<in>I. ennreal (norm (f i (x i)))) \<partial>Pi\<^sub>M I M)"
    3.16 -    by (simp add: setprod_norm setprod_ennreal)
    3.17 +    by (simp add: prod_norm prod_ennreal)
    3.18    also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<^sup>+ x. ennreal (norm (f i x)) \<partial>M i)"
    3.19 -    using assms by (intro product_nn_integral_setprod) auto
    3.20 +    using assms by (intro product_nn_integral_prod) auto
    3.21    also have "\<dots> < \<infinity>"
    3.22 -    using integrable by (simp add: less_top[symmetric] ennreal_setprod_eq_top integrable_iff_bounded)
    3.23 +    using integrable by (simp add: less_top[symmetric] ennreal_prod_eq_top integrable_iff_bounded)
    3.24    finally show "(\<integral>\<^sup>+ x. ennreal (norm (\<Prod>i\<in>I. f i (x i))) \<partial>Pi\<^sub>M I M) < \<infinity>" .
    3.25  qed
    3.26  
    3.27 -lemma (in product_sigma_finite) product_integral_setprod:
    3.28 +lemma (in product_sigma_finite) product_integral_prod:
    3.29    fixes f :: "'i \<Rightarrow> 'a \<Rightarrow> _::{real_normed_field,banach,second_countable_topology}"
    3.30    assumes "finite I" and integrable: "\<And>i. i \<in> I \<Longrightarrow> integrable (M i) (f i)"
    3.31    shows "(\<integral>x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>L (M i) (f i))"
    3.32 @@ -3036,10 +3036,10 @@
    3.33    then have iI: "finite (insert i I)" by auto
    3.34    then have prod: "\<And>J. J \<subseteq> insert i I \<Longrightarrow>
    3.35      integrable (Pi\<^sub>M J M) (\<lambda>x. (\<Prod>i\<in>J. f i (x i)))"
    3.36 -    by (intro product_integrable_setprod insert(4)) (auto intro: finite_subset)
    3.37 +    by (intro product_integrable_prod insert(4)) (auto intro: finite_subset)
    3.38    interpret I: finite_product_sigma_finite M I by standard fact
    3.39    have *: "\<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))"
    3.40 -    using \<open>i \<notin> I\<close> by (auto intro!: setprod.cong)
    3.41 +    using \<open>i \<notin> I\<close> by (auto intro!: prod.cong)
    3.42    show ?case
    3.43      unfolding product_integral_insert[OF insert(1,2) prod[OF subset_refl]]
    3.44      by (simp add: * insert prod subset_insertI)
     4.1 --- a/src/HOL/Analysis/Borel_Space.thy	Mon Oct 17 14:37:32 2016 +0200
     4.2 +++ b/src/HOL/Analysis/Borel_Space.thy	Mon Oct 17 17:33:07 2016 +0200
     4.3 @@ -1348,7 +1348,7 @@
     4.4    shows "(\<lambda>x. f x * g x) \<in> borel_measurable M"
     4.5    using f g by (rule borel_measurable_continuous_Pair) (intro continuous_intros)
     4.6  
     4.7 -lemma borel_measurable_setprod[measurable (raw)]:
     4.8 +lemma borel_measurable_prod[measurable (raw)]:
     4.9    fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> 'b::{second_countable_topology, real_normed_field}"
    4.10    assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
    4.11    shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
    4.12 @@ -1652,7 +1652,7 @@
    4.13    shows "(\<lambda>x. \<Sum>i\<in>S. f i x) \<in> borel_measurable M"
    4.14    using assms by (induction S rule: infinite_finite_induct) auto
    4.15  
    4.16 -lemma borel_measurable_ereal_setprod[measurable (raw)]:
    4.17 +lemma borel_measurable_ereal_prod[measurable (raw)]:
    4.18    fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ereal"
    4.19    assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
    4.20    shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
    4.21 @@ -1728,7 +1728,7 @@
    4.22    shows "f \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> g \<in> M \<rightarrow>\<^sub>M borel \<Longrightarrow> (\<lambda>x. f x - g x) \<in> M \<rightarrow>\<^sub>M borel"
    4.23    unfolding is_borel_def[symmetric] by transfer simp
    4.24  
    4.25 -lemma borel_measurable_setprod_ennreal[measurable (raw)]:
    4.26 +lemma borel_measurable_prod_ennreal[measurable (raw)]:
    4.27    fixes f :: "'c \<Rightarrow> 'a \<Rightarrow> ennreal"
    4.28    assumes "\<And>i. i \<in> S \<Longrightarrow> f i \<in> borel_measurable M"
    4.29    shows "(\<lambda>x. \<Prod>i\<in>S. f i x) \<in> borel_measurable M"
     5.1 --- a/src/HOL/Analysis/Determinants.thy	Mon Oct 17 14:37:32 2016 +0200
     5.2 +++ b/src/HOL/Analysis/Determinants.thy	Mon Oct 17 17:33:07 2016 +0200
     5.3 @@ -37,20 +37,20 @@
     5.4  
     5.5  definition det:: "'a::comm_ring_1^'n^'n \<Rightarrow> 'a" where
     5.6    "det A =
     5.7 -    sum (\<lambda>p. of_int (sign p) * setprod (\<lambda>i. A$i$p i) (UNIV :: 'n set))
     5.8 +    sum (\<lambda>p. of_int (sign p) * prod (\<lambda>i. A$i$p i) (UNIV :: 'n set))
     5.9        {p. p permutes (UNIV :: 'n set)}"
    5.10  
    5.11  text \<open>A few general lemmas we need below.\<close>
    5.12  
    5.13 -lemma setprod_permute:
    5.14 +lemma prod_permute:
    5.15    assumes p: "p permutes S"
    5.16 -  shows "setprod f S = setprod (f \<circ> p) S"
    5.17 -  using assms by (fact setprod.permute)
    5.18 +  shows "prod f S = prod (f \<circ> p) S"
    5.19 +  using assms by (fact prod.permute)
    5.20  
    5.21 -lemma setproduct_permute_nat_interval:
    5.22 +lemma product_permute_nat_interval:
    5.23    fixes m n :: nat
    5.24 -  shows "p permutes {m..n} \<Longrightarrow> setprod f {m..n} = setprod (f \<circ> p) {m..n}"
    5.25 -  by (blast intro!: setprod_permute)
    5.26 +  shows "p permutes {m..n} \<Longrightarrow> prod f {m..n} = prod (f \<circ> p) {m..n}"
    5.27 +  by (blast intro!: prod_permute)
    5.28  
    5.29  text \<open>Basic determinant properties.\<close>
    5.30  
    5.31 @@ -70,12 +70,12 @@
    5.32      have pi: "inj_on p ?U"
    5.33        by (blast intro: subset_inj_on)
    5.34      from permutes_image[OF pU]
    5.35 -    have "setprod (\<lambda>i. ?di (transpose A) i (inv p i)) ?U =
    5.36 -      setprod (\<lambda>i. ?di (transpose A) i (inv p i)) (p ` ?U)"
    5.37 +    have "prod (\<lambda>i. ?di (transpose A) i (inv p i)) ?U =
    5.38 +      prod (\<lambda>i. ?di (transpose A) i (inv p i)) (p ` ?U)"
    5.39        by simp
    5.40 -    also have "\<dots> = setprod ((\<lambda>i. ?di (transpose A) i (inv p i)) \<circ> p) ?U"
    5.41 -      unfolding setprod.reindex[OF pi] ..
    5.42 -    also have "\<dots> = setprod (\<lambda>i. ?di A i (p i)) ?U"
    5.43 +    also have "\<dots> = prod ((\<lambda>i. ?di (transpose A) i (inv p i)) \<circ> p) ?U"
    5.44 +      unfolding prod.reindex[OF pi] ..
    5.45 +    also have "\<dots> = prod (\<lambda>i. ?di A i (p i)) ?U"
    5.46      proof -
    5.47        {
    5.48          fix i
    5.49 @@ -84,12 +84,12 @@
    5.50          have "((\<lambda>i. ?di (transpose A) i (inv p i)) \<circ> p) i = ?di A i (p i)"
    5.51            unfolding transpose_def by (simp add: fun_eq_iff)
    5.52        }
    5.53 -      then show "setprod ((\<lambda>i. ?di (transpose A) i (inv p i)) \<circ> p) ?U =
    5.54 -        setprod (\<lambda>i. ?di A i (p i)) ?U"
    5.55 -        by (auto intro: setprod.cong)
    5.56 +      then show "prod ((\<lambda>i. ?di (transpose A) i (inv p i)) \<circ> p) ?U =
    5.57 +        prod (\<lambda>i. ?di A i (p i)) ?U"
    5.58 +        by (auto intro: prod.cong)
    5.59      qed
    5.60 -    finally have "of_int (sign (inv p)) * (setprod (\<lambda>i. ?di (transpose A) i (inv p i)) ?U) =
    5.61 -      of_int (sign p) * (setprod (\<lambda>i. ?di A i (p i)) ?U)"
    5.62 +    finally have "of_int (sign (inv p)) * (prod (\<lambda>i. ?di (transpose A) i (inv p i)) ?U) =
    5.63 +      of_int (sign p) * (prod (\<lambda>i. ?di A i (p i)) ?U)"
    5.64        using sth by simp
    5.65    }
    5.66    then show ?thesis
    5.67 @@ -104,11 +104,11 @@
    5.68  lemma det_lowerdiagonal:
    5.69    fixes A :: "'a::comm_ring_1^('n::{finite,wellorder})^('n::{finite,wellorder})"
    5.70    assumes ld: "\<And>i j. i < j \<Longrightarrow> A$i$j = 0"
    5.71 -  shows "det A = setprod (\<lambda>i. A$i$i) (UNIV:: 'n set)"
    5.72 +  shows "det A = prod (\<lambda>i. A$i$i) (UNIV:: 'n set)"
    5.73  proof -
    5.74    let ?U = "UNIV:: 'n set"
    5.75    let ?PU = "{p. p permutes ?U}"
    5.76 -  let ?pp = "\<lambda>p. of_int (sign p) * setprod (\<lambda>i. A$i$p i) (UNIV :: 'n set)"
    5.77 +  let ?pp = "\<lambda>p. of_int (sign p) * prod (\<lambda>i. A$i$p i) (UNIV :: 'n set)"
    5.78    have fU: "finite ?U"
    5.79      by simp
    5.80    from finite_permutations[OF fU] have fPU: "finite ?PU" .
    5.81 @@ -123,7 +123,7 @@
    5.82        by (metis not_le)
    5.83      from ld[OF i] have ex:"\<exists>i \<in> ?U. A$i$p i = 0"
    5.84        by blast
    5.85 -    from setprod_zero[OF fU ex] have "?pp p = 0"
    5.86 +    from prod_zero[OF fU ex] have "?pp p = 0"
    5.87        by simp
    5.88    }
    5.89    then have p0: "\<forall>p \<in> ?PU - {id}. ?pp p = 0"
    5.90 @@ -135,11 +135,11 @@
    5.91  lemma det_upperdiagonal:
    5.92    fixes A :: "'a::comm_ring_1^'n::{finite,wellorder}^'n::{finite,wellorder}"
    5.93    assumes ld: "\<And>i j. i > j \<Longrightarrow> A$i$j = 0"
    5.94 -  shows "det A = setprod (\<lambda>i. A$i$i) (UNIV:: 'n set)"
    5.95 +  shows "det A = prod (\<lambda>i. A$i$i) (UNIV:: 'n set)"
    5.96  proof -
    5.97    let ?U = "UNIV:: 'n set"
    5.98    let ?PU = "{p. p permutes ?U}"
    5.99 -  let ?pp = "(\<lambda>p. of_int (sign p) * setprod (\<lambda>i. A$i$p i) (UNIV :: 'n set))"
   5.100 +  let ?pp = "(\<lambda>p. of_int (sign p) * prod (\<lambda>i. A$i$p i) (UNIV :: 'n set))"
   5.101    have fU: "finite ?U"
   5.102      by simp
   5.103    from finite_permutations[OF fU] have fPU: "finite ?PU" .
   5.104 @@ -154,7 +154,7 @@
   5.105        by (metis not_le)
   5.106      from ld[OF i] have ex:"\<exists>i \<in> ?U. A$i$p i = 0"
   5.107        by blast
   5.108 -    from setprod_zero[OF fU ex] have "?pp p = 0"
   5.109 +    from prod_zero[OF fU ex] have "?pp p = 0"
   5.110        by simp
   5.111    }
   5.112    then have p0: "\<forall>p \<in> ?PU -{id}. ?pp p = 0"
   5.113 @@ -166,11 +166,11 @@
   5.114  lemma det_diagonal:
   5.115    fixes A :: "'a::comm_ring_1^'n^'n"
   5.116    assumes ld: "\<And>i j. i \<noteq> j \<Longrightarrow> A$i$j = 0"
   5.117 -  shows "det A = setprod (\<lambda>i. A$i$i) (UNIV::'n set)"
   5.118 +  shows "det A = prod (\<lambda>i. A$i$i) (UNIV::'n set)"
   5.119  proof -
   5.120    let ?U = "UNIV:: 'n set"
   5.121    let ?PU = "{p. p permutes ?U}"
   5.122 -  let ?pp = "\<lambda>p. of_int (sign p) * setprod (\<lambda>i. A$i$p i) (UNIV :: 'n set)"
   5.123 +  let ?pp = "\<lambda>p. of_int (sign p) * prod (\<lambda>i. A$i$p i) (UNIV :: 'n set)"
   5.124    have fU: "finite ?U" by simp
   5.125    from finite_permutations[OF fU] have fPU: "finite ?PU" .
   5.126    have id0: "{id} \<subseteq> ?PU"
   5.127 @@ -184,7 +184,7 @@
   5.128        unfolding fun_eq_iff by auto
   5.129      from ld [OF i [symmetric]] have ex:"\<exists>i \<in> ?U. A$i$p i = 0"
   5.130        by blast
   5.131 -    from setprod_zero [OF fU ex] have "?pp p = 0"
   5.132 +    from prod_zero [OF fU ex] have "?pp p = 0"
   5.133        by simp
   5.134    }
   5.135    then have p0: "\<forall>p \<in> ?PU - {id}. ?pp p = 0"
   5.136 @@ -204,23 +204,23 @@
   5.137      have "?f i i = 1"
   5.138        using i by (vector mat_def)
   5.139    }
   5.140 -  then have th: "setprod (\<lambda>i. ?f i i) ?U = setprod (\<lambda>x. 1) ?U"
   5.141 -    by (auto intro: setprod.cong)
   5.142 +  then have th: "prod (\<lambda>i. ?f i i) ?U = prod (\<lambda>x. 1) ?U"
   5.143 +    by (auto intro: prod.cong)
   5.144    {
   5.145      fix i j
   5.146      assume i: "i \<in> ?U" and j: "j \<in> ?U" and ij: "i \<noteq> j"
   5.147      have "?f i j = 0" using i j ij
   5.148        by (vector mat_def)
   5.149    }
   5.150 -  then have "det ?A = setprod (\<lambda>i. ?f i i) ?U"
   5.151 +  then have "det ?A = prod (\<lambda>i. ?f i i) ?U"
   5.152      using det_diagonal by blast
   5.153    also have "\<dots> = 1"
   5.154 -    unfolding th setprod.neutral_const ..
   5.155 +    unfolding th prod.neutral_const ..
   5.156    finally show ?thesis .
   5.157  qed
   5.158  
   5.159  lemma det_0: "det (mat 0 :: 'a::comm_ring_1^'n^'n) = 0"
   5.160 -  by (simp add: det_def setprod_zero)
   5.161 +  by (simp add: det_def prod_zero)
   5.162  
   5.163  lemma det_permute_rows:
   5.164    fixes A :: "'a::comm_ring_1^'n^'n"
   5.165 @@ -240,16 +240,16 @@
   5.166    from p q have pp: "permutation p" and qp: "permutation q"
   5.167      by (metis fU permutation_permutes)+
   5.168    from permutes_inv[OF p] have ip: "inv p permutes ?U" .
   5.169 -  have "setprod (\<lambda>i. A$p i$ (q \<circ> p) i) ?U = setprod ((\<lambda>i. A$p i$(q \<circ> p) i) \<circ> inv p) ?U"
   5.170 -    by (simp only: setprod_permute[OF ip, symmetric])
   5.171 -  also have "\<dots> = setprod (\<lambda>i. A $ (p \<circ> inv p) i $ (q \<circ> (p \<circ> inv p)) i) ?U"
   5.172 +  have "prod (\<lambda>i. A$p i$ (q \<circ> p) i) ?U = prod ((\<lambda>i. A$p i$(q \<circ> p) i) \<circ> inv p) ?U"
   5.173 +    by (simp only: prod_permute[OF ip, symmetric])
   5.174 +  also have "\<dots> = prod (\<lambda>i. A $ (p \<circ> inv p) i $ (q \<circ> (p \<circ> inv p)) i) ?U"
   5.175      by (simp only: o_def)
   5.176 -  also have "\<dots> = setprod (\<lambda>i. A$i$q i) ?U"
   5.177 +  also have "\<dots> = prod (\<lambda>i. A$i$q i) ?U"
   5.178      by (simp only: o_def permutes_inverses[OF p])
   5.179 -  finally have thp: "setprod (\<lambda>i. A$p i$ (q \<circ> p) i) ?U = setprod (\<lambda>i. A$i$q i) ?U"
   5.180 +  finally have thp: "prod (\<lambda>i. A$p i$ (q \<circ> p) i) ?U = prod (\<lambda>i. A$i$q i) ?U"
   5.181      by blast
   5.182 -  show "of_int (sign (q \<circ> p)) * setprod (\<lambda>i. A$ p i$ (q \<circ> p) i) ?U =
   5.183 -    of_int (sign p) * of_int (sign q) * setprod (\<lambda>i. A$i$q i) ?U"
   5.184 +  show "of_int (sign (q \<circ> p)) * prod (\<lambda>i. A$ p i$ (q \<circ> p) i) ?U =
   5.185 +    of_int (sign p) * of_int (sign q) * prod (\<lambda>i. A$i$q i) ?U"
   5.186      by (simp only: thp sign_compose[OF qp pp] mult.commute of_int_mult)
   5.187  qed rule
   5.188  
   5.189 @@ -341,30 +341,30 @@
   5.190      from j have "?f j $ p j = ?g j $ p j" and "?f j $ p j= ?h j $ p j"
   5.191        by simp_all
   5.192    }
   5.193 -  then have th1: "setprod (\<lambda>i. ?f i $ p i) ?Uk = setprod (\<lambda>i. ?g i $ p i) ?Uk"
   5.194 -    and th2: "setprod (\<lambda>i. ?f i $ p i) ?Uk = setprod (\<lambda>i. ?h i $ p i) ?Uk"
   5.195 +  then have th1: "prod (\<lambda>i. ?f i $ p i) ?Uk = prod (\<lambda>i. ?g i $ p i) ?Uk"
   5.196 +    and th2: "prod (\<lambda>i. ?f i $ p i) ?Uk = prod (\<lambda>i. ?h i $ p i) ?Uk"
   5.197      apply -
   5.198 -    apply (rule setprod.cong, simp_all)+
   5.199 +    apply (rule prod.cong, simp_all)+
   5.200      done
   5.201    have th3: "finite ?Uk" "k \<notin> ?Uk"
   5.202      by auto
   5.203 -  have "setprod (\<lambda>i. ?f i $ p i) ?U = setprod (\<lambda>i. ?f i $ p i) (insert k ?Uk)"
   5.204 +  have "prod (\<lambda>i. ?f i $ p i) ?U = prod (\<lambda>i. ?f i $ p i) (insert k ?Uk)"
   5.205      unfolding kU[symmetric] ..
   5.206 -  also have "\<dots> = ?f k $ p k * setprod (\<lambda>i. ?f i $ p i) ?Uk"
   5.207 -    apply (rule setprod.insert)
   5.208 +  also have "\<dots> = ?f k $ p k * prod (\<lambda>i. ?f i $ p i) ?Uk"
   5.209 +    apply (rule prod.insert)
   5.210      apply simp
   5.211      apply blast
   5.212      done
   5.213 -  also have "\<dots> = (a k $ p k * setprod (\<lambda>i. ?f i $ p i) ?Uk) + (b k$ p k * setprod (\<lambda>i. ?f i $ p i) ?Uk)"
   5.214 +  also have "\<dots> = (a k $ p k * prod (\<lambda>i. ?f i $ p i) ?Uk) + (b k$ p k * prod (\<lambda>i. ?f i $ p i) ?Uk)"
   5.215      by (simp add: field_simps)
   5.216 -  also have "\<dots> = (a k $ p k * setprod (\<lambda>i. ?g i $ p i) ?Uk) + (b k$ p k * setprod (\<lambda>i. ?h i $ p i) ?Uk)"
   5.217 +  also have "\<dots> = (a k $ p k * prod (\<lambda>i. ?g i $ p i) ?Uk) + (b k$ p k * prod (\<lambda>i. ?h i $ p i) ?Uk)"
   5.218      by (metis th1 th2)
   5.219 -  also have "\<dots> = setprod (\<lambda>i. ?g i $ p i) (insert k ?Uk) + setprod (\<lambda>i. ?h i $ p i) (insert k ?Uk)"
   5.220 -    unfolding  setprod.insert[OF th3] by simp
   5.221 -  finally have "setprod (\<lambda>i. ?f i $ p i) ?U = setprod (\<lambda>i. ?g i $ p i) ?U + setprod (\<lambda>i. ?h i $ p i) ?U"
   5.222 +  also have "\<dots> = prod (\<lambda>i. ?g i $ p i) (insert k ?Uk) + prod (\<lambda>i. ?h i $ p i) (insert k ?Uk)"
   5.223 +    unfolding  prod.insert[OF th3] by simp
   5.224 +  finally have "prod (\<lambda>i. ?f i $ p i) ?U = prod (\<lambda>i. ?g i $ p i) ?U + prod (\<lambda>i. ?h i $ p i) ?U"
   5.225      unfolding kU[symmetric] .
   5.226 -  then show "of_int (sign p) * setprod (\<lambda>i. ?f i $ p i) ?U =
   5.227 -    of_int (sign p) * setprod (\<lambda>i. ?g i $ p i) ?U + of_int (sign p) * setprod (\<lambda>i. ?h i $ p i) ?U"
   5.228 +  then show "of_int (sign p) * prod (\<lambda>i. ?f i $ p i) ?U =
   5.229 +    of_int (sign p) * prod (\<lambda>i. ?g i $ p i) ?U + of_int (sign p) * prod (\<lambda>i. ?h i $ p i) ?U"
   5.230      by (simp add: field_simps)
   5.231  qed rule
   5.232  
   5.233 @@ -391,30 +391,30 @@
   5.234      from j have "?f j $ p j = ?g j $ p j"
   5.235        by simp
   5.236    }
   5.237 -  then have th1: "setprod (\<lambda>i. ?f i $ p i) ?Uk = setprod (\<lambda>i. ?g i $ p i) ?Uk"
   5.238 +  then have th1: "prod (\<lambda>i. ?f i $ p i) ?Uk = prod (\<lambda>i. ?g i $ p i) ?Uk"
   5.239      apply -
   5.240 -    apply (rule setprod.cong)
   5.241 +    apply (rule prod.cong)
   5.242      apply simp_all
   5.243      done
   5.244    have th3: "finite ?Uk" "k \<notin> ?Uk"
   5.245      by auto
   5.246 -  have "setprod (\<lambda>i. ?f i $ p i) ?U = setprod (\<lambda>i. ?f i $ p i) (insert k ?Uk)"
   5.247 +  have "prod (\<lambda>i. ?f i $ p i) ?U = prod (\<lambda>i. ?f i $ p i) (insert k ?Uk)"
   5.248      unfolding kU[symmetric] ..
   5.249 -  also have "\<dots> = ?f k $ p k  * setprod (\<lambda>i. ?f i $ p i) ?Uk"
   5.250 -    apply (rule setprod.insert)
   5.251 +  also have "\<dots> = ?f k $ p k  * prod (\<lambda>i. ?f i $ p i) ?Uk"
   5.252 +    apply (rule prod.insert)
   5.253      apply simp
   5.254      apply blast
   5.255      done
   5.256 -  also have "\<dots> = (c*s a k) $ p k * setprod (\<lambda>i. ?f i $ p i) ?Uk"
   5.257 +  also have "\<dots> = (c*s a k) $ p k * prod (\<lambda>i. ?f i $ p i) ?Uk"
   5.258      by (simp add: field_simps)
   5.259 -  also have "\<dots> = c* (a k $ p k * setprod (\<lambda>i. ?g i $ p i) ?Uk)"
   5.260 +  also have "\<dots> = c* (a k $ p k * prod (\<lambda>i. ?g i $ p i) ?Uk)"
   5.261      unfolding th1 by (simp add: ac_simps)
   5.262 -  also have "\<dots> = c* (setprod (\<lambda>i. ?g i $ p i) (insert k ?Uk))"
   5.263 -    unfolding setprod.insert[OF th3] by simp
   5.264 -  finally have "setprod (\<lambda>i. ?f i $ p i) ?U = c* (setprod (\<lambda>i. ?g i $ p i) ?U)"
   5.265 +  also have "\<dots> = c* (prod (\<lambda>i. ?g i $ p i) (insert k ?Uk))"
   5.266 +    unfolding prod.insert[OF th3] by simp
   5.267 +  finally have "prod (\<lambda>i. ?f i $ p i) ?U = c* (prod (\<lambda>i. ?g i $ p i) ?U)"
   5.268      unfolding kU[symmetric] .
   5.269 -  then show "of_int (sign p) * setprod (\<lambda>i. ?f i $ p i) ?U =
   5.270 -    c * (of_int (sign p) * setprod (\<lambda>i. ?g i $ p i) ?U)"
   5.271 +  then show "of_int (sign p) * prod (\<lambda>i. ?f i $ p i) ?U =
   5.272 +    c * (of_int (sign p) * prod (\<lambda>i. ?g i $ p i) ?U)"
   5.273      by (simp add: field_simps)
   5.274  qed rule
   5.275  
   5.276 @@ -644,8 +644,8 @@
   5.277  
   5.278  lemma det_rows_mul:
   5.279    "det((\<chi> i. c i *s a i)::'a::comm_ring_1^'n^'n) =
   5.280 -    setprod (\<lambda>i. c i) (UNIV:: 'n set) * det((\<chi> i. a i)::'a^'n^'n)"
   5.281 -proof (simp add: det_def sum_distrib_left cong add: setprod.cong, rule sum.cong)
   5.282 +    prod (\<lambda>i. c i) (UNIV:: 'n set) * det((\<chi> i. a i)::'a^'n^'n)"
   5.283 +proof (simp add: det_def sum_distrib_left cong add: prod.cong, rule sum.cong)
   5.284    let ?U = "UNIV :: 'n set"
   5.285    let ?PU = "{p. p permutes ?U}"
   5.286    fix p
   5.287 @@ -653,10 +653,10 @@
   5.288    let ?s = "of_int (sign p)"
   5.289    from pU have p: "p permutes ?U"
   5.290      by blast
   5.291 -  have "setprod (\<lambda>i. c i * a i $ p i) ?U = setprod c ?U * setprod (\<lambda>i. a i $ p i) ?U"
   5.292 -    unfolding setprod.distrib ..
   5.293 +  have "prod (\<lambda>i. c i * a i $ p i) ?U = prod c ?U * prod (\<lambda>i. a i $ p i) ?U"
   5.294 +    unfolding prod.distrib ..
   5.295    then show "?s * (\<Prod>xa\<in>?U. c xa * a xa $ p xa) =
   5.296 -    setprod c ?U * (?s* (\<Prod>xa\<in>?U. a xa $ p xa))"
   5.297 +    prod c ?U * (?s* (\<Prod>xa\<in>?U. a xa $ p xa))"
   5.298      by (simp add: field_simps)
   5.299  qed rule
   5.300  
   5.301 @@ -754,17 +754,17 @@
   5.302        have ths: "?s q = ?s p * ?s (q \<circ> inv p)"
   5.303          using pp pq permutation_inverse[OF pp] sign_inverse[OF pp]
   5.304          by (simp add:  th00 ac_simps sign_idempotent sign_compose)
   5.305 -      have th001: "setprod (\<lambda>i. B$i$ q (inv p i)) ?U = setprod ((\<lambda>i. B$i$ q (inv p i)) \<circ> p) ?U"
   5.306 -        by (rule setprod_permute[OF p])
   5.307 -      have thp: "setprod (\<lambda>i. (\<chi> i. A$i$p i *s B$p i :: 'a^'n^'n) $i $ q i) ?U =
   5.308 -        setprod (\<lambda>i. A$i$p i) ?U * setprod (\<lambda>i. B$i$ q (inv p i)) ?U"
   5.309 -        unfolding th001 setprod.distrib[symmetric] o_def permutes_inverses[OF p]
   5.310 -        apply (rule setprod.cong[OF refl])
   5.311 +      have th001: "prod (\<lambda>i. B$i$ q (inv p i)) ?U = prod ((\<lambda>i. B$i$ q (inv p i)) \<circ> p) ?U"
   5.312 +        by (rule prod_permute[OF p])
   5.313 +      have thp: "prod (\<lambda>i. (\<chi> i. A$i$p i *s B$p i :: 'a^'n^'n) $i $ q i) ?U =
   5.314 +        prod (\<lambda>i. A$i$p i) ?U * prod (\<lambda>i. B$i$ q (inv p i)) ?U"
   5.315 +        unfolding th001 prod.distrib[symmetric] o_def permutes_inverses[OF p]
   5.316 +        apply (rule prod.cong[OF refl])
   5.317          using permutes_in_image[OF q]
   5.318          apply vector
   5.319          done
   5.320 -      show "?s q * setprod (\<lambda>i. (((\<chi> i. A$i$p i *s B$p i) :: 'a^'n^'n)$i$q i)) ?U =
   5.321 -        ?s p * (setprod (\<lambda>i. A$i$p i) ?U) * (?s (q \<circ> inv p) * setprod (\<lambda>i. B$i$(q \<circ> inv p) i) ?U)"
   5.322 +      show "?s q * prod (\<lambda>i. (((\<chi> i. A$i$p i *s B$p i) :: 'a^'n^'n)$i$q i)) ?U =
   5.323 +        ?s p * (prod (\<lambda>i. A$i$p i) ?U) * (?s (q \<circ> inv p) * prod (\<lambda>i. B$i$(q \<circ> inv p) i) ?U)"
   5.324          using ths thp pp pq permutation_inverse[OF pp] sign_inverse[OF pp]
   5.325          by (simp add: sign_nz th00 field_simps sign_idempotent sign_compose)
   5.326      qed rule
   5.327 @@ -1202,13 +1202,13 @@
   5.328  
   5.329  text \<open>Explicit formulas for low dimensions.\<close>
   5.330  
   5.331 -lemma setprod_neutral_const: "setprod f {(1::nat)..1} = f 1"
   5.332 +lemma prod_neutral_const: "prod f {(1::nat)..1} = f 1"
   5.333    by simp
   5.334  
   5.335 -lemma setprod_2: "setprod f {(1::nat)..2} = f 1 * f 2"
   5.336 +lemma prod_2: "prod f {(1::nat)..2} = f 1 * f 2"
   5.337    by (simp add: eval_nat_numeral atLeastAtMostSuc_conv mult.commute)
   5.338  
   5.339 -lemma setprod_3: "setprod f {(1::nat)..3} = f 1 * f 2 * f 3"
   5.340 +lemma prod_3: "prod f {(1::nat)..3} = f 1 * f 2 * f 3"
   5.341    by (simp add: eval_nat_numeral atLeastAtMostSuc_conv mult.commute)
   5.342  
   5.343  lemma det_1: "det (A::'a::comm_ring_1^1^1) = A$1$1"
     6.1 --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy	Mon Oct 17 14:37:32 2016 +0200
     6.2 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy	Mon Oct 17 17:33:07 2016 +0200
     6.3 @@ -1129,7 +1129,7 @@
     6.4  
     6.5  lemma negligible_interval:
     6.6    "negligible (cbox a b) \<longleftrightarrow> box a b = {}" "negligible (box a b) \<longleftrightarrow> box a b = {}"
     6.7 -   by (auto simp: negligible_iff_null_sets null_sets_def setprod_nonneg inner_diff_left box_eq_empty
     6.8 +   by (auto simp: negligible_iff_null_sets null_sets_def prod_nonneg inner_diff_left box_eq_empty
     6.9                    not_le emeasure_lborel_cbox_eq emeasure_lborel_box_eq
    6.10              intro: eq_refl antisym less_imp_le)
    6.11  
    6.12 @@ -1254,9 +1254,9 @@
    6.13        then have ufvf: "cbox (uf X) (vf X) = X"
    6.14          using uvz by blast
    6.15        have "prj1 (vf X - uf X) ^ DIM('M) = (\<Prod>i::'M \<in> Basis. prj1 (vf X - uf X))"
    6.16 -        by (rule setprod_constant [symmetric])
    6.17 +        by (rule prod_constant [symmetric])
    6.18        also have "\<dots> = (\<Prod>i\<in>Basis. vf X \<bullet> i - uf X \<bullet> i)"
    6.19 -        using prj1_idem [OF \<open>X \<in> \<D>\<close>] by (auto simp: algebra_simps intro: setprod.cong)
    6.20 +        using prj1_idem [OF \<open>X \<in> \<D>\<close>] by (auto simp: algebra_simps intro: prod.cong)
    6.21        finally have prj1_eq: "prj1 (vf X - uf X) ^ DIM('M) = (\<Prod>i\<in>Basis. vf X \<bullet> i - uf X \<bullet> i)" .
    6.22        have "uf X \<in> cbox (uf X) (vf X)" "vf X \<in> cbox (uf X) (vf X)"
    6.23          using uvz [OF \<open>X \<in> \<D>\<close>] by (force simp: mem_box)+
    6.24 @@ -1272,7 +1272,7 @@
    6.25        have 0: "0 \<le> prj1 (vf X - uf X)"
    6.26          using \<open>X \<in> \<D>\<close> prj1_def vu_pos by fastforce
    6.27        have "(measure lebesgue \<circ> fbx) X \<le> (2 * B * DIM('M)) ^ DIM('N) * content (cbox (uf X) (vf X))"
    6.28 -        apply (simp add: fbx_def content_cbox_cases algebra_simps BM_ge0 \<open>X \<in> \<D>'\<close> setprod_constant)
    6.29 +        apply (simp add: fbx_def content_cbox_cases algebra_simps BM_ge0 \<open>X \<in> \<D>'\<close> prod_constant)
    6.30          apply (simp add: power_mult_distrib \<open>0 < B\<close> prj1_eq [symmetric])
    6.31          using MleN 0 1 uvz \<open>X \<in> \<D>\<close>
    6.32          apply (fastforce simp add: box_ne_empty power_decreasing)
     7.1 --- a/src/HOL/Analysis/Finite_Product_Measure.thy	Mon Oct 17 14:37:32 2016 +0200
     7.2 +++ b/src/HOL/Analysis/Finite_Product_Measure.thy	Mon Oct 17 17:33:07 2016 +0200
     7.3 @@ -202,7 +202,7 @@
     7.4  next
     7.5    case (4 x)
     7.6    thus ?case using assms
     7.7 -    by (auto intro!: setprod.cong split: if_split_asm)
     7.8 +    by (auto intro!: prod.cong split: if_split_asm)
     7.9  qed
    7.10  
    7.11  
    7.12 @@ -926,12 +926,12 @@
    7.13        by (auto simp: prod_emb_iff PiE_def Pi_iff split: if_split_asm) blast+
    7.14      also have "emeasure (Pi\<^sub>M I M) (\<Pi>\<^sub>E j\<in>I. if j \<in> J-{i} then E j else space (M j)) =
    7.15        (\<Prod> j\<in>I. if j \<in> J-{i} then emeasure (M j) (E j) else emeasure (M j) (space (M j)))"
    7.16 -      using E by (subst insert) (auto intro!: setprod.cong)
    7.17 +      using E by (subst insert) (auto intro!: prod.cong)
    7.18      also have "(\<Prod>j\<in>I. if j \<in> J - {i} then emeasure (M j) (E j) else emeasure (M j) (space (M j))) *
    7.19         emeasure (M i) (if i \<in> J then E i else space (M i)) = (\<Prod>j\<in>insert i I. ?f J E j)"
    7.20 -      using insert by (auto simp: mult.commute intro!: arg_cong2[where f="op *"] setprod.cong)
    7.21 +      using insert by (auto simp: mult.commute intro!: arg_cong2[where f="op *"] prod.cong)
    7.22      also have "\<dots> = (\<Prod>j\<in>J \<union> ?I. ?f J E j)"
    7.23 -      using insert(1,2) J E by (intro setprod.mono_neutral_right) auto
    7.24 +      using insert(1,2) J E by (intro prod.mono_neutral_right) auto
    7.25      finally show "?\<mu> ?p = \<dots>" .
    7.26  
    7.27      show "prod_emb (insert i I) M J (Pi\<^sub>E J E) \<in> Pow (\<Pi>\<^sub>E i\<in>insert i I. space (M i))"
    7.28 @@ -943,7 +943,7 @@
    7.29      show "(insert i I \<noteq> {} \<or> insert i I = {}) \<and> finite (insert i I) \<and>
    7.30        insert i I \<subseteq> insert i I \<and> A \<in> (\<Pi> j\<in>insert i I. sets (M j))"
    7.31        using insert by auto
    7.32 -  qed (auto intro!: setprod.cong)
    7.33 +  qed (auto intro!: prod.cong)
    7.34    with insert show ?case
    7.35      by (subst (asm) prod_emb_PiE_same_index) (auto intro!: sets.sets_into_space)
    7.36  qed simp
    7.37 @@ -962,7 +962,7 @@
    7.38        by (simp add: eq emeasure_PiM)
    7.39      define A where "A n = (\<Pi>\<^sub>E i\<in>I. C i n)" for n
    7.40      with C show "range A \<subseteq> prod_algebra I M" "\<And>i. emeasure (Pi\<^sub>M I M) (A i) \<noteq> \<infinity>" "(\<Union>i. A i) = space (PiM I M)"
    7.41 -      by (auto intro!: prod_algebraI_finite simp: emeasure_PiM subset_eq ennreal_setprod_eq_top)
    7.42 +      by (auto intro!: prod_algebraI_finite simp: emeasure_PiM subset_eq ennreal_prod_eq_top)
    7.43    qed
    7.44  qed
    7.45  
    7.46 @@ -981,7 +981,7 @@
    7.47    ultimately show "\<exists>A. countable A \<and> A \<subseteq> sets (Pi\<^sub>M I M) \<and> \<Union>A = space (Pi\<^sub>M I M) \<and> (\<forall>a\<in>A. emeasure (Pi\<^sub>M I M) a \<noteq> \<infinity>)"
    7.48      by (intro exI[of _ "PiE I ` PiE I F"])
    7.49         (auto intro!: countable_PiE sets_PiM_I_finite
    7.50 -             simp: PiE_iff emeasure_PiM finite_index ennreal_setprod_eq_top)
    7.51 +             simp: PiE_iff emeasure_PiM finite_index ennreal_prod_eq_top)
    7.52  qed
    7.53  
    7.54  sublocale finite_product_sigma_finite \<subseteq> sigma_finite_measure "Pi\<^sub>M I M"
    7.55 @@ -1008,7 +1008,7 @@
    7.56    from A fin show "emeasure (distr (Pi\<^sub>M I M \<Otimes>\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \<union> J) M) (merge I J)) (Pi\<^sub>E (I \<union> J) A) =
    7.57        (\<Prod>i\<in>I \<union> J. emeasure (M i) (A i))"
    7.58      by (subst emeasure_distr)
    7.59 -       (auto simp: * J.emeasure_pair_measure_Times I.measure_times J.measure_times setprod.union_disjoint)
    7.60 +       (auto simp: * J.emeasure_pair_measure_Times I.measure_times J.measure_times prod.union_disjoint)
    7.61  qed (insert fin, simp_all)
    7.62  
    7.63  lemma (in product_sigma_finite) product_nn_integral_fold:
    7.64 @@ -1090,7 +1090,7 @@
    7.65    apply measurable
    7.66    done
    7.67  
    7.68 -lemma (in product_sigma_finite) product_nn_integral_setprod:
    7.69 +lemma (in product_sigma_finite) product_nn_integral_prod:
    7.70    assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)"
    7.71    shows "(\<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))"
    7.72  using assms proof (induction I)
    7.73 @@ -1099,10 +1099,10 @@
    7.74    note \<open>finite I\<close>[intro, simp]
    7.75    interpret I: finite_product_sigma_finite M I by standard auto
    7.76    have *: "\<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))"
    7.77 -    using insert by (auto intro!: setprod.cong)
    7.78 +    using insert by (auto intro!: prod.cong)
    7.79    have prod: "\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. (\<Prod>i\<in>J. f i (x i))) \<in> borel_measurable (Pi\<^sub>M J M)"
    7.80      using sets.sets_into_space insert
    7.81 -    by (intro borel_measurable_setprod_ennreal
    7.82 +    by (intro borel_measurable_prod_ennreal
    7.83                measurable_comp[OF measurable_component_singleton, unfolded comp_def])
    7.84         auto
    7.85    then show ?case
     8.1 --- a/src/HOL/Analysis/Gamma_Function.thy	Mon Oct 17 14:37:32 2016 +0200
     8.2 +++ b/src/HOL/Analysis/Gamma_Function.thy	Mon Oct 17 17:33:07 2016 +0200
     8.3 @@ -510,15 +510,15 @@
     8.4            (of_nat n) powr z / (z * (\<Prod>k=1..n. exp (Ln (z / of_nat k + 1))))"
     8.5      unfolding ln_Gamma_series_def powr_def by (simp add: exp_diff exp_sum)
     8.6    also from assms have "(\<Prod>k=1..n. exp (Ln (z / of_nat k + 1))) = (\<Prod>k=1..n. z / of_nat k + 1)"
     8.7 -    by (intro setprod.cong[OF refl], subst exp_Ln) (auto simp: field_simps plus_of_nat_eq_0_imp)
     8.8 +    by (intro prod.cong[OF refl], subst exp_Ln) (auto simp: field_simps plus_of_nat_eq_0_imp)
     8.9    also have "... = (\<Prod>k=1..n. z + k) / fact n"
    8.10 -    by (simp add: fact_setprod)
    8.11 -    (subst setprod_dividef [symmetric], simp_all add: field_simps)
    8.12 +    by (simp add: fact_prod)
    8.13 +    (subst prod_dividef [symmetric], simp_all add: field_simps)
    8.14    also from m have "z * ... = (\<Prod>k=0..n. z + k) / fact n"
    8.15 -    by (simp add: setprod.atLeast0_atMost_Suc_shift setprod.atLeast_Suc_atMost_Suc_shift)
    8.16 +    by (simp add: prod.atLeast0_atMost_Suc_shift prod.atLeast_Suc_atMost_Suc_shift)
    8.17    also have "(\<Prod>k=0..n. z + k) = pochhammer z (Suc n)"
    8.18 -    unfolding pochhammer_setprod
    8.19 -    by (simp add: setprod.atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
    8.20 +    unfolding pochhammer_prod
    8.21 +    by (simp add: prod.atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
    8.22    also have "of_nat n powr z / (pochhammer z (Suc n) / fact n) = Gamma_series z n"
    8.23      unfolding Gamma_series_def using assms by (simp add: divide_simps powr_def Ln_of_nat)
    8.24    finally show ?thesis .
    8.25 @@ -995,10 +995,10 @@
    8.26                          norm (y - z)) (nhds 0) (at z)"
    8.27    assumes differentiable_rGamma_aux2:
    8.28      "let z = - of_nat n
    8.29 -     in  filterlim (\<lambda>y. (rGamma y - rGamma z - (-1)^n * (setprod of_nat {1..n}) * (y - z)) /\<^sub>R
    8.30 +     in  filterlim (\<lambda>y. (rGamma y - rGamma z - (-1)^n * (prod of_nat {1..n}) * (y - z)) /\<^sub>R
    8.31                          norm (y - z)) (nhds 0) (at z)"
    8.32    assumes rGamma_series_aux: "(\<And>n. z \<noteq> - of_nat n) \<Longrightarrow>
    8.33 -             let fact' = (\<lambda>n. setprod of_nat {1..n});
    8.34 +             let fact' = (\<lambda>n. prod of_nat {1..n});
    8.35                   exp = (\<lambda>x. THE e. (\<lambda>n. \<Sum>k<n. x^k /\<^sub>R fact k) \<longlonglongrightarrow> e);
    8.36                   pochhammer' = (\<lambda>a n. (\<Prod>n = 0..n. a + of_nat n))
    8.37               in  filterlim (\<lambda>n. pochhammer' z n / (fact' n * exp (z * (ln (of_nat n) *\<^sub>R 1))))
    8.38 @@ -1033,7 +1033,7 @@
    8.39    case False
    8.40    hence "z \<noteq> - of_nat n" for n by auto
    8.41    from rGamma_series_aux[OF this] show ?thesis
    8.42 -    by (simp add: rGamma_series_def[abs_def] fact_setprod pochhammer_Suc_setprod
    8.43 +    by (simp add: rGamma_series_def[abs_def] fact_prod pochhammer_Suc_prod
    8.44                    exp_def of_real_def[symmetric] suminf_def sums_def[abs_def] atLeast0AtMost)
    8.45  qed (insert rGamma_eq_zero_iff[of z], simp_all add: rGamma_series_nonpos_Ints_LIMSEQ)
    8.46  
    8.47 @@ -1183,7 +1183,7 @@
    8.48    apply (rule has_field_derivative_at_within)
    8.49    using differentiable_rGamma_aux2[of n]
    8.50    unfolding Let_def has_field_derivative_def has_derivative_def netlimit_at
    8.51 -  by (simp only: bounded_linear_mult_right mult_ac of_real_def [symmetric] fact_setprod) simp
    8.52 +  by (simp only: bounded_linear_mult_right mult_ac of_real_def [symmetric] fact_prod) simp
    8.53  
    8.54  lemma has_field_derivative_rGamma [derivative_intros]:
    8.55    "(rGamma has_field_derivative (if z \<in> \<int>\<^sub>\<le>\<^sub>0 then (-1)^(nat \<lfloor>norm z\<rfloor>) * fact (nat \<lfloor>norm z\<rfloor>)
    8.56 @@ -1387,18 +1387,18 @@
    8.57  next
    8.58    fix n :: nat
    8.59    from has_field_derivative_rGamma_complex_nonpos_Int[of n]
    8.60 -  show "let z = - of_nat n in (\<lambda>y. (rGamma y - rGamma z - (- 1) ^ n * setprod of_nat {1..n} *
    8.61 +  show "let z = - of_nat n in (\<lambda>y. (rGamma y - rGamma z - (- 1) ^ n * prod of_nat {1..n} *
    8.62                    (y - z)) /\<^sub>R cmod (y - z)) \<midarrow>z\<rightarrow> 0"
    8.63 -    by (simp add: has_field_derivative_def has_derivative_def fact_setprod netlimit_at Let_def)
    8.64 +    by (simp add: has_field_derivative_def has_derivative_def fact_prod netlimit_at Let_def)
    8.65  next
    8.66    fix z :: complex
    8.67    from rGamma_series_complex_converges[of z] have "rGamma_series z \<longlonglongrightarrow> rGamma z"
    8.68      by (simp add: convergent_LIMSEQ_iff rGamma_complex_def)
    8.69 -  thus "let fact' = \<lambda>n. setprod of_nat {1..n};
    8.70 +  thus "let fact' = \<lambda>n. prod of_nat {1..n};
    8.71              exp = \<lambda>x. THE e. (\<lambda>n. \<Sum>k<n. x ^ k /\<^sub>R fact k) \<longlonglongrightarrow> e;
    8.72              pochhammer' = \<lambda>a n. \<Prod>n = 0..n. a + of_nat n
    8.73          in  (\<lambda>n. pochhammer' z n / (fact' n * exp (z * ln (real_of_nat n) *\<^sub>R 1))) \<longlonglongrightarrow> rGamma z"
    8.74 -    by (simp add: fact_setprod pochhammer_Suc_setprod rGamma_series_def [abs_def] exp_def
    8.75 +    by (simp add: fact_prod pochhammer_Suc_prod rGamma_series_def [abs_def] exp_def
    8.76                    of_real_def [symmetric] suminf_def sums_def [abs_def] atLeast0AtMost)
    8.77  qed
    8.78  
    8.79 @@ -1517,9 +1517,9 @@
    8.80    have "(rGamma has_field_derivative (-1)^n * fact n) (at (- of_nat n :: real))"
    8.81      by (fastforce intro!: derivative_eq_intros has_vector_derivative_real_complex
    8.82                    simp: Polygamma_of_real rGamma_real_def [abs_def])
    8.83 -  thus "let x = - of_nat n in (\<lambda>y. (rGamma y - rGamma x - (- 1) ^ n * setprod of_nat {1..n} *
    8.84 +  thus "let x = - of_nat n in (\<lambda>y. (rGamma y - rGamma x - (- 1) ^ n * prod of_nat {1..n} *
    8.85                    (y - x)) /\<^sub>R norm (y - x)) \<midarrow>x::real\<rightarrow> 0"
    8.86 -    by (simp add: has_field_derivative_def has_derivative_def fact_setprod netlimit_at Let_def)
    8.87 +    by (simp add: has_field_derivative_def has_derivative_def fact_prod netlimit_at Let_def)
    8.88  next
    8.89    fix x :: real
    8.90    have "rGamma_series x \<longlonglongrightarrow> rGamma x"
    8.91 @@ -1527,11 +1527,11 @@
    8.92      show "(\<lambda>n. Re (rGamma_series (of_real x) n)) \<longlonglongrightarrow> rGamma x" unfolding rGamma_real_def
    8.93        by (intro tendsto_intros)
    8.94    qed (insert rGamma_series_real, simp add: eq_commute)
    8.95 -  thus "let fact' = \<lambda>n. setprod of_nat {1..n};
    8.96 +  thus "let fact' = \<lambda>n. prod of_nat {1..n};
    8.97              exp = \<lambda>x. THE e. (\<lambda>n. \<Sum>k<n. x ^ k /\<^sub>R fact k) \<longlonglongrightarrow> e;
    8.98              pochhammer' = \<lambda>a n. \<Prod>n = 0..n. a + of_nat n
    8.99          in  (\<lambda>n. pochhammer' x n / (fact' n * exp (x * ln (real_of_nat n) *\<^sub>R 1))) \<longlonglongrightarrow> rGamma x"
   8.100 -    by (simp add: fact_setprod pochhammer_Suc_setprod rGamma_series_def [abs_def] exp_def
   8.101 +    by (simp add: fact_prod pochhammer_Suc_prod rGamma_series_def [abs_def] exp_def
   8.102                    of_real_def [symmetric] suminf_def sums_def [abs_def] atLeast0AtMost)
   8.103  qed
   8.104  
   8.105 @@ -2575,11 +2575,11 @@
   8.106            exp (z * of_real (\<Sum>k = 1..n. ln (1 + 1 / real_of_nat k)))"
   8.107      by (subst exp_sum [symmetric]) (simp_all add: sum_distrib_left)
   8.108    also have "(\<Sum>k=1..n. ln (1 + 1 / of_nat k) :: real) = ln (\<Prod>k=1..n. 1 + 1 / real_of_nat k)"
   8.109 -    by (subst ln_setprod [symmetric]) (auto intro!: add_pos_nonneg)
   8.110 +    by (subst ln_prod [symmetric]) (auto intro!: add_pos_nonneg)
   8.111    also have "(\<Prod>k=1..n. 1 + 1 / of_nat k :: real) = (\<Prod>k=1..n. (of_nat k + 1) / of_nat k)"
   8.112 -    by (intro setprod.cong) (simp_all add: divide_simps)
   8.113 +    by (intro prod.cong) (simp_all add: divide_simps)
   8.114    also have "(\<Prod>k=1..n. (of_nat k + 1) / of_nat k :: real) = of_nat n + 1"
   8.115 -    by (induction n) (simp_all add: setprod_nat_ivl_Suc' divide_simps)
   8.116 +    by (induction n) (simp_all add: prod_nat_ivl_Suc' divide_simps)
   8.117    finally show ?thesis ..
   8.118  qed
   8.119  
   8.120 @@ -2606,11 +2606,11 @@
   8.121      from n z' have "Gamma_series_euler' z n =
   8.122        exp (z * of_real (ln (of_nat n + 1))) / (z * (\<Prod>k=1..n. (1 + z / of_nat k)))"
   8.123        by (subst Gamma_euler'_aux1)
   8.124 -         (simp_all add: Gamma_series_euler'_def setprod.distrib
   8.125 -                        setprod_inversef[symmetric] divide_inverse)
   8.126 +         (simp_all add: Gamma_series_euler'_def prod.distrib
   8.127 +                        prod_inversef[symmetric] divide_inverse)
   8.128      also have "(\<Prod>k=1..n. (1 + z / of_nat k)) = pochhammer (z + 1) n / fact n"
   8.129 -      by (cases n) (simp_all add: pochhammer_setprod fact_setprod atLeastLessThanSuc_atLeastAtMost
   8.130 -        setprod_dividef [symmetric] field_simps setprod.atLeast_Suc_atMost_Suc_shift)
   8.131 +      by (cases n) (simp_all add: pochhammer_prod fact_prod atLeastLessThanSuc_atLeastAtMost
   8.132 +        prod_dividef [symmetric] field_simps prod.atLeast_Suc_atMost_Suc_shift)
   8.133      also have "z * \<dots> = pochhammer z (Suc n) / fact n" by (simp add: pochhammer_rec)
   8.134      finally show "?r n = Gamma_series_euler' z n / Gamma_series z n" by simp
   8.135    qed
   8.136 @@ -2681,7 +2681,7 @@
   8.137    case False
   8.138    have "rGamma_series_weierstrass z = (\<lambda>n. inverse (Gamma_series_weierstrass z n))"
   8.139      by (simp add: rGamma_series_weierstrass_def[abs_def] Gamma_series_weierstrass_def
   8.140 -                  exp_minus divide_inverse setprod_inversef[symmetric] mult_ac)
   8.141 +                  exp_minus divide_inverse prod_inversef[symmetric] mult_ac)
   8.142    also from False have "\<dots> \<longlonglongrightarrow> inverse (Gamma z)"
   8.143      by (intro tendsto_intros Gamma_weierstrass_complex) (simp add: Gamma_eq_zero_iff)
   8.144    finally show ?thesis by (simp add: Gamma_def)
   8.145 @@ -2865,7 +2865,7 @@
   8.146        also have "?A = (\<lambda>t. ?f t * ?g' t)" by (intro ext) (simp_all add: field_simps)
   8.147        also have "?B = - (of_nat (Suc n) * fact n / pochhammer z (n+2))"
   8.148          by (simp add: divide_simps pochhammer_rec
   8.149 -              setprod_shift_bounds_cl_Suc_ivl del: of_nat_Suc)
   8.150 +              prod_shift_bounds_cl_Suc_ivl del: of_nat_Suc)
   8.151        finally show "((\<lambda>t. ?f t * ?g' t) has_integral (?f 1 * ?g 1 - ?f 0 * ?g 0 - ?I)) {0..1}"
   8.152          by simp
   8.153      qed (simp_all add: bounded_bilinear_mult)
   8.154 @@ -3024,10 +3024,10 @@
   8.155      have "(- of_real pi * inverse z) * (?f z n * ?f (-z) n) =
   8.156                of_real pi * z * (\<Prod>k=1..n. (of_nat k - z) * (of_nat k + z) / of_nat k ^ 2)"
   8.157        by (simp add: rGamma_series_weierstrass_def mult_ac exp_minus
   8.158 -                    divide_simps setprod.distrib[symmetric] power2_eq_square)
   8.159 +                    divide_simps prod.distrib[symmetric] power2_eq_square)
   8.160      also have "(\<Prod>k=1..n. (of_nat k - z) * (of_nat k + z) / of_nat k ^ 2) =
   8.161                   (\<Prod>k=1..n. 1 - z^2 / of_nat k ^ 2)"
   8.162 -      by (intro setprod.cong) (simp_all add: power2_eq_square field_simps)
   8.163 +      by (intro prod.cong) (simp_all add: power2_eq_square field_simps)
   8.164      finally show "(- of_real pi * inverse z) * (?f z n * ?f (-z) n) = of_real pi * z * \<dots>"
   8.165        by (simp add: divide_simps)
   8.166    qed
   8.167 @@ -3058,10 +3058,10 @@
   8.168    from tendsto_inverse[OF tendsto_mult[OF 
   8.169           sin_product_formula_real[of "1/2"] tendsto_const[of "2/pi"]]]
   8.170      have "(\<lambda>n. (\<Prod>k=1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2))) \<longlonglongrightarrow> pi/2" 
   8.171 -    by (simp add: setprod_inversef [symmetric])
   8.172 +    by (simp add: prod_inversef [symmetric])
   8.173    also have "(\<lambda>n. (\<Prod>k=1..n. inverse (1 - (1 / 2)\<^sup>2 / (real k)\<^sup>2))) =
   8.174                 (\<lambda>n. (\<Prod>k=1..n. (4*real k^2)/(4*real k^2 - 1)))"
   8.175 -    by (intro ext setprod.cong refl) (simp add: divide_simps)
   8.176 +    by (intro ext prod.cong refl) (simp add: divide_simps)
   8.177    finally show ?thesis .
   8.178  qed
   8.179  
   8.180 @@ -3086,7 +3086,7 @@
   8.181      have "(\<lambda>n. P x n - P x (Suc n)) sums (P x 0 - sin (pi * x) / (pi * x))"
   8.182        unfolding P_def using x by (intro telescope_sums' sin_product_formula_real')
   8.183      also have "(\<lambda>n. P x n - P x (Suc n)) = (\<lambda>n. (x^2 / of_nat (Suc n)^2) * P x n)"
   8.184 -      unfolding P_def by (simp add: setprod_nat_ivl_Suc' algebra_simps)
   8.185 +      unfolding P_def by (simp add: prod_nat_ivl_Suc' algebra_simps)
   8.186      also have "P x 0 = 1" by (simp add: P_def)
   8.187      finally have "(\<lambda>n. x\<^sup>2 / (of_nat (Suc n))\<^sup>2 * P x n) sums (1 - sin (pi * x) / (pi * x))" .
   8.188      from sums_divide[OF this, of "x^2"] x show ?thesis unfolding g_def by simp
   8.189 @@ -3104,9 +3104,9 @@
   8.190          finally have "(1 - x^2 / of_nat k^2) \<in> {0..1}" using k
   8.191            by (simp_all add: field_simps del: of_nat_Suc)
   8.192        }
   8.193 -      hence "(\<Prod>k=1..n. abs (1 - x^2 / of_nat k^2)) \<le> (\<Prod>k=1..n. 1)" by (intro setprod_mono) simp
   8.194 +      hence "(\<Prod>k=1..n. abs (1 - x^2 / of_nat k^2)) \<le> (\<Prod>k=1..n. 1)" by (intro prod_mono) simp
   8.195        thus "norm (P x n / (of_nat (Suc n)^2)) \<le> 1 / of_nat (Suc n)^2"
   8.196 -        unfolding P_def by (simp add: field_simps abs_setprod del: of_nat_Suc)
   8.197 +        unfolding P_def by (simp add: field_simps abs_prod del: of_nat_Suc)
   8.198      qed (subst summable_Suc_iff, insert inverse_power_summable[of 2], simp add: inverse_eq_divide)
   8.199    qed (auto simp: P_def intro!: continuous_intros)
   8.200    hence "isCont f 0" by (subst (asm) continuous_on_eq_continuous_at) simp_all
     9.1 --- a/src/HOL/Analysis/Generalised_Binomial_Theorem.thy	Mon Oct 17 14:37:32 2016 +0200
     9.2 +++ b/src/HOL/Analysis/Generalised_Binomial_Theorem.thy	Mon Oct 17 17:33:07 2016 +0200
     9.3 @@ -31,9 +31,9 @@
     9.4      let ?P = "\<Prod>i=0..<n. a - of_nat i"
     9.5      from n have "(a gchoose n) / (a gchoose Suc n) = (of_nat (Suc n) :: 'a) *
     9.6                     (?P / (\<Prod>i=0..n. a - of_nat i))"
     9.7 -      by (simp add: gbinomial_setprod_rev atLeastLessThanSuc_atLeastAtMost)
     9.8 +      by (simp add: gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
     9.9      also from q have "(\<Prod>i=0..n. a - of_nat i) = ?P * (a - of_nat n)"
    9.10 -      by (simp add: setprod.atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
    9.11 +      by (simp add: prod.atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
    9.12      also have "?P / \<dots> = (?P / ?P) / (a - of_nat n)" by (rule divide_divide_eq_left[symmetric])
    9.13      also from assms have "?P / ?P = 1" by auto
    9.14      also have "of_nat (Suc n) * (1 / (a - of_nat n)) =
    9.15 @@ -210,7 +210,7 @@
    9.16    also have "(of_real (1 + z) :: complex) powr (of_real a) = of_real ((1 + z) powr a)"
    9.17      using assms by (subst powr_of_real) simp_all
    9.18    also have "(of_real a gchoose n :: complex) = of_real (a gchoose n)" for n
    9.19 -    by (simp add: gbinomial_setprod_rev)
    9.20 +    by (simp add: gbinomial_prod_rev)
    9.21    hence "(\<lambda>n. (of_real a gchoose n :: complex) * of_real z ^ n) =
    9.22             (\<lambda>n. of_real ((a gchoose n) * z ^ n))" by (intro ext) simp
    9.23    finally show ?thesis by (simp only: sums_of_real_iff)
    10.1 --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy	Mon Oct 17 14:37:32 2016 +0200
    10.2 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy	Mon Oct 17 17:33:07 2016 +0200
    10.3 @@ -56,7 +56,7 @@
    10.4    where "content s \<equiv> measure lborel s"
    10.5  
    10.6  lemma content_cbox_cases:
    10.7 -  "content (cbox a b) = (if \<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i then setprod (\<lambda>i. b\<bullet>i - a\<bullet>i) Basis else 0)"
    10.8 +  "content (cbox a b) = (if \<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i then prod (\<lambda>i. b\<bullet>i - a\<bullet>i) Basis else 0)"
    10.9    by (simp add: measure_lborel_cbox_eq inner_diff)
   10.10  
   10.11  lemma content_cbox: "\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i \<Longrightarrow> content (cbox a b) = (\<Prod>i\<in>Basis. b\<bullet>i - a\<bullet>i)"
   10.12 @@ -84,7 +84,7 @@
   10.13    using not_le by blast
   10.14  
   10.15  lemma content_pos_lt: "\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i \<Longrightarrow> 0 < content (cbox a b)"
   10.16 -  by (auto simp: less_imp_le inner_diff box_eq_empty intro!: setprod_pos)
   10.17 +  by (auto simp: less_imp_le inner_diff box_eq_empty intro!: prod_pos)
   10.18  
   10.19  lemma content_eq_0: "content (cbox a b) = 0 \<longleftrightarrow> (\<exists>i\<in>Basis. b\<bullet>i \<le> a\<bullet>i)"
   10.20    by (auto simp: content_cbox_cases not_le intro: less_imp_le antisym eq_refl)
   10.21 @@ -93,7 +93,7 @@
   10.22    unfolding content_eq_0 interior_cbox box_eq_empty by auto
   10.23  
   10.24  lemma content_pos_lt_eq: "0 < content (cbox a (b::'a::euclidean_space)) \<longleftrightarrow> (\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i)"
   10.25 -  by (auto simp add: content_cbox_cases less_le setprod_nonneg)
   10.26 +  by (auto simp add: content_cbox_cases less_le prod_nonneg)
   10.27  
   10.28  lemma content_empty [simp]: "content {} = 0"
   10.29    by simp
   10.30 @@ -110,9 +110,9 @@
   10.31  
   10.32  lemma content_Pair: "content (cbox (a,c) (b,d)) = content (cbox a b) * content (cbox c d)"
   10.33    unfolding measure_lborel_cbox_eq Basis_prod_def
   10.34 -  apply (subst setprod.union_disjoint)
   10.35 +  apply (subst prod.union_disjoint)
   10.36    apply (auto simp: bex_Un ball_Un)
   10.37 -  apply (subst (1 2) setprod.reindex_nontrivial)
   10.38 +  apply (subst (1 2) prod.reindex_nontrivial)
   10.39    apply auto
   10.40    done
   10.41  
   10.42 @@ -138,7 +138,7 @@
   10.43      apply (subst *(1))
   10.44      defer
   10.45      apply (subst *(1))
   10.46 -    unfolding setprod.insert[OF *(2-)]
   10.47 +    unfolding prod.insert[OF *(2-)]
   10.48      apply auto
   10.49      done
   10.50    assume as: "\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i"
   10.51 @@ -151,7 +151,7 @@
   10.52        (\<Prod>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) - a \<bullet> i)"
   10.53      "(\<Prod>i\<in>Basis. b \<bullet> i - ((\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) \<bullet> i)) =
   10.54        (\<Prod>i\<in>Basis. b \<bullet> i - (if i = k then max (a \<bullet> k) c else a \<bullet> i))"
   10.55 -    by (auto intro!: setprod.cong)
   10.56 +    by (auto intro!: prod.cong)
   10.57    have "\<not> a \<bullet> k \<le> c \<Longrightarrow> \<not> c \<le> b \<bullet> k \<Longrightarrow> False"
   10.58      unfolding not_le
   10.59      using as[unfolded ,rule_format,of k] assms
   10.60 @@ -1876,7 +1876,7 @@
   10.61      by (auto simp: b'_def a'_def intro!: tendsto_min tendsto_max tendsto_eq_intros)
   10.62    also have "(\<Prod>j\<in>Basis. (b' 0 - a' 0) \<bullet> j) = 0"
   10.63      using k *
   10.64 -    by (intro setprod_zero bexI[OF _ k])
   10.65 +    by (intro prod_zero bexI[OF _ k])
   10.66         (auto simp: b'_def a'_def inner_diff inner_sum_left inner_not_same_Basis intro!: sum.cong)
   10.67    also have "((\<lambda>d. \<Prod>j\<in>Basis. (b' d - a' d) \<bullet> j) \<longlongrightarrow> 0) (at_right 0) =
   10.68      ((\<lambda>d. content (cbox a b \<inter> {x. \<bar>x\<bullet>k - c\<bar> \<le> d})) \<longlongrightarrow> 0) (at_right 0)"
   10.69 @@ -3472,7 +3472,7 @@
   10.70    also have "\<dots> = (\<Prod>j\<in>Basis. emeasure lborel (if j = k then {c} else UNIV))"
   10.71      by (intro measure_times) auto
   10.72    also have "\<dots> = 0"
   10.73 -    by (intro setprod_zero bexI[OF _ k]) auto
   10.74 +    by (intro prod_zero bexI[OF _ k]) auto
   10.75    finally show ?thesis
   10.76      by (subst AE_iff_measurable[OF _ refl]) auto
   10.77  qed
   10.78 @@ -3494,13 +3494,13 @@
   10.79    show ?thesis
   10.80      using m unfolding eq measure_def
   10.81      by (subst lborel_affine_euclidean[where c=m and t=0])
   10.82 -       (simp_all add: emeasure_density measurable_sets_borel[OF s] abs_setprod nn_integral_cmult
   10.83 -                      s_def[symmetric] emeasure_distr vimage_comp s_comp_s enn2real_mult setprod_nonneg)
   10.84 +       (simp_all add: emeasure_density measurable_sets_borel[OF s] abs_prod nn_integral_cmult
   10.85 +                      s_def[symmetric] emeasure_distr vimage_comp s_comp_s enn2real_mult prod_nonneg)
   10.86  next
   10.87    assume "\<not> (\<forall>k\<in>Basis. m k \<noteq> 0)"
   10.88    then obtain k where k: "k \<in> Basis" "m k = 0" by auto
   10.89    then have [simp]: "(\<Prod>k\<in>Basis. m k) = 0"
   10.90 -    by (intro setprod_zero) auto
   10.91 +    by (intro prod_zero) auto
   10.92    have "emeasure lborel {x\<in>space lborel. x \<in> s m ` cbox a b} = 0"
   10.93    proof (rule emeasure_eq_0_AE)
   10.94      show "AE x in lborel. x \<notin> s m ` cbox a b"
   10.95 @@ -3539,7 +3539,7 @@
   10.96        by (simp add: inner_simps field_simps)
   10.97      ultimately show ?thesis
   10.98        by (simp add: image_affinity_cbox True content_cbox'
   10.99 -        setprod.distrib setprod_constant inner_diff_left)
  10.100 +        prod.distrib prod_constant inner_diff_left)
  10.101    next
  10.102      case False
  10.103      with \<open>cbox a b \<noteq> {}\<close> have "cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c) \<noteq> {}"
  10.104 @@ -3552,7 +3552,7 @@
  10.105        by (simp add: inner_simps field_simps)
  10.106      ultimately show ?thesis using False
  10.107        by (simp add: image_affinity_cbox content_cbox'
  10.108 -        setprod.distrib[symmetric] setprod_constant[symmetric] inner_diff_left)
  10.109 +        prod.distrib[symmetric] prod_constant[symmetric] inner_diff_left)
  10.110    qed
  10.111  qed
  10.112  
  10.113 @@ -3589,7 +3589,7 @@
  10.114    assumes "(f has_integral i) (cbox a b)"
  10.115      and "\<forall>k\<in>Basis. m k \<noteq> 0"
  10.116    shows "((\<lambda>x. f (\<Sum>k\<in>Basis. (m k * (x\<bullet>k))*\<^sub>R k)) has_integral
  10.117 -         ((1/ \<bar>setprod m Basis\<bar>) *\<^sub>R i)) ((\<lambda>x. (\<Sum>k\<in>Basis. (1 / m k * (x\<bullet>k))*\<^sub>R k)) ` cbox a b)"
  10.118 +         ((1/ \<bar>prod m Basis\<bar>) *\<^sub>R i)) ((\<lambda>x. (\<Sum>k\<in>Basis. (1 / m k * (x\<bullet>k))*\<^sub>R k)) ` cbox a b)"
  10.119  apply (rule has_integral_twiddle[where f=f])
  10.120  unfolding zero_less_abs_iff content_image_stretch_interval
  10.121  unfolding image_stretch_interval empty_as_interval euclidean_eq_iff[where 'a='a]
  10.122 @@ -7371,7 +7371,8 @@
  10.123  subsection \<open>Integration by parts\<close>
  10.124  
  10.125  lemma integration_by_parts_interior_strong:
  10.126 -  assumes bilinear: "bounded_bilinear (prod :: _ \<Rightarrow> _ \<Rightarrow> 'b :: banach)"
  10.127 +  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  10.128 +  assumes bilinear: "bounded_bilinear (prod)"
  10.129    assumes s: "finite s" and le: "a \<le> b"
  10.130    assumes cont [continuous_intros]: "continuous_on {a..b} f" "continuous_on {a..b} g"
  10.131    assumes deriv: "\<And>x. x\<in>{a<..<b} - s \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
  10.132 @@ -7389,7 +7390,8 @@
  10.133  qed
  10.134  
  10.135  lemma integration_by_parts_interior:
  10.136 -  assumes "bounded_bilinear (prod :: _ \<Rightarrow> _ \<Rightarrow> 'b :: banach)" "a \<le> b"
  10.137 +  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  10.138 +  assumes "bounded_bilinear (prod)" "a \<le> b"
  10.139            "continuous_on {a..b} f" "continuous_on {a..b} g"
  10.140    assumes "\<And>x. x\<in>{a<..<b} \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
  10.141            "\<And>x. x\<in>{a<..<b} \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
  10.142 @@ -7398,7 +7400,8 @@
  10.143    by (rule integration_by_parts_interior_strong[of _ "{}" _ _ f g f' g']) (insert assms, simp_all)
  10.144  
  10.145  lemma integration_by_parts:
  10.146 -  assumes "bounded_bilinear (prod :: _ \<Rightarrow> _ \<Rightarrow> 'b :: banach)" "a \<le> b"
  10.147 +  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  10.148 +  assumes "bounded_bilinear (prod)" "a \<le> b"
  10.149            "continuous_on {a..b} f" "continuous_on {a..b} g"
  10.150    assumes "\<And>x. x\<in>{a..b} \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
  10.151            "\<And>x. x\<in>{a..b} \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
  10.152 @@ -7407,7 +7410,8 @@
  10.153    by (rule integration_by_parts_interior[of _ _ _ f g f' g']) (insert assms, simp_all)
  10.154  
  10.155  lemma integrable_by_parts_interior_strong:
  10.156 -  assumes bilinear: "bounded_bilinear (prod :: _ \<Rightarrow> _ \<Rightarrow> 'b :: banach)"
  10.157 +  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  10.158 +  assumes bilinear: "bounded_bilinear (prod)"
  10.159    assumes s: "finite s" and le: "a \<le> b"
  10.160    assumes cont [continuous_intros]: "continuous_on {a..b} f" "continuous_on {a..b} g"
  10.161    assumes deriv: "\<And>x. x\<in>{a<..<b} - s \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
  10.162 @@ -7424,7 +7428,8 @@
  10.163  qed
  10.164  
  10.165  lemma integrable_by_parts_interior:
  10.166 -  assumes "bounded_bilinear (prod :: _ \<Rightarrow> _ \<Rightarrow> 'b :: banach)" "a \<le> b"
  10.167 +  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  10.168 +  assumes "bounded_bilinear (prod)" "a \<le> b"
  10.169            "continuous_on {a..b} f" "continuous_on {a..b} g"
  10.170    assumes "\<And>x. x\<in>{a<..<b} \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
  10.171            "\<And>x. x\<in>{a<..<b} \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
  10.172 @@ -7433,7 +7438,8 @@
  10.173    by (rule integrable_by_parts_interior_strong[of _ "{}" _ _ f g f' g']) (insert assms, simp_all)
  10.174  
  10.175  lemma integrable_by_parts:
  10.176 -  assumes "bounded_bilinear (prod :: _ \<Rightarrow> _ \<Rightarrow> 'b :: banach)" "a \<le> b"
  10.177 +  fixes prod :: "_ \<Rightarrow> _ \<Rightarrow> 'b :: banach"
  10.178 +  assumes "bounded_bilinear (prod)" "a \<le> b"
  10.179            "continuous_on {a..b} f" "continuous_on {a..b} g"
  10.180    assumes "\<And>x. x\<in>{a..b} \<Longrightarrow> (f has_vector_derivative f' x) (at x)"
  10.181            "\<And>x. x\<in>{a..b} \<Longrightarrow> (g has_vector_derivative g' x) (at x)"
    11.1 --- a/src/HOL/Analysis/Lebesgue_Measure.thy	Mon Oct 17 14:37:32 2016 +0200
    11.2 +++ b/src/HOL/Analysis/Lebesgue_Measure.thy	Mon Oct 17 17:33:07 2016 +0200
    11.3 @@ -404,11 +404,11 @@
    11.4  lemma lborel_eq: "lborel = distr (\<Pi>\<^sub>M b\<in>Basis. lborel) borel (\<lambda>f. \<Sum>b\<in>Basis. f b *\<^sub>R b)"
    11.5    by (subst lborel_def) (simp add: lborel_eq_real)
    11.6  
    11.7 -lemma nn_integral_lborel_setprod:
    11.8 +lemma nn_integral_lborel_prod:
    11.9    assumes [measurable]: "\<And>b. b \<in> Basis \<Longrightarrow> f b \<in> borel_measurable borel"
   11.10    assumes nn[simp]: "\<And>b x. b \<in> Basis \<Longrightarrow> 0 \<le> f b x"
   11.11    shows "(\<integral>\<^sup>+x. (\<Prod>b\<in>Basis. f b (x \<bullet> b)) \<partial>lborel) = (\<Prod>b\<in>Basis. (\<integral>\<^sup>+x. f b x \<partial>lborel))"
   11.12 -  by (simp add: lborel_def nn_integral_distr product_nn_integral_setprod
   11.13 +  by (simp add: lborel_def nn_integral_distr product_nn_integral_prod
   11.14                  product_nn_integral_singleton)
   11.15  
   11.16  lemma emeasure_lborel_Icc[simp]:
   11.17 @@ -434,13 +434,13 @@
   11.18    then have "emeasure lborel (cbox l u) = (\<integral>\<^sup>+x. (\<Prod>b\<in>Basis. indicator {l\<bullet>b .. u\<bullet>b} (x \<bullet> b)) \<partial>lborel)"
   11.19      by simp
   11.20    also have "\<dots> = (\<Prod>b\<in>Basis. (u - l) \<bullet> b)"
   11.21 -    by (subst nn_integral_lborel_setprod) (simp_all add: setprod_ennreal inner_diff_left)
   11.22 +    by (subst nn_integral_lborel_prod) (simp_all add: prod_ennreal inner_diff_left)
   11.23    finally show ?thesis .
   11.24  qed
   11.25  
   11.26  lemma AE_lborel_singleton: "AE x in lborel::'a::euclidean_space measure. x \<noteq> c"
   11.27    using SOME_Basis AE_discrete_difference [of "{c}" lborel] emeasure_lborel_cbox [of c c]
   11.28 -  by (auto simp add: cbox_sing setprod_constant power_0_left)
   11.29 +  by (auto simp add: cbox_sing prod_constant power_0_left)
   11.30  
   11.31  lemma emeasure_lborel_Ioo[simp]:
   11.32    assumes [simp]: "l \<le> u"
   11.33 @@ -481,7 +481,7 @@
   11.34    then have "emeasure lborel (box l u) = (\<integral>\<^sup>+x. (\<Prod>b\<in>Basis. indicator {l\<bullet>b <..< u\<bullet>b} (x \<bullet> b)) \<partial>lborel)"
   11.35      by simp
   11.36    also have "\<dots> = (\<Prod>b\<in>Basis. (u - l) \<bullet> b)"
   11.37 -    by (subst nn_integral_lborel_setprod) (simp_all add: setprod_ennreal inner_diff_left)
   11.38 +    by (subst nn_integral_lborel_prod) (simp_all add: prod_ennreal inner_diff_left)
   11.39    finally show ?thesis .
   11.40  qed
   11.41  
   11.42 @@ -495,7 +495,7 @@
   11.43  
   11.44  lemma emeasure_lborel_singleton[simp]: "emeasure lborel {x} = 0"
   11.45    using emeasure_lborel_cbox[of x x] nonempty_Basis
   11.46 -  by (auto simp del: emeasure_lborel_cbox nonempty_Basis simp add: cbox_sing setprod_constant)
   11.47 +  by (auto simp del: emeasure_lborel_cbox nonempty_Basis simp add: cbox_sing prod_constant)
   11.48  
   11.49  lemma
   11.50    fixes l u :: real
   11.51 @@ -510,7 +510,7 @@
   11.52    assumes [simp]: "\<And>b. b \<in> Basis \<Longrightarrow> l \<bullet> b \<le> u \<bullet> b"
   11.53    shows measure_lborel_box[simp]: "measure lborel (box l u) = (\<Prod>b\<in>Basis. (u - l) \<bullet> b)"
   11.54      and measure_lborel_cbox[simp]: "measure lborel (cbox l u) = (\<Prod>b\<in>Basis. (u - l) \<bullet> b)"
   11.55 -  by (simp_all add: measure_def inner_diff_left setprod_nonneg)
   11.56 +  by (simp_all add: measure_def inner_diff_left prod_nonneg)
   11.57  
   11.58  lemma measure_lborel_cbox_eq:
   11.59    "measure lborel (cbox l u) = (if \<forall>b\<in>Basis. l \<bullet> b \<le> u \<bullet> b then \<Prod>b\<in>Basis. (u - l) \<bullet> b else 0)"
   11.60 @@ -549,7 +549,7 @@
   11.61    show ?thesis
   11.62      unfolding UN_box_eq_UNIV[symmetric]
   11.63      apply (subst SUP_emeasure_incseq[symmetric])
   11.64 -    apply (auto simp: incseq_def subset_box inner_add_left setprod_constant
   11.65 +    apply (auto simp: incseq_def subset_box inner_add_left prod_constant
   11.66        simp del: Sup_eq_top_iff SUP_eq_top_iff
   11.67        intro!: ennreal_SUP_eq_top)
   11.68      done
   11.69 @@ -629,15 +629,15 @@
   11.70      using c by (auto simp: box_def T_def field_simps inner_simps divide_less_eq)
   11.71    with le c show "emeasure ?D (box l u) = (\<Prod>b\<in>?B. (u - l) \<bullet> b)"
   11.72      by (auto simp: emeasure_density emeasure_distr nn_integral_multc emeasure_lborel_box_eq inner_simps
   11.73 -                   field_simps divide_simps ennreal_mult'[symmetric] setprod_nonneg setprod.distrib[symmetric]
   11.74 -             intro!: setprod.cong)
   11.75 +                   field_simps divide_simps ennreal_mult'[symmetric] prod_nonneg prod.distrib[symmetric]
   11.76 +             intro!: prod.cong)
   11.77  qed simp
   11.78  
   11.79  lemma lborel_affine:
   11.80    fixes t :: "'a::euclidean_space"
   11.81    shows "c \<noteq> 0 \<Longrightarrow> lborel = density (distr lborel borel (\<lambda>x. t + c *\<^sub>R x)) (\<lambda>_. \<bar>c\<bar>^DIM('a))"
   11.82    using lborel_affine_euclidean[where c="\<lambda>_::'a. c" and t=t]
   11.83 -  unfolding scaleR_scaleR[symmetric] scaleR_sum_right[symmetric] euclidean_representation setprod_constant by simp
   11.84 +  unfolding scaleR_scaleR[symmetric] scaleR_sum_right[symmetric] euclidean_representation prod_constant by simp
   11.85  
   11.86  lemma lborel_real_affine:
   11.87    "c \<noteq> 0 \<Longrightarrow> lborel = density (distr lborel borel (\<lambda>x. t + c * x)) (\<lambda>_. ennreal (abs c))"
   11.88 @@ -696,7 +696,7 @@
   11.89      then have "emeasure lborel A = 0 \<longleftrightarrow> emeasure (density (distr lborel borel T) (\<lambda>_. (\<Prod>j\<in>Basis. \<bar>c j\<bar>))) A = 0"
   11.90        unfolding T_def using c by (subst lborel_affine_euclidean[symmetric]) auto
   11.91      also have "\<dots> \<longleftrightarrow> emeasure (distr lebesgue lborel T) A = 0"
   11.92 -      using A c by (simp add: distr_completion emeasure_density nn_integral_cmult setprod_nonneg cong: distr_cong)
   11.93 +      using A c by (simp add: distr_completion emeasure_density nn_integral_cmult prod_nonneg cong: distr_cong)
   11.94      finally have "emeasure lborel A = 0 \<longleftrightarrow> emeasure (distr lebesgue lborel T) A = 0" . }
   11.95    then have eq: "null_sets lborel = null_sets (distr lebesgue lborel T)"
   11.96      by (auto simp: null_sets_def)
   11.97 @@ -707,7 +707,7 @@
   11.98    have "lebesgue = completion (density (distr lborel borel T) (\<lambda>_. (\<Prod>j\<in>Basis. \<bar>c j\<bar>)))"
   11.99      using c by (subst lborel_affine_euclidean[of c t]) (simp_all add: T_def[abs_def])
  11.100    also have "\<dots> = density (completion (distr lebesgue lborel T)) (\<lambda>_. (\<Prod>j\<in>Basis. \<bar>c j\<bar>))"
  11.101 -    using c by (auto intro!: always_eventually setprod_pos completion_density_eq simp: distr_completion cong: distr_cong)
  11.102 +    using c by (auto intro!: always_eventually prod_pos completion_density_eq simp: distr_completion cong: distr_cong)
  11.103    also have "\<dots> = density (distr lebesgue lebesgue T) (\<lambda>_. (\<Prod>j\<in>Basis. \<bar>c j\<bar>))"
  11.104      by (subst completion.completion_distr_eq) (auto simp: eq measurable_completion)
  11.105    finally show "lebesgue = density (distr lebesgue lebesgue T) (\<lambda>_. (\<Prod>j\<in>Basis. \<bar>c j\<bar>))" .
  11.106 @@ -761,7 +761,7 @@
  11.107          apply (subst lebesgue_affine_euclidean[of "\<lambda>_. m" \<delta>])
  11.108          apply (simp_all add: emeasure_density trans_eq_T nn_integral_cmult emeasure_distr
  11.109                          del: space_completion emeasure_completion)
  11.110 -        apply (simp add: vimage_comp s_comp_s setprod_constant)
  11.111 +        apply (simp add: vimage_comp s_comp_s prod_constant)
  11.112          done
  11.113      next
  11.114        assume "S \<notin> sets lebesgue"
  11.115 @@ -779,7 +779,7 @@
  11.116      qed
  11.117    qed
  11.118    show ?m
  11.119 -    unfolding measure_def \<open>?e\<close> by (simp add: enn2real_mult setprod_nonneg)
  11.120 +    unfolding measure_def \<open>?e\<close> by (simp add: enn2real_mult prod_nonneg)
  11.121  qed
  11.122  
  11.123  lemma divideR_right:
  11.124 @@ -843,9 +843,9 @@
  11.125      "box (la, lb) (ua, ub) = box la ua \<times> box lb ub"
  11.126      using lu[of _ 0] lu[of 0] by (auto intro!: inj_onI simp add: Basis_prod_def ball_Un box_def)
  11.127    show "emeasure (lborel \<Otimes>\<^sub>M lborel) (box (la, lb) (ua, ub)) =
  11.128 -      ennreal (setprod (op \<bullet> ((ua, ub) - (la, lb))) Basis)"
  11.129 -    by (simp add: lborel.emeasure_pair_measure_Times Basis_prod_def setprod.union_disjoint
  11.130 -                  setprod.reindex ennreal_mult inner_diff_left setprod_nonneg)
  11.131 +      ennreal (prod (op \<bullet> ((ua, ub) - (la, lb))) Basis)"
  11.132 +    by (simp add: lborel.emeasure_pair_measure_Times Basis_prod_def prod.union_disjoint
  11.133 +                  prod.reindex ennreal_mult inner_diff_left prod_nonneg)
  11.134  qed (simp add: borel_prod[symmetric])
  11.135  
  11.136  (* FIXME: conversion in measurable prover *)
  11.137 @@ -860,7 +860,7 @@
  11.138    then have "emeasure lborel A \<le> emeasure lborel (cbox a b)"
  11.139      by (intro emeasure_mono) auto
  11.140    then show ?thesis
  11.141 -    by (auto simp: emeasure_lborel_cbox_eq setprod_nonneg less_top[symmetric] top_unique split: if_split_asm)
  11.142 +    by (auto simp: emeasure_lborel_cbox_eq prod_nonneg less_top[symmetric] top_unique split: if_split_asm)
  11.143  qed
  11.144  
  11.145  lemma emeasure_compact_finite: "compact A \<Longrightarrow> emeasure lborel A < \<infinity>"
    12.1 --- a/src/HOL/Analysis/Weierstrass_Theorems.thy	Mon Oct 17 14:37:32 2016 +0200
    12.2 +++ b/src/HOL/Analysis/Weierstrass_Theorems.thy	Mon Oct 17 17:33:07 2016 +0200
    12.3 @@ -192,7 +192,7 @@
    12.4    lemma sum: "\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> f i \<in> R\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Sum>i \<in> I. f i x) \<in> R"
    12.5      by (induct I rule: finite_induct; simp add: const add)
    12.6  
    12.7 -  lemma setprod: "\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> f i \<in> R\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Prod>i \<in> I. f i x) \<in> R"
    12.8 +  lemma prod: "\<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> f i \<in> R\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Prod>i \<in> I. f i x) \<in> R"
    12.9      by (induct I rule: finite_induct; simp add: const mult)
   12.10  
   12.11    definition normf :: "('a::t2_space \<Rightarrow> real) \<Rightarrow> real"
   12.12 @@ -467,19 +467,19 @@
   12.13      by metis
   12.14    define pff where [abs_def]: "pff x = (\<Prod>w \<in> subA. ff w x)" for x
   12.15    have pffR: "pff \<in> R"
   12.16 -    unfolding pff_def using subA ff by (auto simp: intro: setprod)
   12.17 +    unfolding pff_def using subA ff by (auto simp: intro: prod)
   12.18    moreover
   12.19    have pff01: "pff x \<in> {0..1}" if t: "x \<in> S" for x
   12.20    proof -
   12.21      have "0 \<le> pff x"
   12.22        using subA cardp t
   12.23        apply (simp add: pff_def divide_simps sum_nonneg)
   12.24 -      apply (rule Groups_Big.linordered_semidom_class.setprod_nonneg)
   12.25 +      apply (rule Groups_Big.linordered_semidom_class.prod_nonneg)
   12.26        using ff by fastforce
   12.27      moreover have "pff x \<le> 1"
   12.28        using subA cardp t
   12.29        apply (simp add: pff_def divide_simps sum_nonneg)
   12.30 -      apply (rule setprod_mono [where g = "\<lambda>x. 1", simplified])
   12.31 +      apply (rule prod_mono [where g = "\<lambda>x. 1", simplified])
   12.32        using ff by fastforce
   12.33      ultimately show ?thesis
   12.34        by auto
   12.35 @@ -488,10 +488,10 @@
   12.36    { fix v x
   12.37      assume v: "v \<in> subA" and x: "x \<in> Vf v" "x \<in> S"
   12.38      from subA v have "pff x = ff v x * (\<Prod>w \<in> subA - {v}. ff w x)"
   12.39 -      unfolding pff_def  by (metis setprod.remove)
   12.40 +      unfolding pff_def  by (metis prod.remove)
   12.41      also have "... \<le> ff v x * 1"
   12.42        apply (rule Rings.ordered_semiring_class.mult_left_mono)
   12.43 -      apply (rule setprod_mono [where g = "\<lambda>x. 1", simplified])
   12.44 +      apply (rule prod_mono [where g = "\<lambda>x. 1", simplified])
   12.45        using ff [THEN conjunct2, THEN conjunct1] v subA x
   12.46        apply auto
   12.47        apply (meson atLeastAtMost_iff contra_subsetD imageI)
   12.48 @@ -515,10 +515,10 @@
   12.49        using Bernoulli_inequality [of "-e / card subA" "card subA"] e cardp
   12.50        by (auto simp: field_simps)
   12.51      also have "... = (\<Prod>w \<in> subA. 1 - e / card subA)"
   12.52 -      by (simp add: setprod_constant subA(2))
   12.53 +      by (simp add: prod_constant subA(2))
   12.54      also have "... < pff x"
   12.55        apply (simp add: pff_def)
   12.56 -      apply (rule setprod_mono_strict [where f = "\<lambda>x. 1 - e / card subA", simplified])
   12.57 +      apply (rule prod_mono_strict [where f = "\<lambda>x. 1 - e / card subA", simplified])
   12.58        apply (simp_all add: subA(2))
   12.59        apply (intro ballI conjI)
   12.60        using e apply (force simp: divide_simps)
    13.1 --- a/src/HOL/Analysis/ex/Approximations.thy	Mon Oct 17 14:37:32 2016 +0200
    13.2 +++ b/src/HOL/Analysis/ex/Approximations.thy	Mon Oct 17 17:33:07 2016 +0200
    13.3 @@ -185,12 +185,12 @@
    13.4    also have "\<dots> = (\<Sum>k\<le>n. 1 / fact k)"
    13.5    proof (intro sum.cong refl)
    13.6      fix k assume k: "k \<in> {..n}"
    13.7 -    have "fact n = (\<Prod>i=1..n. real i)" by (simp add: fact_setprod)
    13.8 +    have "fact n = (\<Prod>i=1..n. real i)" by (simp add: fact_prod)
    13.9      also from k have "{1..n} = {1..k} \<union> {k+1..n}" by auto
   13.10 -    also have "setprod real \<dots> / (\<Prod>i=k+1..n. real i) = (\<Prod>i=1..k. real i)"
   13.11 -      by (subst nonzero_divide_eq_eq, simp, subst setprod.union_disjoint [symmetric]) auto
   13.12 -    also have "\<dots> = fact k" by (simp add: fact_setprod)
   13.13 -    finally show "1 / (fact n / setprod real {k + 1..n}) = 1 / fact k" by simp
   13.14 +    also have "prod real \<dots> / (\<Prod>i=k+1..n. real i) = (\<Prod>i=1..k. real i)"
   13.15 +      by (subst nonzero_divide_eq_eq, simp, subst prod.union_disjoint [symmetric]) auto
   13.16 +    also have "\<dots> = fact k" by (simp add: fact_prod)
   13.17 +    finally show "1 / (fact n / prod real {k + 1..n}) = 1 / fact k" by simp
   13.18    qed
   13.19    also have "\<dots> = euler_approx n" by (simp add: euler_approx_def field_simps)
   13.20    finally show ?thesis by (simp add: euler_approx_aux_def)
    14.1 --- a/src/HOL/Binomial.thy	Mon Oct 17 14:37:32 2016 +0200
    14.2 +++ b/src/HOL/Binomial.thy	Mon Oct 17 17:33:07 2016 +0200
    14.3 @@ -18,45 +18,45 @@
    14.4  begin
    14.5  
    14.6  definition fact :: "nat \<Rightarrow> 'a"
    14.7 -  where fact_setprod: "fact n = of_nat (\<Prod>{1..n})"
    14.8 +  where fact_prod: "fact n = of_nat (\<Prod>{1..n})"
    14.9  
   14.10 -lemma fact_setprod_Suc: "fact n = of_nat (setprod Suc {0..<n})"
   14.11 +lemma fact_prod_Suc: "fact n = of_nat (prod Suc {0..<n})"
   14.12    by (cases n)
   14.13 -    (simp_all add: fact_setprod setprod.atLeast_Suc_atMost_Suc_shift
   14.14 +    (simp_all add: fact_prod prod.atLeast_Suc_atMost_Suc_shift
   14.15        atLeastLessThanSuc_atLeastAtMost)
   14.16  
   14.17 -lemma fact_setprod_rev: "fact n = of_nat (\<Prod>i = 0..<n. n - i)"
   14.18 -  using setprod.atLeast_atMost_rev [of "\<lambda>i. i" 1 n]
   14.19 +lemma fact_prod_rev: "fact n = of_nat (\<Prod>i = 0..<n. n - i)"
   14.20 +  using prod.atLeast_atMost_rev [of "\<lambda>i. i" 1 n]
   14.21    by (cases n)
   14.22 -    (simp_all add: fact_setprod_Suc setprod.atLeast_Suc_atMost_Suc_shift
   14.23 +    (simp_all add: fact_prod_Suc prod.atLeast_Suc_atMost_Suc_shift
   14.24        atLeastLessThanSuc_atLeastAtMost)
   14.25  
   14.26  lemma fact_0 [simp]: "fact 0 = 1"
   14.27 -  by (simp add: fact_setprod)
   14.28 +  by (simp add: fact_prod)
   14.29  
   14.30  lemma fact_1 [simp]: "fact 1 = 1"
   14.31 -  by (simp add: fact_setprod)
   14.32 +  by (simp add: fact_prod)
   14.33  
   14.34  lemma fact_Suc_0 [simp]: "fact (Suc 0) = 1"
   14.35 -  by (simp add: fact_setprod)
   14.36 +  by (simp add: fact_prod)
   14.37  
   14.38  lemma fact_Suc [simp]: "fact (Suc n) = of_nat (Suc n) * fact n"
   14.39 -  by (simp add: fact_setprod atLeastAtMostSuc_conv algebra_simps)
   14.40 +  by (simp add: fact_prod atLeastAtMostSuc_conv algebra_simps)
   14.41  
   14.42  lemma fact_2 [simp]: "fact 2 = 2"
   14.43    by (simp add: numeral_2_eq_2)
   14.44  
   14.45 -lemma fact_split: "k \<le> n \<Longrightarrow> fact n = of_nat (setprod Suc {n - k..<n}) * fact (n - k)"
   14.46 -  by (simp add: fact_setprod_Suc setprod.union_disjoint [symmetric]
   14.47 +lemma fact_split: "k \<le> n \<Longrightarrow> fact n = of_nat (prod Suc {n - k..<n}) * fact (n - k)"
   14.48 +  by (simp add: fact_prod_Suc prod.union_disjoint [symmetric]
   14.49      ivl_disj_un ac_simps of_nat_mult [symmetric])
   14.50  
   14.51  end
   14.52  
   14.53  lemma of_nat_fact [simp]: "of_nat (fact n) = fact n"
   14.54 -  by (simp add: fact_setprod)
   14.55 +  by (simp add: fact_prod)
   14.56  
   14.57  lemma of_int_fact [simp]: "of_int (fact n) = fact n"
   14.58 -  by (simp only: fact_setprod of_int_of_nat_eq)
   14.59 +  by (simp only: fact_prod of_int_of_nat_eq)
   14.60  
   14.61  lemma fact_reduce: "n > 0 \<Longrightarrow> fact n = of_nat n * fact (n - 1)"
   14.62    by (cases n) auto
   14.63 @@ -170,7 +170,7 @@
   14.64    shows "fact n div fact (n - r) \<le> n ^ r"
   14.65  proof -
   14.66    have "r \<le> n \<Longrightarrow> \<Prod>{n - r..n} = (n - r) * \<Prod>{Suc (n - r)..n}" for r
   14.67 -    by (subst setprod.insert[symmetric]) (auto simp: atLeastAtMost_insertL)
   14.68 +    by (subst prod.insert[symmetric]) (auto simp: atLeastAtMost_insertL)
   14.69    with assms show ?thesis
   14.70      by (induct r rule: nat.induct) (auto simp add: fact_div_fact Suc_diff_Suc mult_le_mono)
   14.71  qed
   14.72 @@ -434,7 +434,7 @@
   14.73    with True have "n = m + 2"
   14.74      by simp
   14.75    then have "fact n = n * (n - 1) * fact (n - 2)"
   14.76 -    by (simp add: fact_setprod_Suc atLeast0_lessThan_Suc algebra_simps)
   14.77 +    by (simp add: fact_prod_Suc atLeast0_lessThan_Suc algebra_simps)
   14.78    with True show ?thesis
   14.79      by (simp add: binomial_fact')
   14.80  qed
   14.81 @@ -508,29 +508,29 @@
   14.82  begin
   14.83  
   14.84  definition pochhammer :: "'a \<Rightarrow> nat \<Rightarrow> 'a"
   14.85 -  where pochhammer_setprod: "pochhammer a n = setprod (\<lambda>i. a + of_nat i) {0..<n}"
   14.86 +  where pochhammer_prod: "pochhammer a n = prod (\<lambda>i. a + of_nat i) {0..<n}"
   14.87  
   14.88 -lemma pochhammer_setprod_rev: "pochhammer a n = setprod (\<lambda>i. a + of_nat (n - i)) {1..n}"
   14.89 -  using setprod.atLeast_lessThan_rev_at_least_Suc_atMost [of "\<lambda>i. a + of_nat i" 0 n]
   14.90 -  by (simp add: pochhammer_setprod)
   14.91 +lemma pochhammer_prod_rev: "pochhammer a n = prod (\<lambda>i. a + of_nat (n - i)) {1..n}"
   14.92 +  using prod.atLeast_lessThan_rev_at_least_Suc_atMost [of "\<lambda>i. a + of_nat i" 0 n]
   14.93 +  by (simp add: pochhammer_prod)
   14.94  
   14.95 -lemma pochhammer_Suc_setprod: "pochhammer a (Suc n) = setprod (\<lambda>i. a + of_nat i) {0..n}"
   14.96 -  by (simp add: pochhammer_setprod atLeastLessThanSuc_atLeastAtMost)
   14.97 +lemma pochhammer_Suc_prod: "pochhammer a (Suc n) = prod (\<lambda>i. a + of_nat i) {0..n}"
   14.98 +  by (simp add: pochhammer_prod atLeastLessThanSuc_atLeastAtMost)
   14.99  
  14.100 -lemma pochhammer_Suc_setprod_rev: "pochhammer a (Suc n) = setprod (\<lambda>i. a + of_nat (n - i)) {0..n}"
  14.101 -  by (simp add: pochhammer_setprod_rev setprod.atLeast_Suc_atMost_Suc_shift)
  14.102 +lemma pochhammer_Suc_prod_rev: "pochhammer a (Suc n) = prod (\<lambda>i. a + of_nat (n - i)) {0..n}"
  14.103 +  by (simp add: pochhammer_prod_rev prod.atLeast_Suc_atMost_Suc_shift)
  14.104  
  14.105  lemma pochhammer_0 [simp]: "pochhammer a 0 = 1"
  14.106 -  by (simp add: pochhammer_setprod)
  14.107 +  by (simp add: pochhammer_prod)
  14.108  
  14.109  lemma pochhammer_1 [simp]: "pochhammer a 1 = a"
  14.110 -  by (simp add: pochhammer_setprod lessThan_Suc)
  14.111 +  by (simp add: pochhammer_prod lessThan_Suc)
  14.112  
  14.113  lemma pochhammer_Suc0 [simp]: "pochhammer a (Suc 0) = a"
  14.114 -  by (simp add: pochhammer_setprod lessThan_Suc)
  14.115 +  by (simp add: pochhammer_prod lessThan_Suc)
  14.116  
  14.117  lemma pochhammer_Suc: "pochhammer a (Suc n) = pochhammer a n * (a + of_nat n)"
  14.118 -  by (simp add: pochhammer_setprod atLeast0_lessThan_Suc ac_simps)
  14.119 +  by (simp add: pochhammer_prod atLeast0_lessThan_Suc ac_simps)
  14.120  
  14.121  end
  14.122  
  14.123 @@ -545,22 +545,22 @@
  14.124    by (induction n) (auto simp: pochhammer_Suc intro!: mult_pos_pos add_pos_nonneg)
  14.125  
  14.126  lemma pochhammer_of_nat: "pochhammer (of_nat x) n = of_nat (pochhammer x n)"
  14.127 -  by (simp add: pochhammer_setprod)
  14.128 +  by (simp add: pochhammer_prod)
  14.129  
  14.130  lemma pochhammer_of_int: "pochhammer (of_int x) n = of_int (pochhammer x n)"
  14.131 -  by (simp add: pochhammer_setprod)
  14.132 +  by (simp add: pochhammer_prod)
  14.133  
  14.134  lemma pochhammer_rec: "pochhammer a (Suc n) = a * pochhammer (a + 1) n"
  14.135 -  by (simp add: pochhammer_setprod setprod.atLeast0_lessThan_Suc_shift ac_simps)
  14.136 +  by (simp add: pochhammer_prod prod.atLeast0_lessThan_Suc_shift ac_simps)
  14.137  
  14.138  lemma pochhammer_rec': "pochhammer z (Suc n) = (z + of_nat n) * pochhammer z n"
  14.139 -  by (simp add: pochhammer_setprod setprod.atLeast0_lessThan_Suc ac_simps)
  14.140 +  by (simp add: pochhammer_prod prod.atLeast0_lessThan_Suc ac_simps)
  14.141  
  14.142  lemma pochhammer_fact: "fact n = pochhammer 1 n"
  14.143 -  by (simp add: pochhammer_setprod fact_setprod_Suc)
  14.144 +  by (simp add: pochhammer_prod fact_prod_Suc)
  14.145  
  14.146  lemma pochhammer_of_nat_eq_0_lemma: "k > n \<Longrightarrow> pochhammer (- (of_nat n :: 'a:: idom)) k = 0"
  14.147 -  by (auto simp add: pochhammer_setprod)
  14.148 +  by (auto simp add: pochhammer_prod)
  14.149  
  14.150  lemma pochhammer_of_nat_eq_0_lemma':
  14.151    assumes kn: "k \<le> n"
  14.152 @@ -571,7 +571,7 @@
  14.153  next
  14.154    case (Suc h)
  14.155    then show ?thesis
  14.156 -    apply (simp add: pochhammer_Suc_setprod)
  14.157 +    apply (simp add: pochhammer_Suc_prod)
  14.158      using Suc kn
  14.159      apply (auto simp add: algebra_simps)
  14.160      done
  14.161 @@ -585,7 +585,7 @@
  14.162    by (auto simp add: not_le[symmetric])
  14.163  
  14.164  lemma pochhammer_eq_0_iff: "pochhammer a n = (0::'a::field_char_0) \<longleftrightarrow> (\<exists>k < n. a = - of_nat k)"
  14.165 -  by (auto simp add: pochhammer_setprod eq_neg_iff_add_eq_0)
  14.166 +  by (auto simp add: pochhammer_prod eq_neg_iff_add_eq_0)
  14.167  
  14.168  lemma pochhammer_eq_0_mono:
  14.169    "pochhammer a n = (0::'a::field_char_0) \<Longrightarrow> m \<ge> n \<Longrightarrow> pochhammer a m = 0"
  14.170 @@ -603,11 +603,11 @@
  14.171  next
  14.172    case (Suc h)
  14.173    have eq: "((- 1) ^ Suc h :: 'a) = (\<Prod>i = 0..h. - 1)"
  14.174 -    using setprod_constant [where A="{0.. h}" and y="- 1 :: 'a"]
  14.175 +    using prod_constant [where A="{0.. h}" and y="- 1 :: 'a"]
  14.176      by auto
  14.177    with Suc show ?thesis
  14.178 -    using pochhammer_Suc_setprod_rev [of "b - of_nat k + 1"]
  14.179 -    by (auto simp add: pochhammer_Suc_setprod setprod.distrib [symmetric] eq of_nat_diff)
  14.180 +    using pochhammer_Suc_prod_rev [of "b - of_nat k + 1"]
  14.181 +    by (auto simp add: pochhammer_Suc_prod prod.distrib [symmetric] eq of_nat_diff)
  14.182  qed
  14.183  
  14.184  lemma pochhammer_minus':
  14.185 @@ -705,19 +705,19 @@
  14.186  subsection \<open>Generalized binomial coefficients\<close>
  14.187  
  14.188  definition gbinomial :: "'a::{semidom_divide,semiring_char_0} \<Rightarrow> nat \<Rightarrow> 'a"  (infixl "gchoose" 65)
  14.189 -  where gbinomial_setprod_rev: "a gchoose n = setprod (\<lambda>i. a - of_nat i) {0..<n} div fact n"
  14.190 +  where gbinomial_prod_rev: "a gchoose n = prod (\<lambda>i. a - of_nat i) {0..<n} div fact n"
  14.191  
  14.192  lemma gbinomial_0 [simp]:
  14.193    "a gchoose 0 = 1"
  14.194    "0 gchoose (Suc n) = 0"
  14.195 -  by (simp_all add: gbinomial_setprod_rev setprod.atLeast0_lessThan_Suc_shift)
  14.196 +  by (simp_all add: gbinomial_prod_rev prod.atLeast0_lessThan_Suc_shift)
  14.197  
  14.198 -lemma gbinomial_Suc: "a gchoose (Suc k) = setprod (\<lambda>i. a - of_nat i) {0..k} div fact (Suc k)"
  14.199 -  by (simp add: gbinomial_setprod_rev atLeastLessThanSuc_atLeastAtMost)
  14.200 +lemma gbinomial_Suc: "a gchoose (Suc k) = prod (\<lambda>i. a - of_nat i) {0..k} div fact (Suc k)"
  14.201 +  by (simp add: gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
  14.202  
  14.203  lemma gbinomial_mult_fact: "fact n * (a gchoose n) = (\<Prod>i = 0..<n. a - of_nat i)"
  14.204    for a :: "'a::field_char_0"
  14.205 -  by (simp_all add: gbinomial_setprod_rev field_simps)
  14.206 +  by (simp_all add: gbinomial_prod_rev field_simps)
  14.207  
  14.208  lemma gbinomial_mult_fact': "(a gchoose n) * fact n = (\<Prod>i = 0..<n. a - of_nat i)"
  14.209    for a :: "'a::field_char_0"
  14.210 @@ -727,9 +727,9 @@
  14.211    for a :: "'a::field_char_0"
  14.212    by (cases n)
  14.213      (simp_all add: pochhammer_minus,
  14.214 -     simp_all add: gbinomial_setprod_rev pochhammer_setprod_rev
  14.215 +     simp_all add: gbinomial_prod_rev pochhammer_prod_rev
  14.216         power_mult_distrib [symmetric] atLeastLessThanSuc_atLeastAtMost
  14.217 -       setprod.atLeast_Suc_atMost_Suc_shift of_nat_diff)
  14.218 +       prod.atLeast_Suc_atMost_Suc_shift of_nat_diff)
  14.219  
  14.220  lemma gbinomial_pochhammer': "s gchoose n = pochhammer (s - of_nat n + 1) n / fact n"
  14.221    for s :: "'a::field_char_0"
  14.222 @@ -749,42 +749,42 @@
  14.223      by (simp add: not_le)
  14.224    then have "0 \<in> (op - n) ` {0..<k}"
  14.225      by auto
  14.226 -  then have "setprod (op - n) {0..<k} = 0"
  14.227 -    by (auto intro: setprod_zero)
  14.228 +  then have "prod (op - n) {0..<k} = 0"
  14.229 +    by (auto intro: prod_zero)
  14.230    with \<open>n < k\<close> show ?thesis
  14.231 -    by (simp add: binomial_eq_0 gbinomial_setprod_rev setprod_zero)
  14.232 +    by (simp add: binomial_eq_0 gbinomial_prod_rev prod_zero)
  14.233  next
  14.234    case True
  14.235    then have "inj_on (op - n) {0..<k}"
  14.236      by (auto intro: inj_onI)
  14.237 -  then have "\<Prod>(op - n ` {0..<k}) = setprod (op - n) {0..<k}"
  14.238 -    by (auto dest: setprod.reindex)
  14.239 +  then have "\<Prod>(op - n ` {0..<k}) = prod (op - n) {0..<k}"
  14.240 +    by (auto dest: prod.reindex)
  14.241    also have "op - n ` {0..<k} = {Suc (n - k)..n}"
  14.242      using True by (auto simp add: image_def Bex_def) presburger  (* FIXME slow *)
  14.243 -  finally have *: "setprod (\<lambda>q. n - q) {0..<k} = \<Prod>{Suc (n - k)..n}" ..
  14.244 +  finally have *: "prod (\<lambda>q. n - q) {0..<k} = \<Prod>{Suc (n - k)..n}" ..
  14.245    from True have "n choose k = fact n div (fact k * fact (n - k))"
  14.246      by (rule binomial_fact')
  14.247    with * show ?thesis
  14.248 -    by (simp add: gbinomial_setprod_rev mult.commute [of "fact k"] div_mult2_eq fact_div_fact)
  14.249 +    by (simp add: gbinomial_prod_rev mult.commute [of "fact k"] div_mult2_eq fact_div_fact)
  14.250  qed
  14.251  
  14.252  lemma of_nat_gbinomial: "of_nat (n gchoose k) = (of_nat n gchoose k :: 'a::field_char_0)"
  14.253  proof (cases "k \<le> n")
  14.254    case False
  14.255    then show ?thesis
  14.256 -    by (simp add: not_le gbinomial_binomial binomial_eq_0 gbinomial_setprod_rev)
  14.257 +    by (simp add: not_le gbinomial_binomial binomial_eq_0 gbinomial_prod_rev)
  14.258  next
  14.259    case True
  14.260    define m where "m = n - k"
  14.261    with True have n: "n = m + k"
  14.262      by arith
  14.263    from n have "fact n = ((\<Prod>i = 0..<m + k. of_nat (m + k - i) ):: 'a)"
  14.264 -    by (simp add: fact_setprod_rev)
  14.265 +    by (simp add: fact_prod_rev)
  14.266    also have "\<dots> = ((\<Prod>i\<in>{0..<k} \<union> {k..<m + k}. of_nat (m + k - i)) :: 'a)"
  14.267      by (simp add: ivl_disj_un)
  14.268    finally have "fact n = (fact m * (\<Prod>i = 0..<k. of_nat m + of_nat k - of_nat i) :: 'a)"
  14.269 -    using setprod_shift_bounds_nat_ivl [of "\<lambda>i. of_nat (m + k - i) :: 'a" 0 k m]
  14.270 -    by (simp add: fact_setprod_rev [of m] setprod.union_disjoint of_nat_diff)
  14.271 +    using prod_shift_bounds_nat_ivl [of "\<lambda>i. of_nat (m + k - i) :: 'a" 0 k m]
  14.272 +    by (simp add: fact_prod_rev [of m] prod.union_disjoint of_nat_diff)
  14.273    then have "fact n / fact (n - k) = ((\<Prod>i = 0..<k. of_nat n - of_nat i) :: 'a)"
  14.274      by (simp add: n)
  14.275    with True have "fact k * of_nat (n gchoose k) = (fact k * (of_nat n gchoose k) :: 'a)"
  14.276 @@ -800,10 +800,10 @@
  14.277    \<open>Sign.add_const_constraint (@{const_name gbinomial}, SOME @{typ "'a::field_char_0 \<Rightarrow> nat \<Rightarrow> 'a"})\<close>
  14.278  
  14.279  lemma gbinomial_1[simp]: "a gchoose 1 = a"
  14.280 -  by (simp add: gbinomial_setprod_rev lessThan_Suc)
  14.281 +  by (simp add: gbinomial_prod_rev lessThan_Suc)
  14.282  
  14.283  lemma gbinomial_Suc0[simp]: "a gchoose (Suc 0) = a"
  14.284 -  by (simp add: gbinomial_setprod_rev lessThan_Suc)
  14.285 +  by (simp add: gbinomial_prod_rev lessThan_Suc)
  14.286  
  14.287  lemma gbinomial_mult_1:
  14.288    fixes a :: "'a::field_char_0"
  14.289 @@ -833,7 +833,7 @@
  14.290  next
  14.291    case (Suc h)
  14.292    have eq0: "(\<Prod>i\<in>{1..k}. (a + 1) - of_nat i) = (\<Prod>i\<in>{0..h}. a - of_nat i)"
  14.293 -    apply (rule setprod.reindex_cong [where l = Suc])
  14.294 +    apply (rule prod.reindex_cong [where l = Suc])
  14.295        using Suc
  14.296        apply (auto simp add: image_Suc_atMost)
  14.297      done
  14.298 @@ -865,7 +865,7 @@
  14.299      by (simp add: field_simps Suc atLeastLessThanSuc_atLeastAtMost)
  14.300    also have "\<dots> = (\<Prod>i\<in>{0..k}. (a + 1) - of_nat i)"
  14.301      using eq0
  14.302 -    by (simp add: Suc setprod.atLeast0_atMost_Suc_shift)
  14.303 +    by (simp add: Suc prod.atLeast0_atMost_Suc_shift)
  14.304    also have "\<dots> = (fact (Suc k)) * ((a + 1) gchoose (Suc k))"
  14.305      by (simp only: gbinomial_mult_fact atLeastLessThanSuc_atLeastAtMost)
  14.306    finally show ?thesis
  14.307 @@ -1003,7 +1003,7 @@
  14.308    Alternative definition of the binomial coefficient as @{term "\<Prod>i<k. (n - i) / (k - i)"}.\<close>
  14.309  lemma gbinomial_altdef_of_nat: "x gchoose k = (\<Prod>i = 0..<k. (x - of_nat i) / of_nat (k - i) :: 'a)"
  14.310    for k :: nat and x :: "'a::field_char_0"
  14.311 -  by (simp add: setprod_dividef gbinomial_setprod_rev fact_setprod_rev)
  14.312 +  by (simp add: prod_dividef gbinomial_prod_rev fact_prod_rev)
  14.313  
  14.314  lemma gbinomial_ge_n_over_k_pow_k:
  14.315    fixes k :: nat
  14.316 @@ -1014,10 +1014,10 @@
  14.317    have x: "0 \<le> x"
  14.318      using assms of_nat_0_le_iff order_trans by blast
  14.319    have "(x / of_nat k :: 'a) ^ k = (\<Prod>i = 0..<k. x / of_nat k :: 'a)"
  14.320 -    by (simp add: setprod_constant)
  14.321 +    by (simp add: prod_constant)
  14.322    also have "\<dots> \<le> x gchoose k" (* FIXME *)
  14.323      unfolding gbinomial_altdef_of_nat
  14.324 -    apply (safe intro!: setprod_mono)
  14.325 +    apply (safe intro!: prod_mono)
  14.326      apply simp_all
  14.327      prefer 2
  14.328      subgoal premises for i
  14.329 @@ -1051,11 +1051,11 @@
  14.330  next
  14.331    case (Suc b)
  14.332    then have "((a + 1) gchoose (Suc (Suc b))) = (\<Prod>i = 0..Suc b. a + (1 - of_nat i)) / fact (b + 2)"
  14.333 -    by (simp add: field_simps gbinomial_setprod_rev atLeastLessThanSuc_atLeastAtMost)
  14.334 +    by (simp add: field_simps gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
  14.335    also have "(\<Prod>i = 0..Suc b. a + (1 - of_nat i)) = (a + 1) * (\<Prod>i = 0..b. a - of_nat i)"
  14.336 -    by (simp add: setprod.atLeast0_atMost_Suc_shift)
  14.337 +    by (simp add: prod.atLeast0_atMost_Suc_shift)
  14.338    also have "\<dots> / fact (b + 2) = (a + 1) / of_nat (Suc (Suc b)) * (a gchoose Suc b)"
  14.339 -    by (simp_all add: gbinomial_setprod_rev atLeastLessThanSuc_atLeastAtMost)
  14.340 +    by (simp_all add: gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
  14.341    finally show ?thesis by (simp add: Suc field_simps del: of_nat_Suc)
  14.342  qed
  14.343  
  14.344 @@ -1066,11 +1066,11 @@
  14.345  next
  14.346    case (Suc b)
  14.347    then have "((a + 1) gchoose (Suc (Suc b))) = (\<Prod>i = 0 .. Suc b. a + (1 - of_nat i)) / fact (b + 2)"
  14.348 -    by (simp add: field_simps gbinomial_setprod_rev atLeastLessThanSuc_atLeastAtMost)
  14.349 +    by (simp add: field_simps gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
  14.350    also have "(\<Prod>i = 0 .. Suc b. a + (1 - of_nat i)) = (a + 1) * (\<Prod>i = 0..b. a - of_nat i)"
  14.351 -    by (simp add: setprod.atLeast0_atMost_Suc_shift)
  14.352 +    by (simp add: prod.atLeast0_atMost_Suc_shift)
  14.353    also have "\<dots> / fact (b + 2) = (a + 1) / of_nat (Suc (Suc b)) * (a gchoose Suc b)"
  14.354 -    by (simp_all add: gbinomial_setprod_rev atLeastLessThanSuc_atLeastAtMost atLeast0AtMost)
  14.355 +    by (simp_all add: gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost atLeast0AtMost)
  14.356    finally show ?thesis
  14.357      by (simp add: Suc)
  14.358  qed
  14.359 @@ -1647,11 +1647,11 @@
  14.360    "fact n = (of_nat (fold_atLeastAtMost_nat (op *) 2 n 1) :: 'a::semiring_char_0)"
  14.361  proof -
  14.362    have "fact n = (of_nat (\<Prod>{1..n}) :: 'a)"
  14.363 -    by (simp add: fact_setprod)
  14.364 +    by (simp add: fact_prod)
  14.365    also have "\<Prod>{1..n} = \<Prod>{2..n}"
  14.366 -    by (intro setprod.mono_neutral_right) auto
  14.367 +    by (intro prod.mono_neutral_right) auto
  14.368    also have "\<dots> = fold_atLeastAtMost_nat (op *) 2 n 1"
  14.369 -    by (simp add: setprod_atLeastAtMost_code)
  14.370 +    by (simp add: prod_atLeastAtMost_code)
  14.371    finally show ?thesis .
  14.372  qed
  14.373  
  14.374 @@ -1660,7 +1660,7 @@
  14.375      (if n = 0 then 1
  14.376       else fold_atLeastAtMost_nat (\<lambda>n acc. (a + of_nat n) * acc) 0 (n - 1) 1)"
  14.377    by (cases n)
  14.378 -    (simp_all add: pochhammer_setprod setprod_atLeastAtMost_code [symmetric]
  14.379 +    (simp_all add: pochhammer_prod prod_atLeastAtMost_code [symmetric]
  14.380        atLeastLessThanSuc_atLeastAtMost)
  14.381  
  14.382  lemma gbinomial_code [code]:
  14.383 @@ -1668,7 +1668,7 @@
  14.384      (if n = 0 then 1
  14.385       else fold_atLeastAtMost_nat (\<lambda>n acc. (a - of_nat n) * acc) 0 (n - 1) 1 / fact n)"
  14.386    by (cases n)
  14.387 -    (simp_all add: gbinomial_setprod_rev setprod_atLeastAtMost_code [symmetric]
  14.388 +    (simp_all add: gbinomial_prod_rev prod_atLeastAtMost_code [symmetric]
  14.389        atLeastLessThanSuc_atLeastAtMost)
  14.390  
  14.391  (* FIXME *)
  14.392 @@ -1685,9 +1685,9 @@
  14.393      assume "k \<le> n"
  14.394      then have "{1..n} = {1..n-k} \<union> {n-k+1..n}" by auto
  14.395      then have "(fact n :: nat) = fact (n-k) * \<Prod>{n-k+1..n}"
  14.396 -      by (simp add: setprod.union_disjoint fact_altdef_nat)
  14.397 +      by (simp add: prod.union_disjoint fact_altdef_nat)
  14.398    }
  14.399 -  then show ?thesis by (auto simp: binomial_altdef_nat mult_ac setprod_atLeastAtMost_code)
  14.400 +  then show ?thesis by (auto simp: binomial_altdef_nat mult_ac prod_atLeastAtMost_code)
  14.401  qed
  14.402  *)
  14.403  
    15.1 --- a/src/HOL/Complex.thy	Mon Oct 17 14:37:32 2016 +0200
    15.2 +++ b/src/HOL/Complex.thy	Mon Oct 17 17:33:07 2016 +0200
    15.3 @@ -486,7 +486,7 @@
    15.4  lemma complex_cnj_mult [simp]: "cnj (x * y) = cnj x * cnj y"
    15.5    by (simp add: complex_eq_iff)
    15.6  
    15.7 -lemma cnj_setprod [simp]: "cnj (setprod f s) = (\<Prod>x\<in>s. cnj (f x))"
    15.8 +lemma cnj_prod [simp]: "cnj (prod f s) = (\<Prod>x\<in>s. cnj (f x))"
    15.9    by (induct s rule: infinite_finite_induct) auto
   15.10  
   15.11  lemma complex_cnj_inverse [simp]: "cnj (inverse x) = inverse (cnj x)"
    16.1 --- a/src/HOL/Decision_Procs/Approximation.thy	Mon Oct 17 14:37:32 2016 +0200
    16.2 +++ b/src/HOL/Decision_Procs/Approximation.thy	Mon Oct 17 17:33:07 2016 +0200
    16.3 @@ -3972,7 +3972,7 @@
    16.4      qed
    16.5  
    16.6      have "\<And>k i. k < i \<Longrightarrow> {k ..< i} = insert k {Suc k ..< i}" by auto
    16.7 -    hence setprod_head_Suc: "\<And>k i. \<Prod>{k ..< k + Suc i} = k * \<Prod>{Suc k ..< Suc k + i}"
    16.8 +    hence prod_head_Suc: "\<And>k i. \<Prod>{k ..< k + Suc i} = k * \<Prod>{Suc k ..< Suc k + i}"
    16.9        by auto
   16.10      have sum_move0: "\<And>k F. sum F {0..<Suc k} = F 0 + sum (\<lambda> k. F (Suc k)) {0..<k}"
   16.11        unfolding sum_shift_bounds_Suc_ivl[symmetric]
   16.12 @@ -3994,7 +3994,7 @@
   16.13        also have "?X (Suc k) f n t * (xs!x - real_of_float c) * inverse (real k) + ?f 0 c =
   16.14                 (\<Sum> i = 0..<Suc n. inverse (real (\<Prod> j \<in> {k..<k+i}. j)) * ?f i c * (xs!x - c)^i) +
   16.15                 inverse (real (\<Prod> j \<in> {k..<k+Suc n}. j)) * ?f (Suc n) t * (xs!x - c)^Suc n" (is "_ = ?T")
   16.16 -        unfolding funpow_Suc C_def[symmetric] sum_move0 setprod_head_Suc
   16.17 +        unfolding funpow_Suc C_def[symmetric] sum_move0 prod_head_Suc
   16.18          by (auto simp add: algebra_simps)
   16.19            (simp only: mult.left_commute [of _ "inverse (real k)"] sum_distrib_left [symmetric])
   16.20        finally have "?T \<in> {l .. u}" .
   16.21 @@ -4003,8 +4003,8 @@
   16.22    qed
   16.23  qed
   16.24  
   16.25 -lemma setprod_fact: "real (\<Prod> {1..<1 + k}) = fact (k :: nat)"
   16.26 -  by (simp add: fact_setprod atLeastLessThanSuc_atLeastAtMost)
   16.27 +lemma prod_fact: "real (\<Prod> {1..<1 + k}) = fact (k :: nat)"
   16.28 +  by (simp add: fact_prod atLeastLessThanSuc_atLeastAtMost)
   16.29  
   16.30  lemma approx_tse:
   16.31    assumes "bounded_by xs vs"
   16.32 @@ -4029,7 +4029,7 @@
   16.33             (\<Sum> j = 0..<n. inverse(fact j) * F j c * (xs!x - c)^j) +
   16.34               inverse ((fact n)) * F n t * (xs!x - c)^n
   16.35               \<in> {l .. u}" (is "\<And> t. _ \<Longrightarrow> ?taylor t \<in> _")
   16.36 -    unfolding F_def atLeastAtMost_iff[symmetric] setprod_fact
   16.37 +    unfolding F_def atLeastAtMost_iff[symmetric] prod_fact
   16.38      by blast
   16.39  
   16.40    have bnd_xs: "xs ! x \<in> { lx .. ux }"
    17.1 --- a/src/HOL/Deriv.thy	Mon Oct 17 14:37:32 2016 +0200
    17.2 +++ b/src/HOL/Deriv.thy	Mon Oct 17 17:33:07 2016 +0200
    17.3 @@ -351,7 +351,7 @@
    17.4  lemmas has_derivative_mult[simp, derivative_intros] = bounded_bilinear.FDERIV[OF bounded_bilinear_mult]
    17.5  lemmas has_derivative_scaleR[simp, derivative_intros] = bounded_bilinear.FDERIV[OF bounded_bilinear_scaleR]
    17.6  
    17.7 -lemma has_derivative_setprod[simp, derivative_intros]:
    17.8 +lemma has_derivative_prod[simp, derivative_intros]:
    17.9    fixes f :: "'i \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::real_normed_field"
   17.10    shows "(\<And>i. i \<in> I \<Longrightarrow> (f i has_derivative f' i) (at x within s)) \<Longrightarrow>
   17.11      ((\<lambda>x. \<Prod>i\<in>I. f i x) has_derivative (\<lambda>y. \<Sum>i\<in>I. f' i y * (\<Prod>j\<in>I - {i}. f j x))) (at x within s)"
   17.12 @@ -377,7 +377,7 @@
   17.13    fixes f :: "'a :: real_normed_vector \<Rightarrow> 'b :: real_normed_field"
   17.14    assumes f: "(f has_derivative f') (at x within s)"
   17.15    shows "((\<lambda>x. f x^n) has_derivative (\<lambda>y. of_nat n * f' y * f x^(n - 1))) (at x within s)"
   17.16 -  using has_derivative_setprod[OF f, of "{..< n}"] by (simp add: setprod_constant ac_simps)
   17.17 +  using has_derivative_prod[OF f, of "{..< n}"] by (simp add: prod_constant ac_simps)
   17.18  
   17.19  lemma has_derivative_inverse':
   17.20    fixes x :: "'a::real_normed_div_algebra"
    18.1 --- a/src/HOL/GCD.thy	Mon Oct 17 14:37:32 2016 +0200
    18.2 +++ b/src/HOL/GCD.thy	Mon Oct 17 17:33:07 2016 +0200
    18.3 @@ -859,7 +859,7 @@
    18.4  lemma coprime_plus_one [simp]: "gcd (n + 1) n = 1"
    18.5    by (subst add_commute) simp
    18.6  
    18.7 -lemma setprod_coprime [rule_format]: "(\<forall>i\<in>A. gcd (f i) a = 1) \<longrightarrow> gcd (\<Prod>i\<in>A. f i) a = 1"
    18.8 +lemma prod_coprime [rule_format]: "(\<forall>i\<in>A. gcd (f i) a = 1) \<longrightarrow> gcd (\<Prod>i\<in>A. f i) a = 1"
    18.9    by (induct A rule: infinite_finite_induct) (auto simp add: gcd_mult_cancel)
   18.10  
   18.11  lemma prod_list_coprime: "(\<And>x. x \<in> set xs \<Longrightarrow> coprime x y) \<Longrightarrow> coprime (prod_list xs) y"
   18.12 @@ -1373,7 +1373,7 @@
   18.13    also have "lcm a \<dots> = lcm a (\<Prod>A)"
   18.14      by (cases "\<Prod>A = 0") (simp_all add: lcm_div_unit2)
   18.15    also from insert have "gcd a (\<Prod>A) = 1"
   18.16 -    by (subst gcd.commute, intro setprod_coprime) auto
   18.17 +    by (subst gcd.commute, intro prod_coprime) auto
   18.18    with insert have "lcm a (\<Prod>A) = normalize (\<Prod>(insert a A))"
   18.19      by (simp add: lcm_coprime)
   18.20    finally show ?case .
    19.1 --- a/src/HOL/Groups_Big.thy	Mon Oct 17 14:37:32 2016 +0200
    19.2 +++ b/src/HOL/Groups_Big.thy	Mon Oct 17 17:33:07 2016 +0200
    19.3 @@ -1051,34 +1051,34 @@
    19.4  context comm_monoid_mult
    19.5  begin
    19.6  
    19.7 -sublocale setprod: comm_monoid_set times 1
    19.8 -  defines setprod = setprod.F ..
    19.9 +sublocale prod: comm_monoid_set times 1
   19.10 +  defines prod = prod.F ..
   19.11  
   19.12 -abbreviation Setprod ("\<Prod>_" [1000] 999)
   19.13 -  where "\<Prod>A \<equiv> setprod (\<lambda>x. x) A"
   19.14 +abbreviation Prod ("\<Prod>_" [1000] 999)
   19.15 +  where "\<Prod>A \<equiv> prod (\<lambda>x. x) A"
   19.16  
   19.17  end
   19.18  
   19.19  syntax (ASCII)
   19.20 -  "_setprod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult"  ("(4PROD _:_./ _)" [0, 51, 10] 10)
   19.21 +  "_prod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult"  ("(4PROD _:_./ _)" [0, 51, 10] 10)
   19.22  syntax
   19.23 -  "_setprod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult"  ("(2\<Prod>_\<in>_./ _)" [0, 51, 10] 10)
   19.24 +  "_prod" :: "pttrn => 'a set => 'b => 'b::comm_monoid_mult"  ("(2\<Prod>_\<in>_./ _)" [0, 51, 10] 10)
   19.25  translations \<comment> \<open>Beware of argument permutation!\<close>
   19.26 -  "\<Prod>i\<in>A. b" == "CONST setprod (\<lambda>i. b) A"
   19.27 +  "\<Prod>i\<in>A. b" == "CONST prod (\<lambda>i. b) A"
   19.28  
   19.29  text \<open>Instead of @{term"\<Prod>x\<in>{x. P}. e"} we introduce the shorter \<open>\<Prod>x|P. e\<close>.\<close>
   19.30  
   19.31  syntax (ASCII)
   19.32 -  "_qsetprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a"  ("(4PROD _ |/ _./ _)" [0, 0, 10] 10)
   19.33 +  "_qprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a"  ("(4PROD _ |/ _./ _)" [0, 0, 10] 10)
   19.34  syntax
   19.35 -  "_qsetprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a"  ("(2\<Prod>_ | (_)./ _)" [0, 0, 10] 10)
   19.36 +  "_qprod" :: "pttrn \<Rightarrow> bool \<Rightarrow> 'a \<Rightarrow> 'a"  ("(2\<Prod>_ | (_)./ _)" [0, 0, 10] 10)
   19.37  translations
   19.38 -  "\<Prod>x|P. t" => "CONST setprod (\<lambda>x. t) {x. P}"
   19.39 +  "\<Prod>x|P. t" => "CONST prod (\<lambda>x. t) {x. P}"
   19.40  
   19.41  context comm_monoid_mult
   19.42  begin
   19.43  
   19.44 -lemma setprod_dvd_setprod: "(\<And>a. a \<in> A \<Longrightarrow> f a dvd g a) \<Longrightarrow> setprod f A dvd setprod g A"
   19.45 +lemma prod_dvd_prod: "(\<And>a. a \<in> A \<Longrightarrow> f a dvd g a) \<Longrightarrow> prod f A dvd prod g A"
   19.46  proof (induct A rule: infinite_finite_induct)
   19.47    case infinite
   19.48    then show ?case by (auto intro: dvdI)
   19.49 @@ -1087,18 +1087,18 @@
   19.50    then show ?case by (auto intro: dvdI)
   19.51  next
   19.52    case (insert a A)
   19.53 -  then have "f a dvd g a" and "setprod f A dvd setprod g A"
   19.54 +  then have "f a dvd g a" and "prod f A dvd prod g A"
   19.55      by simp_all
   19.56 -  then obtain r s where "g a = f a * r" and "setprod g A = setprod f A * s"
   19.57 +  then obtain r s where "g a = f a * r" and "prod g A = prod f A * s"
   19.58      by (auto elim!: dvdE)
   19.59 -  then have "g a * setprod g A = f a * setprod f A * (r * s)"
   19.60 +  then have "g a * prod g A = f a * prod f A * (r * s)"
   19.61      by (simp add: ac_simps)
   19.62    with insert.hyps show ?case
   19.63      by (auto intro: dvdI)
   19.64  qed
   19.65  
   19.66 -lemma setprod_dvd_setprod_subset: "finite B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> setprod f A dvd setprod f B"
   19.67 -  by (auto simp add: setprod.subset_diff ac_simps intro: dvdI)
   19.68 +lemma prod_dvd_prod_subset: "finite B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> prod f A dvd prod f B"
   19.69 +  by (auto simp add: prod.subset_diff ac_simps intro: dvdI)
   19.70  
   19.71  end
   19.72  
   19.73 @@ -1108,25 +1108,25 @@
   19.74  context comm_semiring_1
   19.75  begin
   19.76  
   19.77 -lemma dvd_setprod_eqI [intro]:
   19.78 +lemma dvd_prod_eqI [intro]:
   19.79    assumes "finite A" and "a \<in> A" and "b = f a"
   19.80 -  shows "b dvd setprod f A"
   19.81 +  shows "b dvd prod f A"
   19.82  proof -
   19.83 -  from \<open>finite A\<close> have "setprod f (insert a (A - {a})) = f a * setprod f (A - {a})"
   19.84 -    by (intro setprod.insert) auto
   19.85 +  from \<open>finite A\<close> have "prod f (insert a (A - {a})) = f a * prod f (A - {a})"
   19.86 +    by (intro prod.insert) auto
   19.87    also from \<open>a \<in> A\<close> have "insert a (A - {a}) = A"
   19.88      by blast
   19.89 -  finally have "setprod f A = f a * setprod f (A - {a})" .
   19.90 +  finally have "prod f A = f a * prod f (A - {a})" .
   19.91    with \<open>b = f a\<close> show ?thesis
   19.92      by simp
   19.93  qed
   19.94  
   19.95 -lemma dvd_setprodI [intro]: "finite A \<Longrightarrow> a \<in> A \<Longrightarrow> f a dvd setprod f A"
   19.96 +lemma dvd_prodI [intro]: "finite A \<Longrightarrow> a \<in> A \<Longrightarrow> f a dvd prod f A"
   19.97    by auto
   19.98  
   19.99 -lemma setprod_zero:
  19.100 +lemma prod_zero:
  19.101    assumes "finite A" and "\<exists>a\<in>A. f a = 0"
  19.102 -  shows "setprod f A = 0"
  19.103 +  shows "prod f A = 0"
  19.104    using assms
  19.105  proof (induct A)
  19.106    case empty
  19.107 @@ -1134,32 +1134,32 @@
  19.108  next
  19.109    case (insert a A)
  19.110    then have "f a = 0 \<or> (\<exists>a\<in>A. f a = 0)" by simp
  19.111 -  then have "f a * setprod f A = 0" by rule (simp_all add: insert)
  19.112 +  then have "f a * prod f A = 0" by rule (simp_all add: insert)
  19.113    with insert show ?case by simp
  19.114  qed
  19.115  
  19.116 -lemma setprod_dvd_setprod_subset2:
  19.117 +lemma prod_dvd_prod_subset2:
  19.118    assumes "finite B" and "A \<subseteq> B" and "\<And>a. a \<in> A \<Longrightarrow> f a dvd g a"
  19.119 -  shows "setprod f A dvd setprod g B"
  19.120 +  shows "prod f A dvd prod g B"
  19.121  proof -
  19.122 -  from assms have "setprod f A dvd setprod g A"
  19.123 -    by (auto intro: setprod_dvd_setprod)
  19.124 -  moreover from assms have "setprod g A dvd setprod g B"
  19.125 -    by (auto intro: setprod_dvd_setprod_subset)
  19.126 +  from assms have "prod f A dvd prod g A"
  19.127 +    by (auto intro: prod_dvd_prod)
  19.128 +  moreover from assms have "prod g A dvd prod g B"
  19.129 +    by (auto intro: prod_dvd_prod_subset)
  19.130    ultimately show ?thesis by (rule dvd_trans)
  19.131  qed
  19.132  
  19.133  end
  19.134  
  19.135 -lemma (in semidom) setprod_zero_iff [simp]:
  19.136 +lemma (in semidom) prod_zero_iff [simp]:
  19.137    fixes f :: "'b \<Rightarrow> 'a"
  19.138    assumes "finite A"
  19.139 -  shows "setprod f A = 0 \<longleftrightarrow> (\<exists>a\<in>A. f a = 0)"
  19.140 +  shows "prod f A = 0 \<longleftrightarrow> (\<exists>a\<in>A. f a = 0)"
  19.141    using assms by (induct A) (auto simp: no_zero_divisors)
  19.142  
  19.143 -lemma (in semidom_divide) setprod_diff1:
  19.144 +lemma (in semidom_divide) prod_diff1:
  19.145    assumes "finite A" and "f a \<noteq> 0"
  19.146 -  shows "setprod f (A - {a}) = (if a \<in> A then setprod f A div f a else setprod f A)"
  19.147 +  shows "prod f (A - {a}) = (if a \<in> A then prod f A div f a else prod f A)"
  19.148  proof (cases "a \<notin> A")
  19.149    case True
  19.150    then show ?thesis by simp
  19.151 @@ -1196,73 +1196,73 @@
  19.152    for c :: "nat \<Rightarrow> 'a::field"
  19.153    using sum_zero_power [of "\<lambda>i. c i / d i" A] by auto
  19.154  
  19.155 -lemma (in field) setprod_inversef:
  19.156 -  "finite A \<Longrightarrow> setprod (inverse \<circ> f) A = inverse (setprod f A)"
  19.157 +lemma (in field) prod_inversef:
  19.158 +  "finite A \<Longrightarrow> prod (inverse \<circ> f) A = inverse (prod f A)"
  19.159    by (induct A rule: finite_induct) simp_all
  19.160  
  19.161 -lemma (in field) setprod_dividef: "finite A \<Longrightarrow> (\<Prod>x\<in>A. f x / g x) = setprod f A / setprod g A"
  19.162 -  using setprod_inversef [of A g] by (simp add: divide_inverse setprod.distrib)
  19.163 +lemma (in field) prod_dividef: "finite A \<Longrightarrow> (\<Prod>x\<in>A. f x / g x) = prod f A / prod g A"
  19.164 +  using prod_inversef [of A g] by (simp add: divide_inverse prod.distrib)
  19.165  
  19.166 -lemma setprod_Un:
  19.167 +lemma prod_Un:
  19.168    fixes f :: "'b \<Rightarrow> 'a :: field"
  19.169    assumes "finite A" and "finite B"
  19.170      and "\<forall>x\<in>A \<inter> B. f x \<noteq> 0"
  19.171 -  shows "setprod f (A \<union> B) = setprod f A * setprod f B / setprod f (A \<inter> B)"
  19.172 +  shows "prod f (A \<union> B) = prod f A * prod f B / prod f (A \<inter> B)"
  19.173  proof -
  19.174 -  from assms have "setprod f A * setprod f B = setprod f (A \<union> B) * setprod f (A \<inter> B)"
  19.175 -    by (simp add: setprod.union_inter [symmetric, of A B])
  19.176 +  from assms have "prod f A * prod f B = prod f (A \<union> B) * prod f (A \<inter> B)"
  19.177 +    by (simp add: prod.union_inter [symmetric, of A B])
  19.178    with assms show ?thesis
  19.179      by simp
  19.180  qed
  19.181  
  19.182 -lemma (in linordered_semidom) setprod_nonneg: "(\<forall>a\<in>A. 0 \<le> f a) \<Longrightarrow> 0 \<le> setprod f A"
  19.183 +lemma (in linordered_semidom) prod_nonneg: "(\<forall>a\<in>A. 0 \<le> f a) \<Longrightarrow> 0 \<le> prod f A"
  19.184    by (induct A rule: infinite_finite_induct) simp_all
  19.185  
  19.186 -lemma (in linordered_semidom) setprod_pos: "(\<forall>a\<in>A. 0 < f a) \<Longrightarrow> 0 < setprod f A"
  19.187 +lemma (in linordered_semidom) prod_pos: "(\<forall>a\<in>A. 0 < f a) \<Longrightarrow> 0 < prod f A"
  19.188    by (induct A rule: infinite_finite_induct) simp_all
  19.189  
  19.190 -lemma (in linordered_semidom) setprod_mono:
  19.191 -  "\<forall>i\<in>A. 0 \<le> f i \<and> f i \<le> g i \<Longrightarrow> setprod f A \<le> setprod g A"
  19.192 -  by (induct A rule: infinite_finite_induct) (auto intro!: setprod_nonneg mult_mono)
  19.193 +lemma (in linordered_semidom) prod_mono:
  19.194 +  "\<forall>i\<in>A. 0 \<le> f i \<and> f i \<le> g i \<Longrightarrow> prod f A \<le> prod g A"
  19.195 +  by (induct A rule: infinite_finite_induct) (auto intro!: prod_nonneg mult_mono)
  19.196  
  19.197 -lemma (in linordered_semidom) setprod_mono_strict:
  19.198 +lemma (in linordered_semidom) prod_mono_strict:
  19.199    assumes "finite A" "\<forall>i\<in>A. 0 \<le> f i \<and> f i < g i" "A \<noteq> {}"
  19.200 -  shows "setprod f A < setprod g A"
  19.201 +  shows "prod f A < prod g A"
  19.202    using assms
  19.203  proof (induct A rule: finite_induct)
  19.204    case empty
  19.205    then show ?case by simp
  19.206  next
  19.207    case insert
  19.208 -  then show ?case by (force intro: mult_strict_mono' setprod_nonneg)
  19.209 +  then show ?case by (force intro: mult_strict_mono' prod_nonneg)
  19.210  qed
  19.211  
  19.212 -lemma (in linordered_field) abs_setprod: "\<bar>setprod f A\<bar> = (\<Prod>x\<in>A. \<bar>f x\<bar>)"
  19.213 +lemma (in linordered_field) abs_prod: "\<bar>prod f A\<bar> = (\<Prod>x\<in>A. \<bar>f x\<bar>)"
  19.214    by (induct A rule: infinite_finite_induct) (simp_all add: abs_mult)
  19.215  
  19.216 -lemma setprod_eq_1_iff [simp]: "finite A \<Longrightarrow> setprod f A = 1 \<longleftrightarrow> (\<forall>a\<in>A. f a = 1)"
  19.217 +lemma prod_eq_1_iff [simp]: "finite A \<Longrightarrow> prod f A = 1 \<longleftrightarrow> (\<forall>a\<in>A. f a = 1)"
  19.218    for f :: "'a \<Rightarrow> nat"
  19.219    by (induct A rule: finite_induct) simp_all
  19.220  
  19.221 -lemma setprod_pos_nat_iff [simp]: "finite A \<Longrightarrow> setprod f A > 0 \<longleftrightarrow> (\<forall>a\<in>A. f a > 0)"
  19.222 +lemma prod_pos_nat_iff [simp]: "finite A \<Longrightarrow> prod f A > 0 \<longleftrightarrow> (\<forall>a\<in>A. f a > 0)"
  19.223    for f :: "'a \<Rightarrow> nat"
  19.224 -  using setprod_zero_iff by (simp del: neq0_conv add: zero_less_iff_neq_zero)
  19.225 +  using prod_zero_iff by (simp del: neq0_conv add: zero_less_iff_neq_zero)
  19.226  
  19.227 -lemma setprod_constant: "(\<Prod>x\<in> A. y) = y ^ card A"
  19.228 +lemma prod_constant: "(\<Prod>x\<in> A. y) = y ^ card A"
  19.229    for y :: "'a::comm_monoid_mult"
  19.230    by (induct A rule: infinite_finite_induct) simp_all
  19.231  
  19.232 -lemma setprod_power_distrib: "setprod f A ^ n = setprod (\<lambda>x. (f x) ^ n) A"
  19.233 +lemma prod_power_distrib: "prod f A ^ n = prod (\<lambda>x. (f x) ^ n) A"
  19.234    for f :: "'a \<Rightarrow> 'b::comm_semiring_1"
  19.235    by (induct A rule: infinite_finite_induct) (auto simp add: power_mult_distrib)
  19.236  
  19.237  lemma power_sum: "c ^ (\<Sum>a\<in>A. f a) = (\<Prod>a\<in>A. c ^ f a)"
  19.238    by (induct A rule: infinite_finite_induct) (simp_all add: power_add)
  19.239  
  19.240 -lemma setprod_gen_delta:
  19.241 +lemma prod_gen_delta:
  19.242    fixes b :: "'b \<Rightarrow> 'a::comm_monoid_mult"
  19.243    assumes fin: "finite S"
  19.244 -  shows "setprod (\<lambda>k. if k = a then b k else c) S =
  19.245 +  shows "prod (\<lambda>k. if k = a then b k else c) S =
  19.246      (if a \<in> S then b a * c ^ (card S - 1) else c ^ card S)"
  19.247  proof -
  19.248    let ?f = "(\<lambda>k. if k=a then b k else c)"
  19.249 @@ -1270,7 +1270,7 @@
  19.250    proof (cases "a \<in> S")
  19.251      case False
  19.252      then have "\<forall> k\<in> S. ?f k = c" by simp
  19.253 -    with False show ?thesis by (simp add: setprod_constant)
  19.254 +    with False show ?thesis by (simp add: prod_constant)
  19.255    next
  19.256      case True
  19.257      let ?A = "S - {a}"
  19.258 @@ -1278,16 +1278,16 @@
  19.259      from True have eq: "S = ?A \<union> ?B" by blast
  19.260      have disjoint: "?A \<inter> ?B = {}" by simp
  19.261      from fin have fin': "finite ?A" "finite ?B" by auto
  19.262 -    have f_A0: "setprod ?f ?A = setprod (\<lambda>i. c) ?A"
  19.263 -      by (rule setprod.cong) auto
  19.264 +    have f_A0: "prod ?f ?A = prod (\<lambda>i. c) ?A"
  19.265 +      by (rule prod.cong) auto
  19.266      from fin True have card_A: "card ?A = card S - 1" by auto
  19.267 -    have f_A1: "setprod ?f ?A = c ^ card ?A"
  19.268 -      unfolding f_A0 by (rule setprod_constant)
  19.269 -    have "setprod ?f ?A * setprod ?f ?B = setprod ?f S"
  19.270 -      using setprod.union_disjoint[OF fin' disjoint, of ?f, unfolded eq[symmetric]]
  19.271 +    have f_A1: "prod ?f ?A = c ^ card ?A"
  19.272 +      unfolding f_A0 by (rule prod_constant)
  19.273 +    have "prod ?f ?A * prod ?f ?B = prod ?f S"
  19.274 +      using prod.union_disjoint[OF fin' disjoint, of ?f, unfolded eq[symmetric]]
  19.275        by simp
  19.276      with True card_A show ?thesis
  19.277 -      by (simp add: f_A1 field_simps cong add: setprod.cong cong del: if_weak_cong)
  19.278 +      by (simp add: f_A1 field_simps cong add: prod.cong cong del: if_weak_cong)
  19.279    qed
  19.280  qed
  19.281  
    20.1 --- a/src/HOL/Groups_List.thy	Mon Oct 17 14:37:32 2016 +0200
    20.2 +++ b/src/HOL/Groups_List.thy	Mon Oct 17 17:33:07 2016 +0200
    20.3 @@ -340,15 +340,15 @@
    20.4    from prod_list_def show "monoid_list.F times 1 = prod_list" by simp
    20.5  qed
    20.6  
    20.7 -sublocale setprod: comm_monoid_list_set times 1
    20.8 +sublocale prod: comm_monoid_list_set times 1
    20.9  rewrites
   20.10    "monoid_list.F times 1 = prod_list"
   20.11 -  and "comm_monoid_set.F times 1 = setprod"
   20.12 +  and "comm_monoid_set.F times 1 = prod"
   20.13  proof -
   20.14    show "comm_monoid_list_set times 1" ..
   20.15 -  then interpret setprod: comm_monoid_list_set times 1 .
   20.16 +  then interpret prod: comm_monoid_list_set times 1 .
   20.17    from prod_list_def show "monoid_list.F times 1 = prod_list" by simp
   20.18 -  from setprod_def show "comm_monoid_set.F times 1 = setprod" by (auto intro: sym)
   20.19 +  from prod_def show "comm_monoid_set.F times 1 = prod" by (auto intro: sym)
   20.20  qed
   20.21  
   20.22  end
    21.1 --- a/src/HOL/Int.thy	Mon Oct 17 14:37:32 2016 +0200
    21.2 +++ b/src/HOL/Int.thy	Mon Oct 17 17:33:07 2016 +0200
    21.3 @@ -866,7 +866,7 @@
    21.4  qed
    21.5  
    21.6  
    21.7 -subsection \<open>@{term sum} and @{term setprod}\<close>
    21.8 +subsection \<open>@{term sum} and @{term prod}\<close>
    21.9  
   21.10  lemma of_nat_sum [simp]: "of_nat (sum f A) = (\<Sum>x\<in>A. of_nat(f x))"
   21.11    by (induct A rule: infinite_finite_induct) auto
   21.12 @@ -874,14 +874,14 @@
   21.13  lemma of_int_sum [simp]: "of_int (sum f A) = (\<Sum>x\<in>A. of_int(f x))"
   21.14    by (induct A rule: infinite_finite_induct) auto
   21.15  
   21.16 -lemma of_nat_setprod [simp]: "of_nat (setprod f A) = (\<Prod>x\<in>A. of_nat(f x))"
   21.17 +lemma of_nat_prod [simp]: "of_nat (prod f A) = (\<Prod>x\<in>A. of_nat(f x))"
   21.18    by (induct A rule: infinite_finite_induct) auto
   21.19  
   21.20 -lemma of_int_setprod [simp]: "of_int (setprod f A) = (\<Prod>x\<in>A. of_int(f x))"
   21.21 +lemma of_int_prod [simp]: "of_int (prod f A) = (\<Prod>x\<in>A. of_int(f x))"
   21.22    by (induct A rule: infinite_finite_induct) auto
   21.23  
   21.24  lemmas int_sum = of_nat_sum [where 'a=int]
   21.25 -lemmas int_setprod = of_nat_setprod [where 'a=int]
   21.26 +lemmas int_prod = of_nat_prod [where 'a=int]
   21.27  
   21.28  
   21.29  text \<open>Legacy theorems\<close>
    22.1 --- a/src/HOL/Library/Extended_Nonnegative_Real.thy	Mon Oct 17 14:37:32 2016 +0200
    22.2 +++ b/src/HOL/Library/Extended_Nonnegative_Real.thy	Mon Oct 17 17:33:07 2016 +0200
    22.3 @@ -550,12 +550,12 @@
    22.4  lemma top_power_ennreal: "top ^ n = (if n = 0 then 1 else top :: ennreal)"
    22.5    by (induction n) (simp_all add: ennreal_mult_eq_top_iff)
    22.6  
    22.7 -lemma ennreal_setprod_eq_0[simp]:
    22.8 +lemma ennreal_prod_eq_0[simp]:
    22.9    fixes f :: "'a \<Rightarrow> ennreal"
   22.10 -  shows "(setprod f A = 0) = (finite A \<and> (\<exists>i\<in>A. f i = 0))"
   22.11 +  shows "(prod f A = 0) = (finite A \<and> (\<exists>i\<in>A. f i = 0))"
   22.12    by (induction A rule: infinite_finite_induct) auto
   22.13  
   22.14 -lemma ennreal_setprod_eq_top:
   22.15 +lemma ennreal_prod_eq_top:
   22.16    fixes f :: "'a \<Rightarrow> ennreal"
   22.17    shows "(\<Prod>i\<in>I. f i) = top \<longleftrightarrow> (finite I \<and> ((\<forall>i\<in>I. f i \<noteq> 0) \<and> (\<exists>i\<in>I. f i = top)))"
   22.18    by (induction I rule: infinite_finite_induct) (auto simp: ennreal_mult_eq_top_iff)
   22.19 @@ -1047,9 +1047,9 @@
   22.20  lemma ennreal_divide_numeral: "0 \<le> x \<Longrightarrow> ennreal x / numeral b = ennreal (x / numeral b)"
   22.21    by (subst divide_ennreal[symmetric]) auto
   22.22  
   22.23 -lemma setprod_ennreal: "(\<And>i. i \<in> A \<Longrightarrow> 0 \<le> f i) \<Longrightarrow> (\<Prod>i\<in>A. ennreal (f i)) = ennreal (setprod f A)"
   22.24 +lemma prod_ennreal: "(\<And>i. i \<in> A \<Longrightarrow> 0 \<le> f i) \<Longrightarrow> (\<Prod>i\<in>A. ennreal (f i)) = ennreal (prod f A)"
   22.25    by (induction A rule: infinite_finite_induct)
   22.26 -     (auto simp: ennreal_mult setprod_nonneg)
   22.27 +     (auto simp: ennreal_mult prod_nonneg)
   22.28  
   22.29  lemma mult_right_ennreal_cancel: "a * ennreal c = b * ennreal c \<longleftrightarrow> (a = b \<or> c \<le> 0)"
   22.30    apply (cases "0 \<le> c")
    23.1 --- a/src/HOL/Library/Extended_Real.thy	Mon Oct 17 14:37:32 2016 +0200
    23.2 +++ b/src/HOL/Library/Extended_Real.thy	Mon Oct 17 17:33:07 2016 +0200
    23.3 @@ -1180,7 +1180,7 @@
    23.4    shows "y \<le> x"
    23.5    by (metis assms ereal_bot ereal_cases ereal_infty_less_eq(2) ereal_less_eq(1) linorder_le_cases)
    23.6  
    23.7 -lemma setprod_ereal_0:
    23.8 +lemma prod_ereal_0:
    23.9    fixes f :: "'a \<Rightarrow> ereal"
   23.10    shows "(\<Prod>i\<in>A. f i) = 0 \<longleftrightarrow> finite A \<and> (\<exists>i\<in>A. f i = 0)"
   23.11  proof (cases "finite A")
   23.12 @@ -1191,7 +1191,7 @@
   23.13    then show ?thesis by auto
   23.14  qed
   23.15  
   23.16 -lemma setprod_ereal_pos:
   23.17 +lemma prod_ereal_pos:
   23.18    fixes f :: "'a \<Rightarrow> ereal"
   23.19    assumes pos: "\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i"
   23.20    shows "0 \<le> (\<Prod>i\<in>I. f i)"
   23.21 @@ -1204,7 +1204,7 @@
   23.22    then show ?thesis by simp
   23.23  qed
   23.24  
   23.25 -lemma setprod_PInf:
   23.26 +lemma prod_PInf:
   23.27    fixes f :: "'a \<Rightarrow> ereal"
   23.28    assumes "\<And>i. i \<in> I \<Longrightarrow> 0 \<le> f i"
   23.29    shows "(\<Prod>i\<in>I. f i) = \<infinity> \<longleftrightarrow> finite I \<and> (\<exists>i\<in>I. f i = \<infinity>) \<and> (\<forall>i\<in>I. f i \<noteq> 0)"
   23.30 @@ -1213,15 +1213,15 @@
   23.31    from this assms show ?thesis
   23.32    proof (induct I)
   23.33      case (insert i I)
   23.34 -    then have pos: "0 \<le> f i" "0 \<le> setprod f I"
   23.35 -      by (auto intro!: setprod_ereal_pos)
   23.36 -    from insert have "(\<Prod>j\<in>insert i I. f j) = \<infinity> \<longleftrightarrow> setprod f I * f i = \<infinity>"
   23.37 +    then have pos: "0 \<le> f i" "0 \<le> prod f I"
   23.38 +      by (auto intro!: prod_ereal_pos)
   23.39 +    from insert have "(\<Prod>j\<in>insert i I. f j) = \<infinity> \<longleftrightarrow> prod f I * f i = \<infinity>"
   23.40        by auto
   23.41 -    also have "\<dots> \<longleftrightarrow> (setprod f I = \<infinity> \<or> f i = \<infinity>) \<and> f i \<noteq> 0 \<and> setprod f I \<noteq> 0"
   23.42 -      using setprod_ereal_pos[of I f] pos
   23.43 -      by (cases rule: ereal2_cases[of "f i" "setprod f I"]) auto
   23.44 +    also have "\<dots> \<longleftrightarrow> (prod f I = \<infinity> \<or> f i = \<infinity>) \<and> f i \<noteq> 0 \<and> prod f I \<noteq> 0"
   23.45 +      using prod_ereal_pos[of I f] pos
   23.46 +      by (cases rule: ereal2_cases[of "f i" "prod f I"]) auto
   23.47      also have "\<dots> \<longleftrightarrow> finite (insert i I) \<and> (\<exists>j\<in>insert i I. f j = \<infinity>) \<and> (\<forall>j\<in>insert i I. f j \<noteq> 0)"
   23.48 -      using insert by (auto simp: setprod_ereal_0)
   23.49 +      using insert by (auto simp: prod_ereal_0)
   23.50      finally show ?case .
   23.51    qed simp
   23.52  next
   23.53 @@ -1229,7 +1229,7 @@
   23.54    then show ?thesis by simp
   23.55  qed
   23.56  
   23.57 -lemma setprod_ereal: "(\<Prod>i\<in>A. ereal (f i)) = ereal (setprod f A)"
   23.58 +lemma prod_ereal: "(\<Prod>i\<in>A. ereal (f i)) = ereal (prod f A)"
   23.59  proof (cases "finite A")
   23.60    case True
   23.61    then show ?thesis
    24.1 --- a/src/HOL/Library/Formal_Power_Series.thy	Mon Oct 17 14:37:32 2016 +0200
    24.2 +++ b/src/HOL/Library/Formal_Power_Series.thy	Mon Oct 17 17:33:07 2016 +0200
    24.3 @@ -2278,11 +2278,11 @@
    24.4  qed
    24.5  
    24.6  text \<open>The general form.\<close>
    24.7 -lemma fps_setprod_nth:
    24.8 +lemma fps_prod_nth:
    24.9    fixes m :: nat
   24.10      and a :: "nat \<Rightarrow> 'a::comm_ring_1 fps"
   24.11 -  shows "(setprod a {0 .. m}) $ n =
   24.12 -    sum (\<lambda>v. setprod (\<lambda>j. (a j) $ (v!j)) {0..m}) (natpermute n (m+1))"
   24.13 +  shows "(prod a {0 .. m}) $ n =
   24.14 +    sum (\<lambda>v. prod (\<lambda>j. (a j) $ (v!j)) {0..m}) (natpermute n (m+1))"
   24.15    (is "?P m n")
   24.16  proof (induct m arbitrary: n rule: nat_less_induct)
   24.17    fix m n assume H: "\<forall>m' < m. \<forall>n. ?P m' n"
   24.18 @@ -2301,8 +2301,8 @@
   24.19        using Suc by (simp add: set_eq_iff) presburger
   24.20      have f0: "finite {0 .. k}" "finite {m}" by auto
   24.21      have d0: "{0 .. k} \<inter> {m} = {}" using Suc by auto
   24.22 -    have "(setprod a {0 .. m}) $ n = (setprod a {0 .. k} * a m) $ n"
   24.23 -      unfolding setprod.union_disjoint[OF f0 d0, unfolded u0] by simp
   24.24 +    have "(prod a {0 .. m}) $ n = (prod a {0 .. k} * a m) $ n"
   24.25 +      unfolding prod.union_disjoint[OF f0 d0, unfolded u0] by simp
   24.26      also have "\<dots> = (\<Sum>i = 0..n. (\<Sum>v\<in>natpermute i (k + 1). \<Prod>j\<in>{0..k}. a j $ v ! j) * a m $ (n - i))"
   24.27        unfolding fps_mult_nth H[rule_format, OF km] ..
   24.28      also have "\<dots> = (\<Sum>v\<in>natpermute n (m + 1). \<Prod>j\<in>{0..m}. a j $ v ! j)"
   24.29 @@ -2325,7 +2325,7 @@
   24.30        apply (rule_tac l = "\<lambda>xs. xs @ [n - x]" in sum.reindex_cong)
   24.31        apply (simp add: inj_on_def)
   24.32        apply auto
   24.33 -      unfolding setprod.union_disjoint[OF f0 d0, unfolded u0, unfolded Suc]
   24.34 +      unfolding prod.union_disjoint[OF f0 d0, unfolded u0, unfolded Suc]
   24.35        apply (clarsimp simp add: natpermute_def nth_append)
   24.36        done
   24.37      finally show ?thesis .
   24.38 @@ -2336,18 +2336,18 @@
   24.39  lemma fps_power_nth_Suc:
   24.40    fixes m :: nat
   24.41      and a :: "'a::comm_ring_1 fps"
   24.42 -  shows "(a ^ Suc m)$n = sum (\<lambda>v. setprod (\<lambda>j. a $ (v!j)) {0..m}) (natpermute n (m+1))"
   24.43 +  shows "(a ^ Suc m)$n = sum (\<lambda>v. prod (\<lambda>j. a $ (v!j)) {0..m}) (natpermute n (m+1))"
   24.44  proof -
   24.45 -  have th0: "a^Suc m = setprod (\<lambda>i. a) {0..m}"
   24.46 -    by (simp add: setprod_constant)
   24.47 -  show ?thesis unfolding th0 fps_setprod_nth ..
   24.48 +  have th0: "a^Suc m = prod (\<lambda>i. a) {0..m}"
   24.49 +    by (simp add: prod_constant)
   24.50 +  show ?thesis unfolding th0 fps_prod_nth ..
   24.51  qed
   24.52  
   24.53  lemma fps_power_nth:
   24.54    fixes m :: nat
   24.55      and a :: "'a::comm_ring_1 fps"
   24.56    shows "(a ^m)$n =
   24.57 -    (if m=0 then 1$n else sum (\<lambda>v. setprod (\<lambda>j. a $ (v!j)) {0..m - 1}) (natpermute n m))"
   24.58 +    (if m=0 then 1$n else sum (\<lambda>v. prod (\<lambda>j. a $ (v!j)) {0..m - 1}) (natpermute n m))"
   24.59    by (cases m) (simp_all add: fps_power_nth_Suc del: power_Suc)
   24.60  
   24.61  lemma fps_nth_power_0:
   24.62 @@ -2360,10 +2360,10 @@
   24.63  next
   24.64    case (Suc n)
   24.65    then have c: "m = card {0..n}" by simp
   24.66 -  have "(a ^m)$0 = setprod (\<lambda>i. a$0) {0..n}"
   24.67 +  have "(a ^m)$0 = prod (\<lambda>i. a$0) {0..n}"
   24.68      by (simp add: Suc fps_power_nth del: replicate.simps power_Suc)
   24.69    also have "\<dots> = (a$0) ^ m"
   24.70 -   unfolding c by (rule setprod_constant)
   24.71 +   unfolding c by (rule prod_constant)
   24.72   finally show ?thesis .
   24.73  qed
   24.74  
   24.75 @@ -2433,10 +2433,10 @@
   24.76        
   24.77      from j have "{0..m} = insert j ({0..m} - {j})" by auto
   24.78      also from j have "(\<Prod>i\<in>\<dots>. f $ (v ! i)) = f $ k * (\<Prod>i\<in>{0..m} - {j}. f $ (v ! i))"
   24.79 -      by (subst setprod.insert) auto
   24.80 +      by (subst prod.insert) auto
   24.81      also have "(\<Prod>i\<in>{0..m} - {j}. f $ (v ! i)) = (\<Prod>i\<in>{0..m} - {j}. f $ 0)"
   24.82 -      by (intro setprod.cong) (simp_all add: zero)
   24.83 -    also from j have "\<dots> = (f $ 0) ^ m" by (subst setprod_constant) simp_all
   24.84 +      by (intro prod.cong) (simp_all add: zero)
   24.85 +    also from j have "\<dots> = (f $ 0) ^ m" by (subst prod_constant) simp_all
   24.86      finally have "(\<Prod>j = 0..m. f $ (v ! j)) = f $ k * (f $ 0) ^ m" .
   24.87    } note A = this
   24.88    
   24.89 @@ -2472,7 +2472,7 @@
   24.90          using that elem_le_sum_list_nat[of i v] unfolding natpermute_def
   24.91          by (auto simp: set_conv_nth dest!: spec[of _ i])
   24.92        hence "?h f = ?h g"
   24.93 -        by (intro sum.cong refl setprod.cong less lessI) (auto simp: natpermute_def)
   24.94 +        by (intro sum.cong refl prod.cong less lessI) (auto simp: natpermute_def)
   24.95        finally have "f $ k * (of_nat (Suc m) * (f $ 0) ^ m) = g $ k * (of_nat (Suc m) * (f $ 0) ^ m)"
   24.96          by simp
   24.97        with assms show "f $ k = g $ k" 
   24.98 @@ -2567,7 +2567,7 @@
   24.99  
  24.100  subsection \<open>Radicals\<close>
  24.101  
  24.102 -declare setprod.cong [fundef_cong]
  24.103 +declare prod.cong [fundef_cong]
  24.104  
  24.105  function radical :: "(nat \<Rightarrow> 'a \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a::field fps \<Rightarrow> nat \<Rightarrow> 'a"
  24.106  where
  24.107 @@ -2575,7 +2575,7 @@
  24.108  | "radical r 0 a (Suc n) = 0"
  24.109  | "radical r (Suc k) a 0 = r (Suc k) (a$0)"
  24.110  | "radical r (Suc k) a (Suc n) =
  24.111 -    (a$ Suc n - sum (\<lambda>xs. setprod (\<lambda>j. radical r (Suc k) a (xs ! j)) {0..k})
  24.112 +    (a$ Suc n - sum (\<lambda>xs. prod (\<lambda>j. radical r (Suc k) a (xs ! j)) {0..k})
  24.113        {xs. xs \<in> natpermute (Suc n) (Suc k) \<and> Suc n \<notin> set xs}) /
  24.114      (of_nat (Suc k) * (radical r (Suc k) a 0)^k)"
  24.115    by pat_completeness auto
  24.116 @@ -2641,14 +2641,14 @@
  24.117    have eq1: "fps_radical r k a ^ k $ 0 = (\<Prod>j\<in>{0..h}. fps_radical r k a $ (replicate k 0) ! j)"
  24.118      unfolding fps_power_nth Suc by simp
  24.119    also have "\<dots> = (\<Prod>j\<in>{0..h}. r k (a$0))"
  24.120 -    apply (rule setprod.cong)
  24.121 +    apply (rule prod.cong)
  24.122      apply simp
  24.123      using Suc
  24.124      apply (subgoal_tac "replicate k 0 ! x = 0")
  24.125      apply (auto intro: nth_replicate simp del: replicate.simps)
  24.126      done
  24.127    also have "\<dots> = a$0"
  24.128 -    using r Suc by (simp add: setprod_constant)
  24.129 +    using r Suc by (simp add: prod_constant)
  24.130    finally show ?thesis
  24.131      using Suc by simp
  24.132  qed
  24.133 @@ -2693,12 +2693,12 @@
  24.134              unfolding natpermute_contain_maximal by auto
  24.135            have "(\<Prod>j\<in>{0..k}. fps_radical r (Suc k) a $ v ! j) =
  24.136                (\<Prod>j\<in>{0..k}. if j = i then fps_radical r (Suc k) a $ n else r (Suc k) (a$0))"
  24.137 -            apply (rule setprod.cong, simp)
  24.138 +            apply (rule prod.cong, simp)
  24.139              using i r0
  24.140              apply (simp del: replicate.simps)
  24.141              done
  24.142            also have "\<dots> = (fps_radical r (Suc k) a $ n) * r (Suc k) (a$0) ^ k"
  24.143 -            using i r0 by (simp add: setprod_gen_delta)
  24.144 +            using i r0 by (simp add: prod_gen_delta)
  24.145            finally show ?ths .
  24.146          qed rule
  24.147          then have "sum ?f ?Pnkn = of_nat (k+1) * ?r $ n * r (Suc k) (a $ 0) ^ k"
  24.148 @@ -2720,7 +2720,7 @@
  24.149        by simp
  24.150      then show ?thesis
  24.151        unfolding fps_power_nth_Suc
  24.152 -      by (simp add: setprod_constant del: replicate.simps)
  24.153 +      by (simp add: prod_constant del: replicate.simps)
  24.154    qed
  24.155  qed
  24.156  
  24.157 @@ -2757,10 +2757,10 @@
  24.158            from v obtain i where i: "i \<in> {0..k}" "v = replicate (k+1) 0 [i:= n]"
  24.159              unfolding natpermute_contain_maximal by auto
  24.160            have "(\<Prod>j\<in>{0..k}. fps_radical r (Suc k) a $ v ! j) = (\<Prod>j\<in>{0..k}. if j = i then fps_radical r (Suc k) a $ n else r (Suc k) (a$0))"
  24.161 -            apply (rule setprod.cong, simp)
  24.162 +            apply (rule prod.cong, simp)
  24.163              using i r0 by (simp del: replicate.simps)
  24.164            also have "\<dots> = (fps_radical r (Suc k) a $ n) * r (Suc k) (a$0) ^ k"
  24.165 -            unfolding setprod_gen_delta[OF fK] using i r0 by simp
  24.166 +            unfolding prod_gen_delta[OF fK] using i r0 by simp
  24.167            finally show ?ths .
  24.168          qed
  24.169          then have "sum ?f ?Pnkn = of_nat (k+1) * ?r $ n * r (Suc k) (a $ 0) ^ k"
  24.170 @@ -2828,18 +2828,18 @@
  24.171              unfolding Suc_eq_plus1 natpermute_contain_maximal
  24.172              by (auto simp del: replicate.simps)
  24.173            have "(\<Prod>j\<in>{0..k}. a $ v ! j) = (\<Prod>j\<in>{0..k}. if j = i then a $ n else r (Suc k) (b$0))"
  24.174 -            apply (rule setprod.cong, simp)
  24.175 +            apply (rule prod.cong, simp)
  24.176              using i a0
  24.177              apply (simp del: replicate.simps)
  24.178              done
  24.179            also have "\<dots> = a $ n * (?r $ 0)^k"
  24.180 -            using i by (simp add: setprod_gen_delta)
  24.181 +            using i by (simp add: prod_gen_delta)
  24.182            finally show ?ths .
  24.183          qed rule
  24.184          then have th0: "sum ?g ?Pnkn = of_nat (k+1) * a $ n * (?r $ 0)^k"
  24.185            by (simp add: natpermute_max_card[OF nz, simplified])
  24.186          have th1: "sum ?g ?Pnknn = sum ?f ?Pnknn"
  24.187 -        proof (rule sum.cong, rule refl, rule setprod.cong, simp)
  24.188 +        proof (rule sum.cong, rule refl, rule prod.cong, simp)
  24.189            fix xs i
  24.190            assume xs: "xs \<in> ?Pnknn" and i: "i \<in> {0..k}"
  24.191            have False if c: "n \<le> xs ! i"
  24.192 @@ -3380,9 +3380,9 @@
  24.193    apply (simp add: fps_compose_nth fps_mult_nth sum_distrib_right)
  24.194    done
  24.195  
  24.196 -lemma fps_compose_setprod_distrib:
  24.197 +lemma fps_compose_prod_distrib:
  24.198    assumes c0: "c$0 = (0::'a::idom)"
  24.199 -  shows "setprod a S oo c = setprod (\<lambda>k. a k oo c) S"
  24.200 +  shows "prod a S oo c = prod (\<lambda>k. a k oo c) S"
  24.201    apply (cases "finite S")
  24.202    apply simp_all
  24.203    apply (induct S rule: finite_induct)
  24.204 @@ -3413,10 +3413,10 @@
  24.205    then show ?thesis by simp
  24.206  next
  24.207    case (Suc m)
  24.208 -  have th0: "a^n = setprod (\<lambda>k. a) {0..m}" "(a oo c) ^ n = setprod (\<lambda>k. a oo c) {0..m}"
  24.209 -    by (simp_all add: setprod_constant Suc)
  24.210 +  have th0: "a^n = prod (\<lambda>k. a) {0..m}" "(a oo c) ^ n = prod (\<lambda>k. a oo c) {0..m}"
  24.211 +    by (simp_all add: prod_constant Suc)
  24.212    then show ?thesis
  24.213 -    by (simp add: fps_compose_setprod_distrib[OF c0])
  24.214 +    by (simp add: fps_compose_prod_distrib[OF c0])
  24.215  qed
  24.216  
  24.217  lemma fps_compose_uminus: "- (a::'a::ring_1 fps) oo c = - (a oo c)"
  24.218 @@ -4155,8 +4155,8 @@
  24.219          case False
  24.220          with kn have kn': "k < n"
  24.221            by simp
  24.222 -        have m1nk: "?m1 n = setprod (\<lambda>i. - 1) {..m}" "?m1 k = setprod (\<lambda>i. - 1) {0..h}"
  24.223 -          by (simp_all add: setprod_constant m h)
  24.224 +        have m1nk: "?m1 n = prod (\<lambda>i. - 1) {..m}" "?m1 k = prod (\<lambda>i. - 1) {0..h}"
  24.225 +          by (simp_all add: prod_constant m h)
  24.226          have bnz0: "pochhammer (b - of_nat n + 1) k \<noteq> 0"
  24.227            using bn0 kn
  24.228            unfolding pochhammer_eq_0_iff
  24.229 @@ -4164,37 +4164,37 @@
  24.230            apply (erule_tac x= "n - ka - 1" in allE)
  24.231            apply (auto simp add: algebra_simps of_nat_diff)
  24.232            done
  24.233 -        have eq1: "setprod (\<lambda>k. (1::'a) + of_nat m - of_nat k) {..h} =
  24.234 -          setprod of_nat {Suc (m - h) .. Suc m}"
  24.235 +        have eq1: "prod (\<lambda>k. (1::'a) + of_nat m - of_nat k) {..h} =
  24.236 +          prod of_nat {Suc (m - h) .. Suc m}"
  24.237            using kn' h m
  24.238 -          by (intro setprod.reindex_bij_witness[where i="\<lambda>k. Suc m - k" and j="\<lambda>k. Suc m - k"])
  24.239 +          by (intro prod.reindex_bij_witness[where i="\<lambda>k. Suc m - k" and j="\<lambda>k. Suc m - k"])
  24.240               (auto simp: of_nat_diff)
  24.241          have th1: "(?m1 k * ?p (of_nat n) k) / ?f n = 1 / of_nat(fact (n - k))"
  24.242            apply (simp add: pochhammer_minus field_simps)
  24.243            using \<open>k \<le> n\<close> apply (simp add: fact_split [of k n])
  24.244 -          apply (simp add: pochhammer_setprod)
  24.245 -          using setprod.atLeast_lessThan_shift_bounds [where ?'a = 'a, of "\<lambda>i. 1 + of_nat i" 0 "n - k" k]
  24.246 +          apply (simp add: pochhammer_prod)
  24.247 +          using prod.atLeast_lessThan_shift_bounds [where ?'a = 'a, of "\<lambda>i. 1 + of_nat i" 0 "n - k" k]
  24.248            apply (auto simp add: of_nat_diff field_simps)
  24.249            done
  24.250 -        have th20: "?m1 n * ?p b n = setprod (\<lambda>i. b - of_nat i) {0..m}"
  24.251 +        have th20: "?m1 n * ?p b n = prod (\<lambda>i. b - of_nat i) {0..m}"
  24.252            apply (simp add: pochhammer_minus field_simps m)
  24.253 -          apply (auto simp add: pochhammer_setprod_rev of_nat_diff setprod.atLeast_Suc_atMost_Suc_shift)
  24.254 +          apply (auto simp add: pochhammer_prod_rev of_nat_diff prod.atLeast_Suc_atMost_Suc_shift)
  24.255            done
  24.256 -        have th21:"pochhammer (b - of_nat n + 1) k = setprod (\<lambda>i. b - of_nat i) {n - k .. n - 1}"
  24.257 -          using kn apply (simp add: pochhammer_setprod_rev m h setprod.atLeast_Suc_atMost_Suc_shift)
  24.258 -          using setprod.atLeast_atMost_shift_0 [of "m - h" m, where ?'a = 'a]
  24.259 +        have th21:"pochhammer (b - of_nat n + 1) k = prod (\<lambda>i. b - of_nat i) {n - k .. n - 1}"
  24.260 +          using kn apply (simp add: pochhammer_prod_rev m h prod.atLeast_Suc_atMost_Suc_shift)
  24.261 +          using prod.atLeast_atMost_shift_0 [of "m - h" m, where ?'a = 'a]
  24.262            apply (auto simp add: of_nat_diff field_simps)
  24.263            done
  24.264          have "?m1 n * ?p b n =
  24.265 -          setprod (\<lambda>i. b - of_nat i) {0.. n - k - 1} * pochhammer (b - of_nat n + 1) k"
  24.266 +          prod (\<lambda>i. b - of_nat i) {0.. n - k - 1} * pochhammer (b - of_nat n + 1) k"
  24.267            using kn' m h unfolding th20 th21 apply simp
  24.268 -          apply (subst setprod.union_disjoint [symmetric])
  24.269 +          apply (subst prod.union_disjoint [symmetric])
  24.270            apply auto
  24.271 -          apply (rule setprod.cong)
  24.272 +          apply (rule prod.cong)
  24.273            apply auto
  24.274            done
  24.275          then have th2: "(?m1 n * ?p b n)/pochhammer (b - of_nat n + 1) k =
  24.276 -          setprod (\<lambda>i. b - of_nat i) {0.. n - k - 1}"
  24.277 +          prod (\<lambda>i. b - of_nat i) {0.. n - k - 1}"
  24.278            using nz' by (simp add: field_simps)
  24.279          have "(?m1 n * ?p b n * ?m1 k * ?p (of_nat n) k) / (?f n * pochhammer (b - of_nat n + 1) k) =
  24.280            ((?m1 k * ?p (of_nat n) k) / ?f n) * ((?m1 n * ?p b n)/pochhammer (b - of_nat n + 1) k)"
  24.281 @@ -4204,7 +4204,7 @@
  24.282            unfolding th1 th2
  24.283            using kn' m h
  24.284            apply (simp add: field_simps gbinomial_mult_fact)
  24.285 -          apply (rule setprod.cong)
  24.286 +          apply (rule prod.cong)
  24.287            apply auto
  24.288            done
  24.289          finally show ?thesis by simp
    25.1 --- a/src/HOL/Library/Groups_Big_Fun.thy	Mon Oct 17 14:37:32 2016 +0200
    25.2 +++ b/src/HOL/Library/Groups_Big_Fun.thy	Mon Oct 17 17:33:07 2016 +0200
    25.3 @@ -283,11 +283,11 @@
    25.4  
    25.5  sublocale Prod_any: comm_monoid_fun times 1
    25.6    defines Prod_any = Prod_any.G
    25.7 -  rewrites "comm_monoid_set.F times 1 = setprod"
    25.8 +  rewrites "comm_monoid_set.F times 1 = prod"
    25.9  proof -
   25.10    show "comm_monoid_fun times 1" ..
   25.11    then interpret Prod_any: comm_monoid_fun times 1 .
   25.12 -  from setprod_def show "comm_monoid_set.F times 1 = setprod" by (auto intro: sym)
   25.13 +  from prod_def show "comm_monoid_set.F times 1 = prod" by (auto intro: sym)
   25.14  qed
   25.15  
   25.16  end
   25.17 @@ -308,7 +308,7 @@
   25.18    from \<open>f a = 0\<close> have "f a \<noteq> 1" by simp
   25.19    with \<open>f a = 0\<close> have "\<exists>a. f a \<noteq> 1 \<and> f a = 0" by blast
   25.20    with \<open>finite {a. f a \<noteq> 1}\<close> show ?thesis
   25.21 -    by (simp add: Prod_any.expand_set setprod_zero)
   25.22 +    by (simp add: Prod_any.expand_set prod_zero)
   25.23  qed
   25.24  
   25.25  lemma Prod_any_not_zero:
    26.1 --- a/src/HOL/Library/Multiset.thy	Mon Oct 17 14:37:32 2016 +0200
    26.2 +++ b/src/HOL/Library/Multiset.thy	Mon Oct 17 17:33:07 2016 +0200
    26.3 @@ -2269,13 +2269,13 @@
    26.4    "prod_mset (replicate_mset n a) = a ^ n"
    26.5    by (induct n) simp_all
    26.6  
    26.7 -lemma setprod_unfold_prod_mset:
    26.8 -  "setprod f A = prod_mset (image_mset f (mset_set A))"
    26.9 +lemma prod_unfold_prod_mset:
   26.10 +  "prod f A = prod_mset (image_mset f (mset_set A))"
   26.11    by (cases "finite A") (induct A rule: finite_induct, simp_all)
   26.12  
   26.13  lemma prod_mset_multiplicity:
   26.14 -  "prod_mset M = setprod (\<lambda>x. x ^ count M x) (set_mset M)"
   26.15 -  by (simp add: fold_mset_def setprod.eq_fold prod_mset.eq_fold funpow_times_power comp_def)
   26.16 +  "prod_mset M = prod (\<lambda>x. x ^ count M x) (set_mset M)"
   26.17 +  by (simp add: fold_mset_def prod.eq_fold prod_mset.eq_fold funpow_times_power comp_def)
   26.18  
   26.19  lemma prod_mset_delta: "prod_mset (image_mset (\<lambda>x. if x = y then c else 1) A) = c ^ count A y"
   26.20    by (induction A) simp_all
    27.1 --- a/src/HOL/Library/Multiset_Permutations.thy	Mon Oct 17 14:37:32 2016 +0200
    27.2 +++ b/src/HOL/Library/Multiset_Permutations.thy	Mon Oct 17 17:33:07 2016 +0200
    27.3 @@ -161,24 +161,24 @@
    27.4  context
    27.5  begin
    27.6  
    27.7 -private lemma multiset_setprod_fact_insert:
    27.8 +private lemma multiset_prod_fact_insert:
    27.9    "(\<Prod>y\<in>set_mset (A+{#x#}). fact (count (A+{#x#}) y)) =
   27.10       (count A x + 1) * (\<Prod>y\<in>set_mset A. fact (count A y))"
   27.11  proof -
   27.12    have "(\<Prod>y\<in>set_mset (A+{#x#}). fact (count (A+{#x#}) y)) =
   27.13            (\<Prod>y\<in>set_mset (A+{#x#}). (if y = x then count A x + 1 else 1) * fact (count A y))"
   27.14 -    by (intro setprod.cong) simp_all
   27.15 +    by (intro prod.cong) simp_all
   27.16    also have "\<dots> = (count A x + 1) * (\<Prod>y\<in>set_mset (A+{#x#}). fact (count A y))"
   27.17 -    by (simp add: setprod.distrib setprod.delta)
   27.18 +    by (simp add: prod.distrib prod.delta)
   27.19    also have "(\<Prod>y\<in>set_mset (A+{#x#}). fact (count A y)) = (\<Prod>y\<in>set_mset A. fact (count A y))"
   27.20 -    by (intro setprod.mono_neutral_right) (auto simp: not_in_iff)
   27.21 +    by (intro prod.mono_neutral_right) (auto simp: not_in_iff)
   27.22    finally show ?thesis .
   27.23  qed
   27.24  
   27.25 -private lemma multiset_setprod_fact_remove:
   27.26 +private lemma multiset_prod_fact_remove:
   27.27    "x \<in># A \<Longrightarrow> (\<Prod>y\<in>set_mset A. fact (count A y)) =
   27.28                     count A x * (\<Prod>y\<in>set_mset (A-{#x#}). fact (count (A-{#x#}) y))"
   27.29 -  using multiset_setprod_fact_insert[of "A - {#x#}" x] by simp
   27.30 +  using multiset_prod_fact_insert[of "A - {#x#}" x] by simp
   27.31  
   27.32  lemma card_permutations_of_multiset_aux:
   27.33    "card (permutations_of_multiset A) * (\<Prod>x\<in>set_mset A. fact (count A x)) = fact (size A)"
   27.34 @@ -199,7 +199,7 @@
   27.35      have "card (permutations_of_multiset (A - {#x#})) * (\<Prod>y\<in>set_mset A. fact (count A y)) = 
   27.36              count A x * (card (permutations_of_multiset (A - {#x#})) * 
   27.37                (\<Prod>y\<in>set_mset (A - {#x#}). fact (count (A - {#x#}) y)))" (is "?lhs = _")
   27.38 -      by (subst multiset_setprod_fact_remove[OF x]) simp_all
   27.39 +      by (subst multiset_prod_fact_remove[OF x]) simp_all
   27.40      also note remove.IH[OF x]
   27.41      also from x have "size (A - {#x#}) = size A - 1" by (simp add: size_Diff_submset)
   27.42      finally show "?lhs = count A x * fact (size A - 1)" .
   27.43 @@ -223,7 +223,7 @@
   27.44  proof -
   27.45    note card_permutations_of_multiset_aux[of "A + {#x#}"]
   27.46    also have "fact (size (A + {#x#})) = (size A + 1) * fact (size A)" by simp
   27.47 -  also note multiset_setprod_fact_insert[of A x]
   27.48 +  also note multiset_prod_fact_insert[of A x]
   27.49    also note card_permutations_of_multiset_aux[of A, symmetric]
   27.50    finally have "card (permutations_of_multiset (A + {#x#})) * (count A x + 1) *
   27.51                      (\<Prod>y\<in>set_mset A. fact (count A y)) =
    28.1 --- a/src/HOL/Library/Polynomial.thy	Mon Oct 17 14:37:32 2016 +0200
    28.2 +++ b/src/HOL/Library/Polynomial.thy	Mon Oct 17 17:33:07 2016 +0200
    28.3 @@ -1054,13 +1054,13 @@
    28.4    shows "poly (p ^ n) x = poly p x ^ n"
    28.5    by (induct n) simp_all
    28.6  
    28.7 -lemma poly_setprod: "poly (\<Prod>k\<in>A. p k) x = (\<Prod>k\<in>A. poly (p k) x)"
    28.8 +lemma poly_prod: "poly (\<Prod>k\<in>A. p k) x = (\<Prod>k\<in>A. poly (p k) x)"
    28.9    by (induct A rule: infinite_finite_induct) simp_all
   28.10  
   28.11 -lemma degree_setprod_sum_le: "finite S \<Longrightarrow> degree (setprod f S) \<le> sum (degree o f) S"
   28.12 +lemma degree_prod_sum_le: "finite S \<Longrightarrow> degree (prod f S) \<le> sum (degree o f) S"
   28.13  proof (induct S rule: finite_induct)
   28.14    case (insert a S)
   28.15 -  show ?case unfolding setprod.insert[OF insert(1-2)] sum.insert[OF insert(1-2)]
   28.16 +  show ?case unfolding prod.insert[OF insert(1-2)] sum.insert[OF insert(1-2)]
   28.17      by (rule le_trans[OF degree_mult_le], insert insert, auto)
   28.18  qed simp
   28.19  
   28.20 @@ -2856,7 +2856,7 @@
   28.21    by (cases "finite A", induction rule: finite_induct)
   28.22       (simp_all add: pcompose_1 pcompose_add)
   28.23  
   28.24 -lemma pcompose_setprod: "pcompose (setprod f A) p = setprod (\<lambda>i. pcompose (f i) p) A"
   28.25 +lemma pcompose_prod: "pcompose (prod f A) p = prod (\<lambda>i. pcompose (f i) p) A"
   28.26    by (cases "finite A", induction rule: finite_induct)
   28.27       (simp_all add: pcompose_1 pcompose_mult)
   28.28  
   28.29 @@ -3209,9 +3209,9 @@
   28.30         reflect_poly p ^ n"
   28.31    by (induction n) (simp_all add: reflect_poly_mult)
   28.32  
   28.33 -lemma reflect_poly_setprod:
   28.34 -  "reflect_poly (setprod (f :: _ \<Rightarrow> _ :: {comm_semiring_0,semiring_no_zero_divisors} poly) A) = 
   28.35 -     setprod (\<lambda>x. reflect_poly (f x)) A"
   28.36 +lemma reflect_poly_prod:
   28.37 +  "reflect_poly (prod (f :: _ \<Rightarrow> _ :: {comm_semiring_0,semiring_no_zero_divisors} poly) A) = 
   28.38 +     prod (\<lambda>x. reflect_poly (f x)) A"
   28.39    by (cases "finite A", induction rule: finite_induct) (simp_all add: reflect_poly_mult)
   28.40  
   28.41  lemma reflect_poly_prod_list:
   28.42 @@ -3225,7 +3225,7 @@
   28.43  
   28.44  lemmas reflect_poly_simps = 
   28.45    reflect_poly_0 reflect_poly_1 reflect_poly_const reflect_poly_smult reflect_poly_mult
   28.46 -  reflect_poly_power reflect_poly_setprod reflect_poly_prod_list
   28.47 +  reflect_poly_power reflect_poly_prod reflect_poly_prod_list
   28.48  
   28.49  
   28.50  subsection \<open>Derivatives of univariate polynomials\<close>
   28.51 @@ -3395,11 +3395,11 @@
   28.52  apply (simp add: algebra_simps)
   28.53  done
   28.54  
   28.55 -lemma pderiv_setprod: "pderiv (setprod f (as)) = 
   28.56 -  (\<Sum>a \<in> as. setprod f (as - {a}) * pderiv (f a))"
   28.57 +lemma pderiv_prod: "pderiv (prod f (as)) = 
   28.58 +  (\<Sum>a \<in> as. prod f (as - {a}) * pderiv (f a))"
   28.59  proof (induct as rule: infinite_finite_induct)
   28.60    case (insert a as)
   28.61 -  hence id: "setprod f (insert a as) = f a * setprod f as" 
   28.62 +  hence id: "prod f (insert a as) = f a * prod f as" 
   28.63      "\<And> g. sum g (insert a as) = g a + sum g as"
   28.64      "insert a as - {a} = as"
   28.65      by auto
   28.66 @@ -3407,9 +3407,9 @@
   28.67      fix b
   28.68      assume "b \<in> as"
   28.69      hence id2: "insert a as - {b} = insert a (as - {b})" using \<open>a \<notin> as\<close> by auto
   28.70 -    have "setprod f (insert a as - {b}) = f a * setprod f (as - {b})"
   28.71 +    have "prod f (insert a as - {b}) = f a * prod f (as - {b})"
   28.72        unfolding id2
   28.73 -      by (subst setprod.insert, insert insert, auto)
   28.74 +      by (subst prod.insert, insert insert, auto)
   28.75    } note id2 = this
   28.76    show ?case
   28.77      unfolding id pderiv_mult insert(3) sum_distrib_left
    29.1 --- a/src/HOL/Library/Polynomial_FPS.thy	Mon Oct 17 14:37:32 2016 +0200
    29.2 +++ b/src/HOL/Library/Polynomial_FPS.thy	Mon Oct 17 17:33:07 2016 +0200
    29.3 @@ -67,7 +67,7 @@
    29.4  lemma fps_of_poly_sum_list: "fps_of_poly (sum_list xs) = sum_list (map fps_of_poly xs)"
    29.5    by (induction xs) (simp_all add: fps_of_poly_add)
    29.6    
    29.7 -lemma fps_of_poly_setprod: "fps_of_poly (setprod f A) = setprod (\<lambda>x. fps_of_poly (f x)) A"
    29.8 +lemma fps_of_poly_prod: "fps_of_poly (prod f A) = prod (\<lambda>x. fps_of_poly (f x)) A"
    29.9    by (cases "finite A", induction rule: finite_induct) (simp_all add: fps_of_poly_mult)
   29.10    
   29.11  lemma fps_of_poly_prod_list: "fps_of_poly (prod_list xs) = prod_list (map fps_of_poly xs)"
   29.12 @@ -144,7 +144,7 @@
   29.13  lemmas fps_of_poly_simps =
   29.14    fps_of_poly_0 fps_of_poly_1 fps_of_poly_numeral fps_of_poly_const fps_of_poly_X
   29.15    fps_of_poly_add fps_of_poly_diff fps_of_poly_uminus fps_of_poly_mult fps_of_poly_smult
   29.16 -  fps_of_poly_sum fps_of_poly_sum_list fps_of_poly_setprod fps_of_poly_prod_list
   29.17 +  fps_of_poly_sum fps_of_poly_sum_list fps_of_poly_prod fps_of_poly_prod_list
   29.18    fps_of_poly_pCons fps_of_poly_pderiv fps_of_poly_power fps_of_poly_monom
   29.19    fps_of_poly_divide_numeral
   29.20  
    30.1 --- a/src/HOL/Library/RBT_Set.thy	Mon Oct 17 14:37:32 2016 +0200
    30.2 +++ b/src/HOL/Library/RBT_Set.thy	Mon Oct 17 17:33:07 2016 +0200
    30.3 @@ -88,7 +88,7 @@
    30.4    "sum = sum" ..
    30.5  
    30.6  lemma [code, code del]:
    30.7 -  "setprod = setprod" ..
    30.8 +  "prod = prod" ..
    30.9  
   30.10  lemma [code, code del]:
   30.11    "Product_Type.product = Product_Type.product"  ..
    31.1 --- a/src/HOL/Lifting_Set.thy	Mon Oct 17 14:37:32 2016 +0200
    31.2 +++ b/src/HOL/Lifting_Set.thy	Mon Oct 17 17:33:07 2016 +0200
    31.3 @@ -286,7 +286,7 @@
    31.4  qed
    31.5  
    31.6  lemmas sum_parametric = sum.F_parametric
    31.7 -lemmas setprod_parametric = setprod.F_parametric
    31.8 +lemmas prod_parametric = prod.F_parametric
    31.9  
   31.10  lemma rel_set_UNION:
   31.11    assumes [transfer_rule]: "rel_set Q A B" "rel_fun Q (rel_set R) f g"
    32.1 --- a/src/HOL/Limits.thy	Mon Oct 17 14:37:32 2016 +0200
    32.2 +++ b/src/HOL/Limits.thy	Mon Oct 17 17:33:07 2016 +0200
    32.3 @@ -833,20 +833,20 @@
    32.4    shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. (f x)^n)"
    32.5    unfolding continuous_on_def by (auto intro: tendsto_power)
    32.6  
    32.7 -lemma tendsto_setprod [tendsto_intros]:
    32.8 +lemma tendsto_prod [tendsto_intros]:
    32.9    fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
   32.10    shows "(\<And>i. i \<in> S \<Longrightarrow> (f i \<longlongrightarrow> L i) F) \<Longrightarrow> ((\<lambda>x. \<Prod>i\<in>S. f i x) \<longlongrightarrow> (\<Prod>i\<in>S. L i)) F"
   32.11    by (induct S rule: infinite_finite_induct) (simp_all add: tendsto_mult)
   32.12  
   32.13 -lemma continuous_setprod [continuous_intros]:
   32.14 +lemma continuous_prod [continuous_intros]:
   32.15    fixes f :: "'a \<Rightarrow> 'b::t2_space \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
   32.16    shows "(\<And>i. i \<in> S \<Longrightarrow> continuous F (f i)) \<Longrightarrow> continuous F (\<lambda>x. \<Prod>i\<in>S. f i x)"
   32.17 -  unfolding continuous_def by (rule tendsto_setprod)
   32.18 -
   32.19 -lemma continuous_on_setprod [continuous_intros]:
   32.20 +  unfolding continuous_def by (rule tendsto_prod)
   32.21 +
   32.22 +lemma continuous_on_prod [continuous_intros]:
   32.23    fixes f :: "'a \<Rightarrow> _ \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
   32.24    shows "(\<And>i. i \<in> S \<Longrightarrow> continuous_on s (f i)) \<Longrightarrow> continuous_on s (\<lambda>x. \<Prod>i\<in>S. f i x)"
   32.25 -  unfolding continuous_on_def by (auto intro: tendsto_setprod)
   32.26 +  unfolding continuous_on_def by (auto intro: tendsto_prod)
   32.27  
   32.28  lemma tendsto_of_real_iff:
   32.29    "((\<lambda>x. of_real (f x) :: 'a::real_normed_div_algebra) \<longlongrightarrow> of_real c) F \<longleftrightarrow> (f \<longlongrightarrow> c) F"
    33.1 --- a/src/HOL/List.thy	Mon Oct 17 14:37:32 2016 +0200
    33.2 +++ b/src/HOL/List.thy	Mon Oct 17 17:33:07 2016 +0200
    33.3 @@ -4672,7 +4672,7 @@
    33.4    moreover
    33.5    have "Suc (card A - Suc k) = card A - k" using Suc.prems by simp
    33.6    then have "(card A - k) * \<Prod>{Suc (card A - k)..card A} = \<Prod>{Suc (card A - Suc k)..card A}"
    33.7 -    by (subst setprod.insert[symmetric]) (simp add: atLeastAtMost_insertL)+
    33.8 +    by (subst prod.insert[symmetric]) (simp add: atLeastAtMost_insertL)+
    33.9    ultimately show ?case
   33.10      by (simp add: card_image inj_Cons card_UN_disjoint Suc.hyps algebra_simps)
   33.11  qed
    34.1 --- a/src/HOL/Nat_Transfer.thy	Mon Oct 17 14:37:32 2016 +0200
    34.2 +++ b/src/HOL/Nat_Transfer.thy	Mon Oct 17 17:33:07 2016 +0200
    34.3 @@ -186,33 +186,33 @@
    34.4  ]
    34.5  
    34.6  
    34.7 -text \<open>sum and setprod\<close>
    34.8 +text \<open>sum and prod\<close>
    34.9  
   34.10  (* this handles the case where the *domain* of f is nat *)
   34.11  lemma transfer_nat_int_sum_prod:
   34.12      "sum f A = sum (%x. f (nat x)) (int ` A)"
   34.13 -    "setprod f A = setprod (%x. f (nat x)) (int ` A)"
   34.14 +    "prod f A = prod (%x. f (nat x)) (int ` A)"
   34.15    apply (subst sum.reindex)
   34.16    apply (unfold inj_on_def, auto)
   34.17 -  apply (subst setprod.reindex)
   34.18 +  apply (subst prod.reindex)
   34.19    apply (unfold inj_on_def o_def, auto)
   34.20  done
   34.21  
   34.22  (* this handles the case where the *range* of f is nat *)
   34.23  lemma transfer_nat_int_sum_prod2:
   34.24      "sum f A = nat(sum (%x. int (f x)) A)"
   34.25 -    "setprod f A = nat(setprod (%x. int (f x)) A)"
   34.26 +    "prod f A = nat(prod (%x. int (f x)) A)"
   34.27    apply (simp only: int_sum [symmetric] nat_int)
   34.28 -  apply (simp only: int_setprod [symmetric] nat_int)
   34.29 +  apply (simp only: int_prod [symmetric] nat_int)
   34.30    done
   34.31  
   34.32  lemma transfer_nat_int_sum_prod_closure:
   34.33      "nat_set A \<Longrightarrow> (!!x. x >= 0 \<Longrightarrow> f x >= (0::int)) \<Longrightarrow> sum f A >= 0"
   34.34 -    "nat_set A \<Longrightarrow> (!!x. x >= 0 \<Longrightarrow> f x >= (0::int)) \<Longrightarrow> setprod f A >= 0"
   34.35 +    "nat_set A \<Longrightarrow> (!!x. x >= 0 \<Longrightarrow> f x >= (0::int)) \<Longrightarrow> prod f A >= 0"
   34.36    unfolding nat_set_def
   34.37    apply (rule sum_nonneg)
   34.38    apply auto
   34.39 -  apply (rule setprod_nonneg)
   34.40 +  apply (rule prod_nonneg)
   34.41    apply auto
   34.42  done
   34.43  
   34.44 @@ -223,28 +223,28 @@
   34.45  
   34.46  lemma transfer_nat_int_sum_prod_closure:
   34.47      "(!!x. x : A  ==> f x >= (0::int)) \<Longrightarrow> sum f A >= 0"
   34.48 -    "(!!x. x : A  ==> f x >= (0::int)) \<Longrightarrow> setprod f A >= 0"
   34.49 +    "(!!x. x : A  ==> f x >= (0::int)) \<Longrightarrow> prod f A >= 0"
   34.50    unfolding nat_set_def simp_implies_def
   34.51    apply (rule sum_nonneg)
   34.52    apply auto
   34.53 -  apply (rule setprod_nonneg)
   34.54 +  apply (rule prod_nonneg)
   34.55    apply auto
   34.56  done
   34.57  *)
   34.58  
   34.59  (* Making A = B in this lemma doesn't work. Why not?
   34.60 -   Also, why aren't sum.cong and setprod.cong enough,
   34.61 +   Also, why aren't sum.cong and prod.cong enough,
   34.62     with the previously mentioned rule turned on? *)
   34.63  
   34.64  lemma transfer_nat_int_sum_prod_cong:
   34.65      "A = B \<Longrightarrow> nat_set B \<Longrightarrow> (!!x. x >= 0 \<Longrightarrow> f x = g x) \<Longrightarrow>
   34.66        sum f A = sum g B"
   34.67      "A = B \<Longrightarrow> nat_set B \<Longrightarrow> (!!x. x >= 0 \<Longrightarrow> f x = g x) \<Longrightarrow>
   34.68 -      setprod f A = setprod g B"
   34.69 +      prod f A = prod g B"
   34.70    unfolding nat_set_def
   34.71    apply (subst sum.cong, assumption)
   34.72    apply auto [2]
   34.73 -  apply (subst setprod.cong, assumption, auto)
   34.74 +  apply (subst prod.cong, assumption, auto)
   34.75  done
   34.76  
   34.77  declare transfer_morphism_nat_int [transfer add
   34.78 @@ -389,29 +389,29 @@
   34.79  ]
   34.80  
   34.81  
   34.82 -text \<open>sum and setprod\<close>
   34.83 +text \<open>sum and prod\<close>
   34.84  
   34.85  (* this handles the case where the *domain* of f is int *)
   34.86  lemma transfer_int_nat_sum_prod:
   34.87      "nat_set A \<Longrightarrow> sum f A = sum (%x. f (int x)) (nat ` A)"
   34.88 -    "nat_set A \<Longrightarrow> setprod f A = setprod (%x. f (int x)) (nat ` A)"
   34.89 +    "nat_set A \<Longrightarrow> prod f A = prod (%x. f (int x)) (nat ` A)"
   34.90    apply (subst sum.reindex)
   34.91    apply (unfold inj_on_def nat_set_def, auto simp add: eq_nat_nat_iff)
   34.92 -  apply (subst setprod.reindex)
   34.93 +  apply (subst prod.reindex)
   34.94    apply (unfold inj_on_def nat_set_def o_def, auto simp add: eq_nat_nat_iff
   34.95 -            cong: setprod.cong)
   34.96 +            cong: prod.cong)
   34.97  done
   34.98  
   34.99  (* this handles the case where the *range* of f is int *)
  34.100  lemma transfer_int_nat_sum_prod2:
  34.101      "(!!x. x:A \<Longrightarrow> is_nat (f x)) \<Longrightarrow> sum f A = int(sum (%x. nat (f x)) A)"
  34.102      "(!!x. x:A \<Longrightarrow> is_nat (f x)) \<Longrightarrow>
  34.103 -      setprod f A = int(setprod (%x. nat (f x)) A)"
  34.104 +      prod f A = int(prod (%x. nat (f x)) A)"
  34.105    unfolding is_nat_def
  34.106    by (subst int_sum) auto
  34.107  
  34.108  declare transfer_morphism_int_nat [transfer add
  34.109    return: transfer_int_nat_sum_prod transfer_int_nat_sum_prod2
  34.110 -  cong: sum.cong setprod.cong]
  34.111 +  cong: sum.cong prod.cong]
  34.112  
  34.113  end
    35.1 --- a/src/HOL/Number_Theory/Cong.thy	Mon Oct 17 14:37:32 2016 +0200
    35.2 +++ b/src/HOL/Number_Theory/Cong.thy	Mon Oct 17 17:33:07 2016 +0200
    35.3 @@ -193,7 +193,7 @@
    35.4    apply (auto intro: cong_add_int)
    35.5    done
    35.6  
    35.7 -lemma cong_setprod_nat [rule_format]:
    35.8 +lemma cong_prod_nat [rule_format]:
    35.9      "(\<forall>x\<in>A. [((f x)::nat) = g x] (mod m)) \<longrightarrow>
   35.10        [(\<Prod>x\<in>A. f x) = (\<Prod>x\<in>A. g x)] (mod m)"
   35.11    apply (cases "finite A")
   35.12 @@ -201,7 +201,7 @@
   35.13    apply (auto intro: cong_mult_nat)
   35.14    done
   35.15  
   35.16 -lemma cong_setprod_int [rule_format]:
   35.17 +lemma cong_prod_int [rule_format]:
   35.18      "(\<forall>x\<in>A. [((f x)::int) = g x] (mod m)) \<longrightarrow>
   35.19        [(\<Prod>x\<in>A. f x) = (\<Prod>x\<in>A. g x)] (mod m)"
   35.20    apply (cases "finite A")
   35.21 @@ -562,22 +562,22 @@
   35.22      [x = y] (mod b) \<Longrightarrow> [x = y] (mod lcm a b)"
   35.23    by (auto simp add: cong_altdef_int lcm_least) [1]
   35.24  
   35.25 -lemma cong_cong_setprod_coprime_nat [rule_format]: "finite A \<Longrightarrow>
   35.26 +lemma cong_cong_prod_coprime_nat [rule_format]: "finite A \<Longrightarrow>
   35.27      (\<forall>i\<in>A. (\<forall>j\<in>A. i \<noteq> j \<longrightarrow> coprime (m i) (m j))) \<longrightarrow>
   35.28      (\<forall>i\<in>A. [(x::nat) = y] (mod m i)) \<longrightarrow>
   35.29        [x = y] (mod (\<Prod>i\<in>A. m i))"
   35.30    apply (induct set: finite)
   35.31    apply auto
   35.32 -  apply (metis One_nat_def coprime_cong_mult_nat gcd.commute setprod_coprime)
   35.33 +  apply (metis One_nat_def coprime_cong_mult_nat gcd.commute prod_coprime)
   35.34    done
   35.35  
   35.36 -lemma cong_cong_setprod_coprime_int [rule_format]: "finite A \<Longrightarrow>
   35.37 +lemma cong_cong_prod_coprime_int [rule_format]: "finite A \<Longrightarrow>
   35.38      (\<forall>i\<in>A. (\<forall>j\<in>A. i \<noteq> j \<longrightarrow> coprime (m i) (m j))) \<longrightarrow>
   35.39      (\<forall>i\<in>A. [(x::int) = y] (mod m i)) \<longrightarrow>
   35.40        [x = y] (mod (\<Prod>i\<in>A. m i))"
   35.41    apply (induct set: finite)
   35.42    apply auto
   35.43 -  apply (metis coprime_cong_mult_int gcd.commute setprod_coprime)
   35.44 +  apply (metis coprime_cong_mult_int gcd.commute prod_coprime)
   35.45    done
   35.46  
   35.47  lemma binary_chinese_remainder_aux_nat:
   35.48 @@ -760,7 +760,7 @@
   35.49    fix i
   35.50    assume "i : A"
   35.51    with cop have "coprime (\<Prod>j \<in> A - {i}. m j) (m i)"
   35.52 -    by (intro setprod_coprime, auto)
   35.53 +    by (intro prod_coprime, auto)
   35.54    then have "EX x. [(\<Prod>j \<in> A - {i}. m j) * x = 1] (mod m i)"
   35.55      by (elim cong_solve_coprime_nat)
   35.56    then obtain x where "[(\<Prod>j \<in> A - {i}. m j) * x = 1] (mod m i)"
   35.57 @@ -769,7 +769,7 @@
   35.58      (mod (\<Prod>j \<in> A - {i}. m j))"
   35.59      by (subst mult.commute, rule cong_mult_self_nat)
   35.60    ultimately show "\<exists>a. [a = 1] (mod m i) \<and> [a = 0]
   35.61 -      (mod setprod m (A - {i}))"
   35.62 +      (mod prod m (A - {i}))"
   35.63      by blast
   35.64  qed
   35.65  
   35.66 @@ -824,7 +824,7 @@
   35.67           [x = y] (mod (\<Prod>i\<in>A. m i))"
   35.68    apply (induct set: finite)
   35.69    apply auto
   35.70 -  apply (metis One_nat_def coprime_cong_mult_nat gcd.commute setprod_coprime)
   35.71 +  apply (metis One_nat_def coprime_cong_mult_nat gcd.commute prod_coprime)
   35.72    done
   35.73  
   35.74  lemma chinese_remainder_unique_nat:
    36.1 --- a/src/HOL/Number_Theory/Factorial_Ring.thy	Mon Oct 17 14:37:32 2016 +0200
    36.2 +++ b/src/HOL/Number_Theory/Factorial_Ring.thy	Mon Oct 17 17:33:07 2016 +0200
    36.3 @@ -1294,12 +1294,12 @@
    36.4    using assms prime_elem_multiplicity_prod_mset_distrib [of p "replicate_mset n x"]
    36.5    by simp
    36.6  
    36.7 -lemma prime_elem_multiplicity_setprod_distrib:
    36.8 +lemma prime_elem_multiplicity_prod_distrib:
    36.9    assumes "prime_elem p" "0 \<notin> f ` A" "finite A"
   36.10 -  shows   "multiplicity p (setprod f A) = (\<Sum>x\<in>A. multiplicity p (f x))"
   36.11 +  shows   "multiplicity p (prod f A) = (\<Sum>x\<in>A. multiplicity p (f x))"
   36.12  proof -
   36.13 -  have "multiplicity p (setprod f A) = (\<Sum>x\<in>#mset_set A. multiplicity p (f x))"
   36.14 -    using assms by (subst setprod_unfold_prod_mset)
   36.15 +  have "multiplicity p (prod f A) = (\<Sum>x\<in>#mset_set A. multiplicity p (f x))"
   36.16 +    using assms by (subst prod_unfold_prod_mset)
   36.17                     (simp_all add: prime_elem_multiplicity_prod_mset_distrib sum_unfold_sum_mset 
   36.18                        multiset.map_comp o_def)
   36.19    also from \<open>finite A\<close> have "\<dots> = (\<Sum>x\<in>A. multiplicity p (f x))"
   36.20 @@ -1352,7 +1352,7 @@
   36.21    "prime p \<Longrightarrow> prime_factors p = {p}"
   36.22    by (drule prime_factorization_prime) simp
   36.23  
   36.24 -lemma setprod_prime_factors:
   36.25 +lemma prod_prime_factors:
   36.26    assumes "x \<noteq> 0"
   36.27    shows   "(\<Prod>p \<in> prime_factors x. p ^ multiplicity p x) = normalize x"
   36.28  proof -
   36.29 @@ -1361,7 +1361,7 @@
   36.30    also have "\<dots> = (\<Prod>p \<in> prime_factors x. p ^ count (prime_factorization x) p)"
   36.31      by (subst prod_mset_multiplicity) simp_all
   36.32    also have "\<dots> = (\<Prod>p \<in> prime_factors x. p ^ multiplicity p x)"
   36.33 -    by (intro setprod.cong) 
   36.34 +    by (intro prod.cong) 
   36.35        (simp_all add: assms count_prime_factorization_prime in_prime_factors_imp_prime)
   36.36    finally show ?thesis ..
   36.37  qed
   36.38 @@ -1751,12 +1751,12 @@
   36.39    have "gcd x y = gcd_factorial x y" by (rule gcd_eq_gcd_factorial)
   36.40    also have "\<dots> = ?rhs1"
   36.41      by (auto simp: gcd_factorial_def assms prod_mset_multiplicity
   36.42 -          count_prime_factorization_prime dest: in_prime_factors_imp_prime intro!: setprod.cong)
   36.43 +          count_prime_factorization_prime dest: in_prime_factors_imp_prime intro!: prod.cong)
   36.44    finally show "gcd x y = ?rhs1" .
   36.45    have "lcm x y = lcm_factorial x y" by (rule lcm_eq_lcm_factorial)
   36.46    also have "\<dots> = ?rhs2"
   36.47      by (auto simp: lcm_factorial_def assms prod_mset_multiplicity
   36.48 -          count_prime_factorization_prime dest: in_prime_factors_imp_prime intro!: setprod.cong)
   36.49 +          count_prime_factorization_prime dest: in_prime_factors_imp_prime intro!: prod.cong)
   36.50    finally show "lcm x y = ?rhs2" .
   36.51  qed
   36.52  
    37.1 --- a/src/HOL/Number_Theory/Gauss.thy	Mon Oct 17 14:37:32 2016 +0200
    37.2 +++ b/src/HOL/Number_Theory/Gauss.thy	Mon Oct 17 17:33:07 2016 +0200
    37.3 @@ -209,8 +209,8 @@
    37.4    using p_prime A_ncong_p [OF assms]
    37.5    by (auto simp: cong_altdef_int gcd.commute[of _ "int p"] intro!: prime_imp_coprime)
    37.6  
    37.7 -lemma A_prod_relprime: "gcd (setprod id A) p = 1"
    37.8 -  by (metis id_def all_A_relprime setprod_coprime)
    37.9 +lemma A_prod_relprime: "gcd (prod id A) p = 1"
   37.10 +  by (metis id_def all_A_relprime prod_coprime)
   37.11  
   37.12  
   37.13  subsection \<open>Relationships Between Gauss Sets\<close>
   37.14 @@ -242,15 +242,15 @@
   37.15  lemma C_card_eq_D_plus_E: "card C = card D + card E"
   37.16    by (auto simp add: C_eq card_Un_disjoint D_E_disj finite_D finite_E)
   37.17  
   37.18 -lemma C_prod_eq_D_times_E: "setprod id E * setprod id D = setprod id C"
   37.19 -  by (metis C_eq D_E_disj finite_D finite_E inf_commute setprod.union_disjoint sup_commute)
   37.20 +lemma C_prod_eq_D_times_E: "prod id E * prod id D = prod id C"
   37.21 +  by (metis C_eq D_E_disj finite_D finite_E inf_commute prod.union_disjoint sup_commute)
   37.22  
   37.23 -lemma C_B_zcong_prod: "[setprod id C = setprod id B] (mod p)"
   37.24 +lemma C_B_zcong_prod: "[prod id C = prod id B] (mod p)"
   37.25    apply (auto simp add: C_def)
   37.26    apply (insert finite_B SR_B_inj)
   37.27 -  apply (drule setprod.reindex [of "\<lambda>x. x mod int p" B id])
   37.28 +  apply (drule prod.reindex [of "\<lambda>x. x mod int p" B id])
   37.29    apply auto
   37.30 -  apply (rule cong_setprod_int)
   37.31 +  apply (rule cong_prod_int)
   37.32    apply (auto simp add: cong_int_def)
   37.33    done
   37.34  
   37.35 @@ -295,25 +295,25 @@
   37.36    using finite_A F_Un_D_subset A_card_eq F_Un_D_card 
   37.37    by (auto simp add: card_seteq)
   37.38  
   37.39 -lemma prod_D_F_eq_prod_A: "(setprod id D) * (setprod id F) = setprod id A"
   37.40 -  by (metis F_D_disj F_Un_D_eq_A Int_commute Un_commute finite_D finite_F setprod.union_disjoint)
   37.41 +lemma prod_D_F_eq_prod_A: "(prod id D) * (prod id F) = prod id A"
   37.42 +  by (metis F_D_disj F_Un_D_eq_A Int_commute Un_commute finite_D finite_F prod.union_disjoint)
   37.43  
   37.44 -lemma prod_F_zcong: "[setprod id F = ((-1) ^ (card E)) * (setprod id E)] (mod p)"
   37.45 +lemma prod_F_zcong: "[prod id F = ((-1) ^ (card E)) * (prod id E)] (mod p)"
   37.46  proof -
   37.47 -  have FE: "setprod id F = setprod (op - p) E"
   37.48 +  have FE: "prod id F = prod (op - p) E"
   37.49      apply (auto simp add: F_def)
   37.50      apply (insert finite_E inj_on_pminusx_E)
   37.51 -    apply (drule setprod.reindex, auto)
   37.52 +    apply (drule prod.reindex, auto)
   37.53      done
   37.54    then have "\<forall>x \<in> E. [(p-x) mod p = - x](mod p)"
   37.55      by (metis cong_int_def minus_mod_self1 mod_mod_trivial)
   37.56 -  then have "[setprod ((\<lambda>x. x mod p) o (op - p)) E = setprod (uminus) E](mod p)"
   37.57 +  then have "[prod ((\<lambda>x. x mod p) o (op - p)) E = prod (uminus) E](mod p)"
   37.58      using finite_E p_ge_2
   37.59 -          cong_setprod_int [of E "(\<lambda>x. x mod p) o (op - p)" uminus p]
   37.60 +          cong_prod_int [of E "(\<lambda>x. x mod p) o (op - p)" uminus p]
   37.61      by auto
   37.62 -  then have two: "[setprod id F = setprod (uminus) E](mod p)"
   37.63 -    by (metis FE cong_cong_mod_int cong_refl_int cong_setprod_int minus_mod_self1)
   37.64 -  have "setprod uminus E = (-1) ^ (card E) * (setprod id E)"
   37.65 +  then have two: "[prod id F = prod (uminus) E](mod p)"
   37.66 +    by (metis FE cong_cong_mod_int cong_refl_int cong_prod_int minus_mod_self1)
   37.67 +  have "prod uminus E = (-1) ^ (card E) * (prod id E)"
   37.68      using finite_E by (induct set: finite) auto
   37.69    with two show ?thesis
   37.70      by simp
   37.71 @@ -322,50 +322,50 @@
   37.72  
   37.73  subsection \<open>Gauss' Lemma\<close>
   37.74  
   37.75 -lemma aux: "setprod id A * (- 1) ^ card E * a ^ card A * (- 1) ^ card E = setprod id A * a ^ card A"
   37.76 +lemma aux: "prod id A * (- 1) ^ card E * a ^ card A * (- 1) ^ card E = prod id A * a ^ card A"
   37.77  by (metis (no_types) minus_minus mult.commute mult.left_commute power_minus power_one)
   37.78  
   37.79  theorem pre_gauss_lemma:
   37.80    "[a ^ nat((int p - 1) div 2) = (-1) ^ (card E)] (mod p)"
   37.81  proof -
   37.82 -  have "[setprod id A = setprod id F * setprod id D](mod p)"
   37.83 -    by (auto simp add: prod_D_F_eq_prod_A mult.commute cong del: setprod.strong_cong)
   37.84 -  then have "[setprod id A = ((-1)^(card E) * setprod id E) * setprod id D] (mod p)"
   37.85 +  have "[prod id A = prod id F * prod id D](mod p)"
   37.86 +    by (auto simp add: prod_D_F_eq_prod_A mult.commute cong del: prod.strong_cong)
   37.87 +  then have "[prod id A = ((-1)^(card E) * prod id E) * prod id D] (mod p)"
   37.88      apply (rule cong_trans_int)
   37.89      apply (metis cong_scalar_int prod_F_zcong)
   37.90      done
   37.91 -  then have "[setprod id A = ((-1)^(card E) * setprod id C)] (mod p)"
   37.92 +  then have "[prod id A = ((-1)^(card E) * prod id C)] (mod p)"
   37.93      by (metis C_prod_eq_D_times_E mult.commute mult.left_commute)
   37.94 -  then have "[setprod id A = ((-1)^(card E) * setprod id B)] (mod p)"
   37.95 +  then have "[prod id A = ((-1)^(card E) * prod id B)] (mod p)"
   37.96      by (rule cong_trans_int) (metis C_B_zcong_prod cong_scalar2_int)
   37.97 -  then have "[setprod id A = ((-1)^(card E) *
   37.98 -    (setprod id ((\<lambda>x. x * a) ` A)))] (mod p)"
   37.99 +  then have "[prod id A = ((-1)^(card E) *
  37.100 +    (prod id ((\<lambda>x. x * a) ` A)))] (mod p)"
  37.101      by (simp add: B_def)
  37.102 -  then have "[setprod id A = ((-1)^(card E) * (setprod (\<lambda>x. x * a) A))]
  37.103 +  then have "[prod id A = ((-1)^(card E) * (prod (\<lambda>x. x * a) A))]
  37.104      (mod p)"
  37.105 -    by (simp add: inj_on_xa_A setprod.reindex)
  37.106 -  moreover have "setprod (\<lambda>x. x * a) A =
  37.107 -    setprod (\<lambda>x. a) A * setprod id A"
  37.108 +    by (simp add: inj_on_xa_A prod.reindex)
  37.109 +  moreover have "prod (\<lambda>x. x * a) A =
  37.110 +    prod (\<lambda>x. a) A * prod id A"
  37.111      using finite_A by (induct set: finite) auto
  37.112 -  ultimately have "[setprod id A = ((-1)^(card E) * (setprod (\<lambda>x. a) A *
  37.113 -    setprod id A))] (mod p)"
  37.114 +  ultimately have "[prod id A = ((-1)^(card E) * (prod (\<lambda>x. a) A *
  37.115 +    prod id A))] (mod p)"
  37.116      by simp
  37.117 -  then have "[setprod id A = ((-1)^(card E) * a^(card A) *
  37.118 -      setprod id A)](mod p)"
  37.119 +  then have "[prod id A = ((-1)^(card E) * a^(card A) *
  37.120 +      prod id A)](mod p)"
  37.121      apply (rule cong_trans_int)
  37.122 -    apply (simp add: cong_scalar2_int cong_scalar_int finite_A setprod_constant mult.assoc)
  37.123 +    apply (simp add: cong_scalar2_int cong_scalar_int finite_A prod_constant mult.assoc)
  37.124      done
  37.125 -  then have a: "[setprod id A * (-1)^(card E) =
  37.126 -      ((-1)^(card E) * a^(card A) * setprod id A * (-1)^(card E))](mod p)"
  37.127 +  then have a: "[prod id A * (-1)^(card E) =
  37.128 +      ((-1)^(card E) * a^(card A) * prod id A * (-1)^(card E))](mod p)"
  37.129      by (rule cong_scalar_int)
  37.130 -  then have "[setprod id A * (-1)^(card E) = setprod id A *
  37.131 +  then have "[prod id A * (-1)^(card E) = prod id A *
  37.132        (-1)^(card E) * a^(card A) * (-1)^(card E)](mod p)"
  37.133      apply (rule cong_trans_int)
  37.134      apply (simp add: a mult.commute mult.left_commute)
  37.135      done
  37.136 -  then have "[setprod id A * (-1)^(card E) = setprod id A * a^(card A)](mod p)"
  37.137 +  then have "[prod id A * (-1)^(card E) = prod id A * a^(card A)](mod p)"
  37.138      apply (rule cong_trans_int)
  37.139 -    apply (simp add: aux cong del: setprod.strong_cong)
  37.140 +    apply (simp add: aux cong del: prod.strong_cong)
  37.141      done
  37.142    with A_prod_relprime have "[(- 1) ^ card E = a ^ card A](mod p)"
  37.143      by (metis cong_mult_lcancel_int)
    38.1 --- a/src/HOL/Number_Theory/Primes.thy	Mon Oct 17 14:37:32 2016 +0200
    38.2 +++ b/src/HOL/Number_Theory/Primes.thy	Mon Oct 17 17:33:07 2016 +0200
    38.3 @@ -485,11 +485,11 @@
    38.4  
    38.5  lemma prime_factorization_nat:
    38.6      "n > (0::nat) \<Longrightarrow> n = (\<Prod>p \<in> prime_factors n. p ^ multiplicity p n)"
    38.7 -  by (simp add: setprod_prime_factors)
    38.8 +  by (simp add: prod_prime_factors)
    38.9  
   38.10  lemma prime_factorization_int:
   38.11      "n > (0::int) \<Longrightarrow> n = (\<Prod>p \<in> prime_factors n. p ^ multiplicity p n)"
   38.12 -  by (simp add: setprod_prime_factors)
   38.13 +  by (simp add: prod_prime_factors)
   38.14  
   38.15  lemma prime_factorization_unique_nat:
   38.16    fixes f :: "nat \<Rightarrow> _"
   38.17 @@ -524,13 +524,13 @@
   38.18    by (rule prime_factorization_unique_int [THEN conjunct1, symmetric])
   38.19  
   38.20  (* TODO Move *)
   38.21 -lemma abs_setprod: "abs (setprod f A :: 'a :: linordered_idom) = setprod (\<lambda>x. abs (f x)) A"
   38.22 +lemma abs_prod: "abs (prod f A :: 'a :: linordered_idom) = prod (\<lambda>x. abs (f x)) A"
   38.23    by (cases "finite A", induction A rule: finite_induct) (simp_all add: abs_mult)
   38.24  
   38.25  lemma primes_characterization'_int [rule_format]:
   38.26    "finite {p. p \<ge> 0 \<and> 0 < f (p::int)} \<Longrightarrow> \<forall>p. 0 < f p \<longrightarrow> prime p \<Longrightarrow>
   38.27        prime_factors (\<Prod>p | p \<ge> 0 \<and> 0 < f p. p ^ f p) = {p. p \<ge> 0 \<and> 0 < f p}"
   38.28 -  by (rule prime_factors_characterization_int) (auto simp: abs_setprod prime_ge_0_int)
   38.29 +  by (rule prime_factors_characterization_int) (auto simp: abs_prod prime_ge_0_int)
   38.30  
   38.31  lemma multiplicity_characterization_nat:
   38.32    "S = {p. 0 < f (p::nat)} \<Longrightarrow> finite S \<Longrightarrow> \<forall>p\<in>S. prime p \<Longrightarrow> prime p \<Longrightarrow>
   38.33 @@ -545,7 +545,7 @@
   38.34  lemma multiplicity_characterization_int: "S = {p. 0 < f (p::int)} \<Longrightarrow>
   38.35      finite S \<Longrightarrow> \<forall>p\<in>S. prime p \<Longrightarrow> prime p \<Longrightarrow> n = (\<Prod>p\<in>S. p ^ f p) \<Longrightarrow> multiplicity p n = f p"
   38.36    by (frule prime_factorization_unique_int [of S f n, THEN conjunct2, rule_format, symmetric]) 
   38.37 -     (auto simp: abs_setprod power_abs prime_ge_0_int intro!: setprod.cong)
   38.38 +     (auto simp: abs_prod power_abs prime_ge_0_int intro!: prod.cong)
   38.39  
   38.40  lemma multiplicity_characterization'_int [rule_format]:
   38.41    "finite {p. p \<ge> 0 \<and> 0 < f (p::int)} \<Longrightarrow>
   38.42 @@ -583,11 +583,11 @@
   38.43      unfolding set_mset_def count_A by (auto simp: g_def)
   38.44    with assms have prime: "prime x" if "x \<in># A" for x using that by auto
   38.45    from set_mset_A assms have "(\<Prod>p \<in> S. p ^ f p) = (\<Prod>p \<in> S. p ^ g p) "
   38.46 -    by (intro setprod.cong) (auto simp: g_def)
   38.47 +    by (intro prod.cong) (auto simp: g_def)
   38.48    also from set_mset_A assms have "\<dots> = (\<Prod>p \<in> set_mset A. p ^ g p)"
   38.49 -    by (intro setprod.mono_neutral_right) (auto simp: g_def set_mset_A)
   38.50 +    by (intro prod.mono_neutral_right) (auto simp: g_def set_mset_A)
   38.51    also have "\<dots> = prod_mset A"
   38.52 -    by (auto simp: prod_mset_multiplicity count_A set_mset_A intro!: setprod.cong)
   38.53 +    by (auto simp: prod_mset_multiplicity count_A set_mset_A intro!: prod.cong)
   38.54    also from assms have "multiplicity p \<dots> = sum_mset (image_mset (multiplicity p) A)"
   38.55      by (subst prime_elem_multiplicity_prod_mset_distrib) (auto dest: prime)
   38.56    also from assms have "image_mset (multiplicity p) A = image_mset (\<lambda>x. if x = p then 1 else 0) A"
   38.57 @@ -601,10 +601,10 @@
   38.58    shows "prime_factorization (prod_mset A) = \<Union>#(image_mset prime_factorization A)"
   38.59    using assms by (induct A) (auto simp add: prime_factorization_mult)
   38.60  
   38.61 -lemma prime_factors_setprod:
   38.62 +lemma prime_factors_prod:
   38.63    assumes "finite A" and "0 \<notin> f ` A"
   38.64 -  shows "prime_factors (setprod f A) = UNION A (prime_factors \<circ> f)"
   38.65 -  using assms by (simp add: setprod_unfold_prod_mset prime_factorization_prod_mset)
   38.66 +  shows "prime_factors (prod f A) = UNION A (prime_factors \<circ> f)"
   38.67 +  using assms by (simp add: prod_unfold_prod_mset prime_factorization_prod_mset)
   38.68  
   38.69  lemma prime_factors_fact:
   38.70    "prime_factors (fact n) = {p \<in> {2..n}. prime p}" (is "?M = ?N")
   38.71 @@ -621,7 +621,7 @@
   38.72        by (auto intro: order_trans)
   38.73    } note * = this
   38.74    show "p \<in> ?M \<longleftrightarrow> p \<in> ?N"
   38.75 -    by (auto simp add: fact_setprod prime_factors_setprod Suc_le_eq dest!: prime_prime_factors intro: *)
   38.76 +    by (auto simp add: fact_prod prime_factors_prod Suc_le_eq dest!: prime_prime_factors intro: *)
   38.77  qed
   38.78  
   38.79  lemma prime_dvd_fact_iff:
    39.1 --- a/src/HOL/Number_Theory/Residues.thy	Mon Oct 17 14:37:32 2016 +0200
    39.2 +++ b/src/HOL/Number_Theory/Residues.thy	Mon Oct 17 17:33:07 2016 +0200
    39.3 @@ -428,10 +428,10 @@
    39.4      apply auto
    39.5      done
    39.6    also have "\<dots> = fact (p - 1) mod p"
    39.7 -    apply (simp add: fact_setprod)
    39.8 +    apply (simp add: fact_prod)
    39.9      apply (insert assms)
   39.10      apply (subst res_prime_units_eq)
   39.11 -    apply (simp add: int_setprod zmod_int setprod_int_eq)
   39.12 +    apply (simp add: int_prod zmod_int prod_int_eq)
   39.13      done
   39.14    finally have "fact (p - 1) mod p = \<ominus> \<one>" .
   39.15    then show ?thesis
   39.16 @@ -445,7 +445,7 @@
   39.17  proof (cases "p = 2")
   39.18    case True
   39.19    then show ?thesis
   39.20 -    by (simp add: cong_int_def fact_setprod)
   39.21 +    by (simp add: cong_int_def fact_prod)
   39.22  next
   39.23    case False
   39.24    then show ?thesis
    40.1 --- a/src/HOL/Old_Number_Theory/Euler.thy	Mon Oct 17 14:37:32 2016 +0200
    40.2 +++ b/src/HOL/Old_Number_Theory/Euler.thy	Mon Oct 17 17:33:07 2016 +0200
    40.3 @@ -133,7 +133,7 @@
    40.4    then show ?thesis by auto
    40.5  qed
    40.6  
    40.7 -lemma SetS_setprod_prop: "[| zprime p; 2 < p; ~([a = 0] (mod p));
    40.8 +lemma SetS_prod_prop: "[| zprime p; 2 < p; ~([a = 0] (mod p));
    40.9                                ~(QuadRes p a); x \<in> (SetS a p) |] ==> 
   40.10                            [\<Prod>x = a] (mod p)"
   40.11    apply (auto simp add: SetS_def MultInvPair_def)
   40.12 @@ -174,21 +174,21 @@
   40.13    apply (frule d22set_g_1, auto)
   40.14    done
   40.15  
   40.16 -lemma Union_SetS_setprod_prop1:
   40.17 +lemma Union_SetS_prod_prop1:
   40.18    assumes "zprime p" and "2 < p" and "~([a = 0] (mod p))" and
   40.19      "~(QuadRes p a)"
   40.20    shows "[\<Prod>(\<Union>(SetS a p)) = a ^ nat ((p - 1) div 2)] (mod p)"
   40.21  proof -
   40.22 -  from assms have "[\<Prod>(\<Union>(SetS a p)) = setprod (setprod (%x. x)) (SetS a p)] (mod p)"
   40.23 +  from assms have "[\<Prod>(\<Union>(SetS a p)) = prod (prod (%x. x)) (SetS a p)] (mod p)"
   40.24      by (auto simp add: SetS_finite SetS_elems_finite
   40.25 -      MultInvPair_prop1c setprod.Union_disjoint)
   40.26 -  also have "[setprod (setprod (%x. x)) (SetS a p) = 
   40.27 -      setprod (%x. a) (SetS a p)] (mod p)"
   40.28 -    by (rule setprod_same_function_zcong)
   40.29 -      (auto simp add: assms SetS_setprod_prop SetS_finite)
   40.30 -  also (zcong_trans) have "[setprod (%x. a) (SetS a p) = 
   40.31 +      MultInvPair_prop1c prod.Union_disjoint)
   40.32 +  also have "[prod (prod (%x. x)) (SetS a p) = 
   40.33 +      prod (%x. a) (SetS a p)] (mod p)"
   40.34 +    by (rule prod_same_function_zcong)
   40.35 +      (auto simp add: assms SetS_prod_prop SetS_finite)
   40.36 +  also (zcong_trans) have "[prod (%x. a) (SetS a p) = 
   40.37        a^(card (SetS a p))] (mod p)"
   40.38 -    by (auto simp add: assms SetS_finite setprod_constant)
   40.39 +    by (auto simp add: assms SetS_finite prod_constant)
   40.40    finally (zcong_trans) show ?thesis
   40.41      apply (rule zcong_trans)
   40.42      apply (subgoal_tac "card(SetS a p) = nat((p - 1) div 2)", auto)
   40.43 @@ -197,7 +197,7 @@
   40.44      done
   40.45  qed
   40.46  
   40.47 -lemma Union_SetS_setprod_prop2:
   40.48 +lemma Union_SetS_prod_prop2:
   40.49    assumes "zprime p" and "2 < p" and "~([a = 0](mod p))"
   40.50    shows "\<Prod>(\<Union>(SetS a p)) = zfact (p - 1)"
   40.51  proof -
   40.52 @@ -219,8 +219,8 @@
   40.53  
   40.54  lemma zfact_prop: "[| zprime p; 2 < p; ~([a = 0] (mod p)); ~(QuadRes p a) |] ==>
   40.55                     [zfact (p - 1) = a ^ nat ((p - 1) div 2)] (mod p)"
   40.56 -  apply (frule Union_SetS_setprod_prop1) 
   40.57 -  apply (auto simp add: Union_SetS_setprod_prop2)
   40.58 +  apply (frule Union_SetS_prod_prop1) 
   40.59 +  apply (auto simp add: Union_SetS_prod_prop2)
   40.60    done
   40.61  
   40.62  text \<open>\medskip Prove the first part of Euler's Criterion:\<close>
    41.1 --- a/src/HOL/Old_Number_Theory/EulerFermat.thy	Mon Oct 17 14:37:32 2016 +0200
    41.2 +++ b/src/HOL/Old_Number_Theory/EulerFermat.thy	Mon Oct 17 17:33:07 2016 +0200
    41.3 @@ -252,7 +252,7 @@
    41.4     apply (simplesubst BnorRset.simps)  \<comment>\<open>multiple redexes\<close>
    41.5     apply (unfold Let_def, auto)
    41.6    apply (simp add: Bnor_fin Bnor_mem_zle_swap)
    41.7 -  apply (subst setprod.insert)
    41.8 +  apply (subst prod.insert)
    41.9      apply (rule_tac [2] Bnor_prod_power_aux)
   41.10       apply (unfold inj_on_def)
   41.11       apply (simp_all add: ac_simps Bnor_fin Bnor_mem_zle_swap)
    42.1 --- a/src/HOL/Old_Number_Theory/Finite2.thy	Mon Oct 17 14:37:32 2016 +0200
    42.2 +++ b/src/HOL/Old_Number_Theory/Finite2.thy	Mon Oct 17 17:33:07 2016 +0200
    42.3 @@ -26,9 +26,9 @@
    42.4    assume "infinite S" thus ?thesis by simp
    42.5  qed
    42.6  
    42.7 -lemma setprod_same_function_zcong:
    42.8 +lemma prod_same_function_zcong:
    42.9    assumes a: "\<forall>x \<in> S. [f x = g x](mod m)"
   42.10 -  shows "[setprod f S = setprod g S] (mod m)"
   42.11 +  shows "[prod f S = prod g S] (mod m)"
   42.12  proof cases
   42.13    assume "finite S"
   42.14    thus ?thesis using a by induct (simp_all add: zcong_zmult)
    43.1 --- a/src/HOL/Old_Number_Theory/Gauss.thy	Mon Oct 17 14:37:32 2016 +0200
    43.2 +++ b/src/HOL/Old_Number_Theory/Gauss.thy	Mon Oct 17 17:33:07 2016 +0200
    43.3 @@ -263,7 +263,7 @@
    43.4  lemma all_A_relprime: "\<forall>x \<in> A. zgcd x p = 1"
    43.5    using p_prime p_minus_one_l by (auto simp add: A_def zless_zprime_imp_zrelprime)
    43.6  
    43.7 -lemma A_prod_relprime: "zgcd (setprod id A) p = 1"
    43.8 +lemma A_prod_relprime: "zgcd (prod id A) p = 1"
    43.9  by(rule all_relprime_prod_relprime[OF finite_A all_A_relprime])
   43.10  
   43.11  
   43.12 @@ -292,18 +292,18 @@
   43.13  lemma C_card_eq_D_plus_E: "card C = card D + card E"
   43.14    by (auto simp add: C_eq card_Un_disjoint D_E_disj finite_D finite_E)
   43.15  
   43.16 -lemma C_prod_eq_D_times_E: "setprod id E * setprod id D = setprod id C"
   43.17 +lemma C_prod_eq_D_times_E: "prod id E * prod id D = prod id C"
   43.18    apply (insert D_E_disj finite_D finite_E C_eq)
   43.19 -  apply (frule setprod.union_disjoint [of D E id])
   43.20 +  apply (frule prod.union_disjoint [of D E id])
   43.21    apply auto
   43.22    done
   43.23  
   43.24 -lemma C_B_zcong_prod: "[setprod id C = setprod id B] (mod p)"
   43.25 +lemma C_B_zcong_prod: "[prod id C = prod id B] (mod p)"
   43.26    apply (auto simp add: C_def)
   43.27    apply (insert finite_B SR_B_inj)
   43.28 -  apply (frule setprod.reindex [of "StandardRes p" B id])
   43.29 +  apply (frule prod.reindex [of "StandardRes p" B id])
   43.30    apply auto
   43.31 -  apply (rule setprod_same_function_zcong)
   43.32 +  apply (rule prod_same_function_zcong)
   43.33    apply (auto simp add: StandardRes_prop1 zcong_sym p_g_0)
   43.34    done
   43.35  
   43.36 @@ -372,25 +372,25 @@
   43.37    using finite_A F_Un_D_subset A_card_eq F_Un_D_card by (auto simp add: card_seteq)
   43.38  
   43.39  lemma prod_D_F_eq_prod_A:
   43.40 -    "(setprod id D) * (setprod id F) = setprod id A"
   43.41 +    "(prod id D) * (prod id F) = prod id A"
   43.42    apply (insert F_D_disj finite_D finite_F)
   43.43 -  apply (frule setprod.union_disjoint [of F D id])
   43.44 +  apply (frule prod.union_disjoint [of F D id])
   43.45    apply (auto simp add: F_Un_D_eq_A)
   43.46    done
   43.47  
   43.48  lemma prod_F_zcong:
   43.49 -  "[setprod id F = ((-1) ^ (card E)) * (setprod id E)] (mod p)"
   43.50 +  "[prod id F = ((-1) ^ (card E)) * (prod id E)] (mod p)"
   43.51  proof -
   43.52 -  have "setprod id F = setprod id (op - p ` E)"
   43.53 +  have "prod id F = prod id (op - p ` E)"
   43.54      by (auto simp add: F_def)
   43.55 -  then have "setprod id F = setprod (op - p) E"
   43.56 +  then have "prod id F = prod (op - p) E"
   43.57      apply simp
   43.58      apply (insert finite_E inj_on_pminusx_E)
   43.59 -    apply (frule setprod.reindex [of "minus p" E id])
   43.60 +    apply (frule prod.reindex [of "minus p" E id])
   43.61      apply auto
   43.62      done
   43.63    then have one:
   43.64 -    "[setprod id F = setprod (StandardRes p o (op - p)) E] (mod p)"
   43.65 +    "[prod id F = prod (StandardRes p o (op - p)) E] (mod p)"
   43.66      apply simp
   43.67      apply (insert p_g_0 finite_E StandardRes_prod)
   43.68      by (auto)
   43.69 @@ -409,20 +409,20 @@
   43.70      apply (rule_tac b = "p - x" in zcong_trans, auto)
   43.71      done
   43.72    ultimately have c:
   43.73 -    "[setprod (StandardRes p o (op - p)) E = setprod (uminus) E](mod p)"
   43.74 +    "[prod (StandardRes p o (op - p)) E = prod (uminus) E](mod p)"
   43.75      apply simp
   43.76      using finite_E p_g_0
   43.77 -      setprod_same_function_zcong [of E "StandardRes p o (op - p)" uminus p]
   43.78 +      prod_same_function_zcong [of E "StandardRes p o (op - p)" uminus p]
   43.79      by auto
   43.80 -  then have two: "[setprod id F = setprod (uminus) E](mod p)"
   43.81 +  then have two: "[prod id F = prod (uminus) E](mod p)"
   43.82      apply (insert one c)
   43.83 -    apply (rule zcong_trans [of "setprod id F"
   43.84 -                               "setprod (StandardRes p o op - p) E" p
   43.85 -                               "setprod uminus E"], auto)
   43.86 +    apply (rule zcong_trans [of "prod id F"
   43.87 +                               "prod (StandardRes p o op - p) E" p
   43.88 +                               "prod uminus E"], auto)
   43.89      done
   43.90 -  also have "setprod uminus E = (setprod id E) * (-1)^(card E)"
   43.91 +  also have "prod uminus E = (prod id E) * (-1)^(card E)"
   43.92      using finite_E by (induct set: finite) auto
   43.93 -  then have "setprod uminus E = (-1) ^ (card E) * (setprod id E)"
   43.94 +  then have "prod uminus E = (-1) ^ (card E) * (prod id E)"
   43.95      by (simp add: mult.commute)
   43.96    with two show ?thesis
   43.97      by simp
   43.98 @@ -431,52 +431,52 @@
   43.99  
  43.100  subsection \<open>Gauss' Lemma\<close>
  43.101  
  43.102 -lemma aux: "setprod id A * (- 1) ^ card E * a ^ card A * (- 1) ^ card E = setprod id A * a ^ card A"
  43.103 +lemma aux: "prod id A * (- 1) ^ card E * a ^ card A * (- 1) ^ card E = prod id A * a ^ card A"
  43.104    by (auto simp add: finite_E neg_one_special)
  43.105  
  43.106  theorem pre_gauss_lemma:
  43.107    "[a ^ nat((p - 1) div 2) = (-1) ^ (card E)] (mod p)"
  43.108  proof -
  43.109 -  have "[setprod id A = setprod id F * setprod id D](mod p)"
  43.110 -    by (auto simp add: prod_D_F_eq_prod_A mult.commute cong del: setprod.strong_cong)
  43.111 -  then have "[setprod id A = ((-1)^(card E) * setprod id E) *
  43.112 -      setprod id D] (mod p)"
  43.113 -    by (rule zcong_trans) (auto simp add: prod_F_zcong zcong_scalar cong del: setprod.strong_cong)
  43.114 -  then have "[setprod id A = ((-1)^(card E) * setprod id C)] (mod p)"
  43.115 +  have "[prod id A = prod id F * prod id D](mod p)"
  43.116 +    by (auto simp add: prod_D_F_eq_prod_A mult.commute cong del: prod.strong_cong)
  43.117 +  then have "[prod id A = ((-1)^(card E) * prod id E) *
  43.118 +      prod id D] (mod p)"
  43.119 +    by (rule zcong_trans) (auto simp add: prod_F_zcong zcong_scalar cong del: prod.strong_cong)
  43.120 +  then have "[prod id A = ((-1)^(card E) * prod id C)] (mod p)"
  43.121      apply (rule zcong_trans)
  43.122      apply (insert C_prod_eq_D_times_E, erule subst)
  43.123      apply (subst mult.assoc)
  43.124      apply auto
  43.125      done
  43.126 -  then have "[setprod id A = ((-1)^(card E) * setprod id B)] (mod p)"
  43.127 +  then have "[prod id A = ((-1)^(card E) * prod id B)] (mod p)"
  43.128      apply (rule zcong_trans)
  43.129 -    apply (simp add: C_B_zcong_prod zcong_scalar2 cong del: setprod.strong_cong)
  43.130 +    apply (simp add: C_B_zcong_prod zcong_scalar2 cong del: prod.strong_cong)
  43.131      done
  43.132 -  then have "[setprod id A = ((-1)^(card E) *
  43.133 -    (setprod id ((%x. x * a) ` A)))] (mod p)"
  43.134 +  then have "[prod id A = ((-1)^(card E) *
  43.135 +    (prod id ((%x. x * a) ` A)))] (mod p)"
  43.136      by (simp add: B_def)
  43.137 -  then have "[setprod id A = ((-1)^(card E) * (setprod (%x. x * a) A))]
  43.138 +  then have "[prod id A = ((-1)^(card E) * (prod (%x. x * a) A))]
  43.139      (mod p)"
  43.140 -    by (simp add:finite_A inj_on_xa_A setprod.reindex cong del: setprod.strong_cong)
  43.141 -  moreover have "setprod (%x. x * a) A =
  43.142 -    setprod (%x. a) A * setprod id A"
  43.143 +    by (simp add:finite_A inj_on_xa_A prod.reindex cong del: prod.strong_cong)
  43.144 +  moreover have "prod (%x. x * a) A =
  43.145 +    prod (%x. a) A * prod id A"
  43.146      using finite_A by (induct set: finite) auto
  43.147 -  ultimately have "[setprod id A = ((-1)^(card E) * (setprod (%x. a) A *
  43.148 -    setprod id A))] (mod p)"
  43.149 +  ultimately have "[prod id A = ((-1)^(card E) * (prod (%x. a) A *
  43.150 +    prod id A))] (mod p)"
  43.151      by simp
  43.152 -  then have "[setprod id A = ((-1)^(card E) * a^(card A) *
  43.153 -      setprod id A)](mod p)"
  43.154 -    by (rule zcong_trans) (simp add: zcong_scalar2 zcong_scalar finite_A setprod_constant mult.assoc)
  43.155 -  then have a: "[setprod id A * (-1)^(card E) =
  43.156 -      ((-1)^(card E) * a^(card A) * setprod id A * (-1)^(card E))](mod p)"
  43.157 +  then have "[prod id A = ((-1)^(card E) * a^(card A) *
  43.158 +      prod id A)](mod p)"
  43.159 +    by (rule zcong_trans) (simp add: zcong_scalar2 zcong_scalar finite_A prod_constant mult.assoc)
  43.160 +  then have a: "[prod id A * (-1)^(card E) =
  43.161 +      ((-1)^(card E) * a^(card A) * prod id A * (-1)^(card E))](mod p)"
  43.162      by (rule zcong_scalar)
  43.163 -  then have "[setprod id A * (-1)^(card E) = setprod id A *
  43.164 +  then have "[prod id A * (-1)^(card E) = prod id A *
  43.165        (-1)^(card E) * a^(card A) * (-1)^(card E)](mod p)"
  43.166      by (rule zcong_trans) (simp add: a mult.commute mult.left_commute)
  43.167 -  then have "[setprod id A * (-1)^(card E) = setprod id A *
  43.168 +  then have "[prod id A * (-1)^(card E) = prod id A *
  43.169        a^(card A)](mod p)"
  43.170 -    by (rule zcong_trans) (simp add: aux cong del: setprod.strong_cong)
  43.171 -  with this zcong_cancel2 [of p "setprod id A" "(- 1) ^ card E" "a ^ card A"]
  43.172 +    by (rule zcong_trans) (simp add: aux cong del: prod.strong_cong)
  43.173 +  with this zcong_cancel2 [of p "prod id A" "(- 1) ^ card E" "a ^ card A"]
  43.174        p_g_0 A_prod_relprime have "[(- 1) ^ card E = a ^ card A](mod p)"
  43.175      by (simp add: order_less_imp_le)
  43.176    from this show ?thesis
    44.1 --- a/src/HOL/Old_Number_Theory/Int2.thy	Mon Oct 17 14:37:32 2016 +0200
    44.2 +++ b/src/HOL/Old_Number_Theory/Int2.thy	Mon Oct 17 17:33:07 2016 +0200
    44.3 @@ -170,7 +170,7 @@
    44.4    done
    44.5  
    44.6  lemma all_relprime_prod_relprime: "[| finite A; \<forall>x \<in> A. zgcd x y = 1 |]
    44.7 -    ==> zgcd (setprod id A) y = 1"
    44.8 +    ==> zgcd (prod id A) y = 1"
    44.9    by (induct set: finite) (auto simp add: zgcd_zgcd_zmult)
   44.10  
   44.11  
    45.1 --- a/src/HOL/Old_Number_Theory/Pocklington.thy	Mon Oct 17 14:37:32 2016 +0200
    45.2 +++ b/src/HOL/Old_Number_Theory/Pocklington.thy	Mon Oct 17 17:33:07 2016 +0200
    45.3 @@ -561,7 +561,7 @@
    45.4  
    45.5  lemma nproduct_mod:
    45.6    assumes fS: "finite S" and n0: "n \<noteq> 0"
    45.7 -  shows "[setprod (\<lambda>m. a(m) mod n) S = setprod a S] (mod n)"
    45.8 +  shows "[prod (\<lambda>m. a(m) mod n) S = prod a S] (mod n)"
    45.9  proof-
   45.10    have th1:"[1 = 1] (mod n)" by (simp add: modeq_def)
   45.11    from cong_mult
   45.12 @@ -569,17 +569,17 @@
   45.13      [x1 = x2] (mod n) \<and> [y1 = y2] (mod n) \<longrightarrow> [x1 * y1 = x2 * y2] (mod n)"
   45.14      by blast
   45.15    have th4:"\<forall>x\<in>S. [a x mod n = a x] (mod n)" by (simp add: modeq_def)
   45.16 -  from setprod.related [where h="(\<lambda>m. a(m) mod n)" and g=a, OF th1 th3 fS, OF th4] show ?thesis by (simp add: fS)
   45.17 +  from prod.related [where h="(\<lambda>m. a(m) mod n)" and g=a, OF th1 th3 fS, OF th4] show ?thesis by (simp add: fS)
   45.18  qed
   45.19  
   45.20  lemma nproduct_cmul:
   45.21    assumes fS:"finite S"
   45.22 -  shows "setprod (\<lambda>m. (c::'a::{comm_monoid_mult})* a(m)) S = c ^ (card S) * setprod a S"
   45.23 -unfolding setprod.distrib setprod_constant [of c] ..
   45.24 +  shows "prod (\<lambda>m. (c::'a::{comm_monoid_mult})* a(m)) S = c ^ (card S) * prod a S"
   45.25 +unfolding prod.distrib prod_constant [of c] ..
   45.26  
   45.27  lemma coprime_nproduct:
   45.28    assumes fS: "finite S" and Sn: "\<forall>x\<in>S. coprime n (a x)"
   45.29 -  shows "coprime n (setprod a S)"
   45.30 +  shows "coprime n (prod a S)"
   45.31    using fS by (rule finite_subset_induct)
   45.32      (insert Sn, auto simp add: coprime_mul)
   45.33  
   45.34 @@ -607,7 +607,7 @@
   45.35        let ?h = "\<lambda>m. (a * m) mod n"
   45.36        
   45.37        have eq0: "(\<Prod>i\<in>?S. ?h i) = (\<Prod>i\<in>?S. i)"
   45.38 -      proof (rule setprod.reindex_bij_betw)
   45.39 +      proof (rule prod.reindex_bij_betw)
   45.40          have "inj_on (\<lambda>i. ?h i) ?S"
   45.41          proof (rule inj_onI)
   45.42            fix x y assume "?h x = ?h y"
   45.43 @@ -636,7 +636,7 @@
   45.44        have "[(\<Prod>i\<in>?S. a * i) = (\<Prod>i\<in>?S. ?h i)] (mod n)"
   45.45          by (simp add: cong_commute)
   45.46        also have "[(\<Prod>i\<in>?S. ?h i) = ?P] (mod n)"
   45.47 -        using eq0 fS an by (simp add: setprod_def modeq_def)
   45.48 +        using eq0 fS an by (simp add: prod_def modeq_def)
   45.49        finally show "[?P*a^ (\<phi> n) = ?P*1] (mod n)"
   45.50          unfolding cardfS mult.commute[of ?P "a^ (card ?S)"]
   45.51            nproduct_cmul[OF fS, symmetric] mult_1_right by simp
    46.1 --- a/src/HOL/Old_Number_Theory/Residues.thy	Mon Oct 17 14:37:32 2016 +0200
    46.2 +++ b/src/HOL/Old_Number_Theory/Residues.thy	Mon Oct 17 17:33:07 2016 +0200
    46.3 @@ -147,7 +147,7 @@
    46.4    by (auto simp add: zcong_zmod)
    46.5  
    46.6  lemma StandardRes_prod: "[| finite X; 0 < m |] 
    46.7 -     ==> [setprod f X = setprod (StandardRes m o f) X] (mod m)"
    46.8 +     ==> [prod f X = prod (StandardRes m o f) X] (mod m)"
    46.9    apply (rule_tac F = X in finite_induct)
   46.10    apply (auto intro!: zcong_zmult simp add: StandardRes_prop1)
   46.11    done
    47.1 --- a/src/HOL/Old_Number_Theory/WilsonBij.thy	Mon Oct 17 14:37:32 2016 +0200
    47.2 +++ b/src/HOL/Old_Number_Theory/WilsonBij.thy	Mon Oct 17 17:33:07 2016 +0200
    47.3 @@ -229,9 +229,9 @@
    47.4      apply (subgoal_tac [2] "a = 1 \<or> a = p - 1")
    47.5       apply (rule_tac [3] zcong_square_zless)
    47.6          apply auto
    47.7 -  apply (subst setprod.insert)
    47.8 +  apply (subst prod.insert)
    47.9      prefer 3
   47.10 -    apply (subst setprod.insert)
   47.11 +    apply (subst prod.insert)
   47.12        apply (auto simp add: fin_bijER)
   47.13    apply (subgoal_tac "zcong ((a * b) * \<Prod>A) (1 * 1) p")
   47.14     apply (simp add: mult.assoc)
    48.1 --- a/src/HOL/Old_Number_Theory/WilsonRuss.thy	Mon Oct 17 14:37:32 2016 +0200
    48.2 +++ b/src/HOL/Old_Number_Theory/WilsonRuss.thy	Mon Oct 17 17:33:07 2016 +0200
    48.3 @@ -247,8 +247,8 @@
    48.4     prefer 2
    48.5     apply (subst wset.simps)
    48.6     apply (auto, unfold Let_def, auto)
    48.7 -  apply (subst setprod.insert)
    48.8 -    apply (tactic \<open>stac @{context} @{thm setprod.insert} 3\<close>)
    48.9 +  apply (subst prod.insert)
   48.10 +    apply (tactic \<open>stac @{context} @{thm prod.insert} 3\<close>)
   48.11        apply (subgoal_tac [5]
   48.12          "zcong (a * inv p a * (\<Prod>x\<in>wset (a - 1) p. x)) (1 * 1) p")
   48.13         prefer 5
    49.1 --- a/src/HOL/Probability/Central_Limit_Theorem.thy	Mon Oct 17 14:37:32 2016 +0200
    49.2 +++ b/src/HOL/Probability/Central_Limit_Theorem.thy	Mon Oct 17 17:33:07 2016 +0200
    49.3 @@ -64,7 +64,7 @@
    49.4        apply auto
    49.5        done
    49.6      also have "\<dots> = (\<psi> n t)^n"
    49.7 -      by (auto simp add: * setprod_constant)
    49.8 +      by (auto simp add: * prod_constant)
    49.9      finally have \<phi>_eq: "\<phi> n t =(\<psi> n t)^n" .
   49.10  
   49.11      have "norm (\<psi> n t - (1 - ?t^2 * \<sigma>\<^sup>2 / 2)) \<le> ?t\<^sup>2 / 6 * (LINT x|\<mu>. min (6 * x\<^sup>2) (\<bar>?t\<bar> * \<bar>x\<bar> ^ 3))"
    50.1 --- a/src/HOL/Probability/Independent_Family.thy	Mon Oct 17 14:37:32 2016 +0200
    50.2 +++ b/src/HOL/Probability/Independent_Family.thy	Mon Oct 17 17:33:07 2016 +0200
    50.3 @@ -166,7 +166,7 @@
    50.4                also have "\<dots> = prob (A j) * (\<Prod>i\<in>J-{j}. prob (A i))"
    50.5                  using \<open>A j = X\<close> by simp
    50.6                also have "\<dots> = (\<Prod>i\<in>J. prob (A i))"
    50.7 -                unfolding setprod.insert_remove[OF \<open>finite J\<close>, symmetric, of "\<lambda>i. prob  (A i)"]
    50.8 +                unfolding prod.insert_remove[OF \<open>finite J\<close>, symmetric, of "\<lambda>i. prob  (A i)"]
    50.9                  using \<open>j \<in> J\<close> by (simp add: insert_absorb)
   50.10                finally show ?thesis .
   50.11              qed
   50.12 @@ -207,7 +207,7 @@
   50.13              have "prob (\<Inter>i\<in>insert j J. (A(j := X)) i) = (\<Prod>i\<in>insert j J. prob ((A(j := X)) i))"
   50.14                using J A \<open>j \<in> K\<close> by (intro indep_setsD[OF G']) auto
   50.15              then have "prob (\<Inter>i\<in>insert j J. (A(j := X)) i) = prob X * (\<Prod>i\<in>J. prob (A i))"
   50.16 -              using \<open>finite J\<close> \<open>j \<notin> J\<close> by (auto intro!: setprod.cong) }
   50.17 +              using \<open>finite J\<close> \<open>j \<notin> J\<close> by (auto intro!: prod.cong) }
   50.18            ultimately have "prob ((\<Inter>j\<in>J. A j) \<inter> (space M - X)) = (prob (space M) - prob X) * (\<Prod>i\<in>J. prob (A i))"
   50.19              by (simp add: field_simps)
   50.20            also have "\<dots> = prob (space M - X) * (\<Prod>i\<in>J. prob (A i))"
   50.21 @@ -233,7 +233,7 @@
   50.22            qed
   50.23            moreover { fix k
   50.24              from J A \<open>j \<in> K\<close> have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * (\<Prod>i\<in>J. prob (A i))"
   50.25 -              by (subst indep_setsD[OF F(2)]) (auto intro!: setprod.cong split: if_split_asm)
   50.26 +              by (subst indep_setsD[OF F(2)]) (auto intro!: prod.cong split: if_split_asm)
   50.27              also have "\<dots> = prob (F k) * prob (\<Inter>i\<in>J. A i)"
   50.28                using J A \<open>j \<in> K\<close> by (subst indep_setsD[OF G(1)]) auto
   50.29              finally have "prob (\<Inter>i\<in>insert j J. (A(j := F k)) i) = prob (F k) * prob (\<Inter>i\<in>J. A i)" . }
   50.30 @@ -478,9 +478,9 @@
   50.31        also have "\<dots> = (\<Prod>l\<in>(\<Union>k\<in>K. L k). prob (?E' l))"
   50.32          using L K E' by (intro indep_setsD[OF indep]) (simp_all add: UN_mono)
   50.33        also have "\<dots> = (\<Prod>j\<in>K. \<Prod>l\<in>L j. prob (E' j l))"
   50.34 -        using K L L_inj by (subst setprod.UNION_disjoint) auto
   50.35 +        using K L L_inj by (subst prod.UNION_disjoint) auto
   50.36        also have "\<dots> = (\<Prod>j\<in>K. prob (A j))"
   50.37 -        using K L E' by (auto simp add: A intro!: setprod.cong indep_setsD[OF indep, symmetric]) blast
   50.38 +        using K L E' by (auto simp add: A intro!: prod.cong indep_setsD[OF indep, symmetric]) blast
   50.39        finally show "prob (\<Inter>j\<in>K. A j) = (\<Prod>j\<in>K. prob (A j))" .
   50.40      qed
   50.41    next
   50.42 @@ -849,8 +849,8 @@
   50.43      with indep have "prob (\<Inter>j\<in>I. ?A j) = (\<Prod>j\<in>I. prob (?A j))"
   50.44        by auto
   50.45      also have "\<dots> = (\<Prod>j\<in>J. prob (A j))"
   50.46 -      unfolding if_distrib setprod.If_cases[OF \<open>finite I\<close>]
   50.47 -      using prob_space \<open>J \<subseteq> I\<close> by (simp add: Int_absorb1 setprod.neutral_const)
   50.48 +      unfolding if_distrib prod.If_cases[OF \<open>finite I\<close>]
   50.49 +      using prob_space \<open>J \<subseteq> I\<close> by (simp add: Int_absorb1 prod.neutral_const)
   50.50      finally show "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))" ..
   50.51    qed
   50.52  qed
   50.53 @@ -1007,7 +1007,7 @@
   50.54    finally show ?thesis .
   50.55  qed
   50.56  
   50.57 -lemma (in prob_space) indep_vars_setprod:
   50.58 +lemma (in prob_space) indep_vars_prod:
   50.59    fixes X :: "'i \<Rightarrow> 'a \<Rightarrow> real"
   50.60    assumes I: "finite I" "i \<notin> I" and indep: "indep_vars (\<lambda>_. borel) X (insert i I)"
   50.61    shows "indep_var borel (X i) borel (\<lambda>\<omega>. \<Prod>i\<in>I. X i \<omega>)"
   50.62 @@ -1092,7 +1092,7 @@
   50.63          using J \<open>I \<noteq> {}\<close> measurable_space[OF rv] by (auto simp: prod_emb_def PiE_iff split: if_split_asm)
   50.64        also have "emeasure M (\<Inter>i\<in>J. X i -` Y i \<inter> space M) = (\<Prod> i\<in>J. emeasure M (X i -` Y i \<inter> space M))"
   50.65          using \<open>indep_vars M' X I\<close> J \<open>I \<noteq> {}\<close> using indep_varsD[of M' X I J]
   50.66 -        by (auto simp: emeasure_eq_measure setprod_ennreal measure_nonneg setprod_nonneg)
   50.67 +        by (auto simp: emeasure_eq_measure prod_ennreal measure_nonneg prod_nonneg)
   50.68        also have "\<dots> = (\<Prod> i\<in>J. emeasure (?D' i) (Y i))"
   50.69          using rv J by (simp add: emeasure_distr)
   50.70        also have "\<dots> = emeasure ?P' E"
   50.71 @@ -1133,7 +1133,7 @@
   50.72          using rv J Y by (simp add: emeasure_distr)
   50.73        finally have "emeasure M (\<Inter>j\<in>J. Y' j) = (\<Prod> i\<in>J. emeasure M (Y' i))" .
   50.74        then show "prob (\<Inter>j\<in>J. Y' j) = (\<Prod> i\<in>J. prob (Y' i))"
   50.75 -        by (auto simp: emeasure_eq_measure setprod_ennreal measure_nonneg setprod_nonneg)
   50.76 +        by (auto simp: emeasure_eq_measure prod_ennreal measure_nonneg prod_nonneg)
   50.77      qed
   50.78    qed
   50.79  qed
   50.80 @@ -1283,15 +1283,15 @@
   50.81      by (rule indep_vars_cong[THEN iffD1, OF _ _ _ I(2)]) (auto simp: Y_def)
   50.82  
   50.83    have "(\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. X i \<omega>) \<partial>M) = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. Y i \<omega>) \<partial>M)"
   50.84 -    using I(3) by (auto intro!: nn_integral_cong setprod.cong simp add: Y_def max_def)
   50.85 +    using I(3) by (auto intro!: nn_integral_cong prod.cong simp add: Y_def max_def)
   50.86    also have "\<dots> = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x))"
   50.87      by (subst nn_integral_distr) auto
   50.88    also have "\<dots> = (\<integral>\<^sup>+\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))"
   50.89      unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y] ..
   50.90    also have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<^sup>+\<omega>. \<omega> \<partial>distr M borel (Y i)))"
   50.91 -    by (rule product_nn_integral_setprod) (auto intro: \<open>finite I\<close>)
   50.92 +    by (rule product_nn_integral_prod) (auto intro: \<open>finite I\<close>)
   50.93    also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<^sup>+\<omega>. X i \<omega> \<partial>M)"
   50.94 -    by (intro setprod.cong nn_integral_cong) (auto simp: nn_integral_distr Y_def rv_X)
   50.95 +    by (intro prod.cong nn_integral_cong) (auto simp: nn_integral_distr Y_def rv_X)
   50.96    finally show ?thesis .
   50.97  qed (simp add: emeasure_space_1)
   50.98  
   50.99 @@ -1330,15 +1330,15 @@
  50.100    also have "\<dots> = (\<integral>\<omega>. (\<Prod>i\<in>I. \<omega> i) \<partial>Pi\<^sub>M I (\<lambda>i. distr M borel (Y i)))"
  50.101      unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y] ..
  50.102    also have "\<dots> = (\<Prod>i\<in>I. (\<integral>\<omega>. \<omega> \<partial>distr M borel (Y i)))"
  50.103 -    by (rule product_integral_setprod) (auto intro: \<open>finite I\<close> simp: integrable_distr_eq int_Y)
  50.104 +    by (rule product_integral_prod) (auto intro: \<open>finite I\<close> simp: integrable_distr_eq int_Y)
  50.105    also have "\<dots> = (\<Prod>i\<in>I. \<integral>\<omega>. X i \<omega> \<partial>M)"
  50.106 -    by (intro setprod.cong integral_cong)
  50.107 +    by (intro prod.cong integral_cong)
  50.108         (auto simp: integral_distr Y_def rv_X)
  50.109    finally show ?eq .
  50.110  
  50.111    have "integrable (distr M (Pi\<^sub>M I (\<lambda>i. borel)) (\<lambda>x. \<lambda>i\<in>I. Y i x)) (\<lambda>\<omega>. (\<Prod>i\<in>I. \<omega> i))"
  50.112      unfolding indep_vars_iff_distr_eq_PiM[THEN iffD1, OF \<open>I \<noteq> {}\<close> rv_Y indep_Y]
  50.113 -    by (intro product_integrable_setprod[OF \<open>finite I\<close>])
  50.114 +    by (intro product_integrable_prod[OF \<open>finite I\<close>])
  50.115         (simp add: integrable_distr_eq int_Y)
  50.116    then show ?int
  50.117      by (simp add: integrable_distr_eq Y_def)
    51.1 --- a/src/HOL/Probability/Infinite_Product_Measure.thy	Mon Oct 17 14:37:32 2016 +0200
    51.2 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy	Mon Oct 17 17:33:07 2016 +0200
    51.3 @@ -98,7 +98,7 @@
    51.4    shows "measure (PiM I M) (emb I J (Pi\<^sub>E J X)) = (\<Prod> i\<in>J. measure (M i) (X i))"
    51.5    using emeasure_PiM_emb[OF assms]
    51.6    unfolding emeasure_eq_measure M.emeasure_eq_measure
    51.7 -  by (simp add: setprod_ennreal measure_nonneg setprod_nonneg)
    51.8 +  by (simp add: prod_ennreal measure_nonneg prod_nonneg)
    51.9  
   51.10  lemma sets_Collect_single':
   51.11    "i \<in> I \<Longrightarrow> {x\<in>space (M i). P x} \<in> sets (M i) \<Longrightarrow> {x\<in>space (PiM I M). P (x i)} \<in> sets (PiM I M)"
   51.12 @@ -151,7 +151,7 @@
   51.13    have "emeasure (Pi\<^sub>M I M) (prod_emb I M J (Pi\<^sub>E J A)) = emeasure (Pi\<^sub>M I ?M) (P.emb I J (Pi\<^sub>E J A))"
   51.14      by (auto simp: prod_emb_def PiE_iff intro!: arg_cong2[where f=emeasure] PiM_cong)
   51.15    also have "\<dots> = (\<Prod>i\<in>J. emeasure (M i) (A i))"
   51.16 -    using J A by (subst P.emeasure_PiM_emb[OF J]) (auto intro!: setprod.cong)
   51.17 +    using J A by (subst P.emeasure_PiM_emb[OF J]) (auto intro!: prod.cong)
   51.18    finally show ?thesis .
   51.19  qed
   51.20  
   51.21 @@ -173,7 +173,7 @@
   51.22    have "Pi\<^sub>M (insert i' I) M ?X = (\<Prod>i\<in>J. M i (A i))"
   51.23      using M J A by (intro emeasure_PiM_emb) auto
   51.24    also have "\<dots> = M i' (if i' \<in> J then (A i') else space (M i')) * (\<Prod>i\<in>J-{i'}. M i (A i))"
   51.25 -    using setprod.insert_remove[of J "\<lambda>i. M i (A i)" i'] J M'.emeasure_space_1
   51.26 +    using prod.insert_remove[of J "\<lambda>i. M i (A i)" i'] J M'.emeasure_space_1
   51.27      by (cases "i' \<in> J") (auto simp: insert_absorb)
   51.28    also have "(\<Prod>i\<in>J-{i'}. M i (A i)) = Pi\<^sub>M I M (prod_emb I M (J - {i'}) (Pi\<^sub>E (J - {i'}) A))"
   51.29      using M J A by (intro emeasure_PiM_emb[symmetric]) auto
   51.30 @@ -205,7 +205,7 @@
   51.31    have "?I (prod_emb I (\<lambda>i. M (f i)) J (Pi\<^sub>E J A)) = (\<Prod>j\<in>J. M (f j) (A j))"
   51.32      using f J A by (intro emeasure_PiM_emb M) auto
   51.33    also have "\<dots> = (\<Prod>j\<in>f`J. M j (A (the_inv_into I f j)))"
   51.34 -    using f J by (subst setprod.reindex) (auto intro!: setprod.cong intro: inj_on_subset simp: the_inv_into_f_f)
   51.35 +    using f J by (subst prod.reindex) (auto intro!: prod.cong intro: inj_on_subset simp: the_inv_into_f_f)
   51.36    also have "\<dots> = ?K (prod_emb K M (f`J) (\<Pi>\<^sub>E j\<in>f`J. A (the_inv_into I f j)))"
   51.37      using f J A by (intro emeasure_PiM_emb[symmetric] M) (auto simp: the_inv_into_f_f)
   51.38    also have "prod_emb K M (f`J) (\<Pi>\<^sub>E j\<in>f`J. A (the_inv_into I f j)) = ?t -` prod_emb I (\<lambda>i. M (f i)) J (Pi\<^sub>E J A) \<inter> space ?K"
   51.39 @@ -352,12 +352,12 @@
   51.40    also have "emeasure S ?F = (\<Prod>j\<in>(op + i) -` J. emeasure M (E (i + j)))"
   51.41      using J by (intro emeasure_PiM_emb) (simp_all add: finite_vimageI inj_on_def)
   51.42    also have "\<dots> = (\<Prod>j\<in>J - (J \<inter> {..<i}). emeasure M (E j))"
   51.43 -    by (rule setprod.reindex_cong [of "\<lambda>x. x - i"])
   51.44 +    by (rule prod.reindex_cong [of "\<lambda>x. x - i"])
   51.45         (auto simp: image_iff Bex_def not_less nat_eq_diff_eq ac_simps cong: conj_cong intro!: inj_onI)
   51.46    also have "emeasure S ?E = (\<Prod>j\<in>J \<inter> {..<i}. emeasure M (E j))"
   51.47      using J by (intro emeasure_PiM_emb) simp_all
   51.48    also have "(\<Prod>j\<in>J \<inter> {..<i}. emeasure M (E j)) * (\<Prod>j\<in>J - (J \<inter> {..<i}). emeasure M (E j)) = (\<Prod>j\<in>J. emeasure M (E j))"
   51.49 -    by (subst mult.commute) (auto simp: J setprod.subset_diff[symmetric])
   51.50 +    by (subst mult.commute) (auto simp: J prod.subset_diff[symmetric])
   51.51    finally show "emeasure ?D ?X = (\<Prod>j\<in>J. emeasure M (E j))" .
   51.52  qed simp_all
   51.53  
   51.54 @@ -383,10 +383,10 @@
   51.55    also have "emeasure S ?F = (\<Prod>j\<in>Suc -` J. emeasure M (E (Suc j)))"
   51.56      using J by (intro emeasure_PiM_emb) (simp_all add: finite_vimageI)
   51.57    also have "\<dots> = (\<Prod>j\<in>J - {0}. emeasure M (E j))"
   51.58 -    by (rule setprod.reindex_cong [of "\<lambda>x. x - 1"])
   51.59 +    by (rule prod.reindex_cong [of "\<lambda>x. x - 1"])
   51.60         (auto simp: image_iff Bex_def not_less nat_eq_diff_eq ac_simps cong: conj_cong intro!: inj_onI)
   51.61    also have "emeasure M ?E * (\<Prod>j\<in>J - {0}. emeasure M (E j)) = (\<Prod>j\<in>J. emeasure M (E j))"
   51.62 -    by (auto simp: M.emeasure_space_1 setprod.remove J)
   51.63 +    by (auto simp: M.emeasure_space_1 prod.remove J)
   51.64    finally show "emeasure ?D ?X = (\<Prod>j\<in>J. emeasure M (E j))" .
   51.65  qed simp_all
   51.66  
    52.1 --- a/src/HOL/Probability/Probability_Measure.thy	Mon Oct 17 14:37:32 2016 +0200
    52.2 +++ b/src/HOL/Probability/Probability_Measure.thy	Mon Oct 17 17:33:07 2016 +0200
    52.3 @@ -485,7 +485,7 @@
    52.4  sublocale finite_product_prob_space \<subseteq> prob_space "\<Pi>\<^sub>M i\<in>I. M i"
    52.5  proof
    52.6    show "emeasure (\<Pi>\<^sub>M i\<in>I. M i) (space (\<Pi>\<^sub>M i\<in>I. M i)) = 1"
    52.7 -    by (simp add: measure_times M.emeasure_space_1 setprod.neutral_const space_PiM)
    52.8 +    by (simp add: measure_times M.emeasure_space_1 prod.neutral_const space_PiM)
    52.9  qed
   52.10  
   52.11  lemma (in finite_product_prob_space) prob_times:
   52.12 @@ -497,8 +497,8 @@
   52.13    also have "\<dots> = (\<Prod>i\<in>I. emeasure (M i) (X i))"
   52.14      using measure_times X by simp
   52.15    also have "\<dots> = ennreal (\<Prod>i\<in>I. measure (M i) (X i))"
   52.16 -    using X by (simp add: M.emeasure_eq_measure setprod_ennreal measure_nonneg)
   52.17 -  finally show ?thesis by (simp add: measure_nonneg setprod_nonneg)
   52.18 +    using X by (simp add: M.emeasure_eq_measure prod_ennreal measure_nonneg)
   52.19 +  finally show ?thesis by (simp add: measure_nonneg prod_nonneg)
   52.20  qed
   52.21  
   52.22  subsection \<open>Distributions\<close>
   52.23 @@ -1201,8 +1201,8 @@
   52.24      apply (subst emeasure_distr)
   52.25      apply (auto intro!: sets_PiM_I_finite simp: Pi_iff)
   52.26      apply (subst emeasure_PiM)
   52.27 -    apply (auto simp: the_inv_into_f_f \<open>inj_on t J\<close> setprod.reindex[OF \<open>inj_on t J\<close>]
   52.28 -      if_distrib[where f="emeasure (M _)"] setprod.If_cases emeasure_space_1 Int_absorb1 \<open>t`J \<subseteq> K\<close>)
   52.29 +    apply (auto simp: the_inv_into_f_f \<open>inj_on t J\<close> prod.reindex[OF \<open>inj_on t J\<close>]
   52.30 +      if_distrib[where f="emeasure (M _)"] prod.If_cases emeasure_space_1 Int_absorb1 \<open>t`J \<subseteq> K\<close>)
   52.31      done
   52.32  qed simp
   52.33  
    53.1 --- a/src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy	Mon Oct 17 14:37:32 2016 +0200
    53.2 +++ b/src/HOL/Probability/ex/Koepf_Duermuth_Countermeasure.thy	Mon Oct 17 17:33:07 2016 +0200
    53.3 @@ -83,7 +83,7 @@
    53.4  lemma zero_notin_Suc_image[simp]: "0 \<notin> Suc ` A"
    53.5    by auto
    53.6  
    53.7 -lemma setprod_sum_distrib_lists:
    53.8 +lemma prod_sum_distrib_lists:
    53.9    fixes P and S :: "'a set" and f :: "'a \<Rightarrow> _::semiring_0" assumes "finite S"
   53.10    shows "(\<Sum>ms\<in>{ms. set ms \<subseteq> S \<and> length ms = n \<and> (\<forall>i<n. P i (ms!i))}. \<Prod>x<n. f (ms ! x)) =
   53.11           (\<Prod>i<n. \<Sum>m\<in>{m\<in>S. P i m}. f m)"
   53.12 @@ -100,7 +100,7 @@
   53.13    show ?case unfolding *
   53.14      using Suc[of "\<lambda>i. P (Suc i)"]
   53.15      by (simp add: sum.reindex split_conv sum_cartesian_product'
   53.16 -      lessThan_Suc_eq_insert_0 setprod.reindex sum_distrib_right[symmetric] sum_distrib_left[symmetric])
   53.17 +      lessThan_Suc_eq_insert_0 prod.reindex sum_distrib_right[symmetric] sum_distrib_left[symmetric])
   53.18  qed
   53.19  
   53.20  declare space_point_measure[simp]
   53.21 @@ -169,12 +169,12 @@
   53.22      case (Suc n)
   53.23      then show ?case
   53.24        by (simp add: lists_length_Suc_eq lessThan_Suc_eq_insert_0
   53.25 -                    sum.reindex setprod.reindex)
   53.26 +                    sum.reindex prod.reindex)
   53.27    qed
   53.28    then show "sum P msgs = 1"
   53.29      unfolding msgs_def P_def by simp
   53.30    fix x
   53.31 -  have "\<And> A f. 0 \<le> (\<Prod>x\<in>A. M (f x))" by (auto simp: setprod_nonneg)
   53.32 +  have "\<And> A f. 0 \<le> (\<Prod>x\<in>A. M (f x))" by (auto simp: prod_nonneg)
   53.33    then show "0 \<le> P x"
   53.34      unfolding P_def by (auto split: prod.split simp: zero_le_mult_iff)
   53.35  qed auto
   53.36 @@ -255,8 +255,8 @@
   53.37      apply (simp add: \<mu>'_eq)
   53.38      apply (simp add: * P_def)
   53.39      apply (simp add: sum_cartesian_product')
   53.40 -    using setprod_sum_distrib_lists[OF M.finite_space, of M n "\<lambda>x x. True"] \<open>k \<in> keys\<close>
   53.41 -    by (auto simp add: sum_distrib_left[symmetric] subset_eq setprod.neutral_const)
   53.42 +    using prod_sum_distrib_lists[OF M.finite_space, of M n "\<lambda>x x. True"] \<open>k \<in> keys\<close>
   53.43 +    by (auto simp add: sum_distrib_left[symmetric] subset_eq prod.neutral_const)
   53.44  qed
   53.45  
   53.46  lemma fst_image_msgs[simp]: "fst`msgs = keys"
   53.47 @@ -352,14 +352,14 @@
   53.48            (\<Prod>i<n. \<Sum>m\<in>{m\<in>messages. observe k m = obs ! i}. M m)"
   53.49          unfolding P_def using \<open>K k \<noteq> 0\<close> \<open>k \<in> keys\<close>
   53.50          apply (simp add: sum_cartesian_product' sum_divide_distrib msgs_def ** cong: conj_cong)
   53.51 -        apply (subst setprod_sum_distrib_lists[OF M.finite_space]) ..
   53.52 +        apply (subst prod_sum_distrib_lists[OF M.finite_space]) ..
   53.53        finally have "(\<P>(OB ; fst) {(obs, k)}) / K k =
   53.54              (\<Prod>i<n. \<Sum>m\<in>{m\<in>messages. observe k m = obs ! i}. M m)" . }
   53.55      note * = this
   53.56  
   53.57      have "(\<P>(OB ; fst) {(obs, k)}) / K k = (\<P>(OB ; fst) {(obs', k)}) / K k"
   53.58        unfolding *[OF obs] *[OF obs']
   53.59 -      using t_f(1) obs_t_f by (subst (2) t_f(2)) (simp add: setprod.reindex)
   53.60 +      using t_f(1) obs_t_f by (subst (2) t_f(2)) (simp add: prod.reindex)
   53.61      then have "(\<P>(OB ; fst) {(obs, k)}) = (\<P>(OB ; fst) {(obs', k)})"
   53.62        using \<open>K k \<noteq> 0\<close> by auto }
   53.63    note t_eq_imp = this
    54.1 --- a/src/HOL/Rat.thy	Mon Oct 17 14:37:32 2016 +0200
    54.2 +++ b/src/HOL/Rat.thy	Mon Oct 17 17:33:07 2016 +0200
    54.3 @@ -701,7 +701,7 @@
    54.4  lemma of_rat_sum: "of_rat (\<Sum>a\<in>A. f a) = (\<Sum>a\<in>A. of_rat (f a))"
    54.5    by (induct rule: infinite_finite_induct) (auto simp: of_rat_add)
    54.6  
    54.7 -lemma of_rat_setprod: "of_rat (\<Prod>a\<in>A. f a) = (\<Prod>a\<in>A. of_rat (f a))"
    54.8 +lemma of_rat_prod: "of_rat (\<Prod>a\<in>A. f a) = (\<Prod>a\<in>A. of_rat (f a))"
    54.9    by (induct rule: infinite_finite_induct) (auto simp: of_rat_mult)
   54.10  
   54.11  lemma nonzero_of_rat_inverse: "a \<noteq> 0 \<Longrightarrow> of_rat (inverse a) = inverse (of_rat a)"
    55.1 --- a/src/HOL/Real_Vector_Spaces.thy	Mon Oct 17 14:37:32 2016 +0200
    55.2 +++ b/src/HOL/Real_Vector_Spaces.thy	Mon Oct 17 17:33:07 2016 +0200
    55.3 @@ -319,7 +319,7 @@
    55.4  lemma of_real_sum[simp]: "of_real (sum f s) = (\<Sum>x\<in>s. of_real (f x))"
    55.5    by (induct s rule: infinite_finite_induct) auto
    55.6  
    55.7 -lemma of_real_setprod[simp]: "of_real (setprod f s) = (\<Prod>x\<in>s. of_real (f x))"
    55.8 +lemma of_real_prod[simp]: "of_real (prod f s) = (\<Prod>x\<in>s. of_real (f x))"
    55.9    by (induct s rule: infinite_finite_induct) auto
   55.10  
   55.11  lemma nonzero_of_real_inverse:
   55.12 @@ -501,10 +501,10 @@
   55.13    then show ?case by (metis Reals_0 sum.infinite)
   55.14  qed simp_all
   55.15  
   55.16 -lemma setprod_in_Reals [intro,simp]: "(\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> setprod f s \<in> \<real>"
   55.17 +lemma prod_in_Reals [intro,simp]: "(\<And>i. i \<in> s \<Longrightarrow> f i \<in> \<real>) \<Longrightarrow> prod f s \<in> \<real>"
   55.18  proof (induct s rule: infinite_finite_induct)
   55.19    case infinite
   55.20 -  then show ?case by (metis Reals_1 setprod.infinite)
   55.21 +  then show ?case by (metis Reals_1 prod.infinite)
   55.22  qed simp_all
   55.23  
   55.24  lemma Reals_induct [case_names of_real, induct set: Reals]:
   55.25 @@ -978,20 +978,20 @@
   55.26      by simp
   55.27  qed
   55.28  
   55.29 -lemma setprod_norm: "setprod (\<lambda>x. norm (f x)) A = norm (setprod f A)"
   55.30 +lemma prod_norm: "prod (\<lambda>x. norm (f x)) A = norm (prod f A)"
   55.31    for f :: "'a \<Rightarrow> 'b::{comm_semiring_1,real_normed_div_algebra}"
   55.32    by (induct A rule: infinite_finite_induct) (auto simp: norm_mult)
   55.33  
   55.34 -lemma norm_setprod_le:
   55.35 -  "norm (setprod f A) \<le> (\<Prod>a\<in>A. norm (f a :: 'a :: {real_normed_algebra_1,comm_monoid_mult}))"
   55.36 +lemma norm_prod_le:
   55.37 +  "norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a :: 'a :: {real_normed_algebra_1,comm_monoid_mult}))"
   55.38  proof (induct A rule: infinite_finite_induct)
   55.39    case empty
   55.40    then show ?case by simp
   55.41  next
   55.42    case (insert a A)
   55.43 -  then have "norm (setprod f (insert a A)) \<le> norm (f a) * norm (setprod f A)"
   55.44 +  then have "norm (prod f (insert a A)) \<le> norm (f a) * norm (prod f A)"
   55.45      by (simp add: norm_mult_ineq)
   55.46 -  also have "norm (setprod f A) \<le> (\<Prod>a\<in>A. norm (f a))"
   55.47 +  also have "norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))"
   55.48      by (rule insert)
   55.49    finally show ?case
   55.50      by (simp add: insert mult_left_mono)
   55.51 @@ -1000,7 +1000,7 @@
   55.52    then show ?case by simp
   55.53  qed
   55.54  
   55.55 -lemma norm_setprod_diff:
   55.56 +lemma norm_prod_diff:
   55.57    fixes z w :: "'i \<Rightarrow> 'a::{real_normed_algebra_1, comm_monoid_mult}"
   55.58    shows "(\<And>i. i \<in> I \<Longrightarrow> norm (z i) \<le> 1) \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> norm (w i) \<le> 1) \<Longrightarrow>
   55.59      norm ((\<Prod>i\<in>I. z i) - (\<Prod>i\<in>I. w i)) \<le> (\<Sum>i\<in>I. norm (z i - w i))"
   55.60 @@ -1020,9 +1020,9 @@
   55.61    also have "norm ?t1 \<le> norm (\<Prod>i\<in>I. z i) * norm (z i - w i)"
   55.62      by (rule norm_mult_ineq)
   55.63    also have "\<dots> \<le> (\<Prod>i\<in>I. norm (z i)) * norm(z i - w i)"
   55.64 -    by (rule mult_right_mono) (auto intro: norm_setprod_le)
   55.65 +    by (rule mult_right_mono) (auto intro: norm_prod_le)
   55.66    also have "(\<Prod>i\<in>I. norm (z i)) \<le> (\<Prod>i\<in>I. 1)"
   55.67 -    by (intro setprod_mono) (auto intro!: insert)
   55.68 +    by (intro prod_mono) (auto intro!: insert)
   55.69    also have "norm ?t2 \<le> norm ((\<Prod>i\<in>I. z i) - (\<Prod>i\<in>I. w i)) * norm (w i)"
   55.70      by (rule norm_mult_ineq)
   55.71    also have "norm (w i) \<le> 1"
   55.72 @@ -1042,9 +1042,9 @@
   55.73    shows "norm (z^m - w^m) \<le> m * norm (z - w)"
   55.74  proof -
   55.75    have "norm (z^m - w^m) = norm ((\<Prod> i < m. z) - (\<Prod> i < m. w))"
   55.76 -    by (simp add: setprod_constant)
   55.77 +    by (simp add: prod_constant)
   55.78    also have "\<dots> \<le> (\<Sum>i<m. norm (z - w))"
   55.79 -    by (intro norm_setprod_diff) (auto simp add: assms)
   55.80 +    by (intro norm_prod_diff) (auto simp add: assms)
   55.81    also have "\<dots> = m * norm (z - w)"
   55.82      by simp
   55.83    finally show ?thesis .
    56.1 --- a/src/HOL/Set_Interval.thy	Mon Oct 17 14:37:32 2016 +0200
    56.2 +++ b/src/HOL/Set_Interval.thy	Mon Oct 17 17:33:07 2016 +0200
    56.3 @@ -2018,41 +2018,41 @@
    56.4  subsection \<open>Products indexed over intervals\<close>
    56.5  
    56.6  syntax (ASCII)
    56.7 -  "_from_to_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _ = _.._./ _)" [0,0,0,10] 10)
    56.8 -  "_from_upto_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _ = _..<_./ _)" [0,0,0,10] 10)
    56.9 -  "_upt_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _<_./ _)" [0,0,10] 10)
   56.10 -  "_upto_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _<=_./ _)" [0,0,10] 10)
   56.11 +  "_from_to_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _ = _.._./ _)" [0,0,0,10] 10)
   56.12 +  "_from_upto_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _ = _..<_./ _)" [0,0,0,10] 10)
   56.13 +  "_upt_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _<_./ _)" [0,0,10] 10)
   56.14 +  "_upto_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(PROD _<=_./ _)" [0,0,10] 10)
   56.15  
   56.16  syntax (latex_prod output)
   56.17 -  "_from_to_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.18 +  "_from_to_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.19   ("(3\<^latex>\<open>$\\prod_{\<close>_ = _\<^latex>\<open>}^{\<close>_\<^latex>\<open>}$\<close> _)" [0,0,0,10] 10)
   56.20 -  "_from_upto_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.21 +  "_from_upto_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.22   ("(3\<^latex>\<open>$\\prod_{\<close>_ = _\<^latex>\<open>}^{<\<close>_\<^latex>\<open>}$\<close> _)" [0,0,0,10] 10)
   56.23 -  "_upt_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.24 +  "_upt_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.25   ("(3\<^latex>\<open>$\\prod_{\<close>_ < _\<^latex>\<open>}$\<close> _)" [0,0,10] 10)
   56.26 -  "_upto_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.27 +  "_upto_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"
   56.28   ("(3\<^latex>\<open>$\\prod_{\<close>_ \<le> _\<^latex>\<open>}$\<close> _)" [0,0,10] 10)
   56.29  
   56.30  syntax
   56.31 -  "_from_to_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_ = _.._./ _)" [0,0,0,10] 10)
   56.32 -  "_from_upto_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_ = _..<_./ _)" [0,0,0,10] 10)
   56.33 -  "_upt_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_<_./ _)" [0,0,10] 10)
   56.34 -  "_upto_setprod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_\<le>_./ _)" [0,0,10] 10)
   56.35 +  "_from_to_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_ = _.._./ _)" [0,0,0,10] 10)
   56.36 +  "_from_upto_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_ = _..<_./ _)" [0,0,0,10] 10)
   56.37 +  "_upt_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_<_./ _)" [0,0,10] 10)
   56.38 +  "_upto_prod" :: "idt \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> 'b"  ("(3\<Prod>_\<le>_./ _)" [0,0,10] 10)
   56.39  
   56.40  translations
   56.41 -  "\<Prod>x=a..b. t" \<rightleftharpoons> "CONST setprod (\<lambda>x. t) {a..b}"
   56.42 -  "\<Prod>x=a..<b. t" \<rightleftharpoons> "CONST setprod (\<lambda>x. t) {a..<b}"
   56.43 -  "\<Prod>i\<le>n. t" \<rightleftharpoons> "CONST setprod (\<lambda>i. t) {..n}"
   56.44 -  "\<Prod>i<n. t" \<rightleftharpoons> "CONST setprod (\<lambda>i. t) {..<n}"
   56.45 -
   56.46 -lemma setprod_int_plus_eq: "setprod int {i..i+j} =  \<Prod>{int i..int (i+j)}"
   56.47 +  "\<Prod>x=a..b. t" \<rightleftharpoons> "CONST prod (\<lambda>x. t) {a..b}"
   56.48 +  "\<Prod>x=a..<b. t" \<rightleftharpoons> "CONST prod (\<lambda>x. t) {a..<b}"
   56.49 +  "\<Prod>i\<le>n. t" \<rightleftharpoons> "CONST prod (\<lambda>i. t) {..n}"
   56.50 +  "\<Prod>i<n. t" \<rightleftharpoons> "CONST prod (\<lambda>i. t) {..<n}"
   56.51 +
   56.52 +lemma prod_int_plus_eq: "prod int {i..i+j} =  \<Prod>{int i..int (i+j)}"
   56.53    by (induct j) (auto simp add: atLeastAtMostSuc_conv atLeastAtMostPlus1_int_conv)
   56.54  
   56.55 -lemma setprod_int_eq: "setprod int {i..j} =  \<Prod>{int i..int j}"
   56.56 +lemma prod_int_eq: "prod int {i..j} =  \<Prod>{int i..int j}"
   56.57  proof (cases "i \<le> j")
   56.58    case True
   56.59    then show ?thesis
   56.60 -    by (metis le_iff_add setprod_int_plus_eq)
   56.61 +    by (metis le_iff_add prod_int_plus_eq)
   56.62  next
   56.63    case False
   56.64    then show ?thesis
   56.65 @@ -2062,37 +2062,37 @@
   56.66  
   56.67  subsubsection \<open>Shifting bounds\<close>
   56.68  
   56.69 -lemma setprod_shift_bounds_nat_ivl:
   56.70 -  "setprod f {m+k..<n+k} = setprod (%i. f(i + k)){m..<n::nat}"
   56.71 +lemma prod_shift_bounds_nat_ivl:
   56.72 +  "prod f {m+k..<n+k} = prod (%i. f(i + k)){m..<n::nat}"
   56.73  by (induct "n", auto simp:atLeastLessThanSuc)
   56.74  
   56.75 -lemma setprod_shift_bounds_cl_nat_ivl:
   56.76 -  "setprod f {m+k..n+k} = setprod (%i. f(i + k)){m..n::nat}"
   56.77 -  by (rule setprod.reindex_bij_witness[where i="\<lambda>i. i + k" and j="\<lambda>i. i - k"]) auto
   56.78 -
   56.79 -corollary setprod_shift_bounds_cl_Suc_ivl:
   56.80 -  "setprod f {Suc m..Suc n} = setprod (%i. f(Suc i)){m..n}"
   56.81 -by (simp add:setprod_shift_bounds_cl_nat_ivl[where k="Suc 0", simplified])
   56.82 -
   56.83 -corollary setprod_shift_bounds_Suc_ivl:
   56.84 -  "setprod f {Suc m..<Suc n} = setprod (%i. f(Suc i)){m..<n}"
   56.85 -by (simp add:setprod_shift_bounds_nat_ivl[where k="Suc 0", simplified])
   56.86 -
   56.87 -lemma setprod_lessThan_Suc: "setprod f {..<Suc n} = setprod f {..<n} * f n"
   56.88 +lemma prod_shift_bounds_cl_nat_ivl:
   56.89 +  "prod f {m+k..n+k} = prod (%i. f(i + k)){m..n::nat}"
   56.90 +  by (rule prod.reindex_bij_witness[where i="\<lambda>i. i + k" and j="\<lambda>i. i - k"]) auto
   56.91 +
   56.92 +corollary prod_shift_bounds_cl_Suc_ivl:
   56.93 +  "prod f {Suc m..Suc n} = prod (%i. f(Suc i)){m..n}"
   56.94 +by (simp add:prod_shift_bounds_cl_nat_ivl[where k="Suc 0", simplified])
   56.95 +
   56.96 +corollary prod_shift_bounds_Suc_ivl:
   56.97 +  "prod f {Suc m..<Suc n} = prod (%i. f(Suc i)){m..<n}"
   56.98 +by (simp add:prod_shift_bounds_nat_ivl[where k="Suc 0", simplified])
   56.99 +
  56.100 +lemma prod_lessThan_Suc: "prod f {..<Suc n} = prod f {..<n} * f n"
  56.101    by (simp add: lessThan_Suc mult.commute)
  56.102  
  56.103 -lemma setprod_lessThan_Suc_shift:"(\<Prod>i<Suc n. f i) = f 0 * (\<Prod>i<n. f (Suc i))"
  56.104 +lemma prod_lessThan_Suc_shift:"(\<Prod>i<Suc n. f i) = f 0 * (\<Prod>i<n. f (Suc i))"
  56.105    by (induction n) (simp_all add: lessThan_Suc mult_ac)
  56.106  
  56.107 -lemma setprod_atLeastLessThan_Suc: "a \<le> b \<Longrightarrow> setprod f {a..<Suc b} = setprod f {a..<b} * f b"
  56.108 +lemma prod_atLeastLessThan_Suc: "a \<le> b \<Longrightarrow> prod f {a..<Suc b} = prod f {a..<b} * f b"
  56.109    by (simp add: atLeastLessThanSuc mult.commute)
  56.110  
  56.111 -lemma setprod_nat_ivl_Suc':
  56.112 +lemma prod_nat_ivl_Suc':
  56.113    assumes "m \<le> Suc n"
  56.114 -  shows   "setprod f {m..Suc n} = f (Suc n) * setprod f {m..n}"
  56.115 +  shows   "prod f {m..Suc n} = f (Suc n) * prod f {m..n}"
  56.116  proof -
  56.117    from assms have "{m..Suc n} = insert (Suc n) {m..n}" by auto
  56.118 -  also have "setprod f \<dots> = f (Suc n) * setprod f {m..n}" by simp
  56.119 +  also have "prod f \<dots> = f (Suc n) * prod f {m..n}" by simp
  56.120    finally show ?thesis .
  56.121  qed
  56.122  
  56.123 @@ -2133,13 +2133,13 @@
  56.124      by (simp add: sum.eq_fold fold_atLeastAtMost_nat o_def)
  56.125  qed
  56.126  
  56.127 -lemma setprod_atLeastAtMost_code:
  56.128 -  "setprod f {a..b} = fold_atLeastAtMost_nat (\<lambda>a acc. f a * acc) a b 1"
  56.129 +lemma prod_atLeastAtMost_code:
  56.130 +  "prod f {a..b} = fold_atLeastAtMost_nat (\<lambda>a acc. f a * acc) a b 1"
  56.131  proof -
  56.132    have "comp_fun_commute (\<lambda>a. op * (f a))"
  56.133      by unfold_locales (auto simp: o_def mult_ac)
  56.134    thus ?thesis
  56.135 -    by (simp add: setprod.eq_fold fold_atLeastAtMost_nat o_def)
  56.136 +    by (simp add: prod.eq_fold fold_atLeastAtMost_nat o_def)
  56.137  qed
  56.138  
  56.139  (* TODO: Add support for more kinds of intervals here *)
    57.1 --- a/src/HOL/Transcendental.thy	Mon Oct 17 14:37:32 2016 +0200
    57.2 +++ b/src/HOL/Transcendental.thy	Mon Oct 17 17:33:07 2016 +0200
    57.3 @@ -35,7 +35,7 @@
    57.4    by (metis of_nat_fact of_real_of_nat_eq)
    57.5  
    57.6  lemma pochhammer_of_real: "pochhammer (of_real x) n = of_real (pochhammer x n)"
    57.7 -  by (simp add: pochhammer_setprod)
    57.8 +  by (simp add: pochhammer_prod)
    57.9  
   57.10  lemma norm_fact [simp]: "norm (fact n :: 'a::real_normed_algebra_1) = fact n"
   57.11  proof -
   57.12 @@ -1522,7 +1522,7 @@
   57.13  corollary exp_real_of_nat_mult: "exp (real n * x) = exp x ^ n"
   57.14    by (simp add: exp_of_nat_mult)
   57.15  
   57.16 -lemma exp_sum: "finite I \<Longrightarrow> exp (sum f I) = setprod (\<lambda>x. exp (f x)) I"
   57.17 +lemma exp_sum: "finite I \<Longrightarrow> exp (sum f I) = prod (\<lambda>x. exp (f x)) I"
   57.18    by (induct I rule: finite_induct) (auto simp: exp_add_commuting mult.commute)
   57.19  
   57.20  lemma exp_divide_power_eq:
   57.21 @@ -1744,9 +1744,9 @@
   57.22    for x :: real
   57.23    by (rule ln_unique) (simp add: exp_add)
   57.24  
   57.25 -lemma ln_setprod: "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i > 0) \<Longrightarrow> ln (setprod f I) = sum (\<lambda>x. ln(f x)) I"
   57.26 +lemma ln_prod: "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> f i > 0) \<Longrightarrow> ln (prod f I) = sum (\<lambda>x. ln(f x)) I"
   57.27    for f :: "'a \<Rightarrow> real"
   57.28 -  by (induct I rule: finite_induct) (auto simp: ln_mult setprod_pos)
   57.29 +  by (induct I rule: finite_induct) (auto simp: ln_mult prod_pos)
   57.30  
   57.31  lemma ln_inverse: "0 < x \<Longrightarrow> ln (inverse x) = - ln x"
   57.32    for x :: real
    58.1 --- a/src/HOL/ex/Birthday_Paradox.thy	Mon Oct 17 14:37:32 2016 +0200
    58.2 +++ b/src/HOL/ex/Birthday_Paradox.thy	Mon Oct 17 17:33:07 2016 +0200
    58.3 @@ -64,11 +64,11 @@
    58.4      by (auto intro!: finite_PiE)
    58.5    have "{f \<in> extensional_funcset S T. \<not> inj_on f S} = extensional_funcset S T - {f \<in> extensional_funcset S T. inj_on f S}" by auto
    58.6    from assms this finite subset show ?thesis
    58.7 -    by (simp add: card_Diff_subset card_PiE card_extensional_funcset_inj_on setprod_constant)
    58.8 +    by (simp add: card_Diff_subset card_PiE card_extensional_funcset_inj_on prod_constant)
    58.9  qed
   58.10  
   58.11 -lemma setprod_upto_nat_unfold:
   58.12 -  "setprod f {m..(n::nat)} = (if n < m then 1 else (if n = 0 then f 0 else f n * setprod f {m..(n - 1)}))"
   58.13 +lemma prod_upto_nat_unfold:
   58.14 +  "prod f {m..(n::nat)} = (if n < m then 1 else (if n = 0 then f 0 else f n * prod f {m..(n - 1)}))"
   58.15    by auto (auto simp add: gr0_conv_Suc atLeastAtMostSuc_conv)
   58.16  
   58.17  section \<open>Birthday paradox\<close>
   58.18 @@ -81,7 +81,7 @@
   58.19    from assms show ?thesis
   58.20      using card_PiE[OF \<open>finite S\<close>, of "\<lambda>i. T"] \<open>finite S\<close>
   58.21        card_extensional_funcset_not_inj_on[OF \<open>finite S\<close> \<open>finite T\<close> \<open>card S <= card T\<close>]
   58.22 -    by (simp add: fact_div_fact setprod_upto_nat_unfold setprod_constant)
   58.23 +    by (simp add: fact_div_fact prod_upto_nat_unfold prod_constant)
   58.24  qed
   58.25  
   58.26  end
    59.1 --- a/src/HOL/ex/Sum_of_Powers.thy	Mon Oct 17 14:37:32 2016 +0200
    59.2 +++ b/src/HOL/ex/Sum_of_Powers.thy	Mon Oct 17 17:33:07 2016 +0200
    59.3 @@ -23,8 +23,8 @@
    59.4  next
    59.5    case (Suc l)
    59.6    have "of_nat (n + 1) * (\<Prod>i=0..<k. of_nat (n - i)) = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
    59.7 -    using setprod.atLeast0_lessThan_Suc [where ?'a = 'a, symmetric, of "\<lambda>i. of_nat (Suc n - i)" k]
    59.8 -    by (simp add: ac_simps setprod.atLeast0_lessThan_Suc_shift)
    59.9 +    using prod.atLeast0_lessThan_Suc [where ?'a = 'a, symmetric, of "\<lambda>i. of_nat (Suc n - i)" k]
   59.10 +    by (simp add: ac_simps prod.atLeast0_lessThan_Suc_shift)
   59.11    also have "... = (of_nat :: (nat \<Rightarrow> 'a)) (Suc n - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
   59.12      by (simp add: Suc atLeast0_atMost_Suc atLeastLessThanSuc_atLeastAtMost)
   59.13    also have "... = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
   59.14 @@ -32,7 +32,7 @@
   59.15    finally have "(\<Prod>i=0..<k. of_nat (n - i)) = (of_nat :: (nat \<Rightarrow> 'a)) (n + 1 - k) / of_nat (n + 1) * (\<Prod>i=0..<k. of_nat (Suc n - i))"
   59.16      by (simp add: field_simps)
   59.17    with assms show ?thesis
   59.18 -    by (simp add: binomial_altdef_of_nat setprod_dividef)
   59.19 +    by (simp add: binomial_altdef_of_nat prod_dividef)
   59.20  qed
   59.21  
   59.22  lemma real_binomial_eq_mult_binomial_Suc: