I want to count the number of integral points inside of a bounded polyhedron. The polyhedron is defined by the following system of equations:
> eqns = [
[-100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[0, -1, 0, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, -1, 0, 0, 1, 1, -1, 0, 0],
[0, 0, 0, 0, -1, 0, -1, 1, 0, 1, 0, 0, 0],
[0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 1, -1],
[0, 0, -1, -1, 0, 1, 0, 0, 0, 0, 0, 1, 0],
[0, -1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
]
and the following system of inequalities:
> ieqs = [
[-1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[-1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[-1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[-1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
[-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
[-1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[-1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
[-1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],
[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
]
And so I did:
> Polyhedron(eqns=eqns, ieqs=ieqs).integral_points_count()
1260
However, if I look at all of the slices obtained by fixing the first variable x_0 (which must be 1 <= x_0 <= 100 by the first equation and inequality) then I get the following numbers of integral points in each slice:
> [Polyhedron(eqns=eqns+[[-k, 1, 0,0,0,0,0,0,0,0,0,0,0]], ieqs=ieqs).integral_points_count() for k in range(1, 101)]
[84, 84, 84, ...., 0, 0, 0]
Which is fewer points in total:
> sum(_)
1197
Can anyone reproduce this? Is this a bug in Sage or LattE?
I'm using Sage 8.0 with LattE installed via "sage -i latte_int" and have attached the full example code.
Thanks,
Mark