reserve n for Nat;
reserve i for Integer;
reserve r,s,t for Real;
reserve An,Bn,Cn,Dn for Point of TOP-REAL n;
reserve L1,L2 for Element of line_of_REAL n;
reserve A,B,C for Point of TOP-REAL 2;
reserve D for Point of TOP-REAL 2;
reserve a,b,c,d for Real;

theorem Th49:
  B <> C & r = -(|(B,C)| -|(C,C)| -|(A,B)|+|(A,C)|)/|(B-C,B-C)|&
  D = r * B + (1 - r) * C & D = C implies C = the_foot_of_the_altitude(A,B,C)
  proof
    assume that
A1: B <> C and
A2: r = -(|(B,C)| -|(C,C)| -|(A,B)|+|(A,C)|)/|(B-C,B-C)| and
A3: D = r * B + (1 - r) * C and
A4: D = C;
    reconsider rB=B,rC=C as Element of REAL 2 by EUCLID:22;
    reconsider n = 2 as Nat;
A5: rB - rC <> 0*n by A1,EUCLIDLP:9;
    0 = -(|(B,C)| -|(C,C)| -|(A,B)|+|(A,C)|)/|(B-C,B-C)|
         by A2,A1,A3,A4,Th12;
    then 0 * |(B-C,B-C)| = -(|(C-A,B-C)|)/|(B-C,B-C)|*|(B-C,B-C)| by Th13;
    then 0 = - |(C-A,B-C)| by A5,EUCLID_4:17,XCMPLX_1:87;
    then |(C-A,C-B)| = 0 by Th14;
    then C = the_foot_of_the_altitude(A,C,B) by A1,Th43;
    hence thesis by A1,Th34;
  end;
