Leibniz Permutation Formula

How can a single number, computed from the entries of a square matrix, detect whether that matrix is invertible? The determinant answers this question. But its usual introduction through row operations or an inductive cofactor expansion can obscure what the determinant actually is as a function of the entries. The Leibniz formula removes the obscurity. It exhibits the determinant as one explicit finite sum. This sum runs over every permutation of the column indices, of signed products of entries. This formula matters for an important reason. It is the bridge between the abstract characterization of the determinant and a concrete polynomial expression. The abstract characterization is the unique alternating, multilinear, normalized function of the rows. The concrete expression is one that anyone can compute, differentiate, or manipulate symbolically. It shows immediately why the determinant is a polynomial in the entries with integer coefficients. It also shows why the determinant commutes with transpose. Further, it shows why the number of terms explodes combinatorially (n!n! terms for an n×nn\times n matrix). This explains both its theoretical elegance and its practical uselessness as an algorithm for large nn. The big picture: determinants can be approached from three directions that must ultimately agree. One is axiomatic (alternating multilinear normalized function of rows). One is recursive (cofactor/Laplace expansion). One is combinatorial (the Leibniz sum). This article proves something important. The axiomatic determinant, whose existence and uniqueness is assumed known, equals the Leibniz sum. This single identity unlocks all further computational tools. What this article delivers: a precise statement and complete proof of the Leibniz formula. This proof derives from the defining properties of the determinant. The article also gives a geometric picture of what a "permutation term" contributes. It includes two fully worked numerical examples on non-symmetric matrices. It offers a counterexample showing why the sign of the permutation cannot be dropped. Finally, it maps where this formula surfaces across mathematics and its applications.

Key takeaways
  • The determinant of an n×nn\times n matrix equals a sum over all n!n! permutations σ\sigma of {1,…,n}\{1,\dots,n\}.
  • Each term is sgn⁡(σ)\operatorname{sgn}(\sigma) times the product of entries a1σ(1)a2σ(2)⋯anσ(n)a_{1\sigma(1)}a_{2\sigma(2)}\cdots a_{n\sigma(n)}, one entry from each row and each column.
  • The formula is derived from multilinearity and alternation applied to the standard basis expansion of each row.
  • It proves the determinant is a polynomial in the entries, and that det⁡(A)=det⁡(AT)\det(A)=\det(A^T).
  • It generalizes cofactor expansion: expanding along a row groups the n!n! terms by the column chosen in that row.
  • Key idea: the determinant is the signed count, with multiplicities from matrix entries, of all ways to pick one entry per row and per column.

Where this lives today

The Leibniz formula underlies the theoretical definition of the determinant used throughout Existence and Uniqueness of the Determinant and directly explains why cofactor expansion (see Computing Determinants by Cofactor Expansion) works: expanding along a row is exactly grouping the n!n! Leibniz terms according to the value σ(1)\sigma(1) (or σ(i)\sigma(i) for any fixed row ii), factoring out the common entry aiσ(i)a_{i\sigma(i)}, and recognizing the remaining sum as a smaller (n−1)×(n−1)(n-1)\times(n-1) determinant. It also gives the cleanest proof that determinant is multiplicative in spirit, motivating Multiplicativity of the Determinant, since both det⁡(AB)\det(AB) and det⁡(A)det⁡(B)\det(A)\det(B) can be expanded and compared permutation-by-permutation. Beyond pure linear algebra, the formula appears in multivariable calculus as the Jacobian determinant governing change-of-variables in integrals, in differential geometry as the volume form on a manifold, and in combinatorics as the prototype relating determinants to permanents (relevant to counting perfect matchings in bipartite graphs). In physics, the Leibniz sum underlies the Slater determinant construction in quantum mechanics, encoding the antisymmetry (Pauli exclusion) of fermionic wavefunctions — the alternating sign structure is not incidental but is the mathematical expression of antisymmetrization. In computer science and cryptography, understanding the n!n! growth of the Leibniz sum explains why determinant computation is implemented via Gaussian elimination (O(n3)O(n^3)) rather than direct summation, and permanent computation (the unsigned analogue) is known to be #P-hard, a foundational result in computational complexity theory that hinges on exactly the contrast highlighted in the counterexample above.

Ask the tutor: How does grouping the Leibniz sum by one row's chosen column turn into the cofactor expansion formula, step by step?

DefinitionThe Leibniz Formula for the Determinant

Let A=(aij)A = (a_{ij}) be an n×nn \times n matrix over a field (or commutative ring) FF. Let SnS_n denote the symmetric group on {1,2,…,n}\{1,2,\dots,n\}, and for σ∈Sn\sigma \in S_n let sgn⁡(σ)∈{+1,−1}\operatorname{sgn}(\sigma) \in \{+1,-1\} denote its Sign of a permutation. The Leibniz formula asserts

det⁡(A)=∑σ∈Snsgn⁡(σ)∏i=1nai σ(i).\det(A) = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) \prod_{i=1}^n a_{i\,\sigma(i)}.

