ASF

Linear Algebra I: Vector Spaces and Linear Maps

Part I of a six-part lecture series converging on the singular value decomposition and geometric algebra.

July 13, 2026|
A
A
SymPy Verification Environment

This lecture includes interactive SymPy cells that verify key results symbolically. SymPy is a Python library for symbolic mathematics. Loading it fetches a WebAssembly Python runtime (approx. 15 MB, cached after first load). You can also load it on demand from any code cell below.

0. Purpose of the series

A chemistry student is asked to balance the combustion of methane. She writes down the skeleton

and then juggles the coefficients until the carbon, hydrogen and oxygen counts agree and arrives at . She is told this is bookkeeping. It is linear algebra. Element conservation is three linear equations in four unknowns. The balanced reaction is a vector in the null space of a matrix. The balance is unique up to overall scale because that null space is one-dimensional. Each fact she was asked to accept as a knack is a theorem proved in this lecture.

The same student, two chapters later, draws an ICE table for the Haber process and solves for the extent of reaction. The table records the amounts

which is a straight line in the space of species amounts. The equilibrium condition that cuts that line is a quartic. Both objects live in the same table and the same variable and differ entirely in kind. Nobody says so. The words that would say so have been worn smooth.

That is the thesis of this series. The subject is taught as matrix manipulation and the manipulation hides the linear maps. Students row-reduce, invert, multiply and take determinants: procedures on arrays of numbers that never name the objects the arrays represent. The damage appears later in every application area the reader meets. A chemical engineer calls an ICE table linear. A deep-learning framework calls an array a tensor. A textbook calls a linear layer. A paper calls attention scores an inner product. Each of these is false, and each has a true replacement that is more useful.

Arc of the series. Part I builds vector spaces, bases, dimension, linear maps, rank-nullity, matrices as coordinate representations, the four fundamental subspaces, Gaussian elimination, and the solution set of , applied to stoichiometry. Part II builds eigenstructure, the Jordan form and the matrix exponential, applied to linear systems of ordinary differential equations. Part III builds inner products, orthogonality and the spectral theorem, applied to the attention mechanism. Part IV builds tensors and the calculus of matrix functions, applied to backpropagation. Part V proves the singular value decomposition and applies it to principal component analysis and low-rank adaptation. Part VI builds geometric algebra, and the six parts converge on one theorem. A linear map moves vectors and also the areas and volumes they span. Part VI extends to act on all of these at once. If the singular values of are , the extension stretches a -dimensional piece spanned by singular directions by a product of of the and stretches -dimensional volume by . That product is . Rotation, stretch, area, volume and determinant are one object. The series ends there.

Prerequisites. Arithmetic and the concept of a function as a rule assigning one output to each input. Nothing else. Matrices are constructed here and no result is used before it is proved.

Relation to the manifolds series. Analysis on Manifolds is self-contained. It builds from scratch the linear algebra that the derivative and exterior algebra require. This series gives the fuller account of the linear side and runs far past what an analysis course has room for. The two are complementary and a reader may take either first.

0.1. Terminology

Before any mathematics, five words. The series uses each in one sense only.

Definition (Terminology used throughout).
  • Function. A rule assigning one output to each input. Its domain and codomain are sets. No structure is assumed, and none is preserved.
  • Map. Reserved for a structure-preserving function, and always qualified: linear map, affine map, multilinear map, smooth map. An unqualified "map" is never written.
  • Linear. A function between vector spaces satisfying for all scalars and all vectors , and nothing else. In particular with is affine, and is named affine at every appearance.
  • Nonlinear. A statement about a function relative to a nominated vector-space structure: the function fails on that structure. The word is empty until the structure is named, and it never means "complicated".
  • Matrix. The coordinate representation of a linear map with respect to a chosen pair of bases. A matrix is never identified with the map it represents, and an array of numbers is never called a tensor.

Each application the series touches has a loose word that hides a fact.

AreaWhat these definitions force you to say
ChemistryElement conservation is linear. The equilibrium condition is nonlinear. An ICE table is the affine set cut by a nonlinear variety, and the two are different objects sharing one variable.
ODEs"Linear ODE" means the operator is linear on a function space. Superposition is that linearity. The solution set of the inhomogeneous equation is affine.
Transformers is affine. The attention score is a bilinear form that is in general neither symmetric nor positive definite so it is not an inner product. Softmax is where the nonlinearity lives.
BackpropagationThe derivative is the linear map. The network is not. Reverse mode is the adjoint of the tangent map. A gradient is a covector until a metric intervenes.
TensorsAn array has no transformation law so it is not a tensor. A PyTorch tensor is an array.

Each row is settled in the part that owns it. The chemistry row is settled in §8 of this lecture.

0.2. Chemical vocabulary

The application running through this lecture is chemical and needs seven words. Ordinary speech uses them loosely, chemists included. The looseness is removed here because each word names a specific part of a matrix.

Definition (Chemical terms used throughout).
  • Element. A kind of atom, fixed by the number of protons in its nucleus: carbon, hydrogen, oxygen, manganese. In this lecture an element is a kind of atom and so a thing to be counted, never a substance. Chemists also say "the element oxygen" for the gas . This lecture never does.
  • Atom. One particle of an element.
  • Molecule. A discrete group of atoms bonded together, such as , or . Not every substance is made of molecules: table salt is an extended ionic lattice and iron is a metallic one so the word is too narrow.
  • Compound. A substance built from more than one element, such as or . So is a molecule and not a compound. The mathematics never asks whether something is a compound and the word appears here only to be set aside.
  • Ion. Anything with a net electric charge, such as , or . A reaction conserves charge exactly as it conserves atoms so charge is counted alongside the elements. §8.1 shows that this adds one row and no new idea.
  • Species. Anything whose amount we choose to track separately. This is the operative word and it is a bookkeeping decision. A species may be a molecule, an ion, a lone atom, a metal or a dissolved solid. Two substances with the same formula are different species whenever the model needs them apart, as -butane and isobutane are in §8.2.
  • Amount. How much of a species is present, in moles. The amounts of all the species in a flask, listed in a fixed order, are the tuple of [tuple].

Elements are counted and species are tracked. The matrix of §8 is built on that distinction so the two words are never swapped.

Chemical wordWhat it is in the linear algebra
ElementA row of the element-species matrix : the covector "count the atoms of this element", in the sense of §4.1.
SpeciesA column of , and an axis of the space of mixtures. Choosing the species list is choosing the coordinate space.
AmountAn entry of the column vector . A mixture is a point.
ReactionA vector in the null space : negative entries for species consumed, positive for species produced.
Conservation lawA vector in the left null space : a covector that every reaction annihilates.
Extent of reactionA coordinate along an affine line in the space of mixtures.
Remark (Species and molecules).

The matrix cannot see chemistry. It sees a column of atom counts so two species with the same atom counts give the same column and the matrix cannot tell them apart.

§8.2 turns this limit into the point. Both -butane and isobutane have the formula and contribute identical columns to . The isomerisation between them changes no atom count. Element conservation therefore permits the reaction. Atom counting cannot forbid it and it happens. The reaction lies in because the difference of two identical columns is zero.

0.3. Boldface notation for vectors

Vectors are set in boldface throughout this series: , and . Scalars are set in ordinary italic: , and . The choice has a history and the alternatives are still in daily use. Each makes a different claim about what a vector is.

Hamilton announced the quaternions in 1844, the year Grassmann's Ausdehnungslehre built the linear theory independently, and in 1846 gave the existing word vector its algebraic sense, for the non-scalar part of a quaternion [6][7]. Neither settled the notation and for fifty years it was a free-for-all. In the lecture notes he printed privately at Yale between 1881 and 1884 and marked not published, Gibbs wrote that "we shall use the small Greek letters to denote vectors, and the small English letters to denote scalars" [8]. Tait did the same. Maxwell set his vectors in German Gothic.

Heaviside rejected the lot. In Electromagnetic Theory he devotes a section to the question. He complains that Greek requires "a considerable familiarity" before it can be manipulated with any facility, dismisses Maxwell's Gothic as an unfortunate choice, and records that he "found salvation in Clarendons" (the printer's name for heavy type) and first used them in 1886. His grounds are practical and typographic: "It is always in stock; it is very neat; it is perfectly legible" [9].

