6fbd3ac Δ 9506729 Δ 1430182 Δ 30ccbf5
editors: nobody
An integral polymatroid on a finite ground set E = {1,...,n} is
specified by a rank function r: 2^E -> Z_{>=0} that is normalized
(r(empty) = 0), nondecreasing (r(A) <= r(B) when A is contained in B),
and submodular (r(A) + r(B) >= r(A union B) + r(A intersect B)). Its
base polytope is
  B(r) = { x in R^E : x(E) = r(E), and x(A) <= r(A) for every A },
with x(A) = sum over j in A of x_j. For nondecreasing r this polytope
lies in the nonnegative orthant, and the integral polymatroid consists
of its integer points.

The problem is to count the common integer bases of two integral
polymatroids of equal total rank R = r_1(E) = r_2(E). Put
  Omega(r_1,r_2) = { x in Z_{>=0}^E : x(E) = R, x(A) <= r_i(A)
                     for every A and i = 1,2 },
and Z = |Omega(r_1,r_2)|. Each feasible integer vector counts once; a
labelled-copy realization of a vector is not a separate object.

The input is n, the total rank R in binary, and exact value oracles
for r_1 and r_2. A query names a subset A by its n-bit indicator, and
the reply is the binary integer r_i(A). No inequality list,
decomposition, sampler, or counting oracle is supplied. Let ell be the
binary encoding length of n, R, and the tolerances eps and delta, where
0 < eps, delta < 1 are given by numerator and denominator. Oracle work
is excluded from the bit-operation count, but writing queries and
reading answers are counted.

Main theorem. For every such input there is one uniform randomized
algorithm printing a nonnegative rational Zhat with
  Pr[ (1-eps) Z <= Zhat <= (1+eps) Z ] >= 1 - delta.
If Z = 0 it prints zero on every run. On every run the number of
oracle calls and the number of other bit operations are each bounded
by one fixed polynomial in n, ell, eps^{-1}, and log(delta^{-1}). The
bit-operation bound covers rational arithmetic, generation of
independent unbiased bits, and the encoding of the output.

The statement covers lower-dimensional feasible sets, arbitrary rank
pairs, and total rank of unrestricted binary length. When R = 0 there
is exactly one common base, the zero vector, and this includes the
empty vector when n = 0. The polynomial has large but absolute
exponents; the substance is dependence on the input encoding, not an
optimized running time.

The polyhedral foundations are due to Edmonds, who characterized
matroid and polymatroid intersection, proved that the base polyhedra
are integral, and gave the greedy oracle formulation used throughout.
Exact submodular minimization, returning a minimizing set, is supplied
by Iwata, Fleischer, and Fujishige; the equivalence between strong
separation and exact rational optimization for well-described polyhedra
is the theory of Groetschel, Lovasz, and Schrijver. The representation
of an integer polymatroid as a matroid on groups of interchangeable
copies goes back to Helgason's hypermatroids. That representation keeps
the feasible occupancy vectors fixed, but its explicit size and the
number of labelled realizations of a single vector are not the count of
interest, and the gap becomes decisive once capacities are encoded in
binary.

Contingency tables are a concrete instance: a nonnegative integer
matrix with prescribed row and column sums and cell upper bounds is a
common base of two polymatroids. Dyer, Kannan, and Mount gave
approximate counting and sampling under lower bounds on the margins,
through the link between lattice counts and transportation-polytope
volumes. Cryan and Dyer obtained an FPRAS for arbitrary margins when the
number of rows is fixed, and Cryan, Dyer, and Randall extended this to
cell-bounded tables with fixed rows. For fixed-row tables without cell
bounds, Gopalan, Klivans, Meka, Stefankovic, Vempala, and Vigoda gave a
deterministic FPTAS. For 0/1 tables, Bezakova, Bhatnagar, and Vigoda
gave an annealing-based FPRAS with arbitrary margins. The cell-bounded
companion treats tables with both dimensions variable; its paired
encoding and two factorial corrections are the immediate counting
tools used below, and what remains is to handle arbitrary submodular
rank constraints available only through value queries.

Log concavity enters through matroid theory. Adiprasito, Huh, and Katz
proved the Hodge-Riemann relations for matroid Chow rings and deduced
log concavity of characteristic-polynomial coefficients. Anari, Liu,
Oveis Gharan, and Vinzant used log-concave polynomials and
high-dimensional walks to give an independence-oracle FPRAS for the
bases of a general matroid. Branden and Huh's Lorentzian polynomials
include matroid basis polynomials and the factorial-normalized
generating polynomials of integer polymatroid bases. These results
concern a single matroid or polymatroid, and a common-base family need
not keep the exchange axiom; the factorial normalization also weights
integer bases nonuniformly, so the uniform common-base count is not
immediate. For common bases of two rank-r matroids, Anari, Oveis Gharan,
and Vinzant obtained a deterministic 2^{O(r)}-approximation and a
randomized relative approximation in time 2^{O(r)} times a polynomial
in n, eps^{-1}, and log(delta^{-1}). The matroid companion gives an
FPRAS for two matroids on an explicitly listed ground set, using
positive rank-deficiency weights, transport of a single defect, variance
bounds for specified observables, and mixing of a trace chain; the
cell-bounded companion adds the two complementary factorial lifts that
cancel labelled multiplicities on the targets. These constructions
parallel the perfect- and near-perfect-matching ensemble and learned
defect weights of the permanent FPRAS of Jerrum, Sinclair, and Vigoda,
and the restricted Poincare inequalities for hole-pattern observables
identifying unmatched vertices in the recent permanent algorithm of
Chen, Vigoda, and Yang. The continuous part uses Prekopa's marginal
theorem, which preserves log concavity when free coordinates are
integrated out, and the randomized convex-volume algorithm of Dyer,
Frieze, and Kannan in the rational oracle formulation of Dyer and
Frieze. The rational-center step below is a determinant-replacement
construction close to the barycentric-spanner method of Awerbuch and
Kleinberg.
./adiprasito-huh-katz-1511.02888-hodge-theory-combinatorial-geometries.pdf
./anari-liu-oveisgharan-vinzant-1811.01816-log-concave-II-fpras-matroid-bases.pdf
./anari-oveisgharan-vinzant-1807.00929-log-concave-I-entropy.pdf
./branden-huh-1902.03719-lorentzian-polynomials.pdf

The first obstacle is scale. The expansion matroid of an integral
polymatroid can spend one element per unit of capacity, so a direct
construction may have size proportional to nR; further, an occupancy
vector has a whole product of binomial coefficients worth of labelled
realizations. Feeding that expansion to any common-base counter would
address neither the required runtime nor the required weights.

The reduction begins with an exact feasibility test and a rational
center of the common base polytope. Near-tight rank inequalities at this
center split E into two partitions, and only their part totals survive
as discrete variables. A coarser partition isolates directions in which
pairs of bases can be shifted without materially changing the count;
directional log concavity makes this quantitative, and within suitable
fixed-total slices a small homothety shows that enlarging the two base
polytopes in the remaining directions changes the lattice count by only
a small relative error.

For the retained part totals, an incidence graph joins a part of the
first partition to a part of the second whenever they share a
coordinate. Spanning trees express every other coordinate through free
variables and the part totals, and the retained integer ranges have
polynomial cardinality. Large free ranges are integrated out against
soft penalties for rank violation, and the preceding comparison proves
that the resulting weighted count approximates Z.

Integration preserves ordinary log concavity but does not by itself
yield the discrete quadratic inequalities used by the counter. The
integrated weights are convolved with a smooth compactly supported
kernel and multiplied by a small strictly concave quadratic. Derivative
estimates bound the gap between discrete second differences and the
continuous Hessian, and the added curvature dominates that gap at every
annealing power, so both quadratic tests hold throughout the annealing.

Finally, each bounded part-total variable is encoded by a polynomial
number of paired labels. Two factorially corrected lifts agree on
transversals, where their labelled multiplicities cancel exactly, and
carry the two complementary signature conditions. The imported transport
and trace estimates are stated precisely, their hypotheses verified, and
the capped annealing algorithm assembled. A separate convex-volume
construction evaluates the weights by bounded rational computation.
Every large expansion and slice subdivision is a proof device; each
instance actually sampled has polynomial size.

The work proceeds through the base polytopes of normalized submodular
set functions. A function f on subsets of E is normalized when
f(empty) = 0. For any normalized submodular f, possibly not
nondecreasing, set
  B(f) = { x in R^E : x(E) = f(E), and x(A) <= f(A) for every A }.
The singleton and complementary-singleton inequalities give
f(E) - f(E\{j}) <= x_j <= f({j}), so B(f) is bounded and, for
nondecreasing f, lies in the nonnegative orthant. Integrals in free
coordinates use ordinary Lebesgue measure of unit lattice mesh; an
integral in zero coordinates is the evaluation of its integrand.

Proposition (oracle algorithms). The following operations have
deterministic oracle and bit complexity bounded by fixed polynomials in
the stated input sizes. (1) An integer-valued submodular function on a
finite ground set can be minimized, with a minimizing set returned, from
an exact value oracle and a bound on the binary lengths of its values;
the size parameters are the ground-set cardinality and that value-length
bound. (2) A bounded rational polytope Q in R^d, given by strong
separation together with a coordinate bound and a bound on the binary
encoding length of each individual defining inequality, has rational
linear optimization in polynomial time, including an emptiness decision
and an optimal vertex when nonempty, in d, these description bounds, and
the objective length; the inclusion of lower-dimensional polytopes is
allowed; the separator returns inequalities of length polynomial in the
query length and the description bounds, and all separation queries have
polynomial encoding length.
The first operation also applies to an integer submodular function with
a rational modular term added, and with prescribed elements required to
belong or not to belong to the minimizing set.

The first assertion is the submodular minimization of Iwata, Fleischer,
and Fujishige. The second is the strong separation-optimization
equivalence for well-described rational polyhedra of Groetschel, Lovasz,
and Schrijver, whose description size bounds one inequality and not the
number of inequalities; the vertex encoding bound there also permits
optimal-vertex selection by successive rational face restrictions. The
LP bound counts separation-oracle calls and additional bit operations
separately, and each oracle call here is itself a submodular
minimization with explicit rational arithmetic.

Oracles are supplied as follows. At a rational point x, separation from
B(r_i) minimizes r_i(A) - x(A) and checks the total equation; multiplying
by the product of the coordinate denominators gives an integer submodular
function whose values have polynomial binary length, since the length of
that product is at most the sum of the denominator lengths. Requiring
inclusion of F and exclusion of G, with F and G disjoint, means
minimizing A -> r_i(A union F) - x(A union F) on E minus (F union G);
restrictions, contractions, and ranks on unions of partition parts are
handled the same way. Every rational modular translation below has known
denominators and polynomial-length coefficients, so the same clearing
applies. The original intersection
  P = B(r_1) intersect B(r_2)
has a strong separation oracle and lies in [0,R]^n, with 0-1 normals and
right sides of O(1 + log(R+1)) bits, so exact feasibility and
optimization on P obey the proposition without any polynomial
dependence on the numerical value of R.

Lemma (base-polytope identities). Let f and g be normalized submodular
functions on subsets of E and let v be a vector in R^E.
(1) If w_pi(1) >= ... >= w_pi(n) is a decreasing ordering and
A_k = {pi(1),...,pi(k)}, the vector with b_pi(k) = f(A_k) - f(A_{k-1})
lies in B(f) and maximizes the linear functional w.x over B(f).
(2) With (f+v)(A) = f(A) + v(A) and f^ref(A) = f(E minus A) - f(E),
  B(f+g) = B(f) + B(g),  B(f+v) = B(f) + v,  B(f^ref) = -B(f).
(3) For a partition D of E, put pi_D(x) = (x(D) : D in D) and
fbar(J) = f(union of the parts in J). Then pi_D(B(f)) = B(fbar).
(4) For distinct a,b in E and t >= 0, the segment [-t,t](e_a - e_b)
equals B(q_ab) with q_ab(A) = t times |1_A(a) - 1_A(b)|. Adding any
collection of these segments to a base polytope again gives a base
polytope, with integral rank function when f and the segment lengths are
integral.

Proof. For E empty all assertions are immediate, so take n >= 1.
Submodularity gives decreasing marginal increments: for C contained in
D and j not in D,
f(C union {j}) - f(C) >= f(D union {j}) - f(D). Apply this to the
elements of any A in their pi-order. The increments defining b(A) are no
larger than the increments along the induced chain inside A, hence
b(A) <= f(A); also b(E) = f(E). Summation by parts gives, for every x in
B(f),
  w.x = w_pi(n) f(E) + sum_{k=1}^{n-1} (w_pi(k) - w_pi(k+1)) x(A_k).
All coefficients in the sum are nonnegative, and b attains equality in
each resulting upper bound. This proves (1) and, in particular,
nonemptiness of B(f).

The displayed support-function formula is additive in f, and nonempty
compact convex sets are determined by their support functions, so it
gives the Minkowski-sum identity in (2). Translation follows from the
inequalities. For reflection, x(E) = f(E) converts -x(A) <= f(E minus A)
- f(E) into the inequality for x on E minus A; the reflected function is
normalized and submodular.

For (3), containment in B(fbar) follows from the inequalities on unions
of parts. Conversely, maximize a linear functional of the projected
coordinates; its lift to R^E is constant on each part. In the greedy
formula of (1), order the parts by decreasing constant and place each
part's elements consecutively; the increments telescope to the greedy
formula for fbar. The two projected sets have the same support function
and hence agree.

For (4), q_ab is the cut function of a single edge and is submodular,
as is checked on the four membership patterns of {a,b}. Its base
inequalities force every other coordinate to vanish, force x_a + x_b =
0, and give |x_a| <= t. This proves the last assertion.

