 reserve j for set;
 reserve p,r for Real;
 reserve S,T,F for RealNormSpace;
 reserve x0 for Point of S;
 reserve g for PartFunc of S,T;
 reserve c for constant sequence of S;
 reserve R for RestFunc of S,T;
 reserve G for RealNormSpace-Sequence;
 reserve i for Element of dom G;
 reserve f for PartFunc of product G,F;
 reserve x for Element of product G;
reserve G for RealNormSpace-Sequence;
reserve F for RealNormSpace;
reserve i for Element of dom G;
reserve f,f1,f2 for PartFunc of product G, F;
reserve x for Point of product G;
reserve X for set;

theorem Th52:
for G be RealNormSpace-Sequence,
    x,y,z,w be Point of product G,
    i be Element of dom G,
    d be Real,
    p,q,r be Point of G.i
  st ||. y-x .|| < d & ||. z-x .|| < d & p= proj(i).y & z=reproj(i,y).q
   & r in [. p,q .] & w= reproj(i,y).r
holds ||. w-x .|| < d
proof
   let G be RealNormSpace-Sequence,
       x,y,z,w be Point of product G,
       i be Element of dom G,
       d be Real,
       p,q,r be Point of G.i;
   assume that
A1: ||. y-x .|| < d & ||. z-x .|| < d and
A2: p= proj(i).y & z=reproj(i,y).q and
A3: r in [. p,q .] and
A4: w= reproj(i,y).r;
   set wx = w-x;
   set yx = y-x;
   set zx = z-x;
   reconsider xi = proj(i).x as Point of G.i;
   r in {(1-t)*p + t*q where t is Real: 0 <= t & t <= 1 }
     by A3,RLTOPSP1:def 2; then
   consider t be Real such that
A5: r = (1-t)*p + t*q & 0 <= t & t <= 1;
A6: r = p + t*(q-p) & 0 <= t & t <= 1 by A5,Lm2;
   reconsider wx0 = wx, yx0 = yx, zx0 = zx
      as Element of product carr G by Th10;
   reconsider Nwx = normsequence(G,wx0) as (len G)-element FinSequence of REAL;
   reconsider Nyx = normsequence(G,yx0) as (len G)-element FinSequence of REAL;
   reconsider Nzx = normsequence(G,zx0) as (len G)-element FinSequence of REAL;
   set tyz = (1-t)*yx + t*zx;
   reconsider tyz0 = tyz as Element of product carr G by Th10;
   reconsider Ntyz = normsequence(G,tyz0)
      as (len G)-element FinSequence of REAL;
A7:1 = 1-t+t;
   r = p + (t*q - t*p) by A6,RLVECT_1:34
    .= (p + -t*p) + t*q by RLVECT_1:def 3
    .= (1*p - t*p) + t*q by RLVECT_1:def 8
    .= (1-t)*p + t*q by RLVECT_1:35; then
A8:r-xi = (1-t)*p + t*q - 1*xi by RLVECT_1:def 8
    .= (1-t)*p + t*q - ((1-t)*xi + t*xi) by A7,RLVECT_1:def 6
    .= (1-t)*p + t*q - t*xi - (1-t)*xi by RLVECT_1:27
    .= (1-t)*p +(t*q - t*xi) - (1-t)*xi by RLVECT_1:28
    .= (t*q - t*xi) + ((1-t)*p - (1-t)*xi) by RLVECT_1:def 3
    .= t*(q-xi) + ((1-t)*p - (1-t)*xi) by RLVECT_1:34
    .= t*(q-xi) + (1-t)*(p-xi) by RLVECT_1:34;
   reconsider Swx = wx as (len G)-element FinSequence;
   reconsider Syz = (1-t)*yx + t*zx as (len G)-element FinSequence;
A9:dom Swx = Seg len G & dom Syz = Seg len G by FINSEQ_1:89;
A10:for k be Nat st k in dom Swx holds Swx.k = Syz.k
   proof
    let k be Nat;
    assume k in dom Swx; then
    reconsider k0 = k as Element of dom G by A9,FINSEQ_1:def 3;
    per cases;
    suppose A11: k = i; then
     Swx.k = proj(i).wx0 by Def3; then
A12:  Swx.k = proj(i).w - proj(i).x by Th37;
A13:  proj(i).z = q by A2,Th46;
     Syz.k = proj(i).tyz0 by A11,Def3; then
     Syz.k = proj(i).((1-t)*yx) + proj(i).(t*zx) by Th35; then
     Syz.k = (1-t)*(proj(i).yx) + proj(i).(t*zx) by Th40; then
     Syz.k = (1-t)*(proj(i).yx) + t*proj(i).zx by Th40; then
     Syz.k = (1-t)*(proj(i).y - proj(i).x) + t*proj(i).zx by Th37; then
     Syz.k = (1-t)*(p-xi) + t*(q-xi) by A2,A13,Th37;
     hence Swx.k = Syz.k by A12,A8,A4,Th46;
    end;
    suppose k <> i; then
A14:  proj(k0).y = proj(k0).w & proj(k0).z = proj(k0).y by A2,A4,Th49;
     Swx.k = proj(k0).wx0 by Def3; then
