reserve X for MetrSpace,
  x,y,z for Element of X,
  A for non empty set,
  G for Function of [:A,A:],REAL,
  f for Function,
  k,n,m,m1,m2 for Nat,
  q,r for Real;

theorem
  G is_metric_of A iff (G is Reflexive discerning & for a,b,c being
  Element of A holds G.(b,c) <= G.(a,b) + G.(a,c))
proof
A1: (G is Reflexive discerning & for a,b,c being Element of A holds G.(b,c)
  <= G.(a,b) + G.(a,c)) implies G is_metric_of A
  proof
    assume that
A2: G is Reflexive discerning and
A3: for a,b,c being Element of A holds G.(b,c) <= G.(a,b) + G.(a,c);
A4: for b,c being Element of A holds G.(b,c) = G.(c,b)
    proof
      let b,c be Element of A;
      G.(c,b) <= G.(b,c) + G.(b,b) by A3;
      then
A5:   G.(c,b) <= G.(b,c) + 0 by A2,METRIC_1:def 2;
      G.(b,c) <= G.(c,b) + G.(c,c) by A3;
      then G.(b,c) <= G.(c,b) + 0 by A2,METRIC_1:def 2;
      hence thesis by A5,XXREAL_0:1;
    end;
    for a,b,c being Element of A holds G.(a,c) <= G.(a,b) + G.(b,c)
    proof
      let a,b,c be Element of A;
      G.(a,c) <= G.(b,a) + G.(b,c) by A3;
      hence thesis by A4;
    end;
    then G is Reflexive discerning symmetric triangle by A2,A4,METRIC_1:def 4
,def 5;
    hence thesis by Th3;
  end;
  G is_metric_of A implies (G is Reflexive discerning & for a,b,c being
  Element of A holds G.(b,c) <= G.(a,b) + G.(a,c))
  proof
    assume
A6: G is_metric_of A;
    then
A7: G is Reflexive discerning symmetric triangle by Th3;
    now
      let a,b,c be Element of A;
      G.(b,c) <= G.(b,a) + G.(a,c) by A7,METRIC_1:def 5;
      hence G.(b,c) <= G.(a,b) + G.(a,c) by A7,METRIC_1:def 4;
    end;
    hence thesis by A6,Th3;
  end;
  hence thesis by A1;
end;
