46. Adv: linear algebra over general fields (bridge to abstract algebra)
Every scalar in this course, since §16.0, has been a real number (§21.1's brief detour into complex entries aside). This closing lesson asks what survives if \mathbb{R} is replaced by a different field entirely — and the honest answer is: almost everything, because almost nothing in this course actually used a property specific to \mathbb{R}.
What a field is
A field \mathbb{F} is a set with addition and multiplication satisfying the arithmetic rules taken for granted throughout this course: both operations commutative and associative, distributivity, additive and multiplicative identities (0 and 1), additive inverses for everything, and multiplicative inverses for every nonzero element. \mathbb{R} is a field; so is \mathbb{C} (§21.1 already used this); so is \mathbb{Q} (the rationals); and so, less obviously, is a finite field like \mathbb{F}_2=\{0,1\} with addition and multiplication done modulo 2 (1+1=0).
A vector space over \mathbb{F} is exactly §17.0's eight axioms, with "scalar" now meaning "element of \mathbb{F}" rather than "real number." Nothing in that definition, or in the definitions of span, basis, dimension, linear transformation, determinant, rank, or eigenvalue, ever used a property of \mathbb{R} beyond being a field — every one of them is defined, word for word, over any field.
What transfers unchanged
Gaussian elimination (§16.1), matrix multiplication (§16.2), the determinant and its properties (§16.4), rank-nullity (§17.5), and eigenvalues via the characteristic polynomial (§19.0) all work identically over \mathbb{F}_2 or any other field — the proofs never divided by anything except nonzero field elements, which is exactly what a field guarantees is always invertible.
A genuinely useful example: linear algebra over \mathbb{F}_2 is the mathematical foundation of coding theory and cryptography — a binary error-correcting code is a subspace of \mathbb{F}_2^n, and "decoding" is solving a linear system exactly the way §16.1 does, just with arithmetic where 1+1=0.
What breaks, and why
Every idea in Modules 20–21 that depended on order (comparing sizes, \lambda>0, "positive" definite) or on an inner product's positive-definiteness axiom breaks over a general field — \mathbb{F}_2 has no meaningful notion of one element being "bigger" than another, so §20.0's norm, §20.1's Cauchy-Schwarz, and §21.2's positive-definiteness simply don't generalize (an inner product needs \ge, which needs an ordered field — \mathbb{R} has one, \mathbb{C} and \mathbb{F}_2 do not). This is the precise boundary: algebraic structure (Modules 16–19, most of 23) survives over any field; geometric structure built from order (Modules 20–21's lengths and angles) needs \mathbb{R} or \mathbb{C} specifically.
Characteristic: \mathbb{F}_2 has characteristic 2 (1+1=0), unlike \mathbb{R}'s characteristic 0 (no finite sum of 1's is ever zero). This has real consequences: in characteristic 2, -1=1, so "subtraction" and "addition" coincide, and some formulas needing division by 2 (like §16.4's cofactor sign pattern in certain forms) require special handling. This course's over-\mathbb{R} results are always safe; this lesson's point is only that most of the machinery doesn't specifically need \mathbb{R} to make sense in the first place.
Where this leads next
A vector space over a field is the entry point to abstract algebra: allowing the scalars themselves to come from a ring rather than a field (dropping the guarantee of multiplicative inverses) produces a module — vector spaces are the special, best-behaved case where every scalar operation "just works." This course stops at fields, but the pattern — start with familiar structure, strip axioms one at a time, see what still holds — is the same method Module 17 already used to go from \mathbb{R}^n to abstract vector spaces, run one level further.
Doing it in Python
def add2(a, b): return (a + b) % 2
def mul2(a, b): return (a * b) % 2
# Gaussian elimination over F_2, by hand, on a small system
# x + y = 1
# y + z = 1
# x + z = 0
A = [[1, 1, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]]
# R3 <- R3 + R1 (mod 2)
A[2] = [add2(A[2][i], A[0][i]) for i in range(4)]
print("after R3 += R1:", A[2])
# R3 <- R3 + R2 (mod 2)
A[2] = [add2(A[2][i], A[1][i]) for i in range(4)]
print("after R3 += R2:", A[2])
after R3 += R1: [0, 1, 1, 1]
after R3 += R2: [0, 0, 0, 0]
Checking a determinant over \mathbb{F}_2 (a matrix invertible over \mathbb{R} can become singular over \mathbb{F}_2):
def det2x2_mod2(a, b, c, d):
return (a*d - b*c) % 2
A = (1, 1, 1, 0) # det over R is -1 (invertible)
B = (1, 1, 1, 1) # det over R is 0 (singular over R too)
print("det(A) over R:", 1*0 - 1*1, " det(A) mod 2:", det2x2_mod2(*A))
print("det(B) over R:", 1*1 - 1*1, " det(B) mod 2:", det2x2_mod2(*B))
C = (1, 0, 0, 3) # det over R is 3 (invertible), but 3 mod 2 = 1 (still invertible)
D = (1, 1, 3, 1) # det over R is 1 - 3 = -2 (invertible over R!) but 0 mod 2 (singular over F_2)
print("det(C) over R:", 1*3 - 0*0, " det(C) mod 2:", det2x2_mod2(*C))
print("det(D) over R:", 1*1 - 1*3, " det(D) mod 2:", det2x2_mod2(*D))
det(A) over R: -1 det(A) mod 2: 1
det(B) over R: 0 det(B) mod 2: 0
det(C) over R: 3 det(C) mod 2: 1
det(D) over R: -2 det(D) mod 2: 0
Worked example
Row-reduce \begin{pmatrix}1&1&1\\1&0&1\\0&1&1\end{pmatrix} over \mathbb{F}_2.
R_2\leftarrow R_2+R_1\pmod2: (1+1,0+1,1+1)=(0,1,0).
\begin{pmatrix}1&1&1\\0&1&0\\0&1&1\end{pmatrix}
R_3\leftarrow R_3+R_2\pmod2: (0+0,1+1,1+0)=(0,0,1).
\begin{pmatrix}1&1&1\\0&1&0\\0&0&1\end{pmatrix}
Three pivots — full rank over \mathbb{F}_2.
\boxed{\text{Invertible over }\mathbb{F}_2}
Sanity check. Over \mathbb{R}, the same matrix has determinant 1(0-1)-1(1-0)+1(1-0)=-1-1+1=-1\neq0 — also invertible over \mathbb{R}. This particular matrix happens to be invertible over both fields, illustrating that the two questions are genuinely independent: neither field's invertibility implies the other's (the Python example above shows a case, matrix D, where they disagree).
Your turn
1. Compute 1+1+1 in \mathbb{F}_2 (i.e., \pmod2).
2. Does §17.5's Rank-Nullity Theorem (\operatorname{rank}+\operatorname{nullity}=n) hold over \mathbb{F}_2? Why or why not, in one line.
3. True or false: "positive definite" is a meaningful concept for a bilinear form over \mathbb{F}_2.
Solutions
1. 1+1+1=(1+1)+1=0+1=1\pmod2.
2. Yes. The proof (§17.5) only used counting pivot versus free columns in RREF — a purely combinatorial argument about elimination that never referenced any property of \mathbb{R} beyond field arithmetic (division by nonzero pivots), so it transfers to \mathbb{F}_2, or any field, unchanged.
3. False. "Positive definite" requires comparing \vec x^TA\vec x to 0 using > — and \mathbb{F}_2=\{0,1\} has no order relation at all (there's no meaningful sense in which 1>0 or 0>1 in modular arithmetic; 1+1=0 already breaks the usual ordering intuition). This is exactly the "what breaks" boundary from this lesson: definiteness is an order-dependent, not purely algebraic, concept.
Check yourself in code
Row-reduce \begin{pmatrix}1&1&0\\1&1&1\\0&1&1\end{pmatrix} over \mathbb{F}_2 using R_2\leftarrow R_2+R_1 then check for a zero row (which would signal a singular matrix over \mathbb{F}_2).
Print exactly this:
after R2 += R1 (mod 2): [0, 0, 1]
has zero row: False
def add2(a, b): return (a + b) % 2
A = [[1, 1, 0], [1, 1, 1], [0, 1, 1]]
A[1] = [add2(A[1][i], A[0][i]) for i in range(3)]
print("after R2 += R1 (mod 2):", A[1])
# print whether any row of A is now all zeros
def add2(a, b): return (a + b) % 2
A = [[1, 1, 0], [1, 1, 1], [0, 1, 1]]
A[1] = [add2(A[1][i], A[0][i]) for i in range(3)]
print("after R2 += R1 (mod 2):", A[1])
has_zero_row = any(all(v == 0 for v in row) for row in A)
print("has zero row:", has_zero_row)
A vector space only needs a field of scalars, and nearly every algebraic idea in this course — elimination, rank, determinants, eigenvalues — is defined and proved without ever using a property specific to \mathbb{R}, so it transfers unchanged to \mathbb{F}_2 and every other field, underlying coding theory and cryptography. What breaks is anything built on order: norms, angles, and positive-definiteness all need \mathbb{R} or \mathbb{C} specifically.
This closes Module 23, and the theory arc of this course. Module 24 closes the whole course with five applications — Markov chains, PCA, graph spectral theory, regression, and linear ODE systems — each one a direct payoff of a specific tool built somewhere in Modules 16–22.