theorem Th28:
  for X,S,f,A holds f is A-measurable iff
  for r being Real holds A /\ less_eq_dom(f,r) in S
proof
  let X,S,f,A;
A1: f is A-measurable implies for r being Real
  holds A /\ less_eq_dom(f,r) in S
  proof
    assume
A2: f is A-measurable;
 for r being Real holds A /\ less_eq_dom(f,r) in S
    proof
      let r be Real;
      defpred P[Element of NAT,set] means
      A /\ less_dom(f,(r+1/($1+1))) = $2;
A3:   for n ex y being Element of S st P[n,y]
      proof
        let n;
        reconsider y=A /\ less_dom(f,(r+1/(n+1))) as Element of S
        by A2;
        take y;
        thus thesis;
      end;
      consider F being sequence of S such that
A4:   for n holds P[n,F.n] from FUNCT_2:sch 3(A3);
   A /\ less_eq_dom(f,r) = meet rng F by A4,Th20;
      hence thesis;
    end;
    hence thesis;
  end;
 (for r being Real holds A /\ less_eq_dom(f,r) in S) implies
  f is A-measurable
  proof
    assume
A5: for r being Real holds A /\ less_eq_dom(f,r) in S;
 for r being Real holds A /\ less_dom(f,r) in S
    proof
      let r be Real;
      defpred P[Element of NAT,set] means
      A /\ less_eq_dom(f,(r-1/($1+1))) = $2;
A6:  for n ex y being Element of S st P[n,y]
      proof
        let n;
        reconsider y=A /\ less_eq_dom(f,(r-1/(n+1))) as Element of S
        by A5;
        take y;
        thus thesis;
      end;
      consider F being sequence of S such that
A7:  for n holds P[n,F.n] from FUNCT_2:sch 3(A6);
  A /\ less_dom(f,r) = union rng F by A7,Th21;
      hence thesis;
    end;
    hence thesis;
  end;
  hence thesis by A1;
end;
