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 Th21:
  for i,j st i in Seg (n+1) & p1.i = j holds -(a,p1) = power(K).(-
  1_K,i+j) * -(a,Rem(p1,i))
proof
  set n1=n+1;
  let i,j such that
A1: i in Seg n1 and
A2: p1.i=j;
A3: p1 is Permutation of Seg n1 by MATRIX_1:def 12;
  then
A4: rng p1=Seg n1 by FUNCT_2:def 3;
  dom p1=Seg n1 by A3,FUNCT_2:52;
  then
A5: j in Seg n1 by A1,A2,A4,FUNCT_1:def 3;
  set R=Rem(p1,i);
  per cases by NAT_1:23;
  suppose
A6: n=0;
    then R is even by Th11;
    then
A7: -(a,R)=a by MATRIX_1:def 16;
A8: 1+1=2*1;
    p1 is even by A6,Th11;
    then
A9: -(a,p1)=a by MATRIX_1:def 16;
A10: j=1 by A5,A6,FINSEQ_1:2,TARSKI:def 1;
    i=1 by A1,A6,FINSEQ_1:2,TARSKI:def 1;
    then power(K).(-1_K,i+j)=1_K by A10,A8,HURWITZ:4;
    hence thesis by A9,A7;
  end;
  suppose
A11: n=1;
    then
A12: p1 is Permutation of Seg 2 by MATRIX_1:def 12;
    per cases by A12,MATRIX_7:1;
    suppose
A13:  p1=<*1,2*>;
      i=1 or i=2 by A1,A11,FINSEQ_1:2,TARSKI:def 2;
      then i=1 & p1.i=1 or i=2 & p1.i=2 by A13;
      then i+j=2*1 or i+j=2*2 by A2;
      then
A14:  power(K).(-1_K,i+j)=1_K by HURWITZ:4;
A15:  len Permutations(2)=2 by MATRIX_1:9;
      R is even by A11,Th11;
      then
A16:  -(a,R)=a by MATRIX_1:def 16;
      id Seg 2 is even by MATRIX_1:16;
      then -(a,p1)=a by A11,A13,A15,FINSEQ_2:52,MATRIX_1:def 16;
      hence thesis by A14,A16;
    end;
    suppose
A17:  p1=<*2,1*>;
      len Permutations(2)=2 by MATRIX_1:9;
      then -(a,p1)=-a by A11,A17,MATRIX_1:def 16,MATRIX_9:12;
      then
A18:  -(a,p1)=-1_K*a;
      i=1 or i=2 by A1,A11,FINSEQ_1:2,TARSKI:def 2;
      then i+j=2*1+1 by A2,A17;
      then
A19:  power(K).(-1_K,i+j)=-1_K by HURWITZ:4;
      R is even by A11,Th11;
      then -(a,R)=a by MATRIX_1:def 16;
      hence thesis by A19,A18,VECTSP_1:8;
    end;
  end;
  suppose
A20: n >= 2;
    then reconsider n2=n-2 as Element of NAT by NAT_1:21;
    per cases;
    suppose
A21:  not K is Fanoian;
A22:  now
        per cases by NAT_D:12;
        suppose
          i+j mod 2=0;
          then consider t be Nat such that
A23:      i+j = 2 * t + 0 and
          0 < 2 by NAT_D:def 2;
          t is Element of NAT by ORDINAL1:def 12;
          hence power(K).(-1_K,i+j)=1_K by A23,HURWITZ:4;
        end;
        suppose
          i+j mod 2=1;
          then consider t be Nat such that
A24:      i+j = 2 * t + 1 and
          1 < 2 by NAT_D:def 2;
A25:      1_K=-1_K by A21,MATRIX11:22;
          t is Element of NAT by ORDINAL1:def 12;
          hence power(K).(-1_K,i+j)=1_K by A24,A25,HURWITZ:4;
        end;
      end;
A26:  -(a,p1)=a or -(a,p1)=-a by MATRIX_1:def 16;
      -1_K=1_K by A21,MATRIX11:22;
      then
A27:  -a*1_K=a*(1_K) by VECTSP_1:9;
      -(a,R)=a or -(a,R)=-a by MATRIX_1:def 16;
      then -(a,R)=a by A27;
      hence thesis by A22,A26,A27;
    end;
    suppose
