It seems many programming languages have a function similar to `groupBy`

. Does anyone know whether there is a general mathematical name for this function? I.e., if `f`

is a function (in the set theory sense) mapping set X to Y, f inverse may not exist, but I certainly can pair every element `y`

in the range with the set of elements `x`

, in the domain which `f(x) = y`

.

If `f`

maps `X`

to `Y`

, then `groupBy(f)`

(for lack of better notation) maps `Y`

to the power set of `X`

, and is a well-defined function.

If I’m not mistaken, I believe such an operator also exists in relational algebra. Perhaps that name might be useful and evocative.

Does anyone know if this function has a name? I’m tempted to call it the `reciprocal`

function.