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 Th38ThJ8:
  B <> C implies |(A - the_foot_of_the_altitude(A,B,C), B - C)| = 0
  proof
    assume
A1: B <> C;
    consider L1,L2 be Element of line_of_REAL 2 such that
A2: the_altitude(A,B,C) = L1 and
A3: L2 = Line(B,C) & A in L1 & L1 _|_ L2 by A1,Def1;
    per cases;
    suppose not A in Line(B,C);
      then L1 _|_ L2 & L1 = Line(A,the_foot_of_the_altitude(A,B,C)) &
           L2 = Line(B,C) by A1,A2,A3,Th36;
      hence thesis by EUCLID12:48;
    end;
    suppose A in Line(B,C);
      then
A4:   the_foot_of_the_altitude(A,B,C) = A by A1,Th37;
      |(A - the_foot_of_the_altitude(A,B,C), B - C)|
          = |(A,B - C)| - |(the_foot_of_the_altitude(A,B,C),B-C)|
              by EUCLID_2:27
         .= 0 by A4;
      hence thesis;
    end;
  end;
