On The Computability of Parametric Inversion

Parametric inversion, introduced in (Tavares & Solar-Lezama, 2016), generalizes the classical notion of function inversion to non-invertible functions by introducing a parameterized function that selects specific elements from the preimage of a given function. This approach enables inverting functions that are not bijective, opening up new possibilities for practical applications.

In (Tavares & Solar-Lezama, 2016), the authors mentioned that

In contrast to a conventional inverse, a parametric inverse always exists.

While this holds mathematically, the computability of parametric inverses presents additional challenges. Computability is essential for algorithmic applications, determining whether such inverses can be constructed and utilized effectively. In this document, I examine the computability of parametric inverses within the framework of Type-2 Computability (Weihrauch, 2000). I show that a computable function need not have a computable parametric inverse, illustrating a limitation of this concept.


Parametric Inversion

Definition For a function $f: X \to Y$, a function $ f^{-1} : Y \times \Theta \to X $ is a parametric inverse of $f$ if, for all $y \in Y$:

\[\{ f^{-1}(y, \theta) \mid \theta \in \Theta \} = \set{ x \in X \mid f(x) = y }.\]

Here, $\theta$ serves as a parameter to select specific elements from the preimage of $f$, ensuring full coverage of the preimage for each $y$.

Mathematically, a parametric inverse always exists for any function $f$. To construct one:

  1. For each $y$, choose an abitrary element $x^*_y \in \set{ x \in X \mid f(x) = y }$.
  2. Let $\Theta = X$.
  3. Define a trivial parametric inverse as:

    \[f^{-1}(y, \theta) = \begin{cases} \theta & \text{if } f(\theta) = y, \\ x^*_y & \text{otherwise}. \end{cases}\]

However, when considering continuous (or computable) functions, ensuring that the parametric inverse is also continuous (or computable) becomes more complex. This distinction leads to interesting limitations, as shown in the example below.


A Computable Function Without a Computable Parametric Inverse

Consider the ReLU function, $\mathrm{relu}: \mathbb{R} \to \mathbb{R}$, defined as:

\[\mathrm{relu}(x) = \max(x, 0).\]

The ReLU function is continuous and computable because $\max(., .)$ is continuous and computable (Weihrauch, 2000, theorem 4.3.2).

However, any parametric inverse $\mathrm{relu}^{-1}$ is discontinuous, as shown below.

Proof of Discontinuity
  1. For $x = a$, where $a < 0$, we have $\mathrm{relu}(a) = 0$.
  2. By the definition of parametric inverse, there exists $\theta^* \in \Theta$ such that:
    • $\mathrm{relu}^{-1}(0, \theta^*) = a$, and
    • $\mathrm{relu}^{-1}(y, \theta^*) = y$ for all $y > 0$.

The second point implies a jump discontinuity at $y = 0$ for $\mathrm{relu}^{-1}(y, \theta^*)$, as shown in the figure:

Since every computable function on $\mathbb{R}$ is continuous (Weihrauch, 2000, theorem 4.3.1), the discontinuity imples $\mathrm{relu}^{-1}$ is not computable. Thus, the $\mathrm{relu}$ example demonstrates a computable function lacking a computable parametric inverse.


When Is Parametric Inversion Computable?

Functions defined on computably enumerable sets (e.g., integers $\mathbb{Z}$, rationals $\mathbb{Q}$, finite-length strings $\Sigma^*$) admit computable parametric inverses. A simple construction is as follows:

Let $f: X \to Y$ be a computable function mapping bewteen computably enumerable domains $X$ and $Y$. Let $\Theta = \mathbb{N}$. Define $f^{-1} : Y \times \Theta \to X$ with the following pseudo-code:

def make_parametric_inverse(f: Callable[[X], Y]) -> Callable[[Y, Naturals], X]:
    def parametric_inverse(y: Y, theta: Naturals) -> X:
        for x in X:  # Assume X is computably enumerable
            if f(x) == y:  # Equality testing is computable for computably enumerable Y
                if theta == 0:
                    return x
                theta -= 1
    return parametric_inverse

This algorithm ensures computability but is inefficient, relying on exhaustive enumeration.

For general domains, computability appears to hinge on additional structure of the function, such as a computable enumeration of the function’s local optima, a topic worth further exploration.


Conclusion

Parametric inverses provide a flexible framework for “inverting” non-bijective functions, with guaranteed existence mathematically. However, their computability depends on the function’s domain and properties. As shown, computable functions on reals may lack computable parametric inverses due to discontinuities in the inverse. On the other hand, functions on discrete domains offer a more favorable computability landscape. This nuanced interplay highlights interesting directions for further study within computability theory.




If you found this useful, please cite this as:

Yang, Cambridge (Dec 2024). On The Computability of Parametric Inversion. https://people.csail.mit.edu/camyang.

or as a BibTeX entry:

@article{yang2024on-the-computability-of-parametric-inversion,
  title   = {On The Computability of Parametric Inversion},
  author  = {Yang, Cambridge},
  year    = {2024},
  month   = {Dec},
  url     = {https://people.csail.mit.edu/camyang/blog/2024/computable-parametric-inversion/}
}

References

  1. [1] Tavares, Zenna and Solar-Lezama, Armando. Parametric Inverse Simulation. 2016. [Link]
  2. [2] Weihrauch, Klaus. Computable Analysis: An Introduction. 2000.



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • JAX, Static-Shape Programming and Polyhedron
  • Estimating Fluid Velocity and Diffusion from Temperature Measurements (Part 2, Simulation)
  • Estimating Fluid Velocity and Diffusion from Temperature Measurements (in Theory)