Lemma (the expansion matroid). Let r be normalized, nondecreasing, and
submodular on subsets of E, integer-valued. Replace each j in E by any
finite number of labelled copies, and declare a set of copies
independent when its occupancy vector z satisfies z(A) <= r(A) for every
A. This is a matroid. A set of copies with occupancy vector v has matroid
rank
  m(v) = min over A of { r(A) + v(E minus A) }.

Proof. Hereditary closure is immediate. Let I, J be independent copy
sets with occupancy vectors z, z' and |I| < |J|. If no element of
J minus I can be added to I, then for every coordinate j with z'_j >
z_j some set A_j containing j is tight for z: failure of the increment
z + e_j yields such a set because both its slack and its rank are
integral. Tight sets are closed under union and intersection, since
submodularity and modularity give
  r(A) + r(B) = z(A) + z(B) = z(A union B) + z(A intersect B)
             <= r(A union B) + r(A intersect B) <= r(A) + r(B).
Their union A is therefore tight. On E minus A, z'_j <= z_j, while
z'(A) <= r(A) = z(A). This contradicts |J| > |I| and proves augmentation.

Every independent subprofile z <= v has z(E) <= r(A) + v(E minus A) for
every A. Choose a maximal independent subprofile of v. Each coordinate
where z_j < v_j is blocked by a tight set containing j; the union A of
those sets is tight and z = v outside A, so z(E) = r(A) + v(E minus A),
which is equality in the displayed formula. If no coordinate is blocked,
take A = empty.

Lemma (polyhedral controls). Let Q be a nonempty subset of R^E defined
either by B(f_1) intersect B(f_2) or by B(f) together with the equations
x(D) = a_D for the parts D of a partition of E, where the functions are
normalized and submodular. In either case arbitrary coordinate lower and
upper bounds may also be imposed.
(1) If the ranks and all other right sides are integral, every vertex of
Q is integral.
(2) If x satisfies every defining inequality with additive violation at
most b >= 0 and every defining equality with absolute error at most b,
then dist_inf(x, Q) <= 10(n+1)^2 b.
(3) Fix a in Q and an affine F with integral linear part. The function
phi(l) = max { F(y) : y in Q, ||y - a||_inf <= l }, l >= 0, is
continuous, nondecreasing, concave, and piecewise affine. Every positive
slope of an affine piece is an integer, hence at least one, and
phi(l) = max over Q of F for all large l. Consequently, if F >= 0 on Q
and phi(L) < L for some L > 0, then phi(L) = max over Q of F.

Proof. First the structure of tight constraint normals. For a fixed rank
system at y in B(f), the tight sets are closed under union and
intersection by the submodularity calculation already used. Choose a
maximal strictly increasing chain of tight sets from empty to E. No
tight set can cut a difference between successive members: otherwise
intersecting it with the upper member and adjoining the lower member
would insert another tight set. Every tight-set indicator is a sum of
these difference indicators, so the chain indicators span all tight rank
normals.

A second version preserves nonnegative coefficients: any nonnegative
combination of tight-set indicators is a nonnegative combination of
indicators from one chain. Fix the resulting vector and the total
coefficient, allow a coefficient on the empty set, and maximize the sum
of coefficients times |A|^2 over the compact feasible coefficient set.
Two incomparable sets with positive coefficients can be replaced, with
the smaller coefficient, by their union and intersection; the vector and
total coefficient are unchanged while the maximized quantity grows by
2|A minus B||B minus A| times that coefficient. No such pair survives.
Signed multiples of the total equation are kept separately.

The matrix of indicators of two chains is totally unimodular; more
generally this holds for two laminar families and hence for a chain and
a partition. Apply Ghouila-Houri's row-signing criterion. For any
selection of rows from the first family, alternate signs along nested
selected sets beginning with +1 on the maximal sets; in any column the
sum is 0 or 1. Begin with -1 in the second family, obtaining 0 or -1, so
the combined sum lies in {-1,0,1}. Coordinate rows may be added, with
signs chosen separately in each column to keep this bound. Negating rows
or adding signed copies also preserves total unimodularity. The same
conclusion holds with either orientation of equality normals and with
coordinate bounds.

At a vertex the tight normals span R^E. Replace the tight rank rows by
their chain spans, retain the partition and coordinate rows, and choose
n independent rows; their square matrix is unimodular. With integral
right sides its unique solution is integral, proving (1).

For (2), let y in Q minimize ||x - y||_inf and put t = ||x - y||_inf; if
t = 0 there is nothing to prove. The optimality condition for this convex
minimization supplies a normal g to Q at y with ||g||_1 = 1 and
g.(x - y) = t. Express g as a nonnegative combination of the active
inequality normals and the two orientations of the active equality
normals, uncross the rank contributions separately as above, and note
the remaining normals form a totally unimodular matrix. A conic
representation can be chosen with linearly independent normals,
g = sum_{k=1}^m mu_k a_k with m <= n and mu_k >= 0. Choose m columns
giving a nonsingular square minor of the row matrix; that minor has
determinant +-1 and every cofactor 0 or +-1. Solving for the coefficients
gives mu_k <= ||g||_1 = 1. Each active oriented row satisfies
a_k.(x - y) <= b, so t = sum_k mu_k a_k.(x - y) <= n b. This stronger
estimate implies the stated bound 10(n+1)^2 b.

For (3), the cube constraint is y_j <= a_j + l and -y_j <= -a_j + l.
Every vertex of the constrained system has a basis selected by the same
chain-span argument; its basis matrix is unimodular and its right side
has the form b_0 + l b_1 with b_1 integral. That vertex is therefore
affine in l, with integral derivative wherever the basis is feasible.
There are finitely many bases, so optimizing F gives a piecewise affine
function with integer slopes. Inclusion of cubes gives monotonicity, and
convex combinations of feasible points for radii l_1, l_2 give
concavity. Continuity on (0,infinity) follows from finite concavity and
at zero from |F(y) - F(a)| <= ||grad F||_1 l, and boundedness of Q gives
eventual equality with the unrestricted maximum. If phi(L) < max_Q F,
concavity and monotonicity exclude a zero-slope interval before L, so
every preceding affine piece has slope at least one and
phi(L) >= phi(0) + L >= L when F >= 0 on Q. This proves the stated
consequence.

Lemma (a center for affine slacks). Let Q in R^n be a nonempty bounded
rational polytope satisfying the hypotheses of the oracle-algorithms
proposition. One can find a rational c in Q, of polynomial encoding
length, such that every affine F nonnegative on Q satisfies
  max over Q of F <= 4(n+1) F(c),
with polynomial oracle and bit complexity. The construction also
returns an affinely spanning vertex simplex of Q relative to which every
point of Q has all barycentric coordinates of absolute value at most two.

Proof. Start from a vertex v_0 obtained by linear optimization. Given
vertices whose affine span has direction space L, optimize both signs of
a rational basis of the orthogonal complement of L. Either every optimum
equals its value at v_0, proving Q lies in the current span, or an
optimal vertex extends that span. After at most n extensions this gives
d+1 affinely independent vertices, where d = dim Q; for d = 0 take
c = v_0 and stop.

Choose a rational coordinate projection that is one-to-one on the affine
hull. For the current simplex v_0,...,v_d, let lambda_0,...,lambda_d be
its affine barycentric-coordinate functions on that hull. Optimize both
signs of each lambda_j over Q. If some value has absolute value greater
than two, replace v_j by an attaining vertex. The absolute determinant of
the simplex in the fixed coordinate projection is then multiplied by a
factor exceeding two.

All vertices of a well-described rational polytope have polynomial
encoding length, so every nonzero simplex determinant encountered lies
between 2^{-B} and 2^B for a polynomially bounded B. There are at most
2B+1 replacements. Determinants, barycentric functions, objectives, and
returned vertices throughout the procedure have polynomial encoding
length, so the whole construction has polynomial cost.

At termination |lambda_j(x)| <= 2 for every x in Q and every j. Set
c = (d+1)^{-1} sum_{j=0}^d v_j. If F >= 0 on Q then F(v_j) >= 0 and, for
every x in Q,
  F(x) = sum_j lambda_j(x) F(v_j) <= 2 sum_j F(v_j) = 2(d+1) F(c),
which is the displayed bound.

The preliminary branches are now exact. If R = 0, print 1, since the
only feasible vector is zero, including when E is empty. Otherwise test
P by the oracle-algorithms proposition. If P is empty, print 0 on every
execution. If P is nonempty, the polyhedral-controls lemma gives an
integral vertex and hence Z >= 1, and the center lemma gives a rational
center c in P. That nonempty case is assumed from now on, so an input
with Z = 0 always prints zero.

The geometric comparison uses log concavity of lattice-pair counts
along the directions e_j - e_k, and the counting algorithm uses two
quadratic inequalities for positive weights on integer boxes. A single
argument serves both: rank penalties satisfy the inequalities, and
summing paired coordinates preserves them. The quadratic viewpoint is
the rank-deficiency construction of the matroid companion; it descends
from the Lorentzian property of homogenized matroid Tutte polynomials
and closure under nonnegative linear substitutions of Branden and Huh.
./branden-huh-1902.03719-lorentzian-polynomials.pdf

For a finite index set I, capacities m in Z_{>=0}^I, and an integer r,
write
  B(m,r) = { z in Z^I : 0 <= z_i <= m_i, sum_i z_i = r }.
A box-valid display is any integer vector in the product of the
intervals [0,m_i], with its total specified separately. Weights on
B(m,r) are extended by zero outside the slice.

Definition (integer quadratic signatures). A strictly positive weight F
on all of B(m,r) has the removal signature when, for every box-valid
display z of total r+2, the matrix ( F(z - e_i - e_j) )_{i,j in I} has
at most one positive eigenvalue. It has the addition signature when, for
every box-valid display z of total r-2, the same holds for
( F(z + e_i + e_j) )_{i,j in I}. Diagonal entries represent two changes
in the same coordinate, all invalid changes have weight zero, and a test
with no box-valid display is vacuous.

If Q is symmetric with at most one positive eigenvalue and u^T Q u > 0,
then Q is nonpositive on { v : v^T Q u = 0 }; otherwise this subspace
together with u would contain a two-dimensional positive-definite
subspace. Hence
  v^T Q v <= (v^T Q u)^2 / (u^T Q u).
A null-axis variant reads: if e^T Q e = 0 and Q e is nonzero, then Q is
nonpositive on { v : v^T Q e = 0 }. Indeed, take w = Q e and apply the
display with u = e + t w for small t > 0; for v with v^T Q e = 0 the
right side is t^2 (v^T Q w)^2 / (2 t ||Q e||^2 + t^2 w^T Q w), which
tends to zero.

For two coordinates a,b of common capacity M, summing at balance means
summing their values (k, M - k) over 0 <= k <= M. The next lemma isolates
this operation from the particular factors used to build the weight; only
positivity and the initial quadratic signature enter the induction.

Lemma (balanced summation). Let F > 0 on the entire slice B(m,r) and
suppose it has the removal signature. Choose disjoint coordinate pairs
{a_t, b_t} with m_{a_t} = m_{b_t} = M_t >= 1. Their balanced sum
  Phi(z) = sum over 0 <= k_t <= M_t of F(z, (k_t, M_t - k_t)_t)
is strictly positive on the entire remaining box slice of total
r - sum_t M_t and has the removal signature. The same holds with
addition in place of removal. Fixing coordinates at prescribed box-valid
values preserves either signature and positivity on the resulting slice.

Proof of balanced summation. Fixing coordinates restricts each test to a
principal submatrix of the original, so it suffices to sum one pair at a
time. Suppose earlier pairs have been summed, giving a positive weight
Psi, and the next pair has capacity M. Fix a box-valid display z on the
other coordinates, two above their required total after this pair is
summed. For 0 <= k <= M the removal matrix at (z, k, M-k) is the three
band matrix
  N_k = [ [ V_k, S(k-1), S(k) ],
          [ S(k-1)^T, u_{k-1}, u_k ],
          [ S(k)^T,   u_k,   u_{k+1} ] ],
with (V_k)_{ij} = Psi(z - e_i - e_j, k, M-k), S(l)_i = Psi(z - e_i, l,
M-1-l), and u_k = Psi(z, k-1, M-1-k). Each N_k has at most one positive
eigenvalue by induction. Out-of-box terms are zero, so S(-1) = S(M) = 0
and u_k = 0 unless 1 <= k <= M-1. The matrix to control is sum_{k=0}^M
V_k; one common subspace of codimension at most one is found on which its
quadratic form is nonpositive.

When M = 1, put S = S(0). After discarding a zero axis the two matrices
are [ [ V_0, S ], [ S^T, 0 ] ] and [ [ V_1, S ], [ S^T, 0 ] ]. If S is
nonzero, the null-axis form makes both V_0 and V_1 nonpositive on
{ a : a^T S = 0 }. If some z_i > 0, positivity gives
S_i = Psi(z - e_i, 0, 0) > 0; hence S = 0 forces z = 0, and then both V_k
vanish because every removal is invalid. This proves M = 1.

Let M >= 2. Positivity on the full slice gives u_k > 0 for
1 <= k <= M-1. Take a vector a on the old coordinates with
a^T sum_{l=0}^{M-1} S(l) = 0, and define
  g_k = ( a^T sum_{l=0}^{k-1} S(l) ) / u_k  for 1 <= k <= M-1, g_k = 0
otherwise. The definition and the condition give, including endpoints,
  a^T S(l) = u_{l+1} g_{l+1} - u_l g_l, 0 <= l <= M-1.
