
theorem Th21:
  for V be RealNormSpace,
      x be Point of V,
      M be non empty Subspace of V
      st not x in M holds
  ex L be non empty bounded_below real-membered set,
     U be non empty bounded_above real-membered set st
    L = {||.x-m.|| where m is Point of V : m in M} &
    U = { x .|. y where y is Point of DualSp V :
    y in Ort_Comp M & ||.y.|| <= 1 }
    & inf L = sup U & sup U in U
    & ( 0 < inf L implies ex v be Point of DualSp V
    st ||.v.|| = 1 & v in Ort_Comp M & x .|. v = inf L ) &
    for m0 be Point of V
    st m0 in M & ||.x-m0.|| = inf L holds
    for v be Point of DualSp V st ||.v.|| = 1
    & v in Ort_Comp M & x .|. v = inf L
    holds x-m0,v are_parallel
proof
  let V be RealNormSpace,
      x be Point of V,
      M be non empty Subspace of V;
   assume
A1: not x in M;
   reconsider L = {||.x-m.|| where m is Point of V :m in M}
     as non empty bounded_below real-membered set by Th18;
   reconsider U = { x .|. y where y is Point of DualSp V :
     y in Ort_Comp M & ||.y.|| <= 1 } as
     non empty bounded_above real-membered set by Th19;
   take L,U;
   thus L = {||.x-m.|| where m is Point of V :m in M};
   thus U = { x .|. y where y is Point of DualSp V :
   y in Ort_Comp M & ||.y.|| <= 1 };
   set d = inf L;
A2: d = lower_bound L;
A3: now let e be Real;
      assume 0 < e; then
      consider r being Real such that
A4:   r in L & r < d + e by A2,SEQ_4:def 2;
      consider me be Point of V such that
A5:   r = ||.x-me.|| & me in M by A4;
      take me;
      thus ||.x-me.|| < d + e & me in M by A4,A5;
    end;
A6: now let y be Point of DualSp V;
      assume A7: y in Ort_Comp M & ||.y.|| <= 1;
A8:   now let e0 be Real;
        assume A9:0 < e0;
        set e = e0/2;
A10:    0 < e & e < e0 by A9,XREAL_1:216;
        consider me be Point of V such that
A11:    ||.x-me.|| < d + e & me in M by A3,A9;
        me .|. y = 0 by A7,A11,Th16; then
A12:    x .|. y = x.|.y - me.|.y
          .=(x-me) .|. y by Th13;
A13:    |.(x-me) .|. y .| <= ||.x-me.|| * ||.y.|| by Th2;
        ||.x-me.|| * ||.y.|| <= (d + e) * 1
          by XREAL_1:66,A7,A11; then
A14:    |. x .|. y .| <= d + e by A12,A13, XXREAL_0:2;
        x .|. y <= |. x .|. y .| by ABSVALUE:4; then
A15:    x .|. y <= d + e by A14,XXREAL_0:2;
        d + e < d + e0 by XREAL_1:8,A10;
        hence x .|. y < d + e0 by A15,XXREAL_0:2;
      end;
      thus x .|. y <= d
      proof
        assume d < x .|. y; then
        0 < x .|. y - d by XREAL_1:50; then
        x .|. y < d + (x .|. y - d) by A8;
        hence contradiction;
      end;
    end;
A16:
    for r be Real st r in U holds r <= d
    proof
      let r be Real;
      assume r in U; then
      consider y be Point of DualSp V such that
A17:  r =x .|. y & y in Ort_Comp M & ||.y.|| <= 1;
      thus r <=d by A6,A17;
    end;
    reconsider xM = x+M as Subset of (V qua RealLinearSpace);
    reconsider LxM = Lin xM as Subspace of V;
    set S = { a*x + m where a is Real,m is Point of V: m in M };
