Ask Your Question

Revision history [back]

If the inequalities are linear (as in your example), you can define a polyhedron P from them. Then given a new inequality, it also defines a polyhedron Q (a half space), and ask wether this new polyhedron Q contains the initial one P.

You can define polytopes fro inequalities using the Polyhedron(ieqs=...) syntax, see, for example:

  • https://doc.sagemath.org/html/en/thematic_tutorials/geometry/polyhedra_quicktutorial.html
  • https://doc.sagemath.org/html/en/reference/discrete_geometry/sage/geometry/polyhedron/constructor.html

To test that Q contains P, you can do:

sage: P.intersection(Q) == P

Note that inequalities have to be large (<=), not strict (<). If you absolutely want to test strict inequalities, you can use vertices and test inclusion in the interior, using P.interior_contains method.