Skip to content

Commit 14e44da

Browse files
author
Pim Otte
committed
feat(Algebra/BigOperators/Group/Finset): Lemma for product being a square (#14622)
Added a small lemma that shows a product is a square if all the terms are squares
1 parent 11ef377 commit 14e44da

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Mathlib/Algebra/BigOperators/Group/Finset.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,17 @@ lemma prod_mul_eq_prod_mul_of_exists [DecidableEq α] {s : Finset α} {f : α
20542054
simp only [mem_erase, ne_eq, not_true_eq_false, false_and, not_false_eq_true, prod_insert]
20552055
rw [mul_assoc, mul_comm, mul_assoc, mul_comm b₁, h, ← mul_assoc, mul_comm _ (f a)]
20562056

2057+
@[to_additive]
2058+
lemma isSquare_prod {s : Finset ι} [CommMonoid α] (f : ι → α)
2059+
(h : ∀ c ∈ s, IsSquare (f c)) : IsSquare (∏ i ∈ s, f i) := by
2060+
rw [isSquare_iff_exists_sq]
2061+
use (∏ (x : s), ((isSquare_iff_exists_sq _).mp (h _ x.2)).choose)
2062+
rw [@sq, ← Finset.prod_mul_distrib, ← Finset.prod_coe_sort]
2063+
congr
2064+
ext i
2065+
rw [← @sq]
2066+
exact ((isSquare_iff_exists_sq _).mp (h _ i.2)).choose_spec
2067+
20572068
end CommMonoid
20582069

20592070
section CancelCommMonoid

0 commit comments

Comments
 (0)