
theorem Th21:
  for A be non empty closed_interval Subset of REAL,
    rho be Function of A,REAL,
    u be PartFunc of REAL,REAL,
    T0,T,T1 be DivSequence of A,
    S0 be middle_volume_Sequence of rho,u,T0,
    S be middle_volume_Sequence of rho,u,T
  st for i be Nat holds T1.(2*i) = T0.i & T1.(2*i+1) = T.i
  ex S1 be middle_volume_Sequence of rho,u,T1
  st for i be Nat holds S1.(2*i) = S0.i & S1.(2*i+1) = S.i
  proof
    let A be non empty closed_interval Subset of REAL,
        rho be Function of A,REAL,
        u be PartFunc of REAL,REAL,
        T0,T,T1 be DivSequence of A,
        S0 be middle_volume_Sequence of rho,u,T0,
        S be middle_volume_Sequence of rho,u,T;
    assume
    A2: for k be Nat holds T1.(2*k) = T0.k & T1.(2*k+1) = T.k;
    reconsider SS0 = S0, SS = S as sequence of (REAL)*;
    deffunc F(Nat) = In(SS0.$1, (REAL)*);
    deffunc G(Nat) = In(SS.$1, (REAL)*);
    consider S1 being sequence of (REAL)* such that
    A3: for n be Nat holds S1.(2*n) = F(n) & S1.(2*n+1) = G(n)
        from INTEGR20:sch 1;
    for i be Element of NAT holds S1.i is middle_volume of rho,u,T1.i
    proof
      let i be Element of NAT;
      consider k be Nat such that
      A4: i = 2*k or i = 2*k+1 by INTEGR20:14;
      reconsider k as Element of NAT by ORDINAL1:def 12;
      per cases by A4;
      suppose
        A5: i = 2*k; then
        S1.i = In(SS0.k, (REAL)*) by A3
            .= S0.k by FUNCT_2:5,SUBSET_1:def 8;
        hence S1.i is middle_volume of rho,u,T1.i by A2,A5;
      end;
      suppose
        A6: i = 2*k + 1; then
        S1.i = In(SS.k, (REAL)*) by A3
            .= S.k by FUNCT_2:5,SUBSET_1:def 8;
        hence S1.i is middle_volume of rho,u,T1.i by A2,A6;
      end;
    end; then
    reconsider S1 as middle_volume_Sequence of rho,u,T1 by INTEGR22:def 6;
    take S1;
    let i be Nat;
    A7: i is Element of NAT by ORDINAL1:def 12;
    A8: S1.(2*i) = In(SS0.i,(REAL)*) by A3
                .= S0.i by A7,FUNCT_2:5,SUBSET_1:def 8;
    S1.(2*i+1) = In(SS.i,(REAL)*) by A3
              .= S.i by A7,FUNCT_2:5,SUBSET_1:def 8;
    hence thesis by A8;
  end;