For v_k = (a, g_k, -g_k), its products under N_k with the two new
coordinate axes are u_{k-1}(g_k - g_{k-1}) and u_{k+1}(g_{k+1} - g_k).
If at least one axis has positive square, the projection identity applied
to that axis bounds v_k^T N_k v_k by
  v_k^T N_k v_k <= u_{k-1}(g_k - g_{k-1})^2 + u_{k+1}(g_k - g_{k+1})^2,
and adding the other, nonnegative term preserves the bound. If both axis
squares vanish then u_{k-1} = u_{k+1} = 0; at k = 0 or M the other
neighboring u is positive, so this case is interior and u_k > 0. The sum
of the two axes then has square 2 u_k > 0 and product zero with v_k, and
applying the projection identity to that sum proves the same bound with
right side zero.

Expanding the bound and substituting the cumulative identity cancels the
mixed terms and gives
  a^T V_k a + 2 u_k g_k^2 - u_{k-1} g_{k-1}^2 - u_{k+1} g_{k+1}^2 <= 0.
Summing over 0 <= k <= M cancels every u_k g_k^2 term, so sum_k V_k is
nonpositive on the kernel of the single linear functional
a -> a^T sum_l S(l), as required. Every remaining box-valid profile has
positive weight because any balanced choices of the summed pairs supply a
positive summand. This completes the removal induction.

For addition, reflect all coordinates in their boxes, z_i -> m_i - z_i.
This interchanges the two signatures, preserves balance, and commutes with
the balanced sum, so the removal result for the reflected weight gives the
addition result.

The one-positive-eigenvalue property is preserved by matrix limits, and
all sums above are finite, so limits of positive weights after summation
are also covered. Positivity is needed before the passage: the proof
divides by the interior quantities u_k. Global interpolation for the
positive approximations precedes any limit, because adjacent
log-concavity inequalities alone would not exclude gaps in the limiting
support.

Next come the positive weights to which the summation lemma applies. Let
r be integral, normalized, nondecreasing, and submodular on E. For v in
Z_{>=0}^E put m_r(v) = min over A of { r(A) + v(E minus A) }; by the
expansion-matroid lemma this is the rank of a set with occupancy vector v
in a sufficiently large copy matroid. For H >= 0 define the soft rank
weight
  Phi_{r,H}(v) = exp{ -H [ 2(v(E) - m_r(v)) + r(E) - v(E) ] }.
Its bracket equals (v(E) - m_r(v)) + (r(E) - m_r(v)), which is
nonnegative and vanishes exactly on B(r) intersect Z^E; so Phi_{r,H} is
positive for finite H and converges to the indicator of integer bases as
H tends to infinity.

For a positive factor G on a whole box, the normalized matrix for steps
of sign sigma in {1,-1} is
  Q_{ij} = G(z) G(z + sigma e_i + sigma e_j) /
           ( G(z + sigma e_i) G(z + sigma e_j) ).
Only coordinates permitting one step are kept, and an invalid repeated
step gets Q_{ii} = 0. The unnormalized quadratic test is the normalized
one rescaled by a positive scalar and congruenced by a positive diagonal,
so the inequality 1 1^T - Q >= 0 (all-ones minus Q, positive
semidefinite) implies the required signature.

Lemma (rank-factor signatures). Partition a set of count coordinates I
into groups indexed by E, allowing empty groups, and let b lie in
Z_{>=0}^E. For either consistent orientation
  v_e = b_e + sum over i in group e of z_i,
  or  v_e = b_e + sum over i in group e of (m_i - z_i),
the factor G(z) = Phi_{r,H}(v) satisfies 1 1^T - Q >= 0 for both signs.
The product of such factors on disjoint sets of count coordinates has
both integer signatures on every total slice, holds for every nonnegative
power of the product, and survives fixing any coordinates at box-valid
values. More generally a base constraint for an arbitrary integral
normalized submodular rank, with a fixed integer translation and either
consistent orientation of its grouped arguments on a finite box, is a
limit of factors of this kind.

Proof. Take the increasing orientation and an addition test. Realize the
vector v by a set S in the expansion matroid, and assign two distinct
spare copies to each retained count coordinate, disjointly even when
several count coordinates feed one physical coordinate. Contract S, that
is, contract a basis of S and delete its remaining loops; a new copy
raises rank exactly when it is a nonloop in this contraction. Two
individually rank-increasing copies raise rank by only one precisely when
they are parallel, meaning their two-element set has rank one; in every
other case the increments add.

The affine terms of the exponent cancel in the normalization. Hence,
when both steps are valid, Q_{ij} equals exp(-2H) if the two nonloop
copies are parallel and equals 1 otherwise. For a repeated step use two
distinct copies of that count coordinate. Copies of one physical
coordinate are interchangeable by matroid automorphisms fixing S. If the
representative of one count coordinate is parallel to that of another,
exchange the first representative with its second copy while fixing the
other representative; this shows the second copy is parallel to the other
representative and hence to the first. Each nontrivial parallel class of
retained count indices therefore has normalized entry exp(-2H) across its
block, including every valid repeated-step diagonal; a single index whose
two copies are parallel contributes a singleton block, and all remaining
valid diagonal entries are 1. Hence
  1 1^T - Q = (1 - exp(-2H)) sum_C 1_C 1_C^T + diag(eta_i), eta_i >= 0,
over the disjoint parallel classes C. The diagonal correction replaces an
invalid repeated-step entry by zero and only enlarges the left side.
This proves the addition assertion, box boundaries included.

For removals, use a finite expansion on a ground set Omega with enough
copies to realize every display and with rank r(E). The complement of S
in the dual matroid has rank m*(Omega minus S) = |Omega minus S| - r(E) +
m_r(v), and with r* = |Omega| - r(E) the exact identity
  |S| + r(E) - 2 m_r(v) = |Omega minus S| + r* - 2 m*(Omega minus S)
holds. A removal from S is an addition to its dual complement. Realize S
with b_e fixed copies and disjoint sets of z_i copies for the count
coordinates in physical group e, choose one representative of every
nonempty such set and a second copy when z_i >= 2. A transposition of
those two copies fixes every other representative and preserves both S
and the dual contraction, so the parallel-class argument gives the same
block description. When only one removal is allowed in a count
coordinate its diagonal is zero and the nonnegative correction covers it,
with no nonexistent second copy needed.

Reflection z_i -> m_i - z_i on the whole coordinate set of one factor
exchanges addition and removal, proving both tests for the decreasing
orientation; fixed coordinates merely join b. For factors on disjoint
groups the cross entries equal one, so 1 1^T - Q is a direct sum of
nonnegative definite matrices and unused coordinates contribute zero
blocks. Raising to a nonnegative power replaces H by that power times H.

Finally let f be integral normalized submodular but not necessarily
nondecreasing. Choose an integer vector a large enough that f'(A) =
f(A) + a(A) is nondecreasing and that every translated lower endpoint of
the grouped arguments plus a is nonnegative; this uses only finitely many
marginal differences f(A union {e}) - f(A) and finitely many box
endpoints. The equation B(f') = B(f) + a is the base-polytope calculus.
Applying the construction to the shifted argument and f', then letting H
tend to infinity, gives exactly the desired base indicator on the finite
box. The copy matroids and these large boxes only prove inequalities; the
algorithm never constructs them.

Proposition (root-direction log concavity). Let f_1, f_2 be integral
normalized submodular functions on E, not necessarily nondecreasing, and
put
  Y(d) = # { (x_1, x_2) in (B(f_1) intersect Z^E) x (B(f_2) intersect
           Z^E) : x_1 - x_2 = d }.
For d_0 in Z^E and distinct j,k in E, put y(t) = Y(d_0 + t(e_j - e_k)),
t in Z. The positive support of y is an integer interval, possibly empty
or a singleton. For integers a < t < b with y(a), y(b) > 0,
  y(t) >= y(a)^{(b-t)/(b-a)} y(b)^{(t-a)/(b-a)}.

Proof. Every base polytope here is bounded: its e-th coordinate lies
between f_i(E) - f_i(E minus {e}) and f_i({e}). Fix a finite integer
interval [A,B] of parameters, with M = B - A >= 2. For each e in E choose
an integer interval [L_e, U_e] containing all e-th coordinates of B(f_2),
of width D_e = U_e - L_e >= 2. Introduce two count coordinates a_e, b_e
of capacity D_e and two further coordinates p, q of capacity M, and use
the full box slice of total sum_e D_e + M. Define the physical arguments
  w_{2,e} = U_e - b_e,
  w_{1,e} = L_e + a_e + (d_0)_e + A 1_{e=j} - B 1_{e=k}
            + p 1_{e=j} + q 1_{e=k}.
The first rank factor uses the increasing counts (a_e)_e, p, q and the
second uses the decreasing counts (b_e)_e, on disjoint sets of count
coordinates; in the first factor the coordinates a_j, p feed one physical
coordinate and a_k, q feed another, as the rank-factor lemma permits.

On this finite box choose modular translations c_1, c_2 so that f_i + c_i
is nondecreasing and every lower endpoint of w_i + c_i is nonnegative.
For finite H the product
  F_H = Phi_{f_1+c_1,H}(w_1+c_1) Phi_{f_2+c_2,H}(w_2+c_2)
is strictly positive on the full slice and has both signatures. Sum every
ordinary pair (a_e, b_e) at balance, leaving the pair (p, q) of total M.
By the balanced-summation lemma the resulting weight has the removal
signature. Let y_H(t) be its value at (p, q) = (t - A, B - t); it is
positive for every integer A <= t <= B.

For A < t < B, add one to each coordinate of this retained pair. That is
a box-valid display of total M+2, whose removal matrix is
  [ [ y_H(t-1), y_H(t) ], [ y_H(t), y_H(t+1) ] ].
It has positive trace and at most one positive eigenvalue, so
y_H(t)^2 >= y_H(t-1) y_H(t+1). All entries are positive, so successive
differences of log y_H are nonincreasing, and for all A <= a < t < b <= B,
  y_H(t) >= y_H(a)^{(b-t)/(b-a)} y_H(b)^{(t-a)/(b-a)}.

At balance a_e + b_e = D_e the vector w_2 equals L + a; at
(p, q) = (t - A, B - t) the encoding gives w_1 - w_2 = d_0 + t(e_j -
e_k). Each possible integer x_2 in the chosen intervals has exactly one
balanced encoding. Letting H tend to infinity gives y_H(t) -> y(t) term
by term, since a finite product of rank penalties converges to the two
base indicators; the global interpolation inequality passes to this
limit. Positive endpoint counts give a positive lower bound at every
intermediate integer. The interval [A,B] was arbitrary, which proves both
the interpolation inequality and the statement about support.

This supplies the interval support and the secant inequalities used
below to compare nearby shift counts; the positive approximations are
what make both survive the limit. The integrated weights of the port
construction need a separate quantitative argument for their signatures.

The geometric comparison fixes a nonempty common-base polytope P =
B(r_1) intersect B(r_2) and its center c from the center lemma. The aim
is to enlarge the two base polytopes in chosen directions while changing
the common lattice-point count by only a small relative error, which lets
small rank violations enter the subsequent reduction. The proof averages
counts over a small displacement between the two bases.

Three scales organize the comparison: S is a slack threshold for the
difference polytope, W a larger slack threshold for the individual base
polytopes, and T the amount of enlargement. Fix the integer scales
  N = 10^10 + n + ell + ceil(1/eps),  K = N^5,
  S = N^5000,  W = N^20000,  T = W/N^300.
Every exponent in the paper is an absolute constant, so quantities
polynomial in N are polynomial in the required size parameters, though of
large degree. Counts and box volumes are bounded by e^K. More precisely,
a product of m factors is at most e^K whenever m <= 100n+100 and each
factor lies in [0, N^100000 (R+2)]. When all factors are positive the
logarithm of the product is at most (100n+100)(100000 log N + log(R+2)) <
N^5, using log(R+2) <= ell+2 and N >= 10^10; a zero factor causes no
difficulty. In a lattice count the factors are numbers of allowed integer
coordinate values, and in a volume they are interval lengths. These
scales leave room for successive approximations without any assumption on
the widths of the input polytope; the precise enlargement factor proved
below is at most e^{20 N^{-8}}.

For A contained in E put
  s_i(A) = r_i(A) - c(A),
  s_*(A) = s_1(A) + s_2(E minus A) = r_1(A) + r_2(E minus A) - R.
These are nonnegative submodular functions, zero at the empty set and at
E, and by the base-polytope calculus B(s_*) = B(r_1) - B(r_2). The atoms
of a family of subsets are the nonempty classes of elements with identical
membership in every set of the family. Let D_i be the partition into
atoms of { A : s_i(A) < W }, and let G be the partition into atoms of
{ A : s_*(A) < S }; the parts of G are called superblocks. A set A cuts a
part D when both A intersect D and D minus A are nonempty, so a set that
cuts a D_i-part has s_i(A) >= W and a set that cuts a superblock has
s_*(A) >= S.

Lemma (prefixes and part totals). Let A = (A_1,...,A_m) be a family of
subsets of E. Its atoms admit an order in which every prefix is a union
of at most n intersections of members of A, allowing E as the empty
intersection. If s is normalized, nonnegative, and submodular, s(E) = 0,
and s(A_j) <= b for every j with b >= 0, then in that order every prefix
F satisfies s(F) <= n(m+1) b. Consequently, if Q is contained in B(r) and
r(A_j) - x(A_j) <= b for all x in Q and all j, then for every atom D of A
and all x, y in Q,
  | x(D) - y(D) | <= 2n(m+1) b.