Each summand sgn⁡(σ) a1σ(1)a2σ(2)⋯anσ(n)\operatorname{sgn}(\sigma)\, a_{1\sigma(1)} a_{2\sigma(2)} \cdots a_{n\sigma(n)} is called a permutation term: it picks exactly one entry from each row ii, in column σ(i)\sigma(i), so that across all nn factors every row index 1,…,n1,\dots,n and every column index 1,…,n1,\dots,n appears exactly once.

Intuition

Think of choosing nn entries from the matrix, one per row, so that no two chosen entries share a column. Such a choice is precisely a bijection from rows to columns, i.e., a permutation σ\sigma: row ii contributes its entry in column σ(i)\sigma(i). Multiplying the nn chosen entries and summing over all such choices, with a sign attached to each choice according to how many transpositions the permutation represents, produces the determinant. The sign is not a bookkeeping nuisance; it is what makes the sum detect linear dependence. If two rows of AA are equal, the permutation terms pair up: for every σ\sigma there is a partner στ\sigma \tau (where τ\tau is the transposition swapping the two equal-row indices) contributing the same product but the opposite sign, so everything cancels. This cancellation is exactly the alternating property of the determinant, seen combinatorially. For n=2n=2, there are only 2!=22! = 2 permutations: the identity, contributing a11a22a_{11}a_{22} with sign +1+1, and the transposition (1 2)(1\,2), contributing a12a21a_{12}a_{21} with sign −1-1. This recovers the familiar formula det⁡A=a11a22−a12a21\det A = a_{11}a_{22} - a_{12}a_{21}.

Figure
The two permutation terms for a 2×2 matrix, shown as entry-selection patterns
σ = identity, sgn = +1 σ = (1 2), sgn = −1 a₁₁ a₁₂ a₂₁ a₂₂ +a₁₁a₂₂ a₁₁ a₁₂ a₂₁ a₂₂ −a₁₂a₂₁ det(A) = a₁₁a₂₂ − a₁₂a₂₁

Central theorem

TheoremLeibniz Expansion of the Determinant

Let FF be a field and let det⁡:Fn×n→F\det : F^{n\times n} \to F be the unique function satisfying: 1. Multilinearity: det⁡\det is linear in each row separately (fixing the other n−1n-1 rows). 2. Alternation: det⁡(A)=0\det(A) = 0 whenever two rows of AA are equal. 3. Normalization: det⁡(In)=1\det(I_n) = 1, where InI_n is the n×nn\times n identity matrix. (This function exists and is unique — see Existence and Uniqueness of the Determinant.) Then for every A=(aij)∈Fn×nA = (a_{ij}) \in F^{n\times n},

det⁡(A)=∑σ∈Snsgn⁡(σ)∏i=1nai σ(i).\det(A) = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) \prod_{i=1}^n a_{i\,\sigma(i)}.
Proof

We use the proof technique of expanding by multilinearity in each row against the standard basis, then invoking alternation to kill degenerate terms.

Step 1: Write each row in the standard basis. Let e1,…,ene_1,\dots,e_n be the standard basis vectors of FnF^n. Denote by Ri=(ai1,…,ain)R_i = (a_{i1},\dots,a_{in}) the ii-th row of AA. Then

Ri=∑j=1naij ej.R_i = \sum_{j=1}^n a_{ij}\, e_j .

Let D(R1,…,Rn):=det⁡(A)D(R_1,\dots,R_n) := \det(A) denote the determinant viewed as a function of the nn row vectors; this is legitimate since det⁡\det is defined on matrices, and a matrix is exactly an ordered nn-tuple of rows.

Step 2: Expand using multilinearity in the first row, then the second, and so on. By linearity in the first argument,

D(R1,R2,…,Rn)=D(∑j1=1na1j1ej1, R2,…,Rn)=∑j1=1na1j1 D(ej1,R2,…,Rn).D(R_1,R_2,\dots,R_n) = D\Big(\sum_{j_1=1}^n a_{1j_1}e_{j_1},\, R_2,\dots,R_n\Big) = \sum_{j_1=1}^n a_{1j_1}\, D(e_{j_1}, R_2,\dots,R_n).

Now expand R2R_2 in the second slot inside each term, and continue through all nn rows. Because DD is linear in each row independently (multilinearity, hypothesis 1, applied nn times, once per row), the fully expanded sum is

D(R1,…,Rn)=∑j1=1n∑j2=1n⋯∑jn=1na1j1a2j2⋯anjn D(ej1,ej2,…,ejn).D(R_1,\dots,R_n) = \sum_{j_1=1}^n \sum_{j_2=1}^n \cdots \sum_{j_n=1}^n a_{1j_1}a_{2j_2}\cdots a_{nj_n}\, D(e_{j_1}, e_{j_2}, \dots, e_{j_n}).

This is a sum over all functions j:{1,…,n}→{1,…,n}j : \{1,\dots,n\} \to \{1,\dots,n\}, i.e., over all nnn^n tuples (j1,…,jn)(j_1,\dots,j_n), not yet restricted to permutations.

