reserve i,n,m for Nat,
  x,y,X,Y for set,
  r,s for Real;

theorem
  for M be MetrStruct,a be Point of M for X be non empty set holds (
  well_dist(a,X) is Reflexive implies M is Reflexive ) & ( well_dist(a,X) is
  symmetric implies M is symmetric ) & ( well_dist(a,X) is triangle Reflexive
implies M is triangle ) & (well_dist(a,X) is discerning Reflexive implies M is
  discerning )
proof
  let M be MetrStruct,A be Point of M;
  let X be non empty set;
  consider x0 be object such that
A1: x0 in X by XBOOLE_0:def 1;
  set w=well_dist(A,X);
  set XX=[:X,(the carrier of M)\{A}:]\/{[X,A]};
  thus
A2: w is Reflexive implies M is Reflexive
  proof
    assume
A3: w is Reflexive;
    now
      let a be Element of M;
      now
        per cases;
        suppose
          a=A;
          then
A4:       [X,a] in XX by Th37;
          hence dist(a,a) = w.([X,a],[X,a]) by Def10
            .= 0 by A3,A4;
        end;
        suppose
          a<>A;
          then
A5:       [x0,a] in XX by A1,Th37;
          hence dist(a,a) = w.([x0,a],[x0,a]) by Def10
            .= 0 by A3,A5;
        end;
      end;
      hence dist(a,a) = 0;
    end;
    hence thesis by METRIC_1:1;
  end;
  thus w is symmetric implies M is symmetric
  proof
    assume
A6: w is symmetric;
    now
      let a,b be Element of M;
      now
        per cases;
        suppose
          a=A & b=A;
          hence dist(a,b)=dist(b,a);
        end;
        suppose
A7:       a=A & b<>A;
          then
A8:       [x0,b] in XX by A1,Th37;
A9:       [X,A] in XX by Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
A10:      X<>x0 by A1;
          then dist(A,A)+dist(A,b) = w.([X,A],[x0,b]) by A9,A8,Def10
            .= w.([x0,b],[X,A]) by A6,A9,A8
            .= dist(b,A)+dist(A,A) by A9,A8,A10,Def10;
          hence dist(a,b)=dist(b,a) by A7;
        end;
        suppose
A11:      a<>A & b=A;
          then
A12:      [x0,a] in XX by A1,Th37;
A13:      [X,A] in XX by Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
A14:      X<>x0 by A1;
          then dist(A,A)+dist(A,a) = w.([X,A],[x0,a]) by A13,A12,Def10
            .= w.([x0,a],[X,A]) by A6,A13,A12
            .= dist(a,A)+dist(A,A) by A13,A12,A14,Def10;
          hence dist(a,b)=dist(b,a) by A11;
        end;
        suppose
A15:      a<>A & b<>A;
          then
A16:      [x0,b] in XX by A1,Th37;
A17:      [x0,a] in XX by A1,A15,Th37;
          hence dist(a,b) = w.([x0,a],[x0,b]) by A16,Def10
            .= w.([x0,b],[x0,a]) by A6,A17,A16
            .= dist(b,a) by A17,A16,Def10;
        end;
      end;
      hence dist(a,b) = dist(b,a);
    end;
    hence thesis by METRIC_1:3;
  end;
  thus w is triangle Reflexive implies M is triangle
  proof
    assume
A18: w is triangle Reflexive;
    now
      let a,b,c be Point of M;
      now
        per cases;
        suppose
          a=A & b=A & c =A;
          then reconsider Xa=[X,a],Xb=[X,b],Xc =[X,c] as Element of XX by Th37;
A19:      dist(a,c)=w.(Xa,Xc) by Def10;
A20:      dist(a,b)=w.(Xa,Xb) by Def10;
          w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A19,A20,Def10;
        end;
        suppose
A21:      a=A & b=A & c <> A;
          dist(a,a)=0 by A2,A18,METRIC_1:1;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A21;
        end;
        suppose
A22:      a=A & b<>A & c = A;
          then reconsider Xa=[X,a],Xb=[x0,b],Xc =[X,c] as Element of XX by A1
,Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
A23:      x0<>X by A1;
          then
