Can someone please explain the following phenomenon to me?
I am using Refine to evaluate a symbolic Max expression with a condition that explicitly states which of the inputs is the maximum, like this:
Refine[Max[0, 1/b - a1 - a2 - a3], 1/b - a1 - a2 - a3 > 0 && b > 0]
which correctly yields 1/b - a1 - a2 - a3. Now if I add another variable to the sum:
Refine[Max[0, 1/b - a1 - a2 - a3 - a4], 1/b - a1 - a2 - a3 - a4 > 0 && b > 0]
suddenly the Refine command fails and simply states Max[0, 1/b - a1 - a2 - a3 - a4]. This confuses me as Mathematica is generally quite strong with symbolic simplifications and here I outright state the supposed result.
Another peculiarity is that the process works again if instead of 1/b I simply use b:
Refine[Max[0, b - a1 - a2 - a3 - a4], b - a1 - a2 - a3 - a4 > 0 && b > 0]
(* -a1 - a2 - a3 - a4 + b *)
I tried Simplify, FullSimplify, Reduce (with 0 < 1/b - a1 - a2 - a3 - a4 instead of the Maxexpression) alone and in conjunction with Refine.
Is this a software limitation? And if so, can I work around this? I wouldn't see a mathematical reason for this behavior.
I am using Mathematica 12.0.
By the way, I am well aware that this refinement has no use what so ever. I just stumbled across this during an attempted generalization, which failed after adding more variables to the mix.
With[{a1 = (1 - a2 b - a3 b - a4 b - b z)/b}, Refine[Max[0, 1/b - a1 - a2 - a3 - a4], 1/b - a1 - a2 - a3 - a4 > 0 && b > 0]] /. z -> 1/b - a1 - a2 - a3 - a4 // Simplify. – AccidentalFourierTransform Jan 21 '20 at 14:59Maxor the assumption becomes a bit more complicated or at least if they are not the exact same. Any idea, why this is happening in the first place? – niak Jan 21 '20 at 15:45