reserve x,y for object,
  N for Element of NAT,
  c,i,j,k,m,n for Nat,
  D for non empty set,
  s for Element of 2Set Seg (n+2),
  p for Element of Permutations(n) ,
  p1, q1 for Element of Permutations(n+1),
  p2 for Element of Permutations(n +2),
  K for Field,
  a for Element of K,
  f for FinSequence of K,
  A for (Matrix of K),
  AD for Matrix of n,m,D,
  pD for FinSequence of D,
  M for Matrix of n,K;

theorem Th37:
  for A be Matrix of n,K st Det A <> 0.K for x,b be Matrix of K st
len x = n & A * x = b holds x = A~ * b & for i,j st [i,j] in Indices x holds x*
  (i,j) = (Det A)" * Det ReplaceCol(A,i,Col(b,j))
proof
  let A be Matrix of n,K such that
A1: Det A <> 0.K;
  A is invertible by A1,Th34;
  then A~ is_reverse_of A by MATRIX_6:def 4;
  then
A2: A~*A=1.(K,n) by MATRIX_6:def 2;
  set MC=Matrix_of_Cofactor A;
  set D=Det A;
A3: width MC=n by MATRIX_0:24;
A4: len (MC@)=n by MATRIX_0:24;
A5: width (MC@)=n by MATRIX_0:24;
A6: width (A~)=n by MATRIX_0:24;
A7: width A=n by MATRIX_0:24;
  let x,b be Matrix of K such that
A8: len x = n and
A9: A * x = b;
A10: len A=n by MATRIX_0:24;
  then
A11: len b=n by A8,A9,A7,MATRIX_3:def 4;
  x = 1.(K,n) * x by A8,MATRIXR2:68;
  hence
A12: x=A~ * b by A8,A9,A6,A10,A7,A2,MATRIX_3:33;
  let i,j such that
A13: [i,j] in Indices x;
A14: len Col(b,j)=n by A11,MATRIX_0:def 8;
  Indices x=[:Seg n,Seg width x:] by A8,FINSEQ_1:def 3;
  then
A15: i in Seg n by A13,ZFMISC_1:87;
  then
A16: 1<=i by FINSEQ_1:1;
A17: i<= n by A15,FINSEQ_1:1;
  thus x*(i,j) = Line(A~,i)"*"Col(b,j) by A6,A12,A13,A11,MATRIX_3:def 4
    .= Line(D" * MC@,i)"*"Col(b,j) by A1,Th35
    .= (D"*Line(MC@,i))"*"Col(b,j) by A4,A16,A17,MATRIXR1:20
    .= Sum(D"*mlt(Line(MC@,i),Col(b,j))) by A5,A11,FVSUM_1:68
    .= D"*(Line(MC@,i)"*"Col(b,j)) by FVSUM_1:73
    .= D"*(Col(MC,i)"*"Col(b,j)) by A3,A15,MATRIX_0:59
    .= D"*Sum(LaplaceExpL(RLine(A@,i,Col(b,j)),i)) by A15,A14,Th31
    .= D"*Det RLine(A@,i,Col(b,j)) by A15,Th25
    .= D"*Det (RLine(A@,i,Col(b,j))@) by MATRIXR2:43
    .= D"*Det RCol(A,i,Col(b,j)) by Th19;
end;
