reserve x,y for Real,
  u,v,w for set,
  r for positive Real;

theorem Th49:
  for X being TopSpace, R being non empty SubSpace of R^1 for f,g
  being continuous Function of X,R for A being Subset of X st for x being Point
  of X holds x in A iff f.x <= g.x holds A is closed
proof
  let X be TopSpace;
  let R be non empty SubSpace of R^1;
  let f,g be continuous Function of X,R;
  let A be Subset of X;
  assume
A1: for x being Point of X holds x in A iff f.x <= g.x;
  now
    thus the topology of X is Basis of X by CANTOR_1:2;
    let p be Point of X;
    set r = f.p-g.p;
    reconsider U1 = ].f.p-r/2,f.p+r/2.[, V1 = ].g.p-r/2,g.p+r/2.[ as open
    Subset of R^1 by JORDAN6:35,TOPMETR:17;
    reconsider U = U1/\[#]R, V = V1/\[#]R as open Subset of R by TOPS_2:24;
A2: g"V is open by TOPS_2:43;
    assume
A3: p in A`;
    then
A4: f.p in [#]R by FUNCT_2:5;
    not p in A by A3,XBOOLE_0:def 5;
    then f.p > g.p by A1;
    then reconsider r as positive Real by XREAL_1:50;
A5: f.p < f.p+r/2 by XREAL_1:29;
    take B = f"U /\ g"V;
A6: g.p < g.p+r/2 by XREAL_1:29;
A7: g.p in [#]R by A3,FUNCT_2:5;
    g.p-r/2 < g.p by XREAL_1:44;
    then g.p in V1 by A6,XXREAL_1:4;
    then g.p in V by A7,XBOOLE_0:def 4;
    then
A8: p in g"V by A3,FUNCT_2:38;
    f.p-r/2 < f.p by XREAL_1:44;
    then f.p in U1 by A5,XXREAL_1:4;
    then f.p in U by A4,XBOOLE_0:def 4;
    then
A9: p in f"U by A3,FUNCT_2:38;
    f"U is open by TOPS_2:43;
    hence B in the topology of X & p in B by A9,A8,A2,PRE_TOPC:def 2
,XBOOLE_0:def 4;
    thus B c= A`
    proof
      let q be object;
       reconsider qq=q as set by TARSKI:1;
      assume
A10:  q in B;
      then q in g"V by XBOOLE_0:def 4;
      then g.q in V by FUNCT_2:38;
      then g.q in V1 by XBOOLE_0:def 4;
      then
A11:  g.qq < g.p+r/2 by XXREAL_1:4;
      q in f"U by A10,XBOOLE_0:def 4;
      then f.q in U by FUNCT_2:38;
      then f.q in U1 by XBOOLE_0:def 4;
      then f.qq > f.p-r/2 by XXREAL_1:4;
      then g.qq < f.qq by A11,XXREAL_0:2;
      then not q in A by A1;
      hence thesis by A10,SUBSET_1:29;
    end;
  end;
  then A` is open by YELLOW_9:31;
  hence thesis;
end;
