reserve V for RealLinearSpace;
reserve W,W1,W2,W3 for Subspace of V;
reserve u,u1,u2,v,v1,v2 for VECTOR of V;
reserve a,a1,a2 for Real;
reserve X,Y,x,y,y1,y2 for set;

theorem
  (ex W st the carrier of W = (the carrier of W1) \/ (the carrier of W2)
  ) iff W1 is Subspace of W2 or W2 is Subspace of W1
proof
  set VW1 = the carrier of W1;
  set VW2 = the carrier of W2;
  thus (ex W st the carrier of W = (the carrier of W1) \/ (the carrier of W2))
  implies W1 is Subspace of W2 or W2 is Subspace of W1
  proof
    given W such that
A1: the carrier of W = (the carrier of W1) \/ (the carrier of W2);
    set VW = the carrier of W;
    assume that
A2: not W1 is Subspace of W2 and
A3: not W2 is Subspace of W1;
    not VW2 c= VW1 by A3,RLSUB_1:28;
    then consider y being object such that
A4: y in VW2 and
A5: not y in VW1;
    reconsider y as Element of VW2 by A4;
    reconsider y as VECTOR of V by RLSUB_1:10;
    reconsider A1 = VW as Subset of V by RLSUB_1:def 2;
A6: A1 is linearly-closed by RLSUB_1:34;
    not VW1 c= VW2 by A2,RLSUB_1:28;
    then consider x being object such that
A7: x in VW1 and
A8: not x in VW2;
    reconsider x as Element of VW1 by A7;
    reconsider x as VECTOR of V by RLSUB_1:10;
A9: now
      reconsider A2 = VW2 as Subset of V by RLSUB_1:def 2;
A10:  A2 is linearly-closed by RLSUB_1:34;
      assume x + y in VW2;
      then (x + y) - y in VW2 by A10,RLSUB_1:3;
      then x + (y - y) in VW2 by RLVECT_1:def 3;
      then x + 0.V in VW2 by RLVECT_1:15;
      hence contradiction by A8;
    end;
A11: now
      reconsider A2 = VW1 as Subset of V by RLSUB_1:def 2;
A12:  A2 is linearly-closed by RLSUB_1:34;
      assume x + y in VW1;
      then (y + x) - x in VW1 by A12,RLSUB_1:3;
      then y + (x - x) in VW1 by RLVECT_1:def 3;
      then y + 0.V in VW1 by RLVECT_1:15;
      hence contradiction by A5;
    end;
    x in VW & y in VW by A1,XBOOLE_0:def 3;
    then x + y in VW by A6;
    hence thesis by A1,A11,A9,XBOOLE_0:def 3;
  end;
A13: now
    assume W1 is Subspace of W2;
    then VW1 c= VW2 by RLSUB_1:def 2;
    then VW1 \/ VW2 = VW2 by XBOOLE_1:12;
    hence thesis;
  end;
A14: now
    assume W2 is Subspace of W1;
    then VW2 c= VW1 by RLSUB_1:def 2;
    then VW1 \/ VW2 = VW1 by XBOOLE_1:12;
    hence thesis;
  end;
  assume W1 is Subspace of W2 or W2 is Subspace of W1;
  hence thesis by A13,A14;
end;
