Compact Operators
Compact operators are infinite-dimensional maps that behave almost like finite matrices: they squash bounded sets small and surrender to low-rank approximation with known error.
Why Does This Exist?
Kernel integral equations, covariance operators and attention matrices are infinite-dimensional yet practically low-rank: a few modes carry the action. Compactness is the property that makes this rigorous. It guarantees discrete spectra, approximability by finite matrices, and the Fredholm alternative (finite-dimensional-flavored solvability) for equations that otherwise resist all matrix intuition.
This page defines compactness and truncates one operator with exact error. Matrix factors behind the truncation are in singular value decomposition; the eigenvalue picture is eigenvalues and eigenvectors.
The one idea you need first
A finite-rank operator has finite-dimensional range: . Operator norm is the top stretch factor. Compactness means finite-rank maps approximate in that norm.
Think of It Like This
A photo compressed to thumbnails
A 40-megapixel photo compresses to a crisp 2-megapixel version: thumbnails capture nearly everything because pixel detail beyond some fineness is noise. Compact operators are compressible photos: rank- thumbnails converge to the full image as grows.
A non-compact operator is television static: every zoom level shows fresh detail, no thumbnail ever suffices. Where it stops: compression error decays at the singular-value rate, which can be agonizingly slow. Compact promises convergence, never speed.
How It Actually Works
Bounded is compact when the image of the unit ball has compact closure: bounded inputs map to sets small enough that finite nets approximate them. Equivalently, is a norm limit of finite-rank operators:
In plain words: truncate and the worst-case error vanishes as rank grows. On Hilbert space, compact has a singular expansion with ; truncation error is . Hilbert-Schmidt operators () are the tractable subclass. Fredholm: is injective iff surjective, with finite-dimensional kernel.
Worked example
Diagonal on with entries . Singular values are the entries themselves, tending to : compact. Rank-3 truncation keeps the first three; error (largest dropped entry).
Hilbert-Schmidt check on the first three modes: , so partial HS norm . Full , HS norm : finite, so Hilbert-Schmidt, hence compact twice over.
Code
Truncate the diagonal and read off the exact tail error.
import numpy as np
def truncation_error(s: np.ndarray, rank: int) -> tuple[float, float]: kept_hs = float(np.sqrt((s[:rank] ** 2).sum())) # HS norm of kept part tail = float(s[rank]) if rank < s.size else 0.0 # operator error return kept_hs, tail
s = 1.0 / np.arange(1, 11)print(truncation_error(s, 3)) # -> (1.167, 0.25)Kept HS norm , tail error : the hand numbers, reproduced.
Watch Out For
Assuming the identity is compact
Symptom: truncating the identity (or any isomorphism on infinite dimensions) with error stuck at forever. Fix: the unit ball is non-compact in infinite dimensions; identity is never compact there. Check before truncating anything.
Reading compactness off slow tails
Symptom: singular values decay like and rank-1000 still leaves error . Fix: compactness gives no rate; estimate the actual tail for your and budget rank from that, not from the label.
The Quick Version
- Compact operators map bounded sets to nearly finite sets and are norm limits of finite-rank maps.
- Singular values tend to zero; rank- truncation error is the first dropped value.
- Diagonal has rank-3 error and HS norm about .
- Hilbert-Schmidt () implies compact with a computable norm.
- The identity on infinite dimensions is never compact.