
theorem Th18:
  for V being RealUnitarySpace, V1 being Subset of V, D being non
  empty set, d1 being Element of D, A being BinOp of D, M being Function of [:
REAL, D:], D, S being Function of [:D,D:],REAL st V1 = D & d1 = 0.V & A = (the
addF of V)||V1 & M = (the Mult of V) | [:REAL,V1:] & S = (the scalar of V)||V1
  holds UNITSTR (# D,d1,A,M,S #) is Subspace of V
proof
  let V be RealUnitarySpace;
  let V1 be Subset of V;
  let D be non empty set;
  let d1 be Element of D;
  let A be BinOp of D;
  let M be Function of [:REAL, D:], D;
  let S be Function of [:D, D:], REAL;
  assume that
A1: V1 = D and
A2: d1 = 0.V and
A3: A = (the addF of V)||V1 and
A4: M = (the Mult of V) | [:REAL,V1:] and
A5: S = (the scalar of V)||V1;
  UNITSTR (# D,d1,A,M,S #) is Subspace of V
  proof
    set W = UNITSTR (# D,d1,A,M,S #);
A6: for a being Real, x being VECTOR of W
      holds a * x = (the Mult of V).[a,x]
    proof let a be Real, x be VECTOR of W;
      reconsider a as Element of REAL by XREAL_0:def 1;
      a * x = (the Mult of V).[a,x] by A1,A4,FUNCT_1:49;
     hence thesis;
    end;
A7: for x,y being VECTOR of W holds x .|. y = (the scalar of V).[x,y]
    by A1,A5,FUNCT_1:49;
A8: for x,y being VECTOR of W holds x + y = (the addF of V).[x,y] by A1,A3,
FUNCT_1:49;
A9: W is RealUnitarySpace-like vector-distributive scalar-distributive
scalar-associative scalar-unital Abelian
    add-associative right_zeroed right_complementable
    proof
      set SV = the scalar of V;
      set MV = the Mult of V;
      set AV = the addF of V;
A10:  for x being VECTOR of W holds jj * x = x
      proof
        let x be VECTOR of W;
        reconsider y = x as VECTOR of V by A1,TARSKI:def 3;
        thus jj * x = jj * y by A6
          .= x by RLVECT_1:def 8;
      end;
A11:  for a,b being Real, x being VECTOR of W holds (a * b) * x =
      a * (b * x)
      proof
        let a,b be Real;
        let x be VECTOR of W;
        reconsider y = x as VECTOR of V by A1,TARSKI:def 3;
        reconsider a,b as Element of REAL by XREAL_0:def 1;
        (a * b) * x = (a * b) * y by A6
          .= a * (b * y) by RLVECT_1:def 7
          .= MV.[a,b * x] by A6
          .= a * (b * x) by A1,A4,FUNCT_1:49;
        hence thesis;
      end;
A12:  for a being Real, x,y being VECTOR of W holds a * (x + y) =
      a * x + a * y
      proof
        let a be Real;
        let x,y be VECTOR of W;
        reconsider x1 = x, y1 = y as VECTOR of V by A1,TARSKI:def 3;
        reconsider a as Element of REAL by XREAL_0:def 1;
        a * (x + y) = MV.[a,x + y] by A1,A4,FUNCT_1:49
          .= a * (x1 + y1) by A8
          .= a * x1 + a * y1 by RLVECT_1:def 5
          .= AV.[MV.[a,x1],a * y] by A6
          .= AV.[a * x, a * y] by A6
          .= a * x + a * y by A1,A3,FUNCT_1:49;
        hence thesis;
      end;
A13:  for x being VECTOR of W holds x + 0.W = x
      proof
        let x be VECTOR of W;
        reconsider y = x as VECTOR of V by A1,TARSKI:def 3;
        thus x + 0.W = y + 0.V by A2,A8
          .= x by RLVECT_1:4;
      end;
     thus W is RealUnitarySpace-like
      proof
        let x,y,z be VECTOR of W;
        reconsider z1 = z as VECTOR of V by A1,TARSKI:def 3;
        reconsider y1 = y as VECTOR of V by A1,TARSKI:def 3;
        reconsider x1 = x as VECTOR of V by A1,TARSKI:def 3;
        let a be Real;
A14:    x = 0.W implies x .|. x = 0
        proof
          assume x = 0.W;
          then x1 .|. x1 = 0 by A2,BHSP_1:def 2;
          then SV.[x1,x1] = 0;
          hence thesis by A7;
        end;
        x .|. x = 0 implies x = 0.W
        proof
          assume x .|. x = 0;
          then SV.[x1,x1] = 0 by A7;
          then x1 .|. x1 = 0;
          hence thesis by A2,BHSP_1:def 2;
        end;
        hence x .|. x = 0 iff x = 0.W by A14;
        0 <= x1 .|. x1 by BHSP_1:def 2;
        then 0 <= SV.[x1,x1];
        hence 0 <= x .|. x by A7;
        SV.[x1,y1] = y1 .|. x1 by BHSP_1:def 1;
        then SV.[x1,y1] = SV.[y1,x1];
        then x .|. y = SV.[y1,x1] by A7;
        hence x .|. y = y .|. x by A7;
A15:    (x + y) .|. z = SV.[x+y, z] by A7
          .= SV.[x1+y1, z] by A8
          .= (x1 + y1) .|. z1
          .= x1 .|. z1 + y1 .|. z1 by BHSP_1:def 2;
        x .|. z + y .|. z = SV.[x, z] + (y .|. z) by A7
          .= (SV.[x, z]) + (SV.[y, z]) by A7
          .= x1 .|. z1 + y1 .|. z1;
        hence (x+y) .|. z = x .|. z + y .|. z by A15;
A16:    a * ( x .|. y ) = a * SV.[x,y] by A7
          .= a * (x1 .|. y1);
        (a*x) .|. y = SV.[(a*x), y] by A7
          .= SV.[(a*x1), y] by A6
          .= (a*x1) .|. y1
          .= a * ( x1 .|. y1 ) by BHSP_1:def 2;
        hence thesis by A16;
      end;
A17:  for a,b being Real, x being VECTOR of W holds (a + b) * x =
      a * x + b * x
      proof
        let a,b be Real;
        let x be VECTOR of W;
        reconsider y = x as VECTOR of V by A1,TARSKI:def 3;
        reconsider a,b as Real;
        (a + b) * x = (a + b) * y by A6
          .= a * y + b * y by RLVECT_1:def 6
          .= AV.[MV.[a,y],b * x] by A6
          .= AV.[a * x,b * x] by A6
          .= a * x + b * x by A1,A3,FUNCT_1:49;
        hence thesis;
      end;
A18:  W is right_complementable
      proof
        let x be VECTOR of W;
        reconsider x1 = x as VECTOR of V by A1,TARSKI:def 3;
        consider v being VECTOR of V such that
A19:    x1 + v = 0.V by ALGSTR_0:def 11;
        v = - x1 by A19,RLVECT_1:def 10
          .= (- 1) * x1 by RLVECT_1:16
          .= (- jj) * x by A6;
        then reconsider y = v as VECTOR of W;
        take y;
        thus thesis by A2,A8,A19;
      end;
A20:  for x,y being Element of W holds x + y = y + x
      proof
        let x,y be Element of W;
        reconsider x1 = x, y1 = y as VECTOR of V by A1,TARSKI:def 3;
        thus x + y = x1 + y1 by A8
          .= y1 + x1
          .= y + x by A8;
      end;
      for x,y,z being VECTOR of W holds (x + y) + z = x + (y + z)
      proof
        let x,y,z be VECTOR of W;
        reconsider x1 = x, y1 = y, z1 = z as VECTOR of V by A1,TARSKI:def 3;
        thus (x + y) + z = AV.[x + y,z1] by A8
          .= (x1 + y1) + z1 by A8
          .= x1 + (y1 + z1) by RLVECT_1:def 3
          .= AV.[x1,y + z] by A8
          .= x + (y + z) by A8;
      end;
      hence thesis by A20,A13,A18,A12,A17,A11,A10;
    end;
    0.W = 0.V by A2;
    hence thesis by A1,A3,A4,A5,A9,Def1;
  end;
  hence thesis;
end;
