I defined the following functions
CreatorQ[_] := False;
AnnihilatorQ[_] := False;
CreatorQ[q] := True;
AnnihilatorQ[p] := True;
CreatorQ[J[n_]] /; n < 0 := True;
AnnihilatorQ[J[n_]] /; n > 0 := True;
and when I ask for
Assuming[r < 0, CreatorQ[J[r]]]
I get False instead of True. I know that probabilly it's because Matehamtica doesn't evaluate the r, but I have no idea how to change the code in order to get the correct answer.
Thanks
rsymbol or with the downvalues of the functionCreatorQ. I thinkAssumingisn't doing what you think it should. It simply adds the assumption into $Assumptions, which some functions likeSimplifyuse. This I think does not have any effect on user defined functions, unless they useRefine,Simplify,FullSimplifyorFunctionExpand– Vahagn Tumanyan Jan 27 '17 at 14:20/;because if I defineCreatorQ[J[n_]]:= n<0it works! – MaPo Jan 27 '17 at 14:47