
theorem Th16:
  OS_Meas is C_Measure of REAL
proof
  set G = D;
  {} c= union(rng G) & for n being Element of NAT holds G.n is Interval
  by FUNCOP_1:7;
  then reconsider G as Interval_Covering of {}REAL by Def2;
A1: for A being Subset of REAL holds for F being Interval_Covering of A
  holds F vol is nonnegative
  proof
    let A be Subset of REAL;
    let F be Interval_Covering of A;
    for n being Element of NAT holds 0. <= (F vol).n
    proof
      let n be Element of NAT;
      (F vol).n = diameter(F.n) by Def4;
      hence thesis by MEASURE5:13;
    end;
    hence thesis by SUPINF_2:39;
  end;
A2: for A being Subset of REAL holds 0.<= OS_Meas.A
  proof
    let A be Subset of REAL;
A3: 0. is LowerBound of Svc(A)
    proof
      let x be ExtReal;
      assume x in Svc(A);
      then consider F being Interval_Covering of A such that
A4:   x = vol(F) by Def8;
      set y = Ser(F vol).0;
      F vol is nonnegative by A1;
      then
A5:   0. <= y by SUPINF_2:40;
      SUM(F vol) = sup(rng Ser(F vol)) & y <= sup(rng Ser(F vol)) by FUNCT_2:4
,XXREAL_2:4;
      hence thesis by A4,A5,XXREAL_0:2;
    end;
    OS_Meas.A = inf(Svc(A)) by Def10;
    hence thesis by A3,XXREAL_2:def 4;
  end;
  hence OS_Meas is nonnegative by MEASURE1:def 2;
A6: for r being Element of NAT holds 0 <= r implies (G vol).r = 0.
  proof
    let n be Element of NAT;
    diameter(G.n) = diameter({}) by FUNCOP_1:7;
    hence thesis by Def4,MEASURE5:10;
  end;
  then vol(G) = Ser(G vol).0 by A1,SUPINF_2:48
    .= (G vol).0 by SUPINF_2:def 11
    .= 0. by A6;
  then
A7: 0. in Svc({}REAL) by Def8;
  0. is LowerBound of Svc {}REAL
  proof
    let x be ExtReal;
    assume x in Svc({}REAL);
    then
A8: inf Svc({}REAL) <= x by XXREAL_2:3;
    0. <= OS_Meas.{}REAL by A2;
    then 0. <= inf Svc({}REAL) by Def10;
    hence thesis by A8,XXREAL_0:2;
  end;
  then inf Svc {}REAL = 0. by A7,XXREAL_2:56;
  hence OS_Meas.{} = 0 by Def10;
  let A,B be Subset of REAL;
  assume
A9: A c= B;
A10: Svc(B) c= Svc(A)
  proof
    let x be object;
    assume
A11: x in Svc(B);
    then reconsider x as R_eal;
    consider F being Interval_Covering of B such that
A12: x = vol(F) by A11,Def8;
    B c= union(rng F) by Def2;
    then
    ( for n being Element of NAT holds F.n is Interval)& A c= union(rng F
    ) by A9;
    then reconsider G = F as Interval_Covering of A by Def2;
    for n being Element of NAT holds (F vol).n <= (G vol).n
    proof
      let n be Element of NAT;
      (G vol).n = diameter(G.n) by Def4
        .= (F vol).n by Def4;
      hence thesis;
    end;
    then
A13: SUM(F vol) <= SUM(G vol) by SUPINF_2:43;
    for n being Element of NAT holds (G vol).n <= (F vol).n
    proof
      let n be Element of NAT;
      (G vol).n = diameter(G.n) by Def4
        .= (F vol).n by Def4;
      hence thesis;
    end;
    then SUM(G vol) <= SUM(F vol) by SUPINF_2:43;
    then x = vol(G) by A12,A13,XXREAL_0:1;
    hence thesis by Def8;
  end;
  OS_Meas.A = inf Svc(A) & OS_Meas.B = inf Svc(B) by Def10;
  hence OS_Meas.A <= OS_Meas.B by A10,XXREAL_2:60;
  let F be sequence of bool REAL;
  per cases;
  suppose
A14: for n being Element of NAT holds Svc(F.n) <> {+infty};
A16: for n being Element of NAT holds 0. <= (OS_Meas*F).n
    proof
      let n be Element of NAT;
      (OS_Meas*F).n = OS_Meas.(F.n) by FUNCT_2:15;
      hence thesis by A2;
    end;
    then
A17: OS_Meas*F is nonnegative by SUPINF_2:39;
    inf Svc(union rng F) <= sup(rng Ser(OS_Meas*F))
    proof
      set y = inf Svc(union rng F), x = sup(rng Ser(OS_Meas*F));
      assume
A18:  not inf Svc(union rng F) <= sup(rng Ser(OS_Meas*F));
      0. <= (OS_Meas*F).0 by A16;
      then
A19:  0. <= Ser(OS_Meas*F).0 by SUPINF_2:def 11;
      Ser(OS_Meas*F).0 <= x by FUNCT_2:4,XXREAL_2:4;
      then 0. <= x by A19,XXREAL_0:2;
      then consider eps being Real such that
