2
$\begingroup$

If I restrict a variable x to x>0 via $Assumptions=x>0, is there a way I can get Mathematica to tell me that x>0? I would have guessed typing Attributes[x] would say something, but it gives {}.

$\endgroup$

1 Answer 1

5
$\begingroup$

I don't yet have the reputation for commenting, but perhaps this suffices as an answer as well: why not just evaluate $Assumptions to get a list of active global assumptions about variables?

$Assumtions=x>0
$Assumptions
(*x>0*)
$\endgroup$
1
  • 1
    $\begingroup$ (+1) in case #Assumptions is a long list involving other variables, you can filter using Cases[_[___, x, ___]]@$Assumptions or Select[Not@*FreeQ[x]]@$Assumptions $\endgroup$
    – kglr
    Feb 18, 2021 at 5:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.