# How come the cross-sectional CAPM equation produces $N$ moment conditions (not $1$)?

Reading Cochrane "Asset Pricing" (2005) section 12.2 (p. 241), I got lost in the derivation of the GMM estimator for the single-factor model. Equation $$(12.23)$$ says the moments are $$g_T(b) = \begin{bmatrix} E(R^e_t-a-\beta f_t) \\ E[(R^e_t-a-\beta f_t)f_t] \\ E(R^e-\beta \lambda) \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \tag{12.23}$$ where $$R^e_t=(R^e_{1,t},\dots,R^e_{N,t})'$$ is a vector of individual assets' excess returns, $$\beta=(\beta_1,\dots,\beta_N)'$$ is a vector of betas, $$f_t$$ is factor's excess return and $$\lambda=E(f)$$ is the expected value of the factor's excess return. The first two rows correspond to time series regressions for $$N$$ assets (one regression per asset), so there are actually $$2N$$ conditions. If I understand correctly, the third row corresponds to a cross-sectional regression of time-averaged returns. It is a single equation (scalar dependent variable) $$E_T(R^{ei})=\beta_i' \lambda+\alpha_i, \quad i=1,2,\dots,N. \tag{12.10}$$ ($$(12.10)$$ is specified for potentially many factors, but $$(12.23)$$ considers the simple case of a single factor, so vector $$\beta'$$ turns into scalar $$\beta$$, and the same holds for $$\lambda$$.)

That should add one moment condition. However, the textbook says it adds $$N$$ moment conditions. How does that happen?

A related question is "GMM estimation of the CAPM: why not include sample mean of the market excess return as a moment?".

This is simple. While $$(12.10)$$ is indeed a single equation, the third row of $$(12.23)$$ combines $$N$$ copies of $$(12.10)$$, one of each asset. Thus, $$R^e$$ and $$\beta$$ are both vectors of $$N$$ elements, and the result is $$N$$ conditions.