
theorem
  for A,B,C being Point of TOP-REAL 2,
      a,b,r being Real st A,B,C is_a_triangle &
  angle(C,B,A) in ].0,PI.[ & angle(B,A,C) in ].0,PI.[ &
  A in circle(a,b,r) & B in circle(a,b,r) & C in circle(a,b,r) &
  |[a,b]| in LSeg(A,C) holds angle (C,B,A) = PI/2
  proof
    let A,B,C be Point of TOP-REAL 2,
        a,b,r be Real such that
A1: A,B,C is_a_triangle and
A2: angle(C,B,A) in ].0,PI.[ and
A3: angle(B,A,C) in].0,PI.[ and
A4: A in circle(a,b,r) & B in circle(a,b,r) & C in circle(a,b,r) and
A5: |[a,b]| in LSeg(A,C);
A6: A,B,C are_mutually_distinct by A1,EUCLID_6:20;
    set O = |[a,b]|;
A7: angle(C,B,A) > 0 & angle(C,B,A) < PI by A2,XXREAL_1:4;
A8: angle(B,A,C) >0 & angle(B,A,C)<PI by A3,XXREAL_1:4;
A9: circle(a,b,r)={p where p is Point of TOP-REAL 2: |.p-|[a,b]|.|=r}
    by JGRAPH_6:def 5;
    consider JA be Point of TOP-REAL 2 such that
A10: A=JA and
A11: |.JA-|[a,b]|.|=r by A4,A9;
    consider JB be Point of TOP-REAL 2 such that
A12: B=JB and
A13: |.JB-|[a,b]|.|=r by A4,A9;
    consider JC be Point of TOP-REAL 2 such that
A14: C=JC and
A15: |.JC-|[a,b]|.|=r by A4,A9;
    r is positive by A1,A4,Thm24; then
A16: O<>A & O<>C by A4,Thm25;
A17: angle(C,B,A)<PI by A2,XXREAL_1:4;
A18: |.B-O.|=|.O-C.| & B<>C by A12,A13,A14,A15,A6,EUCLID_6:43;
A19: angle(C,B,O)<PI
    proof
      assume angle(C,B,O)>=PI;
      then angle(O,C,B)>=PI by A18,EUCLID_6:16; then
A20:  angle(A,C,B)>=PI by A5,A16,EUCLID_6:9;
      angle(C,B,A)+angle(B,A,C)+angle(A,C,B)=PI by A17,A6,EUCLID_3:47;
      then
A21:  angle(C,B,A)+angle(B,A,C)=PI - angle(A,C,B);
      angle(B,A,C) <= 0
      proof
        assume
A22:    angle(B,A,C)>0;
        angle(C,B,A)>0 by A2,XXREAL_1:4;
        hence contradiction by A21,A20,A22,XREAL_1:47;
      end;
      hence contradiction by A3,XXREAL_1:4;
    end;
A23: A,O,B is_a_triangle & C,O,B is_a_triangle
    proof
A23a:  r is positive by A1,A4,Thm24; then
A24:  O<>B & O<>A & O<>C by A4,Thm25;
      not A in Line(O,B)
      proof
        assume
A25:    A in Line(O,B);
        B in Line(O,B) by RLTOPSP1:72;
        then Line(A,B)=Line(O,B) by A6,A25,RLTOPSP1:75;
        then O in Line(A,B) & A in Line(A,B) by RLTOPSP1:72; then
A26:    Line(O,A)=Line(A,B) by A4,A23a,Thm25,RLTOPSP1:75;
        O in Line(A,C) & A in Line(A,C) by A5,MENELAUS:12,RLTOPSP1:72; then
        Line(O,A)=Line(A,C) by A4,A23a,Thm25,RLTOPSP1:75;
        then A in Line(A,B) & B in Line(A,B) & C in Line(A,B)
        by A26,RLTOPSP1:72;
        hence contradiction by A1,RLTOPSP1:def 16;
      end;
      hence A,O,B is_a_triangle by A24,MENELAUS:13;
      not C,O,B are_collinear
      proof
        assume
A28:    C,O,B are_collinear;
        then C in Line(O,B) & B in Line(O,B) by A24,MENELAUS:13,RLTOPSP1:72;
        then
A29:    Line(C,B) = Line (O,B) by A6,RLTOPSP1:75;
        C in Line(O,B) & O in Line(O,B) & O<>C by A28,A24,MENELAUS:13,
        RLTOPSP1:72; then
A30:    Line(C,O)=Line(O,B) by RLTOPSP1:75;
A31:    O in Line(A,C) & A in Line(A,C) & C in Line(C,A)
        by A5,MENELAUS:12,RLTOPSP1:72;
        then Line(C,O)=Line(A,C) by A4,A23a,Thm25,RLTOPSP1:75;
        hence contradiction by A30,A31,A29,A1,A6,MENELAUS:13;
      end;
      hence C,O,B is_a_triangle;
    end; then
A32: A,O,B are_mutually_distinct & C,O,B are_mutually_distinct
    by EUCLID_6:20;
    then angle(B,A,O)<PI by A8,A5,EUCLID_6:10; then
A33: angle(B,A,O)+angle(A,O,B)+angle(O,B,A)=PI by A32,EUCLID_3:47;
    |.O-A.|=|.B-O.| by A10,A11,A12,A13,EUCLID_6:43; then
A34: angle(O,A,B)=angle(A,B,O) by A6,EUCLID_6:16;
    |.O-B.|=|.C-O.| by A12,A13,A14,A15,EUCLID_6:43; then
A35: angle(O,B,C)=angle(B,C,O) by A6,EUCLID_6:16;
A36: angle(C,B,O)+angle(O,C,B) + angle (O,B,A)+angle(B,A,O)=PI or
    angle(C,B,O)+angle(O,C,B) + angle (O,B,A)+angle(B,A,O)=-PI
    proof
A37: angle(A,O,B)+angle(B,O,C)=PI or angle(A,O,B)+angle(B,O,C)=3*PI
      by A32,A5,EUCLID_6:13;
      angle(C,B,O)+angle(B,O,C)+angle(O,C,B)=PI by A19,A32,EUCLID_3:47;
      hence thesis by A33,A37;
    end;
    angle(O,C,B)=angle(C,B,O) & angle (B,A,O)=angle(O,B,A)
    proof
      2*PI-angle(C,B,O)=angle(O,B,C) & 2*PI-angle(O,C,B)=angle(B,C,O)
      by A23,Thm20;
      hence angle(O,C,B)=angle(C,B,O) by A35;
      2*PI-angle(O,B,A)=angle(A,B,O) & 2*PI-angle(O,A,B)=angle(B,A,O)
      by A23,Thm20;
      hence thesis by A34;
    end;
    then angle(C,B,O)+angle(O,B,A)=PI/2 or angle(C,B,O)+angle(O,B,A)=-PI/2
    by A36;
    then angle(C,B,A)=PI/2 or angle(C,B,A)+2*PI=PI/2 or
    angle(C,B,A)=-PI/2 or angle(C,B,A)+2*PI=-PI/2 by EUCLID_6:4;
    then angle(C,B,A)=PI/2 or angle(C,B,A)=-3*PI/2 or
    angle(C,B,A)=-PI/2 or angle(C,B,A)=-5*PI/2;
    hence thesis by A7;
  end;
