  We provide a step towards classifying Riemannian four-manifolds in which the
curvature tensor has zero divergence, or -- equivalently -- the Ricci tensor
Ric satisfies the Codazzi equation. Every known compact manifold of this type
belongs to one of five otherwise-familiar classes of examples. The main result
consists in showing that, if such a manifold (not necessarily compact or even
complete) lies outside of the five classes -- a non-vacuous assumption -- then,
at all points of a dense open subset, Ric has four distinct eigenvalues, while
suitable local coordinates simultaneously diagonalize Ric, the metric and, in a
natural sense, also the curvature tensor. Furthermore, in a local orthonormal
frame formed by Ricci eigenvectors, the connection form (or, curvature tensor)
has just twelve (or, respectively, six) possibly-nonzero components, which
together satisfy a specific system, not depending on the point, of homogeneous
polynomial equations. A part of the classification problem is thus reduced to a
question in real algebraic geometry.
