Solution (source code)

= Solution

For the <normal linear model>, differentiating the <ordinary least squares> objective gives $X^TX\widehat\beta=X^TY$. Full column <rank> makes $X^TX$ invertible, so
$$
 \boxed{\widehat\beta=(X^TX)^{-1}X^TY,\qquad
 \widehat\beta\sim N_p\left(\beta,\sigma^2(X^TX)^{-1}\right).}
$$
The distribution follows because $\widehat\beta=\beta+(X^TX)^{-1}X^T\varepsilon$ is a linear transformation of a <multivariate normal distribution>. Its <expectation> is $\beta$, and direct multiplication gives the displayed <covariance matrix>.

Let $H=X(X^TX)^{-1}X^T$, the orthogonal projection onto the design's column space. The <residual sum of squares> is $RSS=\|Y-X\widehat\beta\|^2=Y^T(I-H)Y$. Since $(I-H)X\beta=0$, symmetry and idempotence give $\mathbb E[RSS]=\sigma^2\operatorname{tr}(I-H)=(n-p)\sigma^2$. Thus
$$
 \boxed{\widehat\sigma^2=\frac{RSS}{n-p}}
$$
is an <unbiased estimator>.

For the two independent regressions choose $\beta=(a,b,c,d)^T$. The first $m$ rows of the <design matrix> are $(1,u_i,0,0)$ and the last $m$ rows are $(0,0,1,w_i)$. The centering conditions and distinct predictors give
$$
 X^TX=\operatorname{diag}(m,S_u,m,S_w),\qquad
 S_u=\sum_i u_i^2>0,\quad S_w=\sum_i w_i^2>0.
$$
It follows that
$$
 \boxed{\widehat a=\overline V,\quad\widehat b=\frac{\sum_i u_iV_i}{S_u},\quad
 \widehat c=\overline Z,\quad\widehat d=\frac{\sum_i w_iZ_i}{S_w}.}
$$
The two estimated slopes are independent <normal random variables>, as they depend on independent error blocks. Therefore
$$
 \boxed{\widehat b-\widehat d\sim N\left(b-d,\sigma^2\left(\frac1{S_u}+\frac1{S_w}\right)\right).}
$$
For these data use the pooled <residual sum of squares>
$$
 RSS=\sum_i(V_i-\widehat a-\widehat b u_i)^2
 +\sum_i(Z_i-\widehat c-\widehat d w_i)^2,\qquad s^2=\frac{RSS}{2m-4}.
$$
Its scaled value is $\chi^2_{2m-4}$ and is independent of the slope estimates by the permitted normal-model result. Hence the standardized difference has a <Student t-distribution> with $2m-4$ degrees of freedom, giving the exact \b[95 percent confidence interval]
$$
 \boxed{(\widehat b-\widehat d)\ \pm\ t_{2m-4,\,0.975}\,
 s\sqrt{\frac1{S_u}+\frac1{S_w}}.}
$$
Here $t_{\nu,0.975}$ is the 0.975 <quantile> of that distribution. This is a <confidence interval for the difference of independent regression slopes>. As required by the original $p<n$ framework, this specialization needs $m>2$. Distinct predictors alone allow $m=2$, but then the fit is saturated, $RSS=0$ and there are no residual degrees of freedom to estimate the unknown variance or form this interval.