Estimation of Persistence Diagrams via the Three Gap Theorem

This paper proposes a fast and provably correct method for approximating the persistence diagrams of sliding window embeddings of quasiperiodic functions by integrating the Three Gap Theorem from number theory with the Persistent Künneth formula from topological data analysis.

Luis Suarez Salas, Jose A. Perea

Published 2026-03-06
📖 6 min read🧠 Deep dive

Here is an explanation of the paper "Estimation of Persistence Diagrams Via the Three Gap Theorem" using simple language, analogies, and metaphors.

The Big Picture: Finding Shapes in Noise

Imagine you are listening to a complex piece of music. It's not just a simple drumbeat (periodic); it's a mix of several instruments playing slightly different rhythms that never quite line up perfectly (quasiperiodic).

Scientists often want to know: "What is the underlying shape of this rhythm?"

  • Is it a simple circle (one repeating beat)?
  • Is it a donut (two interlocking rhythms)?
  • Is it a pretzel (three or more complex rhythms)?

In mathematics, this "shape" is called an attractor. To find it, researchers use a technique called Sliding Window Embedding. Imagine taking a snapshot of the music every second, then taking a snapshot of the next second, and so on, stacking them up to create a 3D sculpture. If the music is quasiperiodic, this sculpture looks like a torus (a donut shape).

Once they have this 3D donut made of points, they use a tool called Topological Data Analysis (TDA) to count the holes.

  • A circle has 1 hole.
  • A donut has 2 holes (one in the middle, one through the tube).
  • A pretzel has 3 holes.

This counting process produces a Persistence Diagram, which is essentially a map showing where the holes are and how "strong" they are.

The Problem: The "Brute Force" Bottleneck

Here is the catch: To build this 3D donut and count the holes, you need a lot of data points.

  • If you have 1,000 points, the computer has to check the distance between every single pair of points to build the shape.
  • The number of connections grows explosively. It's like trying to connect every person in a stadium to every other person with a string.
  • For complex rhythms, this calculation takes hours or even days on a supercomputer. It's too slow for real-time use.

The Solution: The "Three Gap" Shortcut

The authors of this paper found a clever shortcut. Instead of building the whole 3D donut and counting the holes the hard way, they realized they could predict the shape using two mathematical tricks:

1. The Three Gap Theorem (The "Clock" Trick)

Imagine you have a clock face. You start at 12:00 and move forward by a weird, irrational amount of time (like π\pi minutes) every tick. You mark where you land.

  • After a while, you'll notice that the gaps between your marks on the clock face are never random. They are always one of three specific sizes (or sometimes just two).
  • This is the Three Gap Theorem. It's a rule from number theory that says, "If you spin a wheel by an irrational amount, the gaps between your stops are highly predictable."

The authors realized that the "holes" in their 3D data are directly related to these predictable gaps on the clock. Instead of measuring the whole 3D shape, they just need to measure the gaps on the 1D clock face. This is incredibly fast.

2. The K"unneth Formula (The "Lego" Trick)

If your music has two different rhythms (like a drum and a guitar), the shape is a 2D donut (a torus).

  • The K"unneth Formula is a mathematical rule that says: "If you know the shape of the drum rhythm and the shape of the guitar rhythm separately, you can mathematically 'multiply' them to get the shape of the combined donut."
  • It's like knowing that a square plus a line makes a square, and a circle plus a line makes a cylinder. You don't need to build the cylinder from scratch; you just combine the known parts.

How the New Method Works (The "3G Pipeline")

The authors combined these two tricks into a new pipeline called 3G (Three Gap):

  1. Listen to the Signal: They take the time series data (the music).
  2. Find the Frequencies: They use a standard tool (FFT) to find the "notes" (frequencies) being played.
  3. The Clock Calculation: For each frequency, they use the Three Gap Theorem to calculate the exact gaps between points on a circle. This tells them the "shape" of that single rhythm instantly.
  4. The Lego Assembly: They use the K"unneth Formula to combine the shapes of all the individual rhythms into the final 3D shape.
  5. The Result: They get the Persistence Diagram (the map of holes) almost instantly.

Why This Matters

  • Speed: In the paper's tests, the old method took hours (e.g., 7,000 seconds). The new 3G method took less than 1 second. That's a speed-up of thousands of times!
  • Accuracy: They didn't just guess; they proved mathematically that their shortcut is within a specific, known margin of error. It's like saying, "I didn't measure the whole building, but I know the height is between 100 and 102 feet."
  • Real-World Use: This allows scientists to analyze complex systems in real-time.
    • Earthquakes: Detecting if a building's vibration is safe or chaotic.
    • Medicine: Analyzing brain waves (fMRI) or heart rhythms to spot early signs of disease.
    • Space Travel: Calculating safe, efficient paths for spacecraft around the Earth and Moon.

Summary Analogy

The Old Way:
You want to know how many rooms are in a massive, foggy castle. You have to walk through every single hallway, open every door, and count them one by one. It takes all day.

The New Way (3G):
You realize the castle is built from a few standard blueprints. Instead of walking through, you look at the blueprints (the frequencies), use a rule about how the bricks are laid (Three Gap Theorem) to see the room layout of one wing, and then use a multiplication rule (K"unneth) to instantly know the layout of the whole castle. You get the answer in a blink, with a guarantee that you are correct within a few feet.

This paper gives scientists a "blueprint reader" for complex, rhythmic data, turning a slow, impossible task into a fast, reliable one.