He won. When Wilson wrote the 1901 textbook that put vector analysis into the curriculum, a book founded on Gibbs's lectures and written at Gibbs's suggestion, he kept Gibbs's system and threw out Gibbs's notation: "some typographical difference must be relied upon to distinguish vectors from scalars. Hence in this book Clarendon type is used for setting up vectors and ordinary type for scalars" [10]. The boldface on this page is Heaviside's decision, made for a compositor's type case and spread by Wilson through every course since.

Remark (Boldface in print and by hand).

Wilson's reason applies and so does another. The sum mixes scalars and vectors, and this series mixes scalars, vectors, covectors and arrays in a single line. The weight of the type says which is which before the reader has parsed anything. Boldface is also the handsomest of the four conventions this section surveys: boldface, the handwritten ornaments, plain letters and indices.

Boldface does not suit the hand. It belongs to a type case and no one has produced it with chalk. Cajori's 1929 catalogue puts it exactly: bold-faced type is "satisfactory for print, but inconvenient for writing" [11]. Handwriting acquired its own ornaments, and the two in common use are the arrow and the rightward harpoon .

Neither has a documented origin. Cajori lists the rival conventions of the nineteenth century and dates each and footnotes Argand in 1806, Möbius in 1827 and Bellavitis in 1837. He mentions the arrow without a date, a name or a footnote. The most diligent cataloguer the subject has had could not say where it came from so it had probably been anonymous for a long while.

The choice between the two is a matter of taste and this series takes a side. The harpoon is the better mark on a board: it is quick and unmistakable, and its asymmetry stays clear when drawn badly at speed where the arrow's two barbs blur. The arrow is ungainly on the page and sits above the letter as a decoration. This series omits it. Every theorem below is indifferent to the ink.

One more story has no citation. The underline beneath vectors in handwritten notes is also the printer's mark instructing a compositor to set a letter in bold. It is tempting to conclude that mathematicians underline vectors because they are marking up their own manuscripts. The story is tidy and appears to be documented nowhere. Its tidiness is a reason to distrust it.

Remark (Plain and index notation).

Two other conventions are in use. Each is a deliberate position.

The first uses no ornament. Halmos writes his vectors as plain italic and Axler does the same [2][1]. In a careful text the sentence has already said what kind of object is. This series declines the practice because its subject is the difference between objects that arrays make look alike.

The second is index notation, which names the slots of an object: for a vector, for a covector, for a linear map. It came out of the absolute differential calculus that Ricci and Levi-Civita systematised in 1900 [12]. Einstein added the summation convention in 1916 by suppressing the summation sign [13], and later remarked to a friend that he had made "a great discovery in mathematics" by doing so [14].

Index notation is the most informative of the four conventions. A boldface says that an object is a vector. An index says how the object transforms, and that distinguishes a vector from a list of numbers. The transpose is where this matters first, and §4.1 shows what the superscript conceals. Part IV switches notation for good because of the sentence from §0.1: an array has no transformation law so it is not a tensor.

1. Vector spaces

This section fixes the setting. Everything the series proves concerns vector spaces and the linear maps between them. The axioms come first and the examples follow to show how little the axioms demand.

1.1. Fields

Vectors are scaled by numbers and the numbers must be well behaved. A field has exactly the required good behaviour.

Definition (Field).

A field is a set with two operations, addition and multiplication, and two distinguished elements , such that for all :

  1. Addition is associative and commutative, , and every has an additive inverse .
  2. Multiplication is associative and commutative, , and every has a multiplicative inverse .
  3. Multiplication distributes over addition: .
Example .

The rationals , the reals and the complex numbers are fields. The integers are not: has no multiplicative inverse in . This failure is why §8 must work to get integer coefficients from a chemical balance. The linear algebra gives a line of solutions over and picking the integer point on it is an extra step.

Throughout denotes a field. The reader may read everywhere until Part II, where the complex numbers become unavoidable.

1.2. Vector space axioms

Definition (Vector space).

A vector space over is a set with an addition and a scalar multiplication such that, for all and all :

  1. and .
  2. There is a zero vector with .
  3. Every has an additive inverse with .
  4. and .
  5. and .

Elements of are called vectors and elements of are called scalars.

Remark .

Nothing here mentions arrows, lengths, angles or coordinates. A vector space has no length for a vector and no angle between two of them. Those arrive in Part III with an inner product. An inner product is extra structure. Everything in this lecture is proved without them so every theorem here holds for polynomial spaces and function spaces as for .

Proposition .

In any vector space, and .

Proof

By axiom 5, . Adding to both sides gives . Then , so is the additive inverse of .

Example (Four vector spaces).
  1. Coordinate space. , the set of -tuples with componentwise operations. Everyone meets this example first and it is the least interesting of the four.
  2. Polynomials. , the real polynomials of degree at most , with pointwise addition and scaling. The sum of two such polynomials is one, and a scalar multiple of one is one, so the axioms hold.
  3. Functions. , all functions from a set to , with and . The zero vector is the function that is identically zero.
  4. Solutions of a homogeneous linear ODE. The set of twice-differentiable with . If and solve it so does by inspection of the equation. That closure property, with the zero function in the set, is what [subspace-test] asks of a subset of , and axioms 1 to 5 follow.
Remark (Superposition).

The principle of superposition, which physics courses present as a physical fact about waves, states that a certain solution set is a vector space. The operator is linear and its solution set is . §3 proves that this set is a subspace of the function space. Part II identifies the dimension of that solution space as the order of the equation.

1.3. Subspaces

Definition (Subspace).

A subset is a subspace of if is itself a vector space under the operations inherited from .

Proposition (Subspace test).

A subset is a subspace if and only if and for all and all scalars .

Proof

If is a subspace, both conditions are satisfied by definition. Conversely, suppose both are satisfied. Associativity, commutativity and distributivity are inherited from , since they are identities satisfied by all elements of and therefore by all elements of . The closure condition with gives closure under scaling and with gives closure under addition so the operations restrict to . Additive inverses lie in because by [zero-times-v], and by hypothesis.

Example .

In the plane is a subspace. The plane is not, because it misses the origin. The second set is the affine set that §7 is about, and the distinction between the two is the distinction between linear and affine.

Proposition .

The intersection of any collection of subspaces of is a subspace of .

Proof

Let be subspaces and . Each contains , so . If then both lie in every , hence for every , hence . Apply [subspace-test].

1.4. Coordinate space and Euclidean space

The axioms say what a vector is: an element of a set with the structure of [vector-space]. The most familiar such set was listed as the first example and never built. It is built now from an object that is not a vector.

Definition (Tuple and coordinate space).

An -tuple over is an ordered list of entries , where ordered means that the slot an entry occupies is part of the data: two tuples are equal exactly when they agree slot by slot, so . The set of all of them is the Cartesian product .

Coordinate space is that set equipped with the componentwise operations

The axioms of [vector-space] apply slot by slot because they apply in , with zero vector . When this is real coordinate space .

Remark (Tuples without operations).

A tuple is a list and a vector space is a list together with operations on it. Writing numbers in a row commits you to nothing and the operations need a meaning. Two chemical lists show what that means.

The amounts of the four species in a flask form a tuple , and here the operations mean something: pour two flasks together and the amounts add, double the batch and they scale. Componentwise addition answers to an experiment.

The state of that same flask can be recorded as the tuple , and now componentwise addition answers to nothing. A flask at combined with one at does not give , and no laboratory operation doubles a temperature and a pH together. The vector-space structure on still exists, and nothing chemical answers to it.

Both lists sit in a Cartesian product. Only the first is a vector in any sense a chemist should accept. This is the same discipline [terminology] imposed on the word nonlinear: the structure has to be named before the word means anything.

Remark (Vectors without lists).

The converse failure matters more to this series. A polynomial in is a vector and not a list of numbers. A solution of is a vector and not a list of numbers. Such a vector acquires a list only when a basis is chosen, by [coordinates-unique] below, and a different basis gives the same vector a different list. The tuple is a label and the vector is the thing labelled. §4 draws the consequences.

Definition (Euclidean n-space).

Euclidean -space is together with the dot product

from which the length and the angle are defined. Two vectors are orthogonal if .

Remark (Dot product as added structure).

and Euclidean -space are the same set with different structure. The difference is the dot product. Everything proved in this lecture concerns the vector space and never uses the dot product. Part III adds it under the name inner product.

The extra structure is not always meaningful. In the species-amount space of §8 the formula can be typed. It asserts that is orthogonal to , that a mixture has a length and that two mixtures subtend an angle. No experiment answers to any of that. The standard basis is orthonormal by decree, and the decree is ours. So §5 does not draw the four subspaces at right angles and the conservation laws of §8.2 are derived without a word about perpendicularity.

2. Bases and dimension

This section defines coordinates for a space and proves the fact that makes them trustworthy: every basis of a given space has the same number of elements. The proof rests on the Steinitz exchange lemma, the first real theorem of the subject.

2.1. Span

Definition (Span).

Let . A linear combination of them is a vector with . Their span is the set of all such:

By convention . If , the list spans , and is finite-dimensional.

Proposition .

is a subspace of , and it is the smallest subspace containing every .

Proof

It contains (take every ) and is closed under linear combinations, since , so [subspace-test] applies. Any subspace containing every is closed under linear combinations of them so it contains the span.

2.2. Linear independence

Definition (Linear independence).

A list is linearly independent if the only scalars with

are . Otherwise the list is linearly dependent, and any relation [eq:eq-independence] with some is a dependence relation.

Proposition .

A list with is linearly dependent if and only if some lies in the span of the others.

Proof

If with , then , which lies in the span of the others. Conversely, if , then is a dependence relation with coefficient on .

2.3. Basis and the Steinitz exchange

Definition (Basis).

A basis of is a list of vectors that is linearly independent and spans .

Proposition (Unique coordinates).

The list is a basis of if and only if every has exactly one expression . The scalars are the coordinates of with respect to , written .

Proof

Suppose is a basis. Spanning gives at least one expression. If , then , so independence forces for every . Hence there is exactly one. Conversely, existence of an expression for every is spanning, and uniqueness applied to (whose obvious expression has every coefficient zero) is independence.

Remark .

[coordinates-unique] is the entire content of the phrase "choose coordinates". A basis is a labelling scheme chosen by us and is the label. The vector is indifferent to it. §4 is one long consequence.

The next theorem says that an independent list is never longer than a spanning list. Everything about dimension follows.

Theorem (Steinitz exchange lemma).

Let be a vector space. Suppose is linearly independent and spans . Then , and after reordering the 's the list

also spans .

Proof

We prove by induction on the statement : for , we have and, after a reordering of the 's, the list

spans . The theorem is .

Base case. is the hypothesis that spans , with no 's exchanged in.

Induction step. Assume with . The spanning list of contains in its span so there are scalars with

Some is nonzero. Otherwise is a linear combination of and contradicts the independence of by [dependence-redundancy]. Hence the index range is nonempty and .

Reorder the 's so that . Solving [eq:eq-steinitz-step] for ,

so lies in the span of . Every vector of is a combination of by , and each of those vectors is in turn a combination of the new list, so the new list spans . This is .

The induction runs to , and at each step it produced , so .

Corollary (Well-defined dimension).

If is finite-dimensional, any two bases of have the same length. That common length is the dimension .

Proof

Let and be bases of lengths and . Since is independent and spans, [steinitz] gives . Exchanging the roles gives .

Example .

, with the standard basis , where has a in slot and zeros elsewhere. Likewise , with the basis . The function space is not finite-dimensional: the monomials are independent for every so no finite list can span it, by [steinitz].

Corollary (Extension and reduction).

Let . Every linearly independent list in has length at most and extends to a basis. Every spanning list has length at least and contains a basis. Any independent list of length is already a basis, and so is any spanning list of length .

Proof

The length bounds are [steinitz] against a basis. For extension: given an independent , if it spans we are done; otherwise pick , which keeps the list independent by [dependence-redundancy], and repeat. The process halts by the length bound. For reduction: given a spanning list, delete any vector lying in the span of the others ([dependence-redundancy]), which preserves spanning, and repeat until the list is independent. If an independent list has length and failed to span, an extension would be an independent list of length greater than . This is impossible. The dual argument handles a spanning list of length .

3. Linear maps

This section introduces the linear maps between vector spaces and proves the theorem that governs them.

3.1. Kernel and image

Definition (Linear map).

Let be vector spaces over . A function is a linear map if

The set of linear maps is written , and it is itself a vector space under pointwise operations.

Proposition .

Every linear map satisfies .

Proof

Take in [eq:eq-linearity].

Example (Affine maps).

Fix and with , and let . Then , so is not linear by [linear-fixes-zero]. It is affine: a linear map followed by a translation. The failure is quantitative as well as qualitative, since

which vanishes exactly on the coefficient pairs with . An affine map preserves those combinations, the ones whose coefficients sum to one, and no others. That structure defines an affine space, and an ICE table has it in §8.

The layer in every neural network is this . It is affine and is named affine here and in Parts III and IV.

Definition (Kernel and image).

For , the kernel and image are

The rank of is , and the nullity is .

Proposition .

is a subspace of and is a subspace of .

Proof

puts in both. If then . If then . Apply [subspace-test] twice.

Proposition .

A linear map is injective if and only if .

Proof

If is injective and , then . Conversely, if and , then , so , so .

Remark .

For a general function injectivity is a statement about every pair of points. For a linear map it is a statement about a single subspace, because linearity converts the difference of two collisions into one collision with zero.

3.2. Rank-nullity

Theorem (Rank-nullity theorem).

Let be finite-dimensional and . Then

Proof

Let and let be a basis of , so . Being independent in , it extends by [extend-to-basis] to a basis

We claim is a basis of . Then and [eq:eq-rank-nullity] follows.

Spanning. Let . Write in the basis above. Applying and using ,

so lies in their span.

Independence. Suppose . By linearity , so , so it is a combination of the kernel basis:

That is a relation among the basis vectors of , and they are independent. Hence every (and every ).

Corollary .

Let and . Then is injective if and only if it is surjective, and either condition makes it bijective.

Proof

By [injective-iff-kernel-zero], injectivity is equivalent to . By [eq:eq-rank-nullity] this is equivalent to . Then is a subspace of of full dimension and by [extend-to-basis]. Each step reverses.

Remark .

[square-injective-surjective] fails without finite dimension. On the space of real sequences the right shift is injective and not surjective. [eq:eq-rank-nullity] depends on dimension, and dimension is available only because [dimension-well-defined] made it well defined.

4. Matrices as coordinates

A matrix has not appeared yet. It appears now because a linear map is determined by finitely many scalars once bases are chosen at both ends. Those scalars are the matrix. They belong to the pair of bases as much as to the map. Changing the bases changes every scalar and nothing about the map. Horn and Johnson [3] is the standing reference for the facts below about matrices.

4.1. Matrix arrays and the transpose

The array has to be named before it can be filled.

Definition (Matrices).

An matrix over is a rectangular array of scalars with rows and columns, the entry sitting in row and column . Written out, it is

The first index runs down and the second runs across, so is read "row , column ". This order is fixed for the whole series. The shape is quoted rows first so an matrix is tall when .

Three objects share the letter and are told apart by their type. The scalar entry is italic . The -th column is the boldface with one subscript, and a bare always means this below. The -th row is with a parenthesised superscript, because a row is a different kind of object from a column. The next two remarks explain why.

The set of them is , and it is a vector space under entrywise addition and scaling, for the reason is one: the axioms apply entry by entry. Its dimension is , with basis the matrices with a single .

A column vector is an matrix and a row vector is a matrix. Coordinate vectors are columns throughout this series: is identified with . Then is a column and is a matrix product.

Definition (Transpose).

The transpose of is the matrix with

Rows become columns and columns become rows. A matrix with is symmetric, which forces it to be square.

Proposition .

For matrices of compatible shapes and any scalar ,

Proof

The first three are entrywise and immediate from [transpose]. For the last, let be and be . Both sides are so compare entries:

The order reverses, and it has to: the shapes compose in no other way.

Remark (Rows and columns).

A row of numbers and a column of numbers contain the same data and nothing in the two lists tells them apart. What tells them apart is what they do.

A column is a vector. A row is a function on vectors, namely

and that function is linear so it is an element of . The space of linear functions from a space to its scalars is the dual space. Its elements are covectors and Part IV builds the space properly. Columns are vectors, rows are covectors, and the transpose is the passage between them.

That passage looks free and is not. Turning the column into the row is a choice of which covector to attach to a given vector. The notation makes the choice licensed by the dot product of [euclidean-space]: the covector is the function . Without the dot product no vector has a preferred row. This is the sentence "a gradient is a covector until a metric intervenes" from §0.1. Part III must work for what Part I gets by writing a superscript.

The chemistry is already built this way and nobody says so. The element-species matrix of §8.1 has one row per element, and row is the covector "count the atoms of element in this mixture": it eats an amounts column and returns a number. The rows of are not amounts of anything. They are functions on amounts and live in a different space from the mixtures they measure. §8.2 states that the conserved quantities of a network are exactly the covectors annihilating every reaction. A conservation law is a row, and that is why it is found in the null space of a transpose.

Remark (Index notation and the transpose).

Boldface names an object and says nothing about its slots. Index notation names the slots, and on the transpose it is the more accurate of the two.

Give a vector an upper index and a covector a lower one, as in [transpose] and the remark above:

The product is a scalar because an upper slot is contracted with a lower one of the opposite kind. In this notation a linear map is , one slot of each kind, since it eats a vector and returns a vector. A bilinear form is , two lower slots, since it eats two vectors and returns a scalar. Boldface writes both as a square array and hides the difference. Index notation shows it because the slots are written down.

The symbol is doing two different things.

For a map the transpose is the dual map , which takes the covector on to the covector on . In indices it is the same array with its slots read in the other order and no entry moves. This transpose is free. It needs no inner product, no basis and no structure beyond linearity. §5 uses it to form and §8.2 calls its elements conservation laws.

For a map , written , the transpose asks for the array , which requires interchanging an upper slot with a lower one. No vector space provides that operation. It becomes legal when a metric lowers the upper index and raises the lower one, and in the metric quietly supplied is the dot product of [euclidean-space]. So the superscript conceals a choice: the passage from a column to a row identified in the remark above.

Two consequences follow. A symmetric matrix and a self-adjoint operator are different statements. is a property of a bilinear form and needs nothing. for an operator is a property relative to a metric, and Part III separates them. The reason for the index notation of Part IV is visible in miniature: the position of a slot records what transforms and how, and boldface has no place to write it. This is the sentence "an array has no transformation law so it is not a tensor" from §0.1.

4.2. Matrix of a linear map

Proposition .

Let be a basis of . For any vectors there is exactly one linear map with for every .

Proof

Existence: define . It is well defined because the coordinates are unique ([coordinates-unique]), and is linear by inspection. Uniqueness: two linear maps agreeing on a basis agree on every linear combination of it, hence on .

Definition (Matrix of a linear map).

Let , let be a basis of and a basis of . Expand each image in :

The array is the matrix of with respect to and . Its -th column is .

Proposition .

With the notation of [matrix-of-map], for every

where the right-hand side is the usual matrix-times-column product. For with a basis of ,

Proof

Write . Then by linearity and [eq:eq-matrix-def], , and the bracket is the -th entry of . Uniqueness of coordinates gives the first claim. Applying it twice, for every , and a matrix is determined by its action on the coordinate vectors .

Remark (Origin of matrix multiplication).

Matrix multiplication is forced. It is the unique rule that makes the array of a composition equal the product of the arrays. Its associativity, verified by index gymnastics in most courses, is the associativity of composition of functions.

4.3. Change of basis and similarity

Definition (Change-of-basis matrix).

Let and be bases of . The change-of-basis matrix has -th column and satisfies for every .

Proposition .

is invertible, with .

Proof

By [matrix-acts-on-coordinates], , and symmetrically in the other order.

Theorem (Similarity of matrix representations).

Let and let be bases of with change-of-basis matrix . Write and . Then

Two square matrices related in this way are called similar, and similarity is precisely the relation "these are the same linear map, written in two coordinate systems".

Proof

Write and apply [matrix-acts-on-coordinates] to the composition and read the bases right to left:

Remark (Matrix as shadow).

Read [eq:eq-similarity] in those terms. The two sides are arrays of numbers that in general share no entry. They represent one linear map. Turning the basis changed our description of and nothing about . Any number computed from that is a statement about must therefore be invariant under [eq:eq-similarity]. The trace and the determinant are two such numbers and the eigenvalues are another, the subject of Part II. The entries of are not.

Panel one draws the linear map with no frame present: the image of the unit sphere under with the directions leaves invariant. Panel two is a basis you may rotate. Panel three is the array of components. Turning the frame churns the nine numbers under [eq:eq-similarity], and the object in panel one does not move because the map never heard of your basis. The trace and the determinant stay fixed while the entries move.

This lecture offers one control and Part IV adds a second. Rotations are gentle: an orthogonal change of basis is the special case in which several inequivalent transformation laws agree so an array can be mistaken for a tensor indefinitely. Part IV unlocks the shear, the agreement collapses and the array is caught.

5. Four fundamental subspaces

A matrix has four subspaces, two in the source and two in the target. This section defines them and proves the theorem tying them together: a matrix has the same rank read by rows as read by columns. Strang [4] organises the subject around these four.

Definition (Four fundamental subspaces).

Let , regarded as the linear map from to in the standard bases.

  • The column space and equals .
  • The null space and equals .
  • The row space .
  • The left null space and equals , since and are the same equation transposed.
Remark .

The column space is the image, so is solvable exactly when . §7 treats this. The left null space is the set of linear relations satisfied by the rows of : a vector in it says that the combination vanishes. §8 takes for a matrix whose columns are reactions and reads these relations as conservation laws.

Courses often draw these four subspaces with right angles between them, since and are orthogonal complements. That picture needs an inner product, which we do not have and do not need here. Orthogonality is deferred to Part III, and every statement below is proved without it.

Remark (Null space and kernel).

Two names have been given to one set. For a fixed the null space is the kernel of the map in the sense of [kernel-image], so element for element and every theorem in this section remains true when one symbol replaces the other. The distinction is in what each symbol takes as its argument.

takes a map. It is defined for any before a basis has been chosen, and is a subspace of itself. The word also belongs to algebra at large, where the kernel of a group homomorphism is a normal subgroup and the kernel of a ring homomorphism is an ideal, in each case the preimage of zero. takes an array. An array has no kernel at all until bases have been fixed at both ends, and is a space of coordinate columns sitting in , a different vector space from .

The following makes the distinction precise.

Proposition .

Let with , let be bases of with , and write and as in [eq:eq-similarity]. Then the kernel is read in coordinates by

and the null space transforms under a change of basis by

In particular .

Proof

By [matrix-acts-on-coordinates], , and coordinates are unique ([coordinates-unique]), so holds if and only if . This is [eq:eq-kernel-in-coordinates] for . The same argument in gives the other half. For [eq:eq-null-space-transforms] use that is invertible ([p-invertible]):

The dimension claim follows because is an isomorphism, as is the coordinate map .

Remark (Kernel as object).

Read [eq:eq-null-space-transforms] against §4.3. For one map and two bases the null spaces and are in general different subspaces of with no vector in common beyond . The kernel did not move: [eq:eq-kernel-in-coordinates] says the two are one subspace of , namely , written in two coordinate systems. The kernel is the object and the null space is its shadow, as the map is the object and the matrix is its shadow. The invariant is the dimension, named the nullity. So the theorem of §3.2 is called rank-nullity: it counts the quantity on which both notations agree.

The convention from here on is that is written when the object is a map, as in §3, and when the object is an array of numbers, as in the rest of this lecture, where , and arrive with their entries given and the standard bases understood. Where the bases are standard and no other basis is in play the shadow is faithful and the choice of symbol makes no difference.

Remark (Null vectors and radicals).

The word has a second and unrelated use once a bilinear form is present, in Part III. Given a symmetric bilinear form with quadratic form , a null vector is one with , and those form a cone: on with , both and are null while their sum is not. The subspace attached to a form is its radical, , and that one is a null space in the sense of [four-subspaces] since it equals for the Gram matrix of . For an inner product the radical and the null cone are both so the two senses never collide in a first course. They collide immediately in relativity, where the null cone is the light cone and has nothing to do with any kernel.

Theorem (Equality of row rank and column rank).

For any , . The common value is the rank of .

Proof

Let and let be a basis of the column space. Assemble them as the columns of a matrix .

Every column of lies in the column space so it has an expansion for unique scalars . Collecting the coefficients into , this reads

Now read [eq:eq-rank-factorisation] by rows. The -th row of is so every row of lies in the span of the rows of . Hence

The bound holds for every matrix so apply it to , whose row space is the column space of and whose column space is the row space of :

The two inequalities force equality.

Remark .

The factorisation [eq:eq-rank-factorisation] says every rank- matrix is a product of a tall matrix and a wide one with the inner dimension equal to the rank. That is the shape of a low-rank approximation, a bottleneck layer and the update in low-rank adaptation. Part V returns to it with the singular value decomposition, which picks the best such factorisation of each rank.

Corollary .

, and by [eq:eq-rank-nullity] applied to and to ,

Proof

Immediate from [row-rank-col-rank] and [rank-nullity], the latter applied to the linear map on and to on .

6. Gaussian elimination

Five sections have defined much and computed almost nothing. The four subspaces of [four-subspaces] exist and nothing so far says how to find a basis of any of them. This section gives the algorithm and proves what it does. That is less than the folklore claims: elimination leaves two of the four subspaces where they were and moves the other two.

Nothing above depends on elimination.

6.1. Augmented matrix

A system of linear equations in unknowns , written out in full, is

which is for the array [eq:eq-general-matrix] of [matrix-array], the column and the column . The names , the plus signs and the equals signs are identical in every system ever written and have no information about this one. Delete them. The coefficients and the right-hand side remain, and the array containing both is the object the algorithm works on.

Definition (Block juxtaposition and the augmented matrix).

Let and have the same number of rows. Their juxtaposition is the matrix whose first columns are the columns of and whose last columns are the columns of .

The augmented matrix of the system [eq:eq-general-system] is the case , :

Remark (Bar in the augmented matrix).

The bar is punctuation. [eq:eq-augmented] is an ordinary matrix with a rank and four subspaces like any other, and every theorem below applies to it with the bar erased. The bar records the reader's intention: columns through are coefficients of unknowns, column is data and no unknown is ever solved for column . That intention has one mathematical consequence, [consistency]: the system is solvable precisely when the augmented column is not a pivot column, equivalently when adjoining adds no new direction to the column space.

Row of [eq:eq-augmented] is one equation. Write for it, and for the coefficients alone, row of . The bold subscripted is reserved for the -th column of throughout. Then is the equation . The whole array is the list of equations. A row is an equation and a column is an unknown.

The augmented form is the right object because elimination cannot tell the blocks apart. That is the only fact to check before the algorithm is applied to it.

Proposition (Parallel elimination of blocks).

For any and any and ,

Proof

Column of a product is applied to column of , and a column of is a column of or a column of . So the first columns of are the columns of and the last are the columns of .

Remark (Three uses of the same trick).

Row operations are left multiplications ([elementary-invertible]) so by [eq:eq-block-product] a sweep that takes to takes any block beside it to whatever is. Choose the passenger and the same algorithm answers three different questions.

  1. , with . The reduced system has the solutions of the original one, since is invertible, and §7 reads them off.
  2. , since . The identity block is a recorder: it starts as , undergoes every operation the left block does and ends as the product of all of them. §6.5 gets the left null space from it. When is square and invertible and .
  3. . Several right-hand sides need one sweep because the left block does not know how many passengers it has.

An augmented matrix is an ordinary matrix with a passenger, and [eq:eq-block-product] is why the passenger arrives at the right place.

6.2. Row operations as invertible matrices

Definition (Elementary row operations).

An elementary row operation on a matrix is one of:

  1. Swap. Exchange rows and .
  2. Scale. Multiply row by a scalar .
  3. Replace. Add times row to row , with .

The elementary matrix of an operation is the result of applying it to the identity .

Performed on the augmented array [eq:eq-augmented], whose -th row is , the three are

and every other row is left alone. Each operation acts on the whole row, all entries of it. The augmented entry is a passenger and never a spectator: scaling to , with the right-hand side left behind, states a different equation with a different solution set, and the elimination would answer a question nobody asked. The arithmetic runs straight through the bar.

The unknowns get no such licence. Rows may be swapped, scaled and combined but columns may not. A column operation is a right multiplication . It mixes the unknowns and sends to so the vectors read out at the end would answer a system in different variables. Gaussian elimination moves rows and the columns stay where they are put. The single exception is a permutation of columns, a relabelling of the unknowns used only for tidiness in [eq:eq-reduced-block] below.

Proposition .

Performing an elementary row operation on is the same as forming , where is the elementary matrix of that operation. Every elementary matrix is invertible, and its inverse is elementary of the same type.

Proof

Row of a product is so left multiplication forms combinations of the rows of with coefficients read from the rows of . Take to be the identity with the operation applied to it, and read this formula off row by row: for the swap, rows and of are and , which select rows and of ; for the scale, row is , which returns times row ; for the replace, row is , which returns row plus times row . Every other row of is and passes row through unchanged.

Each operation is undone by one of the same type: a swap by itself, a scale by by a scale by , a replace by by a replace by . The corresponding elementary matrices therefore multiply to in both orders.

Proposition (Invariants of elimination).

Let be invertible and . Then

while in general.

Proof

Null space. if and only if , because is injective. The two solution sets are the same set.

Row space. Every row of is a combination of rows of by the formula in [elementary-invertible], so . Applying the same fact to gives the reverse inclusion.

Column space. , since the columns of are applied to the columns of . An invertible is an isomorphism so it preserves dimension. It does not preserve the subspace: with and the swap of two rows, while , and the two share only .

Remark .

Elimination leaves the null space and the row space where they were so it computes them correctly. It moves the column space so a basis of the column space must be read off the columns of the original and never off the columns of the reduced matrix. Courses state that rule. [row-ops-preserve] is the reason for it.

6.3. Geometry of elimination

[row-ops-preserve] is a statement about subspaces and has a picture. The picture makes the theorem obvious and makes the algorithm's one counterintuitive rule inevitable.

Read a single equation geometrically. The row of an augmented matrix is the condition , whose solutions are a plane in (a hyperplane in , and an affine subset of dimension in the sense of [affine-set], whenever ). A system of equations is planes, and its solution set is what they have in common. Now take the three operations of [row-operations] one at a time and ask what each does to that arrangement.

Swap. It moves nothing and reorders the equations on the page. The planes are a set and a set has no order.

Scale. It moves nothing either. The equations and have exactly the same solutions for any so the plane never moves. A plane has no preferred equation, only a proportionality class of them, and scaling walks around inside that class. This is the operation that makes pivots equal to , and it is geometrically inert.

Replacement. Only the replacement turns anything, and it turns it about the answer. Send row to . Any satisfying both original equations satisfies the combination so the new plane still contains everything the old arrangement had in common. The plane has pivoted about the solution set, which stays fixed like an axle. It cannot do otherwise, because the solution set is exactly what it was told to keep.

The picture is [row-ops-preserve]. The intersection of the planes is the solution set, no operation can move it, and elimination rewrites the question until the answer is legible. The row space is the space of all linear equations that follow from the system. Elimination cannot leave it and only replaces its basis of consequences by a better one.

A zero row is the equation , whose solution set is all of space. It constrains nothing and has no plane, and the plane that was there goes out. Nothing was lost: in the figure's first system, as in the worked example of [elimination-worked], row two is row one doubled, so the second plane lay exactly on top of the first and was never a second constraint. Elimination did not destroy information. It exposed that there was none.

An inconsistent system reduces to a row , the equation , whose solution set is empty. This is [consistency] in the picture: three planes can have no common point, as any two of them meet in a line and the three lines miss each other. The algorithm ends by writing the empty set down.

In a reduced form each pivot row has a in its pivot column and zeros in every other pivot column, so its equation solves for one pivot variable in terms of the free ones. When the solution is a single point there are no free variables and the reduced planes are the planes perpendicular to the coordinate axes: , , . Elimination turns each plane until its equation states one coordinate of the answer. The figure shows this.

