This question already has an answer here:
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]]]
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.