Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132935 views
License: OTHER
%auto %html(hide=True) <div class="mathbook-content"> <link rel="stylesheet" type="text/css" href="http://buzzard.ups.edu/mathbook-content.css"> <link rel="stylesheet" type="text/css" href="https://aimath.org/mathbook/mathbook-add-on.css"> </div>
%auto %html(hide=True) <div class="mathbook-content"><div class="hidden-content" style="display:none">\( \newcommand{\lt}{&lt;} \newcommand{\gt}{&gt;} \newcommand{\amp}{&amp;} \)</div></div>
%auto %html(hide=True) <div class="mathbook-content"><table width="90%" style="font-size: 200%;"><tr></tr></table></div>
%auto %html(hide=True) <div class="mathbook-content"><section class="article" id="SLT"></section></div>
%auto %html(hide=True) <div class="mathbook-content"><section class="frontmatter" id="frontmatter-1"></section></div>
%auto %html(hide=True) <div class="mathbook-content"> <h2 class="heading"> <span class="title">Sage and Linear Algebra Worksheet:</span> <span class="subtitle">FCLA Section SLT</span> </h2> <div class="author"> <div class="author-name">Robert Beezer</div> <div class="author-info">Department of Mathematics and Computer Science<br>University of Puget Sound</div> </div> <div class="date">Fall 2019</div> </div>
%auto %html(hide=True) <div class="mathbook-content"><section class="section" id="section-1"><h6 class="heading hide-type"> <span class="type">Section</span> <span class="codenumber">1</span> <span class="title">Surjective Linear Transformations</span> </h6></section></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-1">Two carefully-crafted linear transformations: <code class="code-inline tex2jax_ignore">T</code> is surjective, <code class="code-inline tex2jax_ignore">S</code> is not.</p></div>
A = matrix(QQ, [[2, 2, 5, -2], [2, 3, 1, -4], [-3, -4, -4, 5]]) T = linear_transformation(QQ^4, QQ^3, A, side='right')
T.is_surjective()
%auto %html(hide=True) <div class="mathbook-content"><p id="p-2">The range is known in Sage as the “image.” For a surjective linear transformation, it will be the entire codomain. Note that the image is a vector space.</p></div>
T.image()
T.image() == T.codomain()
B = matrix(QQ, [[1, -2, 0, 3], [3, -5, 1, 7], [-1, 4, 2, -7]]) S = linear_transformation(QQ^4, QQ^3, B, side='right')
S.is_surjective()
IM = S.image() IM
IM == S.codomain()
%auto %html(hide=True) <div class="mathbook-content"><section class="section" id="section-2"><h6 class="heading hide-type"> <span class="type">Section</span> <span class="codenumber">2</span> <span class="title">Pre-Images</span> </h6></section></div>
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-1"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">1</span>.</h6> <p id="p-3">We can create inputs associated with any output. First, we make an arbitrary output, but make sure it really is an output, as a linear combination of a basis of the image (see basis above). We print the two vectors in the opposite of what we would consider the “normal” order.</p></article></div>
bas = IM.basis() out = ()*bas[0] + ()*bas[1] inp = S.preimage_representative(out) out, inp
%auto %html(hide=True) <div class="mathbook-content"><p id="p-4">A check on our work.</p></div>
S(inp)
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-2"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">2</span>.</h6> <p id="p-5">We can make other inputs, using the kernel.</p> <p id="p-6">Any value of <code class="code-inline tex2jax_ignore">new_inp</code> is in the preimage of <code class="code-inline tex2jax_ignore">out</code>, and every element of the preimage can be built this way. Notice the role the kernel plays, much like in the worksheet about injective linear transformations.</p></article></div>
K = S.kernel() K
z = K.random_element() new_inp = inp + z new_inp, S(new_inp)
%auto %html(hide=True) <div class="mathbook-content"><article class="exercise-like" id="exercise-3"><h6 class="heading"> <span class="type">Demonstration</span> <span class="codenumber">3</span>.</h6> <p id="p-7">Elements outside the range (image) will have empty preimages. We mildly “wreck” an element of the range.</p> <p id="p-8">With two initial entries determined by the zeros and ones in the basis vectors, the third entry must be determined, so we can “twiddle” it just a bit to obtain a vector of the codomain that lies outside the range. We will ask Sage for a pre-image representative anyway and see what happens.</p></article></div>
in_range = ()*bas[0] + ()*bas[1] in_range
outside_range = vector(QQ, [ , , ]) S.preimage_representative(outside_range)
%auto %html(hide=True) <div class="mathbook-content"><article class="conclusion" id="conclusion-1"><h5 class="heading"><span></span></h5></article></div>
%auto %html(hide=True) <div class="mathbook-content"><p id="p-9">This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a <a class="external" href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</p></div>
%auto %html(hide=True) <div class="mathbook-content"><table width="90%" style="font-size: 200%;"><tr></tr></table></div>