Remark (Column picture).

The figure is the row picture, where the planes move and their intersection does not. The column picture behaves oppositely.

In the column picture asks for as a combination of the columns of , and elimination applies the same invertible to every column. The columns therefore all move, and so does their span. This is [row-ops-preserve] again. What does not move is the set of coefficient relations among them: says precisely that a combination of the columns vanishing before the elimination is the same combination vanishing after it. moves the columns to new positions and keeps every dependence among them unchanged.

The row picture preserves a set and the column picture preserves the relations. Together they explain the rule that looks arbitrary in every course that states it. A basis of is read from the pivot columns of because the columns of are in the wrong place, and the pivot positions are trustworthy because the relations that determine them were never disturbed. The coefficients come from and the columns come from , so [rref-bases] describes what happened.

6.4. Echelon form with pivots and free columns

Definition (Reduced row echelon form).

A matrix is in row echelon form if every zero row lies below every nonzero row, and the leading entry of each nonzero row, called its pivot, lies strictly to the right of the pivot of the row above. It is in reduced row echelon form if in addition every pivot equals and is the only nonzero entry in its column.

A column containing a pivot is a pivot column and every other column is a free column.

Theorem (Existence of the reduced form).

Every can be brought to a reduced row echelon form by finitely many elementary row operations. Equivalently, there is an invertible with .

Proof

The proof is the algorithm. Keep a count of pivots placed so far, initially , and sweep the columns left to right. At column , inspect the entries in rows .

If they are all zero, column is free; leave it and move to column .

Otherwise choose a nonzero one, swap its row into position (operation 1), scale that row to make the entry (operation 2), and add suitable multiples of row to every other row to clear the rest of column (operation 3, applied at most times). Increase by one and move to column .

The sweep visits each of the columns once and performs at most operations there so it halts. At the end: pivots were placed in rows in strictly increasing column order, each is , each is alone in its column, and rows are zero, since every column was either cleared below row or was already zero there. That is the reduced form. Composing the elementary matrices of the operations performed gives an invertible with , invertible as a product of invertibles by [elementary-invertible].

Proposition (Pivot columns of A).

Let be the columns of , and let be any reduced row echelon form of . Then column is a pivot column of if and only if

In particular the pivot positions do not depend on which sequence of row operations was used to reach .

Proof

For any matrix with columns , the statement says exactly that there is an whose last nonzero entry sits in slot : given such a combination , the vector with , and zeros beyond is such a null vector, and conversely such a null vector may be solved for . This is a statement about alone, and by [row-ops-preserve]. So the property holds for if and only if it holds for the -th column of .

It remains to check the property against the pivot structure of . A free column of has its nonzero entries confined to the rows of pivots standing to its left, so it is a combination of those pivot columns, which precede it. A pivot column of , with its in row , cannot be such a combination: every column of to its left has a zero in row , since the pivots to the left sit in rows above and free columns to the left are supported on those same rows. Any combination of them therefore has a zero in row , and the pivot column has a there.

6.5. Bases for all four subspaces

Theorem (Bases from the reduced form).

Let with invertible and in reduced row echelon form, with pivots, in columns . Then:

  1. .
  2. The nonzero rows of are a basis of .
  3. The columns of are a basis of .
  4. For each free column , define the special solution by

The special solutions form a basis of . 5. The rows of in the positions of the zero rows of form a basis of .

Proof

(2). by [row-ops-preserve] so the nonzero rows of span it. They are independent: in a vanishing combination , look at entry , where row has a and every other row has a . Hence .

(1). By (2), , and by [row-rank-col-rank].

(4). Each lies in : row of has a in column , zeros in the other pivot columns, and entry in a free column , so

and by [row-ops-preserve]. They are independent, since is the only one of them with a nonzero entry in free slot . They span: given , put , which lies in and has every free entry zero. Row of then reads so every pivot entry vanishes too and . Hence , and there are of them.

(3). Independence: a vanishing combination of the pivot columns of is a vector of with every free entry zero, and the previous paragraph showed the only such vector is . Spanning: rearranging [eq:eq-special-solution] as a statement about columns, says

so every free column of lies in the span of the pivot columns of , and the pivot columns span . The coefficients are read from and the columns combined are those of , as the warning after [row-ops-preserve] states.

(5). Row of says . If row of is zero, then that row of , transposed, lies in by [four-subspaces]. There are such rows. They are independent because is invertible, and by [rank-transpose], so they are a basis.

Remark .

Part 5 is the second use of [blocks-in-parallel]. Reduce and the recorder block ends as , whose rows facing the zero rows of are the conservation laws of §8.2, extracted by bookkeeping. Reducing alone would compute the same and throw away.

6.6. Counting rank-nullity

Corollary .

For every ,

Proof

Every column of is a pivot column or a free column and not both. Count them: , and the two counts are and by parts 1 and 4 of [rref-bases].

Remark (Two proofs of rank-nullity).

[rank-nullity-counted] is [rank-nullity] again and the proofs have nothing in common. The first extends a basis of the kernel to a basis of the domain and never mentions a number. The second sorts columns into two bins and counts them. The first is the stronger statement, because it holds for a linear map on any finite-dimensional space: the derivative on of [examples-vs] has the constants as kernel and as image, and with no array to reduce. The second holds only where there is an array. The difference is that between a theorem about maps and an algorithm on matrices, and the series keeps them apart.

Example (Four subspaces from one elimination).

Take the matrix that §7 will solve and reduce so that the left null space falls out with the rest:

Clear column one with and , then swap and to bring a nonzero entry into the pivot position, and scale by :

Finally clears above the second pivot:

Read [rref-bases] off it. Pivots stand in columns and , so . Column is free, so .

  • Row space. , the nonzero rows of .
  • Column space. , the first two columns of . The first two columns of are , which span a different plane, exactly as [row-ops-preserve] warns.
  • Null space. One free column so one special solution: , , . Hence , the direction of the solution line in §7.
  • Left null space. has one zero row, the third, and the third row of is , so . It says , the redundancy visible in from the start: row two is twice row one.
Remark (Exact arithmetic).

Every operation above was performed in a field, exactly. On a computer in floating point the same algorithm can be badly behaved: dividing by a pivot that is nonzero and tiny amplifies rounding error, and the fix of choosing the largest available entry as the pivot is partial pivoting. That is numerical linear algebra, a different subject with different theorems, and nothing in this series depends on it. The chemistry of §8 is done over , where the question does not arise.

7. Solving

This section answers the oldest question in the subject: when a linear system has a solution, when it has only one and what the set of all of them looks like.

Theorem (Solution set of a linear system).

Let and , and let .

  1. Existence. if and only if .
  2. Uniqueness. If , then has exactly one element if and only if .
  3. Structure. If , then
Proof

(1) restates the definition of the image as the column space. (3): if and , then , so with . Conversely . (2) follows from (3), since is a single point exactly when is.

Proposition (Consistency from the reduced form).

Reduce the augmented matrix of [augmented]. The system is solvable if and only if the last column is a free column, and this is equivalent to

Proof

By [pivots-intrinsic] the last column is a pivot column exactly when , which by part 1 of [solution-set] is exactly when the system has no solution. The rank statement is the same fact counted: adjoining either adds a pivot or does not.

Remark .

A pivot in the last column is the row , which reads . The contradiction a student is taught to look for at the bottom of an elimination is the statement .

Theorem (Solutions from the reduced augmented form).

Reduce to , with in reduced row echelon form, pivots in columns , and . Then:

  1. Consistency. The system is solvable if and only if , the entries of facing the zero rows of .
  2. Solution. When it is solvable, the pivot rows read

and assigning the free variables arbitrary values produces every solution exactly once.

Proof

Row of has a in column and zeros in the other pivot columns so it reads . This is [eq:eq-back-substitution]. Row is zero so it reads . If some there then the reduced system has no solution, and by [row-ops-preserve] neither has the original one. If all of them vanish, choose the free entries freely and let [eq:eq-back-substitution] supply the pivot entries: the resulting satisfies every row, and distinct choices give distinct vectors, since the free entries are visible in the answer.

Remark (Shape of the reduced array).

