Solution (source code)

= Solution

Insert the <Breslow estimator> into the fitted cumulative intensities and interchange the finite sums:
$$
\begin{aligned}
\sum_{i=1}^n e^{\widehat\beta z_i}\widehat H_0(x_i)
&=\sum_{i=1}^n e^{\widehat\beta z_i}
\sum_{\ell:x_\ell\leq x_i}\frac{v_\ell}{\sum_{j:x_j\geq x_\ell}e^{\widehat\beta z_j}}\\
&=\sum_{\ell=1}^n
\frac{v_\ell\sum_{i:x_i\geq x_\ell}e^{\widehat\beta z_i}}
{\sum_{j:x_j\geq x_\ell}e^{\widehat\beta z_j}}
=\sum_{\ell=1}^n v_\ell.
\end{aligned}
$$
Every observed event contributes exactly one after summing its fitted contribution over its <risk set>. Therefore
$$
\boxed{\sum_{i=1}^n y_i=\sum_i v_i-\sum_i e^{\widehat\beta z_i}\widehat H_0(x_i)=0.}
$$
This identity is algebraic and holds for any finite coefficient used consistently in the relative hazards and the <Breslow estimator>; it does not require the <score equation> to be solved exactly. It can fail if the <baseline hazard> is estimated or smoothed by a different procedure.