Canonical Representative Selection¶
Method — instantiates Representation-Invariant Reasoning
Chooses one repeatable representative when a global regular canonical form genuinely exists.
When an equivalence class has a distinguished form that can be computed deterministically for every member — one that always exists, is regular across the whole domain, and returns a byte-identical result no matter which member you feed it — Canonical Representative Selection is the discipline of computing that form and letting it stand in for the class. Its defining bet is uniqueness-and-globality: it does not merely reduce ambiguity, it eliminates it, so any two equivalent descriptions collapse to the same label. That bet is safe only when the canonical form provably exists everywhere in scope, so the mechanism's real labor is proving the bet before anyone leans on it. Everything downstream — deduplication, cache keys, cross-system joins — trusts that canon(x) == canon(y) if and only if x and y are truly equivalent.
Example¶
A chemical-inventory team is merging two vendor catalogs and keeps counting the same compound twice. The reason is representational: a molecule has no single spelling in SMILES notation — atom traversal order is arbitrary, so a molecule like caffeine has dozens of equally valid strings, and a naïve string match treats them as different substances. The team runs each structure through a canonicalization routine that computes an invariant atom ordering (a Morgan-style ranking), breaks any remaining ties by a fixed rule, and serializes from that ordering. The output is one canonical SMILES per compound. Now 1,3,7-trimethylxanthine resolves to exactly one string whether it came in as CN1C=NC2=C1C(=O)N(C)C(=O)N2C or any of its siblings. The two catalogs deduplicate cleanly, and the canonical string becomes the join key across every downstream table.
How it works¶
The method is distinguished from ordinary "just pick something" selection by four moves:
- Prove existence and regularity first. Confirm the canonical form is defined and stable for every member in scope — not just the cases on hand. A form that is canonical for most inputs and undefined for a few is not canonical; it is a partial gauge with a hidden patch boundary.
- Compute an invariant ordering, then break ties deterministically. The ordering is the substantive step; the tie-break rule is what buys full uniqueness where the ordering alone leaves symmetry.
- Check idempotence.
canon(canon(x))must equalcanon(x). Failure means the routine is not actually landing on a fixed point. - Stamp the convention. Record which algorithm and version produced the form, because the "canonical" label is only as portable as the recipe behind it.
Tuning parameters¶
- Tie-break rule — how residual symmetry is resolved into a single choice. A stricter rule guarantees uniqueness but can be brittle across implementations; a looser one is portable but may leave two equivalent inputs with different forms.
- Scope of the canonical claim — the domain over which existence is asserted. Narrow it and the guarantee is airtight but covers less; widen it and you inherit the burden of proving regularity everywhere.
- Version pinning — whether the convention is frozen or free to improve. Freezing protects historical keys; letting it float lets the algorithm get better but can silently re-key old data.
- Idempotence tolerance — exact for discrete forms, a numerical band for continuous ones; too loose and near-duplicates leak through as distinct.
When it helps, and when it misleads¶
Its strength is that it turns an equivalence relation into an equality check: once every member maps to one form, deduplication, caching, and cross-tool joins become trivial string comparisons. It is the cheapest correct answer whenever a global regular form genuinely exists and interoperability is the only goal.
Its failure mode is that the guarantee quietly dissolves when the canonical algorithm changes. If a library updates its ranking heuristic — as canonical-numbering schemes descended from the Morgan algorithm[1] have across versions — the same molecule can acquire two different "canonical" strings on either side of an upgrade, splitting records that a dedupe pass had merged. The classic misuse is to reify the convention: treating the canonical form as the real object rather than one chosen representative, and then baking its arbitrary features (a particular atom numbering, say) into a downstream metric. The guarding discipline is to pin and version the convention, run a quiet idempotence self-check on a sample after every upgrade, and remember that a canonical form is a reversible convenience, not the thing itself.
How it implements the components¶
representative_selection_rule— the deterministic ordering-plus-tie-break is the selection rule; it names exactly one representative per class with no residual choice.representation_choice_provenance— the stamped algorithm-and-version record makes the convention visible to reviewers and downstream systems, so a re-key can be detected rather than silently absorbed.
It does not implement gauge_degree_map or residual_freedom_register — those belong to Gauge-Fixing Condition, which removes only specified freedom and logs what remains, whereas a canonical form claims the residual is empty. Nor does it implement equivalence_class_model — computing on the class itself rather than a chosen member is Quotient-Space Construction.
Related¶
- Instantiates: Representation-Invariant Reasoning — supplies the single-representative selection the archetype permits when a global regular form exists.
- Sibling mechanisms: Coordinate or Basis Transformation · Cross-Representation Regression Suite · Gauge-Fixing Condition · Invariance Property Test · Invariant Observable Report · Patchwise Atlas and Transition Map · Quotient-Space Construction · Redundant-Variable Elimination · Reference-Frame Sweep
Editorial Notes¶
Form Classification¶
Form family: Decision, Gate & Allocation
Rationale: Chooses one repeatable representative when a global regular canonical form genuinely exists, making its operative form a case-specific gate, selection, routing, prioritization, or disposition decision.
Independent corroboration: The frozen evidence defines Canonical Representative Selection as 'Chooses one repeatable representative when a global regular canonical form genuinely exists', so its operative form is Decision, Gate & Allocation.
Review outcome: Independent reviewer agreement; high confidence.
Origin Attribution¶
Primary origin: Mathematics
Origin pattern: Single lineage
Present-day reach: Multi-domain
Rationale: Mathematics selects canonical representatives of equivalence classes when a global, convention-stable normal form can be defined.
Related originating lineages:
- Chemistry & Materials Science — Cheminformatics canonical atom numbering is a concrete named implementation for molecular graphs.
- Computer Science & Software Engineering — Canonicalization algorithms compute repeatable representatives for indexing, comparison, and deduplication.
Review resolution: Mathematics is primary through canonical forms and representatives of equivalence classes. Computing and chemical canonicalization are important applications and implementation lineages, but not independent origins of the general method; its reach is nevertheless multi-domain.
Review outcome: Reconciled after independent review; high confidence.
Notes¶
A canonical form is the limiting case of gauge-fixing: a selection condition strong enough to leave zero residual freedom, everywhere, without a singularity. That is exactly why it is not always available — the moment a domain has a point where no single form is regular, the honest move is to drop back to Gauge-Fixing Condition (accept residual) or Patchwise Atlas and Transition Map (accept local charts), rather than force a global canon that will fracture at the bad point.
References¶
[1] RDKit Project. Backwards Incompatible Changes. RDKit Documentation, version 2026.03.5 (2026). Documents RDKit releases in which canonicalization changes altered canonical atom rankings and canonical SMILES relative to prior versions. registry ↩