Permute the columns so that the pivot columns come first. This relabels the unknowns as and changes nothing else. Then [eq:eq-back-substitution] is one matrix equation, and the reduced array has the block shape

Every elimination in this series ends here. Solvability is , and then

which is [eq:eq-solution-set] with the particular solution and the null space spanned by the columns of , the special solutions of [rref-bases]. Existence is the block , uniqueness is the width of , and the answer itself is .

Definition (Affine subset).

An affine subset of a vector space is a set of the form for some and some subspace . Its dimension is . It is a subspace if and only if .

Remark (Affine as a word).

The word affine is the shortest true description of [eq:eq-solution-set].

The solution set of an inhomogeneous system is closed only under the linear combinations whose coefficients sum to one: if then , which equals exactly when . This is the structure identified in [affine-not-linear]. It has a well-defined dimension, , and a well-defined direction space, , and no distinguished point: is any solution you happen to find, and a different one names the same set. That last property makes an extent of reaction a coordinate in §8 and makes a particular solution of an inhomogeneous ODE a choice in Part II.

Example (Worked system).

Take

This is the matrix reduced in [elimination-worked], so and are already known. Only is new so reduce the augmented matrix, which repeats that elimination with one more column alongside:

The last column is free so the system is solvable by [consistency], and the reduced rows read and . Setting the free variable gives the particular solution , and by [eq:eq-solution-set]

where the direction is the special solution with its sign flipped, which names the same line. This line in misses the origin so it is an affine subset of dimension one and not a subspace.

Verification. Check the null-space vector directly: , so , and . Then for every . That is the whole content of [eq:eq-solution-set]: linearity does the substitution.

The figure runs [eq:eq-rank-nullity] as a conservation law. Sliding the rank of a linear map trades the two dimensions against each other: as the image collapses from a solid to a plane to a line the kernel grows from a point to a line to a plane and the sum stays at three. Once the image has collapsed may fail to be reachable, and where a solution exists the solution set is a large affine set. Existence and uniqueness are the two ends of the same slider.

8. Stoichiometry and nonlinear equilibrium

The stoichiometric matrix and the extent of reaction used below are standard in reactor analysis, where Aris [5] sets them out in the linear-algebraic form this section assumes. Take the Haber process, , and write down its ICE table. The amounts are

which is degree one in : an affine set, a straight line in the space of species amounts, direction , base point . The equilibrium condition that picks a point on that line is

which is degree four in once cleared of denominators. The quotient on the left is written in mole amounts. The in the worked problem of §8.3 is a number chosen to make that problem come out and not a measured constant. The remark in §8.3 states what is assumed, and nothing in the degree count depends on it. The same variable and the same table give two different kinds of object: a line and a quartic hypersurface. The line is linear algebra and this lecture solves it completely. The quartic is not linear algebra. A course that calls the whole table "linear" discards the only distinction that explains why one half is easy.

Definition (Element-species matrix).

Fix an ordered list of species and an ordered list of the chemical elements they contain. The element-species matrix has one row per element and one column per species, with the number of atoms of element in one molecule of species . Every entry is a non-negative integer. No reaction has been mentioned yet and none is needed to write down.

Signed coefficients specify the reaction. A stoichiometric coefficient vector is a vector whose entry is negative for a species consumed, positive for one produced, and zero for one not taking part. It balances if and only if

which says exactly that the atom count of each element is unchanged by the reaction.

For methane combustion, with species ordered and elements ordered , the atom counts are read straight off the formulae:

Three elements and four species give rank at most three and by [rank-transpose]. So a balancing vector exists before any arithmetic is done. The vector itself comes from an elimination, and §6 has supplied one. Clear column one with , exchange the last two rows to bring a nonzero entry into the second pivot position and scale the rows to unit pivots:

where the last step clears above the third pivot. Three pivots give and by [rank-nullity-counted] so the balance is unique up to scale.

The single free column is the fourth and belongs to water. Its special solution from [eq:eq-special-solution] is

and the doubling is the only arithmetic in the whole balance. It clears the denominators. This is possible because is a field and is not, as flagged after [field]. Fixing the sign so that methane is consumed gives : methane and oxygen negative, carbon dioxide and water positive, magnitudes . That is the balanced equation

the answer the student got by juggling. Two facts she was never told are now theorems. Her answer is unique up to scale because . Whenever a reaction network has no amount of juggling gives a unique answer because none exists: the number of independent reactions among a set of species is , the statement of [rank-nullity] in a laboratory.

from sympy import Matrix, Rational, ilcm, igcd

# Species: CH4, O2, CO2, H2O.  Elements: C, H, O.
# E holds ATOM COUNTS only: every entry non-negative, no reaction in sight.
E = Matrix([[1, 0, 1, 0],
          [4, 0, 0, 2],
          [0, 2, 2, 1]])

print("E =", E.tolist())
print("rank E =", E.rank())

ns = E.nullspace()
print("dim N(E) =", len(ns), "(unique up to scale iff this is 1)")

# Clear the rational null-space vector to a primitive integer vector.
v = ns[0]
den = 1
for e in v:
  den = ilcm(den, Rational(e).q)
ints = [int(Rational(e) * den) for e in v]
g = 0
for k in ints:
  g = igcd(g, k)
