In mathematics, Dodgson condensation or method of contractants is a method of computing the determinants of square matrices. It is named for its inventor, Charles Lutwidge Dodgson (better known by his pseudonym, as Lewis Carroll, the popular author), who discovered it in 1866. The method in the case of an n × n matrix is to construct an (n − 1) × (n − 1) matrix, an (n − 2) × (n − 2), and so on, finishing with a 1 × 1 matrix, which has one entry, the determinant of the original matrix.
 This algorithm can be described in the following four steps:
 One wishes to find
 All of the interior elements are non-zero, so there is no need to re-arrange the matrix.
 We make a matrix of its 2 × 2 submatrices.
 We then find another matrix of determinants:
 We must then divide each element by the corresponding element of our original matrix. The interior of the original matrix is

  
    
      
        
          
            [
            
              
                
                  −
                  2
                
                
                  −
                  1
                
              
              
                
                  −
                  1
                
                
                  2
                
              
            
            ]
          
        
      
    
    {\displaystyle {\begin{bmatrix}-2&-1\\-1&2\end{bmatrix}}}
  
, so after dividing we get

  
    
      
        
          
            [
            
              
                
                  8
                
                
                  −
                  2
                
              
              
                
                  −
                  4
                
                
                  6
                
              
            
            ]
          
        
      
    
    {\displaystyle {\begin{bmatrix}8&-2\\-4&6\end{bmatrix}}}
  
.
The process must be repeated to arrive at a 1 × 1 matrix.

  
    
      
        
          
            [
            
              
                
                  
                    
                      |
                      
                        
                          
                            8
                          
                          
                            −
                            2
                          
                        
                        
                          
                            −
                            4
                          
                          
                            6
                          
                        
                      
                      |
                    
                  
                
              
            
            ]
          
        
        =
        
          
            [
            
              
                
                  40
                
              
            
            ]
          
        
        .
      
    
    {\displaystyle {\begin{bmatrix}{\begin{vmatrix}8&-2\\-4&6\end{vmatrix}}\end{bmatrix}}={\begin{bmatrix}40\end{bmatrix}}.}
  

Dividing by the interior of the 3 × 3 matrix, which is just −5, gives 
  
    
      
        
          
            [
            
              
                
                  −
                  8
                
              
            
            ]
          
        
      
    
    {\displaystyle {\begin{bmatrix}-8\end{bmatrix}}}
  
 and −8 is indeed the determinant of the original matrix.
 Simply writing out the matrices:
 Here we run into trouble. If we continue the process, we will eventually be dividing by 0. We can perform four row exchanges on the initial matrix to preserve the determinant and repeat the process, with most of the determinants precalculated:
 Hence, we arrive at a determinant of 36.
 The proof that the condensation method computes the determinant of the matrix if no divisions by zero are encountered is based on an identity known as the Desnanot–Jacobi identity (1841) or, more generally, the Sylvester determinant identity (1851).
 Let 
  
    
      
        M
        =
        (
        
          m
          
            i
            ,
            j
          
        
        
          )
          
            i
            ,
            j
            =
            1
          
          
            k
          
        
      
    
    {\displaystyle M=(m_{i,j})_{i,j=1}^{k}}
  
 be a square matrix, and for each 
  
    
      
        1
        ≤
        i
        ,
        j
        ≤
        k
      
    
    {\displaystyle 1\leq i,j\leq k}
  
, denote by 
  
    
      
        
          M
          
            i
          
          
            j
          
        
      
    
    {\displaystyle M_{i}^{j}}
  
 the matrix that results from 
  
    
      
        M
      
    
    {\displaystyle M}
  
 by deleting the 
  
    
      
        i
      
    
    {\displaystyle i}
  
-th row and the 
  
    
      
        j
      
    
    {\displaystyle j}
  
-th column. Similarly, for

  
    
      
        1
        ≤
        i
        ,
        j
        ,
        p
        ,
        q
        ≤
        k
      
    
    {\displaystyle 1\leq i,j,p,q\leq k}
  
, denote by 
  
    
      
        
          M
          
            i
            ,
            j
          
          
            p
            ,
            q
          
        
      
    
    {\displaystyle M_{i,j}^{p,q}}
  
 the matrix that results from 
  
    
      
        M
      
    
    {\displaystyle M}
  
 by deleting the 
  
    
      
        i
      
    
    {\displaystyle i}
  
-th and 
  
    
      
        j
      
    
    {\displaystyle j}
  
-th rows and the 
  
    
      
        p
      
    
    {\displaystyle p}
  
-th and 
  
    
      
        q
      
    
    {\displaystyle q}
  
-th columns.
 Rewrite the identity as
 Now note that by induction it follows that when applying the Dodgson condensation procedure to a square matrix 
  
    
      
        A
      
    
    {\displaystyle A}
  
 of order 
  
    
      
        n
      
    
    {\displaystyle n}
  
, the matrix in the 
  
    
      
        k
      
    
    {\displaystyle k}
  
