reserve n for non zero Nat,
  j,k,l,m for Nat,
  g,h,i for Integer;

theorem Th32:
  for j be Nat st 1 <= j & j <= n holds 2sComplement(n+1,i)/.j =
  2sComplement(n,i)/.j
proof
  let j be Nat such that
A1: 1 <= j and
A2: j <= n;
A3: j in Seg n by A1,A2,FINSEQ_1:1;
  n <= n+1 by NAT_1:11;
  then j <= n+1 by A2,XXREAL_0:2;
  then
A4: j in Seg (n+1) by A1,FINSEQ_1:1;
  set N = |. (2 to_power MajP(n,|.i.|)) + i .|;
  set M = |. (2 to_power MajP(n+1,|.i.|)) + i .|;
A5: i < 0 implies (M div 2 to_power (j-'1)) mod 2 = (N div 2 to_power (j-'1)
  ) mod 2
  proof
    MajP(n+1,|.i.|) >= MajP(n,|.i.|) by Th22,NAT_1:11;
    then consider m be Nat such that
A6: MajP(n+1,|.i.|) = MajP(n,|.i.|) + m by NAT_1:10;
    reconsider m as Nat;
    set P = MajP(n,|.i.|);
    assume
A7: i < 0;
    set Q = 2 to_power P;
A8: (Q * 2 to_power m qua Integer) mod Q = 0 by NAT_D:13;
    2 to_power (MajP(n+1,|.i.|)) >= |.i.| by Def1;
    then 2 to_power (MajP(n+1,|.i.|)) >= -i by A7,ABSVALUE:def 1;
    then 2 to_power (MajP(n+1,|.i.|)) + i >= -i + i by XREAL_1:6;
    then M = 2 to_power (P+m) + i by A6,ABSVALUE:def 1
      .= (Q * 2 to_power m)+i by POWER:27;
    then
A9: M mod Q = (((Q * 2 to_power m qua Integer) mod Q) + (i mod Q)) mod Q
    by NAT_D:66
      .= (i mod Q) mod Q by A8;
A10: (Q qua Integer) mod Q = 0 by NAT_D:25;
    j + -1 >= 1 + -1 by A1,XREAL_1:6;
    then j -' 1 = j - 1 by XREAL_0:def 2;
    then
A11: j -' 1 < n by A2,XREAL_1:146,XXREAL_0:2;
    P >= n by Def1;
    then
A12: j -' 1 < P by A11,XXREAL_0:2;
    Q >= |.i.| by Def1;
    then Q >= -i by A7,ABSVALUE:def 1;
    then Q + i >= -i + i by XREAL_1:6;
    then N = Q + i by ABSVALUE:def 1;
    then N mod Q = (((Q qua Integer) mod Q) + (i mod Q)) mod Q by NAT_D:66
      .= (i mod Q) mod Q by A10;
    hence thesis by A9,A12,Lm3;
  end;
  per cases;
  suppose
    i >= 0;
    then reconsider i as Element of NAT by INT_1:3;
A13: 2sComplement(n,i)/.j = (n-BinarySequence(|.i.|))/.j by Def2
      .= (n-BinarySequence(i))/.j by ABSVALUE:def 1
      .= IFEQ((i div 2 to_power (j-'1)) mod 2,0,FALSE,TRUE) by A3,
BINARI_3:def 1;
    2sComplement(n+1,i)/.j = ((n+1)-BinarySequence(|.i.|))/.j by Def2
      .= ((n+1)-BinarySequence(i))/.j by ABSVALUE:def 1
      .= IFEQ((i div 2 to_power (j-'1)) mod 2,0,FALSE,TRUE) by A4,
BINARI_3:def 1;
    hence thesis by A13;
  end;
  suppose
A14: i < 0;
    then
A15: 2sComplement(n,i)/.j = (n-BinarySequence(N))/.j by Def2
      .= IFEQ((N div 2 to_power (j-'1)) mod 2,0,FALSE,TRUE) by A3,
BINARI_3:def 1;
    2sComplement(n+1,i)/.j = ((n+1)-BinarySequence(M))/.j by A14,Def2
      .= IFEQ((M div 2 to_power (j-'1)) mod 2,0,FALSE,TRUE) by A4,
BINARI_3:def 1;
    hence thesis by A5,A14,A15;
  end;
end;
