  This is the fourth in a series of papers where we prove a conjecture of Deser
and Schwimmer regarding the algebraic structure of ``global conformal
invariants''; these are defined to be conformally invariant integrals of
geometric scalars. The conjecture asserts that the integrand of any such
integral can be expressed as a linear combination of a local conformal
invariant, a divergence and of the Chern-Gauss-Bonnet integrand.
  The present paper lays out the second half of this entire work: The second
half proves certain purely algebraic statements regarding local Riemannian
invariants; these were used extensively in [3,4]. These results may be of
independent interest, applicable to related problems.
