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
  median(A,A,B)=Line(A,B)
  proof
    per cases;
    suppose
A1:   A <> B;
      the_midpoint_of_the_segment(A,B) in LSeg(A,B) by Th21;
      then the_midpoint_of_the_segment(A,B) in Line(A,B) & A in Line(A,B) &
           the_midpoint_of_the_segment(A,B) <> A
             by A1,Th25,MENELAUS:12,RLTOPSP1:72;
      hence thesis by RLTOPSP1:75;
    end;
    suppose
A2:   A=B;
      reconsider rA=A as Element of REAL 2 by EUCLID:22;
A3:   Line(rA,rA)=Line(A,B) by Th4,A2;
      Line(rA,rA) = {A} by Th3;
      hence thesis by A2,A3,Th60;
    end;
  end;
