Applying this code
def One_dimension_loss(representationH) :
x = list(var('x_%i' % i) for i in (0..2))
sol=[solve_ineq(ieq,[x[0]]) for ieq in Ineq]
sol_r=flatten([x[1] for x in sol])
ineq_ge=[z for z in sol_r if z.rhs() == x[0]]
ineq_le=[z for z in sol_r if z.lhs() == x[0]]
ineq_a=[z for z in sol_r if z.lhs() != x[0] and z.rhs() != x[0]]
ineq_aa=[(z.lhs()).full_simplify()>=0 for z in ineq_a]
result=flatten(ineq_aa+[[(ineq_le[j].rhs()-ineq_ge[i].lhs()).full_simplify() >= 0 for i in range(len(ineq_ge))]
for j in range(len(ineq_le))])
#result1=[result[i].factor() for i in range(len(result))]
return result
to
D = polytopes.dodecahedron()
DH = D.Hrepresentation()
with
PD1=One_dimension_loss(DH)
show(PD1)
I can eliminate one variable and obtain a set of inequalities defining a polyhedron in a lower dimension (here I go from 3 to 2 but it can be higher.
For each x in PD1
, I can isolate it's right hand side but I don't know how to isolate the parameters in such a way to write it as
Polyhedron(ieqs=[(0,1,0),(0,0,1),(1,-1,-1)]).Hrepresentation()
(An inequality (-1, -1) x + 1 >= 0,
An inequality (1, 0) x + 0 >= 0,
An inequality (0, 1) x + 0 >= 0)
the lists needed to feed ieqs
in Polyhedron
. How to do that ?