reserve z,z1,z2 for Complex;
reserve r,x1,x2 for Real;
reserve p0,p,p1,p2,p3,q for Point of TOP-REAL 2;

theorem :: Sum of inner angles of triangle
  for p1,p2,p3 st p2<>p1 & p1<>p3 & p3<>p2 & angle(p2,p1,p3)<PI holds
  angle(p2,p1,p3)+angle(p1,p3,p2)+angle(p3,p2,p1)=PI
proof
  let p1,p2,p3;
  assume that
A1: p2<>p1 & p1<>p3 and
A2: p3<>p2 and
A3: angle(p2,p1,p3)<PI;
A4: euc2cpx(p1)<> euc2cpx(p2) & euc2cpx(p1)<> euc2cpx(p3) by A1,Th4;
A5: euc2cpx(p3)<> euc2cpx(p2) by A2,Th4;
  per cases by COMPLEX2:70;
  suppose
A6: 0 = angle(euc2cpx(p2),euc2cpx(p1),euc2cpx(p3));
    now
      per cases by A4,A5,A6,COMPLEX2:87;
      suppose
        angle(euc2cpx(p1),euc2cpx(p3),euc2cpx(p2)) = 0 & angle(euc2cpx
        (p3),euc2cpx(p2),euc2cpx(p1)) = PI;
        hence thesis by A6;
      end;
      suppose
        angle(euc2cpx(p1),euc2cpx(p3),euc2cpx(p2)) = PI & angle(
        euc2cpx(p3),euc2cpx(p2),euc2cpx(p1)) = 0;
        hence thesis by A6;
      end;
    end;
    hence thesis;
  end;
  suppose
    0 < angle(euc2cpx(p2),euc2cpx(p1),euc2cpx(p3));
    hence thesis by A3,A4,COMPLEX2:84;
  end;
end;
