← Latest papers
🔢 mathematics

Measuring data types

This paper unifies Sweedler's theory of measuring coalgebras with the categorical semantics of W-types to demonstrate that algebras of certain endofunctors are enriched in coalgebras of the same endofunctor, thereby generalizing the concept of initial algebras and providing new examples through polynomial endofunctors.

Original authors: Lukas Mulder, Paige Randall North, Maximilien Péroux

Published 2026-07-08
📖 5 min read🧠 Deep dive

Original authors: Lukas Mulder, Paige Randall North, Maximilien Péroux

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Picture: A New Way to Compare Computer Programs

Imagine you are a software engineer. You have two different computer programs (let's call them Program A and Program B). Usually, to see if they are related, you ask: "Can I turn Program A into Program B perfectly?" In math and computer science, this is called a homomorphism. It's like checking if two Lego structures are built exactly the same way, just with different colored bricks.

But what if they aren't perfect matches? What if Program A is a bit messy, or Program B is missing a few pieces? In the real world, we often deal with "almost right" or "partially correct" transformations.

This paper introduces a new mathematical tool called Measuring. Instead of just asking "Can I turn A into B perfectly?", it asks: "How close can I get, and how much of A can I successfully translate into B before I run into a wall?"

The authors combine two existing mathematical ideas to create this new tool:

  1. Measuring Coalgebras: A classic idea from algebra about measuring how well two things fit together.
  2. W-Types: The mathematical foundation for how computer languages (like Haskell or Agda) define data structures like lists, trees, and numbers.

The Core Concept: The "Partial Translator"

Think of a Homomorphism (a perfect translator) as a fluent speaker who can translate an entire book from English to French without making a single mistake.

The authors introduce the concept of a Partial Homomorphism (a partial translator). Imagine a translator who knows the first 10 pages of the book perfectly, but then gets stuck on page 11.

  • In traditional math, this translator is a "failure" because they didn't finish the whole book.
  • In this paper's new system, this translator is valuable! We can measure exactly how far they got.

The paper proves that for any two data structures (like a list of numbers or a tree of files), there isn't just a "Yes/No" answer on whether they match. Instead, there is a whole spectrum of "partial matches."

The "Tower of Approximations"

One of the coolest ideas in the paper is the Tower of Coalgebras.

Imagine you are trying to build a bridge between two cliffs (Program A and Program B).

  • Level 0: You can only connect the very first step.
  • Level 1: You can connect the first two steps.
  • Level 2: You can connect the first three steps.
  • ...
  • Level Infinity: You have built the perfect, complete bridge.

The paper shows that you can build a mathematical "tower" where each level represents a slightly better, more complete connection between the two programs.

  • If you can only build a bridge up to Level 5, the math tells you exactly that.
  • If you can build it all the way to the top (Infinity), you have a perfect match.

This allows us to study "broken" or "incomplete" programs not as failures, but as valid, measurable steps toward a perfect solution.

The "Universal Measuring Device"

The authors also discovered a "Universal Measuring Device" (called the Universal Measuring Coalgebra).

Think of this as a Swiss Army Knife for comparisons.

  • If you have a specific data type (like a List of Integers), this device can tell you exactly how many different ways you can partially translate it into another type.
  • It doesn't just give you a list of perfect matches; it gives you a map of all the possible "almost matches," organized by how deep or complex they are.

Why This Matters (According to the Paper)

The paper doesn't claim this will immediately fix bugs in your code or cure diseases. Instead, it claims to:

  1. Deepen our understanding of math: It shows that the "messy" world of partial connections is just as structured and beautiful as the "perfect" world of total connections.
  2. Generalize "W-Types": In computer science, "W-Types" are the standard way to define recursive data (like lists and trees). This paper says, "We can generalize this." We can now define "C-Initial Algebras," which are like data types that are "initial" (the starting point) relative to a specific measuring device, rather than just being the absolute starting point.
  3. Provide a framework for "Partial Induction": Usually, to prove something about a list, you use induction (prove it for the first item, then prove if it works for nn, it works for n+1n+1). This paper suggests a way to do induction that stops partway through, allowing us to reason about processes that might not finish or might only work for a limited depth.

Summary Analogy

Imagine you are trying to fit a key (Program A) into a lock (Program B).

  • Old Math: The key either fits perfectly (it's a homomorphism), or it doesn't (it's not).
  • This Paper: The key might fit halfway in. Or it might fit in the first two teeth but jam on the third. The paper provides a ruler to measure exactly how far the key goes in. It builds a ladder of "fits" from "barely touches" to "perfectly turns."

By combining the math of "measuring" with the math of "data types," the authors have created a more precise, nuanced way to look at how computer programs interact, allowing us to appreciate the value of "almost right" just as much as "perfectly right."

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →