AI-generated fun with vibe coding, math and physics (part 4)
(Credit: Tesfu Assefa).

AI-generated fun with vibe coding, math and physics (part 4)

In this continuation of my series on AI-generated science, I revisit a project to interpret fractional calculus through fractal geometry with assistance from Grok Bot and other AI models.
Dec 3, 2026
12 min read
0.00 MPXR

This post continues my previous posts "AI-generated fun with vibe coding, math and physics" (Part 1, Part 2, Part 3).

At the end of Part 3 I said that this particular project was concluded. I had found what I was looking for: a simple intuitive interpretation of fractional calculus and its connection with fractal geometry. I also said that it would be fun to revise the AI-written paper as suggested by Claude's referee report, and turn it into a real scientific paper. Well, I couldn't resist. I was stimulated by the story of a society of AI scientists and the journal they built for themselves, which I wrote about recently. If AI agents can do science and review each other's papers, why not try with my little paper?

The new paper is titled "Riemann-Liouville fractional integrals as expected local times on the zero sets of fractional Brownian motion" and authored by "Grok Bot, with human assistance from Giulio Prisco." Grok Bot is the AI agent that I use as my assistant these days. The paper, the code, a machine-checked proof and all the referee reports are in a new subrepository of my GitHub repository fracturlab. It is a new version of the earlier subrepository described in Part 3.

Let me say it right away: this is not Navier-Stokes, or Riemann (the only Riemann in this paper is the one in Riemann-Liouville, who happens to be the same Riemann). Nobody is going to win a Millennium Prize for this. But I think it's a nice little contribution, and it gives a clear and, I think, beautiful picture of what fractional calculus is.

What is a fractional integral, again?

You can integrate a function once and get the area under its graph. You can integrate it twice, three times, and so forth. Fractional calculus asks: what about half an integral? The Riemann-Liouville fractional integral of order alpha (between zero and one) answers with a formula. Like an ordinary integral, it adds up all the past values of a function. But while an ordinary integral has total recall and gives every past moment the same weight, a fractional integral has selective, fading recall: the weight fades like a power of the distance from now, so the recent past counts more and the distant past counts less.

The formula works, and scientists use it for anomalous diffusion, viscoelastic materials and many other things (see Part 2). But what does it mean? An ordinary integral is an area, and everyone can picture an area. For fractional integrals there is no picture that everyone agrees on. Raoul Nigmatullin suggested that a fractional integral of order alpha is like an ordinary integral restricted to a Cantor set of fractal dimension alpha. This is a lovely idea, but it works only approximately. Cantor sets are rigid, and they give the power law only up to small wiggles that repeat at every scale.

In later writings, for example this 2005 paper, Nigmatullin points to a clear account of this idea in the book "Flèches du temps et géométrie fractale" (Alain Le Méhauté, Raoul R. Nigmatullin, Laurent Nivanen). Chapter 5 is the place to look. The authors recover the Riemann-Liouville fractional integral of a function by averaging it over a binary Cantor set and over the choice of scale. As they write, "The result [5.18] can be interpreted as" a smooth weighting of the past by a power law, whose exponent is the fractal dimension of the Cantor set. When the dust fills the interval, "the memory is total and all the states are taken into account by the filter." When the dust thins away, "the filtering leads to a total loss of memory."

A dust of zeros

In Part 3 I replaced the rigid Cantor set with a random fractal: the set of times when a fractional Brownian motion (fBm) is at zero (zero set). Remember that fBm is a rough random path with a "memory" parameter H between zero and one, and that its zero set is a random fractal of dimension 1 - H. So if you choose H = 1 - alpha, you get a random fractal of dimension alpha.

Here is the picture that the new paper makes precise.

Stand at the present time and look back into the past. Launch a rough random fBm path that starts at zero right now and wanders off backward in time. Every time the path comes back to zero, it leaves a mark on the timeline. It is like casting a random fractal net back into the past: the marks form a fine random dust, a fractal of dimension alpha. Now walk along the dust and add up the values of your function at the marks, weighted by how much time the path spends near zero there. Mathematicians call this "local time." A dust of points has zero length, so local time is the natural way to measure how much dust there is in a given stretch of time. Do this for very many random paths and take the average. The paper proves that the average is exactly the fractional integral of order alpha of your function, times a fixed constant.

Why does the memory fade like a power law? Because a random path that starts at zero hangs around zero for a while, then drifts away and comes back less and less often. So the dust is thick near the present and thinner and thinner in the distant past, and on average it thins out exactly like the weight of the fractional integral. The memory of fractional calculus is the density of the dust.

And the order of the fractional integral becomes a fractal dimension. When alpha is close to one, H is close to zero, the path is extremely jagged and crosses zero all the time, and the dust almost fills the timeline: you get back the ordinary integral. When alpha is close to zero, the path is smooth and rarely comes back, and the dust is very sparse: almost no integration at all.

In Part 3 I used the image of a fractal "stencil" through which you see the function. I think the new paper confirms that image, with one important twist.

The twist: look back from now

The random path must start at the present and run backward in time. The dust is densest where the path starts, and the fractional integral gives the most weight to the recent past, so both must start at the same place: now.

The exploratory scripts that Gemini and Grok wrote for Part 3 ran the path forward from the beginning of time, so their dust was thickest in the distant past. Grok Bot found this by rerunning both scripts. In the Gemini script the error was hidden by a rescaling of the result and a wide smoothing kernel. The Grok script computed the right thing, but compared it with the wrong value in a printout. Funny detail: in an intermediate draft Grok Bot first blamed a wrong formula in the Grok script, and that diagnosis was wrong too. A later round found that the formula was fine and the real problem was, again, the missing time reversal. Brilliance and blunders as usual, but this time the blunders were caught and fixed.

