# How to 'define' value in Assumptions but not let Simplify replace it? [closed]

I want to let Simplify know the exact value of a symbol, to resolve logical statements, but don't want it to actually replace it. For instance, I would like something like

assumptions = x==4;
Simplify[Sqrt[x^2], assumptions]


to output x and not 4 (or Abs[x]).

How can this, or something analogous, be done?

Edit: It wasn't clear enough that I understand that in this case an assumption like x>0 would output what I want -- however, this is not what I'm looking for. This is what I have been doing so far, but it is messy and needs focused attention. That is, I need to be sure that the eps that I set to define a range as

assumptions = (x > xValue - eps) && (x < xValue + eps)


is small enough for every independent simplification to be equivalent to that of

assumptions = x == xValue


Even if I could generaly chose a value exaggeratedly small such that this would be the case for all my problems, I'd still like to find a better alternative -- if there is one.

• If instead of the exact value, you provide a range of values (for instance 3<x<5), the simplification will be done, but the values will not be substituted. Oct 15 at 20:00
• @yarchik That is what I have been doing in this situation, but have always wondered if there isn't a more elegant and general solution. Oct 15 at 20:02
• At the risk of pointing the obvious, these three examples are from the doc page on Simplify.
– Syed
Oct 15 at 20:51
• @Syed I understand that! It's just that it would be preferable to define the exact value because in very complicated scenarios, with a lot of variables, there is no direct way of defining a safe range for the variable in such a way that the expression is simplified to the max. Oct 15 at 21:03
• Would x <=4 && x>=4 work for you? Oct 15 at 22:45

One possibility is to mimic the behavior of symbolic constants like Pi, E, etc:

N[x, _] ^= 4;
NumericQ[x] ^= True;


Then:

Sqrt[x^2]


x

without even using Simplify.