reserve n for Nat,
        lambda,lambda2,mu,mu2 for Real,
        x1,x2 for Element of REAL n,
        An,Bn,Cn for Point of TOP-REAL n,
        a for Real;
 reserve Pn,PAn,PBn for Element of REAL n,
         Ln for Element of line_of_REAL n;
reserve A,B,C for Point of TOP-REAL 2;
reserve x,y,z,y1,y2 for Element of REAL 2;
reserve L,L1,L2,L3,L4 for Element of line_of_REAL 2;
reserve D,E,F for Point of TOP-REAL 2;
reserve b,c,d,r,s for Real;

theorem Th51:
  A,B,C is_a_triangle &
  A in circle(a,b,r) & B in circle(a,b,r) & C in circle(a,b,r) &
  A,B,D is_a_triangle &
  A in circle(a,b,r) & B in circle(a,b,r) & D in circle(a,b,r) &
  C <> D implies
  the_diameter_of_the_circumcircle(A,B,C)
     = the_diameter_of_the_circumcircle(D,B,C) or
  the_diameter_of_the_circumcircle(A,B,C)
     = - the_diameter_of_the_circumcircle(D,B,C)
  proof
    assume that
A1: A,B,C is_a_triangle &
    A in circle(a,b,r) & B in circle(a,b,r) & C in circle(a,b,r) and
A2: A,B,D is_a_triangle &
    A in circle(a,b,r) & B in circle(a,b,r) & D in circle(a,b,r) and
A3: C<>D;
A4: B,A,C is_a_triangle by A1,MENELAUS:15;
A5: D,B,C is_a_triangle
    proof
A6:   now
        A,B,D are_mutually_distinct by A2,EUCLID_6:20;
        hence D<>B;
        A,B,C are_mutually_distinct by A1,EUCLID_6:20;
        hence B<>C;
        thus D<>C by A3;
      end;
      then
A7:   D,B,C are_mutually_distinct;
      now
        hereby
          assume angle(D,B,C) = PI or angle(B,C,D)=PI or angle(C,D,B)=PI;
          then per cases;
          suppose angle(D,B,C)=PI; then
A8:         B in LSeg(D,C) by EUCLID_6:11;
            B in LSeg(D,B) & B<>C by A6,RLTOPSP1:68;
            hence contradiction by A6,A1,A2,A8,EUCLID_6:30;
          end;
          suppose angle(B,C,D)=PI; then
A9:         C in LSeg(B,D) by EUCLID_6:11;
            C in LSeg(D,C) & C<>D by A3,RLTOPSP1:68;
            hence contradiction by A6,A1,A2,A9,EUCLID_6:30;
          end;
          suppose angle(C,D,B)=PI; then
A10:        D in LSeg(C,B) by EUCLID_6:11;
            D in LSeg(B,D) & B<>D by A6,RLTOPSP1:68;
            hence contradiction by A6,A1,A2,A10,EUCLID_6:30;
          end;
        end;
      end;
      hence thesis by A7,EUCLID_6:20;
    end;
    then
A11: B,D,C is_a_triangle & B,A,C is_a_triangle by A1,MENELAUS:15;
A12: the_diameter_of_the_circumcircle(A,B,C)
       = - the_diameter_of_the_circumcircle(B,A,C) &
    the_diameter_of_the_circumcircle(D,B,C)
       = - the_diameter_of_the_circumcircle(B,D,C) by A1,A5,EUCLID10:47;
      now
        A,B,C are_mutually_distinct by A1,EUCLID_6:20;
        hence A<>B & B<>C & A<>C;
        D,B,C are_mutually_distinct by A5,EUCLID_6:20;
        hence B<>D & C<>D;
      end;
      then
A13:  angle(B,A,C) = angle(B,D,C) or
      angle(B,A,C) = angle(B,D,C) - PI or
      angle(B,A,C) = angle(B,D,C) + PI by A1,A2,EUCLID_6:34;
A14:  now
        assume
A15:    sin angle(B,A,C) = sin angle(B,D,C);
        thus the_diameter_of_the_circumcircle(A,B,C)
           = - the_diameter_of_the_circumcircle(B,A,C) by A1,EUCLID10:47
          .= - - |.C-B.| / sin angle(B,A,C) by A4,EUCLID10:45
          .= - the_diameter_of_the_circumcircle(B,D,C) by A11,EUCLID10:45,A15
          .= the_diameter_of_the_circumcircle(D,B,C) by A5,EUCLID10:47;
      end;
      now
        assume
A16:    sin angle(B,A,C) = - sin angle(B,D,C);
        thus the_diameter_of_the_circumcircle(A,B,C)
           = - the_diameter_of_the_circumcircle(B,A,C) by A1,EUCLID10:47
          .= - - |.C-B.| / sin angle(B,A,C) by A11,EUCLID10:45
          .= (-|.C-B.|) / sin angle(B,D,C) by A16,XCMPLX_1:192
          .= - |.C-B.| / sin angle(B,D,C)
          .= the_diameter_of_the_circumcircle(B,D,C) by A11,EUCLID10:45;
      end;
      hence thesis by A13,Lm2,SIN_COS:79,A14,A12;
  end;