Step 3: Alternation kills every non-injective tuple. Suppose (j1,…,jn)(j_1,\dots,j_n) is not injective, so jk=jlj_k = j_l for some k≠lk \neq l. Then the tuple of vectors (ej1,…,ejn)(e_{j_1},\dots,e_{j_n}) has two equal entries (the kk-th and ll-th, both equal to ejke_{j_k}). By hypothesis 2 (alternation), applied to the matrix whose rows are ej1,…,ejne_{j_1},\dots,e_{j_n},

D(ej1,…,ejn)=0.D(e_{j_1},\dots,e_{j_n}) = 0.

Hence every term in the sum from Step 2 with a repeated jkj_k vanishes. The only surviving terms are those where (j1,…,jn)(j_1,\dots,j_n) is a bijection {1,…,n}→{1,…,n}\{1,\dots,n\}\to\{1,\dots,n\}, that is, a permutation σ∈Sn\sigma \in S_n with ji=σ(i)j_i = \sigma(i) for all ii. Therefore

det⁡(A)=∑σ∈Sna1σ(1)a2σ(2)⋯anσ(n) D(eσ(1),eσ(2),…,eσ(n)).\det(A) = \sum_{\sigma \in S_n} a_{1\sigma(1)} a_{2\sigma(2)} \cdots a_{n\sigma(n)}\, D(e_{\sigma(1)}, e_{\sigma(2)}, \dots, e_{\sigma(n)}).

Step 4: Evaluate D(eσ(1),…,eσ(n))D(e_{\sigma(1)},\dots,e_{\sigma(n)}) using alternation and normalization. We show D(eσ(1),…,eσ(n))=sgn⁡(σ)D(e_{\sigma(1)},\dots,e_{\sigma(n)}) = \operatorname{sgn}(\sigma) for every σ∈Sn\sigma \in S_n. First, recall the standard fact (part of the theory of Sign of a permutation) that any permutation σ\sigma can be written as a product of transpositions, σ=τ1τ2⋯τm\sigma = \tau_1\tau_2\cdots\tau_m, and that sgn⁡(σ)=(−1)m\operatorname{sgn}(\sigma) = (-1)^m; while mm is not unique, its parity is, so (−1)m(-1)^m is well defined. Claim: swapping two rows of any matrix negates DD. Let BB be a matrix and let B′B' be obtained from BB by swapping rows kk and ll (k≠lk\ne l). Consider the matrix CC obtained from BB by replacing both row kk and row ll with Rk+RlR_k + R_l (i.e., every row equals Rk+RlR_k+R_l in positions k,lk,l). By alternation, det⁡(C)=0\det(C) = 0. Expand det⁡(C)\det(C) by multilinearity in rows kk and ll separately (all other rows fixed):

0=D(…,Rk+Rl,…,Rk+Rl,… )=D(…,Rk,…,Rk,… )+D(…,Rk,…,Rl,… )+D(…,Rl,…,Rk,… )+D(…,Rl,…,Rl,… ),0 = D(\dots, R_k+R_l, \dots, R_k+R_l, \dots) = D(\dots,R_k,\dots,R_k,\dots) + D(\dots,R_k,\dots,R_l,\dots) + D(\dots,R_l,\dots,R_k,\dots) + D(\dots,R_l,\dots,R_l,\dots),

where the first and fourth terms each have a repeated row, hence vanish by alternation. This leaves

0=D(…,Rk,…,Rl,… )+D(…,Rl,…,Rk,… ),0 = D(\dots,R_k,\dots,R_l,\dots) + D(\dots,R_l,\dots,R_k,\dots),

i.e., D(B)=−D(B′)D(B) = -D(B'), where B′B' is BB with rows k,lk,l swapped. This proves the claim. Now apply the claim inductively. The identity permutation gives D(e1,…,en)=D(In)=det⁡(In)=1D(e_1,\dots,e_n) = D(I_n) = \det(I_n) = 1 by hypothesis 3. If σ=τ1⋯τm\sigma = \tau_1\cdots\tau_m is a product of mm transpositions, then (eσ(1),…,eσ(n))(e_{\sigma(1)},\dots,e_{\sigma(n)}) is obtained from (e1,…,en)(e_1,\dots,e_n) by performing the mm corresponding row swaps (applying the transpositions to the row-index positions, in the appropriate order corresponding to how permutation composition acts on row slots). Each swap negates DD by the claim, so after mm swaps,

D(eσ(1),…,eσ(n))=(−1)m⋅D(e1,…,en)=(−1)m⋅1=(−1)m=sgn⁡(σ).D(e_{\sigma(1)},\dots,e_{\sigma(n)}) = (-1)^m \cdot D(e_1,\dots,e_n) = (-1)^m \cdot 1 = (-1)^m = \operatorname{sgn}(\sigma).

This value is independent of the particular factorization into transpositions since sgn⁡(σ)=(−1)m\operatorname{sgn}(\sigma) = (-1)^m is well-defined (a fact already established for the sign function, assumed known here).

Step 5: Conclude. Substituting the result of Step 4 into the sum from Step 3,

det⁡(A)=∑σ∈Snsgn⁡(σ) a1σ(1)a2σ(2)⋯anσ(n).\det(A) = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) \, a_{1\sigma(1)} a_{2\sigma(2)} \cdots a_{n\sigma(n)}.