ints = [k // g for k in ints]

# Fix the sign so that methane (species 0) is CONSUMED: nu_0 < 0.
if ints[0] > 0:
  ints = [-k for k in ints]

print("signed coefficients (CH4, O2, CO2, H2O) =", ints)
print("E . nu =", (E * Matrix(ints)).T.tolist(), "-> every element conserved")
print("magnitudes match the textbook answer [1, 2, 1, 2]:",
    [abs(k) for k in ints] == [1, 2, 1, 2])

Verification: methane combustion balances to (-1, -2, 1, 2), and the null space is one-dimensional

Example (Redox balance with charge as one more row).

The reaction chemistry students are taught to fear is the one where electrons move:

The method drilled for it is the half-reaction ritual: split the equation in two, balance atoms, balance oxygen with water, balance hydrogen with protons, balance charge with electrons, scale the halves until the electrons cancel, add them back together. It has seven steps in a fixed order and no visible reason.

There is no new mathematics here. A reaction conserves charge exactly as it conserves manganese so charge is one more thing to count: one more row. With species ordered and rows ordered ,

The charge row is the only one with a negative entry, since is an anion. It is an ordinary row: the covector "count the net charge", in the sense of §4.1. Reducing gives

with five pivots and one free column, the water. So and by [rank-nullity-counted], and the balance is unique up to scale before a single coefficient has been chosen. The special solution has water as its free entry, and taking that entry to be clears every denominator at once:

which is the balanced equation

Check the charge row by hand: the left side gives and the right side gives . It balances because and the charge row is a row of .

The electrons never appeared. None of the six species is an electron, and the charge row records every consequence of the electrons having moved. The seven-step ritual is one null-space computation on a matrix with five rows.

Example (No unique balanced equation).

§8.1 claimed that a species list with admits no unique balance. Burning carbon incompletely in oxygen is an example. Species , elements ,

Two pivots, in the columns of and , and two free columns, and . So and . The set of balanced reactions among these four species is a plane, and the question "what is the balanced equation" has no answer.

The two special solutions of [eq:eq-special-solution], cleared of denominators, are a basis of that plane:

which are the two reactions a chemist would have named:

Every balanced reaction on this species list is a combination of those two, and that includes the one a chemist would name third, the burning of carbon monoxide:

The third reaction is real and happens in the flame, and it is not independent. It is a linear combination of the other two, and no chemical fact will change that because and three vectors in a plane are dependent by [steinitz]. The nullity of gives the number of reactions the flame can have without repeating itself: two, whatever the mechanism.

This is what the sentence "the number of independent reactions is " means in a laboratory. A juggler asked to balance this system would find an answer and never learn that there were infinitely many answers and that all of them were correct.

8.2. Conservation laws as a left null space

A network of several reactions has a second matrix and the two must be told apart.

Definition (Stoichiometric matrix).

For a network of reactions among species, the stoichiometric matrix has one column per reaction, whose entries are the change in each species amount per unit extent of that reaction: negative for a species consumed, positive for one produced. Each column is therefore a stoichiometric coefficient vector in the sense of [element-species], and each is balanced.

Proposition (Conservation laws as the left null space of N).

Let be the element-species matrix of [element-species] for the same species list. Then

so every row of lies in , the left null space of . More generally, a vector lies in if and only if the quantity is conserved along every trajectory of the network.

Proof

The -th column of is applied to the -th column of , and that column is a balanced coefficient vector, so [eq:eq-balance] kills it. Balancing one reaction and annihilating the whole network are the same statement, read one column at a time: the entry of is the net change in the number of atoms of element per unit extent of reaction , and a chemical reaction conserves atoms of every element. For the general statement, the amounts under the network are , so . This is independent of for all precisely when .

Example (Two-reaction network).

Hydrogenate 1-butene and then isomerise the product:

With species ordered and elements ordered ,

Multiplying gives , as [conservation-left-null] states. Carbon: in the first column, in the second. Hydrogen likewise.

Now count. is of rank , so by [rank-transpose]. There are exactly two independent conserved quantities, and the two rows of (which are independent) already exhaust them: total carbon and total hydrogen. Nothing else is conserved, and the left null space is the proof that nothing else can be.

Completeness. Each column of balances, so by [eq:eq-balance]: the reactions of a network always live in the null space of the element-species matrix. Here they fill it. has rank , so . This is the rank of , and a subspace of the right dimension inside a subspace is all of it by [extend-to-basis]. So , and the two columns of are a basis of it. Every reaction these four species can undergo, known or unknown, is a combination of these two.

Remark (Isomers and the element-species matrix).

Look at the last two columns of . They are identical, both , because -butane and isobutane are the same atoms in a different arrangement, and [element-species] counts atoms. The element-species matrix is blind to isomerism, as promised in [chem-terminology].

The blindness is correct, as the second column of shows. The isomerisation is annihilated by because it is the difference of two identical columns so element conservation permits it and says nothing else about it. Atom counting cannot forbid a rearrangement of atoms. It also cannot predict one: whether that isomerisation proceeds is a question for thermodynamics and kinetics, and no amount of linear algebra will answer it.

8.3. Degree one and degree four in the ICE table

Return to the Haber process with the feed in the species order . By [eq:eq-ice-affine],

each of them degree one in . The whole ICE table is one point moving along one line, and the extent of reaction is a coordinate on that line, in the sense of [coordinates-unique] applied to the one-dimensional direction space . The feed is in stoichiometric ratio so both reactants are exhausted together at , and the physically admissible segment is .

Remark (Meaning of K).

The condition [eq:eq-equilibrium] is written as a power product of mole amounts. The true equilibrium condition is a power product of activities, and the two coincide only at the volume that makes the activities numerically equal to the amounts (unit volume). Everything below is therefore a statement about that reference volume, and the numerical value of used here is an artefact of where the worked problem places equilibrium and is not the measured equilibrium constant of ammonia synthesis at any real temperature. None of this touches the mathematics. A volume term multiplies [eq:eq-equilibrium] by a constant and leaves the polynomial degree in unchanged so the contrast of degree one against degree four stands.

Substituting the affine amounts into [eq:eq-equilibrium] and clearing denominators,

Example (Worked ICE problem).

Take . Then [eq:eq-haber-quartic] reads . Taking positive square roots on the admissible segment where both sides are non-negative,

whose roots are and . The second lies outside and is discarded on physical grounds: it would drive both reactant amounts negative. So and the equilibrium amounts are

Verification. Feed the amounts back into the quotient:

Every atom is accounted for too, as [conservation-left-null] requires: nitrogen , the feed value ; hydrogen , the feed value . The conservation rows were never imposed. They are satisfied because the state never left the affine set [eq:eq-ice-affine], whose direction is annihilated by them.

Remark (Thesis).

Two objects sat in that table. [eq:eq-ice-affine] is degree one and is completely solved by §7: a line, a direction space, a coordinate, conservation laws read off a left null space. [eq:eq-haber-quartic] is degree four and is a different subject. We solved this instance only because a perfect square happened to be extractable, and the general case falls to a numerical root-finder. Linear algebra shows that the quartic is the only hard thing in the problem and gives it the simplest possible geometry to cut.

Three species amounts on three axes, one point in the space of states. The straight line is the affine set [eq:eq-ice-affine], along which the extent of reaction is the coordinate. The flat sheet is a conservation plane, one row of , and the line lies inside it exactly because that row is in the left null space of ([conservation-left-null]). The curved sheet is the equilibrium variety [eq:eq-equilibrium]. Linearity stops there. Drag and watch the reaction quotient climb to at the one point where the line pierces the curve.

9. Determinant left undefined

This lecture has met the determinant twice without defining it. [p-invertible] asserts that a change-of-basis matrix is invertible, and every reader knows the test for invertibility is a nonvanishing determinant. The proof given there composes two maps and needs no determinant. The remark after [similarity] claimed that the determinant is unchanged by a change of basis. That claim was not proved, because the determinant cannot be properly defined at this stage. The formula with the sum over permutations computes something not yet named.

The series settles this three times, each more fully than the last.

  • Part II axiomatises it: is the unique function of the columns of a matrix that is multilinear, alternating and equal to one on the identity. Uniqueness makes the permutation formula a theorem. Invariance under [eq:eq-similarity] follows from multiplicativity and means signed volume. Part II needs it because the characteristic polynomial does.
  • Part IV explains it: a linear map on an -dimensional space induces a linear map on the one-dimensional space , and a linear map on a one-dimensional space is multiplication by a scalar. That scalar is . The alternating multilinear axioms of Part II are then the definition of , and the determinant is basis-independent because was constructed without a basis.
  • Part VI reveals it: is the signed factor by which stretches -dimensional volume, and its absolute value is , the product of the singular values. This is the top-dimensional case of the theorem stated in §0, in which rotation, stretch, area, volume and determinant become one object.

Part II begins with eigenvalues, and eigenvalues need a determinant.

References

  1. S. Axler, Linear Algebra Done Right, 4th ed., Springer, 2024. DOI
  2. P.R. Halmos, Finite-Dimensional Vector Spaces, 2nd ed., Springer, 1974. DOI
  3. R.A. Horn and C.R. Johnson, Matrix Analysis, Cambridge University Press, 1985. DOI
  4. G. Strang, Linear Algebra and Its Applications, 4th ed., Cengage, 2006.
  5. R. Aris, Elementary Chemical Reactor Analysis, Prentice-Hall, 1969.
  6. W.R. Hamilton, "On Quaternions", read to the Royal Irish Academy, 11 November 1844; Proceedings of the Royal Irish Academy 3 (1847), 1–16. The words scalar and vector enter in art. 18 of his "On Quaternions; or on a New System of Imaginaries in Algebra", Philosophical Magazine (3) 29 (July 1846), 26–31. Wilkins edition
  7. H. Grassmann, Die lineale Ausdehnungslehre, ein neuer Zweig der Mathematik, Wigand, Leipzig, 1844.
  8. J.W. Gibbs, Elements of Vector Analysis, Arranged for the Use of Students in Physics, privately printed, New Haven, 1881–4, Art. 1. Archive
  9. O. Heaviside, Electromagnetic Theory, vol. I, The Electrician, London, 1893, §103, 139–141. Archive
  10. E.B. Wilson, Vector Analysis: A Text-Book for the Use of Students of Mathematics and Physics, Founded upon the Lectures of J. Willard Gibbs, Scribner, New York, 1901, Art. 4. Archive
  11. F. Cajori, A History of Mathematical Notations, vol. II, Open Court, Chicago, 1929, §502, 131–132.
  12. G. Ricci and T. Levi-Civita, "Méthodes de calcul différentiel absolu et leurs applications", Mathematische Annalen 54 (1900), 125–201. DOI
  13. A. Einstein, "Die Grundlage der allgemeinen Relativitätstheorie", Annalen der Physik 49 (1916), 769–822, §5. DOI
  14. A. Pais, 'Subtle is the Lord...': The Science and the Life of Albert Einstein, Oxford University Press, 1982, p. 216, after L. Kollros, "Albert Einstein en Suisse: souvenirs", Helvetica Physica Acta Supplementum 4 (1956), 271–281.