A20:  0. < eps and
A21:  x + eps < y by A18,XXREAL_3:49;
      reconsider eps as Element of ExtREAL by XXREAL_0:def 1;
      consider E being sequence of ExtREAL such that
A22:  for n being Nat holds 0. < E.n and
A23:  SUM(E) < eps by A20,MEASURE6:4;
A24:  SUM(OS_Meas*F) + SUM(E) <= SUM(OS_Meas*F) + eps by A23,XXREAL_3:36;
      defpred P[Element of NAT,set] means ex F0 being Interval_Covering of F.
      $1 st ($2 = F0 & (vol(F0) < inf Svc(F.$1) + E.$1));
A25:  for n being Element of NAT holds ex F0 being Element of Funcs(NAT,
      bool REAL) st P[n,F0]
      proof
        let n be Element of NAT;
A26:    OS_Meas.(F.n) = inf Svc(F.n) & In(0,REAL) is Real by Def10;
        Svc(F.n) <> {+infty} by A14;
        then not Svc(F.n) c= {+infty} by ZFMISC_1:33;
        then Svc(F.n) \ {+infty} <> {} by XBOOLE_1:37;
        then consider x being object such that
A27:    x in Svc(F.n) \ {+infty} by XBOOLE_0:def 1;
        reconsider x as R_eal by A27;
        not x in {+infty} by A27,XBOOLE_0:def 5;
        then
A28:    x <> +infty by TARSKI:def 1;
        x in Svc(F.n) by A27,XBOOLE_0:def 5;
        then inf Svc(F.n) <= x by XXREAL_2:3;
        then inf Svc(F.n) < +infty by A28,XXREAL_0:2,4;
        then inf Svc(F.n) is Element of REAL by A2,A26,XXREAL_0:46;
        then consider S being ExtReal such that
A29:    S in Svc(F.n) and
A30:    S < inf Svc(F.n) + E.n by A22,MEASURE6:5;
        consider FS being Interval_Covering of F.n such that
A31:    S = vol(FS) by A29,Def8;
        reconsider FS as Element of Funcs(NAT,bool REAL) by FUNCT_2:8;
        take FS;
        thus thesis by A30,A31;
      end;
      consider FF being sequence of Funcs(NAT,bool REAL) such that
A32:  for n being Element of NAT holds P[n,FF.n] from FUNCT_2:sch 3(
      A25);
      for n being Element of NAT holds FF.n is Interval_Covering of F.n
      proof
        let n be Element of NAT;
        ex F0 being Interval_Covering of F.n st F0 = FF.n & vol( F0) < inf
        Svc(F.n) + E.n by A32;
        hence thesis;
      end;
      then reconsider FF as Interval_Covering of F by Def3;
A33:  y <= SUM vol(FF) by Th15;
      defpred P1[Element of NAT,Element of ExtREAL] means $2 = (OS_Meas*F).$1
      + E.$1;
A34:  for n being Element of NAT holds ex y being Element of ExtREAL st
      P1[n,y];
      consider G0 being sequence of ExtREAL such that
A35:  for n being Element of NAT holds P1[n,G0.n] from FUNCT_2:sch 3(
      A34);
      for n being Element of NAT holds (vol(FF)).n <= G0.n
      proof
        let n be Element of NAT;
        (ex F0 being Interval_Covering of F.n st F0 = FF.n & vol( F0) <
        inf Svc(F.n) + E.n )& (OS_Meas*F).n = OS_Meas.(F.n) by A32,FUNCT_2:15;
        then vol(FF.n) < (OS_Meas*F).n + E.n by Def10;
        then (vol(FF)).n < (OS_Meas*F).n + E.n by Def7;
        hence thesis by A35;
      end;
      then
A36:  SUM(vol(FF)) <= SUM(G0) by SUPINF_2:43;
      for n being Element of NAT holds 0. <= E.n by A22;
      then E is nonnegative by SUPINF_2:39;
      then SUM(G0) <= SUM(OS_Meas*F) + SUM(E) by A17,A35,Th4;
      then SUM(G0) <= SUM(OS_Meas*F) + eps by A24,XXREAL_0:2;
      then SUM (vol(FF)) <= SUM (OS_Meas*F) + eps by A36,XXREAL_0:2;
      hence thesis by A21,A33,XXREAL_0:2;
    end;
    hence thesis by Def10;
  end;
  suppose
    ex n being Element of NAT st Svc(F.n) = {+infty};
    then consider n being Element of NAT such that
A37: Svc(F.n) = {+infty};
    for n being Element of NAT holds 0. <= (OS_Meas*F).n
    proof
      let n be Element of NAT;
      (OS_Meas*F).n = OS_Meas.(F.n) by FUNCT_2:15;
      hence thesis by A2;
    end;
    then
A38: OS_Meas*F is nonnegative by SUPINF_2:39;
    inf {+infty} = +infty by XXREAL_2:13;
    then OS_Meas.(F.n) = +infty by A37,Def10;
    then (OS_Meas*F).n = +infty by FUNCT_2:15;
    then SUM(OS_Meas*F) = +infty by A38,SUPINF_2:45;
    hence thesis by XXREAL_0:4;
  end;
end;
