Is there a name for this sort-of-inverse function?

130 Views Asked by At

I'm looking for the mathematical name of a particular function which is available in several functional programming languages.

If $f$ is a function $f:X\to Y$, then define $g : Y \to 2^X$ as follows.

$g(y) = \{x \in X \mid f(x) = y\}$

For example, if $f(0) = 1, f(1) = 2, f(2) = 1, f(3) = 3$, then $g(0) = \emptyset, g(1)=\{0,2\}, g(2) = \{1\}, g(3)=\{3\}$.

2

There are 2 best solutions below

2
On

Well, given a function $f:X\rightarrow Y$. Define the relation $$x\equiv x':\Longleftrightarrow f(x)=f(x').$$ This is an equivalence relation on $X$ and the equivalence class $\bar x = \{x'\in X\mid x\equiv x'\}$ of $x\in X$ is the fibre of $x$ w.r.t. $f$.

Then the function $g:Y\rightarrow 2^X$ is given by $g(y) = f^{-1}(y)$, where $f^{-1}(y)=\{x\in X\mid f(x)=y\}$ is the preimage of $y\in Y$ in $f$. This preimage is given by a fibre, i.e., if $f(x)=y$, then $f^{-1}(y) = \bar x$. Note that $g(y)=\emptyset$ if $y$ is not in the image of $f$.

0
On

This is called the preimage, and is usually denoted by $f^{-1}$ (not to be confused with the inverse, which uses the same notation!). In this case you only look at the preimage of one element, but we often consider it for more general sets as well. That is, given $A \subseteq Y$ we have $$ f^{-1}(A) = \{ x \in X : f(x) \in A \}. $$ In the specific case you are interested in, $A$ is just a singleton every time.