A29:  K is Fanoian;
      set mm=the multF of K;
      reconsider n1=n2+1 as Element of NAT;
      set P1=Permutations(n1+2);
      reconsider Q1=p1 as Element of P1;
      set SS1=2Set Seg (n1+2);
      consider X be Element of Fin SS1 such that
A30:  X = {{N,i} where N is Nat:{N,i} in SS1} and
A31:  mm $$ (X,Part_sgn(Q1,K)) = power(K).(-1_K,i+j) by A1,A2,A29,Th9;
      set PQ1=Part_sgn(Q1,K);
      set SS2=2Set Seg (n2+2);
      reconsider Q19=Q1 as Permutation of Seg (n1+2) by MATRIX_1:def 12;
      set P2=Permutations(n2+2);
      reconsider Q=R as Element of P2;
      reconsider Q9=Q as Permutation of Seg (n2+2) by MATRIX_1:def 12;
      set PQ=Part_sgn(Q,K);
      SS1 in Fin SS1 by FINSUB_1:def 5; then
A32:  In(SS1,Fin SS1)=SS1 by SUBSET_1:def 8;
      reconsider SSX=SS1\X as Element of Fin SS1 by FINSUB_1:def 5;
A33:  X\/SSX=SS1\/X by XBOOLE_1:39;
      X c= SS1 by FINSUB_1:def 5;
      then
A34:  X\/SSX=SS1 by A33,XBOOLE_1:12;
      consider f be Function of SS2,SS1 such that
A35:  rng f=SS1\X and
A36:  f is one-to-one and
A37:  for k,m st k<m & {k,m} in SS2 holds (m < i & k < i implies f.{k
      ,m}={k,m}) & (m >= i & k < i implies f.{k,m}={k,m+1}) & (m >= i & k >= i
      implies f.{k,m}={k+1,m+1}) by A1,A20,A30,Th10;
      set Pf=PQ1*f;
A38:  dom Pf=SS2 by FUNCT_2:def 1;
A39:  dom Q19=Seg (n1+2) by FUNCT_2:52;
A40:  now
        n<=n+1 by NAT_1:11;
        then
A41:    Seg (n2+2) c= Seg (n1+2) by FINSEQ_1:5;
        let x be object such that
A42:    x in SS2;
        consider k,m be Nat such that
A43:    k in Seg (n2+2) and
A44:    m in Seg (n2+2) and
A45:    k < m and
A46:    x={k,m} by A42,MATRIX11:1;
        reconsider k,m as Element of NAT by ORDINAL1:def 12;
        dom Q9=Seg (n2+2) by FUNCT_2:52;
        then Q9.k<>Q.m by A43,A44,A45,FUNCT_1:def 4;
        then
A47:    Q.k>Q.m or Q.k<Q.m by XXREAL_0:1;
        set m1=m+1;
        set k1=k+1;
A48:    (n2+2)+1=n1+2;
        then
A49:    k1 in Seg (n1+2) by A43,FINSEQ_1:60;
A50:    m1 in Seg (n1+2) by A44,A48,FINSEQ_1:60;
        per cases;
        suppose
A51:      k<i & m<i;
A52:      Pf.x=PQ1.(f.x) by A38,A42,FUNCT_1:12;
A53:      f.x=x by A37,A42,A45,A46,A51;
          per cases;
          suppose
            Q1.k<j & Q1.m<j or Q1.k>=j & Q1.m>=j;
            then Q.k=Q1.k&Q.m=Q1.m or Q.k=Q1.k-1&Q.m=Q1.m-1 by A1,A2,A43,A44
,A51,Def3;
            then Q.k<Q.m & Q1.k<Q1.m or Q.k>Q.m & Q1.k>Q1.m by A47,XREAL_1:9;
            then
            PQ1.x=1_K & PQ.x=1_K or PQ1.x=-1_K & PQ.x=-1_K by A43,A44,A45,A46
,A41,MATRIX11:def 1;
            hence Pf.x=PQ.x by A38,A42,A53,FUNCT_1:12;
          end;
          suppose
A54:        Q1.k<j & Q1.m>=j;
            then Q.m=Q1.m-1 by A1,A2,A44,A51,Def3;
            then
A55:        Q1.m=Q.m+1;
            Q19.m<>j by A1,A2,A39,A44,A41,A51,FUNCT_1:def 4;
            then Q1.m>j by A54,XXREAL_0:1;
            then
A56:        Q.m>=j by A55,NAT_1:13;
            Q1.k<Q1.m by A54,XXREAL_0:2;
            then