This holds for an arbitrary matrix A∈Fn×nA \in F^{n\times n}, completing the proof. ■\blacksquare

∎
CorollaryTranspose invariance

For every A∈Fn×nA \in F^{n\times n}, det⁡(AT)=det⁡(A)\det(A^T) = \det(A).

Proof

Write AT=(bij)A^T = (b_{ij}) with bij=ajib_{ij} = a_{ji}. By the theorem,

det⁡(AT)=∑σ∈Snsgn⁡(σ)∏i=1nbiσ(i)=∑σ∈Snsgn⁡(σ)∏i=1naσ(i) i.\det(A^T) = \sum_{\sigma\in S_n} \operatorname{sgn}(\sigma) \prod_{i=1}^n b_{i\sigma(i)} = \sum_{\sigma \in S_n}\operatorname{sgn}(\sigma) \prod_{i=1}^n a_{\sigma(i)\,i}.

Reindex the product: set k=σ(i)k = \sigma(i), so i=σ−1(k)i = \sigma^{-1}(k), and as ii ranges over 1,…,n1,\dots,n so does kk (since σ\sigma is a bijection). Thus ∏i=1naσ(i) i=∏k=1nak σ−1(k)\prod_{i=1}^n a_{\sigma(i)\,i} = \prod_{k=1}^n a_{k\,\sigma^{-1}(k)}. Also sgn⁡(σ)=sgn⁡(σ−1)\operatorname{sgn}(\sigma) = \operatorname{sgn}(\sigma^{-1}), because if σ=τ1⋯τm\sigma = \tau_1\cdots\tau_m then σ−1=τm⋯τ1\sigma^{-1} = \tau_m\cdots\tau_1, a product of the same number mm of transpositions, so both have sign (−1)m(-1)^m. Hence

det⁡(AT)=∑σ∈Snsgn⁡(σ−1)∏k=1nak σ−1(k).\det(A^T) = \sum_{\sigma\in S_n} \operatorname{sgn}(\sigma^{-1}) \prod_{k=1}^n a_{k\,\sigma^{-1}(k)}.

As σ\sigma ranges over all of SnS_n, so does σ−1\sigma^{-1} (inversion is a bijection Sn→SnS_n \to S_n), so relabeling the summation index by π=σ−1\pi = \sigma^{-1} gives

det⁡(AT)=∑π∈Snsgn⁡(π)∏k=1nak π(k)=det⁡(A).■\det(A^T) = \sum_{\pi \in S_n} \operatorname{sgn}(\pi) \prod_{k=1}^n a_{k\,\pi(k)} = \det(A). \qquad \blacksquare
∎

Worked examples

Example 1: A generic 3×33\times 3 matrix (all entries distinct, no special structure). Let

A=(20314−1521).A = \begin{pmatrix} 2 & 0 & 3 \\ 1 & 4 & -1 \\ 5 & 2 & 1 \end{pmatrix}.

There are 3!=63! = 6 permutations of {1,2,3}\{1,2,3\}. We list each σ\sigma as (σ(1),σ(2),σ(3))(\sigma(1),\sigma(2),\sigma(3)), its sign, and its permutation term a1σ(1)a2σ(2)a3σ(3)a_{1\sigma(1)}a_{2\sigma(2)}a_{3\sigma(3)}:

σ\sigmatypesgn⁡(σ)\operatorname{sgn}(\sigma)term
(1,2,3)(1,2,3)identity+1+1a11a22a33=2⋅4⋅1=8a_{11}a_{22}a_{33} = 2\cdot4\cdot1 = 8
(1,3,2)(1,3,2)transposition of 2,32,3−1-1a11a23a32=2⋅(−1)⋅2=−4a_{11}a_{23}a_{32} = 2\cdot(-1)\cdot2 = -4
(2,1,3)(2,1,3)transposition of 1,21,2−1-1a12a21a33=0⋅1⋅1=0a_{12}a_{21}a_{33} = 0\cdot1\cdot1 = 0
(2,3,1)(2,3,1)3-cycle+1+1a12a23a31=0⋅(−1)⋅5=0a_{12}a_{23}a_{31} = 0\cdot(-1)\cdot5 = 0
(3,1,2)(3,1,2)3-cycle+1+1a13a21a32=3⋅1⋅2=6a_{13}a_{21}a_{32} = 3\cdot1\cdot2 = 6
(3,2,1)(3,2,1)transposition of 1,31,3−1-1a13a22a31=3⋅4⋅5=60a_{13}a_{22}a_{31} = 3\cdot4\cdot5 = 60

Applying signs and summing:

det⁡(A)=(+1)(8)+(−1)(−4)+(−1)(0)+(+1)(0)+(+1)(6)+(−1)(60)\det(A) = (+1)(8) + (-1)(-4) + (-1)(0) + (+1)(0) + (+1)(6) + (-1)(60)
=8+4+0+0+6−60=−42.= 8 + 4 + 0 + 0 + 6 - 60 = -42.

Cross-check by cofactor expansion along the first row, which is justified because it is exactly a regrouping of this same Leibniz sum by the value of σ(1)\sigma(1):

