<script>
$(function () {sagecell.makeSagecell({inputLocation: '.sage-DMS', linked: true});});
</script><h5 class="sage">
<span class="type">Sage</span> <span class="acro">DMS</span> <span class="titletext">Dimensions of Matrix Subspaces</span>
</h5>


<p>The theorems in this section about the dimensions of various subspaces associated with matrices can be tested easily in Sage.  For a large arbitrary matrix, we first verify <a class="knowl" acro="RMRT" type="Theorem" title="Rank of a Matrix is the Rank of the Transpose" knowl="./knowls/theorem.RMRT.knowl">Theorem RMRT</a>, followed by the four conclusions of <a class="knowl" acro="DFS" type="Theorem" title="Dimensions of Four Subspaces" knowl="./knowls/theorem.DFS.knowl">Theorem DFS</a>.</p>

<br><br><div class="sage-DMS"><script type="text/x-sage">A = matrix(QQ, [
    [ 1, -2,  3,  2,  0,  2,  2, -1,  3,  8,  0,  7],
    [-1,  2, -2, -1,  3, -3,  5, -2, -6, -7,  6, -2],
    [ 0,  0,  1,  1,  0,  0,  1, -3, -2,  0,  3,  8],
    [-1, -1,  0, -1, -1,  0, -6, -2, -5, -6,  5,  1],
    [ 1, -3,  2,  1, -4,  4, -6,  2,  7,  7, -5,  2],
    [-2,  2, -2, -2,  3, -3,  6, -1, -8, -8,  7, -7],
    [ 0, -3,  2,  0, -3,  3, -7,  1,  2,  3, -1,  0],
    [ 0, -1,  2,  1,  2,  0,  4, -3, -3,  2,  6,  6],
    [-1,  1,  0, -1,  2, -1,  6, -2, -6, -3,  8,  0],
    [ 0, -4,  4,  0, -2,  4, -4, -2, -2,  4,  8,  6]
               ])
m = A.nrows()
n = A.ncols()
r = A.rank()
m, n, r
</script></div>

<br><br><div class="sage-DMS"><script type="text/x-sage">A.transpose().rank() == r
</script></div>

<br><br><div class="sage-DMS"><script type="text/x-sage">A.right_kernel().dimension() == n - r
</script></div>

<br><br><div class="sage-DMS"><script type="text/x-sage">A.column_space().dimension() == r
</script></div>

<br><br><div class="sage-DMS"><script type="text/x-sage">A.row_space().dimension() == r
</script></div>

<br><br><div class="sage-DMS"><script type="text/x-sage">A.left_kernel().dimension() == m - r
</script></div>

<br><br><div class="sage-DMS sagecell-practice"><script type="text/x-sage"># Sage practice area
</script></div>