A57:        PQ1.x=1_K by A43,A44,A45,A46,A41,MATRIX11:def 1;
            Q1.k=Q.k by A1,A2,A43,A51,A54,Def3;
            then Q.k<Q.m by A54,A56,XXREAL_0:2;
            hence Pf.x=PQ.x by A43,A44,A45,A46,A53,A52,A57,MATRIX11:def 1;
          end;
          suppose
A58:        Q1.k>=j & Q1.m<j;
            then Q.k=Q1.k-1 by A1,A2,A43,A51,Def3;
            then
A59:        Q1.k=Q.k+1;
            Q19.k<>j by A1,A2,A39,A43,A41,A51,FUNCT_1:def 4;
            then Q1.k>j by A58,XXREAL_0:1;
            then
A60:        Q.k>=j by A59,NAT_1:13;
            Q1.k>Q1.m by A58,XXREAL_0:2;
            then
A61:        PQ1.x=-1_K by A43,A44,A45,A46,A41,MATRIX11:def 1;
            Q1.m=Q.m by A1,A2,A44,A51,A58,Def3;
            then Q.k>Q.m by A58,A60,XXREAL_0:2;
            hence Pf.x=PQ.x by A43,A44,A45,A46,A53,A52,A61,MATRIX11:def 1;
          end;
        end;
        suppose
          k>=i & m<i;
          hence Pf.x=PQ.x by A45,XXREAL_0:2;
        end;
        suppose
A62:      k<i & m>=i;
A63:      Pf.x=PQ1.(f.{k,m}) by A38,A42,A46,FUNCT_1:12;
A64:      f.{k,m}={k,m1} by A37,A42,A45,A46,A62;
          per cases;
          suppose
            Q1.k<j & Q1.m1<j or Q1.k>=j & Q1.m1>=j;
            then Q.k=Q1.k & Q.m=Q1.m1 or Q.k=Q1.k-1 & Q.m=Q1.m1-1 by A1,A2,A43
,A44,A62,Def3;
            then
A65:        Q.k<Q.m & Q1.k<Q1.m1 or Q.k>Q.m & Q1.k>Q1.m1 by A47,XREAL_1:9;
            k < m1 by A45,NAT_1:13;
            then PQ1.{k,m1}=1_K & PQ.x=1_K or PQ1.{k,m1}=-1_K & PQ.x=-1_K by
A43,A44,A45,A46,A41,A50,A65,MATRIX11:def 1;
            hence Pf.x=PQ.x by A38,A42,A46,A64,FUNCT_1:12;
          end;
          suppose
A66:        Q1.k<j & Q1.m1>=j;
            m1>i by A62,NAT_1:13;
            then Q19.m1<>j by A1,A2,A39,A50,FUNCT_1:def 4;
            then
A67:        Q1.m1>j by A66,XXREAL_0:1;
            Q.m=Q1.m1-1 by A1,A2,A44,A62,A66,Def3;
            then Q1.m1=Q.m+1;
            then
A68:        Q.m>=j by A67,NAT_1:13;
            Q1.k=Q.k by A1,A2,A43,A62,A66,Def3;
            then
A69:        Q.k<Q.m by A66,A68,XXREAL_0:2;
A70:        k<m1 by A45,NAT_1:13;
            Q1.k<Q1.m1 by A66,XXREAL_0:2;
            then PQ1.{k,m1}=1_K by A43,A41,A50,A70,MATRIX11:def 1;
            hence Pf.x=PQ.x by A43,A44,A45,A46,A64,A63,A69,MATRIX11:def 1;
          end;
          suppose
A71:        Q1.k>=j & Q1.m1<j;
            then Q.k=Q1.k-1 by A1,A2,A43,A62,Def3;
            then
A72:        Q1.k=Q.k+1;
            Q19.k<>j by A1,A2,A39,A43,A41,A62,FUNCT_1:def 4;
            then Q1.k>j by A71,XXREAL_0:1;
            then
A73:        Q.k>=j by A72,NAT_1:13;
            Q1.m1=Q.m by A1,A2,A44,A62,A71,Def3;
            then
A74:        Q.m<Q.k by A71,A73,XXREAL_0:2;
A75:        k<m1 by A45,NAT_1:13;
            Q1.k>Q1.m1 by A71,XXREAL_0:2;
            then PQ1.{k,m1}=-1_K by A43,A41,A50,A75,MATRIX11:def 1;
            hence Pf.x=PQ.x by A43,A44,A45,A46,A64,A63,A74,MATRIX11:def 1;
          end;
        end;
        suppose
