reserve T, T1 for non empty TopSpace;
reserve F,G,H for Subset-Family of T,
  A,B,C,D for Subset of T,
  O,U for open Subset of T,
  p,q for Point of T,
  x,y,X for set;
reserve Un for FamilySequence of T,
  r,r1,r2 for Real,
  n for Element of NAT;
reserve m for Function of [:the carrier of T,the carrier of T:],REAL;

theorem Th28:
  for f be Function of [:X,X:],REAL holds f is_a_pseudometric_of X
  iff for a,b,c be Element of X holds f.(a,a) = 0 & f.(a,c)<=f.(a,b)+f.(c,b)
proof
  let f be Function of [:X,X:],REAL;
  thus f is_a_pseudometric_of X implies for a,b,c be Element of X holds f.(a,a
  ) = 0 & f.(a,c)<=f.(a,b)+f.(c,b)
  proof
    assume
A1: f is_a_pseudometric_of X;
    let a,b,c be Element of X;
    f.(a,c)<=f.(a,b)+f.(b,c) by A1,Lm8;
    hence thesis by A1,Lm8;
  end;
  thus (for a,b,c be Element of X holds f.(a,a) = 0 & f.(a,c)<=f.(a,b)+f.(c,b)
  ) implies f is_a_pseudometric_of X
  proof
    assume
A2: for a,b,c be Element of X holds f.(a,a) = 0 & f.(a,c)<=f.(a,b)+f.( c,b);
A3: for a,b being Element of X holds f.(a,b) = f.(b,a)
    proof
      let a,b be Element of X;
A4:   f.(b,a)<=f.(b,b)+f.(a,b) & f.(b,b)=0 by A2;
      f.(a,b)<=f.(a,a)+f.(b,a) & f.(a,a)=0 by A2;
      hence thesis by A4,XXREAL_0:1;
    end;
    for a, b, c being Element of X holds f.(a,c) <= f.(a,b) + f.(b,c)
    proof
      let x, y, z be Element of X;
      f.(x,z)<=f.(x,y)+f.(z,y) by A2;
      hence thesis by A3;
    end;
    then f is Reflexive symmetric triangle by A2,A3,METRIC_1:def 2,def 4,def 5;
    hence thesis;
  end;
end;
