1
Given two subspaces $U$ and $W$ of a vector space $V\\text{,}$ their sum $U+W$ can be defined as the set $U+W=\\{u+w\\mid u\\in U,\\ w\\in W\\}\\text{,}$ in other words, the set of all possible sums of an element from $U$ and an element from $W\\text{.}$
Notice this is not the direct sum of your text, nor the direct_sum()
method in Sage. However, you can build this subspace in Sage as follows. Grab the bases of $U$ and $W$ individually, as lists of vectors. Join the two lists together by just using a plus sign between them. Now build the sum subspace by creating a subspace of $V$ spanned by this set, by using the .subspace()
method.
In the vector space (QQ^10
) construct two subspaces that you expect to (a) have dimension $5$ or $6$ or so, and (b) have an intersection that is a vector space of dimension $2$ or so. Compare their individual dimensions with the dimensions of the intersection of $U$ and $W$ ($U\\cap W\\text{,}$ .intersection()
in Sage) and the sum $U+W\\text{.}$
Repeat the experiment with the two original vector spaces having dimension $8$ or so, and with the intersection as small as possible. Form a general conjecture relating these four dimensions based on the results of your two (or more)experiments.