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 Th62:
  A,B,C is_a_triangle implies ex D st D in median(A,B,C) & D in median(B,C,A) &
  D in median(C,A,B)
  proof
    assume
A1: A,B,C is_a_triangle;
    set D = the_midpoint_of_the_segment(B,C);
    set E = the_midpoint_of_the_segment(C,A);
    set F = the_midpoint_of_the_segment(A,B);
A2: now
      thus the_midpoint_of_the_segment(B,C) = 1/2 * (B+C) by Th22
                                     .= (1-1/2) * B + 1/2 * C
        by RLVECT_1:def 5;
      thus the_midpoint_of_the_segment(C,A) = 1/2 * (C+A) by Th22
                                     .= (1-1/2) * C + 1/2 * A
        by RLVECT_1:def 5;
      thus the_midpoint_of_the_segment(A,B) = 1/2 * (A+B) by Th22
                                     .= (1-1/2) * A + 1/2 * B
        by RLVECT_1:def 5;
    end;
    then
A3: Line(A,D),Line(B,E),Line(C,F) are_concurrent by A1,Th59;
    reconsider rA=A,rD=D,rB=B,rC=C,rE=E,rF=F as Element of REAL 2 by EUCLID:22;
    Line(rA,rD)=Line(A,D) &
    Line(rB,rE)=Line(B,E) &
    Line(rC,rF)=Line(C,F) by Th4;
    then reconsider LAD = Line(A,D),LBE=Line(B,E),
    LCF=Line(C,F) as Subset of REAL 2;
    now
      assume
A5:   Line(A,D) is_parallel_to Line(B,E) &
      Line(B,E) is_parallel_to Line(C,F) &
      Line(C,F) is_parallel_to Line(A,D);
      F=(1-1/2)*A+1/2*B &
      D=(1-1/2)*B+1/2*C &
      (1-1/2)+1/2*1/2 <> 0 & C,A,B is_a_triangle by A1,A2,MENELAUS:15;
      hence contradiction by A5,MENELAUS:16;
    end;
    hence thesis by A3,MENELAUS:def 1;
  end;
