Question 1
If there are $k=1$ factors (i.e. a single factor):
- $\beta$ is a vector (a single-column matrix),
- $(\beta^{'}\beta)^{-1}\beta^{'}\Sigma\beta(\beta^{'}\beta)^{-1}$ is a scalar,
- $\lambda^{'}\Sigma_{f}^{-1}\lambda$ is a scalar and thus
- $(\beta^{'}\beta)^{-1}\beta^{'}\Sigma\beta(\beta^{'}\beta)^{-1}(1+\lambda^{'}\Sigma_{f}^{-1}\lambda)$ is a scalar, matching
- $\Sigma_{f}$ that is a scalar.
If there are $k>1$ factors:
- $\beta$ is a $k$-column matrix,
- $(\beta^{'}\beta)^{-1}\beta^{'}\Sigma\beta(\beta^{'}\beta)^{-1}$ is a matrix
- $\lambda^{'}\Sigma_{f}^{-1}\lambda$ is a scalar and thus
- $(\beta^{'}\beta)^{-1}\beta^{'}\Sigma\beta(\beta^{'}\beta)^{-1}(1+\lambda^{'}\Sigma_{f}^{-1}\lambda)$ is a matrix, matching
- $\Sigma_{f}$ that is a matrix.
The dimensions seem to match in both cases.
Question 2
See the summary of Shanken (1992) laid out nicely in this answerthis answer on Cross Validated. It seems Cochrane's (2005) treatment omits some details, and the equation you give is not considered explicitly by Cochrane.