This notebook contains an excerpt from the Python Programming and Numerical Methods - A Guide for Engineers and Scientists, the content is also available at Berkeley Python Numerical Methods.

The copyright of the book belongs to Elsevier. We also have this interactive book online for a better learning experience. The code is released under the MIT license. If you find this content useful, please consider supporting the work on Elsevier or Amazon!

Linear Transformations¶

For vectors $$x$$ and $$y$$, and scalars $$a$$ and $$b$$, it is sufficient to say that a function, $$F$$, is a linear transformation if

$F(ax + by) = aF(x) + bF(y).$

It can be shown that multiplying an $${m} \times {n}$$ matrix, $$A$$, and an $${n} \times {1}$$ vector, $$v$$, of compatible size is a linear transformation of $$v$$. Therefore from this point forward, a matrix will be synonymous with a linear transformation function.

TRY IT! Let $$x$$ be a vector and let $$F(x)$$ be defined by $$F(x) = Ax$$ where $$A$$ is a rectangular matrix of appropriate size. Show that $$F(x)$$ is a linear transformation.

Proof: Since $$F(x) = Ax$$, then for vectors $$v$$ and $$w$$, and scalars $$a$$ and $$b$$, $$F(av + bw) = A(av + bw)$$ (by definition of $$F$$)$$=$$$$aAv + bAw$$ (by distributive property of matrix multiplication)$$=$$$$aF(v) + bF(w)$$ (by definition of $$F$$).

If $$A$$ is an $${m} \times {n}$$ matrix, then there are two important subpsaces associated with $$A$$, one is $${\mathbb{R}}^n$$, the other is $${\mathbb{R}}^m$$. The domain of $$A$$ is a subspace of $${\mathbb{R}}^n$$. It is the set of all vectors that can be multiplied by $$A$$ on the right. The range of $$A$$ is a subspace of $${\mathbb{R}}^m$$. It is the set of all vectors $$y$$ such that $$y=Ax$$. It can be denoted as $$\mathcal{R}(\mathbf{A})$$, where $$\mathcal{R}(\mathbf{A}) = \{y \in {\mathbb{R}}^m: Ax = y\}$$. Another way to think about the range of $$A$$ is the set of all linear combinations of the columns in $$A$$, where $$x_i$$ is the coefficient of the ith column in $$A$$. The null space of $$A$$, defined as $$\mathcal{N}(\mathbf{A}) = \{x \in {\mathbb{R}}^n: Ax = 0_m\}$$, is the subset of vectors in the domain of $$A, x$$, such that $$Ax = 0_m$$, where $$0_m$$ is the zero vector (i.e., a vector in $${\mathbb{R}}^m$$ with all zeros).

TRY IT! Let $$A = [[1, 0, 0], [0, 1, 0], [0, 0, 0]]$$ and let the domain of $$A$$ be $${\mathbb{R}}^3$$. Characterize the range and nullspace of $$A$$.

Let $$v = [x,y,z]$$ be a vector in $${\mathbb{R}}^3$$. Then $$u = Av$$ is the vector $$u = [x,y,0]$$. Since $$x,y\in {\mathbb{R}}$$, the range of $$A$$ is the $$x$$-$$y$$ plane at $$z = 0$$.

Let $$v = [0,0,z]$$ for $$z\in {\mathbb{R}}$$. Then $$u = Av$$ is the vector $$u = [0, 0, 0]$$. Therefore, the nullspace of $$A$$ is the $$z$$-axis (i.e., the set of vectors $$[0,0,z]$$ $$z\in {\mathbb{R}}$$).

Therefore, this linear transformation “flattens” any $$z$$-component from a vector.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://pythonnumericalmethods.berkeley.edu/notebooks/chapter14.02-Linear-Transformations.html", "fetch_time": 1670140532000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2022-49/segments/1669446710968.29/warc/CC-MAIN-20221204072040-20221204102040-00873.warc.gz", "warc_record_offset": 505090531, "warc_record_length": 8611, "token_count": 967, "char_count": 2962, "score": 4.25, "int_score": 4, "crawl": "CC-MAIN-2022-49", "snapshot_type": "latest", "language": "en", "language_score": 0.8528731465339661, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00034-of-00064.parquet"}