Proof. For an atom D intersect all generators containing D, obtaining a
set H_D; this is the union of atoms whose membership sets contain that of
D. Order the atoms so that a strict superset of memberships comes first,
and every prefix is then the union of the H_D over its own atoms.
Nonnegative submodularity gives s(U union V), s(U intersect V) <=
s(U) + s(V), which proves the prefix bound. At any x in Q apply that
bound to the nonnegative slack function r(.) - x(.). For a fixed prefix
its value lies in [0, n(m+1) b], so the prefix total varies by at most
n(m+1) b, and subtracting consecutive prefix totals gives the part-total
range.

Lemma (computable partitions and compatible orders). Each part of D_i is
contained in a superblock. The three partitions can be found with
polynomially many oracle calls and bit operations, and each has a
generating family of at most n^2 sets meeting its defining strict slack
bound. Fix a superblock order G_1,...,G_g supplied by the prefix lemma for
the s_*-generators. Every prefix F_k = G_1 union ... union G_k, including
the empty and full prefixes, satisfies s_*(F_k) <= N^4 S. Use this order
for system 1 and its reverse for system 2, so the sets preceding a
superblock G_k are
  A_{1G_k} = F_{k-1},  A_{2G_k} = E minus F_k.

Proof. If s_*(A) < S then s_1(A) < W and s_2(E minus A) < W, because
S < W; so neither A nor its complement cuts a fine part, proving the
containment. For each ordered pair of distinct elements (a,b), minimize
the relevant slack under a in A and b not in A. Restricted submodular
minimization, with rational modular terms for s_i, applies as in the
polyhedral section; if the minimum is below the threshold, retain a
minimizer. Two elements separable by any set below the threshold are then
separated by a retained set in one of the two orientations, so the
retained family has exactly the required atoms and contains at most
n(n-1) sets, with polynomial encoding length. The prefix bound is the
prefix lemma, because n(n^2+1) S <= N^4 S.

Consider the bipartite multigraph with one vertex per part of D_1, one
vertex per part of D_2, and one edge labeled j for each j in E, joining
the two parts containing j; parallel edges are distinct coordinates.
Every connected component lies in a single superblock. In each component
C choose a representative coordinate e_C, and in each superblock G choose
a root component C_0(G), putting j_G = e_{C_0(G)}. Only the computed
partitions are needed for these choices, and the port construction below
reuses them.

For integral base polytopes B_1, B_2 of total R, put
  Y_{B_1,B_2}(d) = # { (x_1,x_2) in (B_1 intersect Z^E) x
                       (B_2 intersect Z^E) : x_1 - x_2 = d }.
Write Y(d) for the original pair, so Y(0) = Z. Also use the expanded base
polytopes
  B_i^+ = B(r_i) + Delta_i,  Delta_i = sum over D in D_i, sum over
          unordered subsets {a,b} of D, of the segment [-T,T](e_a - e_b),
where e_a is a unit vector and e_C denotes a chosen label. The rank
function of B_i^+ is
  r_i^+(A) = r_i(A) + T sum over D in D_i of |A intersect D| |D minus A|,
since each segment has rank T on sets separating its endpoints and rank
zero otherwise, and the segment ranks add by the base-polytope calculus.
Thus r_i^+ is integral and submodular, though not necessarily
nondecreasing. Define Y^+(d) = Y_{B_1^+,B_2^+}(d) and Z^+ = Y^+(0).

Every real vector summing to zero on each superblock has the unique
expression
  d(l) = sum over G in G, sum over j in G minus {j_G}, of l_j (e_j -
         e_{j_G}), with l_j = d_j.
These are the full star coordinates; the restricted version uses only
j = e_C for nonroot components C of G, with the other coefficients zero.
Put
  h = S/N^50,  M = N^2000,
  omega(l) = exp( - sum_j |l_j| / h ),
  psi(l)   = exp( - sum_C l_{e_C}^2 / M^2 ),
