Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multiplying an inequality by -1.

I am new to sage and wondering why it doesn't reverse the terms (or the sign) of an inequality when multiplying by -1. E.g.:

sage: var('x y')
(x, y)
sage: f = x + 3 < y - 2
sage: f*2
2*x + 6 < 2*y - 4   # preserves truth-value of f
sage: f*(-1)
-x - 3 < -y + 2     # reverses truth-value of f

Why?

Multiplying an inequality by -1.

I am new to sage and wondering why it doesn't reverse the terms (or the sign) of an inequality when multiplying by -1. E.g.:

sage: var('x y')
(x, y)
sage: f = x + 3 < y - 2
sage: f*2
2*x + 6 < 2*y - 4   # preserves truth-value of f
sage: f*(-1)
-x - 3 < -y + 2     # reverses truth-value of f

Why?

click to hide/show revision 3
retagged

Multiplying an inequality by -1.

I am new to sage and wondering why it doesn't reverse the terms (or the sign) of an inequality when multiplying by -1. E.g.:

sage: var('x y')
(x, y)
sage: f = x + 3 < y - 2
sage: f*2
2*x + 6 < 2*y - 4   # preserves truth-value of f
sage: f*(-1)
-x - 3 < -y + 2     # reverses truth-value of f

Why?