Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit e3ad468

Browse files
committed
feat(data/list/prod_monoid): add prod_eq_pow_card (#12473)
1 parent 7dcba96 commit e3ad468

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/data/list/prod_monoid.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ begin
2727
{ rw [list.repeat_succ, list.prod_cons, ih, pow_succ] }
2828
end
2929

30+
@[to_additive sum_eq_card_nsmul]
31+
lemma prod_eq_pow_card [monoid α] (l : list α) (m : α) (h : ∀ (x ∈ l), x = m) :
32+
l.prod = m ^ l.length :=
33+
begin
34+
convert list.prod_repeat m l.length,
35+
exact list.eq_repeat.mpr ⟨rfl, h⟩,
36+
end
37+
3038
@[to_additive]
3139
lemma prod_le_of_forall_le [ordered_comm_monoid α] (l : list α) (n : α) (h : ∀ (x ∈ l), x ≤ n) :
3240
l.prod ≤ n ^ l.length :=

0 commit comments

Comments
 (0)