ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 08 Jun 2016 01:06:41 +0200Testing inequalities in sagehttps://ask.sagemath.org/question/10388/testing-inequalities-in-sage/I wanted to show if:
$$ |a+b| \leq |a| + |b|$$
So I wrote this in sage:
var('a','b')
eqn1=abs(a+b)
eqn2=abs(a)+abs(b)
bool(eqn1<=eqn2)
The result is False.
I had expected the result to be True. What is the correct way to test this in sage?
Thank you in advance for any help provided.ensabaFri, 26 Jul 2013 08:22:04 +0200https://ask.sagemath.org/question/10388/Proof inequality given some assumptions on the variableshttps://ask.sagemath.org/question/33690/proof-inequality-given-some-assumptions-on-the-variables/I have an inequality in multiple variables and want to show that it is true given that the variables satisfy some conditions (also formulated as inequalities).
I come from Mathematica, where I can write `Reduce[Implies[0<x<1, x>x^2], Reals]` and get `true` as the answer. Is Sage (maybe with some optional package) able to verify these kinds of implications?
This is a simplified implication I want to show: $0 < f \leq 1$ and $z \geq \frac{1}{\sqrt{1+0.8f}}$, implies $$\left((z+f)^2-f^2-1\right)^2+\left((z-1+2f)^2-4f^2\right) > 0$$
So far I tried qepcad but the following code just ran forever:
var('z, f'); qf = qepcad_formula;
qepcad( qf.implies(qf.and_(f>0, f<=1, z>=1/(sqrt(1+4*f/5))), ((z + f)^2 - f^2 - 1)^2 + (z - 1 + 2*f)^2 - 4*f^2>0) )
Are there better ways to formulate my statement using qepcad, are there better packages available or is Sage not able to help me here?
Note that I don't need help for the given example, as I proved this already. However I have similar more complicated implications of the same form which I need to check using some other CAS than Mathematica. Can Coq do this?LuxWed, 08 Jun 2016 01:06:41 +0200https://ask.sagemath.org/question/33690/