Is there a way to compare two functions for equality? For example, (λx.2*x) == (λx.x+x) should return true, because those are obviously equivalent.
(λx.2*x) == (λx.x+x)
In a language with symbolic computation like Mathematica:
Or C# with a computer algebra library:
MathObject f(MathObject x) => x + x; MathObject g(MathObject x) => 2 * x; { var x = new Symbol("x"); Console.WriteLine(f(x) == g(x)); }
The above displays 'True' at the console.