-th stage of the computation (where the first stage 
  
    
      
        k
        =
        1
      
    
    {\displaystyle k=1}
  
 corresponds to the matrix 
  
    
      
        A
      
    
    {\displaystyle A}
  
 itself) consists of all the connected minors of order 
  
    
      
        k
      
    
    {\displaystyle k}
  

of 
  
    
      
        A
      
    
    {\displaystyle A}
  
, where a connected minor is the determinant of a connected 
  
    
      
        k
        ×
        k
      
    
    {\displaystyle k\times k}
  
 sub-block of adjacent entries of 
  
    
      
        A
      
    
    {\displaystyle A}
  
. In particular, in the last stage 
  
    
      
        k
        =
        n
      
    
    {\displaystyle k=n}
  
, one gets a matrix containing a single element equal to the unique connected minor of order 
  
    
      
        n
      
    
    {\displaystyle n}
  
, namely the determinant of 
  
    
      
        A
      
    
    {\displaystyle A}
  
.
 We follow the treatment in the book Proofs and Confirmations: The Story of the Alternating Sign Matrix Conjecture; an alternative combinatorial proof was given in a paper by Doron Zeilberger.
 
 
Denote 
  
    
      
        
          a
          
            i
            ,
            j
          
        
        =
        (
        −
        1
        
          )
          
            i
            +
            j
          
        
        det
        (
        
          M
          
            i
          
          
            j
          
        
        )
      
    
    {\displaystyle a_{i,j}=(-1)^{i+j}\det(M_{i}^{j})}
  
 (up to sign, the 
  
    
      
        (
        i
        ,
        j
        )
      
    
    {\displaystyle (i,j)}
  
-th minor of 
  
    
      
        M
      
    
    {\displaystyle M}
  
), and define a 
  
    
      
        k
        ×
        k
      
    
    {\displaystyle k\times k}
  

matrix 
  
    
      
        
          M
          ′
        
      
    
    {\displaystyle M'}
  
 by

 
(Note that the first and last column of 
  
    
      
        
          M
          ′
        
      
    
    {\displaystyle M'}
  
 are equal to those of the adjugate matrix of 
  
    
      
        A
      
    
    {\displaystyle A}
  
). The identity is now obtained by computing 
  
    
      
        det
        (
        M
        
          M
          ′
        
        )
      
    
    {\displaystyle \det(MM')}
  
 in two ways. First, we can directly compute the matrix product 
  
    
      
        M
        
          M
          ′
        
      
    
    {\displaystyle MM'}
  
 (using simple properties of the adjugate matrix, or alternatively using the formula for the expansion of a matrix determinant in terms of a row or a column)
to arrive at

 
where we use 
  
    
      
        
          m
          
            i
            ,
            j
          
        
      
    
    {\displaystyle m_{i,j}}
  
 to denote the 
  
    
      
        (
        i
        ,
        j
        )
      
    
    {\displaystyle (i,j)}
  
-th entry of 
  
    
      
        M
      
    
    {\displaystyle M}
  
. The determinant of this matrix is 
  
    
      
        det
        (
        M
        
          )
          
            2
          
        
        ⋅
        det
        (
        
          M
          
            1
            ,
            k
          
          
            1
            ,
            k
          
        
        )
      
    
    {\displaystyle \det(M)^{2}\cdot \det(M_{1,k}^{1,k})}
  
.
Second, this is equal to the product of the determinants, 
  
    
      
        det
        (
        M
        )
        ⋅
        det
        (
        
          M
          ′
        
        )
      
    
    {\displaystyle \det(M)\cdot \det(M')}
  
. But clearly


  
    
      
        det
        (
        
          M
          ′
        
        )
        =
        
          a
          
            1
            ,
            1
          
        
        
          a
          
            k
            ,
            k
          
        
        −
        
          a
          
            k
            ,
            1
          
        
        
          a
          
            1
            ,
            k
          
        
        =
        det
        (
        
          M
          
            1
          
          
            1
          
        
        )
        det
        (
        
          M
          
            k
          
          
            k
          
        
        )
        −
        det
        (
        
          M
          
            1
          
          
            k
          
        
        )
        det
        (
        
          M
          
            k
          
          
            1
          
        
        )
        ,
      
    
    {\displaystyle \det(M')=a_{1,1}a_{k,k}-a_{k,1}a_{1,k}=\det(M_{1}^{1})\det(M_{k}^{k})-\det(M_{1}^{k})\det(M_{k}^{1}),}
  


so the identity follows from equating the two expressions we obtained for 
  
    
      
        det
        (
        M
        
          M
          ′
        
        )
      
    
    {\displaystyle \det(MM')}
  
 and dividing out by 
  
    
      
        det
        (
        M
        )
      
    
    {\displaystyle \det(M)}
  
 (this is allowed if one thinks of the identities as polynomial identities over the ring of polynomials in the 
  
    
      
        
          k
          
            2
          
        
      
    
    {\displaystyle k^{2}}
  
 indeterminate variables 
  
    
      
        (
        
          m
          
            i
            ,
            j
          
        
        
          )
          
            i
            ,
            j
            =
            1
          
          
            k
          
        
      
    
    {\displaystyle (m_{i,j})_{i,j=1}^{k}}
  
).