Canonical Form¶
Core Idea¶
Canonical form is the pattern in which an equivalence relation partitions a domain into classes, a deterministic reduction procedure maps every object to a unique distinguished representative of its class, and two objects are equivalent if and only if their canonical forms are identical — converting an expensive semantic equality test into a cheap syntactic one.
How would you explain it like I'm…
The One Official Version
Reduce Then Compare
One Representative Per Class
Broad Use¶
- Linear algebra: Jordan normal form, reduced row-echelon form, Smith and rational canonical forms — a unique representative so similarity reduces to identity.
- Logic: conjunctive and disjunctive normal form, prenex and Skolem normal form, beta-normal form in lambda calculus.
- Compilers: static single assignment form, giving every variable one assignment and making dataflow analyses trivially expressible.
- Databases: the relational normal-form hierarchy, progressively stricter conditions that eliminate redundancy and update anomalies.
- Chemistry: systematic nomenclature and canonical molecular strings, without which structure search and deduplication are intractable.
- Law: codification, reducing years of amending acts to a canonical title-and-section structure.
Clarity¶
The distinguishing insight is the biconditional: two objects are equivalent exactly when their canonical forms are identical — which is what makes the syntactic test soundly stand in for the semantic one, separating genuine canonical forms from weaker one-directional normalisations.
Manages Complexity¶
It converts an intractable problem — semantic equivalence checking, often undecidable — into a tractable one, syntactic identity testing, at the cost of building the reduction once; and where no canonical form exists, that absence is the complexity barrier.
Abstract Reasoning¶
It supports asking whether an equivalence relation admits a canonical form (the answer determines tractability), recognizing that which canonical form to use is substantive (SSA versus three-address code expose different aspects), and that unique is separable from minimal.
Knowledge Transfer¶
- Across math, compilers, chemistry, databases, law: the transfer is exact rather than analogical — the equivalence classes, representatives, and biconditional are literally the same object in every field.
- As a structural unlock: introducing a canonical form to a domain with hidden equivalence redundancy can make a whole class of previously intractable operations possible (canonical molecular strings enabled chemical databases; SSA enabled the optimising compiler).
Example¶
Reduced row echelon form: Gaussian elimination deterministically sends every matrix to exactly one representative of its row-equivalence class, so the semantic question "do these matrices have the same row space?" — about infinitely many linear combinations — is answered by reducing each to RREF and comparing entrywise.
Relationships to Other Abstractions¶
Current abstraction Canonical Form Prime
Parents (1) — outgoing typed relations
-
Canonical Form presupposes Equivalence Relation Prime
Canonical form PRESUPPOSES an equivalence relation (the partition) and adds a deterministic reduction to a unique per-class representative plus the biconditional (equivalent iff identical canonical forms).
Children (10) — abstractions linked here by typed relations
-
Diagonal form Domain-specific is a kind of Canonical Form
It remains its own entry because its identity is fixed by the coefficient field and characteristic, number of variables and homogeneous degree, coefficients, pure-power expression, associated hypersurface, allowed linear transformations and proof or obstruction of diagonalization.
-
Frobenius normal form Domain-specific is a kind of Canonical Form
The construction supplies one distinguished matrix for every similarity equivalence class and makes two matrices similar exactly when their canonical representatives coincide.
-
Hermite normal form Domain-specific is a kind of Canonical Form
Canonical Form (
prime:canonical_form). -
Koenigs function Domain-specific is a kind of Canonical Form
It remains its own entry because its identity is fixed by the holomorphic self-map and domain, fixed point and multiplier, attracting, repelling or semigroup regime, normalization of h, Schröder or Abel equation, univalence domain, existence and uniqueness conditions and iterate representation.
-
Minimal polynomial (field theory) Domain-specific is a kind of Canonical Form
It remains its own entry because its identity is fixed by the base field and extension, element alpha, polynomial ring, evaluation homomorphism and kernel, algebraicity, monicity, least degree, irreducibility, uniqueness and degree relation to the simple extension.
- Prenex normal form Domain-specific is a kind of Canonical Form
What makes it its own entry: the domain-specific identity determined by the logic, free and bound variables, variable-renaming discipline, quantifier order, equivalence rules, and quantifier-free matrix are explicit and semantic equivalence is preserved.
- Standard monomial theory Domain-specific is a kind of Canonical Form
It remains its own entry because its identity is fixed by the reductive group or variety, line bundle or coordinate ring, generators, indexing order, standardness criterion, straightening relations, coefficient convention, and basis theorem.
- Static single-assignment form Domain-specific is a kind of Canonical Form
It remains its own entry because its identity is fixed by the source IR and control-flow graph, variable and memory model, dominance convention, phi semantics, placement and renaming algorithm, exceptional and unreachable edges, loops, conversion out of SSA, and preserved program behavior.
- Graph canonization Domain-specific presupposes Canonical Form
Graph canonization structurally presupposes Canonical Form rather than being a subtype of it.
- Unicode Collation Algorithm Domain-specific includes Canonical Form
Unicode Collation Algorithm is a strict domain-specific instance of **`prime:algorithm`**.
Hierarchy path (1) — routes to 1 parentless root
- Canonical Form → presupposes Equivalence Relation
Not to Be Confused With¶
- Canonical Form is not Equivalence Relation because canonical form presupposes the partition and adds a deterministic reduction to a unique representative plus the biconditional, whereas the relation alone tells you only which objects are the same.
- Canonical Form is not Classification because canonical form requires a unique representative and the if-and-only-if, whereas classification assigns a category that need not be unique, reversible, or grounded in an equivalence structure.
- Canonical Form is not Comparison because canonical form is the Construction that makes a comparison cheap, whereas comparison is the consumer — the repeated cheap test on representatives.