A44P:
    for z be object holds z in S iff z in the carrier of LxM
    proof
      let z be object;
      hereby assume z in S; then
        consider a be Real,m be Point of V such that
        A18: z= a*x + m & m in M;
        A19: x+2*m -(x+m) =x+2*m -x-m by RLVECT_1:27
        .=2*m -m by RLVECT_4:1
        .=2*m -1*m by RLVECT_1:def 8
        .=(2-1)*m by RLVECT_1:35
        .= m by RLVECT_1:def 8;
        2*m in M by A18,RLSUB_1:21; then
        x+2*m in xM; then
        A20: x+2*m in LxM by RLVECT_3:15;
        x+m in xM by A18; then
        A21P:x+m in LxM by RLVECT_3:15;
        per cases;
        suppose a = 0; then
          z =0.V + m by A18, RLVECT_1:10
          .=m;
          hence z in the carrier of LxM
          by STRUCT_0:def 5,A21P,RLSUB_1:23,A20,A19;
        end;
        suppose A22:a <> 0;
          A23: z= a*x + 1*m by A18,RLVECT_1:def 8
          .=a*x +a*a"*m by A22,XCMPLX_0:def 7
          .=a*x +a*(a"*m) by RLVECT_1:def 7
          .=a*(x+a"*m) by RLVECT_1:def 5;
          a"*m in M by A18,RLSUB_1:21; then
          x+a"*m in xM; then
          z in LxM by A23,RLSUB_1:21,RLVECT_3:15;
          hence z in the carrier of LxM by STRUCT_0:def 5;
        end;
      end;
      assume z in the carrier of LxM; then
      consider l being Linear_Combination of xM such that
      A24: z = Sum l by STRUCT_0:def 5,RLVECT_3:14;
      consider F being FinSequence of V such that
      A25:F is one-to-one & rng F = Carrier l
      & Sum l = Sum (l (#) F) by RLVECT_2:def 8;
      deffunc H1(set) = l . (F /. $1);
      consider G being FinSequence of REAL such that
      A26: len G = len F and
      A27: for n being Nat st n in dom G holds
      G . n = H1(n) from FINSEQ_2:sch 1;
A31:  for i being Nat st i in dom G holds G /. i = l . (F /. i)
      proof
        let i be Nat;
        assume A32: i in dom G;
        hence G /. i = G.i by PARTFUN1:def 6
        .= l . (F /. i) by A32,A27;
      end;
A33:  rng F c= xM by A25,RLVECT_2:def 6;
A34:  for i be Nat st i in dom F holds F.i in xM
      proof
        let i be Nat;
        assume i in dom F; then
        F.i in rng F by FUNCT_1:def 3;
        hence thesis by A33;
      end;
      deffunc H2(set) = (G/.$1)*(F/.$1);
      consider K being FinSequence of the carrier of V such that
A35:  len K = len F and
A36:  for n being Nat st n in dom K holds
      K . n = H2(n) from FINSEQ_2:sch 1;
A40:  dom K = Seg len (l (#) F) by RLVECT_2:def 7,A35,FINSEQ_1:def 3
      .=dom (l (#) F) by FINSEQ_1:def 3;
A41:  dom G = Seg len (l (#) F) by RLVECT_2:def 7,FINSEQ_1:def 3,A26
      .=dom (l (#) F) by FINSEQ_1:def 3;
      for i be Nat st i in dom K holds K.i = (l (#) F).i
      proof
        let i be Nat;
        assume A42: i in dom K;
        hence K.i = (G/.i)*(F/.i) by A36
        .=(l.(F/.i))*(F/.i) by A31,A40,A42,A41
        .= (l (#) F).i by A42,A40,RLVECT_2:def 7;
      end; then
      K = l (#) F by A40;
      hence z in S by A34,A35,A36,Th20,A24,A25,A26;
    end;

    reconsider LLxM = RSubNormSpace(LxM) as SubRealNormSpace of V by Th1;

    A45:the RLSStruct of LLxM = the RLSStruct of LxM by Def1; then
    A46: the carrier of LLxM
    ={ a*x + m where a is Real,m is Point of V: m in M }
    by A44P,TARSKI:2;
    A47: for a1,a2 be Real, m1,m2 be Point of V
    st m1 in M & m2 in M & a1*x+m1 =a2*x+m2
    holds a1=a2 & m1=m2
    proof
      let a1,a2 be Real, m1,m2 be Point of V;
      assume
      A48: m1 in M & m2 in M & a1*x+m1 =a2*x+m2;
      a1*x+m1 - (a2*x+m2)
      = a1*x+m1 - a2*x- m2 by RLVECT_1:27
      .= a1*x-a2*x+m1- m2 by RLVECT_1:def 3
      .= (a1-a2)*x+m1- m2 by RLVECT_1:35; then
      0.V + m2 =(a1-a2)*x+m1- m2 + m2 by RLVECT_1:15,A48;
      then
      A49: m2 =(a1-a2)*x+m1-(m2-m2) by RLVECT_1:29
      .=(a1-a2)*x+m1- 0.V by RLVECT_1:15
      .=(a1-a2)*x+m1; then
      m2 -m1 = (a1-a2)*x by RLVECT_4:1; then
      A50:(a1-a2)*x in M by A48, RLSUB_1:23;
      thus a1=a2
      proof
        assume a1 <> a2; then
        A51: a1-a2 <> 0;
        (a1-a2)"*((a1-a2)*x) in M by A50,RLSUB_1:21; then
        (a1-a2)"*(a1-a2)*x in M by RLVECT_1:def 7; then
        1*x in M by A51,XCMPLX_0:def 7;
        hence contradiction by A1,RLVECT_1:def 8;
      end; then
      m2 = 0.V + m1 by RLVECT_1:10,A49
      .= m1;
      hence thesis;
    end;
    defpred P1[ object, object ] means
    ex m be Point of V, a be Real
    st m in M & $1=a*x + m & $2 = a*d;
    A52: for s being Element of the carrier of LLxM
    ex y being Element of REAL st P1[s,y]
    proof
      let s be Element of the carrier of LLxM;
      s in { a*x + m where a is Real,m is Point of V: m in M }
      by A45,A44P; then
      consider a be Real,m be Point of V such that
      A53: s=a*x + m & m in M;
      reconsider b= a*d as Element of REAL by XREAL_0:def 1;
      take b;
      thus thesis by A53;
    end;
    consider f being Function of the carrier of LLxM,REAL such that
    A54:for x being Element of the carrier of LLxM holds P1[x,f . x]
    from FUNCT_2:sch 3(A52);
T60:
    for s,t be Point of LLxM holds f.(s+t) =f.s+f.t
    proof
      let s,t be Point of LLxM;
      reconsider s1=s,t1=t as Point of LxM by A45;
      consider m1 be Point of V,a1 be Real such that
      A56: m1 in M & s=a1*x + m1 & f.s =a1*d by A54;
      consider m2 be Point of V,a2 be Real such that
      A57: m2 in M & t=a2*x + m2 & f.t=a2*d by A54;
      consider m3 be Point of V,a3 be Real such that
  A58: m3 in M & s+t=a3*x + m3 & f.(s+t)=a3*d by A54;
  A59: s+t =s1+t1 by A45
        .= (a1*x + m1) +(a2*x + m2) by A56,A57,RLSUB_1:13
        .= (a1*x + m1) +a2*x + m2 by RLVECT_1:def 3
        .= a1*x + a2*x+m1+ m2 by RLVECT_1:def 3
        .= (a1 + a2) *x+ m1+ m2 by RLVECT_1:def 6
        .= (a1 + a2) *x+ (m1+ m2) by RLVECT_1:def 3;
        m1+m2 in M by A56,A57,RLSUB_1:20;
        hence f.(s+t) =(a1+a2)*d by A47,A59,A58
        .=f.s+f.t by A56,A57;
      end;
      for s be Point of LLxM,r be Real holds f.(r*s) =r*f.s
      proof
        let s be Point of LLxM,r be Real;
        reconsider s1=s as Point of LxM by A45;
        consider m1 be Point of V,a1 be Real such that
        A61:  m1 in M & s=a1*x + m1 & f.s =a1*d by A54;
        consider m3 be Point of V,a3 be Real such that
        A62:  m3 in M & r*s=a3*x + m3 & f.(r*s) =a3*d by A54;
        A63:  r*s = (the Mult of LLxM).(r,s) by RLVECT_1:def 1
        .=r*s1 by RLVECT_1:def 1,A45
        .= r*(a1*x + m1) by A61,RLSUB_1:14
        .=r*(a1*x) + r*m1 by RLVECT_1:def 5
        .=(r*a1)*x + r*m1 by RLVECT_1:def 7;
        r*m1 in M by A61,RLSUB_1:21;
        hence f.(r*s) = (r*a1)*d by A47,A63,A62
        .=r*f.s by A61;
      end; then
      reconsider f as linear-Functional of LLxM
        by HAHNBAN:def 2,HAHNBAN:def 3,T60;
A64:  0 <= d
      proof
        assume A65: d < 0; then
        consider r being Real such that
A66:    r in L & r < d + ((-d) /2) by SEQ_4:def 2,A2;
        consider m be Point of V such that
A67:    r= ||.x-m.|| & m in M by A66;
        ||.x-m.|| < d/2 by A66,A67;
        hence contradiction by A65;
     end;

    A68: the normF of LLxM
    = ( the normF of V ) | the carrier of LLxM by DUALSP01:def 16;
    A69:for s being VECTOR of LLxM holds |.f.s.| <= 1* ||.s.||
    proof
      let s be VECTOR of LLxM;
      consider m be Point of V,a be Real such that
A70:  m in M & s=a*x + m & f.s =a*d by A54;
A71:  |.f.s.| = |.a.|*|.d.| by COMPLEX1:65,A70
      .=|.a.|*d by A64,COMPLEX1:43;
      per cases;
      suppose a=0;
        hence |.f.s.| <= 1*||.s.|| by A70;
      end;
      suppose A72: a <> 0;
        s = a*x + 1*m by RLVECT_1:def 8,A70
        .= a*x+(a*a")*m by A72,XCMPLX_0:def 7
        .= a*x+ a*(a"*m) by RLVECT_1:def 7
        .=a*(x-(-a"*m)) by RLVECT_1:def 5; then
A73:    ||.s.|| =||.a*(x-(-a"*m)) .|| by A68,FUNCT_1:49
        .= |.a.| * ||.x-(-a"*m).|| by NORMSP_1:def 1;
        a"*m in M by A70, RLSUB_1:21; then
        -a"*m in M by RLSUB_1:22; then
        ||.x-(-a"*m).|| in L; then
A74:    d <= ||.x-(-a"*m).|| by SEQ_4:def 2,A2;
        0 <= |.a.| by COMPLEX1:46;
        hence |.f.s.| <=1*||.s.|| by A71,A73,XREAL_1:64,A74;
      end;
    end; then
    reconsider f as Lipschitzian linear-Functional of LLxM
    by DUALSP01:def 9;
    reconsider pf = f as Point of DualSp LLxM
    by DUALSP01:def 10;
    now let r be Real;
      assume r in PreNorms f; then
      consider t be VECTOR of LLxM such that
A75:  r = |.f.t.| and
A76:  ||.t.|| <= 1;
      |.f.t.| <= 1 * ||.t.|| by A69;
      hence r <= 1 by A75,A76,XXREAL_0:2;
    end; then
A78P: upper_bound PreNorms f <= 1 by SEQ_4:45; then
A78: ||.pf.|| <= 1 by DUALSP01:24;
    consider g being Lipschitzian linear-Functional of V,
    pg being Point of DualSp V such that
    A79: g = pg & g | ( the carrier of LLxM) = f
    & ||.pg.|| = ||.pf.|| by DUALSP01:36;
    A80: ||.pg.|| <= 1 by A78P,A79,DUALSP01:24;
    A81: 1*x + 0.V =x by RLVECT_1:def 8;
    0.V in M by RLSUB_1:17; then
    A82: x in the carrier of LLxM by A46,A81;
    A83: x .|. pg =f.x by A79,FUNCT_1:49,A82;
    consider m be Point of V,a be Real such that
    A84: m in M & x=a*x + m & f.x =a*d by A54,A82;
    A85: 1*x + 0.V = a*x + m by A84,RLVECT_1:def 8;
    0.V in M by RLSUB_1:17; then
    A86P: a=1 by A47,A84,A85;
    for m being VECTOR of V st m in M holds
    m,pg are_orthogonal
    proof
      let m be VECTOR of V;
      assume A87: m in M;
      A88:0*x + m = 0.V + m by RLVECT_1:10
      .= m; then
      A89:m in the carrier of LLxM by A46,A87;
      consider m1 be Point of V,a be Real such that
      A91: m1 in M & m=a*x + m1
      & f.m =a*d by A54,A89;
      a=0 by A87,A88,A91,A47;
      hence m,pg are_orthogonal by A91,A79,FUNCT_1:49,A89;
    end; then
    pg in { v where v is VECTOR of DualSp V
    : for w being VECTOR of V st w in M holds
    w,v are_orthogonal }; then
    A92P:pg in the carrier of
    Ort_Comp M by Def5; then
    A92: pg in Ort_Comp M by STRUCT_0:def 5;
    for s being Real st 0 < s holds
    ex r being Real st r in U & d - s < r
    proof
      let s be Real;
      assume A94: 0 < s;
      take d;
      thus d in U by A92,A86P,A80,A83,A84;
      d-s < d - 0 by XREAL_1:15,A94;
      hence thesis;
    end; then
    HP1: inf L = upper_bound U by A16,SEQ_4:def 1;
    hence inf L = sup U;
    thus sup U in U by A92,A86P,A80,A83,A84,HP1;
    thus 0 < inf L implies
    ex pg be Point of DualSp V st ||.pg.|| = 1
    & pg in Ort_Comp M & x .|. pg = inf L
    proof
      assume
      A95P:0 < inf L;
      now let e be Real;
        assume 0 < e; then
        consider m be Point of V such that
        A96: ||.x-m.|| < d + e & m in M by A3;
        A97: x-m = 1*x -m by RLVECT_1:def 8;
        -m in M by RLSUB_1:22,A96; then
        x-m in the carrier of LLxM by A97,A46; then
        reconsider xm=x-m as Point of LLxM;
        consider m1 be Point of V,a be Real such that
A98:    m1 in M & xm=a*x + m1 & f.xm =a*d by A54;
        -m in M by A96,RLSUB_1:22; then
A100P:  f.xm =1*d by A97,A98,A47
            .=d;
        x-m <> 0.V by RLVECT_1:21,A1,A96; then
A101P:  ||.x-m.|| <> 0 by NORMSP_0:def 5; then
A101:   ||.xm.|| <> 0 by A68,FUNCT_1:49;
        set s = ||.xm.||"*xm;
A102:   ||.s.|| =|.||.xm.||".|* ||.xm.|| by NORMSP_1:def 1
               .= 1 by XCMPLX_0:def 7,A101;
A103:   |.f.s.| =|.||.xm.||"* f.xm.| by HAHNBAN:def 3
               .= ||.xm.||"* d by A100P,A64,COMPLEX1:43;
A104:   ||.xm.|| < d + e by A96,A68,FUNCT_1:49;
        0 < ||.xm.|| by A101P,A68,FUNCT_1:49; then
        (d + e)" < ||.xm.|| " by A104,XREAL_1:88; then
A106:   (d + e)"*d <= |.f.s.| by A103,XREAL_1:64,A64;
        |.f.s.| in PreNorms f by A102; then
        |.f.s.| <= upper_bound PreNorms f by SEQ_4:def 1; then
        (d + e)"*d <= upper_bound PreNorms f by A106,XXREAL_0:2;
        hence (d + e)"*d <= ||.pf.|| by DUALSP01:24;
      end; then
      1<= ||.pf.|| by Lm1,A95P; then
      ||.pf.|| = 1 by A78,XXREAL_0:1;
      hence ex pg be Point of DualSp V
      st ||.pg.|| = 1 & pg in Ort_Comp M
      & x .|. pg = inf L by A79,A86P,A92P,A83,A84,STRUCT_0:def 5;
    end;
    now let m0 be Point of V;
      assume
      A107: m0 in M & ||.x-m0.|| = inf L;
      let pg be Point of DualSp V;
      assume A108: ||.pg.|| = 1
      & pg in Ort_Comp M & x .|. pg = inf L;
      (x-m0) .|. pg = inf L - m0 .|. pg by A108,Th13
      .= inf L - 0 by A107,Th16,A108
      .= ||.x-m0.||*||.pg.|| by A107,A108;
      hence x-m0,pg are_parallel;
    end;
    hence thesis;
  end;