A24:      dist(b,c)+dist(a,a)=w.(Xb,Xc) by A22,Def10;
A25:      dist(a,a)=0 by A2,A18,METRIC_1:1;
A26:      w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          dist(a,a)+dist(a,b)=w.(Xa,Xb) by A22,A23,Def10;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A26,A24,A25,Def10;
        end;
        suppose
A27:      a=A & b<>A & c <> A;
          then reconsider
          Xa=[X,a],Xb=[x0,b],Xc =[x0,c] as Element of XX by A1,Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
A28:      x0<>X by A1;
          then
A29:      dist(a,a)+dist(a,b)=w.(Xa,Xb) by A27,Def10;
A30:      dist(a,a)=0 by A2,A18,METRIC_1:1;
A31:      w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          dist(a,a)+dist(a,c)=w.(Xa,Xc) by A27,A28,Def10;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A31,A29,A30,Def10;
        end;
        suppose
A32:      a<>A & b=A & c =A;
          dist(c,c)=0 by A2,A18,METRIC_1:1;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A32;
        end;
        suppose
A33:      a<>A & b=A & c <>A;
          then reconsider
          Xa=[x0,a],Xb=[X,b],Xc =[x0,c] as Element of XX by A1,Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
A34:      x0<>X by A1;
          then
A35:      dist(b,b)+dist(b,c)=w.(Xb,Xc) by A33,Def10;
A36:      dist(b,b)=0 by A2,A18,METRIC_1:1;
A37:      w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          dist(a,b)+dist(b,b)=w.(Xa,Xb) by A33,A34,Def10;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A37,A35,A36,Def10;
        end;
        suppose
A38:      a<>A & b<>A & c = A;
          then reconsider
          Xa=[x0,a],Xb=[x0,b],Xc =[X,c] as Element of XX by A1,Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
A39:      x0<>X by A1;
          then
A40:      dist(b,c)+dist(c,c)=w.(Xb,Xc) by A38,Def10;
A41:      dist(c,c)=0 by A2,A18,METRIC_1:1;
A42:      w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          dist(a,c)+dist(c,c)=w.(Xa,Xc) by A38,A39,Def10;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A42,A40,A41,Def10;
        end;
        suppose
          a<>A & b<>A & c <> A;
          then reconsider
          Xa=[x0,a],Xb=[x0,b],Xc =[x0,c] as Element of XX by A1,Th37;
A43:      dist(a,c)=w.(Xa,Xc) by Def10;
A44:      dist(a,b)=w.(Xa,Xb) by Def10;
          w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A43,A44,Def10;
        end;
      end;
      hence dist(a,c)<=dist(a,b)+dist(b,c);
    end;
    hence thesis by METRIC_1:4;
  end;
  assume
A45: w is discerning Reflexive;
  now
    let a,b be Point of M;
    assume
A46: dist(a,b)=0;
    now
      per cases;
      suppose
        a=A & b=A;
        hence a=b;
      end;
      suppose
A47:    a=A & b<>A;
        then reconsider Xa=[X,a],Xb=[x0,b] as Element of XX by A1,Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
        x0<>X by A1;
        then
A48:    dist(a,a)+dist(a,b)=w.(Xa,Xb) by A47,Def10;
        dist(a,a)=0 by A2,A45,METRIC_1:1;
        then Xa=Xb by A45,A46,A48;
        hence a=b by XTUPLE_0:1;
      end;
      suppose
A49:    a<>A & b=A;
        then reconsider Xa=[x0,a],Xb=[X,b] as Element of XX by A1,Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
        x0<>X by A1;
        then
A50:    dist(a,b)+dist(b,b)=w.(Xa,Xb) by A49,Def10;
        dist(b,b)=0 by A2,A45,METRIC_1:1;
        then Xa=Xb by A45,A46,A50;
        hence a=b by XTUPLE_0:1;
      end;
      suppose
        a<>A & b<>A;
        then reconsider Xa=[x0,a],Xb=[x0,b] as Element of XX by A1,Th37;
        dist(a,b)=w.(Xa,Xb) by Def10;
        then Xa=Xb by A45,A46;
        hence a=b by XTUPLE_0:1;
      end;
    end;
    hence a=b;
  end;
  hence thesis by METRIC_1:2;
end;
