I was reading the proof of $$Cov(X, Y) = E[X \cdot Y^T] - E[X] \cdot (E[Y])^T$$ but there's a step (at least) that I don't understand.
The proof is the following:
The $(i, j)$ entry of $E[X \cdot Y^T] - E[X] \cdot (E[Y])^T$ is $E[X_i \cdot Y_j] - E[X_i] \cdot E[Y_j]$, which by the standard computational formula, is $Cov(X_i,Y_j)$, which in turn is the $(i,j)$ entry of $Cov(X,Y)$.
Why $E[X_i \cdot Y_j] - E[X_i] \cdot E[Y_j]$ is $Cov(X_i,Y_j)$?
Let $\mathbf{X}$ and $\mathbf{Y}$ be $n \times 1$ random vectors, i.e., $$\mathbf{X} = \begin{bmatrix} X_1 \\ X_2 \\ \vdots \\ X_n \end{bmatrix}, \quad \mathbf{Y} = \begin{bmatrix} Y_1 \\ Y_2 \\ \vdots \\ Y_n \end{bmatrix}$$ Then we have that $$\mathbf{X}\mathbf{Y}^T = \begin{bmatrix} X_1Y_1 & X_1Y_2 &\cdots & X_1Y_n \\ X_2Y_1 & X_2Y_2 & \cdots & X_2Y_n \\ \vdots & \vdots & \ddots & \vdots \\ X_nY_1 & X_nY_2 & \cdots & X_nY_N \end{bmatrix}$$ And hence $$\mathbb{E}[\mathbf{X}\mathbf{Y}^T] = \begin{bmatrix} \mathbb{E}[X_1Y_1] & \mathbb{E}[X_1Y_2] &\cdots & \mathbb{E}[X_1Y_n] \\ \mathbb{E}[X_2Y_1] & \mathbb{E}[X_2Y_2] & \cdots & \mathbb{E}[X_2Y_n] \\ \vdots & \vdots & \ddots & \vdots \\ \mathbb{E}[X_nY_1] & \mathbb{E}[X_nY_2] & \cdots & \mathbb{E}[X_nY_N] \end{bmatrix}$$ Moreover, $$\mathbb{E}[\mathbf{X}]\mathbb{E}[\mathbf{Y}]^T = \begin{bmatrix} \mathbb{E}[X_1]\mathbb{E}[Y_1] & \mathbb{E}[X_1]\mathbb{E}[Y_2] &\cdots & \mathbb{E}[X_1]\mathbb{E}[Y_n] \\ \mathbb{E}[X_2]\mathbb{E}[Y_1] & \mathbb{E}[X_2]\mathbb{E}[Y_2] & \cdots & \mathbb{E}[X_2]\mathbb{E}[Y_n] \\ \vdots & \vdots & \ddots & \vdots \\ \mathbb{E}[X_n]\mathbb{E}[Y_1] & \mathbb{E}[X_n]\mathbb{E}[Y_2] & \cdots & \mathbb{E}[X_n]\mathbb{E}[Y_N] \end{bmatrix}$$ Which yields \begin{align*}\mathbb{E}[\mathbf{XY}^T] - \mathbb{E}[\mathbf{X}]\mathbb{E}[\mathbf{Y}]^T &= \begin{bmatrix} \mathbb{E}[X_1Y_1] - \mathbb{E}[X_1]\mathbb{E}[Y_1]& \mathbb{E}[X_1Y_2] - \mathbb{E}[X_1]\mathbb{E}[Y_2]&\cdots & \mathbb{E}[X_1Y_n] - \mathbb{E}[X_1]\mathbb{E}[Y_n] \\ \mathbb{E}[X_2Y_1] - \mathbb{E}[X_2]\mathbb{E}[Y_1]& \mathbb{E}[X_2Y_2] - \mathbb{E}[X_2]\mathbb{E}[Y_2]& \cdots & \mathbb{E}[X_2Y_n] -\mathbb{E}[X_2]\mathbb{E}[Y_n]\\ \vdots & \vdots & \ddots & \vdots \\ \mathbb{E}[X_nY_1] - \mathbb{E}[X_n]\mathbb{E}[Y_1]& \mathbb{E}[X_nY_2] - \mathbb{E}[X_n]\mathbb{E}[Y_2]& \cdots & \mathbb{E}[X_nY_N] - \mathbb{E}[X_n]\mathbb{E}[Y_n]\end{bmatrix} \\ &= \begin{bmatrix} \operatorname{Cov}[X_1,Y_1] & \operatorname{Cov}[X_1,Y_2] & \cdots & \operatorname{Cov}[X_1,Y_n] \\ \operatorname{Cov}[X_2,Y_1] & \operatorname{Cov}[X_2,Y_2] & \cdots & \operatorname{Cov}[X_2,Y_n] \\ \vdots & \vdots & \ddots & \vdots \\ \operatorname{Cov}[X_n,Y_1] & \operatorname{Cov}[X_n,Y_2] & \cdots & \operatorname{Cov}[X_n,Y_n]\end{bmatrix} \\ &\overset{\text{def}}{=}\operatorname{Cov}[\mathbf{X},\mathbf{Y}] \end{align*}