3
$\begingroup$

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?

$\endgroup$
10
  • $\begingroup$ Returns False for me. $\endgroup$
    – corey979
    May 6, 2020 at 21:55
  • $\begingroup$ o.O, I cleaned my Kernel before trying. Are you using 12.1? What InverseFunction[DiracDelta][0] gives to you? $\endgroup$
    – GarouDan
    May 6, 2020 at 21:57
  • $\begingroup$ 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. $\endgroup$
    – corey979
    May 6, 2020 at 21:59
  • 1
    $\begingroup$ 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. $\endgroup$
    – user64494
    May 7, 2020 at 10:39
  • 1
    $\begingroup$ "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. $\endgroup$ May 7, 2020 at 11:09

1 Answer 1

6
$\begingroup$

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].

$\endgroup$
4
  • 2
    $\begingroup$ 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 $\endgroup$
    – user64494
    May 7, 2020 at 10:42
  • 1
    $\begingroup$ @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. $\endgroup$
    – Szabolcs
    May 7, 2020 at 10:43
  • 2
    $\begingroup$ I think the correct implementation of $\delta$-distribution in Mathematica should be done. The current DiracDelta command is a primitive implementation which is buggy. $\endgroup$
    – user64494
    May 7, 2020 at 10:48
  • 5
    $\begingroup$ 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. $\endgroup$
    – Szabolcs
    May 7, 2020 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.