
theorem Th14:
for A be Subset of [:RNS_Real,RNS_Real:] st
 (for a,b be Real st [a,b] in A holds
   ex Rx be real-membered set st Rx is non empty bounded_above &
      Rx = {r where r is Real : 0 < r & [: ].a-r,a+r.[,].b-r,b+r.[ :] c= A })
holds
  ex F be Function of A,REAL st
   for a,b be Real st [a,b] in A holds
    ex Rx be real-membered set st Rx is non empty bounded_above
      & Rx = {r where r is Real :0 < r & [: ].a-r,a+r.[,].b-r,b+r.[ :] c= A }
      & F.([a,b]) = (upper_bound Rx) / 2
proof
    let A be Subset of [:RNS_Real,RNS_Real:];
    assume
A1:  for a,b be Real st [a,b] in A holds
      ex Rx be real-membered set st Rx is non empty bounded_above
       & Rx = {r where r is Real :0 < r & [: ].a-r,a+r.[,].b-r,b+r.[ :] c= A };

    defpred P[object,object] means
     ex a,b be Real, Rx be real-membered set st $1 = [a,b]
      & Rx is non empty bounded_above
      & Rx = {r where r is Real :0 < r & [: ].a-r,a+r.[,].b-r,b+r.[ :] c= A }
      & $2= (upper_bound Rx)/2;

A2: for x being object st x in A ex y being object st y in REAL & P[x,y]
    proof
     let x be object;
     assume
A3:   x in A; then
     consider a1 be Point of RNS_Real ,b1 be Point of RNS_Real such that
A4:   x = [a1,b1] by PRVECT_3:18;
     reconsider a=a1,b=b1 as Real;
     consider Rx be real-membered set such that
A5:   Rx is non empty bounded_above
    & Rx = {r where r is Real :0< r & [: ].a-r,a+r.[,].b-r,b+r.[ :] c= A }
        by A1,A3,A4;

     take y = (upper_bound Rx)/2;
     thus y in REAL by XREAL_0:def 1;
     thus thesis by A4,A5;
    end;

    consider F being Function of A,REAL such that
A6:  for x being object st x in A holds P[x,F.x] from FUNCT_2:sch 1(A2);

    take F;
    thus for a,b be Real st [a,b] in A holds
      ex Rx be real-membered set st Rx is non empty bounded_above
       & Rx = {r where r is Real :0 < r & [: ].a-r,a+r.[,].b-r,b+r.[ :] c= A}
       & F.([a,b]) = (upper_bound Rx)/2
    proof
     let a,b be Real;
     assume [a,b] in A; then
     consider a1,b1 be Real, Rx be real-membered set such that
A7:  [a,b] = [a1,b1] & Rx is non empty bounded_above
    & Rx = {r where r is Real : 0 < r & [: ].a1-r,a1+r.[,].b1-r,b1+r.[ :] c= A}
    & F.([a,b]) = (upper_bound Rx)/2 by A6;

     a=a1 & b=b1 by A7,XTUPLE_0:1;
     hence thesis by A7;
    end;
end;