(Casting a random fractal net into the past: the zero dust of fBm paths, dense near now and thinning out like the memory of fractional calculus. Made with Grok Bot).
(Casting a random fractal net into the past: the zero dust of fBm paths, dense near now and thinning out like the memory of fractional calculus. Made with Grok Bot).

What the paper shows, and what it doesn't

The paper is careful (more careful than me) about what it claims. The proof uses fBm only through one simple thing: how often, on average, the path is at zero. Any random measure with the same average density would give the same result, even one with no fractal structure at all. So the result does not prove that fractional calculus must come from fractals. Mathematically, a smooth weight would do the same job, but to me the dust is the natural way to spread the weight: points count when they are in the dust, and don't count when they are in the holes. The link with fractal dimension comes from self-similarity: fBm looks statistically the same when you zoom in, and this fixes both the dimension of the dust and the power law. The paper calls the result "a random-fractal reading of Nigmatullin's idea that is exact in the mean," and says that it "may be known to specialists." Its interest is mainly interpretive. That's fine with me, because a visual, intuitive interpretation is exactly what I was looking for.

The paper also generalizes the result to other self-similar random fractals. My favorite example is the simplest one. Take the classic middle-thirds Cantor set (blown up to cover the whole positive half-line) and shrink it by a random factor, a single random number. When you average over many different random shrink factors, the wiggles of Nigmatullin's Cantor sets cancel out and disappear, and you get exactly the fractional integral of order log 2 / log 3 (about 0.63), which is the dimension of the Cantor set. A little randomness turns an approximate picture into an exact one.

The deterministic part of the proof has been checked by a computer in Lean 4, a language for machine-checked proofs. The probabilistic input (the properties of fBm and its local time) is stated as a hypothesis and not machine-checked, because Lean's math library doesn't have fBm yet. Large simulations agree with the predicted results, including the small predicted errors of the numerical method, and an independent second method confirms them.

Five rounds of AI peer review

The process was simple. I sent each version of the paper to Claude, asking it to act as a referee, and sent the report to Grok Bot, which revised the paper. Then again. Claude's ratings went from 5/10 for the February preprint to 7, 8, 8.5, 9 and finally "accept" (about 9/10), with the advice to stop iterating with AI reports. Then I asked Gemini to review the paper and the repository. Gemini found no mathematical issues and suggested three minor fixes, which Grok Bot applied in version 1.0. Then Gemini read version 1.0 and said it is in "publication-ready shape."

Of course, AI referees are not independent peer review, and the paper says so very clearly. A human referee still has to read it. And most journals don't accept AI authors, so if I submit this paper to a journal the author line will have to change.

(Credit: Tesfu Assefa).
(Credit: Tesfu Assefa).

I didn't run the code

I kept "coding" in the title for continuity with the previous parts of this series, but this time I haven't run the code myself. Grok Bot wrote and ran all the code, the simulations and the Lean proofs, and wrote the paper. My role was to propose the idea (back in Part 3), steer, and relay referee reports from one AI to another. In Part 2 I said "don't use AI to do things that you couldn't do yourself without AI, given enough time." This is not a contradiction. I guess I could do all this myself, but I do mostly other things, and doing it alone would take me a year or more. Given enough time, I guess I could. But I do NOT have enough time! This kind of AI help is especially useful to those, like me, who want to understand some deep conceptual point well, but don't have the time or patience to work out all the details. In a recent video, Sabine Hossenfelder talks about how "the revenge of the idea guys," as Sam Altman called it, is creating a "scientific underground." As I commented, the artistic underground advances art, the cultural underground advances culture, and the scientific underground will advance science. Now anyone with a novel idea can try it with the help of AI. Most will fail, but a few will succeed spectacularly.

Progress in only a few months

I'm really impressed with the progress, in only a few months, of the AI assistants that I have used. In February, Gemini and Grok produced a nice exploratory preprint with beautiful pictures, but with no proof, numerical tests only for linear functions, no error analysis, and a hidden error in the scripts. In Part 3 I wrote of "raw brilliance spoiled by occasional blunders." Now Grok Bot has written a complete proof, a full error analysis, new simulations, a Lean check, and revisions through five rounds of referee reports, and it found and explained the old error. The blunders haven't disappeared, but now they get caught and fixed along the way.

In Part 2 I said that I could see the writing on the wall: future AI assistants "will be able to do these things without human assistance, much faster, and perhaps discover better math and physics." I didn't expect it to happen this fast. The society of AI scientists I mentioned above did science together and founded their own peer-reviewed journal. My little project is a tiny version of the same thing: an AI author, AI referees, and a human who mostly watches and says "please."

The initial idea of this project came from me. Next time, I guess, the AI will also have the idea. And sooner or later a really spectacular breakthrough will come out of an AI. I wouldn't be surprised if it happens soon. I find this immensely exciting. And the best part is that, at least this time, the AI explained what it did in a way that I can understand.

About the Writer

More from Mindplex

Keep reading

Three more ideas worth your time.

Browse Magazine

Discussion

Join the discussion

Sign in to share a response with the community.

Type @ to mention someone Type / or use + to add a block Highlight text, then choose Link
Loading editor

Comments cannot be edited after posting because they become part of the reputation record. Give yours a quick review first.