reserve i,j,k,n,m for Nat,
        X for set,
        b,s for bag of X,
        x for object;

theorem Th2:
  for z1,z2 be Complex st Re z1 >=0 & Re z2>=0 & Im z1 >=0 & Im z2>=0 &
    z1^2=z2^2 & z1^2 is Real holds z1=z2
proof
  let z1,z2 be Complex such that
A1:Re z1 >=0 & Re z2>=0 & Im z1 >=0 & Im z2>=0
    &z1^2=z2^2 & z1^2 is Real & z1<>z2;
A2:z1^2 = z1*z1 & z2^2=z2*z2 by SQUARE_1:def 1;
A3:Re(z1 * z1) = Re z1 * Re z1 - Im z1 * Im z1 by COMPLEX1:9;
A4:Re(z2 * z2) = Re z2 * Re z2 - Im z2 * Im z2 by COMPLEX1:9;
A5:Re(z1 * z1) = Re(z2 * z2) by A2,A1;
A6: 0 = Im (z2^2) by A1,COMPLEX1:def 2
  .=Im (z2*z2) by SQUARE_1:def 1
  .= (Im z2)* (Re z2) + (Im z2)* (Re z2) by COMPLEX1:9;
  0 = Im (z1^2) by A1,COMPLEX1:def 2
  .= (Im z1)* (Re z1) + (Im z1)* (Re z1) by A2,COMPLEX1:9;
  then per cases by A6;
  suppose
A7: Im z1=0 & Im z2 = 0;
    then (Re z1)^2 = Re z1 * Re z1 = Re z2 * Re z2 = (Re z2)^2
      by A1,A3,A4,A2,SQUARE_1:def 1;
    then
A8: Re z1 = Re z2 or Re z1 = - Re z2 by SQUARE_1:40;
    then Re z1=0 by A1,A7,COMPLEX1:def 3;
    hence thesis by A7,A1,A8,COMPLEX1:def 3;
  end;
  suppose
A9: Im z1=0 & Re z2 = 0;
    then
A10:Im z2 =0 by A2,A1,A3,A4;
    Re z1 = 0 by A2,A9,A1,A3,A4;
    hence thesis by A10,A9,COMPLEX1:def 3,A1;
  end;
  suppose
A11: Im z2=0 & Re z1 = 0;
    then
A12: Im z1 =0 by A2,A1,A3,A4;
    Re z2 = 0 by A2,A11,A1,A3,A4;
    hence thesis by A12,A11,COMPLEX1:def 3,A1;
  end;
  suppose A13: Re z1=0 & Re z2 = 0;
    then (Im z1)^2 = Im z1 * Im z1 = Im z2 * Im z2 = (Im z2)^2
      by A3,A4,A5,SQUARE_1:def 1;
    then A14: Im z1 = Im z2 or Im z1 = - Im z2 by SQUARE_1:40;
    then Im z1=0 by A1,A13,COMPLEX1:def 3;
    hence thesis by A13,A1,A14,COMPLEX1:def 3;
  end;
end;
