I apologize if it is a too elementary question but I could not find the appropriate documentation so far.
My goal is simple. I would like to add some assumptions that are defined in terms of patterns rather than symbols. For example, I would like to something like this
$Assumptions = { a[ ___ ] > 0 };
In my ideal world, this should set every expression with the Head
a
should be considered positive. Is it possible in Mathematica?
EDIT:
Thanks. Following the first comment and the first answer, I did the following experiment. I still got puzzled about the result. Maybe it is just because of the intricate interaction between Integrate
and $Assumptions
.
$Assumptions = {A[___] > 0, B > 0};
Integrate[ Exp[ - A[x] t] , {t, 0, \[Infinity]}]
Integrate[ Exp[ - B t] , {t, 0, \[Infinity]}]
(* output *)
ConditionalExpression[1/A[x], Re[A[x]] > 0]
1/B
In this example, Integrate
does not make use of the fact A[___]>0
.
$Assumptions = {a[__] > 0};Refine[a[3] > 0]
, and the result wasTrue
. You should have just tried it! :) (As "simple" as this is, I never thought of it.) $\endgroup$Integrate
assumes that its argument (and all variables) are all complex. It seems like$Assumptions
is very conservative, in the sense that it will only apply theA[___] >0
assumption if it knows it's real. if it knowsA[___]
is real. AddElement[A[___], Reals]
to$Assumptions
, and you don't get the conditional expression. I'm not sure about the differences between those two, though. That's interesting. $\endgroup$