Scalar aggregation for tensor reduction #
This module defines the einops aggregates that do not already have canonical
mathlib names. Multiset.sum and Multiset.prod are used directly.
Boolean any and all are total and use the usual empty identities false
and true. Exact mean, min, and max take evidence that their input
multiset is nonempty. The lowering layer obtains that evidence from the
checked tensor shape, independently of tensor values.
Boolean disjunction over a multiset; the empty result is false.
Instances For
Boolean conjunction over a multiset; the empty result is true.
Instances For
The exact arithmetic mean of a nonempty multiset.
DivisionRing permits noncommutative multiplication because averaging uses
only addition and division by the natural-number cardinality. CharZero
ensures a positive cardinality remains nonzero in the scalar type. Neither the
nonemptiness evidence nor that instance is inspected by the formula; both are
retained so that exactness is part of the aggregate's public contract rather
than only a later theorem.
Instances For
The least value in a nonempty multiset.
Instances For
A minimum of a nonempty multiset is one of its values.
The greatest value in a nonempty multiset.
Instances For
A maximum of a nonempty multiset is one of its values.