algebra.big_operators.basic
⟷
Mathlib.Algebra.BigOperators.Basic
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(last sync)
attach
and filter
lemmas (#18087)
Left commutativity and cardinality of list.filter
/multiset.filter
/finset.filter
. Interaction of count
/countp
and attach
.
@@ -106,6 +106,9 @@ variables {s s₁ s₂ : finset α} {a : α} {f g : α → β}
@[to_additive] lemma prod_eq_multiset_prod [comm_monoid β] (s : finset α) (f : α → β) :
∏ x in s, f x = (s.1.map f).prod := rfl
+@[simp, to_additive] lemma prod_map_val [comm_monoid β] (s : finset α) (f : α → β) :
+ (s.1.map f).prod = ∏ a in s, f a := rfl
+
@[to_additive]
theorem prod_eq_fold [comm_monoid β] (s : finset α) (f : α → β) :
∏ x in s, f x = s.fold (*) 1 f :=
@@ -1418,16 +1421,19 @@ begin
apply sum_congr rfl h₁
end
+lemma nat_cast_card_filter [add_comm_monoid_with_one β] (p) [decidable_pred p] (s : finset α) :
+ ((filter p s).card : β) = ∑ a in s, if p a then 1 else 0 :=
+by simp only [add_zero, sum_const, nsmul_eq_mul, eq_self_iff_true, sum_const_zero, sum_ite,
+ nsmul_one]
+
+lemma card_filter (p) [decidable_pred p] (s : finset α) :
+ (filter p s).card = ∑ a in s, ite (p a) 1 0 :=
+nat_cast_card_filter _ _
+
@[simp]
-lemma sum_boole {s : finset α} {p : α → Prop} [non_assoc_semiring β] {hp : decidable_pred p} :
- (∑ x in s, if p x then (1 : β) else (0 : β)) = (s.filter p).card :=
-by simp only [add_zero,
- mul_one,
- finset.sum_const,
- nsmul_eq_mul,
- eq_self_iff_true,
- finset.sum_const_zero,
- finset.sum_ite]
+lemma sum_boole {s : finset α} {p : α → Prop} [add_comm_monoid_with_one β] {hp : decidable_pred p} :
+ (∑ x in s, if p x then 1 else 0 : β) = (s.filter p).card :=
+(nat_cast_card_filter _ _).symm
lemma _root_.commute.sum_right [non_unital_non_assoc_semiring β] (s : finset α)
(f : α → β) (b : β) (h : ∀ i ∈ s, commute b (f i)) :
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
to_additive
s (#18878)
These lemmas were written before pi.mul_single
existed.
@@ -865,15 +865,16 @@ lemma prod_dite_irrel (p : Prop) [decidable p] (s : finset α) (f : p → α →
(∏ x in s, if h : p then f h x else g h x) = if h : p then ∏ x in s, f h x else ∏ x in s, g h x :=
by { split_ifs with h; refl }
-@[simp] lemma sum_pi_single' {ι M : Type*} [decidable_eq ι] [add_comm_monoid M]
- (i : ι) (x : M) (s : finset ι) :
- ∑ j in s, pi.single i x j = if i ∈ s then x else 0 :=
-sum_dite_eq' _ _ _
+@[simp, to_additive]
+lemma prod_pi_mul_single' [decidable_eq α] (a : α) (x : β) (s : finset α) :
+ ∏ a' in s, pi.mul_single a x a' = if a ∈ s then x else 1 :=
+prod_dite_eq' _ _ _
-@[simp] lemma sum_pi_single {ι : Type*} {M : ι → Type*}
- [decidable_eq ι] [Π i, add_comm_monoid (M i)] (i : ι) (f : Π i, M i) (s : finset ι) :
- ∑ j in s, pi.single j (f j) i = if i ∈ s then f i else 0 :=
-sum_dite_eq _ _ _
+@[simp, to_additive]
+lemma prod_pi_mul_single {β : α → Type*}
+ [decidable_eq α] [Π a, comm_monoid (β a)] (a : α) (f : Π a, β a) (s : finset α) :
+ ∏ a' in s, pi.mul_single a' (f a') a = if a ∈ s then f a else 1 :=
+prod_dite_eq _ _ _
@[to_additive]
lemma prod_bij_ne_one {s : finset α} {t : finset γ} {f : α → β} {g : γ → β}
@@ -1350,13 +1351,14 @@ begin
exact λ i hi, if_neg (h i hi) }
end
-lemma sum_erase_lt_of_pos {γ : Type*} [decidable_eq α] [ordered_add_comm_monoid γ]
- [covariant_class γ γ (+) (<)] {s : finset α} {d : α} (hd : d ∈ s) {f : α → γ} (hdf : 0 < f d) :
- ∑ (m : α) in s.erase d, f m < ∑ (m : α) in s, f m :=
+@[to_additive]
+lemma prod_erase_lt_of_one_lt {γ : Type*} [decidable_eq α] [ordered_comm_monoid γ]
+ [covariant_class γ γ (*) (<)] {s : finset α} {d : α} (hd : d ∈ s) {f : α → γ} (hdf : 1 < f d) :
+ ∏ (m : α) in s.erase d, f m < ∏ (m : α) in s, f m :=
begin
nth_rewrite_rhs 0 ←finset.insert_erase hd,
- rw finset.sum_insert (finset.not_mem_erase d s),
- exact lt_add_of_pos_left _ hdf,
+ rw finset.prod_insert (finset.not_mem_erase d s),
+ exact lt_mul_of_one_lt_left' _ hdf,
end
/-- If a product is 1 and the function is 1 except possibly at one
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
This PR will split most of the lemmas in data.set.pairwise
which are independent of the data.set.lattice
. It makes a lot of files no longer depend on data.set.lattice
.
mathlib4 PR: https://github.com/leanprover-community/mathlib4/pull/1184
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@@ -3,7 +3,6 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-
import algebra.big_operators.multiset.lemmas
import algebra.group.pi
import algebra.group_power.lemmas
@@ -13,7 +12,7 @@ import data.finset.sum
import data.fintype.basic
import data.finset.sigma
import data.multiset.powerset
-import data.set.pairwise
+import data.set.pairwise.basic
/-!
# Big operators
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
finset.sum
under mod
(#18364)
and ∏ a in s, f a = b ^ s.card
if f a = b
for all a
@@ -1131,6 +1131,10 @@ end
@[simp, to_additive] lemma prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
(congr_arg _ $ s.val.map_const b).trans $ multiset.prod_replicate s.card b
+@[to_additive sum_eq_card_nsmul] lemma prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) :
+ ∏ a in s, f a = b ^ s.card :=
+(prod_congr rfl hf).trans $ prod_const _
+
@[to_additive]
lemma pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ k in range n, b := by simp
@@ -1570,6 +1574,22 @@ lemma prod_unique_nonempty {α β : Type*} [comm_monoid β] [unique α]
(∏ x in s, f x) = f default :=
by rw [h.eq_singleton_default, finset.prod_singleton]
+lemma sum_nat_mod (s : finset α) (n : ℕ) (f : α → ℕ) :
+ (∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
+(multiset.sum_nat_mod _ _).trans $ by rw [finset.sum, multiset.map_map]
+
+lemma prod_nat_mod (s : finset α) (n : ℕ) (f : α → ℕ) :
+ (∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
+(multiset.prod_nat_mod _ _).trans $ by rw [finset.prod, multiset.map_map]
+
+lemma sum_int_mod (s : finset α) (n : ℤ) (f : α → ℤ) :
+ (∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
+(multiset.sum_int_mod _ _).trans $ by rw [finset.sum, multiset.map_map]
+
+lemma prod_int_mod (s : finset α) (n : ℤ) (f : α → ℤ) :
+ (∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
+(multiset.prod_int_mod _ _).trans $ by rw [finset.prod, multiset.map_map]
+
end finset
namespace fintype
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
list.replicate
with Mathlib 4 (#18181)
Sync arguments order and golfs with leanprover-community/mathlib4#1579
@@ -1126,7 +1126,7 @@ begin
end
@[simp, to_additive] lemma prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
-(congr_arg _ $ s.val.map_const b).trans $ multiset.prod_replicate b s.card
+(congr_arg _ $ s.val.map_const b).trans $ multiset.prod_replicate s.card b
@[to_additive]
lemma pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ k in range n, b := by simp
(no changes)
(no changes)
list.replicate
and migrate to it (#18127)
This definition differs from list.repeat
by the order of arguments. The new order is in sync with the Lean 4 version.
@@ -245,7 +245,7 @@ by rw [prod_insert (not_mem_singleton.2 h), prod_singleton]
@[simp, priority 1100, to_additive]
lemma prod_const_one : (∏ x in s, (1 : β)) = 1 :=
-by simp only [finset.prod, multiset.map_const, multiset.prod_repeat, one_pow]
+by simp only [finset.prod, multiset.map_const, multiset.prod_replicate, one_pow]
@[simp, to_additive]
lemma prod_image [decidable_eq α] {s : finset γ} {g : γ → α} :
@@ -1126,7 +1126,7 @@ begin
end
@[simp, to_additive] lemma prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
-(congr_arg _ $ s.val.map_const b).trans $ multiset.prod_repeat b s.card
+(congr_arg _ $ s.val.map_const b).trans $ multiset.prod_replicate b s.card
@[to_additive]
lemma pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ k in range n, b := by simp
@@ -1382,7 +1382,7 @@ begin
classical,
apply finset.induction_on' S, { simp },
intros a T haS _ haT IH,
- repeat {rw finset.prod_insert haT},
+ repeat { rw finset.prod_insert haT },
exact mul_dvd_mul (h a haS) IH,
end
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -1713,7 +1713,7 @@ theorem prod_involution {s : Finset α} {f : α → β} :
ih' ▸
Eq.symm
(prod_subset hmem fun y hy hy₁ =>
- have : y = x ∨ y = g x hx := by simpa [hy, not_and_or, or_comm'] using hy₁
+ have : y = x ∨ y = g x hx := by simpa [hy, not_and_or, or_comm] using hy₁
this.elim (fun hy => hy.symm ▸ hx1) fun hy =>
h x hx ▸ hy ▸ hx1.symm ▸ (one_mul _).symm)
else by
@@ -2466,8 +2466,7 @@ theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
#print Multiset.add_eq_union_right_of_le /-
theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
- x + y = x ∪ z ↔ y = z ∧ x.Disjoint y := by
- simpa only [and_comm'] using add_eq_union_left_of_le h
+ x + y = x ∪ z ↔ y = z ∧ x.Disjoint y := by simpa only [and_comm] using add_eq_union_left_of_le h
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-/
@@ -2486,7 +2485,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
imp_and, forall_and, ← hr, @eq_comm _ z]
have := fun x (_ : x ∈ i) => ne_of_mem_of_not_mem H hz
simp (config := { contextual := true }) only [this, not_false_iff, true_imp_iff]
- simp_rw [← disjoint_finset_sum_left, ← disjoint_finset_sum_right, disjoint_comm, ← and_assoc',
+ simp_rw [← disjoint_finset_sum_left, ← disjoint_finset_sum_right, disjoint_comm, ← and_assoc,
and_self_iff]
exact add_eq_union_left_of_le (Finset.sup_le fun x hx => le_sum_of_mem (mem_map_of_mem f hx))
#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjoint
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -166,83 +166,101 @@ theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G
section Deprecated
+/- warning: monoid_hom.map_prod clashes with map_prod -> map_prod
+Case conversion may be inaccurate. Consider using '#align monoid_hom.map_prod map_prodₓ'. -/
+#print map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f : α → β) (s : Finset α) :
g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
-#align monoid_hom.map_prod map_prodₓ
-#align linear_map.map_sum map_sumₓ
+#align monoid_hom.map_prod map_prod
+#align map_sum map_sum
+-/
-/- warning: mul_equiv.map_prod clashes with monoid_hom.map_prod -> map_prodₓ
-Case conversion may be inaccurate. Consider using '#align mul_equiv.map_prod map_prodₓₓ'. -/
-#print map_prodₓ /-
+/- warning: mul_equiv.map_prod clashes with map_prod -> map_prod
+Case conversion may be inaccurate. Consider using '#align mul_equiv.map_prod map_prodₓ'. -/
+#print map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f : α → β) (s : Finset α) :
g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
-#align mul_equiv.map_prod map_prodₓ
-#align linear_map.map_sum map_sumₓ
+#align mul_equiv.map_prod map_prod
+#align map_sum map_sum
-/
-#print RingHom.map_list_prod /-
+/- warning: ring_hom.map_list_prod clashes with map_list_prod -> map_list_prod
+Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_prod map_list_prodₓ'. -/
+#print map_list_prod /-
/-- Deprecated: use `_root_.map_list_prod` instead. -/
-protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
+protected theorem map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
f l.Prod = (l.map f).Prod :=
map_list_prod f l
-#align ring_hom.map_list_prod RingHom.map_list_prod
+#align ring_hom.map_list_prod map_list_prod
-/
-#print RingHom.map_list_sum /-
+/- warning: ring_hom.map_list_sum clashes with map_list_sum -> map_list_sum
+Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_sum map_list_sumₓ'. -/
+#print map_list_sum /-
/-- Deprecated: use `_root_.map_list_sum` instead. -/
-protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
+protected theorem map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
(l : List β) : f l.Sum = (l.map f).Sum :=
map_list_sum f l
-#align ring_hom.map_list_sum RingHom.map_list_sum
+#align ring_hom.map_list_sum map_list_sum
-/
-#print RingHom.unop_map_list_prod /-
+/- warning: ring_hom.unop_map_list_prod clashes with unop_map_list_prod -> unop_map_list_prod
+Case conversion may be inaccurate. Consider using '#align ring_hom.unop_map_list_prod unop_map_list_prodₓ'. -/
+#print unop_map_list_prod /-
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
Deprecated: use `_root_.unop_map_list_prod` instead.
-/
-protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β →+* γᵐᵒᵖ)
- (l : List β) : MulOpposite.unop (f l.Prod) = (l.map (MulOpposite.unop ∘ f)).reverse.Prod :=
+protected theorem unop_map_list_prod [Semiring β] [Semiring γ] (f : β →+* γᵐᵒᵖ) (l : List β) :
+ MulOpposite.unop (f l.Prod) = (l.map (MulOpposite.unop ∘ f)).reverse.Prod :=
unop_map_list_prod f l
-#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prod
+#align ring_hom.unop_map_list_prod unop_map_list_prod
-/
-#print RingHom.map_multiset_prod /-
+/- warning: ring_hom.map_multiset_prod clashes with map_multiset_prod -> map_multiset_prod
+Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_prod map_multiset_prodₓ'. -/
+#print map_multiset_prod /-
/-- Deprecated: use `_root_.map_multiset_prod` instead. -/
-protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
+protected theorem map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
(s : Multiset β) : f s.Prod = (s.map f).Prod :=
map_multiset_prod f s
-#align ring_hom.map_multiset_prod RingHom.map_multiset_prod
+#align ring_hom.map_multiset_prod map_multiset_prod
-/
-#print RingHom.map_multiset_sum /-
+/- warning: ring_hom.map_multiset_sum clashes with map_multiset_sum -> map_multiset_sum
+Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_sum map_multiset_sumₓ'. -/
+#print map_multiset_sum /-
/-- Deprecated: use `_root_.map_multiset_sum` instead. -/
-protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
+protected theorem map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
(s : Multiset β) : f s.Sum = (s.map f).Sum :=
map_multiset_sum f s
-#align ring_hom.map_multiset_sum RingHom.map_multiset_sum
+#align ring_hom.map_multiset_sum map_multiset_sum
-/
-#print RingHom.map_prod /-
+/- warning: ring_hom.map_prod clashes with map_prod -> map_prod
+Case conversion may be inaccurate. Consider using '#align ring_hom.map_prod map_prodₓ'. -/
+#print map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
-protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
+protected theorem map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
(s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
-#align ring_hom.map_prod RingHom.map_prod
+#align ring_hom.map_prod map_prod
-/
-#print RingHom.map_sum /-
+/- warning: ring_hom.map_sum clashes with map_sum -> map_sum
+Case conversion may be inaccurate. Consider using '#align ring_hom.map_sum map_sumₓ'. -/
+#print map_sum /-
/-- Deprecated: use `_root_.map_sum` instead. -/
-protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
- (f : α → β) (s : Finset α) : g (∑ x in s, f x) = ∑ x in s, g (f x) :=
+protected theorem map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ) (f : α → β)
+ (s : Finset α) : g (∑ x in s, f x) = ∑ x in s, g (f x) :=
map_sum g f s
-#align ring_hom.map_sum RingHom.map_sum
+#align ring_hom.map_sum map_sum
-/
end Deprecated
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -172,7 +172,7 @@ protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f :
g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
#align monoid_hom.map_prod map_prodₓ
-#align add_monoid_hom.map_sum map_sumₓ
+#align linear_map.map_sum map_sumₓ
/- warning: mul_equiv.map_prod clashes with monoid_hom.map_prod -> map_prodₓ
Case conversion may be inaccurate. Consider using '#align mul_equiv.map_prod map_prodₓₓ'. -/
@@ -183,7 +183,7 @@ protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f :
g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
#align mul_equiv.map_prod map_prodₓ
-#align add_monoid_hom.map_sum map_sumₓ
+#align linear_map.map_sum map_sumₓ
-/
#print RingHom.map_list_prod /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -4,9 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Algebra.BigOperators.Multiset.Lemmas
-import Algebra.Group.Pi
+import Algebra.Group.Pi.Lemmas
import Algebra.GroupPower.Lemmas
-import Algebra.Hom.Equiv.Basic
+import Algebra.Group.Equiv.Basic
import Algebra.Ring.Opposite
import Data.Finset.Sum
import Data.Fintype.Basic
@@ -1433,7 +1433,7 @@ theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type _} [CommMon
simp only [List.map, List.prod_cons, to_finset_cons, IH]
by_cases has : a ∈ s.to_finset
· rw [insert_eq_of_mem has, ← insert_erase has, prod_insert (not_mem_erase _ _),
- prod_insert (not_mem_erase _ _), ← mul_assoc, count_cons_self, pow_succ]
+ prod_insert (not_mem_erase _ _), ← mul_assoc, count_cons_self, pow_succ']
congr 1
refine' prod_congr rfl fun x hx => _
rw [count_cons_of_ne (ne_of_mem_erase hx)]
@@ -1587,7 +1587,7 @@ theorem prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
#print Finset.eq_prod_range_div /-
@[to_additive]
theorem eq_prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel'_right]
+ f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel]
#align finset.eq_prod_range_div Finset.eq_prod_range_div
#align finset.eq_sum_range_sub Finset.eq_sum_range_sub
-/
@@ -2453,8 +2453,8 @@ theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ∈ » i) -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x y «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x y «expr ∈ » i) -/
#print Multiset.finset_sum_eq_sup_iff_disjoint /-
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
i.Sum f = i.sup f ↔ ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -444,7 +444,7 @@ section ToList
#print Finset.prod_to_list /-
@[simp, to_additive]
theorem prod_to_list (s : Finset α) (f : α → β) : (s.toList.map f).Prod = s.Prod f := by
- rw [Finset.prod, ← Multiset.coe_prod, ← Multiset.coe_map, Finset.coe_toList]
+ rw [Finset.prod, ← Multiset.prod_coe, ← Multiset.map_coe, Finset.coe_toList]
#align finset.prod_to_list Finset.prod_to_list
#align finset.sum_to_list Finset.sum_to_list
-/
@@ -865,7 +865,7 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
_ = ∏ a in s, if p a then f a else 1 :=
by
refine' prod_subset (filter_subset _ s) fun x hs h => _
- rw [mem_filter, not_and] at h
+ rw [mem_filter, not_and] at h
exact if_neg (h hs)
#align finset.prod_filter Finset.prod_filter
#align finset.sum_filter Finset.sum_filter
@@ -1336,7 +1336,7 @@ theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
@[to_additive]
theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
- rw [← prod_filter_ne_one] at h
+ rw [← prod_filter_ne_one] at h
rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
@@ -1462,7 +1462,7 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
by
rw [prod_list_count]
refine' prod_subset hs fun x _ hx => _
- rw [mem_to_finset] at hx
+ rw [mem_to_finset] at hx
rw [count_eq_zero_of_not_mem hx, pow_zero]
#align finset.prod_list_count_of_subset Finset.prod_list_count_of_subset
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
@@ -1720,7 +1720,7 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
(-- `(by finish)` closes this
by
rintro ⟨b_fst, b_snd⟩ H
- simp only [mem_image, exists_prop, mem_filter, mem_sigma] at H
+ simp only [mem_image, exists_prop, mem_filter, mem_sigma] at H
tauto)
_ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f (g a) := (prod_sigma _ _ _)
_ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f b :=
@@ -1826,7 +1826,7 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
(b : β) : ∏ x in s, Function.update f i b x = ∏ x in s, f x :=
by
apply prod_congr rfl fun j hj => _
- have : j ≠ i := by intro eq; rw [Eq] at hj ; exact h hj
+ have : j ≠ i := by intro eq; rw [Eq] at hj; exact h hj
simp [this]
#align finset.prod_update_of_not_mem Finset.prod_update_of_not_mem
#align finset.sum_update_of_not_mem Finset.sum_update_of_not_mem
@@ -1853,12 +1853,12 @@ theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α
by_cases hc0 : s.card = 0
· exact False.elim (card_ne_zero_of_mem hx hc0)
· have h1 : s.card = 1 := le_antisymm hc (Nat.one_le_of_lt (Nat.pos_of_ne_zero hc0))
- rw [card_eq_one] at h1
+ rw [card_eq_one] at h1
cases' h1 with x2 hx2
- rw [hx2, mem_singleton] at hx
- simp_rw [hx2] at h
+ rw [hx2, mem_singleton] at hx
+ simp_rw [hx2] at h
rw [hx]
- rw [prod_singleton] at h
+ rw [prod_singleton] at h
exact h
#align finset.eq_of_card_le_one_of_prod_eq Finset.eq_of_card_le_one_of_prod_eq
#align finset.eq_of_card_le_one_of_sum_eq Finset.eq_of_card_le_one_of_sum_eq
@@ -1897,7 +1897,7 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
by
rw [← sdiff_singleton_eq_erase]
refine' prod_subset (sdiff_subset _ _) fun x hx hnx => _
- rw [sdiff_singleton_eq_erase] at hnx
+ rw [sdiff_singleton_eq_erase] at hnx
rwa [eq_of_mem_of_not_mem_erase hx hnx]
#align finset.prod_erase Finset.prod_erase
#align finset.sum_erase Finset.sum_erase
@@ -1913,7 +1913,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
· obtain ⟨i, hi, hfi⟩ := h
rw [prod_eq_single_of_mem _ hi, if_pos hfi]
exact fun j hj h => if_neg fun hfj => (hf hj hi h).le_bot ⟨hfj, hfi⟩
- · push_neg at h
+ · push_neg at h
rw [prod_eq_one]
exact fun i hi => if_neg (h i hi)
#align finset.prod_ite_one Finset.prod_ite_one
@@ -1945,9 +1945,9 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏
classical
by_cases h : x = a
· rw [h]
- rw [h] at hx
+ rw [h] at hx
rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_singleton.1 ha),
- prod_singleton] at hp
+ prod_singleton] at hp
exact hp
· exact h1 x hx h
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
@@ -2211,7 +2211,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
· apply prod_eq_one
intro i hi
rw [if_pos (h i hi)]
- · push_neg at h
+ · push_neg at h
rcases h with ⟨i, hi, hq⟩
apply prod_eq_zero hi
rw [if_neg hq]
@@ -2400,7 +2400,7 @@ theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
Multiset.Disjoint i.Sum a ↔ ∀ b ∈ i, Multiset.Disjoint b a :=
Quotient.inductionOn i fun l =>
by
- rw [quot_mk_to_coe, Multiset.coe_sum]
+ rw [quot_mk_to_coe, Multiset.sum_coe]
exact disjoint_list_sum_left
#align multiset.disjoint_sum_left Multiset.disjoint_sum_left
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -483,7 +483,8 @@ variable [Fintype α] [CommMonoid β]
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
(∏ i in s, f i) * ∏ i in t, f i = ∏ i, f i :=
- (Finset.prod_disjUnion h.Disjoint).symm.trans <| by classical
+ (Finset.prod_disjUnion h.Disjoint).symm.trans <| by
+ classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top] <;> rfl
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
#align is_compl.sum_add_sum IsCompl.sum_add_sum
-/
@@ -768,7 +769,15 @@ variable. -/
"Generalization of `finset.sum_comm` to the case when the inner `finset`s depend on\nthe outer variable."]
theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' : α → Finset γ}
(h : ∀ x y, x ∈ s ∧ y ∈ t x ↔ x ∈ s' y ∧ y ∈ t') {f : γ → α → β} :
- ∏ x in s, ∏ y in t x, f x y = ∏ y in t', ∏ x in s' y, f x y := by classical
+ ∏ x in s, ∏ y in t x, f x y = ∏ y in t', ∏ x in s' y, f x y := by
+ classical
+ have :
+ ∀ z : γ × α,
+ (z ∈ s.bUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔ z.1 ∈ s ∧ z.2 ∈ t z.1 :=
+ by rintro ⟨x, y⟩; simp
+ exact
+ (prod_finset_product' _ _ _ this).symm.trans
+ (prod_finset_product_right' _ _ _ fun ⟨x, y⟩ => (this _).trans ((h x y).trans and_comm))
#align finset.prod_comm' Finset.prod_comm'
#align finset.sum_comm' Finset.sum_comm'
-/
@@ -827,7 +836,10 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
∏ x in s.filterₓ p, f x = ∏ x in s, f x :=
- prod_subset (filter_subset _ _) fun x => by classical
+ prod_subset (filter_subset _ _) fun x => by
+ classical
+ rw [not_imp_comm, mem_filter]
+ exact fun h₁ h₂ => ⟨h₁, hp _ h₁ h₂⟩
#align finset.prod_filter_of_ne Finset.prod_filter_of_ne
#align finset.sum_filter_of_ne Finset.sum_filter_of_ne
-/
@@ -1268,7 +1280,24 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
(i_inj : ∀ a₁ a₂ h₁₁ h₁₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
- ∏ x in s, f x = ∏ x in t, g x := by classical
+ ∏ x in s, f x = ∏ x in t, g x := by
+ classical exact
+ calc
+ ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
+ _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
+ (prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
+ (fun a ha =>
+ (mem_filter.mp ha).elim fun h₁ h₂ =>
+ mem_filter.mpr ⟨hi a h₁ h₂, fun hg => h₂ (hg ▸ h a h₁ h₂)⟩)
+ (fun a ha => (mem_filter.mp ha).elim <| h a)
+ (fun a₁ a₂ ha₁ ha₂ =>
+ (mem_filter.mp ha₁).elim fun ha₁₁ ha₁₂ =>
+ (mem_filter.mp ha₂).elim fun ha₂₁ ha₂₂ => i_inj a₁ a₂ _ _ _ _)
+ fun b hb =>
+ (mem_filter.mp hb).elim fun h₁ h₂ =>
+ let ⟨a, ha₁, ha₂, Eq⟩ := i_surj b h₁ h₂
+ ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩)
+ _ = ∏ x in t, g x := prod_filter_ne_one
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
-/
@@ -1305,7 +1334,11 @@ theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
#print Finset.exists_ne_one_of_prod_ne_one /-
@[to_additive]
-theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by classical
+theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
+ classical
+ rw [← prod_filter_ne_one] at h
+ rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
+ exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
#align finset.exists_ne_zero_of_sum_ne_zero Finset.exists_ne_zero_of_sum_ne_zero
-/
@@ -1755,6 +1788,8 @@ theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f
#print Finset.dvd_prod_of_mem /-
theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i in s, f i := by
classical
+ rw [Finset.prod_eq_mul_prod_diff_singleton ha]
+ exact dvd_mul_right _ _
#align finset.dvd_prod_of_mem Finset.dvd_prod_of_mem
-/
@@ -1908,6 +1943,13 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏
by
intro x hx
classical
+ by_cases h : x = a
+ · rw [h]
+ rw [h] at hx
+ rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_singleton.1 ha),
+ prod_singleton] at hp
+ exact hp
+ · exact h1 x hx h
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
-/
@@ -1920,7 +1962,13 @@ theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α)
#print Finset.prod_dvd_prod_of_dvd /-
theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
- S.Prod g1 ∣ S.Prod g2 := by classical
+ S.Prod g1 ∣ S.Prod g2 := by
+ classical
+ apply Finset.induction_on' S
+ · simp
+ intro a T haS _ haT IH
+ repeat' rw [Finset.prod_insert haT]
+ exact mul_dvd_mul (h a haS) IH
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
-/
@@ -1938,7 +1986,10 @@ end CommMonoid
is the sum of the products of `g` and `h`. -/
theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
(h1 : g i + h i = f i) (h2 : ∀ j ∈ s, j ≠ i → g j = f j) (h3 : ∀ j ∈ s, j ≠ i → h j = f j) :
- ∏ i in s, g i + ∏ i in s, h i = ∏ i in s, f i := by classical
+ ∏ i in s, g i + ∏ i in s, h i = ∏ i in s, f i := by
+ classical
+ simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
+ congr 2 <;> apply prod_congr rfl <;> simpa
#align finset.prod_add_prod_eq Finset.prod_add_prod_eq
-/
@@ -2134,7 +2185,11 @@ theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α)
#print Finset.mem_sum /-
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
- b ∈ ∑ x in s, f x ↔ ∃ a ∈ s, b ∈ f a := by classical
+ b ∈ ∑ x in s, f x ↔ ∃ a ∈ s, b ∈ f a := by
+ classical
+ refine' s.induction_on (by simp) _
+ · intro a t hi ih
+ simp [sum_insert hi, ih, or_and_right, exists_or]
#align finset.mem_sum Finset.mem_sum
-/
@@ -2166,7 +2221,12 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
variable [Nontrivial β] [NoZeroDivisors β]
#print Finset.prod_eq_zero_iff /-
-theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by classical
+theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
+ classical
+ apply Finset.induction_on s
+ exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => H.elim⟩
+ intro a s ha ih
+ rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
-/
@@ -2286,7 +2346,13 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
@[to_additive]
theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
- (∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by classical
+ (∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by
+ classical
+ let s := {x | p x}.toFinset
+ rw [← Finset.prod_subtype s, ← Finset.prod_subtype (sᶜ)]
+ · exact Finset.prod_mul_prod_compl _ _
+ · simp
+ · simp
#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtype
#align fintype.sum_subtype_add_sum_subtype Fintype.sum_subtype_add_sum_subtype
-/
@@ -2471,7 +2537,11 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.Pr
#print Multiset.prod_sum /-
@[to_additive]
theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
- (∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by classical
+ (∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by
+ classical
+ induction' s using Finset.induction_on with a t hat ih
+ · rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]
+ · rw [Finset.sum_insert hat, Finset.prod_insert hat, Multiset.prod_add, ih]
#align multiset.prod_sum Multiset.prod_sum
#align multiset.sum_sum Multiset.sum_sum
-/
@@ -2589,13 +2659,19 @@ theorem Units.coe_prod {M : Type _} [CommMonoid M] (f : α → Mˣ) (s : Finset
theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h) :
Units.mk0 (∏ b in s, f b) h =
∏ b in s.attach, Units.mk0 (f b) fun hh => h (Finset.prod_eq_zero b.2 hh) :=
- by classical
+ by classical induction s using Finset.induction_on <;> simp [*]
#align units.mk0_prod Units.mk0_prod
-/
#print nat_abs_sum_le /-
theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
- (∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by classical
+ (∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
+ classical
+ apply Finset.induction_on s
+ · simp only [Finset.sum_empty, Int.natAbs_zero]
+ · intro i s his IH
+ simp only [his, Finset.sum_insert, not_false_iff]
+ exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
#align nat_abs_sum_le nat_abs_sum_le
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -483,8 +483,7 @@ variable [Fintype α] [CommMonoid β]
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
(∏ i in s, f i) * ∏ i in t, f i = ∏ i, f i :=
- (Finset.prod_disjUnion h.Disjoint).symm.trans <| by
- classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top] <;> rfl
+ (Finset.prod_disjUnion h.Disjoint).symm.trans <| by classical
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
#align is_compl.sum_add_sum IsCompl.sum_add_sum
-/
@@ -769,15 +768,7 @@ variable. -/
"Generalization of `finset.sum_comm` to the case when the inner `finset`s depend on\nthe outer variable."]
theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' : α → Finset γ}
(h : ∀ x y, x ∈ s ∧ y ∈ t x ↔ x ∈ s' y ∧ y ∈ t') {f : γ → α → β} :
- ∏ x in s, ∏ y in t x, f x y = ∏ y in t', ∏ x in s' y, f x y := by
- classical
- have :
- ∀ z : γ × α,
- (z ∈ s.bUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔ z.1 ∈ s ∧ z.2 ∈ t z.1 :=
- by rintro ⟨x, y⟩; simp
- exact
- (prod_finset_product' _ _ _ this).symm.trans
- (prod_finset_product_right' _ _ _ fun ⟨x, y⟩ => (this _).trans ((h x y).trans and_comm))
+ ∏ x in s, ∏ y in t x, f x y = ∏ y in t', ∏ x in s' y, f x y := by classical
#align finset.prod_comm' Finset.prod_comm'
#align finset.sum_comm' Finset.sum_comm'
-/
@@ -836,10 +827,7 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
∏ x in s.filterₓ p, f x = ∏ x in s, f x :=
- prod_subset (filter_subset _ _) fun x => by
- classical
- rw [not_imp_comm, mem_filter]
- exact fun h₁ h₂ => ⟨h₁, hp _ h₁ h₂⟩
+ prod_subset (filter_subset _ _) fun x => by classical
#align finset.prod_filter_of_ne Finset.prod_filter_of_ne
#align finset.sum_filter_of_ne Finset.sum_filter_of_ne
-/
@@ -1280,24 +1268,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
(i_inj : ∀ a₁ a₂ h₁₁ h₁₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
- ∏ x in s, f x = ∏ x in t, g x := by
- classical exact
- calc
- ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
- _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
- (prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
- (fun a ha =>
- (mem_filter.mp ha).elim fun h₁ h₂ =>
- mem_filter.mpr ⟨hi a h₁ h₂, fun hg => h₂ (hg ▸ h a h₁ h₂)⟩)
- (fun a ha => (mem_filter.mp ha).elim <| h a)
- (fun a₁ a₂ ha₁ ha₂ =>
- (mem_filter.mp ha₁).elim fun ha₁₁ ha₁₂ =>
- (mem_filter.mp ha₂).elim fun ha₂₁ ha₂₂ => i_inj a₁ a₂ _ _ _ _)
- fun b hb =>
- (mem_filter.mp hb).elim fun h₁ h₂ =>
- let ⟨a, ha₁, ha₂, Eq⟩ := i_surj b h₁ h₂
- ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩)
- _ = ∏ x in t, g x := prod_filter_ne_one
+ ∏ x in s, f x = ∏ x in t, g x := by classical
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
-/
@@ -1334,11 +1305,7 @@ theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
#print Finset.exists_ne_one_of_prod_ne_one /-
@[to_additive]
-theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
- classical
- rw [← prod_filter_ne_one] at h
- rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
- exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
+theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by classical
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
#align finset.exists_ne_zero_of_sum_ne_zero Finset.exists_ne_zero_of_sum_ne_zero
-/
@@ -1788,8 +1755,6 @@ theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f
#print Finset.dvd_prod_of_mem /-
theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i in s, f i := by
classical
- rw [Finset.prod_eq_mul_prod_diff_singleton ha]
- exact dvd_mul_right _ _
#align finset.dvd_prod_of_mem Finset.dvd_prod_of_mem
-/
@@ -1943,13 +1908,6 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏
by
intro x hx
classical
- by_cases h : x = a
- · rw [h]
- rw [h] at hx
- rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_singleton.1 ha),
- prod_singleton] at hp
- exact hp
- · exact h1 x hx h
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
-/
@@ -1962,13 +1920,7 @@ theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α)
#print Finset.prod_dvd_prod_of_dvd /-
theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
- S.Prod g1 ∣ S.Prod g2 := by
- classical
- apply Finset.induction_on' S
- · simp
- intro a T haS _ haT IH
- repeat' rw [Finset.prod_insert haT]
- exact mul_dvd_mul (h a haS) IH
+ S.Prod g1 ∣ S.Prod g2 := by classical
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
-/
@@ -1986,10 +1938,7 @@ end CommMonoid
is the sum of the products of `g` and `h`. -/
theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
(h1 : g i + h i = f i) (h2 : ∀ j ∈ s, j ≠ i → g j = f j) (h3 : ∀ j ∈ s, j ≠ i → h j = f j) :
- ∏ i in s, g i + ∏ i in s, h i = ∏ i in s, f i := by
- classical
- simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
- congr 2 <;> apply prod_congr rfl <;> simpa
+ ∏ i in s, g i + ∏ i in s, h i = ∏ i in s, f i := by classical
#align finset.prod_add_prod_eq Finset.prod_add_prod_eq
-/
@@ -2185,11 +2134,7 @@ theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α)
#print Finset.mem_sum /-
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
- b ∈ ∑ x in s, f x ↔ ∃ a ∈ s, b ∈ f a := by
- classical
- refine' s.induction_on (by simp) _
- · intro a t hi ih
- simp [sum_insert hi, ih, or_and_right, exists_or]
+ b ∈ ∑ x in s, f x ↔ ∃ a ∈ s, b ∈ f a := by classical
#align finset.mem_sum Finset.mem_sum
-/
@@ -2221,12 +2166,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
variable [Nontrivial β] [NoZeroDivisors β]
#print Finset.prod_eq_zero_iff /-
-theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
- classical
- apply Finset.induction_on s
- exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => H.elim⟩
- intro a s ha ih
- rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
+theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by classical
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
-/
@@ -2346,13 +2286,7 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
@[to_additive]
theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
- (∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by
- classical
- let s := {x | p x}.toFinset
- rw [← Finset.prod_subtype s, ← Finset.prod_subtype (sᶜ)]
- · exact Finset.prod_mul_prod_compl _ _
- · simp
- · simp
+ (∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by classical
#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtype
#align fintype.sum_subtype_add_sum_subtype Fintype.sum_subtype_add_sum_subtype
-/
@@ -2537,11 +2471,7 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.Pr
#print Multiset.prod_sum /-
@[to_additive]
theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
- (∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by
- classical
- induction' s using Finset.induction_on with a t hat ih
- · rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]
- · rw [Finset.sum_insert hat, Finset.prod_insert hat, Multiset.prod_add, ih]
+ (∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by classical
#align multiset.prod_sum Multiset.prod_sum
#align multiset.sum_sum Multiset.sum_sum
-/
@@ -2659,19 +2589,13 @@ theorem Units.coe_prod {M : Type _} [CommMonoid M] (f : α → Mˣ) (s : Finset
theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h) :
Units.mk0 (∏ b in s, f b) h =
∏ b in s.attach, Units.mk0 (f b) fun hh => h (Finset.prod_eq_zero b.2 hh) :=
- by classical induction s using Finset.induction_on <;> simp [*]
+ by classical
#align units.mk0_prod Units.mk0_prod
-/
#print nat_abs_sum_le /-
theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
- (∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
- classical
- apply Finset.induction_on s
- · simp only [Finset.sum_empty, Int.natAbs_zero]
- · intro i s his IH
- simp only [his, Finset.sum_insert, not_false_iff]
- exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
+ (∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by classical
#align nat_abs_sum_le nat_abs_sum_le
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -613,12 +613,12 @@ theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β
#align finset.sum_bij' Finset.sum_bij'
-/
-#print Finset.Equiv.prod_comp_finset /-
+#print Finset.prod_equiv /-
/-- Reindexing a product over a finset along an equivalence.
See `equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@[to_additive
" Reindexing a sum over a finset along an equivalence.\nSee `equiv.sum_comp` for the version where `s` and `s'` are `univ`. "]
-theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι' → β) {s' : Finset ι'}
+theorem Finset.prod_equiv {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι' → β) {s' : Finset ι'}
{s : Finset ι} (h : s = s'.image e.symm) : ∏ i' in s', f i' = ∏ i in s, f (e i) :=
by
rw [h]
@@ -628,8 +628,8 @@ theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι'
(fun a ha => e.apply_symm_apply a) fun a ha => e.symm_apply_apply a
rcases finset.mem_image.mp ha with ⟨i', hi', rfl⟩
rwa [e.apply_symm_apply]
-#align finset.equiv.prod_comp_finset Finset.Equiv.prod_comp_finset
-#align finset.equiv.sum_comp_finset Finset.Equiv.sum_comp_finset
+#align finset.equiv.prod_comp_finset Finset.prod_equiv
+#align finset.equiv.sum_comp_finset Finset.sum_equiv
-/
#print Finset.prod_finset_product /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -174,14 +174,16 @@ protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f :
#align monoid_hom.map_prod map_prodₓ
#align add_monoid_hom.map_sum map_sumₓ
-#print MulEquiv.map_prod /-
+/- warning: mul_equiv.map_prod clashes with monoid_hom.map_prod -> map_prodₓ
+Case conversion may be inaccurate. Consider using '#align mul_equiv.map_prod map_prodₓₓ'. -/
+#print map_prodₓ /-
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
-protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f : α → β)
- (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
+protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f : α → β) (s : Finset α) :
+ g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
-#align mul_equiv.map_prod MulEquiv.map_prod
-#align add_equiv.map_sum AddEquiv.map_sum
+#align mul_equiv.map_prod map_prodₓ
+#align add_monoid_hom.map_sum map_sumₓ
-/
#print RingHom.map_list_prod /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -166,15 +166,13 @@ theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G
section Deprecated
-#print MonoidHom.map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
-protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f : α → β)
- (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
+protected theorem map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f : α → β) (s : Finset α) :
+ g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
-#align monoid_hom.map_prod MonoidHom.map_prod
-#align add_monoid_hom.map_sum AddMonoidHom.map_sum
--/
+#align monoid_hom.map_prod map_prodₓ
+#align add_monoid_hom.map_sum map_sumₓ
#print MulEquiv.map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -129,11 +129,13 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
-/
+#print Finset.prod_map_val /-
@[simp, to_additive]
theorem prod_map_val [CommMonoid β] (s : Finset α) (f : α → β) : (s.1.map f).Prod = ∏ a in s, f a :=
rfl
#align finset.prod_map_val Finset.prod_map_val
#align finset.sum_map_val Finset.sum_map_val
+-/
#print Finset.prod_eq_fold /-
@[to_additive]
@@ -2004,22 +2006,26 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
#align finset.sum_const_nat Finset.sum_const_nat
-/
-theorem nat_cast_card_filter [AddCommMonoidWithOne β] (p) [DecidablePred p] (s : Finset α) :
+#print Finset.natCast_card_filter /-
+theorem natCast_card_filter [AddCommMonoidWithOne β] (p) [DecidablePred p] (s : Finset α) :
((filter p s).card : β) = ∑ a in s, if p a then 1 else 0 := by
simp only [add_zero, sum_const, nsmul_eq_mul, eq_self_iff_true, sum_const_zero, sum_ite,
nsmul_one]
-#align finset.nat_cast_card_filter Finset.nat_cast_card_filter
+#align finset.nat_cast_card_filter Finset.natCast_card_filter
+-/
+#print Finset.card_filter /-
theorem card_filter (p) [DecidablePred p] (s : Finset α) :
(filter p s).card = ∑ a in s, ite (p a) 1 0 :=
- nat_cast_card_filter _ _
+ natCast_card_filter _ _
#align finset.card_filter Finset.card_filter
+-/
#print Finset.sum_boole /-
@[simp]
theorem sum_boole {s : Finset α} {p : α → Prop} [AddCommMonoidWithOne β] {hp : DecidablePred p} :
(∑ x in s, if p x then 1 else 0 : β) = (s.filterₓ p).card :=
- (nat_cast_card_filter _ _).symm
+ (natCast_card_filter _ _).symm
#align finset.sum_boole Finset.sum_boole
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -14,7 +14,7 @@ import Data.Finset.Sigma
import Data.Multiset.Powerset
import Data.Set.Pairwise.Basic
-#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"fa2309577c7009ea243cffdf990cd6c84f0ad497"
+#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
/-!
# Big operators
@@ -129,6 +129,12 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
-/
+@[simp, to_additive]
+theorem prod_map_val [CommMonoid β] (s : Finset α) (f : α → β) : (s.1.map f).Prod = ∏ a in s, f a :=
+ rfl
+#align finset.prod_map_val Finset.prod_map_val
+#align finset.sum_map_val Finset.sum_map_val
+
#print Finset.prod_eq_fold /-
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
@@ -1998,12 +2004,22 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
#align finset.sum_const_nat Finset.sum_const_nat
-/
+theorem nat_cast_card_filter [AddCommMonoidWithOne β] (p) [DecidablePred p] (s : Finset α) :
+ ((filter p s).card : β) = ∑ a in s, if p a then 1 else 0 := by
+ simp only [add_zero, sum_const, nsmul_eq_mul, eq_self_iff_true, sum_const_zero, sum_ite,
+ nsmul_one]
+#align finset.nat_cast_card_filter Finset.nat_cast_card_filter
+
+theorem card_filter (p) [DecidablePred p] (s : Finset α) :
+ (filter p s).card = ∑ a in s, ite (p a) 1 0 :=
+ nat_cast_card_filter _ _
+#align finset.card_filter Finset.card_filter
+
#print Finset.sum_boole /-
@[simp]
-theorem sum_boole {s : Finset α} {p : α → Prop} [NonAssocSemiring β] {hp : DecidablePred p} :
- (∑ x in s, if p x then (1 : β) else (0 : β)) = (s.filterₓ p).card := by
- simp only [add_zero, mul_one, Finset.sum_const, nsmul_eq_mul, eq_self_iff_true,
- Finset.sum_const_zero, Finset.sum_ite]
+theorem sum_boole {s : Finset α} {p : α → Prop} [AddCommMonoidWithOne β] {hp : DecidablePred p} :
+ (∑ x in s, if p x then 1 else 0 : β) = (s.filterₓ p).card :=
+ (nat_cast_card_filter _ _).symm
#align finset.sum_boole Finset.sum_boole
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/b1abe23ae96fef89ad30d9f4362c307f72a55010
@@ -2454,7 +2454,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
#print Multiset.sup_powerset_len /-
theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
- (Finset.sup (Finset.range (x.card + 1)) fun k => x.powersetLen k) = x.powerset :=
+ (Finset.sup (Finset.range (x.card + 1)) fun k => x.powersetCard k) = x.powerset :=
by
convert bind_powerset_len x
rw [Multiset.bind, Multiset.join, ← Finset.range_val, ← Finset.sum_eq_multiset_sum]
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -1598,7 +1598,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
reduces to the difference of the last and first terms
when the function we are summing is monotone.
-/
-theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
+theorem sum_range_tsub [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α]
[ContravariantClass α α (· + ·) (· ≤ ·)] {f : ℕ → α} (h : Monotone f) (n : ℕ) :
∑ i in range n, (f (i + 1) - f i) = f n - f 0 :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,16 +3,16 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-import Mathbin.Algebra.BigOperators.Multiset.Lemmas
-import Mathbin.Algebra.Group.Pi
-import Mathbin.Algebra.GroupPower.Lemmas
-import Mathbin.Algebra.Hom.Equiv.Basic
-import Mathbin.Algebra.Ring.Opposite
-import Mathbin.Data.Finset.Sum
-import Mathbin.Data.Fintype.Basic
-import Mathbin.Data.Finset.Sigma
-import Mathbin.Data.Multiset.Powerset
-import Mathbin.Data.Set.Pairwise.Basic
+import Algebra.BigOperators.Multiset.Lemmas
+import Algebra.Group.Pi
+import Algebra.GroupPower.Lemmas
+import Algebra.Hom.Equiv.Basic
+import Algebra.Ring.Opposite
+import Data.Finset.Sum
+import Data.Fintype.Basic
+import Data.Finset.Sigma
+import Data.Multiset.Powerset
+import Data.Set.Pairwise.Basic
#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"fa2309577c7009ea243cffdf990cd6c84f0ad497"
@@ -674,7 +674,7 @@ theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t :
#align finset.sum_finset_product_right' Finset.sum_finset_product_right'
-/
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:132:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2]) } -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:133:4: warning: unsupported: rw with cfg: { occs := occurrences.pos[occurrences.pos] «expr[ ,]»([2]) } -/
#print Finset.prod_fiberwise_of_maps_to /-
@[to_additive]
theorem prod_fiberwise_of_maps_to [DecidableEq γ] {s : Finset α} {t : Finset γ} {g : α → γ}
@@ -2431,8 +2431,8 @@ theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∈ » i) -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x y «expr ∈ » i) -/
#print Multiset.finset_sum_eq_sup_iff_disjoint /-
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
i.Sum f = i.sup f ↔ ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -1460,11 +1460,11 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
-/
-#print Finset.sum_filter_count_eq_countp /-
-theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
- ∑ x in l.toFinset.filterₓ p, l.count x = l.countp p := by
+#print Finset.sum_filter_count_eq_countP /-
+theorem sum_filter_count_eq_countP [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
+ ∑ x in l.toFinset.filterₓ p, l.count x = l.countP p := by
simp [Finset.sum, sum_map_count_dedup_filter_eq_countp p l]
-#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countp
+#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countP
-/
open Multiset
mathlib commit https://github.com/leanprover-community/mathlib/commit/63721b2c3eba6c325ecf8ae8cca27155a4f6306f
@@ -2491,7 +2491,7 @@ theorem toFinset_sum_count_nsmul_eq (s : Multiset α) : ∑ a in s.toFinset, s.c
theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
(h : ∀ a : α, a ∈ s → k ∣ Multiset.count a s) : ∃ u : Multiset α, s = k • u :=
by
- use ∑ a in s.to_finset, (s.count a / k) • {a}
+ use∑ a in s.to_finset, (s.count a / k) • {a}
have h₂ :
∑ x : α in s.to_finset, k • (count x s / k) • ({x} : Multiset α) =
∑ x : α in s.to_finset, count x s • {x} :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,11 +2,6 @@
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit fa2309577c7009ea243cffdf990cd6c84f0ad497
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.BigOperators.Multiset.Lemmas
import Mathbin.Algebra.Group.Pi
@@ -19,6 +14,8 @@ import Mathbin.Data.Finset.Sigma
import Mathbin.Data.Multiset.Powerset
import Mathbin.Data.Set.Pairwise.Basic
+#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"fa2309577c7009ea243cffdf990cd6c84f0ad497"
+
/-!
# Big operators
@@ -2434,8 +2431,8 @@ theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-/
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ∈ » i) -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x y «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » i) -/
#print Multiset.finset_sum_eq_sup_iff_disjoint /-
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
i.Sum f = i.sup f ↔ ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -109,16 +109,12 @@ In practice, this means that parentheses should be placed as follows:
-/
--- mathport name: finset.sum_univ
scoped[BigOperators] notation3"∑ "(...)", "r:67:(scoped f => Finset.sum Finset.univ f) => r
--- mathport name: finset.prod_univ
scoped[BigOperators] notation3"∏ "(...)", "r:67:(scoped f => Finset.prod Finset.univ f) => r
--- mathport name: finset.sum
scoped[BigOperators] notation3"∑ "(...)" in "s", "r:67:(scoped f => Finset.sum s f) => r
--- mathport name: finset.prod
scoped[BigOperators] notation3"∏ "(...)" in "s", "r:67:(scoped f => Finset.prod s f) => r
open scoped BigOperators
@@ -136,29 +132,36 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
-/
+#print Finset.prod_eq_fold /-
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
∏ x in s, f x = s.fold (· * ·) 1 f :=
rfl
#align finset.prod_eq_fold Finset.prod_eq_fold
#align finset.sum_eq_fold Finset.sum_eq_fold
+-/
+#print Finset.sum_multiset_singleton /-
@[simp]
theorem sum_multiset_singleton (s : Finset α) : (s.Sum fun x => {x}) = s.val := by
simp only [sum_eq_multiset_sum, Multiset.sum_map_singleton]
#align finset.sum_multiset_singleton Finset.sum_multiset_singleton
+-/
end Finset
+#print map_prod /-
@[to_additive]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G β γ] (g : G)
(f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
simp only [Finset.prod_eq_multiset_prod, map_multiset_prod, Multiset.map_map]
#align map_prod map_prod
#align map_sum map_sum
+-/
section Deprecated
+#print MonoidHom.map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f : α → β)
@@ -166,7 +169,9 @@ protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →
map_prod g f s
#align monoid_hom.map_prod MonoidHom.map_prod
#align add_monoid_hom.map_sum AddMonoidHom.map_sum
+-/
+#print MulEquiv.map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f : α → β)
@@ -174,19 +179,25 @@ protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃*
map_prod g f s
#align mul_equiv.map_prod MulEquiv.map_prod
#align add_equiv.map_sum AddEquiv.map_sum
+-/
+#print RingHom.map_list_prod /-
/-- Deprecated: use `_root_.map_list_prod` instead. -/
protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
f l.Prod = (l.map f).Prod :=
map_list_prod f l
#align ring_hom.map_list_prod RingHom.map_list_prod
+-/
+#print RingHom.map_list_sum /-
/-- Deprecated: use `_root_.map_list_sum` instead. -/
protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
(l : List β) : f l.Sum = (l.map f).Sum :=
map_list_sum f l
#align ring_hom.map_list_sum RingHom.map_list_sum
+-/
+#print RingHom.unop_map_list_prod /-
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
Deprecated: use `_root_.unop_map_list_prod` instead.
@@ -195,40 +206,52 @@ protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β
(l : List β) : MulOpposite.unop (f l.Prod) = (l.map (MulOpposite.unop ∘ f)).reverse.Prod :=
unop_map_list_prod f l
#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prod
+-/
+#print RingHom.map_multiset_prod /-
/-- Deprecated: use `_root_.map_multiset_prod` instead. -/
protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
(s : Multiset β) : f s.Prod = (s.map f).Prod :=
map_multiset_prod f s
#align ring_hom.map_multiset_prod RingHom.map_multiset_prod
+-/
+#print RingHom.map_multiset_sum /-
/-- Deprecated: use `_root_.map_multiset_sum` instead. -/
protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
(s : Multiset β) : f s.Sum = (s.map f).Sum :=
map_multiset_sum f s
#align ring_hom.map_multiset_sum RingHom.map_multiset_sum
+-/
+#print RingHom.map_prod /-
/-- Deprecated: use `_root_.map_prod` instead. -/
protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
(s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
#align ring_hom.map_prod RingHom.map_prod
+-/
+#print RingHom.map_sum /-
/-- Deprecated: use `_root_.map_sum` instead. -/
protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
(f : α → β) (s : Finset α) : g (∑ x in s, f x) = ∑ x in s, g (f x) :=
map_sum g f s
#align ring_hom.map_sum RingHom.map_sum
+-/
end Deprecated
+#print MonoidHom.coe_finset_prod /-
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
⇑(∏ x in s, f x) = ∏ x in s, f x :=
(MonoidHom.coeFn β γ).map_prod _ _
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
+-/
+#print MonoidHom.finset_prod_apply /-
-- See also `finset.prod_apply`, with the same conclusion
-- but with the weaker hypothesis `f : α → β → γ`.
@[simp, to_additive]
@@ -237,6 +260,7 @@ theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α →
(MonoidHom.eval b).map_prod _ _
#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_apply
#align add_monoid_hom.finset_sum_apply AddMonoidHom.finset_sum_apply
+-/
variable {s s₁ s₂ : Finset α} {a : α} {f g : α → β}
@@ -246,30 +270,39 @@ section CommMonoid
variable [CommMonoid β]
+#print Finset.prod_empty /-
@[simp, to_additive]
theorem prod_empty : ∏ x in ∅, f x = 1 :=
rfl
#align finset.prod_empty Finset.prod_empty
#align finset.sum_empty Finset.sum_empty
+-/
+#print Finset.prod_of_empty /-
@[to_additive]
theorem prod_of_empty [IsEmpty α] (s : Finset α) : ∏ i in s, f i = 1 := by
rw [eq_empty_of_is_empty s, prod_empty]
#align finset.prod_of_empty Finset.prod_of_empty
#align finset.sum_of_empty Finset.sum_of_empty
+-/
+#print Finset.prod_cons /-
@[simp, to_additive]
theorem prod_cons (h : a ∉ s) : ∏ x in cons a s h, f x = f a * ∏ x in s, f x :=
fold_cons h
#align finset.prod_cons Finset.prod_cons
#align finset.sum_cons Finset.sum_cons
+-/
+#print Finset.prod_insert /-
@[simp, to_additive]
theorem prod_insert [DecidableEq α] : a ∉ s → ∏ x in insert a s, f x = f a * ∏ x in s, f x :=
fold_insert
#align finset.prod_insert Finset.prod_insert
#align finset.sum_insert Finset.sum_insert
+-/
+#print Finset.prod_insert_of_eq_one_if_not_mem /-
/-- The product of `f` over `insert a s` is the same as
the product over `s`, as long as `a` is in `s` or `f a = 1`.
-/
@@ -284,7 +317,9 @@ theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a =
· rw [prod_insert hm, h hm, one_mul]
#align finset.prod_insert_of_eq_one_if_not_mem Finset.prod_insert_of_eq_one_if_not_mem
#align finset.sum_insert_of_eq_zero_if_not_mem Finset.sum_insert_of_eq_zero_if_not_mem
+-/
+#print Finset.prod_insert_one /-
/-- The product of `f` over `insert a s` is the same as the product over `s`, as long as `f a = 1`.
-/
@[simp,
@@ -294,6 +329,7 @@ theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x in insert a s, f
prod_insert_of_eq_one_if_not_mem fun _ => h
#align finset.prod_insert_one Finset.prod_insert_one
#align finset.sum_insert_zero Finset.sum_insert_zero
+-/
#print Finset.prod_singleton /-
@[simp, to_additive]
@@ -303,18 +339,22 @@ theorem prod_singleton : ∏ x in singleton a, f x = f a :=
#align finset.sum_singleton Finset.sum_singleton
-/
+#print Finset.prod_pair /-
@[to_additive]
theorem prod_pair [DecidableEq α] {a b : α} (h : a ≠ b) :
∏ x in ({a, b} : Finset α), f x = f a * f b := by
rw [prod_insert (not_mem_singleton.2 h), prod_singleton]
#align finset.prod_pair Finset.prod_pair
#align finset.sum_pair Finset.sum_pair
+-/
+#print Finset.prod_const_one /-
@[simp, to_additive]
theorem prod_const_one : ∏ x in s, (1 : β) = 1 := by
simp only [Finset.prod, Multiset.map_const, Multiset.prod_replicate, one_pow]
#align finset.prod_const_one Finset.prod_const_one
#align finset.sum_const_zero Finset.sum_const_zero
+-/
#print Finset.prod_image /-
@[simp, to_additive]
@@ -343,12 +383,15 @@ theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.Prod
attribute [congr] Finset.sum_congr
+#print Finset.prod_disjUnion /-
@[to_additive]
theorem prod_disjUnion (h) : ∏ x in s₁.disjUnion s₂ h, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
refine' Eq.trans _ (fold_disj_union h); rw [one_mul]; rfl
#align finset.prod_disj_union Finset.prod_disjUnion
#align finset.sum_disj_union Finset.sum_disjUnion
+-/
+#print Finset.prod_disjiUnion /-
@[to_additive]
theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
∏ x in s.disjUnionₓ t h, f x = ∏ i in s, ∏ x in t i, f x :=
@@ -359,21 +402,27 @@ theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
exact prod_const_one.symm
#align finset.prod_disj_Union Finset.prod_disjiUnion
#align finset.sum_disj_Union Finset.sum_disjiUnion
+-/
+#print Finset.prod_union_inter /-
@[to_additive]
theorem prod_union_inter [DecidableEq α] :
(∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
fold_union_inter
#align finset.prod_union_inter Finset.prod_union_inter
#align finset.sum_union_inter Finset.sum_union_inter
+-/
+#print Finset.prod_union /-
@[to_additive]
theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
∏ x in s₁ ∪ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
rw [← prod_union_inter, disjoint_iff_inter_eq_empty.mp h] <;> exact (mul_one _).symm
#align finset.prod_union Finset.prod_union
#align finset.sum_union Finset.sum_union
+-/
+#print Finset.prod_filter_mul_prod_filter_not /-
@[to_additive]
theorem prod_filter_mul_prod_filter_not (s : Finset α) (p : α → Prop) [DecidablePred p]
[DecidablePred fun x => ¬p x] (f : α → β) :
@@ -383,14 +432,17 @@ theorem prod_filter_mul_prod_filter_not (s : Finset α) (p : α → Prop) [Decid
rw [← prod_union (disjoint_filter_filter_neg _ _ p), filter_union_filter_neg_eq]
#align finset.prod_filter_mul_prod_filter_not Finset.prod_filter_mul_prod_filter_not
#align finset.sum_filter_add_sum_filter_not Finset.sum_filter_add_sum_filter_not
+-/
section ToList
+#print Finset.prod_to_list /-
@[simp, to_additive]
theorem prod_to_list (s : Finset α) (f : α → β) : (s.toList.map f).Prod = s.Prod f := by
rw [Finset.prod, ← Multiset.coe_prod, ← Multiset.coe_map, Finset.coe_toList]
#align finset.prod_to_list Finset.prod_to_list
#align finset.sum_to_list Finset.sum_to_list
+-/
end ToList
@@ -422,6 +474,7 @@ open Finset
variable [Fintype α] [CommMonoid β]
+#print IsCompl.prod_mul_prod /-
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
(∏ i in s, f i) * ∏ i in t, f i = ∏ i, f i :=
@@ -429,6 +482,7 @@ theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β
classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top] <;> rfl
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
#align is_compl.sum_add_sum IsCompl.sum_add_sum
+-/
end
@@ -438,6 +492,7 @@ section CommMonoid
variable [CommMonoid β]
+#print Finset.prod_mul_prod_compl /-
/-- Multiplying the products of a function over `s` and over `sᶜ` gives the whole product.
For a version expressed with subtypes, see `fintype.prod_subtype_mul_prod_subtype`. -/
@[to_additive
@@ -447,21 +502,27 @@ theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f :
IsCompl.prod_mul_prod isCompl_compl f
#align finset.prod_mul_prod_compl Finset.prod_mul_prod_compl
#align finset.sum_add_sum_compl Finset.sum_add_sum_compl
+-/
+#print Finset.prod_compl_mul_prod /-
@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
(∏ i in sᶜ, f i) * ∏ i in s, f i = ∏ i, f i :=
(@isCompl_compl _ s _).symm.prod_mul_prod f
#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prod
#align finset.sum_compl_add_sum Finset.sum_compl_add_sum
+-/
+#print Finset.prod_sdiff /-
@[to_additive]
theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
(∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x = ∏ x in s₂, f x := by
rw [← prod_union sdiff_disjoint, sdiff_union_of_subset h]
#align finset.prod_sdiff Finset.prod_sdiff
#align finset.sum_sdiff Finset.sum_sdiff
+-/
+#print Finset.prod_disj_sum /-
@[simp, to_additive]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
∏ x in s.disjSum t, f x = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) :=
@@ -470,20 +531,26 @@ theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
rfl
#align finset.prod_disj_sum Finset.prod_disj_sum
#align finset.sum_disj_sum Finset.sum_disj_sum
+-/
+#print Finset.prod_sum_elim /-
@[to_additive]
theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ → β) :
∏ x in s.disjSum t, Sum.elim f g x = (∏ x in s, f x) * ∏ x in t, g x := by simp
#align finset.prod_sum_elim Finset.prod_sum_elim
#align finset.sum_sum_elim Finset.sum_sum_elim
+-/
+#print Finset.prod_biUnion /-
@[to_additive]
theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
(hs : Set.PairwiseDisjoint (↑s) t) : ∏ x in s.biUnion t, f x = ∏ x in s, ∏ i in t x, f i := by
rw [← disj_Union_eq_bUnion _ _ hs, prod_disj_Union]
#align finset.prod_bUnion Finset.prod_biUnion
#align finset.sum_bUnion Finset.sum_biUnion
+-/
+#print Finset.prod_sigma /-
/-- Product over a sigma type equals the product of fiberwise products. For rewriting
in the reverse direction, use `finset.prod_sigma'`. -/
@[to_additive
@@ -493,13 +560,16 @@ theorem prod_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a
simp_rw [← disj_Union_map_sigma_mk, prod_disj_Union, Prod_map, Function.Embedding.sigmaMk_apply]
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
+-/
+#print Finset.prod_sigma' /-
@[to_additive]
theorem prod_sigma' {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
∏ a in s, ∏ s in t a, f a s = ∏ x in s.Sigma t, f x.1 x.2 :=
Eq.symm <| prod_sigma s t fun x => f x.1 x.2
#align finset.prod_sigma' Finset.prod_sigma'
#align finset.sum_sigma' Finset.sum_sigma'
+-/
#print Finset.prod_bij /-
/-- Reorder a product.
@@ -538,6 +608,7 @@ theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β
#align finset.sum_bij' Finset.sum_bij'
-/
+#print Finset.Equiv.prod_comp_finset /-
/-- Reindexing a product over a finset along an equivalence.
See `equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@[to_additive
@@ -554,6 +625,7 @@ theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι'
rwa [e.apply_symm_apply]
#align finset.equiv.prod_comp_finset Finset.Equiv.prod_comp_finset
#align finset.equiv.sum_comp_finset Finset.Equiv.sum_comp_finset
+-/
#print Finset.prod_finset_product /-
@[to_additive]
@@ -633,11 +705,13 @@ theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ →
#align finset.sum_image' Finset.sum_image'
-/
+#print Finset.prod_mul_distrib /-
@[to_additive]
theorem prod_mul_distrib : ∏ x in s, f x * g x = (∏ x in s, f x) * ∏ x in s, g x :=
Eq.trans (by rw [one_mul] <;> rfl) fold_op_distrib
#align finset.prod_mul_distrib Finset.prod_mul_distrib
#align finset.sum_add_distrib Finset.sum_add_distrib
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -712,6 +786,7 @@ theorem prod_comm {s : Finset γ} {t : Finset α} {f : γ → α → β} :
#align finset.sum_comm Finset.sum_comm
-/
+#print Finset.prod_hom_rel /-
@[to_additive]
theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g : α → γ} {s : Finset α}
(h₁ : r 1 1) (h₂ : ∀ a b c, r b c → r (f a * b) (g a * c)) :
@@ -719,7 +794,9 @@ theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g
apply Multiset.prod_hom_rel <;> assumption
#align finset.prod_hom_rel Finset.prod_hom_rel
#align finset.sum_hom_rel Finset.sum_hom_rel
+-/
+#print Finset.prod_eq_one /-
@[to_additive]
theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x in s, f x = 1 :=
calc
@@ -727,7 +804,9 @@ theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) :
_ = 1 := Finset.prod_const_one
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
+-/
+#print Finset.prod_subset_one_on_sdiff /-
@[to_additive]
theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
(hfg : ∀ x ∈ s₁, f x = g x) : ∏ i in s₁, f i = ∏ i in s₂, g i :=
@@ -736,7 +815,9 @@ theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀
exact prod_congr rfl hfg
#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiff
#align finset.sum_subset_zero_on_sdiff Finset.sum_subset_zero_on_sdiff
+-/
+#print Finset.prod_subset /-
@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
∏ x in s₁, f x = ∏ x in s₂, f x :=
@@ -744,7 +825,9 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
prod_subset_one_on_sdiff h (by simpa) fun _ _ => rfl
#align finset.prod_subset Finset.prod_subset
#align finset.sum_subset Finset.sum_subset
+-/
+#print Finset.prod_filter_of_ne /-
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
∏ x in s.filterₓ p, f x = ∏ x in s, f x :=
@@ -754,7 +837,9 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
exact fun h₁ h₂ => ⟨h₁, hp _ h₁ h₂⟩
#align finset.prod_filter_of_ne Finset.prod_filter_of_ne
#align finset.sum_filter_of_ne Finset.sum_filter_of_ne
+-/
+#print Finset.prod_filter_ne_one /-
-- If we use `[decidable_eq β]` here, some rewrites fail because they find a wrong `decidable`
-- instance first; `{∀ x, decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
@@ -763,7 +848,9 @@ theorem prod_filter_ne_one [∀ x, Decidable (f x ≠ 1)] :
prod_filter_of_ne fun _ _ => id
#align finset.prod_filter_ne_one Finset.prod_filter_ne_one
#align finset.sum_filter_ne_zero Finset.sum_filter_ne_zero
+-/
+#print Finset.prod_filter /-
@[to_additive]
theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
∏ a in s.filterₓ p, f a = ∏ a in s, if p a then f a else 1 :=
@@ -777,7 +864,9 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
exact if_neg (h hs)
#align finset.prod_filter Finset.prod_filter
#align finset.sum_filter Finset.sum_filter
+-/
+#print Finset.prod_eq_single_of_mem /-
@[to_additive]
theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a ∈ s)
(h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x in s, f x = f a :=
@@ -792,7 +881,9 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
_ = f a := prod_singleton
#align finset.prod_eq_single_of_mem Finset.prod_eq_single_of_mem
#align finset.sum_eq_single_of_mem Finset.sum_eq_single_of_mem
+-/
+#print Finset.prod_eq_single /-
@[to_additive]
theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
(h₁ : a ∉ s → f a = 1) : ∏ x in s, f x = f a :=
@@ -802,7 +893,9 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
prod_const_one.trans (h₁ this).symm
#align finset.prod_eq_single Finset.prod_eq_single
#align finset.sum_eq_single Finset.sum_eq_single
+-/
+#print Finset.prod_eq_mul_of_mem /-
@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
(hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x in s, f x = f a * f b :=
@@ -823,7 +916,9 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
exact Finset.prod_pair hn
#align finset.prod_eq_mul_of_mem Finset.prod_eq_mul_of_mem
#align finset.sum_eq_add_of_mem Finset.sum_eq_add_of_mem
+-/
+#print Finset.prod_eq_mul /-
@[to_additive]
theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) :
@@ -845,6 +940,7 @@ theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
prod_const_one
#align finset.prod_eq_mul Finset.prod_eq_mul
#align finset.sum_eq_add Finset.sum_eq_add
+-/
#print Finset.prod_attach /-
@[to_additive]
@@ -939,6 +1035,7 @@ theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α)
#align finset.sum_subtype Finset.sum_subtype
-/
+#print Finset.prod_congr_set /-
/-- The product of a function `g` defined only on a set `s` is equal to
the product of a function `f` defined everywhere,
as long as `f` and `g` agree on `s`, and `f = 1` off `s`. -/
@@ -956,7 +1053,9 @@ theorem prod_congr_set {α : Type _} [CommMonoid α] {β : Type _} [Fintype β]
· rintro x _ h; exact w' x (by simpa using h)
#align finset.prod_congr_set Finset.prod_congr_set
#align finset.sum_congr_set Finset.sum_congr_set
+-/
+#print Finset.prod_apply_dite /-
@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
[DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
@@ -979,7 +1078,9 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
(prod_congr rfl fun x hx => congr_arg h (dif_neg (mem_filter.mp x.2).2))
#align finset.prod_apply_dite Finset.prod_apply_dite
#align finset.sum_apply_dite Finset.sum_apply_dite
+-/
+#print Finset.prod_apply_ite /-
@[to_additive]
theorem prod_apply_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → γ)
(h : γ → β) :
@@ -989,7 +1090,9 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
(congr_arg₂ _ (@prod_attach _ _ _ _ (h ∘ f)) (@prod_attach _ _ _ _ (h ∘ g)))
#align finset.prod_apply_ite Finset.prod_apply_ite
#align finset.sum_apply_ite Finset.sum_apply_ite
+-/
+#print Finset.prod_dite /-
@[to_additive]
theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f : ∀ x : α, p x → β)
(g : ∀ x : α, ¬p x → β) :
@@ -999,7 +1102,9 @@ theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f :
by simp [prod_apply_dite _ _ fun x => x]
#align finset.prod_dite Finset.prod_dite
#align finset.sum_dite Finset.sum_dite
+-/
+#print Finset.prod_ite /-
@[to_additive]
theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → β) :
(∏ x in s, if p x then f x else g x) =
@@ -1007,6 +1112,7 @@ theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g :
by simp [prod_apply_ite _ _ fun x => x]
#align finset.prod_ite Finset.prod_ite
#align finset.sum_ite Finset.sum_ite
+-/
#print Finset.prod_ite_of_false /-
@[to_additive]
@@ -1044,20 +1150,25 @@ theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g :
#align finset.sum_apply_ite_of_true Finset.sum_apply_ite_of_true
-/
+#print Finset.prod_extend_by_one /-
@[to_additive]
theorem prod_extend_by_one [DecidableEq α] (s : Finset α) (f : α → β) :
(∏ i in s, if i ∈ s then f i else 1) = ∏ i in s, f i :=
prod_congr rfl fun i hi => if_pos hi
#align finset.prod_extend_by_one Finset.prod_extend_by_one
#align finset.sum_extend_by_zero Finset.sum_extend_by_zero
+-/
+#print Finset.prod_ite_mem /-
@[simp, to_additive]
theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
(∏ i in s, if i ∈ t then f i else 1) = ∏ i in s ∩ t, f i := by
rw [← Finset.prod_filter, Finset.filter_mem_eq_inter]
#align finset.prod_ite_mem Finset.prod_ite_mem
#align finset.sum_ite_mem Finset.sum_ite_mem
+-/
+#print Finset.prod_dite_eq /-
@[simp, to_additive]
theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, a = x → β) :
(∏ x in s, if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 :=
@@ -1070,7 +1181,9 @@ theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
intros; rw [dif_neg]; intro; cc
#align finset.prod_dite_eq Finset.prod_dite_eq
#align finset.sum_dite_eq Finset.sum_dite_eq
+-/
+#print Finset.prod_dite_eq' /-
@[simp, to_additive]
theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, x = a → β) :
(∏ x in s, if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 :=
@@ -1083,14 +1196,18 @@ theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
intros; rw [dif_neg]; intro; cc
#align finset.prod_dite_eq' Finset.prod_dite_eq'
#align finset.sum_dite_eq' Finset.sum_dite_eq'
+-/
+#print Finset.prod_ite_eq /-
@[simp, to_additive]
theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
∏ x in s, ite (a = x) (b x) 1 = ite (a ∈ s) (b a) 1 :=
prod_dite_eq s a fun x _ => b x
#align finset.prod_ite_eq Finset.prod_ite_eq
#align finset.sum_ite_eq Finset.sum_ite_eq
+-/
+#print Finset.prod_ite_eq' /-
/-- A product taken over a conditional whose condition is an equality test on the index and whose
alternative is `1` has value either the term at that index or `1`.
@@ -1103,6 +1220,7 @@ theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
prod_dite_eq' s a fun x _ => b x
#align finset.prod_ite_eq' Finset.prod_ite_eq'
#align finset.sum_ite_eq' Finset.sum_ite_eq'
+-/
#print Finset.prod_ite_index /-
@[to_additive]
@@ -1132,13 +1250,16 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
#align finset.sum_dite_irrel Finset.sum_dite_irrel
-/
+#print Finset.prod_pi_mulSingle' /-
@[simp, to_additive]
theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
∏ a' in s, Pi.mulSingle a x a' = if a ∈ s then x else 1 :=
prod_dite_eq' _ _ _
#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
+-/
+#print Finset.prod_pi_mulSingle /-
@[simp, to_additive]
theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
(f : ∀ a, β a) (s : Finset α) :
@@ -1146,7 +1267,9 @@ theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMono
prod_dite_eq _ _ _
#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
#align finset.sum_pi_single Finset.sum_pi_single
+-/
+#print Finset.prod_bij_ne_one /-
@[to_additive]
theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
@@ -1172,6 +1295,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
_ = ∏ x in t, g x := prod_filter_ne_one
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
+-/
#print Finset.prod_dite_of_false /-
@[to_additive]
@@ -1195,12 +1319,15 @@ theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
#align finset.sum_dite_of_true Finset.sum_dite_of_true
-/
+#print Finset.nonempty_of_prod_ne_one /-
@[to_additive]
theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
s.eq_empty_or_nonempty.elim (fun H => False.elim <| h <| H.symm ▸ prod_empty) id
#align finset.nonempty_of_prod_ne_one Finset.nonempty_of_prod_ne_one
#align finset.nonempty_of_sum_ne_zero Finset.nonempty_of_sum_ne_zero
+-/
+#print Finset.exists_ne_one_of_prod_ne_one /-
@[to_additive]
theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
@@ -1209,21 +1336,27 @@ theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s,
exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
#align finset.exists_ne_zero_of_sum_ne_zero Finset.exists_ne_zero_of_sum_ne_zero
+-/
+#print Finset.prod_range_succ_comm /-
@[to_additive]
theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
∏ x in range (n + 1), f x = f n * ∏ x in range n, f x := by
rw [range_succ, prod_insert not_mem_range_self]
#align finset.prod_range_succ_comm Finset.prod_range_succ_comm
#align finset.sum_range_succ_comm Finset.sum_range_succ_comm
+-/
+#print Finset.prod_range_succ /-
@[to_additive]
theorem prod_range_succ (f : ℕ → β) (n : ℕ) :
∏ x in range (n + 1), f x = (∏ x in range n, f x) * f n := by
simp only [mul_comm, prod_range_succ_comm]
#align finset.prod_range_succ Finset.prod_range_succ
#align finset.sum_range_succ Finset.sum_range_succ
+-/
+#print Finset.prod_range_succ' /-
@[to_additive]
theorem prod_range_succ' (f : ℕ → β) :
∀ n : ℕ, ∏ k in range (n + 1), f k = (∏ k in range n, f (k + 1)) * f 0
@@ -1231,7 +1364,9 @@ theorem prod_range_succ' (f : ℕ → β) :
| n + 1 => by rw [prod_range_succ _ n, mul_right_comm, ← prod_range_succ', prod_range_succ]
#align finset.prod_range_succ' Finset.prod_range_succ'
#align finset.sum_range_succ' Finset.sum_range_succ'
+-/
+#print Finset.eventually_constant_prod /-
@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
∏ k in range (n + 1), u k = ∏ k in range (N + 1), u k :=
@@ -1244,7 +1379,9 @@ theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u
simp [hu, @zero_le' ℕ]
#align finset.eventually_constant_prod Finset.eventually_constant_prod
#align finset.eventually_constant_sum Finset.eventually_constant_sum
+-/
+#print Finset.prod_range_add /-
@[to_additive]
theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
∏ x in range (n + m), f x = (∏ x in range n, f x) * ∏ x in range m, f (n + x) :=
@@ -1254,18 +1391,23 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
· rw [Nat.add_succ, prod_range_succ, hm, prod_range_succ, mul_assoc]
#align finset.prod_range_add Finset.prod_range_add
#align finset.sum_range_add Finset.sum_range_add
+-/
+#print Finset.prod_range_add_div_prod_range /-
@[to_additive]
theorem prod_range_add_div_prod_range {α : Type _} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
(∏ k in range (n + m), f k) / ∏ k in range n, f k = ∏ k in Finset.range m, f (n + k) :=
div_eq_of_eq_mul' (prod_range_add f n m)
#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_range
#align finset.sum_range_add_sub_sum_range Finset.sum_range_add_sub_sum_range
+-/
+#print Finset.prod_range_zero /-
@[to_additive]
theorem prod_range_zero (f : ℕ → β) : ∏ k in range 0, f k = 1 := by rw [range_zero, prod_empty]
#align finset.prod_range_zero Finset.prod_range_zero
#align finset.sum_range_zero Finset.sum_range_zero
+-/
#print Finset.prod_range_one /-
@[to_additive sum_range_one]
@@ -1277,6 +1419,7 @@ theorem prod_range_one (f : ℕ → β) : ∏ k in range 1, f k = f 0 := by rw [
open List
+#print Finset.prod_list_map_count /-
@[to_additive]
theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type _} [CommMonoid M] (f : α → M) :
(l.map f).Prod = ∏ m in l.toFinset, f m ^ l.count m :=
@@ -1297,13 +1440,17 @@ theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type _} [CommMon
exact has hx
#align finset.prod_list_map_count Finset.prod_list_map_count
#align finset.sum_list_map_count Finset.sum_list_map_count
+-/
+#print Finset.prod_list_count /-
@[to_additive]
theorem prod_list_count [DecidableEq α] [CommMonoid α] (s : List α) :
s.Prod = ∏ m in s.toFinset, m ^ s.count m := by simpa using prod_list_map_count s id
#align finset.prod_list_count Finset.prod_list_count
#align finset.sum_list_count Finset.sum_list_count
+-/
+#print Finset.prod_list_count_of_subset /-
@[to_additive]
theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α) (s : Finset α)
(hs : m.toFinset ⊆ s) : m.Prod = ∏ i in s, i ^ m.count i :=
@@ -1314,6 +1461,7 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
rw [count_eq_zero_of_not_mem hx, pow_zero]
#align finset.prod_list_count_of_subset Finset.prod_list_count_of_subset
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
+-/
#print Finset.sum_filter_count_eq_countp /-
theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
@@ -1324,12 +1472,14 @@ theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [Decidable
open Multiset
+#print Finset.prod_multiset_map_count /-
@[to_additive]
theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type _} [CommMonoid M]
(f : α → M) : (s.map f).Prod = ∏ m in s.toFinset, f m ^ s.count m := by
refine' Quot.inductionOn s fun l => _; simp [prod_list_map_count l f]
#align finset.prod_multiset_map_count Finset.prod_multiset_map_count
#align finset.sum_multiset_map_count Finset.sum_multiset_map_count
+-/
#print Finset.prod_multiset_count /-
@[to_additive]
@@ -1364,6 +1514,7 @@ theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m
#align finset.sum_mem_multiset Finset.sum_mem_multiset
-/
+#print Finset.prod_induction /-
/-- To prove a property of a product, it suffices to prove that
the property is multiplicative and holds on factors.
-/
@@ -1375,7 +1526,9 @@ theorem prod_induction {M : Type _} [CommMonoid M] (f : α → M) (p : M → Pro
Multiset.prod_induction _ _ p_mul p_one (Multiset.forall_mem_map_iff.mpr p_s)
#align finset.prod_induction Finset.prod_induction
#align finset.sum_induction Finset.sum_induction
+-/
+#print Finset.prod_induction_nonempty /-
/-- To prove a property of a product, it suffices to prove that
the property is multiplicative and holds on factors.
-/
@@ -1388,7 +1541,9 @@ theorem prod_induction_nonempty {M : Type _} [CommMonoid M] (f : α → M) (p :
(Multiset.forall_mem_map_iff.mpr p_s)
#align finset.prod_induction_nonempty Finset.prod_induction_nonempty
#align finset.sum_induction_nonempty Finset.sum_induction_nonempty
+-/
+#print Finset.prod_range_induction /-
/-- For any product along `{0, ..., n - 1}` of a commutative-monoid-valued function, we can verify
that it's equal to a different function just by checking ratios of adjacent terms.
@@ -1403,7 +1558,9 @@ theorem prod_range_induction (f s : ℕ → β) (h0 : s 0 = 1) (h : ∀ n, s (n
· simp only [hk, Finset.prod_range_succ, h, mul_comm]
#align finset.prod_range_induction Finset.prod_range_induction
#align finset.sum_range_induction Finset.sum_range_induction
+-/
+#print Finset.prod_range_div /-
/-- A telescoping product along `{0, ..., n - 1}` of a commutative group valued function reduces to
the ratio of the last and first factors. -/
@[to_additive
@@ -1412,26 +1569,34 @@ theorem prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
∏ i in range n, f (i + 1) / f i = f n / f 0 := by apply prod_range_induction <;> simp
#align finset.prod_range_div Finset.prod_range_div
#align finset.sum_range_sub Finset.sum_range_sub
+-/
+#print Finset.prod_range_div' /-
@[to_additive]
theorem prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
∏ i in range n, f i / f (i + 1) = f 0 / f n := by apply prod_range_induction <;> simp
#align finset.prod_range_div' Finset.prod_range_div'
#align finset.sum_range_sub' Finset.sum_range_sub'
+-/
+#print Finset.eq_prod_range_div /-
@[to_additive]
theorem eq_prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel'_right]
#align finset.eq_prod_range_div Finset.eq_prod_range_div
#align finset.eq_sum_range_sub Finset.eq_sum_range_sub
+-/
+#print Finset.eq_prod_range_div' /-
@[to_additive]
theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
f n = ∏ i in range (n + 1), if i = 0 then f 0 else f i / f (i - 1) := by
conv_lhs => rw [Finset.eq_prod_range_div f]; simp [Finset.prod_range_succ', mul_comm]
#align finset.eq_prod_range_div' Finset.eq_prod_range_div'
#align finset.eq_sum_range_sub' Finset.eq_sum_range_sub'
+-/
+#print Finset.sum_range_tsub /-
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
when the function we are summing is monotone.
@@ -1445,6 +1610,7 @@ theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
have h₂ : f 0 ≤ f n := h (Nat.zero_le _)
rw [tsub_add_eq_add_tsub h₂, add_tsub_cancel_of_le h₁]
#align finset.sum_range_tsub Finset.sum_range_tsub
+-/
#print Finset.prod_const /-
@[simp, to_additive]
@@ -1490,6 +1656,7 @@ theorem prod_flip {n : ℕ} (f : ℕ → β) :
#align finset.sum_flip Finset.sum_flip
-/
+#print Finset.prod_involution /-
@[to_additive]
theorem prod_involution {s : Finset α} {f : α → β} :
∀ (g : ∀ a ∈ s, α) (h : ∀ a ha, f a * f (g a ha) = 1) (g_ne : ∀ a ha, f a ≠ 1 → g a ha ≠ a)
@@ -1532,6 +1699,7 @@ theorem prod_involution {s : Finset α} {f : α → β} :
prod_insert (not_mem_erase _ _), ih', mul_one, h x hx]
#align finset.prod_involution Finset.prod_involution
#align finset.sum_involution Finset.sum_involution
+-/
#print Finset.prod_comp /-
/-- The product of the composition of functions `f` and `g`, is the product over `b ∈ s.image g` of
@@ -1558,47 +1726,59 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
#align finset.sum_comp Finset.sum_comp
-/
+#print Finset.prod_piecewise /-
@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
∏ x in s, (t.piecewise f g) x = (∏ x in s ∩ t, f x) * ∏ x in s \ t, g x := by
rw [piecewise, prod_ite, filter_mem_eq_inter, ← sdiff_eq_filter]
#align finset.prod_piecewise Finset.prod_piecewise
#align finset.sum_piecewise Finset.sum_piecewise
+-/
+#print Finset.prod_inter_mul_prod_diff /-
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
(∏ x in s ∩ t, f x) * ∏ x in s \ t, f x = ∏ x in s, f x := by
convert (s.prod_piecewise t f f).symm; simp [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
+-/
+#print Finset.prod_eq_mul_prod_diff_singleton /-
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : ∏ x in s, f x = f i * ∏ x in s \ {i}, f x := by
convert (s.prod_inter_mul_prod_diff {i} f).symm; simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
#align finset.sum_eq_add_sum_diff_singleton Finset.sum_eq_add_sum_diff_singleton
+-/
+#print Finset.prod_eq_prod_diff_singleton_mul /-
@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : ∏ x in s, f x = (∏ x in s \ {i}, f x) * f i := by
rw [prod_eq_mul_prod_diff_singleton h, mul_comm]
#align finset.prod_eq_prod_diff_singleton_mul Finset.prod_eq_prod_diff_singleton_mul
#align finset.sum_eq_sum_diff_singleton_add Finset.sum_eq_sum_diff_singleton_add
+-/
+#print Fintype.prod_eq_mul_prod_compl /-
@[to_additive]
theorem Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
∏ i, f i = f a * ∏ i in {a}ᶜ, f i :=
prod_eq_mul_prod_diff_singleton (mem_univ a) f
#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_compl
#align fintype.sum_eq_add_sum_compl Fintype.sum_eq_add_sum_compl
+-/
+#print Fintype.prod_eq_prod_compl_mul /-
@[to_additive]
theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
∏ i, f i = (∏ i in {a}ᶜ, f i) * f a :=
prod_eq_prod_diff_singleton_mul (mem_univ a) f
#align fintype.prod_eq_prod_compl_mul Fintype.prod_eq_prod_compl_mul
#align fintype.sum_eq_sum_compl_add Fintype.sum_eq_sum_compl_add
+-/
#print Finset.dvd_prod_of_mem /-
theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i in s, f i := by
@@ -1620,6 +1800,7 @@ theorem prod_partition (R : Setoid α) [DecidableRel R.R] :
#align finset.sum_partition Finset.sum_partition
-/
+#print Finset.prod_cancels_of_partition_cancels /-
/-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/
@[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."]
theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.R]
@@ -1632,6 +1813,7 @@ theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.R]
apply h x x_in_s
#align finset.prod_cancels_of_partition_cancels Finset.prod_cancels_of_partition_cancels
#align finset.sum_cancels_of_partition_cancels Finset.sum_cancels_of_partition_cancels
+-/
#print Finset.prod_update_of_not_mem /-
@[to_additive]
@@ -1645,12 +1827,14 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
#align finset.sum_update_of_not_mem Finset.sum_update_of_not_mem
-/
+#print Finset.prod_update_of_mem /-
@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
∏ x in s, Function.update f i b x = b * ∏ x in s \ singleton i, f x := by
rw [update_eq_piecewise, prod_piecewise]; simp [h]
#align finset.prod_update_of_mem Finset.prod_update_of_mem
#align finset.sum_update_of_mem Finset.sum_update_of_mem
+-/
#print Finset.eq_of_card_le_one_of_prod_eq /-
/-- If a product of a `finset` of size at most 1 has a given value, so
@@ -1675,6 +1859,7 @@ theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α
#align finset.eq_of_card_le_one_of_sum_eq Finset.eq_of_card_le_one_of_sum_eq
-/
+#print Finset.mul_prod_erase /-
/-- Taking a product over `s : finset α` is the same as multiplying the value on a single element
`f a` by the product of `s.erase a`.
@@ -1686,14 +1871,18 @@ theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α}
rw [← prod_insert (not_mem_erase a s), insert_erase h]
#align finset.mul_prod_erase Finset.mul_prod_erase
#align finset.add_sum_erase Finset.add_sum_erase
+-/
+#print Finset.prod_erase_mul /-
/-- A variant of `finset.mul_prod_erase` with the multiplication swapped. -/
@[to_additive "A variant of `finset.add_sum_erase` with the addition swapped."]
theorem prod_erase_mul [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
(∏ x in s.eraseₓ a, f x) * f a = ∏ x in s, f x := by rw [mul_comm, mul_prod_erase s f h]
#align finset.prod_erase_mul Finset.prod_erase_mul
#align finset.sum_erase_add Finset.sum_erase_add
+-/
+#print Finset.prod_erase /-
/-- If a function applied at a point is 1, a product is unchanged by
removing that point, if present, from a `finset`. -/
@[to_additive
@@ -1707,7 +1896,9 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
rwa [eq_of_mem_of_not_mem_erase hx hnx]
#align finset.prod_erase Finset.prod_erase
#align finset.sum_erase Finset.sum_erase
+-/
+#print Finset.prod_ite_one /-
/-- See also `finset.prod_boole`. -/
@[to_additive "See also `finset.sum_boole`."]
theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).PairwiseDisjoint f)
@@ -1722,7 +1913,9 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
exact fun i hi => if_neg (h i hi)
#align finset.prod_ite_one Finset.prod_ite_one
#align finset.sum_ite_zero Finset.sum_ite_zero
+-/
+#print Finset.prod_erase_lt_of_one_lt /-
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
@@ -1733,7 +1926,9 @@ theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoi
exact lt_mul_of_one_lt_left' _ hdf
#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_lt
#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_pos
+-/
+#print Finset.eq_one_of_prod_eq_one /-
/-- If a product is 1 and the function is 1 except possibly at one
point, it is 1 everywhere on the `finset`. -/
@[to_additive
@@ -1752,10 +1947,13 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏
· exact h1 x hx h
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
+-/
+#print Finset.prod_pow_boole /-
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
∏ x in s, f x ^ ite (a = x) 1 0 = ite (a ∈ s) (f a) 1 := by simp
#align finset.prod_pow_boole Finset.prod_pow_boole
+-/
#print Finset.prod_dvd_prod_of_dvd /-
theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
@@ -1769,13 +1967,16 @@ theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
-/
+#print Finset.prod_dvd_prod_of_subset /-
theorem prod_dvd_prod_of_subset {ι M : Type _} [CommMonoid M] (s t : Finset ι) (f : ι → M)
(h : s ⊆ t) : ∏ i in s, f i ∣ ∏ i in t, f i :=
Multiset.prod_dvd_prod_of_le <| Multiset.map_le_map <| by simpa
#align finset.prod_dvd_prod_of_subset Finset.prod_dvd_prod_of_subset
+-/
end CommMonoid
+#print Finset.prod_add_prod_eq /-
/-- If `f = g = h` everywhere but at `i`, where `f i = g i + h i`, then the product of `f` over `s`
is the sum of the products of `g` and `h`. -/
theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
@@ -1785,6 +1986,7 @@ theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α
simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
congr 2 <;> apply prod_congr rfl <;> simpa
#align finset.prod_add_prod_eq Finset.prod_add_prod_eq
+-/
#print Finset.card_eq_sum_ones /-
theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ _ in s, 1 := by simp
@@ -1799,13 +2001,16 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
#align finset.sum_const_nat Finset.sum_const_nat
-/
+#print Finset.sum_boole /-
@[simp]
theorem sum_boole {s : Finset α} {p : α → Prop} [NonAssocSemiring β] {hp : DecidablePred p} :
(∑ x in s, if p x then (1 : β) else (0 : β)) = (s.filterₓ p).card := by
simp only [add_zero, mul_one, Finset.sum_const, nsmul_eq_mul, eq_self_iff_true,
Finset.sum_const_zero, Finset.sum_ite]
#align finset.sum_boole Finset.sum_boole
+-/
+#print Commute.sum_right /-
theorem Commute.sum_right [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
(h : ∀ i ∈ s, Commute b (f i)) : Commute b (∑ i in s, f i) :=
Commute.multiset_sum_right _ _ fun b hb =>
@@ -1813,11 +2018,14 @@ theorem Commute.sum_right [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α
obtain ⟨i, hi, rfl⟩ := multiset.mem_map.mp hb
exact h _ hi
#align commute.sum_right Commute.sum_right
+-/
+#print Commute.sum_left /-
theorem Commute.sum_left [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
(h : ∀ i ∈ s, Commute (f i) b) : Commute (∑ i in s, f i) b :=
(Commute.sum_right _ _ _ fun i hi => (h _ hi).symm).symm
#align commute.sum_left Commute.sum_left
+-/
section Opposite
@@ -1846,17 +2054,21 @@ section DivisionCommMonoid
variable [DivisionCommMonoid β]
+#print Finset.prod_inv_distrib /-
@[simp, to_additive]
theorem prod_inv_distrib : ∏ x in s, (f x)⁻¹ = (∏ x in s, f x)⁻¹ :=
Multiset.prod_map_inv
#align finset.prod_inv_distrib Finset.prod_inv_distrib
#align finset.sum_neg_distrib Finset.sum_neg_distrib
+-/
+#print Finset.prod_div_distrib /-
@[simp, to_additive]
theorem prod_div_distrib : ∏ x in s, f x / g x = (∏ x in s, f x) / ∏ x in s, g x :=
Multiset.prod_map_div
#align finset.prod_div_distrib Finset.prod_div_distrib
#align finset.sum_sub_distrib Finset.sum_sub_distrib
+-/
#print Finset.prod_zpow /-
@[to_additive]
@@ -1872,39 +2084,50 @@ section CommGroup
variable [CommGroup β] [DecidableEq α]
+#print Finset.prod_sdiff_eq_div /-
@[simp, to_additive]
theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) : ∏ x in s₂ \ s₁, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x :=
by rw [eq_div_iff_mul_eq', prod_sdiff h]
#align finset.prod_sdiff_eq_div Finset.prod_sdiff_eq_div
#align finset.sum_sdiff_eq_sub Finset.sum_sdiff_eq_sub
+-/
+#print Finset.prod_sdiff_div_prod_sdiff /-
@[to_additive]
theorem prod_sdiff_div_prod_sdiff :
(∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
simp [← Finset.prod_sdiff (@inf_le_left _ _ s₁ s₂), ← Finset.prod_sdiff (@inf_le_right _ _ s₁ s₂)]
#align finset.prod_sdiff_div_prod_sdiff Finset.prod_sdiff_div_prod_sdiff
#align finset.sum_sdiff_sub_sum_sdiff Finset.sum_sdiff_sub_sum_sdiff
+-/
+#print Finset.prod_erase_eq_div /-
@[simp, to_additive]
theorem prod_erase_eq_div {a : α} (h : a ∈ s) : ∏ x in s.eraseₓ a, f x = (∏ x in s, f x) / f a := by
rw [eq_div_iff_mul_eq', prod_erase_mul _ _ h]
#align finset.prod_erase_eq_div Finset.prod_erase_eq_div
#align finset.sum_erase_eq_sub Finset.sum_erase_eq_sub
+-/
end CommGroup
+#print Finset.card_sigma /-
@[simp]
theorem card_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) :
card (s.Sigma t) = ∑ a in s, card (t a) :=
Multiset.card_sigma _ _
#align finset.card_sigma Finset.card_sigma
+-/
+#print Finset.card_disjiUnion /-
@[simp]
theorem card_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
(s.disjUnionₓ t h).card = s.Sum fun i => (t i).card :=
Multiset.card_bind _ _
#align finset.card_disj_Union Finset.card_disjiUnion
+-/
+#print Finset.card_biUnion /-
theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
(h : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → Disjoint (t x) (t y)) :
(s.biUnion t).card = ∑ u in s, card (t u) :=
@@ -1913,6 +2136,7 @@ theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
_ = ∑ a in s, ∑ i in t a, 1 := (Finset.sum_biUnion h)
_ = ∑ u in s, card (t u) := by simp
#align finset.card_bUnion Finset.card_biUnion
+-/
#print Finset.card_biUnion_le /-
theorem card_biUnion_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
@@ -1940,6 +2164,7 @@ theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α)
#align finset.card_eq_sum_card_image Finset.card_eq_sum_card_image
-/
+#print Finset.mem_sum /-
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
b ∈ ∑ x in s, f x ↔ ∃ a ∈ s, b ∈ f a := by
classical
@@ -1947,15 +2172,19 @@ theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
· intro a t hi ih
simp [sum_insert hi, ih, or_and_right, exists_or]
#align finset.mem_sum Finset.mem_sum
+-/
section ProdEqZero
variable [CommMonoidWithZero β]
+#print Finset.prod_eq_zero /-
theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : ∏ x in s, f x = 0 := by
haveI := Classical.decEq α; rw [← prod_erase_mul _ _ ha, h, MulZeroClass.mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
+-/
+#print Finset.prod_boole /-
theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
∏ i in s, ite (p i) (1 : β) (0 : β) = ite (∀ i ∈ s, p i) 1 0 :=
by
@@ -1968,9 +2197,11 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
apply prod_eq_zero hi
rw [if_neg hq]
#align finset.prod_boole Finset.prod_boole
+-/
variable [Nontrivial β] [NoZeroDivisors β]
+#print Finset.prod_eq_zero_iff /-
theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
apply Finset.induction_on s
@@ -1978,19 +2209,24 @@ theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
intro a s ha ih
rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
+-/
+#print Finset.prod_ne_zero_iff /-
theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by rw [Ne, prod_eq_zero_iff];
push_neg
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
+-/
end ProdEqZero
+#print Finset.prod_unique_nonempty /-
@[to_additive]
theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
(h : s.Nonempty) : ∏ x in s, f x = f default := by
rw [h.eq_singleton_default, Finset.prod_singleton]
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
#align finset.sum_unique_nonempty Finset.sum_unique_nonempty
+-/
#print Finset.sum_nat_mod /-
theorem sum_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
@@ -2006,15 +2242,19 @@ theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
#align finset.prod_nat_mod Finset.prod_nat_mod
-/
+#print Finset.sum_int_mod /-
theorem sum_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
(Multiset.sum_int_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]
#align finset.sum_int_mod Finset.sum_int_mod
+-/
+#print Finset.prod_int_mod /-
theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
(Multiset.prod_int_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]
#align finset.prod_int_mod Finset.prod_int_mod
+-/
end Finset
@@ -2022,6 +2262,7 @@ namespace Fintype
open Finset
+#print Fintype.prod_bijective /-
/-- `fintype.prod_bijective` is a variant of `finset.prod_bij` that accepts `function.bijective`.
See `function.bijective.prod_comp` for a version without `h`. -/
@@ -2035,7 +2276,9 @@ theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid
(he.Surjective y).imp fun a h => ⟨mem_univ _, h.symm⟩
#align fintype.prod_bijective Fintype.prod_bijective
#align fintype.sum_bijective Fintype.sum_bijective
+-/
+#print Fintype.prod_equiv /-
/-- `fintype.prod_equiv` is a specialization of `finset.prod_bij` that
automatically fills in most arguments.
@@ -2048,22 +2291,28 @@ theorem prod_equiv {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (
prod_bijective e e.Bijective f g h
#align fintype.prod_equiv Fintype.prod_equiv
#align fintype.sum_equiv Fintype.sum_equiv
+-/
variable {f s}
+#print Fintype.prod_unique /-
@[to_additive]
theorem prod_unique {α β : Type _} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
∏ x : α, f x = f default := by rw [univ_unique, prod_singleton]
#align fintype.prod_unique Fintype.prod_unique
#align fintype.sum_unique Fintype.sum_unique
+-/
+#print Fintype.prod_empty /-
@[to_additive]
theorem prod_empty {α β : Type _} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
∏ x : α, f x = 1 :=
Finset.prod_of_empty _
#align fintype.prod_empty Fintype.prod_empty
#align fintype.sum_empty Fintype.sum_empty
+-/
+#print Fintype.prod_subsingleton /-
@[to_additive]
theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
(a : α) : ∏ x : α, f x = f a :=
@@ -2072,7 +2321,9 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
convert prod_unique f
#align fintype.prod_subsingleton Fintype.prod_subsingleton
#align fintype.sum_subsingleton Fintype.sum_subsingleton
+-/
+#print Fintype.prod_subtype_mul_prod_subtype /-
@[to_additive]
theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
@@ -2085,11 +2336,13 @@ theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid
· simp
#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtype
#align fintype.sum_subtype_add_sum_subtype Fintype.sum_subtype_add_sum_subtype
+-/
end Fintype
namespace List
+#print List.prod_toFinset /-
@[to_additive]
theorem prod_toFinset {M : Type _} [DecidableEq α] [CommMonoid M] (f : α → M) :
∀ {l : List α} (hl : l.Nodup), l.toFinset.Prod f = (l.map f).Prod
@@ -2099,6 +2352,7 @@ theorem prod_toFinset {M : Type _} [DecidableEq α] [CommMonoid M] (f : α → M
simp [Finset.prod_insert (mt list.mem_to_finset.mp not_mem), prod_to_finset hl]
#align list.prod_to_finset List.prod_toFinset
#align list.sum_to_finset List.sum_toFinset
+-/
end List
@@ -2122,6 +2376,7 @@ theorem disjoint_list_sum_right {a : Multiset α} {l : List (Multiset α)} :
#align multiset.disjoint_list_sum_right Multiset.disjoint_list_sum_right
-/
+#print Multiset.disjoint_sum_left /-
theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
Multiset.Disjoint i.Sum a ↔ ∀ b ∈ i, Multiset.Disjoint b a :=
Quotient.inductionOn i fun l =>
@@ -2129,26 +2384,34 @@ theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
rw [quot_mk_to_coe, Multiset.coe_sum]
exact disjoint_list_sum_left
#align multiset.disjoint_sum_left Multiset.disjoint_sum_left
+-/
+#print Multiset.disjoint_sum_right /-
theorem disjoint_sum_right {a : Multiset α} {i : Multiset (Multiset α)} :
Multiset.Disjoint a i.Sum ↔ ∀ b ∈ i, Multiset.Disjoint a b := by
simpa only [disjoint_comm] using disjoint_sum_left
#align multiset.disjoint_sum_right Multiset.disjoint_sum_right
+-/
+#print Multiset.disjoint_finset_sum_left /-
theorem disjoint_finset_sum_left {β : Type _} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
Multiset.Disjoint (i.Sum f) a ↔ ∀ b ∈ i, Multiset.Disjoint (f b) a :=
by
convert (@disjoint_sum_left _ a) (map f i.val)
simp [and_congr_left_iff, iff_self_iff]
#align multiset.disjoint_finset_sum_left Multiset.disjoint_finset_sum_left
+-/
+#print Multiset.disjoint_finset_sum_right /-
theorem disjoint_finset_sum_right {β : Type _} {i : Finset β} {f : β → Multiset α}
{a : Multiset α} : Multiset.Disjoint a (i.Sum f) ↔ ∀ b ∈ i, Multiset.Disjoint a (f b) := by
simpa only [disjoint_comm] using disjoint_finset_sum_left
#align multiset.disjoint_finset_sum_right Multiset.disjoint_finset_sum_right
+-/
variable [DecidableEq α]
+#print Multiset.add_eq_union_left_of_le /-
theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
z + x = z ∪ y ↔ z.Disjoint x ∧ x = y :=
by
@@ -2162,14 +2425,18 @@ theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
· rintro ⟨h0, rfl⟩
exact h0
#align multiset.add_eq_union_left_of_le Multiset.add_eq_union_left_of_le
+-/
+#print Multiset.add_eq_union_right_of_le /-
theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
x + y = x ∪ z ↔ y = z ∧ x.Disjoint y := by
simpa only [and_comm'] using add_eq_union_left_of_le h
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
+-/
/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ∈ » i) -/
/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x y «expr ∈ » i) -/
+#print Multiset.finset_sum_eq_sup_iff_disjoint /-
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
i.Sum f = i.sup f ↔ ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) :=
by
@@ -2186,7 +2453,9 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
and_self_iff]
exact add_eq_union_left_of_le (Finset.sup_le fun x hx => le_sum_of_mem (mem_map_of_mem f hx))
#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjoint
+-/
+#print Multiset.sup_powerset_len /-
theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
(Finset.sup (Finset.range (x.card + 1)) fun k => x.powersetLen k) = x.powerset :=
by
@@ -2195,7 +2464,9 @@ theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
exact
Eq.symm (finset_sum_eq_sup_iff_disjoint.mpr fun _ _ _ _ h => pairwise_disjoint_powerset_len x h)
#align multiset.sup_powerset_len Multiset.sup_powerset_len
+-/
+#print Multiset.toFinset_sum_count_eq /-
@[simp]
theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a = s.card :=
calc
@@ -2204,16 +2475,22 @@ theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a
_ = (s.map fun _ => 1).Sum := (Finset.sum_multiset_map_count _ _).symm
_ = s.card := by simp
#align multiset.to_finset_sum_count_eq Multiset.toFinset_sum_count_eq
+-/
+#print Multiset.count_sum' /-
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
count a (∑ x in s, f x) = ∑ x in s, count a (f x) := by dsimp only [Finset.sum]; rw [count_sum]
#align multiset.count_sum' Multiset.count_sum'
+-/
+#print Multiset.toFinset_sum_count_nsmul_eq /-
@[simp]
theorem toFinset_sum_count_nsmul_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a • {a} = s := by
rw [← Finset.sum_multiset_map_count, Multiset.sum_map_singleton]
#align multiset.to_finset_sum_count_nsmul_eq Multiset.toFinset_sum_count_nsmul_eq
+-/
+#print Multiset.exists_smul_of_dvd_count /-
theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
(h : ∀ a : α, a ∈ s → k ∣ Multiset.count a s) : ∃ u : Multiset α, s = k • u :=
by
@@ -2227,6 +2504,7 @@ theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
rw [← mul_nsmul', Nat.mul_div_cancel' (h x (mem_to_finset.mp hx))]
rw [← Finset.sum_nsmul, h₂, to_finset_sum_count_nsmul_eq]
#align multiset.exists_smul_of_dvd_count Multiset.exists_smul_of_dvd_count
+-/
#print Multiset.toFinset_prod_dvd_prod /-
theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.Prod id ∣ S.Prod :=
@@ -2237,6 +2515,7 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.Pr
#align multiset.to_finset_prod_dvd_prod Multiset.toFinset_prod_dvd_prod
-/
+#print Multiset.prod_sum /-
@[to_additive]
theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
(∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by
@@ -2246,20 +2525,25 @@ theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multise
· rw [Finset.sum_insert hat, Finset.prod_insert hat, Multiset.prod_add, ih]
#align multiset.prod_sum Multiset.prod_sum
#align multiset.sum_sum Multiset.sum_sum
+-/
end Multiset
namespace Nat
+#print Nat.cast_list_sum /-
@[simp, norm_cast]
theorem cast_list_sum [AddMonoidWithOne β] (s : List ℕ) : (↑s.Sum : β) = (s.map coe).Sum :=
map_list_sum (castAddMonoidHom β) _
#align nat.cast_list_sum Nat.cast_list_sum
+-/
+#print Nat.cast_list_prod /-
@[simp, norm_cast]
theorem cast_list_prod [Semiring β] (s : List ℕ) : (↑s.Prod : β) = (s.map coe).Prod :=
map_list_prod (castRingHom β) _
#align nat.cast_list_prod Nat.cast_list_prod
+-/
#print Nat.cast_multiset_sum /-
@[simp, norm_cast]
@@ -2296,54 +2580,71 @@ end Nat
namespace Int
+#print Int.cast_list_sum /-
@[simp, norm_cast]
theorem cast_list_sum [AddGroupWithOne β] (s : List ℤ) : (↑s.Sum : β) = (s.map coe).Sum :=
map_list_sum (castAddHom β) _
#align int.cast_list_sum Int.cast_list_sum
+-/
+#print Int.cast_list_prod /-
@[simp, norm_cast]
theorem cast_list_prod [Ring β] (s : List ℤ) : (↑s.Prod : β) = (s.map coe).Prod :=
map_list_prod (castRingHom β) _
#align int.cast_list_prod Int.cast_list_prod
+-/
+#print Int.cast_multiset_sum /-
@[simp, norm_cast]
theorem cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
(↑s.Sum : β) = (s.map coe).Sum :=
map_multiset_sum (castAddHom β) _
#align int.cast_multiset_sum Int.cast_multiset_sum
+-/
+#print Int.cast_multiset_prod /-
@[simp, norm_cast]
theorem cast_multiset_prod {R : Type _} [CommRing R] (s : Multiset ℤ) :
(↑s.Prod : R) = (s.map coe).Prod :=
map_multiset_prod (castRingHom R) _
#align int.cast_multiset_prod Int.cast_multiset_prod
+-/
+#print Int.cast_sum /-
@[simp, norm_cast]
theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
↑(∑ x in s, f x : ℤ) = ∑ x in s, (f x : β) :=
map_sum (castAddHom β) _ _
#align int.cast_sum Int.cast_sum
+-/
+#print Int.cast_prod /-
@[simp, norm_cast]
theorem cast_prod {R : Type _} [CommRing R] (f : α → ℤ) (s : Finset α) :
(↑(∏ i in s, f i) : R) = ∏ i in s, f i :=
(Int.castRingHom R).map_prod _ _
#align int.cast_prod Int.cast_prod
+-/
end Int
+#print Units.coe_prod /-
@[simp, norm_cast]
theorem Units.coe_prod {M : Type _} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
(↑(∏ i in s, f i) : M) = ∏ i in s, f i :=
(Units.coeHom M).map_prod _ _
#align units.coe_prod Units.coe_prod
+-/
+#print Units.mk0_prod /-
theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h) :
Units.mk0 (∏ b in s, f b) h =
∏ b in s.attach, Units.mk0 (f b) fun hh => h (Finset.prod_eq_zero b.2 hh) :=
by classical induction s using Finset.induction_on <;> simp [*]
#align units.mk0_prod Units.mk0_prod
+-/
+#print nat_abs_sum_le /-
theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
(∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
classical
@@ -2353,6 +2654,7 @@ theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
simp only [his, Finset.sum_insert, not_false_iff]
exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
#align nat_abs_sum_le nat_abs_sum_le
+-/
/-! ### `additive`, `multiplicative` -/
@@ -2414,16 +2716,20 @@ theorem toMul_multiset_sum (s : Multiset (Additive α)) : toMul s.Sum = (s.map t
#align to_mul_multiset_sum toMul_multiset_sum
-/
+#print ofMul_prod /-
@[simp]
theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) = ∑ i in s, ofMul (f i) :=
rfl
#align of_mul_prod ofMul_prod
+-/
+#print toMul_sum /-
@[simp]
theorem toMul_sum (s : Finset ι) (f : ι → Additive α) :
toMul (∑ i in s, f i) = ∏ i in s, toMul (f i) :=
rfl
#align to_mul_sum toMul_sum
+-/
end CommMonoid
@@ -2444,16 +2750,20 @@ theorem toAdd_multiset_sum (s : Multiset (Multiplicative α)) : toAdd s.Prod = (
#align to_add_multiset_sum toAdd_multiset_sum
-/
+#print ofAdd_sum /-
@[simp]
theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) = ∏ i in s, ofAdd (f i) :=
rfl
#align of_add_sum ofAdd_sum
+-/
+#print toAdd_prod /-
@[simp]
theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
toAdd (∏ i in s, f i) = ∑ i in s, toAdd (f i) :=
rfl
#align to_add_prod toAdd_prod
+-/
end AddCommMonoid
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -110,16 +110,16 @@ In practice, this means that parentheses should be placed as follows:
-- mathport name: finset.sum_univ
-scoped[BigOperators] notation3"∑ "(...)", "r:(scoped f => Finset.sum Finset.univ f) => r
+scoped[BigOperators] notation3"∑ "(...)", "r:67:(scoped f => Finset.sum Finset.univ f) => r
-- mathport name: finset.prod_univ
-scoped[BigOperators] notation3"∏ "(...)", "r:(scoped f => Finset.prod Finset.univ f) => r
+scoped[BigOperators] notation3"∏ "(...)", "r:67:(scoped f => Finset.prod Finset.univ f) => r
-- mathport name: finset.sum
-scoped[BigOperators] notation3"∑ "(...)" in "s", "r:(scoped f => Finset.sum s f) => r
+scoped[BigOperators] notation3"∑ "(...)" in "s", "r:67:(scoped f => Finset.sum s f) => r
-- mathport name: finset.prod
-scoped[BigOperators] notation3"∏ "(...)" in "s", "r:(scoped f => Finset.prod s f) => r
+scoped[BigOperators] notation3"∏ "(...)" in "s", "r:67:(scoped f => Finset.prod s f) => r
open scoped BigOperators
@@ -130,7 +130,7 @@ variable {s s₁ s₂ : Finset α} {a : α} {f g : α → β}
#print Finset.prod_eq_multiset_prod /-
@[to_additive]
theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
- (∏ x in s, f x) = (s.1.map f).Prod :=
+ ∏ x in s, f x = (s.1.map f).Prod :=
rfl
#align finset.prod_eq_multiset_prod Finset.prod_eq_multiset_prod
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
@@ -138,7 +138,7 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
- (∏ x in s, f x) = s.fold (· * ·) 1 f :=
+ ∏ x in s, f x = s.fold (· * ·) 1 f :=
rfl
#align finset.prod_eq_fold Finset.prod_eq_fold
#align finset.sum_eq_fold Finset.sum_eq_fold
@@ -247,25 +247,25 @@ section CommMonoid
variable [CommMonoid β]
@[simp, to_additive]
-theorem prod_empty : (∏ x in ∅, f x) = 1 :=
+theorem prod_empty : ∏ x in ∅, f x = 1 :=
rfl
#align finset.prod_empty Finset.prod_empty
#align finset.sum_empty Finset.sum_empty
@[to_additive]
-theorem prod_of_empty [IsEmpty α] (s : Finset α) : (∏ i in s, f i) = 1 := by
+theorem prod_of_empty [IsEmpty α] (s : Finset α) : ∏ i in s, f i = 1 := by
rw [eq_empty_of_is_empty s, prod_empty]
#align finset.prod_of_empty Finset.prod_of_empty
#align finset.sum_of_empty Finset.sum_of_empty
@[simp, to_additive]
-theorem prod_cons (h : a ∉ s) : (∏ x in cons a s h, f x) = f a * ∏ x in s, f x :=
+theorem prod_cons (h : a ∉ s) : ∏ x in cons a s h, f x = f a * ∏ x in s, f x :=
fold_cons h
#align finset.prod_cons Finset.prod_cons
#align finset.sum_cons Finset.sum_cons
@[simp, to_additive]
-theorem prod_insert [DecidableEq α] : a ∉ s → (∏ x in insert a s, f x) = f a * ∏ x in s, f x :=
+theorem prod_insert [DecidableEq α] : a ∉ s → ∏ x in insert a s, f x = f a * ∏ x in s, f x :=
fold_insert
#align finset.prod_insert Finset.prod_insert
#align finset.sum_insert Finset.sum_insert
@@ -277,7 +277,7 @@ the product over `s`, as long as `a` is in `s` or `f a = 1`.
to_additive
"The sum of `f` over `insert a s` is the same as\nthe sum over `s`, as long as `a` is in `s` or `f a = 0`."]
theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a = 1) :
- (∏ x in insert a s, f x) = ∏ x in s, f x :=
+ ∏ x in insert a s, f x = ∏ x in s, f x :=
by
by_cases hm : a ∈ s
· simp_rw [insert_eq_of_mem hm]
@@ -290,14 +290,14 @@ theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a =
@[simp,
to_additive
"The sum of `f` over `insert a s` is the same as\nthe sum over `s`, as long as `f a = 0`."]
-theorem prod_insert_one [DecidableEq α] (h : f a = 1) : (∏ x in insert a s, f x) = ∏ x in s, f x :=
+theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x in insert a s, f x = ∏ x in s, f x :=
prod_insert_of_eq_one_if_not_mem fun _ => h
#align finset.prod_insert_one Finset.prod_insert_one
#align finset.sum_insert_zero Finset.sum_insert_zero
#print Finset.prod_singleton /-
@[simp, to_additive]
-theorem prod_singleton : (∏ x in singleton a, f x) = f a :=
+theorem prod_singleton : ∏ x in singleton a, f x = f a :=
Eq.trans fold_singleton <| mul_one _
#align finset.prod_singleton Finset.prod_singleton
#align finset.sum_singleton Finset.sum_singleton
@@ -305,13 +305,13 @@ theorem prod_singleton : (∏ x in singleton a, f x) = f a :=
@[to_additive]
theorem prod_pair [DecidableEq α] {a b : α} (h : a ≠ b) :
- (∏ x in ({a, b} : Finset α), f x) = f a * f b := by
+ ∏ x in ({a, b} : Finset α), f x = f a * f b := by
rw [prod_insert (not_mem_singleton.2 h), prod_singleton]
#align finset.prod_pair Finset.prod_pair
#align finset.sum_pair Finset.sum_pair
@[simp, to_additive]
-theorem prod_const_one : (∏ x in s, (1 : β)) = 1 := by
+theorem prod_const_one : ∏ x in s, (1 : β) = 1 := by
simp only [Finset.prod, Multiset.map_const, Multiset.prod_replicate, one_pow]
#align finset.prod_const_one Finset.prod_const_one
#align finset.sum_const_zero Finset.sum_const_zero
@@ -319,7 +319,7 @@ theorem prod_const_one : (∏ x in s, (1 : β)) = 1 := by
#print Finset.prod_image /-
@[simp, to_additive]
theorem prod_image [DecidableEq α] {s : Finset γ} {g : γ → α} :
- (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → (∏ x in s.image g, f x) = ∏ x in s, f (g x) :=
+ (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x in s.image g, f x = ∏ x in s, f (g x) :=
fold_image
#align finset.prod_image Finset.prod_image
#align finset.sum_image Finset.sum_image
@@ -327,9 +327,8 @@ theorem prod_image [DecidableEq α] {s : Finset γ} {g : γ → α} :
#print Finset.prod_map /-
@[simp, to_additive]
-theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) :
- (∏ x in s.map e, f x) = ∏ x in s, f (e x) := by
- rw [Finset.prod, Finset.map_val, Multiset.map_map] <;> rfl
+theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) : ∏ x in s.map e, f x = ∏ x in s, f (e x) :=
+ by rw [Finset.prod, Finset.map_val, Multiset.map_map] <;> rfl
#align finset.prod_map Finset.prod_map
#align finset.sum_map Finset.sum_map
-/
@@ -345,14 +344,14 @@ theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.Prod
attribute [congr] Finset.sum_congr
@[to_additive]
-theorem prod_disjUnion (h) : (∏ x in s₁.disjUnion s₂ h, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
- by refine' Eq.trans _ (fold_disj_union h); rw [one_mul]; rfl
+theorem prod_disjUnion (h) : ∏ x in s₁.disjUnion s₂ h, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
+ refine' Eq.trans _ (fold_disj_union h); rw [one_mul]; rfl
#align finset.prod_disj_union Finset.prod_disjUnion
#align finset.sum_disj_union Finset.sum_disjUnion
@[to_additive]
theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
- (∏ x in s.disjUnionₓ t h, f x) = ∏ i in s, ∏ x in t i, f x :=
+ ∏ x in s.disjUnionₓ t h, f x = ∏ i in s, ∏ x in t i, f x :=
by
refine' Eq.trans _ (fold_disj_Union h)
dsimp [Finset.prod, Multiset.prod, Multiset.fold, Finset.disjUnion, Finset.fold]
@@ -363,14 +362,14 @@ theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
@[to_additive]
theorem prod_union_inter [DecidableEq α] :
- ((∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
+ (∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
fold_union_inter
#align finset.prod_union_inter Finset.prod_union_inter
#align finset.sum_union_inter Finset.sum_union_inter
@[to_additive]
theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
- (∏ x in s₁ ∪ s₂, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
+ ∏ x in s₁ ∪ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
rw [← prod_union_inter, disjoint_iff_inter_eq_empty.mp h] <;> exact (mul_one _).symm
#align finset.prod_union Finset.prod_union
#align finset.sum_union Finset.sum_union
@@ -378,7 +377,7 @@ theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
@[to_additive]
theorem prod_filter_mul_prod_filter_not (s : Finset α) (p : α → Prop) [DecidablePred p]
[DecidablePred fun x => ¬p x] (f : α → β) :
- ((∏ x in s.filterₓ p, f x) * ∏ x in s.filterₓ fun x => ¬p x, f x) = ∏ x in s, f x :=
+ (∏ x in s.filterₓ p, f x) * ∏ x in s.filterₓ fun x => ¬p x, f x = ∏ x in s, f x :=
by
haveI := Classical.decEq α
rw [← prod_union (disjoint_filter_filter_neg _ _ p), filter_union_filter_neg_eq]
@@ -398,7 +397,7 @@ end ToList
#print Equiv.Perm.prod_comp /-
@[to_additive]
theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β)
- (hs : {a | σ a ≠ a} ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x := by
+ (hs : {a | σ a ≠ a} ⊆ s) : ∏ x in s, f (σ x) = ∏ x in s, f x := by
convert (Prod_map _ σ.to_embedding _).symm; exact (map_perm hs).symm
#align equiv.perm.prod_comp Equiv.Perm.prod_comp
#align equiv.perm.sum_comp Equiv.Perm.sum_comp
@@ -407,7 +406,7 @@ theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β
#print Equiv.Perm.prod_comp' /-
@[to_additive]
theorem Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
- (hs : {a | σ a ≠ a} ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) := by
+ (hs : {a | σ a ≠ a} ⊆ s) : ∏ x in s, f (σ x) x = ∏ x in s, f x (σ.symm x) := by
convert σ.prod_comp s (fun x => f x (σ.symm x)) hs; ext; rw [Equiv.symm_apply_apply]
#align equiv.perm.prod_comp' Equiv.Perm.prod_comp'
#align equiv.perm.sum_comp' Equiv.Perm.sum_comp'
@@ -425,7 +424,7 @@ variable [Fintype α] [CommMonoid β]
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
- ((∏ i in s, f i) * ∏ i in t, f i) = ∏ i, f i :=
+ (∏ i in s, f i) * ∏ i in t, f i = ∏ i, f i :=
(Finset.prod_disjUnion h.Disjoint).symm.trans <| by
classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top] <;> rfl
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
@@ -444,28 +443,28 @@ For a version expressed with subtypes, see `fintype.prod_subtype_mul_prod_subtyp
@[to_additive
"Adding the sums of a function over `s` and over `sᶜ` gives the whole sum.\nFor a version expressed with subtypes, see `fintype.sum_subtype_add_sum_subtype`. "]
theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
- ((∏ i in s, f i) * ∏ i in sᶜ, f i) = ∏ i, f i :=
+ (∏ i in s, f i) * ∏ i in sᶜ, f i = ∏ i, f i :=
IsCompl.prod_mul_prod isCompl_compl f
#align finset.prod_mul_prod_compl Finset.prod_mul_prod_compl
#align finset.sum_add_sum_compl Finset.sum_add_sum_compl
@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
- ((∏ i in sᶜ, f i) * ∏ i in s, f i) = ∏ i, f i :=
+ (∏ i in sᶜ, f i) * ∏ i in s, f i = ∏ i, f i :=
(@isCompl_compl _ s _).symm.prod_mul_prod f
#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prod
#align finset.sum_compl_add_sum Finset.sum_compl_add_sum
@[to_additive]
theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
- ((∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x) = ∏ x in s₂, f x := by
+ (∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x = ∏ x in s₂, f x := by
rw [← prod_union sdiff_disjoint, sdiff_union_of_subset h]
#align finset.prod_sdiff Finset.prod_sdiff
#align finset.sum_sdiff Finset.sum_sdiff
@[simp, to_additive]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
- (∏ x in s.disjSum t, f x) = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) :=
+ ∏ x in s.disjSum t, f x = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) :=
by
rw [← map_inl_disj_union_map_inr, prod_disj_union, Prod_map, Prod_map]
rfl
@@ -474,13 +473,13 @@ theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
@[to_additive]
theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ → β) :
- (∏ x in s.disjSum t, Sum.elim f g x) = (∏ x in s, f x) * ∏ x in t, g x := by simp
+ ∏ x in s.disjSum t, Sum.elim f g x = (∏ x in s, f x) * ∏ x in t, g x := by simp
#align finset.prod_sum_elim Finset.prod_sum_elim
#align finset.sum_sum_elim Finset.sum_sum_elim
@[to_additive]
theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
- (hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.biUnion t, f x) = ∏ x in s, ∏ i in t x, f i := by
+ (hs : Set.PairwiseDisjoint (↑s) t) : ∏ x in s.biUnion t, f x = ∏ x in s, ∏ i in t x, f i := by
rw [← disj_Union_eq_bUnion _ _ hs, prod_disj_Union]
#align finset.prod_bUnion Finset.prod_biUnion
#align finset.sum_bUnion Finset.sum_biUnion
@@ -490,14 +489,14 @@ in the reverse direction, use `finset.prod_sigma'`. -/
@[to_additive
"Sum over a sigma type equals the sum of fiberwise sums. For rewriting\nin the reverse direction, use `finset.sum_sigma'`"]
theorem prod_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
- (∏ x in s.Sigma t, f x) = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
+ ∏ x in s.Sigma t, f x = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
simp_rw [← disj_Union_map_sigma_mk, prod_disj_Union, Prod_map, Function.Embedding.sigmaMk_apply]
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
@[to_additive]
theorem prod_sigma' {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
- (∏ a in s, ∏ s in t a, f a s) = ∏ x in s.Sigma t, f x.1 x.2 :=
+ ∏ a in s, ∏ s in t a, f a s = ∏ x in s.Sigma t, f x.1 x.2 :=
Eq.symm <| prod_sigma s t fun x => f x.1 x.2
#align finset.prod_sigma' Finset.prod_sigma'
#align finset.sum_sigma' Finset.sum_sigma'
@@ -513,7 +512,7 @@ theorem prod_sigma' {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ
theorem prod_bij {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β} (i : ∀ a ∈ s, γ)
(hi : ∀ a ha, i a ha ∈ t) (h : ∀ a ha, f a = g (i a ha))
(i_inj : ∀ a₁ a₂ ha₁ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
- (i_surj : ∀ b ∈ t, ∃ a ha, b = i a ha) : (∏ x in s, f x) = ∏ x in t, g x :=
+ (i_surj : ∀ b ∈ t, ∃ a ha, b = i a ha) : ∏ x in s, f x = ∏ x in t, g x :=
congr_arg Multiset.prod (Multiset.map_eq_map_of_bij_of_nodup f g s.2 t.2 i hi h i_inj i_surj)
#align finset.prod_bij Finset.prod_bij
#align finset.sum_bij Finset.sum_bij
@@ -530,7 +529,7 @@ theorem prod_bij {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β} (i : ∀ a ∈ s, γ)
(hi : ∀ a ha, i a ha ∈ t) (h : ∀ a ha, f a = g (i a ha)) (j : ∀ a ∈ t, α)
(hj : ∀ a ha, j a ha ∈ s) (left_inv : ∀ a ha, j (i a ha) (hi a ha) = a)
- (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) : (∏ x in s, f x) = ∏ x in t, g x :=
+ (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) : ∏ x in s, f x = ∏ x in t, g x :=
by
refine' prod_bij i hi h _ _
· intro a1 a2 h1 h2 eq; rw [← left_inv a1 h1, ← left_inv a2 h2]; cc
@@ -544,7 +543,7 @@ See `equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@[to_additive
" Reindexing a sum over a finset along an equivalence.\nSee `equiv.sum_comp` for the version where `s` and `s'` are `univ`. "]
theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι' → β) {s' : Finset ι'}
- {s : Finset ι} (h : s = s'.image e.symm) : (∏ i' in s', f i') = ∏ i in s, f (e i) :=
+ {s : Finset ι} (h : s = s'.image e.symm) : ∏ i' in s', f i' = ∏ i in s, f (e i) :=
by
rw [h]
refine'
@@ -560,7 +559,7 @@ theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι'
@[to_additive]
theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ × α → β} :
- (∏ p in r, f p) = ∏ c in s, ∏ a in t c, f (c, a) :=
+ ∏ p in r, f p = ∏ c in s, ∏ a in t c, f (c, a) :=
by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.1, p.2))
exact
@@ -575,7 +574,7 @@ theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ →
@[to_additive]
theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ → α → β} :
- (∏ p in r, f p.1 p.2) = ∏ c in s, ∏ a in t c, f c a :=
+ ∏ p in r, f p.1 p.2 = ∏ c in s, ∏ a in t c, f c a :=
prod_finset_product r s t h
#align finset.prod_finset_product' Finset.prod_finset_product'
#align finset.sum_finset_product' Finset.sum_finset_product'
@@ -585,7 +584,7 @@ theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ →
@[to_additive]
theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α × γ → β} :
- (∏ p in r, f p) = ∏ c in s, ∏ a in t c, f (a, c) :=
+ ∏ p in r, f p = ∏ c in s, ∏ a in t c, f (a, c) :=
by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.2, p.1))
exact
@@ -600,7 +599,7 @@ theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t :
@[to_additive]
theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α → γ → β} :
- (∏ p in r, f p.1 p.2) = ∏ c in s, ∏ a in t c, f a c :=
+ ∏ p in r, f p.1 p.2 = ∏ c in s, ∏ a in t c, f a c :=
prod_finset_product_right r s t h
#align finset.prod_finset_product_right' Finset.prod_finset_product_right'
#align finset.sum_finset_product_right' Finset.sum_finset_product_right'
@@ -611,7 +610,7 @@ theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t :
@[to_additive]
theorem prod_fiberwise_of_maps_to [DecidableEq γ] {s : Finset α} {t : Finset γ} {g : α → γ}
(h : ∀ x ∈ s, g x ∈ t) (f : α → β) :
- (∏ y in t, ∏ x in s.filterₓ fun x => g x = y, f x) = ∏ x in s, f x :=
+ ∏ y in t, ∏ x in s.filterₓ fun x => g x = y, f x = ∏ x in s, f x :=
by
rw [← disj_Union_filter_eq_of_maps_to h]
rw [prod_disj_Union]
@@ -623,9 +622,9 @@ theorem prod_fiberwise_of_maps_to [DecidableEq γ] {s : Finset α} {t : Finset
@[to_additive]
theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ → β)
(eq : ∀ c ∈ s, f (g c) = ∏ x in s.filterₓ fun c' => g c' = g c, h x) :
- (∏ x in s.image g, f x) = ∏ x in s, h x :=
+ ∏ x in s.image g, f x = ∏ x in s, h x :=
calc
- (∏ x in s.image g, f x) = ∏ x in s.image g, ∏ x in s.filterₓ fun c' => g c' = x, h x :=
+ ∏ x in s.image g, f x = ∏ x in s.image g, ∏ x in s.filterₓ fun c' => g c' = x, h x :=
prod_congr rfl fun x hx =>
let ⟨c, hcs, hc⟩ := mem_image.1 hx
hc ▸ Eq c hcs
@@ -635,7 +634,7 @@ theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ →
-/
@[to_additive]
-theorem prod_mul_distrib : (∏ x in s, f x * g x) = (∏ x in s, f x) * ∏ x in s, g x :=
+theorem prod_mul_distrib : ∏ x in s, f x * g x = (∏ x in s, f x) * ∏ x in s, g x :=
Eq.trans (by rw [one_mul] <;> rfl) fold_op_distrib
#align finset.prod_mul_distrib Finset.prod_mul_distrib
#align finset.sum_add_distrib Finset.sum_add_distrib
@@ -645,7 +644,7 @@ theorem prod_mul_distrib : (∏ x in s, f x * g x) = (∏ x in s, f x) * ∏ x i
#print Finset.prod_product /-
@[to_additive]
theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- (∏ x in s ×ˢ t, f x) = ∏ x in s, ∏ y in t, f (x, y) :=
+ ∏ x in s ×ˢ t, f x = ∏ x in s, ∏ y in t, f (x, y) :=
prod_finset_product (s ×ˢ t) s (fun a => t) fun p => mem_product
#align finset.prod_product Finset.prod_product
#align finset.sum_product Finset.sum_product
@@ -656,7 +655,7 @@ theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
/-- An uncurried version of `finset.prod_product`. -/
@[to_additive "An uncurried version of `finset.sum_product`"]
theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s ×ˢ t, f x.1 x.2) = ∏ x in s, ∏ y in t, f x y :=
+ ∏ x in s ×ˢ t, f x.1 x.2 = ∏ x in s, ∏ y in t, f x y :=
prod_product
#align finset.prod_product' Finset.prod_product'
#align finset.sum_product' Finset.sum_product'
@@ -667,7 +666,7 @@ theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
#print Finset.prod_product_right /-
@[to_additive]
theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- (∏ x in s ×ˢ t, f x) = ∏ y in t, ∏ x in s, f (x, y) :=
+ ∏ x in s ×ˢ t, f x = ∏ y in t, ∏ x in s, f (x, y) :=
prod_finset_product_right (s ×ˢ t) t (fun a => s) fun p => mem_product.trans and_comm
#align finset.prod_product_right Finset.prod_product_right
#align finset.sum_product_right Finset.sum_product_right
@@ -678,7 +677,7 @@ theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β}
/-- An uncurried version of `finset.prod_product_right`. -/
@[to_additive "An uncurried version of `finset.prod_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s ×ˢ t, f x.1 x.2) = ∏ y in t, ∏ x in s, f x y :=
+ ∏ x in s ×ˢ t, f x.1 x.2 = ∏ y in t, ∏ x in s, f x y :=
prod_product_right
#align finset.prod_product_right' Finset.prod_product_right'
#align finset.sum_product_right' Finset.sum_product_right'
@@ -691,7 +690,7 @@ variable. -/
"Generalization of `finset.sum_comm` to the case when the inner `finset`s depend on\nthe outer variable."]
theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' : α → Finset γ}
(h : ∀ x y, x ∈ s ∧ y ∈ t x ↔ x ∈ s' y ∧ y ∈ t') {f : γ → α → β} :
- (∏ x in s, ∏ y in t x, f x y) = ∏ y in t', ∏ x in s' y, f x y := by
+ ∏ x in s, ∏ y in t x, f x y = ∏ y in t', ∏ x in s' y, f x y := by
classical
have :
∀ z : γ × α,
@@ -707,7 +706,7 @@ theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' :
#print Finset.prod_comm /-
@[to_additive]
theorem prod_comm {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s, ∏ y in t, f x y) = ∏ y in t, ∏ x in s, f x y :=
+ ∏ x in s, ∏ y in t, f x y = ∏ y in t, ∏ x in s, f x y :=
prod_comm' fun _ _ => Iff.rfl
#align finset.prod_comm Finset.prod_comm
#align finset.sum_comm Finset.sum_comm
@@ -722,16 +721,16 @@ theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g
#align finset.sum_hom_rel Finset.sum_hom_rel
@[to_additive]
-theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : (∏ x in s, f x) = 1 :=
+theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x in s, f x = 1 :=
calc
- (∏ x in s, f x) = ∏ x in s, 1 := Finset.prod_congr rfl h
+ ∏ x in s, f x = ∏ x in s, 1 := Finset.prod_congr rfl h
_ = 1 := Finset.prod_const_one
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
@[to_additive]
theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
- (hfg : ∀ x ∈ s₁, f x = g x) : (∏ i in s₁, f i) = ∏ i in s₂, g i :=
+ (hfg : ∀ x ∈ s₁, f x = g x) : ∏ i in s₁, f i = ∏ i in s₂, g i :=
by
rw [← prod_sdiff h, prod_eq_one hg, one_mul]
exact prod_congr rfl hfg
@@ -740,7 +739,7 @@ theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀
@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
- (∏ x in s₁, f x) = ∏ x in s₂, f x :=
+ ∏ x in s₁, f x = ∏ x in s₂, f x :=
haveI := Classical.decEq α
prod_subset_one_on_sdiff h (by simpa) fun _ _ => rfl
#align finset.prod_subset Finset.prod_subset
@@ -748,7 +747,7 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
- (∏ x in s.filterₓ p, f x) = ∏ x in s, f x :=
+ ∏ x in s.filterₓ p, f x = ∏ x in s, f x :=
prod_subset (filter_subset _ _) fun x => by
classical
rw [not_imp_comm, mem_filter]
@@ -760,16 +759,16 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
-- instance first; `{∀ x, decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
theorem prod_filter_ne_one [∀ x, Decidable (f x ≠ 1)] :
- (∏ x in s.filterₓ fun x => f x ≠ 1, f x) = ∏ x in s, f x :=
+ ∏ x in s.filterₓ fun x => f x ≠ 1, f x = ∏ x in s, f x :=
prod_filter_of_ne fun _ _ => id
#align finset.prod_filter_ne_one Finset.prod_filter_ne_one
#align finset.sum_filter_ne_zero Finset.sum_filter_ne_zero
@[to_additive]
theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
- (∏ a in s.filterₓ p, f a) = ∏ a in s, if p a then f a else 1 :=
+ ∏ a in s.filterₓ p, f a = ∏ a in s, if p a then f a else 1 :=
calc
- (∏ a in s.filterₓ p, f a) = ∏ a in s.filterₓ p, if p a then f a else 1 :=
+ ∏ a in s.filterₓ p, f a = ∏ a in s.filterₓ p, if p a then f a else 1 :=
prod_congr rfl fun a h => by rw [if_pos (mem_filter.1 h).2]
_ = ∏ a in s, if p a then f a else 1 :=
by
@@ -781,11 +780,11 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
@[to_additive]
theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a ∈ s)
- (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : (∏ x in s, f x) = f a :=
+ (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x in s, f x = f a :=
by
haveI := Classical.decEq α
calc
- (∏ x in s, f x) = ∏ x in {a}, f x :=
+ ∏ x in s, f x = ∏ x in {a}, f x :=
by
refine' (prod_subset _ _).symm
· intro _ H; rwa [mem_singleton.1 H]
@@ -796,7 +795,7 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
@[to_additive]
theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
- (h₁ : a ∉ s → f a = 1) : (∏ x in s, f x) = f a :=
+ (h₁ : a ∉ s → f a = 1) : ∏ x in s, f x = f a :=
haveI := Classical.decEq α
by_cases (fun this : a ∈ s => prod_eq_single_of_mem a this h₀) fun this : a ∉ s =>
(prod_congr rfl fun b hb => h₀ b hb <| by rintro rfl <;> cc).trans <|
@@ -806,7 +805,7 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
- (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : (∏ x in s, f x) = f a * f b :=
+ (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x in s, f x = f a * f b :=
by
haveI := Classical.decEq α <;> let s' := ({a, b} : Finset α)
have hu : s' ⊆ s := by refine' insert_subset.mpr _; apply And.intro ha;
@@ -828,7 +827,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
@[to_additive]
theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) :
- (∏ x in s, f x) = f a * f b :=
+ ∏ x in s, f x = f a * f b :=
by
haveI := Classical.decEq α <;> by_cases h₁ : a ∈ s <;> by_cases h₂ : b ∈ s
· exact prod_eq_mul_of_mem a b h₁ h₂ hn h₀
@@ -849,10 +848,10 @@ theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
#print Finset.prod_attach /-
@[to_additive]
-theorem prod_attach {f : α → β} : (∏ x in s.attach, f x) = ∏ x in s, f x :=
+theorem prod_attach {f : α → β} : ∏ x in s.attach, f x = ∏ x in s, f x :=
haveI := Classical.decEq α
calc
- (∏ x in s.attach, f x.val) = ∏ x in s.attach.image Subtype.val, f x := by
+ ∏ x in s.attach, f x.val = ∏ x in s.attach.image Subtype.val, f x := by
rw [prod_image] <;> exact fun x _ y _ => Subtype.eq
_ = _ := by rw [attach_image_val]
#align finset.prod_attach Finset.prod_attach
@@ -863,7 +862,7 @@ theorem prod_attach {f : α → β} : (∏ x in s.attach, f x) = ∏ x in s, f x
/-- A product over `s.subtype p` equals one over `s.filter p`. -/
@[simp, to_additive "A sum over `s.subtype p` equals one over `s.filter p`."]
theorem prod_subtype_eq_prod_filter (f : α → β) {p : α → Prop} [DecidablePred p] :
- (∏ x in s.Subtype p, f x) = ∏ x in s.filterₓ p, f x :=
+ ∏ x in s.Subtype p, f x = ∏ x in s.filterₓ p, f x :=
by
conv_lhs => erw [← Prod_map (s.subtype p) (Function.Embedding.subtype _) f]
exact prod_congr (subtype_map _) fun x hx => rfl
@@ -877,7 +876,7 @@ over `s.subtype p` equals that product over `s`. -/
@[to_additive
"If all elements of a `finset` satisfy the predicate `p`, a sum\nover `s.subtype p` equals that sum over `s`."]
theorem prod_subtype_of_mem (f : α → β) {p : α → Prop} [DecidablePred p] (h : ∀ x ∈ s, p x) :
- (∏ x in s.Subtype p, f x) = ∏ x in s, f x := by
+ ∏ x in s.Subtype p, f x = ∏ x in s, f x := by
simp_rw [prod_subtype_eq_prod_filter, filter_true_of_mem h]
#align finset.prod_subtype_of_mem Finset.prod_subtype_of_mem
#align finset.sum_subtype_of_mem Finset.sum_subtype_of_mem
@@ -891,7 +890,7 @@ function on that `finset`. -/
"A sum of a function over a `finset` in a subtype equals a\nsum in the main type of a function that agrees with the first\nfunction on that `finset`."]
theorem prod_subtype_map_embedding {p : α → Prop} {s : Finset { x // p x }} {f : { x // p x } → β}
{g : α → β} (h : ∀ x : { x // p x }, x ∈ s → g x = f x) :
- (∏ x in s.map (Function.Embedding.subtype _), g x) = ∏ x in s, f x :=
+ ∏ x in s.map (Function.Embedding.subtype _), g x = ∏ x in s, f x :=
by
rw [Finset.prod_map]
exact Finset.prod_congr rfl h
@@ -903,7 +902,7 @@ variable (f s)
#print Finset.prod_coe_sort_eq_attach /-
@[to_additive]
-theorem prod_coe_sort_eq_attach (f : s → β) : (∏ i : s, f i) = ∏ i in s.attach, f i :=
+theorem prod_coe_sort_eq_attach (f : s → β) : ∏ i : s, f i = ∏ i in s.attach, f i :=
rfl
#align finset.prod_coe_sort_eq_attach Finset.prod_coe_sort_eq_attach
#align finset.sum_coe_sort_eq_attach Finset.sum_coe_sort_eq_attach
@@ -911,7 +910,7 @@ theorem prod_coe_sort_eq_attach (f : s → β) : (∏ i : s, f i) = ∏ i in s.a
#print Finset.prod_coe_sort /-
@[to_additive]
-theorem prod_coe_sort : (∏ i : s, f i) = ∏ i in s, f i :=
+theorem prod_coe_sort : ∏ i : s, f i = ∏ i in s, f i :=
prod_attach
#align finset.prod_coe_sort Finset.prod_coe_sort
#align finset.sum_coe_sort Finset.sum_coe_sort
@@ -919,7 +918,7 @@ theorem prod_coe_sort : (∏ i : s, f i) = ∏ i in s, f i :=
#print Finset.prod_finset_coe /-
@[to_additive]
-theorem prod_finset_coe (f : α → β) (s : Finset α) : (∏ i : (s : Set α), f i) = ∏ i in s, f i :=
+theorem prod_finset_coe (f : α → β) (s : Finset α) : ∏ i : (s : Set α), f i = ∏ i in s, f i :=
prod_coe_sort s f
#align finset.prod_finset_coe Finset.prod_finset_coe
#align finset.sum_finset_coe Finset.sum_finset_coe
@@ -930,7 +929,7 @@ variable {f s}
#print Finset.prod_subtype /-
@[to_additive]
theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α) (h : ∀ x, x ∈ s ↔ p x)
- (f : α → β) : (∏ a in s, f a) = ∏ a : Subtype p, f a :=
+ (f : α → β) : ∏ a in s, f a = ∏ a : Subtype p, f a :=
by
have : (· ∈ s) = p := Set.ext h
subst p
@@ -961,11 +960,11 @@ theorem prod_congr_set {α : Type _} [CommMonoid α] {β : Type _} [Fintype β]
@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
[DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
- (∏ x in s, h (if hx : p x then f x hx else g x hx)) =
+ ∏ x in s, h (if hx : p x then f x hx else g x hx) =
(∏ x in (s.filterₓ p).attach, h (f x.1 (mem_filter.mp x.2).2)) *
∏ x in (s.filterₓ fun x => ¬p x).attach, h (g x.1 (mem_filter.mp x.2).2) :=
calc
- (∏ x in s, h (if hx : p x then f x hx else g x hx)) =
+ ∏ x in s, h (if hx : p x then f x hx else g x hx) =
(∏ x in s.filterₓ p, h (if hx : p x then f x hx else g x hx)) *
∏ x in s.filterₓ fun x => ¬p x, h (if hx : p x then f x hx else g x hx) :=
(prod_filter_mul_prod_filter_not s p _).symm
@@ -984,7 +983,7 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
@[to_additive]
theorem prod_apply_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → γ)
(h : γ → β) :
- (∏ x in s, h (if p x then f x else g x)) =
+ ∏ x in s, h (if p x then f x else g x) =
(∏ x in s.filterₓ p, h (f x)) * ∏ x in s.filterₓ fun x => ¬p x, h (g x) :=
trans (prod_apply_dite _ _ _)
(congr_arg₂ _ (@prod_attach _ _ _ _ (h ∘ f)) (@prod_attach _ _ _ _ (h ∘ g)))
@@ -1030,7 +1029,7 @@ theorem prod_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α →
#print Finset.prod_apply_ite_of_false /-
@[to_additive]
theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
- (h : ∀ x ∈ s, ¬p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (g x) := by
+ (h : ∀ x ∈ s, ¬p x) : ∏ x in s, k (if p x then f x else g x) = ∏ x in s, k (g x) := by
simp_rw [apply_ite k]; exact prod_ite_of_false _ _ h
#align finset.prod_apply_ite_of_false Finset.prod_apply_ite_of_false
#align finset.sum_apply_ite_of_false Finset.sum_apply_ite_of_false
@@ -1039,7 +1038,7 @@ theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g :
#print Finset.prod_apply_ite_of_true /-
@[to_additive]
theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
- (h : ∀ x ∈ s, p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (f x) := by
+ (h : ∀ x ∈ s, p x) : ∏ x in s, k (if p x then f x else g x) = ∏ x in s, k (f x) := by
simp_rw [apply_ite k]; exact prod_ite_of_true _ _ h
#align finset.prod_apply_ite_of_true Finset.prod_apply_ite_of_true
#align finset.sum_apply_ite_of_true Finset.sum_apply_ite_of_true
@@ -1087,7 +1086,7 @@ theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
@[simp, to_additive]
theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
- (∏ x in s, ite (a = x) (b x) 1) = ite (a ∈ s) (b a) 1 :=
+ ∏ x in s, ite (a = x) (b x) 1 = ite (a ∈ s) (b a) 1 :=
prod_dite_eq s a fun x _ => b x
#align finset.prod_ite_eq Finset.prod_ite_eq
#align finset.sum_ite_eq Finset.sum_ite_eq
@@ -1100,7 +1099,7 @@ The difference with `finset.prod_ite_eq` is that the arguments to `eq` are swapp
to_additive
"A sum taken over a conditional whose condition is an equality test on the index\nand whose alternative is `0` has value either the term at that index or `0`.\n\nThe difference with `finset.sum_ite_eq` is that the arguments to `eq` are swapped."]
theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
- (∏ x in s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1 :=
+ ∏ x in s, ite (x = a) (b x) 1 = ite (a ∈ s) (b a) 1 :=
prod_dite_eq' s a fun x _ => b x
#align finset.prod_ite_eq' Finset.prod_ite_eq'
#align finset.sum_ite_eq' Finset.sum_ite_eq'
@@ -1108,7 +1107,7 @@ theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
#print Finset.prod_ite_index /-
@[to_additive]
theorem prod_ite_index (p : Prop) [Decidable p] (s t : Finset α) (f : α → β) :
- (∏ x in if p then s else t, f x) = if p then ∏ x in s, f x else ∏ x in t, f x :=
+ ∏ x in if p then s else t, f x = if p then ∏ x in s, f x else ∏ x in t, f x :=
apply_ite (fun s => ∏ x in s, f x) _ _ _
#align finset.prod_ite_index Finset.prod_ite_index
#align finset.sum_ite_index Finset.sum_ite_index
@@ -1135,7 +1134,7 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
@[simp, to_additive]
theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
- (∏ a' in s, Pi.mulSingle a x a') = if a ∈ s then x else 1 :=
+ ∏ a' in s, Pi.mulSingle a x a' = if a ∈ s then x else 1 :=
prod_dite_eq' _ _ _
#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
@@ -1143,7 +1142,7 @@ theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
@[simp, to_additive]
theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
(f : ∀ a, β a) (s : Finset α) :
- (∏ a' in s, Pi.mulSingle a' (f a') a) = if a ∈ s then f a else 1 :=
+ ∏ a' in s, Pi.mulSingle a' (f a') a = if a ∈ s then f a else 1 :=
prod_dite_eq _ _ _
#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
#align finset.sum_pi_single Finset.sum_pi_single
@@ -1153,10 +1152,10 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
(i_inj : ∀ a₁ a₂ h₁₁ h₁₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
- (∏ x in s, f x) = ∏ x in t, g x := by
+ ∏ x in s, f x = ∏ x in t, g x := by
classical exact
calc
- (∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
+ ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
_ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
(prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
(fun a ha =>
@@ -1197,13 +1196,13 @@ theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
-/
@[to_additive]
-theorem nonempty_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : s.Nonempty :=
+theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
s.eq_empty_or_nonempty.elim (fun H => False.elim <| h <| H.symm ▸ prod_empty) id
#align finset.nonempty_of_prod_ne_one Finset.nonempty_of_prod_ne_one
#align finset.nonempty_of_sum_ne_zero Finset.nonempty_of_sum_ne_zero
@[to_additive]
-theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
+theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
rw [← prod_filter_ne_one] at h
rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
@@ -1213,21 +1212,21 @@ theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s
@[to_additive]
theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
- (∏ x in range (n + 1), f x) = f n * ∏ x in range n, f x := by
+ ∏ x in range (n + 1), f x = f n * ∏ x in range n, f x := by
rw [range_succ, prod_insert not_mem_range_self]
#align finset.prod_range_succ_comm Finset.prod_range_succ_comm
#align finset.sum_range_succ_comm Finset.sum_range_succ_comm
@[to_additive]
theorem prod_range_succ (f : ℕ → β) (n : ℕ) :
- (∏ x in range (n + 1), f x) = (∏ x in range n, f x) * f n := by
+ ∏ x in range (n + 1), f x = (∏ x in range n, f x) * f n := by
simp only [mul_comm, prod_range_succ_comm]
#align finset.prod_range_succ Finset.prod_range_succ
#align finset.sum_range_succ Finset.sum_range_succ
@[to_additive]
theorem prod_range_succ' (f : ℕ → β) :
- ∀ n : ℕ, (∏ k in range (n + 1), f k) = (∏ k in range n, f (k + 1)) * f 0
+ ∀ n : ℕ, ∏ k in range (n + 1), f k = (∏ k in range n, f (k + 1)) * f 0
| 0 => prod_range_succ _ _
| n + 1 => by rw [prod_range_succ _ n, mul_right_comm, ← prod_range_succ', prod_range_succ]
#align finset.prod_range_succ' Finset.prod_range_succ'
@@ -1235,7 +1234,7 @@ theorem prod_range_succ' (f : ℕ → β) :
@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
- (∏ k in range (n + 1), u k) = ∏ k in range (N + 1), u k :=
+ ∏ k in range (n + 1), u k = ∏ k in range (N + 1), u k :=
by
obtain ⟨m, rfl : n = N + m⟩ := le_iff_exists_add.mp hn
clear hn
@@ -1248,7 +1247,7 @@ theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u
@[to_additive]
theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
- (∏ x in range (n + m), f x) = (∏ x in range n, f x) * ∏ x in range m, f (n + x) :=
+ ∏ x in range (n + m), f x = (∏ x in range n, f x) * ∏ x in range m, f (n + x) :=
by
induction' m with m hm
· simp
@@ -1258,19 +1257,19 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
@[to_additive]
theorem prod_range_add_div_prod_range {α : Type _} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
- ((∏ k in range (n + m), f k) / ∏ k in range n, f k) = ∏ k in Finset.range m, f (n + k) :=
+ (∏ k in range (n + m), f k) / ∏ k in range n, f k = ∏ k in Finset.range m, f (n + k) :=
div_eq_of_eq_mul' (prod_range_add f n m)
#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_range
#align finset.sum_range_add_sub_sum_range Finset.sum_range_add_sub_sum_range
@[to_additive]
-theorem prod_range_zero (f : ℕ → β) : (∏ k in range 0, f k) = 1 := by rw [range_zero, prod_empty]
+theorem prod_range_zero (f : ℕ → β) : ∏ k in range 0, f k = 1 := by rw [range_zero, prod_empty]
#align finset.prod_range_zero Finset.prod_range_zero
#align finset.sum_range_zero Finset.sum_range_zero
#print Finset.prod_range_one /-
@[to_additive sum_range_one]
-theorem prod_range_one (f : ℕ → β) : (∏ k in range 1, f k) = f 0 := by rw [range_one];
+theorem prod_range_one (f : ℕ → β) : ∏ k in range 1, f k = f 0 := by rw [range_one];
apply @prod_singleton β ℕ 0 f
#align finset.prod_range_one Finset.prod_range_one
#align finset.sum_range_one Finset.sum_range_one
@@ -1318,7 +1317,7 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
#print Finset.sum_filter_count_eq_countp /-
theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
- (∑ x in l.toFinset.filterₓ p, l.count x) = l.countp p := by
+ ∑ x in l.toFinset.filterₓ p, l.count x = l.countp p := by
simp [Finset.sum, sum_map_count_dedup_filter_eq_countp p l]
#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countp
-/
@@ -1357,7 +1356,7 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
#print Finset.prod_mem_multiset /-
@[to_additive]
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
- (hfg : ∀ x, f x = g x) : (∏ x : { x // x ∈ m }, f x) = ∏ x in m.toFinset, g x :=
+ (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x in m.toFinset, g x :=
prod_bij (fun x _ => x.1) (fun x _ => Multiset.mem_toFinset.mpr x.2) (fun _ _ => hfg _)
(fun _ _ _ _ h => by ext; assumption) fun y hy =>
⟨⟨y, Multiset.mem_toFinset.mp hy⟩, Finset.mem_univ _, rfl⟩
@@ -1397,7 +1396,7 @@ This is a multiplicative discrete analogue of the fundamental theorem of calculu
@[to_additive
"For any sum along `{0, ..., n - 1}` of a commutative-monoid-valued function, we can\nverify that it's equal to a different function just by checking differences of adjacent terms.\n\nThis is a discrete analogue of the fundamental theorem of calculus."]
theorem prod_range_induction (f s : ℕ → β) (h0 : s 0 = 1) (h : ∀ n, s (n + 1) = s n * f n) (n : ℕ) :
- (∏ k in Finset.range n, f k) = s n :=
+ ∏ k in Finset.range n, f k = s n :=
by
induction' n with k hk
· simp only [h0, Finset.prod_range_zero]
@@ -1410,13 +1409,13 @@ the ratio of the last and first factors. -/
@[to_additive
"A telescoping sum along `{0, ..., n - 1}` of an additive commutative group valued\nfunction reduces to the difference of the last and first terms."]
theorem prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- (∏ i in range n, f (i + 1) / f i) = f n / f 0 := by apply prod_range_induction <;> simp
+ ∏ i in range n, f (i + 1) / f i = f n / f 0 := by apply prod_range_induction <;> simp
#align finset.prod_range_div Finset.prod_range_div
#align finset.sum_range_sub Finset.sum_range_sub
@[to_additive]
theorem prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- (∏ i in range n, f i / f (i + 1)) = f 0 / f n := by apply prod_range_induction <;> simp
+ ∏ i in range n, f i / f (i + 1) = f 0 / f n := by apply prod_range_induction <;> simp
#align finset.prod_range_div' Finset.prod_range_div'
#align finset.sum_range_sub' Finset.sum_range_sub'
@@ -1439,7 +1438,7 @@ when the function we are summing is monotone.
-/
theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
[ContravariantClass α α (· + ·) (· ≤ ·)] {f : ℕ → α} (h : Monotone f) (n : ℕ) :
- (∑ i in range n, f (i + 1) - f i) = f n - f 0 :=
+ ∑ i in range n, (f (i + 1) - f i) = f n - f 0 :=
by
refine' sum_range_induction _ _ (tsub_self _) (fun n => _) _
have h₁ : f n ≤ f (n + 1) := h (Nat.le_succ _)
@@ -1449,7 +1448,7 @@ theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
#print Finset.prod_const /-
@[simp, to_additive]
-theorem prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
+theorem prod_const (b : β) : ∏ x in s, b = b ^ s.card :=
(congr_arg _ <| s.val.mapConst b).trans <| Multiset.prod_replicate s.card b
#align finset.prod_const Finset.prod_const
#align finset.sum_const Finset.sum_const
@@ -1457,7 +1456,7 @@ theorem prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
#print Finset.prod_eq_pow_card /-
@[to_additive sum_eq_card_nsmul]
-theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : (∏ a in s, f a) = b ^ s.card :=
+theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : ∏ a in s, f a = b ^ s.card :=
(prod_congr rfl hf).trans <| prod_const _
#align finset.prod_eq_pow_card Finset.prod_eq_pow_card
#align finset.sum_eq_card_nsmul Finset.sum_eq_card_nsmul
@@ -1472,7 +1471,7 @@ theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ k in range n, b := by si
#print Finset.prod_pow /-
@[to_additive]
-theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : (∏ x in s, f x ^ n) = (∏ x in s, f x) ^ n :=
+theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x in s, f x ^ n = (∏ x in s, f x) ^ n :=
Multiset.prod_map_pow
#align finset.prod_pow Finset.prod_pow
#align finset.sum_nsmul Finset.sum_nsmul
@@ -1481,7 +1480,7 @@ theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : (∏ x in s, f x ^
#print Finset.prod_flip /-
@[to_additive]
theorem prod_flip {n : ℕ} (f : ℕ → β) :
- (∏ r in range (n + 1), f (n - r)) = ∏ k in range (n + 1), f k :=
+ ∏ r in range (n + 1), f (n - r) = ∏ k in range (n + 1), f k :=
by
induction' n with n ih
· rw [prod_range_one, prod_range_one]
@@ -1495,7 +1494,7 @@ theorem prod_flip {n : ℕ} (f : ℕ → β) :
theorem prod_involution {s : Finset α} {f : α → β} :
∀ (g : ∀ a ∈ s, α) (h : ∀ a ha, f a * f (g a ha) = 1) (g_ne : ∀ a ha, f a ≠ 1 → g a ha ≠ a)
(g_mem : ∀ a ha, g a ha ∈ s) (g_inv : ∀ a ha, g (g a ha) (g_mem a ha) = a),
- (∏ x in s, f x) = 1 :=
+ ∏ x in s, f x = 1 :=
by
haveI := Classical.decEq α <;> haveI := Classical.decEq β <;>
exact
@@ -1505,7 +1504,7 @@ theorem prod_involution {s : Finset α} {f : α → β} :
mem_of_mem_erase (mem_of_mem_erase hy)
have g_inj : ∀ {x hx y hy}, g x hx = g y hy → x = y := fun x hx y hy h => by
rw [← g_inv x hx, ← g_inv y hy] <;> simp [h]
- have ih' : (∏ y in erase (erase s x) (g x hx), f y) = (1 : β) :=
+ have ih' : ∏ y in erase (erase s x) (g x hx), f y = (1 : β) :=
ih ((s.eraseₓ x).eraseₓ (g x hx))
⟨subset.trans (erase_subset _ _) (erase_subset _ _), fun h =>
not_mem_erase (g x hx) (s.eraseₓ x) (h (g_mem x hx))⟩
@@ -1540,9 +1539,9 @@ theorem prod_involution {s : Finset α} {f : α → β} :
@[to_additive
"The sum of the composition of functions `f` and `g`, is the sum over `b ∈ s.image g`\nof `f b` times of the cardinality of the fibre of `b`. See also `finset.sum_image`."]
theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
- (∏ a in s, f (g a)) = ∏ b in s.image g, f b ^ (s.filterₓ fun a => g a = b).card :=
+ ∏ a in s, f (g a) = ∏ b in s.image g, f b ^ (s.filterₓ fun a => g a = b).card :=
calc
- (∏ a in s, f (g a)) =
+ ∏ a in s, f (g a) =
∏ x in (s.image g).Sigma fun b : γ => s.filterₓ fun a => g a = b, f (g x.2) :=
prod_bij (fun a ha => ⟨g a, a⟩) (by simp <;> tauto) (fun _ _ => rfl) (by simp)
(-- `(by finish)` closes this
@@ -1561,42 +1560,42 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
- (∏ x in s, (t.piecewise f g) x) = (∏ x in s ∩ t, f x) * ∏ x in s \ t, g x := by
+ ∏ x in s, (t.piecewise f g) x = (∏ x in s ∩ t, f x) * ∏ x in s \ t, g x := by
rw [piecewise, prod_ite, filter_mem_eq_inter, ← sdiff_eq_filter]
#align finset.prod_piecewise Finset.prod_piecewise
#align finset.sum_piecewise Finset.sum_piecewise
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
- ((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x := by
+ (∏ x in s ∩ t, f x) * ∏ x in s \ t, f x = ∏ x in s, f x := by
convert (s.prod_piecewise t f f).symm; simp [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x := by
+ (f : α → β) : ∏ x in s, f x = f i * ∏ x in s \ {i}, f x := by
convert (s.prod_inter_mul_prod_diff {i} f).symm; simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
#align finset.sum_eq_add_sum_diff_singleton Finset.sum_eq_add_sum_diff_singleton
@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : (∏ x in s, f x) = (∏ x in s \ {i}, f x) * f i := by
+ (f : α → β) : ∏ x in s, f x = (∏ x in s \ {i}, f x) * f i := by
rw [prod_eq_mul_prod_diff_singleton h, mul_comm]
#align finset.prod_eq_prod_diff_singleton_mul Finset.prod_eq_prod_diff_singleton_mul
#align finset.sum_eq_sum_diff_singleton_add Finset.sum_eq_sum_diff_singleton_add
@[to_additive]
theorem Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
- (∏ i, f i) = f a * ∏ i in {a}ᶜ, f i :=
+ ∏ i, f i = f a * ∏ i in {a}ᶜ, f i :=
prod_eq_mul_prod_diff_singleton (mem_univ a) f
#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_compl
#align fintype.sum_eq_add_sum_compl Fintype.sum_eq_add_sum_compl
@[to_additive]
theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
- (∏ i, f i) = (∏ i in {a}ᶜ, f i) * f a :=
+ ∏ i, f i = (∏ i in {a}ᶜ, f i) * f a :=
prod_eq_prod_diff_singleton_mul (mem_univ a) f
#align fintype.prod_eq_prod_compl_mul Fintype.prod_eq_prod_compl_mul
#align fintype.sum_eq_sum_compl_add Fintype.sum_eq_sum_compl_add
@@ -1613,7 +1612,7 @@ theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s)
/-- A product can be partitioned into a product of products, each equivalent under a setoid. -/
@[to_additive "A sum can be partitioned into a sum of sums, each equivalent under a setoid."]
theorem prod_partition (R : Setoid α) [DecidableRel R.R] :
- (∏ x in s, f x) = ∏ xbar in s.image Quotient.mk', ∏ y in s.filterₓ fun y => ⟦y⟧ = xbar, f y :=
+ ∏ x in s, f x = ∏ xbar in s.image Quotient.mk', ∏ y in s.filterₓ fun y => ⟦y⟧ = xbar, f y :=
by
refine' (Finset.prod_image' f fun x hx => _).symm
rfl
@@ -1624,7 +1623,7 @@ theorem prod_partition (R : Setoid α) [DecidableRel R.R] :
/-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/
@[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."]
theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.R]
- (h : ∀ x ∈ s, (∏ a in s.filterₓ fun y => y ≈ x, f a) = 1) : (∏ x in s, f x) = 1 :=
+ (h : ∀ x ∈ s, ∏ a in s.filterₓ fun y => y ≈ x, f a = 1) : ∏ x in s, f x = 1 :=
by
rw [prod_partition R, ← Finset.prod_eq_one]
intro xbar xbar_in_s
@@ -1637,7 +1636,7 @@ theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.R]
#print Finset.prod_update_of_not_mem /-
@[to_additive]
theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∉ s) (f : α → β)
- (b : β) : (∏ x in s, Function.update f i b x) = ∏ x in s, f x :=
+ (b : β) : ∏ x in s, Function.update f i b x = ∏ x in s, f x :=
by
apply prod_congr rfl fun j hj => _
have : j ≠ i := by intro eq; rw [Eq] at hj ; exact h hj
@@ -1648,7 +1647,7 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
- (∏ x in s, Function.update f i b x) = b * ∏ x in s \ singleton i, f x := by
+ ∏ x in s, Function.update f i b x = b * ∏ x in s \ singleton i, f x := by
rw [update_eq_piecewise, prod_piecewise]; simp [h]
#align finset.prod_update_of_mem Finset.prod_update_of_mem
#align finset.sum_update_of_mem Finset.sum_update_of_mem
@@ -1659,7 +1658,7 @@ do the terms in that product. -/
@[to_additive eq_of_card_le_one_of_sum_eq
"If a sum of a `finset` of size at most 1 has a given\nvalue, so do the terms in that sum."]
theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α → β} {b : β}
- (h : (∏ x in s, f x) = b) : ∀ x ∈ s, f x = b :=
+ (h : ∏ x in s, f x = b) : ∀ x ∈ s, f x = b :=
by
intro x hx
by_cases hc0 : s.card = 0
@@ -1683,7 +1682,7 @@ See `multiset.prod_map_erase` for the `multiset` version. -/
@[to_additive
"Taking a sum over `s : finset α` is the same as adding the value on a single element\n`f a` to the sum over `s.erase a`.\n\nSee `multiset.sum_map_erase` for the `multiset` version."]
theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
- (f a * ∏ x in s.eraseₓ a, f x) = ∏ x in s, f x := by
+ f a * ∏ x in s.eraseₓ a, f x = ∏ x in s, f x := by
rw [← prod_insert (not_mem_erase a s), insert_erase h]
#align finset.mul_prod_erase Finset.mul_prod_erase
#align finset.add_sum_erase Finset.add_sum_erase
@@ -1700,7 +1699,7 @@ removing that point, if present, from a `finset`. -/
@[to_additive
"If a function applied at a point is 0, a sum is unchanged by\nremoving that point, if present, from a `finset`."]
theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h : f a = 1) :
- (∏ x in s.eraseₓ a, f x) = ∏ x in s, f x :=
+ ∏ x in s.eraseₓ a, f x = ∏ x in s, f x :=
by
rw [← sdiff_singleton_eq_erase]
refine' prod_subset (sdiff_subset _ _) fun x hx hnx => _
@@ -1712,7 +1711,7 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
/-- See also `finset.prod_boole`. -/
@[to_additive "See also `finset.sum_boole`."]
theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).PairwiseDisjoint f)
- (a : β) : (∏ i in s, ite (f i) a 1) = ite (∃ i ∈ s, f i) a 1 :=
+ (a : β) : ∏ i in s, ite (f i) a 1 = ite (∃ i ∈ s, f i) a 1 :=
by
split_ifs
· obtain ⟨i, hi, hfi⟩ := h
@@ -1727,7 +1726,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
- (hdf : 1 < f d) : (∏ m : α in s.eraseₓ d, f m) < ∏ m : α in s, f m :=
+ (hdf : 1 < f d) : ∏ m : α in s.eraseₓ d, f m < ∏ m : α in s, f m :=
by
nth_rw_rhs 1 [← Finset.insert_erase hd]
rw [Finset.prod_insert (Finset.not_mem_erase d s)]
@@ -1739,7 +1738,7 @@ theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoi
point, it is 1 everywhere on the `finset`. -/
@[to_additive
"If a sum is 0 and the function is 0 except possibly at one\npoint, it is 0 everywhere on the `finset`."]
-theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : (∏ x in s, f x) = 1)
+theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏ x in s, f x = 1)
(h1 : ∀ x ∈ s, x ≠ a → f x = 1) : ∀ x ∈ s, f x = 1 :=
by
intro x hx
@@ -1755,7 +1754,7 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : (
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
- (∏ x in s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1 := by simp
+ ∏ x in s, f x ^ ite (a = x) 1 0 = ite (a ∈ s) (f a) 1 := by simp
#align finset.prod_pow_boole Finset.prod_pow_boole
#print Finset.prod_dvd_prod_of_dvd /-
@@ -1771,7 +1770,7 @@ theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈
-/
theorem prod_dvd_prod_of_subset {ι M : Type _} [CommMonoid M] (s t : Finset ι) (f : ι → M)
- (h : s ⊆ t) : (∏ i in s, f i) ∣ ∏ i in t, f i :=
+ (h : s ⊆ t) : ∏ i in s, f i ∣ ∏ i in t, f i :=
Multiset.prod_dvd_prod_of_le <| Multiset.map_le_map <| by simpa
#align finset.prod_dvd_prod_of_subset Finset.prod_dvd_prod_of_subset
@@ -1781,7 +1780,7 @@ end CommMonoid
is the sum of the products of `g` and `h`. -/
theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
(h1 : g i + h i = f i) (h2 : ∀ j ∈ s, j ≠ i → g j = f j) (h3 : ∀ j ∈ s, j ≠ i → h j = f j) :
- ((∏ i in s, g i) + ∏ i in s, h i) = ∏ i in s, f i := by
+ ∏ i in s, g i + ∏ i in s, h i = ∏ i in s, f i := by
classical
simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
congr 2 <;> apply prod_congr rfl <;> simpa
@@ -1793,7 +1792,7 @@ theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ _ in s, 1 := by simp
-/
#print Finset.sum_const_nat /-
-theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) : (∑ x in s, f x) = card s * m :=
+theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) : ∑ x in s, f x = card s * m :=
by
rw [← Nat.nsmul_eq_mul, ← sum_const]
apply sum_congr rfl h₁
@@ -1848,20 +1847,20 @@ section DivisionCommMonoid
variable [DivisionCommMonoid β]
@[simp, to_additive]
-theorem prod_inv_distrib : (∏ x in s, (f x)⁻¹) = (∏ x in s, f x)⁻¹ :=
+theorem prod_inv_distrib : ∏ x in s, (f x)⁻¹ = (∏ x in s, f x)⁻¹ :=
Multiset.prod_map_inv
#align finset.prod_inv_distrib Finset.prod_inv_distrib
#align finset.sum_neg_distrib Finset.sum_neg_distrib
@[simp, to_additive]
-theorem prod_div_distrib : (∏ x in s, f x / g x) = (∏ x in s, f x) / ∏ x in s, g x :=
+theorem prod_div_distrib : ∏ x in s, f x / g x = (∏ x in s, f x) / ∏ x in s, g x :=
Multiset.prod_map_div
#align finset.prod_div_distrib Finset.prod_div_distrib
#align finset.sum_sub_distrib Finset.sum_sub_distrib
#print Finset.prod_zpow /-
@[to_additive]
-theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : (∏ a in s, f a ^ n) = (∏ a in s, f a) ^ n :=
+theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : ∏ a in s, f a ^ n = (∏ a in s, f a) ^ n :=
Multiset.prod_map_zpow
#align finset.prod_zpow Finset.prod_zpow
#align finset.sum_zsmul Finset.sum_zsmul
@@ -1874,22 +1873,21 @@ section CommGroup
variable [CommGroup β] [DecidableEq α]
@[simp, to_additive]
-theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) :
- (∏ x in s₂ \ s₁, f x) = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
- rw [eq_div_iff_mul_eq', prod_sdiff h]
+theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) : ∏ x in s₂ \ s₁, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x :=
+ by rw [eq_div_iff_mul_eq', prod_sdiff h]
#align finset.prod_sdiff_eq_div Finset.prod_sdiff_eq_div
#align finset.sum_sdiff_eq_sub Finset.sum_sdiff_eq_sub
@[to_additive]
theorem prod_sdiff_div_prod_sdiff :
- ((∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x) = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
+ (∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
simp [← Finset.prod_sdiff (@inf_le_left _ _ s₁ s₂), ← Finset.prod_sdiff (@inf_le_right _ _ s₁ s₂)]
#align finset.prod_sdiff_div_prod_sdiff Finset.prod_sdiff_div_prod_sdiff
#align finset.sum_sdiff_sub_sum_sdiff Finset.sum_sdiff_sub_sum_sdiff
@[simp, to_additive]
-theorem prod_erase_eq_div {a : α} (h : a ∈ s) : (∏ x in s.eraseₓ a, f x) = (∏ x in s, f x) / f a :=
- by rw [eq_div_iff_mul_eq', prod_erase_mul _ _ h]
+theorem prod_erase_eq_div {a : α} (h : a ∈ s) : ∏ x in s.eraseₓ a, f x = (∏ x in s, f x) / f a := by
+ rw [eq_div_iff_mul_eq', prod_erase_mul _ _ h]
#align finset.prod_erase_eq_div Finset.prod_erase_eq_div
#align finset.sum_erase_eq_sub Finset.sum_erase_eq_sub
@@ -1943,7 +1941,7 @@ theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α)
-/
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
- (b ∈ ∑ x in s, f x) ↔ ∃ a ∈ s, b ∈ f a := by
+ b ∈ ∑ x in s, f x ↔ ∃ a ∈ s, b ∈ f a := by
classical
refine' s.induction_on (by simp) _
· intro a t hi ih
@@ -1954,12 +1952,12 @@ section ProdEqZero
variable [CommMonoidWithZero β]
-theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : (∏ x in s, f x) = 0 := by
+theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : ∏ x in s, f x = 0 := by
haveI := Classical.decEq α; rw [← prod_erase_mul _ _ ha, h, MulZeroClass.mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
- (∏ i in s, ite (p i) (1 : β) (0 : β)) = ite (∀ i ∈ s, p i) 1 0 :=
+ ∏ i in s, ite (p i) (1 : β) (0 : β) = ite (∀ i ∈ s, p i) 1 0 :=
by
split_ifs
· apply prod_eq_one
@@ -1973,7 +1971,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
variable [Nontrivial β] [NoZeroDivisors β]
-theorem prod_eq_zero_iff : (∏ x in s, f x) = 0 ↔ ∃ a ∈ s, f a = 0 := by
+theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
apply Finset.induction_on s
exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => H.elim⟩
@@ -1981,7 +1979,7 @@ theorem prod_eq_zero_iff : (∏ x in s, f x) = 0 ↔ ∃ a ∈ s, f a = 0 := by
rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
-theorem prod_ne_zero_iff : (∏ x in s, f x) ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by rw [Ne, prod_eq_zero_iff];
+theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by rw [Ne, prod_eq_zero_iff];
push_neg
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
@@ -1989,7 +1987,7 @@ end ProdEqZero
@[to_additive]
theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
- (h : s.Nonempty) : (∏ x in s, f x) = f default := by
+ (h : s.Nonempty) : ∏ x in s, f x = f default := by
rw [h.eq_singleton_default, Finset.prod_singleton]
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
#align finset.sum_unique_nonempty Finset.sum_unique_nonempty
@@ -2031,7 +2029,7 @@ See `function.bijective.prod_comp` for a version without `h`. -/
"`fintype.sum_equiv` is a variant of `finset.sum_bij` that accepts\n`function.bijective`.\n\nSee `function.bijective.sum_comp` for a version without `h`. "]
theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
(he : Function.Bijective e) (f : α → M) (g : β → M) (h : ∀ x, f x = g (e x)) :
- (∏ x : α, f x) = ∏ x : β, g x :=
+ ∏ x : α, f x = ∏ x : β, g x :=
prod_bij (fun x _ => e x) (fun x _ => mem_univ (e x)) (fun x _ => h x)
(fun x x' _ _ h => he.Injective h) fun y _ =>
(he.Surjective y).imp fun a h => ⟨mem_univ _, h.symm⟩
@@ -2046,7 +2044,7 @@ See `equiv.prod_comp` for a version without `h`.
@[to_additive
"`fintype.sum_equiv` is a specialization of `finset.sum_bij` that\nautomatically fills in most arguments.\n\nSee `equiv.sum_comp` for a version without `h`.\n"]
theorem prod_equiv {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
- (g : β → M) (h : ∀ x, f x = g (e x)) : (∏ x : α, f x) = ∏ x : β, g x :=
+ (g : β → M) (h : ∀ x, f x = g (e x)) : ∏ x : α, f x = ∏ x : β, g x :=
prod_bijective e e.Bijective f g h
#align fintype.prod_equiv Fintype.prod_equiv
#align fintype.sum_equiv Fintype.sum_equiv
@@ -2055,20 +2053,20 @@ variable {f s}
@[to_additive]
theorem prod_unique {α β : Type _} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
- (∏ x : α, f x) = f default := by rw [univ_unique, prod_singleton]
+ ∏ x : α, f x = f default := by rw [univ_unique, prod_singleton]
#align fintype.prod_unique Fintype.prod_unique
#align fintype.sum_unique Fintype.sum_unique
@[to_additive]
theorem prod_empty {α β : Type _} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
- (∏ x : α, f x) = 1 :=
+ ∏ x : α, f x = 1 :=
Finset.prod_of_empty _
#align fintype.prod_empty Fintype.prod_empty
#align fintype.sum_empty Fintype.sum_empty
@[to_additive]
theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
- (a : α) : (∏ x : α, f x) = f a :=
+ (a : α) : ∏ x : α, f x = f a :=
by
haveI : Unique α := uniqueOfSubsingleton a
convert prod_unique f
@@ -2078,7 +2076,7 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
@[to_additive]
theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
- ((∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i) = ∏ i, f i := by
+ (∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by
classical
let s := {x | p x}.toFinset
rw [← Finset.prod_subtype s, ← Finset.prod_subtype (sᶜ)]
@@ -2199,9 +2197,9 @@ theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
#align multiset.sup_powerset_len Multiset.sup_powerset_len
@[simp]
-theorem toFinset_sum_count_eq (s : Multiset α) : (∑ a in s.toFinset, s.count a) = s.card :=
+theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a = s.card :=
calc
- (∑ a in s.toFinset, s.count a) = ∑ a in s.toFinset, s.count a • 1 := by
+ ∑ a in s.toFinset, s.count a = ∑ a in s.toFinset, s.count a • 1 := by
simp only [smul_eq_mul, mul_one]
_ = (s.map fun _ => 1).Sum := (Finset.sum_multiset_map_count _ _).symm
_ = s.card := by simp
@@ -2212,8 +2210,8 @@ theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
#align multiset.count_sum' Multiset.count_sum'
@[simp]
-theorem toFinset_sum_count_nsmul_eq (s : Multiset α) : (∑ a in s.toFinset, s.count a • {a}) = s :=
- by rw [← Finset.sum_multiset_map_count, Multiset.sum_map_singleton]
+theorem toFinset_sum_count_nsmul_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a • {a} = s := by
+ rw [← Finset.sum_multiset_map_count, Multiset.sum_map_singleton]
#align multiset.to_finset_sum_count_nsmul_eq Multiset.toFinset_sum_count_nsmul_eq
theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
@@ -2221,7 +2219,7 @@ theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
by
use ∑ a in s.to_finset, (s.count a / k) • {a}
have h₂ :
- (∑ x : α in s.to_finset, k • (count x s / k) • ({x} : Multiset α)) =
+ ∑ x : α in s.to_finset, k • (count x s / k) • ({x} : Multiset α) =
∑ x : α in s.to_finset, count x s • {x} :=
by
apply Finset.sum_congr rfl
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -630,7 +630,6 @@ theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ →
let ⟨c, hcs, hc⟩ := mem_image.1 hx
hc ▸ Eq c hcs
_ = ∏ x in s, h x := prod_fiberwise_of_maps_to (fun x => mem_image_of_mem g) _
-
#align finset.prod_image' Finset.prod_image'
#align finset.sum_image' Finset.sum_image'
-/
@@ -727,7 +726,6 @@ theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) :
calc
(∏ x in s, f x) = ∏ x in s, 1 := Finset.prod_congr rfl h
_ = 1 := Finset.prod_const_one
-
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
@@ -778,7 +776,6 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
refine' prod_subset (filter_subset _ s) fun x hs h => _
rw [mem_filter, not_and] at h
exact if_neg (h hs)
-
#align finset.prod_filter Finset.prod_filter
#align finset.sum_filter Finset.sum_filter
@@ -794,7 +791,6 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
· intro _ H; rwa [mem_singleton.1 H]
· simpa only [mem_singleton]
_ = f a := prod_singleton
-
#align finset.prod_eq_single_of_mem Finset.prod_eq_single_of_mem
#align finset.sum_eq_single_of_mem Finset.sum_eq_single_of_mem
@@ -859,7 +855,6 @@ theorem prod_attach {f : α → β} : (∏ x in s.attach, f x) = ∏ x in s, f x
(∏ x in s.attach, f x.val) = ∏ x in s.attach.image Subtype.val, f x := by
rw [prod_image] <;> exact fun x _ y _ => Subtype.eq
_ = _ := by rw [attach_image_val]
-
#align finset.prod_attach Finset.prod_attach
#align finset.sum_attach Finset.sum_attach
-/
@@ -983,7 +978,6 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
∏ x in (s.filterₓ fun x => ¬p x).attach, h (g x.1 (mem_filter.mp x.2).2) :=
congr_arg₂ _ (prod_congr rfl fun x hx => congr_arg h (dif_pos (mem_filter.mp x.2).2))
(prod_congr rfl fun x hx => congr_arg h (dif_neg (mem_filter.mp x.2).2))
-
#align finset.prod_apply_dite Finset.prod_apply_dite
#align finset.sum_apply_dite Finset.sum_apply_dite
@@ -1177,7 +1171,6 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
let ⟨a, ha₁, ha₂, Eq⟩ := i_surj b h₁ h₂
⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩)
_ = ∏ x in t, g x := prod_filter_ne_one
-
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
@@ -1562,7 +1555,6 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
(prod_congr rfl fun b hb => prod_congr rfl (by simp (config := { contextual := true })))
_ = ∏ b in s.image g, f b ^ (s.filterₓ fun a => g a = b).card :=
prod_congr rfl fun _ _ => prod_const _
-
#align finset.prod_comp Finset.prod_comp
#align finset.sum_comp Finset.sum_comp
-/
@@ -1922,7 +1914,6 @@ theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
(s.biUnion t).card = ∑ i in s.biUnion t, 1 := by simp
_ = ∑ a in s, ∑ i in t a, 1 := (Finset.sum_biUnion h)
_ = ∑ u in s, card (t u) := by simp
-
#align finset.card_bUnion Finset.card_biUnion
#print Finset.card_biUnion_le /-
@@ -1934,7 +1925,6 @@ theorem card_biUnion_le [DecidableEq β] {s : Finset α} {t : α → Finset β}
((insert a s).biUnion t).card ≤ (t a).card + (s.biUnion t).card := by
rw [bUnion_insert] <;> exact Finset.card_union_le _ _
_ ≤ ∑ a in insert a s, card (t a) := by rw [sum_insert has] <;> exact add_le_add_left ih _
-
#align finset.card_bUnion_le Finset.card_biUnion_le
-/
@@ -2215,7 +2205,6 @@ theorem toFinset_sum_count_eq (s : Multiset α) : (∑ a in s.toFinset, s.count
simp only [smul_eq_mul, mul_one]
_ = (s.map fun _ => 1).Sum := (Finset.sum_multiset_map_count _ _).symm
_ = s.card := by simp
-
#align multiset.to_finset_sum_count_eq Multiset.toFinset_sum_count_eq
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
mathlib commit https://github.com/leanprover-community/mathlib/commit/31c24aa72e7b3e5ed97a8412470e904f82b81004
@@ -2180,8 +2180,8 @@ theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
simpa only [and_comm'] using add_eq_union_left_of_le h
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∈ » i) -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x y «expr ∈ » i) -/
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
i.Sum f = i.sup f ↔ ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -398,8 +398,8 @@ end ToList
#print Equiv.Perm.prod_comp /-
@[to_additive]
theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β)
- (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x := by
- convert(Prod_map _ σ.to_embedding _).symm; exact (map_perm hs).symm
+ (hs : {a | σ a ≠ a} ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x := by
+ convert (Prod_map _ σ.to_embedding _).symm; exact (map_perm hs).symm
#align equiv.perm.prod_comp Equiv.Perm.prod_comp
#align equiv.perm.sum_comp Equiv.Perm.sum_comp
-/
@@ -407,7 +407,7 @@ theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β
#print Equiv.Perm.prod_comp' /-
@[to_additive]
theorem Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
- (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) := by
+ (hs : {a | σ a ≠ a} ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) := by
convert σ.prod_comp s (fun x => f x (σ.symm x)) hs; ext; rw [Equiv.symm_apply_apply]
#align equiv.perm.prod_comp' Equiv.Perm.prod_comp'
#align equiv.perm.sum_comp' Equiv.Perm.sum_comp'
@@ -694,13 +694,13 @@ theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' :
(h : ∀ x y, x ∈ s ∧ y ∈ t x ↔ x ∈ s' y ∧ y ∈ t') {f : γ → α → β} :
(∏ x in s, ∏ y in t x, f x y) = ∏ y in t', ∏ x in s' y, f x y := by
classical
- have :
- ∀ z : γ × α,
- (z ∈ s.bUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔ z.1 ∈ s ∧ z.2 ∈ t z.1 :=
- by rintro ⟨x, y⟩; simp
- exact
- (prod_finset_product' _ _ _ this).symm.trans
- (prod_finset_product_right' _ _ _ fun ⟨x, y⟩ => (this _).trans ((h x y).trans and_comm))
+ have :
+ ∀ z : γ × α,
+ (z ∈ s.bUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔ z.1 ∈ s ∧ z.2 ∈ t z.1 :=
+ by rintro ⟨x, y⟩; simp
+ exact
+ (prod_finset_product' _ _ _ this).symm.trans
+ (prod_finset_product_right' _ _ _ fun ⟨x, y⟩ => (this _).trans ((h x y).trans and_comm))
#align finset.prod_comm' Finset.prod_comm'
#align finset.sum_comm' Finset.sum_comm'
-/
@@ -753,8 +753,8 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
(∏ x in s.filterₓ p, f x) = ∏ x in s, f x :=
prod_subset (filter_subset _ _) fun x => by
classical
- rw [not_imp_comm, mem_filter]
- exact fun h₁ h₂ => ⟨h₁, hp _ h₁ h₂⟩
+ rw [not_imp_comm, mem_filter]
+ exact fun h₁ h₂ => ⟨h₁, hp _ h₁ h₂⟩
#align finset.prod_filter_of_ne Finset.prod_filter_of_ne
#align finset.sum_filter_of_ne Finset.sum_filter_of_ne
@@ -1161,23 +1161,23 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
(∏ x in s, f x) = ∏ x in t, g x := by
classical exact
- calc
- (∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
- _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
- (prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
- (fun a ha =>
- (mem_filter.mp ha).elim fun h₁ h₂ =>
- mem_filter.mpr ⟨hi a h₁ h₂, fun hg => h₂ (hg ▸ h a h₁ h₂)⟩)
- (fun a ha => (mem_filter.mp ha).elim <| h a)
- (fun a₁ a₂ ha₁ ha₂ =>
- (mem_filter.mp ha₁).elim fun ha₁₁ ha₁₂ =>
- (mem_filter.mp ha₂).elim fun ha₂₁ ha₂₂ => i_inj a₁ a₂ _ _ _ _)
- fun b hb =>
- (mem_filter.mp hb).elim fun h₁ h₂ =>
- let ⟨a, ha₁, ha₂, Eq⟩ := i_surj b h₁ h₂
- ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩)
- _ = ∏ x in t, g x := prod_filter_ne_one
-
+ calc
+ (∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
+ _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
+ (prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
+ (fun a ha =>
+ (mem_filter.mp ha).elim fun h₁ h₂ =>
+ mem_filter.mpr ⟨hi a h₁ h₂, fun hg => h₂ (hg ▸ h a h₁ h₂)⟩)
+ (fun a ha => (mem_filter.mp ha).elim <| h a)
+ (fun a₁ a₂ ha₁ ha₂ =>
+ (mem_filter.mp ha₁).elim fun ha₁₁ ha₁₂ =>
+ (mem_filter.mp ha₂).elim fun ha₂₁ ha₂₂ => i_inj a₁ a₂ _ _ _ _)
+ fun b hb =>
+ (mem_filter.mp hb).elim fun h₁ h₂ =>
+ let ⟨a, ha₁, ha₂, Eq⟩ := i_surj b h₁ h₂
+ ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩)
+ _ = ∏ x in t, g x := prod_filter_ne_one
+
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
@@ -1212,9 +1212,9 @@ theorem nonempty_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : s.Nonempty :=
@[to_additive]
theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
- rw [← prod_filter_ne_one] at h
- rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
- exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
+ rw [← prod_filter_ne_one] at h
+ rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
+ exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
#align finset.exists_ne_zero_of_sum_ne_zero Finset.exists_ne_zero_of_sum_ne_zero
@@ -1577,14 +1577,14 @@ theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x := by
- convert(s.prod_piecewise t f f).symm; simp [Finset.piecewise]
+ convert (s.prod_piecewise t f f).symm; simp [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x := by
- convert(s.prod_inter_mul_prod_diff {i} f).symm; simp [h]
+ convert (s.prod_inter_mul_prod_diff {i} f).symm; simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
#align finset.sum_eq_add_sum_diff_singleton Finset.sum_eq_add_sum_diff_singleton
@@ -1612,8 +1612,8 @@ theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f
#print Finset.dvd_prod_of_mem /-
theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i in s, f i := by
classical
- rw [Finset.prod_eq_mul_prod_diff_singleton ha]
- exact dvd_mul_right _ _
+ rw [Finset.prod_eq_mul_prod_diff_singleton ha]
+ exact dvd_mul_right _ _
#align finset.dvd_prod_of_mem Finset.dvd_prod_of_mem
-/
@@ -1726,7 +1726,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
· obtain ⟨i, hi, hfi⟩ := h
rw [prod_eq_single_of_mem _ hi, if_pos hfi]
exact fun j hj h => if_neg fun hfj => (hf hj hi h).le_bot ⟨hfj, hfi⟩
- · push_neg at h
+ · push_neg at h
rw [prod_eq_one]
exact fun i hi => if_neg (h i hi)
#align finset.prod_ite_one Finset.prod_ite_one
@@ -1752,13 +1752,13 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : (
by
intro x hx
classical
- by_cases h : x = a
- · rw [h]
- rw [h] at hx
- rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_singleton.1 ha),
- prod_singleton] at hp
- exact hp
- · exact h1 x hx h
+ by_cases h : x = a
+ · rw [h]
+ rw [h] at hx
+ rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_singleton.1 ha),
+ prod_singleton] at hp
+ exact hp
+ · exact h1 x hx h
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
@@ -1770,11 +1770,11 @@ theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α)
theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
S.Prod g1 ∣ S.Prod g2 := by
classical
- apply Finset.induction_on' S
- · simp
- intro a T haS _ haT IH
- repeat' rw [Finset.prod_insert haT]
- exact mul_dvd_mul (h a haS) IH
+ apply Finset.induction_on' S
+ · simp
+ intro a T haS _ haT IH
+ repeat' rw [Finset.prod_insert haT]
+ exact mul_dvd_mul (h a haS) IH
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
-/
@@ -1791,8 +1791,8 @@ theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α
(h1 : g i + h i = f i) (h2 : ∀ j ∈ s, j ≠ i → g j = f j) (h3 : ∀ j ∈ s, j ≠ i → h j = f j) :
((∏ i in s, g i) + ∏ i in s, h i) = ∏ i in s, f i := by
classical
- simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
- congr 2 <;> apply prod_congr rfl <;> simpa
+ simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
+ congr 2 <;> apply prod_congr rfl <;> simpa
#align finset.prod_add_prod_eq Finset.prod_add_prod_eq
#print Finset.card_eq_sum_ones /-
@@ -1955,9 +1955,9 @@ theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α)
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
(b ∈ ∑ x in s, f x) ↔ ∃ a ∈ s, b ∈ f a := by
classical
- refine' s.induction_on (by simp) _
- · intro a t hi ih
- simp [sum_insert hi, ih, or_and_right, exists_or]
+ refine' s.induction_on (by simp) _
+ · intro a t hi ih
+ simp [sum_insert hi, ih, or_and_right, exists_or]
#align finset.mem_sum Finset.mem_sum
section ProdEqZero
@@ -1975,7 +1975,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
· apply prod_eq_one
intro i hi
rw [if_pos (h i hi)]
- · push_neg at h
+ · push_neg at h
rcases h with ⟨i, hi, hq⟩
apply prod_eq_zero hi
rw [if_neg hq]
@@ -1985,10 +1985,10 @@ variable [Nontrivial β] [NoZeroDivisors β]
theorem prod_eq_zero_iff : (∏ x in s, f x) = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
- apply Finset.induction_on s
- exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => H.elim⟩
- intro a s ha ih
- rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
+ apply Finset.induction_on s
+ exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => H.elim⟩
+ intro a s ha ih
+ rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
theorem prod_ne_zero_iff : (∏ x in s, f x) ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by rw [Ne, prod_eq_zero_iff];
@@ -2090,11 +2090,11 @@ theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid
(f : α → β) [DecidablePred p] :
((∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i) = ∏ i, f i := by
classical
- let s := { x | p x }.toFinset
- rw [← Finset.prod_subtype s, ← Finset.prod_subtype (sᶜ)]
- · exact Finset.prod_mul_prod_compl _ _
- · simp
- · simp
+ let s := {x | p x}.toFinset
+ rw [← Finset.prod_subtype s, ← Finset.prod_subtype (sᶜ)]
+ · exact Finset.prod_mul_prod_compl _ _
+ · simp
+ · simp
#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtype
#align fintype.sum_subtype_add_sum_subtype Fintype.sum_subtype_add_sum_subtype
@@ -2150,7 +2150,7 @@ theorem disjoint_sum_right {a : Multiset α} {i : Multiset (Multiset α)} :
theorem disjoint_finset_sum_left {β : Type _} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
Multiset.Disjoint (i.Sum f) a ↔ ∀ b ∈ i, Multiset.Disjoint (f b) a :=
by
- convert(@disjoint_sum_left _ a) (map f i.val)
+ convert (@disjoint_sum_left _ a) (map f i.val)
simp [and_congr_left_iff, iff_self_iff]
#align multiset.disjoint_finset_sum_left Multiset.disjoint_finset_sum_left
@@ -2254,9 +2254,9 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.Pr
theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
(∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by
classical
- induction' s using Finset.induction_on with a t hat ih
- · rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]
- · rw [Finset.sum_insert hat, Finset.prod_insert hat, Multiset.prod_add, ih]
+ induction' s using Finset.induction_on with a t hat ih
+ · rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]
+ · rw [Finset.sum_insert hat, Finset.prod_insert hat, Multiset.prod_add, ih]
#align multiset.prod_sum Multiset.prod_sum
#align multiset.sum_sum Multiset.sum_sum
@@ -2360,11 +2360,11 @@ theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h
theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
(∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
classical
- apply Finset.induction_on s
- · simp only [Finset.sum_empty, Int.natAbs_zero]
- · intro i s his IH
- simp only [his, Finset.sum_insert, not_false_iff]
- exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
+ apply Finset.induction_on s
+ · simp only [Finset.sum_empty, Int.natAbs_zero]
+ · intro i s his IH
+ simp only [his, Finset.sum_insert, not_false_iff]
+ exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
#align nat_abs_sum_le nat_abs_sum_le
/-! ### `additive`, `multiplicative` -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -776,7 +776,7 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
_ = ∏ a in s, if p a then f a else 1 :=
by
refine' prod_subset (filter_subset _ s) fun x hs h => _
- rw [mem_filter, not_and] at h
+ rw [mem_filter, not_and] at h
exact if_neg (h hs)
#align finset.prod_filter Finset.prod_filter
@@ -1071,10 +1071,10 @@ theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
- · intros ; rw [dif_neg]; cc
+ · intros; rw [dif_neg]; cc
· cc
· rw [Finset.prod_eq_one]
- intros ; rw [dif_neg]; intro ; cc
+ intros; rw [dif_neg]; intro; cc
#align finset.prod_dite_eq Finset.prod_dite_eq
#align finset.sum_dite_eq Finset.sum_dite_eq
@@ -1084,10 +1084,10 @@ theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
- · intros ; rw [dif_neg]; cc
+ · intros; rw [dif_neg]; cc
· cc
· rw [Finset.prod_eq_one]
- intros ; rw [dif_neg]; intro ; cc
+ intros; rw [dif_neg]; intro; cc
#align finset.prod_dite_eq' Finset.prod_dite_eq'
#align finset.sum_dite_eq' Finset.sum_dite_eq'
@@ -1212,7 +1212,7 @@ theorem nonempty_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : s.Nonempty :=
@[to_additive]
theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
- rw [← prod_filter_ne_one] at h
+ rw [← prod_filter_ne_one] at h
rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
exact ⟨x, (mem_filter.1 hx).1, (mem_filter.1 hx).2⟩
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
@@ -1318,7 +1318,7 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
by
rw [prod_list_count]
refine' prod_subset hs fun x _ hx => _
- rw [mem_to_finset] at hx
+ rw [mem_to_finset] at hx
rw [count_eq_zero_of_not_mem hx, pow_zero]
#align finset.prod_list_count_of_subset Finset.prod_list_count_of_subset
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
@@ -1555,7 +1555,7 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
(-- `(by finish)` closes this
by
rintro ⟨b_fst, b_snd⟩ H
- simp only [mem_image, exists_prop, mem_filter, mem_sigma] at H
+ simp only [mem_image, exists_prop, mem_filter, mem_sigma] at H
tauto)
_ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f (g a) := (prod_sigma _ _ _)
_ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f b :=
@@ -1648,7 +1648,7 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
(b : β) : (∏ x in s, Function.update f i b x) = ∏ x in s, f x :=
by
apply prod_congr rfl fun j hj => _
- have : j ≠ i := by intro eq; rw [Eq] at hj; exact h hj
+ have : j ≠ i := by intro eq; rw [Eq] at hj ; exact h hj
simp [this]
#align finset.prod_update_of_not_mem Finset.prod_update_of_not_mem
#align finset.sum_update_of_not_mem Finset.sum_update_of_not_mem
@@ -1673,12 +1673,12 @@ theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α
by_cases hc0 : s.card = 0
· exact False.elim (card_ne_zero_of_mem hx hc0)
· have h1 : s.card = 1 := le_antisymm hc (Nat.one_le_of_lt (Nat.pos_of_ne_zero hc0))
- rw [card_eq_one] at h1
+ rw [card_eq_one] at h1
cases' h1 with x2 hx2
- rw [hx2, mem_singleton] at hx
- simp_rw [hx2] at h
+ rw [hx2, mem_singleton] at hx
+ simp_rw [hx2] at h
rw [hx]
- rw [prod_singleton] at h
+ rw [prod_singleton] at h
exact h
#align finset.eq_of_card_le_one_of_prod_eq Finset.eq_of_card_le_one_of_prod_eq
#align finset.eq_of_card_le_one_of_sum_eq Finset.eq_of_card_le_one_of_sum_eq
@@ -1712,7 +1712,7 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
by
rw [← sdiff_singleton_eq_erase]
refine' prod_subset (sdiff_subset _ _) fun x hx hnx => _
- rw [sdiff_singleton_eq_erase] at hnx
+ rw [sdiff_singleton_eq_erase] at hnx
rwa [eq_of_mem_of_not_mem_erase hx hnx]
#align finset.prod_erase Finset.prod_erase
#align finset.sum_erase Finset.sum_erase
@@ -1726,7 +1726,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
· obtain ⟨i, hi, hfi⟩ := h
rw [prod_eq_single_of_mem _ hi, if_pos hfi]
exact fun j hj h => if_neg fun hfj => (hf hj hi h).le_bot ⟨hfj, hfi⟩
- · push_neg at h
+ · push_neg at h
rw [prod_eq_one]
exact fun i hi => if_neg (h i hi)
#align finset.prod_ite_one Finset.prod_ite_one
@@ -1754,9 +1754,9 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : (
classical
by_cases h : x = a
· rw [h]
- rw [h] at hx
+ rw [h] at hx
rw [← prod_subset (singleton_subset_iff.2 hx) fun t ht ha => h1 t ht (not_mem_singleton.1 ha),
- prod_singleton] at hp
+ prod_singleton] at hp
exact hp
· exact h1 x hx h
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
@@ -1975,7 +1975,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
· apply prod_eq_one
intro i hi
rw [if_pos (h i hi)]
- · push_neg at h
+ · push_neg at h
rcases h with ⟨i, hi, hq⟩
apply prod_eq_zero hi
rw [if_neg hq]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -121,7 +121,7 @@ scoped[BigOperators] notation3"∑ "(...)" in "s", "r:(scoped f => Finset.sum s
-- mathport name: finset.prod
scoped[BigOperators] notation3"∏ "(...)" in "s", "r:(scoped f => Finset.prod s f) => r
-open BigOperators
+open scoped BigOperators
namespace Finset
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -136,12 +136,6 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
-/
-/- warning: finset.prod_eq_fold -> Finset.prod_eq_fold is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.fold.{u2, u1} α β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) (CommSemigroup.to_isCommutative.{u1} β (CommMonoid.toCommSemigroup.{u1} β _inst_1)) (Semigroup.to_isAssociative.{u1} β (Monoid.toSemigroup.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) f s)
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.fold.{u2, u1} α β (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4358 : β) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4360 : β) => HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4358 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4360) (CommSemigroup.to_isCommutative.{u1} β (CommMonoid.toCommSemigroup.{u1} β _inst_1)) (Semigroup.to_isAssociative.{u1} β (Monoid.toSemigroup.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) f s)
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_fold Finset.prod_eq_foldₓ'. -/
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
(∏ x in s, f x) = s.fold (· * ·) 1 f :=
@@ -149,12 +143,6 @@ theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
#align finset.prod_eq_fold Finset.prod_eq_fold
#align finset.sum_eq_fold Finset.sum_eq_fold
-/- warning: finset.sum_multiset_singleton -> Finset.sum_multiset_singleton is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (s : Finset.{u1} α), Eq.{succ u1} (Multiset.{u1} α) (Finset.sum.{u1, u1} (Multiset.{u1} α) α (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) s (fun (x : α) => Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.hasSingleton.{u1} α) x)) (Finset.val.{u1} α s)
-but is expected to have type
- forall {α : Type.{u1}} (s : Finset.{u1} α), Eq.{succ u1} (Multiset.{u1} α) (Finset.sum.{u1, u1} (Multiset.{u1} α) α (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)) s (fun (x : α) => Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.instSingletonMultiset.{u1} α) x)) (Finset.val.{u1} α s)
-Case conversion may be inaccurate. Consider using '#align finset.sum_multiset_singleton Finset.sum_multiset_singletonₓ'. -/
@[simp]
theorem sum_multiset_singleton (s : Finset α) : (s.Sum fun x => {x}) = s.val := by
simp only [sum_eq_multiset_sum, Multiset.sum_map_singleton]
@@ -162,12 +150,6 @@ theorem sum_multiset_singleton (s : Finset α) : (s.Sum fun x => {x}) = s.val :=
end Finset
-/- warning: map_prod -> map_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] {G : Type.{u4}} [_inst_3 : MonoidHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (f x)))
-but is expected to have type
- forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
-Case conversion may be inaccurate. Consider using '#align map_prod map_prodₓ'. -/
@[to_additive]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G β γ] (g : G)
(f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
@@ -177,12 +159,6 @@ theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G
section Deprecated
-/- warning: monoid_hom.map_prod -> MonoidHom.map_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
-Case conversion may be inaccurate. Consider using '#align monoid_hom.map_prod MonoidHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f : α → β)
@@ -191,12 +167,6 @@ protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →
#align monoid_hom.map_prod MonoidHom.map_prod
#align add_monoid_hom.map_sum AddMonoidHom.map_sum
-/- warning: mul_equiv.map_prod -> MulEquiv.map_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (fun (_x : MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) => β -> γ) (MulEquiv.hasCoeToFun.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (fun (_x : MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) => β -> γ) (MulEquiv.hasCoeToFun.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) g (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (EquivLike.toEmbeddingLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulEquivClass.toEquivLike.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MulEquiv.instMulEquivClassMulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (EquivLike.toEmbeddingLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulEquivClass.toEquivLike.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MulEquiv.instMulEquivClassMulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) g (f x)))
-Case conversion may be inaccurate. Consider using '#align mul_equiv.map_prod MulEquiv.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f : α → β)
@@ -205,36 +175,18 @@ protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃*
#align mul_equiv.map_prod MulEquiv.map_prod
#align add_equiv.map_sum AddEquiv.map_sum
-/- warning: ring_hom.map_list_prod -> RingHom.map_list_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l)) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f) l))
-but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
-Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_prod RingHom.map_list_prodₓ'. -/
/-- Deprecated: use `_root_.map_list_prod` instead. -/
protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
f l.Prod = (l.map f).Prod :=
map_list_prod f l
#align ring_hom.map_list_prod RingHom.map_list_prod
-/- warning: ring_hom.map_list_sum -> RingHom.map_list_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (List.sum.{u1} β (Distrib.toHasAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroClass.toHasZero.{u1} β (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) l)) (List.sum.{u2} γ (Distrib.toHasAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroClass.toHasZero.{u2} γ (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) l))
-but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
-Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_sum RingHom.map_list_sumₓ'. -/
/-- Deprecated: use `_root_.map_list_sum` instead. -/
protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
(l : List β) : f l.Sum = (l.map f).Sum :=
map_list_sum f l
#align ring_hom.map_list_sum RingHom.map_list_sum
-/- warning: ring_hom.unop_map_list_prod -> RingHom.unop_map_list_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l))) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f)) l)))
-but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
-Case conversion may be inaccurate. Consider using '#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prodₓ'. -/
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
Deprecated: use `_root_.unop_map_list_prod` instead.
@@ -244,48 +196,24 @@ protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β
unop_map_list_prod f l
#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prod
-/- warning: ring_hom.map_multiset_prod -> RingHom.map_multiset_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f) s))
-but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
-Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_prod RingHom.map_multiset_prodₓ'. -/
/-- Deprecated: use `_root_.map_multiset_prod` instead. -/
protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
(s : Multiset β) : f s.Prod = (s.map f).Prod :=
map_multiset_prod f s
#align ring_hom.map_multiset_prod RingHom.map_multiset_prod
-/- warning: ring_hom.map_multiset_sum -> RingHom.map_multiset_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) s))
-but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
-Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_sum RingHom.map_multiset_sumₓ'. -/
/-- Deprecated: use `_root_.map_multiset_sum` instead. -/
protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
(s : Multiset β) : f s.Sum = (s.map f).Sum :=
map_multiset_sum f s
#align ring_hom.map_multiset_sum RingHom.map_multiset_sum
-/- warning: ring_hom.map_prod -> RingHom.map_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
-Case conversion may be inaccurate. Consider using '#align ring_hom.map_prod RingHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
(s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
map_prod g f s
#align ring_hom.map_prod RingHom.map_prod
-/- warning: ring_hom.map_sum -> RingHom.map_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
-Case conversion may be inaccurate. Consider using '#align ring_hom.map_sum RingHom.map_sumₓ'. -/
/-- Deprecated: use `_root_.map_sum` instead. -/
protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
(f : α → β) (s : Finset α) : g (∑ x in s, f x) = ∑ x in s, g (f x) :=
@@ -294,12 +222,6 @@ protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g
end Deprecated
-/- warning: monoid_hom.coe_finset_prod -> MonoidHom.coe_finset_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (β -> γ) (coeFn.{succ (max u3 u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (β -> γ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => γ) (fun (i : β) => _inst_2)) s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
-Case conversion may be inaccurate. Consider using '#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prodₓ'. -/
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
⇑(∏ x in s, f x) = ∏ x in s, f x :=
@@ -307,12 +229,6 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
-/- warning: monoid_hom.finset_prod_apply -> MonoidHom.finset_prod_apply is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x) b))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
-Case conversion may be inaccurate. Consider using '#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_applyₓ'. -/
-- See also `finset.prod_apply`, with the same conclusion
-- but with the weaker hypothesis `f : α → β → γ`.
@[simp, to_additive]
@@ -330,60 +246,30 @@ section CommMonoid
variable [CommMonoid β]
-/- warning: finset.prod_empty -> Finset.prod_empty is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (EmptyCollection.emptyCollection.{u2} (Finset.{u2} α) (Finset.hasEmptyc.{u2} α)) (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (EmptyCollection.emptyCollection.{u2} (Finset.{u2} α) (Finset.instEmptyCollectionFinset.{u2} α)) (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_empty Finset.prod_emptyₓ'. -/
@[simp, to_additive]
theorem prod_empty : (∏ x in ∅, f x) = 1 :=
rfl
#align finset.prod_empty Finset.prod_empty
#align finset.sum_empty Finset.sum_empty
-/- warning: finset.prod_of_empty -> Finset.prod_of_empty is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : IsEmpty.{succ u2} α] (s : Finset.{u2} α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : IsEmpty.{succ u2} α] (s : Finset.{u2} α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_of_empty Finset.prod_of_emptyₓ'. -/
@[to_additive]
theorem prod_of_empty [IsEmpty α] (s : Finset α) : (∏ i in s, f i) = 1 := by
rw [eq_empty_of_is_empty s, prod_empty]
#align finset.prod_of_empty Finset.prod_of_empty
#align finset.sum_of_empty Finset.sum_of_empty
-/- warning: finset.prod_cons -> Finset.prod_cons is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (h : Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s)), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.cons.{u2} α a s h) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (h : Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s)), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.cons.{u2} α a s h) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_cons Finset.prod_consₓ'. -/
@[simp, to_additive]
theorem prod_cons (h : a ∉ s) : (∏ x in cons a s h, f x) = f a * ∏ x in s, f x :=
fold_cons h
#align finset.prod_cons Finset.prod_cons
#align finset.sum_cons Finset.sum_cons
-/- warning: finset.prod_insert -> Finset.prod_insert is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s)) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.hasInsert.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a s) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s)) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.instInsertFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a s) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_insert Finset.prod_insertₓ'. -/
@[simp, to_additive]
theorem prod_insert [DecidableEq α] : a ∉ s → (∏ x in insert a s, f x) = f a * ∏ x in s, f x :=
fold_insert
#align finset.prod_insert Finset.prod_insert
#align finset.sum_insert Finset.sum_insert
-/- warning: finset.prod_insert_of_eq_one_if_not_mem -> Finset.prod_insert_of_eq_one_if_not_mem is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], ((Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s)) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.hasInsert.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], ((Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s)) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.instInsertFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_insert_of_eq_one_if_not_mem Finset.prod_insert_of_eq_one_if_not_memₓ'. -/
/-- The product of `f` over `insert a s` is the same as
the product over `s`, as long as `a` is in `s` or `f a = 1`.
-/
@@ -399,12 +285,6 @@ theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a =
#align finset.prod_insert_of_eq_one_if_not_mem Finset.prod_insert_of_eq_one_if_not_mem
#align finset.sum_insert_of_eq_zero_if_not_mem Finset.sum_insert_of_eq_zero_if_not_mem
-/- warning: finset.prod_insert_one -> Finset.prod_insert_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.hasInsert.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.instInsertFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_insert_one Finset.prod_insert_oneₓ'. -/
/-- The product of `f` over `insert a s` is the same as the product over `s`, as long as `f a = 1`.
-/
@[simp,
@@ -423,12 +303,6 @@ theorem prod_singleton : (∏ x in singleton a, f x) = f a :=
#align finset.sum_singleton Finset.sum_singleton
-/
-/- warning: finset.prod_pair -> Finset.prod_pair is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {a : α} {b : α}, (Ne.{succ u2} α a b) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.hasInsert.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) b)) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f b)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {a : α} {b : α}, (Ne.{succ u2} α a b) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Insert.insert.{u2, u2} α (Finset.{u2} α) (Finset.instInsertFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) a (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) b)) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f b)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_pair Finset.prod_pairₓ'. -/
@[to_additive]
theorem prod_pair [DecidableEq α] {a b : α} (h : a ≠ b) :
(∏ x in ({a, b} : Finset α), f x) = f a * f b := by
@@ -436,12 +310,6 @@ theorem prod_pair [DecidableEq α] {a b : α} (h : a ≠ b) :
#align finset.prod_pair Finset.prod_pair
#align finset.sum_pair Finset.sum_pair
-/- warning: finset.prod_const_one -> Finset.prod_const_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} [_inst_1 : CommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} [_inst_1 : CommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_const_one Finset.prod_const_oneₓ'. -/
@[simp, to_additive]
theorem prod_const_one : (∏ x in s, (1 : β)) = 1 := by
simp only [Finset.prod, Multiset.map_const, Multiset.prod_replicate, one_pow]
@@ -476,24 +344,12 @@ theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.Prod
attribute [congr] Finset.sum_congr
-/- warning: finset.prod_disj_union -> Finset.prod_disjUnion is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (h : Disjoint.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) s₁ s₂), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.disjUnion.{u2} α s₁ s₂ h) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (h : Disjoint.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u2} α) s₁ s₂), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.disjUnion.{u2} α s₁ s₂ h) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_disj_union Finset.prod_disjUnionₓ'. -/
@[to_additive]
theorem prod_disjUnion (h) : (∏ x in s₁.disjUnion s₂ h, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
by refine' Eq.trans _ (fold_disj_union h); rw [one_mul]; rfl
#align finset.prod_disj_union Finset.prod_disjUnion
#align finset.sum_disj_union Finset.sum_disjUnion
-/- warning: finset.prod_disj_Union -> Finset.prod_disjiUnion is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u3}} {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u3} ι) (t : ι -> (Finset.{u2} α)) (h : Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) ι (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} ι) (Set.{u3} ι) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} ι) (Set.{u3} ι) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} ι) (Set.{u3} ι) (Finset.Set.hasCoeT.{u3} ι))) s) t), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.disjUnionₓ.{u3, u2} ι α s t h) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β ι _inst_1 s (fun (i : ι) => Finset.prod.{u1, u2} β α _inst_1 (t i) (fun (x : α) => f x)))
-but is expected to have type
- forall {ι : Type.{u1}} {β : Type.{u2}} {α : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u2} β] (s : Finset.{u1} ι) (t : ι -> (Finset.{u3} α)) (h : Set.PairwiseDisjoint.{u3, u1} (Finset.{u3} α) ι (Finset.partialOrder.{u3} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u3} α) (Finset.toSet.{u1} ι s) t), Eq.{succ u2} β (Finset.prod.{u2, u3} β α _inst_1 (Finset.disjiUnion.{u1, u3} ι α s t h) (fun (x : α) => f x)) (Finset.prod.{u2, u1} β ι _inst_1 s (fun (i : ι) => Finset.prod.{u2, u3} β α _inst_1 (t i) (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_disj_Union Finset.prod_disjiUnionₓ'. -/
@[to_additive]
theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
(∏ x in s.disjUnionₓ t h, f x) = ∏ i in s, ∏ x in t i, f x :=
@@ -505,12 +361,6 @@ theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
#align finset.prod_disj_Union Finset.prod_disjiUnion
#align finset.sum_disj_Union Finset.sum_disjiUnion
-/- warning: finset.prod_union_inter -> Finset.prod_union_inter is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Union.union.{u2} (Finset.{u2} α) (Finset.hasUnion.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.hasInter.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_union_inter Finset.prod_union_interₓ'. -/
@[to_additive]
theorem prod_union_inter [DecidableEq α] :
((∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
@@ -518,12 +368,6 @@ theorem prod_union_inter [DecidableEq α] :
#align finset.prod_union_inter Finset.prod_union_inter
#align finset.sum_union_inter Finset.sum_union_inter
-/- warning: finset.prod_union -> Finset.prod_union is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (Disjoint.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) s₁ s₂) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Union.union.{u2} (Finset.{u2} α) (Finset.hasUnion.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (Disjoint.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u2} α) s₁ s₂) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_union Finset.prod_unionₓ'. -/
@[to_additive]
theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
(∏ x in s₁ ∪ s₂, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
@@ -531,12 +375,6 @@ theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
#align finset.prod_union Finset.prod_union
#align finset.sum_union Finset.sum_union
-/- warning: finset.prod_filter_mul_prod_filter_not -> Finset.prod_filter_mul_prod_filter_not is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (p : α -> Prop) [_inst_2 : DecidablePred.{succ u2} α p] [_inst_3 : DecidablePred.{succ u2} α (fun (x : α) => Not (p x))] (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => _inst_2 a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_3 a) s) (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (p : α -> Prop) [_inst_2 : DecidablePred.{succ u2} α p] [_inst_3 : forall (x : α), Decidable (Not (p x))] (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => _inst_2 a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_3 a) s) (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))
-Case conversion may be inaccurate. Consider using '#align finset.prod_filter_mul_prod_filter_not Finset.prod_filter_mul_prod_filter_notₓ'. -/
@[to_additive]
theorem prod_filter_mul_prod_filter_not (s : Finset α) (p : α → Prop) [DecidablePred p]
[DecidablePred fun x => ¬p x] (f : α → β) :
@@ -549,12 +387,6 @@ theorem prod_filter_mul_prod_filter_not (s : Finset α) (p : α → Prop) [Decid
section ToList
-/- warning: finset.prod_to_list -> Finset.prod_to_list is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (List.prod.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (List.map.{u2, u1} α β f (Finset.toList.{u2} α s))) (Finset.prod.{u1, u2} β α _inst_1 s f)
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (List.prod.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (List.map.{u2, u1} α β f (Finset.toList.{u2} α s))) (Finset.prod.{u1, u2} β α _inst_1 s f)
-Case conversion may be inaccurate. Consider using '#align finset.prod_to_list Finset.prod_to_listₓ'. -/
@[simp, to_additive]
theorem prod_to_list (s : Finset α) (f : α → β) : (s.toList.map f).Prod = s.Prod f := by
rw [Finset.prod, ← Multiset.coe_prod, ← Multiset.coe_map, Finset.coe_toList]
@@ -591,12 +423,6 @@ open Finset
variable [Fintype α] [CommMonoid β]
-/- warning: is_compl.prod_mul_prod -> IsCompl.prod_mul_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : Fintype.{u2} α] [_inst_2 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u2} α}, (IsCompl.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.boundedOrder.{u2} α _inst_1) s t) -> (forall (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_2)))) (Finset.prod.{u1, u2} β α _inst_2 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_2 t (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_2 (Finset.univ.{u2} α _inst_1) (fun (i : α) => f i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : Fintype.{u2} α] [_inst_2 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u2} α}, (IsCompl.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.boundedOrder.{u2} α _inst_1) s t) -> (forall (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_2)))) (Finset.prod.{u1, u2} β α _inst_2 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_2 t (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_2 (Finset.univ.{u2} α _inst_1) (fun (i : α) => f i)))
-Case conversion may be inaccurate. Consider using '#align is_compl.prod_mul_prod IsCompl.prod_mul_prodₓ'. -/
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
((∏ i in s, f i) * ∏ i in t, f i) = ∏ i, f i :=
@@ -613,12 +439,6 @@ section CommMonoid
variable [CommMonoid β]
-/- warning: finset.prod_mul_prod_compl -> Finset.prod_mul_prod_compl is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
-Case conversion may be inaccurate. Consider using '#align finset.prod_mul_prod_compl Finset.prod_mul_prod_complₓ'. -/
/-- Multiplying the products of a function over `s` and over `sᶜ` gives the whole product.
For a version expressed with subtypes, see `fintype.prod_subtype_mul_prod_subtype`. -/
@[to_additive
@@ -629,12 +449,6 @@ theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f :
#align finset.prod_mul_prod_compl Finset.prod_mul_prod_compl
#align finset.sum_add_sum_compl Finset.sum_add_sum_compl
-/- warning: finset.prod_compl_mul_prod -> Finset.prod_compl_mul_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
-Case conversion may be inaccurate. Consider using '#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prodₓ'. -/
@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
((∏ i in sᶜ, f i) * ∏ i in s, f i) = ∏ i, f i :=
@@ -642,12 +456,6 @@ theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f :
#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prod
#align finset.sum_compl_add_sum Finset.sum_compl_add_sum
-/- warning: finset.prod_sdiff -> Finset.prod_sdiff is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.hasSubset.{u2} α) s₁ s₂) -> (Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.instHasSubsetFinset.{u2} α) s₁ s₂) -> (Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_sdiff Finset.prod_sdiffₓ'. -/
@[to_additive]
theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
((∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x) = ∏ x in s₂, f x := by
@@ -655,12 +463,6 @@ theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
#align finset.prod_sdiff Finset.prod_sdiff
#align finset.sum_sdiff Finset.sum_sdiff
-/- warning: finset.prod_disj_sum -> Finset.prod_disj_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (t : Finset.{u3} γ) (f : (Sum.{u2, u3} α γ) -> β), Eq.{succ u1} β (Finset.prod.{u1, max u2 u3} β (Sum.{u2, u3} α γ) _inst_1 (Finset.disjSum.{u2, u3} α γ s t) (fun (x : Sum.{u2, u3} α γ) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f (Sum.inl.{u2, u3} α γ x))) (Finset.prod.{u1, u3} β γ _inst_1 t (fun (x : γ) => f (Sum.inr.{u2, u3} α γ x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (t : Finset.{u3} γ) (f : (Sum.{u2, u3} α γ) -> β), Eq.{succ u1} β (Finset.prod.{u1, max u2 u3} β (Sum.{u2, u3} α γ) _inst_1 (Finset.disjSum.{u2, u3} α γ s t) (fun (x : Sum.{u2, u3} α γ) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f (Sum.inl.{u2, u3} α γ x))) (Finset.prod.{u1, u3} β γ _inst_1 t (fun (x : γ) => f (Sum.inr.{u2, u3} α γ x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_disj_sum Finset.prod_disj_sumₓ'. -/
@[simp, to_additive]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
(∏ x in s.disjSum t, f x) = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) :=
@@ -670,24 +472,12 @@ theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
#align finset.prod_disj_sum Finset.prod_disj_sum
#align finset.sum_disj_sum Finset.sum_disj_sum
-/- warning: finset.prod_sum_elim -> Finset.prod_sum_elim is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (t : Finset.{u3} γ) (f : α -> β) (g : γ -> β), Eq.{succ u1} β (Finset.prod.{u1, max u2 u3} β (Sum.{u2, u3} α γ) _inst_1 (Finset.disjSum.{u2, u3} α γ s t) (fun (x : Sum.{u2, u3} α γ) => Sum.elim.{u2, u3, succ u1} α γ β f g x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 t (fun (x : γ) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (t : Finset.{u3} γ) (f : α -> β) (g : γ -> β), Eq.{succ u1} β (Finset.prod.{u1, max u2 u3} β (Sum.{u2, u3} α γ) _inst_1 (Finset.disjSum.{u2, u3} α γ s t) (fun (x : Sum.{u2, u3} α γ) => Sum.elim.{u2, u3, succ u1} α γ β f g x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 t (fun (x : γ) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_sum_elim Finset.prod_sum_elimₓ'. -/
@[to_additive]
theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ → β) :
(∏ x in s.disjSum t, Sum.elim f g x) = (∏ x in s, f x) * ∏ x in t, g x := by simp
#align finset.prod_sum_elim Finset.prod_sum_elim
#align finset.sum_sum_elim Finset.sum_sum_elim
-/- warning: finset.prod_bUnion -> Finset.prod_biUnion is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u3} γ} {t : γ -> (Finset.{u2} α)}, (Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) γ (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) s) t) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.biUnion.{u3, u2} γ α (fun (a : α) (b : α) => _inst_2 a b) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 s (fun (x : γ) => Finset.prod.{u1, u2} β α _inst_1 (t x) (fun (i : α) => f i))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u3} γ} {t : γ -> (Finset.{u2} α)}, (Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) γ (Finset.partialOrder.{u2} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u2} α) (Finset.toSet.{u3} γ s) t) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.biUnion.{u3, u2} γ α (fun (a : α) (b : α) => _inst_2 a b) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 s (fun (x : γ) => Finset.prod.{u1, u2} β α _inst_1 (t x) (fun (i : α) => f i))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_bUnion Finset.prod_biUnionₓ'. -/
@[to_additive]
theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
(hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.biUnion t, f x) = ∏ x in s, ∏ i in t x, f i := by
@@ -695,12 +485,6 @@ theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
#align finset.prod_bUnion Finset.prod_biUnion
#align finset.sum_bUnion Finset.sum_biUnion
-/- warning: finset.prod_sigma -> Finset.prod_sigma is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {σ : α -> Type.{u3}} (s : Finset.{u2} α) (t : forall (a : α), Finset.{u3} (σ a)) (f : (Sigma.{u2, u3} α σ) -> β), Eq.{succ u1} β (Finset.prod.{u1, max u2 u3} β (Sigma.{u2, u3} α (fun (i : α) => σ i)) _inst_1 (Finset.sigma.{u2, u3} α (fun (a : α) => σ a) s t) (fun (x : Sigma.{u2, u3} α (fun (i : α) => σ i)) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (a : α) => Finset.prod.{u1, u3} β (σ a) _inst_1 (t a) (fun (s : σ a) => f (Sigma.mk.{u2, u3} α σ a s))))
-but is expected to have type
- forall {β : Type.{u2}} {α : Type.{u3}} [_inst_1 : CommMonoid.{u2} β] {σ : α -> Type.{u1}} (s : Finset.{u3} α) (t : forall (a : α), Finset.{u1} (σ a)) (f : (Sigma.{u3, u1} α σ) -> β), Eq.{succ u2} β (Finset.prod.{u2, max u3 u1} β (Sigma.{u3, u1} α (fun (i : α) => σ i)) _inst_1 (Finset.sigma.{u3, u1} α (fun (a : α) => σ a) s t) (fun (x : Sigma.{u3, u1} α (fun (i : α) => σ i)) => f x)) (Finset.prod.{u2, u3} β α _inst_1 s (fun (a : α) => Finset.prod.{u2, u1} β (σ a) _inst_1 (t a) (fun (s : σ a) => f (Sigma.mk.{u3, u1} α σ a s))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_sigma Finset.prod_sigmaₓ'. -/
/-- Product over a sigma type equals the product of fiberwise products. For rewriting
in the reverse direction, use `finset.prod_sigma'`. -/
@[to_additive
@@ -711,12 +495,6 @@ theorem prod_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
-/- warning: finset.prod_sigma' -> Finset.prod_sigma' is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {σ : α -> Type.{u3}} (s : Finset.{u2} α) (t : forall (a : α), Finset.{u3} (σ a)) (f : forall (a : α), (σ a) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (a : α) => Finset.prod.{u1, u3} β (σ a) _inst_1 (t a) (fun (s : σ a) => f a s))) (Finset.prod.{u1, max u2 u3} β (Sigma.{u2, u3} α (fun (i : α) => σ i)) _inst_1 (Finset.sigma.{u2, u3} α (fun (a : α) => σ a) s t) (fun (x : Sigma.{u2, u3} α (fun (i : α) => σ i)) => f (Sigma.fst.{u2, u3} α (fun (i : α) => σ i) x) (Sigma.snd.{u2, u3} α (fun (i : α) => σ i) x)))
-but is expected to have type
- forall {β : Type.{u2}} {α : Type.{u3}} [_inst_1 : CommMonoid.{u2} β] {σ : α -> Type.{u1}} (s : Finset.{u3} α) (t : forall (a : α), Finset.{u1} (σ a)) (f : forall (a : α), (σ a) -> β), Eq.{succ u2} β (Finset.prod.{u2, u3} β α _inst_1 s (fun (a : α) => Finset.prod.{u2, u1} β (σ a) _inst_1 (t a) (fun (s : σ a) => f a s))) (Finset.prod.{u2, max u3 u1} β (Sigma.{u3, u1} α (fun (i : α) => σ i)) _inst_1 (Finset.sigma.{u3, u1} α (fun (a : α) => σ a) s t) (fun (x : Sigma.{u3, u1} α (fun (i : α) => σ i)) => f (Sigma.fst.{u3, u1} α (fun (i : α) => σ i) x) (Sigma.snd.{u3, u1} α (fun (i : α) => σ i) x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_sigma' Finset.prod_sigma'ₓ'. -/
@[to_additive]
theorem prod_sigma' {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
(∏ a in s, ∏ s in t a, f a s) = ∏ x in s.Sigma t, f x.1 x.2 :=
@@ -761,12 +539,6 @@ theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β
#align finset.sum_bij' Finset.sum_bij'
-/
-/- warning: finset.equiv.prod_comp_finset -> Finset.Equiv.prod_comp_finset is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] {ι' : Type.{u3}} [_inst_2 : DecidableEq.{succ u2} ι] (e : Equiv.{succ u2, succ u3} ι ι') (f : ι' -> β) {s' : Finset.{u3} ι'} {s : Finset.{u2} ι}, (Eq.{succ u2} (Finset.{u2} ι) s (Finset.image.{u3, u2} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (coeFn.{max 1 (max (succ u3) (succ u2)) (succ u2) (succ u3), max (succ u3) (succ u2)} (Equiv.{succ u3, succ u2} ι' ι) (fun (_x : Equiv.{succ u3, succ u2} ι' ι) => ι' -> ι) (Equiv.hasCoeToFun.{succ u3, succ u2} ι' ι) (Equiv.symm.{succ u2, succ u3} ι ι' e)) s')) -> (Eq.{succ u1} β (Finset.prod.{u1, u3} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u1, u2} β ι _inst_1 s (fun (i : ι) => f (coeFn.{max 1 (max (succ u2) (succ u3)) (succ u3) (succ u2), max (succ u2) (succ u3)} (Equiv.{succ u2, succ u3} ι ι') (fun (_x : Equiv.{succ u2, succ u3} ι ι') => ι -> ι') (Equiv.hasCoeToFun.{succ u2, succ u3} ι ι') e i))))
-but is expected to have type
- forall {ι : Type.{u1}} {β : Type.{u3}} [_inst_1 : CommMonoid.{u3} β] {ι' : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] (e : Equiv.{succ u1, succ u2} ι ι') (f : ι' -> β) {s' : Finset.{u2} ι'} {s : Finset.{u1} ι}, (Eq.{succ u1} (Finset.{u1} ι) s (Finset.image.{u2, u1} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (Equiv.{succ u2, succ u1} ι' ι) ι' (fun (_x : ι') => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : ι') => ι) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} ι' ι) (Equiv.symm.{succ u1, succ u2} ι ι' e)) s')) -> (Eq.{succ u3} β (Finset.prod.{u3, u2} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u3, u1} β ι _inst_1 s (fun (i : ι) => f (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Equiv.{succ u1, succ u2} ι ι') ι (fun (_x : ι) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : ι) => ι') _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} ι ι') e i))))
-Case conversion may be inaccurate. Consider using '#align finset.equiv.prod_comp_finset Finset.Equiv.prod_comp_finsetₓ'. -/
/-- Reindexing a product over a finset along an equivalence.
See `equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@[to_additive
@@ -863,12 +635,6 @@ theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ →
#align finset.sum_image' Finset.sum_image'
-/
-/- warning: finset.prod_mul_distrib -> Finset.prod_mul_distrib is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} {g : α -> β} [_inst_1 : CommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (g x))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} {g : α -> β} [_inst_1 : CommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f x) (g x))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_mul_distrib Finset.prod_mul_distribₓ'. -/
@[to_additive]
theorem prod_mul_distrib : (∏ x in s, f x * g x) = (∏ x in s, f x) * ∏ x in s, g x :=
Eq.trans (by rw [one_mul] <;> rfl) fold_op_distrib
@@ -948,12 +714,6 @@ theorem prod_comm {s : Finset γ} {t : Finset α} {f : γ → α → β} :
#align finset.sum_comm Finset.sum_comm
-/
-/- warning: finset.prod_hom_rel -> Finset.prod_hom_rel is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] {r : β -> γ -> Prop} {f : α -> β} {g : α -> γ} {s : Finset.{u2} α}, (r (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (OfNat.ofNat.{u3} γ 1 (OfNat.mk.{u3} γ 1 (One.one.{u3} γ (MulOneClass.toHasOne.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) -> (forall (a : α) (b : β) (c : γ), (r b c) -> (r (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) b) (HMul.hMul.{u3, u3, u3} γ γ γ (instHMul.{u3} γ (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (g a) c))) -> (r (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] {r : β -> γ -> Prop} {f : α -> β} {g : α -> γ} {s : Finset.{u2} α}, (r (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (OfNat.ofNat.{u3} γ 1 (One.toOfNat1.{u3} γ (Monoid.toOne.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) -> (forall (a : α) (b : β) (c : γ), (r b c) -> (r (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) b) (HMul.hMul.{u3, u3, u3} γ γ γ (instHMul.{u3} γ (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (g a) c))) -> (r (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_hom_rel Finset.prod_hom_relₓ'. -/
@[to_additive]
theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g : α → γ} {s : Finset α}
(h₁ : r 1 1) (h₂ : ∀ a b c, r b c → r (f a * b) (g a * c)) :
@@ -962,12 +722,6 @@ theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g
#align finset.prod_hom_rel Finset.prod_hom_rel
#align finset.sum_hom_rel Finset.sum_hom_rel
-/- warning: finset.prod_eq_one -> Finset.prod_eq_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {f : α -> β} {s : Finset.{u2} α}, (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {f : α -> β} {s : Finset.{u2} α}, (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_one Finset.prod_eq_oneₓ'. -/
@[to_additive]
theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : (∏ x in s, f x) = 1 :=
calc
@@ -977,12 +731,6 @@ theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) :
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
-/- warning: finset.prod_subset_one_on_sdiff -> Finset.prod_subset_one_on_sdiff is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} {g : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.hasSubset.{u2} α) s₁ s₂) -> (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁)) -> (Eq.{succ u1} β (g x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s₁) -> (Eq.{succ u1} β (f x) (g x))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (i : α) => g i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} {g : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.instHasSubsetFinset.{u2} α) s₁ s₂) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁)) -> (Eq.{succ u1} β (g x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s₁) -> (Eq.{succ u1} β (f x) (g x))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (i : α) => g i)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiffₓ'. -/
@[to_additive]
theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
(hfg : ∀ x ∈ s₁, f x = g x) : (∏ i in s₁, f i) = ∏ i in s₂, g i :=
@@ -992,12 +740,6 @@ theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀
#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiff
#align finset.sum_subset_zero_on_sdiff Finset.sum_subset_zero_on_sdiff
-/- warning: finset.prod_subset -> Finset.prod_subset is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.hasSubset.{u2} α) s₁ s₂) -> (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s₂) -> (Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s₁)) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.instHasSubsetFinset.{u2} α) s₁ s₂) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s₂) -> (Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s₁)) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s₁ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s₂ (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_subset Finset.prod_subsetₓ'. -/
@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
(∏ x in s₁, f x) = ∏ x in s₂, f x :=
@@ -1006,12 +748,6 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
#align finset.prod_subset Finset.prod_subset
#align finset.sum_subset Finset.sum_subset
-/- warning: finset.prod_filter_of_ne -> Finset.prod_filter_of_ne is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] {p : α -> Prop} [_inst_2 : DecidablePred.{succ u2} α p], (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (Ne.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (p x)) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => _inst_2 a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] {p : α -> Prop} [_inst_2 : DecidablePred.{succ u2} α p], (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (Ne.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (p x)) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => _inst_2 a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_filter_of_ne Finset.prod_filter_of_neₓ'. -/
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
(∏ x in s.filterₓ p, f x) = ∏ x in s, f x :=
@@ -1022,12 +758,6 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
#align finset.prod_filter_of_ne Finset.prod_filter_of_ne
#align finset.sum_filter_of_ne Finset.sum_filter_of_ne
-/- warning: finset.prod_filter_ne_one -> Finset.prod_filter_ne_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : forall (x : α), Decidable (Ne.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Ne.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) (fun (a : α) => _inst_2 a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : forall (x : α), Decidable (Ne.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))], Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Ne.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) (fun (a : α) => _inst_2 a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))
-Case conversion may be inaccurate. Consider using '#align finset.prod_filter_ne_one Finset.prod_filter_ne_oneₓ'. -/
-- If we use `[decidable_eq β]` here, some rewrites fail because they find a wrong `decidable`
-- instance first; `{∀ x, decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
@@ -1037,12 +767,6 @@ theorem prod_filter_ne_one [∀ x, Decidable (f x ≠ 1)] :
#align finset.prod_filter_ne_one Finset.prod_filter_ne_one
#align finset.sum_filter_ne_zero Finset.sum_filter_ne_zero
-/- warning: finset.prod_filter -> Finset.prod_filter is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} [_inst_1 : CommMonoid.{u1} β] (p : α -> Prop) [_inst_2 : DecidablePred.{succ u2} α p] (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => _inst_2 a) s) (fun (a : α) => f a)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (a : α) => ite.{succ u1} β (p a) (_inst_2 a) (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} [_inst_1 : CommMonoid.{u1} β] (p : α -> Prop) [_inst_2 : DecidablePred.{succ u2} α p] (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => _inst_2 a) s) (fun (a : α) => f a)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (a : α) => ite.{succ u1} β (p a) (_inst_2 a) (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_filter Finset.prod_filterₓ'. -/
@[to_additive]
theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
(∏ a in s.filterₓ p, f a) = ∏ a in s, if p a then f a else 1 :=
@@ -1058,12 +782,6 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
#align finset.prod_filter Finset.prod_filter
#align finset.sum_filter Finset.sum_filter
-/- warning: finset.prod_eq_single_of_mem -> Finset.prod_eq_single_of_mem is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (forall (b : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) b s) -> (Ne.{succ u2} α b a) -> (Eq.{succ u1} β (f b) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (f a))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (forall (b : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) b s) -> (Ne.{succ u2} α b a) -> (Eq.{succ u1} β (f b) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (f a))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_single_of_mem Finset.prod_eq_single_of_memₓ'. -/
@[to_additive]
theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a ∈ s)
(h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : (∏ x in s, f x) = f a :=
@@ -1080,12 +798,6 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
#align finset.prod_eq_single_of_mem Finset.prod_eq_single_of_mem
#align finset.sum_eq_single_of_mem Finset.sum_eq_single_of_mem
-/- warning: finset.prod_eq_single -> Finset.prod_eq_single is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α), (forall (b : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) b s) -> (Ne.{succ u2} α b a) -> (Eq.{succ u1} β (f b) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> ((Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s)) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (f a))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α), (forall (b : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) b s) -> (Ne.{succ u2} α b a) -> (Eq.{succ u1} β (f b) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> ((Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s)) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (f a))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_single Finset.prod_eq_singleₓ'. -/
@[to_additive]
theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
(h₁ : a ∉ s → f a = 1) : (∏ x in s, f x) = f a :=
@@ -1096,12 +808,6 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
#align finset.prod_eq_single Finset.prod_eq_single
#align finset.sum_eq_single Finset.sum_eq_single
-/- warning: finset.prod_eq_mul_of_mem -> Finset.prod_eq_mul_of_mem is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α) (b : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) b s) -> (Ne.{succ u2} α a b) -> (forall (c : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) c s) -> (And (Ne.{succ u2} α c a) (Ne.{succ u2} α c b)) -> (Eq.{succ u1} β (f c) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f b)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α) (b : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) b s) -> (Ne.{succ u2} α a b) -> (forall (c : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) c s) -> (And (Ne.{succ u2} α c a) (Ne.{succ u2} α c b)) -> (Eq.{succ u1} β (f c) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f b)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_mul_of_mem Finset.prod_eq_mul_of_memₓ'. -/
@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
(hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : (∏ x in s, f x) = f a * f b :=
@@ -1123,12 +829,6 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
#align finset.prod_eq_mul_of_mem Finset.prod_eq_mul_of_mem
#align finset.sum_eq_add_of_mem Finset.sum_eq_add_of_mem
-/- warning: finset.prod_eq_mul -> Finset.prod_eq_mul is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α) (b : α), (Ne.{succ u2} α a b) -> (forall (c : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) c s) -> (And (Ne.{succ u2} α c a) (Ne.{succ u2} α c b)) -> (Eq.{succ u1} β (f c) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> ((Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s)) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> ((Not (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) b s)) -> (Eq.{succ u1} β (f b) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f b)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (a : α) (b : α), (Ne.{succ u2} α a b) -> (forall (c : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) c s) -> (And (Ne.{succ u2} α c a) (Ne.{succ u2} α c b)) -> (Eq.{succ u1} β (f c) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> ((Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s)) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> ((Not (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) b s)) -> (Eq.{succ u1} β (f b) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f b)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_mul Finset.prod_eq_mulₓ'. -/
@[to_additive]
theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) :
@@ -1245,12 +945,6 @@ theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α)
#align finset.sum_subtype Finset.sum_subtype
-/
-/- warning: finset.prod_congr_set -> Finset.prod_congr_set is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : CommMonoid.{u1} α] {β : Type.{u2}} [_inst_3 : Fintype.{u2} β] (s : Set.{u2} β) [_inst_4 : DecidablePred.{succ u2} β (fun (_x : β) => Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) _x s)] (f : β -> α) (g : (coeSort.{succ u2, succ (succ u2)} (Set.{u2} β) Type.{u2} (Set.hasCoeToSort.{u2} β) s) -> α), (forall (x : β) (h : Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) x s), Eq.{succ u1} α (f x) (g (Subtype.mk.{succ u2} β (fun (x : β) => Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) x s) x h))) -> (forall (x : β), (Not (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) x s)) -> (Eq.{succ u1} α (f x) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_2)))))))) -> (Eq.{succ u1} α (Finset.prod.{u1, u2} α β _inst_2 (Finset.univ.{u2} β _inst_3) f) (Finset.prod.{u1, u2} α (coeSort.{succ u2, succ (succ u2)} (Set.{u2} β) Type.{u2} (Set.hasCoeToSort.{u2} β) s) _inst_2 (Finset.univ.{u2} (coeSort.{succ u2, succ (succ u2)} (Set.{u2} β) Type.{u2} (Set.hasCoeToSort.{u2} β) s) (Subtype.fintype.{u2} β (fun (x : β) => Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) x s) (fun (a : β) => _inst_4 a) _inst_3)) g))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_2 : CommMonoid.{u2} α] {β : Type.{u1}} [_inst_3 : Fintype.{u1} β] (s : Set.{u1} β) [_inst_4 : DecidablePred.{succ u1} β (fun (_x : β) => Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) _x s)] (f : β -> α) (g : (Set.Elem.{u1} β s) -> α), (forall (x : β) (h : Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s), Eq.{succ u2} α (f x) (g (Subtype.mk.{succ u1} β (fun (x : β) => Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s) x h))) -> (forall (x : β), (Not (Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s)) -> (Eq.{succ u2} α (f x) (OfNat.ofNat.{u2} α 1 (One.toOfNat1.{u2} α (Monoid.toOne.{u2} α (CommMonoid.toMonoid.{u2} α _inst_2)))))) -> (Eq.{succ u2} α (Finset.prod.{u2, u1} α β _inst_2 (Finset.univ.{u1} β _inst_3) f) (Finset.prod.{u2, u1} α (Set.Elem.{u1} β s) _inst_2 (Finset.univ.{u1} (Set.Elem.{u1} β s) (Subtype.fintype.{u1} β (fun (x : β) => Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) x s) (fun (a : β) => _inst_4 a) _inst_3)) g))
-Case conversion may be inaccurate. Consider using '#align finset.prod_congr_set Finset.prod_congr_setₓ'. -/
/-- The product of a function `g` defined only on a set `s` is equal to
the product of a function `f` defined everywhere,
as long as `f` and `g` agree on `s`, and `f = 1` off `s`. -/
@@ -1269,9 +963,6 @@ theorem prod_congr_set {α : Type _} [CommMonoid α] {β : Type _} [Fintype β]
#align finset.prod_congr_set Finset.prod_congr_set
#align finset.sum_congr_set Finset.sum_congr_set
-/- warning: finset.prod_apply_dite -> Finset.prod_apply_dite is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.prod_apply_dite Finset.prod_apply_diteₓ'. -/
@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
[DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
@@ -1296,12 +987,6 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
#align finset.prod_apply_dite Finset.prod_apply_dite
#align finset.sum_apply_dite Finset.sum_apply_dite
-/- warning: finset.prod_apply_ite -> Finset.prod_apply_ite is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} (f : α -> γ) (g : α -> γ) (h : γ -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => h (ite.{succ u3} γ (p x) (hp x) (f x) (g x)))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => hp a) s) (fun (x : α) => h (f x))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s) (fun (x : α) => h (g x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} (f : α -> γ) (g : α -> γ) (h : γ -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => h (ite.{succ u3} γ (p x) (hp x) (f x) (g x)))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => hp a) s) (fun (x : α) => h (f x))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s) (fun (x : α) => h (g x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_apply_ite Finset.prod_apply_iteₓ'. -/
@[to_additive]
theorem prod_apply_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → γ)
(h : γ → β) :
@@ -1312,9 +997,6 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
#align finset.prod_apply_ite Finset.prod_apply_ite
#align finset.sum_apply_ite Finset.sum_apply_ite
-/- warning: finset.prod_dite -> Finset.prod_dite is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.prod_dite Finset.prod_diteₓ'. -/
@[to_additive]
theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f : ∀ x : α, p x → β)
(g : ∀ x : α, ¬p x → β) :
@@ -1325,12 +1007,6 @@ theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f :
#align finset.prod_dite Finset.prod_dite
#align finset.sum_dite Finset.sum_dite
-/- warning: finset.prod_ite -> Finset.prod_ite is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} (f : α -> β) (g : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => ite.{succ u1} β (p x) (hp x) (f x) (g x))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => hp a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s) (fun (x : α) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} (f : α -> β) (g : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => ite.{succ u1} β (p x) (hp x) (f x) (g x))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α p (fun (a : α) => hp a) s) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s) (fun (x : α) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_ite Finset.prod_iteₓ'. -/
@[to_additive]
theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → β) :
(∏ x in s, if p x then f x else g x) =
@@ -1375,12 +1051,6 @@ theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g :
#align finset.sum_apply_ite_of_true Finset.sum_apply_ite_of_true
-/
-/- warning: finset.prod_extend_by_one -> Finset.prod_extend_by_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) i s) (f i) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) i s) (f i) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))
-Case conversion may be inaccurate. Consider using '#align finset.prod_extend_by_one Finset.prod_extend_by_oneₓ'. -/
@[to_additive]
theorem prod_extend_by_one [DecidableEq α] (s : Finset α) (f : α → β) :
(∏ i in s, if i ∈ s then f i else 1) = ∏ i in s, f i :=
@@ -1388,12 +1058,6 @@ theorem prod_extend_by_one [DecidableEq α] (s : Finset α) (f : α → β) :
#align finset.prod_extend_by_one Finset.prod_extend_by_one
#align finset.sum_extend_by_zero Finset.sum_extend_by_zero
-/- warning: finset.prod_ite_mem -> Finset.prod_ite_mem is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (t : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i t) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) i t) (f i) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.hasInter.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (i : α) => f i))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (t : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i t) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) i t) (f i) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (i : α) => f i))
-Case conversion may be inaccurate. Consider using '#align finset.prod_ite_mem Finset.prod_ite_memₓ'. -/
@[simp, to_additive]
theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
(∏ i in s, if i ∈ t then f i else 1) = ∏ i in s ∩ t, f i := by
@@ -1401,12 +1065,6 @@ theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
#align finset.prod_ite_mem Finset.prod_ite_mem
#align finset.sum_ite_mem Finset.sum_ite_mem
-/- warning: finset.prod_dite_eq -> Finset.prod_dite_eq is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : forall (x : α), (Eq.{succ u2} α a x) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => dite.{succ u1} β (Eq.{succ u2} α a x) (_inst_2 a x) (fun (h : Eq.{succ u2} α a x) => b x h) (fun (h : Not (Eq.{succ u2} α a x)) => OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a (rfl.{succ u2} α a)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : forall (x : α), (Eq.{succ u2} α a x) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => dite.{succ u1} β (Eq.{succ u2} α a x) (_inst_2 a x) (fun (h : Eq.{succ u2} α a x) => b x h) (fun (h : Not (Eq.{succ u2} α a x)) => OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a (rfl.{succ u2} α a)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_dite_eq Finset.prod_dite_eqₓ'. -/
@[simp, to_additive]
theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, a = x → β) :
(∏ x in s, if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 :=
@@ -1420,12 +1078,6 @@ theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
#align finset.prod_dite_eq Finset.prod_dite_eq
#align finset.sum_dite_eq Finset.sum_dite_eq
-/- warning: finset.prod_dite_eq' -> Finset.prod_dite_eq' is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : forall (x : α), (Eq.{succ u2} α x a) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => dite.{succ u1} β (Eq.{succ u2} α x a) (_inst_2 x a) (fun (h : Eq.{succ u2} α x a) => b x h) (fun (h : Not (Eq.{succ u2} α x a)) => OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a (rfl.{succ u2} α a)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : forall (x : α), (Eq.{succ u2} α x a) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => dite.{succ u1} β (Eq.{succ u2} α x a) (_inst_2 x a) (fun (h : Eq.{succ u2} α x a) => b x h) (fun (h : Not (Eq.{succ u2} α x a)) => OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a (rfl.{succ u2} α a)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_dite_eq' Finset.prod_dite_eq'ₓ'. -/
@[simp, to_additive]
theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, x = a → β) :
(∏ x in s, if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 :=
@@ -1439,12 +1091,6 @@ theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
#align finset.prod_dite_eq' Finset.prod_dite_eq'
#align finset.sum_dite_eq' Finset.sum_dite_eq'
-/- warning: finset.prod_ite_eq -> Finset.prod_ite_eq is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => ite.{succ u1} β (Eq.{succ u2} α a x) (_inst_2 a x) (b x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => ite.{succ u1} β (Eq.{succ u2} α a x) (_inst_2 a x) (b x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_ite_eq Finset.prod_ite_eqₓ'. -/
@[simp, to_additive]
theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
(∏ x in s, ite (a = x) (b x) 1) = ite (a ∈ s) (b a) 1 :=
@@ -1452,12 +1098,6 @@ theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
#align finset.prod_ite_eq Finset.prod_ite_eq
#align finset.sum_ite_eq Finset.sum_ite_eq
-/- warning: finset.prod_ite_eq' -> Finset.prod_ite_eq' is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => ite.{succ u1} β (Eq.{succ u2} α x a) (_inst_2 x a) (b x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (a : α) (b : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => ite.{succ u1} β (Eq.{succ u2} α x a) (_inst_2 x a) (b x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (b a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_ite_eq' Finset.prod_ite_eq'ₓ'. -/
/-- A product taken over a conditional whose condition is an equality test on the index and whose
alternative is `1` has value either the term at that index or `1`.
@@ -1499,12 +1139,6 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
#align finset.sum_dite_irrel Finset.sum_dite_irrel
-/
-/- warning: finset.prod_pi_mul_single' -> Finset.prod_pi_mulSingle' is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (a : α) (x : β) (s : Finset.{u2} α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (a' : α) => Pi.mulSingle.{u2, u1} α (fun (a : α) => β) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) a x a')) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) x (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (a : α) (x : β) (s : Finset.{u2} α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (a' : α) => Pi.mulSingle.{u2, u1} α (fun (a : α) => β) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) a x a')) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) x (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'ₓ'. -/
@[simp, to_additive]
theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
(∏ a' in s, Pi.mulSingle a x a') = if a ∈ s then x else 1 :=
@@ -1512,12 +1146,6 @@ theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
-/- warning: finset.prod_pi_mul_single -> Finset.prod_pi_mulSingle is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : α -> Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : forall (a : α), CommMonoid.{u2} (β a)] (a : α) (f : forall (a : α), β a) (s : Finset.{u1} α), Eq.{succ u2} (β a) (Finset.prod.{u2, u1} (β a) α (_inst_3 a) s (fun (a' : α) => Pi.mulSingle.{u1, u2} α (fun (a' : α) => β a') (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => MulOneClass.toHasOne.{u2} (β i) (Monoid.toMulOneClass.{u2} (β i) (CommMonoid.toMonoid.{u2} (β i) (_inst_3 i)))) a' (f a') a)) (ite.{succ u2} (β a) (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) (Finset.decidableMem.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a s) (f a) (OfNat.ofNat.{u2} (β a) 1 (OfNat.mk.{u2} (β a) 1 (One.one.{u2} (β a) (MulOneClass.toHasOne.{u2} (β a) (Monoid.toMulOneClass.{u2} (β a) (CommMonoid.toMonoid.{u2} (β a) (_inst_3 a))))))))
-but is expected to have type
- forall {α : Type.{u2}} {β : α -> Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : forall (a : α), CommMonoid.{u1} (β a)] (a : α) (f : forall (a : α), β a) (s : Finset.{u2} α), Eq.{succ u1} (β a) (Finset.prod.{u1, u2} (β a) α (_inst_3 a) s (fun (a' : α) => Pi.mulSingle.{u2, u1} α β (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Monoid.toOne.{u1} (β i) (CommMonoid.toMonoid.{u1} (β i) (_inst_3 i))) a' (f a') a)) (ite.{succ u1} (β a) (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (f a) (OfNat.ofNat.{u1} (β a) 1 (One.toOfNat1.{u1} (β a) (Monoid.toOne.{u1} (β a) (CommMonoid.toMonoid.{u1} (β a) (_inst_3 a))))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_pi_mul_single Finset.prod_pi_mulSingleₓ'. -/
@[simp, to_additive]
theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
(f : ∀ a, β a) (s : Finset α) :
@@ -1526,12 +1154,6 @@ theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMono
#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
#align finset.sum_pi_single Finset.sum_pi_single
-/- warning: finset.prod_bij_ne_one -> Finset.prod_bij_ne_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u3} γ} {f : α -> β} {g : γ -> β} (i : forall (a : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> γ), (forall (a : α) (h₁ : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (h₂ : Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))), Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) (i a h₁ h₂) t) -> (forall (a₁ : α) (a₂ : α) (h₁₁ : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a₁ s) (h₁₂ : Ne.{succ u1} β (f a₁) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) (h₂₁ : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a₂ s) (h₂₂ : Ne.{succ u1} β (f a₂) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))), (Eq.{succ u3} γ (i a₁ h₁₁ h₁₂) (i a₂ h₂₁ h₂₂)) -> (Eq.{succ u2} α a₁ a₂)) -> (forall (b : γ), (Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) b t) -> (Ne.{succ u1} β (g b) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Exists.{succ u2} α (fun (a : α) => Exists.{0} (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (fun (h₁ : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) => Exists.{0} (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) (fun (h₂ : Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) => Eq.{succ u3} γ b (i a h₁ h₂)))))) -> (forall (a : α) (h₁ : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (h₂ : Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))), Eq.{succ u1} β (f a) (g (i a h₁ h₂))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 t (fun (x : γ) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u3} γ} {f : α -> β} {g : γ -> β} (i : forall (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> γ), (forall (a : α) (h₁ : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (h₂ : Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))), Membership.mem.{u3, u3} γ (Finset.{u3} γ) (Finset.instMembershipFinset.{u3} γ) (i a h₁ h₂) t) -> (forall (a₁ : α) (a₂ : α) (h₁₁ : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a₁ s) (h₁₂ : Ne.{succ u1} β (f a₁) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) (h₂₁ : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a₂ s) (h₂₂ : Ne.{succ u1} β (f a₂) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))), (Eq.{succ u3} γ (i a₁ h₁₁ h₁₂) (i a₂ h₂₁ h₂₂)) -> (Eq.{succ u2} α a₁ a₂)) -> (forall (b : γ), (Membership.mem.{u3, u3} γ (Finset.{u3} γ) (Finset.instMembershipFinset.{u3} γ) b t) -> (Ne.{succ u1} β (g b) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Exists.{succ u2} α (fun (a : α) => Exists.{0} (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (fun (h₁ : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) => Exists.{0} (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) (fun (h₂ : Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) => Eq.{succ u3} γ b (i a h₁ h₂)))))) -> (forall (a : α) (h₁ : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (h₂ : Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))), Eq.{succ u1} β (f a) (g (i a h₁ h₂))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 t (fun (x : γ) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_bij_ne_one Finset.prod_bij_ne_oneₓ'. -/
@[to_additive]
theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
@@ -1581,24 +1203,12 @@ theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
#align finset.sum_dite_of_true Finset.sum_dite_of_true
-/
-/- warning: finset.nonempty_of_prod_ne_one -> Finset.nonempty_of_prod_ne_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], (Ne.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Finset.Nonempty.{u2} α s)
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], (Ne.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Finset.Nonempty.{u2} α s)
-Case conversion may be inaccurate. Consider using '#align finset.nonempty_of_prod_ne_one Finset.nonempty_of_prod_ne_oneₓ'. -/
@[to_additive]
theorem nonempty_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : s.Nonempty :=
s.eq_empty_or_nonempty.elim (fun H => False.elim <| h <| H.symm ▸ prod_empty) id
#align finset.nonempty_of_prod_ne_one Finset.nonempty_of_prod_ne_one
#align finset.nonempty_of_sum_ne_zero Finset.nonempty_of_sum_ne_zero
-/- warning: finset.exists_ne_one_of_prod_ne_one -> Finset.exists_ne_one_of_prod_ne_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], (Ne.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Exists.{succ u2} α (fun (a : α) => Exists.{0} (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (fun (H : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) => Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β], (Ne.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Exists.{succ u2} α (fun (a : α) => And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-Case conversion may be inaccurate. Consider using '#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_oneₓ'. -/
@[to_additive]
theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
@@ -1608,12 +1218,6 @@ theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s
#align finset.exists_ne_one_of_prod_ne_one Finset.exists_ne_one_of_prod_ne_one
#align finset.exists_ne_zero_of_sum_ne_zero Finset.exists_ne_zero_of_sum_ne_zero
-/- warning: finset.prod_range_succ_comm -> Finset.prod_range_succ_comm is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (x : Nat) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f n) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (x : Nat) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (x : Nat) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f n) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (x : Nat) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_succ_comm Finset.prod_range_succ_commₓ'. -/
@[to_additive]
theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
(∏ x in range (n + 1), f x) = f n * ∏ x in range n, f x := by
@@ -1621,12 +1225,6 @@ theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
#align finset.prod_range_succ_comm Finset.prod_range_succ_comm
#align finset.sum_range_succ_comm Finset.sum_range_succ_comm
-/- warning: finset.prod_range_succ -> Finset.prod_range_succ is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (x : Nat) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (x : Nat) => f x)) (f n))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (x : Nat) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (x : Nat) => f x)) (f n))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_succ Finset.prod_range_succₓ'. -/
@[to_additive]
theorem prod_range_succ (f : ℕ → β) (n : ℕ) :
(∏ x in range (n + 1), f x) = (∏ x in range n, f x) * f n := by
@@ -1634,12 +1232,6 @@ theorem prod_range_succ (f : ℕ → β) (n : ℕ) :
#align finset.prod_range_succ Finset.prod_range_succ
#align finset.sum_range_succ Finset.sum_range_succ
-/- warning: finset.prod_range_succ' -> Finset.prod_range_succ' is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => f k)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (k : Nat) => f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) k (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => f k)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (k : Nat) => f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) k (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_succ' Finset.prod_range_succ'ₓ'. -/
@[to_additive]
theorem prod_range_succ' (f : ℕ → β) :
∀ n : ℕ, (∏ k in range (n + 1), f k) = (∏ k in range n, f (k + 1)) * f 0
@@ -1648,12 +1240,6 @@ theorem prod_range_succ' (f : ℕ → β) :
#align finset.prod_range_succ' Finset.prod_range_succ'
#align finset.sum_range_succ' Finset.sum_range_succ'
-/- warning: finset.eventually_constant_prod -> Finset.eventually_constant_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] {u : Nat -> β} {N : Nat}, (forall (n : Nat), (GE.ge.{0} Nat Nat.hasLe n N) -> (Eq.{succ u1} β (u n) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (forall {n : Nat}, (LE.le.{0} Nat Nat.hasLe N n) -> (Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => u k)) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) N (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => u k))))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] {u : Nat -> β} {N : Nat}, (forall (n : Nat), (GE.ge.{0} Nat instLENat n N) -> (Eq.{succ u1} β (u n) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (forall {n : Nat}, (LE.le.{0} Nat instLENat N n) -> (Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => u k)) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) N (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => u k))))
-Case conversion may be inaccurate. Consider using '#align finset.eventually_constant_prod Finset.eventually_constant_prodₓ'. -/
@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
(∏ k in range (n + 1), u k) = ∏ k in range (N + 1), u k :=
@@ -1667,12 +1253,6 @@ theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u
#align finset.eventually_constant_prod Finset.eventually_constant_prod
#align finset.eventually_constant_sum Finset.eventually_constant_sum
-/- warning: finset.prod_range_add -> Finset.prod_range_add is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat) (m : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n m)) (fun (x : Nat) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (x : Nat) => f x)) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range m) (fun (x : Nat) => f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n x))))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (n : Nat) (m : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n m)) (fun (x : Nat) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (x : Nat) => f x)) (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range m) (fun (x : Nat) => f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_add Finset.prod_range_addₓ'. -/
@[to_additive]
theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
(∏ x in range (n + m), f x) = (∏ x in range n, f x) * ∏ x in range m, f (n + x) :=
@@ -1683,12 +1263,6 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
#align finset.prod_range_add Finset.prod_range_add
#align finset.sum_range_add Finset.sum_range_add
-/- warning: finset.prod_range_add_div_prod_range -> Finset.prod_range_add_div_prod_range is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : CommGroup.{u1} α] (f : Nat -> α) (n : Nat) (m : Nat), Eq.{succ u1} α (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α (DivInvMonoid.toHasDiv.{u1} α (Group.toDivInvMonoid.{u1} α (CommGroup.toGroup.{u1} α _inst_2)))) (Finset.prod.{u1, 0} α Nat (CommGroup.toCommMonoid.{u1} α _inst_2) (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n m)) (fun (k : Nat) => f k)) (Finset.prod.{u1, 0} α Nat (CommGroup.toCommMonoid.{u1} α _inst_2) (Finset.range n) (fun (k : Nat) => f k))) (Finset.prod.{u1, 0} α Nat (CommGroup.toCommMonoid.{u1} α _inst_2) (Finset.range m) (fun (k : Nat) => f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n k)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CommGroup.{u1} α] (f : Nat -> α) (n : Nat) (m : Nat), Eq.{succ u1} α (HDiv.hDiv.{u1, u1, u1} α α α (instHDiv.{u1} α (DivInvMonoid.toDiv.{u1} α (Group.toDivInvMonoid.{u1} α (CommGroup.toGroup.{u1} α _inst_2)))) (Finset.prod.{u1, 0} α Nat (CommGroup.toCommMonoid.{u1} α _inst_2) (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n m)) (fun (k : Nat) => f k)) (Finset.prod.{u1, 0} α Nat (CommGroup.toCommMonoid.{u1} α _inst_2) (Finset.range n) (fun (k : Nat) => f k))) (Finset.prod.{u1, 0} α Nat (CommGroup.toCommMonoid.{u1} α _inst_2) (Finset.range m) (fun (k : Nat) => f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n k)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_rangeₓ'. -/
@[to_additive]
theorem prod_range_add_div_prod_range {α : Type _} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
((∏ k in range (n + m), f k) / ∏ k in range n, f k) = ∏ k in Finset.range m, f (n + k) :=
@@ -1696,12 +1270,6 @@ theorem prod_range_add_div_prod_range {α : Type _} [CommGroup α] (f : ℕ →
#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_range
#align finset.sum_range_add_sub_sum_range Finset.sum_range_add_sub_sum_range
-/- warning: finset.prod_range_zero -> Finset.prod_range_zero is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (fun (k : Nat) => f k)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (fun (k : Nat) => f k)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_zero Finset.prod_range_zeroₓ'. -/
@[to_additive]
theorem prod_range_zero (f : ℕ → β) : (∏ k in range 0, f k) = 1 := by rw [range_zero, prod_empty]
#align finset.prod_range_zero Finset.prod_range_zero
@@ -1717,12 +1285,6 @@ theorem prod_range_one (f : ℕ → β) : (∏ k in range 1, f k) = f 0 := by rw
open List
-/- warning: finset.prod_list_map_count -> Finset.prod_list_map_count is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (l : List.{u1} α) {M : Type.{u2}} [_inst_3 : CommMonoid.{u2} M] (f : α -> M), Eq.{succ u2} M (List.prod.{u2} M (MulOneClass.toHasMul.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_3))) (MulOneClass.toHasOne.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_3))) (List.map.{u1, u2} α M f l)) (Finset.prod.{u2, u1} M α _inst_3 (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_2 a b) l) (fun (m : α) => HPow.hPow.{u2, 0, u2} M Nat M (instHPow.{u2, 0} M Nat (Monoid.Pow.{u2} M (CommMonoid.toMonoid.{u2} M _inst_3))) (f m) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) m l)))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_2 : DecidableEq.{succ u2} α] (l : List.{u2} α) {M : Type.{u1}} [_inst_3 : CommMonoid.{u1} M] (f : α -> M), Eq.{succ u1} M (List.prod.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3))) (Monoid.toOne.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3)) (List.map.{u2, u1} α M f l)) (Finset.prod.{u1, u2} M α _inst_3 (List.toFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b) l) (fun (m : α) => HPow.hPow.{u1, 0, u1} M Nat M (instHPow.{u1, 0} M Nat (Monoid.Pow.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3))) (f m) (List.count.{u2} α (instBEq.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) m l)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_list_map_count Finset.prod_list_map_countₓ'. -/
@[to_additive]
theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type _} [CommMonoid M] (f : α → M) :
(l.map f).Prod = ∏ m in l.toFinset, f m ^ l.count m :=
@@ -1744,24 +1306,12 @@ theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type _} [CommMon
#align finset.prod_list_map_count Finset.prod_list_map_count
#align finset.sum_list_map_count Finset.sum_list_map_count
-/- warning: finset.prod_list_count -> Finset.prod_list_count is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : CommMonoid.{u1} α] (s : List.{u1} α), Eq.{succ u1} α (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) s) (Finset.prod.{u1, u1} α α _inst_3 (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s) (fun (m : α) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) m (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) m s)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : CommMonoid.{u1} α] (s : List.{u1} α), Eq.{succ u1} α (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3)) s) (Finset.prod.{u1, u1} α α _inst_3 (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s) (fun (m : α) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) m (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) m s)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_list_count Finset.prod_list_countₓ'. -/
@[to_additive]
theorem prod_list_count [DecidableEq α] [CommMonoid α] (s : List α) :
s.Prod = ∏ m in s.toFinset, m ^ s.count m := by simpa using prod_list_map_count s id
#align finset.prod_list_count Finset.prod_list_count
#align finset.sum_list_count Finset.sum_list_count
-/- warning: finset.prod_list_count_of_subset -> Finset.prod_list_count_of_subset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : CommMonoid.{u1} α] (m : List.{u1} α) (s : Finset.{u1} α), (HasSubset.Subset.{u1} (Finset.{u1} α) (Finset.hasSubset.{u1} α) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_2 a b) m) s) -> (Eq.{succ u1} α (List.prod.{u1} α (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) m) (Finset.prod.{u1, u1} α α _inst_3 s (fun (i : α) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) i (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) i m))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : CommMonoid.{u1} α] (m : List.{u1} α) (s : Finset.{u1} α), (HasSubset.Subset.{u1} (Finset.{u1} α) (Finset.instHasSubsetFinset.{u1} α) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_2 a b) m) s) -> (Eq.{succ u1} α (List.prod.{u1} α (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) (Monoid.toOne.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3)) m) (Finset.prod.{u1, u1} α α _inst_3 s (fun (i : α) => HPow.hPow.{u1, 0, u1} α Nat α (instHPow.{u1, 0} α Nat (Monoid.Pow.{u1} α (CommMonoid.toMonoid.{u1} α _inst_3))) i (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) i m))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_list_count_of_subset Finset.prod_list_count_of_subsetₓ'. -/
@[to_additive]
theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α) (s : Finset α)
(hs : m.toFinset ⊆ s) : m.Prod = ∏ i in s, i ^ m.count i :=
@@ -1782,12 +1332,6 @@ theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [Decidable
open Multiset
-/- warning: finset.prod_multiset_map_count -> Finset.prod_multiset_map_count is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α) {M : Type.{u2}} [_inst_3 : CommMonoid.{u2} M] (f : α -> M), Eq.{succ u2} M (Multiset.prod.{u2} M _inst_3 (Multiset.map.{u1, u2} α M f s)) (Finset.prod.{u2, u1} M α _inst_3 (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s) (fun (m : α) => HPow.hPow.{u2, 0, u2} M Nat M (instHPow.{u2, 0} M Nat (Monoid.Pow.{u2} M (CommMonoid.toMonoid.{u2} M _inst_3))) (f m) (Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) m s)))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_2 : DecidableEq.{succ u2} α] (s : Multiset.{u2} α) {M : Type.{u1}} [_inst_3 : CommMonoid.{u1} M] (f : α -> M), Eq.{succ u1} M (Multiset.prod.{u1} M _inst_3 (Multiset.map.{u2, u1} α M f s)) (Finset.prod.{u1, u2} M α _inst_3 (Multiset.toFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s) (fun (m : α) => HPow.hPow.{u1, 0, u1} M Nat M (instHPow.{u1, 0} M Nat (Monoid.Pow.{u1} M (CommMonoid.toMonoid.{u1} M _inst_3))) (f m) (Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_2 a b) m s)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_multiset_map_count Finset.prod_multiset_map_countₓ'. -/
@[to_additive]
theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type _} [CommMonoid M]
(f : α → M) : (s.map f).Prod = ∏ m in s.toFinset, f m ^ s.count m := by
@@ -1828,12 +1372,6 @@ theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m
#align finset.sum_mem_multiset Finset.sum_mem_multiset
-/
-/- warning: finset.prod_induction -> Finset.prod_induction is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {s : Finset.{u1} α} {M : Type.{u2}} [_inst_2 : CommMonoid.{u2} M] (f : α -> M) (p : M -> Prop), (forall (a : M) (b : M), (p a) -> (p b) -> (p (HMul.hMul.{u2, u2, u2} M M M (instHMul.{u2} M (MulOneClass.toHasMul.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_2)))) a b))) -> (p (OfNat.ofNat.{u2} M 1 (OfNat.mk.{u2} M 1 (One.one.{u2} M (MulOneClass.toHasOne.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_2))))))) -> (forall (x : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) x s) -> (p (f x))) -> (p (Finset.prod.{u2, u1} M α _inst_2 s (fun (x : α) => f x)))
-but is expected to have type
- forall {α : Type.{u2}} {s : Finset.{u2} α} {M : Type.{u1}} [_inst_2 : CommMonoid.{u1} M] (f : α -> M) (p : M -> Prop), (forall (a : M) (b : M), (p a) -> (p b) -> (p (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_2)))) a b))) -> (p (OfNat.ofNat.{u1} M 1 (One.toOfNat1.{u1} M (Monoid.toOne.{u1} M (CommMonoid.toMonoid.{u1} M _inst_2))))) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (p (f x))) -> (p (Finset.prod.{u1, u2} M α _inst_2 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_induction Finset.prod_inductionₓ'. -/
/-- To prove a property of a product, it suffices to prove that
the property is multiplicative and holds on factors.
-/
@@ -1846,12 +1384,6 @@ theorem prod_induction {M : Type _} [CommMonoid M] (f : α → M) (p : M → Pro
#align finset.prod_induction Finset.prod_induction
#align finset.sum_induction Finset.sum_induction
-/- warning: finset.prod_induction_nonempty -> Finset.prod_induction_nonempty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {s : Finset.{u1} α} {M : Type.{u2}} [_inst_2 : CommMonoid.{u2} M] (f : α -> M) (p : M -> Prop), (forall (a : M) (b : M), (p a) -> (p b) -> (p (HMul.hMul.{u2, u2, u2} M M M (instHMul.{u2} M (MulOneClass.toHasMul.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_2)))) a b))) -> (Finset.Nonempty.{u1} α s) -> (forall (x : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) x s) -> (p (f x))) -> (p (Finset.prod.{u2, u1} M α _inst_2 s (fun (x : α) => f x)))
-but is expected to have type
- forall {α : Type.{u2}} {s : Finset.{u2} α} {M : Type.{u1}} [_inst_2 : CommMonoid.{u1} M] (f : α -> M) (p : M -> Prop), (forall (a : M) (b : M), (p a) -> (p b) -> (p (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_2)))) a b))) -> (Finset.Nonempty.{u2} α s) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (p (f x))) -> (p (Finset.prod.{u1, u2} M α _inst_2 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_induction_nonempty Finset.prod_induction_nonemptyₓ'. -/
/-- To prove a property of a product, it suffices to prove that
the property is multiplicative and holds on factors.
-/
@@ -1865,12 +1397,6 @@ theorem prod_induction_nonempty {M : Type _} [CommMonoid M] (f : α → M) (p :
#align finset.prod_induction_nonempty Finset.prod_induction_nonempty
#align finset.sum_induction_nonempty Finset.sum_induction_nonempty
-/- warning: finset.prod_range_induction -> Finset.prod_range_induction is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (s : Nat -> β), (Eq.{succ u1} β (s (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall (n : Nat), Eq.{succ u1} β (s (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (s n) (f n))) -> (forall (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (k : Nat) => f k)) (s n))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] (f : Nat -> β) (s : Nat -> β), (Eq.{succ u1} β (s (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall (n : Nat), Eq.{succ u1} β (s (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (s n) (f n))) -> (forall (n : Nat), Eq.{succ u1} β (Finset.prod.{u1, 0} β Nat _inst_1 (Finset.range n) (fun (k : Nat) => f k)) (s n))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_induction Finset.prod_range_inductionₓ'. -/
/-- For any product along `{0, ..., n - 1}` of a commutative-monoid-valued function, we can verify
that it's equal to a different function just by checking ratios of adjacent terms.
@@ -1886,12 +1412,6 @@ theorem prod_range_induction (f s : ℕ → β) (h0 : s 0 = 1) (h : ∀ n, s (n
#align finset.prod_range_induction Finset.prod_range_induction
#align finset.sum_range_induction Finset.sum_range_induction
-/- warning: finset.prod_range_div -> Finset.prod_range_div is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range n) (fun (i : Nat) => HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toHasDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toHasDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range n) (fun (i : Nat) => HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_div Finset.prod_range_divₓ'. -/
/-- A telescoping product along `{0, ..., n - 1}` of a commutative group valued function reduces to
the ratio of the last and first factors. -/
@[to_additive
@@ -1901,36 +1421,18 @@ theorem prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
#align finset.prod_range_div Finset.prod_range_div
#align finset.sum_range_sub Finset.sum_range_sub
-/- warning: finset.prod_range_div' -> Finset.prod_range_div' is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range n) (fun (i : Nat) => HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toHasDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f i) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))) (HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toHasDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (f n))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range n) (fun (i : Nat) => HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f i) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (f n))
-Case conversion may be inaccurate. Consider using '#align finset.prod_range_div' Finset.prod_range_div'ₓ'. -/
@[to_additive]
theorem prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
(∏ i in range n, f i / f (i + 1)) = f 0 / f n := by apply prod_range_induction <;> simp
#align finset.prod_range_div' Finset.prod_range_div'
#align finset.sum_range_sub' Finset.sum_range_sub'
-/- warning: finset.eq_prod_range_div -> Finset.eq_prod_range_div is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (f n) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M (DivInvMonoid.toMonoid.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))))) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range n) (fun (i : Nat) => HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toHasDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (f n) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M (DivInvMonoid.toMonoid.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))))) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range n) (fun (i : Nat) => HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))))
-Case conversion may be inaccurate. Consider using '#align finset.eq_prod_range_div Finset.eq_prod_range_divₓ'. -/
@[to_additive]
theorem eq_prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel'_right]
#align finset.eq_prod_range_div Finset.eq_prod_range_div
#align finset.eq_sum_range_sub Finset.eq_sum_range_sub
-/- warning: finset.eq_prod_range_div' -> Finset.eq_prod_range_div' is a dubious translation:
-lean 3 declaration is
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (f n) (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) n (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (i : Nat) => ite.{succ u1} M (Eq.{1} Nat i (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Nat.decidableEq i (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toHasDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f i) (f (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat Nat.hasSub) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))))))
-but is expected to have type
- forall {M : Type.{u1}} [_inst_2 : CommGroup.{u1} M] (f : Nat -> M) (n : Nat), Eq.{succ u1} M (f n) (Finset.prod.{u1, 0} M Nat (CommGroup.toCommMonoid.{u1} M _inst_2) (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) n (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (i : Nat) => ite.{succ u1} M (Eq.{1} Nat i (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (instDecidableEqNat i (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (HDiv.hDiv.{u1, u1, u1} M M M (instHDiv.{u1} M (DivInvMonoid.toDiv.{u1} M (Group.toDivInvMonoid.{u1} M (CommGroup.toGroup.{u1} M _inst_2)))) (f i) (f (HSub.hSub.{0, 0, 0} Nat Nat Nat (instHSub.{0} Nat instSubNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))))
-Case conversion may be inaccurate. Consider using '#align finset.eq_prod_range_div' Finset.eq_prod_range_div'ₓ'. -/
@[to_additive]
theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
f n = ∏ i in range (n + 1), if i = 0 then f 0 else f i / f (i - 1) := by
@@ -1938,12 +1440,6 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
#align finset.eq_prod_range_div' Finset.eq_prod_range_div'
#align finset.eq_sum_range_sub' Finset.eq_sum_range_sub'
-/- warning: finset.sum_range_tsub -> Finset.sum_range_tsub is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19921 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19923 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19921 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19923) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19936 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19938 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19936 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19938)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
-Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
when the function we are summing is monotone.
@@ -2002,12 +1498,6 @@ theorem prod_flip {n : ℕ} (f : ℕ → β) :
#align finset.sum_flip Finset.sum_flip
-/
-/- warning: finset.prod_involution -> Finset.prod_involution is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (g : forall (a : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> α), (forall (a : α) (ha : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f (g a ha))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall (a : α) (ha : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s), (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Ne.{succ u2} α (g a ha) a)) -> (forall (g_mem : forall (a : α) (ha : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s), Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (g a ha) s), (forall (a : α) (ha : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s), Eq.{succ u2} α (g (g a ha) (g_mem a ha)) a) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} (g : forall (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> α), (forall (a : α) (ha : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (f (g a ha))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall (a : α) (ha : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s), (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Ne.{succ u2} α (g a ha) a)) -> (forall (g_mem : forall (a : α) (ha : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s), Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (g a ha) s), (forall (a : α) (ha : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s), Eq.{succ u2} α (g (g a ha) (g_mem a ha)) a) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_involution Finset.prod_involutionₓ'. -/
@[to_additive]
theorem prod_involution {s : Finset α} {f : α → β} :
∀ (g : ∀ a ∈ s, α) (h : ∀ a ha, f a * f (g a ha) = 1) (g_ne : ∀ a ha, f a ≠ 1 → g a ha ≠ a)
@@ -2077,12 +1567,6 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
#align finset.sum_comp Finset.sum_comp
-/
-/- warning: finset.prod_piecewise -> Finset.prod_piecewise is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (t : Finset.{u2} α) (f : α -> β) (g : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => Finset.piecewise.{u2, succ u1} α (fun (ᾰ : α) => β) t f g (fun (j : α) => Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) j t) x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.hasInter.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (t : Finset.{u2} α) (f : α -> β) (g : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => Finset.piecewise.{u2, succ u1} α (fun (ᾰ : α) => β) t f g (fun (j : α) => Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) j t) x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_piecewise Finset.prod_piecewiseₓ'. -/
@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
(∏ x in s, (t.piecewise f g) x) = (∏ x in s ∩ t, f x) * ∏ x in s \ t, g x := by
@@ -2090,12 +1574,6 @@ theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
#align finset.prod_piecewise Finset.prod_piecewise
#align finset.sum_piecewise Finset.sum_piecewise
-/- warning: finset.prod_inter_mul_prod_diff -> Finset.prod_inter_mul_prod_diff is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (t : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.hasInter.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (t : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s t) (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))
-Case conversion may be inaccurate. Consider using '#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diffₓ'. -/
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x := by
@@ -2103,12 +1581,6 @@ theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α →
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
-/- warning: finset.prod_eq_mul_prod_diff_singleton -> Finset.prod_eq_mul_prod_diff_singleton is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u2} α} {i : α}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (forall (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f i) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) i)) (fun (x : α) => f x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u2} α} {i : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (forall (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f i) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) i)) (fun (x : α) => f x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singletonₓ'. -/
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x := by
@@ -2116,12 +1588,6 @@ theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
#align finset.sum_eq_add_sum_diff_singleton Finset.sum_eq_add_sum_diff_singleton
-/- warning: finset.prod_eq_prod_diff_singleton_mul -> Finset.prod_eq_prod_diff_singleton_mul is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u2} α} {i : α}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (forall (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) i)) (fun (x : α) => f x)) (f i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u2} α} {i : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (forall (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) i)) (fun (x : α) => f x)) (f i)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_prod_diff_singleton_mul Finset.prod_eq_prod_diff_singleton_mulₓ'. -/
@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : (∏ x in s, f x) = (∏ x in s \ {i}, f x) * f i := by
@@ -2129,12 +1595,6 @@ theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α
#align finset.prod_eq_prod_diff_singleton_mul Finset.prod_eq_prod_diff_singleton_mul
#align finset.sum_eq_sum_diff_singleton_add Finset.sum_eq_sum_diff_singleton_add
-/- warning: fintype.prod_eq_mul_prod_compl -> Fintype.prod_eq_mul_prod_compl is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) a)) (fun (i : α) => f i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a)) (fun (i : α) => f i)))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_complₓ'. -/
@[to_additive]
theorem Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
(∏ i, f i) = f a * ∏ i in {a}ᶜ, f i :=
@@ -2142,12 +1602,6 @@ theorem Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f
#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_compl
#align fintype.sum_eq_add_sum_compl Fintype.sum_eq_add_sum_compl
-/- warning: fintype.prod_eq_prod_compl_mul -> Fintype.prod_eq_prod_compl_mul is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) a)) (fun (i : α) => f i)) (f a))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a)) (fun (i : α) => f i)) (f a))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_eq_prod_compl_mul Fintype.prod_eq_prod_compl_mulₓ'. -/
@[to_additive]
theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
(∏ i, f i) = (∏ i in {a}ᶜ, f i) * f a :=
@@ -2175,12 +1629,6 @@ theorem prod_partition (R : Setoid α) [DecidableRel R.R] :
#align finset.sum_partition Finset.sum_partition
-/
-/- warning: finset.prod_cancels_of_partition_cancels -> Finset.prod_cancels_of_partition_cancels is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (R : Setoid.{succ u2} α) [_inst_2 : DecidableRel.{succ u2} α (Setoid.r.{succ u2} α R)], (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (y : α) => HasEquivₓ.Equiv.{succ u2} α (setoidHasEquiv.{succ u2} α R) y x) (fun (a : α) => _inst_2 a x) s) (fun (a : α) => f a)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (R : Setoid.{succ u2} α) [_inst_2 : DecidableRel.{succ u2} α (Setoid.r.{succ u2} α R)], (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.filter.{u2} α (fun (y : α) => HasEquiv.Equiv.{succ u2, 0} α (instHasEquiv.{succ u2} α R) y x) (fun (a : α) => _inst_2 a x) s) (fun (a : α) => f a)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_cancels_of_partition_cancels Finset.prod_cancels_of_partition_cancelsₓ'. -/
/-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/
@[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."]
theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.R]
@@ -2206,12 +1654,6 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
#align finset.sum_update_of_not_mem Finset.sum_update_of_not_mem
-/
-/- warning: finset.prod_update_of_mem -> Finset.prod_update_of_mem is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u2} α} {i : α}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (forall (f : α -> β) (b : β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => Function.update.{succ u2, succ u1} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_2 a b) f i b x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) b (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) i)) (fun (x : α) => f x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u2} α} {i : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (forall (f : α -> β) (b : β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => Function.update.{succ u2, succ u1} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_2 a b) f i b x)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) b (Finset.prod.{u1, u2} β α _inst_1 (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) i)) (fun (x : α) => f x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_update_of_mem Finset.prod_update_of_memₓ'. -/
@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
(∏ x in s, Function.update f i b x) = b * ∏ x in s \ singleton i, f x := by
@@ -2242,12 +1684,6 @@ theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α
#align finset.eq_of_card_le_one_of_sum_eq Finset.eq_of_card_le_one_of_sum_eq
-/
-/- warning: finset.mul_prod_erase -> Finset.mul_prod_erase is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β) {a : α}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β) {a : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.mul_prod_erase Finset.mul_prod_eraseₓ'. -/
/-- Taking a product over `s : finset α` is the same as multiplying the value on a single element
`f a` by the product of `s.erase a`.
@@ -2260,12 +1696,6 @@ theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α}
#align finset.mul_prod_erase Finset.mul_prod_erase
#align finset.add_sum_erase Finset.add_sum_erase
-/- warning: finset.prod_erase_mul -> Finset.prod_erase_mul is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β) {a : α}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x)) (f a)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β) {a : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x)) (f a)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_erase_mul Finset.prod_erase_mulₓ'. -/
/-- A variant of `finset.mul_prod_erase` with the multiplication swapped. -/
@[to_additive "A variant of `finset.add_sum_erase` with the addition swapped."]
theorem prod_erase_mul [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
@@ -2273,12 +1703,6 @@ theorem prod_erase_mul [DecidableEq α] (s : Finset α) (f : α → β) {a : α}
#align finset.prod_erase_mul Finset.prod_erase_mul
#align finset.sum_erase_add Finset.sum_erase_add
-/- warning: finset.prod_erase -> Finset.prod_erase is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) {f : α -> β} {a : α}, (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) {f : α -> β} {a : α}, (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_erase Finset.prod_eraseₓ'. -/
/-- If a function applied at a point is 1, a product is unchanged by
removing that point, if present, from a `finset`. -/
@[to_additive
@@ -2293,12 +1717,6 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
#align finset.prod_erase Finset.prod_erase
#align finset.sum_erase Finset.sum_erase
-/- warning: finset.prod_ite_one -> Finset.prod_ite_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} [_inst_1 : CommMonoid.{u1} β] {f : α -> Prop} [_inst_2 : DecidablePred.{succ u2} α f], (Set.PairwiseDisjoint.{0, u2} Prop α Prop.partialOrder (GeneralizedBooleanAlgebra.toOrderBot.{0} Prop (BooleanAlgebra.toGeneralizedBooleanAlgebra.{0} Prop Prop.booleanAlgebra)) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} α) (Set.{u2} α) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} α) (Set.{u2} α) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} α) (Set.{u2} α) (Finset.Set.hasCoeT.{u2} α))) s) f) -> (forall (a : β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => ite.{succ u1} β (f i) (_inst_2 i) a (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) (ite.{succ u1} β (Exists.{succ u2} α (fun (i : α) => Exists.{0} (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) (fun (H : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) => f i))) (Finset.decidableDexistsFinset.{u2} α s (fun (i : α) (H : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) => f i) (fun (a : α) (h : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) => _inst_2 a)) a (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} [_inst_1 : CommMonoid.{u1} β] {f : α -> Prop} [_inst_2 : DecidablePred.{succ u2} α f], (Set.PairwiseDisjoint.{0, u2} Prop α Prop.partialOrder (BoundedOrder.toOrderBot.{0} Prop (Preorder.toLE.{0} Prop (PartialOrder.toPreorder.{0} Prop Prop.partialOrder)) Prop.boundedOrder) (Finset.toSet.{u2} α s) f) -> (forall (a : β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => ite.{succ u1} β (f i) (_inst_2 i) a (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) (ite.{succ u1} β (Exists.{succ u2} α (fun (i : α) => And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) (f i))) (Finset.decidableExistsAndFinset.{u2} α s (fun (i : α) => f i) (fun (a : α) => _inst_2 a)) a (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_ite_one Finset.prod_ite_oneₓ'. -/
/-- See also `finset.prod_boole`. -/
@[to_additive "See also `finset.sum_boole`."]
theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).PairwiseDisjoint f)
@@ -2314,12 +1732,6 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
#align finset.prod_ite_one Finset.prod_ite_one
#align finset.sum_ite_zero Finset.sum_ite_zero
-/- warning: finset.prod_erase_lt_of_one_lt -> Finset.prod_erase_lt_of_one_lt is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (MulOneClass.toHasMul.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toHasLt.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toHasLt.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 1 (OfNat.mk.{u2} γ 1 (One.one.{u2} γ (MulOneClass.toHasOne.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toHasLt.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
-but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23794 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23796 : γ) => HMul.hMul.{u1, u1, u1} γ γ γ (instHMul.{u1} γ (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23794 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23796) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23809 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23811 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23809 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23811)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 1 (One.toOfNat1.{u1} γ (Monoid.toOne.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_ltₓ'. -/
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
@@ -2331,12 +1743,6 @@ theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoi
#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_lt
#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_pos
-/- warning: finset.eq_one_of_prod_eq_one -> Finset.eq_one_of_prod_eq_one is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} {a : α}, (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))) -> (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (Ne.{succ u2} α x a) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))) -> (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {f : α -> β} {a : α}, (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (Ne.{succ u2} α x a) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) -> (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (Eq.{succ u1} β (f x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))))
-Case conversion may be inaccurate. Consider using '#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_oneₓ'. -/
/-- If a product is 1 and the function is 1 except possibly at one
point, it is 1 everywhere on the `finset`. -/
@[to_additive
@@ -2356,12 +1762,6 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : (
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
-/- warning: finset.prod_pow_boole -> Finset.prod_pow_boole is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β) (a : α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => HPow.hPow.{u1, 0, u1} β Nat β (instHPow.{u1, 0} β Nat (Monoid.Pow.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (f x) (ite.{1} Nat (Eq.{succ u2} α a x) (_inst_2 a x) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (f a) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β) (a : α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => HPow.hPow.{u1, 0, u1} β Nat β (instHPow.{u1, 0} β Nat (Monoid.Pow.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (f x) (ite.{1} Nat (Eq.{succ u2} α a x) (_inst_2 a x) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (f a) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_pow_boole Finset.prod_pow_booleₓ'. -/
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
(∏ x in s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1 := by simp
#align finset.prod_pow_boole Finset.prod_pow_boole
@@ -2378,12 +1778,6 @@ theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
-/
-/- warning: finset.prod_dvd_prod_of_subset -> Finset.prod_dvd_prod_of_subset is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u1}} {M : Type.{u2}} [_inst_2 : CommMonoid.{u2} M] (s : Finset.{u1} ι) (t : Finset.{u1} ι) (f : ι -> M), (HasSubset.Subset.{u1} (Finset.{u1} ι) (Finset.hasSubset.{u1} ι) s t) -> (Dvd.Dvd.{u2} M (semigroupDvd.{u2} M (Monoid.toSemigroup.{u2} M (CommMonoid.toMonoid.{u2} M _inst_2))) (Finset.prod.{u2, u1} M ι _inst_2 s (fun (i : ι) => f i)) (Finset.prod.{u2, u1} M ι _inst_2 t (fun (i : ι) => f i)))
-but is expected to have type
- forall {ι : Type.{u2}} {M : Type.{u1}} [_inst_2 : CommMonoid.{u1} M] (s : Finset.{u2} ι) (t : Finset.{u2} ι) (f : ι -> M), (HasSubset.Subset.{u2} (Finset.{u2} ι) (Finset.instHasSubsetFinset.{u2} ι) s t) -> (Dvd.dvd.{u1} M (semigroupDvd.{u1} M (Monoid.toSemigroup.{u1} M (CommMonoid.toMonoid.{u1} M _inst_2))) (Finset.prod.{u1, u2} M ι _inst_2 s (fun (i : ι) => f i)) (Finset.prod.{u1, u2} M ι _inst_2 t (fun (i : ι) => f i)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_dvd_prod_of_subset Finset.prod_dvd_prod_of_subsetₓ'. -/
theorem prod_dvd_prod_of_subset {ι M : Type _} [CommMonoid M] (s t : Finset ι) (f : ι → M)
(h : s ⊆ t) : (∏ i in s, f i) ∣ ∏ i in t, f i :=
Multiset.prod_dvd_prod_of_le <| Multiset.map_le_map <| by simpa
@@ -2391,12 +1785,6 @@ theorem prod_dvd_prod_of_subset {ι M : Type _} [CommMonoid M] (s t : Finset ι)
end CommMonoid
-/- warning: finset.prod_add_prod_eq -> Finset.prod_add_prod_eq is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] {s : Finset.{u2} α} {i : α} {f : α -> β} {g : α -> β} {h : α -> β}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (Eq.{succ u1} β (HAdd.hAdd.{u1, u1, u1} β β β (instHAdd.{u1} β (Distrib.toHasAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))))) (g i) (h i)) (f i)) -> (forall (j : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) j s) -> (Ne.{succ u2} α j i) -> (Eq.{succ u1} β (g j) (f j))) -> (forall (j : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) j s) -> (Ne.{succ u2} α j i) -> (Eq.{succ u1} β (h j) (f j))) -> (Eq.{succ u1} β (HAdd.hAdd.{u1, u1, u1} β β β (instHAdd.{u1} β (Distrib.toHasAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))))) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => g i)) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => h i))) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => f i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] {s : Finset.{u2} α} {i : α} {f : α -> β} {g : α -> β} {h : α -> β}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (Eq.{succ u1} β (HAdd.hAdd.{u1, u1, u1} β β β (instHAdd.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))))) (g i) (h i)) (f i)) -> (forall (j : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) j s) -> (Ne.{succ u2} α j i) -> (Eq.{succ u1} β (g j) (f j))) -> (forall (j : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) j s) -> (Ne.{succ u2} α j i) -> (Eq.{succ u1} β (h j) (f j))) -> (Eq.{succ u1} β (HAdd.hAdd.{u1, u1, u1} β β β (instHAdd.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))))) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => g i)) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => h i))) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => f i)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_add_prod_eq Finset.prod_add_prod_eqₓ'. -/
/-- If `f = g = h` everywhere but at `i`, where `f i = g i + h i`, then the product of `f` over `s`
is the sum of the products of `g` and `h`. -/
theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
@@ -2420,12 +1808,6 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
#align finset.sum_const_nat Finset.sum_const_nat
-/
-/- warning: finset.sum_boole -> Finset.sum_boole is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {p : α -> Prop} [_inst_1 : NonAssocSemiring.{u1} β] {hp : DecidablePred.{succ u2} α p}, Eq.{succ u1} β (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => ite.{succ u1} β (p x) (hp x) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β _inst_1)))))) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)))))))) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat β (HasLiftT.mk.{1, succ u1} Nat β (CoeTCₓ.coe.{1, succ u1} Nat β (Nat.castCoe.{u1} β (AddMonoidWithOne.toNatCast.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β _inst_1)))))) (Finset.card.{u2} α (Finset.filter.{u2} α p (fun (a : α) => hp a) s)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {p : α -> Prop} [_inst_1 : NonAssocSemiring.{u1} β] {hp : DecidablePred.{succ u2} α p}, Eq.{succ u1} β (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => ite.{succ u1} β (p x) (hp x) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (NonAssocSemiring.toOne.{u1} β _inst_1))) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)))))) (Nat.cast.{u1} β (NonAssocSemiring.toNatCast.{u1} β _inst_1) (Finset.card.{u2} α (Finset.filter.{u2} α p (fun (a : α) => hp a) s)))
-Case conversion may be inaccurate. Consider using '#align finset.sum_boole Finset.sum_booleₓ'. -/
@[simp]
theorem sum_boole {s : Finset α} {p : α → Prop} [NonAssocSemiring β] {hp : DecidablePred p} :
(∑ x in s, if p x then (1 : β) else (0 : β)) = (s.filterₓ p).card := by
@@ -2433,12 +1815,6 @@ theorem sum_boole {s : Finset α} {p : α → Prop} [NonAssocSemiring β] {hp :
Finset.sum_const_zero, Finset.sum_ite]
#align finset.sum_boole Finset.sum_boole
-/- warning: commute.sum_right -> Commute.sum_right is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : NonUnitalNonAssocSemiring.{u1} β] (s : Finset.{u2} α) (f : α -> β) (b : β), (forall (i : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (Commute.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β _inst_1)) b (f i))) -> (Commute.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β _inst_1)) b (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β _inst_1) s (fun (i : α) => f i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : NonUnitalNonAssocSemiring.{u1} β] (s : Finset.{u2} α) (f : α -> β) (b : β), (forall (i : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (Commute.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β _inst_1) b (f i))) -> (Commute.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β _inst_1) b (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β _inst_1) s (fun (i : α) => f i)))
-Case conversion may be inaccurate. Consider using '#align commute.sum_right Commute.sum_rightₓ'. -/
theorem Commute.sum_right [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
(h : ∀ i ∈ s, Commute b (f i)) : Commute b (∑ i in s, f i) :=
Commute.multiset_sum_right _ _ fun b hb =>
@@ -2447,12 +1823,6 @@ theorem Commute.sum_right [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α
exact h _ hi
#align commute.sum_right Commute.sum_right
-/- warning: commute.sum_left -> Commute.sum_left is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : NonUnitalNonAssocSemiring.{u1} β] (s : Finset.{u2} α) (f : α -> β) (b : β), (forall (i : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (Commute.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β _inst_1)) (f i) b)) -> (Commute.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β _inst_1)) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β _inst_1) s (fun (i : α) => f i)) b)
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : NonUnitalNonAssocSemiring.{u1} β] (s : Finset.{u2} α) (f : α -> β) (b : β), (forall (i : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (Commute.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β _inst_1) (f i) b)) -> (Commute.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β _inst_1) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β _inst_1) s (fun (i : α) => f i)) b)
-Case conversion may be inaccurate. Consider using '#align commute.sum_left Commute.sum_leftₓ'. -/
theorem Commute.sum_left [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
(h : ∀ i ∈ s, Commute (f i) b) : Commute (∑ i in s, f i) b :=
(Commute.sum_right _ _ _ fun i hi => (h _ hi).symm).symm
@@ -2485,24 +1855,12 @@ section DivisionCommMonoid
variable [DivisionCommMonoid β]
-/- warning: finset.prod_inv_distrib -> Finset.prod_inv_distrib is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : DivisionCommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => Inv.inv.{u1} β (DivInvMonoid.toHasInv.{u1} β (DivisionMonoid.toDivInvMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1))) (f x))) (Inv.inv.{u1} β (DivInvMonoid.toHasInv.{u1} β (DivisionMonoid.toDivInvMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1))) (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : DivisionCommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => Inv.inv.{u1} β (InvOneClass.toInv.{u1} β (DivInvOneMonoid.toInvOneClass.{u1} β (DivisionMonoid.toDivInvOneMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1)))) (f x))) (Inv.inv.{u1} β (InvOneClass.toInv.{u1} β (DivInvOneMonoid.toInvOneClass.{u1} β (DivisionMonoid.toDivInvOneMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_inv_distrib Finset.prod_inv_distribₓ'. -/
@[simp, to_additive]
theorem prod_inv_distrib : (∏ x in s, (f x)⁻¹) = (∏ x in s, f x)⁻¹ :=
Multiset.prod_map_inv
#align finset.prod_inv_distrib Finset.prod_inv_distrib
#align finset.sum_neg_distrib Finset.sum_neg_distrib
-/- warning: finset.prod_div_distrib -> Finset.prod_div_distrib is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} {g : α -> β} [_inst_1 : DivisionCommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toHasDiv.{u1} β (DivisionMonoid.toDivInvMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1)))) (f x) (g x))) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toHasDiv.{u1} β (DivisionMonoid.toDivInvMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => g x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} {g : α -> β} [_inst_1 : DivisionCommMonoid.{u1} β], Eq.{succ u1} β (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toDiv.{u1} β (DivisionMonoid.toDivInvMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1)))) (f x) (g x))) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toDiv.{u1} β (DivisionMonoid.toDivInvMonoid.{u1} β (DivisionCommMonoid.toDivisionMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (DivisionCommMonoid.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => g x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_div_distrib Finset.prod_div_distribₓ'. -/
@[simp, to_additive]
theorem prod_div_distrib : (∏ x in s, f x / g x) = (∏ x in s, f x) / ∏ x in s, g x :=
Multiset.prod_map_div
@@ -2523,12 +1881,6 @@ section CommGroup
variable [CommGroup β] [DecidableEq α]
-/- warning: finset.prod_sdiff_eq_div -> Finset.prod_sdiff_eq_div is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommGroup.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.hasSubset.{u2} α) s₁ s₂) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁) (fun (x : α) => f x)) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toHasDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₂ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₁ (fun (x : α) => f x))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommGroup.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], (HasSubset.Subset.{u2} (Finset.{u2} α) (Finset.instHasSubsetFinset.{u2} α) s₁ s₂) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁) (fun (x : α) => f x)) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₂ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₁ (fun (x : α) => f x))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_sdiff_eq_div Finset.prod_sdiff_eq_divₓ'. -/
@[simp, to_additive]
theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) :
(∏ x in s₂ \ s₁, f x) = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
@@ -2536,12 +1888,6 @@ theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) :
#align finset.prod_sdiff_eq_div Finset.prod_sdiff_eq_div
#align finset.sum_sdiff_eq_sub Finset.sum_sdiff_eq_sub
-/- warning: finset.prod_sdiff_div_prod_sdiff -> Finset.prod_sdiff_div_prod_sdiff is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommGroup.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], Eq.{succ u1} β (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toHasDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.hasSdiff.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x))) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toHasDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₂ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₁ (fun (x : α) => f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s₁ : Finset.{u2} α} {s₂ : Finset.{u2} α} {f : α -> β} [_inst_1 : CommGroup.{u1} β] [_inst_2 : DecidableEq.{succ u2} α], Eq.{succ u1} β (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₂ s₁) (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (SDiff.sdiff.{u2} (Finset.{u2} α) (Finset.instSDiffFinset.{u2} α (fun (a : α) (b : α) => _inst_2 a b)) s₁ s₂) (fun (x : α) => f x))) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₂ (fun (x : α) => f x)) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s₁ (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_sdiff_div_prod_sdiff Finset.prod_sdiff_div_prod_sdiffₓ'. -/
@[to_additive]
theorem prod_sdiff_div_prod_sdiff :
((∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x) = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
@@ -2549,12 +1895,6 @@ theorem prod_sdiff_div_prod_sdiff :
#align finset.prod_sdiff_div_prod_sdiff Finset.prod_sdiff_div_prod_sdiff
#align finset.sum_sdiff_sub_sum_sdiff Finset.sum_sdiff_sub_sum_sdiff
-/- warning: finset.prod_erase_eq_div -> Finset.prod_erase_eq_div is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommGroup.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {a : α}, (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x)) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toHasDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (f a)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommGroup.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {a : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s a) (fun (x : α) => f x)) (HDiv.hDiv.{u1, u1, u1} β β β (instHDiv.{u1} β (DivInvMonoid.toDiv.{u1} β (Group.toDivInvMonoid.{u1} β (CommGroup.toGroup.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α (CommGroup.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (f a)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_erase_eq_div Finset.prod_erase_eq_divₓ'. -/
@[simp, to_additive]
theorem prod_erase_eq_div {a : α} (h : a ∈ s) : (∏ x in s.eraseₓ a, f x) = (∏ x in s, f x) / f a :=
by rw [eq_div_iff_mul_eq', prod_erase_mul _ _ h]
@@ -2563,36 +1903,18 @@ theorem prod_erase_eq_div {a : α} (h : a ∈ s) : (∏ x in s.eraseₓ a, f x)
end CommGroup
-/- warning: finset.card_sigma -> Finset.card_sigma is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {σ : α -> Type.{u2}} (s : Finset.{u1} α) (t : forall (a : α), Finset.{u2} (σ a)), Eq.{1} Nat (Finset.card.{max u1 u2} (Sigma.{u1, u2} α (fun (i : α) => σ i)) (Finset.sigma.{u1, u2} α (fun (a : α) => σ a) s t)) (Finset.sum.{0, u1} Nat α Nat.addCommMonoid s (fun (a : α) => Finset.card.{u2} (σ a) (t a)))
-but is expected to have type
- forall {α : Type.{u2}} {σ : α -> Type.{u1}} (s : Finset.{u2} α) (t : forall (a : α), Finset.{u1} (σ a)), Eq.{1} Nat (Finset.card.{max u2 u1} (Sigma.{u2, u1} α (fun (i : α) => σ i)) (Finset.sigma.{u2, u1} α (fun (a : α) => σ a) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (a : α) => Finset.card.{u1} (σ a) (t a)))
-Case conversion may be inaccurate. Consider using '#align finset.card_sigma Finset.card_sigmaₓ'. -/
@[simp]
theorem card_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) :
card (s.Sigma t) = ∑ a in s, card (t a) :=
Multiset.card_sigma _ _
#align finset.card_sigma Finset.card_sigma
-/- warning: finset.card_disj_Union -> Finset.card_disjiUnion is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} (s : Finset.{u2} α) (t : α -> (Finset.{u1} β)) (h : Set.PairwiseDisjoint.{u1, u2} (Finset.{u1} β) α (Finset.partialOrder.{u1} β) (Finset.orderBot.{u1} β) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} α) (Set.{u2} α) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} α) (Set.{u2} α) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} α) (Set.{u2} α) (Finset.Set.hasCoeT.{u2} α))) s) t), Eq.{1} Nat (Finset.card.{u1} β (Finset.disjUnionₓ.{u2, u1} α β s t h)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (i : α) => Finset.card.{u1} β (t i)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} (s : Finset.{u2} α) (t : α -> (Finset.{u1} β)) (h : Set.PairwiseDisjoint.{u1, u2} (Finset.{u1} β) α (Finset.partialOrder.{u1} β) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u1} β) (Finset.toSet.{u2} α s) t), Eq.{1} Nat (Finset.card.{u1} β (Finset.disjiUnion.{u2, u1} α β s t h)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (i : α) => Finset.card.{u1} β (t i)))
-Case conversion may be inaccurate. Consider using '#align finset.card_disj_Union Finset.card_disjiUnionₓ'. -/
@[simp]
theorem card_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
(s.disjUnionₓ t h).card = s.Sum fun i => (t i).card :=
Multiset.card_bind _ _
#align finset.card_disj_Union Finset.card_disjiUnion
-/- warning: finset.card_bUnion -> Finset.card_biUnion is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} β] {s : Finset.{u2} α} {t : α -> (Finset.{u1} β)}, (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (forall (y : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) y s) -> (Ne.{succ u2} α x y) -> (Disjoint.{u1} (Finset.{u1} β) (Finset.partialOrder.{u1} β) (Finset.orderBot.{u1} β) (t x) (t y)))) -> (Eq.{1} Nat (Finset.card.{u1} β (Finset.biUnion.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (u : α) => Finset.card.{u1} β (t u))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} β] {s : Finset.{u2} α} {t : α -> (Finset.{u1} β)}, (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (forall (y : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) y s) -> (Ne.{succ u2} α x y) -> (Disjoint.{u1} (Finset.{u1} β) (Finset.partialOrder.{u1} β) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u1} β) (t x) (t y)))) -> (Eq.{1} Nat (Finset.card.{u1} β (Finset.biUnion.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (u : α) => Finset.card.{u1} β (t u))))
-Case conversion may be inaccurate. Consider using '#align finset.card_bUnion Finset.card_biUnionₓ'. -/
theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
(h : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → Disjoint (t x) (t y)) :
(s.biUnion t).card = ∑ u in s, card (t u) :=
@@ -2630,12 +1952,6 @@ theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α)
#align finset.card_eq_sum_card_image Finset.card_eq_sum_card_image
-/
-/- warning: finset.mem_sum -> Finset.mem_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> (Multiset.{u1} β)} (s : Finset.{u2} α) (b : β), Iff (Membership.Mem.{u1, u1} β (Multiset.{u1} β) (Multiset.hasMem.{u1} β) b (Finset.sum.{u1, u2} (Multiset.{u1} β) α (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} β) (Multiset.orderedCancelAddCommMonoid.{u1} β)) s (fun (x : α) => f x))) (Exists.{succ u2} α (fun (a : α) => Exists.{0} (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (fun (H : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) => Membership.Mem.{u1, u1} β (Multiset.{u1} β) (Multiset.hasMem.{u1} β) b (f a))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {f : α -> (Multiset.{u1} β)} (s : Finset.{u2} α) (b : β), Iff (Membership.mem.{u1, u1} β (Multiset.{u1} β) (Multiset.instMembershipMultiset.{u1} β) b (Finset.sum.{u1, u2} (Multiset.{u1} β) α (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} β) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} β)) s (fun (x : α) => f x))) (Exists.{succ u2} α (fun (a : α) => And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Membership.mem.{u1, u1} β (Multiset.{u1} β) (Multiset.instMembershipMultiset.{u1} β) b (f a))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_sum Finset.mem_sumₓ'. -/
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
(b ∈ ∑ x in s, f x) ↔ ∃ a ∈ s, b ∈ f a := by
classical
@@ -2648,22 +1964,10 @@ section ProdEqZero
variable [CommMonoidWithZero β]
-/- warning: finset.prod_eq_zero -> Finset.prod_eq_zero is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β], (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))))))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β], (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_zero Finset.prod_eq_zeroₓ'. -/
theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : (∏ x in s, f x) = 0 := by
haveI := Classical.decEq α; rw [← prod_erase_mul _ _ ha, h, MulZeroClass.mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
-/- warning: finset.prod_boole -> Finset.prod_boole is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoidWithZero.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} [_inst_2 : DecidablePred.{succ u2} α p], Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => ite.{succ u1} β (p i) (_inst_2 i) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (MulZeroOneClass.toMulOneClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))))) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))))))) (ite.{succ u1} β (forall (i : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) -> (p i)) (Finset.decidableDforallFinset.{u2} α s (fun (i : α) (H : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) i s) => p i) (fun (a : α) (h : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) => _inst_2 a)) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (MulZeroOneClass.toMulOneClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))))) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoidWithZero.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} [_inst_2 : DecidablePred.{succ u2} α p], Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (i : α) => ite.{succ u1} β (p i) (_inst_2 i) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (MonoidWithZero.toMonoid.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1))))) (ite.{succ u1} β (forall (i : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) -> (p i)) (Finset.decidableDforallFinset.{u2} α s (fun (i : α) (H : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) i s) => p i) (fun (a : α) (h : Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) => (fun (a : α) => _inst_2 a) a)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (MonoidWithZero.toMonoid.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_boole Finset.prod_booleₓ'. -/
theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
(∏ i in s, ite (p i) (1 : β) (0 : β)) = ite (∀ i ∈ s, p i) 1 0 :=
by
@@ -2679,12 +1983,6 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
variable [Nontrivial β] [NoZeroDivisors β]
-/- warning: finset.prod_eq_zero_iff -> Finset.prod_eq_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β] [_inst_2 : Nontrivial.{u1} β] [_inst_3 : NoZeroDivisors.{u1} β (MulZeroClass.toHasMul.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))) (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))], Iff (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))))))) (Exists.{succ u2} α (fun (a : α) => Exists.{0} (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (fun (H : Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) => Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β] [_inst_2 : Nontrivial.{u1} β] [_inst_3 : NoZeroDivisors.{u1} β (MulZeroClass.toMul.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))) (CommMonoidWithZero.toZero.{u1} β _inst_1)], Iff (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))) (Exists.{succ u2} α (fun (a : α) => And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1))))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iffₓ'. -/
theorem prod_eq_zero_iff : (∏ x in s, f x) = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
apply Finset.induction_on s
@@ -2693,24 +1991,12 @@ theorem prod_eq_zero_iff : (∏ x in s, f x) = 0 ↔ ∃ a ∈ s, f a = 0 := by
rw [prod_insert ha, mul_eq_zero, bex_def, exists_mem_insert, ih, ← bex_def]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
-/- warning: finset.prod_ne_zero_iff -> Finset.prod_ne_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β] [_inst_2 : Nontrivial.{u1} β] [_inst_3 : NoZeroDivisors.{u1} β (MulZeroClass.toHasMul.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))) (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1))))], Iff (Ne.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))))))) (forall (a : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) -> (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β] [_inst_2 : Nontrivial.{u1} β] [_inst_3 : NoZeroDivisors.{u1} β (MulZeroClass.toMul.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))) (CommMonoidWithZero.toZero.{u1} β _inst_1)], Iff (Ne.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))) (forall (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iffₓ'. -/
theorem prod_ne_zero_iff : (∏ x in s, f x) ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by rw [Ne, prod_eq_zero_iff];
push_neg
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
end ProdEqZero
-/- warning: finset.prod_unique_nonempty -> Finset.prod_unique_nonempty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : Unique.{succ u1} α] (s : Finset.{u1} α) (f : α -> β), (Finset.Nonempty.{u1} α s) -> (Eq.{succ u2} β (Finset.prod.{u2, u1} β α _inst_1 s (fun (x : α) => f x)) (f (Inhabited.default.{succ u1} α (Unique.inhabited.{succ u1} α _inst_2))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Unique.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), (Finset.Nonempty.{u2} α s) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (f (Inhabited.default.{succ u2} α (Unique.instInhabited.{succ u2} α _inst_2))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_unique_nonempty Finset.prod_unique_nonemptyₓ'. -/
@[to_additive]
theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
(h : s.Nonempty) : (∏ x in s, f x) = f default := by
@@ -2732,23 +2018,11 @@ theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
#align finset.prod_nat_mod Finset.prod_nat_mod
-/
-/- warning: finset.sum_int_mod -> Finset.sum_int_mod is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.sum.{0, u1} Int α Int.addCommMonoid s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.sum.{0, u1} Int α Int.addCommMonoid s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (f i) n)) n)
-but is expected to have type
- forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.sum.{0, u1} Int α Int.instAddCommMonoidInt s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.sum.{0, u1} Int α Int.instAddCommMonoidInt s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (f i) n)) n)
-Case conversion may be inaccurate. Consider using '#align finset.sum_int_mod Finset.sum_int_modₓ'. -/
theorem sum_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
(Multiset.sum_int_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]
#align finset.sum_int_mod Finset.sum_int_mod
-/- warning: finset.prod_int_mod -> Finset.prod_int_mod is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (f i) n)) n)
-but is expected to have type
- forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.prod.{0, u1} Int α Int.instCommMonoidInt s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.prod.{0, u1} Int α Int.instCommMonoidInt s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (f i) n)) n)
-Case conversion may be inaccurate. Consider using '#align finset.prod_int_mod Finset.prod_int_modₓ'. -/
theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
(Multiset.prod_int_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]
@@ -2760,12 +2034,6 @@ namespace Fintype
open Finset
-/- warning: fintype.prod_bijective -> Fintype.prod_bijective is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {M : Type.{u3}} [_inst_1 : Fintype.{u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u3} M] (e : α -> β), (Function.Bijective.{succ u1, succ u2} α β e) -> (forall (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u3} M (f x) (g (e x))) -> (Eq.{succ u3} M (Finset.prod.{u3, u1} M α _inst_3 (Finset.univ.{u1} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u3, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x))))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {M : Type.{u1}} [_inst_1 : Fintype.{u3} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u1} M] (e : α -> β), (Function.Bijective.{succ u3, succ u2} α β e) -> (forall (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u1} M (f x) (g (e x))) -> (Eq.{succ u1} M (Finset.prod.{u1, u3} M α _inst_3 (Finset.univ.{u3} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u1, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x))))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_bijective Fintype.prod_bijectiveₓ'. -/
/-- `fintype.prod_bijective` is a variant of `finset.prod_bij` that accepts `function.bijective`.
See `function.bijective.prod_comp` for a version without `h`. -/
@@ -2780,12 +2048,6 @@ theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid
#align fintype.prod_bijective Fintype.prod_bijective
#align fintype.sum_bijective Fintype.sum_bijective
-/- warning: fintype.prod_equiv -> Fintype.prod_equiv is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {M : Type.{u3}} [_inst_1 : Fintype.{u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u3} M] (e : Equiv.{succ u1, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u3} M (f x) (g (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) e x))) -> (Eq.{succ u3} M (Finset.prod.{u3, u1} M α _inst_3 (Finset.univ.{u1} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u3, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
-but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {M : Type.{u1}} [_inst_1 : Fintype.{u3} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u1} M] (e : Equiv.{succ u3, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u1} M (f x) (g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Equiv.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u3, succ u2} α β) e x))) -> (Eq.{succ u1} M (Finset.prod.{u1, u3} M α _inst_3 (Finset.univ.{u3} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u1, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_equiv Fintype.prod_equivₓ'. -/
/-- `fintype.prod_equiv` is a specialization of `finset.prod_bij` that
automatically fills in most arguments.
@@ -2801,24 +2063,12 @@ theorem prod_equiv {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (
variable {f s}
-/- warning: fintype.prod_unique -> Fintype.prod_unique is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : Unique.{succ u1} α] [_inst_3 : Fintype.{u1} α] (f : α -> β), Eq.{succ u2} β (Finset.prod.{u2, u1} β α _inst_1 (Finset.univ.{u1} α _inst_3) (fun (x : α) => f x)) (f (Inhabited.default.{succ u1} α (Unique.inhabited.{succ u1} α _inst_2)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Unique.{succ u2} α] [_inst_3 : Fintype.{u2} α] (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (x : α) => f x)) (f (Inhabited.default.{succ u2} α (Unique.instInhabited.{succ u2} α _inst_2)))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_unique Fintype.prod_uniqueₓ'. -/
@[to_additive]
theorem prod_unique {α β : Type _} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
(∏ x : α, f x) = f default := by rw [univ_unique, prod_singleton]
#align fintype.prod_unique Fintype.prod_unique
#align fintype.sum_unique Fintype.sum_unique
-/- warning: fintype.prod_empty -> Fintype.prod_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : IsEmpty.{succ u1} α] [_inst_3 : Fintype.{u1} α] (f : α -> β), Eq.{succ u2} β (Finset.prod.{u2, u1} β α _inst_1 (Finset.univ.{u1} α _inst_3) (fun (x : α) => f x)) (OfNat.ofNat.{u2} β 1 (OfNat.mk.{u2} β 1 (One.one.{u2} β (MulOneClass.toHasOne.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : IsEmpty.{succ u2} α] [_inst_3 : Fintype.{u2} α] (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_empty Fintype.prod_emptyₓ'. -/
@[to_additive]
theorem prod_empty {α β : Type _} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
(∏ x : α, f x) = 1 :=
@@ -2826,12 +2076,6 @@ theorem prod_empty {α β : Type _} [CommMonoid β] [IsEmpty α] [Fintype α] (f
#align fintype.prod_empty Fintype.prod_empty
#align fintype.sum_empty Fintype.sum_empty
-/- warning: fintype.prod_subsingleton -> Fintype.prod_subsingleton is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : Subsingleton.{succ u1} α] [_inst_3 : Fintype.{u1} α] (f : α -> β) (a : α), Eq.{succ u2} β (Finset.prod.{u2, u1} β α _inst_1 (Finset.univ.{u1} α _inst_3) (fun (x : α) => f x)) (f a)
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Subsingleton.{succ u2} α] [_inst_3 : Fintype.{u2} α] (f : α -> β) (a : α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (x : α) => f x)) (f a)
-Case conversion may be inaccurate. Consider using '#align fintype.prod_subsingleton Fintype.prod_subsingletonₓ'. -/
@[to_additive]
theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
(a : α) : (∏ x : α, f x) = f a :=
@@ -2841,12 +2085,6 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
#align fintype.prod_subsingleton Fintype.prod_subsingleton
#align fintype.sum_subsingleton Fintype.sum_subsingleton
-/- warning: fintype.prod_subtype_mul_prod_subtype -> Fintype.prod_subtype_mul_prod_subtype is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Fintype.{u1} α] [_inst_2 : CommMonoid.{u2} β] (p : α -> Prop) (f : α -> β) [_inst_3 : DecidablePred.{succ u1} α p], Eq.{succ u2} β (HMul.hMul.{u2, u2, u2} β β β (instHMul.{u2} β (MulOneClass.toHasMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_2)))) (Finset.prod.{u2, u1} β (Subtype.{succ u1} α (fun (x : α) => p x)) _inst_2 (Finset.univ.{u1} (Subtype.{succ u1} α (fun (x : α) => p x)) (Subtype.fintype.{u1} α (fun (x : α) => p x) (fun (a : α) => _inst_3 a) _inst_1)) (fun (i : Subtype.{succ u1} α (fun (x : α) => p x)) => f ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Subtype.{succ u1} α (fun (x : α) => p x)) α (HasLiftT.mk.{succ u1, succ u1} (Subtype.{succ u1} α (fun (x : α) => p x)) α (CoeTCₓ.coe.{succ u1, succ u1} (Subtype.{succ u1} α (fun (x : α) => p x)) α (coeBase.{succ u1, succ u1} (Subtype.{succ u1} α (fun (x : α) => p x)) α (coeSubtype.{succ u1} α (fun (x : α) => p x))))) i))) (Finset.prod.{u2, u1} β (Subtype.{succ u1} α (fun (x : α) => Not (p x))) _inst_2 (Finset.univ.{u1} (Subtype.{succ u1} α (fun (x : α) => Not (p x))) (Subtype.fintype.{u1} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (_inst_3 a)) _inst_1)) (fun (i : Subtype.{succ u1} α (fun (x : α) => Not (p x))) => f ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Subtype.{succ u1} α (fun (x : α) => Not (p x))) α (HasLiftT.mk.{succ u1, succ u1} (Subtype.{succ u1} α (fun (x : α) => Not (p x))) α (CoeTCₓ.coe.{succ u1, succ u1} (Subtype.{succ u1} α (fun (x : α) => Not (p x))) α (coeBase.{succ u1, succ u1} (Subtype.{succ u1} α (fun (x : α) => Not (p x))) α (coeSubtype.{succ u1} α (fun (x : α) => Not (p x)))))) i)))) (Finset.prod.{u2, u1} β α _inst_2 (Finset.univ.{u1} α _inst_1) (fun (i : α) => f i))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Fintype.{u2} α] [_inst_2 : CommMonoid.{u1} β] (p : α -> Prop) (f : α -> β) [_inst_3 : DecidablePred.{succ u2} α p], Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_2)))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => p x)) _inst_2 (Finset.univ.{u2} (Subtype.{succ u2} α (fun (x : α) => p x)) (Subtype.fintype.{u2} α (fun (x : α) => p x) (fun (a : α) => _inst_3 a) _inst_1)) (fun (i : Subtype.{succ u2} α (fun (x : α) => p x)) => f (Subtype.val.{succ u2} α (fun (x : α) => p x) i))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Not (p x))) _inst_2 (Finset.univ.{u2} (Subtype.{succ u2} α (fun (x : α) => Not (p x))) (Subtype.fintype.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (_inst_3 a)) _inst_1)) (fun (i : Subtype.{succ u2} α (fun (x : α) => Not (p x))) => f (Subtype.val.{succ u2} α (fun (x : α) => Not (p x)) i)))) (Finset.prod.{u1, u2} β α _inst_2 (Finset.univ.{u2} α _inst_1) (fun (i : α) => f i))
-Case conversion may be inaccurate. Consider using '#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtypeₓ'. -/
@[to_additive]
theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
@@ -2864,12 +2102,6 @@ end Fintype
namespace List
-/- warning: list.prod_to_finset -> List.prod_toFinset is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : CommMonoid.{u2} M] (f : α -> M) {l : List.{u1} α}, (List.Nodup.{u1} α l) -> (Eq.{succ u2} M (Finset.prod.{u2, u1} M α _inst_2 (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) f) (List.prod.{u2} M (MulOneClass.toHasMul.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_2))) (MulOneClass.toHasOne.{u2} M (Monoid.toMulOneClass.{u2} M (CommMonoid.toMonoid.{u2} M _inst_2))) (List.map.{u1, u2} α M f l)))
-but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : DecidableEq.{succ u2} α] [_inst_2 : CommMonoid.{u1} M] (f : α -> M) {l : List.{u2} α}, (List.Nodup.{u2} α l) -> (Eq.{succ u1} M (Finset.prod.{u1, u2} M α _inst_2 (List.toFinset.{u2} α (fun (a : α) (b : α) => _inst_1 a b) l) f) (List.prod.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_2))) (Monoid.toOne.{u1} M (CommMonoid.toMonoid.{u1} M _inst_2)) (List.map.{u2, u1} α M f l)))
-Case conversion may be inaccurate. Consider using '#align list.prod_to_finset List.prod_toFinsetₓ'. -/
@[to_additive]
theorem prod_toFinset {M : Type _} [DecidableEq α] [CommMonoid M] (f : α → M) :
∀ {l : List α} (hl : l.Nodup), l.toFinset.Prod f = (l.map f).Prod
@@ -2902,12 +2134,6 @@ theorem disjoint_list_sum_right {a : Multiset α} {l : List (Multiset α)} :
#align multiset.disjoint_list_sum_right Multiset.disjoint_list_sum_right
-/
-/- warning: multiset.disjoint_sum_left -> Multiset.disjoint_sum_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {a : Multiset.{u1} α} {i : Multiset.{u1} (Multiset.{u1} α)}, Iff (Multiset.Disjoint.{u1} α (Multiset.sum.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) i) a) (forall (b : Multiset.{u1} α), (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) b i) -> (Multiset.Disjoint.{u1} α b a))
-but is expected to have type
- forall {α : Type.{u1}} {a : Multiset.{u1} α} {i : Multiset.{u1} (Multiset.{u1} α)}, Iff (Multiset.Disjoint.{u1} α (Multiset.sum.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)) i) a) (forall (b : Multiset.{u1} α), (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) b i) -> (Multiset.Disjoint.{u1} α b a))
-Case conversion may be inaccurate. Consider using '#align multiset.disjoint_sum_left Multiset.disjoint_sum_leftₓ'. -/
theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
Multiset.Disjoint i.Sum a ↔ ∀ b ∈ i, Multiset.Disjoint b a :=
Quotient.inductionOn i fun l =>
@@ -2916,23 +2142,11 @@ theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
exact disjoint_list_sum_left
#align multiset.disjoint_sum_left Multiset.disjoint_sum_left
-/- warning: multiset.disjoint_sum_right -> Multiset.disjoint_sum_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {a : Multiset.{u1} α} {i : Multiset.{u1} (Multiset.{u1} α)}, Iff (Multiset.Disjoint.{u1} α a (Multiset.sum.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) i)) (forall (b : Multiset.{u1} α), (Membership.Mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.hasMem.{u1} (Multiset.{u1} α)) b i) -> (Multiset.Disjoint.{u1} α a b))
-but is expected to have type
- forall {α : Type.{u1}} {a : Multiset.{u1} α} {i : Multiset.{u1} (Multiset.{u1} α)}, Iff (Multiset.Disjoint.{u1} α a (Multiset.sum.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)) i)) (forall (b : Multiset.{u1} α), (Membership.mem.{u1, u1} (Multiset.{u1} α) (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instMembershipMultiset.{u1} (Multiset.{u1} α)) b i) -> (Multiset.Disjoint.{u1} α a b))
-Case conversion may be inaccurate. Consider using '#align multiset.disjoint_sum_right Multiset.disjoint_sum_rightₓ'. -/
theorem disjoint_sum_right {a : Multiset α} {i : Multiset (Multiset α)} :
Multiset.Disjoint a i.Sum ↔ ∀ b ∈ i, Multiset.Disjoint a b := by
simpa only [disjoint_comm] using disjoint_sum_left
#align multiset.disjoint_sum_right Multiset.disjoint_sum_right
-/- warning: multiset.disjoint_finset_sum_left -> Multiset.disjoint_finset_sum_left is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {i : Finset.{u2} β} {f : β -> (Multiset.{u1} α)} {a : Multiset.{u1} α}, Iff (Multiset.Disjoint.{u1} α (Finset.sum.{u1, u2} (Multiset.{u1} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) i f) a) (forall (b : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b i) -> (Multiset.Disjoint.{u1} α (f b) a))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {i : Finset.{u1} β} {f : β -> (Multiset.{u2} α)} {a : Multiset.{u2} α}, Iff (Multiset.Disjoint.{u2} α (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) i f) a) (forall (b : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) b i) -> (Multiset.Disjoint.{u2} α (f b) a))
-Case conversion may be inaccurate. Consider using '#align multiset.disjoint_finset_sum_left Multiset.disjoint_finset_sum_leftₓ'. -/
theorem disjoint_finset_sum_left {β : Type _} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
Multiset.Disjoint (i.Sum f) a ↔ ∀ b ∈ i, Multiset.Disjoint (f b) a :=
by
@@ -2940,12 +2154,6 @@ theorem disjoint_finset_sum_left {β : Type _} {i : Finset β} {f : β → Multi
simp [and_congr_left_iff, iff_self_iff]
#align multiset.disjoint_finset_sum_left Multiset.disjoint_finset_sum_left
-/- warning: multiset.disjoint_finset_sum_right -> Multiset.disjoint_finset_sum_right is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} {i : Finset.{u2} β} {f : β -> (Multiset.{u1} α)} {a : Multiset.{u1} α}, Iff (Multiset.Disjoint.{u1} α a (Finset.sum.{u1, u2} (Multiset.{u1} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) i f)) (forall (b : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b i) -> (Multiset.Disjoint.{u1} α a (f b)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} {i : Finset.{u1} β} {f : β -> (Multiset.{u2} α)} {a : Multiset.{u2} α}, Iff (Multiset.Disjoint.{u2} α a (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) i f)) (forall (b : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) b i) -> (Multiset.Disjoint.{u2} α a (f b)))
-Case conversion may be inaccurate. Consider using '#align multiset.disjoint_finset_sum_right Multiset.disjoint_finset_sum_rightₓ'. -/
theorem disjoint_finset_sum_right {β : Type _} {i : Finset β} {f : β → Multiset α}
{a : Multiset α} : Multiset.Disjoint a (i.Sum f) ↔ ∀ b ∈ i, Multiset.Disjoint a (f b) := by
simpa only [disjoint_comm] using disjoint_finset_sum_left
@@ -2953,12 +2161,6 @@ theorem disjoint_finset_sum_right {β : Type _} {i : Finset β} {f : β → Mult
variable [DecidableEq α]
-/- warning: multiset.add_eq_union_left_of_le -> Multiset.add_eq_union_left_of_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) y x) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.hasAdd.{u1} α)) z x) (Union.union.{u1} (Multiset.{u1} α) (Multiset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) z y)) (And (Multiset.Disjoint.{u1} α z x) (Eq.{succ u1} (Multiset.{u1} α) x y)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) y x) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.instAddMultiset.{u1} α)) z x) (Union.union.{u1} (Multiset.{u1} α) (Multiset.instUnionMultiset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) z y)) (And (Multiset.Disjoint.{u1} α z x) (Eq.{succ u1} (Multiset.{u1} α) x y)))
-Case conversion may be inaccurate. Consider using '#align multiset.add_eq_union_left_of_le Multiset.add_eq_union_left_of_leₓ'. -/
theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
z + x = z ∪ y ↔ z.Disjoint x ∧ x = y :=
by
@@ -2973,23 +2175,11 @@ theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
exact h0
#align multiset.add_eq_union_left_of_le Multiset.add_eq_union_left_of_le
-/- warning: multiset.add_eq_union_right_of_le -> Multiset.add_eq_union_right_of_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) z y) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.hasAdd.{u1} α)) x y) (Union.union.{u1} (Multiset.{u1} α) (Multiset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) x z)) (And (Eq.{succ u1} (Multiset.{u1} α) y z) (Multiset.Disjoint.{u1} α x y)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) z y) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.instAddMultiset.{u1} α)) x y) (Union.union.{u1} (Multiset.{u1} α) (Multiset.instUnionMultiset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) x z)) (And (Eq.{succ u1} (Multiset.{u1} α) y z) (Multiset.Disjoint.{u1} α x y)))
-Case conversion may be inaccurate. Consider using '#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_leₓ'. -/
theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
x + y = x ∪ z ↔ y = z ∧ x.Disjoint y := by
simpa only [and_comm'] using add_eq_union_left_of_le h
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-/- warning: multiset.finset_sum_eq_sup_iff_disjoint -> Multiset.finset_sum_eq_sup_iff_disjoint is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {β : Type.{u2}} {i : Finset.{u2} β} {f : β -> (Multiset.{u1} α)}, Iff (Eq.{succ u1} (Multiset.{u1} α) (Finset.sum.{u1, u2} (Multiset.{u1} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) i f) (Finset.sup.{u1, u2} (Multiset.{u1} α) β (Lattice.toSemilatticeSup.{u1} (Multiset.{u1} α) (Multiset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b))) (Multiset.orderBot.{u1} α) i f)) (forall (x : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) x i) -> (forall (y : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) y i) -> (Ne.{succ u2} β x y) -> (Multiset.Disjoint.{u1} α (f x) (f y))))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} α] {β : Type.{u1}} {i : Finset.{u1} β} {f : β -> (Multiset.{u2} α)}, Iff (Eq.{succ u2} (Multiset.{u2} α) (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) i f) (Finset.sup.{u2, u1} (Multiset.{u2} α) β (Lattice.toSemilatticeSup.{u2} (Multiset.{u2} α) (Multiset.instLatticeMultiset.{u2} α (fun (a : α) (b : α) => _inst_1 a b))) (Multiset.instOrderBotMultisetToLEToPreorderInstPartialOrderMultiset.{u2} α) i f)) (forall (x : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) x i) -> (forall (y : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) y i) -> (Ne.{succ u1} β x y) -> (Multiset.Disjoint.{u2} α (f x) (f y))))
-Case conversion may be inaccurate. Consider using '#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjointₓ'. -/
/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∈ » i) -/
/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » i) -/
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
@@ -3009,12 +2199,6 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
exact add_eq_union_left_of_le (Finset.sup_le fun x hx => le_sum_of_mem (mem_map_of_mem f hx))
#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjoint
-/- warning: multiset.sup_powerset_len -> Multiset.sup_powerset_len is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Finset.sup.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (Lattice.toSemilatticeSup.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.lattice.{u1} (Multiset.{u1} α) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a b))) (Multiset.orderBot.{u1} (Multiset.{u1} α)) (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) x) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k x)) (Multiset.powerset.{u1} α x)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Finset.sup.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (Lattice.toSemilatticeSup.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instLatticeMultiset.{u1} (Multiset.{u1} α) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a b))) (Multiset.instOrderBotMultisetToLEToPreorderInstPartialOrderMultiset.{u1} (Multiset.{u1} α)) (Finset.range (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) x) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) x) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) x) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) x) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k x)) (Multiset.powerset.{u1} α x)
-Case conversion may be inaccurate. Consider using '#align multiset.sup_powerset_len Multiset.sup_powerset_lenₓ'. -/
theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
(Finset.sup (Finset.range (x.card + 1)) fun k => x.powersetLen k) = x.powerset :=
by
@@ -3024,12 +2208,6 @@ theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
Eq.symm (finset_sum_eq_sup_iff_disjoint.mpr fun _ _ _ _ h => pairwise_disjoint_powerset_len x h)
#align multiset.sup_powerset_len Multiset.sup_powerset_len
-/- warning: multiset.to_finset_sum_count_eq -> Multiset.toFinset_sum_count_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{1} Nat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s)) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{1} Nat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s)
-Case conversion may be inaccurate. Consider using '#align multiset.to_finset_sum_count_eq Multiset.toFinset_sum_count_eqₓ'. -/
@[simp]
theorem toFinset_sum_count_eq (s : Multiset α) : (∑ a in s.toFinset, s.count a) = s.card :=
calc
@@ -3040,33 +2218,15 @@ theorem toFinset_sum_count_eq (s : Multiset α) : (∑ a in s.toFinset, s.count
#align multiset.to_finset_sum_count_eq Multiset.toFinset_sum_count_eq
-/- warning: multiset.count_sum' -> Multiset.count_sum' is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} α] {s : Finset.{u1} β} {a : α} {f : β -> (Multiset.{u2} α)}, Eq.{1} Nat (Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_1 a b) a (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.orderedCancelAddCommMonoid.{u2} α)) s (fun (x : β) => f x))) (Finset.sum.{0, u1} Nat β Nat.addCommMonoid s (fun (x : β) => Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_1 a b) a (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} α] {s : Finset.{u1} β} {a : α} {f : β -> (Multiset.{u2} α)}, Eq.{1} Nat (Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_1 a b) a (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) s (fun (x : β) => f x))) (Finset.sum.{0, u1} Nat β Nat.addCommMonoid s (fun (x : β) => Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_1 a b) a (f x)))
-Case conversion may be inaccurate. Consider using '#align multiset.count_sum' Multiset.count_sum'ₓ'. -/
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
count a (∑ x in s, f x) = ∑ x in s, count a (f x) := by dsimp only [Finset.sum]; rw [count_sum]
#align multiset.count_sum' Multiset.count_sum'
-/- warning: multiset.to_finset_sum_count_nsmul_eq -> Multiset.toFinset_sum_count_nsmul_eq is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} α) (Finset.sum.{u1, u1} (Multiset.{u1} α) α (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => SMul.smul.{0, u1} Nat (Multiset.{u1} α) (AddMonoid.SMul.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.hasSingleton.{u1} α) a))) s
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} α) (Finset.sum.{u1, u1} (Multiset.{u1} α) α (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)) (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => HSMul.hSMul.{0, u1, u1} Nat (Multiset.{u1} α) (Multiset.{u1} α) (instHSMul.{0, u1} Nat (Multiset.{u1} α) (AddMonoid.SMul.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s) (Singleton.singleton.{u1, u1} α (Multiset.{u1} α) (Multiset.instSingletonMultiset.{u1} α) a))) s
-Case conversion may be inaccurate. Consider using '#align multiset.to_finset_sum_count_nsmul_eq Multiset.toFinset_sum_count_nsmul_eqₓ'. -/
@[simp]
theorem toFinset_sum_count_nsmul_eq (s : Multiset α) : (∑ a in s.toFinset, s.count a • {a}) = s :=
by rw [← Finset.sum_multiset_map_count, Multiset.sum_map_singleton]
#align multiset.to_finset_sum_count_nsmul_eq Multiset.toFinset_sum_count_nsmul_eq
-/- warning: multiset.exists_smul_of_dvd_count -> Multiset.exists_smul_of_dvd_count is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α) {k : Nat}, (forall (a : α), (Membership.Mem.{u1, u1} α (Multiset.{u1} α) (Multiset.hasMem.{u1} α) a s) -> (Dvd.Dvd.{0} Nat Nat.hasDvd k (Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s))) -> (Exists.{succ u1} (Multiset.{u1} α) (fun (u : Multiset.{u1} α) => Eq.{succ u1} (Multiset.{u1} α) s (SMul.smul.{0, u1} Nat (Multiset.{u1} α) (AddMonoid.SMul.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) k u)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α) {k : Nat}, (forall (a : α), (Membership.mem.{u1, u1} α (Multiset.{u1} α) (Multiset.instMembershipMultiset.{u1} α) a s) -> (Dvd.dvd.{0} Nat Nat.instDvdNat k (Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s))) -> (Exists.{succ u1} (Multiset.{u1} α) (fun (u : Multiset.{u1} α) => Eq.{succ u1} (Multiset.{u1} α) s (HSMul.hSMul.{0, u1, u1} Nat (Multiset.{u1} α) (Multiset.{u1} α) (instHSMul.{0, u1} Nat (Multiset.{u1} α) (AddMonoid.SMul.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) k u)))
-Case conversion may be inaccurate. Consider using '#align multiset.exists_smul_of_dvd_count Multiset.exists_smul_of_dvd_countₓ'. -/
theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
(h : ∀ a : α, a ∈ s → k ∣ Multiset.count a s) : ∃ u : Multiset α, s = k • u :=
by
@@ -3090,12 +2250,6 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.Pr
#align multiset.to_finset_prod_dvd_prod Multiset.toFinset_prod_dvd_prod
-/
-/- warning: multiset.prod_sum -> Multiset.prod_sum is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {ι : Type.{u2}} [_inst_2 : CommMonoid.{u1} α] (f : ι -> (Multiset.{u1} α)) (s : Finset.{u2} ι), Eq.{succ u1} α (Multiset.prod.{u1} α _inst_2 (Finset.sum.{u1, u2} (Multiset.{u1} α) ι (OrderedCancelAddCommMonoid.toAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)) s (fun (x : ι) => f x))) (Finset.prod.{u1, u2} α ι _inst_2 s (fun (x : ι) => Multiset.prod.{u1} α _inst_2 (f x)))
-but is expected to have type
- forall {α : Type.{u2}} {ι : Type.{u1}} [_inst_2 : CommMonoid.{u2} α] (f : ι -> (Multiset.{u2} α)) (s : Finset.{u1} ι), Eq.{succ u2} α (Multiset.prod.{u2} α _inst_2 (Finset.sum.{u2, u1} (Multiset.{u2} α) ι (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) s (fun (x : ι) => f x))) (Finset.prod.{u2, u1} α ι _inst_2 s (fun (x : ι) => Multiset.prod.{u2} α _inst_2 (f x)))
-Case conversion may be inaccurate. Consider using '#align multiset.prod_sum Multiset.prod_sumₓ'. -/
@[to_additive]
theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
(∑ x in s, f x).Prod = ∏ x in s, (f x).Prod := by
@@ -3110,23 +2264,11 @@ end Multiset
namespace Nat
-/- warning: nat.cast_list_sum -> Nat.cast_list_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : AddMonoidWithOne.{u1} β] (s : List.{0} Nat), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat β (HasLiftT.mk.{1, succ u1} Nat β (CoeTCₓ.coe.{1, succ u1} Nat β (Nat.castCoe.{u1} β (AddMonoidWithOne.toNatCast.{u1} β _inst_1)))) (List.sum.{0} Nat Nat.hasAdd Nat.hasZero s)) (List.sum.{u1} β (AddZeroClass.toHasAdd.{u1} β (AddMonoid.toAddZeroClass.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β _inst_1))) (AddZeroClass.toHasZero.{u1} β (AddMonoid.toAddZeroClass.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β _inst_1))) (List.map.{0, u1} Nat β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat β (HasLiftT.mk.{1, succ u1} Nat β (CoeTCₓ.coe.{1, succ u1} Nat β (Nat.castCoe.{u1} β (AddMonoidWithOne.toNatCast.{u1} β _inst_1))))) s))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : AddMonoidWithOne.{u1} β] (s : List.{0} Nat), Eq.{succ u1} β (Nat.cast.{u1} β (AddMonoidWithOne.toNatCast.{u1} β _inst_1) (List.sum.{0} Nat instAddNat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) s)) (List.sum.{u1} β (AddZeroClass.toAdd.{u1} β (AddMonoid.toAddZeroClass.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β _inst_1))) (AddMonoid.toZero.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β _inst_1)) (List.map.{0, u1} Nat β (Nat.cast.{u1} β (AddMonoidWithOne.toNatCast.{u1} β _inst_1)) s))
-Case conversion may be inaccurate. Consider using '#align nat.cast_list_sum Nat.cast_list_sumₓ'. -/
@[simp, norm_cast]
theorem cast_list_sum [AddMonoidWithOne β] (s : List ℕ) : (↑s.Sum : β) = (s.map coe).Sum :=
map_list_sum (castAddMonoidHom β) _
#align nat.cast_list_sum Nat.cast_list_sum
-/- warning: nat.cast_list_prod -> Nat.cast_list_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : Semiring.{u1} β] (s : List.{0} Nat), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat β (HasLiftT.mk.{1, succ u1} Nat β (CoeTCₓ.coe.{1, succ u1} Nat β (Nat.castCoe.{u1} β (AddMonoidWithOne.toNatCast.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))))))) (List.prod.{0} Nat Nat.hasMul Nat.hasOne s)) (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (List.map.{0, u1} Nat β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat β (HasLiftT.mk.{1, succ u1} Nat β (CoeTCₓ.coe.{1, succ u1} Nat β (Nat.castCoe.{u1} β (AddMonoidWithOne.toNatCast.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))))))) s))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : Semiring.{u1} β] (s : List.{0} Nat), Eq.{succ u1} β (Nat.cast.{u1} β (Semiring.toNatCast.{u1} β _inst_1) (List.prod.{0} Nat instMulNat (CanonicallyOrderedCommSemiring.toOne.{0} Nat Nat.canonicallyOrderedCommSemiring) s)) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) (List.map.{0, u1} Nat β (Nat.cast.{u1} β (Semiring.toNatCast.{u1} β _inst_1)) s))
-Case conversion may be inaccurate. Consider using '#align nat.cast_list_prod Nat.cast_list_prodₓ'. -/
@[simp, norm_cast]
theorem cast_list_prod [Semiring β] (s : List ℕ) : (↑s.Prod : β) = (s.map coe).Prod :=
map_list_prod (castRingHom β) _
@@ -3167,70 +2309,34 @@ end Nat
namespace Int
-/- warning: int.cast_list_sum -> Int.cast_list_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : AddGroupWithOne.{u1} β] (s : List.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β _inst_1)))) (List.sum.{0} Int Int.hasAdd Int.hasZero s)) (List.sum.{u1} β (AddZeroClass.toHasAdd.{u1} β (AddMonoid.toAddZeroClass.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β _inst_1)))) (AddZeroClass.toHasZero.{u1} β (AddMonoid.toAddZeroClass.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β _inst_1)))) (List.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β _inst_1))))) s))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : AddGroupWithOne.{u1} β] (s : List.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (AddGroupWithOne.toIntCast.{u1} β _inst_1) (List.sum.{0} Int Int.instAddInt (CommMonoidWithZero.toZero.{0} Int (CommSemiring.toCommMonoidWithZero.{0} Int Int.instCommSemiringInt)) s)) (List.sum.{u1} β (AddZeroClass.toAdd.{u1} β (AddMonoid.toAddZeroClass.{u1} β (AddMonoidWithOne.toAddMonoid.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β _inst_1)))) (NegZeroClass.toZero.{u1} β (SubNegZeroMonoid.toNegZeroClass.{u1} β (SubtractionMonoid.toSubNegZeroMonoid.{u1} β (AddGroup.toSubtractionMonoid.{u1} β (AddGroupWithOne.toAddGroup.{u1} β _inst_1))))) (List.map.{0, u1} Int β (Int.cast.{u1} β (AddGroupWithOne.toIntCast.{u1} β _inst_1)) s))
-Case conversion may be inaccurate. Consider using '#align int.cast_list_sum Int.cast_list_sumₓ'. -/
@[simp, norm_cast]
theorem cast_list_sum [AddGroupWithOne β] (s : List ℤ) : (↑s.Sum : β) = (s.map coe).Sum :=
map_list_sum (castAddHom β) _
#align int.cast_list_sum Int.cast_list_sum
-/- warning: int.cast_list_prod -> Int.cast_list_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1)))))) (List.prod.{0} Int Int.hasMul Int.hasOne s)) (List.prod.{u1} β (Distrib.toHasMul.{u1} β (Ring.toDistrib.{u1} β _inst_1)) (AddMonoidWithOne.toOne.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1)))) (List.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1))))))) s))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1) (List.prod.{0} Int Int.instMulInt (Semiring.toOne.{0} Int Int.instSemiringInt) s)) (List.prod.{u1} β (NonUnitalNonAssocRing.toMul.{u1} β (NonAssocRing.toNonUnitalNonAssocRing.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1))) (Semiring.toOne.{u1} β (Ring.toSemiring.{u1} β _inst_1)) (List.map.{0, u1} Int β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1)) s))
-Case conversion may be inaccurate. Consider using '#align int.cast_list_prod Int.cast_list_prodₓ'. -/
@[simp, norm_cast]
theorem cast_list_prod [Ring β] (s : List ℤ) : (↑s.Prod : β) = (s.map coe).Prod :=
map_list_prod (castRingHom β) _
#align int.cast_list_prod Int.cast_list_prod
-/- warning: int.cast_multiset_sum -> Int.cast_multiset_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Multiset.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1))))) (Multiset.sum.{0} Int Int.addCommMonoid s)) (Multiset.sum.{u1} β (AddCommGroup.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommGroup.{u1} β _inst_1)) (Multiset.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1)))))) s))
-but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Multiset.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (Multiset.sum.{0} Int Int.instAddCommMonoidInt s)) (Multiset.sum.{u1} β (AddCommMonoidWithOne.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommMonoidWithOne.{u1} β _inst_1)) (Multiset.map.{0, u1} Int β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1)) s))
-Case conversion may be inaccurate. Consider using '#align int.cast_multiset_sum Int.cast_multiset_sumₓ'. -/
@[simp, norm_cast]
theorem cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
(↑s.Sum : β) = (s.map coe).Sum :=
map_multiset_sum (castAddHom β) _
#align int.cast_multiset_sum Int.cast_multiset_sum
-/- warning: int.cast_multiset_prod -> Int.cast_multiset_prod is a dubious translation:
-lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Multiset.{0} Int), Eq.{succ u1} R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int R (HasLiftT.mk.{1, succ u1} Int R (CoeTCₓ.coe.{1, succ u1} Int R (Int.castCoe.{u1} R (AddGroupWithOne.toHasIntCast.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1))))))) (Multiset.prod.{0} Int Int.commMonoid s)) (Multiset.prod.{u1} R (CommRing.toCommMonoid.{u1} R _inst_1) (Multiset.map.{0, u1} Int R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int R (HasLiftT.mk.{1, succ u1} Int R (CoeTCₓ.coe.{1, succ u1} Int R (Int.castCoe.{u1} R (AddGroupWithOne.toHasIntCast.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) s))
-but is expected to have type
- forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Multiset.{0} Int), Eq.{succ u1} R (Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Multiset.prod.{0} Int Int.instCommMonoidInt s)) (Multiset.prod.{u1} R (CommRing.toCommMonoid.{u1} R _inst_1) (Multiset.map.{0, u1} Int R (Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1))) s))
-Case conversion may be inaccurate. Consider using '#align int.cast_multiset_prod Int.cast_multiset_prodₓ'. -/
@[simp, norm_cast]
theorem cast_multiset_prod {R : Type _} [CommRing R] (s : Multiset ℤ) :
(↑s.Prod : R) = (s.map coe).Prod :=
map_multiset_prod (castRingHom R) _
#align int.cast_multiset_prod Int.cast_multiset_prod
-/- warning: int.cast_sum -> Int.cast_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Finset.{u2} α) (f : α -> Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1))))) (Finset.sum.{0, u2} Int α Int.addCommMonoid s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α (AddCommGroup.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommGroup.{u1} β _inst_1)) s (fun (x : α) => (fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1))))) (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Finset.{u2} α) (f : α -> Int), Eq.{succ u1} β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (Finset.sum.{0, u2} Int α Int.instAddCommMonoidInt s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α (AddCommMonoidWithOne.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommMonoidWithOne.{u1} β _inst_1)) s (fun (x : α) => Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (f x)))
-Case conversion may be inaccurate. Consider using '#align int.cast_sum Int.cast_sumₓ'. -/
@[simp, norm_cast]
theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
↑(∑ x in s, f x : ℤ) = ∑ x in s, (f x : β) :=
map_sum (castAddHom β) _ _
#align int.cast_sum Int.cast_sum
-/- warning: int.cast_prod -> Int.cast_prod is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : CommRing.{u2} R] (f : α -> Int) (s : Finset.{u1} α), Eq.{succ u2} R ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int R (HasLiftT.mk.{1, succ u2} Int R (CoeTCₓ.coe.{1, succ u2} Int R (Int.castCoe.{u2} R (AddGroupWithOne.toHasIntCast.{u2} R (AddCommGroupWithOne.toAddGroupWithOne.{u2} R (Ring.toAddCommGroupWithOne.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => f i))) (Finset.prod.{u2, u1} R α (CommRing.toCommMonoid.{u2} R _inst_1) s (fun (i : α) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int R (HasLiftT.mk.{1, succ u2} Int R (CoeTCₓ.coe.{1, succ u2} Int R (Int.castCoe.{u2} R (AddGroupWithOne.toHasIntCast.{u2} R (AddCommGroupWithOne.toAddGroupWithOne.{u2} R (Ring.toAddCommGroupWithOne.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) (f i)))
-but is expected to have type
- forall {α : Type.{u2}} {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (f : α -> Int) (s : Finset.{u2} α), Eq.{succ u1} R (Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Finset.prod.{0, u2} Int α Int.instCommMonoidInt s (fun (i : α) => f i))) (Finset.prod.{u1, u2} R α (CommRing.toCommMonoid.{u1} R _inst_1) s (fun (i : α) => Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1)) (f i)))
-Case conversion may be inaccurate. Consider using '#align int.cast_prod Int.cast_prodₓ'. -/
@[simp, norm_cast]
theorem cast_prod {R : Type _} [CommRing R] (f : α → ℤ) (s : Finset α) :
(↑(∏ i in s, f i) : R) = ∏ i in s, f i :=
@@ -3239,36 +2345,18 @@ theorem cast_prod {R : Type _} [CommRing R] (f : α → ℤ) (s : Finset α) :
end Int
-/- warning: units.coe_prod -> Units.coe_prod is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {M : Type.{u2}} [_inst_1 : CommMonoid.{u2} M] (f : α -> (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1))) (s : Finset.{u1} α), Eq.{succ u2} M ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (HasLiftT.mk.{succ u2, succ u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (CoeTCₓ.coe.{succ u2, succ u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (coeBase.{succ u2, succ u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (Units.hasCoe.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1))))) (Finset.prod.{u2, u1} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) α (CommGroup.toCommMonoid.{u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) (Units.instCommGroupUnitsToMonoid.{u2} M _inst_1)) s (fun (i : α) => f i))) (Finset.prod.{u2, u1} M α _inst_1 s (fun (i : α) => (fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (HasLiftT.mk.{succ u2, succ u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (CoeTCₓ.coe.{succ u2, succ u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (coeBase.{succ u2, succ u2} (Units.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1)) M (Units.hasCoe.{u2} M (CommMonoid.toMonoid.{u2} M _inst_1))))) (f i)))
-but is expected to have type
- forall {α : Type.{u2}} {M : Type.{u1}} [_inst_1 : CommMonoid.{u1} M] (f : α -> (Units.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))) (s : Finset.{u2} α), Eq.{succ u1} M (Units.val.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1) (Finset.prod.{u1, u2} (Units.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1)) α (CommGroup.toCommMonoid.{u1} (Units.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1)) (Units.instCommGroupUnitsToMonoid.{u1} M _inst_1)) s (fun (i : α) => f i))) (Finset.prod.{u1, u2} M α _inst_1 s (fun (i : α) => Units.val.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1) (f i)))
-Case conversion may be inaccurate. Consider using '#align units.coe_prod Units.coe_prodₓ'. -/
@[simp, norm_cast]
theorem Units.coe_prod {M : Type _} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
(↑(∏ i in s, f i) : M) = ∏ i in s, f i :=
(Units.coeHom M).map_prod _ _
#align units.coe_prod Units.coe_prod
-/- warning: units.mk0_prod -> Units.mk0_prod is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommGroupWithZero.{u1} β] (s : Finset.{u2} α) (f : α -> β) (h : Ne.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1)) s (fun (b : α) => f b)) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1))))))))), Eq.{succ u1} (Units.{u1} β (MonoidWithZero.toMonoid.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))) (Units.mk0.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1) (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1)) s (fun (b : α) => f b)) h) (Finset.prod.{u1, u2} (Units.{u1} β (MonoidWithZero.toMonoid.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))) (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) (CommGroup.toCommMonoid.{u1} (Units.{u1} β (MonoidWithZero.toMonoid.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))) (Units.instCommGroupUnitsToMonoid.{u1} β (CommMonoidWithZero.toCommMonoid.{u1} β (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1)))) (Finset.attach.{u2} α s) (fun (b : Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) => Units.mk0.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1) (f ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (HasLiftT.mk.{succ u2, succ u2} (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (CoeTCₓ.coe.{succ u2, succ u2} (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (coeBase.{succ u2, succ u2} (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (coeSubtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s))))) b)) (fun (hh : Eq.{succ u1} β (f ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (HasLiftT.mk.{succ u2, succ u2} (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (CoeTCₓ.coe.{succ u2, succ u2} (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (coeBase.{succ u2, succ u2} (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s)) α (coeSubtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s))))) b)) (OfNat.ofNat.{u1} β 0 (OfNat.mk.{u1} β 0 (Zero.zero.{u1} β (MulZeroClass.toHasZero.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1))))))))) => h (Finset.prod_eq_zero.{u1, u2} β α s (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) b) (fun (b : α) => f b) (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1) (Subtype.property.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) b) hh))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommGroupWithZero.{u1} β] (s : Finset.{u2} α) (f : α -> β) (h : Ne.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1)) s (fun (b : α) => f b)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (MonoidWithZero.toZero.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))))), Eq.{succ u1} (Units.{u1} β (MonoidWithZero.toMonoid.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))) (Units.mk0.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1) (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1)) s (fun (b : α) => f b)) h) (Finset.prod.{u1, u2} (Units.{u1} β (MonoidWithZero.toMonoid.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))) (Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s)) (CommGroup.toCommMonoid.{u1} (Units.{u1} β (MonoidWithZero.toMonoid.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))) (Units.instCommGroupUnitsToMonoid.{u1} β (CommMonoidWithZero.toCommMonoid.{u1} β (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1)))) (Finset.attach.{u2} α s) (fun (b : Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s)) => Units.mk0.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1) (f (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) b)) (fun (hh : Eq.{succ u1} β (f (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) b)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (MonoidWithZero.toZero.{u1} β (GroupWithZero.toMonoidWithZero.{u1} β (CommGroupWithZero.toGroupWithZero.{u1} β _inst_1)))))) => h (Finset.prod_eq_zero.{u1, u2} β α s (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) b) (fun (b : α) => f b) (CommGroupWithZero.toCommMonoidWithZero.{u1} β _inst_1) (Subtype.property.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) b) hh))))
-Case conversion may be inaccurate. Consider using '#align units.mk0_prod Units.mk0_prodₓ'. -/
theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h) :
Units.mk0 (∏ b in s, f b) h =
∏ b in s.attach, Units.mk0 (f b) fun hh => h (Finset.prod_eq_zero b.2 hh) :=
by classical induction s using Finset.induction_on <;> simp [*]
#align units.mk0_prod Units.mk0_prod
-/- warning: nat_abs_sum_le -> nat_abs_sum_le is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u1}} (s : Finset.{u1} ι) (f : ι -> Int), LE.le.{0} Nat Nat.hasLe (Int.natAbs (Finset.sum.{0, u1} Int ι Int.addCommMonoid s (fun (i : ι) => f i))) (Finset.sum.{0, u1} Nat ι Nat.addCommMonoid s (fun (i : ι) => Int.natAbs (f i)))
-but is expected to have type
- forall {ι : Type.{u1}} (s : Finset.{u1} ι) (f : ι -> Int), LE.le.{0} Nat instLENat (Int.natAbs (Finset.sum.{0, u1} Int ι Int.instAddCommMonoidInt s (fun (i : ι) => f i))) (Finset.sum.{0, u1} Nat ι Nat.addCommMonoid s (fun (i : ι) => Int.natAbs (f i)))
-Case conversion may be inaccurate. Consider using '#align nat_abs_sum_le nat_abs_sum_leₓ'. -/
theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
(∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
classical
@@ -3339,23 +2427,11 @@ theorem toMul_multiset_sum (s : Multiset (Additive α)) : toMul s.Sum = (s.map t
#align to_mul_multiset_sum toMul_multiset_sum
-/
-/- warning: of_mul_prod -> ofMul_prod is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> α), Eq.{succ u1} (Additive.{u1} α) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Additive.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Additive.{u1} α)) => α -> (Additive.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Additive.{u1} α)) (Additive.ofMul.{u1} α) (Finset.prod.{u1, u2} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u1, u2} (Additive.{u1} α) ι (Additive.addCommMonoid.{u1} α _inst_1) s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Additive.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Additive.{u1} α)) => α -> (Additive.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Additive.{u1} α)) (Additive.ofMul.{u1} α) (f i)))
-but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Additive.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (f i)))
-Case conversion may be inaccurate. Consider using '#align of_mul_prod ofMul_prodₓ'. -/
@[simp]
theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) = ∑ i in s, ofMul (f i) :=
rfl
#align of_mul_prod ofMul_prod
-/- warning: to_mul_sum -> toMul_sum is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> (Additive.{u1} α)), Eq.{succ u1} α (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Additive.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Additive.{u1} α) α) => (Additive.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Additive.{u1} α) α) (Additive.toMul.{u1} α) (Finset.sum.{u1, u2} (Additive.{u1} α) ι (Additive.addCommMonoid.{u1} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u1, u2} α ι _inst_1 s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Additive.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Additive.{u1} α) α) => (Additive.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Additive.{u1} α) α) (Additive.toMul.{u1} α) (f i)))
-but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Additive.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Additive.{u2} α) => α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (f i)))
-Case conversion may be inaccurate. Consider using '#align to_mul_sum toMul_sumₓ'. -/
@[simp]
theorem toMul_sum (s : Finset ι) (f : ι → Additive α) :
toMul (∑ i in s, f i) = ∏ i in s, toMul (f i) :=
@@ -3381,23 +2457,11 @@ theorem toAdd_multiset_sum (s : Multiset (Multiplicative α)) : toAdd s.Prod = (
#align to_add_multiset_sum toAdd_multiset_sum
-/
-/- warning: of_add_sum -> ofAdd_sum is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> α), Eq.{succ u1} (Multiplicative.{u1} α) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) => α -> (Multiplicative.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Multiplicative.{u1} α)) (Multiplicative.ofAdd.{u1} α) (Finset.sum.{u1, u2} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u1, u2} (Multiplicative.{u1} α) ι (Multiplicative.commMonoid.{u1} α _inst_1) s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) => α -> (Multiplicative.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Multiplicative.{u1} α)) (Multiplicative.ofAdd.{u1} α) (f i)))
-but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Multiplicative.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (f i)))
-Case conversion may be inaccurate. Consider using '#align of_add_sum ofAdd_sumₓ'. -/
@[simp]
theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) = ∏ i in s, ofAdd (f i) :=
rfl
#align of_add_sum ofAdd_sum
-/- warning: to_add_prod -> toAdd_prod is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> (Multiplicative.{u1} α)), Eq.{succ u1} α (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) => (Multiplicative.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Multiplicative.{u1} α) α) (Multiplicative.toAdd.{u1} α) (Finset.prod.{u1, u2} (Multiplicative.{u1} α) ι (Multiplicative.commMonoid.{u1} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u1, u2} α ι _inst_1 s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) => (Multiplicative.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Multiplicative.{u1} α) α) (Multiplicative.toAdd.{u1} α) (f i)))
-but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Multiplicative.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Multiplicative.{u2} α) => α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (f i)))
-Case conversion may be inaccurate. Consider using '#align to_add_prod toAdd_prodₓ'. -/
@[simp]
theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
toAdd (∏ i in s, f i) = ∑ i in s, toAdd (f i) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -484,10 +484,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.prod_disj_union Finset.prod_disjUnionₓ'. -/
@[to_additive]
theorem prod_disjUnion (h) : (∏ x in s₁.disjUnion s₂ h, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
- by
- refine' Eq.trans _ (fold_disj_union h)
- rw [one_mul]
- rfl
+ by refine' Eq.trans _ (fold_disj_union h); rw [one_mul]; rfl
#align finset.prod_disj_union Finset.prod_disjUnion
#align finset.sum_disj_union Finset.sum_disjUnion
@@ -569,10 +566,8 @@ end ToList
#print Equiv.Perm.prod_comp /-
@[to_additive]
theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β)
- (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x :=
- by
- convert(Prod_map _ σ.to_embedding _).symm
- exact (map_perm hs).symm
+ (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x := by
+ convert(Prod_map _ σ.to_embedding _).symm; exact (map_perm hs).symm
#align equiv.perm.prod_comp Equiv.Perm.prod_comp
#align equiv.perm.sum_comp Equiv.Perm.sum_comp
-/
@@ -580,11 +575,8 @@ theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β
#print Equiv.Perm.prod_comp' /-
@[to_additive]
theorem Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
- (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) :=
- by
- convert σ.prod_comp s (fun x => f x (σ.symm x)) hs
- ext
- rw [Equiv.symm_apply_apply]
+ (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) := by
+ convert σ.prod_comp s (fun x => f x (σ.symm x)) hs; ext; rw [Equiv.symm_apply_apply]
#align equiv.perm.prod_comp' Equiv.Perm.prod_comp'
#align equiv.perm.sum_comp' Equiv.Perm.sum_comp'
-/
@@ -763,13 +755,8 @@ theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β
(right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) : (∏ x in s, f x) = ∏ x in t, g x :=
by
refine' prod_bij i hi h _ _
- · intro a1 a2 h1 h2 eq
- rw [← left_inv a1 h1, ← left_inv a2 h2]
- cc
- · intro b hb
- use j b hb
- use hj b hb
- exact (right_inv b hb).symm
+ · intro a1 a2 h1 h2 eq; rw [← left_inv a1 h1, ← left_inv a2 h2]; cc
+ · intro b hb; use j b hb; use hj b hb; exact (right_inv b hb).symm
#align finset.prod_bij' Finset.prod_bij'
#align finset.sum_bij' Finset.sum_bij'
-/
@@ -944,9 +931,7 @@ theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' :
have :
∀ z : γ × α,
(z ∈ s.bUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔ z.1 ∈ s ∧ z.2 ∈ t z.1 :=
- by
- rintro ⟨x, y⟩
- simp
+ by rintro ⟨x, y⟩; simp
exact
(prod_finset_product' _ _ _ this).symm.trans
(prod_finset_product_right' _ _ _ fun ⟨x, y⟩ => (this _).trans ((h x y).trans and_comm))
@@ -972,8 +957,7 @@ Case conversion may be inaccurate. Consider using '#align finset.prod_hom_rel Fi
@[to_additive]
theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g : α → γ} {s : Finset α}
(h₁ : r 1 1) (h₂ : ∀ a b c, r b c → r (f a * b) (g a * c)) :
- r (∏ x in s, f x) (∏ x in s, g x) := by
- delta Finset.prod
+ r (∏ x in s, f x) (∏ x in s, g x) := by delta Finset.prod;
apply Multiset.prod_hom_rel <;> assumption
#align finset.prod_hom_rel Finset.prod_hom_rel
#align finset.sum_hom_rel Finset.sum_hom_rel
@@ -1089,8 +1073,7 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
(∏ x in s, f x) = ∏ x in {a}, f x :=
by
refine' (prod_subset _ _).symm
- · intro _ H
- rwa [mem_singleton.1 H]
+ · intro _ H; rwa [mem_singleton.1 H]
· simpa only [mem_singleton]
_ = f a := prod_singleton
@@ -1124,9 +1107,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
(hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : (∏ x in s, f x) = f a * f b :=
by
haveI := Classical.decEq α <;> let s' := ({a, b} : Finset α)
- have hu : s' ⊆ s := by
- refine' insert_subset.mpr _
- apply And.intro ha
+ have hu : s' ⊆ s := by refine' insert_subset.mpr _; apply And.intro ha;
apply singleton_subset_iff.mpr hb
have hf : ∀ c ∈ s, c ∉ s' → f c = 1 := by
intro c hc hcs
@@ -1284,8 +1265,7 @@ theorem prod_congr_set {α : Type _} [CommMonoid α] {β : Type _} [Fintype β]
· apply Finset.prod_congr rfl
exact fun ⟨x, h⟩ _ => w x h
· simp
- · rintro x _ h
- exact w' x (by simpa using h)
+ · rintro x _ h; exact w' x (by simpa using h)
#align finset.prod_congr_set Finset.prod_congr_set
#align finset.sum_congr_set Finset.sum_congr_set
@@ -1362,9 +1342,7 @@ theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g :
#print Finset.prod_ite_of_false /-
@[to_additive]
theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → β) (h : ∀ x ∈ s, ¬p x) :
- (∏ x in s, if p x then f x else g x) = ∏ x in s, g x :=
- by
- rw [prod_ite]
+ (∏ x in s, if p x then f x else g x) = ∏ x in s, g x := by rw [prod_ite];
simp [filter_false_of_mem h, filter_true_of_mem h]
#align finset.prod_ite_of_false Finset.prod_ite_of_false
#align finset.sum_ite_of_false Finset.sum_ite_of_false
@@ -1373,11 +1351,8 @@ theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α →
#print Finset.prod_ite_of_true /-
@[to_additive]
theorem prod_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → β) (h : ∀ x ∈ s, p x) :
- (∏ x in s, if p x then f x else g x) = ∏ x in s, f x :=
- by
- simp_rw [← ite_not (p _)]
- apply prod_ite_of_false
- simpa
+ (∏ x in s, if p x then f x else g x) = ∏ x in s, f x := by simp_rw [← ite_not (p _)];
+ apply prod_ite_of_false; simpa
#align finset.prod_ite_of_true Finset.prod_ite_of_true
#align finset.sum_ite_of_true Finset.sum_ite_of_true
-/
@@ -1385,10 +1360,8 @@ theorem prod_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α →
#print Finset.prod_apply_ite_of_false /-
@[to_additive]
theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
- (h : ∀ x ∈ s, ¬p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (g x) :=
- by
- simp_rw [apply_ite k]
- exact prod_ite_of_false _ _ h
+ (h : ∀ x ∈ s, ¬p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (g x) := by
+ simp_rw [apply_ite k]; exact prod_ite_of_false _ _ h
#align finset.prod_apply_ite_of_false Finset.prod_apply_ite_of_false
#align finset.sum_apply_ite_of_false Finset.sum_apply_ite_of_false
-/
@@ -1396,10 +1369,8 @@ theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g :
#print Finset.prod_apply_ite_of_true /-
@[to_additive]
theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
- (h : ∀ x ∈ s, p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (f x) :=
- by
- simp_rw [apply_ite k]
- exact prod_ite_of_true _ _ h
+ (h : ∀ x ∈ s, p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (f x) := by
+ simp_rw [apply_ite k]; exact prod_ite_of_true _ _ h
#align finset.prod_apply_ite_of_true Finset.prod_apply_ite_of_true
#align finset.sum_apply_ite_of_true Finset.sum_apply_ite_of_true
-/
@@ -1442,15 +1413,10 @@ theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
- · intros
- rw [dif_neg]
- cc
+ · intros ; rw [dif_neg]; cc
· cc
· rw [Finset.prod_eq_one]
- intros
- rw [dif_neg]
- intro
- cc
+ intros ; rw [dif_neg]; intro ; cc
#align finset.prod_dite_eq Finset.prod_dite_eq
#align finset.sum_dite_eq Finset.sum_dite_eq
@@ -1466,15 +1432,10 @@ theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
- · intros
- rw [dif_neg]
- cc
+ · intros ; rw [dif_neg]; cc
· cc
· rw [Finset.prod_eq_one]
- intros
- rw [dif_neg]
- intro
- cc
+ intros ; rw [dif_neg]; intro ; cc
#align finset.prod_dite_eq' Finset.prod_dite_eq'
#align finset.sum_dite_eq' Finset.sum_dite_eq'
@@ -1603,10 +1564,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, ¬p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
(∏ x in s, if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) :=
- prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp)
- (fun a ha => by
- dsimp
- rw [dif_neg])
+ prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp) (fun a ha => by dsimp; rw [dif_neg])
(fun a₁ a₂ h₁ h₂ hh => congr_arg coe hh) fun b hb => ⟨b.1, b.2, by simp⟩
#align finset.prod_dite_of_false Finset.prod_dite_of_false
#align finset.sum_dite_of_false Finset.sum_dite_of_false
@@ -1617,10 +1575,7 @@ theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
(∏ x in s, if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) :=
- prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp)
- (fun a ha => by
- dsimp
- rw [dif_pos])
+ prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp) (fun a ha => by dsimp; rw [dif_pos])
(fun a₁ a₂ h₁ h₂ hh => congr_arg coe hh) fun b hb => ⟨b.1, b.2, by simp⟩
#align finset.prod_dite_of_true Finset.prod_dite_of_true
#align finset.sum_dite_of_true Finset.sum_dite_of_true
@@ -1754,9 +1709,7 @@ theorem prod_range_zero (f : ℕ → β) : (∏ k in range 0, f k) = 1 := by rw
#print Finset.prod_range_one /-
@[to_additive sum_range_one]
-theorem prod_range_one (f : ℕ → β) : (∏ k in range 1, f k) = f 0 :=
- by
- rw [range_one]
+theorem prod_range_one (f : ℕ → β) : (∏ k in range 1, f k) = f 0 := by rw [range_one];
apply @prod_singleton β ℕ 0 f
#align finset.prod_range_one Finset.prod_range_one
#align finset.sum_range_one Finset.sum_range_one
@@ -1837,19 +1790,15 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.prod_multiset_map_count Finset.prod_multiset_map_countₓ'. -/
@[to_additive]
theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type _} [CommMonoid M]
- (f : α → M) : (s.map f).Prod = ∏ m in s.toFinset, f m ^ s.count m :=
- by
- refine' Quot.inductionOn s fun l => _
- simp [prod_list_map_count l f]
+ (f : α → M) : (s.map f).Prod = ∏ m in s.toFinset, f m ^ s.count m := by
+ refine' Quot.inductionOn s fun l => _; simp [prod_list_map_count l f]
#align finset.prod_multiset_map_count Finset.prod_multiset_map_count
#align finset.sum_multiset_map_count Finset.sum_multiset_map_count
#print Finset.prod_multiset_count /-
@[to_additive]
theorem prod_multiset_count [DecidableEq α] [CommMonoid α] (s : Multiset α) :
- s.Prod = ∏ m in s.toFinset, m ^ s.count m :=
- by
- convert prod_multiset_map_count s id
+ s.Prod = ∏ m in s.toFinset, m ^ s.count m := by convert prod_multiset_map_count s id;
rw [Multiset.map_id]
#align finset.prod_multiset_count Finset.prod_multiset_count
#align finset.sum_multiset_count Finset.sum_multiset_count
@@ -1873,10 +1822,8 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
(hfg : ∀ x, f x = g x) : (∏ x : { x // x ∈ m }, f x) = ∏ x in m.toFinset, g x :=
prod_bij (fun x _ => x.1) (fun x _ => Multiset.mem_toFinset.mpr x.2) (fun _ _ => hfg _)
- (fun _ _ _ _ h => by
- ext
- assumption)
- fun y hy => ⟨⟨y, Multiset.mem_toFinset.mp hy⟩, Finset.mem_univ _, rfl⟩
+ (fun _ _ _ _ h => by ext; assumption) fun y hy =>
+ ⟨⟨y, Multiset.mem_toFinset.mp hy⟩, Finset.mem_univ _, rfl⟩
#align finset.prod_mem_multiset Finset.prod_mem_multiset
#align finset.sum_mem_multiset Finset.sum_mem_multiset
-/
@@ -1986,10 +1933,8 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.eq_prod_range_div' Finset.eq_prod_range_div'ₓ'. -/
@[to_additive]
theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- f n = ∏ i in range (n + 1), if i = 0 then f 0 else f i / f (i - 1) :=
- by
- conv_lhs => rw [Finset.eq_prod_range_div f]
- simp [Finset.prod_range_succ', mul_comm]
+ f n = ∏ i in range (n + 1), if i = 0 then f 0 else f i / f (i - 1) := by
+ conv_lhs => rw [Finset.eq_prod_range_div f]; simp [Finset.prod_range_succ', mul_comm]
#align finset.eq_prod_range_div' Finset.eq_prod_range_div'
#align finset.eq_sum_range_sub' Finset.eq_sum_range_sub'
@@ -2153,10 +2098,8 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diffₓ'. -/
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
- ((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x :=
- by
- convert(s.prod_piecewise t f f).symm
- simp [Finset.piecewise]
+ ((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x := by
+ convert(s.prod_piecewise t f f).symm; simp [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
@@ -2168,10 +2111,8 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singletonₓ'. -/
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x :=
- by
- convert(s.prod_inter_mul_prod_diff {i} f).symm
- simp [h]
+ (f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x := by
+ convert(s.prod_inter_mul_prod_diff {i} f).symm; simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
#align finset.sum_eq_add_sum_diff_singleton Finset.sum_eq_add_sum_diff_singleton
@@ -2259,10 +2200,7 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
(b : β) : (∏ x in s, Function.update f i b x) = ∏ x in s, f x :=
by
apply prod_congr rfl fun j hj => _
- have : j ≠ i := by
- intro eq
- rw [Eq] at hj
- exact h hj
+ have : j ≠ i := by intro eq; rw [Eq] at hj; exact h hj
simp [this]
#align finset.prod_update_of_not_mem Finset.prod_update_of_not_mem
#align finset.sum_update_of_not_mem Finset.sum_update_of_not_mem
@@ -2276,10 +2214,8 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align finset.prod_update_of_mem Finset.prod_update_of_memₓ'. -/
@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
- (∏ x in s, Function.update f i b x) = b * ∏ x in s \ singleton i, f x :=
- by
- rw [update_eq_piecewise, prod_piecewise]
- simp [h]
+ (∏ x in s, Function.update f i b x) = b * ∏ x in s \ singleton i, f x := by
+ rw [update_eq_piecewise, prod_piecewise]; simp [h]
#align finset.prod_update_of_mem Finset.prod_update_of_mem
#align finset.sum_update_of_mem Finset.sum_update_of_mem
@@ -2718,10 +2654,8 @@ lean 3 declaration is
but is expected to have type
forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {a : α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β], (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Eq.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1))))
Case conversion may be inaccurate. Consider using '#align finset.prod_eq_zero Finset.prod_eq_zeroₓ'. -/
-theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : (∏ x in s, f x) = 0 :=
- by
- haveI := Classical.decEq α
- rw [← prod_erase_mul _ _ ha, h, MulZeroClass.mul_zero]
+theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : (∏ x in s, f x) = 0 := by
+ haveI := Classical.decEq α; rw [← prod_erase_mul _ _ ha, h, MulZeroClass.mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
/- warning: finset.prod_boole -> Finset.prod_boole is a dubious translation:
@@ -2765,9 +2699,7 @@ lean 3 declaration is
but is expected to have type
forall {β : Type.{u1}} {α : Type.{u2}} {s : Finset.{u2} α} {f : α -> β} [_inst_1 : CommMonoidWithZero.{u1} β] [_inst_2 : Nontrivial.{u1} β] [_inst_3 : NoZeroDivisors.{u1} β (MulZeroClass.toMul.{u1} β (MulZeroOneClass.toMulZeroClass.{u1} β (MonoidWithZero.toMulZeroOneClass.{u1} β (CommMonoidWithZero.toMonoidWithZero.{u1} β _inst_1)))) (CommMonoidWithZero.toZero.{u1} β _inst_1)], Iff (Ne.{succ u1} β (Finset.prod.{u1, u2} β α (CommMonoidWithZero.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x)) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))) (forall (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (Ne.{succ u1} β (f a) (OfNat.ofNat.{u1} β 0 (Zero.toOfNat0.{u1} β (CommMonoidWithZero.toZero.{u1} β _inst_1)))))
Case conversion may be inaccurate. Consider using '#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iffₓ'. -/
-theorem prod_ne_zero_iff : (∏ x in s, f x) ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 :=
- by
- rw [Ne, prod_eq_zero_iff]
+theorem prod_ne_zero_iff : (∏ x in s, f x) ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by rw [Ne, prod_eq_zero_iff];
push_neg
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
@@ -3115,10 +3047,7 @@ but is expected to have type
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} α] {s : Finset.{u1} β} {a : α} {f : β -> (Multiset.{u2} α)}, Eq.{1} Nat (Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_1 a b) a (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) s (fun (x : β) => f x))) (Finset.sum.{0, u1} Nat β Nat.addCommMonoid s (fun (x : β) => Multiset.count.{u2} α (fun (a : α) (b : α) => _inst_1 a b) a (f x)))
Case conversion may be inaccurate. Consider using '#align multiset.count_sum' Multiset.count_sum'ₓ'. -/
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
- count a (∑ x in s, f x) = ∑ x in s, count a (f x) :=
- by
- dsimp only [Finset.sum]
- rw [count_sum]
+ count a (∑ x in s, f x) = ∑ x in s, count a (f x) := by dsimp only [Finset.sum]; rw [count_sum]
#align multiset.count_sum' Multiset.count_sum'
/- warning: multiset.to_finset_sum_count_nsmul_eq -> Multiset.toFinset_sum_count_nsmul_eq is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -1290,10 +1290,7 @@ theorem prod_congr_set {α : Type _} [CommMonoid α] {β : Type _} [Fintype β]
#align finset.sum_congr_set Finset.sum_congr_set
/- warning: finset.prod_apply_dite -> Finset.prod_apply_dite is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} [_inst_2 : DecidablePred.{succ u2} α (fun (x : α) => Not (p x))] (f : forall (x : α), (p x) -> γ) (g : forall (x : α), (Not (p x)) -> γ) (h : γ -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => h (dite.{succ u3} γ (p x) (hp x) (fun (hx : p x) => f x hx) (fun (hx : Not (p x)) => g x hx)))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) => h (f (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (And.right (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Iff.mp (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (And (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x))) (Finset.mem_filter.{u2} α p (fun (a : α) => hp a) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)))))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s))) => h (g (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) (And.right (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x))) (Iff.mp (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) (And (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x)))) (Finset.mem_filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x)))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} [_inst_2 : DecidablePred.{succ u2} α (fun (x : α) => Not (p x))] (f : forall (x : α), (p x) -> γ) (g : forall (x : α), (Not (p x)) -> γ) (h : γ -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => h (dite.{succ u3} γ (p x) (hp x) (fun (hx : p x) => f x hx) (fun (hx : Not (p x)) => g x hx)))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) => h (f (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (And.right (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Iff.mp (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x))) (Finset.mem_filter.{u2} α p (fun (a : α) => hp a) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)))))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s))) => h (g (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) (And.right (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x))) (Iff.mp (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) (And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x)))) (Finset.mem_filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => _inst_2 a) s)) x)))))))
+<too large>
Case conversion may be inaccurate. Consider using '#align finset.prod_apply_dite Finset.prod_apply_diteₓ'. -/
@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
@@ -1336,10 +1333,7 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
#align finset.sum_apply_ite Finset.sum_apply_ite
/- warning: finset.prod_dite -> Finset.prod_dite is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} (f : forall (x : α), (p x) -> β) (g : forall (x : α), (Not (p x)) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => dite.{succ u1} β (p x) (hp x) (fun (hx : p x) => f x hx) (fun (hx : Not (p x)) => g x hx))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) => f (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (And.right (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Iff.mp (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (And (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x))) (Finset.mem_filter.{u2} α p (fun (a : α) => hp a) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x))))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s))) => g (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x) (And.right (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x))) (Iff.mp (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x) (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) (And (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x)))) (Finset.mem_filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => Not.decidable (p a) (hp a)) s)) x))))))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] {s : Finset.{u2} α} {p : α -> Prop} {hp : DecidablePred.{succ u2} α p} (f : forall (x : α), (p x) -> β) (g : forall (x : α), (Not (p x)) -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => dite.{succ u1} β (p x) (hp x) (fun (hx : p x) => f x hx) (fun (hx : Not (p x)) => g x hx))) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s))) => f (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (And.right (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Iff.mp (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) (And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x) s) (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x))) (Finset.mem_filter.{u2} α p (fun (a : α) => hp a) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α p (fun (a : α) => hp a) s)) x))))) (Finset.prod.{u1, u2} β (Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s))) _inst_1 (Finset.attach.{u2} α (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) (fun (x : Subtype.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s))) => g (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x) (And.right (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x))) (Iff.mp (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x) (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) (And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x) s) (Not (p (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x)))) (Finset.mem_filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s (Subtype.val.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x)) (Subtype.property.{succ u2} α (fun (x : α) => Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x (Finset.filter.{u2} α (fun (x : α) => Not (p x)) (fun (a : α) => instDecidableNot (p a) (hp a)) s)) x))))))
+<too large>
Case conversion may be inaccurate. Consider using '#align finset.prod_dite Finset.prod_diteₓ'. -/
@[to_additive]
theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f : ∀ x : α, p x → β)
mathlib commit https://github.com/leanprover-community/mathlib/commit/95a87616d63b3cb49d3fe678d416fbe9c4217bf4
@@ -166,7 +166,7 @@ end Finset
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] {G : Type.{u4}} [_inst_3 : MonoidHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (f x)))
but is expected to have type
- forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
+ forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
Case conversion may be inaccurate. Consider using '#align map_prod map_prodₓ'. -/
@[to_additive]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G β γ] (g : G)
@@ -181,7 +181,7 @@ section Deprecated
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align monoid_hom.map_prod MonoidHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
@@ -209,7 +209,7 @@ protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃*
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l)) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f) l))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_prod RingHom.map_list_prodₓ'. -/
/-- Deprecated: use `_root_.map_list_prod` instead. -/
protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
@@ -221,7 +221,7 @@ protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (List.sum.{u1} β (Distrib.toHasAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroClass.toHasZero.{u1} β (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) l)) (List.sum.{u2} γ (Distrib.toHasAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroClass.toHasZero.{u2} γ (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) l))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_sum RingHom.map_list_sumₓ'. -/
/-- Deprecated: use `_root_.map_list_sum` instead. -/
protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
@@ -233,7 +233,7 @@ protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l))) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f)) l)))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
Case conversion may be inaccurate. Consider using '#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prodₓ'. -/
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
@@ -248,7 +248,7 @@ protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f) s))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_prod RingHom.map_multiset_prodₓ'. -/
/-- Deprecated: use `_root_.map_multiset_prod` instead. -/
protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
@@ -260,7 +260,7 @@ protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ]
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) s))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_sum RingHom.map_multiset_sumₓ'. -/
/-- Deprecated: use `_root_.map_multiset_sum` instead. -/
protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
@@ -272,7 +272,7 @@ protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiri
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_prod RingHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
@@ -284,7 +284,7 @@ protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_sum RingHom.map_sumₓ'. -/
/-- Deprecated: use `_root_.map_sum` instead. -/
protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
@@ -298,7 +298,7 @@ end Deprecated
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (β -> γ) (coeFn.{succ (max u3 u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (β -> γ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => γ) (fun (i : β) => _inst_2)) s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
Case conversion may be inaccurate. Consider using '#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prodₓ'. -/
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
@@ -311,7 +311,7 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x) b))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
Case conversion may be inaccurate. Consider using '#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_applyₓ'. -/
-- See also `finset.prod_apply`, with the same conclusion
-- but with the weaker hypothesis `f : α → β → γ`.
@@ -778,7 +778,7 @@ theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β
lean 3 declaration is
forall {ι : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] {ι' : Type.{u3}} [_inst_2 : DecidableEq.{succ u2} ι] (e : Equiv.{succ u2, succ u3} ι ι') (f : ι' -> β) {s' : Finset.{u3} ι'} {s : Finset.{u2} ι}, (Eq.{succ u2} (Finset.{u2} ι) s (Finset.image.{u3, u2} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (coeFn.{max 1 (max (succ u3) (succ u2)) (succ u2) (succ u3), max (succ u3) (succ u2)} (Equiv.{succ u3, succ u2} ι' ι) (fun (_x : Equiv.{succ u3, succ u2} ι' ι) => ι' -> ι) (Equiv.hasCoeToFun.{succ u3, succ u2} ι' ι) (Equiv.symm.{succ u2, succ u3} ι ι' e)) s')) -> (Eq.{succ u1} β (Finset.prod.{u1, u3} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u1, u2} β ι _inst_1 s (fun (i : ι) => f (coeFn.{max 1 (max (succ u2) (succ u3)) (succ u3) (succ u2), max (succ u2) (succ u3)} (Equiv.{succ u2, succ u3} ι ι') (fun (_x : Equiv.{succ u2, succ u3} ι ι') => ι -> ι') (Equiv.hasCoeToFun.{succ u2, succ u3} ι ι') e i))))
but is expected to have type
- forall {ι : Type.{u1}} {β : Type.{u3}} [_inst_1 : CommMonoid.{u3} β] {ι' : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] (e : Equiv.{succ u1, succ u2} ι ι') (f : ι' -> β) {s' : Finset.{u2} ι'} {s : Finset.{u1} ι}, (Eq.{succ u1} (Finset.{u1} ι) s (Finset.image.{u2, u1} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (Equiv.{succ u2, succ u1} ι' ι) ι' (fun (_x : ι') => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : ι') => ι) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} ι' ι) (Equiv.symm.{succ u1, succ u2} ι ι' e)) s')) -> (Eq.{succ u3} β (Finset.prod.{u3, u2} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u3, u1} β ι _inst_1 s (fun (i : ι) => f (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Equiv.{succ u1, succ u2} ι ι') ι (fun (_x : ι) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : ι) => ι') _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} ι ι') e i))))
+ forall {ι : Type.{u1}} {β : Type.{u3}} [_inst_1 : CommMonoid.{u3} β] {ι' : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] (e : Equiv.{succ u1, succ u2} ι ι') (f : ι' -> β) {s' : Finset.{u2} ι'} {s : Finset.{u1} ι}, (Eq.{succ u1} (Finset.{u1} ι) s (Finset.image.{u2, u1} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (Equiv.{succ u2, succ u1} ι' ι) ι' (fun (_x : ι') => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : ι') => ι) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} ι' ι) (Equiv.symm.{succ u1, succ u2} ι ι' e)) s')) -> (Eq.{succ u3} β (Finset.prod.{u3, u2} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u3, u1} β ι _inst_1 s (fun (i : ι) => f (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Equiv.{succ u1, succ u2} ι ι') ι (fun (_x : ι) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : ι) => ι') _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} ι ι') e i))))
Case conversion may be inaccurate. Consider using '#align finset.equiv.prod_comp_finset Finset.Equiv.prod_comp_finsetₓ'. -/
/-- Reindexing a product over a finset along an equivalence.
See `equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@@ -2858,7 +2858,7 @@ theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u2}} {M : Type.{u3}} [_inst_1 : Fintype.{u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u3} M] (e : Equiv.{succ u1, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u3} M (f x) (g (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) e x))) -> (Eq.{succ u3} M (Finset.prod.{u3, u1} M α _inst_3 (Finset.univ.{u1} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u3, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {M : Type.{u1}} [_inst_1 : Fintype.{u3} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u1} M] (e : Equiv.{succ u3, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u1} M (f x) (g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Equiv.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u3, succ u2} α β) e x))) -> (Eq.{succ u1} M (Finset.prod.{u1, u3} M α _inst_3 (Finset.univ.{u3} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u1, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
+ forall {α : Type.{u3}} {β : Type.{u2}} {M : Type.{u1}} [_inst_1 : Fintype.{u3} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u1} M] (e : Equiv.{succ u3, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u1} M (f x) (g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Equiv.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u3, succ u2} α β) e x))) -> (Eq.{succ u1} M (Finset.prod.{u1, u3} M α _inst_3 (Finset.univ.{u3} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u1, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
Case conversion may be inaccurate. Consider using '#align fintype.prod_equiv Fintype.prod_equivₓ'. -/
/-- `fintype.prod_equiv` is a specialization of `finset.prod_bij` that
automatically fills in most arguments.
@@ -3420,7 +3420,7 @@ theorem toMul_multiset_sum (s : Multiset (Additive α)) : toMul s.Sum = (s.map t
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> α), Eq.{succ u1} (Additive.{u1} α) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Additive.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Additive.{u1} α)) => α -> (Additive.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Additive.{u1} α)) (Additive.ofMul.{u1} α) (Finset.prod.{u1, u2} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u1, u2} (Additive.{u1} α) ι (Additive.addCommMonoid.{u1} α _inst_1) s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Additive.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Additive.{u1} α)) => α -> (Additive.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Additive.{u1} α)) (Additive.ofMul.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Additive.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Additive.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align of_mul_prod ofMul_prodₓ'. -/
@[simp]
theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) = ∑ i in s, ofMul (f i) :=
@@ -3431,7 +3431,7 @@ theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) =
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> (Additive.{u1} α)), Eq.{succ u1} α (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Additive.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Additive.{u1} α) α) => (Additive.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Additive.{u1} α) α) (Additive.toMul.{u1} α) (Finset.sum.{u1, u2} (Additive.{u1} α) ι (Additive.addCommMonoid.{u1} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u1, u2} α ι _inst_1 s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Additive.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Additive.{u1} α) α) => (Additive.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Additive.{u1} α) α) (Additive.toMul.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Additive.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Additive.{u2} α) => α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Additive.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Additive.{u2} α) => α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align to_mul_sum toMul_sumₓ'. -/
@[simp]
theorem toMul_sum (s : Finset ι) (f : ι → Additive α) :
@@ -3462,7 +3462,7 @@ theorem toAdd_multiset_sum (s : Multiset (Multiplicative α)) : toAdd s.Prod = (
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> α), Eq.{succ u1} (Multiplicative.{u1} α) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) => α -> (Multiplicative.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Multiplicative.{u1} α)) (Multiplicative.ofAdd.{u1} α) (Finset.sum.{u1, u2} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u1, u2} (Multiplicative.{u1} α) ι (Multiplicative.commMonoid.{u1} α _inst_1) s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) => α -> (Multiplicative.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Multiplicative.{u1} α)) (Multiplicative.ofAdd.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Multiplicative.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Multiplicative.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align of_add_sum ofAdd_sumₓ'. -/
@[simp]
theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) = ∏ i in s, ofAdd (f i) :=
@@ -3473,7 +3473,7 @@ theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) =
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> (Multiplicative.{u1} α)), Eq.{succ u1} α (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) => (Multiplicative.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Multiplicative.{u1} α) α) (Multiplicative.toAdd.{u1} α) (Finset.prod.{u1, u2} (Multiplicative.{u1} α) ι (Multiplicative.commMonoid.{u1} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u1, u2} α ι _inst_1 s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) => (Multiplicative.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Multiplicative.{u1} α) α) (Multiplicative.toAdd.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Multiplicative.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} α) => α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Multiplicative.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Multiplicative.{u2} α) => α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align to_add_prod toAdd_prodₓ'. -/
@[simp]
theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -2001,7 +2001,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
/- warning: finset.sum_range_tsub -> Finset.sum_range_tsub is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toHasLe.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19921 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19923 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19921 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19923) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19936 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19938 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19936 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19938)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
@@ -2386,7 +2386,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
/- warning: finset.prod_erase_lt_of_one_lt -> Finset.prod_erase_lt_of_one_lt is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (MulOneClass.toHasMul.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 1 (OfNat.mk.{u2} γ 1 (One.one.{u2} γ (MulOneClass.toHasOne.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (MulOneClass.toHasMul.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toHasLt.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toHasLt.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 1 (OfNat.mk.{u2} γ 1 (One.one.{u2} γ (MulOneClass.toHasOne.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toHasLt.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23794 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23796 : γ) => HMul.hMul.{u1, u1, u1} γ γ γ (instHMul.{u1} γ (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23794 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23796) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23809 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23811 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23809 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23811)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 1 (One.toOfNat1.{u1} γ (Monoid.toOne.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_ltₓ'. -/
@@ -3029,7 +3029,7 @@ variable [DecidableEq α]
/- warning: multiset.add_eq_union_left_of_le -> Multiset.add_eq_union_left_of_le is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) y x) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.hasAdd.{u1} α)) z x) (Union.union.{u1} (Multiset.{u1} α) (Multiset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) z y)) (And (Multiset.Disjoint.{u1} α z x) (Eq.{succ u1} (Multiset.{u1} α) x y)))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) y x) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.hasAdd.{u1} α)) z x) (Union.union.{u1} (Multiset.{u1} α) (Multiset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) z y)) (And (Multiset.Disjoint.{u1} α z x) (Eq.{succ u1} (Multiset.{u1} α) x y)))
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) y x) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.instAddMultiset.{u1} α)) z x) (Union.union.{u1} (Multiset.{u1} α) (Multiset.instUnionMultiset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) z y)) (And (Multiset.Disjoint.{u1} α z x) (Eq.{succ u1} (Multiset.{u1} α) x y)))
Case conversion may be inaccurate. Consider using '#align multiset.add_eq_union_left_of_le Multiset.add_eq_union_left_of_leₓ'. -/
@@ -3049,7 +3049,7 @@ theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
/- warning: multiset.add_eq_union_right_of_le -> Multiset.add_eq_union_right_of_le is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) z y) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.hasAdd.{u1} α)) x y) (Union.union.{u1} (Multiset.{u1} α) (Multiset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) x z)) (And (Eq.{succ u1} (Multiset.{u1} α) y z) (Multiset.Disjoint.{u1} α x y)))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toHasLe.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.partialOrder.{u1} α))) z y) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.hasAdd.{u1} α)) x y) (Union.union.{u1} (Multiset.{u1} α) (Multiset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) x z)) (And (Eq.{succ u1} (Multiset.{u1} α) y z) (Multiset.Disjoint.{u1} α x y)))
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {x : Multiset.{u1} α} {y : Multiset.{u1} α} {z : Multiset.{u1} α}, (LE.le.{u1} (Multiset.{u1} α) (Preorder.toLE.{u1} (Multiset.{u1} α) (PartialOrder.toPreorder.{u1} (Multiset.{u1} α) (Multiset.instPartialOrderMultiset.{u1} α))) z y) -> (Iff (Eq.{succ u1} (Multiset.{u1} α) (HAdd.hAdd.{u1, u1, u1} (Multiset.{u1} α) (Multiset.{u1} α) (Multiset.{u1} α) (instHAdd.{u1} (Multiset.{u1} α) (Multiset.instAddMultiset.{u1} α)) x y) (Union.union.{u1} (Multiset.{u1} α) (Multiset.instUnionMultiset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) x z)) (And (Eq.{succ u1} (Multiset.{u1} α) y z) (Multiset.Disjoint.{u1} α x y)))
Case conversion may be inaccurate. Consider using '#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_leₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -2003,7 +2003,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19930 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19932 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19930 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19932) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19945 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19947 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19945 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19947)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19921 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19923 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19921 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19923) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19936 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19938 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19936 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19938)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
@@ -2388,7 +2388,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
lean 3 declaration is
forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (MulOneClass.toHasMul.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 1 (OfNat.mk.{u2} γ 1 (One.one.{u2} γ (MulOneClass.toHasOne.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23803 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23805 : γ) => HMul.hMul.{u1, u1, u1} γ γ γ (instHMul.{u1} γ (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23803 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23805) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23818 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23820 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23818 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23820)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 1 (One.toOfNat1.{u1} γ (Monoid.toOne.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23794 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23796 : γ) => HMul.hMul.{u1, u1, u1} γ γ γ (instHMul.{u1} γ (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23794 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23796) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23809 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23811 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23809 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23811)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 1 (One.toOfNat1.{u1} γ (Monoid.toOne.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_ltₓ'. -/
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
mathlib commit https://github.com/leanprover-community/mathlib/commit/e3fb84046afd187b710170887195d50bada934ee
@@ -491,22 +491,22 @@ theorem prod_disjUnion (h) : (∏ x in s₁.disjUnion s₂ h, f x) = (∏ x in s
#align finset.prod_disj_union Finset.prod_disjUnion
#align finset.sum_disj_union Finset.sum_disjUnion
-/- warning: finset.prod_disj_Union -> Finset.prod_disjUnionᵢ is a dubious translation:
+/- warning: finset.prod_disj_Union -> Finset.prod_disjiUnion is a dubious translation:
lean 3 declaration is
forall {ι : Type.{u3}} {β : Type.{u1}} {α : Type.{u2}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u3} ι) (t : ι -> (Finset.{u2} α)) (h : Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) ι (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} ι) (Set.{u3} ι) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} ι) (Set.{u3} ι) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} ι) (Set.{u3} ι) (Finset.Set.hasCoeT.{u3} ι))) s) t), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.disjUnionₓ.{u3, u2} ι α s t h) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β ι _inst_1 s (fun (i : ι) => Finset.prod.{u1, u2} β α _inst_1 (t i) (fun (x : α) => f x)))
but is expected to have type
- forall {ι : Type.{u1}} {β : Type.{u2}} {α : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u2} β] (s : Finset.{u1} ι) (t : ι -> (Finset.{u3} α)) (h : Set.PairwiseDisjoint.{u3, u1} (Finset.{u3} α) ι (Finset.partialOrder.{u3} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u3} α) (Finset.toSet.{u1} ι s) t), Eq.{succ u2} β (Finset.prod.{u2, u3} β α _inst_1 (Finset.disjUnionᵢ.{u1, u3} ι α s t h) (fun (x : α) => f x)) (Finset.prod.{u2, u1} β ι _inst_1 s (fun (i : ι) => Finset.prod.{u2, u3} β α _inst_1 (t i) (fun (x : α) => f x)))
-Case conversion may be inaccurate. Consider using '#align finset.prod_disj_Union Finset.prod_disjUnionᵢₓ'. -/
+ forall {ι : Type.{u1}} {β : Type.{u2}} {α : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u2} β] (s : Finset.{u1} ι) (t : ι -> (Finset.{u3} α)) (h : Set.PairwiseDisjoint.{u3, u1} (Finset.{u3} α) ι (Finset.partialOrder.{u3} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u3} α) (Finset.toSet.{u1} ι s) t), Eq.{succ u2} β (Finset.prod.{u2, u3} β α _inst_1 (Finset.disjiUnion.{u1, u3} ι α s t h) (fun (x : α) => f x)) (Finset.prod.{u2, u1} β ι _inst_1 s (fun (i : ι) => Finset.prod.{u2, u3} β α _inst_1 (t i) (fun (x : α) => f x)))
+Case conversion may be inaccurate. Consider using '#align finset.prod_disj_Union Finset.prod_disjiUnionₓ'. -/
@[to_additive]
-theorem prod_disjUnionᵢ (s : Finset ι) (t : ι → Finset α) (h) :
+theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
(∏ x in s.disjUnionₓ t h, f x) = ∏ i in s, ∏ x in t i, f x :=
by
refine' Eq.trans _ (fold_disj_Union h)
dsimp [Finset.prod, Multiset.prod, Multiset.fold, Finset.disjUnion, Finset.fold]
congr
exact prod_const_one.symm
-#align finset.prod_disj_Union Finset.prod_disjUnionᵢ
-#align finset.sum_disj_Union Finset.sum_disjUnionᵢ
+#align finset.prod_disj_Union Finset.prod_disjiUnion
+#align finset.sum_disj_Union Finset.sum_disjiUnion
/- warning: finset.prod_union_inter -> Finset.prod_union_inter is a dubious translation:
lean 3 declaration is
@@ -690,18 +690,18 @@ theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ
#align finset.prod_sum_elim Finset.prod_sum_elim
#align finset.sum_sum_elim Finset.sum_sum_elim
-/- warning: finset.prod_bUnion -> Finset.prod_bunionᵢ is a dubious translation:
+/- warning: finset.prod_bUnion -> Finset.prod_biUnion is a dubious translation:
lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u3} γ} {t : γ -> (Finset.{u2} α)}, (Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) γ (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) s) t) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.bunionᵢ.{u3, u2} γ α (fun (a : α) (b : α) => _inst_2 a b) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 s (fun (x : γ) => Finset.prod.{u1, u2} β α _inst_1 (t x) (fun (i : α) => f i))))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u3} γ} {t : γ -> (Finset.{u2} α)}, (Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) γ (Finset.partialOrder.{u2} α) (Finset.orderBot.{u2} α) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) s) t) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.biUnion.{u3, u2} γ α (fun (a : α) (b : α) => _inst_2 a b) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 s (fun (x : γ) => Finset.prod.{u1, u2} β α _inst_1 (t x) (fun (i : α) => f i))))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u3} γ} {t : γ -> (Finset.{u2} α)}, (Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) γ (Finset.partialOrder.{u2} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u2} α) (Finset.toSet.{u3} γ s) t) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.bunionᵢ.{u3, u2} γ α (fun (a : α) (b : α) => _inst_2 a b) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 s (fun (x : γ) => Finset.prod.{u1, u2} β α _inst_1 (t x) (fun (i : α) => f i))))
-Case conversion may be inaccurate. Consider using '#align finset.prod_bUnion Finset.prod_bunionᵢₓ'. -/
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} {f : α -> β} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] {s : Finset.{u3} γ} {t : γ -> (Finset.{u2} α)}, (Set.PairwiseDisjoint.{u2, u3} (Finset.{u2} α) γ (Finset.partialOrder.{u2} α) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u2} α) (Finset.toSet.{u3} γ s) t) -> (Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.biUnion.{u3, u2} γ α (fun (a : α) (b : α) => _inst_2 a b) s t) (fun (x : α) => f x)) (Finset.prod.{u1, u3} β γ _inst_1 s (fun (x : γ) => Finset.prod.{u1, u2} β α _inst_1 (t x) (fun (i : α) => f i))))
+Case conversion may be inaccurate. Consider using '#align finset.prod_bUnion Finset.prod_biUnionₓ'. -/
@[to_additive]
-theorem prod_bunionᵢ [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
- (hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.bunionᵢ t, f x) = ∏ x in s, ∏ i in t x, f i := by
+theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
+ (hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.biUnion t, f x) = ∏ x in s, ∏ i in t x, f i := by
rw [← disj_Union_eq_bUnion _ _ hs, prod_disj_Union]
-#align finset.prod_bUnion Finset.prod_bunionᵢ
-#align finset.sum_bUnion Finset.sum_bunionᵢ
+#align finset.prod_bUnion Finset.prod_biUnion
+#align finset.sum_bUnion Finset.sum_biUnion
/- warning: finset.prod_sigma -> Finset.prod_sigma is a dubious translation:
lean 3 declaration is
@@ -2645,45 +2645,45 @@ theorem card_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a
Multiset.card_sigma _ _
#align finset.card_sigma Finset.card_sigma
-/- warning: finset.card_disj_Union -> Finset.card_disjUnionᵢ is a dubious translation:
+/- warning: finset.card_disj_Union -> Finset.card_disjiUnion is a dubious translation:
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} (s : Finset.{u2} α) (t : α -> (Finset.{u1} β)) (h : Set.PairwiseDisjoint.{u1, u2} (Finset.{u1} β) α (Finset.partialOrder.{u1} β) (Finset.orderBot.{u1} β) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} α) (Set.{u2} α) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} α) (Set.{u2} α) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} α) (Set.{u2} α) (Finset.Set.hasCoeT.{u2} α))) s) t), Eq.{1} Nat (Finset.card.{u1} β (Finset.disjUnionₓ.{u2, u1} α β s t h)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (i : α) => Finset.card.{u1} β (t i)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} (s : Finset.{u2} α) (t : α -> (Finset.{u1} β)) (h : Set.PairwiseDisjoint.{u1, u2} (Finset.{u1} β) α (Finset.partialOrder.{u1} β) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u1} β) (Finset.toSet.{u2} α s) t), Eq.{1} Nat (Finset.card.{u1} β (Finset.disjUnionᵢ.{u2, u1} α β s t h)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (i : α) => Finset.card.{u1} β (t i)))
-Case conversion may be inaccurate. Consider using '#align finset.card_disj_Union Finset.card_disjUnionᵢₓ'. -/
+ forall {β : Type.{u1}} {α : Type.{u2}} (s : Finset.{u2} α) (t : α -> (Finset.{u1} β)) (h : Set.PairwiseDisjoint.{u1, u2} (Finset.{u1} β) α (Finset.partialOrder.{u1} β) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u1} β) (Finset.toSet.{u2} α s) t), Eq.{1} Nat (Finset.card.{u1} β (Finset.disjiUnion.{u2, u1} α β s t h)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (i : α) => Finset.card.{u1} β (t i)))
+Case conversion may be inaccurate. Consider using '#align finset.card_disj_Union Finset.card_disjiUnionₓ'. -/
@[simp]
-theorem card_disjUnionᵢ (s : Finset α) (t : α → Finset β) (h) :
+theorem card_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
(s.disjUnionₓ t h).card = s.Sum fun i => (t i).card :=
Multiset.card_bind _ _
-#align finset.card_disj_Union Finset.card_disjUnionᵢ
+#align finset.card_disj_Union Finset.card_disjiUnion
-/- warning: finset.card_bUnion -> Finset.card_bunionᵢ is a dubious translation:
+/- warning: finset.card_bUnion -> Finset.card_biUnion is a dubious translation:
lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} β] {s : Finset.{u2} α} {t : α -> (Finset.{u1} β)}, (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (forall (y : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) y s) -> (Ne.{succ u2} α x y) -> (Disjoint.{u1} (Finset.{u1} β) (Finset.partialOrder.{u1} β) (Finset.orderBot.{u1} β) (t x) (t y)))) -> (Eq.{1} Nat (Finset.card.{u1} β (Finset.bunionᵢ.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (u : α) => Finset.card.{u1} β (t u))))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} β] {s : Finset.{u2} α} {t : α -> (Finset.{u1} β)}, (forall (x : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) x s) -> (forall (y : α), (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) y s) -> (Ne.{succ u2} α x y) -> (Disjoint.{u1} (Finset.{u1} β) (Finset.partialOrder.{u1} β) (Finset.orderBot.{u1} β) (t x) (t y)))) -> (Eq.{1} Nat (Finset.card.{u1} β (Finset.biUnion.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (u : α) => Finset.card.{u1} β (t u))))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} β] {s : Finset.{u2} α} {t : α -> (Finset.{u1} β)}, (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (forall (y : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) y s) -> (Ne.{succ u2} α x y) -> (Disjoint.{u1} (Finset.{u1} β) (Finset.partialOrder.{u1} β) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u1} β) (t x) (t y)))) -> (Eq.{1} Nat (Finset.card.{u1} β (Finset.bunionᵢ.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (u : α) => Finset.card.{u1} β (t u))))
-Case conversion may be inaccurate. Consider using '#align finset.card_bUnion Finset.card_bunionᵢₓ'. -/
-theorem card_bunionᵢ [DecidableEq β] {s : Finset α} {t : α → Finset β}
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} β] {s : Finset.{u2} α} {t : α -> (Finset.{u1} β)}, (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (forall (y : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) y s) -> (Ne.{succ u2} α x y) -> (Disjoint.{u1} (Finset.{u1} β) (Finset.partialOrder.{u1} β) (Finset.instOrderBotFinsetToLEToPreorderPartialOrder.{u1} β) (t x) (t y)))) -> (Eq.{1} Nat (Finset.card.{u1} β (Finset.biUnion.{u2, u1} α β (fun (a : β) (b : β) => _inst_1 a b) s t)) (Finset.sum.{0, u2} Nat α Nat.addCommMonoid s (fun (u : α) => Finset.card.{u1} β (t u))))
+Case conversion may be inaccurate. Consider using '#align finset.card_bUnion Finset.card_biUnionₓ'. -/
+theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
(h : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → Disjoint (t x) (t y)) :
- (s.bunionᵢ t).card = ∑ u in s, card (t u) :=
+ (s.biUnion t).card = ∑ u in s, card (t u) :=
calc
- (s.bunionᵢ t).card = ∑ i in s.bunionᵢ t, 1 := by simp
- _ = ∑ a in s, ∑ i in t a, 1 := (Finset.sum_bunionᵢ h)
+ (s.biUnion t).card = ∑ i in s.biUnion t, 1 := by simp
+ _ = ∑ a in s, ∑ i in t a, 1 := (Finset.sum_biUnion h)
_ = ∑ u in s, card (t u) := by simp
-#align finset.card_bUnion Finset.card_bunionᵢ
+#align finset.card_bUnion Finset.card_biUnion
-#print Finset.card_bunionᵢ_le /-
-theorem card_bunionᵢ_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
- (s.bunionᵢ t).card ≤ ∑ a in s, (t a).card :=
+#print Finset.card_biUnion_le /-
+theorem card_biUnion_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
+ (s.biUnion t).card ≤ ∑ a in s, (t a).card :=
haveI := Classical.decEq α
Finset.induction_on s (by simp) fun a s has ih =>
calc
- ((insert a s).bunionᵢ t).card ≤ (t a).card + (s.bunionᵢ t).card := by
+ ((insert a s).biUnion t).card ≤ (t a).card + (s.biUnion t).card := by
rw [bUnion_insert] <;> exact Finset.card_union_le _ _
_ ≤ ∑ a in insert a s, card (t a) := by rw [sum_insert has] <;> exact add_le_add_left ih _
-#align finset.card_bUnion_le Finset.card_bunionᵢ_le
+#align finset.card_bUnion_le Finset.card_biUnion_le
-/
#print Finset.card_eq_sum_card_fiberwise /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/08e1d8d4d989df3a6df86f385e9053ec8a372cc1
@@ -3259,7 +3259,7 @@ theorem cast_list_sum [AddGroupWithOne β] (s : List ℤ) : (↑s.Sum : β) = (s
lean 3 declaration is
forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1)))))) (List.prod.{0} Int Int.hasMul Int.hasOne s)) (List.prod.{u1} β (Distrib.toHasMul.{u1} β (Ring.toDistrib.{u1} β _inst_1)) (AddMonoidWithOne.toOne.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1)))) (List.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1))))))) s))
but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1) (List.prod.{0} Int Int.instMulInt (NonAssocRing.toOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.instRingInt)) s)) (List.prod.{u1} β (NonUnitalNonAssocRing.toMul.{u1} β (NonAssocRing.toNonUnitalNonAssocRing.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1))) (NonAssocRing.toOne.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1)) (List.map.{0, u1} Int β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1)) s))
+ forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1) (List.prod.{0} Int Int.instMulInt (Semiring.toOne.{0} Int Int.instSemiringInt) s)) (List.prod.{u1} β (NonUnitalNonAssocRing.toMul.{u1} β (NonAssocRing.toNonUnitalNonAssocRing.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1))) (Semiring.toOne.{u1} β (Ring.toSemiring.{u1} β _inst_1)) (List.map.{0, u1} Int β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1)) s))
Case conversion may be inaccurate. Consider using '#align int.cast_list_prod Int.cast_list_prodₓ'. -/
@[simp, norm_cast]
theorem cast_list_prod [Ring β] (s : List ℤ) : (↑s.Prod : β) = (s.map coe).Prod :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/08e1d8d4d989df3a6df86f385e9053ec8a372cc1
@@ -1544,13 +1544,25 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
#align finset.sum_dite_irrel Finset.sum_dite_irrel
-/
+/- warning: finset.prod_pi_mul_single' -> Finset.prod_pi_mulSingle' is a dubious translation:
+lean 3 declaration is
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (a : α) (x : β) (s : Finset.{u2} α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (a' : α) => Pi.mulSingle.{u2, u1} α (fun (a : α) => β) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) a x a')) (ite.{succ u1} β (Membership.Mem.{u2, u2} α (Finset.{u2} α) (Finset.hasMem.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) x (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))))
+but is expected to have type
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] (a : α) (x : β) (s : Finset.{u2} α), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (a' : α) => Pi.mulSingle.{u2, u1} α (fun (a : α) => β) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) a x a')) (ite.{succ u1} β (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) x (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))
+Case conversion may be inaccurate. Consider using '#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'ₓ'. -/
@[simp, to_additive]
-theorem prod_pi_mul_single' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
+theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
(∏ a' in s, Pi.mulSingle a x a') = if a ∈ s then x else 1 :=
prod_dite_eq' _ _ _
-#align finset.prod_pi_mul_single' Finset.prod_pi_mul_single'
+#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
+/- warning: finset.prod_pi_mul_single -> Finset.prod_pi_mulSingle is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : α -> Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : forall (a : α), CommMonoid.{u2} (β a)] (a : α) (f : forall (a : α), β a) (s : Finset.{u1} α), Eq.{succ u2} (β a) (Finset.prod.{u2, u1} (β a) α (_inst_3 a) s (fun (a' : α) => Pi.mulSingle.{u1, u2} α (fun (a' : α) => β a') (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => MulOneClass.toHasOne.{u2} (β i) (Monoid.toMulOneClass.{u2} (β i) (CommMonoid.toMonoid.{u2} (β i) (_inst_3 i)))) a' (f a') a)) (ite.{succ u2} (β a) (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) (Finset.decidableMem.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a s) (f a) (OfNat.ofNat.{u2} (β a) 1 (OfNat.mk.{u2} (β a) 1 (One.one.{u2} (β a) (MulOneClass.toHasOne.{u2} (β a) (Monoid.toMulOneClass.{u2} (β a) (CommMonoid.toMonoid.{u2} (β a) (_inst_3 a))))))))
+but is expected to have type
+ forall {α : Type.{u2}} {β : α -> Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : forall (a : α), CommMonoid.{u1} (β a)] (a : α) (f : forall (a : α), β a) (s : Finset.{u2} α), Eq.{succ u1} (β a) (Finset.prod.{u1, u2} (β a) α (_inst_3 a) s (fun (a' : α) => Pi.mulSingle.{u2, u1} α β (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Monoid.toOne.{u1} (β i) (CommMonoid.toMonoid.{u1} (β i) (_inst_3 i))) a' (f a') a)) (ite.{succ u1} (β a) (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (Finset.decidableMem.{u2} α (fun (a : α) (b : α) => _inst_2 a b) a s) (f a) (OfNat.ofNat.{u1} (β a) 1 (One.toOfNat1.{u1} (β a) (Monoid.toOne.{u1} (β a) (CommMonoid.toMonoid.{u1} (β a) (_inst_3 a))))))
+Case conversion may be inaccurate. Consider using '#align finset.prod_pi_mul_single Finset.prod_pi_mulSingleₓ'. -/
@[simp, to_additive]
theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
(f : ∀ a, β a) (s : Finset α) :
@@ -1991,7 +2003,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19935 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19937 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19935 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19937) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19950 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19952 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19950 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19952)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19930 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19932 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19930 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19932) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19945 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19947 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19945 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19947)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
@@ -2372,6 +2384,12 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
#align finset.prod_ite_one Finset.prod_ite_one
#align finset.sum_ite_zero Finset.sum_ite_zero
+/- warning: finset.prod_erase_lt_of_one_lt -> Finset.prod_erase_lt_of_one_lt is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HMul.hMul.{u2, u2, u2} γ γ γ (instHMul.{u2} γ (MulOneClass.toHasMul.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 1 (OfNat.mk.{u2} γ 1 (One.one.{u2} γ (MulOneClass.toHasOne.{u2} γ (Monoid.toMulOneClass.{u2} γ (CommMonoid.toMonoid.{u2} γ (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u2, u1} γ α (OrderedCommMonoid.toCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
+but is expected to have type
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23803 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23805 : γ) => HMul.hMul.{u1, u1, u1} γ γ γ (instHMul.{u1} γ (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23803 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23805) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23818 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23820 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23818 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.23820)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 1 (One.toOfNat1.{u1} γ (Monoid.toOne.{u1} γ (CommMonoid.toMonoid.{u1} γ (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.prod.{u1, u2} γ α (OrderedCommMonoid.toCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+Case conversion may be inaccurate. Consider using '#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_ltₓ'. -/
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
mathlib commit https://github.com/leanprover-community/mathlib/commit/92c69b77c5a7dc0f7eeddb552508633305157caa
@@ -140,7 +140,7 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.fold.{u2, u1} α β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))))) (CommSemigroup.to_isCommutative.{u1} β (CommMonoid.toCommSemigroup.{u1} β _inst_1)) (Semigroup.to_isAssociative.{u1} β (Monoid.toSemigroup.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (OfNat.ofNat.{u1} β 1 (OfNat.mk.{u1} β 1 (One.one.{u1} β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))))) f s)
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.fold.{u2, u1} α β (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.3172 : β) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.3174 : β) => HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.3172 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.3174) (CommSemigroup.to_isCommutative.{u1} β (CommMonoid.toCommSemigroup.{u1} β _inst_1)) (Semigroup.to_isAssociative.{u1} β (Monoid.toSemigroup.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) f s)
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x)) (Finset.fold.{u2, u1} α β (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4358 : β) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4360 : β) => HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4358 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.4360) (CommSemigroup.to_isCommutative.{u1} β (CommMonoid.toCommSemigroup.{u1} β _inst_1)) (Semigroup.to_isAssociative.{u1} β (Monoid.toSemigroup.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (OfNat.ofNat.{u1} β 1 (One.toOfNat1.{u1} β (Monoid.toOne.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) f s)
Case conversion may be inaccurate. Consider using '#align finset.prod_eq_fold Finset.prod_eq_foldₓ'. -/
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
@@ -1991,7 +1991,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18749 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18751 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18749 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18751) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18764 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18766 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18764 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18766)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19935 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19937 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19935 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19937) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19950 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19952 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19950 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.19952)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
mathlib commit https://github.com/leanprover-community/mathlib/commit/36b8aa61ea7c05727161f96a0532897bd72aedab
@@ -1991,7 +1991,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18761 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18763 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18761 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18763) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18776 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18778 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18776 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18778)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18749 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18751 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18749 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18751) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18764 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18766 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18764 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18766)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
mathlib commit https://github.com/leanprover-community/mathlib/commit/a4f99eae998680d3a2c240da4a2b16354c85ee49
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit c227d107bbada5d0d9d20287e3282c0a7f1651a0
+! leanprover-community/mathlib commit fa2309577c7009ea243cffdf990cd6c84f0ad497
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -1544,29 +1544,19 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
#align finset.sum_dite_irrel Finset.sum_dite_irrel
-/
-/- warning: finset.sum_pi_single' -> Finset.sum_pi_single' is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u1}} {M : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] [_inst_3 : AddCommMonoid.{u2} M] (i : ι) (x : M) (s : Finset.{u1} ι), Eq.{succ u2} M (Finset.sum.{u2, u1} M ι _inst_3 s (fun (j : ι) => Pi.single.{u1, u2} ι (fun (i : ι) => M) (fun (a : ι) (b : ι) => _inst_2 a b) (fun (i : ι) => AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (AddCommMonoid.toAddMonoid.{u2} M _inst_3))) i x j)) (ite.{succ u2} M (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (Finset.decidableMem.{u1} ι (fun (a : ι) (b : ι) => _inst_2 a b) i s) x (OfNat.ofNat.{u2} M 0 (OfNat.mk.{u2} M 0 (Zero.zero.{u2} M (AddZeroClass.toHasZero.{u2} M (AddMonoid.toAddZeroClass.{u2} M (AddCommMonoid.toAddMonoid.{u2} M _inst_3)))))))
-but is expected to have type
- forall {ι : Type.{u2}} {M : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} ι] [_inst_3 : AddCommMonoid.{u1} M] (i : ι) (x : M) (s : Finset.{u2} ι), Eq.{succ u1} M (Finset.sum.{u1, u2} M ι _inst_3 s (fun (j : ι) => Pi.single.{u2, u1} ι (fun (i : ι) => M) (fun (a : ι) (b : ι) => _inst_2 a b) (fun (i : ι) => AddMonoid.toZero.{u1} M (AddCommMonoid.toAddMonoid.{u1} M _inst_3)) i x j)) (ite.{succ u1} M (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) (Finset.decidableMem.{u2} ι (fun (a : ι) (b : ι) => _inst_2 a b) i s) x (OfNat.ofNat.{u1} M 0 (Zero.toOfNat0.{u1} M (AddMonoid.toZero.{u1} M (AddCommMonoid.toAddMonoid.{u1} M _inst_3)))))
-Case conversion may be inaccurate. Consider using '#align finset.sum_pi_single' Finset.sum_pi_single'ₓ'. -/
-@[simp]
-theorem sum_pi_single' {ι M : Type _} [DecidableEq ι] [AddCommMonoid M] (i : ι) (x : M)
- (s : Finset ι) : (∑ j in s, Pi.single i x j) = if i ∈ s then x else 0 :=
- sum_dite_eq' _ _ _
+@[simp, to_additive]
+theorem prod_pi_mul_single' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
+ (∏ a' in s, Pi.mulSingle a x a') = if a ∈ s then x else 1 :=
+ prod_dite_eq' _ _ _
+#align finset.prod_pi_mul_single' Finset.prod_pi_mul_single'
#align finset.sum_pi_single' Finset.sum_pi_single'
-/- warning: finset.sum_pi_single -> Finset.sum_pi_single is a dubious translation:
-lean 3 declaration is
- forall {ι : Type.{u1}} {M : ι -> Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] [_inst_3 : forall (i : ι), AddCommMonoid.{u2} (M i)] (i : ι) (f : forall (i : ι), M i) (s : Finset.{u1} ι), Eq.{succ u2} (M i) (Finset.sum.{u2, u1} (M i) ι (_inst_3 i) s (fun (j : ι) => Pi.single.{u1, u2} ι (fun (j : ι) => M j) (fun (a : ι) (b : ι) => _inst_2 a b) (fun (i : ι) => AddZeroClass.toHasZero.{u2} (M i) (AddMonoid.toAddZeroClass.{u2} (M i) (AddCommMonoid.toAddMonoid.{u2} (M i) (_inst_3 i)))) j (f j) i)) (ite.{succ u2} (M i) (Membership.Mem.{u1, u1} ι (Finset.{u1} ι) (Finset.hasMem.{u1} ι) i s) (Finset.decidableMem.{u1} ι (fun (a : ι) (b : ι) => _inst_2 a b) i s) (f i) (OfNat.ofNat.{u2} (M i) 0 (OfNat.mk.{u2} (M i) 0 (Zero.zero.{u2} (M i) (AddZeroClass.toHasZero.{u2} (M i) (AddMonoid.toAddZeroClass.{u2} (M i) (AddCommMonoid.toAddMonoid.{u2} (M i) (_inst_3 i))))))))
-but is expected to have type
- forall {ι : Type.{u2}} {M : ι -> Type.{u1}} [_inst_2 : DecidableEq.{succ u2} ι] [_inst_3 : forall (i : ι), AddCommMonoid.{u1} (M i)] (i : ι) (f : forall (i : ι), M i) (s : Finset.{u2} ι), Eq.{succ u1} (M i) (Finset.sum.{u1, u2} (M i) ι (_inst_3 i) s (fun (j : ι) => Pi.single.{u2, u1} ι M (fun (a : ι) (b : ι) => _inst_2 a b) (fun (i : ι) => AddMonoid.toZero.{u1} (M i) (AddCommMonoid.toAddMonoid.{u1} (M i) (_inst_3 i))) j (f j) i)) (ite.{succ u1} (M i) (Membership.mem.{u2, u2} ι (Finset.{u2} ι) (Finset.instMembershipFinset.{u2} ι) i s) (Finset.decidableMem.{u2} ι (fun (a : ι) (b : ι) => _inst_2 a b) i s) (f i) (OfNat.ofNat.{u1} (M i) 0 (Zero.toOfNat0.{u1} (M i) (AddMonoid.toZero.{u1} (M i) (AddCommMonoid.toAddMonoid.{u1} (M i) (_inst_3 i))))))
-Case conversion may be inaccurate. Consider using '#align finset.sum_pi_single Finset.sum_pi_singleₓ'. -/
-@[simp]
-theorem sum_pi_single {ι : Type _} {M : ι → Type _} [DecidableEq ι] [∀ i, AddCommMonoid (M i)]
- (i : ι) (f : ∀ i, M i) (s : Finset ι) :
- (∑ j in s, Pi.single j (f j) i) = if i ∈ s then f i else 0 :=
- sum_dite_eq _ _ _
+@[simp, to_additive]
+theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
+ (f : ∀ a, β a) (s : Finset α) :
+ (∏ a' in s, Pi.mulSingle a' (f a') a) = if a ∈ s then f a else 1 :=
+ prod_dite_eq _ _ _
+#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
#align finset.sum_pi_single Finset.sum_pi_single
/- warning: finset.prod_bij_ne_one -> Finset.prod_bij_ne_one is a dubious translation:
@@ -2382,19 +2372,15 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
#align finset.prod_ite_one Finset.prod_ite_one
#align finset.sum_ite_zero Finset.sum_ite_zero
-/- warning: finset.sum_erase_lt_of_pos -> Finset.sum_erase_lt_of_pos is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedAddCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HAdd.hAdd.{u2, u2, u2} γ γ γ (instHAdd.{u2} γ (AddZeroClass.toHasAdd.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 0 (OfNat.mk.{u2} γ 0 (Zero.zero.{u2} γ (AddZeroClass.toHasZero.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
-but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22636 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22638 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22636 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22638) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22651 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22653 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22651 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22653)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
-Case conversion may be inaccurate. Consider using '#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_posₓ'. -/
-theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
- [CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
- (hdf : 0 < f d) : (∑ m : α in s.eraseₓ d, f m) < ∑ m : α in s, f m :=
+@[to_additive]
+theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
+ [CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
+ (hdf : 1 < f d) : (∏ m : α in s.eraseₓ d, f m) < ∏ m : α in s, f m :=
by
nth_rw_rhs 1 [← Finset.insert_erase hd]
- rw [Finset.sum_insert (Finset.not_mem_erase d s)]
- exact lt_add_of_pos_left _ hdf
+ rw [Finset.prod_insert (Finset.not_mem_erase d s)]
+ exact lt_mul_of_one_lt_left' _ hdf
+#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_lt
#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_pos
/- warning: finset.eq_one_of_prod_eq_one -> Finset.eq_one_of_prod_eq_one is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce86f4e05e9a9b8da5e316b22c76ce76440c56a1
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit 6c5f73fd6f6cc83122788a80a27cdd54663609f4
+! leanprover-community/mathlib commit c227d107bbada5d0d9d20287e3282c0a7f1651a0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -17,7 +17,7 @@ import Mathbin.Data.Finset.Sum
import Mathbin.Data.Fintype.Basic
import Mathbin.Data.Finset.Sigma
import Mathbin.Data.Multiset.Powerset
-import Mathbin.Data.Set.Pairwise
+import Mathbin.Data.Set.Pairwise.Basic
/-!
# Big operators
@@ -3253,7 +3253,7 @@ theorem cast_list_sum [AddGroupWithOne β] (s : List ℤ) : (↑s.Sum : β) = (s
/- warning: int.cast_list_prod -> Int.cast_list_prod is a dubious translation:
lean 3 declaration is
- forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (NonAssocRing.toAddGroupWithOne.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1)))))) (List.prod.{0} Int Int.hasMul Int.hasOne s)) (List.prod.{u1} β (Distrib.toHasMul.{u1} β (Ring.toDistrib.{u1} β _inst_1)) (AddMonoidWithOne.toOne.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β (NonAssocRing.toAddGroupWithOne.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1)))) (List.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (NonAssocRing.toAddGroupWithOne.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1))))))) s))
+ forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1)))))) (List.prod.{0} Int Int.hasMul Int.hasOne s)) (List.prod.{u1} β (Distrib.toHasMul.{u1} β (Ring.toDistrib.{u1} β _inst_1)) (AddMonoidWithOne.toOne.{u1} β (AddGroupWithOne.toAddMonoidWithOne.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1)))) (List.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β (Ring.toAddCommGroupWithOne.{u1} β _inst_1))))))) s))
but is expected to have type
forall {β : Type.{u1}} [_inst_1 : Ring.{u1} β] (s : List.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1) (List.prod.{0} Int Int.instMulInt (NonAssocRing.toOne.{0} Int (Ring.toNonAssocRing.{0} Int Int.instRingInt)) s)) (List.prod.{u1} β (NonUnitalNonAssocRing.toMul.{u1} β (NonAssocRing.toNonUnitalNonAssocRing.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1))) (NonAssocRing.toOne.{u1} β (Ring.toNonAssocRing.{u1} β _inst_1)) (List.map.{0, u1} Int β (Int.cast.{u1} β (Ring.toIntCast.{u1} β _inst_1)) s))
Case conversion may be inaccurate. Consider using '#align int.cast_list_prod Int.cast_list_prodₓ'. -/
@@ -3276,7 +3276,7 @@ theorem cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
/- warning: int.cast_multiset_prod -> Int.cast_multiset_prod is a dubious translation:
lean 3 declaration is
- forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Multiset.{0} Int), Eq.{succ u1} R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int R (HasLiftT.mk.{1, succ u1} Int R (CoeTCₓ.coe.{1, succ u1} Int R (Int.castCoe.{u1} R (AddGroupWithOne.toHasIntCast.{u1} R (NonAssocRing.toAddGroupWithOne.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1))))))) (Multiset.prod.{0} Int Int.commMonoid s)) (Multiset.prod.{u1} R (CommRing.toCommMonoid.{u1} R _inst_1) (Multiset.map.{0, u1} Int R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int R (HasLiftT.mk.{1, succ u1} Int R (CoeTCₓ.coe.{1, succ u1} Int R (Int.castCoe.{u1} R (AddGroupWithOne.toHasIntCast.{u1} R (NonAssocRing.toAddGroupWithOne.{u1} R (Ring.toNonAssocRing.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) s))
+ forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Multiset.{0} Int), Eq.{succ u1} R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int R (HasLiftT.mk.{1, succ u1} Int R (CoeTCₓ.coe.{1, succ u1} Int R (Int.castCoe.{u1} R (AddGroupWithOne.toHasIntCast.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1))))))) (Multiset.prod.{0} Int Int.commMonoid s)) (Multiset.prod.{u1} R (CommRing.toCommMonoid.{u1} R _inst_1) (Multiset.map.{0, u1} Int R ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int R (HasLiftT.mk.{1, succ u1} Int R (CoeTCₓ.coe.{1, succ u1} Int R (Int.castCoe.{u1} R (AddGroupWithOne.toHasIntCast.{u1} R (AddCommGroupWithOne.toAddGroupWithOne.{u1} R (Ring.toAddCommGroupWithOne.{u1} R (CommRing.toRing.{u1} R _inst_1)))))))) s))
but is expected to have type
forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (s : Multiset.{0} Int), Eq.{succ u1} R (Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Multiset.prod.{0} Int Int.instCommMonoidInt s)) (Multiset.prod.{u1} R (CommRing.toCommMonoid.{u1} R _inst_1) (Multiset.map.{0, u1} Int R (Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1))) s))
Case conversion may be inaccurate. Consider using '#align int.cast_multiset_prod Int.cast_multiset_prodₓ'. -/
@@ -3300,7 +3300,7 @@ theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
/- warning: int.cast_prod -> Int.cast_prod is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : CommRing.{u2} R] (f : α -> Int) (s : Finset.{u1} α), Eq.{succ u2} R ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int R (HasLiftT.mk.{1, succ u2} Int R (CoeTCₓ.coe.{1, succ u2} Int R (Int.castCoe.{u2} R (AddGroupWithOne.toHasIntCast.{u2} R (NonAssocRing.toAddGroupWithOne.{u2} R (Ring.toNonAssocRing.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => f i))) (Finset.prod.{u2, u1} R α (CommRing.toCommMonoid.{u2} R _inst_1) s (fun (i : α) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int R (HasLiftT.mk.{1, succ u2} Int R (CoeTCₓ.coe.{1, succ u2} Int R (Int.castCoe.{u2} R (AddGroupWithOne.toHasIntCast.{u2} R (NonAssocRing.toAddGroupWithOne.{u2} R (Ring.toNonAssocRing.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) (f i)))
+ forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : CommRing.{u2} R] (f : α -> Int) (s : Finset.{u1} α), Eq.{succ u2} R ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int R (HasLiftT.mk.{1, succ u2} Int R (CoeTCₓ.coe.{1, succ u2} Int R (Int.castCoe.{u2} R (AddGroupWithOne.toHasIntCast.{u2} R (AddCommGroupWithOne.toAddGroupWithOne.{u2} R (Ring.toAddCommGroupWithOne.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => f i))) (Finset.prod.{u2, u1} R α (CommRing.toCommMonoid.{u2} R _inst_1) s (fun (i : α) => (fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int R (HasLiftT.mk.{1, succ u2} Int R (CoeTCₓ.coe.{1, succ u2} Int R (Int.castCoe.{u2} R (AddGroupWithOne.toHasIntCast.{u2} R (AddCommGroupWithOne.toAddGroupWithOne.{u2} R (Ring.toAddCommGroupWithOne.{u2} R (CommRing.toRing.{u2} R _inst_1))))))) (f i)))
but is expected to have type
forall {α : Type.{u2}} {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (f : α -> Int) (s : Finset.{u2} α), Eq.{succ u1} R (Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1)) (Finset.prod.{0, u2} Int α Int.instCommMonoidInt s (fun (i : α) => f i))) (Finset.prod.{u1, u2} R α (CommRing.toCommMonoid.{u1} R _inst_1) s (fun (i : α) => Int.cast.{u1} R (Ring.toIntCast.{u1} R (CommRing.toRing.{u1} R _inst_1)) (f i)))
Case conversion may be inaccurate. Consider using '#align int.cast_prod Int.cast_prodₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/b19481deb571022990f1baa9cbf9172e6757a479
@@ -3266,7 +3266,7 @@ theorem cast_list_prod [Ring β] (s : List ℤ) : (↑s.Prod : β) = (s.map coe)
lean 3 declaration is
forall {β : Type.{u1}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Multiset.{0} Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1))))) (Multiset.sum.{0} Int Int.addCommMonoid s)) (Multiset.sum.{u1} β (AddCommGroup.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommGroup.{u1} β _inst_1)) (Multiset.map.{0, u1} Int β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1)))))) s))
but is expected to have type
- forall {β : Type.{u1}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Multiset.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (Multiset.sum.{0} Int Int.instAddCommMonoidInt s)) (Multiset.sum.{u1} β (AddCommGroup.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommGroup.{u1} β _inst_1)) (Multiset.map.{0, u1} Int β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1)) s))
+ forall {β : Type.{u1}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Multiset.{0} Int), Eq.{succ u1} β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (Multiset.sum.{0} Int Int.instAddCommMonoidInt s)) (Multiset.sum.{u1} β (AddCommMonoidWithOne.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommMonoidWithOne.{u1} β _inst_1)) (Multiset.map.{0, u1} Int β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1)) s))
Case conversion may be inaccurate. Consider using '#align int.cast_multiset_sum Int.cast_multiset_sumₓ'. -/
@[simp, norm_cast]
theorem cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
@@ -3290,7 +3290,7 @@ theorem cast_multiset_prod {R : Type _} [CommRing R] (s : Multiset ℤ) :
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Finset.{u2} α) (f : α -> Int), Eq.{succ u1} β ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1))))) (Finset.sum.{0, u2} Int α Int.addCommMonoid s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α (AddCommGroup.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommGroup.{u1} β _inst_1)) s (fun (x : α) => (fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int β (HasLiftT.mk.{1, succ u1} Int β (CoeTCₓ.coe.{1, succ u1} Int β (Int.castCoe.{u1} β (AddGroupWithOne.toHasIntCast.{u1} β (AddCommGroupWithOne.toAddGroupWithOne.{u1} β _inst_1))))) (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Finset.{u2} α) (f : α -> Int), Eq.{succ u1} β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (Finset.sum.{0, u2} Int α Int.instAddCommMonoidInt s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α (AddCommGroup.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommGroup.{u1} β _inst_1)) s (fun (x : α) => Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommGroupWithOne.{u1} β] (s : Finset.{u2} α) (f : α -> Int), Eq.{succ u1} β (Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (Finset.sum.{0, u2} Int α Int.instAddCommMonoidInt s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α (AddCommMonoidWithOne.toAddCommMonoid.{u1} β (AddCommGroupWithOne.toAddCommMonoidWithOne.{u1} β _inst_1)) s (fun (x : α) => Int.cast.{u1} β (AddCommGroupWithOne.toIntCast.{u1} β _inst_1) (f x)))
Case conversion may be inaccurate. Consider using '#align int.cast_sum Int.cast_sumₓ'. -/
@[simp, norm_cast]
theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/b19481deb571022990f1baa9cbf9172e6757a479
@@ -233,7 +233,7 @@ protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l))) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f)) l)))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
Case conversion may be inaccurate. Consider using '#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prodₓ'. -/
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
@@ -2528,30 +2528,22 @@ section Opposite
open MulOpposite
-/- warning: finset.op_sum -> Finset.op_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u1} β] {s : Finset.{u2} α} (f : α -> β), Eq.{succ u1} (MulOpposite.{u1} β) (MulOpposite.op.{u1} β (Finset.sum.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.sum.{u1, u2} (MulOpposite.{u1} β) α (MulOpposite.addCommMonoid.{u1} β _inst_1) s (fun (x : α) => MulOpposite.op.{u1} β (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u1} β] {s : Finset.{u2} α} (f : α -> β), Eq.{succ u1} (MulOpposite.{u1} β) (MulOpposite.op.{u1} β (Finset.sum.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.sum.{u1, u2} (MulOpposite.{u1} β) α (MulOpposite.instAddCommMonoidMulOpposite.{u1} β _inst_1) s (fun (x : α) => MulOpposite.op.{u1} β (f x)))
-Case conversion may be inaccurate. Consider using '#align finset.op_sum Finset.op_sumₓ'. -/
+#print Finset.op_sum /-
/-- Moving to the opposite additive commutative monoid commutes with summing. -/
@[simp]
theorem op_sum [AddCommMonoid β] {s : Finset α} (f : α → β) :
op (∑ x in s, f x) = ∑ x in s, op (f x) :=
(opAddEquiv : β ≃+ βᵐᵒᵖ).map_sum _ _
#align finset.op_sum Finset.op_sum
+-/
-/- warning: finset.unop_sum -> Finset.unop_sum is a dubious translation:
-lean 3 declaration is
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u1} β] {s : Finset.{u2} α} (f : α -> (MulOpposite.{u1} β)), Eq.{succ u1} β (MulOpposite.unop.{u1} β (Finset.sum.{u1, u2} (MulOpposite.{u1} β) α (MulOpposite.addCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α _inst_1 s (fun (x : α) => MulOpposite.unop.{u1} β (f x)))
-but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u1} β] {s : Finset.{u2} α} (f : α -> (MulOpposite.{u1} β)), Eq.{succ u1} β (MulOpposite.unop.{u1} β (Finset.sum.{u1, u2} (MulOpposite.{u1} β) α (MulOpposite.instAddCommMonoidMulOpposite.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.sum.{u1, u2} β α _inst_1 s (fun (x : α) => MulOpposite.unop.{u1} β (f x)))
-Case conversion may be inaccurate. Consider using '#align finset.unop_sum Finset.unop_sumₓ'. -/
+#print Finset.unop_sum /-
@[simp]
theorem unop_sum [AddCommMonoid β] {s : Finset α} (f : α → βᵐᵒᵖ) :
unop (∑ x in s, f x) = ∑ x in s, unop (f x) :=
(opAddEquiv : β ≃+ βᵐᵒᵖ).symm.map_sum _ _
#align finset.unop_sum Finset.unop_sum
+-/
end Opposite
mathlib commit https://github.com/leanprover-community/mathlib/commit/b19481deb571022990f1baa9cbf9172e6757a479
@@ -2001,7 +2001,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18755 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18757 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18755 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18757) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18770 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18772 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18770 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18772)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18761 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18763 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18761 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18763) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18776 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18778 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18776 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18778)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
@@ -2386,7 +2386,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
lean 3 declaration is
forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedAddCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HAdd.hAdd.{u2, u2, u2} γ γ γ (instHAdd.{u2} γ (AddZeroClass.toHasAdd.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 0 (OfNat.mk.{u2} γ 0 (Zero.zero.{u2} γ (AddZeroClass.toHasZero.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22630 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22632 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22630 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22632) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22645 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22647 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22645 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22647)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22636 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22638 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22636 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22638) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22651 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22653 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22651 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22653)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_posₓ'. -/
theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
[CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
mathlib commit https://github.com/leanprover-community/mathlib/commit/da3fc4a33ff6bc75f077f691dc94c217b8d41559
@@ -2025,11 +2025,13 @@ theorem prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
#align finset.sum_const Finset.sum_const
-/
+#print Finset.prod_eq_pow_card /-
@[to_additive sum_eq_card_nsmul]
theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : (∏ a in s, f a) = b ^ s.card :=
(prod_congr rfl hf).trans <| prod_const _
#align finset.prod_eq_pow_card Finset.prod_eq_pow_card
#align finset.sum_eq_card_nsmul Finset.sum_eq_card_nsmul
+-/
#print Finset.pow_eq_prod_const /-
@[to_additive]
@@ -2384,7 +2386,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
lean 3 declaration is
forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedAddCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HAdd.hAdd.{u2, u2, u2} γ γ γ (instHAdd.{u2} γ (AddZeroClass.toHasAdd.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 0 (OfNat.mk.{u2} γ 0 (Zero.zero.{u2} γ (AddZeroClass.toHasZero.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22561 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22563 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22561 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22563) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22576 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22578 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22576 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22578)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22630 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22632 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22630 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22632) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22645 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22647 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22645 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22647)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_posₓ'. -/
theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
[CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
@@ -2794,21 +2796,37 @@ theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : F
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
#align finset.sum_unique_nonempty Finset.sum_unique_nonempty
+#print Finset.sum_nat_mod /-
theorem sum_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
(∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
(Multiset.sum_nat_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]
#align finset.sum_nat_mod Finset.sum_nat_mod
+-/
+#print Finset.prod_nat_mod /-
theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
(∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
(Multiset.prod_nat_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]
#align finset.prod_nat_mod Finset.prod_nat_mod
+-/
+/- warning: finset.sum_int_mod -> Finset.sum_int_mod is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.sum.{0, u1} Int α Int.addCommMonoid s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.sum.{0, u1} Int α Int.addCommMonoid s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (f i) n)) n)
+but is expected to have type
+ forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.sum.{0, u1} Int α Int.instAddCommMonoidInt s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.sum.{0, u1} Int α Int.instAddCommMonoidInt s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (f i) n)) n)
+Case conversion may be inaccurate. Consider using '#align finset.sum_int_mod Finset.sum_int_modₓ'. -/
theorem sum_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
(Multiset.sum_int_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]
#align finset.sum_int_mod Finset.sum_int_mod
+/- warning: finset.prod_int_mod -> Finset.prod_int_mod is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (Finset.prod.{0, u1} Int α Int.commMonoid s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.hasMod) (f i) n)) n)
+but is expected to have type
+ forall {α : Type.{u1}} (s : Finset.{u1} α) (n : Int) (f : α -> Int), Eq.{1} Int (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.prod.{0, u1} Int α Int.instCommMonoidInt s (fun (i : α) => f i)) n) (HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (Finset.prod.{0, u1} Int α Int.instCommMonoidInt s (fun (i : α) => HMod.hMod.{0, 0, 0} Int Int Int (instHMod.{0} Int Int.instModInt_1) (f i) n)) n)
+Case conversion may be inaccurate. Consider using '#align finset.prod_int_mod Finset.prod_int_modₓ'. -/
theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
(∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
(Multiset.prod_int_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce7e9d53d4bbc38065db3b595cd5bd73c323bc1d
@@ -571,7 +571,7 @@ end ToList
theorem Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β)
(hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x :=
by
- convert (Prod_map _ σ.to_embedding _).symm
+ convert(Prod_map _ σ.to_embedding _).symm
exact (map_perm hs).symm
#align equiv.perm.prod_comp Equiv.Perm.prod_comp
#align equiv.perm.sum_comp Equiv.Perm.sum_comp
@@ -2001,7 +2001,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18508 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18510 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18508 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18510) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18523 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18525 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18523 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18525)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18755 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18757 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18755 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18757) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18770 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18772 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18770 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18772)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
@@ -2157,7 +2157,7 @@ Case conversion may be inaccurate. Consider using '#align finset.prod_inter_mul_
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x :=
by
- convert (s.prod_piecewise t f f).symm
+ convert(s.prod_piecewise t f f).symm
simp [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
@@ -2172,7 +2172,7 @@ Case conversion may be inaccurate. Consider using '#align finset.prod_eq_mul_pro
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
(f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x :=
by
- convert (s.prod_inter_mul_prod_diff {i} f).symm
+ convert(s.prod_inter_mul_prod_diff {i} f).symm
simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
#align finset.sum_eq_add_sum_diff_singleton Finset.sum_eq_add_sum_diff_singleton
@@ -2384,7 +2384,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
lean 3 declaration is
forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedAddCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HAdd.hAdd.{u2, u2, u2} γ γ γ (instHAdd.{u2} γ (AddZeroClass.toHasAdd.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 0 (OfNat.mk.{u2} γ 0 (Zero.zero.{u2} γ (AddZeroClass.toHasZero.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22198 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22200 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22198 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22200) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22213 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22215 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22213 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22215)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22561 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22563 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22561 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22563) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22576 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22578 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22576 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22578)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_posₓ'. -/
theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
[CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
@@ -2996,7 +2996,7 @@ Case conversion may be inaccurate. Consider using '#align multiset.disjoint_fins
theorem disjoint_finset_sum_left {β : Type _} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
Multiset.Disjoint (i.Sum f) a ↔ ∀ b ∈ i, Multiset.Disjoint (f b) a :=
by
- convert (@disjoint_sum_left _ a) (map f i.val)
+ convert(@disjoint_sum_left _ a) (map f i.val)
simp [and_congr_left_iff, iff_self_iff]
#align multiset.disjoint_finset_sum_left Multiset.disjoint_finset_sum_left
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -166,7 +166,7 @@ end Finset
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] {G : Type.{u4}} [_inst_3 : MonoidHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (f x)))
but is expected to have type
- forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
+ forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
Case conversion may be inaccurate. Consider using '#align map_prod map_prodₓ'. -/
@[to_additive]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G β γ] (g : G)
@@ -181,7 +181,7 @@ section Deprecated
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align monoid_hom.map_prod MonoidHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
@@ -209,7 +209,7 @@ protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃*
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l)) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f) l))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_prod RingHom.map_list_prodₓ'. -/
/-- Deprecated: use `_root_.map_list_prod` instead. -/
protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
@@ -221,7 +221,7 @@ protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (List.sum.{u1} β (Distrib.toHasAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroClass.toHasZero.{u1} β (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) l)) (List.sum.{u2} γ (Distrib.toHasAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroClass.toHasZero.{u2} γ (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) l))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_sum RingHom.map_list_sumₓ'. -/
/-- Deprecated: use `_root_.map_list_sum` instead. -/
protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
@@ -233,7 +233,7 @@ protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l))) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f)) l)))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
Case conversion may be inaccurate. Consider using '#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prodₓ'. -/
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
@@ -248,7 +248,7 @@ protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f) s))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_prod RingHom.map_multiset_prodₓ'. -/
/-- Deprecated: use `_root_.map_multiset_prod` instead. -/
protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
@@ -260,7 +260,7 @@ protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ]
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) s))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_sum RingHom.map_multiset_sumₓ'. -/
/-- Deprecated: use `_root_.map_multiset_sum` instead. -/
protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
@@ -272,7 +272,7 @@ protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiri
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_prod RingHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
@@ -284,7 +284,7 @@ protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_sum RingHom.map_sumₓ'. -/
/-- Deprecated: use `_root_.map_sum` instead. -/
protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
@@ -298,7 +298,7 @@ end Deprecated
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (β -> γ) (coeFn.{succ (max u3 u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (β -> γ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => γ) (fun (i : β) => _inst_2)) s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
Case conversion may be inaccurate. Consider using '#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prodₓ'. -/
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
@@ -311,7 +311,7 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x) b))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
Case conversion may be inaccurate. Consider using '#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_applyₓ'. -/
-- See also `finset.prod_apply`, with the same conclusion
-- but with the weaker hypothesis `f : α → β → γ`.
@@ -778,7 +778,7 @@ theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β
lean 3 declaration is
forall {ι : Type.{u2}} {β : Type.{u1}} [_inst_1 : CommMonoid.{u1} β] {ι' : Type.{u3}} [_inst_2 : DecidableEq.{succ u2} ι] (e : Equiv.{succ u2, succ u3} ι ι') (f : ι' -> β) {s' : Finset.{u3} ι'} {s : Finset.{u2} ι}, (Eq.{succ u2} (Finset.{u2} ι) s (Finset.image.{u3, u2} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (coeFn.{max 1 (max (succ u3) (succ u2)) (succ u2) (succ u3), max (succ u3) (succ u2)} (Equiv.{succ u3, succ u2} ι' ι) (fun (_x : Equiv.{succ u3, succ u2} ι' ι) => ι' -> ι) (Equiv.hasCoeToFun.{succ u3, succ u2} ι' ι) (Equiv.symm.{succ u2, succ u3} ι ι' e)) s')) -> (Eq.{succ u1} β (Finset.prod.{u1, u3} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u1, u2} β ι _inst_1 s (fun (i : ι) => f (coeFn.{max 1 (max (succ u2) (succ u3)) (succ u3) (succ u2), max (succ u2) (succ u3)} (Equiv.{succ u2, succ u3} ι ι') (fun (_x : Equiv.{succ u2, succ u3} ι ι') => ι -> ι') (Equiv.hasCoeToFun.{succ u2, succ u3} ι ι') e i))))
but is expected to have type
- forall {ι : Type.{u1}} {β : Type.{u3}} [_inst_1 : CommMonoid.{u3} β] {ι' : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] (e : Equiv.{succ u1, succ u2} ι ι') (f : ι' -> β) {s' : Finset.{u2} ι'} {s : Finset.{u1} ι}, (Eq.{succ u1} (Finset.{u1} ι) s (Finset.image.{u2, u1} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (Equiv.{succ u2, succ u1} ι' ι) ι' (fun (_x : ι') => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : ι') => ι) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} ι' ι) (Equiv.symm.{succ u1, succ u2} ι ι' e)) s')) -> (Eq.{succ u3} β (Finset.prod.{u3, u2} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u3, u1} β ι _inst_1 s (fun (i : ι) => f (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Equiv.{succ u1, succ u2} ι ι') ι (fun (_x : ι) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : ι) => ι') _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} ι ι') e i))))
+ forall {ι : Type.{u1}} {β : Type.{u3}} [_inst_1 : CommMonoid.{u3} β] {ι' : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} ι] (e : Equiv.{succ u1, succ u2} ι ι') (f : ι' -> β) {s' : Finset.{u2} ι'} {s : Finset.{u1} ι}, (Eq.{succ u1} (Finset.{u1} ι) s (Finset.image.{u2, u1} ι' ι (fun (a : ι) (b : ι) => _inst_2 a b) (FunLike.coe.{max (succ u1) (succ u2), succ u2, succ u1} (Equiv.{succ u2, succ u1} ι' ι) ι' (fun (_x : ι') => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : ι') => ι) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} ι' ι) (Equiv.symm.{succ u1, succ u2} ι ι' e)) s')) -> (Eq.{succ u3} β (Finset.prod.{u3, u2} β ι' _inst_1 s' (fun (i' : ι') => f i')) (Finset.prod.{u3, u1} β ι _inst_1 s (fun (i : ι) => f (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (Equiv.{succ u1, succ u2} ι ι') ι (fun (_x : ι) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : ι) => ι') _x) (Equiv.instFunLikeEquiv.{succ u1, succ u2} ι ι') e i))))
Case conversion may be inaccurate. Consider using '#align finset.equiv.prod_comp_finset Finset.Equiv.prod_comp_finsetₓ'. -/
/-- Reindexing a product over a finset along an equivalence.
See `equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@@ -2001,7 +2001,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18468 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18470 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18468 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18470) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18483 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18485 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18483 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18485)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18508 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18510 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18508 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18510) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18523 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18525 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18523 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18525)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
@@ -2384,7 +2384,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
lean 3 declaration is
forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedAddCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HAdd.hAdd.{u2, u2, u2} γ γ γ (instHAdd.{u2} γ (AddZeroClass.toHasAdd.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 0 (OfNat.mk.{u2} γ 0 (Zero.zero.{u2} γ (AddZeroClass.toHasZero.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22158 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22160 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22158 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22160) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22173 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22175 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22173 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22175)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22198 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22200 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22198 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22200) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22213 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22215 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22213 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22215)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_posₓ'. -/
theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
[CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
@@ -2844,7 +2844,7 @@ theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u2}} {M : Type.{u3}} [_inst_1 : Fintype.{u1} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u3} M] (e : Equiv.{succ u1, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u3} M (f x) (g (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) e x))) -> (Eq.{succ u3} M (Finset.prod.{u3, u1} M α _inst_3 (Finset.univ.{u1} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u3, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
but is expected to have type
- forall {α : Type.{u3}} {β : Type.{u2}} {M : Type.{u1}} [_inst_1 : Fintype.{u3} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u1} M] (e : Equiv.{succ u3, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u1} M (f x) (g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Equiv.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u3, succ u2} α β) e x))) -> (Eq.{succ u1} M (Finset.prod.{u1, u3} M α _inst_3 (Finset.univ.{u3} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u1, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
+ forall {α : Type.{u3}} {β : Type.{u2}} {M : Type.{u1}} [_inst_1 : Fintype.{u3} α] [_inst_2 : Fintype.{u2} β] [_inst_3 : CommMonoid.{u1} M] (e : Equiv.{succ u3, succ u2} α β) (f : α -> M) (g : β -> M), (forall (x : α), Eq.{succ u1} M (f x) (g (FunLike.coe.{max (succ u3) (succ u2), succ u3, succ u2} (Equiv.{succ u3, succ u2} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u3, succ u2} α β) e x))) -> (Eq.{succ u1} M (Finset.prod.{u1, u3} M α _inst_3 (Finset.univ.{u3} α _inst_1) (fun (x : α) => f x)) (Finset.prod.{u1, u2} M β _inst_3 (Finset.univ.{u2} β _inst_2) (fun (x : β) => g x)))
Case conversion may be inaccurate. Consider using '#align fintype.prod_equiv Fintype.prod_equivₓ'. -/
/-- `fintype.prod_equiv` is a specialization of `finset.prod_bij` that
automatically fills in most arguments.
@@ -3073,7 +3073,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Finset.sup.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (Lattice.toSemilatticeSup.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.lattice.{u1} (Multiset.{u1} α) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a b))) (Multiset.orderBot.{u1} (Multiset.{u1} α)) (Finset.range (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) x) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k x)) (Multiset.powerset.{u1} α x)
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Finset.sup.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (Lattice.toSemilatticeSup.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instLatticeMultiset.{u1} (Multiset.{u1} α) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a b))) (Multiset.instOrderBotMultisetToLEToPreorderInstPartialOrderMultiset.{u1} (Multiset.{u1} α)) (Finset.range (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) x) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) x) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) x) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) x) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k x)) (Multiset.powerset.{u1} α x)
+ forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : Multiset.{u1} α), Eq.{succ u1} (Multiset.{u1} (Multiset.{u1} α)) (Finset.sup.{u1, 0} (Multiset.{u1} (Multiset.{u1} α)) Nat (Lattice.toSemilatticeSup.{u1} (Multiset.{u1} (Multiset.{u1} α)) (Multiset.instLatticeMultiset.{u1} (Multiset.{u1} α) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b) a b))) (Multiset.instOrderBotMultisetToLEToPreorderInstPartialOrderMultiset.{u1} (Multiset.{u1} α)) (Finset.range (HAdd.hAdd.{0, 0, 0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) x) Nat ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) x) (instHAdd.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) x) instAddNat) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) x) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (fun (k : Nat) => Multiset.powersetLen.{u1} α k x)) (Multiset.powerset.{u1} α x)
Case conversion may be inaccurate. Consider using '#align multiset.sup_powerset_len Multiset.sup_powerset_lenₓ'. -/
theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
(Finset.sup (Finset.range (x.card + 1)) fun k => x.powersetLen k) = x.powerset :=
@@ -3088,7 +3088,7 @@ theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{1} Nat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s)) (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) s)
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{1} Nat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s)
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Multiset.{u1} α), Eq.{1} Nat (Finset.sum.{0, u1} Nat α Nat.addCommMonoid (Multiset.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s) (fun (a : α) => Multiset.count.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a s)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) (fun (_x : Multiset.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : Multiset.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddZeroClass.toAdd.{u1} (Multiset.{u1} α) (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α))))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (Multiset.card.{u1} α) s)
Case conversion may be inaccurate. Consider using '#align multiset.to_finset_sum_count_eq Multiset.toFinset_sum_count_eqₓ'. -/
@[simp]
theorem toFinset_sum_count_eq (s : Multiset α) : (∑ a in s.toFinset, s.count a) = s.card :=
@@ -3406,7 +3406,7 @@ theorem toMul_multiset_sum (s : Multiset (Additive α)) : toMul s.Sum = (s.map t
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> α), Eq.{succ u1} (Additive.{u1} α) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Additive.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Additive.{u1} α)) => α -> (Additive.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Additive.{u1} α)) (Additive.ofMul.{u1} α) (Finset.prod.{u1, u2} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u1, u2} (Additive.{u1} α) ι (Additive.addCommMonoid.{u1} α _inst_1) s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Additive.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Additive.{u1} α)) => α -> (Additive.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Additive.{u1} α)) (Additive.ofMul.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => Additive.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Additive.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Additive.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Additive.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Additive.{u2} α)) (Additive.ofMul.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align of_mul_prod ofMul_prodₓ'. -/
@[simp]
theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) = ∑ i in s, ofMul (f i) :=
@@ -3417,7 +3417,7 @@ theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) =
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : CommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> (Additive.{u1} α)), Eq.{succ u1} α (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Additive.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Additive.{u1} α) α) => (Additive.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Additive.{u1} α) α) (Additive.toMul.{u1} α) (Finset.sum.{u1, u2} (Additive.{u1} α) ι (Additive.addCommMonoid.{u1} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u1, u2} α ι _inst_1 s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Additive.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Additive.{u1} α) α) => (Additive.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Additive.{u1} α) α) (Additive.toMul.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Additive.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Additive.{u2} α) => α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Additive.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Additive.{u2} α) => α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (Finset.sum.{u2, u1} (Additive.{u2} α) ι (Additive.addCommMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.{u2} α) (fun (_x : Additive.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Additive.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Additive.{u2} α) α) (Additive.toMul.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align to_mul_sum toMul_sumₓ'. -/
@[simp]
theorem toMul_sum (s : Finset ι) (f : ι → Additive α) :
@@ -3448,7 +3448,7 @@ theorem toAdd_multiset_sum (s : Multiset (Multiplicative α)) : toAdd s.Prod = (
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> α), Eq.{succ u1} (Multiplicative.{u1} α) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) => α -> (Multiplicative.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Multiplicative.{u1} α)) (Multiplicative.ofAdd.{u1} α) (Finset.sum.{u1, u2} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u1, u2} (Multiplicative.{u1} α) ι (Multiplicative.commMonoid.{u1} α _inst_1) s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} α (Multiplicative.{u1} α)) => α -> (Multiplicative.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} α (Multiplicative.{u1} α)) (Multiplicative.ofAdd.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => Multiplicative.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> α), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Multiplicative.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => f i))) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => Multiplicative.{u2} α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} α (Multiplicative.{u2} α)) (Multiplicative.ofAdd.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align of_add_sum ofAdd_sumₓ'. -/
@[simp]
theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) = ∏ i in s, ofAdd (f i) :=
@@ -3459,7 +3459,7 @@ theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) =
lean 3 declaration is
forall {ι : Type.{u2}} {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] (s : Finset.{u2} ι) (f : ι -> (Multiplicative.{u1} α)), Eq.{succ u1} α (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) => (Multiplicative.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Multiplicative.{u1} α) α) (Multiplicative.toAdd.{u1} α) (Finset.prod.{u1, u2} (Multiplicative.{u1} α) ι (Multiplicative.commMonoid.{u1} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u1, u2} α ι _inst_1 s (fun (i : ι) => coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) (fun (_x : Equiv.{succ u1, succ u1} (Multiplicative.{u1} α) α) => (Multiplicative.{u1} α) -> α) (Equiv.hasCoeToFun.{succ u1, succ u1} (Multiplicative.{u1} α) α) (Multiplicative.toAdd.{u1} α) (f i)))
but is expected to have type
- forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Multiplicative.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Multiplicative.{u2} α) => α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (f i)))
+ forall {ι : Type.{u1}} {α : Type.{u2}} [_inst_1 : AddCommMonoid.{u2} α] (s : Finset.{u1} ι) (f : ι -> (Multiplicative.{u2} α)), Eq.{succ u2} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} α) => α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (Finset.prod.{u2, u1} (Multiplicative.{u2} α) ι (Multiplicative.commMonoid.{u2} α _inst_1) s (fun (i : ι) => f i))) (Finset.sum.{u2, u1} α ι _inst_1 s (fun (i : ι) => FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.{u2} α) (fun (_x : Multiplicative.{u2} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} α) => α) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} α) α) (Multiplicative.toAdd.{u2} α) (f i)))
Case conversion may be inaccurate. Consider using '#align to_add_prod toAdd_prodₓ'. -/
@[simp]
theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -603,7 +603,7 @@ variable [Fintype α] [CommMonoid β]
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : Fintype.{u2} α] [_inst_2 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u2} α}, (IsCompl.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.boundedOrder.{u2} α _inst_1) s t) -> (forall (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_2)))) (Finset.prod.{u1, u2} β α _inst_2 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_2 t (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_2 (Finset.univ.{u2} α _inst_1) (fun (i : α) => f i)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : Fintype.{u2} α] [_inst_2 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u2} α}, (IsCompl.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.instBoundedOrderFinsetToLEToPreorderPartialOrder.{u2} α _inst_1) s t) -> (forall (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_2)))) (Finset.prod.{u1, u2} β α _inst_2 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_2 t (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_2 (Finset.univ.{u2} α _inst_1) (fun (i : α) => f i)))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : Fintype.{u2} α] [_inst_2 : CommMonoid.{u1} β] {s : Finset.{u2} α} {t : Finset.{u2} α}, (IsCompl.{u2} (Finset.{u2} α) (Finset.partialOrder.{u2} α) (Finset.boundedOrder.{u2} α _inst_1) s t) -> (forall (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_2)))) (Finset.prod.{u1, u2} β α _inst_2 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_2 t (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_2 (Finset.univ.{u2} α _inst_1) (fun (i : α) => f i)))
Case conversion may be inaccurate. Consider using '#align is_compl.prod_mul_prod IsCompl.prod_mul_prodₓ'. -/
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
@@ -625,7 +625,7 @@ variable [CommMonoid β]
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.instBooleanAlgebraFinset.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
Case conversion may be inaccurate. Consider using '#align finset.prod_mul_prod_compl Finset.prod_mul_prod_complₓ'. -/
/-- Multiplying the products of a function over `s` and over `sᶜ` gives the whole product.
For a version expressed with subtypes, see `fintype.prod_subtype_mul_prod_subtype`. -/
@@ -641,7 +641,7 @@ theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f :
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.instBooleanAlgebraFinset.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : Fintype.{u2} α] [_inst_3 : DecidableEq.{succ u2} α] (s : Finset.{u2} α) (f : α -> β), Eq.{succ u1} β (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_2 (fun (a : α) (b : α) => _inst_3 a b))) s) (fun (i : α) => f i)) (Finset.prod.{u1, u2} β α _inst_1 s (fun (i : α) => f i))) (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_2) (fun (i : α) => f i))
Case conversion may be inaccurate. Consider using '#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prodₓ'. -/
@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
@@ -2194,7 +2194,7 @@ theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) a)) (fun (i : α) => f i)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.instBooleanAlgebraFinset.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a)) (fun (i : α) => f i)))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (f a) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a)) (fun (i : α) => f i)))
Case conversion may be inaccurate. Consider using '#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_complₓ'. -/
@[to_additive]
theorem Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
@@ -2207,7 +2207,7 @@ theorem Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.hasSingleton.{u2} α) a)) (fun (i : α) => f i)) (f a))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.instBooleanAlgebraFinset.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a)) (fun (i : α) => f i)) (f a))
+ forall {β : Type.{u1}} {α : Type.{u2}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : Fintype.{u2} α] (a : α) (f : α -> β), Eq.{succ u1} β (Finset.prod.{u1, u2} β α _inst_1 (Finset.univ.{u2} α _inst_3) (fun (i : α) => f i)) (HMul.hMul.{u1, u1, u1} β β β (instHMul.{u1} β (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)))) (Finset.prod.{u1, u2} β α _inst_1 (HasCompl.compl.{u2} (Finset.{u2} α) (BooleanAlgebra.toHasCompl.{u2} (Finset.{u2} α) (Finset.booleanAlgebra.{u2} α _inst_3 (fun (a : α) (b : α) => _inst_2 a b))) (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a)) (fun (i : α) => f i)) (f a))
Case conversion may be inaccurate. Consider using '#align fintype.prod_eq_prod_compl_mul Fintype.prod_eq_prod_compl_mulₓ'. -/
@[to_additive]
theorem Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -2729,7 +2729,7 @@ Case conversion may be inaccurate. Consider using '#align finset.prod_eq_zero Fi
theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : (∏ x in s, f x) = 0 :=
by
haveI := Classical.decEq α
- rw [← prod_erase_mul _ _ ha, h, mul_zero]
+ rw [← prod_erase_mul _ _ ha, h, MulZeroClass.mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
/- warning: finset.prod_boole -> Finset.prod_boole is a dubious translation:
mathlib commit https://github.com/leanprover-community/mathlib/commit/38f16f960f5006c6c0c2bac7b0aba5273188f4e5
@@ -166,7 +166,7 @@ end Finset
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] {G : Type.{u4}} [_inst_3 : MonoidHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{succ u4, max (succ u1) (succ u3)} G (fun (_x : G) => β -> γ) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} G β (fun (_x : β) => γ) (MulHomClass.toFunLike.{u4, u1, u3} G β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u4, u1, u3} G β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) _inst_3))) g (f x)))
but is expected to have type
- forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
+ forall {β : Type.{u2}} {α : Type.{u3}} {γ : Type.{u4}} [_inst_1 : CommMonoid.{u2} β] [_inst_2 : CommMonoid.{u4} γ] {G : Type.{u1}} [_inst_3 : MonoidHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))] (g : G) (f : α -> β) (s : Finset.{u3} α), Eq.{succ u4} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (Finset.prod.{u2, u3} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u4, u3} γ α _inst_2 s (fun (x : α) => FunLike.coe.{succ u1, succ u2, succ u4} G β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{u1, u2, u4} G β γ (MulOneClass.toMul.{u2} β (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1))) (MulOneClass.toMul.{u4} γ (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2))) (MonoidHomClass.toMulHomClass.{u1, u2, u4} G β γ (Monoid.toMulOneClass.{u2} β (CommMonoid.toMonoid.{u2} β _inst_1)) (Monoid.toMulOneClass.{u4} γ (CommMonoid.toMonoid.{u4} γ _inst_2)) _inst_3)) g (f x)))
Case conversion may be inaccurate. Consider using '#align map_prod map_prodₓ'. -/
@[to_additive]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G β γ] (g : G)
@@ -181,7 +181,7 @@ section Deprecated
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align monoid_hom.map_prod MonoidHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
@@ -209,7 +209,7 @@ protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃*
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l)) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) f) l))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l)) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β _inst_1) (Semiring.toNonAssocSemiring.{u2} γ _inst_2))))) f) l))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_prod RingHom.map_list_prodₓ'. -/
/-- Deprecated: use `_root_.map_list_prod` instead. -/
protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
@@ -221,7 +221,7 @@ protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (List.sum.{u1} β (Distrib.toHasAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroClass.toHasZero.{u1} β (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) l)) (List.sum.{u2} γ (Distrib.toHasAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroClass.toHasZero.{u2} γ (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (List.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) l))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (l : List.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (List.sum.{u1} β (Distrib.toAdd.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1))) (MulZeroOneClass.toZero.{u1} β (NonAssocSemiring.toMulZeroOneClass.{u1} β _inst_1)) l)) (List.sum.{u2} γ (Distrib.toAdd.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2))) (MulZeroOneClass.toZero.{u2} γ (NonAssocSemiring.toMulZeroOneClass.{u2} γ _inst_2)) (List.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) l))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_list_sum RingHom.map_list_sumₓ'. -/
/-- Deprecated: use `_root_.map_list_sum` instead. -/
protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
@@ -233,7 +233,7 @@ protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f (List.prod.{u1} β (Distrib.toHasMul.{u1} β (NonUnitalNonAssocSemiring.toDistrib.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) (AddMonoidWithOne.toOne.{u1} β (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} β (NonAssocSemiring.toAddCommMonoidWithOne.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)))) l))) (List.prod.{u2} γ (Distrib.toHasMul.{u2} γ (NonUnitalNonAssocSemiring.toDistrib.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (AddMonoidWithOne.toOne.{u2} γ (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} γ (NonAssocSemiring.toAddCommMonoidWithOne.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) => β -> (MulOpposite.{u2} γ)) (RingHom.hasCoeToFun.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.nonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) f)) l)))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : Semiring.{u1} β] [_inst_2 : Semiring.{u2} γ] (f : RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (l : List.{u1} β), Eq.{succ u2} γ (MulOpposite.unop.{u2} γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f (List.prod.{u1} β (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (Semiring.toOne.{u1} β _inst_1) l))) (List.prod.{u2} γ (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (Semiring.toOne.{u2} γ _inst_2) (List.reverse.{u2} γ (List.map.{u1, u2} β γ (Function.comp.{succ u1, succ u2, succ u2} β (MulOpposite.{u2} γ) γ (MulOpposite.unop.{u2} γ) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => MulOpposite.{u2} γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u2} (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} (MulOpposite.{u2} γ) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2))) β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β (MulOpposite.{u2} γ) (Semiring.toNonAssocSemiring.{u1} β _inst_1) (MulOpposite.instNonAssocSemiringMulOpposite.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ _inst_2)))))) f)) l)))
Case conversion may be inaccurate. Consider using '#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prodₓ'. -/
/-- A morphism into the opposite ring acts on the product by acting on the reversed elements.
@@ -248,7 +248,7 @@ protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (fun (_x : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) f) s))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f (Multiset.prod.{u1} β (CommSemiring.toCommMonoid.{u1} β _inst_1) s)) (Multiset.prod.{u2} γ (CommSemiring.toCommMonoid.{u2} γ _inst_2) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u2} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u2} γ (CommSemiring.toSemiring.{u2} γ _inst_2)))))) f) s))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_prod RingHom.map_multiset_prodₓ'. -/
/-- Deprecated: use `_root_.map_multiset_prod` instead. -/
protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
@@ -260,7 +260,7 @@ protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ]
lean 3 declaration is
forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (coeFn.{max (succ u1) (succ u2), max (succ u1) (succ u2)} (RingHom.{u1, u2} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u2} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u2} β γ _inst_1 _inst_2) f) s))
but is expected to have type
- forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
+ forall {β : Type.{u1}} {γ : Type.{u2}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u2} γ] (f : RingHom.{u1, u2} β γ _inst_1 _inst_2) (s : Multiset.{u1} β), Eq.{succ u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f (Multiset.sum.{u1} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s)) (Multiset.sum.{u2} γ (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (Multiset.map.{u1, u2} β γ (FunLike.coe.{max (succ u1) (succ u2), succ u1, succ u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u2} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, u2} (RingHom.{u1, u2} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u2} β γ _inst_1 _inst_2)))) f) s))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_multiset_sum RingHom.map_multiset_sumₓ'. -/
/-- Deprecated: use `_root_.map_multiset_sum` instead. -/
protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
@@ -272,7 +272,7 @@ protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiri
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (fun (_x : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommSemiring.{u1} β] [_inst_2 : CommSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (Finset.prod.{u1, u2} β α (CommSemiring.toCommMonoid.{u1} β _inst_1) s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α (CommSemiring.toCommMonoid.{u3} γ _inst_2) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2))) β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)) (RingHom.instRingHomClassRingHom.{u1, u3} β γ (Semiring.toNonAssocSemiring.{u1} β (CommSemiring.toSemiring.{u1} β _inst_1)) (Semiring.toNonAssocSemiring.{u3} γ (CommSemiring.toSemiring.{u3} γ _inst_2)))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_prod RingHom.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
@@ -284,7 +284,7 @@ protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} β γ _inst_1 _inst_2) (fun (_x : RingHom.{u1, u3} β γ _inst_1 _inst_2) => β -> γ) (RingHom.hasCoeToFun.{u1, u3} β γ _inst_1 _inst_2) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : NonAssocSemiring.{u1} β] [_inst_2 : NonAssocSemiring.{u3} γ] (g : RingHom.{u1, u3} β γ _inst_1 _inst_2) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (Finset.sum.{u1, u2} β α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) s (fun (x : α) => f x))) (Finset.sum.{u3, u2} γ α (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonUnitalNonAssocSemiring.toMul.{u1} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u3} γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2)) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} β _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} γ _inst_2) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} β γ _inst_1 _inst_2) β γ _inst_1 _inst_2 (RingHom.instRingHomClassRingHom.{u1, u3} β γ _inst_1 _inst_2)))) g (f x)))
Case conversion may be inaccurate. Consider using '#align ring_hom.map_sum RingHom.map_sumₓ'. -/
/-- Deprecated: use `_root_.map_sum` instead. -/
protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
@@ -298,7 +298,7 @@ end Deprecated
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (β -> γ) (coeFn.{succ (max u3 u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (β -> γ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => γ) (fun (i : β) => _inst_2)) s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α), Eq.{max (succ u1) (succ u3)} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) ᾰ) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x))) (Finset.prod.{max u1 u3, u2} (forall (ᾰ : β), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) ᾰ) α (Pi.commMonoid.{u1, u3} β (fun (ᾰ : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) ᾰ) (fun (i : β) => _inst_2)) s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x)))
Case conversion may be inaccurate. Consider using '#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prodₓ'. -/
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
@@ -311,7 +311,7 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} γ (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (Finset.prod.{max u3 u1, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (fun (_x : MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) => β -> γ) (MonoidHom.hasCoeToFun.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (f x) b))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : MulOneClass.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (f : α -> (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (s : Finset.{u2} α) (b : β), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) b) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (Finset.prod.{max u1 u3, u2} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) α (MonoidHom.commMonoid.{u1, u3} β γ _inst_1 _inst_2) s (fun (x : α) => f x)) b) (Finset.prod.{u3, u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) b) α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ (MulOneClass.toMul.{u1} β _inst_1) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MonoidHom.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MonoidHom.monoidHomClass.{u1, u3} β γ _inst_1 (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))) (f x) b))
Case conversion may be inaccurate. Consider using '#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_applyₓ'. -/
-- See also `finset.prod_apply`, with the same conclusion
-- but with the weaker hypothesis `f : α → β → γ`.
mathlib commit https://github.com/leanprover-community/mathlib/commit/195fcd60ff2bfe392543bceb0ec2adcdb472db4c
@@ -2001,7 +2001,7 @@ theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ)
lean 3 declaration is
forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))))) (LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring))) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat Nat.hasAdd) i (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18458 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18460 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18458 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18460) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18473 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18475 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18473 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18475)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
+ forall {α : Type.{u1}} [_inst_2 : CanonicallyOrderedAddMonoid.{u1} α] [_inst_3 : Sub.{u1} α] [_inst_4 : OrderedSub.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))))) _inst_3] [_inst_5 : ContravariantClass.{u1, u1} α α (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18468 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18470 : α) => HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18468 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18470) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18483 : α) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18485 : α) => LE.le.{u1} α (Preorder.toLE.{u1} α (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18483 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.18485)] {f : Nat -> α}, (Monotone.{0, u1} Nat α (PartialOrder.toPreorder.{0} Nat (StrictOrderedSemiring.toPartialOrder.{0} Nat Nat.strictOrderedSemiring)) (PartialOrder.toPreorder.{u1} α (OrderedAddCommMonoid.toPartialOrder.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2))) f) -> (forall (n : Nat), Eq.{succ u1} α (Finset.sum.{u1, 0} α Nat (OrderedAddCommMonoid.toAddCommMonoid.{u1} α (CanonicallyOrderedAddMonoid.toOrderedAddCommMonoid.{u1} α _inst_2)) (Finset.range n) (fun (i : Nat) => HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f (HAdd.hAdd.{0, 0, 0} Nat Nat Nat (instHAdd.{0} Nat instAddNat) i (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))) (f i))) (HSub.hSub.{u1, u1, u1} α α α (instHSub.{u1} α _inst_3) (f n) (f (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))
Case conversion may be inaccurate. Consider using '#align finset.sum_range_tsub Finset.sum_range_tsubₓ'. -/
/-- A telescoping sum along `{0, ..., n-1}` of an `ℕ`-valued function
reduces to the difference of the last and first terms
@@ -2384,7 +2384,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
lean 3 declaration is
forall {α : Type.{u1}} {γ : Type.{u2}} [_inst_2 : DecidableEq.{succ u1} α] [_inst_3 : OrderedAddCommMonoid.{u2} γ] [_inst_4 : CovariantClass.{u2, u2} γ γ (HAdd.hAdd.{u2, u2, u2} γ γ γ (instHAdd.{u2} γ (AddZeroClass.toHasAdd.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3)))))) (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))))] {s : Finset.{u1} α} {d : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (OfNat.ofNat.{u2} γ 0 (OfNat.mk.{u2} γ 0 (Zero.zero.{u2} γ (AddZeroClass.toHasZero.{u2} γ (AddMonoid.toAddZeroClass.{u2} γ (AddCommMonoid.toAddMonoid.{u2} γ (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3))))))) (f d)) -> (LT.lt.{u2} γ (Preorder.toLT.{u2} γ (PartialOrder.toPreorder.{u2} γ (OrderedAddCommMonoid.toPartialOrder.{u2} γ _inst_3))) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) (Finset.erase.{u1} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u2, u1} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u2} γ _inst_3) s (fun (m : α) => f m))))
but is expected to have type
- forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22144 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22146 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22144 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22146) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22159 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22161 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22159 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22161)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
+ forall {α : Type.{u2}} {γ : Type.{u1}} [_inst_2 : DecidableEq.{succ u2} α] [_inst_3 : OrderedAddCommMonoid.{u1} γ] [_inst_4 : CovariantClass.{u1, u1} γ γ (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22158 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22160 : γ) => HAdd.hAdd.{u1, u1, u1} γ γ γ (instHAdd.{u1} γ (AddZeroClass.toAdd.{u1} γ (AddMonoid.toAddZeroClass.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22158 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22160) (fun (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22173 : γ) (x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22175 : γ) => LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22173 x._@.Mathlib.Algebra.BigOperators.Basic._hyg.22175)] {s : Finset.{u2} α} {d : α}, (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) d s) -> (forall {f : α -> γ}, (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (OfNat.ofNat.{u1} γ 0 (Zero.toOfNat0.{u1} γ (AddMonoid.toZero.{u1} γ (AddCommMonoid.toAddMonoid.{u1} γ (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3))))) (f d)) -> (LT.lt.{u1} γ (Preorder.toLT.{u1} γ (PartialOrder.toPreorder.{u1} γ (OrderedAddCommMonoid.toPartialOrder.{u1} γ _inst_3))) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) (Finset.erase.{u2} α (fun (a : α) (b : α) => _inst_2 a b) s d) (fun (m : α) => f m)) (Finset.sum.{u1, u2} γ α (OrderedAddCommMonoid.toAddCommMonoid.{u1} γ _inst_3) s (fun (m : α) => f m))))
Case conversion may be inaccurate. Consider using '#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_posₓ'. -/
theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
[CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -1309,7 +1309,7 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
_ =
(∏ x in (s.filterₓ p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
∏ x in (s.filterₓ fun x => ¬p x).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
- congr_arg₂ _ prod_attach.symm prod_attach.symm
+ (congr_arg₂ _ prod_attach.symm prod_attach.symm)
_ =
(∏ x in (s.filterₓ p).attach, h (f x.1 (mem_filter.mp x.2).2)) *
∏ x in (s.filterₓ fun x => ¬p x).attach, h (g x.1 (mem_filter.mp x.2).2) :=
@@ -1585,7 +1585,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
calc
(∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
_ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
- prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
+ (prod_bij (fun a ha => i a (mem_filter.mp ha).1 (mem_filter.mp ha).2)
(fun a ha =>
(mem_filter.mp ha).elim fun h₁ h₂ =>
mem_filter.mpr ⟨hi a h₁ h₂, fun hg => h₂ (hg ▸ h a h₁ h₂)⟩)
@@ -1596,7 +1596,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
fun b hb =>
(mem_filter.mp hb).elim fun h₁ h₂ =>
let ⟨a, ha₁, ha₂, Eq⟩ := i_surj b h₁ h₂
- ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩
+ ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, Eq⟩)
_ = ∏ x in t, g x := prod_filter_ne_one
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
@@ -2124,9 +2124,9 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
rintro ⟨b_fst, b_snd⟩ H
simp only [mem_image, exists_prop, mem_filter, mem_sigma] at H
tauto)
- _ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f (g a) := prod_sigma _ _ _
+ _ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f (g a) := (prod_sigma _ _ _)
_ = ∏ b in s.image g, ∏ a in s.filterₓ fun a => g a = b, f b :=
- prod_congr rfl fun b hb => prod_congr rfl (by simp (config := { contextual := true }))
+ (prod_congr rfl fun b hb => prod_congr rfl (by simp (config := { contextual := true })))
_ = ∏ b in s.image g, f b ^ (s.filterₓ fun a => g a = b).card :=
prod_congr rfl fun _ _ => prod_const _
@@ -2670,7 +2670,7 @@ theorem card_bunionᵢ [DecidableEq β] {s : Finset α} {t : α → Finset β}
(s.bunionᵢ t).card = ∑ u in s, card (t u) :=
calc
(s.bunionᵢ t).card = ∑ i in s.bunionᵢ t, 1 := by simp
- _ = ∑ a in s, ∑ i in t a, 1 := Finset.sum_bunionᵢ h
+ _ = ∑ a in s, ∑ i in t a, 1 := (Finset.sum_bunionᵢ h)
_ = ∑ u in s, card (t u) := by simp
#align finset.card_bUnion Finset.card_bunionᵢ
@@ -3050,8 +3050,8 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u2}} [_inst_1 : DecidableEq.{succ u2} α] {β : Type.{u1}} {i : Finset.{u1} β} {f : β -> (Multiset.{u2} α)}, Iff (Eq.{succ u2} (Multiset.{u2} α) (Finset.sum.{u2, u1} (Multiset.{u2} α) β (OrderedCancelAddCommMonoid.toAddCommMonoid.{u2} (Multiset.{u2} α) (Multiset.instOrderedCancelAddCommMonoidMultiset.{u2} α)) i f) (Finset.sup.{u2, u1} (Multiset.{u2} α) β (Lattice.toSemilatticeSup.{u2} (Multiset.{u2} α) (Multiset.instLatticeMultiset.{u2} α (fun (a : α) (b : α) => _inst_1 a b))) (Multiset.instOrderBotMultisetToLEToPreorderInstPartialOrderMultiset.{u2} α) i f)) (forall (x : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) x i) -> (forall (y : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) y i) -> (Ne.{succ u1} β x y) -> (Multiset.Disjoint.{u2} α (f x) (f y))))
Case conversion may be inaccurate. Consider using '#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjointₓ'. -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x «expr ∈ » i) -/
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x y «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ∈ » i) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x y «expr ∈ » i) -/
theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
i.Sum f = i.sup f ↔ ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/271bf175e6c51b8d31d6c0107b7bb4a967c7277e
@@ -195,7 +195,7 @@ protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →
lean 3 declaration is
forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} γ (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (fun (_x : MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) => β -> γ) (MulEquiv.hasCoeToFun.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (fun (_x : MulEquiv.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) => β -> γ) (MulEquiv.hasCoeToFun.{u1, u3} β γ (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toHasMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) g (f x)))
but is expected to have type
- forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MulEquivClass.instMonoidHomClass.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MulEquiv.instMulEquivClassMulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β (fun (_x : β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : β) => γ) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MonoidHomClass.toMulHomClass.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MulEquivClass.instMonoidHomClass.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1)) (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)) (MulEquiv.instMulEquivClassMulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) g (f x)))
+ forall {β : Type.{u1}} {α : Type.{u2}} {γ : Type.{u3}} [_inst_1 : CommMonoid.{u1} β] [_inst_2 : CommMonoid.{u3} γ] (g : MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) (f : α -> β) (s : Finset.{u2} α), Eq.{succ u3} ((fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (EquivLike.toEmbeddingLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulEquivClass.toEquivLike.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MulEquiv.instMulEquivClassMulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) g (Finset.prod.{u1, u2} β α _inst_1 s (fun (x : α) => f x))) (Finset.prod.{u3, u2} γ α _inst_2 s (fun (x : α) => FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β (fun (_x : β) => (fun (x._@.Mathlib.Data.FunLike.Embedding._hyg.19 : β) => γ) _x) (EmbeddingLike.toFunLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (EquivLike.toEmbeddingLike.{max (succ u1) (succ u3), succ u1, succ u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulEquivClass.toEquivLike.{max u1 u3, u1, u3} (MulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2)))) β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))) (MulEquiv.instMulEquivClassMulEquiv.{u1, u3} β γ (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β (CommMonoid.toMonoid.{u1} β _inst_1))) (MulOneClass.toMul.{u3} γ (Monoid.toMulOneClass.{u3} γ (CommMonoid.toMonoid.{u3} γ _inst_2))))))) g (f x)))
Case conversion may be inaccurate. Consider using '#align mul_equiv.map_prod MulEquiv.map_prodₓ'. -/
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive "Deprecated: use `_root_.map_sum` instead."]
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
∑ x ∈ s, f x
to replace ∑ x in s, f x
in the future (#6795)
Adds new syntax for sum/product big operators for ∑ x ∈ s, f x
. The set s
can either be a Finset
or a Set
with a Fintype
instance, in which case it is equivalent to ∑ x ∈ s.toFinset, f x
.
Also supports ∑ (x ∈ s) (y ∈ t), f x y
for Finset.sum (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y)
. Note that these are not dependent products at the moment.
Adds with
clauses, so for example ∑ (x ∈ Finset.range 5) (y ∈ Finset.range 5) with x < y, x * y
, which inserts a Finset.filter
over the domain set.
Supports pattern matching in the variable position. This is by creating an experimental version of extBinder
that uses term:max
instead of binderIdent
.
The new ∑ x ∈ s, f x
notation is used in Algebra.BigOperators.Basic
for illustration, but the old ∑ x in s, f x
still works for backwards compatibility.
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@@ -21,8 +21,8 @@ To enable the notation, use `open BigOperators`.
Let `s` be a `Finset α`, and `f : α → β` a function.
-* `∏ x in s, f x` is notation for `Finset.prod s f` (assuming `β` is a `CommMonoid`)
-* `∑ x in s, f x` is notation for `Finset.sum s f` (assuming `β` is an `AddCommMonoid`)
+* `∏ x ∈ s, f x` is notation for `Finset.prod s f` (assuming `β` is a `CommMonoid`)
+* `∑ x ∈ s, f x` is notation for `Finset.sum s f` (assuming `β` is an `AddCommMonoid`)
* `∏ x, f x` is notation for `Finset.prod Finset.univ f`
(assuming `α` is a `Fintype` and `β` is a `CommMonoid`)
* `∑ x, f x` is notation for `Finset.sum Finset.univ f`
@@ -45,10 +45,10 @@ open Fin Function
namespace Finset
-/-- `∏ x in s, f x` is the product of `f x`
+/-- `∏ x ∈ s, f x` is the product of `f x`
as `x` ranges over the elements of the finite set `s`.
-/
-@[to_additive "`∑ x in s, f x` is the sum of `f x` as `x` ranges over the elements
+@[to_additive "`∑ x ∈ s, f x` is the sum of `f x` as `x` ranges over the elements
of the finite set `s`."]
protected def prod [CommMonoid β] (s : Finset α) (f : α → β) : β :=
(s.1.map f).prod
@@ -83,43 +83,136 @@ and we therefore choose the level `67`.
In practice, this means that parentheses should be placed as follows:
```lean
-∑ k in K, (a k + b k) = ∑ k in K, a k + ∑ k in K, b k →
- ∏ k in K, a k * b k = (∏ k in K, a k) * (∏ k in K, b k)
+∑ k ∈ K, (a k + b k) = ∑ k ∈ K, a k + ∑ k ∈ K, b k →
+ ∏ k ∈ K, a k * b k = (∏ k ∈ K, a k) * (∏ k ∈ K, b k)
```
(Example taken from page 490 of Knuth's *Concrete Mathematics*.)
-/
-- TODO: Use scoped[NS], when implemented?
namespace BigOperators
-open Std.ExtendedBinder
+open Std.ExtendedBinder Lean Meta
+
+-- TODO: contribute this modification back to `extBinder`
+
+/-- A `bigOpBinder` is like an `extBinder` and has the form `x`, `x : ty`, or `x pred`
+where `pred` is a `binderPred` like `< 2`.
+Unlike `extBinder`, `x` is a term. -/
+syntax bigOpBinder := term:max ((" : " term) <|> binderPred)?
+/-- A BigOperator binder in parentheses -/
+syntax bigOpBinderParenthesized := " (" bigOpBinder ")"
+/-- A list of parenthesized binders -/
+syntax bigOpBinderCollection := bigOpBinderParenthesized+
+/-- A single (unparenthesized) binder, or a list of parenthesized binders -/
+syntax bigOpBinders := bigOpBinderCollection <|> (ppSpace bigOpBinder)
+
+/-- Collects additional binder/Finset pairs for the given `bigOpBinder`.
+Note: this is not extensible at the moment, unlike the usual `bigOpBinder` expansions. -/
+def processBigOpBinder (processed : (Array (Term × Term)))
+ (binder : TSyntax ``bigOpBinder) : MacroM (Array (Term × Term)) :=
+ set_option hygiene false in
+ withRef binder do
+ match binder with
+ | `(bigOpBinder| $x:term) =>
+ match x with
+ | `(($a + $b = $n)) => -- Maybe this is too cute.
+ return processed |>.push (← `(⟨$a, $b⟩), ← `(Finset.Nat.antidiagonal $n))
+ | _ => return processed |>.push (x, ← ``(Finset.univ))
+ | `(bigOpBinder| $x : $t) => return processed |>.push (x, ← ``((Finset.univ : Finset $t)))
+ | `(bigOpBinder| $x ∈ $s) => return processed |>.push (x, ← `(finset% $s))
+ | `(bigOpBinder| $x < $n) => return processed |>.push (x, ← `(Finset.Iio $n))
+ | `(bigOpBinder| $x ≤ $n) => return processed |>.push (x, ← `(Finset.Iic $n))
+ | `(bigOpBinder| $x > $n) => return processed |>.push (x, ← `(Finset.Ioi $n))
+ | `(bigOpBinder| $x ≥ $n) => return processed |>.push (x, ← `(Finset.Ici $n))
+ | _ => Macro.throwUnsupported
+
+/-- Collects the binder/Finset pairs for the given `bigOpBinders`. -/
+def processBigOpBinders (binders : TSyntax ``bigOpBinders) :
+ MacroM (Array (Term × Term)) :=
+ match binders with
+ | `(bigOpBinders| $b:bigOpBinder) => processBigOpBinder #[] b
+ | `(bigOpBinders| $[($bs:bigOpBinder)]*) => bs.foldlM processBigOpBinder #[]
+ | _ => Macro.throwUnsupported
+
+/-- Collect the binderIdents into a `⟨...⟩` expression. -/
+def bigOpBindersPattern (processed : (Array (Term × Term))) :
+ MacroM Term := do
+ let ts := processed.map Prod.fst
+ if ts.size == 1 then
+ return ts[0]!
+ else
+ `(⟨$ts,*⟩)
+
+/-- Collect the terms into a product of sets. -/
+def bigOpBindersProd (processed : (Array (Term × Term))) :
+ MacroM Term := do
+ if processed.isEmpty then
+ `((Finset.univ : Finset Unit))
+ else if processed.size == 1 then
+ return processed[0]!.2
+ else
+ processed.foldrM (fun s p => `(SProd.sprod $(s.2) $p)) processed.back.2
+ (start := processed.size - 1)
+
+/--
+- `∑ x, f x` is notation for `Finset.sum Finset.univ f`. It is the sum of `f x`,
+ where `x` ranges over the finite domain of `f`.
+- `∑ x ∈ s, f x` is notation for `Finset.sum s f`. It is the sum of `f x`,
+ where `x` ranges over the finite set `s` (either a `Finset` or a `Set` with a `Fintype` instance).
+- `∑ x ∈ s with p x, f x` is notation for `Finset.sum (Finset.filter p s) f`.
+- `∑ (x ∈ s) (y ∈ t), f x y` is notation for `Finset.sum (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y)`.
+
+These support destructuring, for example `∑ ⟨x, y⟩ ∈ s ×ˢ t, f x y`.
+
+Notation: `"∑" bigOpBinders* ("with" term)? "," term` -/
+scoped syntax (name := bigsum) "∑ " bigOpBinders ("with " term)? ", " term:67 : term
+
+/--
+- `∏ x, f x` is notation for `Finset.prod Finset.univ f`. It is the product of `f x`,
+ where `x` ranges over the finite domain of `f`.
+- `∏ x ∈ s, f x` is notation for `Finset.prod s f`. It is the product of `f x`,
+ where `x` ranges over the finite set `s` (either a `Finset` or a `Set` with a `Fintype` instance).
+- `∏ x ∈ s with p x, f x` is notation for `Finset.prod (Finset.filter p s) f`.
+- `∏ (x ∈ s) (y ∈ t), f x y` is notation for `Finset.prod (s ×ˢ t) (fun ⟨x, y⟩ ↦ f x y)`.
+
+These support destructuring, for example `∏ ⟨x, y⟩ ∈ s ×ˢ t, f x y`.
+
+Notation: `"∏" bigOpBinders* ("with" term)? "," term` -/
+scoped syntax (name := bigprod) "∏ " bigOpBinders ("with " term)? ", " term:67 : term
-/-- `∑ x, f x` is notation for `Finset.sum Finset.univ f`. It is the sum of `f x`,
-where `x` ranges over the finite domain of `f`. -/
-scoped syntax (name := bigsum) "∑ " extBinder ", " term:67 : term
scoped macro_rules (kind := bigsum)
- | `(∑ $x:ident, $p) => `(Finset.sum Finset.univ (fun $x:ident ↦ $p))
- | `(∑ $x:ident : $t, $p) => `(Finset.sum Finset.univ (fun $x:ident : $t ↦ $p))
+ | `(∑ $bs:bigOpBinders $[with $p?]?, $v) => do
+ let processed ← processBigOpBinders bs
+ let x ← bigOpBindersPattern processed
+ let s ← bigOpBindersProd processed
+ match p? with
+ | some p => `(Finset.sum (Finset.filter (fun $x ↦ $p) $s) (fun $x ↦ $v))
+ | none => `(Finset.sum $s (fun $x ↦ $v))
-/-- `∏ x, f x` is notation for `Finset.prod Finset.univ f`. It is the product of `f x`,
-where `x` ranges over the finite domain of `f`. -/
-scoped syntax (name := bigprod) "∏ " extBinder ", " term:67 : term
scoped macro_rules (kind := bigprod)
- | `(∏ $x:ident, $p) => `(Finset.prod Finset.univ (fun $x:ident ↦ $p))
- | `(∏ $x:ident : $t, $p) => `(Finset.prod Finset.univ (fun $x:ident : $t ↦ $p))
-
-/-- `∑ x in s, f x` is notation for `Finset.sum s f`. It is the sum of `f x`,
+ | `(∏ $bs:bigOpBinders $[with $p?]?, $v) => do
+ let processed ← processBigOpBinders bs
+ let x ← bigOpBindersPattern processed
+ let s ← bigOpBindersProd processed
+ match p? with
+ | some p => `(Finset.prod (Finset.filter (fun $x ↦ $p) $s) (fun $x ↦ $v))
+ | none => `(Finset.prod $s (fun $x ↦ $v))
+
+/-- (Deprecated, use `∑ x ∈ s, f x`)
+`∑ x in s, f x` is notation for `Finset.sum s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
scoped syntax (name := bigsumin) "∑ " extBinder " in " term ", " term:67 : term
scoped macro_rules (kind := bigsumin)
- | `(∑ $x:ident in $s, $r) => `(Finset.sum $s (fun $x ↦ $r))
- | `(∑ $x:ident : $t in $s, $p) => `(Finset.sum $s (fun $x:ident : $t ↦ $p))
+ | `(∑ $x:ident in $s, $r) => `(∑ $x:ident ∈ $s, $r)
+ | `(∑ $x:ident : $t in $s, $r) => `(∑ $x:ident ∈ ($s : Finset $t), $r)
-/-- `∏ x in s, f x` is notation for `Finset.prod s f`. It is the product of `f x`,
+/-- (Deprecated, use `∏ x ∈ s, f x`)
+`∏ x in s, f x` is notation for `Finset.prod s f`. It is the product of `f x`,
where `x` ranges over the finite set `s`. -/
scoped syntax (name := bigprodin) "∏ " extBinder " in " term ", " term:67 : term
scoped macro_rules (kind := bigprodin)
- | `(∏ $x:ident in $s, $r) => `(Finset.prod $s (fun $x ↦ $r))
- | `(∏ $x:ident : $t in $s, $p) => `(Finset.prod $s (fun $x:ident : $t ↦ $p))
+ | `(∏ $x:ident in $s, $r) => `(∏ $x:ident ∈ $s, $r)
+ | `(∏ $x:ident : $t in $s, $r) => `(∏ $x:ident ∈ ($s : Finset $t), $r)
open Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr
open Std.ExtendedBinder
@@ -137,15 +230,15 @@ to show the domain type when the product is over `Finset.univ`. -/
let binder ←
if ppDomain then
let ty ← withNaryArg 0 delab
- `(extBinder| $(.mk i):ident : $ty)
+ `(bigOpBinder| $(.mk i):ident : $ty)
else
- `(extBinder| $(.mk i):ident)
- `(∏ $binder, $body)
+ `(bigOpBinder| $(.mk i):ident)
+ `(∏ $binder:bigOpBinder, $body)
else
let ss ← withNaryArg 3 <| delab
- `(∏ $(.mk i):ident in $ss, $body)
+ `(∏ $(.mk i):ident ∈ $ss, $body)
-/-- Delaborator for `Finset.prod`. The `pp.piBinderTypes` option controls whether
+/-- Delaborator for `Finset.sum`. The `pp.piBinderTypes` option controls whether
to show the domain type when the sum is over `Finset.univ`. -/
@[scoped delab app.Finset.sum] def delabFinsetSum : Delab :=
whenPPOption getPPNotation <| withOverApp 5 <| do
@@ -158,13 +251,13 @@ to show the domain type when the sum is over `Finset.univ`. -/
let binder ←
if ppDomain then
let ty ← withNaryArg 0 delab
- `(extBinder| $(.mk i):ident : $ty)
+ `(bigOpBinder| $(.mk i):ident : $ty)
else
- `(extBinder| $(.mk i):ident)
- `(∑ $binder, $body)
+ `(bigOpBinder| $(.mk i):ident)
+ `(∑ $binder:bigOpBinder, $body)
else
let ss ← withNaryArg 3 <| delab
- `(∑ $(.mk i):ident in $ss, $body)
+ `(∑ $(.mk i):ident ∈ $ss, $body)
end BigOperators
@@ -176,20 +269,20 @@ variable {s s₁ s₂ : Finset α} {a : α} {f g : α → β}
@[to_additive]
theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
- ∏ x in s, f x = (s.1.map f).prod :=
+ ∏ x ∈ s, f x = (s.1.map f).prod :=
rfl
#align finset.prod_eq_multiset_prod Finset.prod_eq_multiset_prod
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
@[to_additive (attr := simp)]
-lemma prod_map_val [CommMonoid β] (s : Finset α) (f : α → β) : (s.1.map f).prod = ∏ a in s, f a :=
+lemma prod_map_val [CommMonoid β] (s : Finset α) (f : α → β) : (s.1.map f).prod = ∏ a ∈ s, f a :=
rfl
#align finset.prod_map_val Finset.prod_map_val
#align finset.sum_map_val Finset.sum_map_val
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
- ∏ x in s, f x = s.fold ((· * ·) : β → β → β) 1 f :=
+ ∏ x ∈ s, f x = s.fold ((· * ·) : β → β → β) 1 f :=
rfl
#align finset.prod_eq_fold Finset.prod_eq_fold
#align finset.sum_eq_fold Finset.sum_eq_fold
@@ -203,14 +296,14 @@ end Finset
@[to_additive (attr := simp)]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [FunLike G β γ] [MonoidHomClass G β γ]
- (g : G) (f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
+ (g : G) (f : α → β) (s : Finset α) : g (∏ x ∈ s, f x) = ∏ x ∈ s, g (f x) := by
simp only [Finset.prod_eq_multiset_prod, map_multiset_prod, Multiset.map_map]; rfl
#align map_prod map_prod
#align map_sum map_sum
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
- ⇑(∏ x in s, f x) = ∏ x in s, ⇑(f x) :=
+ ⇑(∏ x ∈ s, f x) = ∏ x ∈ s, ⇑(f x) :=
map_prod (MonoidHom.coeFn β γ) _ _
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
@@ -221,7 +314,7 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
"See also `Finset.sum_apply`, with the same conclusion but with the weaker hypothesis
`f : α → β → γ`"]
theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α)
- (b : β) : (∏ x in s, f x) b = ∏ x in s, f x b :=
+ (b : β) : (∏ x ∈ s, f x) b = ∏ x ∈ s, f x b :=
map_prod (MonoidHom.eval b) _ _
#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_apply
#align add_monoid_hom.finset_sum_apply AddMonoidHom.finset_sum_apply
@@ -235,25 +328,25 @@ section CommMonoid
variable [CommMonoid β]
@[to_additive (attr := simp)]
-theorem prod_empty : ∏ x in ∅, f x = 1 :=
+theorem prod_empty : ∏ x ∈ ∅, f x = 1 :=
rfl
#align finset.prod_empty Finset.prod_empty
#align finset.sum_empty Finset.sum_empty
@[to_additive]
-theorem prod_of_empty [IsEmpty α] (s : Finset α) : ∏ i in s, f i = 1 := by
+theorem prod_of_empty [IsEmpty α] (s : Finset α) : ∏ i ∈ s, f i = 1 := by
rw [eq_empty_of_isEmpty s, prod_empty]
#align finset.prod_of_empty Finset.prod_of_empty
#align finset.sum_of_empty Finset.sum_of_empty
@[to_additive (attr := simp)]
-theorem prod_cons (h : a ∉ s) : ∏ x in cons a s h, f x = f a * ∏ x in s, f x :=
+theorem prod_cons (h : a ∉ s) : ∏ x ∈ cons a s h, f x = f a * ∏ x ∈ s, f x :=
fold_cons h
#align finset.prod_cons Finset.prod_cons
#align finset.sum_cons Finset.sum_cons
@[to_additive (attr := simp)]
-theorem prod_insert [DecidableEq α] : a ∉ s → ∏ x in insert a s, f x = f a * ∏ x in s, f x :=
+theorem prod_insert [DecidableEq α] : a ∉ s → ∏ x ∈ insert a s, f x = f a * ∏ x ∈ s, f x :=
fold_insert
#align finset.prod_insert Finset.prod_insert
#align finset.sum_insert Finset.sum_insert
@@ -263,7 +356,7 @@ the product over `s`, as long as `a` is in `s` or `f a = 1`. -/
@[to_additive (attr := simp) "The sum of `f` over `insert a s` is the same as
the sum over `s`, as long as `a` is in `s` or `f a = 0`."]
theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a = 1) :
- ∏ x in insert a s, f x = ∏ x in s, f x := by
+ ∏ x ∈ insert a s, f x = ∏ x ∈ s, f x := by
by_cases hm : a ∈ s
· simp_rw [insert_eq_of_mem hm]
· rw [prod_insert hm, h hm, one_mul]
@@ -274,50 +367,50 @@ theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a =
the product over `s`, as long as `f a = 1`. -/
@[to_additive (attr := simp) "The sum of `f` over `insert a s` is the same as
the sum over `s`, as long as `f a = 0`."]
-theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x in insert a s, f x = ∏ x in s, f x :=
+theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x ∈ insert a s, f x = ∏ x ∈ s, f x :=
prod_insert_of_eq_one_if_not_mem fun _ => h
#align finset.prod_insert_one Finset.prod_insert_one
#align finset.sum_insert_zero Finset.sum_insert_zero
@[to_additive]
theorem prod_insert_div {M : Type*} [CommGroup M] [DecidableEq α] (ha : a ∉ s) {f : α → M} :
- (∏ x in insert a s, f x) / f a = ∏ x in s, f x := by simp [ha]
+ (∏ x ∈ insert a s, f x) / f a = ∏ x ∈ s, f x := by simp [ha]
@[to_additive (attr := simp)]
-theorem prod_singleton (f : α → β) (a : α) : ∏ x in singleton a, f x = f a :=
+theorem prod_singleton (f : α → β) (a : α) : ∏ x ∈ singleton a, f x = f a :=
Eq.trans fold_singleton <| mul_one _
#align finset.prod_singleton Finset.prod_singleton
#align finset.sum_singleton Finset.sum_singleton
@[to_additive]
theorem prod_pair [DecidableEq α] {a b : α} (h : a ≠ b) :
- (∏ x in ({a, b} : Finset α), f x) = f a * f b := by
+ (∏ x ∈ ({a, b} : Finset α), f x) = f a * f b := by
rw [prod_insert (not_mem_singleton.2 h), prod_singleton]
#align finset.prod_pair Finset.prod_pair
#align finset.sum_pair Finset.sum_pair
@[to_additive (attr := simp)]
-theorem prod_const_one : (∏ _x in s, (1 : β)) = 1 := by
+theorem prod_const_one : (∏ _x ∈ s, (1 : β)) = 1 := by
simp only [Finset.prod, Multiset.map_const', Multiset.prod_replicate, one_pow]
#align finset.prod_const_one Finset.prod_const_one
#align finset.sum_const_zero Finset.sum_const_zero
@[to_additive (attr := simp)]
theorem prod_image [DecidableEq α] {s : Finset γ} {g : γ → α} :
- (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x in s.image g, f x = ∏ x in s, f (g x) :=
+ (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x ∈ s.image g, f x = ∏ x ∈ s, f (g x) :=
fold_image
#align finset.prod_image Finset.prod_image
#align finset.sum_image Finset.sum_image
@[to_additive (attr := simp)]
theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) :
- ∏ x in s.map e, f x = ∏ x in s, f (e x) := by
+ ∏ x ∈ s.map e, f x = ∏ x ∈ s, f (e x) := by
rw [Finset.prod, Finset.map_val, Multiset.map_map]; rfl
#align finset.prod_map Finset.prod_map
#align finset.sum_map Finset.sum_map
@[to_additive]
-lemma prod_attach (s : Finset α) (f : α → β) : ∏ x in s.attach, f x = ∏ x in s, f x := by
+lemma prod_attach (s : Finset α) (f : α → β) : ∏ x ∈ s.attach, f x = ∏ x ∈ s, f x := by
classical rw [← prod_image $ Subtype.coe_injective.injOn _, attach_image_val]
#align finset.prod_attach Finset.prod_attach
#align finset.sum_attach Finset.sum_attach
@@ -329,16 +422,16 @@ theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.prod
#align finset.sum_congr Finset.sum_congr
@[to_additive]
-theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x in s, f x = 1 :=
+theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x ∈ s, f x = 1 :=
calc
- ∏ x in s, f x = ∏ _x in s, 1 := Finset.prod_congr rfl h
+ ∏ x ∈ s, f x = ∏ _x ∈ s, 1 := Finset.prod_congr rfl h
_ = 1 := Finset.prod_const_one
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
@[to_additive]
theorem prod_disjUnion (h) :
- ∏ x in s₁.disjUnion s₂ h, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
+ ∏ x ∈ s₁.disjUnion s₂ h, f x = (∏ x ∈ s₁, f x) * ∏ x ∈ s₂, f x := by
refine' Eq.trans _ (fold_disjUnion h)
rw [one_mul]
rfl
@@ -347,7 +440,7 @@ theorem prod_disjUnion (h) :
@[to_additive]
theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
- ∏ x in s.disjiUnion t h, f x = ∏ i in s, ∏ x in t i, f x := by
+ ∏ x ∈ s.disjiUnion t h, f x = ∏ i ∈ s, ∏ x ∈ t i, f x := by
refine' Eq.trans _ (fold_disjiUnion h)
dsimp [Finset.prod, Multiset.prod, Multiset.fold, Finset.disjUnion, Finset.fold]
congr
@@ -357,14 +450,14 @@ theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
@[to_additive]
theorem prod_union_inter [DecidableEq α] :
- (∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
+ (∏ x ∈ s₁ ∪ s₂, f x) * ∏ x ∈ s₁ ∩ s₂, f x = (∏ x ∈ s₁, f x) * ∏ x ∈ s₂, f x :=
fold_union_inter
#align finset.prod_union_inter Finset.prod_union_inter
#align finset.sum_union_inter Finset.sum_union_inter
@[to_additive]
theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
- ∏ x in s₁ ∪ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
+ ∏ x ∈ s₁ ∪ s₂, f x = (∏ x ∈ s₁, f x) * ∏ x ∈ s₂, f x := by
rw [← prod_union_inter, disjoint_iff_inter_eq_empty.mp h]; exact (mul_one _).symm
#align finset.prod_union Finset.prod_union
#align finset.sum_union Finset.sum_union
@@ -372,7 +465,7 @@ theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
@[to_additive]
theorem prod_filter_mul_prod_filter_not
(s : Finset α) (p : α → Prop) [DecidablePred p] [∀ x, Decidable (¬p x)] (f : α → β) :
- (∏ x in s.filter p, f x) * ∏ x in s.filter fun x => ¬p x, f x = ∏ x in s, f x := by
+ (∏ x ∈ s.filter p, f x) * ∏ x ∈ s.filter fun x => ¬p x, f x = ∏ x ∈ s, f x := by
have := Classical.decEq α
rw [← prod_union (disjoint_filter_filter_neg s s p), filter_union_filter_neg_eq]
#align finset.prod_filter_mul_prod_filter_not Finset.prod_filter_mul_prod_filter_not
@@ -390,7 +483,7 @@ end ToList
@[to_additive]
theorem _root_.Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β)
- (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x)) = ∏ x in s, f x := by
+ (hs : { a | σ a ≠ a } ⊆ s) : (∏ x ∈ s, f (σ x)) = ∏ x ∈ s, f x := by
convert (prod_map s σ.toEmbedding f).symm
exact (map_perm hs).symm
#align equiv.perm.prod_comp Equiv.Perm.prod_comp
@@ -398,7 +491,7 @@ theorem _root_.Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α
@[to_additive]
theorem _root_.Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
- (hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) := by
+ (hs : { a | σ a ≠ a } ⊆ s) : (∏ x ∈ s, f (σ x) x) = ∏ x ∈ s, f x (σ.symm x) := by
convert σ.prod_comp s (fun x => f x (σ.symm x)) hs
rw [Equiv.symm_apply_apply]
#align equiv.perm.prod_comp' Equiv.Perm.prod_comp'
@@ -409,8 +502,8 @@ of `s`, and over all subsets of `s` to which one adds `x`. -/
@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
of `s`, and over all subsets of `s` to which one adds `x`."]
lemma prod_powerset_insert [DecidableEq α] (ha : a ∉ s) (f : Finset α → β) :
- ∏ t in (insert a s).powerset, f t =
- (∏ t in s.powerset, f t) * ∏ t in s.powerset, f (insert a t) := by
+ ∏ t ∈ (insert a s).powerset, f t =
+ (∏ t ∈ s.powerset, f t) * ∏ t ∈ s.powerset, f (insert a t) := by
rw [powerset_insert, prod_union, prod_image]
· exact insert_erase_invOn.2.injOn.mono fun t ht ↦ not_mem_mono (mem_powerset.1 ht) ha
· aesop (add simp [disjoint_left, insert_subset_iff])
@@ -422,8 +515,8 @@ of `s`, and over all subsets of `s` to which one adds `x`. -/
@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
of `s`, and over all subsets of `s` to which one adds `x`."]
lemma prod_powerset_cons (ha : a ∉ s) (f : Finset α → β) :
- ∏ t in (s.cons a ha).powerset, f t = (∏ t in s.powerset, f t) *
- ∏ t in s.powerset.attach, f (cons a t $ not_mem_mono (mem_powerset.1 t.2) ha) := by
+ ∏ t ∈ (s.cons a ha).powerset, f t = (∏ t ∈ s.powerset, f t) *
+ ∏ t ∈ s.powerset.attach, f (cons a t $ not_mem_mono (mem_powerset.1 t.2) ha) := by
classical
simp_rw [cons_eq_insert]
rw [prod_powerset_insert ha, prod_attach _ fun t ↦ f (insert a t)]
@@ -433,7 +526,7 @@ lemma prod_powerset_cons (ha : a ∉ s) (f : Finset α → β) :
@[to_additive "A sum over `powerset s` is equal to the double sum over sets of subsets of `s` with
`card s = k`, for `k = 1, ..., card s`"]
lemma prod_powerset (s : Finset α) (f : Finset α → β) :
- ∏ t in powerset s, f t = ∏ j in range (card s + 1), ∏ t in powersetCard j s, f t := by
+ ∏ t ∈ powerset s, f t = ∏ j ∈ range (card s + 1), ∏ t ∈ powersetCard j s, f t := by
rw [powerset_card_disjiUnion, prod_disjiUnion]
#align finset.prod_powerset Finset.prod_powerset
#align finset.sum_powerset Finset.sum_powerset
@@ -450,7 +543,7 @@ variable [Fintype α] [CommMonoid β]
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
- (∏ i in s, f i) * ∏ i in t, f i = ∏ i, f i :=
+ (∏ i ∈ s, f i) * ∏ i ∈ t, f i = ∏ i, f i :=
(Finset.prod_disjUnion h.disjoint).symm.trans <| by
classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top]; rfl
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
@@ -469,28 +562,28 @@ For a version expressed with subtypes, see `Fintype.prod_subtype_mul_prod_subtyp
@[to_additive "Adding the sums of a function over `s` and over `sᶜ` gives the whole sum.
For a version expressed with subtypes, see `Fintype.sum_subtype_add_sum_subtype`. "]
theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
- (∏ i in s, f i) * ∏ i in sᶜ, f i = ∏ i, f i :=
+ (∏ i ∈ s, f i) * ∏ i ∈ sᶜ, f i = ∏ i, f i :=
IsCompl.prod_mul_prod isCompl_compl f
#align finset.prod_mul_prod_compl Finset.prod_mul_prod_compl
#align finset.sum_add_sum_compl Finset.sum_add_sum_compl
@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
- (∏ i in sᶜ, f i) * ∏ i in s, f i = ∏ i, f i :=
+ (∏ i ∈ sᶜ, f i) * ∏ i ∈ s, f i = ∏ i, f i :=
(@isCompl_compl _ s _).symm.prod_mul_prod f
#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prod
#align finset.sum_compl_add_sum Finset.sum_compl_add_sum
@[to_additive]
theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
- (∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x = ∏ x in s₂, f x := by
+ (∏ x ∈ s₂ \ s₁, f x) * ∏ x ∈ s₁, f x = ∏ x ∈ s₂, f x := by
rw [← prod_union sdiff_disjoint, sdiff_union_of_subset h]
#align finset.prod_sdiff Finset.prod_sdiff
#align finset.sum_sdiff Finset.sum_sdiff
@[to_additive]
theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
- (hfg : ∀ x ∈ s₁, f x = g x) : ∏ i in s₁, f i = ∏ i in s₂, g i := by
+ (hfg : ∀ x ∈ s₁, f x = g x) : ∏ i ∈ s₁, f i = ∏ i ∈ s₂, g i := by
rw [← prod_sdiff h, prod_eq_one hg, one_mul]
exact prod_congr rfl hfg
#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiff
@@ -498,7 +591,7 @@ theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀
@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
- ∏ x in s₁, f x = ∏ x in s₂, f x :=
+ ∏ x ∈ s₁, f x = ∏ x ∈ s₂, f x :=
haveI := Classical.decEq α
prod_subset_one_on_sdiff h (by simpa) fun _ _ => rfl
#align finset.prod_subset Finset.prod_subset
@@ -506,7 +599,7 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
@[to_additive (attr := simp)]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
- ∏ x in s.disjSum t, f x = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) := by
+ ∏ x ∈ s.disjSum t, f x = (∏ x ∈ s, f (Sum.inl x)) * ∏ x ∈ t, f (Sum.inr x) := by
rw [← map_inl_disjUnion_map_inr, prod_disjUnion, prod_map, prod_map]
rfl
#align finset.prod_disj_sum Finset.prod_disj_sum
@@ -514,13 +607,13 @@ theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
@[to_additive]
theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ → β) :
- ∏ x in s.disjSum t, Sum.elim f g x = (∏ x in s, f x) * ∏ x in t, g x := by simp
+ ∏ x ∈ s.disjSum t, Sum.elim f g x = (∏ x ∈ s, f x) * ∏ x ∈ t, g x := by simp
#align finset.prod_sum_elim Finset.prod_sum_elim
#align finset.sum_sum_elim Finset.sum_sum_elim
@[to_additive]
theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
- (hs : Set.PairwiseDisjoint (↑s) t) : ∏ x in s.biUnion t, f x = ∏ x in s, ∏ i in t x, f i := by
+ (hs : Set.PairwiseDisjoint (↑s) t) : ∏ x ∈ s.biUnion t, f x = ∏ x ∈ s, ∏ i ∈ t x, f i := by
rw [← disjiUnion_eq_biUnion _ _ hs, prod_disjiUnion]
#align finset.prod_bUnion Finset.prod_biUnion
#align finset.sum_bUnion Finset.sum_biUnion
@@ -530,14 +623,14 @@ in the reverse direction, use `Finset.prod_sigma'`. -/
@[to_additive "Sum over a sigma type equals the sum of fiberwise sums. For rewriting
in the reverse direction, use `Finset.sum_sigma'`"]
theorem prod_sigma {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
- ∏ x in s.sigma t, f x = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
+ ∏ x ∈ s.sigma t, f x = ∏ a ∈ s, ∏ s ∈ t a, f ⟨a, s⟩ := by
simp_rw [← disjiUnion_map_sigma_mk, prod_disjiUnion, prod_map, Function.Embedding.sigmaMk_apply]
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
@[to_additive]
theorem prod_sigma' {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
- (∏ a in s, ∏ s in t a, f a s) = ∏ x in s.sigma t, f x.1 x.2 :=
+ (∏ a ∈ s, ∏ s ∈ t a, f a s) = ∏ x ∈ s.sigma t, f x.1 x.2 :=
Eq.symm <| prod_sigma s t fun x => f x.1 x.2
#align finset.prod_sigma' Finset.prod_sigma'
#align finset.sum_sigma' Finset.sum_sigma'
@@ -562,7 +655,7 @@ domain of the sum, rather than being a non-dependent function."]
theorem prod_bij (i : ∀ a ∈ s, κ) (hi : ∀ a ha, i a ha ∈ t)
(i_inj : ∀ a₁ ha₁ a₂ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, ∃ a ha, i a ha = b) (h : ∀ a ha, f a = g (i a ha)) :
- ∏ x in s, f x = ∏ x in t, g x :=
+ ∏ x ∈ s, f x = ∏ x ∈ t, g x :=
congr_arg Multiset.prod (Multiset.map_eq_map_of_bij_of_nodup f g s.2 t.2 i hi i_inj i_surj h)
#align finset.prod_bij Finset.prod_bij
#align finset.sum_bij Finset.sum_bij
@@ -584,7 +677,7 @@ membership of the domains of the sums, rather than being non-dependent functions
theorem prod_bij' (i : ∀ a ∈ s, κ) (j : ∀ a ∈ t, ι) (hi : ∀ a ha, i a ha ∈ t)
(hj : ∀ a ha, j a ha ∈ s) (left_inv : ∀ a ha, j (i a ha) (hi a ha) = a)
(right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) (h : ∀ a ha, f a = g (i a ha)) :
- ∏ x in s, f x = ∏ x in t, g x := by
+ ∏ x ∈ s, f x = ∏ x ∈ t, g x := by
refine prod_bij i hi (fun a1 h1 a2 h2 eq ↦ ?_) (fun b hb ↦ ⟨_, hj b hb, right_inv b hb⟩) h
rw [← left_inv a1 h1, ← left_inv a2 h2]
simp only [eq]
@@ -607,7 +700,7 @@ The difference with `Finset.sum_bij` is that the bijection is a non-dependent fu
being allowed to use membership of the domain of the sum."]
lemma prod_nbij (i : ι → κ) (hi : ∀ a ∈ s, i a ∈ t) (i_inj : (s : Set ι).InjOn i)
(i_surj : (s : Set ι).SurjOn i t) (h : ∀ a ∈ s, f a = g (i a)) :
- ∏ x in s, f x = ∏ x in t, g x :=
+ ∏ x ∈ s, f x = ∏ x ∈ t, g x :=
prod_bij (fun a _ ↦ i a) hi i_inj (by simpa using i_surj) h
/-- Reorder a product.
@@ -633,7 +726,7 @@ The difference with `Finset.sum_equiv` is that bijectivity is only required to h
of the sums, rather than on the entire types."]
lemma prod_nbij' (i : ι → κ) (j : κ → ι) (hi : ∀ a ∈ s, i a ∈ t) (hj : ∀ a ∈ t, j a ∈ s)
(left_inv : ∀ a ∈ s, j (i a) = a) (right_inv : ∀ a ∈ t, i (j a) = a)
- (h : ∀ a ∈ s, f a = g (i a)) : ∏ x in s, f x = ∏ x in t, g x :=
+ (h : ∀ a ∈ s, f a = g (i a)) : ∏ x ∈ s, f x = ∏ x ∈ t, g x :=
prod_bij' (fun a _ ↦ i a) (fun b _ ↦ j b) hi hj left_inv right_inv h
/-- Specialization of `Finset.prod_nbij'` that automatically fills in most arguments.
@@ -643,7 +736,7 @@ See `Fintype.prod_equiv` for the version where `s` and `t` are `univ`. -/
See `Fintype.sum_equiv` for the version where `s` and `t` are `univ`."]
lemma prod_equiv (e : ι ≃ κ) (hst : ∀ i, i ∈ s ↔ e i ∈ t) (hfg : ∀ i ∈ s, f i = g (e i)) :
- ∏ i in s, f i = ∏ i in t, g i := by refine prod_nbij' e e.symm ?_ ?_ ?_ ?_ hfg <;> simp [hst]
+ ∏ i ∈ s, f i = ∏ i ∈ t, g i := by refine prod_nbij' e e.symm ?_ ?_ ?_ ?_ hfg <;> simp [hst]
#align finset.equiv.prod_comp_finset Finset.prod_equiv
#align finset.equiv.sum_comp_finset Finset.sum_equiv
@@ -655,12 +748,12 @@ See `Fintype.prod_bijective` for the version where `s` and `t` are `univ`. -/
See `Fintype.sum_bijective` for the version where `s` and `t` are `univ`."]
lemma prod_bijective (e : ι → κ) (he : e.Bijective) (hst : ∀ i, i ∈ s ↔ e i ∈ t)
(hfg : ∀ i ∈ s, f i = g (e i)) :
- ∏ i in s, f i = ∏ i in t, g i := prod_equiv (.ofBijective e he) hst hfg
+ ∏ i ∈ s, f i = ∏ i ∈ t, g i := prod_equiv (.ofBijective e he) hst hfg
@[to_additive]
lemma prod_of_injOn (e : ι → κ) (he : Set.InjOn e s) (hest : Set.MapsTo e s t)
(h' : ∀ i ∈ t, i ∉ e '' s → g i = 1) (h : ∀ i ∈ s, f i = g (e i)) :
- ∏ i in s, f i = ∏ j in t, g j := by
+ ∏ i ∈ s, f i = ∏ j ∈ t, g j := by
classical
exact (prod_nbij e (fun a ↦ mem_image_of_mem e) he (by simp [Set.surjOn_image]) h).trans <|
prod_subset (image_subset_iff.2 hest) <| by simpa using h'
@@ -682,16 +775,16 @@ lemma prod_fiberwise_eq_prod_filter' (s : Finset ι) (t : Finset κ) (g : ι →
@[to_additive]
lemma prod_fiberwise_of_maps_to {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : ι → α) :
- ∏ j in t, ∏ i in s.filter fun i ↦ g i = j, f i = ∏ i in s, f i := by
+ ∏ j ∈ t, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s, f i := by
rw [← prod_disjiUnion, disjiUnion_filter_eq_of_maps_to h]
#align finset.prod_fiberwise_of_maps_to Finset.prod_fiberwise_of_maps_to
#align finset.sum_fiberwise_of_maps_to Finset.sum_fiberwise_of_maps_to
@[to_additive]
lemma prod_fiberwise_of_maps_to' {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : κ → α) :
- ∏ j in t, ∏ _i in s.filter fun i ↦ g i = j, f j = ∏ i in s, f (g i) := by
+ ∏ j ∈ t, ∏ _i ∈ s.filter fun i ↦ g i = j, f j = ∏ i ∈ s, f (g i) := by
calc
- _ = ∏ y in t, ∏ x in s.filter fun x ↦ g x = y, f (g x) :=
+ _ = ∏ y ∈ t, ∏ x ∈ s.filter fun x ↦ g x = y, f (g x) :=
prod_congr rfl fun y _ ↦ prod_congr rfl fun x hx ↦ by rw [(mem_filter.1 hx).2]
_ = _ := prod_fiberwise_of_maps_to h _
@@ -699,14 +792,14 @@ variable [Fintype κ]
@[to_additive]
lemma prod_fiberwise (s : Finset ι) (g : ι → κ) (f : ι → α) :
- ∏ j, ∏ i in s.filter fun i ↦ g i = j, f i = ∏ i in s, f i :=
+ ∏ j, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s, f i :=
prod_fiberwise_of_maps_to (fun _ _ ↦ mem_univ _) _
#align finset.prod_fiberwise Finset.prod_fiberwise
#align finset.sum_fiberwise Finset.sum_fiberwise
@[to_additive]
lemma prod_fiberwise' (s : Finset ι) (g : ι → κ) (f : κ → α) :
- ∏ j, ∏ _i in s.filter fun i ↦ g i = j, f j = ∏ i in s, f (g i) :=
+ ∏ j, ∏ _i ∈ s.filter fun i ↦ g i = j, f j = ∏ i ∈ s, f (g i) :=
prod_fiberwise_of_maps_to' (fun _ _ ↦ mem_univ _) _
end bij
@@ -721,20 +814,20 @@ but differ in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ
`Fintype.piFinset t` is a `Finset (Π a, t a)`."]
lemma prod_univ_pi [DecidableEq ι] [Fintype ι] {κ : ι → Type*} (t : ∀ i, Finset (κ i))
(f : (∀ i ∈ (univ : Finset ι), κ i) → β) :
- ∏ x in univ.pi t, f x = ∏ x in Fintype.piFinset t, f fun a _ ↦ x a := by
+ ∏ x ∈ univ.pi t, f x = ∏ x ∈ Fintype.piFinset t, f fun a _ ↦ x a := by
apply prod_nbij' (fun x i ↦ x i $ mem_univ _) (fun x i _ ↦ x i) <;> simp
#align finset.prod_univ_pi Finset.prod_univ_pi
#align finset.sum_univ_pi Finset.sum_univ_pi
@[to_additive (attr := simp)]
lemma prod_diag [DecidableEq α] (s : Finset α) (f : α × α → β) :
- ∏ i in s.diag, f i = ∏ i in s, f (i, i) := by
+ ∏ i ∈ s.diag, f i = ∏ i ∈ s, f (i, i) := by
apply prod_nbij' Prod.fst (fun i ↦ (i, i)) <;> simp
@[to_additive]
theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ × α → β} :
- ∏ p in r, f p = ∏ c in s, ∏ a in t c, f (c, a) := by
+ ∏ p ∈ r, f p = ∏ c ∈ s, ∏ a ∈ t c, f (c, a) := by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.1, p.2))
apply prod_equiv (Equiv.sigmaEquivProd _ _).symm <;> simp [h]
#align finset.prod_finset_product Finset.prod_finset_product
@@ -743,7 +836,7 @@ theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ →
@[to_additive]
theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ → α → β} :
- ∏ p in r, f p.1 p.2 = ∏ c in s, ∏ a in t c, f c a :=
+ ∏ p ∈ r, f p.1 p.2 = ∏ c ∈ s, ∏ a ∈ t c, f c a :=
prod_finset_product r s t h
#align finset.prod_finset_product' Finset.prod_finset_product'
#align finset.sum_finset_product' Finset.sum_finset_product'
@@ -751,7 +844,7 @@ theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ →
@[to_additive]
theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α × γ → β} :
- ∏ p in r, f p = ∏ c in s, ∏ a in t c, f (a, c) := by
+ ∏ p ∈ r, f p = ∏ c ∈ s, ∏ a ∈ t c, f (a, c) := by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.2, p.1))
apply prod_equiv ((Equiv.prodComm _ _).trans (Equiv.sigmaEquivProd _ _).symm) <;> simp [h]
#align finset.prod_finset_product_right Finset.prod_finset_product_right
@@ -760,38 +853,38 @@ theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t :
@[to_additive]
theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α → γ → β} :
- ∏ p in r, f p.1 p.2 = ∏ c in s, ∏ a in t c, f a c :=
+ ∏ p ∈ r, f p.1 p.2 = ∏ c ∈ s, ∏ a ∈ t c, f a c :=
prod_finset_product_right r s t h
#align finset.prod_finset_product_right' Finset.prod_finset_product_right'
#align finset.sum_finset_product_right' Finset.sum_finset_product_right'
@[to_additive]
theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ → β)
- (eq : ∀ c ∈ s, f (g c) = ∏ x in s.filter fun c' => g c' = g c, h x) :
- ∏ x in s.image g, f x = ∏ x in s, h x :=
+ (eq : ∀ c ∈ s, f (g c) = ∏ x ∈ s.filter fun c' => g c' = g c, h x) :
+ ∏ x ∈ s.image g, f x = ∏ x ∈ s, h x :=
calc
- ∏ x in s.image g, f x = ∏ x in s.image g, ∏ x in s.filter fun c' => g c' = x, h x :=
+ ∏ x ∈ s.image g, f x = ∏ x ∈ s.image g, ∏ x ∈ s.filter fun c' => g c' = x, h x :=
(prod_congr rfl) fun _x hx =>
let ⟨c, hcs, hc⟩ := mem_image.1 hx
hc ▸ eq c hcs
- _ = ∏ x in s, h x := prod_fiberwise_of_maps_to (fun _x => mem_image_of_mem g) _
+ _ = ∏ x ∈ s, h x := prod_fiberwise_of_maps_to (fun _x => mem_image_of_mem g) _
#align finset.prod_image' Finset.prod_image'
#align finset.sum_image' Finset.sum_image'
@[to_additive]
-theorem prod_mul_distrib : ∏ x in s, f x * g x = (∏ x in s, f x) * ∏ x in s, g x :=
+theorem prod_mul_distrib : ∏ x ∈ s, f x * g x = (∏ x ∈ s, f x) * ∏ x ∈ s, g x :=
Eq.trans (by rw [one_mul]; rfl) fold_op_distrib
#align finset.prod_mul_distrib Finset.prod_mul_distrib
#align finset.sum_add_distrib Finset.sum_add_distrib
@[to_additive]
lemma prod_mul_prod_comm (f g h i : α → β) :
- (∏ a in s, f a * g a) * ∏ a in s, h a * i a = (∏ a in s, f a * h a) * ∏ a in s, g a * i a := by
+ (∏ a ∈ s, f a * g a) * ∏ a ∈ s, h a * i a = (∏ a ∈ s, f a * h a) * ∏ a ∈ s, g a * i a := by
simp_rw [prod_mul_distrib, mul_mul_mul_comm]
@[to_additive]
theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- ∏ x in s ×ˢ t, f x = ∏ x in s, ∏ y in t, f (x, y) :=
+ ∏ x ∈ s ×ˢ t, f x = ∏ x ∈ s, ∏ y ∈ t, f (x, y) :=
prod_finset_product (s ×ˢ t) s (fun _a => t) fun _p => mem_product
#align finset.prod_product Finset.prod_product
#align finset.sum_product Finset.sum_product
@@ -799,14 +892,14 @@ theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
/-- An uncurried version of `Finset.prod_product`. -/
@[to_additive "An uncurried version of `Finset.sum_product`"]
theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- ∏ x in s ×ˢ t, f x.1 x.2 = ∏ x in s, ∏ y in t, f x y :=
+ ∏ x ∈ s ×ˢ t, f x.1 x.2 = ∏ x ∈ s, ∏ y ∈ t, f x y :=
prod_product
#align finset.prod_product' Finset.prod_product'
#align finset.sum_product' Finset.sum_product'
@[to_additive]
theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- ∏ x in s ×ˢ t, f x = ∏ y in t, ∏ x in s, f (x, y) :=
+ ∏ x ∈ s ×ˢ t, f x = ∏ y ∈ t, ∏ x ∈ s, f (x, y) :=
prod_finset_product_right (s ×ˢ t) t (fun _a => s) fun _p => mem_product.trans and_comm
#align finset.prod_product_right Finset.prod_product_right
#align finset.sum_product_right Finset.sum_product_right
@@ -814,7 +907,7 @@ theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β}
/-- An uncurried version of `Finset.prod_product_right`. -/
@[to_additive "An uncurried version of `Finset.sum_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- ∏ x in s ×ˢ t, f x.1 x.2 = ∏ y in t, ∏ x in s, f x y :=
+ ∏ x ∈ s ×ˢ t, f x.1 x.2 = ∏ y ∈ t, ∏ x ∈ s, f x y :=
prod_product_right
#align finset.prod_product_right' Finset.prod_product_right'
#align finset.sum_product_right' Finset.sum_product_right'
@@ -825,7 +918,7 @@ variable. -/
the outer variable."]
theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' : α → Finset γ}
(h : ∀ x y, x ∈ s ∧ y ∈ t x ↔ x ∈ s' y ∧ y ∈ t') {f : γ → α → β} :
- (∏ x in s, ∏ y in t x, f x y) = ∏ y in t', ∏ x in s' y, f x y := by
+ (∏ x ∈ s, ∏ y ∈ t x, f x y) = ∏ y ∈ t', ∏ x ∈ s' y, f x y := by
classical
have : ∀ z : γ × α, (z ∈ s.biUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔
z.1 ∈ s ∧ z.2 ∈ t z.1 := by
@@ -840,7 +933,7 @@ theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' :
@[to_additive]
theorem prod_comm {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s, ∏ y in t, f x y) = ∏ y in t, ∏ x in s, f x y :=
+ (∏ x ∈ s, ∏ y ∈ t, f x y) = ∏ y ∈ t, ∏ x ∈ s, f x y :=
prod_comm' fun _ _ => Iff.rfl
#align finset.prod_comm Finset.prod_comm
#align finset.sum_comm Finset.sum_comm
@@ -848,7 +941,7 @@ theorem prod_comm {s : Finset γ} {t : Finset α} {f : γ → α → β} :
@[to_additive]
theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g : α → γ} {s : Finset α}
(h₁ : r 1 1) (h₂ : ∀ a b c, r b c → r (f a * b) (g a * c)) :
- r (∏ x in s, f x) (∏ x in s, g x) := by
+ r (∏ x ∈ s, f x) (∏ x ∈ s, g x) := by
delta Finset.prod
apply Multiset.prod_hom_rel <;> assumption
#align finset.prod_hom_rel Finset.prod_hom_rel
@@ -856,7 +949,7 @@ theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
- ∏ x in s.filter p, f x = ∏ x in s, f x :=
+ ∏ x ∈ s.filter p, f x = ∏ x ∈ s, f x :=
(prod_subset (filter_subset _ _)) fun x => by
classical
rw [not_imp_comm, mem_filter]
@@ -868,18 +961,18 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
-- instance first; `{∀ x, Decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
theorem prod_filter_ne_one (s : Finset α) [∀ x, Decidable (f x ≠ 1)] :
- ∏ x in s.filter fun x => f x ≠ 1, f x = ∏ x in s, f x :=
+ ∏ x ∈ s.filter fun x => f x ≠ 1, f x = ∏ x ∈ s, f x :=
prod_filter_of_ne fun _ _ => id
#align finset.prod_filter_ne_one Finset.prod_filter_ne_one
#align finset.sum_filter_ne_zero Finset.sum_filter_ne_zero
@[to_additive]
theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
- ∏ a in s.filter p, f a = ∏ a in s, if p a then f a else 1 :=
+ ∏ a ∈ s.filter p, f a = ∏ a ∈ s, if p a then f a else 1 :=
calc
- ∏ a in s.filter p, f a = ∏ a in s.filter p, if p a then f a else 1 :=
+ ∏ a ∈ s.filter p, f a = ∏ a ∈ s.filter p, if p a then f a else 1 :=
prod_congr rfl fun a h => by rw [if_pos]; simpa using (mem_filter.1 h).2
- _ = ∏ a in s, if p a then f a else 1 := by
+ _ = ∏ a ∈ s, if p a then f a else 1 := by
{ refine' prod_subset (filter_subset _ s) fun x hs h => _
rw [mem_filter, not_and] at h
exact if_neg (by simpa using h hs) }
@@ -888,10 +981,10 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
@[to_additive]
theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a ∈ s)
- (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x in s, f x = f a := by
+ (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x ∈ s, f x = f a := by
haveI := Classical.decEq α
calc
- ∏ x in s, f x = ∏ x in {a}, f x := by
+ ∏ x ∈ s, f x = ∏ x ∈ {a}, f x := by
{ refine' (prod_subset _ _).symm
· intro _ H
rwa [mem_singleton.1 H]
@@ -902,7 +995,7 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
@[to_additive]
theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
- (h₁ : a ∉ s → f a = 1) : ∏ x in s, f x = f a :=
+ (h₁ : a ∉ s → f a = 1) : ∏ x ∈ s, f x = f a :=
haveI := Classical.decEq α
by_cases (prod_eq_single_of_mem a · h₀) fun this =>
(prod_congr rfl fun b hb => h₀ b hb <| by rintro rfl; exact this hb).trans <|
@@ -912,17 +1005,17 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
@[to_additive]
lemma prod_union_eq_left [DecidableEq α] (hs : ∀ a ∈ s₂, a ∉ s₁ → f a = 1) :
- ∏ a in s₁ ∪ s₂, f a = ∏ a in s₁, f a :=
+ ∏ a ∈ s₁ ∪ s₂, f a = ∏ a ∈ s₁, f a :=
Eq.symm <|
prod_subset (subset_union_left _ _) fun _a ha ha' ↦ hs _ ((mem_union.1 ha).resolve_left ha') ha'
@[to_additive]
lemma prod_union_eq_right [DecidableEq α] (hs : ∀ a ∈ s₁, a ∉ s₂ → f a = 1) :
- ∏ a in s₁ ∪ s₂, f a = ∏ a in s₂, f a := by rw [union_comm, prod_union_eq_left hs]
+ ∏ a ∈ s₁ ∪ s₂, f a = ∏ a ∈ s₂, f a := by rw [union_comm, prod_union_eq_left hs]
@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
- (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x in s, f x = f a * f b := by
+ (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x ∈ s, f x = f a * f b := by
haveI := Classical.decEq α; let s' := ({a, b} : Finset α)
have hu : s' ⊆ s := by
refine' insert_subset_iff.mpr _
@@ -944,7 +1037,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
@[to_additive]
theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) :
- ∏ x in s, f x = f a * f b := by
+ ∏ x ∈ s, f x = f a * f b := by
haveI := Classical.decEq α; by_cases h₁ : a ∈ s <;> by_cases h₂ : b ∈ s
· exact prod_eq_mul_of_mem a b h₁ h₂ hn h₀
· rw [hb h₂, mul_one]
@@ -967,7 +1060,7 @@ theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
@[to_additive (attr := simp, nolint simpNF)
"A sum over `s.subtype p` equals one over `s.filter p`."]
theorem prod_subtype_eq_prod_filter (f : α → β) {p : α → Prop} [DecidablePred p] :
- ∏ x in s.subtype p, f x = ∏ x in s.filter p, f x := by
+ ∏ x ∈ s.subtype p, f x = ∏ x ∈ s.filter p, f x := by
conv_lhs => erw [← prod_map (s.subtype p) (Function.Embedding.subtype _) f]
exact prod_congr (subtype_map _) fun x _hx => rfl
#align finset.prod_subtype_eq_prod_filter Finset.prod_subtype_eq_prod_filter
@@ -978,7 +1071,7 @@ over `s.subtype p` equals that product over `s`. -/
@[to_additive "If all elements of a `Finset` satisfy the predicate `p`, a sum
over `s.subtype p` equals that sum over `s`."]
theorem prod_subtype_of_mem (f : α → β) {p : α → Prop} [DecidablePred p] (h : ∀ x ∈ s, p x) :
- ∏ x in s.subtype p, f x = ∏ x in s, f x := by
+ ∏ x ∈ s.subtype p, f x = ∏ x ∈ s, f x := by
rw [prod_subtype_eq_prod_filter, filter_true_of_mem]
simpa using h
#align finset.prod_subtype_of_mem Finset.prod_subtype_of_mem
@@ -992,7 +1085,7 @@ sum in the main type of a function that agrees with the first
function on that `Finset`."]
theorem prod_subtype_map_embedding {p : α → Prop} {s : Finset { x // p x }} {f : { x // p x } → β}
{g : α → β} (h : ∀ x : { x // p x }, x ∈ s → g x = f x) :
- (∏ x in s.map (Function.Embedding.subtype _), g x) = ∏ x in s, f x := by
+ (∏ x ∈ s.map (Function.Embedding.subtype _), g x) = ∏ x ∈ s, f x := by
rw [Finset.prod_map]
exact Finset.prod_congr rfl h
#align finset.prod_subtype_map_embedding Finset.prod_subtype_map_embedding
@@ -1001,18 +1094,18 @@ theorem prod_subtype_map_embedding {p : α → Prop} {s : Finset { x // p x }} {
variable (f s)
@[to_additive]
-theorem prod_coe_sort_eq_attach (f : s → β) : ∏ i : s, f i = ∏ i in s.attach, f i :=
+theorem prod_coe_sort_eq_attach (f : s → β) : ∏ i : s, f i = ∏ i ∈ s.attach, f i :=
rfl
#align finset.prod_coe_sort_eq_attach Finset.prod_coe_sort_eq_attach
#align finset.sum_coe_sort_eq_attach Finset.sum_coe_sort_eq_attach
@[to_additive]
-theorem prod_coe_sort : ∏ i : s, f i = ∏ i in s, f i := prod_attach _ _
+theorem prod_coe_sort : ∏ i : s, f i = ∏ i ∈ s, f i := prod_attach _ _
#align finset.prod_coe_sort Finset.prod_coe_sort
#align finset.sum_coe_sort Finset.sum_coe_sort
@[to_additive]
-theorem prod_finset_coe (f : α → β) (s : Finset α) : (∏ i : (s : Set α), f i) = ∏ i in s, f i :=
+theorem prod_finset_coe (f : α → β) (s : Finset α) : (∏ i : (s : Set α), f i) = ∏ i ∈ s, f i :=
prod_coe_sort s f
#align finset.prod_finset_coe Finset.prod_finset_coe
#align finset.sum_finset_coe Finset.sum_finset_coe
@@ -1021,7 +1114,7 @@ variable {f s}
@[to_additive]
theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α) (h : ∀ x, x ∈ s ↔ p x)
- (f : α → β) : ∏ a in s, f a = ∏ a : Subtype p, f a := by
+ (f : α → β) : ∏ a ∈ s, f a = ∏ a : Subtype p, f a := by
have : (· ∈ s) = p := Set.ext h
subst p
rw [← prod_coe_sort]
@@ -1056,7 +1149,7 @@ lemma prod_preimage_of_bij (f : ι → κ) (s : Finset κ) (hf : Set.BijOn f (f
#align finset.sum_preimage_of_bij Finset.sum_preimage_of_bij
@[to_additive]
-theorem prod_set_coe (s : Set α) [Fintype s] : (∏ i : s, f i) = ∏ i in s.toFinset, f i :=
+theorem prod_set_coe (s : Set α) [Fintype s] : (∏ i : s, f i) = ∏ i ∈ s.toFinset, f i :=
(Finset.prod_subtype s.toFinset (fun _ ↦ Set.mem_toFinset) f).symm
/-- The product of a function `g` defined only on a set `s` is equal to
@@ -1081,19 +1174,19 @@ theorem prod_congr_set {α : Type*} [CommMonoid α] {β : Type*} [Fintype β] (s
@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
[DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
- (∏ x in s, h (if hx : p x then f x hx else g x hx)) =
- (∏ x in (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
- ∏ x in (s.filter fun x => ¬p x).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2) :=
+ (∏ x ∈ s, h (if hx : p x then f x hx else g x hx)) =
+ (∏ x ∈ (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
+ ∏ x ∈ (s.filter fun x => ¬p x).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2) :=
calc
- (∏ x in s, h (if hx : p x then f x hx else g x hx)) =
- (∏ x in s.filter p, h (if hx : p x then f x hx else g x hx)) *
- ∏ x in s.filter (¬p ·), h (if hx : p x then f x hx else g x hx) :=
+ (∏ x ∈ s, h (if hx : p x then f x hx else g x hx)) =
+ (∏ x ∈ s.filter p, h (if hx : p x then f x hx else g x hx)) *
+ ∏ x ∈ s.filter (¬p ·), h (if hx : p x then f x hx else g x hx) :=
(prod_filter_mul_prod_filter_not s p _).symm
- _ = (∏ x in (s.filter p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
- ∏ x in (s.filter (¬p ·)).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
+ _ = (∏ x ∈ (s.filter p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
+ ∏ x ∈ (s.filter (¬p ·)).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
congr_arg₂ _ (prod_attach _ _).symm (prod_attach _ _).symm
- _ = (∏ x in (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
- ∏ x in (s.filter (¬p ·)).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2) :=
+ _ = (∏ x ∈ (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
+ ∏ x ∈ (s.filter (¬p ·)).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2) :=
congr_arg₂ _ (prod_congr rfl fun x _hx ↦
congr_arg h (dif_pos <| by simpa using (mem_filter.mp x.2).2))
(prod_congr rfl fun x _hx => congr_arg h (dif_neg <| by simpa using (mem_filter.mp x.2).2))
@@ -1103,8 +1196,8 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
@[to_additive]
theorem prod_apply_ite {s : Finset α} {p : α → Prop} {_hp : DecidablePred p} (f g : α → γ)
(h : γ → β) :
- (∏ x in s, h (if p x then f x else g x)) =
- (∏ x in s.filter p, h (f x)) * ∏ x in s.filter fun x => ¬p x, h (g x) :=
+ (∏ x ∈ s, h (if p x then f x else g x)) =
+ (∏ x ∈ s.filter p, h (f x)) * ∏ x ∈ s.filter fun x => ¬p x, h (g x) :=
(prod_apply_dite _ _ _).trans <| congr_arg₂ _ (prod_attach _ (h ∘ f)) (prod_attach _ (h ∘ g))
#align finset.prod_apply_ite Finset.prod_apply_ite
#align finset.sum_apply_ite Finset.sum_apply_ite
@@ -1112,24 +1205,24 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {_hp : DecidablePred p}
@[to_additive]
theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f : ∀ x : α, p x → β)
(g : ∀ x : α, ¬p x → β) :
- ∏ x in s, (if hx : p x then f x hx else g x hx) =
- (∏ x in (s.filter p).attach, f x.1 (by simpa using (mem_filter.mp x.2).2)) *
- ∏ x in (s.filter fun x => ¬p x).attach, g x.1 (by simpa using (mem_filter.mp x.2).2) := by
+ ∏ x ∈ s, (if hx : p x then f x hx else g x hx) =
+ (∏ x ∈ (s.filter p).attach, f x.1 (by simpa using (mem_filter.mp x.2).2)) *
+ ∏ x ∈ (s.filter fun x => ¬p x).attach, g x.1 (by simpa using (mem_filter.mp x.2).2) := by
simp [prod_apply_dite _ _ fun x => x]
#align finset.prod_dite Finset.prod_dite
#align finset.sum_dite Finset.sum_dite
@[to_additive]
theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → β) :
- ∏ x in s, (if p x then f x else g x) =
- (∏ x in s.filter p, f x) * ∏ x in s.filter fun x => ¬p x, g x := by
+ ∏ x ∈ s, (if p x then f x else g x) =
+ (∏ x ∈ s.filter p, f x) * ∏ x ∈ s.filter fun x => ¬p x, g x := by
simp [prod_apply_ite _ _ fun x => x]
#align finset.prod_ite Finset.prod_ite
#align finset.sum_ite Finset.sum_ite
@[to_additive]
theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → β) (h : ∀ x ∈ s, ¬p x) :
- ∏ x in s, (if p x then f x else g x) = ∏ x in s, g x := by
+ ∏ x ∈ s, (if p x then f x else g x) = ∏ x ∈ s, g x := by
rw [prod_ite, filter_false_of_mem, filter_true_of_mem]
· simp only [prod_empty, one_mul]
all_goals intros; apply h; assumption
@@ -1138,7 +1231,7 @@ theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α →
@[to_additive]
theorem prod_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → β) (h : ∀ x ∈ s, p x) :
- ∏ x in s, (if p x then f x else g x) = ∏ x in s, f x := by
+ ∏ x ∈ s, (if p x then f x else g x) = ∏ x ∈ s, f x := by
simp_rw [← ite_not (p _)]
apply prod_ite_of_false
simpa
@@ -1147,7 +1240,7 @@ theorem prod_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α →
@[to_additive]
theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
- (h : ∀ x ∈ s, ¬p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (g x) := by
+ (h : ∀ x ∈ s, ¬p x) : (∏ x ∈ s, k (if p x then f x else g x)) = ∏ x ∈ s, k (g x) := by
simp_rw [apply_ite k]
exact prod_ite_of_false _ _ h
#align finset.prod_apply_ite_of_false Finset.prod_apply_ite_of_false
@@ -1155,7 +1248,7 @@ theorem prod_apply_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g :
@[to_additive]
theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
- (h : ∀ x ∈ s, p x) : (∏ x in s, k (if p x then f x else g x)) = ∏ x in s, k (f x) := by
+ (h : ∀ x ∈ s, p x) : (∏ x ∈ s, k (if p x then f x else g x)) = ∏ x ∈ s, k (f x) := by
simp_rw [apply_ite k]
exact prod_ite_of_true _ _ h
#align finset.prod_apply_ite_of_true Finset.prod_apply_ite_of_true
@@ -1163,21 +1256,21 @@ theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g :
@[to_additive]
theorem prod_extend_by_one [DecidableEq α] (s : Finset α) (f : α → β) :
- ∏ i in s, (if i ∈ s then f i else 1) = ∏ i in s, f i :=
+ ∏ i ∈ s, (if i ∈ s then f i else 1) = ∏ i ∈ s, f i :=
(prod_congr rfl) fun _i hi => if_pos hi
#align finset.prod_extend_by_one Finset.prod_extend_by_one
#align finset.sum_extend_by_zero Finset.sum_extend_by_zero
@[to_additive (attr := simp)]
theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
- ∏ i in s, (if i ∈ t then f i else 1) = ∏ i in s ∩ t, f i := by
+ ∏ i ∈ s, (if i ∈ t then f i else 1) = ∏ i ∈ s ∩ t, f i := by
rw [← Finset.prod_filter, Finset.filter_mem_eq_inter]
#align finset.prod_ite_mem Finset.prod_ite_mem
#align finset.sum_ite_mem Finset.sum_ite_mem
@[to_additive (attr := simp)]
theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, a = x → β) :
- ∏ x in s, (if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
+ ∏ x ∈ s, (if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
· intros _ _ h
@@ -1194,7 +1287,7 @@ theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
@[to_additive (attr := simp)]
theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, x = a → β) :
- ∏ x in s, (if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
+ ∏ x ∈ s, (if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
· intros _ _ h
@@ -1211,7 +1304,7 @@ theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
@[to_additive (attr := simp)]
theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
- (∏ x in s, ite (a = x) (b x) 1) = ite (a ∈ s) (b a) 1 :=
+ (∏ x ∈ s, ite (a = x) (b x) 1) = ite (a ∈ s) (b a) 1 :=
prod_dite_eq s a fun x _ => b x
#align finset.prod_ite_eq Finset.prod_ite_eq
#align finset.sum_ite_eq Finset.sum_ite_eq
@@ -1225,36 +1318,36 @@ test on the index and whose alternative is `0` has value either the term at that
The difference with `Finset.sum_ite_eq` is that the arguments to `Eq` are swapped."]
theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
- (∏ x in s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1 :=
+ (∏ x ∈ s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1 :=
prod_dite_eq' s a fun x _ => b x
#align finset.prod_ite_eq' Finset.prod_ite_eq'
#align finset.sum_ite_eq' Finset.sum_ite_eq'
@[to_additive]
theorem prod_ite_index (p : Prop) [Decidable p] (s t : Finset α) (f : α → β) :
- ∏ x in if p then s else t, f x = if p then ∏ x in s, f x else ∏ x in t, f x :=
- apply_ite (fun s => ∏ x in s, f x) _ _ _
+ ∏ x ∈ if p then s else t, f x = if p then ∏ x ∈ s, f x else ∏ x ∈ t, f x :=
+ apply_ite (fun s => ∏ x ∈ s, f x) _ _ _
#align finset.prod_ite_index Finset.prod_ite_index
#align finset.sum_ite_index Finset.sum_ite_index
@[to_additive (attr := simp)]
theorem prod_ite_irrel (p : Prop) [Decidable p] (s : Finset α) (f g : α → β) :
- ∏ x in s, (if p then f x else g x) = if p then ∏ x in s, f x else ∏ x in s, g x := by
+ ∏ x ∈ s, (if p then f x else g x) = if p then ∏ x ∈ s, f x else ∏ x ∈ s, g x := by
split_ifs with h <;> rfl
#align finset.prod_ite_irrel Finset.prod_ite_irrel
#align finset.sum_ite_irrel Finset.sum_ite_irrel
@[to_additive (attr := simp)]
theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α → β) (g : ¬p → α → β) :
- ∏ x in s, (if h : p then f h x else g h x) =
- if h : p then ∏ x in s, f h x else ∏ x in s, g h x := by
+ ∏ x ∈ s, (if h : p then f h x else g h x) =
+ if h : p then ∏ x ∈ s, f h x else ∏ x ∈ s, g h x := by
split_ifs with h <;> rfl
#align finset.prod_dite_irrel Finset.prod_dite_irrel
#align finset.sum_dite_irrel Finset.sum_dite_irrel
@[to_additive (attr := simp)]
theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
- ∏ a' in s, Pi.mulSingle a x a' = if a ∈ s then x else 1 :=
+ ∏ a' ∈ s, Pi.mulSingle a x a' = if a ∈ s then x else 1 :=
prod_dite_eq' _ _ _
#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
@@ -1262,13 +1355,13 @@ theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
@[to_additive (attr := simp)]
theorem prod_pi_mulSingle {β : α → Type*} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
(f : ∀ a, β a) (s : Finset α) :
- (∏ a' in s, Pi.mulSingle a' (f a') a) = if a ∈ s then f a else 1 :=
+ (∏ a' ∈ s, Pi.mulSingle a' (f a') a) = if a ∈ s then f a else 1 :=
prod_dite_eq _ _ _
#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
@[to_additive]
lemma mulSupport_prod (s : Finset ι) (f : ι → α → β) :
- mulSupport (fun x ↦ ∏ i in s, f i x) ⊆ ⋃ i ∈ s, mulSupport (f i) := by
+ mulSupport (fun x ↦ ∏ i ∈ s, f i x) ⊆ ⋃ i ∈ s, mulSupport (f i) := by
simp only [mulSupport_subset_iff', Set.mem_iUnion, not_exists, nmem_mulSupport]
exact fun x ↦ prod_eq_one
#align function.mul_support_prod Finset.mulSupport_prod
@@ -1289,9 +1382,9 @@ finset without changing the value of the product. -/
larger finset without changing the value of the sum."]
lemma prod_mulIndicator_subset_of_eq_one [One α] (f : ι → α) (g : ι → α → β) {s t : Finset ι}
(h : s ⊆ t) (hg : ∀ a, g a 1 = 1) :
- ∏ i in t, g i (mulIndicator ↑s f i) = ∏ i in s, g i (f i) := by
+ ∏ i ∈ t, g i (mulIndicator ↑s f i) = ∏ i ∈ s, g i (f i) := by
calc
- _ = ∏ i in s, g i (mulIndicator ↑s f i) := by rw [prod_subset h fun i _ hn ↦ by simp [hn, hg]]
+ _ = ∏ i ∈ s, g i (mulIndicator ↑s f i) := by rw [prod_subset h fun i _ hn ↦ by simp [hn, hg]]
-- Porting note: This did not use to need the implicit argument
_ = _ := prod_congr rfl fun i hi ↦ congr_arg _ <| mulIndicator_of_mem (α := ι) hi f
#align set.prod_mul_indicator_subset_of_eq_one Finset.prod_mulIndicator_subset_of_eq_one
@@ -1302,7 +1395,7 @@ taking the original function over the original finset. -/
@[to_additive "Summing an indicator function over a possibly larger `Finset` is the same as summing
the original function over the original finset."]
lemma prod_mulIndicator_subset (f : ι → β) {s t : Finset ι} (h : s ⊆ t) :
- ∏ i in t, mulIndicator (↑s) f i = ∏ i in s, f i :=
+ ∏ i ∈ t, mulIndicator (↑s) f i = ∏ i ∈ s, f i :=
prod_mulIndicator_subset_of_eq_one _ (fun _ ↦ id) h fun _ ↦ rfl
#align set.prod_mul_indicator_subset Finset.prod_mulIndicator_subset
#align set.sum_indicator_subset Finset.sum_indicator_subset
@@ -1310,7 +1403,7 @@ lemma prod_mulIndicator_subset (f : ι → β) {s t : Finset ι} (h : s ⊆ t) :
@[to_additive]
lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t : ι → Set κ) (g : ι → κ)
[DecidablePred fun i ↦ g i ∈ t i] :
- ∏ i in s, mulIndicator (t i) (f i) (g i) = ∏ i in s.filter fun i ↦ g i ∈ t i, f i (g i) := by
+ ∏ i ∈ s, mulIndicator (t i) (f i) (g i) = ∏ i ∈ s.filter fun i ↦ g i ∈ t i, f i (g i) := by
refine (prod_filter_mul_prod_filter_not s (fun i ↦ g i ∈ t i) _).symm.trans <|
Eq.trans (congr_arg₂ (· * ·) ?_ ?_) (mul_one _)
· exact prod_congr rfl fun x hx ↦ mulIndicator_of_mem (mem_filter.1 hx).2 _
@@ -1320,12 +1413,12 @@ lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t
@[to_additive]
lemma prod_mulIndicator_eq_prod_inter [DecidableEq ι] (s t : Finset ι) (f : ι → β) :
- ∏ i in s, (t : Set ι).mulIndicator f i = ∏ i in s ∩ t, f i := by
+ ∏ i ∈ s, (t : Set ι).mulIndicator f i = ∏ i ∈ s ∩ t, f i := by
rw [← filter_mem_eq_inter, prod_mulIndicator_eq_prod_filter]; rfl
@[to_additive]
lemma mulIndicator_prod (s : Finset ι) (t : Set κ) (f : ι → κ → β) :
- mulIndicator t (∏ i in s, f i) = ∏ i in s, mulIndicator t (f i) :=
+ mulIndicator t (∏ i ∈ s, f i) = ∏ i ∈ s, mulIndicator t (f i) :=
map_prod (mulIndicatorHom _ _) _ _
#align set.mul_indicator_finset_prod Finset.mulIndicator_prod
#align set.indicator_finset_sum Finset.indicator_sum
@@ -1334,7 +1427,7 @@ variable {κ : Type*}
@[to_additive]
lemma mulIndicator_biUnion (s : Finset ι) (t : ι → Set κ) {f : κ → β} :
((s : Set ι).PairwiseDisjoint t) →
- mulIndicator (⋃ i ∈ s, t i) f = fun a ↦ ∏ i in s, mulIndicator (t i) f a := by
+ mulIndicator (⋃ i ∈ s, t i) f = fun a ↦ ∏ i ∈ s, mulIndicator (t i) f a := by
classical
refine Finset.induction_on s (by simp) fun i s hi ih hs ↦ funext fun j ↦ ?_
rw [prod_insert hi, set_biUnion_insert, mulIndicator_union_of_not_mem_inter,
@@ -1348,7 +1441,7 @@ lemma mulIndicator_biUnion (s : Finset ι) (t : ι → Set κ) {f : κ → β} :
@[to_additive]
lemma mulIndicator_biUnion_apply (s : Finset ι) (t : ι → Set κ) {f : κ → β}
(h : (s : Set ι).PairwiseDisjoint t) (x : κ) :
- mulIndicator (⋃ i ∈ s, t i) f x = ∏ i in s, mulIndicator (t i) f x := by
+ mulIndicator (⋃ i ∈ s, t i) f x = ∏ i ∈ s, mulIndicator (t i) f x := by
rw [mulIndicator_biUnion s t h]
#align set.mul_indicator_finset_bUnion_apply Finset.mulIndicator_biUnion_apply
#align set.indicator_finset_bUnion_apply Finset.indicator_biUnion_apply
@@ -1360,14 +1453,14 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
(i_inj : ∀ a₁ h₁₁ h₁₂ a₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, i a h₁ h₂ = b) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
- ∏ x in s, f x = ∏ x in t, g x := by
+ ∏ x ∈ s, f x = ∏ x ∈ t, g x := by
classical
calc
- ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := by rw [prod_filter_ne_one]
- _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
+ ∏ x ∈ s, f x = ∏ x ∈ s.filter fun x => f x ≠ 1, f x := by rw [prod_filter_ne_one]
+ _ = ∏ x ∈ t.filter fun x => g x ≠ 1, g x :=
prod_bij (fun a ha => i a (mem_filter.mp ha).1 <| by simpa using (mem_filter.mp ha).2)
?_ ?_ ?_ ?_
- _ = ∏ x in t, g x := prod_filter_ne_one _
+ _ = ∏ x ∈ t, g x := prod_filter_ne_one _
· intros a ha
refine' (mem_filter.mp ha).elim _
intros h₁ h₂
@@ -1390,7 +1483,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
@[to_additive]
theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, ¬p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
- ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) := by
+ ∏ x ∈ s, (if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) := by
refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_ <;> aesop
#align finset.prod_dite_of_false Finset.prod_dite_of_false
#align finset.sum_dite_of_false Finset.sum_dite_of_false
@@ -1398,19 +1491,19 @@ theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
@[to_additive]
theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
- ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) := by
+ ∏ x ∈ s, (if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) := by
refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_ <;> aesop
#align finset.prod_dite_of_true Finset.prod_dite_of_true
#align finset.sum_dite_of_true Finset.sum_dite_of_true
@[to_additive]
-theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
+theorem nonempty_of_prod_ne_one (h : ∏ x ∈ s, f x ≠ 1) : s.Nonempty :=
s.eq_empty_or_nonempty.elim (fun H => False.elim <| h <| H.symm ▸ prod_empty) id
#align finset.nonempty_of_prod_ne_one Finset.nonempty_of_prod_ne_one
#align finset.nonempty_of_sum_ne_zero Finset.nonempty_of_sum_ne_zero
@[to_additive]
-theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
+theorem exists_ne_one_of_prod_ne_one (h : ∏ x ∈ s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
rw [← prod_filter_ne_one] at h
rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
@@ -1420,21 +1513,21 @@ theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s,
@[to_additive]
theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
- (∏ x in range (n + 1), f x) = f n * ∏ x in range n, f x := by
+ (∏ x ∈ range (n + 1), f x) = f n * ∏ x ∈ range n, f x := by
rw [range_succ, prod_insert not_mem_range_self]
#align finset.prod_range_succ_comm Finset.prod_range_succ_comm
#align finset.sum_range_succ_comm Finset.sum_range_succ_comm
@[to_additive]
theorem prod_range_succ (f : ℕ → β) (n : ℕ) :
- (∏ x in range (n + 1), f x) = (∏ x in range n, f x) * f n := by
+ (∏ x ∈ range (n + 1), f x) = (∏ x ∈ range n, f x) * f n := by
simp only [mul_comm, prod_range_succ_comm]
#align finset.prod_range_succ Finset.prod_range_succ
#align finset.sum_range_succ Finset.sum_range_succ
@[to_additive]
theorem prod_range_succ' (f : ℕ → β) :
- ∀ n : ℕ, (∏ k in range (n + 1), f k) = (∏ k in range n, f (k + 1)) * f 0
+ ∀ n : ℕ, (∏ k ∈ range (n + 1), f k) = (∏ k ∈ range n, f (k + 1)) * f 0
| 0 => prod_range_succ _ _
| n + 1 => by rw [prod_range_succ _ n, mul_right_comm, ← prod_range_succ' _ n, prod_range_succ]
#align finset.prod_range_succ' Finset.prod_range_succ'
@@ -1442,7 +1535,7 @@ theorem prod_range_succ' (f : ℕ → β) :
@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
- (∏ k in range n, u k) = ∏ k in range N, u k := by
+ (∏ k ∈ range n, u k) = ∏ k ∈ range N, u k := by
obtain ⟨m, rfl : n = N + m⟩ := le_iff_exists_add.mp hn
clear hn
induction' m with m hm
@@ -1454,7 +1547,7 @@ theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u
@[to_additive]
theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
- (∏ x in range (n + m), f x) = (∏ x in range n, f x) * ∏ x in range m, f (n + x) := by
+ (∏ x ∈ range (n + m), f x) = (∏ x ∈ range n, f x) * ∏ x ∈ range m, f (n + x) := by
induction' m with m hm
· simp
· erw [Nat.add_succ, prod_range_succ, prod_range_succ, hm, mul_assoc]
@@ -1463,18 +1556,18 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
@[to_additive]
theorem prod_range_add_div_prod_range {α : Type*} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
- (∏ k in range (n + m), f k) / ∏ k in range n, f k = ∏ k in Finset.range m, f (n + k) :=
+ (∏ k ∈ range (n + m), f k) / ∏ k ∈ range n, f k = ∏ k ∈ Finset.range m, f (n + k) :=
div_eq_of_eq_mul' (prod_range_add f n m)
#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_range
#align finset.sum_range_add_sub_sum_range Finset.sum_range_add_sub_sum_range
@[to_additive]
-theorem prod_range_zero (f : ℕ → β) : ∏ k in range 0, f k = 1 := by rw [range_zero, prod_empty]
+theorem prod_range_zero (f : ℕ → β) : ∏ k ∈ range 0, f k = 1 := by rw [range_zero, prod_empty]
#align finset.prod_range_zero Finset.prod_range_zero
#align finset.sum_range_zero Finset.sum_range_zero
@[to_additive sum_range_one]
-theorem prod_range_one (f : ℕ → β) : ∏ k in range 1, f k = f 0 := by
+theorem prod_range_one (f : ℕ → β) : ∏ k ∈ range 1, f k = f 0 := by
rw [range_one, prod_singleton]
#align finset.prod_range_one Finset.prod_range_one
#align finset.sum_range_one Finset.sum_range_one
@@ -1483,7 +1576,7 @@ open List
@[to_additive]
theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type*} [CommMonoid M] (f : α → M) :
- (l.map f).prod = ∏ m in l.toFinset, f m ^ l.count m := by
+ (l.map f).prod = ∏ m ∈ l.toFinset, f m ^ l.count m := by
induction' l with a s IH; · simp only [map_nil, prod_nil, count_nil, pow_zero, prod_const_one]
simp only [List.map, List.prod_cons, toFinset_cons, IH]
by_cases has : a ∈ s.toFinset
@@ -1503,13 +1596,13 @@ theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type*} [CommMono
@[to_additive]
theorem prod_list_count [DecidableEq α] [CommMonoid α] (s : List α) :
- s.prod = ∏ m in s.toFinset, m ^ s.count m := by simpa using prod_list_map_count s id
+ s.prod = ∏ m ∈ s.toFinset, m ^ s.count m := by simpa using prod_list_map_count s id
#align finset.prod_list_count Finset.prod_list_count
#align finset.sum_list_count Finset.sum_list_count
@[to_additive]
theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α) (s : Finset α)
- (hs : m.toFinset ⊆ s) : m.prod = ∏ i in s, i ^ m.count i := by
+ (hs : m.toFinset ⊆ s) : m.prod = ∏ i ∈ s, i ^ m.count i := by
rw [prod_list_count]
refine' prod_subset hs fun x _ hx => _
rw [mem_toFinset] at hx
@@ -1518,7 +1611,7 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
theorem sum_filter_count_eq_countP [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
- ∑ x in l.toFinset.filter p, l.count x = l.countP p := by
+ ∑ x ∈ l.toFinset.filter p, l.count x = l.countP p := by
simp [Finset.sum, sum_map_count_dedup_filter_eq_countP p l]
#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countP
@@ -1526,7 +1619,7 @@ open Multiset
@[to_additive]
theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type*} [CommMonoid M]
- (f : α → M) : (s.map f).prod = ∏ m in s.toFinset, f m ^ s.count m := by
+ (f : α → M) : (s.map f).prod = ∏ m ∈ s.toFinset, f m ^ s.count m := by
refine' Quot.induction_on s fun l => _
simp [prod_list_map_count l f]
#align finset.prod_multiset_map_count Finset.prod_multiset_map_count
@@ -1534,7 +1627,7 @@ theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type*} [
@[to_additive]
theorem prod_multiset_count [DecidableEq α] [CommMonoid α] (s : Multiset α) :
- s.prod = ∏ m in s.toFinset, m ^ s.count m := by
+ s.prod = ∏ m ∈ s.toFinset, m ^ s.count m := by
convert prod_multiset_map_count s id
rw [Multiset.map_id]
#align finset.prod_multiset_count Finset.prod_multiset_count
@@ -1542,7 +1635,7 @@ theorem prod_multiset_count [DecidableEq α] [CommMonoid α] (s : Multiset α) :
@[to_additive]
theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Multiset α) (s : Finset α)
- (hs : m.toFinset ⊆ s) : m.prod = ∏ i in s, i ^ m.count i := by
+ (hs : m.toFinset ⊆ s) : m.prod = ∏ i ∈ s, i ^ m.count i := by
revert hs
refine' Quot.induction_on m fun l => _
simp only [quot_mk_to_coe'', prod_coe, coe_count]
@@ -1552,7 +1645,7 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
@[to_additive]
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
- (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x in m.toFinset, g x := by
+ (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x ∈ m.toFinset, g x := by
refine prod_bij' (fun x _ ↦ x) (fun x hx ↦ ⟨x, Multiset.mem_toFinset.1 hx⟩) ?_ ?_ ?_ ?_ ?_ <;>
simp [hfg]
#align finset.prod_mem_multiset Finset.prod_mem_multiset
@@ -1564,7 +1657,7 @@ the property is multiplicative and holds on factors. -/
the property is additive and holds on summands."]
theorem prod_induction {M : Type*} [CommMonoid M] (f : α → M) (p : M → Prop)
(hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p <| f x) :
- p <| ∏ x in s, f x :=
+ p <| ∏ x ∈ s, f x :=
Multiset.prod_induction _ _ hom unit (Multiset.forall_mem_map_iff.mpr base)
#align finset.prod_induction Finset.prod_induction
#align finset.sum_induction Finset.sum_induction
@@ -1575,7 +1668,7 @@ the property is multiplicative and holds on factors. -/
the property is additive and holds on summands."]
theorem prod_induction_nonempty {M : Type*} [CommMonoid M] (f : α → M) (p : M → Prop)
(hom : ∀ a b, p a → p b → p (a * b)) (nonempty : s.Nonempty) (base : ∀ x ∈ s, p <| f x) :
- p <| ∏ x in s, f x :=
+ p <| ∏ x ∈ s, f x :=
Multiset.prod_induction_nonempty p hom (by simp [nonempty_iff_ne_empty.mp nonempty])
(Multiset.forall_mem_map_iff.mpr base)
#align finset.prod_induction_nonempty Finset.prod_induction_nonempty
@@ -1591,7 +1684,7 @@ verify that it's equal to a different function just by checking differences of a
This is a discrete analogue of the fundamental theorem of calculus."]
theorem prod_range_induction (f s : ℕ → β) (base : s 0 = 1)
(step : ∀ n, s (n + 1) = s n * f n) (n : ℕ) :
- ∏ k in Finset.range n, f k = s n := by
+ ∏ k ∈ Finset.range n, f k = s n := by
induction' n with k hk
· rw [Finset.prod_range_zero, base]
· simp only [hk, Finset.prod_range_succ, step, mul_comm]
@@ -1603,25 +1696,25 @@ the ratio of the last and first factors. -/
@[to_additive "A telescoping sum along `{0, ..., n - 1}` of an additive commutative group valued
function reduces to the difference of the last and first terms."]
theorem prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- (∏ i in range n, f (i + 1) / f i) = f n / f 0 := by apply prod_range_induction <;> simp
+ (∏ i ∈ range n, f (i + 1) / f i) = f n / f 0 := by apply prod_range_induction <;> simp
#align finset.prod_range_div Finset.prod_range_div
#align finset.sum_range_sub Finset.sum_range_sub
@[to_additive]
theorem prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- (∏ i in range n, f i / f (i + 1)) = f 0 / f n := by apply prod_range_induction <;> simp
+ (∏ i ∈ range n, f i / f (i + 1)) = f 0 / f n := by apply prod_range_induction <;> simp
#align finset.prod_range_div' Finset.prod_range_div'
#align finset.sum_range_sub' Finset.sum_range_sub'
@[to_additive]
theorem eq_prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel]
+ f n = f 0 * ∏ i ∈ range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel]
#align finset.eq_prod_range_div Finset.eq_prod_range_div
#align finset.eq_sum_range_sub Finset.eq_sum_range_sub
@[to_additive]
theorem eq_prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- f n = ∏ i in range (n + 1), if i = 0 then f 0 else f i / f (i - 1) := by
+ f n = ∏ i ∈ range (n + 1), if i = 0 then f 0 else f i / f (i - 1) := by
conv_lhs => rw [Finset.eq_prod_range_div f]
simp [Finset.prod_range_succ', mul_comm]
#align finset.eq_prod_range_div' Finset.eq_prod_range_div'
@@ -1633,7 +1726,7 @@ when the function we are summing is monotone.
-/
theorem sum_range_tsub [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α]
[ContravariantClass α α (· + ·) (· ≤ ·)] {f : ℕ → α} (h : Monotone f) (n : ℕ) :
- ∑ i in range n, (f (i + 1) - f i) = f n - f 0 := by
+ ∑ i ∈ range n, (f (i + 1) - f i) = f n - f 0 := by
apply sum_range_induction
case base => apply tsub_self
case step =>
@@ -1644,39 +1737,39 @@ theorem sum_range_tsub [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub
#align finset.sum_range_tsub Finset.sum_range_tsub
@[to_additive (attr := simp)]
-theorem prod_const (b : β) : ∏ _x in s, b = b ^ s.card :=
+theorem prod_const (b : β) : ∏ _x ∈ s, b = b ^ s.card :=
(congr_arg _ <| s.val.map_const b).trans <| Multiset.prod_replicate s.card b
#align finset.prod_const Finset.prod_const
#align finset.sum_const Finset.sum_const
@[to_additive sum_eq_card_nsmul]
-theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : ∏ a in s, f a = b ^ s.card :=
+theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : ∏ a ∈ s, f a = b ^ s.card :=
(prod_congr rfl hf).trans <| prod_const _
#align finset.prod_eq_pow_card Finset.prod_eq_pow_card
#align finset.sum_eq_card_nsmul Finset.sum_eq_card_nsmul
@[to_additive card_nsmul_add_sum]
-theorem pow_card_mul_prod {b : β} : b ^ s.card * ∏ a in s, f a = ∏ a in s, b * f a :=
+theorem pow_card_mul_prod {b : β} : b ^ s.card * ∏ a ∈ s, f a = ∏ a ∈ s, b * f a :=
(Finset.prod_const b).symm ▸ prod_mul_distrib.symm
@[to_additive sum_add_card_nsmul]
-theorem prod_mul_pow_card {b : β} : (∏ a in s, f a) * b ^ s.card = ∏ a in s, f a * b :=
+theorem prod_mul_pow_card {b : β} : (∏ a ∈ s, f a) * b ^ s.card = ∏ a ∈ s, f a * b :=
(Finset.prod_const b).symm ▸ prod_mul_distrib.symm
@[to_additive]
-theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k in range n, b := by simp
+theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k ∈ range n, b := by simp
#align finset.pow_eq_prod_const Finset.pow_eq_prod_const
#align finset.nsmul_eq_sum_const Finset.nsmul_eq_sum_const
@[to_additive]
-theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x in s, f x ^ n = (∏ x in s, f x) ^ n :=
+theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x ∈ s, f x ^ n = (∏ x ∈ s, f x) ^ n :=
Multiset.prod_map_pow
#align finset.prod_pow Finset.prod_pow
#align finset.sum_nsmul Finset.sum_nsmul
@[to_additive sum_nsmul_assoc]
lemma prod_pow_eq_pow_sum (s : Finset ι) (f : ι → ℕ) (a : β) :
- ∏ i in s, a ^ f i = a ^ ∑ i in s, f i :=
+ ∏ i ∈ s, a ^ f i = a ^ ∑ i ∈ s, f i :=
cons_induction (by simp) (fun _ _ _ _ ↦ by simp [prod_cons, sum_cons, pow_add, *]) s
#align finset.prod_pow_eq_pow_sum Finset.prod_pow_eq_pow_sum
@@ -1684,12 +1777,12 @@ lemma prod_pow_eq_pow_sum (s : Finset ι) (f : ι → ℕ) (a : β) :
@[to_additive
"A sum over `Finset.powersetCard` which only depends on the size of the sets is constant."]
lemma prod_powersetCard (n : ℕ) (s : Finset α) (f : ℕ → β) :
- ∏ t in powersetCard n s, f t.card = f n ^ s.card.choose n := by
+ ∏ t ∈ powersetCard n s, f t.card = f n ^ s.card.choose n := by
rw [prod_eq_pow_card, card_powersetCard]; rintro a ha; rw [(mem_powersetCard.1 ha).2]
@[to_additive]
theorem prod_flip {n : ℕ} (f : ℕ → β) :
- (∏ r in range (n + 1), f (n - r)) = ∏ k in range (n + 1), f k := by
+ (∏ r ∈ range (n + 1), f (n - r)) = ∏ k ∈ range (n + 1), f k := by
induction' n with n ih
· rw [prod_range_one, prod_range_one]
· rw [prod_range_succ', prod_range_succ _ (Nat.succ n)]
@@ -1701,7 +1794,7 @@ theorem prod_flip {n : ℕ} (f : ℕ → β) :
theorem prod_involution {s : Finset α} {f : α → β} :
∀ (g : ∀ a ∈ s, α) (_ : ∀ a ha, f a * f (g a ha) = 1) (_ : ∀ a ha, f a ≠ 1 → g a ha ≠ a)
(g_mem : ∀ a ha, g a ha ∈ s) (_ : ∀ a ha, g (g a ha) (g_mem a ha) = a),
- ∏ x in s, f x = 1 := by
+ ∏ x ∈ s, f x = 1 := by
haveI := Classical.decEq α; haveI := Classical.decEq β
exact
Finset.strongInductionOn s fun s ih g h g_ne g_mem g_inv =>
@@ -1710,7 +1803,7 @@ theorem prod_involution {s : Finset α} {f : α → β} :
mem_of_mem_erase (mem_of_mem_erase hy)
have g_inj : ∀ {x hx y hy}, g x hx = g y hy → x = y := fun {x hx y hy} h => by
rw [← g_inv x hx, ← g_inv y hy]; simp [h]
- have ih' : (∏ y in erase (erase s x) (g x hx), f y) = (1 : β) :=
+ have ih' : (∏ y ∈ erase (erase s x) (g x hx), f y) = (1 : β) :=
ih ((s.erase x).erase (g x hx))
⟨Subset.trans (erase_subset _ _) (erase_subset _ _), fun h =>
not_mem_erase (g x hx) (s.erase x) (h (g_mem x hx))⟩
@@ -1744,21 +1837,21 @@ theorem prod_involution {s : Finset α} {f : α → β} :
@[to_additive "The sum of the composition of functions `f` and `g`, is the sum over `b ∈ s.image g`
of `f b` times of the cardinality of the fibre of `b`. See also `Finset.sum_image`."]
theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
- ∏ a in s, f (g a) = ∏ b in s.image g, f b ^ (s.filter fun a => g a = b).card := by
+ ∏ a ∈ s, f (g a) = ∏ b ∈ s.image g, f b ^ (s.filter fun a => g a = b).card := by
simp_rw [← prod_const, prod_fiberwise_of_maps_to' fun _ ↦ mem_image_of_mem _]
#align finset.prod_comp Finset.prod_comp
#align finset.sum_comp Finset.sum_comp
@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
- (∏ x in s, (t.piecewise f g) x) = (∏ x in s ∩ t, f x) * ∏ x in s \ t, g x := by
+ (∏ x ∈ s, (t.piecewise f g) x) = (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, g x := by
erw [prod_ite, filter_mem_eq_inter, ← sdiff_eq_filter]
#align finset.prod_piecewise Finset.prod_piecewise
#align finset.sum_piecewise Finset.sum_piecewise
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
- (∏ x in s ∩ t, f x) * ∏ x in s \ t, f x = ∏ x in s, f x := by
+ (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, f x = ∏ x ∈ s, f x := by
convert (s.prod_piecewise t f f).symm
simp (config := { unfoldPartialApp := true }) [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
@@ -1766,7 +1859,7 @@ theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α →
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : ∏ x in s, f x = f i * ∏ x in s \ {i}, f x := by
+ (f : α → β) : ∏ x ∈ s, f x = f i * ∏ x ∈ s \ {i}, f x := by
convert (s.prod_inter_mul_prod_diff {i} f).symm
simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
@@ -1774,26 +1867,26 @@ theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α
@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : ∏ x in s, f x = (∏ x in s \ {i}, f x) * f i := by
+ (f : α → β) : ∏ x ∈ s, f x = (∏ x ∈ s \ {i}, f x) * f i := by
rw [prod_eq_mul_prod_diff_singleton h, mul_comm]
#align finset.prod_eq_prod_diff_singleton_mul Finset.prod_eq_prod_diff_singleton_mul
#align finset.sum_eq_sum_diff_singleton_add Finset.sum_eq_sum_diff_singleton_add
@[to_additive]
theorem _root_.Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
- ∏ i, f i = f a * ∏ i in {a}ᶜ, f i :=
+ ∏ i, f i = f a * ∏ i ∈ {a}ᶜ, f i :=
prod_eq_mul_prod_diff_singleton (mem_univ a) f
#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_compl
#align fintype.sum_eq_add_sum_compl Fintype.sum_eq_add_sum_compl
@[to_additive]
theorem _root_.Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
- ∏ i, f i = (∏ i in {a}ᶜ, f i) * f a :=
+ ∏ i, f i = (∏ i ∈ {a}ᶜ, f i) * f a :=
prod_eq_prod_diff_singleton_mul (mem_univ a) f
#align fintype.prod_eq_prod_compl_mul Fintype.prod_eq_prod_compl_mul
#align fintype.sum_eq_sum_compl_add Fintype.sum_eq_sum_compl_add
-theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i in s, f i := by
+theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s) : f a ∣ ∏ i ∈ s, f i := by
classical
rw [Finset.prod_eq_mul_prod_diff_singleton ha]
exact dvd_mul_right _ _
@@ -1802,7 +1895,7 @@ theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s)
/-- A product can be partitioned into a product of products, each equivalent under a setoid. -/
@[to_additive "A sum can be partitioned into a sum of sums, each equivalent under a setoid."]
theorem prod_partition (R : Setoid α) [DecidableRel R.r] :
- ∏ x in s, f x = ∏ xbar in s.image Quotient.mk'', ∏ y in s.filter (⟦·⟧ = xbar), f y := by
+ ∏ x ∈ s, f x = ∏ xbar ∈ s.image Quotient.mk'', ∏ y ∈ s.filter (⟦·⟧ = xbar), f y := by
refine' (Finset.prod_image' f fun x _hx => _).symm
rfl
#align finset.prod_partition Finset.prod_partition
@@ -1811,7 +1904,7 @@ theorem prod_partition (R : Setoid α) [DecidableRel R.r] :
/-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/
@[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."]
theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r]
- (h : ∀ x ∈ s, ∏ a in s.filter fun y => y ≈ x, f a = 1) : ∏ x in s, f x = 1 := by
+ (h : ∀ x ∈ s, ∏ a ∈ s.filter fun y => y ≈ x, f a = 1) : ∏ x ∈ s, f x = 1 := by
rw [prod_partition R, ← Finset.prod_eq_one]
intro xbar xbar_in_s
obtain ⟨x, x_in_s, rfl⟩ := mem_image.mp xbar_in_s
@@ -1822,7 +1915,7 @@ theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r]
@[to_additive]
theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∉ s) (f : α → β)
- (b : β) : ∏ x in s, Function.update f i b x = ∏ x in s, f x := by
+ (b : β) : ∏ x ∈ s, Function.update f i b x = ∏ x ∈ s, f x := by
apply prod_congr rfl
intros j hj
have : j ≠ i := by
@@ -1834,7 +1927,7 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
- ∏ x in s, Function.update f i b x = b * ∏ x in s \ singleton i, f x := by
+ ∏ x ∈ s, Function.update f i b x = b * ∏ x ∈ s \ singleton i, f x := by
rw [update_eq_piecewise, prod_piecewise]
simp [h]
#align finset.prod_update_of_mem Finset.prod_update_of_mem
@@ -1845,7 +1938,7 @@ do the terms in that product. -/
@[to_additive eq_of_card_le_one_of_sum_eq "If a sum of a `Finset` of size at most 1 has a given
value, so do the terms in that sum."]
theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α → β} {b : β}
- (h : ∏ x in s, f x = b) : ∀ x ∈ s, f x = b := by
+ (h : ∏ x ∈ s, f x = b) : ∀ x ∈ s, f x = b := by
intro x hx
by_cases hc0 : s.card = 0
· exact False.elim (card_ne_zero_of_mem hx hc0)
@@ -1869,7 +1962,7 @@ See `Multiset.prod_map_erase` for the `Multiset` version. -/
See `Multiset.sum_map_erase` for the `Multiset` version."]
theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
- (f a * ∏ x in s.erase a, f x) = ∏ x in s, f x := by
+ (f a * ∏ x ∈ s.erase a, f x) = ∏ x ∈ s, f x := by
rw [← prod_insert (not_mem_erase a s), insert_erase h]
#align finset.mul_prod_erase Finset.mul_prod_erase
#align finset.add_sum_erase Finset.add_sum_erase
@@ -1877,7 +1970,7 @@ theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α}
/-- A variant of `Finset.mul_prod_erase` with the multiplication swapped. -/
@[to_additive "A variant of `Finset.add_sum_erase` with the addition swapped."]
theorem prod_erase_mul [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
- (∏ x in s.erase a, f x) * f a = ∏ x in s, f x := by rw [mul_comm, mul_prod_erase s f h]
+ (∏ x ∈ s.erase a, f x) * f a = ∏ x ∈ s, f x := by rw [mul_comm, mul_prod_erase s f h]
#align finset.prod_erase_mul Finset.prod_erase_mul
#align finset.sum_erase_add Finset.sum_erase_add
@@ -1886,7 +1979,7 @@ removing that point, if present, from a `Finset`. -/
@[to_additive "If a function applied at a point is 0, a sum is unchanged by
removing that point, if present, from a `Finset`."]
theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h : f a = 1) :
- ∏ x in s.erase a, f x = ∏ x in s, f x := by
+ ∏ x ∈ s.erase a, f x = ∏ x ∈ s, f x := by
rw [← sdiff_singleton_eq_erase]
refine' prod_subset (sdiff_subset _ _) fun x hx hnx => _
rw [sdiff_singleton_eq_erase] at hnx
@@ -1898,7 +1991,7 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
@[to_additive "See also `Finset.sum_boole`."]
theorem prod_ite_one (s : Finset α) (p : α → Prop) [DecidablePred p]
(h : ∀ i ∈ s, ∀ j ∈ s, p i → p j → i = j) (a : β) :
- ∏ i in s, ite (p i) a 1 = ite (∃ i ∈ s, p i) a 1 := by
+ ∏ i ∈ s, ite (p i) a 1 = ite (∃ i ∈ s, p i) a 1 := by
split_ifs with h
· obtain ⟨i, hi, hpi⟩ := h
rw [prod_eq_single_of_mem _ hi, if_pos hpi]
@@ -1912,8 +2005,8 @@ theorem prod_ite_one (s : Finset α) (p : α → Prop) [DecidablePred p]
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type*} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
- (hdf : 1 < f d) : ∏ m : α in s.erase d, f m < ∏ m : α in s, f m := by
- conv in ∏ m in s, f m => rw [← Finset.insert_erase hd]
+ (hdf : 1 < f d) : ∏ m ∈ s.erase d, f m < ∏ m ∈ s, f m := by
+ conv in ∏ m ∈ s, f m => rw [← Finset.insert_erase hd]
rw [Finset.prod_insert (Finset.not_mem_erase d s)]
exact lt_mul_of_one_lt_left' _ hdf
#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_lt
@@ -1923,7 +2016,7 @@ theorem prod_erase_lt_of_one_lt {γ : Type*} [DecidableEq α] [OrderedCommMonoid
point, it is 1 everywhere on the `Finset`. -/
@[to_additive "If a sum is 0 and the function is 0 except possibly at one
point, it is 0 everywhere on the `Finset`."]
-theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏ x in s, f x = 1)
+theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏ x ∈ s, f x = 1)
(h1 : ∀ x ∈ s, x ≠ a → f x = 1) : ∀ x ∈ s, f x = 1 := by
intro x hx
classical
@@ -1939,7 +2032,7 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏
@[to_additive sum_boole_nsmul]
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
- (∏ x in s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1 := by simp
+ (∏ x ∈ s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1 := by simp
#align finset.prod_pow_boole Finset.prod_pow_boole
theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
@@ -1952,7 +2045,7 @@ theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι) (f : ι → M)
- (h : s ⊆ t) : (∏ i in s, f i) ∣ ∏ i in t, f i :=
+ (h : s ⊆ t) : (∏ i ∈ s, f i) ∣ ∏ i ∈ t, f i :=
Multiset.prod_dvd_prod_of_le <| Multiset.map_le_map <| by simpa
#align finset.prod_dvd_prod_of_subset Finset.prod_dvd_prod_of_subset
@@ -1980,7 +2073,7 @@ theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ x in s, 1 := by
#align finset.card_eq_sum_ones Finset.card_eq_sum_ones
theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
- ∑ x in s, f x = card s * m := by
+ ∑ x ∈ s, f x = card s * m := by
rw [← Nat.nsmul_eq_mul, ← sum_const]
apply sum_congr rfl h₁
#align finset.sum_const_nat Finset.sum_const_nat
@@ -1990,7 +2083,7 @@ lemma sum_card_fiberwise_eq_card_filter {κ : Type*} [DecidableEq κ] (s : Finse
simpa only [card_eq_sum_ones] using sum_fiberwise_eq_sum_filter _ _ _ _
lemma card_filter (p) [DecidablePred p] (s : Finset α) :
- (filter p s).card = ∑ a in s, ite (p a) 1 0 := by
+ (filter p s).card = ∑ a ∈ s, ite (p a) 1 0 := by
rw [sum_ite, sum_const_zero, add_zero, sum_const, smul_eq_mul, mul_one]
#align finset.card_filter Finset.card_filter
@@ -2001,13 +2094,13 @@ open MulOpposite
/-- Moving to the opposite additive commutative monoid commutes with summing. -/
@[simp]
theorem op_sum [AddCommMonoid β] {s : Finset α} (f : α → β) :
- op (∑ x in s, f x) = ∑ x in s, op (f x) :=
+ op (∑ x ∈ s, f x) = ∑ x ∈ s, op (f x) :=
map_sum (opAddEquiv : β ≃+ βᵐᵒᵖ) _ _
#align finset.op_sum Finset.op_sum
@[simp]
theorem unop_sum [AddCommMonoid β] {s : Finset α} (f : α → βᵐᵒᵖ) :
- unop (∑ x in s, f x) = ∑ x in s, unop (f x) :=
+ unop (∑ x ∈ s, f x) = ∑ x ∈ s, unop (f x) :=
map_sum (opAddEquiv : β ≃+ βᵐᵒᵖ).symm _ _
#align finset.unop_sum Finset.unop_sum
@@ -2018,19 +2111,19 @@ section DivisionCommMonoid
variable [DivisionCommMonoid β]
@[to_additive (attr := simp)]
-theorem prod_inv_distrib : (∏ x in s, (f x)⁻¹) = (∏ x in s, f x)⁻¹ :=
+theorem prod_inv_distrib : (∏ x ∈ s, (f x)⁻¹) = (∏ x ∈ s, f x)⁻¹ :=
Multiset.prod_map_inv
#align finset.prod_inv_distrib Finset.prod_inv_distrib
#align finset.sum_neg_distrib Finset.sum_neg_distrib
@[to_additive (attr := simp)]
-theorem prod_div_distrib : ∏ x in s, f x / g x = (∏ x in s, f x) / ∏ x in s, g x :=
+theorem prod_div_distrib : ∏ x ∈ s, f x / g x = (∏ x ∈ s, f x) / ∏ x ∈ s, g x :=
Multiset.prod_map_div
#align finset.prod_div_distrib Finset.prod_div_distrib
#align finset.sum_sub_distrib Finset.sum_sub_distrib
@[to_additive]
-theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : ∏ a in s, f a ^ n = (∏ a in s, f a) ^ n :=
+theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : ∏ a ∈ s, f a ^ n = (∏ a ∈ s, f a) ^ n :=
Multiset.prod_map_zpow
#align finset.prod_zpow Finset.prod_zpow
#align finset.sum_zsmul Finset.sum_zsmul
@@ -2043,21 +2136,21 @@ variable [CommGroup β] [DecidableEq α]
@[to_additive (attr := simp)]
theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) :
- ∏ x in s₂ \ s₁, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
+ ∏ x ∈ s₂ \ s₁, f x = (∏ x ∈ s₂, f x) / ∏ x ∈ s₁, f x := by
rw [eq_div_iff_mul_eq', prod_sdiff h]
#align finset.prod_sdiff_eq_div Finset.prod_sdiff_eq_div
#align finset.sum_sdiff_eq_sub Finset.sum_sdiff_eq_sub
@[to_additive]
theorem prod_sdiff_div_prod_sdiff :
- (∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
+ (∏ x ∈ s₂ \ s₁, f x) / ∏ x ∈ s₁ \ s₂, f x = (∏ x ∈ s₂, f x) / ∏ x ∈ s₁, f x := by
simp [← Finset.prod_sdiff (@inf_le_left _ _ s₁ s₂), ← Finset.prod_sdiff (@inf_le_right _ _ s₁ s₂)]
#align finset.prod_sdiff_div_prod_sdiff Finset.prod_sdiff_div_prod_sdiff
#align finset.sum_sdiff_sub_sum_sdiff Finset.sum_sdiff_sub_sum_sdiff
@[to_additive (attr := simp)]
theorem prod_erase_eq_div {a : α} (h : a ∈ s) :
- ∏ x in s.erase a, f x = (∏ x in s, f x) / f a := by
+ ∏ x ∈ s.erase a, f x = (∏ x ∈ s, f x) / f a := by
rw [eq_div_iff_mul_eq', prod_erase_mul _ _ h]
#align finset.prod_erase_eq_div Finset.prod_erase_eq_div
#align finset.sum_erase_eq_sub Finset.sum_erase_eq_sub
@@ -2066,7 +2159,7 @@ end CommGroup
@[simp]
theorem card_sigma {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) :
- card (s.sigma t) = ∑ a in s, card (t a) :=
+ card (s.sigma t) = ∑ a ∈ s, card (t a) :=
Multiset.card_sigma _ _
#align finset.card_sigma Finset.card_sigma
@@ -2078,35 +2171,35 @@ theorem card_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
(h : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → Disjoint (t x) (t y)) :
- (s.biUnion t).card = ∑ u in s, card (t u) :=
+ (s.biUnion t).card = ∑ u ∈ s, card (t u) :=
calc
- (s.biUnion t).card = ∑ i in s.biUnion t, 1 := card_eq_sum_ones _
- _ = ∑ a in s, ∑ _i in t a, 1 := Finset.sum_biUnion h
- _ = ∑ u in s, card (t u) := by simp_rw [card_eq_sum_ones]
+ (s.biUnion t).card = ∑ i ∈ s.biUnion t, 1 := card_eq_sum_ones _
+ _ = ∑ a ∈ s, ∑ _i ∈ t a, 1 := Finset.sum_biUnion h
+ _ = ∑ u ∈ s, card (t u) := by simp_rw [card_eq_sum_ones]
#align finset.card_bUnion Finset.card_biUnion
theorem card_biUnion_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
- (s.biUnion t).card ≤ ∑ a in s, (t a).card :=
+ (s.biUnion t).card ≤ ∑ a ∈ s, (t a).card :=
haveI := Classical.decEq α
Finset.induction_on s (by simp) fun a s has ih =>
calc
((insert a s).biUnion t).card ≤ (t a).card + (s.biUnion t).card := by
{ rw [biUnion_insert]; exact Finset.card_union_le _ _ }
- _ ≤ ∑ a in insert a s, card (t a) := by rw [sum_insert has]; exact add_le_add_left ih _
+ _ ≤ ∑ a ∈ insert a s, card (t a) := by rw [sum_insert has]; exact add_le_add_left ih _
#align finset.card_bUnion_le Finset.card_biUnion_le
theorem card_eq_sum_card_fiberwise [DecidableEq β] {f : α → β} {s : Finset α} {t : Finset β}
- (H : ∀ x ∈ s, f x ∈ t) : s.card = ∑ a in t, (s.filter fun x => f x = a).card := by
+ (H : ∀ x ∈ s, f x ∈ t) : s.card = ∑ a ∈ t, (s.filter fun x => f x = a).card := by
simp only [card_eq_sum_ones, sum_fiberwise_of_maps_to H]
#align finset.card_eq_sum_card_fiberwise Finset.card_eq_sum_card_fiberwise
theorem card_eq_sum_card_image [DecidableEq β] (f : α → β) (s : Finset α) :
- s.card = ∑ a in s.image f, (s.filter fun x => f x = a).card :=
+ s.card = ∑ a ∈ s.image f, (s.filter fun x => f x = a).card :=
card_eq_sum_card_fiberwise fun _ => mem_image_of_mem _
#align finset.card_eq_sum_card_image Finset.card_eq_sum_card_image
theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
- (b ∈ ∑ x in s, f x) ↔ ∃ a ∈ s, b ∈ f a := by
+ (b ∈ ∑ x ∈ s, f x) ↔ ∃ a ∈ s, b ∈ f a := by
classical
refine' s.induction_on (by simp) _
intro a t hi ih
@@ -2117,13 +2210,13 @@ section ProdEqZero
variable [CommMonoidWithZero β]
-theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : ∏ x in s, f x = 0 := by
+theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : ∏ x ∈ s, f x = 0 := by
haveI := Classical.decEq α
rw [← prod_erase_mul _ _ ha, h, mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
- (∏ i in s, ite (p i) (1 : β) (0 : β)) = ite (∀ i ∈ s, p i) 1 0 := by
+ (∏ i ∈ s, ite (p i) (1 : β) (0 : β)) = ite (∀ i ∈ s, p i) 1 0 := by
split_ifs with h
· apply prod_eq_one
intro i hi
@@ -2135,26 +2228,26 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
#align finset.prod_boole Finset.prod_boole
lemma support_prod_subset (s : Finset ι) (f : ι → α → β) :
- support (fun x ↦ ∏ i in s, f i x) ⊆ ⋂ i ∈ s, support (f i) :=
+ support (fun x ↦ ∏ i ∈ s, f i x) ⊆ ⋂ i ∈ s, support (f i) :=
fun _ hx ↦ Set.mem_iInter₂.2 fun _ hi H ↦ hx <| prod_eq_zero hi H
#align function.support_prod_subset Finset.support_prod_subset
variable [Nontrivial β] [NoZeroDivisors β]
-theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
+theorem prod_eq_zero_iff : ∏ x ∈ s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
induction' s using Finset.induction_on with a s ha ih
· exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => by simp at H⟩
· rw [prod_insert ha, mul_eq_zero, exists_mem_insert, ih]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
-theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by
+theorem prod_ne_zero_iff : ∏ x ∈ s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by
rw [Ne, prod_eq_zero_iff]
push_neg; rfl
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
lemma support_prod (s : Finset ι) (f : ι → α → β) :
- support (fun x ↦ ∏ i in s, f i x) = ⋂ i ∈ s, support (f i) :=
+ support (fun x ↦ ∏ i ∈ s, f i x) = ⋂ i ∈ s, support (f i) :=
Set.ext fun x ↦ by simp [support, prod_eq_zero_iff]
#align function.support_prod Finset.support_prod
@@ -2162,28 +2255,28 @@ end ProdEqZero
@[to_additive]
theorem prod_unique_nonempty {α β : Type*} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
- (h : s.Nonempty) : ∏ x in s, f x = f default := by
+ (h : s.Nonempty) : ∏ x ∈ s, f x = f default := by
rw [h.eq_singleton_default, Finset.prod_singleton]
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
#align finset.sum_unique_nonempty Finset.sum_unique_nonempty
theorem sum_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
- (∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
+ (∑ i ∈ s, f i) % n = (∑ i ∈ s, f i % n) % n :=
(Multiset.sum_nat_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]; rfl
#align finset.sum_nat_mod Finset.sum_nat_mod
theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
- (∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
+ (∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n :=
(Multiset.prod_nat_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]; rfl
#align finset.prod_nat_mod Finset.prod_nat_mod
theorem sum_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
- (∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
+ (∑ i ∈ s, f i) % n = (∑ i ∈ s, f i % n) % n :=
(Multiset.sum_int_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]; rfl
#align finset.sum_int_mod Finset.sum_int_mod
theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
- (∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
+ (∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n :=
(Multiset.prod_int_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]; rfl
#align finset.prod_int_mod Finset.prod_int_mod
@@ -2346,14 +2439,14 @@ variable [CommMonoid α]
@[to_additive (attr := simp)]
lemma prod_attach_univ [Fintype ι] (f : {i // i ∈ @univ ι _} → α) :
- ∏ i in univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩ :=
+ ∏ i ∈ univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩ :=
Fintype.prod_equiv (Equiv.subtypeUnivEquiv mem_univ) _ _ $ by simp
#align finset.prod_attach_univ Finset.prod_attach_univ
#align finset.sum_attach_univ Finset.sum_attach_univ
@[to_additive]
theorem prod_erase_attach [DecidableEq ι] {s : Finset ι} (f : ι → α) (i : ↑s) :
- ∏ j in s.attach.erase i, f ↑j = ∏ j in s.erase ↑i, f j := by
+ ∏ j ∈ s.attach.erase i, f ↑j = ∏ j ∈ s.erase ↑i, f j := by
rw [← Function.Embedding.coe_subtype, ← prod_map]
simp [attach_map_val]
@@ -2414,9 +2507,9 @@ theorem disjoint_finset_sum_right {β : Type*} {i : Finset β} {f : β → Multi
variable [DecidableEq α]
@[simp]
-theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a = card s :=
+theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a ∈ s.toFinset, s.count a = card s :=
calc
- ∑ a in s.toFinset, s.count a = ∑ a in s.toFinset, s.count a • 1 := by
+ ∑ a ∈ s.toFinset, s.count a = ∑ a ∈ s.toFinset, s.count a • 1 := by
{ simp only [smul_eq_mul, mul_one] }
_ = (s.map fun _ => 1).sum := (Finset.sum_multiset_map_count _ _).symm
_ = card s := by simp
@@ -2430,23 +2523,23 @@ theorem sum_count_eq [Fintype α] (s : Multiset α) : ∑ a, s.count a = Multise
simp
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
- count a (∑ x in s, f x) = ∑ x in s, count a (f x) := by
+ count a (∑ x ∈ s, f x) = ∑ x ∈ s, count a (f x) := by
dsimp only [Finset.sum]
rw [count_sum]
#align multiset.count_sum' Multiset.count_sum'
@[simp]
theorem toFinset_sum_count_nsmul_eq (s : Multiset α) :
- ∑ a in s.toFinset, s.count a • {a} = s := by
+ ∑ a ∈ s.toFinset, s.count a • {a} = s := by
rw [← Finset.sum_multiset_map_count, Multiset.sum_map_singleton]
#align multiset.to_finset_sum_count_nsmul_eq Multiset.toFinset_sum_count_nsmul_eq
theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
(h : ∀ a : α, a ∈ s → k ∣ Multiset.count a s) : ∃ u : Multiset α, s = k • u := by
- use ∑ a in s.toFinset, (s.count a / k) • {a}
+ use ∑ a ∈ s.toFinset, (s.count a / k) • {a}
have h₂ :
- (∑ x : α in s.toFinset, k • (count x s / k) • ({x} : Multiset α)) =
- ∑ x : α in s.toFinset, count x s • {x} := by
+ (∑ x ∈ s.toFinset, k • (count x s / k) • ({x} : Multiset α)) =
+ ∑ x ∈ s.toFinset, count x s • {x} := by
apply Finset.sum_congr rfl
intro x hx
rw [← mul_nsmul', Nat.mul_div_cancel' (h x (mem_toFinset.mp hx))]
@@ -2461,7 +2554,7 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.pr
@[to_additive]
theorem prod_sum {α : Type*} {ι : Type*} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
- (∑ x in s, f x).prod = ∏ x in s, (f x).prod := by
+ (∑ x ∈ s, f x).prod = ∏ x ∈ s, (f x).prod := by
classical
induction' s using Finset.induction_on with a t hat ih
· rw [Finset.sum_empty, Finset.prod_empty, Multiset.prod_zero]
@@ -2473,18 +2566,18 @@ end Multiset
@[simp, norm_cast]
theorem Units.coe_prod {M : Type*} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
- (↑(∏ i in s, f i) : M) = ∏ i in s, (f i : M) :=
+ (↑(∏ i ∈ s, f i) : M) = ∏ i ∈ s, (f i : M) :=
map_prod (Units.coeHom M) _ _
#align units.coe_prod Units.coe_prod
theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h) :
- Units.mk0 (∏ b in s, f b) h =
- ∏ b in s.attach, Units.mk0 (f b) fun hh => h (Finset.prod_eq_zero b.2 hh) := by
+ Units.mk0 (∏ b ∈ s, f b) h =
+ ∏ b ∈ s.attach, Units.mk0 (f b) fun hh => h (Finset.prod_eq_zero b.2 hh) := by
classical induction s using Finset.induction_on <;> simp [*]
#align units.mk0_prod Units.mk0_prod
theorem nat_abs_sum_le {ι : Type*} (s : Finset ι) (f : ι → ℤ) :
- (∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
+ (∑ i ∈ s, f i).natAbs ≤ ∑ i ∈ s, (f i).natAbs := by
classical
induction' s using Finset.induction_on with i s his IH
· simp only [Finset.sum_empty, Int.natAbs_zero, le_refl]
@@ -2542,13 +2635,13 @@ theorem toMul_multiset_sum (s : Multiset (Additive α)) : toMul s.sum = (s.map t
#align to_mul_multiset_sum toMul_multiset_sum
@[simp]
-theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i in s, f i) = ∑ i in s, ofMul (f i) :=
+theorem ofMul_prod (s : Finset ι) (f : ι → α) : ofMul (∏ i ∈ s, f i) = ∑ i ∈ s, ofMul (f i) :=
rfl
#align of_mul_prod ofMul_prod
@[simp]
theorem toMul_sum (s : Finset ι) (f : ι → Additive α) :
- toMul (∑ i in s, f i) = ∏ i in s, toMul (f i) :=
+ toMul (∑ i ∈ s, f i) = ∏ i ∈ s, toMul (f i) :=
rfl
#align to_mul_sum toMul_sum
@@ -2570,13 +2663,13 @@ theorem toAdd_multiset_sum (s : Multiset (Multiplicative α)) :
#align to_add_multiset_sum toAdd_multiset_sum
@[simp]
-theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i in s, f i) = ∏ i in s, ofAdd (f i) :=
+theorem ofAdd_sum (s : Finset ι) (f : ι → α) : ofAdd (∑ i ∈ s, f i) = ∏ i ∈ s, ofAdd (f i) :=
rfl
#align of_add_sum ofAdd_sum
@[simp]
theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
- toAdd (∏ i in s, f i) = ∑ i in s, toAdd (f i) :=
+ toAdd (∏ i ∈ s, f i) = ∑ i ∈ s, toAdd (f i) :=
rfl
#align to_add_prod toAdd_prod
@@ -667,6 +667,19 @@ lemma prod_of_injOn (e : ι → κ) (he : Set.InjOn e s) (hest : Set.MapsTo e s
variable [DecidableEq κ]
+@[to_additive]
+lemma prod_fiberwise_eq_prod_filter (s : Finset ι) (t : Finset κ) (g : ι → κ) (f : ι → α) :
+ ∏ j in t, ∏ i in s.filter fun i ↦ g i = j, f i = ∏ i in s.filter fun i ↦ g i ∈ t, f i := by
+ rw [← prod_disjiUnion, disjiUnion_filter_eq]
+
+@[to_additive]
+lemma prod_fiberwise_eq_prod_filter' (s : Finset ι) (t : Finset κ) (g : ι → κ) (f : κ → α) :
+ ∏ j in t, ∏ _i in s.filter fun i ↦ g i = j, f j = ∏ i in s.filter fun i ↦ g i ∈ t, f (g i) := by
+ calc
+ _ = ∏ j in t, ∏ i in s.filter fun i ↦ g i = j, f (g i) :=
+ prod_congr rfl fun j _ ↦ prod_congr rfl fun i hi ↦ by rw [(mem_filter.1 hi).2]
+ _ = _ := prod_fiberwise_eq_prod_filter _ _ _ _
+
@[to_additive]
lemma prod_fiberwise_of_maps_to {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : ι → α) :
∏ j in t, ∏ i in s.filter fun i ↦ g i = j, f i = ∏ i in s, f i := by
@@ -1945,6 +1958,23 @@ theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι)
end CommMonoid
+section CancelCommMonoid
+variable [DecidableEq ι] [CancelCommMonoid α] {s t : Finset ι} {f : ι → α}
+
+@[to_additive]
+lemma prod_sdiff_eq_prod_sdiff_iff :
+ ∏ i in s \ t, f i = ∏ i in t \ s, f i ↔ ∏ i in s, f i = ∏ i in t, f i :=
+ eq_comm.trans $ eq_iff_eq_of_mul_eq_mul $ by
+ rw [← prod_union disjoint_sdiff_self_left, ← prod_union disjoint_sdiff_self_left,
+ sdiff_union_self_eq_union, sdiff_union_self_eq_union, union_comm]
+
+@[to_additive]
+lemma prod_sdiff_ne_prod_sdiff_iff :
+ ∏ i in s \ t, f i ≠ ∏ i in t \ s, f i ↔ ∏ i in s, f i ≠ ∏ i in t, f i :=
+ prod_sdiff_eq_prod_sdiff_iff.not
+
+end CancelCommMonoid
+
theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ x in s, 1 := by
rw [sum_const, smul_eq_mul, mul_one]
#align finset.card_eq_sum_ones Finset.card_eq_sum_ones
@@ -1955,6 +1985,10 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
apply sum_congr rfl h₁
#align finset.sum_const_nat Finset.sum_const_nat
+lemma sum_card_fiberwise_eq_card_filter {κ : Type*} [DecidableEq κ] (s : Finset ι) (t : Finset κ)
+ (g : ι → κ) : ∑ j in t, (s.filter fun i ↦ g i = j).card = (s.filter fun i ↦ g i ∈ t).card := by
+ simpa only [card_eq_sum_ones] using sum_fiberwise_eq_sum_filter _ _ _ _
+
lemma card_filter (p) [DecidablePred p] (s : Finset α) :
(filter p s).card = ∑ a in s, ite (p a) 1 0 := by
rw [sum_ite, sum_const_zero, add_zero, sum_const, smul_eq_mul, mul_one]
@@ -2156,10 +2190,13 @@ theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
end Finset
namespace Fintype
-variable {ι κ α : Type*} [Fintype ι] [Fintype κ] [CommMonoid α]
+variable {ι κ α : Type*} [Fintype ι] [Fintype κ]
open Finset
+section CommMonoid
+variable [CommMonoid α]
+
/-- `Fintype.prod_bijective` is a variant of `Finset.prod_bij` that accepts `Function.Bijective`.
See `Function.Bijective.prod_comp` for a version without `h`. -/
@@ -2256,6 +2293,52 @@ theorem prod_subtype_mul_prod_subtype {α β : Type*} [Fintype α] [CommMonoid
#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtype
#align fintype.sum_subtype_add_sum_subtype Fintype.sum_subtype_add_sum_subtype
+@[to_additive] lemma prod_subset {s : Finset ι} {f : ι → α} (h : ∀ i, f i ≠ 1 → i ∈ s) :
+ ∏ i in s, f i = ∏ i, f i :=
+ Finset.prod_subset s.subset_univ $ by simpa [not_imp_comm (a := _ ∈ s)]
+
+@[to_additive]
+lemma prod_ite_eq_ite_exists (p : ι → Prop) [DecidablePred p] (h : ∀ i j, p i → p j → i = j)
+ (a : α) : ∏ i, ite (p i) a 1 = ite (∃ i, p i) a 1 := by
+ simp [prod_ite_one univ p (by simpa using h)]
+
+variable [DecidableEq ι]
+
+/-- See also `Finset.prod_dite_eq`. -/
+@[to_additive "See also `Finset.sum_dite_eq`."] lemma prod_dite_eq (i : ι) (f : ∀ j, i = j → α) :
+ ∏ j, (if h : i = j then f j h else 1) = f i rfl := by
+ rw [Finset.prod_dite_eq, if_pos (mem_univ _)]
+
+/-- See also `Finset.prod_dite_eq'`. -/
+@[to_additive "See also `Finset.sum_dite_eq'`."] lemma prod_dite_eq' (i : ι) (f : ∀ j, j = i → α) :
+ ∏ j, (if h : j = i then f j h else 1) = f i rfl := by
+ rw [Finset.prod_dite_eq', if_pos (mem_univ _)]
+
+/-- See also `Finset.prod_ite_eq`. -/
+@[to_additive "See also `Finset.sum_ite_eq`."]
+lemma prod_ite_eq (i : ι) (f : ι → α) : ∏ j, (if i = j then f j else 1) = f i := by
+ rw [Finset.prod_ite_eq, if_pos (mem_univ _)]
+
+/-- See also `Finset.prod_ite_eq'`. -/
+@[to_additive "See also `Finset.sum_ite_eq'`."]
+lemma prod_ite_eq' (i : ι) (f : ι → α) : ∏ j, (if j = i then f j else 1) = f i := by
+ rw [Finset.prod_ite_eq', if_pos (mem_univ _)]
+
+/-- See also `Finset.prod_pi_mulSingle`. -/
+@[to_additive "See also `Finset.sum_pi_single`."]
+lemma prod_pi_mulSingle {α : ι → Type*} [∀ i, CommMonoid (α i)] (i : ι) (f : ∀ i, α i) :
+ ∏ j, Pi.mulSingle j (f j) i = f i := prod_dite_eq _ _
+
+/-- See also `Finset.prod_pi_mulSingle'`. -/
+@[to_additive "See also `Finset.sum_pi_single'`."]
+lemma prod_pi_mulSingle' (i : ι) (a : α) : ∏ j, Pi.mulSingle i a j = a := prod_dite_eq' _ _
+
+end CommMonoid
+
+variable [CommMonoidWithZero α] {p : ι → Prop} [DecidablePred p]
+
+lemma prod_boole : ∏ i, ite (p i) (1 : α) 0 = ite (∀ i, p i) 1 0 := by simp [Finset.prod_boole]
+
end Fintype
namespace Finset
@@ -2075,8 +2075,8 @@ theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
(b ∈ ∑ x in s, f x) ↔ ∃ a ∈ s, b ∈ f a := by
classical
refine' s.induction_on (by simp) _
- · intro a t hi ih
- simp [sum_insert hi, ih, or_and_right, exists_or]
+ intro a t hi ih
+ simp [sum_insert hi, ih, or_and_right, exists_or]
#align finset.mem_sum Finset.mem_sum
section ProdEqZero
deprecated
attributeWhy these changes?
@@ -2499,11 +2499,5 @@ theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
end AddCommMonoid
-/-!
-### Deprecated lemmas
-
-Those lemmas were deprecated on the 2023/12/23.
--/
-
-@[deprecated] alias Equiv.prod_comp' := Fintype.prod_equiv
-@[deprecated] alias Equiv.sum_comp' := Fintype.sum_equiv
+@[deprecated] alias Equiv.prod_comp' := Fintype.prod_equiv -- 2023-12-23
+@[deprecated] alias Equiv.sum_comp' := Fintype.sum_equiv -- 2023-12-23
@@ -1540,7 +1540,7 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
@[to_additive]
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
(hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x in m.toFinset, g x := by
- refine' prod_bij' (fun x _ ↦ x) (fun x hx ↦ ⟨x, Multiset.mem_toFinset.1 hx⟩) ?_ ?_ ?_ ?_ ?_ <;>
+ refine prod_bij' (fun x _ ↦ x) (fun x hx ↦ ⟨x, Multiset.mem_toFinset.1 hx⟩) ?_ ?_ ?_ ?_ ?_ <;>
simp [hfg]
#align finset.prod_mem_multiset Finset.prod_mem_multiset
#align finset.sum_mem_multiset Finset.sum_mem_multiset
This fixes the delaborators for sums, products, infimums, and supremums of pi types and matrices.
Also adds a missing whenPPOption getPPNotation
to Prefunctor.obj
.
@@ -126,7 +126,8 @@ open Std.ExtendedBinder
/-- Delaborator for `Finset.prod`. The `pp.piBinderTypes` option controls whether
to show the domain type when the product is over `Finset.univ`. -/
-@[scoped delab app.Finset.prod] def delabFinsetProd : Delab := whenPPOption getPPNotation do
+@[scoped delab app.Finset.prod] def delabFinsetProd : Delab :=
+ whenPPOption getPPNotation <| withOverApp 5 <| do
let #[_, _, _, s, f] := (← getExpr).getAppArgs | failure
guard <| f.isLambda
let ppDomain ← getPPOption getPPPiBinderTypes
@@ -146,7 +147,8 @@ to show the domain type when the product is over `Finset.univ`. -/
/-- Delaborator for `Finset.prod`. The `pp.piBinderTypes` option controls whether
to show the domain type when the sum is over `Finset.univ`. -/
-@[scoped delab app.Finset.sum] def delabFinsetSum : Delab := whenPPOption getPPNotation do
+@[scoped delab app.Finset.sum] def delabFinsetSum : Delab :=
+ whenPPOption getPPNotation <| withOverApp 5 <| do
let #[_, _, _, s, f] := (← getExpr).getAppArgs | failure
guard <| f.isLambda
let ppDomain ← getPPOption getPPPiBinderTypes
Mostly automatic, with a few manual corrections.
@@ -1208,7 +1208,7 @@ The difference with `Finset.prod_ite_eq` is that the arguments to `Eq` are swapp
@[to_additive (attr := simp) "A sum taken over a conditional whose condition is an equality
test on the index and whose alternative is `0` has value either the term at that index or `0`.
-The difference with `Finset.sum_ite_eq` is that the arguments to `eq` are swapped."]
+The difference with `Finset.sum_ite_eq` is that the arguments to `Eq` are swapped."]
theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
(∏ x in s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1 :=
prod_dite_eq' s a fun x _ => b x
Take the content of
Algebra.BigOperators.List.Basic
Algebra.BigOperators.List.Lemmas
Algebra.BigOperators.Multiset.Basic
Algebra.BigOperators.Multiset.Lemmas
Algebra.BigOperators.Multiset.Order
Algebra.BigOperators.Order
and sort it into six files:
Algebra.Order.BigOperators.Group.List
. I credit Yakov for https://github.com/leanprover-community/mathlib/pull/8543.Algebra.Order.BigOperators.Group.Multiset
. Copyright inherited from Algebra.BigOperators.Multiset.Order
.Algebra.Order.BigOperators.Group.Finset
. Copyright inherited from Algebra.BigOperators.Order
.Algebra.Order.BigOperators.Ring.List
. I credit Stuart for https://github.com/leanprover-community/mathlib/pull/10184.Algebra.Order.BigOperators.Ring.Multiset
. I credit Ruben for https://github.com/leanprover-community/mathlib/pull/8787.Algebra.Order.BigOperators.Ring.Finset
. I credit Floris for https://github.com/leanprover-community/mathlib/pull/1294.Here are the design decisions at play:
Data.Nat.Order.Basic
in a few List
files.Algebra.Order.BigOperators
instead of Algebra.BigOperators.Order
because algebraic order theory is more of a theory than big operators algebra. Another reason is that algebraic order theory is the only way to mix pure order and pure algebra, while there are more ways to mix pure finiteness and pure algebra than just big operators.Algebra.Order.BigOperators.Group
should be additivisable (except a few Nat
- or Int
-specific lemmas). In contrast, things under Algebra.Order.BigOperators.Ring
are more prone to having heavy imports.List
vs Multiset
vs Finset
. This is not strictly necessary, and can be relaxed in cases where there aren't that many lemmas to be had. As an example, I could split out the AbsoluteValue
lemmas from Algebra.Order.BigOperators.Ring.Finset
to a file Algebra.Order.BigOperators.Ring.AbsoluteValue
and it could stay this way until too many lemmas are in this file (or a split is needed for import reasons), in which case we would need files Algebra.Order.BigOperators.Ring.AbsoluteValue.Finset
, Algebra.Order.BigOperators.Ring.AbsoluteValue.Multiset
, etc...Finsupp
big operator and finprod
/finsum
order lemmas also belong in Algebra.Order.BigOperators
. I haven't done so in this PR because the diff is big enough like that.@@ -3,18 +3,9 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
-import Mathlib.Algebra.BigOperators.Multiset.Lemmas
-import Mathlib.Algebra.BigOperators.Multiset.Order
import Mathlib.Algebra.Function.Indicator
-import Mathlib.Algebra.Ring.Opposite
-import Mathlib.Data.Finset.Powerset
import Mathlib.Data.Finset.Piecewise
import Mathlib.Data.Finset.Preimage
-import Mathlib.Data.Finset.Sigma
-import Mathlib.Data.Finset.Sum
-import Mathlib.Data.Fintype.Pi
-import Mathlib.Data.Int.Cast.Lemmas
-import Mathlib.Data.Set.Image
#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
@@ -45,6 +36,9 @@ See the documentation of `to_additive.attr` for more information.
-/
+-- TODO
+-- assert_not_exists AddCommMonoidWithOne
+
variable {ι κ α β γ : Type*}
open Fin Function
@@ -212,58 +206,6 @@ theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [FunLike G β γ] [
#align map_prod map_prod
#align map_sum map_sum
-section Deprecated
-
-#align monoid_hom.map_prod map_prodₓ
-#align add_monoid_hom.map_sum map_sumₓ
-#align mul_equiv.map_prod map_prodₓ
-#align add_equiv.map_sum map_sumₓ
-
-@[deprecated _root_.map_list_prod]
-protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
- f l.prod = (l.map f).prod :=
- map_list_prod f l
-#align ring_hom.map_list_prod RingHom.map_list_prod
-
-@[deprecated _root_.map_list_sum]
-protected theorem RingHom.map_list_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
- (l : List β) : f l.sum = (l.map f).sum :=
- map_list_sum f l
-#align ring_hom.map_list_sum RingHom.map_list_sum
-
-/-- A morphism into the opposite ring acts on the product by acting on the reversed elements. -/
-@[deprecated _root_.unop_map_list_prod]
-protected theorem RingHom.unop_map_list_prod [Semiring β] [Semiring γ] (f : β →+* γᵐᵒᵖ)
- (l : List β) : MulOpposite.unop (f l.prod) = (l.map (MulOpposite.unop ∘ f)).reverse.prod :=
- unop_map_list_prod f l
-#align ring_hom.unop_map_list_prod RingHom.unop_map_list_prod
-
-@[deprecated _root_.map_multiset_prod]
-protected theorem RingHom.map_multiset_prod [CommSemiring β] [CommSemiring γ] (f : β →+* γ)
- (s : Multiset β) : f s.prod = (s.map f).prod :=
- map_multiset_prod f s
-#align ring_hom.map_multiset_prod RingHom.map_multiset_prod
-
-@[deprecated _root_.map_multiset_sum]
-protected theorem RingHom.map_multiset_sum [NonAssocSemiring β] [NonAssocSemiring γ] (f : β →+* γ)
- (s : Multiset β) : f s.sum = (s.map f).sum :=
- map_multiset_sum f s
-#align ring_hom.map_multiset_sum RingHom.map_multiset_sum
-
-@[deprecated _root_.map_prod]
-protected theorem RingHom.map_prod [CommSemiring β] [CommSemiring γ] (g : β →+* γ) (f : α → β)
- (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
- map_prod g f s
-#align ring_hom.map_prod RingHom.map_prod
-
-@[deprecated _root_.map_sum]
-protected theorem RingHom.map_sum [NonAssocSemiring β] [NonAssocSemiring γ] (g : β →+* γ)
- (f : α → β) (s : Finset α) : g (∑ x in s, f x) = ∑ x in s, g (f x) :=
- map_sum g f s
-#align ring_hom.map_sum RingHom.map_sum
-
-end Deprecated
-
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
⇑(∏ x in s, f x) = ∏ x in s, ⇑(f x) :=
@@ -2001,16 +1943,6 @@ theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι)
end CommMonoid
-/-- If `f = g = h` everywhere but at `i`, where `f i = g i + h i`, then the product of `f` over `s`
- is the sum of the products of `g` and `h`. -/
-theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
- (h1 : g i + h i = f i) (h2 : ∀ j ∈ s, j ≠ i → g j = f j) (h3 : ∀ j ∈ s, j ≠ i → h j = f j) :
- (∏ i in s, g i) + ∏ i in s, h i = ∏ i in s, f i := by
- classical
- simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
- congr 2 <;> apply prod_congr rfl <;> simpa
-#align finset.prod_add_prod_eq Finset.prod_add_prod_eq
-
theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ x in s, 1 := by
rw [sum_const, smul_eq_mul, mul_one]
#align finset.card_eq_sum_ones Finset.card_eq_sum_ones
@@ -2021,33 +1953,11 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
apply sum_congr rfl h₁
#align finset.sum_const_nat Finset.sum_const_nat
-lemma natCast_card_filter [AddCommMonoidWithOne β] (p) [DecidablePred p] (s : Finset α) :
- ((filter p s).card : β) = ∑ a in s, if p a then (1 : β) else 0 := by
- rw [sum_ite, sum_const_zero, add_zero, sum_const, nsmul_one]
-#align finset.nat_cast_card_filter Finset.natCast_card_filter
-
lemma card_filter (p) [DecidablePred p] (s : Finset α) :
- (filter p s).card = ∑ a in s, ite (p a) 1 0 := natCast_card_filter _ _
+ (filter p s).card = ∑ a in s, ite (p a) 1 0 := by
+ rw [sum_ite, sum_const_zero, add_zero, sum_const, smul_eq_mul, mul_one]
#align finset.card_filter Finset.card_filter
-@[simp]
-lemma sum_boole {s : Finset α} {p : α → Prop} [AddCommMonoidWithOne β] [DecidablePred p] :
- (∑ x in s, if p x then 1 else 0 : β) = (s.filter p).card :=
- (natCast_card_filter _ _).symm
-#align finset.sum_boole Finset.sum_boole
-
-theorem _root_.Commute.sum_right [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
- (h : ∀ i ∈ s, Commute b (f i)) : Commute b (∑ i in s, f i) :=
- (Commute.multiset_sum_right _ _) fun b hb => by
- obtain ⟨i, hi, rfl⟩ := Multiset.mem_map.mp hb
- exact h _ hi
-#align commute.sum_right Commute.sum_right
-
-theorem _root_.Commute.sum_left [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
- (h : ∀ i ∈ s, Commute (f i) b) : Commute (∑ i in s, f i) b :=
- ((Commute.sum_right _ _ _) fun _i hi => (h _ hi).symm).symm
-#align commute.sum_left Commute.sum_left
-
section Opposite
open MulOpposite
@@ -2418,48 +2328,6 @@ theorem disjoint_finset_sum_right {β : Type*} {i : Finset β} {f : β → Multi
variable [DecidableEq α]
-theorem add_eq_union_left_of_le {x y z : Multiset α} (h : y ≤ x) :
- z + x = z ∪ y ↔ z.Disjoint x ∧ x = y := by
- rw [← add_eq_union_iff_disjoint]
- constructor
- · intro h0
- rw [and_iff_right_of_imp]
- · exact (le_of_add_le_add_left <| h0.trans_le <| union_le_add z y).antisymm h
- · rintro rfl
- exact h0
- · rintro ⟨h0, rfl⟩
- exact h0
-#align multiset.add_eq_union_left_of_le Multiset.add_eq_union_left_of_le
-
-theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
- x + y = x ∪ z ↔ y = z ∧ x.Disjoint y := by
- simpa only [and_comm] using add_eq_union_left_of_le h
-#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-
-theorem finset_sum_eq_sup_iff_disjoint {β : Type*} {i : Finset β} {f : β → Multiset α} :
- i.sum f = i.sup f ↔
- ∀ᵉ (x ∈ i) (y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) := by
- induction' i using Finset.cons_induction_on with z i hz hr
- · simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
- Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
- · simp_rw [Finset.sum_cons hz, Finset.sup_cons, Finset.mem_cons, Multiset.sup_eq_union,
- forall_eq_or_imp, Ne, not_true_eq_false, IsEmpty.forall_iff, true_and_iff,
- imp_and, forall_and, ← hr, @eq_comm _ z]
- have := fun x (H : x ∈ i) => ne_of_mem_of_not_mem H hz
- simp (config := { contextual := true }) only [this, not_false_iff, true_imp_iff]
- simp_rw [← disjoint_finset_sum_left, ← disjoint_finset_sum_right, disjoint_comm, ← and_assoc,
- and_self_iff]
- exact add_eq_union_left_of_le (Finset.sup_le fun x hx => le_sum_of_mem (mem_map_of_mem f hx))
-#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjoint
-
-theorem sup_powerset_len {α : Type*} [DecidableEq α] (x : Multiset α) :
- (Finset.sup (Finset.range (card x + 1)) fun k => x.powersetCard k) = x.powerset := by
- convert bind_powerset_len x using 1
- rw [Multiset.bind, Multiset.join, ← Finset.range_val, ← Finset.sum_eq_multiset_sum]
- exact
- Eq.symm (finset_sum_eq_sup_iff_disjoint.mpr fun _ _ _ _ h => pairwise_disjoint_powersetCard x h)
-#align multiset.sup_powerset_len Multiset.sup_powerset_len
-
@[simp]
theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a = card s :=
calc
@@ -2518,81 +2386,6 @@ theorem prod_sum {α : Type*} {ι : Type*} [CommMonoid α] (f : ι → Multiset
end Multiset
-namespace Nat
-
-@[simp, norm_cast]
-theorem cast_list_sum [AddMonoidWithOne β] (s : List ℕ) : (↑s.sum : β) = (s.map (↑)).sum :=
- map_list_sum (castAddMonoidHom β) _
-#align nat.cast_list_sum Nat.cast_list_sum
-
-@[simp, norm_cast]
-theorem cast_list_prod [Semiring β] (s : List ℕ) : (↑s.prod : β) = (s.map (↑)).prod :=
- map_list_prod (castRingHom β) _
-#align nat.cast_list_prod Nat.cast_list_prod
-
-@[simp, norm_cast]
-theorem cast_multiset_sum [AddCommMonoidWithOne β] (s : Multiset ℕ) :
- (↑s.sum : β) = (s.map (↑)).sum :=
- map_multiset_sum (castAddMonoidHom β) _
-#align nat.cast_multiset_sum Nat.cast_multiset_sum
-
-@[simp, norm_cast]
-theorem cast_multiset_prod [CommSemiring β] (s : Multiset ℕ) : (↑s.prod : β) = (s.map (↑)).prod :=
- map_multiset_prod (castRingHom β) _
-#align nat.cast_multiset_prod Nat.cast_multiset_prod
-
-@[simp, norm_cast]
-theorem cast_sum [AddCommMonoidWithOne β] (s : Finset α) (f : α → ℕ) :
- ↑(∑ x in s, f x : ℕ) = ∑ x in s, (f x : β) :=
- map_sum (castAddMonoidHom β) _ _
-#align nat.cast_sum Nat.cast_sum
-
-@[simp, norm_cast]
-theorem cast_prod [CommSemiring β] (f : α → ℕ) (s : Finset α) :
- (↑(∏ i in s, f i) : β) = ∏ i in s, (f i : β) :=
- map_prod (castRingHom β) _ _
-#align nat.cast_prod Nat.cast_prod
-
-end Nat
-
-namespace Int
-
-@[simp, norm_cast]
-theorem cast_list_sum [AddGroupWithOne β] (s : List ℤ) : (↑s.sum : β) = (s.map (↑)).sum :=
- map_list_sum (castAddHom β) _
-#align int.cast_list_sum Int.cast_list_sum
-
-@[simp, norm_cast]
-theorem cast_list_prod [Ring β] (s : List ℤ) : (↑s.prod : β) = (s.map (↑)).prod :=
- map_list_prod (castRingHom β) _
-#align int.cast_list_prod Int.cast_list_prod
-
-@[simp, norm_cast]
-theorem cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
- (↑s.sum : β) = (s.map (↑)).sum :=
- map_multiset_sum (castAddHom β) _
-#align int.cast_multiset_sum Int.cast_multiset_sum
-
-@[simp, norm_cast]
-theorem cast_multiset_prod {R : Type*} [CommRing R] (s : Multiset ℤ) :
- (↑s.prod : R) = (s.map (↑)).prod :=
- map_multiset_prod (castRingHom R) _
-#align int.cast_multiset_prod Int.cast_multiset_prod
-
-@[simp, norm_cast]
-theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
- ↑(∑ x in s, f x : ℤ) = ∑ x in s, (f x : β) :=
- map_sum (castAddHom β) _ _
-#align int.cast_sum Int.cast_sum
-
-@[simp, norm_cast]
-theorem cast_prod {R : Type*} [CommRing R] (f : α → ℤ) (s : Finset α) :
- (↑(∏ i in s, f i) : R) = ∏ i in s, (f i : R) :=
- map_prod (Int.castRingHom R) _ _
-#align int.cast_prod Int.cast_prod
-
-end Int
-
@[simp, norm_cast]
theorem Units.coe_prod {M : Type*} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
(↑(∏ i in s, f i) : M) = ∏ i in s, (f i : M) :=
@@ -2443,7 +2443,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type*} {i : Finset β} {f : β →
· simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
· simp_rw [Finset.sum_cons hz, Finset.sup_cons, Finset.mem_cons, Multiset.sup_eq_union,
- forall_eq_or_imp, Ne.def, not_true_eq_false, IsEmpty.forall_iff, true_and_iff,
+ forall_eq_or_imp, Ne, not_true_eq_false, IsEmpty.forall_iff, true_and_iff,
imp_and, forall_and, ← hr, @eq_comm _ z]
have := fun x (H : x ∈ i) => ne_of_mem_of_not_mem H hz
simp (config := { contextual := true }) only [this, not_false_iff, true_imp_iff]
Move Finset.biUnion
and Finset.disjiUnion
to a new file so that Data.Finset.Basic
doesn't depend on that much order theory.
@@ -8,6 +8,7 @@ import Mathlib.Algebra.BigOperators.Multiset.Order
import Mathlib.Algebra.Function.Indicator
import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Finset.Powerset
+import Mathlib.Data.Finset.Piecewise
import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Finset.Sum
We change the following field in the definition of an additive commutative monoid:
nsmul_succ : ∀ (n : ℕ) (x : G),
- AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+ AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
where the latter is more natural
We adjust the definitions of ^
in monoids, groups, etc.
Originally there was a warning comment about why this natural order was preferred
use
x * npowRec n x
and notnpowRec n x * x
in the definition to make sure that definitional unfolding ofnpowRec
is blocked, to avoid deep recursion issues.
but it seems to no longer apply.
Remarks on the PR :
pow_succ
and pow_succ'
have switched their meanings.Ideal.IsPrime.mul_mem_pow
which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul
.@@ -1530,7 +1530,7 @@ theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type*} [CommMono
simp only [List.map, List.prod_cons, toFinset_cons, IH]
by_cases has : a ∈ s.toFinset
· rw [insert_eq_of_mem has, ← insert_erase has, prod_insert (not_mem_erase _ _),
- prod_insert (not_mem_erase _ _), ← mul_assoc, count_cons_self, pow_succ]
+ prod_insert (not_mem_erase _ _), ← mul_assoc, count_cons_self, pow_succ']
congr 1
refine' prod_congr rfl fun x hx => _
rw [count_cons_of_ne (ne_of_mem_erase hx)]
Make use of Nat
-specific lemmas from Std rather than the general ones provided by mathlib. Also reverse the dependency between Multiset.Nodup
/Multiset.dedup
and Multiset.sum
since only the latter needs algebra. Also rename Algebra.BigOperators.Multiset.Abs
to Algebra.BigOperators.Multiset.Order
and move some lemmas from Algebra.BigOperators.Multiset.Basic
to it.
The ultimate goal here is to carve out Data
, Algebra
and Order
sublibraries.
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Algebra.BigOperators.Multiset.Lemmas
+import Mathlib.Algebra.BigOperators.Multiset.Order
import Mathlib.Algebra.Function.Indicator
import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Finset.Powerset
RingHom.map_*
to _root_.map_*
(#11660)
Cherry-picked from #9607 Co-authored-by: @semorrison
@@ -2586,7 +2586,7 @@ theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
@[simp, norm_cast]
theorem cast_prod {R : Type*} [CommRing R] (f : α → ℤ) (s : Finset α) :
(↑(∏ i in s, f i) : R) = ∏ i in s, (f i : R) :=
- (Int.castRingHom R).map_prod _ _
+ map_prod (Int.castRingHom R) _ _
#align int.cast_prod Int.cast_prod
end Int
Finset.preimage
not depend on Finset.sum
(#11601)
and Data.Finset.LocallyFinite
not depend on Finset.sum
too
@@ -7,6 +7,7 @@ import Mathlib.Algebra.BigOperators.Multiset.Lemmas
import Mathlib.Algebra.Function.Indicator
import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Finset.Powerset
+import Mathlib.Data.Finset.Preimage
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Finset.Sum
import Mathlib.Data.Fintype.Pi
@@ -42,10 +43,7 @@ See the documentation of `to_additive.attr` for more information.
-/
-
-universe u v w
-
-variable {ι : Type*} {β : Type u} {α : Type v} {γ : Type w}
+variable {ι κ α β γ : Type*}
open Fin Function
@@ -141,7 +139,7 @@ to show the domain type when the product is over `Finset.univ`. -/
if s.isAppOfArity ``Finset.univ 2 then
let binder ←
if ppDomain then
- let ty ← withNaryArg 1 delab
+ let ty ← withNaryArg 0 delab
`(extBinder| $(.mk i):ident : $ty)
else
`(extBinder| $(.mk i):ident)
@@ -161,7 +159,7 @@ to show the domain type when the sum is over `Finset.univ`. -/
if s.isAppOfArity ``Finset.univ 2 then
let binder ←
if ppDomain then
- let ty ← withNaryArg 1 delab
+ let ty ← withNaryArg 0 delab
`(extBinder| $(.mk i):ident : $ty)
else
`(extBinder| $(.mk i):ident)
@@ -1072,6 +1070,32 @@ theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α)
#align finset.prod_subtype Finset.prod_subtype
#align finset.sum_subtype Finset.sum_subtype
+@[to_additive]
+lemma prod_preimage' (f : ι → κ) [DecidablePred (· ∈ Set.range f)] (s : Finset κ) (hf) (g : κ → β) :
+ ∏ x in s.preimage f hf, g (f x) = ∏ x in s.filter (· ∈ Set.range f), g x := by
+ classical
+ calc
+ ∏ x in preimage s f hf, g (f x) = ∏ x in image f (preimage s f hf), g x :=
+ Eq.symm <| prod_image <| by simpa only [mem_preimage, Set.InjOn] using hf
+ _ = ∏ x in s.filter fun x => x ∈ Set.range f, g x := by rw [image_preimage]
+#align finset.prod_preimage' Finset.prod_preimage'
+#align finset.sum_preimage' Finset.sum_preimage'
+
+@[to_additive]
+lemma prod_preimage (f : ι → κ) (s : Finset κ) (hf) (g : κ → β)
+ (hg : ∀ x ∈ s, x ∉ Set.range f → g x = 1) :
+ ∏ x in s.preimage f hf, g (f x) = ∏ x in s, g x := by
+ classical rw [prod_preimage', prod_filter_of_ne]; exact fun x hx ↦ Not.imp_symm (hg x hx)
+#align finset.prod_preimage Finset.prod_preimage
+#align finset.sum_preimage Finset.sum_preimage
+
+@[to_additive]
+lemma prod_preimage_of_bij (f : ι → κ) (s : Finset κ) (hf : Set.BijOn f (f ⁻¹' ↑s) ↑s) (g : κ → β) :
+ ∏ x in s.preimage f hf.injOn, g (f x) = ∏ x in s, g x :=
+ prod_preimage _ _ hf.injOn g fun _ hs h_f ↦ (h_f <| hf.subset_range hs).elim
+#align finset.prod_preimage_of_bij Finset.prod_preimage_of_bij
+#align finset.sum_preimage_of_bij Finset.sum_preimage_of_bij
+
@[to_additive]
theorem prod_set_coe (s : Set α) [Fintype s] : (∏ i : s, f i) = ∏ i in s.toFinset, f i :=
(Finset.prod_subtype s.toFinset (fun _ ↦ Set.mem_toFinset) f).symm
I removed some redundant instance arguments throughout Mathlib. To do this, I used VS Code's regex search. See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/repeating.20instances.20from.20variable.20command I closed the previous PR for this and reopened it.
@@ -2269,7 +2269,7 @@ lemma prod_of_injective (e : ι → κ) (he : Injective e) (f : ι → α) (g :
prod_of_injOn e (he.injOn _) (by simp) (by simpa using h') (fun i _ ↦ h i)
@[to_additive]
-lemma prod_fiberwise [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : ι → α) :
+lemma prod_fiberwise [DecidableEq κ] (g : ι → κ) (f : ι → α) :
∏ j, ∏ i : {i // g i = j}, f i = ∏ i, f i := by
rw [← Finset.prod_fiberwise _ g f]
congr with j
@@ -2278,7 +2278,7 @@ lemma prod_fiberwise [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : ι →
#align fintype.sum_fiberwise Fintype.sum_fiberwise
@[to_additive]
-lemma prod_fiberwise' [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : κ → α) :
+lemma prod_fiberwise' [DecidableEq κ] (g : ι → κ) (f : κ → α) :
∏ j, ∏ _i : {i // g i = j}, f j = ∏ i, f (g i) := by
rw [← Finset.prod_fiberwise' _ g f]
congr with j
mul
-div
cancellation lemmas (#11530)
Lemma names around cancellation of multiplication and division are a mess.
This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero
lemma name, the Group
lemma, the AddGroup
lemma name).
| Statement | New name | Old name | |
@@ -1632,7 +1632,7 @@ theorem prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
@[to_additive]
theorem eq_prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
- f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel'_right]
+ f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel]
#align finset.eq_prod_range_div Finset.eq_prod_range_div
#align finset.eq_sum_range_sub Finset.eq_sum_range_sub
@@ -2264,9 +2264,9 @@ lemma _root_.Equiv.prod_comp (e : ι ≃ κ) (g : κ → α) : ∏ i, g (e i) =
#align equiv.sum_comp Equiv.sum_comp
@[to_additive]
-lemma prod_of_injective (e : ι → κ) (hf : Injective e) (f : ι → α) (g : κ → α)
+lemma prod_of_injective (e : ι → κ) (he : Injective e) (f : ι → α) (g : κ → α)
(h' : ∀ i ∉ Set.range e, g i = 1) (h : ∀ i, f i = g (e i)) : ∏ i, f i = ∏ j, g j :=
- prod_of_injOn e (hf.injOn _) (by simp) (by simpa using h') (fun i _ ↦ h i)
+ prod_of_injOn e (he.injOn _) (by simp) (by simpa using h') (fun i _ ↦ h i)
@[to_additive]
lemma prod_fiberwise [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : ι → α) :
apply foo.mpr
by rw [foo]
(#11515)
Sometimes, that line can be golfed into the next line. Inspired by a comment of @loefflerd; any decisions are my own.
@@ -977,8 +977,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
apply not_or.mp
intro hab
apply hcs
- apply mem_insert.mpr
- rw [mem_singleton]
+ rw [mem_insert, mem_singleton]
exact hab
rw [← prod_subset hu hf]
exact Finset.prod_pair hn
@@ -2444,6 +2444,13 @@ theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a
_ = card s := by simp
#align multiset.to_finset_sum_count_eq Multiset.toFinset_sum_count_eq
+@[simp]
+theorem sum_count_eq [Fintype α] (s : Multiset α) : ∑ a, s.count a = Multiset.card s := by
+ rw [← toFinset_sum_count_eq, ← Finset.sum_filter_ne_zero]
+ congr
+ ext
+ simp
+
theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
count a (∑ x in s, f x) = ∑ x in s, count a (f x) := by
dsimp only [Finset.sum]
List → Multiset
(#11099)
These did not respect the naming convention by having the coe
as a prefix instead of a suffix, or vice-versa. Also add a bunch of norm_cast
@@ -438,7 +438,7 @@ section ToList
@[to_additive (attr := simp)]
theorem prod_to_list (s : Finset α) (f : α → β) : (s.toList.map f).prod = s.prod f := by
- rw [Finset.prod, ← Multiset.coe_prod, ← Multiset.coe_map, Finset.coe_toList]
+ rw [Finset.prod, ← Multiset.prod_coe, ← Multiset.map_coe, Finset.coe_toList]
#align finset.prod_to_list Finset.prod_to_list
#align finset.sum_to_list Finset.sum_to_list
@@ -1563,7 +1563,7 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
(hs : m.toFinset ⊆ s) : m.prod = ∏ i in s, i ^ m.count i := by
revert hs
refine' Quot.induction_on m fun l => _
- simp only [quot_mk_to_coe'', coe_prod, coe_count]
+ simp only [quot_mk_to_coe'', prod_coe, coe_count]
apply prod_list_count_of_subset l s
#align finset.prod_multiset_count_of_subset Finset.prod_multiset_count_of_subset
#align finset.sum_multiset_count_of_subset Finset.sum_multiset_count_of_subset
@@ -2371,7 +2371,7 @@ theorem disjoint_list_sum_right {a : Multiset α} {l : List (Multiset α)} :
theorem disjoint_sum_left {a : Multiset α} {i : Multiset (Multiset α)} :
Multiset.Disjoint i.sum a ↔ ∀ b ∈ i, Multiset.Disjoint b a :=
Quotient.inductionOn i fun l => by
- rw [quot_mk_to_coe, Multiset.coe_sum]
+ rw [quot_mk_to_coe, Multiset.sum_coe]
exact disjoint_list_sum_left
#align multiset.disjoint_sum_left Multiset.disjoint_sum_left
add (iterated) deriv for prod
HasFDerivAt
+ variants for Finset.prod
(and ContinuousMultilinearMap.mkPiAlgebra
)iteratedFDerivWithin
equivalents for zero, const (resolves a todo in Analysis.Calculus.ContDiff.Basic
)iteratedFDeriv[Within]_sum
for symmetrySym
and Finset.{prod,sum}
@@ -2322,15 +2322,21 @@ theorem prod_subtype_mul_prod_subtype {α β : Type*} [Fintype α] [CommMonoid
end Fintype
namespace Finset
-variable [Fintype ι] [CommMonoid α]
+variable [CommMonoid α]
@[to_additive (attr := simp)]
-lemma prod_attach_univ (f : {i // i ∈ @univ ι _} → α) :
+lemma prod_attach_univ [Fintype ι] (f : {i // i ∈ @univ ι _} → α) :
∏ i in univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩ :=
Fintype.prod_equiv (Equiv.subtypeUnivEquiv mem_univ) _ _ $ by simp
#align finset.prod_attach_univ Finset.prod_attach_univ
#align finset.sum_attach_univ Finset.sum_attach_univ
+@[to_additive]
+theorem prod_erase_attach [DecidableEq ι] {s : Finset ι} (f : ι → α) (i : ↑s) :
+ ∏ j in s.attach.erase i, f ↑j = ∏ j in s.erase ↑i, f j := by
+ rw [← Function.Embedding.coe_subtype, ← prod_map]
+ simp [attach_map_val]
+
end Finset
namespace List
@@ -2314,8 +2314,8 @@ theorem prod_subtype_mul_prod_subtype {α β : Type*} [Fintype α] [CommMonoid
let s := { x | p x }.toFinset
rw [← Finset.prod_subtype s, ← Finset.prod_subtype sᶜ]
· exact Finset.prod_mul_prod_compl _ _
- · simp
- · simp
+ · simp [s]
+ · simp [s]
#align fintype.prod_subtype_mul_prod_subtype Fintype.prod_subtype_mul_prod_subtype
#align fintype.sum_subtype_add_sum_subtype Fintype.sum_subtype_add_sum_subtype
@@ -2174,7 +2174,7 @@ theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
induction' s using Finset.induction_on with a s ha ih
· exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => by simp at H⟩
- · rw [prod_insert ha, mul_eq_zero, exists_mem_insert, ih, ← bex_def]
+ · rw [prod_insert ha, mul_eq_zero, exists_mem_insert, ih]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by
The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun
instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike
is EquivLike
, since that has a custom coe_injective'
field that is easier to implement. All other classes should take FunLike
or EquivLike
as a parameter.
Previously, morphism classes would be Type
-valued and extend FunLike
:
/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
extends FunLike F A B :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))
After this PR, they should be Prop
-valued and take FunLike
as a parameter:
/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
[FunLike F A B] : Prop :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))
(Note that A B
stay marked as outParam
even though they are not purely required to be so due to the FunLike
parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam
is slightly faster.)
Similarly, MyEquivClass
should take EquivLike
as a parameter.
As a result, every mention of [MyHomClass F A B]
should become [FunLike F A B] [MyHomClass F A B]
.
While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul
is more expensive. This is due to suboptimal processing of arguments. For example:
variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)
theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y
example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _
Before this PR, applying map_mul f
gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]
. Since M
and N
are out_param
s, [MulHomClass F ?M ?N]
is synthesized first, supplies values for ?M
and ?N
and then the Mul M
and Mul N
instances can be found.
After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]
. Now [FunLike F ?M ?N]
is synthesized first, supplies values for ?M
and ?N
and then the Mul M
and Mul N
instances can be found, before trying MulHomClass F M N
which fails. Since the Mul
hierarchy is very big, this can be slow to fail, especially when there is no such Mul
instance.
A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul
to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N]
because MulHomClass
fails or succeeds much faster than the others.
As a consequence, the simpNF
linter is much slower since by design it tries and fails to apply many map_
lemmas. The same issue occurs a few times in existing calls to simp [map_mul]
, where map_mul
is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.
simp
not firing sometimesThis affects map_smulₛₗ
and related definitions. For simp
lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw
can find every argument to map_smulₛₗ
successfully but simp
can't: leanprover/lean4#3701.
Especially in the category theory library, we might sometimes have a type A
which is also accessible as a synonym (Bundled A hA).1
. Instance synthesis doesn't always work if we have f : A →* B
but x * y : (Bundled A hA).1
or vice versa. This seems to be mostly fixed by keeping A B
as outParam
s in MulHomClass F A B
. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1
instead of using the syntax in the discrimination tree.)
The timeouts can be worked around for now by specifying which map_mul
we mean, either as map_mul f
for some explicit f
, or as e.g. MonoidHomClass.map_mul
.
map_smulₛₗ
not firing as simp
lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulₛₗ
a simp
lemma instead of the generic map_smulₛₗ
. Writing simp [map_smulₛₗ _]
also works.
Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@@ -206,8 +206,8 @@ theorem sum_multiset_singleton (s : Finset α) : (s.sum fun x => {x}) = s.val :=
end Finset
@[to_additive (attr := simp)]
-theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [MonoidHomClass G β γ] (g : G)
- (f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
+theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [FunLike G β γ] [MonoidHomClass G β γ]
+ (g : G) (f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
simp only [Finset.prod_eq_multiset_prod, map_multiset_prod, Multiset.map_map]; rfl
#align map_prod map_prod
#align map_sum map_sum
@@ -11,6 +11,7 @@ import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Finset.Sum
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Int.Cast.Lemmas
+import Mathlib.Data.Set.Image
#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
@@ -5,16 +5,12 @@ Authors: Johannes Hölzl
-/
import Mathlib.Algebra.BigOperators.Multiset.Lemmas
import Mathlib.Algebra.Function.Indicator
-import Mathlib.Algebra.Group.Equiv.Basic
-import Mathlib.Algebra.Group.Pi
-import Mathlib.Algebra.GroupPower.Lemmas
import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Finset.Powerset
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Finset.Sum
import Mathlib.Data.Fintype.Pi
-import Mathlib.Data.Multiset.Powerset
-import Mathlib.Data.Set.Pairwise.Basic
+import Mathlib.Data.Int.Cast.Lemmas
#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
A bunch of lemmas in Algebra.BigOperators.Ring
were not about rings. This PR moves them along with some lemmas from Data.Fintype.BigOperators
to their correct place.
I create a new file with the content from #6605 to avoid importing Fin
material in finset files as a result.
From LeanAPAP
@@ -12,7 +12,7 @@ import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Finset.Powerset
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Finset.Sum
-import Mathlib.Data.Fintype.Basic
+import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Multiset.Powerset
import Mathlib.Data.Set.Pairwise.Basic
@@ -375,6 +375,12 @@ theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) :
#align finset.prod_map Finset.prod_map
#align finset.sum_map Finset.sum_map
+@[to_additive]
+lemma prod_attach (s : Finset α) (f : α → β) : ∏ x in s.attach, f x = ∏ x in s, f x := by
+ classical rw [← prod_image $ Subtype.coe_injective.injOn _, attach_image_val]
+#align finset.prod_attach Finset.prod_attach
+#align finset.sum_attach Finset.sum_attach
+
@[to_additive (attr := congr)]
theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.prod f = s₂.prod g := by
rw [h]; exact fold_congr
@@ -457,6 +463,40 @@ theorem _root_.Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f :
#align equiv.perm.prod_comp' Equiv.Perm.prod_comp'
#align equiv.perm.sum_comp' Equiv.Perm.sum_comp'
+/-- A product over all subsets of `s ∪ {x}` is obtained by multiplying the product over all subsets
+of `s`, and over all subsets of `s` to which one adds `x`. -/
+@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
+of `s`, and over all subsets of `s` to which one adds `x`."]
+lemma prod_powerset_insert [DecidableEq α] (ha : a ∉ s) (f : Finset α → β) :
+ ∏ t in (insert a s).powerset, f t =
+ (∏ t in s.powerset, f t) * ∏ t in s.powerset, f (insert a t) := by
+ rw [powerset_insert, prod_union, prod_image]
+ · exact insert_erase_invOn.2.injOn.mono fun t ht ↦ not_mem_mono (mem_powerset.1 ht) ha
+ · aesop (add simp [disjoint_left, insert_subset_iff])
+#align finset.prod_powerset_insert Finset.prod_powerset_insert
+#align finset.sum_powerset_insert Finset.sum_powerset_insert
+
+/-- A product over all subsets of `s ∪ {x}` is obtained by multiplying the product over all subsets
+of `s`, and over all subsets of `s` to which one adds `x`. -/
+@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
+of `s`, and over all subsets of `s` to which one adds `x`."]
+lemma prod_powerset_cons (ha : a ∉ s) (f : Finset α → β) :
+ ∏ t in (s.cons a ha).powerset, f t = (∏ t in s.powerset, f t) *
+ ∏ t in s.powerset.attach, f (cons a t $ not_mem_mono (mem_powerset.1 t.2) ha) := by
+ classical
+ simp_rw [cons_eq_insert]
+ rw [prod_powerset_insert ha, prod_attach _ fun t ↦ f (insert a t)]
+
+/-- A product over `powerset s` is equal to the double product over sets of subsets of `s` with
+`card s = k`, for `k = 1, ..., card s`. -/
+@[to_additive "A sum over `powerset s` is equal to the double sum over sets of subsets of `s` with
+ `card s = k`, for `k = 1, ..., card s`"]
+lemma prod_powerset (s : Finset α) (f : Finset α → β) :
+ ∏ t in powerset s, f t = ∏ j in range (card s + 1), ∏ t in powersetCard j s, f t := by
+ rw [powerset_card_disjiUnion, prod_disjiUnion]
+#align finset.prod_powerset Finset.prod_powerset
+#align finset.sum_powerset Finset.sum_powerset
+
end CommMonoid
end Finset
@@ -717,6 +757,21 @@ lemma prod_fiberwise' (s : Finset ι) (g : ι → κ) (f : κ → α) :
end bij
+/-- Taking a product over `univ.pi t` is the same as taking the product over `Fintype.piFinset t`.
+`univ.pi t` and `Fintype.piFinset t` are essentially the same `Finset`, but differ
+in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ, t a)` and
+`Fintype.piFinset t` is a `Finset (Π a, t a)`. -/
+@[to_additive "Taking a sum over `univ.pi t` is the same as taking the sum over
+`Fintype.piFinset t`. `univ.pi t` and `Fintype.piFinset t` are essentially the same `Finset`,
+but differ in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ, t a)` and
+`Fintype.piFinset t` is a `Finset (Π a, t a)`."]
+lemma prod_univ_pi [DecidableEq ι] [Fintype ι] {κ : ι → Type*} (t : ∀ i, Finset (κ i))
+ (f : (∀ i ∈ (univ : Finset ι), κ i) → β) :
+ ∏ x in univ.pi t, f x = ∏ x in Fintype.piFinset t, f fun a _ ↦ x a := by
+ apply prod_nbij' (fun x i ↦ x i $ mem_univ _) (fun x i _ ↦ x i) <;> simp
+#align finset.prod_univ_pi Finset.prod_univ_pi
+#align finset.sum_univ_pi Finset.sum_univ_pi
+
@[to_additive (attr := simp)]
lemma prod_diag [DecidableEq α] (s : Finset α) (f : α × α → β) :
∏ i in s.diag, f i = ∏ i in s, f (i, i) := by
@@ -954,16 +1009,6 @@ theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
#align finset.prod_eq_mul Finset.prod_eq_mul
#align finset.sum_eq_add Finset.sum_eq_add
-@[to_additive]
-theorem prod_attach (s : Finset α) (f : α → β) : ∏ x in s.attach, f x = ∏ x in s, f x :=
- haveI := Classical.decEq α
- calc
- ∏ x in s.attach, f x.val = ∏ x in s.attach.image Subtype.val, f x := by
- { rw [prod_image]; exact fun x _ y _ => Subtype.eq }
- _ = _ := by rw [attach_image_val]
-#align finset.prod_attach Finset.prod_attach
-#align finset.sum_attach Finset.sum_attach
-
-- Porting note: simpNF linter complains that LHS doesn't simplify, but it does
/-- A product over `s.subtype p` equals one over `s.filter p`. -/
@[to_additive (attr := simp, nolint simpNF)
@@ -1650,6 +1695,12 @@ theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x in s, f x ^ n
#align finset.prod_pow Finset.prod_pow
#align finset.sum_nsmul Finset.sum_nsmul
+@[to_additive sum_nsmul_assoc]
+lemma prod_pow_eq_pow_sum (s : Finset ι) (f : ι → ℕ) (a : β) :
+ ∏ i in s, a ^ f i = a ^ ∑ i in s, f i :=
+ cons_induction (by simp) (fun _ _ _ _ ↦ by simp [prod_cons, sum_cons, pow_add, *]) s
+#align finset.prod_pow_eq_pow_sum Finset.prod_pow_eq_pow_sum
+
/-- A product over `Finset.powersetCard` which only depends on the size of the sets is constant. -/
@[to_additive
"A sum over `Finset.powersetCard` which only depends on the size of the sets is constant."]
@@ -2273,6 +2324,18 @@ theorem prod_subtype_mul_prod_subtype {α β : Type*} [Fintype α] [CommMonoid
end Fintype
+namespace Finset
+variable [Fintype ι] [CommMonoid α]
+
+@[to_additive (attr := simp)]
+lemma prod_attach_univ (f : {i // i ∈ @univ ι _} → α) :
+ ∏ i in univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩ :=
+ Fintype.prod_equiv (Equiv.subtypeUnivEquiv mem_univ) _ _ $ by simp
+#align finset.prod_attach_univ Finset.prod_attach_univ
+#align finset.sum_attach_univ Finset.sum_attach_univ
+
+end Finset
+
namespace List
@[to_additive]
$
with <|
(#9319)
See Zulip thread for the discussion.
@@ -681,8 +681,8 @@ lemma prod_of_injOn (e : ι → κ) (he : Set.InjOn e s) (hest : Set.MapsTo e s
(h' : ∀ i ∈ t, i ∉ e '' s → g i = 1) (h : ∀ i ∈ s, f i = g (e i)) :
∏ i in s, f i = ∏ j in t, g j := by
classical
- exact (prod_nbij e (fun a ↦ mem_image_of_mem e) he (by simp [Set.surjOn_image]) h).trans $
- prod_subset (image_subset_iff.2 hest) $ by simpa using h'
+ exact (prod_nbij e (fun a ↦ mem_image_of_mem e) he (by simp [Set.surjOn_image]) h).trans <|
+ prod_subset (image_subset_iff.2 hest) <| by simpa using h'
variable [DecidableEq κ]
@@ -904,7 +904,7 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
@[to_additive]
lemma prod_union_eq_left [DecidableEq α] (hs : ∀ a ∈ s₂, a ∉ s₁ → f a = 1) :
∏ a in s₁ ∪ s₂, f a = ∏ a in s₁, f a :=
- Eq.symm $
+ Eq.symm <|
prod_subset (subset_union_left _ _) fun _a ha ha' ↦ hs _ ((mem_union.1 ha).resolve_left ha') ha'
@[to_additive]
@@ -1058,21 +1058,21 @@ theorem prod_congr_set {α : Type*} [CommMonoid α] {β : Type*} [Fintype β] (s
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
[DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
(∏ x in s, h (if hx : p x then f x hx else g x hx)) =
- (∏ x in (s.filter p).attach, h (f x.1 $ by simpa using (mem_filter.mp x.2).2)) *
- ∏ x in (s.filter fun x => ¬p x).attach, h (g x.1 $ by simpa using (mem_filter.mp x.2).2) :=
+ (∏ x in (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
+ ∏ x in (s.filter fun x => ¬p x).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2) :=
calc
(∏ x in s, h (if hx : p x then f x hx else g x hx)) =
(∏ x in s.filter p, h (if hx : p x then f x hx else g x hx)) *
- ∏ x in s.filter fun x => ¬p x, h (if hx : p x then f x hx else g x hx) :=
+ ∏ x in s.filter (¬p ·), h (if hx : p x then f x hx else g x hx) :=
(prod_filter_mul_prod_filter_not s p _).symm
_ = (∏ x in (s.filter p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
- ∏ x in (s.filter fun x => ¬p x).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
+ ∏ x in (s.filter (¬p ·)).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
congr_arg₂ _ (prod_attach _ _).symm (prod_attach _ _).symm
- _ = (∏ x in (s.filter p).attach, h (f x.1 $ by simpa using (mem_filter.mp x.2).2)) *
- ∏ x in (s.filter fun x ↦ ¬p x).attach, h (g x.1 $ by simpa using (mem_filter.mp x.2).2) :=
+ _ = (∏ x in (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
+ ∏ x in (s.filter (¬p ·)).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2) :=
congr_arg₂ _ (prod_congr rfl fun x _hx ↦
- congr_arg h (dif_pos $ by simpa using (mem_filter.mp x.2).2))
- (prod_congr rfl fun x _hx => congr_arg h (dif_neg $ by simpa using (mem_filter.mp x.2).2))
+ congr_arg h (dif_pos <| by simpa using (mem_filter.mp x.2).2))
+ (prod_congr rfl fun x _hx => congr_arg h (dif_neg <| by simpa using (mem_filter.mp x.2).2))
#align finset.prod_apply_dite Finset.prod_apply_dite
#align finset.sum_apply_dite Finset.sum_apply_dite
@@ -1081,7 +1081,7 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {_hp : DecidablePred p}
(h : γ → β) :
(∏ x in s, h (if p x then f x else g x)) =
(∏ x in s.filter p, h (f x)) * ∏ x in s.filter fun x => ¬p x, h (g x) :=
- (prod_apply_dite _ _ _).trans $ congr_arg₂ _ (prod_attach _ (h ∘ f)) (prod_attach _ (h ∘ g))
+ (prod_apply_dite _ _ _).trans <| congr_arg₂ _ (prod_attach _ (h ∘ f)) (prod_attach _ (h ∘ g))
#align finset.prod_apply_ite Finset.prod_apply_ite
#align finset.sum_apply_ite Finset.sum_apply_ite
@@ -1269,7 +1269,7 @@ lemma prod_mulIndicator_subset_of_eq_one [One α] (f : ι → α) (g : ι → α
calc
_ = ∏ i in s, g i (mulIndicator ↑s f i) := by rw [prod_subset h fun i _ hn ↦ by simp [hn, hg]]
-- Porting note: This did not use to need the implicit argument
- _ = _ := prod_congr rfl fun i hi ↦ congr_arg _ $ mulIndicator_of_mem (α := ι) hi f
+ _ = _ := prod_congr rfl fun i hi ↦ congr_arg _ <| mulIndicator_of_mem (α := ι) hi f
#align set.prod_mul_indicator_subset_of_eq_one Finset.prod_mulIndicator_subset_of_eq_one
#align set.sum_indicator_subset_of_eq_zero Finset.sum_indicator_subset_of_eq_zero
@@ -1287,7 +1287,7 @@ lemma prod_mulIndicator_subset (f : ι → β) {s t : Finset ι} (h : s ⊆ t) :
lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t : ι → Set κ) (g : ι → κ)
[DecidablePred fun i ↦ g i ∈ t i] :
∏ i in s, mulIndicator (t i) (f i) (g i) = ∏ i in s.filter fun i ↦ g i ∈ t i, f i (g i) := by
- refine (prod_filter_mul_prod_filter_not s (fun i ↦ g i ∈ t i) _).symm.trans $
+ refine (prod_filter_mul_prod_filter_not s (fun i ↦ g i ∈ t i) _).symm.trans <|
Eq.trans (congr_arg₂ (· * ·) ?_ ?_) (mul_one _)
· exact prod_congr rfl fun x hx ↦ mulIndicator_of_mem (mem_filter.1 hx).2 _
· exact prod_eq_one fun x hx ↦ mulIndicator_of_not_mem (mem_filter.1 hx).2 _
@@ -1314,9 +1314,9 @@ lemma mulIndicator_biUnion (s : Finset ι) (t : ι → Set κ) {f : κ → β} :
classical
refine Finset.induction_on s (by simp) fun i s hi ih hs ↦ funext fun j ↦ ?_
rw [prod_insert hi, set_biUnion_insert, mulIndicator_union_of_not_mem_inter,
- ih (hs.subset $ subset_insert _ _)]
+ ih (hs.subset <| subset_insert _ _)]
simp only [not_exists, exists_prop, mem_iUnion, mem_inter_iff, not_and]
- exact fun hji i' hi' hji' ↦ (ne_of_mem_of_not_mem hi' hi).symm $
+ exact fun hji i' hi' hji' ↦ (ne_of_mem_of_not_mem hi' hi).symm <|
hs.elim_set (mem_insert_self _ _) (mem_insert_of_mem hi') _ hji hji'
#align set.mul_indicator_finset_bUnion Finset.mulIndicator_biUnion
#align set.indicator_finset_bUnion Finset.indicator_biUnion
@@ -1341,7 +1341,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
calc
∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := by rw [prod_filter_ne_one]
_ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
- prod_bij (fun a ha => i a (mem_filter.mp ha).1 $ by simpa using (mem_filter.mp ha).2)
+ prod_bij (fun a ha => i a (mem_filter.mp ha).1 <| by simpa using (mem_filter.mp ha).2)
?_ ?_ ?_ ?_
_ = ∏ x in t, g x := prod_filter_ne_one _
· intros a ha
@@ -1872,7 +1872,7 @@ theorem prod_ite_one (s : Finset α) (p : α → Prop) [DecidablePred p]
split_ifs with h
· obtain ⟨i, hi, hpi⟩ := h
rw [prod_eq_single_of_mem _ hi, if_pos hpi]
- exact fun j hj hji ↦ if_neg fun hpj ↦ hji $ h _ hj _ hi hpj hpi
+ exact fun j hj hji ↦ if_neg fun hpj ↦ hji <| h _ hj _ hi hpj hpi
· push_neg at h
rw [prod_eq_one]
exact fun i hi => if_neg (h i hi)
@@ -1917,8 +1917,8 @@ theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈
classical
induction' S using Finset.induction_on' with a T _haS _hTS haT IH
· simp
- rw [Finset.prod_insert haT, Finset.prod_insert haT]
- exact mul_dvd_mul (h a $ T.mem_insert_self a) (IH fun b hb ↦ h b $ Finset.mem_insert_of_mem hb)
+ · rw [Finset.prod_insert haT, prod_insert haT]
+ exact mul_dvd_mul (h a <| T.mem_insert_self a) <| IH fun b hb ↦ h b <| mem_insert_of_mem hb
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι) (f : ι → M)
@@ -2117,7 +2117,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
lemma support_prod_subset (s : Finset ι) (f : ι → α → β) :
support (fun x ↦ ∏ i in s, f i x) ⊆ ⋂ i ∈ s, support (f i) :=
- fun _ hx ↦ Set.mem_iInter₂.2 fun _ hi H ↦ hx $ prod_eq_zero hi H
+ fun _ hx ↦ Set.mem_iInter₂.2 fun _ hi H ↦ hx <| prod_eq_zero hi H
#align function.support_prod_subset Finset.support_prod_subset
variable [Nontrivial β] [NoZeroDivisors β]
@@ -381,6 +381,14 @@ theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.prod
#align finset.prod_congr Finset.prod_congr
#align finset.sum_congr Finset.sum_congr
+@[to_additive]
+theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x in s, f x = 1 :=
+ calc
+ ∏ x in s, f x = ∏ _x in s, 1 := Finset.prod_congr rfl h
+ _ = 1 := Finset.prod_const_one
+#align finset.prod_eq_one Finset.prod_eq_one
+#align finset.sum_eq_zero Finset.sum_eq_zero
+
@[to_additive]
theorem prod_disjUnion (h) :
∏ x in s₁.disjUnion s₂ h, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
@@ -499,6 +507,22 @@ theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
#align finset.prod_sdiff Finset.prod_sdiff
#align finset.sum_sdiff Finset.sum_sdiff
+@[to_additive]
+theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
+ (hfg : ∀ x ∈ s₁, f x = g x) : ∏ i in s₁, f i = ∏ i in s₂, g i := by
+ rw [← prod_sdiff h, prod_eq_one hg, one_mul]
+ exact prod_congr rfl hfg
+#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiff
+#align finset.sum_subset_zero_on_sdiff Finset.sum_subset_zero_on_sdiff
+
+@[to_additive]
+theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
+ ∏ x in s₁, f x = ∏ x in s₂, f x :=
+ haveI := Classical.decEq α
+ prod_subset_one_on_sdiff h (by simpa) fun _ _ => rfl
+#align finset.prod_subset Finset.prod_subset
+#align finset.sum_subset Finset.sum_subset
+
@[to_additive (attr := simp)]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
∏ x in s.disjSum t, f x = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) := by
@@ -652,6 +676,14 @@ lemma prod_bijective (e : ι → κ) (he : e.Bijective) (hst : ∀ i, i ∈ s
(hfg : ∀ i ∈ s, f i = g (e i)) :
∏ i in s, f i = ∏ i in t, g i := prod_equiv (.ofBijective e he) hst hfg
+@[to_additive]
+lemma prod_of_injOn (e : ι → κ) (he : Set.InjOn e s) (hest : Set.MapsTo e s t)
+ (h' : ∀ i ∈ t, i ∉ e '' s → g i = 1) (h : ∀ i ∈ s, f i = g (e i)) :
+ ∏ i in s, f i = ∏ j in t, g j := by
+ classical
+ exact (prod_nbij e (fun a ↦ mem_image_of_mem e) he (by simp [Set.surjOn_image]) h).trans $
+ prod_subset (image_subset_iff.2 hest) $ by simpa using h'
+
variable [DecidableEq κ]
@[to_additive]
@@ -813,30 +845,6 @@ theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g
#align finset.prod_hom_rel Finset.prod_hom_rel
#align finset.sum_hom_rel Finset.sum_hom_rel
-@[to_additive]
-theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x in s, f x = 1 :=
- calc
- ∏ x in s, f x = ∏ _x in s, 1 := Finset.prod_congr rfl h
- _ = 1 := Finset.prod_const_one
-#align finset.prod_eq_one Finset.prod_eq_one
-#align finset.sum_eq_zero Finset.sum_eq_zero
-
-@[to_additive]
-theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
- (hfg : ∀ x ∈ s₁, f x = g x) : ∏ i in s₁, f i = ∏ i in s₂, g i := by
- rw [← prod_sdiff h, prod_eq_one hg, one_mul]
- exact prod_congr rfl hfg
-#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiff
-#align finset.sum_subset_zero_on_sdiff Finset.sum_subset_zero_on_sdiff
-
-@[to_additive]
-theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
- ∏ x in s₁, f x = ∏ x in s₂, f x :=
- haveI := Classical.decEq α
- prod_subset_one_on_sdiff h (by simpa) fun _ _ => rfl
-#align finset.prod_subset Finset.prod_subset
-#align finset.sum_subset Finset.sum_subset
-
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
∏ x in s.filter p, f x = ∏ x in s, f x :=
@@ -2208,6 +2216,11 @@ lemma _root_.Equiv.prod_comp (e : ι ≃ κ) (g : κ → α) : ∏ i, g (e i) =
#align equiv.prod_comp Equiv.prod_comp
#align equiv.sum_comp Equiv.sum_comp
+@[to_additive]
+lemma prod_of_injective (e : ι → κ) (hf : Injective e) (f : ι → α) (g : κ → α)
+ (h' : ∀ i ∉ Set.range e, g i = 1) (h : ∀ i, f i = g (e i)) : ∏ i, f i = ∏ j, g j :=
+ prod_of_injOn e (hf.injOn _) (by simp) (by simpa using h') (fun i _ ↦ h i)
+
@[to_additive]
lemma prod_fiberwise [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : ι → α) :
∏ j, ∏ i : {i // g i = j}, f i = ∏ i, f i := by
@@ -666,7 +666,7 @@ lemma prod_fiberwise_of_maps_to' {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f
∏ j in t, ∏ _i in s.filter fun i ↦ g i = j, f j = ∏ i in s, f (g i) := by
calc
_ = ∏ y in t, ∏ x in s.filter fun x ↦ g x = y, f (g x) :=
- prod_congr rfl $ fun y _ ↦ prod_congr rfl fun x hx ↦ by rw [(mem_filter.1 hx).2]
+ prod_congr rfl fun y _ ↦ prod_congr rfl fun x hx ↦ by rw [(mem_filter.1 hx).2]
_ = _ := prod_fiberwise_of_maps_to h _
variable [Fintype κ]
Lemmas around this were a mess, throth in terms of names, statement and location. This PR standardises everything to be in Algebra.BigOperators.Basic
and changes the lemmas to take in InjOn
and SurjOn
assumptions where possible (and where impossible make sure the hypotheses are taken in the correct order) and moves the equality of functions hypothesis last.
Also add a few lemmas that help fix downstream uses by golfing.
From LeanAPAP and LeanCamCombi
@@ -537,73 +537,165 @@ theorem prod_sigma' {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a
#align finset.prod_sigma' Finset.prod_sigma'
#align finset.sum_sigma' Finset.sum_sigma'
+section bij
+variable {ι κ α : Type*} [CommMonoid α] {s : Finset ι} {t : Finset κ} {f : ι → α} {g : κ → α}
+
/-- Reorder a product.
- The difference with `prod_bij'` is that the bijection is specified as a surjective injection,
- rather than by an inverse function.
--/
+The difference with `Finset.prod_bij'` is that the bijection is specified as a surjective injection,
+rather than by an inverse function.
+
+The difference with `Finset.prod_nbij` is that the bijection is allowed to use membership of the
+domain of the product, rather than being a non-dependent function. -/
@[to_additive "Reorder a sum.
- The difference with `sum_bij'` is that the bijection is specified as a surjective injection,
- rather than by an inverse function."]
-theorem prod_bij {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β} (i : ∀ a ∈ s, γ)
- (hi : ∀ a ha, i a ha ∈ t) (h : ∀ a ha, f a = g (i a ha))
- (i_inj : ∀ a₁ a₂ ha₁ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
- (i_surj : ∀ b ∈ t, ∃ a ha, b = i a ha) : ∏ x in s, f x = ∏ x in t, g x :=
- congr_arg Multiset.prod (Multiset.map_eq_map_of_bij_of_nodup f g s.2 t.2 i hi h i_inj i_surj)
+The difference with `Finset.sum_bij'` is that the bijection is specified as a surjective injection,
+rather than by an inverse function.
+
+The difference with `Finset.sum_nbij` is that the bijection is allowed to use membership of the
+domain of the sum, rather than being a non-dependent function."]
+theorem prod_bij (i : ∀ a ∈ s, κ) (hi : ∀ a ha, i a ha ∈ t)
+ (i_inj : ∀ a₁ ha₁ a₂ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
+ (i_surj : ∀ b ∈ t, ∃ a ha, i a ha = b) (h : ∀ a ha, f a = g (i a ha)) :
+ ∏ x in s, f x = ∏ x in t, g x :=
+ congr_arg Multiset.prod (Multiset.map_eq_map_of_bij_of_nodup f g s.2 t.2 i hi i_inj i_surj h)
#align finset.prod_bij Finset.prod_bij
#align finset.sum_bij Finset.sum_bij
/-- Reorder a product.
- The difference with `prod_bij` is that the bijection is specified with an inverse, rather than
- as a surjective injection.
--/
+The difference with `Finset.prod_bij` is that the bijection is specified with an inverse, rather
+than as a surjective injection.
+
+The difference with `Finset.prod_nbij'` is that the bijection and its inverse are allowed to use
+membership of the domains of the products, rather than being non-dependent functions. -/
@[to_additive "Reorder a sum.
- The difference with `sum_bij` is that the bijection is specified with an inverse, rather than
- as a surjective injection."]
-theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β} (i : ∀ a ∈ s, γ)
- (hi : ∀ a ha, i a ha ∈ t) (h : ∀ a ha, f a = g (i a ha)) (j : ∀ a ∈ t, α)
+The difference with `Finset.sum_bij` is that the bijection is specified with an inverse, rather than
+as a surjective injection.
+
+The difference with `Finset.sum_nbij'` is that the bijection and its inverse are allowed to use
+membership of the domains of the sums, rather than being non-dependent functions."]
+theorem prod_bij' (i : ∀ a ∈ s, κ) (j : ∀ a ∈ t, ι) (hi : ∀ a ha, i a ha ∈ t)
(hj : ∀ a ha, j a ha ∈ s) (left_inv : ∀ a ha, j (i a ha) (hi a ha) = a)
- (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) : ∏ x in s, f x = ∏ x in t, g x := by
- refine' prod_bij i hi h _ _
- · intro a1 a2 h1 h2 eq
- rw [← left_inv a1 h1, ← left_inv a2 h2]
- simp only [eq]
- · intro b hb
- use j b hb
- use hj b hb
- exact (right_inv b hb).symm
+ (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) (h : ∀ a ha, f a = g (i a ha)) :
+ ∏ x in s, f x = ∏ x in t, g x := by
+ refine prod_bij i hi (fun a1 h1 a2 h2 eq ↦ ?_) (fun b hb ↦ ⟨_, hj b hb, right_inv b hb⟩) h
+ rw [← left_inv a1 h1, ← left_inv a2 h2]
+ simp only [eq]
#align finset.prod_bij' Finset.prod_bij'
#align finset.sum_bij' Finset.sum_bij'
-/-- Reindexing a product over a finset along an equivalence.
-See `Equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
-@[to_additive " Reindexing a sum over a finset along an equivalence.
-See `Equiv.sum_comp` for the version where `s` and `s'` are `univ`. "]
-theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι' → β) {s' : Finset ι'}
- {s : Finset ι} (h : s = s'.image e.symm) : ∏ i' in s', f i' = ∏ i in s, f (e i) := by
- rw [h]
- refine'
- Finset.prod_bij' (fun i' _hi' => e.symm i') (fun a ha => Finset.mem_image_of_mem _ ha)
- (fun a _ha => by simp_rw [e.apply_symm_apply]) (fun i _hi => e i) (fun a ha => _)
- (fun a _ha => e.apply_symm_apply a) fun a _ha => e.symm_apply_apply a
- rcases Finset.mem_image.mp ha with ⟨i', hi', rfl⟩
- dsimp only
- rwa [e.apply_symm_apply]
-#align finset.equiv.prod_comp_finset Finset.Equiv.prod_comp_finset
-#align finset.equiv.sum_comp_finset Finset.Equiv.sum_comp_finset
+/-- Reorder a product.
+
+The difference with `Finset.prod_nbij'` is that the bijection is specified as a surjective
+injection, rather than by an inverse function.
+
+The difference with `Finset.prod_bij` is that the bijection is a non-dependent function, rather than
+being allowed to use membership of the domain of the product. -/
+@[to_additive "Reorder a sum.
+
+The difference with `Finset.sum_nbij'` is that the bijection is specified as a surjective injection,
+rather than by an inverse function.
+
+The difference with `Finset.sum_bij` is that the bijection is a non-dependent function, rather than
+being allowed to use membership of the domain of the sum."]
+lemma prod_nbij (i : ι → κ) (hi : ∀ a ∈ s, i a ∈ t) (i_inj : (s : Set ι).InjOn i)
+ (i_surj : (s : Set ι).SurjOn i t) (h : ∀ a ∈ s, f a = g (i a)) :
+ ∏ x in s, f x = ∏ x in t, g x :=
+ prod_bij (fun a _ ↦ i a) hi i_inj (by simpa using i_surj) h
+
+/-- Reorder a product.
+
+The difference with `Finset.prod_nbij` is that the bijection is specified with an inverse, rather
+than as a surjective injection.
+
+The difference with `Finset.prod_bij'` is that the bijection and its inverse are non-dependent
+functions, rather than being allowed to use membership of the domains of the products.
+
+The difference with `Finset.prod_equiv` is that bijectivity is only required to hold on the domains
+of the products, rather than on the entire types.
+-/
+@[to_additive "Reorder a sum.
+
+The difference with `Finset.sum_nbij` is that the bijection is specified with an inverse, rather
+than as a surjective injection.
+
+The difference with `Finset.sum_bij'` is that the bijection and its inverse are non-dependent
+functions, rather than being allowed to use membership of the domains of the sums.
+
+The difference with `Finset.sum_equiv` is that bijectivity is only required to hold on the domains
+of the sums, rather than on the entire types."]
+lemma prod_nbij' (i : ι → κ) (j : κ → ι) (hi : ∀ a ∈ s, i a ∈ t) (hj : ∀ a ∈ t, j a ∈ s)
+ (left_inv : ∀ a ∈ s, j (i a) = a) (right_inv : ∀ a ∈ t, i (j a) = a)
+ (h : ∀ a ∈ s, f a = g (i a)) : ∏ x in s, f x = ∏ x in t, g x :=
+ prod_bij' (fun a _ ↦ i a) (fun b _ ↦ j b) hi hj left_inv right_inv h
+
+/-- Specialization of `Finset.prod_nbij'` that automatically fills in most arguments.
+
+See `Fintype.prod_equiv` for the version where `s` and `t` are `univ`. -/
+@[to_additive "`Specialization of `Finset.sum_nbij'` that automatically fills in most arguments.
+
+See `Fintype.sum_equiv` for the version where `s` and `t` are `univ`."]
+lemma prod_equiv (e : ι ≃ κ) (hst : ∀ i, i ∈ s ↔ e i ∈ t) (hfg : ∀ i ∈ s, f i = g (e i)) :
+ ∏ i in s, f i = ∏ i in t, g i := by refine prod_nbij' e e.symm ?_ ?_ ?_ ?_ hfg <;> simp [hst]
+#align finset.equiv.prod_comp_finset Finset.prod_equiv
+#align finset.equiv.sum_comp_finset Finset.sum_equiv
+
+/-- Specialization of `Finset.prod_bij` that automatically fills in most arguments.
+
+See `Fintype.prod_bijective` for the version where `s` and `t` are `univ`. -/
+@[to_additive "`Specialization of `Finset.sum_bij` that automatically fills in most arguments.
+
+See `Fintype.sum_bijective` for the version where `s` and `t` are `univ`."]
+lemma prod_bijective (e : ι → κ) (he : e.Bijective) (hst : ∀ i, i ∈ s ↔ e i ∈ t)
+ (hfg : ∀ i ∈ s, f i = g (e i)) :
+ ∏ i in s, f i = ∏ i in t, g i := prod_equiv (.ofBijective e he) hst hfg
+
+variable [DecidableEq κ]
+
+@[to_additive]
+lemma prod_fiberwise_of_maps_to {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : ι → α) :
+ ∏ j in t, ∏ i in s.filter fun i ↦ g i = j, f i = ∏ i in s, f i := by
+ rw [← prod_disjiUnion, disjiUnion_filter_eq_of_maps_to h]
+#align finset.prod_fiberwise_of_maps_to Finset.prod_fiberwise_of_maps_to
+#align finset.sum_fiberwise_of_maps_to Finset.sum_fiberwise_of_maps_to
+
+@[to_additive]
+lemma prod_fiberwise_of_maps_to' {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : κ → α) :
+ ∏ j in t, ∏ _i in s.filter fun i ↦ g i = j, f j = ∏ i in s, f (g i) := by
+ calc
+ _ = ∏ y in t, ∏ x in s.filter fun x ↦ g x = y, f (g x) :=
+ prod_congr rfl $ fun y _ ↦ prod_congr rfl fun x hx ↦ by rw [(mem_filter.1 hx).2]
+ _ = _ := prod_fiberwise_of_maps_to h _
+
+variable [Fintype κ]
+
+@[to_additive]
+lemma prod_fiberwise (s : Finset ι) (g : ι → κ) (f : ι → α) :
+ ∏ j, ∏ i in s.filter fun i ↦ g i = j, f i = ∏ i in s, f i :=
+ prod_fiberwise_of_maps_to (fun _ _ ↦ mem_univ _) _
+#align finset.prod_fiberwise Finset.prod_fiberwise
+#align finset.sum_fiberwise Finset.sum_fiberwise
+
+@[to_additive]
+lemma prod_fiberwise' (s : Finset ι) (g : ι → κ) (f : κ → α) :
+ ∏ j, ∏ _i in s.filter fun i ↦ g i = j, f j = ∏ i in s, f (g i) :=
+ prod_fiberwise_of_maps_to' (fun _ _ ↦ mem_univ _) _
+
+end bij
+
+@[to_additive (attr := simp)]
+lemma prod_diag [DecidableEq α] (s : Finset α) (f : α × α → β) :
+ ∏ i in s.diag, f i = ∏ i in s, f (i, i) := by
+ apply prod_nbij' Prod.fst (fun i ↦ (i, i)) <;> simp
@[to_additive]
theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ × α → β} :
∏ p in r, f p = ∏ c in s, ∏ a in t c, f (c, a) := by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.1, p.2))
- exact
- prod_bij' (fun p _hp => ⟨p.1, p.2⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
- (fun p _ => rfl) (fun p _hp => (p.1, p.2))
- (fun p => (h (p.1, p.2)).mpr ∘ mem_sigma.mp) (fun p _ => rfl) fun p _hp => p.eta
+ apply prod_equiv (Equiv.sigmaEquivProd _ _).symm <;> simp [h]
#align finset.prod_finset_product Finset.prod_finset_product
#align finset.sum_finset_product Finset.sum_finset_product
@@ -620,10 +712,7 @@ theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t :
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α × γ → β} :
∏ p in r, f p = ∏ c in s, ∏ a in t c, f (a, c) := by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.2, p.1))
- exact
- prod_bij' (fun p _hp => ⟨p.2, p.1⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
- (fun p _c => rfl) (fun p _hp => (p.2, p.1))
- (fun p => (h (p.2, p.1)).mpr ∘ mem_sigma.mp) (fun p _ => rfl) fun p _hp => p.eta
+ apply prod_equiv ((Equiv.prodComm _ _).trans (Equiv.sigmaEquivProd _ _).symm) <;> simp [h]
#align finset.prod_finset_product_right Finset.prod_finset_product_right
#align finset.sum_finset_product_right Finset.sum_finset_product_right
@@ -635,14 +724,6 @@ theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t :
#align finset.prod_finset_product_right' Finset.prod_finset_product_right'
#align finset.sum_finset_product_right' Finset.sum_finset_product_right'
-@[to_additive]
-theorem prod_fiberwise_of_maps_to [DecidableEq γ] {s : Finset α} {t : Finset γ} {g : α → γ}
- (h : ∀ x ∈ s, g x ∈ t) (f : α → β) :
- (∏ y in t, ∏ x in s.filter fun x => g x = y, f x) = ∏ x in s, f x := by
- rw [← prod_disjiUnion, disjiUnion_filter_eq_of_maps_to h]
-#align finset.prod_fiberwise_of_maps_to Finset.prod_fiberwise_of_maps_to
-#align finset.sum_fiberwise_of_maps_to Finset.sum_fiberwise_of_maps_to
-
@[to_additive]
theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ → β)
(eq : ∀ c ∈ s, f (g c) = ∏ x in s.filter fun c' => g c' = g c, h x) :
@@ -662,6 +743,11 @@ theorem prod_mul_distrib : ∏ x in s, f x * g x = (∏ x in s, f x) * ∏ x in
#align finset.prod_mul_distrib Finset.prod_mul_distrib
#align finset.sum_add_distrib Finset.sum_add_distrib
+@[to_additive]
+lemma prod_mul_prod_comm (f g h i : α → β) :
+ (∏ a in s, f a * g a) * ∏ a in s, h a * i a = (∏ a in s, f a * h a) * ∏ a in s, g a * i a := by
+ simp_rw [prod_mul_distrib, mul_mul_mul_comm]
+
@[to_additive]
theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
∏ x in s ×ˢ t, f x = ∏ x in s, ∏ y in t, f (x, y) :=
@@ -807,6 +893,16 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
#align finset.prod_eq_single Finset.prod_eq_single
#align finset.sum_eq_single Finset.sum_eq_single
+@[to_additive]
+lemma prod_union_eq_left [DecidableEq α] (hs : ∀ a ∈ s₂, a ∉ s₁ → f a = 1) :
+ ∏ a in s₁ ∪ s₂, f a = ∏ a in s₁, f a :=
+ Eq.symm $
+ prod_subset (subset_union_left _ _) fun _a ha ha' ↦ hs _ ((mem_union.1 ha).resolve_left ha') ha'
+
+@[to_additive]
+lemma prod_union_eq_right [DecidableEq α] (hs : ∀ a ∈ s₁, a ∉ s₂ → f a = 1) :
+ ∏ a in s₁ ∪ s₂, f a = ∏ a in s₂, f a := by rw [union_comm, prod_union_eq_left hs]
+
@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
(hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x in s, f x = f a * f b := by
@@ -851,7 +947,7 @@ theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
#align finset.sum_eq_add Finset.sum_eq_add
@[to_additive]
-theorem prod_attach {f : α → β} : ∏ x in s.attach, f x = ∏ x in s, f x :=
+theorem prod_attach (s : Finset α) (f : α → β) : ∏ x in s.attach, f x = ∏ x in s, f x :=
haveI := Classical.decEq α
calc
∏ x in s.attach, f x.val = ∏ x in s.attach.image Subtype.val, f x := by
@@ -905,8 +1001,7 @@ theorem prod_coe_sort_eq_attach (f : s → β) : ∏ i : s, f i = ∏ i in s.att
#align finset.sum_coe_sort_eq_attach Finset.sum_coe_sort_eq_attach
@[to_additive]
-theorem prod_coe_sort : ∏ i : s, f i = ∏ i in s, f i :=
- prod_attach
+theorem prod_coe_sort : ∏ i : s, f i = ∏ i in s, f i := prod_attach _ _
#align finset.prod_coe_sort Finset.prod_coe_sort
#align finset.sum_coe_sort Finset.sum_coe_sort
@@ -964,7 +1059,7 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
(prod_filter_mul_prod_filter_not s p _).symm
_ = (∏ x in (s.filter p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
∏ x in (s.filter fun x => ¬p x).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
- congr_arg₂ _ prod_attach.symm prod_attach.symm
+ congr_arg₂ _ (prod_attach _ _).symm (prod_attach _ _).symm
_ = (∏ x in (s.filter p).attach, h (f x.1 $ by simpa using (mem_filter.mp x.2).2)) *
∏ x in (s.filter fun x ↦ ¬p x).attach, h (g x.1 $ by simpa using (mem_filter.mp x.2).2) :=
congr_arg₂ _ (prod_congr rfl fun x _hx ↦
@@ -978,8 +1073,7 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {_hp : DecidablePred p}
(h : γ → β) :
(∏ x in s, h (if p x then f x else g x)) =
(∏ x in s.filter p, h (f x)) * ∏ x in s.filter fun x => ¬p x, h (g x) :=
- _root_.trans (prod_apply_dite _ _ _)
- (congr_arg₂ _ (@prod_attach _ _ _ _ (h ∘ f)) (@prod_attach _ _ _ _ (h ∘ g)))
+ (prod_apply_dite _ _ _).trans $ congr_arg₂ _ (prod_attach _ (h ∘ f)) (prod_attach _ (h ∘ g))
#align finset.prod_apply_ite Finset.prod_apply_ite
#align finset.sum_apply_ite Finset.sum_apply_ite
@@ -1192,6 +1286,11 @@ lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t
#align finset.prod_mul_indicator_eq_prod_filter Finset.prod_mulIndicator_eq_prod_filter
#align finset.sum_indicator_eq_sum_filter Finset.sum_indicator_eq_sum_filter
+@[to_additive]
+lemma prod_mulIndicator_eq_prod_inter [DecidableEq ι] (s t : Finset ι) (f : ι → β) :
+ ∏ i in s, (t : Set ι).mulIndicator f i = ∏ i in s ∩ t, f i := by
+ rw [← filter_mem_eq_inter, prod_mulIndicator_eq_prod_filter]; rfl
+
@[to_additive]
lemma mulIndicator_prod (s : Finset ι) (t : Set κ) (f : ι → κ → β) :
mulIndicator t (∏ i in s, f i) = ∏ i in s, mulIndicator t (f i) :=
@@ -1227,8 +1326,8 @@ end indicator
@[to_additive]
theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
- (i_inj : ∀ a₁ a₂ h₁₁ h₁₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
- (i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
+ (i_inj : ∀ a₁ h₁₁ h₁₂ a₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
+ (i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, i a h₁ h₂ = b) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
∏ x in s, f x = ∏ x in t, g x := by
classical
calc
@@ -1243,9 +1342,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
refine (mem_filter.mpr ⟨hi a h₁ _, ?_⟩)
specialize h a h₁ fun H ↦ by rw [H] at h₂; simp at h₂
rwa [← h]
- · refine' (fun a ha => (mem_filter.mp ha).elim fun h₁ h₂ ↦ _)
- exact h a h₁ fun H ↦ by rw [H] at h₂; simp at h₂
- · intros a₁ a₂ ha₁ ha₂
+ · intros a₁ ha₁ a₂ ha₂
refine' (mem_filter.mp ha₁).elim fun _ha₁₁ _ha₁₂ ↦ _
refine' (mem_filter.mp ha₂).elim fun _ha₂₁ _ha₂₂ ↦ _
apply i_inj
@@ -1253,30 +1350,24 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
refine' (mem_filter.mp hb).elim fun h₁ h₂ ↦ _
obtain ⟨a, ha₁, ha₂, eq⟩ := i_surj b h₁ fun H ↦ by rw [H] at h₂; simp at h₂
exact ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, eq⟩
+ · refine' (fun a ha => (mem_filter.mp ha).elim fun h₁ h₂ ↦ _)
+ exact h a h₁ fun H ↦ by rw [H] at h₂; simp at h₂
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
@[to_additive]
theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, ¬p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
- ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) :=
- prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp)
- (fun a ha => by
- dsimp
- rw [dif_neg])
- (fun a₁ a₂ h₁ h₂ hh => congr_arg Subtype.val hh) fun b _hb => ⟨b.1, b.2, by simp⟩
+ ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) := by
+ refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_ <;> aesop
#align finset.prod_dite_of_false Finset.prod_dite_of_false
#align finset.sum_dite_of_false Finset.sum_dite_of_false
@[to_additive]
theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
- ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) :=
- prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp)
- (fun a ha => by
- dsimp
- rw [dif_pos])
- (fun a₁ a₂ h₁ h₂ hh => congr_arg Subtype.val hh) fun b _hb => ⟨b.1, b.2, by simp⟩
+ ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) := by
+ refine prod_bij' (fun x hx => ⟨x, hx⟩) (fun x _ ↦ x) ?_ ?_ ?_ ?_ ?_ <;> aesop
#align finset.prod_dite_of_true Finset.prod_dite_of_true
#align finset.sum_dite_of_true Finset.sum_dite_of_true
@@ -1429,12 +1520,9 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
@[to_additive]
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
- (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x in m.toFinset, g x :=
- prod_bij (fun x _ => x.1) (fun x _ => Multiset.mem_toFinset.mpr x.2) (fun _ _ => hfg _)
- (fun _ _ _ _ h => by
- ext
- assumption)
- fun y hy => ⟨⟨y, Multiset.mem_toFinset.mp hy⟩, Finset.mem_univ _, rfl⟩
+ (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x in m.toFinset, g x := by
+ refine' prod_bij' (fun x _ ↦ x) (fun x hx ↦ ⟨x, Multiset.mem_toFinset.1 hx⟩) ?_ ?_ ?_ ?_ ?_ <;>
+ simp [hfg]
#align finset.prod_mem_multiset Finset.prod_mem_multiset
#align finset.sum_mem_multiset Finset.sum_mem_multiset
@@ -1618,20 +1706,8 @@ theorem prod_involution {s : Finset α} {f : α → β} :
@[to_additive "The sum of the composition of functions `f` and `g`, is the sum over `b ∈ s.image g`
of `f b` times of the cardinality of the fibre of `b`. See also `Finset.sum_image`."]
theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
- (∏ a in s, f (g a)) = ∏ b in s.image g, f b ^ (s.filter fun a => g a = b).card :=
- calc
- (∏ a in s, f (g a)) =
- ∏ x in (s.image g).sigma fun b : γ => s.filter fun a => g a = b, f (g x.2) :=
- prod_bij (fun a _ha => ⟨g a, a⟩) (by simp; tauto) (fun _ _ => rfl) (by simp)
- (by -- `(by finish)` closes this
- rintro ⟨b_fst, b_snd⟩ H
- simp only [mem_image, exists_prop, mem_filter, mem_sigma, decide_eq_true_eq] at H
- tauto)
- _ = ∏ b in s.image g, ∏ a in s.filter fun a => g a = b, f (g a) := prod_sigma _ _ _
- _ = ∏ b in s.image g, ∏ _a in s.filter fun a => g a = b, f b :=
- prod_congr rfl fun b _hb => prod_congr rfl (by simp (config := { contextual := true }))
- _ = ∏ b in s.image g, f b ^ (s.filter fun a => g a = b).card :=
- prod_congr rfl fun _ _ => prod_const _
+ ∏ a in s, f (g a) = ∏ b in s.image g, f b ^ (s.filter fun a => g a = b).card := by
+ simp_rw [← prod_const, prod_fiberwise_of_maps_to' fun _ ↦ mem_image_of_mem _]
#align finset.prod_comp Finset.prod_comp
#align finset.sum_comp Finset.sum_comp
@@ -1782,12 +1858,13 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
/-- See also `Finset.prod_boole`. -/
@[to_additive "See also `Finset.sum_boole`."]
-theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).PairwiseDisjoint f)
- (a : β) : (∏ i in s, ite (f i) a 1) = ite (∃ i ∈ s, f i) a 1 := by
+theorem prod_ite_one (s : Finset α) (p : α → Prop) [DecidablePred p]
+ (h : ∀ i ∈ s, ∀ j ∈ s, p i → p j → i = j) (a : β) :
+ ∏ i in s, ite (p i) a 1 = ite (∃ i ∈ s, p i) a 1 := by
split_ifs with h
- · obtain ⟨i, hi, hfi⟩ := h
- rw [prod_eq_single_of_mem _ hi, if_pos hfi]
- exact fun j hj h => if_neg fun hfj => (hf hj hi h).le_bot ⟨hfj, hfi⟩
+ · obtain ⟨i, hi, hpi⟩ := h
+ rw [prod_eq_single_of_mem _ hi, if_pos hpi]
+ exact fun j hj hji ↦ if_neg fun hpj ↦ hji $ h _ hj _ hi hpj hpi
· push_neg at h
rw [prod_eq_one]
exact fun i hi => if_neg (h i hi)
@@ -2086,6 +2163,7 @@ theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
end Finset
namespace Fintype
+variable {ι κ α : Type*} [Fintype ι] [Fintype κ] [CommMonoid α]
open Finset
@@ -2096,17 +2174,13 @@ See `Function.Bijective.prod_comp` for a version without `h`. -/
`Function.Bijective`.
See `Function.Bijective.sum_comp` for a version without `h`. "]
-theorem prod_bijective {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
- (he : Function.Bijective e) (f : α → M) (g : β → M) (h : ∀ x, f x = g (e x)) :
- ∏ x : α, f x = ∏ x : β, g x :=
- prod_bij (fun x _ => e x) (fun x _ => mem_univ (e x)) (fun x _ => h x)
- (fun _x _x' _ _ h => he.injective h) fun y _ =>
- (he.surjective y).imp fun _a h => ⟨mem_univ _, h.symm⟩
+lemma prod_bijective (e : ι → κ) (he : e.Bijective) (f : ι → α) (g : κ → α)
+ (h : ∀ x, f x = g (e x)) : ∏ x, f x = ∏ x, g x :=
+ prod_equiv (.ofBijective e he) (by simp) (by simp [h])
#align fintype.prod_bijective Fintype.prod_bijective
#align fintype.sum_bijective Fintype.sum_bijective
-alias _root_.Function.Bijective.finset_prod := prod_bijective
-attribute [to_additive] Function.Bijective.finset_prod
+@[to_additive] alias _root_.Function.Bijective.finset_prod := prod_bijective
/-- `Fintype.prod_equiv` is a specialization of `Finset.prod_bij` that
automatically fills in most arguments.
@@ -2117,12 +2191,39 @@ See `Equiv.prod_comp` for a version without `h`.
automatically fills in most arguments.
See `Equiv.sum_comp` for a version without `h`."]
-theorem prod_equiv {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
- (g : β → M) (h : ∀ x, f x = g (e x)) : ∏ x : α, f x = ∏ x : β, g x :=
- e.bijective.finset_prod _ f g h
+lemma prod_equiv (e : ι ≃ κ) (f : ι → α) (g : κ → α) (h : ∀ x, f x = g (e x)) :
+ ∏ x, f x = ∏ x, g x := prod_bijective _ e.bijective _ _ h
#align fintype.prod_equiv Fintype.prod_equiv
#align fintype.sum_equiv Fintype.sum_equiv
+@[to_additive]
+lemma _root_.Function.Bijective.prod_comp {e : ι → κ} (he : e.Bijective) (g : κ → α) :
+ ∏ i, g (e i) = ∏ i, g i := prod_bijective _ he _ _ fun _ ↦ rfl
+#align function.bijective.prod_comp Function.Bijective.prod_comp
+#align function.bijective.sum_comp Function.Bijective.sum_comp
+
+@[to_additive]
+lemma _root_.Equiv.prod_comp (e : ι ≃ κ) (g : κ → α) : ∏ i, g (e i) = ∏ i, g i :=
+ prod_equiv e _ _ fun _ ↦ rfl
+#align equiv.prod_comp Equiv.prod_comp
+#align equiv.sum_comp Equiv.sum_comp
+
+@[to_additive]
+lemma prod_fiberwise [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : ι → α) :
+ ∏ j, ∏ i : {i // g i = j}, f i = ∏ i, f i := by
+ rw [← Finset.prod_fiberwise _ g f]
+ congr with j
+ exact (prod_subtype _ (by simp) _).symm
+#align fintype.prod_fiberwise Fintype.prod_fiberwise
+#align fintype.sum_fiberwise Fintype.sum_fiberwise
+
+@[to_additive]
+lemma prod_fiberwise' [DecidableEq κ] [Fintype ι] (g : ι → κ) (f : κ → α) :
+ ∏ j, ∏ _i : {i // g i = j}, f j = ∏ i, f (g i) := by
+ rw [← Finset.prod_fiberwise' _ g f]
+ congr with j
+ exact (prod_subtype _ (by simp) fun _ ↦ _).symm
+
@[to_additive]
theorem prod_unique {α β : Type*} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
∏ x : α, f x = f default := by rw [univ_unique, prod_singleton]
@@ -2491,3 +2592,12 @@ theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
#align to_add_prod toAdd_prod
end AddCommMonoid
+
+/-!
+### Deprecated lemmas
+
+Those lemmas were deprecated on the 2023/12/23.
+-/
+
+@[deprecated] alias Equiv.prod_comp' := Fintype.prod_equiv
+@[deprecated] alias Equiv.sum_comp' := Fintype.sum_equiv
@@ -219,14 +219,8 @@ section Deprecated
#align monoid_hom.map_prod map_prodₓ
#align add_monoid_hom.map_sum map_sumₓ
-
-/-- Deprecated: use `_root_.map_prod` instead. -/
-@[to_additive (attr := deprecated) "Deprecated: use `_root_.map_sum` instead."]
-protected theorem MulEquiv.map_prod [CommMonoid β] [CommMonoid γ] (g : β ≃* γ) (f : α → β)
- (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
- map_prod g f s
-#align mul_equiv.map_prod MulEquiv.map_prod
-#align add_equiv.map_sum AddEquiv.map_sum
+#align mul_equiv.map_prod map_prodₓ
+#align add_equiv.map_sum map_sumₓ
@[deprecated _root_.map_list_prod]
protected theorem RingHom.map_list_prod [Semiring β] [Semiring γ] (f : β →+* γ) (l : List β) :
@@ -1904,13 +1898,13 @@ open MulOpposite
@[simp]
theorem op_sum [AddCommMonoid β] {s : Finset α} (f : α → β) :
op (∑ x in s, f x) = ∑ x in s, op (f x) :=
- (opAddEquiv : β ≃+ βᵐᵒᵖ).map_sum _ _
+ map_sum (opAddEquiv : β ≃+ βᵐᵒᵖ) _ _
#align finset.op_sum Finset.op_sum
@[simp]
theorem unop_sum [AddCommMonoid β] {s : Finset α} (f : α → βᵐᵒᵖ) :
unop (∑ x in s, f x) = ∑ x in s, unop (f x) :=
- (opAddEquiv : β ≃+ βᵐᵒᵖ).symm.map_sum _ _
+ map_sum (opAddEquiv : β ≃+ βᵐᵒᵖ).symm _ _
#align finset.unop_sum Finset.unop_sum
end Opposite
∃ x ∈ s, _
instead of ∃ (x) (_ : x ∈ s), _
(#9184)
Search for [∀∃].*(_
and manually replace some occurrences with more readable versions.
In case of ∀
, the new expressions are defeq to the old ones.
In case of ∃
, they differ by exists_prop
.
In some rare cases, golf proofs that needed fixing.
@@ -2239,7 +2239,7 @@ theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
theorem finset_sum_eq_sup_iff_disjoint {β : Type*} {i : Finset β} {f : β → Multiset α} :
i.sum f = i.sup f ↔
- ∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) := by
+ ∀ᵉ (x ∈ i) (y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) := by
induction' i using Finset.cons_induction_on with z i hz hr
· simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
Algebra.Support
down the import tree (#8919)
Function.support
is a very basic definition. Nevertheless, it is a pretty heavy import because it imports most objects a support
lemma can be written about.
This PR reverses the dependencies between those objects and Function.support
, so that the latter can become a much more lightweight import.
Only two import could not easily be reversed, namely the ones to Data.Set.Finite
and Order.ConditionallyCompleteLattice.Basic
, so I created two new files instead.
I credit:
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Algebra.BigOperators.Multiset.Lemmas
+import Mathlib.Algebra.Function.Indicator
import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Algebra.Group.Pi
import Mathlib.Algebra.GroupPower.Lemmas
@@ -49,7 +50,7 @@ universe u v w
variable {ι : Type*} {β : Type u} {α : Type v} {γ : Type w}
-open Fin
+open Fin Function
namespace Finset
@@ -1145,6 +1146,90 @@ theorem prod_pi_mulSingle {β : α → Type*} [DecidableEq α] [∀ a, CommMonoi
prod_dite_eq _ _ _
#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
+@[to_additive]
+lemma mulSupport_prod (s : Finset ι) (f : ι → α → β) :
+ mulSupport (fun x ↦ ∏ i in s, f i x) ⊆ ⋃ i ∈ s, mulSupport (f i) := by
+ simp only [mulSupport_subset_iff', Set.mem_iUnion, not_exists, nmem_mulSupport]
+ exact fun x ↦ prod_eq_one
+#align function.mul_support_prod Finset.mulSupport_prod
+#align function.support_sum Finset.support_sum
+
+section indicator
+open Set
+variable {κ : Type*}
+
+/-- Consider a product of `g i (f i)` over a finset. Suppose `g` is a function such as
+`n ↦ (· ^ n)`, which maps a second argument of `1` to `1`. Then if `f` is replaced by the
+corresponding multiplicative indicator function, the finset may be replaced by a possibly larger
+finset without changing the value of the product. -/
+@[to_additive "Consider a sum of `g i (f i)` over a finset. Suppose `g` is a function such as
+`n ↦ (n • ·)`, which maps a second argument of `0` to `0` (or a weighted sum of `f i * h i` or
+`f i • h i`, where `f` gives the weights that are multiplied by some other function `h`). Then if
+`f` is replaced by the corresponding indicator function, the finset may be replaced by a possibly
+larger finset without changing the value of the sum."]
+lemma prod_mulIndicator_subset_of_eq_one [One α] (f : ι → α) (g : ι → α → β) {s t : Finset ι}
+ (h : s ⊆ t) (hg : ∀ a, g a 1 = 1) :
+ ∏ i in t, g i (mulIndicator ↑s f i) = ∏ i in s, g i (f i) := by
+ calc
+ _ = ∏ i in s, g i (mulIndicator ↑s f i) := by rw [prod_subset h fun i _ hn ↦ by simp [hn, hg]]
+ -- Porting note: This did not use to need the implicit argument
+ _ = _ := prod_congr rfl fun i hi ↦ congr_arg _ $ mulIndicator_of_mem (α := ι) hi f
+#align set.prod_mul_indicator_subset_of_eq_one Finset.prod_mulIndicator_subset_of_eq_one
+#align set.sum_indicator_subset_of_eq_zero Finset.sum_indicator_subset_of_eq_zero
+
+/-- Taking the product of an indicator function over a possibly larger finset is the same as
+taking the original function over the original finset. -/
+@[to_additive "Summing an indicator function over a possibly larger `Finset` is the same as summing
+ the original function over the original finset."]
+lemma prod_mulIndicator_subset (f : ι → β) {s t : Finset ι} (h : s ⊆ t) :
+ ∏ i in t, mulIndicator (↑s) f i = ∏ i in s, f i :=
+ prod_mulIndicator_subset_of_eq_one _ (fun _ ↦ id) h fun _ ↦ rfl
+#align set.prod_mul_indicator_subset Finset.prod_mulIndicator_subset
+#align set.sum_indicator_subset Finset.sum_indicator_subset
+
+@[to_additive]
+lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t : ι → Set κ) (g : ι → κ)
+ [DecidablePred fun i ↦ g i ∈ t i] :
+ ∏ i in s, mulIndicator (t i) (f i) (g i) = ∏ i in s.filter fun i ↦ g i ∈ t i, f i (g i) := by
+ refine (prod_filter_mul_prod_filter_not s (fun i ↦ g i ∈ t i) _).symm.trans $
+ Eq.trans (congr_arg₂ (· * ·) ?_ ?_) (mul_one _)
+ · exact prod_congr rfl fun x hx ↦ mulIndicator_of_mem (mem_filter.1 hx).2 _
+ · exact prod_eq_one fun x hx ↦ mulIndicator_of_not_mem (mem_filter.1 hx).2 _
+#align finset.prod_mul_indicator_eq_prod_filter Finset.prod_mulIndicator_eq_prod_filter
+#align finset.sum_indicator_eq_sum_filter Finset.sum_indicator_eq_sum_filter
+
+@[to_additive]
+lemma mulIndicator_prod (s : Finset ι) (t : Set κ) (f : ι → κ → β) :
+ mulIndicator t (∏ i in s, f i) = ∏ i in s, mulIndicator t (f i) :=
+ map_prod (mulIndicatorHom _ _) _ _
+#align set.mul_indicator_finset_prod Finset.mulIndicator_prod
+#align set.indicator_finset_sum Finset.indicator_sum
+
+variable {κ : Type*}
+@[to_additive]
+lemma mulIndicator_biUnion (s : Finset ι) (t : ι → Set κ) {f : κ → β} :
+ ((s : Set ι).PairwiseDisjoint t) →
+ mulIndicator (⋃ i ∈ s, t i) f = fun a ↦ ∏ i in s, mulIndicator (t i) f a := by
+ classical
+ refine Finset.induction_on s (by simp) fun i s hi ih hs ↦ funext fun j ↦ ?_
+ rw [prod_insert hi, set_biUnion_insert, mulIndicator_union_of_not_mem_inter,
+ ih (hs.subset $ subset_insert _ _)]
+ simp only [not_exists, exists_prop, mem_iUnion, mem_inter_iff, not_and]
+ exact fun hji i' hi' hji' ↦ (ne_of_mem_of_not_mem hi' hi).symm $
+ hs.elim_set (mem_insert_self _ _) (mem_insert_of_mem hi') _ hji hji'
+#align set.mul_indicator_finset_bUnion Finset.mulIndicator_biUnion
+#align set.indicator_finset_bUnion Finset.indicator_biUnion
+
+@[to_additive]
+lemma mulIndicator_biUnion_apply (s : Finset ι) (t : ι → Set κ) {f : κ → β}
+ (h : (s : Set ι).PairwiseDisjoint t) (x : κ) :
+ mulIndicator (⋃ i ∈ s, t i) f x = ∏ i in s, mulIndicator (t i) f x := by
+ rw [mulIndicator_biUnion s t h]
+#align set.mul_indicator_finset_bUnion_apply Finset.mulIndicator_biUnion_apply
+#align set.indicator_finset_bUnion_apply Finset.indicator_biUnion_apply
+
+end indicator
+
@[to_additive]
theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
@@ -1951,6 +2036,11 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
rw [if_neg hq]
#align finset.prod_boole Finset.prod_boole
+lemma support_prod_subset (s : Finset ι) (f : ι → α → β) :
+ support (fun x ↦ ∏ i in s, f i x) ⊆ ⋂ i ∈ s, support (f i) :=
+ fun _ hx ↦ Set.mem_iInter₂.2 fun _ hi H ↦ hx $ prod_eq_zero hi H
+#align function.support_prod_subset Finset.support_prod_subset
+
variable [Nontrivial β] [NoZeroDivisors β]
theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
@@ -1965,6 +2055,11 @@ theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := b
push_neg; rfl
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
+lemma support_prod (s : Finset ι) (f : ι → α → β) :
+ support (fun x ↦ ∏ i in s, f i x) = ⋂ i ∈ s, support (f i) :=
+ Set.ext fun x ↦ by simp [support, prod_eq_zero_iff]
+#align function.support_prod Finset.support_prod
+
end ProdEqZero
@[to_additive]
@@ -769,7 +769,7 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
-- If we use `[DecidableEq β]` here, some rewrites fail because they find a wrong `Decidable`
-- instance first; `{∀ x, Decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
-theorem prod_filter_ne_one [∀ x, Decidable (f x ≠ 1)] :
+theorem prod_filter_ne_one (s : Finset α) [∀ x, Decidable (f x ≠ 1)] :
∏ x in s.filter fun x => f x ≠ 1, f x = ∏ x in s, f x :=
prod_filter_of_ne fun _ _ => id
#align finset.prod_filter_ne_one Finset.prod_filter_ne_one
@@ -1153,11 +1153,11 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
∏ x in s, f x = ∏ x in t, g x := by
classical
calc
- ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
+ ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := by rw [prod_filter_ne_one]
_ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
prod_bij (fun a ha => i a (mem_filter.mp ha).1 $ by simpa using (mem_filter.mp ha).2)
?_ ?_ ?_ ?_
- _ = ∏ x in t, g x := prod_filter_ne_one
+ _ = ∏ x in t, g x := prod_filter_ne_one _
· intros a ha
refine' (mem_filter.mp ha).elim _
intros h₁ h₂
@@ -216,13 +216,8 @@ theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [MonoidHomClass G
section Deprecated
-/-- Deprecated: use `_root_.map_prod` instead. -/
-@[to_additive (attr := deprecated) "Deprecated: use `_root_.map_sum` instead."]
-protected theorem MonoidHom.map_prod [CommMonoid β] [CommMonoid γ] (g : β →* γ) (f : α → β)
- (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) :=
- map_prod g f s
-#align monoid_hom.map_prod MonoidHom.map_prod
-#align add_monoid_hom.map_sum AddMonoidHom.map_sum
+#align monoid_hom.map_prod map_prodₓ
+#align add_monoid_hom.map_sum map_sumₓ
/-- Deprecated: use `_root_.map_prod` instead. -/
@[to_additive (attr := deprecated) "Deprecated: use `_root_.map_sum` instead."]
@@ -280,7 +275,7 @@ end Deprecated
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
⇑(∏ x in s, f x) = ∏ x in s, ⇑(f x) :=
- (MonoidHom.coeFn β γ).map_prod _ _
+ map_prod (MonoidHom.coeFn β γ) _ _
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
@@ -291,7 +286,7 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
`f : α → β → γ`"]
theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α)
(b : β) : (∏ x in s, f x) b = ∏ x in s, f x b :=
- (MonoidHom.eval b).map_prod _ _
+ map_prod (MonoidHom.eval b) _ _
#align monoid_hom.finset_prod_apply MonoidHom.finset_prod_apply
#align add_monoid_hom.finset_sum_apply AddMonoidHom.finset_sum_apply
@@ -2300,7 +2295,7 @@ end Int
@[simp, norm_cast]
theorem Units.coe_prod {M : Type*} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
(↑(∏ i in s, f i) : M) = ∏ i in s, (f i : M) :=
- (Units.coeHom M).map_prod _ _
+ map_prod (Units.coeHom M) _ _
#align units.coe_prod Units.coe_prod
theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h) :
@@ -2005,13 +2005,13 @@ namespace Fintype
open Finset
-/-- `Fintype.prod_bijective` is a variant of `Finset.prod_bij` that accepts `Function.bijective`.
+/-- `Fintype.prod_bijective` is a variant of `Finset.prod_bij` that accepts `Function.Bijective`.
-See `Function.bijective.prod_comp` for a version without `h`. -/
-@[to_additive "`Fintype.sum_equiv` is a variant of `Finset.sum_bij` that accepts
-`Function.bijective`.
+See `Function.Bijective.prod_comp` for a version without `h`. -/
+@[to_additive "`Fintype.sum_bijective` is a variant of `Finset.sum_bij` that accepts
+`Function.Bijective`.
-See `Function.bijective.sum_comp` for a version without `h`. "]
+See `Function.Bijective.sum_comp` for a version without `h`. "]
theorem prod_bijective {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
(he : Function.Bijective e) (f : α → M) (g : β → M) (h : ∀ x, f x = g (e x)) :
∏ x : α, f x = ∏ x : β, g x :=
@@ -2021,6 +2021,9 @@ theorem prod_bijective {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M
#align fintype.prod_bijective Fintype.prod_bijective
#align fintype.sum_bijective Fintype.sum_bijective
+alias _root_.Function.Bijective.finset_prod := prod_bijective
+attribute [to_additive] Function.Bijective.finset_prod
+
/-- `Fintype.prod_equiv` is a specialization of `Finset.prod_bij` that
automatically fills in most arguments.
@@ -2032,7 +2035,7 @@ automatically fills in most arguments.
See `Equiv.sum_comp` for a version without `h`."]
theorem prod_equiv {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
(g : β → M) (h : ∀ x, f x = g (e x)) : ∏ x : α, f x = ∏ x : β, g x :=
- prod_bijective e e.bijective f g h
+ e.bijective.finset_prod _ f g h
#align fintype.prod_equiv Fintype.prod_equiv
#align fintype.sum_equiv Fintype.sum_equiv
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -1572,7 +1572,7 @@ theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
(∏ x in s ∩ t, f x) * ∏ x in s \ t, f x = ∏ x in s, f x := by
convert (s.prod_piecewise t f f).symm
- simp [Finset.piecewise]
+ simp (config := { unfoldPartialApp := true }) [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
#align finset.sum_inter_add_sum_diff Finset.sum_inter_add_sum_diff
@@ -2151,7 +2151,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type*} {i : Finset β} {f : β →
· simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
· simp_rw [Finset.sum_cons hz, Finset.sup_cons, Finset.mem_cons, Multiset.sup_eq_union,
- forall_eq_or_imp, Ne.def, IsEmpty.forall_iff, true_and_iff,
+ forall_eq_or_imp, Ne.def, not_true_eq_false, IsEmpty.forall_iff, true_and_iff,
imp_and, forall_and, ← hr, @eq_comm _ z]
have := fun x (H : x ∈ i) => ne_of_mem_of_not_mem H hz
simp (config := { contextual := true }) only [this, not_false_iff, true_imp_iff]
@@ -2310,7 +2310,7 @@ theorem nat_abs_sum_le {ι : Type*} (s : Finset ι) (f : ι → ℤ) :
(∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
classical
induction' s using Finset.induction_on with i s his IH
- · simp only [Finset.sum_empty, Int.natAbs_zero]
+ · simp only [Finset.sum_empty, Int.natAbs_zero, le_refl]
· simp only [his, Finset.sum_insert, not_false_iff]
exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
#align nat_abs_sum_le nat_abs_sum_le
@@ -1461,6 +1461,14 @@ theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : ∏ a in s, f a
#align finset.prod_eq_pow_card Finset.prod_eq_pow_card
#align finset.sum_eq_card_nsmul Finset.sum_eq_card_nsmul
+@[to_additive card_nsmul_add_sum]
+theorem pow_card_mul_prod {b : β} : b ^ s.card * ∏ a in s, f a = ∏ a in s, b * f a :=
+ (Finset.prod_const b).symm ▸ prod_mul_distrib.symm
+
+@[to_additive sum_add_card_nsmul]
+theorem prod_mul_pow_card {b : β} : (∏ a in s, f a) * b ^ s.card = ∏ a in s, f a * b :=
+ (Finset.prod_const b).symm ▸ prod_mul_distrib.symm
+
@[to_additive]
theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k in range n, b := by simp
#align finset.pow_eq_prod_const Finset.pow_eq_prod_const
The new precedences match coeNotation
in core:
syntax:1024 (name := coeNotation) "↑" term:1024 : term
They also match the precedence in Lean 3.
@@ -279,7 +279,7 @@ end Deprecated
@[to_additive]
theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α) :
- ⇑(∏ x in s, f x) = ∏ x in s, ⇑f x :=
+ ⇑(∏ x in s, f x) = ∏ x in s, ⇑(f x) :=
(MonoidHom.coeFn β γ).map_prod _ _
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
attach
and filter
lemmas (#1470)
Match https://github.com/leanprover-community/mathlib/pull/18087
@@ -15,7 +15,7 @@ import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Multiset.Powerset
import Mathlib.Data.Set.Pairwise.Basic
-#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"fa2309577c7009ea243cffdf990cd6c84f0ad497"
+#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
/-!
# Big operators
@@ -187,6 +187,12 @@ theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
#align finset.prod_eq_multiset_prod Finset.prod_eq_multiset_prod
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
+@[to_additive (attr := simp)]
+lemma prod_map_val [CommMonoid β] (s : Finset α) (f : α → β) : (s.1.map f).prod = ∏ a in s, f a :=
+ rfl
+#align finset.prod_map_val Finset.prod_map_val
+#align finset.sum_map_val Finset.sum_map_val
+
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
∏ x in s, f x = s.fold ((· * ·) : β → β → β) 1 f :=
@@ -1775,11 +1781,19 @@ theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
apply sum_congr rfl h₁
#align finset.sum_const_nat Finset.sum_const_nat
+lemma natCast_card_filter [AddCommMonoidWithOne β] (p) [DecidablePred p] (s : Finset α) :
+ ((filter p s).card : β) = ∑ a in s, if p a then (1 : β) else 0 := by
+ rw [sum_ite, sum_const_zero, add_zero, sum_const, nsmul_one]
+#align finset.nat_cast_card_filter Finset.natCast_card_filter
+
+lemma card_filter (p) [DecidablePred p] (s : Finset α) :
+ (filter p s).card = ∑ a in s, ite (p a) 1 0 := natCast_card_filter _ _
+#align finset.card_filter Finset.card_filter
+
@[simp]
-theorem sum_boole {s : Finset α} {p : α → Prop} [NonAssocSemiring β] {hp : DecidablePred p} :
- (∑ x in s, if p x then (1 : β) else (0 : β)) = (s.filter p).card := by
- simp only [add_zero, mul_one, Finset.sum_const, nsmul_eq_mul, eq_self_iff_true,
- Finset.sum_const_zero, Finset.sum_ite, mul_zero]
+lemma sum_boole {s : Finset α} {p : α → Prop} [AddCommMonoidWithOne β] [DecidablePred p] :
+ (∑ x in s, if p x then 1 else 0 : β) = (s.filter p).card :=
+ (natCast_card_filter _ _).symm
#align finset.sum_boole Finset.sum_boole
theorem _root_.Commute.sum_right [NonUnitalNonAssocSemiring β] (s : Finset α) (f : α → β) (b : β)
@@ -342,6 +342,10 @@ theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x in insert a s, f
#align finset.prod_insert_one Finset.prod_insert_one
#align finset.sum_insert_zero Finset.sum_insert_zero
+@[to_additive]
+theorem prod_insert_div {M : Type*} [CommGroup M] [DecidableEq α] (ha : a ∉ s) {f : α → M} :
+ (∏ x in insert a s, f x) / f a = ∏ x in s, f x := by simp [ha]
+
@[to_additive (attr := simp)]
theorem prod_singleton (f : α → β) (a : α) : ∏ x in singleton a, f x = f a :=
Eq.trans fold_singleton <| mul_one _
Hom
and file name (#8095)
I believe the file defining a type of morphisms belongs alongside the file defining the structure this morphism works on. So I would like to reorganize the files in the Mathlib.Algebra.Hom
folder so that e.g. Mathlib.Algebra.Hom.Ring
becomes Mathlib.Algebra.Ring.Hom
and Mathlib.Algebra.Hom.NonUnitalAlg
becomes Mathlib.Algebra.Algebra.NonUnitalHom
.
While fixing the imports I went ahead and sorted them for good luck.
The full list of changes is: renamed: Mathlib/Algebra/Hom/NonUnitalAlg.lean -> Mathlib/Algebra/Algebra/NonUnitalHom.lean renamed: Mathlib/Algebra/Hom/Aut.lean -> Mathlib/Algebra/Group/Aut.lean renamed: Mathlib/Algebra/Hom/Commute.lean -> Mathlib/Algebra/Group/Commute/Hom.lean renamed: Mathlib/Algebra/Hom/Embedding.lean -> Mathlib/Algebra/Group/Embedding.lean renamed: Mathlib/Algebra/Hom/Equiv/Basic.lean -> Mathlib/Algebra/Group/Equiv/Basic.lean renamed: Mathlib/Algebra/Hom/Equiv/TypeTags.lean -> Mathlib/Algebra/Group/Equiv/TypeTags.lean renamed: Mathlib/Algebra/Hom/Equiv/Units/Basic.lean -> Mathlib/Algebra/Group/Units/Equiv.lean renamed: Mathlib/Algebra/Hom/Equiv/Units/GroupWithZero.lean -> Mathlib/Algebra/GroupWithZero/Units/Equiv.lean renamed: Mathlib/Algebra/Hom/Freiman.lean -> Mathlib/Algebra/Group/Freiman.lean renamed: Mathlib/Algebra/Hom/Group/Basic.lean -> Mathlib/Algebra/Group/Hom/Basic.lean renamed: Mathlib/Algebra/Hom/Group/Defs.lean -> Mathlib/Algebra/Group/Hom/Defs.lean renamed: Mathlib/Algebra/Hom/GroupAction.lean -> Mathlib/GroupTheory/GroupAction/Hom.lean renamed: Mathlib/Algebra/Hom/GroupInstances.lean -> Mathlib/Algebra/Group/Hom/Instances.lean renamed: Mathlib/Algebra/Hom/Iterate.lean -> Mathlib/Algebra/GroupPower/IterateHom.lean renamed: Mathlib/Algebra/Hom/Centroid.lean -> Mathlib/Algebra/Ring/CentroidHom.lean renamed: Mathlib/Algebra/Hom/Ring/Basic.lean -> Mathlib/Algebra/Ring/Hom/Basic.lean renamed: Mathlib/Algebra/Hom/Ring/Defs.lean -> Mathlib/Algebra/Ring/Hom/Defs.lean renamed: Mathlib/Algebra/Hom/Units.lean -> Mathlib/Algebra/Group/Units/Hom.lean
Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Reorganizing.20.60Mathlib.2EAlgebra.2EHom.60
@@ -4,9 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Algebra.BigOperators.Multiset.Lemmas
+import Mathlib.Algebra.Group.Equiv.Basic
import Mathlib.Algebra.Group.Pi
import Mathlib.Algebra.GroupPower.Lemmas
-import Mathlib.Algebra.Hom.Equiv.Basic
import Mathlib.Algebra.Ring.Opposite
import Mathlib.Data.Finset.Powerset
import Mathlib.Data.Finset.Sigma
@@ -278,9 +278,11 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
--- See also `Finset.prod_apply`, with the same conclusion
--- but with the weaker hypothesis `f : α → β → γ`.
-@[to_additive (attr := simp)]
+/-- See also `Finset.prod_apply`, with the same conclusion but with the weaker hypothesis
+`f : α → β → γ` -/
+@[to_additive (attr := simp)
+ "See also `Finset.sum_apply`, with the same conclusion but with the weaker hypothesis
+ `f : α → β → γ`"]
theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α)
(b : β) : (∏ x in s, f x) b = ∏ x in s, f x b :=
(MonoidHom.eval b).map_prod _ _
@@ -683,7 +683,7 @@ theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β}
#align finset.sum_product_right Finset.sum_product_right
/-- An uncurried version of `Finset.prod_product_right`. -/
-@[to_additive "An uncurried version of `Finset.prod_product_right`"]
+@[to_additive "An uncurried version of `Finset.sum_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
∏ x in s ×ˢ t, f x.1 x.2 = ∏ y in t, ∏ x in s, f x y :=
prod_product_right
@@ -1460,12 +1460,12 @@ theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x in s, f x ^ n
#align finset.prod_pow Finset.prod_pow
#align finset.sum_nsmul Finset.sum_nsmul
-/-- A product over `Finset.powersetLen` which only depends on the size of the sets is constant. -/
+/-- A product over `Finset.powersetCard` which only depends on the size of the sets is constant. -/
@[to_additive
-"A sum over `Finset.powersetLen` which only depends on the size of the sets is constant."]
-lemma prod_powersetLen (n : ℕ) (s : Finset α) (f : ℕ → β) :
- ∏ t in powersetLen n s, f t.card = f n ^ s.card.choose n := by
- rw [prod_eq_pow_card, card_powersetLen]; rintro a ha; rw [(mem_powersetLen.1 ha).2]
+"A sum over `Finset.powersetCard` which only depends on the size of the sets is constant."]
+lemma prod_powersetCard (n : ℕ) (s : Finset α) (f : ℕ → β) :
+ ∏ t in powersetCard n s, f t.card = f n ^ s.card.choose n := by
+ rw [prod_eq_pow_card, card_powersetCard]; rintro a ha; rw [(mem_powersetCard.1 ha).2]
@[to_additive]
theorem prod_flip {n : ℕ} (f : ℕ → β) :
@@ -2133,11 +2133,11 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type*} {i : Finset β} {f : β →
#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjoint
theorem sup_powerset_len {α : Type*} [DecidableEq α] (x : Multiset α) :
- (Finset.sup (Finset.range (card x + 1)) fun k => x.powersetLen k) = x.powerset := by
+ (Finset.sup (Finset.range (card x + 1)) fun k => x.powersetCard k) = x.powerset := by
convert bind_powerset_len x using 1
rw [Multiset.bind, Multiset.join, ← Finset.range_val, ← Finset.sum_eq_multiset_sum]
exact
- Eq.symm (finset_sum_eq_sup_iff_disjoint.mpr fun _ _ _ _ h => pairwise_disjoint_powersetLen x h)
+ Eq.symm (finset_sum_eq_sup_iff_disjoint.mpr fun _ _ _ _ h => pairwise_disjoint_powersetCard x h)
#align multiset.sup_powerset_len Multiset.sup_powerset_len
@[simp]
@@ -201,7 +201,7 @@ theorem sum_multiset_singleton (s : Finset α) : (s.sum fun x => {x}) = s.val :=
end Finset
-@[to_additive]
+@[to_additive (attr := simp)]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [MonoidHomClass G β γ] (g : G)
(f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
simp only [Finset.prod_eq_multiset_prod, map_multiset_prod, Multiset.map_map]; rfl
Renames:
CanonicallyOrderedMonoid
->
CanonicallyOrderedCommMonoid
CanonicallyOrderedAddMonoid
->
CanonicallyOrderedAddCommMonoid
CanonicallyLinearOrderedMonoid
->
CanonicallyLinearOrderedCommMonoid
CanonicallyLinearOrderedAddMonoid
->
CanonicallyLinearOrderedAddCommMonoid
@@ -1425,7 +1425,7 @@ theorem eq_prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
reduces to the difference of the last and first terms
when the function we are summing is monotone.
-/
-theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
+theorem sum_range_tsub [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α]
[ContravariantClass α α (· + ·) (· ≤ ·)] {f : ℕ → α} (h : Monotone f) (n : ℕ) :
∑ i in range n, (f (i + 1) - f i) = f n - f 0 := by
apply sum_range_induction
Also fix implicitness of arguments to Finset.sum_singleton
.
@@ -8,9 +8,10 @@ import Mathlib.Algebra.Group.Pi
import Mathlib.Algebra.GroupPower.Lemmas
import Mathlib.Algebra.Hom.Equiv.Basic
import Mathlib.Algebra.Ring.Opposite
+import Mathlib.Data.Finset.Powerset
+import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Finset.Sum
import Mathlib.Data.Fintype.Basic
-import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Multiset.Powerset
import Mathlib.Data.Set.Pairwise.Basic
@@ -340,7 +341,7 @@ theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x in insert a s, f
#align finset.sum_insert_zero Finset.sum_insert_zero
@[to_additive (attr := simp)]
-theorem prod_singleton : ∏ x in singleton a, f x = f a :=
+theorem prod_singleton (f : α → β) (a : α) : ∏ x in singleton a, f x = f a :=
Eq.trans fold_singleton <| mul_one _
#align finset.prod_singleton Finset.prod_singleton
#align finset.sum_singleton Finset.sum_singleton
@@ -790,7 +791,7 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
· intro _ H
rwa [mem_singleton.1 H]
· simpa only [mem_singleton] }
- _ = f a := prod_singleton
+ _ = f a := prod_singleton _ _
#align finset.prod_eq_single_of_mem Finset.prod_eq_single_of_mem
#align finset.sum_eq_single_of_mem Finset.sum_eq_single_of_mem
@@ -1265,8 +1266,7 @@ theorem prod_range_zero (f : ℕ → β) : ∏ k in range 0, f k = 1 := by rw [r
@[to_additive sum_range_one]
theorem prod_range_one (f : ℕ → β) : ∏ k in range 1, f k = f 0 := by
- rw [range_one]
- apply @prod_singleton β ℕ 0 f
+ rw [range_one, prod_singleton]
#align finset.prod_range_one Finset.prod_range_one
#align finset.sum_range_one Finset.sum_range_one
@@ -1460,6 +1460,13 @@ theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x in s, f x ^ n
#align finset.prod_pow Finset.prod_pow
#align finset.sum_nsmul Finset.sum_nsmul
+/-- A product over `Finset.powersetLen` which only depends on the size of the sets is constant. -/
+@[to_additive
+"A sum over `Finset.powersetLen` which only depends on the size of the sets is constant."]
+lemma prod_powersetLen (n : ℕ) (s : Finset α) (f : ℕ → β) :
+ ∏ t in powersetLen n s, f t.card = f n ^ s.card.choose n := by
+ rw [prod_eq_pow_card, card_powersetLen]; rintro a ha; rw [(mem_powersetLen.1 ha).2]
+
@[to_additive]
theorem prod_flip {n : ℕ} (f : ℕ → β) :
(∏ r in range (n + 1), f (n - r)) = ∏ k in range (n + 1), f k := by
The hypothesis is that the function is trivial for all indices \geq N
, and the original conclusion is that for n \geq N
the product up to n
is equal to the product up to N
(namely range N+1
), but we can strengthen this by removing the index N
part. This change is especially important for simplifying products and sums with only the initial term nontrivial.
@@ -1232,7 +1232,7 @@ theorem prod_range_succ' (f : ℕ → β) :
@[to_additive]
theorem eventually_constant_prod {u : ℕ → β} {N : ℕ} (hu : ∀ n ≥ N, u n = 1) {n : ℕ} (hn : N ≤ n) :
- (∏ k in range (n + 1), u k) = ∏ k in range (N + 1), u k := by
+ (∏ k in range n, u k) = ∏ k in range N, u k := by
obtain ⟨m, rfl : n = N + m⟩ := le_iff_exists_add.mp hn
clear hn
induction' m with m hm
@@ -599,8 +599,8 @@ theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ →
refine' Eq.trans _ (prod_sigma s t fun p => f (p.1, p.2))
exact
prod_bij' (fun p _hp => ⟨p.1, p.2⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
- (fun p hp => congr_arg f Prod.mk.eta.symm) (fun p _hp => (p.1, p.2))
- (fun p => (h (p.1, p.2)).mpr ∘ mem_sigma.mp) (fun p _hp => Prod.mk.eta) fun p _hp => p.eta
+ (fun p _ => rfl) (fun p _hp => (p.1, p.2))
+ (fun p => (h (p.1, p.2)).mpr ∘ mem_sigma.mp) (fun p _ => rfl) fun p _hp => p.eta
#align finset.prod_finset_product Finset.prod_finset_product
#align finset.sum_finset_product Finset.sum_finset_product
@@ -619,8 +619,8 @@ theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t :
refine' Eq.trans _ (prod_sigma s t fun p => f (p.2, p.1))
exact
prod_bij' (fun p _hp => ⟨p.2, p.1⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
- (fun p hp => congr_arg f Prod.mk.eta.symm) (fun p _hp => (p.2, p.1))
- (fun p => (h (p.2, p.1)).mpr ∘ mem_sigma.mp) (fun p _hp => Prod.mk.eta) fun p _hp => p.eta
+ (fun p _c => rfl) (fun p _hp => (p.2, p.1))
+ (fun p => (h (p.2, p.1)).mpr ∘ mem_sigma.mp) (fun p _ => rfl) fun p _hp => p.eta
#align finset.prod_finset_product_right Finset.prod_finset_product_right
#align finset.sum_finset_product_right Finset.sum_finset_product_right
This incorporates changes from https://github.com/leanprover-community/mathlib4/pull/6575
I have also renamed Multiset.countp
to Multiset.countP
for consistency.
Co-authored-by: James Gallichio <jamesgallicchio@gmail.com>
Co-authored-by: James <jamesgallicchio@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -1308,10 +1308,10 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
#align finset.prod_list_count_of_subset Finset.prod_list_count_of_subset
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
-theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
- ∑ x in l.toFinset.filter p, l.count x = l.countp p := by
- simp [Finset.sum, sum_map_count_dedup_filter_eq_countp p l]
-#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countp
+theorem sum_filter_count_eq_countP [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
+ ∑ x in l.toFinset.filter p, l.count x = l.countP p := by
+ simp [Finset.sum, sum_map_count_dedup_filter_eq_countP p l]
+#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countP
open Multiset
@@ -1003,7 +1003,7 @@ theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α →
∏ x in s, (if p x then f x else g x) = ∏ x in s, g x := by
rw [prod_ite, filter_false_of_mem, filter_true_of_mem]
· simp only [prod_empty, one_mul]
- all_goals intros; simp; apply h; assumption
+ all_goals intros; apply h; assumption
#align finset.prod_ite_of_false Finset.prod_ite_of_false
#align finset.sum_ite_of_false Finset.sum_ite_of_false
@@ -1721,6 +1721,7 @@ theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏
#align finset.eq_one_of_prod_eq_one Finset.eq_one_of_prod_eq_one
#align finset.eq_zero_of_sum_eq_zero Finset.eq_zero_of_sum_eq_zero
+@[to_additive sum_boole_nsmul]
theorem prod_pow_boole [DecidableEq α] (s : Finset α) (f : α → β) (a : α) :
(∏ x in s, f x ^ ite (a = x) 1 0) = ite (a ∈ s) (f a) 1 := by simp
#align finset.prod_pow_boole Finset.prod_pow_boole
@@ -925,6 +925,10 @@ theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α)
#align finset.prod_subtype Finset.prod_subtype
#align finset.sum_subtype Finset.sum_subtype
+@[to_additive]
+theorem prod_set_coe (s : Set α) [Fintype s] : (∏ i : s, f i) = ∏ i in s.toFinset, f i :=
+(Finset.prod_subtype s.toFinset (fun _ ↦ Set.mem_toFinset) f).symm
+
/-- The product of a function `g` defined only on a set `s` is equal to
the product of a function `f` defined everywhere,
as long as `f` and `g` agree on `s`, and `f = 1` off `s`. -/
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -46,7 +46,7 @@ See the documentation of `to_additive.attr` for more information.
universe u v w
-variable {ι : Type _} {β : Type u} {α : Type v} {γ : Type w}
+variable {ι : Type*} {β : Type u} {α : Type v} {γ : Type w}
open Fin
@@ -201,7 +201,7 @@ theorem sum_multiset_singleton (s : Finset α) : (s.sum fun x => {x}) = s.val :=
end Finset
@[to_additive]
-theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type _} [MonoidHomClass G β γ] (g : G)
+theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [MonoidHomClass G β γ] (g : G)
(f : α → β) (s : Finset α) : g (∏ x in s, f x) = ∏ x in s, g (f x) := by
simp only [Finset.prod_eq_multiset_prod, map_multiset_prod, Multiset.map_map]; rfl
#align map_prod map_prod
@@ -521,14 +521,14 @@ theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
in the reverse direction, use `Finset.prod_sigma'`. -/
@[to_additive "Sum over a sigma type equals the sum of fiberwise sums. For rewriting
in the reverse direction, use `Finset.sum_sigma'`"]
-theorem prod_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
+theorem prod_sigma {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
∏ x in s.sigma t, f x = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
simp_rw [← disjiUnion_map_sigma_mk, prod_disjiUnion, prod_map, Function.Embedding.sigmaMk_apply]
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
@[to_additive]
-theorem prod_sigma' {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
+theorem prod_sigma' {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
(∏ a in s, ∏ s in t a, f a s) = ∏ x in s.sigma t, f x.1 x.2 :=
Eq.symm <| prod_sigma s t fun x => f x.1 x.2
#align finset.prod_sigma' Finset.prod_sigma'
@@ -931,7 +931,7 @@ as long as `f` and `g` agree on `s`, and `f = 1` off `s`. -/
@[to_additive "The sum of a function `g` defined only on a set `s` is equal to
the sum of a function `f` defined everywhere,
as long as `f` and `g` agree on `s`, and `f = 0` off `s`."]
-theorem prod_congr_set {α : Type _} [CommMonoid α] {β : Type _} [Fintype β] (s : Set β)
+theorem prod_congr_set {α : Type*} [CommMonoid α] {β : Type*} [Fintype β] (s : Set β)
[DecidablePred (· ∈ s)] (f : β → α) (g : s → α) (w : ∀ (x : β) (h : x ∈ s), f x = g ⟨x, h⟩)
(w' : ∀ x : β, x ∉ s → f x = 1) : Finset.univ.prod f = Finset.univ.prod g := by
rw [← @Finset.prod_subset _ _ s.toFinset Finset.univ f _ (by simp)]
@@ -1127,7 +1127,7 @@ theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
#align finset.sum_pi_single' Finset.sum_pi_single'
@[to_additive (attr := simp)]
-theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
+theorem prod_pi_mulSingle {β : α → Type*} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
(f : ∀ a, β a) (s : Finset α) :
(∏ a' in s, Pi.mulSingle a' (f a') a) = if a ∈ s then f a else 1 :=
prod_dite_eq _ _ _
@@ -1248,7 +1248,7 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
#align finset.sum_range_add Finset.sum_range_add
@[to_additive]
-theorem prod_range_add_div_prod_range {α : Type _} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
+theorem prod_range_add_div_prod_range {α : Type*} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
(∏ k in range (n + m), f k) / ∏ k in range n, f k = ∏ k in Finset.range m, f (n + k) :=
div_eq_of_eq_mul' (prod_range_add f n m)
#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_range
@@ -1269,7 +1269,7 @@ theorem prod_range_one (f : ℕ → β) : ∏ k in range 1, f k = f 0 := by
open List
@[to_additive]
-theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type _} [CommMonoid M] (f : α → M) :
+theorem prod_list_map_count [DecidableEq α] (l : List α) {M : Type*} [CommMonoid M] (f : α → M) :
(l.map f).prod = ∏ m in l.toFinset, f m ^ l.count m := by
induction' l with a s IH; · simp only [map_nil, prod_nil, count_nil, pow_zero, prod_const_one]
simp only [List.map, List.prod_cons, toFinset_cons, IH]
@@ -1312,7 +1312,7 @@ theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [Decidable
open Multiset
@[to_additive]
-theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type _} [CommMonoid M]
+theorem prod_multiset_map_count [DecidableEq α] (s : Multiset α) {M : Type*} [CommMonoid M]
(f : α → M) : (s.map f).prod = ∏ m in s.toFinset, f m ^ s.count m := by
refine' Quot.induction_on s fun l => _
simp [prod_list_map_count l f]
@@ -1352,7 +1352,7 @@ theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m
the property is multiplicative and holds on factors. -/
@[to_additive "To prove a property of a sum, it suffices to prove that
the property is additive and holds on summands."]
-theorem prod_induction {M : Type _} [CommMonoid M] (f : α → M) (p : M → Prop)
+theorem prod_induction {M : Type*} [CommMonoid M] (f : α → M) (p : M → Prop)
(hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p <| f x) :
p <| ∏ x in s, f x :=
Multiset.prod_induction _ _ hom unit (Multiset.forall_mem_map_iff.mpr base)
@@ -1363,7 +1363,7 @@ theorem prod_induction {M : Type _} [CommMonoid M] (f : α → M) (p : M → Pro
the property is multiplicative and holds on factors. -/
@[to_additive "To prove a property of a sum, it suffices to prove that
the property is additive and holds on summands."]
-theorem prod_induction_nonempty {M : Type _} [CommMonoid M] (f : α → M) (p : M → Prop)
+theorem prod_induction_nonempty {M : Type*} [CommMonoid M] (f : α → M) (p : M → Prop)
(hom : ∀ a b, p a → p b → p (a * b)) (nonempty : s.Nonempty) (base : ∀ x ∈ s, p <| f x) :
p <| ∏ x in s, f x :=
Multiset.prod_induction_nonempty p hom (by simp [nonempty_iff_ne_empty.mp nonempty])
@@ -1392,25 +1392,25 @@ theorem prod_range_induction (f s : ℕ → β) (base : s 0 = 1)
the ratio of the last and first factors. -/
@[to_additive "A telescoping sum along `{0, ..., n - 1}` of an additive commutative group valued
function reduces to the difference of the last and first terms."]
-theorem prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
+theorem prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
(∏ i in range n, f (i + 1) / f i) = f n / f 0 := by apply prod_range_induction <;> simp
#align finset.prod_range_div Finset.prod_range_div
#align finset.sum_range_sub Finset.sum_range_sub
@[to_additive]
-theorem prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
+theorem prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
(∏ i in range n, f i / f (i + 1)) = f 0 / f n := by apply prod_range_induction <;> simp
#align finset.prod_range_div' Finset.prod_range_div'
#align finset.sum_range_sub' Finset.sum_range_sub'
@[to_additive]
-theorem eq_prod_range_div {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
+theorem eq_prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
f n = f 0 * ∏ i in range n, f (i + 1) / f i := by rw [prod_range_div, mul_div_cancel'_right]
#align finset.eq_prod_range_div Finset.eq_prod_range_div
#align finset.eq_sum_range_sub Finset.eq_sum_range_sub
@[to_additive]
-theorem eq_prod_range_div' {M : Type _} [CommGroup M] (f : ℕ → M) (n : ℕ) :
+theorem eq_prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
f n = ∏ i in range (n + 1), if i = 0 then f 0 else f i / f (i - 1) := by
conv_lhs => rw [Finset.eq_prod_range_div f]
simp [Finset.prod_range_succ', mul_comm]
@@ -1690,7 +1690,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
#align finset.sum_ite_zero Finset.sum_ite_zero
@[to_additive]
-theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
+theorem prod_erase_lt_of_one_lt {γ : Type*} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
(hdf : 1 < f d) : ∏ m : α in s.erase d, f m < ∏ m : α in s, f m := by
conv in ∏ m in s, f m => rw [← Finset.insert_erase hd]
@@ -1730,7 +1730,7 @@ theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈
exact mul_dvd_mul (h a $ T.mem_insert_self a) (IH fun b hb ↦ h b $ Finset.mem_insert_of_mem hb)
#align finset.prod_dvd_prod_of_dvd Finset.prod_dvd_prod_of_dvd
-theorem prod_dvd_prod_of_subset {ι M : Type _} [CommMonoid M] (s t : Finset ι) (f : ι → M)
+theorem prod_dvd_prod_of_subset {ι M : Type*} [CommMonoid M] (s t : Finset ι) (f : ι → M)
(h : s ⊆ t) : (∏ i in s, f i) ∣ ∏ i in t, f i :=
Multiset.prod_dvd_prod_of_le <| Multiset.map_le_map <| by simpa
#align finset.prod_dvd_prod_of_subset Finset.prod_dvd_prod_of_subset
@@ -1847,7 +1847,7 @@ theorem prod_erase_eq_div {a : α} (h : a ∈ s) :
end CommGroup
@[simp]
-theorem card_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) :
+theorem card_sigma {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) :
card (s.sigma t) = ∑ a in s, card (t a) :=
Multiset.card_sigma _ _
#align finset.card_sigma Finset.card_sigma
@@ -1933,7 +1933,7 @@ theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := b
end ProdEqZero
@[to_additive]
-theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
+theorem prod_unique_nonempty {α β : Type*} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
(h : s.Nonempty) : ∏ x in s, f x = f default := by
rw [h.eq_singleton_default, Finset.prod_singleton]
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
@@ -1972,7 +1972,7 @@ See `Function.bijective.prod_comp` for a version without `h`. -/
`Function.bijective`.
See `Function.bijective.sum_comp` for a version without `h`. "]
-theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
+theorem prod_bijective {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
(he : Function.Bijective e) (f : α → M) (g : β → M) (h : ∀ x, f x = g (e x)) :
∏ x : α, f x = ∏ x : β, g x :=
prod_bij (fun x _ => e x) (fun x _ => mem_univ (e x)) (fun x _ => h x)
@@ -1990,27 +1990,27 @@ See `Equiv.prod_comp` for a version without `h`.
automatically fills in most arguments.
See `Equiv.sum_comp` for a version without `h`."]
-theorem prod_equiv {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
+theorem prod_equiv {α β M : Type*} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
(g : β → M) (h : ∀ x, f x = g (e x)) : ∏ x : α, f x = ∏ x : β, g x :=
prod_bijective e e.bijective f g h
#align fintype.prod_equiv Fintype.prod_equiv
#align fintype.sum_equiv Fintype.sum_equiv
@[to_additive]
-theorem prod_unique {α β : Type _} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
+theorem prod_unique {α β : Type*} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
∏ x : α, f x = f default := by rw [univ_unique, prod_singleton]
#align fintype.prod_unique Fintype.prod_unique
#align fintype.sum_unique Fintype.sum_unique
@[to_additive]
-theorem prod_empty {α β : Type _} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
+theorem prod_empty {α β : Type*} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
∏ x : α, f x = 1 :=
Finset.prod_of_empty _
#align fintype.prod_empty Fintype.prod_empty
#align fintype.sum_empty Fintype.sum_empty
@[to_additive]
-theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
+theorem prod_subsingleton {α β : Type*} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
(a : α) : ∏ x : α, f x = f a := by
haveI : Unique α := uniqueOfSubsingleton a
rw [prod_unique f, Subsingleton.elim default a]
@@ -2018,7 +2018,7 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
#align fintype.sum_subsingleton Fintype.sum_subsingleton
@[to_additive]
-theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
+theorem prod_subtype_mul_prod_subtype {α β : Type*} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
(∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by
classical
@@ -2035,7 +2035,7 @@ end Fintype
namespace List
@[to_additive]
-theorem prod_toFinset {M : Type _} [DecidableEq α] [CommMonoid M] (f : α → M) :
+theorem prod_toFinset {M : Type*} [DecidableEq α] [CommMonoid M] (f : α → M) :
∀ {l : List α} (_hl : l.Nodup), l.toFinset.prod f = (l.map f).prod
| [], _ => by simp
| a :: l, hl => by
@@ -2073,13 +2073,13 @@ theorem disjoint_sum_right {a : Multiset α} {i : Multiset (Multiset α)} :
simpa only [@disjoint_comm _ a] using disjoint_sum_left
#align multiset.disjoint_sum_right Multiset.disjoint_sum_right
-theorem disjoint_finset_sum_left {β : Type _} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
+theorem disjoint_finset_sum_left {β : Type*} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
Multiset.Disjoint (i.sum f) a ↔ ∀ b ∈ i, Multiset.Disjoint (f b) a := by
convert @disjoint_sum_left _ a (map f i.val)
simp [and_congr_left_iff, iff_self_iff]
#align multiset.disjoint_finset_sum_left Multiset.disjoint_finset_sum_left
-theorem disjoint_finset_sum_right {β : Type _} {i : Finset β} {f : β → Multiset α}
+theorem disjoint_finset_sum_right {β : Type*} {i : Finset β} {f : β → Multiset α}
{a : Multiset α} : Multiset.Disjoint a (i.sum f) ↔ ∀ b ∈ i, Multiset.Disjoint a (f b) := by
simpa only [disjoint_comm] using disjoint_finset_sum_left
#align multiset.disjoint_finset_sum_right Multiset.disjoint_finset_sum_right
@@ -2104,7 +2104,7 @@ theorem add_eq_union_right_of_le {x y z : Multiset α} (h : z ≤ y) :
simpa only [and_comm] using add_eq_union_left_of_le h
#align multiset.add_eq_union_right_of_le Multiset.add_eq_union_right_of_le
-theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β → Multiset α} :
+theorem finset_sum_eq_sup_iff_disjoint {β : Type*} {i : Finset β} {f : β → Multiset α} :
i.sum f = i.sup f ↔
∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) := by
induction' i using Finset.cons_induction_on with z i hz hr
@@ -2120,7 +2120,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
exact add_eq_union_left_of_le (Finset.sup_le fun x hx => le_sum_of_mem (mem_map_of_mem f hx))
#align multiset.finset_sum_eq_sup_iff_disjoint Multiset.finset_sum_eq_sup_iff_disjoint
-theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
+theorem sup_powerset_len {α : Type*} [DecidableEq α] (x : Multiset α) :
(Finset.sup (Finset.range (card x + 1)) fun k => x.powersetLen k) = x.powerset := by
convert bind_powerset_len x using 1
rw [Multiset.bind, Multiset.join, ← Finset.range_val, ← Finset.sum_eq_multiset_sum]
@@ -2168,7 +2168,7 @@ theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.pr
#align multiset.to_finset_prod_dvd_prod Multiset.toFinset_prod_dvd_prod
@[to_additive]
-theorem prod_sum {α : Type _} {ι : Type _} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
+theorem prod_sum {α : Type*} {ι : Type*} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
(∑ x in s, f x).prod = ∏ x in s, (f x).prod := by
classical
induction' s using Finset.induction_on with a t hat ih
@@ -2235,7 +2235,7 @@ theorem cast_multiset_sum [AddCommGroupWithOne β] (s : Multiset ℤ) :
#align int.cast_multiset_sum Int.cast_multiset_sum
@[simp, norm_cast]
-theorem cast_multiset_prod {R : Type _} [CommRing R] (s : Multiset ℤ) :
+theorem cast_multiset_prod {R : Type*} [CommRing R] (s : Multiset ℤ) :
(↑s.prod : R) = (s.map (↑)).prod :=
map_multiset_prod (castRingHom R) _
#align int.cast_multiset_prod Int.cast_multiset_prod
@@ -2247,7 +2247,7 @@ theorem cast_sum [AddCommGroupWithOne β] (s : Finset α) (f : α → ℤ) :
#align int.cast_sum Int.cast_sum
@[simp, norm_cast]
-theorem cast_prod {R : Type _} [CommRing R] (f : α → ℤ) (s : Finset α) :
+theorem cast_prod {R : Type*} [CommRing R] (f : α → ℤ) (s : Finset α) :
(↑(∏ i in s, f i) : R) = ∏ i in s, (f i : R) :=
(Int.castRingHom R).map_prod _ _
#align int.cast_prod Int.cast_prod
@@ -2255,7 +2255,7 @@ theorem cast_prod {R : Type _} [CommRing R] (f : α → ℤ) (s : Finset α) :
end Int
@[simp, norm_cast]
-theorem Units.coe_prod {M : Type _} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
+theorem Units.coe_prod {M : Type*} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
(↑(∏ i in s, f i) : M) = ∏ i in s, (f i : M) :=
(Units.coeHom M).map_prod _ _
#align units.coe_prod Units.coe_prod
@@ -2266,7 +2266,7 @@ theorem Units.mk0_prod [CommGroupWithZero β] (s : Finset α) (f : α → β) (h
classical induction s using Finset.induction_on <;> simp [*]
#align units.mk0_prod Units.mk0_prod
-theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
+theorem nat_abs_sum_le {ι : Type*} (s : Finset ι) (f : ι → ℤ) :
(∑ i in s, f i).natAbs ≤ ∑ i in s, (f i).natAbs := by
classical
induction' s using Finset.induction_on with i s his IH
@@ -121,7 +121,7 @@ scoped macro_rules (kind := bigsumin)
| `(∑ $x:ident in $s, $r) => `(Finset.sum $s (fun $x ↦ $r))
| `(∑ $x:ident : $t in $s, $p) => `(Finset.sum $s (fun $x:ident : $t ↦ $p))
-/-- `∏ x, f x` is notation for `Finset.prod s f`. It is the sum of `f x`,
+/-- `∏ x in s, f x` is notation for `Finset.prod s f`. It is the product of `f x`,
where `x` ranges over the finite set `s`. -/
scoped syntax (name := bigprodin) "∏ " extBinder " in " term ", " term:67 : term
scoped macro_rules (kind := bigprodin)
@@ -2,11 +2,6 @@
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-
-! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit fa2309577c7009ea243cffdf990cd6c84f0ad497
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.BigOperators.Multiset.Lemmas
import Mathlib.Algebra.Group.Pi
@@ -19,6 +14,8 @@ import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Multiset.Powerset
import Mathlib.Data.Set.Pairwise.Basic
+#align_import algebra.big_operators.basic from "leanprover-community/mathlib"@"fa2309577c7009ea243cffdf990cd6c84f0ad497"
+
/-!
# Big operators
This PR is the result of running
find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;
which firstly replaces .
focusing dots with ·
and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.
@@ -2111,8 +2111,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
i.sum f = i.sup f ↔
∀ (x) (_ : x ∈ i) (y) (_ : y ∈ i), x ≠ y → Multiset.Disjoint (f x) (f y) := by
induction' i using Finset.cons_induction_on with z i hz hr
- ·
- simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
+ · simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
· simp_rw [Finset.sum_cons hz, Finset.sup_cons, Finset.mem_cons, Multiset.sup_eq_union,
forall_eq_or_imp, Ne.def, IsEmpty.forall_iff, true_and_iff,
∑'
precedence (#5615)
∑
, ∏
and variants).([^a-zA-Zα-ωΑ-Ω'𝓝ℳ₀𝕂ₛ)]) \(([∑∏][^()∑∏]*,[^()∑∏:]*)\) ([⊂⊆=<≤])
replaced by $1 $2 $3
@@ -184,14 +184,14 @@ variable {s s₁ s₂ : Finset α} {a : α} {f g : α → β}
@[to_additive]
theorem prod_eq_multiset_prod [CommMonoid β] (s : Finset α) (f : α → β) :
- (∏ x in s, f x) = (s.1.map f).prod :=
+ ∏ x in s, f x = (s.1.map f).prod :=
rfl
#align finset.prod_eq_multiset_prod Finset.prod_eq_multiset_prod
#align finset.sum_eq_multiset_sum Finset.sum_eq_multiset_sum
@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
- (∏ x in s, f x) = s.fold ((· * ·) : β → β → β) 1 f :=
+ ∏ x in s, f x = s.fold ((· * ·) : β → β → β) 1 f :=
rfl
#align finset.prod_eq_fold Finset.prod_eq_fold
#align finset.sum_eq_fold Finset.sum_eq_fold
@@ -298,25 +298,25 @@ section CommMonoid
variable [CommMonoid β]
@[to_additive (attr := simp)]
-theorem prod_empty : (∏ x in ∅, f x) = 1 :=
+theorem prod_empty : ∏ x in ∅, f x = 1 :=
rfl
#align finset.prod_empty Finset.prod_empty
#align finset.sum_empty Finset.sum_empty
@[to_additive]
-theorem prod_of_empty [IsEmpty α] (s : Finset α) : (∏ i in s, f i) = 1 := by
+theorem prod_of_empty [IsEmpty α] (s : Finset α) : ∏ i in s, f i = 1 := by
rw [eq_empty_of_isEmpty s, prod_empty]
#align finset.prod_of_empty Finset.prod_of_empty
#align finset.sum_of_empty Finset.sum_of_empty
@[to_additive (attr := simp)]
-theorem prod_cons (h : a ∉ s) : (∏ x in cons a s h, f x) = f a * ∏ x in s, f x :=
+theorem prod_cons (h : a ∉ s) : ∏ x in cons a s h, f x = f a * ∏ x in s, f x :=
fold_cons h
#align finset.prod_cons Finset.prod_cons
#align finset.sum_cons Finset.sum_cons
@[to_additive (attr := simp)]
-theorem prod_insert [DecidableEq α] : a ∉ s → (∏ x in insert a s, f x) = f a * ∏ x in s, f x :=
+theorem prod_insert [DecidableEq α] : a ∉ s → ∏ x in insert a s, f x = f a * ∏ x in s, f x :=
fold_insert
#align finset.prod_insert Finset.prod_insert
#align finset.sum_insert Finset.sum_insert
@@ -326,7 +326,7 @@ the product over `s`, as long as `a` is in `s` or `f a = 1`. -/
@[to_additive (attr := simp) "The sum of `f` over `insert a s` is the same as
the sum over `s`, as long as `a` is in `s` or `f a = 0`."]
theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a = 1) :
- (∏ x in insert a s, f x) = ∏ x in s, f x := by
+ ∏ x in insert a s, f x = ∏ x in s, f x := by
by_cases hm : a ∈ s
· simp_rw [insert_eq_of_mem hm]
· rw [prod_insert hm, h hm, one_mul]
@@ -337,13 +337,13 @@ theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a =
the product over `s`, as long as `f a = 1`. -/
@[to_additive (attr := simp) "The sum of `f` over `insert a s` is the same as
the sum over `s`, as long as `f a = 0`."]
-theorem prod_insert_one [DecidableEq α] (h : f a = 1) : (∏ x in insert a s, f x) = ∏ x in s, f x :=
+theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x in insert a s, f x = ∏ x in s, f x :=
prod_insert_of_eq_one_if_not_mem fun _ => h
#align finset.prod_insert_one Finset.prod_insert_one
#align finset.sum_insert_zero Finset.sum_insert_zero
@[to_additive (attr := simp)]
-theorem prod_singleton : (∏ x in singleton a, f x) = f a :=
+theorem prod_singleton : ∏ x in singleton a, f x = f a :=
Eq.trans fold_singleton <| mul_one _
#align finset.prod_singleton Finset.prod_singleton
#align finset.sum_singleton Finset.sum_singleton
@@ -363,14 +363,14 @@ theorem prod_const_one : (∏ _x in s, (1 : β)) = 1 := by
@[to_additive (attr := simp)]
theorem prod_image [DecidableEq α] {s : Finset γ} {g : γ → α} :
- (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → (∏ x in s.image g, f x) = ∏ x in s, f (g x) :=
+ (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x in s.image g, f x = ∏ x in s, f (g x) :=
fold_image
#align finset.prod_image Finset.prod_image
#align finset.sum_image Finset.sum_image
@[to_additive (attr := simp)]
theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) :
- (∏ x in s.map e, f x) = ∏ x in s, f (e x) := by
+ ∏ x in s.map e, f x = ∏ x in s, f (e x) := by
rw [Finset.prod, Finset.map_val, Multiset.map_map]; rfl
#align finset.prod_map Finset.prod_map
#align finset.sum_map Finset.sum_map
@@ -383,7 +383,7 @@ theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.prod
@[to_additive]
theorem prod_disjUnion (h) :
- (∏ x in s₁.disjUnion s₂ h, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
+ ∏ x in s₁.disjUnion s₂ h, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
refine' Eq.trans _ (fold_disjUnion h)
rw [one_mul]
rfl
@@ -392,7 +392,7 @@ theorem prod_disjUnion (h) :
@[to_additive]
theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
- (∏ x in s.disjiUnion t h, f x) = ∏ i in s, ∏ x in t i, f x := by
+ ∏ x in s.disjiUnion t h, f x = ∏ i in s, ∏ x in t i, f x := by
refine' Eq.trans _ (fold_disjiUnion h)
dsimp [Finset.prod, Multiset.prod, Multiset.fold, Finset.disjUnion, Finset.fold]
congr
@@ -402,14 +402,14 @@ theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
@[to_additive]
theorem prod_union_inter [DecidableEq α] :
- ((∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
+ (∏ x in s₁ ∪ s₂, f x) * ∏ x in s₁ ∩ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x :=
fold_union_inter
#align finset.prod_union_inter Finset.prod_union_inter
#align finset.sum_union_inter Finset.sum_union_inter
@[to_additive]
theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
- (∏ x in s₁ ∪ s₂, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
+ ∏ x in s₁ ∪ s₂, f x = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
rw [← prod_union_inter, disjoint_iff_inter_eq_empty.mp h]; exact (mul_one _).symm
#align finset.prod_union Finset.prod_union
#align finset.sum_union Finset.sum_union
@@ -417,7 +417,7 @@ theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
@[to_additive]
theorem prod_filter_mul_prod_filter_not
(s : Finset α) (p : α → Prop) [DecidablePred p] [∀ x, Decidable (¬p x)] (f : α → β) :
- ((∏ x in s.filter p, f x) * ∏ x in s.filter fun x => ¬p x, f x) = ∏ x in s, f x := by
+ (∏ x in s.filter p, f x) * ∏ x in s.filter fun x => ¬p x, f x = ∏ x in s, f x := by
have := Classical.decEq α
rw [← prod_union (disjoint_filter_filter_neg s s p), filter_union_filter_neg_eq]
#align finset.prod_filter_mul_prod_filter_not Finset.prod_filter_mul_prod_filter_not
@@ -461,7 +461,7 @@ variable [Fintype α] [CommMonoid β]
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
- ((∏ i in s, f i) * ∏ i in t, f i) = ∏ i, f i :=
+ (∏ i in s, f i) * ∏ i in t, f i = ∏ i, f i :=
(Finset.prod_disjUnion h.disjoint).symm.trans <| by
classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top]; rfl
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
@@ -480,28 +480,28 @@ For a version expressed with subtypes, see `Fintype.prod_subtype_mul_prod_subtyp
@[to_additive "Adding the sums of a function over `s` and over `sᶜ` gives the whole sum.
For a version expressed with subtypes, see `Fintype.sum_subtype_add_sum_subtype`. "]
theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
- ((∏ i in s, f i) * ∏ i in sᶜ, f i) = ∏ i, f i :=
+ (∏ i in s, f i) * ∏ i in sᶜ, f i = ∏ i, f i :=
IsCompl.prod_mul_prod isCompl_compl f
#align finset.prod_mul_prod_compl Finset.prod_mul_prod_compl
#align finset.sum_add_sum_compl Finset.sum_add_sum_compl
@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
- ((∏ i in sᶜ, f i) * ∏ i in s, f i) = ∏ i, f i :=
+ (∏ i in sᶜ, f i) * ∏ i in s, f i = ∏ i, f i :=
(@isCompl_compl _ s _).symm.prod_mul_prod f
#align finset.prod_compl_mul_prod Finset.prod_compl_mul_prod
#align finset.sum_compl_add_sum Finset.sum_compl_add_sum
@[to_additive]
theorem prod_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) :
- ((∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x) = ∏ x in s₂, f x := by
+ (∏ x in s₂ \ s₁, f x) * ∏ x in s₁, f x = ∏ x in s₂, f x := by
rw [← prod_union sdiff_disjoint, sdiff_union_of_subset h]
#align finset.prod_sdiff Finset.prod_sdiff
#align finset.sum_sdiff Finset.sum_sdiff
@[to_additive (attr := simp)]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
- (∏ x in s.disjSum t, f x) = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) := by
+ ∏ x in s.disjSum t, f x = (∏ x in s, f (Sum.inl x)) * ∏ x in t, f (Sum.inr x) := by
rw [← map_inl_disjUnion_map_inr, prod_disjUnion, prod_map, prod_map]
rfl
#align finset.prod_disj_sum Finset.prod_disj_sum
@@ -509,13 +509,13 @@ theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : Sum α γ → β) :
@[to_additive]
theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ → β) :
- (∏ x in s.disjSum t, Sum.elim f g x) = (∏ x in s, f x) * ∏ x in t, g x := by simp
+ ∏ x in s.disjSum t, Sum.elim f g x = (∏ x in s, f x) * ∏ x in t, g x := by simp
#align finset.prod_sum_elim Finset.prod_sum_elim
#align finset.sum_sum_elim Finset.sum_sum_elim
@[to_additive]
theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
- (hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.biUnion t, f x) = ∏ x in s, ∏ i in t x, f i := by
+ (hs : Set.PairwiseDisjoint (↑s) t) : ∏ x in s.biUnion t, f x = ∏ x in s, ∏ i in t x, f i := by
rw [← disjiUnion_eq_biUnion _ _ hs, prod_disjiUnion]
#align finset.prod_bUnion Finset.prod_biUnion
#align finset.sum_bUnion Finset.sum_biUnion
@@ -525,7 +525,7 @@ in the reverse direction, use `Finset.prod_sigma'`. -/
@[to_additive "Sum over a sigma type equals the sum of fiberwise sums. For rewriting
in the reverse direction, use `Finset.sum_sigma'`"]
theorem prod_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
- (∏ x in s.sigma t, f x) = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
+ ∏ x in s.sigma t, f x = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
simp_rw [← disjiUnion_map_sigma_mk, prod_disjiUnion, prod_map, Function.Embedding.sigmaMk_apply]
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
@@ -549,7 +549,7 @@ theorem prod_sigma' {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ
theorem prod_bij {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β} (i : ∀ a ∈ s, γ)
(hi : ∀ a ha, i a ha ∈ t) (h : ∀ a ha, f a = g (i a ha))
(i_inj : ∀ a₁ a₂ ha₁ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
- (i_surj : ∀ b ∈ t, ∃ a ha, b = i a ha) : (∏ x in s, f x) = ∏ x in t, g x :=
+ (i_surj : ∀ b ∈ t, ∃ a ha, b = i a ha) : ∏ x in s, f x = ∏ x in t, g x :=
congr_arg Multiset.prod (Multiset.map_eq_map_of_bij_of_nodup f g s.2 t.2 i hi h i_inj i_surj)
#align finset.prod_bij Finset.prod_bij
#align finset.sum_bij Finset.sum_bij
@@ -566,7 +566,7 @@ theorem prod_bij {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
theorem prod_bij' {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β} (i : ∀ a ∈ s, γ)
(hi : ∀ a ha, i a ha ∈ t) (h : ∀ a ha, f a = g (i a ha)) (j : ∀ a ∈ t, α)
(hj : ∀ a ha, j a ha ∈ s) (left_inv : ∀ a ha, j (i a ha) (hi a ha) = a)
- (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) : (∏ x in s, f x) = ∏ x in t, g x := by
+ (right_inv : ∀ a ha, i (j a ha) (hj a ha) = a) : ∏ x in s, f x = ∏ x in t, g x := by
refine' prod_bij i hi h _ _
· intro a1 a2 h1 h2 eq
rw [← left_inv a1 h1, ← left_inv a2 h2]
@@ -583,7 +583,7 @@ See `Equiv.prod_comp` for the version where `s` and `s'` are `univ`. -/
@[to_additive " Reindexing a sum over a finset along an equivalence.
See `Equiv.sum_comp` for the version where `s` and `s'` are `univ`. "]
theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι' → β) {s' : Finset ι'}
- {s : Finset ι} (h : s = s'.image e.symm) : (∏ i' in s', f i') = ∏ i in s, f (e i) := by
+ {s : Finset ι} (h : s = s'.image e.symm) : ∏ i' in s', f i' = ∏ i in s, f (e i) := by
rw [h]
refine'
Finset.prod_bij' (fun i' _hi' => e.symm i') (fun a ha => Finset.mem_image_of_mem _ ha)
@@ -598,7 +598,7 @@ theorem Equiv.prod_comp_finset {ι'} [DecidableEq ι] (e : ι ≃ ι') (f : ι'
@[to_additive]
theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ × α → β} :
- (∏ p in r, f p) = ∏ c in s, ∏ a in t c, f (c, a) := by
+ ∏ p in r, f p = ∏ c in s, ∏ a in t c, f (c, a) := by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.1, p.2))
exact
prod_bij' (fun p _hp => ⟨p.1, p.2⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
@@ -610,7 +610,7 @@ theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ →
@[to_additive]
theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ → α → β} :
- (∏ p in r, f p.1 p.2) = ∏ c in s, ∏ a in t c, f c a :=
+ ∏ p in r, f p.1 p.2 = ∏ c in s, ∏ a in t c, f c a :=
prod_finset_product r s t h
#align finset.prod_finset_product' Finset.prod_finset_product'
#align finset.sum_finset_product' Finset.sum_finset_product'
@@ -618,7 +618,7 @@ theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ →
@[to_additive]
theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α × γ → β} :
- (∏ p in r, f p) = ∏ c in s, ∏ a in t c, f (a, c) := by
+ ∏ p in r, f p = ∏ c in s, ∏ a in t c, f (a, c) := by
refine' Eq.trans _ (prod_sigma s t fun p => f (p.2, p.1))
exact
prod_bij' (fun p _hp => ⟨p.2, p.1⟩) (fun p => mem_sigma.mpr ∘ (h p).mp)
@@ -630,7 +630,7 @@ theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t :
@[to_additive]
theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
(h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α → γ → β} :
- (∏ p in r, f p.1 p.2) = ∏ c in s, ∏ a in t c, f a c :=
+ ∏ p in r, f p.1 p.2 = ∏ c in s, ∏ a in t c, f a c :=
prod_finset_product_right r s t h
#align finset.prod_finset_product_right' Finset.prod_finset_product_right'
#align finset.sum_finset_product_right' Finset.sum_finset_product_right'
@@ -646,9 +646,9 @@ theorem prod_fiberwise_of_maps_to [DecidableEq γ] {s : Finset α} {t : Finset
@[to_additive]
theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ → β)
(eq : ∀ c ∈ s, f (g c) = ∏ x in s.filter fun c' => g c' = g c, h x) :
- (∏ x in s.image g, f x) = ∏ x in s, h x :=
+ ∏ x in s.image g, f x = ∏ x in s, h x :=
calc
- (∏ x in s.image g, f x) = ∏ x in s.image g, ∏ x in s.filter fun c' => g c' = x, h x :=
+ ∏ x in s.image g, f x = ∏ x in s.image g, ∏ x in s.filter fun c' => g c' = x, h x :=
(prod_congr rfl) fun _x hx =>
let ⟨c, hcs, hc⟩ := mem_image.1 hx
hc ▸ eq c hcs
@@ -657,14 +657,14 @@ theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ →
#align finset.sum_image' Finset.sum_image'
@[to_additive]
-theorem prod_mul_distrib : (∏ x in s, f x * g x) = (∏ x in s, f x) * ∏ x in s, g x :=
+theorem prod_mul_distrib : ∏ x in s, f x * g x = (∏ x in s, f x) * ∏ x in s, g x :=
Eq.trans (by rw [one_mul]; rfl) fold_op_distrib
#align finset.prod_mul_distrib Finset.prod_mul_distrib
#align finset.sum_add_distrib Finset.sum_add_distrib
@[to_additive]
theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- (∏ x in s ×ˢ t, f x) = ∏ x in s, ∏ y in t, f (x, y) :=
+ ∏ x in s ×ˢ t, f x = ∏ x in s, ∏ y in t, f (x, y) :=
prod_finset_product (s ×ˢ t) s (fun _a => t) fun _p => mem_product
#align finset.prod_product Finset.prod_product
#align finset.sum_product Finset.sum_product
@@ -672,14 +672,14 @@ theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
/-- An uncurried version of `Finset.prod_product`. -/
@[to_additive "An uncurried version of `Finset.sum_product`"]
theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s ×ˢ t, f x.1 x.2) = ∏ x in s, ∏ y in t, f x y :=
+ ∏ x in s ×ˢ t, f x.1 x.2 = ∏ x in s, ∏ y in t, f x y :=
prod_product
#align finset.prod_product' Finset.prod_product'
#align finset.sum_product' Finset.sum_product'
@[to_additive]
theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- (∏ x in s ×ˢ t, f x) = ∏ y in t, ∏ x in s, f (x, y) :=
+ ∏ x in s ×ˢ t, f x = ∏ y in t, ∏ x in s, f (x, y) :=
prod_finset_product_right (s ×ˢ t) t (fun _a => s) fun _p => mem_product.trans and_comm
#align finset.prod_product_right Finset.prod_product_right
#align finset.sum_product_right Finset.sum_product_right
@@ -687,7 +687,7 @@ theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β}
/-- An uncurried version of `Finset.prod_product_right`. -/
@[to_additive "An uncurried version of `Finset.prod_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s ×ˢ t, f x.1 x.2) = ∏ y in t, ∏ x in s, f x y :=
+ ∏ x in s ×ˢ t, f x.1 x.2 = ∏ y in t, ∏ x in s, f x y :=
prod_product_right
#align finset.prod_product_right' Finset.prod_product_right'
#align finset.sum_product_right' Finset.sum_product_right'
@@ -728,16 +728,16 @@ theorem prod_hom_rel [CommMonoid γ] {r : β → γ → Prop} {f : α → β} {g
#align finset.sum_hom_rel Finset.sum_hom_rel
@[to_additive]
-theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : (∏ x in s, f x) = 1 :=
+theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) : ∏ x in s, f x = 1 :=
calc
- (∏ x in s, f x) = ∏ _x in s, 1 := Finset.prod_congr rfl h
+ ∏ x in s, f x = ∏ _x in s, 1 := Finset.prod_congr rfl h
_ = 1 := Finset.prod_const_one
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
@[to_additive]
theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀ x ∈ s₂ \ s₁, g x = 1)
- (hfg : ∀ x ∈ s₁, f x = g x) : (∏ i in s₁, f i) = ∏ i in s₂, g i := by
+ (hfg : ∀ x ∈ s₁, f x = g x) : ∏ i in s₁, f i = ∏ i in s₂, g i := by
rw [← prod_sdiff h, prod_eq_one hg, one_mul]
exact prod_congr rfl hfg
#align finset.prod_subset_one_on_sdiff Finset.prod_subset_one_on_sdiff
@@ -745,7 +745,7 @@ theorem prod_subset_one_on_sdiff [DecidableEq α] (h : s₁ ⊆ s₂) (hg : ∀
@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
- (∏ x in s₁, f x) = ∏ x in s₂, f x :=
+ ∏ x in s₁, f x = ∏ x in s₂, f x :=
haveI := Classical.decEq α
prod_subset_one_on_sdiff h (by simpa) fun _ _ => rfl
#align finset.prod_subset Finset.prod_subset
@@ -753,7 +753,7 @@ theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x
@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
- (∏ x in s.filter p, f x) = ∏ x in s, f x :=
+ ∏ x in s.filter p, f x = ∏ x in s, f x :=
(prod_subset (filter_subset _ _)) fun x => by
classical
rw [not_imp_comm, mem_filter]
@@ -765,16 +765,16 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
-- instance first; `{∀ x, Decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
theorem prod_filter_ne_one [∀ x, Decidable (f x ≠ 1)] :
- (∏ x in s.filter fun x => f x ≠ 1, f x) = ∏ x in s, f x :=
+ ∏ x in s.filter fun x => f x ≠ 1, f x = ∏ x in s, f x :=
prod_filter_of_ne fun _ _ => id
#align finset.prod_filter_ne_one Finset.prod_filter_ne_one
#align finset.sum_filter_ne_zero Finset.sum_filter_ne_zero
@[to_additive]
theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
- (∏ a in s.filter p, f a) = ∏ a in s, if p a then f a else 1 :=
+ ∏ a in s.filter p, f a = ∏ a in s, if p a then f a else 1 :=
calc
- (∏ a in s.filter p, f a) = ∏ a in s.filter p, if p a then f a else 1 :=
+ ∏ a in s.filter p, f a = ∏ a in s.filter p, if p a then f a else 1 :=
prod_congr rfl fun a h => by rw [if_pos]; simpa using (mem_filter.1 h).2
_ = ∏ a in s, if p a then f a else 1 := by
{ refine' prod_subset (filter_subset _ s) fun x hs h => _
@@ -785,10 +785,10 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
@[to_additive]
theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a ∈ s)
- (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : (∏ x in s, f x) = f a := by
+ (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x in s, f x = f a := by
haveI := Classical.decEq α
calc
- (∏ x in s, f x) = ∏ x in {a}, f x := by
+ ∏ x in s, f x = ∏ x in {a}, f x := by
{ refine' (prod_subset _ _).symm
· intro _ H
rwa [mem_singleton.1 H]
@@ -799,7 +799,7 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
@[to_additive]
theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
- (h₁ : a ∉ s → f a = 1) : (∏ x in s, f x) = f a :=
+ (h₁ : a ∉ s → f a = 1) : ∏ x in s, f x = f a :=
haveI := Classical.decEq α
by_cases (prod_eq_single_of_mem a · h₀) fun this =>
(prod_congr rfl fun b hb => h₀ b hb <| by rintro rfl; exact this hb).trans <|
@@ -809,7 +809,7 @@ theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b
@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
- (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : (∏ x in s, f x) = f a * f b := by
+ (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x in s, f x = f a * f b := by
haveI := Classical.decEq α; let s' := ({a, b} : Finset α)
have hu : s' ⊆ s := by
refine' insert_subset_iff.mpr _
@@ -832,7 +832,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
@[to_additive]
theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) :
- (∏ x in s, f x) = f a * f b := by
+ ∏ x in s, f x = f a * f b := by
haveI := Classical.decEq α; by_cases h₁ : a ∈ s <;> by_cases h₂ : b ∈ s
· exact prod_eq_mul_of_mem a b h₁ h₂ hn h₀
· rw [hb h₂, mul_one]
@@ -851,10 +851,10 @@ theorem prod_eq_mul {s : Finset α} {f : α → β} (a b : α) (hn : a ≠ b)
#align finset.sum_eq_add Finset.sum_eq_add
@[to_additive]
-theorem prod_attach {f : α → β} : (∏ x in s.attach, f x) = ∏ x in s, f x :=
+theorem prod_attach {f : α → β} : ∏ x in s.attach, f x = ∏ x in s, f x :=
haveI := Classical.decEq α
calc
- (∏ x in s.attach, f x.val) = ∏ x in s.attach.image Subtype.val, f x := by
+ ∏ x in s.attach, f x.val = ∏ x in s.attach.image Subtype.val, f x := by
{ rw [prod_image]; exact fun x _ y _ => Subtype.eq }
_ = _ := by rw [attach_image_val]
#align finset.prod_attach Finset.prod_attach
@@ -865,7 +865,7 @@ theorem prod_attach {f : α → β} : (∏ x in s.attach, f x) = ∏ x in s, f x
@[to_additive (attr := simp, nolint simpNF)
"A sum over `s.subtype p` equals one over `s.filter p`."]
theorem prod_subtype_eq_prod_filter (f : α → β) {p : α → Prop} [DecidablePred p] :
- (∏ x in s.subtype p, f x) = ∏ x in s.filter p, f x := by
+ ∏ x in s.subtype p, f x = ∏ x in s.filter p, f x := by
conv_lhs => erw [← prod_map (s.subtype p) (Function.Embedding.subtype _) f]
exact prod_congr (subtype_map _) fun x _hx => rfl
#align finset.prod_subtype_eq_prod_filter Finset.prod_subtype_eq_prod_filter
@@ -876,7 +876,7 @@ over `s.subtype p` equals that product over `s`. -/
@[to_additive "If all elements of a `Finset` satisfy the predicate `p`, a sum
over `s.subtype p` equals that sum over `s`."]
theorem prod_subtype_of_mem (f : α → β) {p : α → Prop} [DecidablePred p] (h : ∀ x ∈ s, p x) :
- (∏ x in s.subtype p, f x) = ∏ x in s, f x := by
+ ∏ x in s.subtype p, f x = ∏ x in s, f x := by
rw [prod_subtype_eq_prod_filter, filter_true_of_mem]
simpa using h
#align finset.prod_subtype_of_mem Finset.prod_subtype_of_mem
@@ -899,13 +899,13 @@ theorem prod_subtype_map_embedding {p : α → Prop} {s : Finset { x // p x }} {
variable (f s)
@[to_additive]
-theorem prod_coe_sort_eq_attach (f : s → β) : (∏ i : s, f i) = ∏ i in s.attach, f i :=
+theorem prod_coe_sort_eq_attach (f : s → β) : ∏ i : s, f i = ∏ i in s.attach, f i :=
rfl
#align finset.prod_coe_sort_eq_attach Finset.prod_coe_sort_eq_attach
#align finset.sum_coe_sort_eq_attach Finset.sum_coe_sort_eq_attach
@[to_additive]
-theorem prod_coe_sort : (∏ i : s, f i) = ∏ i in s, f i :=
+theorem prod_coe_sort : ∏ i : s, f i = ∏ i in s, f i :=
prod_attach
#align finset.prod_coe_sort Finset.prod_coe_sort
#align finset.sum_coe_sort Finset.sum_coe_sort
@@ -920,7 +920,7 @@ variable {f s}
@[to_additive]
theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α) (h : ∀ x, x ∈ s ↔ p x)
- (f : α → β) : (∏ a in s, f a) = ∏ a : Subtype p, f a := by
+ (f : α → β) : ∏ a in s, f a = ∏ a : Subtype p, f a := by
have : (· ∈ s) = p := Set.ext h
subst p
rw [← prod_coe_sort]
@@ -982,7 +982,7 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {_hp : DecidablePred p}
@[to_additive]
theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f : ∀ x : α, p x → β)
(g : ∀ x : α, ¬p x → β) :
- (∏ x in s, if hx : p x then f x hx else g x hx) =
+ ∏ x in s, (if hx : p x then f x hx else g x hx) =
(∏ x in (s.filter p).attach, f x.1 (by simpa using (mem_filter.mp x.2).2)) *
∏ x in (s.filter fun x => ¬p x).attach, g x.1 (by simpa using (mem_filter.mp x.2).2) := by
simp [prod_apply_dite _ _ fun x => x]
@@ -991,7 +991,7 @@ theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f :
@[to_additive]
theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g : α → β) :
- (∏ x in s, if p x then f x else g x) =
+ ∏ x in s, (if p x then f x else g x) =
(∏ x in s.filter p, f x) * ∏ x in s.filter fun x => ¬p x, g x := by
simp [prod_apply_ite _ _ fun x => x]
#align finset.prod_ite Finset.prod_ite
@@ -999,7 +999,7 @@ theorem prod_ite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f g :
@[to_additive]
theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α → β) (h : ∀ x ∈ s, ¬p x) :
- (∏ x in s, if p x then f x else g x) = ∏ x in s, g x := by
+ ∏ x in s, (if p x then f x else g x) = ∏ x in s, g x := by
rw [prod_ite, filter_false_of_mem, filter_true_of_mem]
· simp only [prod_empty, one_mul]
all_goals intros; simp; apply h; assumption
@@ -1008,7 +1008,7 @@ theorem prod_ite_of_false {p : α → Prop} {hp : DecidablePred p} (f g : α →
@[to_additive]
theorem prod_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → β) (h : ∀ x ∈ s, p x) :
- (∏ x in s, if p x then f x else g x) = ∏ x in s, f x := by
+ ∏ x in s, (if p x then f x else g x) = ∏ x in s, f x := by
simp_rw [← ite_not (p _)]
apply prod_ite_of_false
simpa
@@ -1033,21 +1033,21 @@ theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g :
@[to_additive]
theorem prod_extend_by_one [DecidableEq α] (s : Finset α) (f : α → β) :
- (∏ i in s, if i ∈ s then f i else 1) = ∏ i in s, f i :=
+ ∏ i in s, (if i ∈ s then f i else 1) = ∏ i in s, f i :=
(prod_congr rfl) fun _i hi => if_pos hi
#align finset.prod_extend_by_one Finset.prod_extend_by_one
#align finset.sum_extend_by_zero Finset.sum_extend_by_zero
@[to_additive (attr := simp)]
theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
- (∏ i in s, if i ∈ t then f i else 1) = ∏ i in s ∩ t, f i := by
+ ∏ i in s, (if i ∈ t then f i else 1) = ∏ i in s ∩ t, f i := by
rw [← Finset.prod_filter, Finset.filter_mem_eq_inter]
#align finset.prod_ite_mem Finset.prod_ite_mem
#align finset.sum_ite_mem Finset.sum_ite_mem
@[to_additive (attr := simp)]
theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, a = x → β) :
- (∏ x in s, if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
+ ∏ x in s, (if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
· intros _ _ h
@@ -1064,7 +1064,7 @@ theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α,
@[to_additive (attr := simp)]
theorem prod_dite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, x = a → β) :
- (∏ x in s, if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
+ ∏ x in s, (if h : x = a then b x h else 1) = ite (a ∈ s) (b a rfl) 1 := by
split_ifs with h
· rw [Finset.prod_eq_single a, dif_pos rfl]
· intros _ _ h
@@ -1102,21 +1102,21 @@ theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
@[to_additive]
theorem prod_ite_index (p : Prop) [Decidable p] (s t : Finset α) (f : α → β) :
- (∏ x in if p then s else t, f x) = if p then ∏ x in s, f x else ∏ x in t, f x :=
+ ∏ x in if p then s else t, f x = if p then ∏ x in s, f x else ∏ x in t, f x :=
apply_ite (fun s => ∏ x in s, f x) _ _ _
#align finset.prod_ite_index Finset.prod_ite_index
#align finset.sum_ite_index Finset.sum_ite_index
@[to_additive (attr := simp)]
theorem prod_ite_irrel (p : Prop) [Decidable p] (s : Finset α) (f g : α → β) :
- (∏ x in s, if p then f x else g x) = if p then ∏ x in s, f x else ∏ x in s, g x := by
+ ∏ x in s, (if p then f x else g x) = if p then ∏ x in s, f x else ∏ x in s, g x := by
split_ifs with h <;> rfl
#align finset.prod_ite_irrel Finset.prod_ite_irrel
#align finset.sum_ite_irrel Finset.sum_ite_irrel
@[to_additive (attr := simp)]
theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α → β) (g : ¬p → α → β) :
- (∏ x in s, if h : p then f h x else g h x) =
+ ∏ x in s, (if h : p then f h x else g h x) =
if h : p then ∏ x in s, f h x else ∏ x in s, g h x := by
split_ifs with h <;> rfl
#align finset.prod_dite_irrel Finset.prod_dite_irrel
@@ -1124,7 +1124,7 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
@[to_additive (attr := simp)]
theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
- (∏ a' in s, Pi.mulSingle a x a') = if a ∈ s then x else 1 :=
+ ∏ a' in s, Pi.mulSingle a x a' = if a ∈ s then x else 1 :=
prod_dite_eq' _ _ _
#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
@@ -1141,10 +1141,10 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i : ∀ a ∈ s, f a ≠ 1 → γ) (hi : ∀ a h₁ h₂, i a h₁ h₂ ∈ t)
(i_inj : ∀ a₁ a₂ h₁₁ h₁₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
- (∏ x in s, f x) = ∏ x in t, g x := by
+ ∏ x in s, f x = ∏ x in t, g x := by
classical
calc
- (∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
+ ∏ x in s, f x = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
_ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
prod_bij (fun a ha => i a (mem_filter.mp ha).1 $ by simpa using (mem_filter.mp ha).2)
?_ ?_ ?_ ?_
@@ -1171,7 +1171,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
@[to_additive]
theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, ¬p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
- (∏ x in s, if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) :=
+ ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, g x.val (h x.val x.property) :=
prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp)
(fun a ha => by
dsimp
@@ -1183,7 +1183,7 @@ theorem prod_dite_of_false {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
@[to_additive]
theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x ∈ s, p x)
(f : ∀ x : α, p x → β) (g : ∀ x : α, ¬p x → β) :
- (∏ x in s, if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) :=
+ ∏ x in s, (if hx : p x then f x hx else g x hx) = ∏ x : s, f x.val (h x.val x.property) :=
prod_bij (fun x hx => ⟨x, hx⟩) (fun x hx => by simp)
(fun a ha => by
dsimp
@@ -1193,13 +1193,13 @@ theorem prod_dite_of_true {p : α → Prop} {hp : DecidablePred p} (h : ∀ x
#align finset.sum_dite_of_true Finset.sum_dite_of_true
@[to_additive]
-theorem nonempty_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : s.Nonempty :=
+theorem nonempty_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : s.Nonempty :=
s.eq_empty_or_nonempty.elim (fun H => False.elim <| h <| H.symm ▸ prod_empty) id
#align finset.nonempty_of_prod_ne_one Finset.nonempty_of_prod_ne_one
#align finset.nonempty_of_sum_ne_zero Finset.nonempty_of_sum_ne_zero
@[to_additive]
-theorem exists_ne_one_of_prod_ne_one (h : (∏ x in s, f x) ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
+theorem exists_ne_one_of_prod_ne_one (h : ∏ x in s, f x ≠ 1) : ∃ a ∈ s, f a ≠ 1 := by
classical
rw [← prod_filter_ne_one] at h
rcases nonempty_of_prod_ne_one h with ⟨x, hx⟩
@@ -1252,18 +1252,18 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
@[to_additive]
theorem prod_range_add_div_prod_range {α : Type _} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
- ((∏ k in range (n + m), f k) / ∏ k in range n, f k) = ∏ k in Finset.range m, f (n + k) :=
+ (∏ k in range (n + m), f k) / ∏ k in range n, f k = ∏ k in Finset.range m, f (n + k) :=
div_eq_of_eq_mul' (prod_range_add f n m)
#align finset.prod_range_add_div_prod_range Finset.prod_range_add_div_prod_range
#align finset.sum_range_add_sub_sum_range Finset.sum_range_add_sub_sum_range
@[to_additive]
-theorem prod_range_zero (f : ℕ → β) : (∏ k in range 0, f k) = 1 := by rw [range_zero, prod_empty]
+theorem prod_range_zero (f : ℕ → β) : ∏ k in range 0, f k = 1 := by rw [range_zero, prod_empty]
#align finset.prod_range_zero Finset.prod_range_zero
#align finset.sum_range_zero Finset.sum_range_zero
@[to_additive sum_range_one]
-theorem prod_range_one (f : ℕ → β) : (∏ k in range 1, f k) = f 0 := by
+theorem prod_range_one (f : ℕ → β) : ∏ k in range 1, f k = f 0 := by
rw [range_one]
apply @prod_singleton β ℕ 0 f
#align finset.prod_range_one Finset.prod_range_one
@@ -1308,7 +1308,7 @@ theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α)
#align finset.sum_list_count_of_subset Finset.sum_list_count_of_subset
theorem sum_filter_count_eq_countp [DecidableEq α] (p : α → Prop) [DecidablePred p] (l : List α) :
- (∑ x in l.toFinset.filter p, l.count x) = l.countp p := by
+ ∑ x in l.toFinset.filter p, l.count x = l.countp p := by
simp [Finset.sum, sum_map_count_dedup_filter_eq_countp p l]
#align finset.sum_filter_count_eq_countp Finset.sum_filter_count_eq_countp
@@ -1342,7 +1342,7 @@ theorem prod_multiset_count_of_subset [DecidableEq α] [CommMonoid α] (m : Mult
@[to_additive]
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
- (hfg : ∀ x, f x = g x) : (∏ x : { x // x ∈ m }, f x) = ∏ x in m.toFinset, g x :=
+ (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x in m.toFinset, g x :=
prod_bij (fun x _ => x.1) (fun x _ => Multiset.mem_toFinset.mpr x.2) (fun _ _ => hfg _)
(fun _ _ _ _ h => by
ext
@@ -1384,7 +1384,7 @@ verify that it's equal to a different function just by checking differences of a
This is a discrete analogue of the fundamental theorem of calculus."]
theorem prod_range_induction (f s : ℕ → β) (base : s 0 = 1)
(step : ∀ n, s (n + 1) = s n * f n) (n : ℕ) :
- (∏ k in Finset.range n, f k) = s n := by
+ ∏ k in Finset.range n, f k = s n := by
induction' n with k hk
· rw [Finset.prod_range_zero, base]
· simp only [hk, Finset.prod_range_succ, step, mul_comm]
@@ -1437,13 +1437,13 @@ theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
#align finset.sum_range_tsub Finset.sum_range_tsub
@[to_additive (attr := simp)]
-theorem prod_const (b : β) : (∏ _x in s, b) = b ^ s.card :=
+theorem prod_const (b : β) : ∏ _x in s, b = b ^ s.card :=
(congr_arg _ <| s.val.map_const b).trans <| Multiset.prod_replicate s.card b
#align finset.prod_const Finset.prod_const
#align finset.sum_const Finset.sum_const
@[to_additive sum_eq_card_nsmul]
-theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : (∏ a in s, f a) = b ^ s.card :=
+theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : ∏ a in s, f a = b ^ s.card :=
(prod_congr rfl hf).trans <| prod_const _
#align finset.prod_eq_pow_card Finset.prod_eq_pow_card
#align finset.sum_eq_card_nsmul Finset.sum_eq_card_nsmul
@@ -1454,7 +1454,7 @@ theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k in range n, b := by s
#align finset.nsmul_eq_sum_const Finset.nsmul_eq_sum_const
@[to_additive]
-theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : (∏ x in s, f x ^ n) = (∏ x in s, f x) ^ n :=
+theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x in s, f x ^ n = (∏ x in s, f x) ^ n :=
Multiset.prod_map_pow
#align finset.prod_pow Finset.prod_pow
#align finset.sum_nsmul Finset.sum_nsmul
@@ -1473,7 +1473,7 @@ theorem prod_flip {n : ℕ} (f : ℕ → β) :
theorem prod_involution {s : Finset α} {f : α → β} :
∀ (g : ∀ a ∈ s, α) (_ : ∀ a ha, f a * f (g a ha) = 1) (_ : ∀ a ha, f a ≠ 1 → g a ha ≠ a)
(g_mem : ∀ a ha, g a ha ∈ s) (_ : ∀ a ha, g (g a ha) (g_mem a ha) = a),
- (∏ x in s, f x) = 1 := by
+ ∏ x in s, f x = 1 := by
haveI := Classical.decEq α; haveI := Classical.decEq β
exact
Finset.strongInductionOn s fun s ih g h g_ne g_mem g_inv =>
@@ -1542,7 +1542,7 @@ theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
@[to_additive]
theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α → β) :
- ((∏ x in s ∩ t, f x) * ∏ x in s \ t, f x) = ∏ x in s, f x := by
+ (∏ x in s ∩ t, f x) * ∏ x in s \ t, f x = ∏ x in s, f x := by
convert (s.prod_piecewise t f f).symm
simp [Finset.piecewise]
#align finset.prod_inter_mul_prod_diff Finset.prod_inter_mul_prod_diff
@@ -1550,7 +1550,7 @@ theorem prod_inter_mul_prod_diff [DecidableEq α] (s t : Finset α) (f : α →
@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : (∏ x in s, f x) = f i * ∏ x in s \ {i}, f x := by
+ (f : α → β) : ∏ x in s, f x = f i * ∏ x in s \ {i}, f x := by
convert (s.prod_inter_mul_prod_diff {i} f).symm
simp [h]
#align finset.prod_eq_mul_prod_diff_singleton Finset.prod_eq_mul_prod_diff_singleton
@@ -1558,21 +1558,21 @@ theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α
@[to_additive]
theorem prod_eq_prod_diff_singleton_mul [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
- (f : α → β) : (∏ x in s, f x) = (∏ x in s \ {i}, f x) * f i := by
+ (f : α → β) : ∏ x in s, f x = (∏ x in s \ {i}, f x) * f i := by
rw [prod_eq_mul_prod_diff_singleton h, mul_comm]
#align finset.prod_eq_prod_diff_singleton_mul Finset.prod_eq_prod_diff_singleton_mul
#align finset.sum_eq_sum_diff_singleton_add Finset.sum_eq_sum_diff_singleton_add
@[to_additive]
theorem _root_.Fintype.prod_eq_mul_prod_compl [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
- (∏ i, f i) = f a * ∏ i in {a}ᶜ, f i :=
+ ∏ i, f i = f a * ∏ i in {a}ᶜ, f i :=
prod_eq_mul_prod_diff_singleton (mem_univ a) f
#align fintype.prod_eq_mul_prod_compl Fintype.prod_eq_mul_prod_compl
#align fintype.sum_eq_add_sum_compl Fintype.sum_eq_add_sum_compl
@[to_additive]
theorem _root_.Fintype.prod_eq_prod_compl_mul [DecidableEq α] [Fintype α] (a : α) (f : α → β) :
- (∏ i, f i) = (∏ i in {a}ᶜ, f i) * f a :=
+ ∏ i, f i = (∏ i in {a}ᶜ, f i) * f a :=
prod_eq_prod_diff_singleton_mul (mem_univ a) f
#align fintype.prod_eq_prod_compl_mul Fintype.prod_eq_prod_compl_mul
#align fintype.sum_eq_sum_compl_add Fintype.sum_eq_sum_compl_add
@@ -1586,7 +1586,7 @@ theorem dvd_prod_of_mem (f : α → β) {a : α} {s : Finset α} (ha : a ∈ s)
/-- A product can be partitioned into a product of products, each equivalent under a setoid. -/
@[to_additive "A sum can be partitioned into a sum of sums, each equivalent under a setoid."]
theorem prod_partition (R : Setoid α) [DecidableRel R.r] :
- (∏ x in s, f x) = ∏ xbar in s.image Quotient.mk'', ∏ y in s.filter (⟦·⟧ = xbar), f y := by
+ ∏ x in s, f x = ∏ xbar in s.image Quotient.mk'', ∏ y in s.filter (⟦·⟧ = xbar), f y := by
refine' (Finset.prod_image' f fun x _hx => _).symm
rfl
#align finset.prod_partition Finset.prod_partition
@@ -1595,7 +1595,7 @@ theorem prod_partition (R : Setoid α) [DecidableRel R.r] :
/-- If we can partition a product into subsets that cancel out, then the whole product cancels. -/
@[to_additive "If we can partition a sum into subsets that cancel out, then the whole sum cancels."]
theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r]
- (h : ∀ x ∈ s, (∏ a in s.filter fun y => y ≈ x, f a) = 1) : (∏ x in s, f x) = 1 := by
+ (h : ∀ x ∈ s, ∏ a in s.filter fun y => y ≈ x, f a = 1) : ∏ x in s, f x = 1 := by
rw [prod_partition R, ← Finset.prod_eq_one]
intro xbar xbar_in_s
obtain ⟨x, x_in_s, rfl⟩ := mem_image.mp xbar_in_s
@@ -1606,7 +1606,7 @@ theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r]
@[to_additive]
theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∉ s) (f : α → β)
- (b : β) : (∏ x in s, Function.update f i b x) = ∏ x in s, f x := by
+ (b : β) : ∏ x in s, Function.update f i b x = ∏ x in s, f x := by
apply prod_congr rfl
intros j hj
have : j ≠ i := by
@@ -1618,7 +1618,7 @@ theorem prod_update_of_not_mem [DecidableEq α] {s : Finset α} {i : α} (h : i
@[to_additive]
theorem prod_update_of_mem [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s) (f : α → β) (b : β) :
- (∏ x in s, Function.update f i b x) = b * ∏ x in s \ singleton i, f x := by
+ ∏ x in s, Function.update f i b x = b * ∏ x in s \ singleton i, f x := by
rw [update_eq_piecewise, prod_piecewise]
simp [h]
#align finset.prod_update_of_mem Finset.prod_update_of_mem
@@ -1629,7 +1629,7 @@ do the terms in that product. -/
@[to_additive eq_of_card_le_one_of_sum_eq "If a sum of a `Finset` of size at most 1 has a given
value, so do the terms in that sum."]
theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α → β} {b : β}
- (h : (∏ x in s, f x) = b) : ∀ x ∈ s, f x = b := by
+ (h : ∏ x in s, f x = b) : ∀ x ∈ s, f x = b := by
intro x hx
by_cases hc0 : s.card = 0
· exact False.elim (card_ne_zero_of_mem hx hc0)
@@ -1670,7 +1670,7 @@ removing that point, if present, from a `Finset`. -/
@[to_additive "If a function applied at a point is 0, a sum is unchanged by
removing that point, if present, from a `Finset`."]
theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h : f a = 1) :
- (∏ x in s.erase a, f x) = ∏ x in s, f x := by
+ ∏ x in s.erase a, f x = ∏ x in s, f x := by
rw [← sdiff_singleton_eq_erase]
refine' prod_subset (sdiff_subset _ _) fun x hx hnx => _
rw [sdiff_singleton_eq_erase] at hnx
@@ -1695,7 +1695,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
@[to_additive]
theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
[CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
- (hdf : 1 < f d) : (∏ m : α in s.erase d, f m) < ∏ m : α in s, f m := by
+ (hdf : 1 < f d) : ∏ m : α in s.erase d, f m < ∏ m : α in s, f m := by
conv in ∏ m in s, f m => rw [← Finset.insert_erase hd]
rw [Finset.prod_insert (Finset.not_mem_erase d s)]
exact lt_mul_of_one_lt_left' _ hdf
@@ -1706,7 +1706,7 @@ theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoi
point, it is 1 everywhere on the `Finset`. -/
@[to_additive "If a sum is 0 and the function is 0 except possibly at one
point, it is 0 everywhere on the `Finset`."]
-theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : (∏ x in s, f x) = 1)
+theorem eq_one_of_prod_eq_one {s : Finset α} {f : α → β} {a : α} (hp : ∏ x in s, f x = 1)
(h1 : ∀ x ∈ s, x ≠ a → f x = 1) : ∀ x ∈ s, f x = 1 := by
intro x hx
classical
@@ -1744,7 +1744,7 @@ end CommMonoid
is the sum of the products of `g` and `h`. -/
theorem prod_add_prod_eq [CommSemiring β] {s : Finset α} {i : α} {f g h : α → β} (hi : i ∈ s)
(h1 : g i + h i = f i) (h2 : ∀ j ∈ s, j ≠ i → g j = f j) (h3 : ∀ j ∈ s, j ≠ i → h j = f j) :
- ((∏ i in s, g i) + ∏ i in s, h i) = ∏ i in s, f i := by
+ (∏ i in s, g i) + ∏ i in s, h i = ∏ i in s, f i := by
classical
simp_rw [prod_eq_mul_prod_diff_singleton hi, ← h1, right_distrib]
congr 2 <;> apply prod_congr rfl <;> simpa
@@ -1755,7 +1755,7 @@ theorem card_eq_sum_ones (s : Finset α) : s.card = ∑ x in s, 1 := by
#align finset.card_eq_sum_ones Finset.card_eq_sum_ones
theorem sum_const_nat {m : ℕ} {f : α → ℕ} (h₁ : ∀ x ∈ s, f x = m) :
- (∑ x in s, f x) = card s * m := by
+ ∑ x in s, f x = card s * m := by
rw [← Nat.nsmul_eq_mul, ← sum_const]
apply sum_congr rfl h₁
#align finset.sum_const_nat Finset.sum_const_nat
@@ -1809,13 +1809,13 @@ theorem prod_inv_distrib : (∏ x in s, (f x)⁻¹) = (∏ x in s, f x)⁻¹ :=
#align finset.sum_neg_distrib Finset.sum_neg_distrib
@[to_additive (attr := simp)]
-theorem prod_div_distrib : (∏ x in s, f x / g x) = (∏ x in s, f x) / ∏ x in s, g x :=
+theorem prod_div_distrib : ∏ x in s, f x / g x = (∏ x in s, f x) / ∏ x in s, g x :=
Multiset.prod_map_div
#align finset.prod_div_distrib Finset.prod_div_distrib
#align finset.sum_sub_distrib Finset.sum_sub_distrib
@[to_additive]
-theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : (∏ a in s, f a ^ n) = (∏ a in s, f a) ^ n :=
+theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : ∏ a in s, f a ^ n = (∏ a in s, f a) ^ n :=
Multiset.prod_map_zpow
#align finset.prod_zpow Finset.prod_zpow
#align finset.sum_zsmul Finset.sum_zsmul
@@ -1828,21 +1828,21 @@ variable [CommGroup β] [DecidableEq α]
@[to_additive (attr := simp)]
theorem prod_sdiff_eq_div (h : s₁ ⊆ s₂) :
- (∏ x in s₂ \ s₁, f x) = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
+ ∏ x in s₂ \ s₁, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
rw [eq_div_iff_mul_eq', prod_sdiff h]
#align finset.prod_sdiff_eq_div Finset.prod_sdiff_eq_div
#align finset.sum_sdiff_eq_sub Finset.sum_sdiff_eq_sub
@[to_additive]
theorem prod_sdiff_div_prod_sdiff :
- ((∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x) = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
+ (∏ x in s₂ \ s₁, f x) / ∏ x in s₁ \ s₂, f x = (∏ x in s₂, f x) / ∏ x in s₁, f x := by
simp [← Finset.prod_sdiff (@inf_le_left _ _ s₁ s₂), ← Finset.prod_sdiff (@inf_le_right _ _ s₁ s₂)]
#align finset.prod_sdiff_div_prod_sdiff Finset.prod_sdiff_div_prod_sdiff
#align finset.sum_sdiff_sub_sum_sdiff Finset.sum_sdiff_sub_sum_sdiff
@[to_additive (attr := simp)]
theorem prod_erase_eq_div {a : α} (h : a ∈ s) :
- (∏ x in s.erase a, f x) = (∏ x in s, f x) / f a := by
+ ∏ x in s.erase a, f x = (∏ x in s, f x) / f a := by
rw [eq_div_iff_mul_eq', prod_erase_mul _ _ h]
#align finset.prod_erase_eq_div Finset.prod_erase_eq_div
#align finset.sum_erase_eq_sub Finset.sum_erase_eq_sub
@@ -1902,7 +1902,7 @@ section ProdEqZero
variable [CommMonoidWithZero β]
-theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : (∏ x in s, f x) = 0 := by
+theorem prod_eq_zero (ha : a ∈ s) (h : f a = 0) : ∏ x in s, f x = 0 := by
haveI := Classical.decEq α
rw [← prod_erase_mul _ _ ha, h, mul_zero]
#align finset.prod_eq_zero Finset.prod_eq_zero
@@ -1921,14 +1921,14 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
variable [Nontrivial β] [NoZeroDivisors β]
-theorem prod_eq_zero_iff : (∏ x in s, f x) = 0 ↔ ∃ a ∈ s, f a = 0 := by
+theorem prod_eq_zero_iff : ∏ x in s, f x = 0 ↔ ∃ a ∈ s, f a = 0 := by
classical
induction' s using Finset.induction_on with a s ha ih
· exact ⟨Not.elim one_ne_zero, fun ⟨_, H, _⟩ => by simp at H⟩
· rw [prod_insert ha, mul_eq_zero, exists_mem_insert, ih, ← bex_def]
#align finset.prod_eq_zero_iff Finset.prod_eq_zero_iff
-theorem prod_ne_zero_iff : (∏ x in s, f x) ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by
+theorem prod_ne_zero_iff : ∏ x in s, f x ≠ 0 ↔ ∀ a ∈ s, f a ≠ 0 := by
rw [Ne, prod_eq_zero_iff]
push_neg; rfl
#align finset.prod_ne_zero_iff Finset.prod_ne_zero_iff
@@ -1937,7 +1937,7 @@ end ProdEqZero
@[to_additive]
theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : Finset α) (f : α → β)
- (h : s.Nonempty) : (∏ x in s, f x) = f default := by
+ (h : s.Nonempty) : ∏ x in s, f x = f default := by
rw [h.eq_singleton_default, Finset.prod_singleton]
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
#align finset.sum_unique_nonempty Finset.sum_unique_nonempty
@@ -1977,7 +1977,7 @@ See `Function.bijective.prod_comp` for a version without `h`. -/
See `Function.bijective.sum_comp` for a version without `h`. "]
theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
(he : Function.Bijective e) (f : α → M) (g : β → M) (h : ∀ x, f x = g (e x)) :
- (∏ x : α, f x) = ∏ x : β, g x :=
+ ∏ x : α, f x = ∏ x : β, g x :=
prod_bij (fun x _ => e x) (fun x _ => mem_univ (e x)) (fun x _ => h x)
(fun _x _x' _ _ h => he.injective h) fun y _ =>
(he.surjective y).imp fun _a h => ⟨mem_univ _, h.symm⟩
@@ -1994,27 +1994,27 @@ automatically fills in most arguments.
See `Equiv.sum_comp` for a version without `h`."]
theorem prod_equiv {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
- (g : β → M) (h : ∀ x, f x = g (e x)) : (∏ x : α, f x) = ∏ x : β, g x :=
+ (g : β → M) (h : ∀ x, f x = g (e x)) : ∏ x : α, f x = ∏ x : β, g x :=
prod_bijective e e.bijective f g h
#align fintype.prod_equiv Fintype.prod_equiv
#align fintype.sum_equiv Fintype.sum_equiv
@[to_additive]
theorem prod_unique {α β : Type _} [CommMonoid β] [Unique α] [Fintype α] (f : α → β) :
- (∏ x : α, f x) = f default := by rw [univ_unique, prod_singleton]
+ ∏ x : α, f x = f default := by rw [univ_unique, prod_singleton]
#align fintype.prod_unique Fintype.prod_unique
#align fintype.sum_unique Fintype.sum_unique
@[to_additive]
theorem prod_empty {α β : Type _} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
- (∏ x : α, f x) = 1 :=
+ ∏ x : α, f x = 1 :=
Finset.prod_of_empty _
#align fintype.prod_empty Fintype.prod_empty
#align fintype.sum_empty Fintype.sum_empty
@[to_additive]
theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
- (a : α) : (∏ x : α, f x) = f a := by
+ (a : α) : ∏ x : α, f x = f a := by
haveI : Unique α := uniqueOfSubsingleton a
rw [prod_unique f, Subsingleton.elim default a]
#align fintype.prod_subsingleton Fintype.prod_subsingleton
@@ -2023,7 +2023,7 @@ theorem prod_subsingleton {α β : Type _} [CommMonoid β] [Subsingleton α] [Fi
@[to_additive]
theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid β] (p : α → Prop)
(f : α → β) [DecidablePred p] :
- ((∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i) = ∏ i, f i := by
+ (∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i = ∏ i, f i := by
classical
let s := { x | p x }.toFinset
rw [← Finset.prod_subtype s, ← Finset.prod_subtype sᶜ]
@@ -2133,9 +2133,9 @@ theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
#align multiset.sup_powerset_len Multiset.sup_powerset_len
@[simp]
-theorem toFinset_sum_count_eq (s : Multiset α) : (∑ a in s.toFinset, s.count a) = card s :=
+theorem toFinset_sum_count_eq (s : Multiset α) : ∑ a in s.toFinset, s.count a = card s :=
calc
- (∑ a in s.toFinset, s.count a) = ∑ a in s.toFinset, s.count a • 1 := by
+ ∑ a in s.toFinset, s.count a = ∑ a in s.toFinset, s.count a • 1 := by
{ simp only [smul_eq_mul, mul_one] }
_ = (s.map fun _ => 1).sum := (Finset.sum_multiset_map_count _ _).symm
_ = card s := by simp
@@ -2149,7 +2149,7 @@ theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
@[simp]
theorem toFinset_sum_count_nsmul_eq (s : Multiset α) :
- (∑ a in s.toFinset, s.count a • {a}) = s := by
+ ∑ a in s.toFinset, s.count a • {a} = s := by
rw [← Finset.sum_multiset_map_count, Multiset.sum_map_singleton]
#align multiset.to_finset_sum_count_nsmul_eq Multiset.toFinset_sum_count_nsmul_eq
@@ -2026,7 +2026,7 @@ theorem prod_subtype_mul_prod_subtype {α β : Type _} [Fintype α] [CommMonoid
((∏ i : { x // p x }, f i) * ∏ i : { x // ¬p x }, f i) = ∏ i, f i := by
classical
let s := { x | p x }.toFinset
- rw [← Finset.prod_subtype s, ← Finset.prod_subtype (sᶜ)]
+ rw [← Finset.prod_subtype s, ← Finset.prod_subtype sᶜ]
· exact Finset.prod_mul_prod_compl _ _
· simp
· simp
Currently, (for both Set
and Finset
) insert_subset
is an iff
lemma stating that insert a s ⊆ t
if and only if a ∈ t
and s ⊆ t
. For both types, this PR renames this lemma to insert_subset_iff
, and adds an insert_subset
lemma that gives the implication just in the reverse direction : namely theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t
.
This both aligns the naming with union_subset
and union_subset_iff
, and removes the need for the awkward insert_subset.mpr ⟨_,_⟩
idiom. It touches a lot of files (too many to list), but in a trivial way.
@@ -812,7 +812,7 @@ theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a
(hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : (∏ x in s, f x) = f a * f b := by
haveI := Classical.decEq α; let s' := ({a, b} : Finset α)
have hu : s' ⊆ s := by
- refine' insert_subset.mpr _
+ refine' insert_subset_iff.mpr _
apply And.intro ha
apply singleton_subset_iff.mpr hb
have hf : ∀ c ∈ s, c ∉ s' → f c = 1 := by
at
and goals (#5387)
Changes are of the form
some_tactic at h⊢
-> some_tactic at h ⊢
some_tactic at h
-> some_tactic at h
@@ -1686,7 +1686,7 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
· obtain ⟨i, hi, hfi⟩ := h
rw [prod_eq_single_of_mem _ hi, if_pos hfi]
exact fun j hj h => if_neg fun hfj => (hf hj hi h).le_bot ⟨hfj, hfi⟩
- · push_neg at h
+ · push_neg at h
rw [prod_eq_one]
exact fun i hi => if_neg (h i hi)
#align finset.prod_ite_one Finset.prod_ite_one
@@ -1913,7 +1913,7 @@ theorem prod_boole {s : Finset α} {p : α → Prop} [DecidablePred p] :
· apply prod_eq_one
intro i hi
rw [if_pos (h i hi)]
- · push_neg at h
+ · push_neg at h
rcases h with ⟨i, hi, hq⟩
apply prod_eq_zero hi
rw [if_neg hq]
SProd
to implement overloaded notation · ×ˢ ·
(#4200)
Currently, the following notations are changed from · ×ˢ ·
because Lean 4 can't deal with ambiguous notations.
| Definition | Notation |
| :
Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com>
@@ -664,30 +664,30 @@ theorem prod_mul_distrib : (∏ x in s, f x * g x) = (∏ x in s, f x) * ∏ x i
@[to_additive]
theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- (∏ x in s ×ᶠ t, f x) = ∏ x in s, ∏ y in t, f (x, y) :=
- prod_finset_product (s ×ᶠ t) s (fun _a => t) fun _p => mem_product
+ (∏ x in s ×ˢ t, f x) = ∏ x in s, ∏ y in t, f (x, y) :=
+ prod_finset_product (s ×ˢ t) s (fun _a => t) fun _p => mem_product
#align finset.prod_product Finset.prod_product
#align finset.sum_product Finset.sum_product
/-- An uncurried version of `Finset.prod_product`. -/
@[to_additive "An uncurried version of `Finset.sum_product`"]
theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s ×ᶠ t, f x.1 x.2) = ∏ x in s, ∏ y in t, f x y :=
+ (∏ x in s ×ˢ t, f x.1 x.2) = ∏ x in s, ∏ y in t, f x y :=
prod_product
#align finset.prod_product' Finset.prod_product'
#align finset.sum_product' Finset.sum_product'
@[to_additive]
theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β} :
- (∏ x in s ×ᶠ t, f x) = ∏ y in t, ∏ x in s, f (x, y) :=
- prod_finset_product_right (s ×ᶠ t) t (fun _a => s) fun _p => mem_product.trans and_comm
+ (∏ x in s ×ˢ t, f x) = ∏ y in t, ∏ x in s, f (x, y) :=
+ prod_finset_product_right (s ×ˢ t) t (fun _a => s) fun _p => mem_product.trans and_comm
#align finset.prod_product_right Finset.prod_product_right
#align finset.sum_product_right Finset.sum_product_right
/-- An uncurried version of `Finset.prod_product_right`. -/
@[to_additive "An uncurried version of `Finset.prod_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
- (∏ x in s ×ᶠ t, f x.1 x.2) = ∏ y in t, ∏ x in s, f x y :=
+ (∏ x in s ×ˢ t, f x.1 x.2) = ∏ y in t, ∏ x in s, f x y :=
prod_product_right
#align finset.prod_product_right' Finset.prod_product_right'
#align finset.sum_product_right' Finset.sum_product_right'
fix-comments.py
on all files.@@ -280,7 +280,7 @@ theorem MonoidHom.coe_finset_prod [MulOneClass β] [CommMonoid γ] (f : α →
#align monoid_hom.coe_finset_prod MonoidHom.coe_finset_prod
#align add_monoid_hom.coe_finset_sum AddMonoidHom.coe_finset_sum
--- See also `finset.prod_apply`, with the same conclusion
+-- See also `Finset.prod_apply`, with the same conclusion
-- but with the weaker hypothesis `f : α → β → γ`.
@[to_additive (attr := simp)]
theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α)
@@ -761,8 +761,8 @@ theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s,
#align finset.prod_filter_of_ne Finset.prod_filter_of_ne
#align finset.sum_filter_of_ne Finset.sum_filter_of_ne
--- If we use `[decidable_eq β]` here, some rewrites fail because they find a wrong `decidable`
--- instance first; `{∀ x, decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
+-- If we use `[DecidableEq β]` here, some rewrites fail because they find a wrong `Decidable`
+-- instance first; `{∀ x, Decidable (f x ≠ 1)}` doesn't work with `rw ← prod_filter_ne_one`
@[to_additive]
theorem prod_filter_ne_one [∀ x, Decidable (f x ≠ 1)] :
(∏ x in s.filter fun x => f x ≠ 1, f x) = ∏ x in s, f x :=
@@ -1089,7 +1089,7 @@ theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
/-- A product taken over a conditional whose condition is an equality test on the index and whose
alternative is `1` has value either the term at that index or `1`.
-The difference with `Finset.prod_ite_eq` is that the arguments to `eq` are swapped. -/
+The difference with `Finset.prod_ite_eq` is that the arguments to `Eq` are swapped. -/
@[to_additive (attr := simp) "A sum taken over a conditional whose condition is an equality
test on the index and whose alternative is `0` has value either the term at that index or `0`.
@@ -2279,7 +2279,7 @@ theorem nat_abs_sum_le {ι : Type _} (s : Finset ι) (f : ι → ℤ) :
exact (Int.natAbs_add_le _ _).trans (add_le_add le_rfl IH)
#align nat_abs_sum_le nat_abs_sum_le
-/-! ### `additive`, `multiplicative` -/
+/-! ### `Additive`, `Multiplicative` -/
open Additive Multiplicative
This makes a mathlib4 version of mathlib3's tactic.basic
, now called Mathlib.Tactic.Common
, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.
This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -18,7 +18,6 @@ import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Multiset.Powerset
import Mathlib.Data.Set.Pairwise.Basic
-import Mathlib.Tactic.ScopedNS
/-!
# Big operators
Now that leanprover/lean4#2210 has been merged, this PR:
set_option synthInstance.etaExperiment true
commands (and some etaExperiment%
term elaborators)set_option maxHeartbeats
commandsCo-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Matthew Ballard <matt@mrb.email>
@@ -1247,7 +1247,7 @@ theorem prod_range_add (f : ℕ → β) (n m : ℕ) :
(∏ x in range (n + m), f x) = (∏ x in range n, f x) * ∏ x in range m, f (n + x) := by
induction' m with m hm
· simp
- · erw [Nat.add_succ, prod_range_succ, prod_range_succ, hm, mul_assoc]; rfl
+ · erw [Nat.add_succ, prod_range_succ, prod_range_succ, hm, mul_assoc]
#align finset.prod_range_add Finset.prod_range_add
#align finset.sum_range_add Finset.sum_range_add
sSup
/iSup
(#3938)
As discussed on Zulip
supₛ
→ sSup
infₛ
→ sInf
supᵢ
→ iSup
infᵢ
→ iInf
bsupₛ
→ bsSup
binfₛ
→ bsInf
bsupᵢ
→ biSup
binfᵢ
→ biInf
csupₛ
→ csSup
cinfₛ
→ csInf
csupᵢ
→ ciSup
cinfᵢ
→ ciInf
unionₛ
→ sUnion
interₛ
→ sInter
unionᵢ
→ iUnion
interᵢ
→ iInter
bunionₛ
→ bsUnion
binterₛ
→ bsInter
bunionᵢ
→ biUnion
binterᵢ
→ biInter
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@@ -392,14 +392,14 @@ theorem prod_disjUnion (h) :
#align finset.sum_disj_union Finset.sum_disjUnion
@[to_additive]
-theorem prod_disjUnionᵢ (s : Finset ι) (t : ι → Finset α) (h) :
- (∏ x in s.disjUnionᵢ t h, f x) = ∏ i in s, ∏ x in t i, f x := by
- refine' Eq.trans _ (fold_disjUnionᵢ h)
+theorem prod_disjiUnion (s : Finset ι) (t : ι → Finset α) (h) :
+ (∏ x in s.disjiUnion t h, f x) = ∏ i in s, ∏ x in t i, f x := by
+ refine' Eq.trans _ (fold_disjiUnion h)
dsimp [Finset.prod, Multiset.prod, Multiset.fold, Finset.disjUnion, Finset.fold]
congr
exact prod_const_one.symm
-#align finset.prod_disj_Union Finset.prod_disjUnionᵢ
-#align finset.sum_disj_Union Finset.sum_disjUnionᵢ
+#align finset.prod_disj_Union Finset.prod_disjiUnion
+#align finset.sum_disj_Union Finset.sum_disjiUnion
@[to_additive]
theorem prod_union_inter [DecidableEq α] :
@@ -515,11 +515,11 @@ theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ
#align finset.sum_sum_elim Finset.sum_sum_elim
@[to_additive]
-theorem prod_bunionᵢ [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
- (hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.bunionᵢ t, f x) = ∏ x in s, ∏ i in t x, f i := by
- rw [← disjUnionᵢ_eq_bunionᵢ _ _ hs, prod_disjUnionᵢ]
-#align finset.prod_bUnion Finset.prod_bunionᵢ
-#align finset.sum_bUnion Finset.sum_bunionᵢ
+theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
+ (hs : Set.PairwiseDisjoint (↑s) t) : (∏ x in s.biUnion t, f x) = ∏ x in s, ∏ i in t x, f i := by
+ rw [← disjiUnion_eq_biUnion _ _ hs, prod_disjiUnion]
+#align finset.prod_bUnion Finset.prod_biUnion
+#align finset.sum_bUnion Finset.sum_biUnion
/-- Product over a sigma type equals the product of fiberwise products. For rewriting
in the reverse direction, use `Finset.prod_sigma'`. -/
@@ -527,7 +527,7 @@ in the reverse direction, use `Finset.prod_sigma'`. -/
in the reverse direction, use `Finset.sum_sigma'`"]
theorem prod_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : Sigma σ → β) :
(∏ x in s.sigma t, f x) = ∏ a in s, ∏ s in t a, f ⟨a, s⟩ := by
- simp_rw [← disjUnionᵢ_map_sigma_mk, prod_disjUnionᵢ, prod_map, Function.Embedding.sigmaMk_apply]
+ simp_rw [← disjiUnion_map_sigma_mk, prod_disjiUnion, prod_map, Function.Embedding.sigmaMk_apply]
#align finset.prod_sigma Finset.prod_sigma
#align finset.sum_sigma Finset.sum_sigma
@@ -640,7 +640,7 @@ theorem prod_finset_product_right' (r : Finset (α × γ)) (s : Finset γ) (t :
theorem prod_fiberwise_of_maps_to [DecidableEq γ] {s : Finset α} {t : Finset γ} {g : α → γ}
(h : ∀ x ∈ s, g x ∈ t) (f : α → β) :
(∏ y in t, ∏ x in s.filter fun x => g x = y, f x) = ∏ x in s, f x := by
- rw [← prod_disjUnionᵢ, disjUnionᵢ_filter_eq_of_maps_to h]
+ rw [← prod_disjiUnion, disjiUnion_filter_eq_of_maps_to h]
#align finset.prod_fiberwise_of_maps_to Finset.prod_fiberwise_of_maps_to
#align finset.sum_fiberwise_of_maps_to Finset.sum_fiberwise_of_maps_to
@@ -701,10 +701,10 @@ theorem prod_comm' {s : Finset γ} {t : γ → Finset α} {t' : Finset α} {s' :
(h : ∀ x y, x ∈ s ∧ y ∈ t x ↔ x ∈ s' y ∧ y ∈ t') {f : γ → α → β} :
(∏ x in s, ∏ y in t x, f x y) = ∏ y in t', ∏ x in s' y, f x y := by
classical
- have : ∀ z : γ × α, (z ∈ s.bunionᵢ fun x => (t x).map <| Function.Embedding.sectr x _) ↔
+ have : ∀ z : γ × α, (z ∈ s.biUnion fun x => (t x).map <| Function.Embedding.sectr x _) ↔
z.1 ∈ s ∧ z.2 ∈ t z.1 := by
rintro ⟨x, y⟩
- simp only [mem_bunionᵢ, mem_map, Function.Embedding.sectr_apply, Prod.mk.injEq,
+ simp only [mem_biUnion, mem_map, Function.Embedding.sectr_apply, Prod.mk.injEq,
exists_eq_right, ← and_assoc]
exact
(prod_finset_product' _ _ _ this).symm.trans
@@ -1857,29 +1857,29 @@ theorem card_sigma {σ : α → Type _} (s : Finset α) (t : ∀ a, Finset (σ a
#align finset.card_sigma Finset.card_sigma
@[simp]
-theorem card_disjUnionᵢ (s : Finset α) (t : α → Finset β) (h) :
- (s.disjUnionᵢ t h).card = s.sum fun i => (t i).card :=
+theorem card_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
+ (s.disjiUnion t h).card = s.sum fun i => (t i).card :=
Multiset.card_bind _ _
-#align finset.card_disj_Union Finset.card_disjUnionᵢ
+#align finset.card_disj_Union Finset.card_disjiUnion
-theorem card_bunionᵢ [DecidableEq β] {s : Finset α} {t : α → Finset β}
+theorem card_biUnion [DecidableEq β] {s : Finset α} {t : α → Finset β}
(h : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → Disjoint (t x) (t y)) :
- (s.bunionᵢ t).card = ∑ u in s, card (t u) :=
+ (s.biUnion t).card = ∑ u in s, card (t u) :=
calc
- (s.bunionᵢ t).card = ∑ i in s.bunionᵢ t, 1 := card_eq_sum_ones _
- _ = ∑ a in s, ∑ _i in t a, 1 := Finset.sum_bunionᵢ h
+ (s.biUnion t).card = ∑ i in s.biUnion t, 1 := card_eq_sum_ones _
+ _ = ∑ a in s, ∑ _i in t a, 1 := Finset.sum_biUnion h
_ = ∑ u in s, card (t u) := by simp_rw [card_eq_sum_ones]
-#align finset.card_bUnion Finset.card_bunionᵢ
+#align finset.card_bUnion Finset.card_biUnion
-theorem card_bunionᵢ_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
- (s.bunionᵢ t).card ≤ ∑ a in s, (t a).card :=
+theorem card_biUnion_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
+ (s.biUnion t).card ≤ ∑ a in s, (t a).card :=
haveI := Classical.decEq α
Finset.induction_on s (by simp) fun a s has ih =>
calc
- ((insert a s).bunionᵢ t).card ≤ (t a).card + (s.bunionᵢ t).card := by
- { rw [bunionᵢ_insert]; exact Finset.card_union_le _ _ }
+ ((insert a s).biUnion t).card ≤ (t a).card + (s.biUnion t).card := by
+ { rw [biUnion_insert]; exact Finset.card_union_le _ _ }
_ ≤ ∑ a in insert a s, card (t a) := by rw [sum_insert has]; exact add_le_add_left ih _
-#align finset.card_bUnion_le Finset.card_bunionᵢ_le
+#align finset.card_bUnion_le Finset.card_biUnion_le
theorem card_eq_sum_card_fiberwise [DecidableEq β] {f : α → β} {s : Finset α} {t : Finset β}
(H : ∀ x ∈ s, f x ∈ t) : s.card = ∑ a in t, (s.filter fun x => f x = a).card := by
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit c227d107bbada5d0d9d20287e3282c0a7f1651a0
+! leanprover-community/mathlib commit fa2309577c7009ea243cffdf990cd6c84f0ad497
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -1123,18 +1123,19 @@ theorem prod_dite_irrel (p : Prop) [Decidable p] (s : Finset α) (f : p → α
#align finset.prod_dite_irrel Finset.prod_dite_irrel
#align finset.sum_dite_irrel Finset.sum_dite_irrel
-@[simp]
-theorem sum_pi_single' {ι M : Type _} [DecidableEq ι] [AddCommMonoid M] (i : ι) (x : M)
- (s : Finset ι) : (∑ j in s, Pi.single i x j) = if i ∈ s then x else 0 :=
- sum_dite_eq' _ _ _
+@[to_additive (attr := simp)]
+theorem prod_pi_mulSingle' [DecidableEq α] (a : α) (x : β) (s : Finset α) :
+ (∏ a' in s, Pi.mulSingle a x a') = if a ∈ s then x else 1 :=
+ prod_dite_eq' _ _ _
+#align finset.prod_pi_mul_single' Finset.prod_pi_mulSingle'
#align finset.sum_pi_single' Finset.sum_pi_single'
-@[simp]
-theorem sum_pi_single {ι : Type _} {M : ι → Type _} [DecidableEq ι] [∀ i, AddCommMonoid (M i)]
- (i : ι) (f : ∀ i, M i) (s : Finset ι) :
- (∑ j in s, Pi.single j (f j) i) = if i ∈ s then f i else 0 :=
- sum_dite_eq _ _ _
-#align finset.sum_pi_single Finset.sum_pi_single
+@[to_additive (attr := simp)]
+theorem prod_pi_mulSingle {β : α → Type _} [DecidableEq α] [∀ a, CommMonoid (β a)] (a : α)
+ (f : ∀ a, β a) (s : Finset α) :
+ (∏ a' in s, Pi.mulSingle a' (f a') a) = if a ∈ s then f a else 1 :=
+ prod_dite_eq _ _ _
+#align finset.prod_pi_mul_single Finset.prod_pi_mulSingle
@[to_additive]
theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ → β}
@@ -1692,12 +1693,14 @@ theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).Pair
#align finset.prod_ite_one Finset.prod_ite_one
#align finset.sum_ite_zero Finset.sum_ite_zero
-theorem sum_erase_lt_of_pos {γ : Type _} [DecidableEq α] [OrderedAddCommMonoid γ]
- [CovariantClass γ γ (· + ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
- (hdf : 0 < f d) : (∑ m : α in s.erase d, f m) < ∑ m : α in s, f m := by
- conv in ∑ m in s, f m => rw [← Finset.insert_erase hd]
- rw [Finset.sum_insert (Finset.not_mem_erase d s)]
- exact lt_add_of_pos_left _ hdf
+@[to_additive]
+theorem prod_erase_lt_of_one_lt {γ : Type _} [DecidableEq α] [OrderedCommMonoid γ]
+ [CovariantClass γ γ (· * ·) (· < ·)] {s : Finset α} {d : α} (hd : d ∈ s) {f : α → γ}
+ (hdf : 1 < f d) : (∏ m : α in s.erase d, f m) < ∏ m : α in s, f m := by
+ conv in ∏ m in s, f m => rw [← Finset.insert_erase hd]
+ rw [Finset.prod_insert (Finset.not_mem_erase d s)]
+ exact lt_mul_of_one_lt_left' _ hdf
+#align finset.prod_erase_lt_of_one_lt Finset.prod_erase_lt_of_one_lt
#align finset.sum_erase_lt_of_pos Finset.sum_erase_lt_of_pos
/-- If a product is 1 and the function is 1 except possibly at one
Also fixes some spacing in their syntax
commands, which impacts pretty printing.
@@ -120,17 +120,61 @@ scoped macro_rules (kind := bigprod)
/-- `∑ x in s, f x` is notation for `Finset.sum s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
-scoped syntax (name := bigsumin) "∑ " extBinder "in " term "," term:67 : term
+scoped syntax (name := bigsumin) "∑ " extBinder " in " term ", " term:67 : term
scoped macro_rules (kind := bigsumin)
| `(∑ $x:ident in $s, $r) => `(Finset.sum $s (fun $x ↦ $r))
| `(∑ $x:ident : $t in $s, $p) => `(Finset.sum $s (fun $x:ident : $t ↦ $p))
/-- `∏ x, f x` is notation for `Finset.prod s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
-scoped syntax (name := bigprodin) "∏ " extBinder "in " term "," term:67 : term
+scoped syntax (name := bigprodin) "∏ " extBinder " in " term ", " term:67 : term
scoped macro_rules (kind := bigprodin)
| `(∏ $x:ident in $s, $r) => `(Finset.prod $s (fun $x ↦ $r))
| `(∏ $x:ident : $t in $s, $p) => `(Finset.prod $s (fun $x:ident : $t ↦ $p))
+
+open Lean Meta Parser.Term PrettyPrinter.Delaborator SubExpr
+open Std.ExtendedBinder
+
+/-- Delaborator for `Finset.prod`. The `pp.piBinderTypes` option controls whether
+to show the domain type when the product is over `Finset.univ`. -/
+@[scoped delab app.Finset.prod] def delabFinsetProd : Delab := whenPPOption getPPNotation do
+ let #[_, _, _, s, f] := (← getExpr).getAppArgs | failure
+ guard <| f.isLambda
+ let ppDomain ← getPPOption getPPPiBinderTypes
+ let (i, body) ← withAppArg <| withBindingBodyUnusedName fun i => do
+ return (i, ← delab)
+ if s.isAppOfArity ``Finset.univ 2 then
+ let binder ←
+ if ppDomain then
+ let ty ← withNaryArg 1 delab
+ `(extBinder| $(.mk i):ident : $ty)
+ else
+ `(extBinder| $(.mk i):ident)
+ `(∏ $binder, $body)
+ else
+ let ss ← withNaryArg 3 <| delab
+ `(∏ $(.mk i):ident in $ss, $body)
+
+/-- Delaborator for `Finset.prod`. The `pp.piBinderTypes` option controls whether
+to show the domain type when the sum is over `Finset.univ`. -/
+@[scoped delab app.Finset.sum] def delabFinsetSum : Delab := whenPPOption getPPNotation do
+ let #[_, _, _, s, f] := (← getExpr).getAppArgs | failure
+ guard <| f.isLambda
+ let ppDomain ← getPPOption getPPPiBinderTypes
+ let (i, body) ← withAppArg <| withBindingBodyUnusedName fun i => do
+ return (i, ← delab)
+ if s.isAppOfArity ``Finset.univ 2 then
+ let binder ←
+ if ppDomain then
+ let ty ← withNaryArg 1 delab
+ `(extBinder| $(.mk i):ident : $ty)
+ else
+ `(extBinder| $(.mk i):ident)
+ `(∑ $binder, $body)
+ else
+ let ss ← withNaryArg 3 <| delab
+ `(∑ $(.mk i):ident in $ss, $body)
+
end BigOperators
open BigOperators
closes #3680, see https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Stepping.20through.20simp_rw/near/326712986
@@ -2069,7 +2069,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
simp only [Finset.not_mem_empty, IsEmpty.forall_iff, imp_true_iff, Finset.sum_empty,
Finset.sup_empty, bot_eq_zero, eq_self_iff_true]
· simp_rw [Finset.sum_cons hz, Finset.sup_cons, Finset.mem_cons, Multiset.sup_eq_union,
- forall_eq_or_imp, Ne.def, eq_self_iff_true, not_true, IsEmpty.forall_iff, true_and_iff,
+ forall_eq_or_imp, Ne.def, IsEmpty.forall_iff, true_and_iff,
imp_and, forall_and, ← hr, @eq_comm _ z]
have := fun x (H : x ∈ i) => ne_of_mem_of_not_mem H hz
simp (config := { contextual := true }) only [this, not_false_iff, true_imp_iff]
@@ -419,7 +419,7 @@ variable [Fintype α] [CommMonoid β]
@[to_additive]
theorem IsCompl.prod_mul_prod {s t : Finset α} (h : IsCompl s t) (f : α → β) :
((∏ i in s, f i) * ∏ i in t, f i) = ∏ i, f i :=
- (Finset.prod_disjUnion h.Disjoint).symm.trans <| by
+ (Finset.prod_disjUnion h.disjoint).symm.trans <| by
classical rw [Finset.disjUnion_eq_union, ← Finset.sup_eq_union, h.sup_eq_top]; rfl
#align is_compl.prod_mul_prod IsCompl.prod_mul_prod
#align is_compl.sum_add_sum IsCompl.sum_add_sum
This PR fixes two things:
align
statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align
). This is often seen in the mathport output after ending calc
blocks.#align
statements. (This was needed for a script I wrote for #3630.)@@ -610,7 +610,6 @@ theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ →
let ⟨c, hcs, hc⟩ := mem_image.1 hx
hc ▸ eq c hcs
_ = ∏ x in s, h x := prod_fiberwise_of_maps_to (fun _x => mem_image_of_mem g) _
-
#align finset.prod_image' Finset.prod_image'
#align finset.sum_image' Finset.sum_image'
@@ -690,7 +689,6 @@ theorem prod_eq_one {f : α → β} {s : Finset α} (h : ∀ x ∈ s, f x = 1) :
calc
(∏ x in s, f x) = ∏ _x in s, 1 := Finset.prod_congr rfl h
_ = 1 := Finset.prod_const_one
-
#align finset.prod_eq_one Finset.prod_eq_one
#align finset.sum_eq_zero Finset.sum_eq_zero
@@ -739,7 +737,6 @@ theorem prod_filter (p : α → Prop) [DecidablePred p] (f : α → β) :
{ refine' prod_subset (filter_subset _ s) fun x hs h => _
rw [mem_filter, not_and] at h
exact if_neg (by simpa using h hs) }
-
#align finset.prod_filter Finset.prod_filter
#align finset.sum_filter Finset.sum_filter
@@ -754,7 +751,6 @@ theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a
rwa [mem_singleton.1 H]
· simpa only [mem_singleton] }
_ = f a := prod_singleton
-
#align finset.prod_eq_single_of_mem Finset.prod_eq_single_of_mem
#align finset.sum_eq_single_of_mem Finset.sum_eq_single_of_mem
@@ -818,7 +814,6 @@ theorem prod_attach {f : α → β} : (∏ x in s.attach, f x) = ∏ x in s, f x
(∏ x in s.attach, f x.val) = ∏ x in s.attach.image Subtype.val, f x := by
{ rw [prod_image]; exact fun x _ y _ => Subtype.eq }
_ = _ := by rw [attach_image_val]
-
#align finset.prod_attach Finset.prod_attach
#align finset.sum_attach Finset.sum_attach
@@ -920,17 +915,14 @@ theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
(∏ x in s.filter p, h (if hx : p x then f x hx else g x hx)) *
∏ x in s.filter fun x => ¬p x, h (if hx : p x then f x hx else g x hx) :=
(prod_filter_mul_prod_filter_not s p _).symm
- _ =
- (∏ x in (s.filter p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
+ _ = (∏ x in (s.filter p).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx)) *
∏ x in (s.filter fun x => ¬p x).attach, h (if hx : p x.1 then f x.1 hx else g x.1 hx) :=
congr_arg₂ _ prod_attach.symm prod_attach.symm
- _ =
- (∏ x in (s.filter p).attach, h (f x.1 $ by simpa using (mem_filter.mp x.2).2)) *
+ _ = (∏ x in (s.filter p).attach, h (f x.1 $ by simpa using (mem_filter.mp x.2).2)) *
∏ x in (s.filter fun x ↦ ¬p x).attach, h (g x.1 $ by simpa using (mem_filter.mp x.2).2) :=
congr_arg₂ _ (prod_congr rfl fun x _hx ↦
congr_arg h (dif_pos $ by simpa using (mem_filter.mp x.2).2))
(prod_congr rfl fun x _hx => congr_arg h (dif_neg $ by simpa using (mem_filter.mp x.2).2))
-
#align finset.prod_apply_dite Finset.prod_apply_dite
#align finset.sum_apply_dite Finset.sum_apply_dite
@@ -1129,7 +1121,6 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
refine' (mem_filter.mp hb).elim fun h₁ h₂ ↦ _
obtain ⟨a, ha₁, ha₂, eq⟩ := i_surj b h₁ fun H ↦ by rw [H] at h₂; simp at h₂
exact ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, eq⟩
-
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
@@ -1495,7 +1486,6 @@ theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
prod_congr rfl fun b _hb => prod_congr rfl (by simp (config := { contextual := true }))
_ = ∏ b in s.image g, f b ^ (s.filter fun a => g a = b).card :=
prod_congr rfl fun _ _ => prod_const _
-
#align finset.prod_comp Finset.prod_comp
#align finset.sum_comp Finset.sum_comp
@@ -1832,7 +1822,6 @@ theorem card_bunionᵢ [DecidableEq β] {s : Finset α} {t : α → Finset β}
(s.bunionᵢ t).card = ∑ i in s.bunionᵢ t, 1 := card_eq_sum_ones _
_ = ∑ a in s, ∑ _i in t a, 1 := Finset.sum_bunionᵢ h
_ = ∑ u in s, card (t u) := by simp_rw [card_eq_sum_ones]
-
#align finset.card_bUnion Finset.card_bunionᵢ
theorem card_bunionᵢ_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
@@ -1843,7 +1832,6 @@ theorem card_bunionᵢ_le [DecidableEq β] {s : Finset α} {t : α → Finset β
((insert a s).bunionᵢ t).card ≤ (t a).card + (s.bunionᵢ t).card := by
{ rw [bunionᵢ_insert]; exact Finset.card_union_le _ _ }
_ ≤ ∑ a in insert a s, card (t a) := by rw [sum_insert has]; exact add_le_add_left ih _
-
#align finset.card_bUnion_le Finset.card_bunionᵢ_le
theorem card_eq_sum_card_fiberwise [DecidableEq β] {f : α → β} {s : Finset α} {t : Finset β}
data.set.pairwise
(#3117)
Match https://github.com/leanprover-community/mathlib/pull/17880
The new import of Mathlib.Data.Set.Lattice
in Mathlib.Data.Finset.Basic
was implied transitively from tactic imports present in Lean 3.
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit 6c5f73fd6f6cc83122788a80a27cdd54663609f4
+! leanprover-community/mathlib commit c227d107bbada5d0d9d20287e3282c0a7f1651a0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -17,7 +17,7 @@ import Mathlib.Data.Finset.Sum
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Finset.Sigma
import Mathlib.Data.Multiset.Powerset
-import Mathlib.Data.Set.Pairwise
+import Mathlib.Data.Set.Pairwise.Basic
import Mathlib.Tactic.ScopedNS
/-!
@@ -886,8 +886,7 @@ theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α)
have : (· ∈ s) = p := Set.ext h
subst p
rw [← prod_coe_sort]
- congr
- apply Subsingleton.elim
+ congr!
#align finset.prod_subtype Finset.prod_subtype
#align finset.sum_subtype Finset.sum_subtype
finset.sum
under mod
(#2025)
Match https://github.com/leanprover-community/mathlib/pull/18364
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit 47adfab39a11a072db552f47594bf8ed2cf8a722
+! leanprover-community/mathlib commit 6c5f73fd6f6cc83122788a80a27cdd54663609f4
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -1408,6 +1408,12 @@ theorem prod_const (b : β) : (∏ _x in s, b) = b ^ s.card :=
#align finset.prod_const Finset.prod_const
#align finset.sum_const Finset.sum_const
+@[to_additive sum_eq_card_nsmul]
+theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : (∏ a in s, f a) = b ^ s.card :=
+ (prod_congr rfl hf).trans <| prod_const _
+#align finset.prod_eq_pow_card Finset.prod_eq_pow_card
+#align finset.sum_eq_card_nsmul Finset.sum_eq_card_nsmul
+
@[to_additive]
theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k in range n, b := by simp
#align finset.pow_eq_prod_const Finset.pow_eq_prod_const
@@ -1903,6 +1909,26 @@ theorem prod_unique_nonempty {α β : Type _} [CommMonoid β] [Unique α] (s : F
#align finset.prod_unique_nonempty Finset.prod_unique_nonempty
#align finset.sum_unique_nonempty Finset.sum_unique_nonempty
+theorem sum_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
+ (∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
+ (Multiset.sum_nat_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]; rfl
+#align finset.sum_nat_mod Finset.sum_nat_mod
+
+theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
+ (∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
+ (Multiset.prod_nat_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]; rfl
+#align finset.prod_nat_mod Finset.prod_nat_mod
+
+theorem sum_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
+ (∑ i in s, f i) % n = (∑ i in s, f i % n) % n :=
+ (Multiset.sum_int_mod _ _).trans <| by rw [Finset.sum, Multiset.map_map]; rfl
+#align finset.sum_int_mod Finset.sum_int_mod
+
+theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
+ (∏ i in s, f i) % n = (∏ i in s, f i % n) % n :=
+ (Multiset.prod_int_mod _ _).trans <| by rw [Finset.prod, Multiset.map_map]; rfl
+#align finset.prod_int_mod Finset.prod_int_mod
+
end Finset
namespace Fintype
congr!
and convert
(#2606)
congr!
, convert
, and convert_to
to control parts of the congruence algorithm, in particular transparency settings when applying congruence lemmas.congr!
now applies congruence lemmas with reducible transparency by default. This prevents it from unfolding definitions when applying congruence lemmas. It also now tries both the LHS-biased and RHS-biased simp congruence lemmas, with a configuration option to set which it should try first.HEq
congruence lemma generator that gives each hypothesis access to the proofs of previous hypotheses. This means that if you have an equality ⊢ ⟨a, x⟩ = ⟨b, y⟩
of sigma types, congr!
turns this into goals ⊢ a = b
and ⊢ a = b → HEq x y
(note that congr!
will also auto-introduce a = b
for you in the second goal). This congruence lemma generator applies to more cases than the simp congruence lemma generator does.congr!
(and hence convert
) are more careful about applying lemmas that don't force definitions to unfold. There were a number of cases in mathlib where the implementation of congr
was being abused to unfold definitions.set_option trace.congr! true
you can see what congr!
sees when it is deciding on congruence lemmas.convert_to
to do using 1
when there is no using
clause, to match its documentation.Note that congr!
is more capable than congr
at finding a way to equate left-hand sides and right-hand sides, so you will frequently need to limit its depth with a using
clause. However, there is also a new heuristic to prevent considering unlikely-to-be-provable type equalities (controlled by the typeEqs
option), which can help limit the depth automatically.
There is also a predefined configuration that you can invoke with, for example, convert (config := .unfoldSameFun) h
, that causes it to behave more like congr
, including using default transparency when unfolding.
@@ -2067,7 +2067,7 @@ theorem finset_sum_eq_sup_iff_disjoint {β : Type _} {i : Finset β} {f : β →
theorem sup_powerset_len {α : Type _} [DecidableEq α] (x : Multiset α) :
(Finset.sup (Finset.range (card x + 1)) fun k => x.powersetLen k) = x.powerset := by
- convert bind_powerset_len x
+ convert bind_powerset_len x using 1
rw [Multiset.bind, Multiset.join, ← Finset.range_val, ← Finset.sum_eq_multiset_sum]
exact
Eq.symm (finset_sum_eq_sup_iff_disjoint.mpr fun _ _ _ _ h => pairwise_disjoint_powersetLen x h)
congr!
and improvement to convert
(#2566)
This introduces a tactic congr!
that is an analogue to mathlib 3's congr'
. It is a more insistent version of congr
that makes use of more congruence lemmas (including user congruence lemmas), propext
, funext
, and Subsingleton
instances. It also has a feature to lift reflexive relations to equalities. Along with funext
, the tactic does intros
, allowing congr!
to get access to function bodies; the introduced variables can be named using rename_i
if needed.
This also modifies convert
to use congr!
rather than congr
, which makes it work more like the mathlib3 version of the tactic.
@@ -402,7 +402,6 @@ theorem _root_.Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α
theorem _root_.Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
(hs : { a | σ a ≠ a } ⊆ s) : (∏ x in s, f (σ x) x) = ∏ x in s, f x (σ.symm x) := by
convert σ.prod_comp s (fun x => f x (σ.symm x)) hs
- ext
rw [Equiv.symm_apply_apply]
#align equiv.perm.prod_comp' Equiv.Perm.prod_comp'
#align equiv.perm.sum_comp' Equiv.Perm.sum_comp'
to_additive
into linter errors@[to_additive (attr := to_additive)]
to additivize the generated lemma. This is useful for Pow -> SMul -> VAdd
lemmas. We can write e.g. @[to_additive (attr := to_additive, simp)]
to add the simp
attribute to all 3 generated lemmas, and we can provide other options to each to_additive
call separately (specifying a name / reorder).addToAdditiveAttr
now returns a value, turn a few (meta) definitions into mutual partial def
, reorder some definitions, generalize additivizeLemmas
to lists of more than 2 elements) that should have no visible effects for the user.@@ -1409,12 +1409,12 @@ theorem prod_const (b : β) : (∏ _x in s, b) = b ^ s.card :=
#align finset.prod_const Finset.prod_const
#align finset.sum_const Finset.sum_const
-@[to_additive nsmul_eq_sum_const]
+@[to_additive]
theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k in range n, b := by simp
#align finset.pow_eq_prod_const Finset.pow_eq_prod_const
#align finset.nsmul_eq_sum_const Finset.nsmul_eq_sum_const
-@[to_additive sum_nsmul]
+@[to_additive]
theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : (∏ x in s, f x ^ n) = (∏ x in s, f x) ^ n :=
Multiset.prod_map_pow
#align finset.prod_pow Finset.prod_pow
Part of the List.repeat
-> List.replicate
refactor. On Mathlib 4 side, I removed mentions of List.repeat
in #1475 and #1579
algebra.big_operators.basic
@9003f28797c0664a49e4179487267c494477d853
..47adfab39a11a072db552f47594bf8ed2cf8a722
algebra.big_operators.multiset.basic
@9003f28797c0664a49e4179487267c494477d853
..47adfab39a11a072db552f47594bf8ed2cf8a722
algebra.gcd_monoid.multiset
@9003f28797c0664a49e4179487267c494477d853
..f694c7dead66f5d4c80f446c796a5aad14707f0e
algebra.hom.freiman
@9003f28797c0664a49e4179487267c494477d853
..f694c7dead66f5d4c80f446c796a5aad14707f0e
data.list.big_operators.basic
@26f081a2fb920140ed5bc5cc5344e84bcc7cb2b2
..47adfab39a11a072db552f47594bf8ed2cf8a722
data.list.dedup
@6133ae2da6ae6693248bb5451de703f1ef154cc8
..f694c7dead66f5d4c80f446c796a5aad14707f0e
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
-! leanprover-community/mathlib commit 9003f28797c0664a49e4179487267c494477d853
+! leanprover-community/mathlib commit 47adfab39a11a072db552f47594bf8ed2cf8a722
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -332,14 +332,12 @@ theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) :
#align finset.prod_map Finset.prod_map
#align finset.sum_map Finset.sum_map
-@[congr, to_additive]
+@[to_additive (attr := congr)]
theorem prod_congr (h : s₁ = s₂) : (∀ x ∈ s₂, f x = g x) → s₁.prod f = s₂.prod g := by
rw [h]; exact fold_congr
#align finset.prod_congr Finset.prod_congr
#align finset.sum_congr Finset.sum_congr
-attribute [congr] Finset.sum_congr
-
@[to_additive]
theorem prod_disjUnion (h) :
(∏ x in s₁.disjUnion s₂ h, f x) = (∏ x in s₁, f x) * ∏ x in s₂, f x := by
@@ -28,7 +28,7 @@ In this file we define products and sums indexed by finite sets (specifically, `
## Notation
We introduce the following notation, localized in `BigOperators`.
-To enable the notation, use `open_locale BigOperators`.
+To enable the notation, use `open BigOperators`.
Let `s` be a `Finset α`, and `f : α → β` a function.
@@ -100,39 +100,40 @@ In practice, this means that parentheses should be placed as follows:
(Example taken from page 490 of Knuth's *Concrete Mathematics*.)
-/
-section
+-- TODO: Use scoped[NS], when implemented?
+namespace BigOperators
open Std.ExtendedBinder
/-- `∑ x, f x` is notation for `Finset.sum Finset.univ f`. It is the sum of `f x`,
where `x` ranges over the finite domain of `f`. -/
-syntax (name := bigsum) "∑ " extBinder ", " term:67 : term
-macro_rules (kind := bigsum)
+scoped syntax (name := bigsum) "∑ " extBinder ", " term:67 : term
+scoped macro_rules (kind := bigsum)
| `(∑ $x:ident, $p) => `(Finset.sum Finset.univ (fun $x:ident ↦ $p))
| `(∑ $x:ident : $t, $p) => `(Finset.sum Finset.univ (fun $x:ident : $t ↦ $p))
/-- `∏ x, f x` is notation for `Finset.prod Finset.univ f`. It is the product of `f x`,
where `x` ranges over the finite domain of `f`. -/
-syntax (name := bigprod) "∏ " extBinder ", " term:67 : term
-macro_rules (kind := bigprod)
+scoped syntax (name := bigprod) "∏ " extBinder ", " term:67 : term
+scoped macro_rules (kind := bigprod)
| `(∏ $x:ident, $p) => `(Finset.prod Finset.univ (fun $x:ident ↦ $p))
| `(∏ $x:ident : $t, $p) => `(Finset.prod Finset.univ (fun $x:ident : $t ↦ $p))
/-- `∑ x in s, f x` is notation for `Finset.sum s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
-syntax (name := bigsumin) "∑ " extBinder "in " term "," term:67 : term
-macro_rules (kind := bigsumin)
+scoped syntax (name := bigsumin) "∑ " extBinder "in " term "," term:67 : term
+scoped macro_rules (kind := bigsumin)
| `(∑ $x:ident in $s, $r) => `(Finset.sum $s (fun $x ↦ $r))
| `(∑ $x:ident : $t in $s, $p) => `(Finset.sum $s (fun $x:ident : $t ↦ $p))
/-- `∏ x, f x` is notation for `Finset.prod s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
-syntax (name := bigprodin) "∏ " extBinder "in " term "," term:67 : term
-macro_rules (kind := bigprodin)
+scoped syntax (name := bigprodin) "∏ " extBinder "in " term "," term:67 : term
+scoped macro_rules (kind := bigprodin)
| `(∏ $x:ident in $s, $r) => `(Finset.prod $s (fun $x ↦ $r))
| `(∏ $x:ident : $t in $s, $p) => `(Finset.prod $s (fun $x:ident : $t ↦ $p))
-end
+end BigOperators
--- open BigOperators -- Porting note: commented out locale
+open BigOperators
namespace Finset
@@ -630,7 +630,7 @@ theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
#align finset.sum_product Finset.sum_product
/-- An uncurried version of `Finset.prod_product`. -/
-@[to_additive "An uncurried version of `finset.sum_product`"]
+@[to_additive "An uncurried version of `Finset.sum_product`"]
theorem prod_product' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
(∏ x in s ×ᶠ t, f x.1 x.2) = ∏ x in s, ∏ y in t, f x y :=
prod_product
@@ -645,7 +645,7 @@ theorem prod_product_right {s : Finset γ} {t : Finset α} {f : γ × α → β}
#align finset.sum_product_right Finset.sum_product_right
/-- An uncurried version of `Finset.prod_product_right`. -/
-@[to_additive "An uncurried version of `finset.prod_product_right`"]
+@[to_additive "An uncurried version of `Finset.prod_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
(∏ x in s ×ᶠ t, f x.1 x.2) = ∏ y in t, ∏ x in s, f x y :=
prod_product_right
@@ -1057,11 +1057,11 @@ theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
/-- A product taken over a conditional whose condition is an equality test on the index and whose
alternative is `1` has value either the term at that index or `1`.
-The difference with `finset.prod_ite_eq` is that the arguments to `eq` are swapped. -/
+The difference with `Finset.prod_ite_eq` is that the arguments to `eq` are swapped. -/
@[to_additive (attr := simp) "A sum taken over a conditional whose condition is an equality
test on the index and whose alternative is `0` has value either the term at that index or `0`.
-The difference with `finset.sum_ite_eq` is that the arguments to `eq` are swapped."]
+The difference with `Finset.sum_ite_eq` is that the arguments to `eq` are swapped."]
theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
(∏ x in s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1 :=
prod_dite_eq' s a fun x _ => b x
@@ -1474,9 +1474,9 @@ theorem prod_involution {s : Finset α} {f : α → β} :
#align finset.sum_involution Finset.sum_involution
/-- The product of the composition of functions `f` and `g`, is the product over `b ∈ s.image g` of
-`f b` to the power of the cardinality of the fibre of `b`. See also `finset.prod_image`. -/
+`f b` to the power of the cardinality of the fibre of `b`. See also `Finset.prod_image`. -/
@[to_additive "The sum of the composition of functions `f` and `g`, is the sum over `b ∈ s.image g`
-of `f b` times of the cardinality of the fibre of `b`. See also `finset.sum_image`."]
+of `f b` times of the cardinality of the fibre of `b`. See also `Finset.sum_image`."]
theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
(∏ a in s, f (g a)) = ∏ b in s.image g, f b ^ (s.filter fun a => g a = b).card :=
calc
@@ -1607,22 +1607,22 @@ theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α
#align finset.eq_of_card_le_one_of_prod_eq Finset.eq_of_card_le_one_of_prod_eq
#align finset.eq_of_card_le_one_of_sum_eq Finset.eq_of_card_le_one_of_sum_eq
-/-- Taking a product over `s : finset α` is the same as multiplying the value on a single element
+/-- Taking a product over `s : Finset α` is the same as multiplying the value on a single element
`f a` by the product of `s.erase a`.
-See `multiset.prod_map_erase` for the `multiset` version. -/
-@[to_additive "Taking a sum over `s : finset α` is the same as adding the value on a single element
+See `Multiset.prod_map_erase` for the `Multiset` version. -/
+@[to_additive "Taking a sum over `s : Finset α` is the same as adding the value on a single element
`f a` to the sum over `s.erase a`.
-See `multiset.sum_map_erase` for the `multiset` version."]
+See `Multiset.sum_map_erase` for the `Multiset` version."]
theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
(f a * ∏ x in s.erase a, f x) = ∏ x in s, f x := by
rw [← prod_insert (not_mem_erase a s), insert_erase h]
#align finset.mul_prod_erase Finset.mul_prod_erase
#align finset.add_sum_erase Finset.add_sum_erase
-/-- A variant of `finset.mul_prod_erase` with the multiplication swapped. -/
-@[to_additive "A variant of `finset.add_sum_erase` with the addition swapped."]
+/-- A variant of `Finset.mul_prod_erase` with the multiplication swapped. -/
+@[to_additive "A variant of `Finset.add_sum_erase` with the addition swapped."]
theorem prod_erase_mul [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
(∏ x in s.erase a, f x) * f a = ∏ x in s, f x := by rw [mul_comm, mul_prod_erase s f h]
#align finset.prod_erase_mul Finset.prod_erase_mul
@@ -1641,8 +1641,8 @@ theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h
#align finset.prod_erase Finset.prod_erase
#align finset.sum_erase Finset.sum_erase
-/-- See also `finset.prod_boole`. -/
-@[to_additive "See also `finset.sum_boole`."]
+/-- See also `Finset.prod_boole`. -/
+@[to_additive "See also `Finset.sum_boole`."]
theorem prod_ite_one {f : α → Prop} [DecidablePred f] (hf : (s : Set α).PairwiseDisjoint f)
(a : β) : (∏ i in s, ite (f i) a 1) = ite (∃ i ∈ s, f i) a 1 := by
split_ifs with h
@@ -1911,13 +1911,13 @@ namespace Fintype
open Finset
-/-- `fintype.prod_bijective` is a variant of `finset.prod_bij` that accepts `function.bijective`.
+/-- `Fintype.prod_bijective` is a variant of `Finset.prod_bij` that accepts `Function.bijective`.
-See `function.bijective.prod_comp` for a version without `h`. -/
-@[to_additive "`fintype.sum_equiv` is a variant of `finset.sum_bij` that accepts
-`function.bijective`.
+See `Function.bijective.prod_comp` for a version without `h`. -/
+@[to_additive "`Fintype.sum_equiv` is a variant of `Finset.sum_bij` that accepts
+`Function.bijective`.
-See `function.bijective.sum_comp` for a version without `h`. "]
+See `Function.bijective.sum_comp` for a version without `h`. "]
theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α → β)
(he : Function.Bijective e) (f : α → M) (g : β → M) (h : ∀ x, f x = g (e x)) :
(∏ x : α, f x) = ∏ x : β, g x :=
@@ -1927,15 +1927,15 @@ theorem prod_bijective {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid
#align fintype.prod_bijective Fintype.prod_bijective
#align fintype.sum_bijective Fintype.sum_bijective
-/-- `fintype.prod_equiv` is a specialization of `finset.prod_bij` that
+/-- `Fintype.prod_equiv` is a specialization of `Finset.prod_bij` that
automatically fills in most arguments.
-See `equiv.prod_comp` for a version without `h`.
+See `Equiv.prod_comp` for a version without `h`.
-/
-@[to_additive "`fintype.sum_equiv` is a specialization of `finset.sum_bij` that
+@[to_additive "`Fintype.sum_equiv` is a specialization of `Finset.sum_bij` that
automatically fills in most arguments.
-See `equiv.sum_comp` for a version without `h`."]
+See `Equiv.sum_comp` for a version without `h`."]
theorem prod_equiv {α β M : Type _} [Fintype α] [Fintype β] [CommMonoid M] (e : α ≃ β) (f : α → M)
(g : β → M) (h : ∀ x, f x = g (e x)) : (∏ x : α, f x) = ∏ x : β, g x :=
prod_bijective e e.bijective f g h
Sets all big-operator precedences to 67, in keeping with the existing library note and with lean 3. https://github.com/leanprover-community/mathlib4/blob/82cf1905168dc57e7d95ce5576b7991b31e4f6ea/Mathlib/Algebra/BigOperators/Basic.lean#L89-L93
Fixes downstream code that relied on the wrong precedences. In all cases, the change in this PR makes the code match the parenthesization of the mathlib3 version.
I came across this problem when I tried to write
lemma sum_range_square (n : ℕ) :
∑i in Finset.range n, (i+1)^2 = n * (n + 1) * (2*n + 1)/6 := sorry
and I got the error
failed to synthesize instance
AddCommMonoid Prop
This PR fixes that error, so that my example successfully parses as expected.
@@ -105,28 +105,28 @@ open Std.ExtendedBinder
/-- `∑ x, f x` is notation for `Finset.sum Finset.univ f`. It is the sum of `f x`,
where `x` ranges over the finite domain of `f`. -/
-syntax (name := bigsum) "∑ " extBinder ", " term:51 : term
+syntax (name := bigsum) "∑ " extBinder ", " term:67 : term
macro_rules (kind := bigsum)
| `(∑ $x:ident, $p) => `(Finset.sum Finset.univ (fun $x:ident ↦ $p))
| `(∑ $x:ident : $t, $p) => `(Finset.sum Finset.univ (fun $x:ident : $t ↦ $p))
/-- `∏ x, f x` is notation for `Finset.prod Finset.univ f`. It is the product of `f x`,
where `x` ranges over the finite domain of `f`. -/
-syntax (name := bigprod) "∏ " extBinder ", " term:51 : term
+syntax (name := bigprod) "∏ " extBinder ", " term:67 : term
macro_rules (kind := bigprod)
| `(∏ $x:ident, $p) => `(Finset.prod Finset.univ (fun $x:ident ↦ $p))
| `(∏ $x:ident : $t, $p) => `(Finset.prod Finset.univ (fun $x:ident : $t ↦ $p))
/-- `∑ x in s, f x` is notation for `Finset.sum s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
-syntax (name := bigsumin) "∑ " extBinder "in " term "," term : term
+syntax (name := bigsumin) "∑ " extBinder "in " term "," term:67 : term
macro_rules (kind := bigsumin)
| `(∑ $x:ident in $s, $r) => `(Finset.sum $s (fun $x ↦ $r))
| `(∑ $x:ident : $t in $s, $p) => `(Finset.sum $s (fun $x:ident : $t ↦ $p))
/-- `∏ x, f x` is notation for `Finset.prod s f`. It is the sum of `f x`,
where `x` ranges over the finite set `s`. -/
-syntax (name := bigprodin) "∏ " extBinder "in " term "," term : term
+syntax (name := bigprodin) "∏ " extBinder "in " term "," term:67 : term
macro_rules (kind := bigprodin)
| `(∏ $x:ident in $s, $r) => `(Finset.prod $s (fun $x ↦ $r))
| `(∏ $x:ident : $t in $s, $p) => `(Finset.prod $s (fun $x:ident : $t ↦ $p))
@@ -951,8 +951,8 @@ theorem prod_apply_ite {s : Finset α} {p : α → Prop} {_hp : DecidablePred p}
theorem prod_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p} (f : ∀ x : α, p x → β)
(g : ∀ x : α, ¬p x → β) :
(∏ x in s, if hx : p x then f x hx else g x hx) =
- (∏ x in (s.filter p).attach, f x.1 $ by simpa using (mem_filter.mp x.2).2) *
- ∏ x in (s.filter fun x => ¬p x).attach, g x.1 $ by simpa using (mem_filter.mp x.2).2 := by
+ (∏ x in (s.filter p).attach, f x.1 (by simpa using (mem_filter.mp x.2).2)) *
+ ∏ x in (s.filter fun x => ¬p x).attach, g x.1 (by simpa using (mem_filter.mp x.2).2) := by
simp [prod_apply_dite _ _ fun x => x]
#align finset.prod_dite Finset.prod_dite
#align finset.sum_dite Finset.sum_dite
@@ -1394,7 +1394,7 @@ when the function we are summing is monotone.
-/
theorem sum_range_tsub [CanonicallyOrderedAddMonoid α] [Sub α] [OrderedSub α]
[ContravariantClass α α (· + ·) (· ≤ ·)] {f : ℕ → α} (h : Monotone f) (n : ℕ) :
- (∑ i in range n, f (i + 1) - f i) = f n - f 0 := by
+ ∑ i in range n, (f (i + 1) - f i) = f n - f 0 := by
apply sum_range_induction
case base => apply tsub_self
case step =>
@@ -1410,16 +1410,16 @@ theorem prod_const (b : β) : (∏ _x in s, b) = b ^ s.card :=
#align finset.prod_const Finset.prod_const
#align finset.sum_const Finset.sum_const
-@[to_additive]
+@[to_additive nsmul_eq_sum_const]
theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k in range n, b := by simp
#align finset.pow_eq_prod_const Finset.pow_eq_prod_const
-#align finset.smul_eq_sum_const Finset.smul_eq_sum_const
+#align finset.nsmul_eq_sum_const Finset.nsmul_eq_sum_const
-@[to_additive]
+@[to_additive sum_nsmul]
theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : (∏ x in s, f x ^ n) = (∏ x in s, f x) ^ n :=
Multiset.prod_map_pow
#align finset.prod_pow Finset.prod_pow
-#align finset.sum_smul Finset.sum_smul
+#align finset.sum_nsmul Finset.sum_nsmul
@[to_additive]
theorem prod_flip {n : ℕ} (f : ℕ → β) :
@@ -2105,7 +2105,7 @@ theorem exists_smul_of_dvd_count (s : Multiset α) {k : ℕ}
apply Finset.sum_congr rfl
intro x hx
rw [← mul_nsmul', Nat.mul_div_cancel' (h x (mem_toFinset.mp hx))]
- rw [← Finset.sum_smul, h₂, toFinset_sum_count_nsmul_eq]
+ rw [← Finset.sum_nsmul, h₂, toFinset_sum_count_nsmul_eq]
#align multiset.exists_smul_of_dvd_count Multiset.exists_smul_of_dvd_count
theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.prod id ∣ S.prod := by
@@ -373,14 +373,11 @@ theorem prod_union [DecidableEq α] (h : Disjoint s₁ s₂) :
#align finset.sum_union Finset.sum_union
@[to_additive]
-theorem prod_filter_mul_prod_filter_not (s : Finset α) (p : α → Prop) [DecidablePred p]
- [DecidablePred fun x => ¬p x] (f : α → β) :
+theorem prod_filter_mul_prod_filter_not
+ (s : Finset α) (p : α → Prop) [DecidablePred p] [∀ x, Decidable (¬p x)] (f : α → β) :
((∏ x in s.filter p, f x) * ∏ x in s.filter fun x => ¬p x, f x) = ∏ x in s, f x := by
- classical
- rw [← prod_union]
- · conv in ∏ x in s, f x => rw [← filter_union_filter_neg_eq (p ·) s]
- simp
- · simpa using disjoint_filter_filter_neg s s (p ·)
+ have := Classical.decEq α
+ rw [← prod_union (disjoint_filter_filter_neg s s p), filter_union_filter_neg_eq]
#align finset.prod_filter_mul_prod_filter_not Finset.prod_filter_mul_prod_filter_not
#align finset.sum_filter_add_sum_filter_not Finset.sum_filter_add_sum_filter_not
@@ -1112,13 +1109,13 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
(i_inj : ∀ a₁ a₂ h₁₁ h₁₂ h₂₁ h₂₂, i a₁ h₁₁ h₁₂ = i a₂ h₂₁ h₂₂ → a₁ = a₂)
(i_surj : ∀ b ∈ t, g b ≠ 1 → ∃ a h₁ h₂, b = i a h₁ h₂) (h : ∀ a h₁ h₂, f a = g (i a h₁ h₂)) :
(∏ x in s, f x) = ∏ x in t, g x := by
- classical refine'
- calc
- (∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
- _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
- prod_bij (fun a ha => i a (mem_filter.mp ha).1 $ by simpa using (mem_filter.mp ha).2)
- _ _ _ _
- _ = ∏ x in t, g x := prod_filter_ne_one
+ classical
+ calc
+ (∏ x in s, f x) = ∏ x in s.filter fun x => f x ≠ 1, f x := prod_filter_ne_one.symm
+ _ = ∏ x in t.filter fun x => g x ≠ 1, g x :=
+ prod_bij (fun a ha => i a (mem_filter.mp ha).1 $ by simpa using (mem_filter.mp ha).2)
+ ?_ ?_ ?_ ?_
+ _ = ∏ x in t, g x := prod_filter_ne_one
· intros a ha
refine' (mem_filter.mp ha).elim _
intros h₁ h₂
@@ -1134,8 +1131,7 @@ theorem prod_bij_ne_one {s : Finset α} {t : Finset γ} {f : α → β} {g : γ
· intros b hb
refine' (mem_filter.mp hb).elim fun h₁ h₂ ↦ _
obtain ⟨a, ha₁, ha₂, eq⟩ := i_surj b h₁ fun H ↦ by rw [H] at h₂; simp at h₂
- refine' ⟨a, mem_filter.mpr ⟨ha₁, _⟩, eq⟩
- classical exact decide_eq_true ha₂
+ exact ⟨a, mem_filter.mpr ⟨ha₁, ha₂⟩, eq⟩
#align finset.prod_bij_ne_one Finset.prod_bij_ne_one
#align finset.sum_bij_ne_zero Finset.sum_bij_ne_zero
@@ -1565,12 +1561,9 @@ theorem prod_cancels_of_partition_cancels (R : Setoid α) [DecidableRel R.r]
(h : ∀ x ∈ s, (∏ a in s.filter fun y => y ≈ x, f a) = 1) : (∏ x in s, f x) = 1 := by
rw [prod_partition R, ← Finset.prod_eq_one]
intro xbar xbar_in_s
- obtain ⟨x, x_in_s, xbar_eq_x⟩ := mem_image.mp xbar_in_s
- rw [← xbar_eq_x, filter_congr]
- · apply h x x_in_s
- · intros
- simp only [decide_eq_true_eq, ← Quotient.eq]
- rfl
+ obtain ⟨x, x_in_s, rfl⟩ := mem_image.mp xbar_in_s
+ simp only [← Quotient.eq] at h
+ exact h x x_in_s
#align finset.prod_cancels_of_partition_cancels Finset.prod_cancels_of_partition_cancels
#align finset.sum_cancels_of_partition_cancels Finset.sum_cancels_of_partition_cancels
The unported dependencies are