with omega on the full star and psi on the restricted star. Let their
integer normalizers be
  A_omega = sum over l in Z^{n-g} of omega(l),
  J = sum over l in Z^{sum_G (# C - 1)} of psi(l).
The sums factor into one-dimensional sums, and an empty star has a single
coefficient vector, weight one, and normalizer one.

Lemma (shift averages). For F = Y and for F = Y^+, every integral full
or restricted star shift with |l_j| <= S/N^25 satisfies
  e^{-N^{-8}} <= F(d(l)) / F(0) <= e^{N^{-8}}.
For (kappa, A_kappa) equal to (omega, A_omega) or (psi, J) on the
corresponding star lattice,
  e^{-3N^{-8}} F(0) <= (1/A_kappa) sum_l kappa(l) F(d(l))
                      <= e^{3N^{-8}} F(0),
and the lower bound remains valid when the sum is restricted to
max_j |l_j| <= S/N^25.

Proof. First Y(d) >= 1 for every integral d with zero superblock sums and
||d||_1 <= S/2. If a set A cuts no superblock then d(A) = 0 <= s_*(A);
otherwise d(A) <= ||d||_1 <= S/2 < s_*(A). Hence d lies in B(s_*), so
B(r_1) intersect (B(r_2) + d) is nonempty, and integrality supplies an
integer point; inclusion gives the same positivity for Y^+.

All coordinates of an expanded base lie in [-nT, R+nT], so the
product-of-lengths bound gives Y(d), Y^+(d) <= e^K for every d. In the
positive region just found their logarithms lie between zero and K, and
by root-direction log concavity these logarithms are concave on integer
lines parallel to e_j - e_k.

Introduce the star shifts successively. Each partial shift has
l1-norm at most 2nS/N^25. On the line for the next shift an integer
interval of radius floor(S/10) about that partial shift stays in the
positive region. A concave integer sequence with values in [0,K] on this
interval has successive slopes of absolute value at most 100K/S within
distance S/N^25 of its center, by comparing each slope with the secants to
the two ends of the interval. Adding at most n changes proves
  | log F(d(l)) - log F(0) | <= (100K/S) sum_j |l_j| <= 100nK/N^25 < N^{-8}.

For completeness put b = S/N^25. For a single omega-coordinate the
normalized tail beyond b is at most 4 exp(-b/(2h)), by summing a geometric
series; for a single psi-coordinate it is at most 4 exp(-b^2/(2M^2)), by
comparing the decreasing Gaussian tail with its integral and using b >=
2M. The full normalized tail is at most the sum of these one-coordinate
tails. Since b/h = N^25, b^2/M^2 = N^5950, and K = N^5, in either case the
tail probability tau satisfies e^K tau <= exp(-N^20). On the complementary
region use the small-shift ratio; on the tail use F <= e^K and F(0) >= 1.
The resulting lower bound (1 - tau) e^{-N^{-8}} F(0) and upper bound
e^{N^{-8}} F(0) + e^K tau imply the average comparison, including its
restricted form, and all assertions are exact when the star is empty.

The full-star average is only a device for comparing Z^+ with Z; the
algorithm uses the restricted average, whose shift variables are the
polynomial-length part totals.

The full-star numerator is a weighted sum over pairs of lattice points
with equal superblock totals. Once those totals are fixed the two systems
subdivide independently: contract each toward a separate point in its
slice, which keeps the common superblock totals but may create
differences away from the representatives. The full star allows those
differences, which is why it serves this comparison. Fix integer totals
w = (w_G : G in G) and write
  Q_i(w) = { x in B(r_i) : x(G) = w_G for every G in G }.
Whenever both expanded slices are nonempty, both original slices are
nonempty, and since every direction in Delta_i preserves superblock
totals, the expanded slice is exactly Q_i(w) + Delta_i.

Lemma (refinement witnesses). Fix integer w for which both Q_i(w) are
nonempty. For each system separately its lattice points and those of its
expanded slice can be partitioned by fixing integer totals on successively
finer parts. Each resulting original slice has the form
  Q = { x in B(r_i) : x(D) = v_D for D in P },
where P refines G and every part of P is a union of D_i-parts, and its
expanded partner is exactly Q + Delta_i. Every nonempty terminal slice has
a point a* in Q satisfying
  ||a* - c||_inf <= N^60 S,
  r_i(A) - a*(A) >= S   whenever A cuts a part of P,
  r_i(A) - a*(A) >= W/2 whenever A cuts a part of D_i.

Proof. Control the starting totals. If A is an s_*-generator it is a
union of superblocks, so for x_1 in Q_1(w) and x_2 in Q_2(w),
  [r_1(A) - x_1(A)] + [r_2(E minus A) - x_2(E minus A)] = s_*(A) < S.
Both terms are nonnegative, so on the whole first slice every generator
has slack below S and on the whole second slice its complement does; the
same holds at c. Apply the prefix lemma to Q_i(w) union {c}, using
complemented generators for system 2, to get |w_G - c(G)| <= 2n(n^2+1)S
<= N^6 S. The distance bound for one rank system with these partition
equalities gives a in Q_i(w) with ||a - c||_inf <= N^10 S; choose it
rationally, since c and the cube radius are rational.

One refinement step on one system maintains a nonempty original slice Q,
its partition P, and a point a in Q. A list of at most n^2+n generators
produces P; initially it is the list just described, each initial
generator having slack at most S throughout Q, and every generator added
later has slack at most N^3 S throughout the slice where it is added and
all its descendants. Intersect Q with the cube of radius L = N^10 S about
a and choose a center b of this boxed slice with the property of the center
lemma. If every rank inequality cutting a current part has slack at least
S at b, stop on this branch with a* = b. Otherwise select a set A cutting a
current part with r_i(A) - b(A) < S. The center property gives
  max over x in Q with ||x - a||_inf <= L of (r_i(A) - x(A)) <= 4(n+1)S
  < N^3 S.
The slack x -> r_i(A) - x(A) is nonnegative on Q with integral linear part
-minus 1_A, and its displayed maximum is below N^3 S < L, so the last
assertion of the polyhedral-controls lemma identifies it with the
unrestricted maximum on Q; the new generator thus has slack at most N^3 S
throughout Q.

Proximity to c survives refinement. At depth t maintain
  ||a - c||_inf <= N^10 S + t N^17 S,
with t <= n. Every tested center b, within L of a, is then within N^60 S
of c. If A cut a fine part, its slack at c would satisfy
s_i(A) = r_i(A) - c(A) >= W, and so r_i(A) - b(A) >= W - n N^60 S >= W/2
> S, a contradiction. Adding A gives a refined partition that is still a
union of fine parts.

On this refined partition prescribe every integer vector of part totals
occurring in the expanded slice. Every such vector occurs in the original
real slice, since in a decomposition x + v in Q + Delta_i the vector v
preserves every new total, being a sum of fine-part-preserving segments.
Each retained original child slice is therefore nonempty, and its expanded
partner is its Minkowski sum with Delta_i. The new list has slack at most
N^3 S throughout Q, and the part-range bound gives a range of at most
2n(n^2+n+1) N^3 S <= N^12 S for each new part total. The current a then
meets all new equalities within N^12 S, and the distance bound gives a
point in the child within N^17 S of a; choose it rationally within the
indicated cube. This proves the distance induction at the next depth.

Each branch stops after at most n-1 strict refinements, and there are
finitely many branches because the slices are bounded. The stopping rule
gives the terminal-slack assertion, the distance induction gives the
distance assertion, and the comparison with c gives the fine-slack
assertion for every fine-cutting inequality. Prescribing totals partitions
lattice points without multiplicity, and integral prescribed totals are
compatible with the unit lattice in every terminal affine space, so
nonempty original terminal slices contain integer points by the
polyhedral-controls lemma.

Proposition (expansion costs little). The expanded common-base count
satisfies Z <= Z^+ <= e^{20 N^{-8}} Z.

Proof. The lower bound is inclusion. For the upper bound define the
full-star weighted pair sums
  W = sum_l omega(l) Y(d(l)),  W^+ = sum_l omega(l) Y^+(d(l)).
Fix common integer superblock totals w and perform the two independent
subdivisions of the refinement lemma. Compare one pair of terminal slices
Q_1, Q_2 with its expanded pair Q_1 + Delta_1, Q_2 + Delta_2, whose
partitions P_1, P_2 may differ; let a_1*, a_2* be their witnesses and put
a* = (a_1*, a_2*).

For each system use the affine coordinates that retain all but one
physical coordinate in each terminal part, the omitted coordinate being
the prescribed integer total minus the retained ones. The integral points
then form exactly a unit grid. Measure is the product measure in the free
coordinates, independently for the two systems, and the terminal slack
makes each original slice full-dimensional in its affine space, since
every inequality not fixed by part totals is strict at the witness; a
zero-dimensional affine space is given measure one.

Tile these affine spaces by half-open unit cells based at all their
integral points. In physical coordinates any point of a cell differs from
its base point by at most 2n in sup norm, and the same holds when rounding
to the base of the containing cell, using the formula for the omitted
coordinate even for negative coordinates. There is no truncation at zero:
expanded bases may have negative coordinates and feasibility is checked
by the full rank inequalities.

Let C be the union of cells based at pairs of original feasible lattice
points in these terminal slices, and C^+ the corresponding expanded union.
Extend the weight to the whole product affine space by
  omega(x_1,x_2) = exp(-Phi(x_1,x_2)),
  Phi(x_1,x_2) = (1/h) sum over G in G, sum over j in G minus {j_G}, of
                 |x_{1j} - x_{2j}|.
The common superblock totals make this the star weight; it is continuous
and Phi is convex. Its logarithm varies by at most kappa_0 = 4n^2/h within
any one product cell relative to the base point, so integration over C or
C^+ approximates the corresponding weighted lattice sum within a factor
e^{kappa_0}.

Put theta = N^{-200} and apply the homothety H(x) = (1 - theta) x +
theta a*. Claim: H(C^+) is contained in C. Fix x in C^+ and round H(x) to
the base point y = (y_1,y_2) of its containing cell; all prescribed
terminal totals are preserved. In system i the rank inequality for A holds
at the expanded lattice point under x with additional allowance
  sigma_i(A) = T sum over D in D_i of |A intersect D| |D minus A| <= n^2 T.
Passing to x and the final rounding each change a subset sum by at most
2n^2. If A cuts a terminal part but no fine part then sigma_i(A) = 0 and
  y_i(A) - r_i(A) <= 4n^2 - theta S < 0.
If A cuts a fine part it also cuts a terminal part, and
  y_i(A) - r_i(A) <= 4n^2 + n^2 T - theta W/2 < 0.
These strict inequalities use theta S = N^4800 and theta W/T = N^100.
Finally, if A cuts no terminal part its total is fixed on the affine space
and equals a feasible original total, so every original rank inequality
holds at y_i, proving the claim and enforcing nonnegativity of y_i.

Write d <= 2n for the product free dimension. The map H is injective with
Jacobian (1 - theta)^d, and convexity and nonnegativity of Phi give
Phi(H(x)) <= (1 - theta) Phi(x) + theta Phi(a*) <= Phi(x) + theta
Phi(a*). The witness distance gives theta Phi(a*) <= theta 2n N^60 S/h <
N^{-80}. Integration and the inclusion imply
  integral over C of omega >= (1 - theta)^d exp(-theta Phi(a*))
                              times integral over C^+ of omega.
Together with the cell-weight variation this bounds the expanded weighted
lattice sum in this pair of slices by the original weighted sum times
exp{ 2 kappa_0 + theta Phi(a*) - d log(1 - theta) } <= e^{N^{-8}}. The
same argument holds in dimension zero, with Jacobian and cell measure one.
Summing over terminal pairs and then over w gives W^+ <= e^{N^{-8}} W.
Finally the shift-average lemma gives
  Z^+ <= e^{3N^{-8}} W^+/A_omega <= e^{4N^{-8}} W/A_omega
       <= e^{7N^{-8}} Z <= e^{20N^{-8}} Z.

Only the original partitions, their orders, and the representative
coordinates are computed; the expanded polytopes, the full-star sum, and
all terminal subdivisions only enter the comparison. The port construction
next uses the restricted Gaussian average and part totals to build a
finite counting problem whose capacities are polynomial in N.

The restricted Gaussian average approximates Z by a normalized weighted
count of pairs of original bases whose difference is supported on the
representative edges. These pairs are now described by part totals and
free edge coordinates: only the part totals become discrete variables,
while the free coordinates, whose ranges may depend on R, are integrated
out. The resulting positive weights must carry the two integer signatures
at every annealing power, which is the purpose of the smoothing below.

For each D in D_i define integer endpoints
  L_{iD} = max{ 0, floor(c(D) - N^20 W) },
  U_{iD} = min{ R, ceil(c(D) + N^20 W) }.
A port is the part total u_{iD}, restricted to the integers of
[L_{iD}, U_{iD}], of length d_{iD} = U_{iD} - L_{iD} <= N^21 W. Write
  rbar_i(A) = r_i(union of the parts in A), for A contained in D_i.
By the base-polytope calculus the projection of B(r_i) onto its part
totals is B(rbar_i).

These ranges contain every term of the original restricted Gaussian
average supported on representative edges with |l_j| <= S/N^25. The center
property bounds the slack of every generator of D_i throughout P by
4(n+1)W, and the prefix construction followed by subtraction of
consecutive prefix totals gives
  | x(D) - c(D) | <= N^10 W, for x in P and D in D_i,
where 8(n+1)n(n^2+1)W suffices. If x_1 in B(r_1), x_2 in B(r_2), and
x_1 - x_2 = d(l) with these bounds on l, then x_1 violates any inequality
of the second system by at most ||d(l)||_1 <= 2nS, so the
polyhedral-controls lemma gives a point of P within N^6 S of x_1 in sup
norm, and likewise for x_2. Their part totals therefore differ from c(D)
by at most N^10 W + n N^6 S < N^20 W, while nonnegativity and total rank
keep them in [0,R].

Use the bipartite graph, component representatives e_C, and root
components C_0(G) fixed earlier. For arbitrary real port values define
the component imbalance
  t_C(u) = sum over D in C intersect D_1 of u_{1D}
           minus sum over D in C intersect D_2 of u_{2D}.
Choose a spanning tree T_C in each component, containing e_C, and let z_e
be free coordinates on the edges outside these trees. Seek X_1 with side-1
margins u_{1D} and side-2 margins u_{2D}, except that t_C is added to the
side-2 margin incident to e_C, so the two margin sums in a component agree;
define X_2 by subtracting t_C from X_1 on e_C and leaving the other edges
unchanged.

Lemma (integral tree coordinates). There is a unique pair X_i(u,z) with
these properties and X_{1e} = z_e on nontree edges. Its coordinates are
integral linear functions of (u,z), with coefficients of absolute value at
most 10(n+1), and each coordinate depends only on variables in its
superblock. For integral (u,z) this is a bijection onto integral pairs with
the specified D_1-totals for X_1, the specified D_2-totals for X_2, and
X_1 - X_2 supported on the representatives.

Proof. Remove the prescribed nontree contributions from each vertex
margin. A leaf of the remaining tree determines its unique incident edge,
whose value is subtracted from the neighboring margin and the leaf
deleted; the final equation holds because the two margin sums agree. This
gives existence, uniqueness, and integrality. Equivalently, deleting a
tree edge splits the vertices into two sets, and the edge value is the
signed sum of the residual margins on either one. Every original port has
coefficient 0, 1, or -1 in that sum before the representative correction,
and every free edge enters with coefficient of absolute value at most one,
so substituting the imbalance gives the stated loose bound. Conversely the
prescribed margins of any such pair give sum over e in C of (X_{1e} -
X_{2e}) = t_C, and representative support forces the discrepancy on e_C to
equal t_C, so the pair obeys exactly these equations. The inverse map
reads off the part totals and the nontree values, with no multiplicity or
lattice determinant.

Let F_G denote the nontree edges in a superblock G. Discrete sums take
z in {0,...,R}^{F_G}; for integration use Q_G = [0,R+1]^{F_G}. These
choices include every original base pair and fix the measure, which is
ordinary Lebesgue measure in z with a zero-dimensional integral equal to
its integrand.

For each superblock G let A_{iG} be the union of blocks preceding G in
the order for system i, using the reversed order for system 2. Define the
contracted ranks and the violation penalty by
  r_{iG}(U) = r_i(A_{iG} union U) - r_i(A_{iG}),  U contained in G,
  V_G(u,z) = sum_{i=1}^2 max over U contained in G of
             { X_i(u,z)(U) - r_{iG}(U) },   lambda = N^320 / W.
Each maximum includes the empty set, so V_G is nonnegative and convex.
The hard conditions on ports are
  u_i in B(rbar_i) for i = 1,2,  and  sum over C contained in G of t_C = 0
for every G.

Lemma (what the penalties enforce). An original base pair with a
representative shift satisfies the hard conditions and
sum over G of V_G <= N^7 S. Conversely, if the hard conditions hold then
X_i(A) - r_i(A) <= sum over G of V_G for every A and both i, and if in
addition sum over G of V_G <= T then X_i lies in B_i^+ for both i.

Proof. The representative shift sums to zero on each superblock, giving
the hard conditions. For an original pair, every forward superblock prefix
A satisfies x_1(A) = x_2(A), so its two complementary rank slacks add to
s_*(A) <= N^4 S; the system-2 prefixes are complements of such forward
prefixes, so the slack at either prefix A_{iG} is at most N^4 S. The
inequality on A_{iG} union U gives
  x_i(U) - r_{iG}(U) <= r_i(A_{iG}) - x_i(A_{iG}),
and summing over the two systems and at most n blocks proves the first
bound.

For the converse fix i and put U_G = A intersect G. Diminishing marginal
returns, applied successively in the order of system i, gives
  sum over G of ( r_i(A_{iG} union U_G) - r_i(A_{iG}) ) <= r_i(A):
the prefix of the already selected pieces of A is contained in A_{iG}, and
its marginal increment from U_G is at least the increment from the full
prefix. Summing the defining inequalities for V_G proves the claim. The
hard rank conditions enforce the correct total and every inequality on a
union of parts of D_i. Any other set cuts at least one part, and its rank
bound in B_i^+ rises by T for each pair of coordinates in that part
separated by the set, hence by at least T, absorbing the remaining
violation.

Write J = sum over l of exp(-sum_j l_j^2/M^2) for the normalizer of the
representative average. Consider the discrete port sum
  Ac = sum over u in the integer port boxes satisfying the hard
       conditions, sum over z in {0,...,R}^{union_G F_G} of
       exp( -lambda sum_G V_G(u,z)
            - sum_G sum_{C not C_0(G)} t_C(u)^2/M^2 ).
Under the hard block equalities the nonroot values t_C are exactly the
independent representative star coordinates, so the tree-coordinate lemma
identifies every summand with one representative-shift pair.

For a lower bound retain original pairs with |l_j| <= S/N^25. Their ports
and free coordinates lie in the chosen boxes, and their extra penalty is
at most lambda N^7 S = N^327 S/W < N^{-20}. For an upper bound the
summands with sum_G V_G <= T form a subset of the expanded representative
average, while the remaining summands total at most e^K exp(-lambda T) =
exp(K - N^20), negligible as a relative error since JZ >= 1. The
shift-average lemma and the expansion proposition then give
  | log ( Ac / (J Z) ) | <= 40 N^{-8}.

Define the continuous block weights
  I_G(u) = integral over Q_G of exp(-lambda V_G(u,z)) dz.
They are positive and log concave, by Prekopa's theorem on marginals of
log-concave functions applied to the integrand times the indicator of its
convex integration box. The tree-coefficient bound gives, globally in the
joint variables (u,z),
  | lambda V_G(u,z) - lambda V_G(u',z') |
      <= L_0 ||(u,z) - (u',z')||_inf,  L_0 = N^330/W,
since at most 3n input variables, at most n edge coordinates per subset
sum, and coefficients bounded by 10(n+1) give a Lipschitz constant at most
100(n+1)^4 lambda < L_0. Integrating the pointwise ratio bounds gives the
same bound for log I_G in u. Define the hard integrated mass
  Ihard = sum over u in the integer port boxes satisfying the hard
          conditions of ( product over G of I_G(u) )
          exp( - sum_G sum_{C not C_0(G)} t_C(u)^2/M^2 ).
Tiling Q_G by unit cells anchored at {0,...,R}^{F_G} gives
  | log ( Ihard / Ac ) | <= 2n L_0.

The block integrals are positive and log concave, but log concavity alone
does not give either integer signature. A quantitative version is arranged
by smoothing on a scale where the weights barely change, then adding a
smaller strictly concave quadratic whose curvature absorbs the gap between
second derivatives and discrete differences. Set
  b_0 = W/N^400,  alpha = N^{-100}/W^2,  H = N^10.
In every port coordinate independently let kappa_{b_0} be the law of a sum
of six uniform variables on [-b_0/6, b_0/6]. Convolve I_G in its port
variables with the product of these kernels, writing the result Itilde_G.
The kernel and the integral are log concave, so their convolution is log
concave as well by Prekopa's theorem. Its support displacement has sup norm
at most b_0, hence
  e^{-L_0 b_0} I_G(u) <= Itilde_G(u) <= e^{L_0 b_0} I_G(u).
Define
  F_G(u) = Itilde_G(u) exp{ -(alpha/2) sum over i, D in G of
            (u_{iD} - c(D))^2
            - sum over C not C_0(G) of t_C(u)^2/M^2
            - H | sum over C in G of t_C(u) | }.
For a rank r on part indices, put
  m_r(v) = min over A of { r(A) + v(E_r minus A) },
  Phi_{r,H}(v) = exp{ -H [ v(E_r) + r(E_r) - 2 m_r(v) ] }.
On nonnegative integral inputs its penalty is nonnegative, vanishes
exactly on B(r), and is at least H otherwise. The positive port weight is
  w(u) = Phi_{rbar_1,H}(u_1) Phi_{rbar_2,H}(u_2) product over G of F_G(u).

On the hard profiles the softened penalties vanish, and hence
  | log ( sum over hard u of w(u) / Ihard ) |
      <= n L_0 b_0 + alpha n (N^21 W)^2 < N^{-50}.
Every profile violating a hard condition has an integral nonzero penalty
and so carries an extra factor at most e^{-H}; all other exponential
factors are at most one and Itilde_G <= (R+1)^{|F_G|}. Thus
  0 <= sum over all u of w(u) - sum over hard u of w(u) <= e^{K-H}.
Combining these estimates with the discrete-proxy bound gives
  | log ( sum over u of w(u) / (J Z) ) | <= 100 N^{-7}.
The weighted port sum now approximates JZ; what remains is to represent it
as a balanced mass of weights carrying both integer signatures.

To expose the disjoint factor groups needed for signatures, give each
positive-length port two count coordinates (a_{iD}, b_{iD}), each of
capacity d_{iD}. The coordinate a feeds a rank factor and b feeds a block
factor, with interpreted port values
  i = 1 : rank argument U_{1D} - a_{1D},  block argument L_{1D} + b_{1D},
  i = 2 : rank argument L_{2D} + a_{2D},  block argument U_{2D} - b_{2D}.
The two interpretations agree exactly when a_{iD} + b_{iD} = d_{iD}.
Length-zero ports are fixed at their endpoint and omitted. All count
coordinates are integers. Let
  p = sum over i, D of d_{iD},
  S = { (a,b) : 0 <= a_{iD}, b_{iD} <= d_{iD}, and
        sum over i, D of (a_{iD} + b_{iD}) = p }.
Let h on S be the product in the positive port weight, using the rank and
block arguments from the corresponding columns. The factors now act on
disjoint count coordinates. The side-2 reflection makes every retained
block coordinate enter its component imbalance with coefficient +1:
  t_C = sum over D in C intersect D_1 of L_{1D}
        - sum over D in C intersect D_2 of U_{2D}
        + sum over (i,D) with D in C of b_{iD},
where omitted count coordinates are understood as zero. This common
orientation is what both imbalance factors need in the signature test.

Lemma (derivatives after smoothing). In block count coordinates the
function g = log Itilde_G is three times continuously differentiable, is
concave, and satisfies, everywhere,
  | g''_{ij} | <= A_2 = N^800/W^2,   | g'''_{ijk} | <= A_3 = N^1250/W^3.

Proof. A uniform density on an interval of length b_0/3 has distributional
derivative of total variation 6/b_0. Assigning at most three derivatives
to distinct uniform factors in each sixfold convolution shows that every
product-kernel derivative of total order q <= 3 has total variation at most
6^q b_0^{-q}; the remaining convolutions give continuous derivatives
through order three. Every positive-order derivative has integral zero.
Subtracting I_G(u) inside its integral and using the Lipschitz bound bounds
each relative derivative of Itilde_G of order q = 1,2,3 by
10^11 L_0 b_0^{1-q}, since e^{L_0 b_0} - 1 <= 2 L_0 b_0 and
Itilde_G(u) >= e^{-L_0 b_0} I_G(u). The identities for derivatives of a
logarithm then bound second derivatives by a constant times (L_0/b_0 +
L_0^2) and third derivatives by a constant times (L_0/b_0^2 + L_0^2/b_0 +
L_0^3), and these constants are absorbed by the powers displayed, using
L_0/b_0 = N^730/W^2 and L_0/b_0^2 = N^1130/W^3. Reflection of side-2
coordinates only changes derivative signs and conjugates the Hessian by a
diagonal sign matrix, so the bounds and concavity hold in the count
convention as claimed.

Lemma (block signatures at every power). For 0 <= s <= 1 every block
factor F_G^s has both normalized positive-semidefinite tests, that is
1 1^T - Q >= 0 for additions and for removals.

Proof. Fix a display b and a direction sigma in {1,-1}. Initially allow
repeated changes outside the box, where the defining positive formula
still makes sense. The normalized entry for a factor F is
  Q_{ij} = F(b) F(b + sigma e_i + sigma e_j) /
           ( F(b + sigma e_i) F(b + sigma e_j) ).
Ignore for the moment the last, absolute-value term of the block factor.
The finite difference of the smoothed logarithm integrates its Hessian
along two unit segments, and comparing it with the Hessian at b costs at
most 4A_3 in every entry, including i = j. The auxiliary quadratic has
exact finite difference -alpha 1_{i=j}. These two factors therefore
contribute exp(sD_{ij}) with
  D_{ij} = g''_{ij}(b) - alpha 1_{i=j} + e_{ij},  |e_{ij}| <= 4A_3.
The imbalance Gaussian contributes gamma = exp(-2s/M^2) when i,j lie in
the same nonroot component and one otherwise; let B be the matrix of
these entries. Its complement is explicitly positive semidefinite:
  1 1^T - B = (1 - gamma) sum over C not C_0(G) of 1_C 1_C^T >= 0,
where 1_C marks the block coordinates incident to C.

Compare Q = B composed entrywise with exp(sD) to its linear
approximation. The inequalities 1 - exp(-2s/M^2) <= 2s/M^2 and
|e^x - 1 - x| <= 2x^2 for |x| <= 1 give
  1 1^T - Q = (1 1^T - B) - s g''(b) + s alpha I + E,
  |E_{ij}| <= s Ecal,
with one admissible choice
  Ecal = 10 A_3 + 100 (A_2 + alpha + 4A_3)^2 + 10 (A_2 + alpha)/M^2.
More explicitly the error entries are
  E_{ij} = -s B_{ij} e_{ij}
           + s (1 - B_{ij}) (g''_{ij}(b) - alpha 1_{i=j})
           - B_{ij} (exp(sD_{ij}) - 1 - sD_{ij}).
All entries of D are below one in absolute value. The three terms are
bounded respectively by 4sA_3, 2s^2(A_2 + alpha)/M^2, and
2s^2(A_2 + alpha + 4A_3)^2; since s^2 <= s they give the displayed budget
uniformly, even for arbitrarily small positive s. There are at most 2n
block coordinates, so the operator norm of E is at most 2nsEcal, and the
scale choices give
  2n Ecal / alpha <= N^4 ( N^1350/W + N^1700/W^2 + N^-3100 ) < 1/2.
Both 1 1^T - B and -s g''(b) are positive semidefinite, and the term
s alpha I absorbs the error for every s > 0; at s = 0 the assertion is
immediate.

Finally the total imbalance in a block is the sum of all its count
coordinates plus a constant. Put v = sum over C in G of t_C(b). The
absolute-value penalty multiplies every normalized entry by the same
number
  beta = exp{ -s H ( |v+2 sigma| - 2|v+sigma| + |v| ) } in (0,1].
Since 1 1^T - beta Q = (1 - beta) 1 1^T + beta (1 1^T - Q), the test
persists. Discarding unavailable single changes and zeroing the diagonal
for invalid repeated changes act by taking principal submatrices and
adding a nonnegative diagonal to their complements, so they preserve the
test as well.

Proposition (the positive port model). For every nonempty input after
the deterministic feasibility test, the preceding construction gives at
most 2n paired ports of lengths d_{iD} <= N^21 W, with p = sum d_{iD}
polynomial in N, and a strictly positive weight h on the entire slice S.
For every real s in [0,1] the power h^s has both integer signatures. Its
balanced mass
  Z_port = sum over (a,b) in S with a_{iD} + b_{iD} = d_{iD} for all (i,D)
           of h(a,b)
satisfies | log ( Z_port / (J Z) ) | <= 100 N^{-7}. These statements
include p = 0, when there is a single profile.

Proof. Balanced profiles are in bijection with the original integer port
settings, and their weights are w(u), so the positive-proxy bound proves
the comparison. Positivity is explicit in the definitions. The
rank-factor lemma applies to the rank factors, including the simultaneous
reflection on side 1, and the block-signature lemma applies to every block
factor. The coordinate groups of all these factors are disjoint, so the
full normalized complement is the direct sum of their normalized
complements, and the signature criterion proves the result.

The block integrals are definitions of weights, not oracles supplied with
the input. An evaluator is now constructed. The central step writes a good
approximation of an exponential integral as the volume of a rational
polytope, whose separation oracle, encoding lengths, and inner and outer
geometric guarantees are all checked. This also explains why a
free-coordinate interval of length R+1 causes only polynomial dependence on
log(R+1).

Lemma (integral and point-weight bounds). For every block and every port
argument in its box, e^{-N^50000} <= Itilde_G(u) <= e^K. For the weight h
on the full paired slice, | log h(a,b) | <= N^60000. All rational
coefficients needed to define or evaluate its factors have polynomial
encoding length in the input and in the query.

Proof. The upper bound is the free-box volume (R+1)^{|F_G|} <= e^K, since
smoothing uses probability kernels. For the lower bound put u^c_{iD} =
c(D) and z^c_e = c_e on free edges. The tree solve gives X_1 = X_2 = c, so
the prefix-slack argument gives V_G(u^c,z^c) <= 2 N^4 S. For each free
coordinate choose z*_e = max{c_e, 1/4}; it lies in [0,R+1] at distance at
least 1/4 from the boundary and differs from c_e by at most 1/4. On the
cube of sup radius 1/8 about z*, for every smoothing displacement, the port
and free-coordinate displacements from (u^c,z^c) are at most N^21 W + b_0 +
1. Hence
  lambda V_G(u - v, z) <= 2 lambda N^4 S + L_0 (N^21 W + b_0 + 1) < N^5000.
Integrating over this cube and over the whole kernel gives Itilde_G(u) >=
4^{-|F_G|} e^{-N^5000} >= e^{-N^50000}, including the case F_G empty.

For the rank factors choose any common integral base x*, which exists by
the feasibility and integrality results. Its projected totals v*_i satisfy
the rank constraint and are within N^10 W of the center totals by the
part-total range. For a nonnegative vector v on a rank index set the rank
penalty is
  max over A contained in E_r of
  { v(A) - v(E_r minus A) + r(E_r) - 2 r(A) },
and every affine function on the right has coordinate slopes +-1, so the
penalty is 1-Lipschitz in the 1-norm. It vanishes at v*_i and is therefore
at most N^23 W throughout a port box, independently of R, and
multiplication by H remains a fixed power of N. For each component t_C
vanishes at the center and has absolute value at most N^23 W throughout the
boxes. All Gaussian and absolute-value exponents in the block factor thus
have absolute value bounded by fixed powers below N^40000, with the
auxiliary quadratic below one, and summing over at most n blocks gives
| log h | <= N^60000.

The center, endpoints, scales, and tree coefficients have polynomial
encoding length, and ranks of unions and contracted ranks need only
ordinary rank queries. For the minima defining m_r and the maxima defining
V_G, the rational modular terms are handled by clearing their common
denominator and applying the oracle-algorithms proposition, whose binary
length is at most the sum of the individual denominator lengths. The size
parameter is thus polynomial in bits, with no bound on its numerical value.

The classical randomized volume theorem of Dyer, Frieze, and Kannan,
stated in the rational oracle form of Dyer and Frieze, is used in this
shape: a full-dimensional rational polytope in R^d, given by strong
separation, a polynomial bound on each inequality's encoding length, and
rational inner and outer ball guarantees, admits a relative volume
approximation with success probability at least 3/4, in oracle and bit
complexity polynomial in d, the encoding lengths, and the reciprocal
error, with the radii entering through their binary lengths. The
finite-precision algorithm, its polynomial random-bit bound, and its
finite-grid sampling with error analysis are the ones in Dyer and Frieze
and in Dyer, Frieze, and Kannan. Finite uniform integer choices are drawn
from unbiased bits by rejection using fewer than two expected trials, so
the expected polynomial bound covers bit operations, rational arithmetic,
and oracle calls; the procedure is capped and amplified below. Strong
separation supplies the weak membership the theorem needs.

Each volume input is first rounded by a rational change of coordinates.
The center lemma is applied to the full-dimensional polytope, and its
returned simplex vertices are sent to 0, e_1, ..., e_d. The image contains
the standard simplex and lies in [-2,2]^d, because its nonconstant
barycentric coordinates have absolute value at most two. The standard
simplex contains a Euclidean ball about its barycenter of radius at least
(d+1)^{-2}, so translating that barycenter to zero and scaling by (d+1)^2
gives an inner unit ball and an outer ball of polynomial radius. The affine
map, its determinant, and the inverse images of rational separation queries
have polynomial encoding length, and correcting the returned volume by the
determinant is exact rational arithmetic. The required optimization uses
the rational separation theorem of Groetschel, Lovasz, and Schrijver
through the oracle-algorithms proposition, giving a rounded input even when
the original aspect ratio is numerically large.

Fix a block and a rational port vector u in its box. Let m be the number
of its port arguments, including fixed length-zero ports, and f = |F_G|
its number of free variables; the length-zero ports are omitted only from
the count slice and remain arguments of the smoothing convolution. Replace
the 6m uniform variables by q_{ja} in [0,1], putting
  v_j(q) = (b_0/3) sum_{a=1}^6 (q_{ja} - 1/2),
  B = [0,R+1]^f x [0,1]^{6m},
  D(z,q) = lambda V_G(u - v(q), z).
The normalized uniform density is absorbed by this unit-interval
parametrization, so no further Jacobian factor appears:
  Itilde_G(u) = integral over B of exp(-D(x)) dx,  x = (z,q).
The function D is nonnegative, convex, and piecewise affine, and its value
together with an attaining affine piece is computable exactly at rational
points, since submodular minimization returns a maximizing subset for each
of the two maxima in V_G and their sum is such a piece.

For 0 < rho < 1 define
  E_0 = N^51000 + ceil(log_2(100/rho)),  d_0 = ceil(1000 E_0^2 / rho).
The ceiling of the logarithm is found by integer comparisons of powers of
two, without numerical logarithms. Consider the polytope
  Q = { (x,y) : x in B, y in R_{>=0}^{d_0},
        D(x) + d_0 y_a <= d_0 for 1 <= a <= d_0 }.
Each inequality involving D means all the affine-piece inequalities in its
finite maximum representation, which makes Q a convex rational polytope
although its inequalities are not enumerated. Integrating over its
y-fiber gives the exact identity
  vol(Q) = integral over B of (1 - D(x)/d_0)_+^{d_0} dx.

Lemma (accuracy and guarantees for the volume lift). The polytope Q has
dimension f + 6m + d_0, a polynomial facet-encoding bound, and an exact
polynomial-time strong separation oracle. It contains a known rational
ball of radius 1/32 and has an outer ball of polynomial encoding length.
Moreover
  (1 - rho/10) Itilde_G(u) <= vol(Q) <= Itilde_G(u).
All polynomial bounds are in the original input length, the encoding
lengths of u and rho, N, and rho^{-1}, with absolute fixed exponents.

Proof. The pointwise upper inequality follows from 1 - t <= exp(-t). For
0 <= D <= E_0, expansion of -log(1-t) or integration of its derivative
gives
  0 <= -d_0 log(1 - D/d_0) - D <= D^2 / (2 d_0 (1 - D/d_0)) < rho/100.
The part of the integral where D > E_0 has integral at most exp(K - E_0),
and dividing by the lower bound of the integral-bounds lemma makes its
relative contribution at most exp(K + N^50000 - E_0) < rho/100. These two
errors prove the displayed accuracy.

For separation, first test the box inequalities and y >= 0. Compute D(x)
and choose an index a with largest y_a. If D(x) + d_0 y_a > d_0, the
attaining affine piece of D gives a rational hyperplane separating the
point from Q; otherwise every inequality holds. The coefficient bounds
come from the integral tree map, the rank-answer bit bound, the rational
scales, and the input port encodings. At a rational query, clearing
denominators for the two submodular minimizations takes polynomial bit
work, so each inequality rather than the number of possible subsets is the
encoding parameter.

For the inner ball choose x* = (z*, q*) with z*_e = max{c_e, 1/4},
q*_{ja} = 1/2, and y*_a = 1/4. All box coordinates have clearance at least
1/4. A Euclidean perturbation of radius 1/32 changes each free coordinate
by at most 1/32 and each v_j by at most 2b_0/32, so by the port Lipschitz
bound its change in D is at most L_0 max{1, 2b_0}/32 < 1. The near-center
estimate then gives D < N^5000 + 1 < d_0/2 throughout this ball, and
0 < y_a <= 9/32 gives D + d_0 y_a < 25 d_0/32 < d_0. This proves the inner
guarantee, including f = 0. Every point of Q has x in B and 0 <= y_a <= 1,
so with d = f + 6m + d_0 the ball centered at the origin of rational radius
d(R+2) is an outer ball, whose binary encoding length is polynomial.

Finally the numerical value of d_0 is polynomial in N and rho^{-1}, the
exponents in its definition being fixed, so even its explicitly added
coordinates are written and processed within one fixed polynomial bound.
The original capacity appears only in the box endpoint R+1 and the
encoding lengths just verified.

Proposition (a bounded weight evaluator). Given a profile in the entire
slice S, rational 0 < rho, beta < 1, and a rational power s in [0,1] with
denominator q_s, there is an evaluator using fresh random bits and
returning a strictly positive rational hhat_s with
  Pr[ (1 - rho) h^s <= hhat_s <= (1 + rho) h^s ] >= 1 - beta.
Its output length, number of rank queries, and other bit operations are
bounded on every execution by fixed polynomials in N, the input encoding
lengths, rho^{-1}, log(beta^{-1}), and q_s. An equally spaced schedule with
a polynomial number of phases has polynomially bounded denominators.
Moreover J admits a deterministic positive rational approximation Jhat
with | log ( Jhat / J ) | <= N^{-7} in polynomial work.

Proof. First evaluate a single smoothed block integral. Round Q by the
rational affine construction above, apply the volume theorem with relative
error rho/10, and restore the exact determinant factor; the same parameter
rho enters the volume-lift scales. By the volume-lift lemma the successful
output is a relative rho/2 approximation to Itilde_G.

All resource bounds are bounds on actual finite-bit executions. Let B be a
furnished polynomial upper bound on the expected combined number of bit
operations and oracle calls of one volume run, including its separation
queries; if the chosen version already has a deterministic bound, use that
instead. Interrupt a run after 16B operations, which by Markov's inequality
raises the failure probability by at most 1/16, leaving success probability
at least 11/16. On interruption, a declared failure such as a zero
denominator, or an invalid or nonpositive output, substitute a fixed
positive rational. Repeat independently O(1 + log beta^{-1}) times and take
the median; the binomial tail bound gives failure probability at most beta.
Cap construction, query lengths, arithmetic, and random-bit generation are
included. Clip each output to [2^{-2N^50000}, 2^{2N^50000}], a polynomial-bit
interval that strictly contains every successful relative approximation, so
clipping keeps the guarantee and bounds positive outputs even on failed or
interrupted runs.

Evaluate all rank penalties and other rational exponents exactly, allocate
relative error rho/(100(n+1)) and failure allowance beta/(n+1) to each of at
most n block integrals, and evaluate the remaining exponentials and rational
arithmetic to another rho/(100(n+1)) per factor. The log bounds ensure these
relative accuracies need only polynomial absolute precision. One elementary
implementation uses the exponential Taylor series with factorial tail
bounds: an exponent of magnitude at most D_*, at absolute precision 2^{-k},
needs polynomially many terms and bits in D_* + k + 1, and negative
exponents follow by inverting a positive exponential approximation. Here
D_* is a fixed polynomial in N, not in R.

Multiplying the factors gives a positive relative approximation to h. Before
taking any power, clip this product to [2^{-3N^60000}, 2^{3N^60000}], an
interval that contains h and so cannot increase the relative error while
supplying valid bisection bounds even after failed block evaluations. On the
simultaneous success event the total factor log error is below rho/10. To
obtain h^s with s = a_s/q_s, apply bisection to the q_s-th root and integer
powering to a_s, with positive rational endpoints whose binary exponents are
bounded by 3N^60000; each comparison is an integer-power comparison with
a_s <= q_s, so the number of bisections, the operand lengths, and the bit
work are polynomial in q_s, N, and log rho^{-1}. A power in [0,1] cannot
increase the preceding log error, and approximating the root to log error at
most rho/[100(q_s+1)] before the a_s-th power adds at most rho/100. For s = 0
return one exactly. Clipping the final output to [2^{-3N^60000},
2^{3N^60000}] gives the same positivity and encoding bound on every failure
event, so no future computation is conditioned on success.

To approximate J, let k be the number of nonroot components, so
  J = ( sum over j in Z of exp(-j^2/M^2) )^k,  0 <= k <= n.
For k = 0 return one. Otherwise truncate at B_J = M N^10, polynomial in N;
the omitted two-sided tail is at most
  2 integral from B_J to infinity of exp(-x^2/M^2) dx
      <= (M^2/B_J) exp(-B_J^2/M^2) = M N^{-10} exp(-N^20),
and the sum is at least one. Approximate each of the 2B_J + 1 retained terms
to absolute error at most N^{-7}/[100(n+1)(2B_J+1)], keeping the term at
zero exactly one and the remaining terms nonnegative; the elementary
exponential procedure above is bounded since each exponent has magnitude at
most N^20. Adding the terms and raising to the integer power k gives a
positive rational result whose log error is below N^{-7}. No random choice
or numerical grid of length R occurs.

The positive port model and the evaluator give a sum of positive weights on
polynomially short ranges whose individual terms can be approximated. That
entire sum is now approximated. The factorial encoding below is essential:
its transversals carry exactly the mass of the unlabelled port profiles, and
the two resulting binary weights give the transport and trace estimates of
the common-base framework in its two-weight form.

Write P for the positive-length ports and d_v for the length of port v in P,
so p = sum over v of d_v. The weight h of the port model is positive on the
entire slice
  B_p = { (a,b) : 0 <= a_v, b_v <= d_v, and
          sum over v of (a_v + b_v) = p }.
All count coordinates here are integers. The quantity to be estimated is
  Z_port = sum over (a,b) in B_p with a_v + b_v = d_v for all v in P
           of h(a,b),  with | log ( Z_port / (J Z) ) | <= 100 N^{-7}.
Length-zero ports are already fixed in h. If p = 0 the sum has one term,
which is evaluated directly at the end of the proof; until then p >= 1.

For every port v introduce d_v labelled pairs, each holding an a-element and
a b-element. Let E be this ground set of 2p elements and number its pairs
1,...,p. For every p-subset S of E the counts (a(S), b(S)) lie in B_p. Given
a positive count weight k on this slice define
  f(S) = k(a,b) product over v in P of a_v! b_v! / d_v!,
  ftilde(S) = k(a,b) product over v in P of
              (d_v - a_v)! (d_v - b_v)! / d_v!.
Both weights are defined and positive on every p-subset, including subsets
with several empty or full pairs.

Let A consist of the transversals, which select exactly one element from
each pair. For distinct labels i, l let A_{il} consist of the subsets with
pair i empty, pair l full, and every other pair singly occupied. On a
transversal the two factors above coincide and equal the product over v of
binom(d_v, a_v)^{-1}, and exactly the product over v of binom(d_v, a_v)
transversals realize any balanced profile. Consequently
  C := sum over S in A of f(S) = sum over S in A of ftilde(S)
     = sum over a + b = d of k(a,b).
This identity concerns transversals, not all subsets with the same
coordinate counts.

For a positive weight on all r-subsets of a finite set the addition property
means that, after any r-2 elements are fixed included, the matrix of weights
obtained by adding two distinct further elements, with zero diagonal, has at
most one positive eigenvalue; it is vacuous for r < 2. The omission property
is the addition property of the complement-set weight.

Lemma (counting lifts). If k has both integer signatures, then f has the
omission property and ftilde has the addition property. Both properties
persist under fixing included or excluded elements and under summing
disjoint labelled pairs at occupancy one, on each resulting full
valid-degree domain. With q = (p+1)^2,
  q^{-1} f(S) <= ftilde(S) <= q f(S)
for every S in A or in A_{il} with i not equal l.

Proof. The factorial cancellation is the one in the cell-bounded companion,
which also displays the roles of the two weights. In an omission test for f
the display has p+2 elements. Group these by count coordinate, letting n_u
be the number in group u. On the subspace of vectors constant within each
group, the ordered-copy multiplicities n_u n_w for u not equal w and
n_u(n_u - 1) for u = w cancel the factorial reductions from removing two
elements, and the quadratic form becomes
  ( product over u of n_u! / product over v of d_v! )
  times sum over u,w of k(n - e_u - e_w) t_u t_w,
where invalid removals contribute zero. Its positive index is at most one by
the integer removal signature. Vectors summing to zero within each group
have nonpositive quadratic form and are orthogonal for this form to the
group-constant subspace, since within a group the matrix has constant
nonnegative off-diagonal entries and zero diagonal. This proves the
omission assertion. For ftilde group the elements available after fixing p-2
inclusions; the remaining-capacity factorials cancel the same
multiplicities, leaving a positive multiple of the integer addition matrix,
which proves the addition assertion. The closure assertions are the binary
contractions of the same companion, whose positivity hypothesis on the full
domain has just been checked.

For the comparison, if the empty and full pair lie in one port then all
ports remain balanced and the ratio is one. Otherwise the port containing
the hole has a + b = d - 1 and contributes (a+1)(b+1) to ftilde/f, and the
port containing the full pair has a + b = d + 1 and contributes 1/(ab). Both
positive integer products lie between 1 and (p+1)^2, and their quotient
proves the displayed comparison.

Let X be the finite set consisting of the transversals A together with all
defect states obtained from a transversal by leaving one ordered pair i,l of
distinct pairs empty and full while every other pair stays single. A defect
state is determined by the ordered pair (i,l) and the transversal assignment
on the remaining pairs, so there are at most p^2 times as many states as
transversals. Let K denote the transversal read from a defect state.

The positive weight on X equals f on transversals. On a defect class A_{il}
it equals ftilde(S) times the fixed positive constant, depending only on i,l,
that makes the weight agree with f at the transversal K; this is well
defined because on A_{il} the ftilde values are proportional to f(K) times
capacity factorials, and the constant cancels in every stationary
probability and every acceptance ratio. Write Lambda for the total mass of
this weight on X.

The chain holds with probability 1/2. Otherwise it chooses independently a
uniform element of S and a uniform element of E minus S and proposes their
exchange. A proposal outside X is rejected; a proposal S' in X is accepted
with probability min(1, lambda(S')/lambda(S)). Write P for this kernel. A
defect state reaches a transversal by moving an element of its full pair to
its empty pair, and transversals are connected by flips within pairs, so
positivity makes P irreducible. The chain is lazy and reversible with
Dirichlet form
  E_P(g) = < g, (I - P) g >_pi = D(g) / (2 p^2 Lambda),
  D(g) = sum over unordered exchange edges {S,S'} of
         min(lambda(S), lambda(S')) (g(S) - g(S'))^2.
Let Qg agree with g at each transversal and replace its values on each defect
class by their conditional pi-mean.

Proposition (companion transport and simulation input). Suppose f is
positive on all p-subsets and has the omission property, ftilde is positive
there and has the addition property, the two weights agree on A, and
q^{-1} f <= ftilde <= q f with q >= 1. For good multipliers put
  C_p = p (1 + 8 p q^2),  C_d = 8 + 32 p q^3,
  K_obs = 10 p^4 (9 C_p + 2 C_d).
Then for every real function g on X,
  C Var_mu(g) <= C_p D(g),
  Var_pi(Qg) <= (9 C_p + 2 C_d) D(g)/C <= K_obs E_P(g).
If QG = G and an initial law satisfies nu <= D pi pointwise, then m >= 1
consecutive observations satisfy
  E_nu[ ( m^{-1} sum_{t=0}^{m-1} G(S_t) - E_pi G )^2 ]
     <= (2 D K_obs / m) Var_pi(G).
The trace on A, counting every strictly positive return as one step, is lazy
and reversible with stationary law mu and inverse spectral gap at most
2 p^2 C_p <= K_obs. In particular
  | P_tr^t(x,y)/mu(y) - 1 | <= mu_min^{-1} exp(-t/K_obs).

Proof of the transport proposition. These are the transport, observable,
and trace statements of the cell-bounded companion, with q left as the
comparison parameter in their proofs. Their structural inputs are the
companion's one-hole transport lemma and its pair inequalities for defect
masses. This paragraph spells out why the stated hypotheses are the
complete interface; the companion proves the estimates themselves.

For a partial transversal assignment sigma, let z_sigma be its transversal
mass and let ctilde^sigma_{il} be the mass of its extensions in A_{il}
under ftilde. Binary contraction, including the full-index cubic
contraction clause of the companion, and the addition property give
  4 ctilde^sigma_{il} ctilde^sigma_{li} <= z_sigma^2,
  ctilde^sigma_{il} ctilde^sigma_{lk}
     <= z_sigma ctilde^sigma_{ik},  i,l,k distinct and unassigned.
Agreement on transversals identifies z_sigma for the two weights. The
omission property supplies one-hole transport for f, including its
auxiliary displays outside X; this is why positivity and the signature are
required on all p-subsets. Comparison on the actual defect classes costs q^2
in the transversal variance bound and q^3 in the defect-mean bound, giving
exactly C_p and C_d above.

The variance inequalities give the stated Poincare bound for the operator Q
and the mean-squared error of a time average at most 2 D K_obs Var_pi(G)/m.
Reversibility and laziness of the trace on A give the trace mixing bound.
The remaining observable and trace arguments use only these inequalities,
reversibility, and laziness, and impose no condition on the origin of the
count weight. This is the two-lift form of the transport, observable
Poincare, and trace-restart framework of the matroid companion.

The weight log bound gives | log h | <= N^60000, and the port model gives
both integer signatures for h^s at every 0 <= s <= 1. Choose
  U = N^61000,  H_o = 10 U,  K_o = 10 (p + U + 1),
  k_j = (2^{-U} h)^{j/H_o},  0 <= j <= H_o.
Apply the counting-lifts lemma to k_j, obtaining f_j and ftilde_j, and let
C_j and c_{il}(j) be their transversal and defect masses. The counting-lifts
lemma verifies every structural hypothesis of the transport proposition at
every phase, with q = (p+1)^2, and in particular
  C_{H_o} = 2^{-U} Z_port,
because k_j is proportional to h at j = H_o.

The initial weight f_0 is transparent: a transversal leaves every coordinate
unspecified and the omitted positions carry equal factorials. Put
  y = 2^{-U} / (product over v of d_v!),  alpha_{il} = product over v of
  [(d_v - 1)!]^{-1}.
The function f_0 equals alpha_{il} y on each A_{il} and y on A. It has both
integer signatures, its omission property, maximality, and transversal
normalization. Since each (d_v - 1)! divides d_v! for d_v >= 1, every
y' satisfies f_0(y') <= (1/C_0) product over v of
[(d_v + 1) binom(d_v, a_v)]^{-1} <= (1/C_0) f_0(S) for S in A. The
displayed maximality uses d_v! <= (R+1) d_v (d_v - 1)!.

For a defect state S with hole at i and full pair at l, a label set F
selecting one or both copies in each of the first two pairs and exactly one
in every other pair leaves a transversal value f_0(y'). Summing its weight
over F and then over y' gives f_0(S) = alpha_{il}^{-1} y times the number
of admissible y', and positivity gives
  f_0(S) >= (1/C_0) product over v of [(d_v + 1) binom(d_v, a_v)]^{-1}
           >= (1/C_0) f_0(S).
The multipliers are initialized at
  w_{il}^{(0)} = alpha_{il}^{-1},
and the first phase uses the exact law k_0, whose diagonal observations are
explicit. Correctness of these formulas is asserted here and used below only
through the two comparisons just displayed and the transversal
normalization f_0(S)/C_0 = product over v of
[(d_v + 1) binom(d_v, a_v)]^{-1} for S in A.

The next experiment uses exact real transition probabilities only for its
analysis; the finite implementation follows. Use the transport constants
with q = (p+1)^2 and choose
  eps_0 = eps/100,  eta = eps_0/(200 (H_o + 1)),
  tau = 2 K_obs (H_o + p + K_o + 5),
  B_ret = 2000 p^2 (H_o + 1)^2 tau,
  N_av = ceil( 10^8 p^8 K_obs (H_o + 1) / eta^2 ).
Write P_{j,w} for the chain at phase j and multiplier collection w. Starting
from the initial multipliers, perform the following for j = 0,...,H_o - 1.

(1) Draw a fresh transversal from mu_0. For a = 1,...,j run tau trace steps
of P_{a,w^(a)}, continuing from the transversal reached at the preceding
stage; each trace step ends at the next transversal after at least one
underlying transition, and holding at a transversal counts as a return. Allow
at most B_ret underlying transitions across the entire restart; if another is
needed, abort and return zero. When j = 0 the fresh mu_0 draw is the restart
endpoint.

(2) From that endpoint take N_av consecutive observations of P_{j,w^(j)},
including the initial state. Label the transversal type by 0 and the other
types by il. Let n_T be the number of observations of type T and set
p_T-hat = n_T/N_av. Also compute the empirical mean u_j-hat of
  G_j(S) = 1_A(S) f_{j+1}(S)/f_j(S).
If any type count is zero, abort and return zero.

(3) Set R_j-hat = u_j-hat/p_0-hat and, if j+1 < H_o, store the exact
rational updates
  w_il^(j+1) = w_il^(j) n_0/n_il.
All randomness in a phase, including its initial sample, is fresh. If no
abort occurs, return Y_ref = C_0 product over j of R_j-hat. The multipliers in
a restart have already been stored by earlier phases.

Proposition (counting reference). With probability at least 1 - 1/50 this
experiment does not abort, every stored multiplier collection is good at its
own phase, and
  | log ( Y_ref / C_{H_o} ) | <= 4 H_o eta.

Proof. A restart begins from a fresh draw with law mu_0. By the trace mixing
bound, after j tau steps every transversal is reached with probability
within mu_min^{-1} exp(-tau/K_obs) of stationarity, and the virtual endpoint
has law at most 2 mu_j, hence at most 10 p^2 pi_{j,w^(j)} on A. Under this
stationary law, let p_T be the type probabilities and u_j = E_pi G_j. Direct
summation gives
  u_j/p_0 = C_{j+1}/C_j,  w_il^(j) p_0/p_il = C_j/c_il(j).
The type indicators and G_j take values in [0,1] and have means at least
(20 p^2)^{-1}. The mean squared error of each average is at most
20 p^2 K_obs/N_av, and there are p(p-1)+2 <= 2 p^2 observables. Markov's
inequality on their squared errors and a union bound show that the
probability some empirical mean has relative error greater than eta is at
most
  16000 p^8 K_obs / (N_av eta^2) <= 1/(100 (H_o + 1)).
These estimates concern the uncapped virtual phase; on the event that its
cost meets the cap it agrees with the capped phase, and failure of the latter
is contained in the union of the two failure events just bounded. No
endpoint law is conditioned on meeting a cap.

On empirical success every type count is positive. The displayed identities
show that the update estimates the current ideal multiplier directly, with
factor error at most (1+eta)/(1-eta) <= 2, and its ideal value changes by at
most a further factor two for the next phase, so the multipliers are good
there. The same empirical bounds give
  | log ( R_j-hat / (C_{j+1}/C_j) ) | <= 4 eta.
The initial multipliers are ideal. Summing the probabilities of the first
unsuccessful phase bounds total failure by 2 H_o/[100(H_o+1)] < 1/50. On
success the ratios telescope and their log errors sum to the displayed
bound.

To turn the experiment into an algorithm put
  J_* = 100 (H_o + 1) (B_ret + N_av + p + 2n + 1),
  xi = eta / (10000 (J_* + 1)).
To evaluate k_j, call the weight evaluator freshly for h^{j/H_o} with
relative tolerance xi/4 and failure probability xi; approximate the known
factor 2^{-Uj/H_o} = 2^{-j/10} deterministically to relative error xi/4 by
rational bisection of the tenth root of 2^{-j}, whose endpoints have
O(j + log xi^{-1}) bits. The product is a positive rational evaluation of
k_j with relative error at most xi and failure probability at most xi;
multiplying by the exact factorial factor evaluates f_j. Fresh evaluations
are used for the two weights in each valid proposed Metropolis ratio and in
each positive observation of G_j. The multipliers and type-count updates
remain exact rationals. Each acceptance ratio is capped at one and realized
by a downward-rounded dyadic threshold with ceil(log_2(1/xi)) bits, and the
half-hold uses one exact fair bit.

Every other finite uniform draw is implemented as follows. To draw from
{0,...,v-1}, choose a uniform b-bit integer Y with 2^b >= v/xi and return
floor(vY/2^b); each output has floor(2^b/v) or ceil(2^b/v) preimages, so its
total variation distance from uniform is at most v/2^b <= xi. For a subset of
size a_v use v = binom(d_v, a_v) and decode its index by successive binomial
inclusion and exclusion counts, in at most d_v decisions. Thus
initialization needs two finite draws per port and each proposal needs two
finite draws, with no rejection loop.

Lemma (bounded bits). The implemented experiment has deterministic
polynomial bounds on oracle calls, bit operations, and output length on
every execution. It can be coupled to the capped reference experiment so
that, except with probability at most 20 J_* xi, all states, type counts,
multiplier updates, and cap decisions coincide, every weight evaluation
meets its tolerance, and each positive observed ratio differs from its
reference value by log error at most 4 xi.

Proof. There are at most T_max = H_o (B_ret + N_av) underlying transitions,
each requiring at most two weight calls and four outer draws (hold, two
proposal choices, and acceptance). The observations require at most
2 H_o N_av further calls, and the restarts at most 2 H_o |P| initialization
draws. Including transition counts, the number of elementary actions is at
most
  7 T_max + 2 H_o N_av + 2 H_o |P| < J_*.
Counter initialization and arithmetic on all defect multipliers add only
deterministic polynomial work. With a fresh weight call on every action, a
union bound over the at most J_* calls bounds the total failure probability
by J_* xi, and the total variation bound on each finite draw bounds by
J_* xi the variation distance for coupling all draws to exact uniform
choices. On this coupling event, acceptance is decided by comparison with
the reference threshold; if the reference accepts and the implemented chain
does not, the difference is at most xi, so no such discrepancy occurs. The
sequences of states, counts, multipliers, and cap decisions therefore
coincide. The bounds on observed ratios use two fresh evaluations, whose
combined relative error is at most 1 + 4 xi, so the log error is at most
4 xi.

The sizes of the stored multipliers are controlled without any accuracy
assumption. On a nonaborting history
  w_il^(a) = w_il^(0) product over j < a of n_0^(j)/n_il^(j),
  1 <= n_T^(j) <= N_av.
Thus each numerator and denominator has at most its initial bit length plus
H_o ceil(log_2(N_av + 1)) bits, up to a fixed additive constant, even without
fraction reduction. A zero count causes an abort before division, so the
acceptance thresholds have polynomial-length operands on every history.
Adding at most N_av positive rational observations using a product
denominator, and multiplying at most H_o phase estimates, also creates only
polynomial-length integers, including the cost of writing the rational
output. All outer loops have the specified caps, all evaluator loops are
bounded, and every random draw uses finitely many fair bits, so the resource
conclusions hold independently of successful coupling, good multipliers, and
statistical accuracy.

Completion of the proof of the main theorem. First perform the exact
feasibility test; its integrality guarantee makes an empty real intersection
equivalent to Z = 0, in which case the algorithm returns zero on every
execution. If R = 0 the only feasible vector is zero and the algorithm
returns one, including the case n = 0. In all other feasible cases perform
the partition and port constructions.

If p >= 1, let Y be the implemented ratio product. By the two counting
propositions, outside an event of probability at most 1/50 + 20 J_* xi < 1/4
the run does not abort and
  | log ( Y / C_{H_o} ) | <= 4 H_o (eta + xi) < eps/100.
The multiplicative bounds on each positive observation persist under
summation, while the type counts agree exactly. Restore the scale by setting
Zhat_port = 2^U Y. If p = 0, evaluate the sole count profile directly with
relative tolerance eps/100 and failure probability 1/16, which gives
| log ( Zhat_port / Z_port ) | <= eps/50 on success; this branch invokes none
of the p-dependent chain parameters. When p = 1 the chain proof already
applies, since there are no defect classes or multipliers and every state is
a transversal.

Obtain the deterministic positive rational estimate Jhat with
| log ( Jhat / J ) | <= N^{-7} and output, for this run,
Zhat = Zhat_port / Jhat; aborted runs output zero. On the success event in
either branch the port comparison gives
  | log ( Zhat / Z ) | <= eps/50 + 101 N^{-7} < eps/10.
Here N >= 10^10 and N >= eps^{-1}, so 101 N^{-7} <= 101 eps N^{-6} < eps/100.
For 0 < eps < 1 the inequalities exp(-eps/10) >= 1 - eps and
exp(eps/10) <= 1 + eps hold, so a single run has the required relative
accuracy with probability greater than 3/4.

For the requested failure probability let s_delta = ceil(log_2(delta^{-1}))
and take m_delta = 10 s_delta + 1 independent runs, returning their median.
If F is their number of failures, independence gives E 2^F <= (5/4)^(m_delta).
A bad median requires at least m_delta/2 failures, so
  P(bad median) <= (5/(4 sqrt 2))^(10 s_delta + 1) <= 2^{-s_delta} <= delta.
The middle inequality uses (5/(4 sqrt 2))^10 < 1/2. Exact comparison of the
rational outputs and median selection have polynomial bit cost.

Finally N = 10^10 + n + ell + ceil(eps^{-1}) is bounded by a fixed polynomial
in the parameters of the theorem. All construction, evaluation, and counting
bounds are fixed polynomials in N and the input encoding length, and
multiplying by m_delta = O(1 + log delta^{-1}) gives the required separate
bounds on rank-oracle calls and other bit operations on every execution,
including reading answers, writing queries and output, and generating random
bits. The only explicitly constructed labelled set has 2p elements, with p
bounded by the short port ranges; the large expansion matroids, geometric
subdivisions, and transport flows are proof devices and are never constructed
or queried. This completes the algorithm, its approximation proof, and its
bit-complexity proof.