det⁡(A)=2∣4−121∣−0∣1−151∣+3∣1452∣\det(A) = 2\begin{vmatrix}4 & -1\\ 2 & 1\end{vmatrix} - 0\begin{vmatrix}1 & -1\\ 5 & 1\end{vmatrix} + 3\begin{vmatrix}1 & 4\\ 5 & 2\end{vmatrix}
=2(4⋅1−(−1)⋅2)−0+3(1⋅2−4⋅5)=2(4+2)+3(2−20)=12+3(−18)=12−54=−42.= 2(4\cdot1 - (-1)\cdot2) - 0 + 3(1\cdot2 - 4\cdot5) = 2(4+2) + 3(2-20) = 12 + 3(-18) = 12 - 54 = -42.

Both methods agree: det⁡(A)=−42\det(A) = -42.

Example 2: A 4×44\times 4 matrix with a zero, to show how zeros prune the sum. Let

B=(1201013220101102).B = \begin{pmatrix} 1 & 2 & 0 & 1\\ 0 & 1 & 3 & 2\\ 2 & 0 & 1 & 0\\ 1 & 1 & 0 & 2 \end{pmatrix}.

Direct Leibniz summation requires all 4!=244! = 24 permutations in principle, but any σ\sigma that selects a zero entry contributes 00, so we only need permutations avoiding the zero positions: (1,3)(1,3) [row 1, col 3], (2,1)(2,1) [row 2, col 1], (3,2)(3,2) [row 3, col 2] and (3,4)(3,4) [row 3, col 4], (4,3)(4,3) [row 4, col 3]. Zero positions: (1,3),(2,1),(3,2),(3,4),(4,3)(1,3), (2,1), (3,2), (3,4), (4,3). A permutation σ\sigma (written as (σ(1),σ(2),σ(3),σ(4))(\sigma(1),\sigma(2),\sigma(3),\sigma(4))) survives only if σ(1)≠3\sigma(1)\ne 3, σ(2)≠1\sigma(2)\ne1, σ(3)≠2\sigma(3)\ne2, σ(3)≠4\sigma(3)\ne4, σ(4)≠3\sigma(4)\ne3. The condition σ(3)≠2,4\sigma(3)\ne 2,4 forces σ(3)∈{1,3}\sigma(3)\in\{1,3\}. Case σ(3)=1\sigma(3)=1: remaining values {2,3,4}\{2,3,4\} for σ(1),σ(2),σ(4)\sigma(1),\sigma(2),\sigma(4) with σ(1)≠3, σ(2)≠1\sigma(1)\ne3,\ \sigma(2)\ne1 (automatic, 11 already used), σ(4)≠3\sigma(4)\ne3. So σ(1)∈{2,4}\sigma(1)\in\{2,4\}, σ(4)∈{2,4}\sigma(4)\in\{2,4\}, and σ(2)\sigma(2) gets the leftover of {2,3,4}\{2,3,4\}.

  • σ(1)=2,σ(4)=4⇒σ(2)=3\sigma(1)=2,\sigma(4)=4 \Rightarrow \sigma(2)=3: σ=(2,3,1,4)\sigma=(2,3,1,4).
  • σ(1)=4,σ(4)=2⇒σ(2)=3\sigma(1)=4,\sigma(4)=2 \Rightarrow \sigma(2)=3: σ=(4,3,1,2)\sigma=(4,3,1,2).

Case σ(3)=3\sigma(3)=3: remaining values {1,2,4}\{1,2,4\} for σ(1),σ(2),σ(4)\sigma(1),\sigma(2),\sigma(4) with σ(1)≠3\sigma(1)\ne3 (automatic), σ(2)≠1\sigma(2)\ne1, σ(4)≠3\sigma(4)\ne3 (automatic). So σ(2)∈{2,4}\sigma(2)\in\{2,4\}.

  • σ(2)=2\sigma(2)=2: leftover {1,4}\{1,4\} for σ(1),σ(4)\sigma(1),\sigma(4): σ=(1,2,3,4)\sigma=(1,2,3,4) or σ=(4,2,3,1)\sigma=(4,2,3,1).
  • σ(2)=4\sigma(2)=4: leftover {1,2}\{1,2\} for σ(1),σ(4)\sigma(1),\sigma(4): σ=(1,4,3,2)\sigma=(1,4,3,2) or σ=(2,4,3,1)\sigma=(2,4,3,1).

So the surviving permutations are:

(2,3,1,4), (4,3,1,2), (1,2,3,4), (4,2,3,1), (1,4,3,2), (2,4,3,1).(2,3,1,4),\ (4,3,1,2),\ (1,2,3,4),\ (4,2,3,1),\ (1,4,3,2),\ (2,4,3,1).

