Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Failure to check simple conditions using boolean tests

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.