A76:      k>=i & m>=i;
A77:      Pf.x=PQ1.(f.{k,m}) by A38,A42,A46,FUNCT_1:12;
A78:      k1<m1 by A45,XREAL_1:6;
A79:      f.{k,m}={k+1,m+1} by A37,A42,A45,A46,A76;
          per cases;
          suppose
            Q1.k1<j & Q1.m1<j or Q1.k1>=j & Q1.m1>=j;
            then Q.k=Q1.k1&Q.m=Q1.m1 or Q.k=Q1.k1-1&Q.m=Q1.m1-1 by A1,A2,A43
,A44,A76,Def3;
            then Q.k<Q.m & Q1.k1<Q1.m1 or Q.k>Q.m & Q1.k1>Q1.m1 by A47,
XREAL_1:9;
            then PQ1.{k1,m1}=1_K & PQ.x=1_K or PQ1.{m1,k1}=-1_K&PQ.x=-1_K by
A43,A44,A45,A46,A49,A50,A78,MATRIX11:def 1;
            hence Pf.x=PQ.x by A38,A42,A46,A79,FUNCT_1:12;
          end;
          suppose
A80:        Q1.k1<j & Q1.m1>=j;
            m1>i by A76,NAT_1:13;
            then Q19.m1<>j by A1,A2,A39,A50,FUNCT_1:def 4;
            then
A81:        Q1.m1>j by A80,XXREAL_0:1;
            Q.m=Q1.m1-1 by A1,A2,A44,A76,A80,Def3;
            then Q1.m1=Q.m+1;
            then
A82:        Q.m>=j by A81,NAT_1:13;
            Q1.k1<Q1.m1 by A80,XXREAL_0:2;
            then
A83:        PQ1.{k1,m1}=1_K by A49,A50,A78,MATRIX11:def 1;
            Q1.k1=Q.k by A1,A2,A43,A76,A80,Def3;
            then Q.k<Q.m by A80,A82,XXREAL_0:2;
            hence Pf.x=PQ.x by A43,A44,A45,A46,A79,A77,A83,MATRIX11:def 1;
          end;
          suppose
A84:        Q1.k1>=j & Q1.m1<j;
            k1>i by A76,NAT_1:13;
            then Q19.k1<>j by A1,A2,A39,A49,FUNCT_1:def 4;
            then
A85:        Q1.k1>j by A84,XXREAL_0:1;
            Q.k=Q1.k1-1 by A1,A2,A43,A76,A84,Def3;
            then Q1.k1=Q.k+1;
            then
A86:        Q.k>=j by A85,NAT_1:13;
            Q1.k1>Q1.m1 by A84,XXREAL_0:2;
            then
A87:        PQ1.{k1,m1}=-1_K by A49,A50,A78,MATRIX11:def 1;
            Q1.m1=Q.m by A1,A2,A44,A76,A84,Def3;
            then Q.k>Q.m by A84,A86,XXREAL_0:2;
            hence Pf.x=PQ.x by A43,A44,A45,A46,A79,A77,A87,MATRIX11:def 1;
          end;
        end;
      end;
      reconsider domf=dom f as Element of Fin SS2 by FINSUB_1:def 5;
A88:  f.:domf=rng f by RELAT_1:113;
      dom f=SS2 by FUNCT_2:def 1;
      then
A89:  domf=In(SS2,Fin SS2) by SUBSET_1:def 8;
      dom PQ=SS2 by FUNCT_2:def 1;
      then PQ=Pf by A38,A40,FUNCT_1:2;
      then
A90:  mm $$ (SSX,PQ1) = sgn(Q,K) by A35,A36,A89,A88,SETWOP_2:6;
      X misses SSX by XBOOLE_1:79;
      then sgn(Q1,K)=power(K).(-1_K,i+j)*sgn(Q,K) by A31,A90,A34,A32,SETWOP_2:4
;
      hence -(a,p1) = power(K).(-1_K,i+j)*sgn(Q,K)*a by MATRIX11:26
        .= power(K).(-1_K,i+j)*(sgn(Q,K)*a) by GROUP_1:def 3
        .= power(K).(-1_K,i+j)*-(a,R) by MATRIX11:26;
    end;
  end;
end;
