reserve i,j,m,n,k for Nat,
  x,y for set,
  K for Field,
  a for Element of K;

theorem Th7:
  for A,B be Matrix of n,K ex P be Polynomial of K st len P <= n+1
  & for x be Element of K holds eval(P,x) = Det(A+x*B)
proof
  defpred P[Nat] means for A,B be Matrix of $1,K ex P be Polynomial of K st
  len P <= $1+1 & for x be Element of K holds eval(P,x) = Det(A+x*B);
A1: for n st P[n] holds P[n+1]
  proof
    let n such that
A2: P[n];
    set n1=n+1;
    let A,B be Matrix of n1,K;
    defpred Q[Nat] means $1 <= n1 implies ex P be Polynomial of K st len P <=
n1+1 & for x be Element of K holds eval(P,x) = Sum (LaplaceExpL(A+x*B,n1)|$1);
A3: n1 in Seg n1 by FINSEQ_1:4;
A4: for m st Q[m] holds Q[m+1]
    proof
      let m such that
A5:   Q[m];
      set m1=m+1;
      assume
A6:   m1 <= n1;
      then consider P be Polynomial of K such that
A7:   len P <= n1+1 and
A8:   for x be Element of K holds eval(P,x) = Sum (LaplaceExpL(A+x*B,
      n1)|m) by A5,NAT_1:13;
      1<=m1 by NAT_1:11;
      then
A9:   m1 in Seg n1 by A6;
      then
A10:  [n1,m1] in [:Seg n1,Seg n1:] by A3,ZFMISC_1:87;
      set pow=power(K).(-1_K,m1+n1);
      set DB=Delete(B,n1,m1);
      set DA=Delete(A,n1,m1);
      set P2=<% A*(n1,m1)*pow,B*(n1,m1)*pow %>;
A11:  Indices B=[:Seg n1,Seg n1:] by MATRIX_0:24;
      n1-'1=n by NAT_D:34;
      then consider P1 be Polynomial of K such that
A12:  len P1 <= n+1 and
A13:  for x be Element of K holds eval(P1,x) = Det(DA+x*DB) by A2;
      take PP=P+(P1*'P2);
      len P2 <= 2 by POLYNOM5:39;
      then (len P1)+(len P2) <= n1+2 by A12,XREAL_1:7;
      then
A14:  (len P1)+(len P2)-'1 <=n1+2-'1 by NAT_D:42;
      n+2+1-'1=n+2 & len (P1*'P2) <= (len P1)+(len P2)-'1 by HILBASIS:21
,NAT_D:34;
      then len (P1*'P2) <= n1+1 by A14,XXREAL_0:2;
      hence len PP<=n1+1 by A7,POLYNOM4:6;
      let x be Element of K;
      set L=LaplaceExpL(A+x*B,n1);
A15:  Indices A=[:Seg n1,Seg n1:] by MATRIX_0:24;
A16:  A*(n1,m1)*pow+B*(n1,m1)*pow*x = A*(n1,m1)*pow+B*(n1,m1)*x*pow by
GROUP_1:def 3
        .= (A*(n1,m1)+B*(n1,m1)*x)*pow by VECTSP_1:def 2
        .= (A*(n1,m1)+(x*B)*(n1,m1))*pow by A10,A11,MATRIX_3:def 5
        .= (A+x*B)*(n1,m1)*pow by A10,A15,MATRIX_3:def 3;
      n1=len L by LAPLACE:def 7;
      then
A17:  dom L=Seg n1 by FINSEQ_1:def 3;
      then
A18:  L|m1 = (L|m)^<*L.m1*> by A9,FINSEQ_5:10;
A19:  DA+x*DB = DA+Delete(x*B,n1,m1) by A3,A9,Th5
        .= Delete(A+x*B,n1,m1) by A3,A9,Th4;
      eval(P1*'P2,x) = eval(P1,x)*eval(P2,x) by POLYNOM4:24
        .= Det(DA+x*DB) * eval(P2,x) by A13
        .= Minor(A+x*B,n1,m1)*((A+x*B)*(n1,m1)*pow) by A16,A19,POLYNOM5:44
        .=(A+x*B)*(n1,m1)*Cofactor(A+x*B,n1,m1) by GROUP_1:def 3
        .= L.m1 by A9,A17,LAPLACE:def 7;
      hence Sum (L|m1) = Sum (L|m) + eval(P1*'P2,x) by A18,FVSUM_1:71
        .= eval(P,x)+eval(P1*'P2,x) by A8
        .= eval(PP,x) by POLYNOM4:19;
    end;
A20: Q[0]
    proof
      assume 0<=n1;
      take P=0_.(K);
      thus len P <=n1+1 by POLYNOM4:3;
      let x be Element of K;
      LaplaceExpL(A+x*B,n1)|0 = <*>(the carrier of K);
      hence Sum (LaplaceExpL(A+x*B,n1)|0) = 0.K by RLVECT_1:43
        .= eval(P,x) by POLYNOM4:17;
    end;
    for m holds Q[m] from NAT_1:sch 2(A20,A4);
    then consider P be Polynomial of K such that
A21: len P <= n1+1 and
A22: for x be Element of K holds eval(P,x)=Sum (LaplaceExpL(A+x*B,n1)| n1);
    take P;
    thus len P <= n1+1 by A21;
    let x be Element of K;
A23: len LaplaceExpL(A+x*B,n1)=n1 by LAPLACE:def 7;
    thus eval(P,x) = Sum (LaplaceExpL(A+x*B,n1)|n1) by A22
      .= Sum LaplaceExpL(A+x*B,n1) by A23,FINSEQ_1:58
      .= Det (A+x*B) by A3,LAPLACE:25;
  end;
A24: P[0]
  proof
    let A,B be Matrix of 0,K;
    take P=1_.(K);
    thus len P <=0+1 by POLYNOM4:4;
    let x be Element of K;
    thus Det(A+x*B) = 1_K by MATRIXR2:41
      .= eval(P,x) by POLYNOM4:18;
  end;
  for n holds P[n] from NAT_1:sch 2(A24,A1);
  hence thesis;
end;
