I have a parametric probability distribution that should reduce to exactly equivalent to a Uniform distribution when the second parameter is zero, but I can’t get Mathematica to test the equivalence.
The resulting equalities “eyeball” as tautologically equal, but I can’t get Solve, Simplify, Reduce, etc. to give me a True. (SameQ does yield False, as it should.)
I can get close with ForAll, but it gets confused with the CDF at x=0.
First, is this clunky ForAll construct really the only way to make this test? And second, is there any way to get ForAll (or the correct function) to see the CDFs as equivalent despite the ever-so-slight difference in definition?
Sorry for not including copiable code in the original message; it didn’t seem to me to bear on the question of comparing two functions, and it didn’t render quite as I expected. Should work, though.
(* Original, intended definition *)
MDistribution[f_, a_] = ProbabilityDistribution[a*Cos[f*2*\[Pi]*x] + 1, {x, 0, 1}];
(* The above behaves oddly at the endpoints, this was the suggested fix: *)
pdf2 = Piecewise[{{0, 1 < x < \[Infinity]}, {a*Cos[f*2*\[Pi]*x] + 1, 0 <= x <= 1}, {0, -\[Infinity] < x < 0}}]
MDistribution[f_, a_] = ProbabilityDistribution[pdf2, {x, -\[Infinity], \[Infinity]}];
FullSimplify[ForAll[n, PDF[MDistribution[f, 0]][n] == PDF[UniformDistribution[{0, 1}]][n]]]
FullSimplify[ForAll[n, CDF[MDistribution[f, 0]][n] == CDF[UniformDistribution[{0, 1}]][n]]]
Reduce could also be used for these. FullSimplify is a different beast. Also it seems they are not quite equivalent outside the reals (maybe they are undefined there).
Resolve[...,Reals] is precisely what I needed to ask my question in a way that Mathematica would understand it. The previous results were confusing without the Reals qualifier because I thought it assumed Reals whenever a variable gets used in an inequality.
Maybe an inequality in a Piecewise[] function doesn’t count as getting used in an inequality.