Skip to content

Commit

Permalink
chore(algebra/big_operators/basic): golf (#16427)
Browse files Browse the repository at this point in the history
  • Loading branch information
negiizhao committed Sep 8, 2022
1 parent d75314b commit aff61c0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/algebra/big_operators/basic.lean
Expand Up @@ -1129,18 +1129,15 @@ begin
end

@[simp, to_additive] lemma prod_const (b : β) : (∏ x in s, b) = b ^ s.card :=
by haveI := classical.dec_eq α; exact
finset.induction_on s (by simp) (λ a s has ih,
by rw [prod_insert has, card_insert_of_not_mem has, pow_succ, ih])
(congr_arg _ $ s.val.map_const b).trans $ multiset.prod_repeat b s.card

@[to_additive]
lemma pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ k in range n, b := by simp

@[to_additive]
lemma prod_pow (s : finset α) (n : ℕ) (f : α → β) :
∏ x in s, f x ^ n = (∏ x in s, f x) ^ n :=
by haveI := classical.dec_eq α; exact
finset.induction_on s (by simp) (by simp [mul_pow] {contextual := tt})
multiset.prod_map_pow

@[to_additive]
lemma prod_flip {n : ℕ} (f : ℕ → β) :
Expand Down

0 comments on commit aff61c0

Please sign in to comment.