[proofplan]
We prove cofactor expansion along column $j$. Express the $j$th column as $A^{(j)} = \sum_{i=1}^n A_{ij}\, e_i$ and use multilinearity of the determinant to distribute. Each resulting determinant has the standard basis vector $e_i$ in position $j$; we evaluate it by moving $e_i$ to position $(1,1)$ via $i + j - 2$ adjacent transpositions and reading off the minor. The row expansion formula follows by applying the column formula to $A^\top$.
[/proofplan]
[step:Distribute the $j$th column using multilinearity]
Since $A^{(j)} = \sum_{i=1}^n A_{ij}\, e_i$ and $\det$ is multilinear in the columns:
\begin{align*}
\det A = \det(A^{(1)}, \dots, A^{(j-1)}, \sum_{i=1}^n A_{ij}\, e_i, A^{(j+1)}, \dots, A^{(n)}) = \sum_{i=1}^n A_{ij}\, \det(A^{(1)}, \dots, A^{(j-1)}, e_i, A^{(j+1)}, \dots, A^{(n)}).
\end{align*}
[/step]
[step:Evaluate the determinant with $e_i$ in column $j$ by row and column transpositions]
[claim:Single Standard Basis Vector]
$\det(A^{(1)}, \dots, A^{(j-1)}, e_i, A^{(j+1)}, \dots, A^{(n)}) = (-1)^{i+j} \det \hat{A}_{ij}$.
[/claim]
[proof]
Let $B$ be the $n \times n$ matrix with $e_i$ in column $j$ and all other columns unchanged from $A$. Move column $j$ (which is $e_i$) to position $1$ using $j - 1$ adjacent column swaps; each swap introduces a factor of $-1$, contributing $(-1)^{j-1}$.
After this rearrangement, the first column is $e_i$, which has a single $1$ in row $i$ and zeros elsewhere. Move row $i$ to position $1$ using $i - 1$ adjacent row swaps, contributing $(-1)^{i-1}$.
The resulting matrix has $1$ in position $(1,1)$ and zeros in the rest of the first row and first column. Its determinant equals $1 \cdot \det \hat{A}_{ij}$ (expansion along the first column, which has only one non-zero entry). The total sign is $(-1)^{(j-1)+(i-1)} = (-1)^{i+j-2} = (-1)^{i+j}$.
[/proof]
[guided]
We need to evaluate $\det B$ where $B$ has $e_i$ in column $j$ and all other columns from $A$. The idea is to rearrange $B$ so that the standard basis vector sits in position $(1,1)$, where it contributes a factor of $1$ and the determinant reduces to the $(n-1) \times (n-1)$ minor.
First, move column $j$ to position $1$ by $j-1$ adjacent column swaps. Each swap changes the sign of the determinant by $-1$, so we pick up $(-1)^{j-1}$. Now $e_i$ is in column $1$: it has a $1$ in row $i$ and zeros elsewhere. Next, move row $i$ to position $1$ by $i-1$ adjacent row swaps, picking up $(-1)^{i-1}$. Now the $(1,1)$-entry is $1$, and the rest of column $1$ and row $1$ (from the original $e_i$) are zero.
Expanding along column $1$ gives $\det = 1 \cdot \det(\text{bottom-right } (n-1) \times (n-1) \text{ block})$. This block is precisely $\hat{A}_{ij}$ (the matrix $A$ with row $i$ and column $j$ deleted, with rows and columns reordered — but the determinant is invariant under the reordering that corresponds to reversing the transpositions we applied to the other rows/columns). The total sign is $(-1)^{(i-1)+(j-1)} = (-1)^{i+j}$.
[/guided]
[/step]
[step:Assemble the cofactor expansion formula and derive the row version]
Substituting the claim:
\begin{align*}
\det A = \sum_{i=1}^n A_{ij}\, (-1)^{i+j} \det \hat{A}_{ij} = \sum_{i=1}^n (-1)^{i+j}\, A_{ij}\, \det \hat{A}_{ij}.
\end{align*}
This is cofactor expansion along column $j$, valid for any $j \in \{1, \dots, n\}$.
The row expansion formula $\det A = \sum_{j=1}^n (-1)^{i+j}\, A_{ij}\, \det \hat{A}_{ij}$ (for any fixed $i$) follows by applying the column expansion to $A^\top$ and using $\det A^\top = \det A$ from [Determinant Transpose Invariance](/theorems/394): expansion along column $i$ of $A^\top$ is the same as expansion along row $i$ of $A$.
[/step]