Failure to check simple conditions using boolean tests

asked 2022-09-26 03:11:43 +0100

ltmb gravatar image

Hi folks,

I am currently designing a microeconomics course using SageMath (9.6) on CoCalc. For one exercise, I would like to use boolean tests to determine whether a production function is exhibiting increasing/constant/decreasing returns to scale.

Doing so, I ran into the following oddities (probably linked to one another), which I was hoping someone could help me with :

a = var("a")
assume(a > 1)
assume(a, "real")
# Check that 'a' is positive
print(a.is_positive())  # First oddity
# Check that sqrt(a) < a
print(bool(a**(1/2) < a)) # Second oddity



Both statements should obviously be true. I am getting the same results when running the code on SageMath 9.1 and SageMath 9.4. Am I missing something or are we dealing with a bug ?

Any help will be greatly appreciated.

edit retag flag offensive close merge delete


I believe I was able to find the answer to my question in another thread :

Long story short, Maxima is behind both assume() and solve(). However, it does not rely on the assumptions made elsewhere in its solver. If I understand correctly, this therefore means that the a I describe in my assumption(s) is somewhat distinct from the one I initiated and called in the booleans, which is quite interesting.

ltmb gravatar imageltmb ( 2022-09-29 23:23:30 +0100 )edit