Now compute sign and term for each (entries of BB: b11=1,b12=2,b14=1,b22=1,b23=3,b24=2,b31=2,b33=1,b41=1,b42=1,b44=2b_{11}=1,b_{12}=2,b_{14}=1,b_{22}=1,b_{23}=3,b_{24}=2,b_{31}=2,b_{33}=1,b_{41}=1,b_{42}=1,b_{44}=2): 1. σ=(2,3,1,4)\sigma=(2,3,1,4): this is the 4-cycle sending 1→2→3→11\to2\to3\to1, fixing 44; as a permutation it's a 3-cycle on {1,2,3}\{1,2,3\} times identity on 44, which is even, sgn⁡=+1\operatorname{sgn}=+1. Term: b12b23b31b44=2⋅3⋅2⋅2=24b_{12}b_{23}b_{31}b_{44} = 2\cdot3\cdot2\cdot2 = 24. 2. σ=(4,3,1,2)\sigma=(4,3,1,2): check parity by counting inversions of the sequence 4,3,1,24,3,1,2: pairs out of order: (4,3),(4,1),(4,2),(3,1),(3,2) — that's 5 inversions, (1,2)(1,2) in order (since 1<21<2 at correct relative spots — recompute carefully. Inversions of sequence (4,3,1,2)(4,3,1,2) (pairs i<ji<j with entry(i)>(i)>entry(j)(j)): (1,2):4>3 ✓; (1,3):4>1 ✓; (1,4):4>2 ✓; (2,3):3>1 ✓; (2,4):3>2 ✓; (3,4):1<2 ✗. Total 5 inversions, odd, sgn⁡=−1\operatorname{sgn}=-1. Term: b14b23b31b42=1⋅3⋅2⋅1=6b_{14}b_{23}b_{31}b_{42} = 1\cdot3\cdot2\cdot1 = 6. 3. σ=(1,2,3,4)\sigma=(1,2,3,4): identity, sgn⁡=+1\operatorname{sgn}=+1. Term: b11b22b33b44=1⋅1⋅1⋅2=2b_{11}b_{22}b_{33}b_{44} = 1\cdot1\cdot1\cdot2 = 2. 4. σ=(4,2,3,1)\sigma=(4,2,3,1): sequence (4,2,3,1)(4,2,3,1); inversions: (1,2):4>2✓;(1,3):4>3✓;(1,4):4>1✓;(2,3):2<3✗;(2,4):2>1✓;(3,4):3>1✓. Total 5, odd, sgn⁡=−1\operatorname{sgn}=-1. Term: b14b22b33b41=1⋅1⋅1⋅1=1b_{14}b_{22}b_{33}b_{41} = 1\cdot1\cdot1\cdot1 = 1. 5. σ=(1,4,3,2)\sigma=(1,4,3,2): sequence (1,4,3,2)(1,4,3,2); inversions: (1,2):1<4✗;(1,3):1<3✗;(1,4):1<2✗;(2,3):4>3✓;(2,4):4>2✓;(3,4):3>2✓. Total 3, odd, sgn⁡=−1\operatorname{sgn}=-1. Term: b11b24b33b42=1⋅2⋅1⋅1=2b_{11}b_{24}b_{33}b_{42} = 1\cdot2\cdot1\cdot1 = 2. 6. σ=(2,4,3,1)\sigma=(2,4,3,1): sequence (2,4,3,1)(2,4,3,1); inversions: (1,2):2<4✗;(1,3):2<3✗;(1,4):2>1✓;(2,3):4>3✓;(2,4):4>1✓;(3,4):3>1✓. Total 4, even, sgn⁡=+1\operatorname{sgn}=+1. Term: b12b24b33b41=2⋅2⋅1⋅1=4b_{12}b_{24}b_{33}b_{41} = 2\cdot2\cdot1\cdot1 = 4. Sum with signs:

det⁡(B)=(+1)(24)+(−1)(6)+(+1)(2)+(−1)(1)+(−1)(2)+(+1)(4)\det(B) = (+1)(24) + (-1)(6) + (+1)(2) + (-1)(1) + (-1)(2) + (+1)(4)
=24−6+2−1−2+4=21.= 24 - 6 + 2 - 1 - 2 + 4 = 21.

Cross-check by expanding along row 3, which has entries (2,0,1,0)(2,0,1,0):

det⁡(B)=−2∣201132102∣+0−1∣121012112∣+0.\det(B) = -2\begin{vmatrix}2&0&1\\1&3&2\\1&0&2\end{vmatrix} + 0 - 1\begin{vmatrix}1&2&1\\0&1&2\\1&1&2\end{vmatrix} + 0.

(Signs from cofactor pattern for row 3, positions 1 and 3, are (−1)3+1=+1(-1)^{3+1}=+1 and (−1)3+3=+1(-1)^{3+3}=+1; let's redo carefully with correct cofactor signs.) Cofactor expansion along row 3: det⁡(B)=∑j(−1)3+jb3jM3j\det(B) = \sum_{j} (-1)^{3+j} b_{3j} M_{3j} where M3jM_{3j} is the minor deleting row 3, column jj.

  • j=1j=1: (−1)4b31M31=1⋅2⋅M31(-1)^{4} b_{31}M_{31} = 1\cdot 2\cdot M_{31}.

M31M_{31} = delete row 3, col 1: (201132102)\begin{pmatrix}2&0&1\\1&3&2\\1&0&2\end{pmatrix}, det =2(3⋅2−2⋅0)−0(1⋅2−2⋅1)+1(1⋅0−3⋅1)=2(6)−0+1(−3)=12−3=9= 2(3\cdot2-2\cdot0) - 0(1\cdot2-2\cdot1)+1(1\cdot0-3\cdot1) = 2(6) - 0 + 1(-3) = 12-3=9. Contribution: 2⋅9=182\cdot9 = 18.

  • j=2j=2: b32=0b_{32}=0, contributes 00.
  • j=3j=3: (−1)6b33M33=1⋅1⋅M33(-1)^{6}b_{33}M_{33} = 1\cdot1\cdot M_{33}.

M33M_{33} = delete row 3, col 3: (121012112)\begin{pmatrix}1&2&1\\0&1&2\\1&1&2\end{pmatrix}, det =1(1⋅2−2⋅1)−2(0⋅2−2⋅1)+1(0⋅1−1⋅1)=1(0)−2(−2)+1(−1)=0+4−1=3=1(1\cdot2-2\cdot1) - 2(0\cdot2-2\cdot1) + 1(0\cdot1-1\cdot1) = 1(0) -2(-2)+1(-1) = 0+4-1=3. Contribution: 1⋅3=31\cdot3 = 3.

  • j=4j=4: b34=0b_{34}=0, contributes 00.

Total: 18+0+3+0=2118 + 0 + 3 + 0 = 21. Both methods agree: det⁡(B)=21\det(B) = 21.

Counterexampledropping the sign turns the formula into a different, non-alternating function

The Leibniz theorem's proof crucially used alternation to force sgn⁡(σ)=(−1)m\operatorname{sgn}(\sigma) = (-1)^m rather than always +1+1. Suppose instead we define, in imitation of the formula but without signs, the permanent

perm⁡(A):=∑σ∈Sn∏i=1naiσ(i).\operatorname{perm}(A) := \sum_{\sigma \in S_n} \prod_{i=1}^n a_{i\sigma(i)}.

This still uses every permutation and every entry exactly as before, only omitting sgn⁡(σ)\operatorname{sgn}(\sigma). We show perm⁡\operatorname{perm} is not alternating, so it cannot equal the determinant, illustrating why the sign hypothesis (equivalently, alternation) is essential. Take

A=(1212),A = \begin{pmatrix} 1 & 2 \\ 1 & 2 \end{pmatrix},

which has two equal rows, so det⁡(A)=0\det(A) = 0 by alternation. But

perm⁡(A)=a11a22+a12a21=1⋅2+2⋅1=4≠0.\operatorname{perm}(A) = a_{11}a_{22} + a_{12}a_{21} = 1\cdot2 + 2\cdot1 = 4 \neq 0.

Thus perm⁡(A)≠det⁡(A)\operatorname{perm}(A) \ne \det(A): the unsigned sum fails to vanish on a matrix with a repeated row, precisely because without the sign the two permutation terms a11a22a_{11}a_{22} and a12a21a_{12}a_{21} reinforce instead of canceling. This shows the sign function is not a cosmetic feature of the Leibniz formula but is forced by the alternating property that defines the determinant in the first place.

Scope, edge cases & common traps

SituationWhat happensWhy
n=1n = 1det⁡(A)=a11\det(A) = a_{11}, only one permutation (identity), sign +1+1.S1S_1 has one element.
Any row or column all zerodet⁡(A)=0\det(A) = 0.Every permutation term contains a factor from that row (or, via transpose invariance, that column), which is 00.
Matrix over a general commutative ring, not just a fieldFormula still holds verbatim; multilinearity, alternation, normalization are ring-module statements.Proof used only additive/multiplicative structure and does not need division.
Confusing "sum over all functions {1,…,n}→{1,…,n}\{1,\dots,n\}\to\{1,\dots,n\}" with "sum over permutations"Leads to spurious extra terms.Only bijective index choices survive; all others vanish by alternation (Step 3 of the proof).
Using the formula for numerical computation with large nnComputationally intractable: n!n! terms.Cofactor expansion or row reduction is used in practice; the Leibniz formula is a structural/theoretical tool, not an algorithm.

The mathematician behind it

Origins · 1 minGottfried Wilhelm Leibniz and how this was discovered
GW
Gottfried Wilhelm Leibniz
1646–1716 · Court philosopher, mathematician, and polymath in the Holy Roman Empire

Leibniz is best known as co-inventor of calculus, but he also conducted early systematic investigations into systems of linear equations and what we now call determinants, working these out in correspondence rather than in a single published treatise. His notation and philosophical ambitions for a universal symbolic calculus ("characteristica universalis") shaped how he approached elimination and combinatorial patterns in coefficients, anticipating the permutation-sum structure that today bears his name.

History
- 1693 — Leibniz, in a letter to Guillaume de l'Hôpital, describes a method equivalent to expanding a determinant as a signed sum over index permutations for systems of linear equations.
- 1750 — Gabriel Cramer publishes what becomes known as Cramer's Rule, using determinant-like expressions for solving linear systems, independently rediscovering aspects of the combinatorial structure.
- 1772 — Alexandre-Théophile Vandermonde treats determinants as objects of independent study, giving one of the first systematic theories.
- 1812 — Augustin-Louis Cauchy formalizes the modern notion of determinant, proves the multiplication theorem, and introduces much of the terminology used today.
- 1841 — Carl Gustav Jacobi popularizes determinants (including the Jacobian determinant) in analysis, cementing the permutation-sum formula as standard machinery.
Why does the Leibniz formula have n!n! terms and not fewer?

Each term corresponds to a way of selecting one matrix entry from every row so that no two selected entries share a column — equivalently, a bijection from row indices to column indices. The number of bijections from an nn-element set to itself is n!n!, since there are nn choices for where row 11 maps, n−1n-1 remaining choices for row 22, and so on. No smaller count is possible if every such selection is to be represented, since the alternation property (proved via multilinearity and the vanishing of terms with repeated rows in the standard-basis expansion) allows precisely the bijective selections to survive and forces all n!n! of them to appear with a definite sign.

Is the Leibniz formula ever used to actually compute determinants by hand or by computer?

By hand, it is practical only for very small nn (typically n≤3n \le 3), because the number of terms grows factorially: 4!=244! = 24, 5!=1205! = 120, 10!=3,628,80010! = 3{,}628{,}800. In practice, both hand computation and software use Gaussian elimination (row reduction to triangular form, tracking sign changes and pivots) with roughly O(n3)O(n^3) arithmetic operations, or cofactor expansion for small structured matrices. The Leibniz formula's main role is theoretical: it proves the determinant is a well-defined polynomial in the entries, justifies transpose invariance, and provides the combinatorial language (permutations, signs) used to prove other determinant identities rigorously.

How does the Leibniz formula relate to cofactor expansion along a row?

Fix a row index, say row 11. Group the Leibniz sum by the value k=σ(1)k = \sigma(1), the column chosen in row 11. For each fixed kk, summing over all σ\sigma with σ(1)=k\sigma(1)=k and factoring out a1ka_{1k} yields exactly a1ka_{1k} times (−1)1+k(-1)^{1+k} times the determinant of the (n−1)×(n−1)(n-1)\times(n-1) submatrix obtained by deleting row 11 and column kk (the "minor"). Summing over k=1,…,nk=1,\dots,n recovers the cofactor expansion formula. This regrouping argument is the rigorous justification for cofactor expansion, developed fully in Computing Determinants by Cofactor Expansion.

Does the Leibniz formula work over rings that are not fields, such as the integers?

Yes. The proof only uses the additive and multiplicative structure of a commutative ring: multilinearity (distributing sums and scaling by ring elements), alternation, and the ring's multiplicative identity for normalization. No division, inversion, or field-specific property is invoked anywhere in the derivation. Consequently the Leibniz formula, and the determinant itself, are defined and behave identically over any commutative ring, which is essential for applications such as determinants of integer matrices in number theory and lattice theory.

Why is the permanent (the unsigned version) not equal to the determinant, and why does that matter?

The permanent drops the sign sgn⁡(σ)\operatorname{sgn}(\sigma) from every term. As the counterexample shows, this destroys the alternating property: a matrix with two identical rows has permanent generally nonzero (e.g., permanent 44 for a matrix with det 00), even though its determinant is forced to vanish. This matters because the two functions, despite looking almost identical combinatorially, have vastly different computational complexity: determinants are computable in polynomial time via elimination, while computing permanents is #P-hard in general (a foundational hardness result in complexity theory), showing that the innocuous-looking sign is responsible for an enormous computational simplification.

What role does the sign of a permutation play beyond just "+1 or −1 bookkeeping"?

The sign function sgn⁡:Sn→{+1,−1}\operatorname{sgn}: S_n \to \{+1,-1\} is a group homomorphism (from SnS_n to the multiplicative group {±1}\{\pm1\}), which is exactly what makes the swap-negation argument in the proof consistent: composing two odd permutations gives an even one, matching how two row swaps return you to a determinant of the same sign as before both swaps. This homomorphism property is what allows the inductive argument in the theorem's proof (Step 4) to give a well-defined value D(eσ(1),…,eσ(n))=sgn⁡(σ)D(e_{\sigma(1)},\dots,e_{\sigma(n)}) = \operatorname{sgn}(\sigma) regardless of which sequence of transpositions is used to build σ\sigma.

Can the Leibniz formula be used to prove the determinant is a polynomial with integer coefficients in the matrix entries?

Yes, directly. The formula expresses det⁡(A)\det(A) as a finite sum, over the n!n! permutations, of terms ± a1σ(1)a2σ(2)⋯anσ(n)\pm\, a_{1\sigma(1)}a_{2\sigma(2)}\cdots a_{n\sigma(n)}, each of which is a monomial of degree nn in the entries aija_{ij} with coefficient ±1\pm1. Since a finite sum of integer-coefficient monomials is by definition a polynomial with integer coefficients, det⁡(A)\det(A) is manifestly such a polynomial, of total degree nn, in the n2n^2 entries of AA. This is precisely why the determinant is a continuous (indeed, smooth, real-analytic) function of the matrix entries, a fact used throughout matrix analysis and differential geometry.

Before this

Where this leads