Module 7: The Adjoint Triple and Data Migration
The adjoint triple Σ ⊣ Δ ⊣ Π — left pushforward, base change, right pushforward — is the categorical engine of functorial data migration. Given any morphism of schemas, this triple provides three canonical ways to move data between them, each with a precise semantic interpretation: reindexing, lossy aggregation, and lossless extension. This module develops the triple in full and applies it to the synchronization of heterogeneous datasets. The lab session uses Catlab.jl to implement a real migration and demonstrate contradiction detection via delta lenses.
Learning Objectives
- Define a schema morphism as a functor between schema categories and explain what it encodes.
- Derive the adjoint triple Σ_f ⊣ Δ_f ⊣ Π_f from a schema morphism f: S → T.
- Describe the semantic role of each functor: Δ reindexes, Σ aggregates (lossy), Π extends (lossless).
- Implement a functorial data migration between two schemas in Catlab.jl.
- Define a delta lens and explain how it enables bidirectional synchronization with put/get coherence.
- Demonstrate how a symmetric lens surfaces contradictions between two heterogeneous models.
Materials
Key Concepts
- Schema Morphism: A functor f: S → T between schema categories; maps tables to tables and foreign keys to foreign keys, defining how one schema relates to another.
- Base Change Δ_f: Reindexing data along a schema morphism; the middle functor of the triple; always exists for any schema morphism; preserves both limits and colimits.
- Left Pushforward Σ_f: Left adjoint to Δ_f; computes colimit-based aggregation of data along f; lossy — can merge distinct rows.
- Right Pushforward Π_f: Right adjoint to Δ_f; computes limit-based extension of data along f; lossless — fills gaps with all compatible tuples.
- Delta Lens: A pair of functors (get, put) satisfying coherence laws; enables bidirectional data transformation with a well-defined round-trip property.
- Contradiction Detection: When the put direction of a lens cannot be satisfied — a signal that the two models being synchronized are structurally inconsistent; previews Module 11's sheaf cohomology.
Central Concepts from Prerequisites
- Modules 2–6: categories, functors, adjunctions, limits and colimits
- Databases: schema design, ETL pipelines, data integration
- Julia or Python for the lab component