# Inverse of DiracDelta at 0 is 99/5?

Here in this other question of mine I asked the question, but maybe here is more pertinent.

When using Mathematica we can find the following result:

InverseFunction[DiracDelta][0] == 99/5 (* returns True *)


Is this a bug or is it actually a real result? If it is a valid result, how can we prove it?

• Returns False for me. May 6, 2020 at 21:55
• o.O, I cleaned my Kernel before trying. Are you using 12.1? What InverseFunction[DiracDelta][0] gives to you? May 6, 2020 at 21:57
• v10.4 - and InverseFunction[DiracDelta][0] returns 42/5. I'd call it a bug. Contact Wolfram support to ask them if they have any justification for this (although from the mathematical point of view this doesn't make sense), and report to them this is a likely bug. May 6, 2020 at 21:59
• The $\delta$-distribution is not a usual function so DiracDelta[99/5] makes no sense. Therefore, the input should be returned with an error message. May 7, 2020 at 10:39
• "an otherwise reasonable approach taken by InverseFunction" - my personal opinion is that InverseFunction[] should just refuse to work with things like DiracDelta[] and HeavisideTheta[], @Szabolcs. I guess we will have to agree to disagree here. May 7, 2020 at 11:09

I disagree that this is a bug. From the InverseFunction docs,

As discussed in "Functions That Do Not Have Unique Values", many mathematical functions do not have unique inverses. In such cases, InverseFunction[f] can represent only one of the possible inverses for f.

Thus, InverseFunction[f][x] returns some y such that f[y] == x.

This is fine:

DiracDelta[99/5]
(* 0 *)


Another comparable example:

InverseFunction[UnitStep][1]
(* 0 *)

InverseFunction[UnitStep][0]
(* -1 *)


It seems to me that this is a GIGO situation because DiracDelta and UnitStep yield the same result for infinitely many inputs. Any of those inputs is consistent with the description of what InverseFunction does. But of course, this behaviour of InverseFunction must have been designed for the more practical case where there are a finite (or countable) number of solutions, such as InverseFunction[#^2 &][1] or InverseFunction[Sin][1].

• The $\delta$-distribution is not a usual function so DiracDelta[99/5] makes no sense. Therefore, the input should be returned with an error message May 7, 2020 at 10:42
• @user64494 By that thinking, there should be no DiracDelta at all in Mathematica. But I'm pretty sure that when Dirac, a physicist, imagined this, he used intuition from normal functions, despite the fact that the idea could only be made mathematically precise using distribution theory. May 7, 2020 at 10:43
• I think the correct implementation of $\delta$-distribution in Mathematica should be done. The current DiracDelta command is a primitive implementation which is buggy. May 7, 2020 at 10:48
• Also by the same thinking, there should be no Infinity in Mathematica, or in any floating point representation standards, because, of course, Infinity is not a number and 1/0 is just nonsense. The countless programs that make use of this value should all be thrown out and considered buggy, along with any CPU implementing IEEE754. May 7, 2020 at 10:50