English
The noncommProd s comm is the product of the elements of s taken in some order, provided all pairs commute; this generalizes ordinary product when commutativity holds.
Русский
Неcкоммутативное произведение по множеству — это произведение элементов по произвольному порядку, если любые пара элементов commute; это обобщает обычное произведение при полной коммутативности.
LaTeX
$$$s.noncommProd comm = \\mathrm{fold} (\\cdot) 1 \\,s$ with commutation assumption.$$
Lean4
/-- Product of a `s : Multiset α` with `[Monoid α]`, given a proof that `*` commutes
on all elements `x ∈ s`. -/
@[to_additive /-- Sum of a `s : Multiset α` with `[AddMonoid α]`, given a proof that `+` commutes
on all elements `x ∈ s`. -/
]
def noncommProd (s : Multiset α) (comm : {x | x ∈ s}.Pairwise Commute) : α :=
s.noncommFold (· * ·) comm 1