A15:  Swx.k = proj(k0).w - proj(k0).x by Th37;
     Syz.k = proj(k0).tyz0 by Def3
          .= proj(k0).((1-t)*yx) + proj(k0).(t*zx) by Th35
          .= (1-t)*(proj(k0).yx) + proj(k0).(t*zx) by Th40
          .= (1-t)*(proj(k0).yx) + t*proj(k0).zx by Th40; then
     Syz.k = (1-t)*(proj(k0).y - proj(k0).x) + t*proj(k0).zx by Th37; then
     Syz.k = (1-t)*(proj(k0).y - proj(k0).x) + t*(proj(k0).y - proj(k0).x)
        by A14,Th37; then
     Syz.k = (1-t)*proj(k0).y - (1-t)*proj(k0).x
             + t*(proj(k0).y - proj(k0).x) by RLVECT_1:34; then
     Syz.k = (1-t)*proj(k0).y - (1-t)*proj(k0).x
             + (t*proj(k0).y - t*proj(k0).x) by RLVECT_1:34; then
     Syz.k = (1-t)*proj(k0).y - (1-t)*proj(k0).x
             + t*proj(k0).y - t*proj(k0).x by RLVECT_1:def 3; then
     Syz.k = (1-t)*proj(k0).y
             - ((1-t)*proj(k0).x - t*proj(k0).y)
             - t*proj(k0).x by RLVECT_1:29; then
     Syz.k = (1-t)*proj(k0).y
             + (t*proj(k0).y + - (1-t)*proj(k0).x)
             - t*proj(k0).x by RLVECT_1:33; then
     Syz.k = (1-t)*proj(k0).y
             + t*proj(k0).y + - (1-t)*proj(k0).x
             - t*proj(k0).x by RLVECT_1:def 3; then
     Syz.k = ((1-t)+t)*proj(k0).y
             + - (1-t)*proj(k0).x
             - t*proj(k0).x by RLVECT_1:def 6; then
     Syz.k = proj(k0).y
             + - (1-t)*proj(k0).x
             - t*proj(k0).x by RLVECT_1:def 8; then
     Syz.k = proj(k0).y
             + (- (1-t)*proj(k0).x - t*proj(k0).x) by RLVECT_1:28; then
     Syz.k = proj(k0).y
             + (- (t*proj(k0).x + (1-t)*proj(k0).x)) by RLVECT_1:30; then
     Syz.k = proj(k0).y
             + (- (t+(1-t))*proj(k0).x) by RLVECT_1:def 6;
     hence Swx.k = Syz.k by A15,A14,RLVECT_1:def 8;
    end;
   end;
A16:len Nwx = len G & len Ntyz = len G by CARD_1:def 7;
   for k be Element of NAT st k in Seg len Nwx
    holds 0 <= Nwx.k & Nwx.k <= Ntyz.k
   proof
    let k be Element of NAT;
    assume A17: k in Seg len Nwx; then
    reconsider k1 = k as Element of dom G by CARD_1:def 7,FINSEQ_1:def 3;
    reconsider wxk = wx0.k1 as Element of (G.k1);
A18: Nwx.k = ||. wxk .|| by PRVECT_2:def 11;
    wx0.k1 = Syz.k by A10,A17,A16,A9;
    hence thesis by A18,PRVECT_2:def 11;
   end; then
A19: |. Nwx .| <= |. Ntyz .| by A16,PRVECT_2:2;
A20: ||. w-x .|| = (productnorm G).wx by PRVECT_2:def 13;
    ||. (1-t)*yx + t*zx .|| = (productnorm G).tyz by PRVECT_2:def 13
              .= |. normsequence(G,tyz0) .| by PRVECT_2:def 12; then
A21: ||. w-x .|| <= ||. (1-t)*yx + t*zx .|| by A19,A20,PRVECT_2:def 12;
A22: ||. (1-t)*yx + t*zx .|| <= |.1-t.|*||. y-x .|| + |.t.|*||. z-x .||
       by NORMSP_1:5;
A23: |.1-t.| = 1-t & |.t.| = t by A5,ABSVALUE:def 1,XREAL_1:48;
   |.1-t.|*||. y-x .|| + |.t.|*||. z-x .|| < d
   proof
    per cases;
    suppose t=1 or t=0;
     hence thesis by A1,A23;
    end;
    suppose t<>1 & t<>0; then
     0 < t & t < 1 by A5,XXREAL_0:1; then
     0 < t & 1-t > 0 by XREAL_1:50; then
     |.1-t.|*||. y-x .|| < (1-t)*d & |.t.|*||. z-x .|| < t*d
       by A1,A23,XREAL_1:68; then
     |.1-t.|*||. y-x .|| + |.t.|*||. z-x .|| < (1-t)*d + t*d by XREAL_1:8;
     hence thesis;
    end;
   end; then
   ||. (1-t)*yx + t*zx .|| < d by A22,XXREAL_0:2;
   hence ||. w-x .|| < d by A21,XXREAL_0:2;
end;
