Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132928 views
License: OTHER
Kernel:
%%html <link href="https://pretextbook.org/beta/mathbook-content.css" rel="stylesheet" type="text/css" /> <link href="https://aimath.org/mathbook/mathbook-add-on.css" rel="stylesheet" type="text/css" /> <style>.subtitle {font-size:medium; display:block}</style> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic" rel="stylesheet" type="text/css" /> <link href="https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext" rel="stylesheet" type="text/css" /><!-- Hide this cell. --> <script> var cell = $(".container .cell").eq(0), ia = cell.find(".input_area") if (cell.find(".toggle-button").length == 0) { ia.after( $('<button class="toggle-button">Toggle hidden code</button>').click( function (){ ia.toggle() } ) ) ia.hide() } </script>

Important: to view this notebook properly you will need to execute the cell above, which assumes you have an Internet connection. It should already be selected, or place your cursor anywhere above to select. Then press the "Run" button in the menu bar above (the right-pointing arrowhead), or press Shift-Enter on your keyboard.

ParseError: KaTeX parse error: \newcommand{\lt} attempting to redefine \lt; use \renewcommand

Sage and Linear Algebra Worksheet: FCLA Section IVLT

Robert Beezer
Department of Mathematics and Computer Science
University of Puget Sound
Fall 2019
Section 1 Invertible Linear Transformations

A carefully-crafted invertible linear transformation from Q5\mathbb{Q}^5 to Q5.\mathbb{Q}^5\text{.}

A = matrix(QQ, [[1, 1, -1, -2, 0], [-3, -2, 1, 4, 7], [2, 2, -1, -3, -4], [-4, -3, 3, 8, 3], [5, 6, -7, -8, 8]]) T = linear_transformation(QQ^5, QQ^5, A, side='right') T
T.is_injective(), T.is_surjective()
T.is_invertible()
S = T.inverse() S

The \* operator, like we would use for multiplication, will create a composition. This will be perfectly natural once we discuss Section MR. Here, composing an invertible linear transformation with its inverse will yield an identity linear transformation.

comp = S*T comp
comp.is_identity()
Section 2 Defining an Invertible Linear Transformation on Bases

Now, an invertible linear transformation defined on a basis, and the resulting inverse linear transformation. We get two “random” bases of Q7\mathbb{Q}^7 from nonsingular (determinant one) matrices.

C = random_matrix(QQ, 7, 7, algorithm='unimodular', upper_bound=99) Cbasis = C.columns() D = random_matrix(QQ, 7, 7, algorithm='unimodular', upper_bound=99) Dbasis = D.columns()

Vector spaces with defined user bases.

Cspace = (QQ^7).subspace_with_basis(Cbasis) Dspace = (QQ^7).subspace_with_basis(Dbasis) Cspace, Dspace

The invertible linear transformation defined with images as the vectors in the codomain basis D.

T = linear_transformation(Cspace, QQ^7, Dbasis) T
T.is_invertible()

Now we simply “turn around” the definition, to make the inverse.

S = linear_transformation(Dspace, QQ^7, Cbasis) S
S.is_invertible()

Composition with vector spaces using different bases does not seem to be working properly. So we just check some random inputs to the composition.

comp = S*T comp.is_identity()
v = random_vector(QQ, 7) v, T(S(v)) == v, S(T(v)) == v
Section 3 Rank and Nullity

A general (i.e. not invertible) linear transformation from Q6\mathbb{Q}^6 to Q5.\mathbb{Q}^5\text{.}

F = matrix(QQ, [[1, 0, 2, -1, -4, 2], [-1, -1, -4, 3, 6, -5], [0, 1, 3, -2, -4, 5], [0, 4, 6, -8, -4, 8], [0, 1, 2, -2, -2, 3]]) R = linear_transformation(QQ^6, QQ^5, F, side='right') R

Rank is dimension of range (image). Note there are not left/right variants.

R.image()
R.rank()

Nullity is dimension of kernel. Note there are not left/right variants.

R.kernel()
R.nullity()

Note that rank and nullity sum to the dimension of the domain (which is 66 here).

This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.