reserve x, y for object, X for set,
  i, j, k, l, n, m for Nat,
  D for non empty set,
  K for commutative Ring,
  a,b for Element of K,
  perm, p, q for Element of Permutations(n),
  Perm,P for Permutation of Seg n,
  F for Function of Seg n,Seg n,
  perm2, p2, q2, pq2 for Element of Permutations(n+2),
  Perm2 for Permutation of Seg (n+2);
reserve s for Element of 2Set Seg (n+2);

theorem Th7:
  for X be Element of Fin 2Set Seg (n+2),p2,q2 for F be finite set
st F={s:s in X & Part_sgn(p2,K).s <> Part_sgn(q2,K).s} holds (card F mod 2 = 0
  implies (the multF of K) $$ (X,Part_sgn(p2,K)) = (the multF of K) $$ (X,
Part_sgn(q2,K)) ) & (card F mod 2 = 1 implies (the multF of K) $$ (X,Part_sgn(
  p2,K)) = -(the multF of K) $$ (X,Part_sgn(q2,K)) )
proof
  let X be Element of Fin 2Set Seg (n+2);
  let p2,q2;
  let F be finite set such that
A1: F={s:s in X & Part_sgn(p2,K).s<>Part_sgn(q2,K).s};
  set Pq=Part_sgn(q2,K);
  set Pp=Part_sgn(p2,K);
  set 2S=2Set Seg (n+2);
  X c= 2S by FINSUB_1:def 5;
  then X\F c= 2S;
  then reconsider Y=X\F as Element of Fin 2S by FINSUB_1:def 5;
A2: F c= X
  proof
    let x be object;
    assume x in F;
    then ex s st x=s & s in X & Pp.s<>Pq.s by A1;
    hence thesis;
  end;
  then
A3: F\/Y=X by XBOOLE_1:45;
  X c= 2S by FINSUB_1:def 5;
  then F c= 2S by A2;
  then reconsider F9=F as Element of Fin 2S by FINSUB_1:def 5;
  set KK=the carrier of K;
  set mm=the multF of K;
  consider Gp be Function of Fin 2S,KK such that
A4: mm $$ (F9,Pp) = Gp.F and
A5: for e be Element of KK st e is_a_unity_wrt mm holds Gp.{} = e and
A6: for x be Element of 2S holds Gp.{x} = Pp.x and
A7: for B be Element of Fin 2S st B c= F & B <> {} for x being Element
  of 2S st x in F9 \ B holds Gp.(B\/{x})= mm.(Gp.B,Pp.x) by SETWISEO:def 3;
A8: Y c=2S by FINSUB_1:def 5;
  consider Gq be Function of Fin 2S,KK such that
A9: mm $$ (F9,Pq) = Gq.F and
A10: for e be Element of KK st e is_a_unity_wrt mm holds Gq.{} = e and
A11: for x be Element of 2S holds Gq.{x} = Pq.x and
A12: for B be Element of Fin 2S st B c= F & B <> {} for x be Element of
  2S st x in F \ B holds Gq.(B\/{x})= mm.(Gq.B,Pq.x) by SETWISEO:def 3;
  defpred P[Nat] means for B be Element of Fin 2S st card B=$1 & B c= F holds
  (card B mod 2=0 implies Gp.B=Gq.B) & (card B mod 2=1 implies Gp.B=-Gq.B);
A13: for s st s in F holds Pp.s = -Pq.s
  proof
    let s;
    assume s in F;
    then
A14: ex s9 be Element of 2S st s9=s & s9 in X & Pp.s9<>Pq.s9 by A1;
A15: Pq.s=1_K or Pq.s=-1_K by Th5;
    Pp.s=1_K or Pp.s=-1_K by Th5;
    then Pp.s+Pq.s=0.K by A14,A15,RLVECT_1:def 10;
    hence thesis by VECTSP_1:16;
  end;
A16: for k be Nat st P[k] holds P[k+1]
  proof
    let k be Nat such that
A17: P[k];
    set k1=k+1;
    let B be Element of Fin 2S such that
A18: card B=k1 and
A19: B c= F;
    now
      per cases;
      case
A20:    k=0;
        then consider x being object such that
A21:    B={x} by A18,CARD_2:42;
A22:    x in B by A21,TARSKI:def 1;
        B c= 2S by FINSUB_1:def 5;
        then reconsider x as Element of 2S by A22;
A23:    Gq.B=Pq.x by A11,A21;
        Gp.B=Pp.x by A6,A21;
        hence thesis by A13,A18,A19,A20,A22,A23,NAT_D:14;
      end;
      case
A24:    k>0;
        consider x being object such that
A25:    x in B by A18,CARD_1:27,XBOOLE_0:def 1;
        B c= 2S by FINSUB_1:def 5;
        then reconsider x as Element of 2S by A25;
        B c= 2S by FINSUB_1:def 5;
        then B\{x} c= 2S;
        then reconsider B9=B\{x} as Element of Fin 2S by FINSUB_1:def 5;
A26:    not x in B9 by ZFMISC_1:56;
        then
A27:    x in F\B9 by A19,A25,XBOOLE_0:def 5;
A28:    B9 c= F by A19;
A29:    {x} \/ B9=B by A25,ZFMISC_1:116;
        then
A30:    k+1=card B9+1 by A18,A26,CARD_2:41;
        then
A31:    Gq.B= mm.(Gq.B9,Pq.x) by A12,A19,A24,A29,A27,CARD_1:27,XBOOLE_1:1;
A32:    Gp.B= mm.(Gp.B9,Pp.x) by A7,A19,A24,A29,A30,A27,CARD_1:27,XBOOLE_1:1;
        now
          per cases by NAT_D:12;
          case
A33:        k mod 2=0;
            0<2-1;
            then
A34:        k1 mod 2 =0 +1 by A33,NAT_D:70;
A35:        Gp.B=Gp.B9*(-Pq.x) by A13,A19,A25,A32;
            Gq.B=Gp.B9*Pq.x by A17,A30,A28,A31,A33;
            hence thesis by A18,A35,A34,VECTSP_1:8;
          end;
          case
A36:        k mod 2=1;
A37:        Pp.x=-Pq.x by A13,A19,A25;
            Gp.B9=-Gq.B9 by A17,A30,A28,A36;
            then
A38:        Gp.B=(-Gq.B9)*(-Pq.x) by A7,A19,A24,A29,A30,A27,A37,CARD_1:27
,XBOOLE_1:1;
A39:        2-1=1;
            Gq.B=Gq.B9*Pq.x by A12,A19,A24,A29,A30,A27,CARD_1:27,XBOOLE_1:1;
            hence thesis by A18,A36,A38,A39,NAT_D:69,VECTSP_1:10;
          end;
        end;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
A40: P[0]
  proof
    let B be Element of Fin 2S such that
A41: card B=0 and
    B c= F;
A42: 0=0 mod 2 by NAT_D:26;
A43: B={} by A41;
    then Gp.B=1_K by A5,FVSUM_1:4;
    hence thesis by A10,A43,A42,FVSUM_1:4;
  end;
A44: for k be Nat holds P[k] from NAT_1:sch 2(A40,A16);
A45: Y misses F by XBOOLE_1:79;
  then
A46: mm $$(X, Pp) = mm.(mm $$(Y,Pp),mm $$(F9,Pp)) by A3,SETWOP_2:4;
A47: mm $$(X, Pq) = mm.(mm $$(Y,Pq),mm $$(F9,Pq)) by A45,A3,SETWOP_2:4;
A48: dom Pp=2S by FUNCT_2:def 1;
  then
A49: dom (Pp|Y)=Y by A8,RELAT_1:62;
  dom Pq=2S by FUNCT_2:def 1;
  then
A50: dom (Pq|Y)=Y by A8,RELAT_1:62;
  for x being object st x in dom (Pp|Y) holds (Pp|Y).x=(Pq|Y).x
  proof
    let x be object such that
A51: x in dom (Pp|Y);
    Y c= 2S by FINSUB_1:def 5;
    then reconsider x9=x as Element of 2S by A49,A51;
A52: (Pp|Y).x9=Pp.x9 by A51,FUNCT_1:47;
A53: not x9 in F by A49,A51,XBOOLE_0:def 5;
    assume
A54: (Pp|Y).x<>(Pq|Y).x;
    (Pq|Y).x9=Pq.x9 by A49,A50,A51,FUNCT_1:47;
    hence contradiction by A1,A49,A51,A54,A52,A53;
  end;
  then
A55: Pp|Y=Pq|Y by A48,A8,A50,FUNCT_1:2,RELAT_1:62;
  then
A56: mm $$(Y,Pp) = mm $$(Y,Pq) by SETWOP_2:7;
  now
    per cases by NAT_D:12;
    case
      card F mod 2=0;
      hence thesis by A4,A9,A44,A56,A46,A47;
    end;
    case
A57:  card F mod 2=1;
A58:  mm $$(X, Pq) = (mm $$(Y,Pp))*(mm $$(F9,Pq)) by A55,A47,SETWOP_2:7;
      mm $$(X, Pp) = (mm $$(Y,Pp))*(-mm $$(F9,Pq)) by A4,A9,A44,A46,A57;
      hence thesis by A57,A58,VECTSP_1:8;
    end;
  end;
  hence thesis;
end;
