← Open Source

Create Epic Math and Physics Animations & Study Notes From Text and Images.

Python
Momentum
+2stars in 24 hours+0.1%
3.12k
Stars
354
Forks
+65
This week
13
Contributors
Created 2025-01-20 · Updated 2026-12-06 · #3812 today
Top developers
HarleyCoopsvenkatpachalaAnubhav-2003
README

Math-To-Manim

Featured: Exotic Four-Spheres (film, paper and Lean file)

Watch the film (1080p60, 7 min 24 s) · 720p copy · Companion paper (PDF, 9 pages) · Lean file · Manim source · Repository with the full record

The smooth four-dimensional Poincaré conjecture says that a closed smooth 4-manifold with the homotopy type of S⁴ is diffeomorphic to S⁴. On 4 December 2026 OpenAI released a preprint that says the conjecture is false. It builds homotopy 4-spheres from two knots. Inside each one, a single torus gives infinitely many independent classes in an invariant made from Khovanov homology. The standard S⁴ has only one such class. This 7-minute film shows that argument in one continuous 3D world with nine stations. The run also wrote a 9-page paper and a Lean file that prove the elementary mathematics on screen. The film was made on the same day as the preprint.

The result is a claim. It is not confirmed. The preprint is not refereed, and it has no Lean proof. The film says so in its first act and in its last act. The Lean file here checks elementary algebra only.

Credit. All of the mathematics is from Exotic four-spheres detected by Khovanov homology by OpenAI, in openai/math (Apache 2.0). The film, the companion paper and the Lean file only explain that preprint. The film has its own repository, HarleyCoops/EXOTICFOURSPHERE, which holds the source paper, the companions and the full run record.


Featured: No Room Left Standing (film and paper)

Watch the film (720p, 12 min 55 s) · 1080p60 master · Companion paper (PDF, 18 pages) · Manim source · Stage artifacts and run record

Take a bounded operator T on a Hilbert space. A closed invariant subspace is a room that T never leaves: if a vector starts in the room, T keeps it there. In finite dimensions every operator has such a room, because it has an eigenvector. The invariant subspace problem asks if this is also true on ℓ², the infinite-dimensional space. The question was open for decades. In November 2026 an internal Claude research model answered no. It built one operator T on ℓ², with ‖T‖ ≤ 1, whose only closed invariant subspaces are {0} and ℓ². This 13-minute film explains that construction in one continuous 3D world with 19 acts. The run also wrote an 18-page companion paper that writes out every step of the proof.

Credit. The theorem, the proof and the Lean formalization are from A counterexample to the invariant subspace problem on ℓ² by Claude (Anthropic), in anthropics/formal-math (Apache 2.0). Anthropic researchers read and confirmed its argument. The film and the companion paper here only explain that result.


Featured: The Mix That Cannot Kill a Pole (film, paper and Lean file)

Watch the film (720p, 264 s) · Paper (PDF) · Lean file · Manim source · Stage artifacts and run record

Take a curve g. Make three copies. Delay two of them by log 2 and log 4. Add the copies with weights −1, 3 and −2. The weights sum to zero, so the mix cancels things. It does not cancel a pole of the transform of g that lies inside the critical strip 0 < Re s < 1. This 4-minute film shows why, in one continuous 3D world with five stations. The run also wrote an 11-page paper and a Lean file that prove the same statement. Credit. The question and the mathematics are Lee Crossley's. All credit goes to his Lean file DelayedPole.lean in prime-window-rh-criterion. The film, the paper and the Lean file here only explain his result. His result is one step of a conditional criterion. It is not a proof of the Riemann hypothesis.


The wall: 20 earlier films

Math-To-Manim turns frontier mathematics into verified 3D Manim and Blender films in a single CLI call. The three films above are the newest ones. These are 20 of the films that came before them.

The numbers are the tile numbers. A link opens the full MP4, or the full GIF when the repo has no MP4. Also in the archive: Altermagnetism, Unit Distance Disproof and A Frontier for the Zeros.

The newer films come from separate model silos under src/: Claude Fable 5.2 and Claude Opus 5.5 (mythos, studio), Gemini 4 Neon (neon), Gemini 4 Argon (argon), and GPT-6 Astra with Jev (astra). See docs/SHOWCASE.md for the complete archive of films, Studio Blender+Manim comparisons, Mythos MCP docs, and installation guides. To rebuild the wall from the GIFs in the repo, run python scripts/build_gif_wall.py.


Exotic Four-Spheres: the run, how to change the film, and the RL experiment

The run

  • The input was one prompt and the 177-page preprint. The prompt is in production/prompt.txt, without changes.
  • This repository was cloned at commit d0ab49f and not changed. A Claude Fable 5.2 session answered the six Mythos stages and codegen through scripts/operate_mythos_chain.py. The harness accepted all seven replies on the first pass.
  • The dossier has 33 formulas. The shot list has 118 shots in 9 acts. Codegen wrote one Manim ThreeDScene, ExoticFourSpheresJourney (1,144 lines).
  • A 480p test render showed seven layout defects. The operator corrected the scene and rebuilt the stage replies before the recorded run.
  • The harness rendered 327 animations (26,619 frames) at 1920 × 1080, 60 fps, in 1,188 seconds, on a cloud Linux workspace with 2 CPU cores that scripts/bootstrap-render.sh set up. The film is 443.65 seconds long.
  • The companion stages built the paper with pdflatex (9 pages) and checked the Lean file with Lean 4.33.1 and Mathlib 0df444a (no sorry, 0 warnings).
  • The run has no token counts and no event trace, because an operator session answered the stages. The first versions of the files are not kept. No independent reviewer checked the film, the paper or the Lean file.

The stage-by-stage table and the timeline are in The run.

How to change the film

Manim renders mythos_scene.py. The six JSON files are the plan that the scene was written from. There are three ways to change the film, and the first two were tested on the files of this run:

  1. A small change by hand. Change a caption, a colour or a number in the JSON file and in the scene. Then python scripts/operate_mythos_chain.py <folder> --render -q l validates the files again and renders a draft.
  2. Change the plan and let a model write the rest. Change an early file, delete the later files, and run the operator script. It stops at the first file that is not there and writes the full prompt for that stage to NEXT_PROMPT.txt.
  3. A new run from the prompt. math-to-manim-mythos run --brief-file prompt.txt --render -q h --companions paper,lean.

The table of which field holds what, and the rules that the harness applies, are in Change the film: edit the agent files.

The RL experiment and Studio

The run is also a data point for the experiment in this repository: can a small open model learn to write and repair Manim scenes from the records of runs?

  • Built here: the visual-improvement environment (environments/m2m2_visual_improvement/README.md), trace capture (src/mythos/trace.py) and the motion profile (--profile motion). The experiment ledger in experiments/prime_rl/ records a capability preflight and no training result.
  • This run adds seven prompt and reply pairs on a hard paper (production/prompts/), a scene that renders with the harness verdict, a list of seven visual defects with their corrections, and a Lean file as a reward that needs no judge.
  • Its limit: the code before the corrections is not kept. Later runs must keep each code version.
  • Studio (src/studio/) is the planned base for RL experiments, because a policy that writes a typed SceneSpec cannot run code, a wrong field is rejected before a render, and one shot renders in seconds. The train command is not built.

The full section is The RL experiment and M2M Studio.


No Room Left Standing: how it was made and the paper

How it was made

  • The input was one prompt: "Explain this new paper … make it epic", with the source paper's LaTeX attached without changes and the usual art direction (one 3D world, a zoom into every formula). The prompt is in docs/showcase/no-room-left-standing/prompt.txt.
  • One CLI call ran the six Mythos stages and codegen on Claude Fable 5.2: m2m run --brief-file prompt.txt --render -q h --companions paper. The stages took 39 minutes. The shot list has 279 shots in 19 acts.
  • Codegen wrote one Manim ThreeDScene, NoRoomLeftJourney (1,788 lines). It passed the static checks on the first attempt.
  • The first render stopped at the 60-minute limit, after 385 animations. A second render with no limit finished all 627 animations at 1920 × 1080, 60 fps, in about 70 minutes. The film is 774.8 seconds long. The GIF at the top of this page is 40 seconds of it.
  • The paper companion did not build at first: MiKTeX had no amsart.cls, and the repair stage added a fallback that LaTeX cannot compile. After amscls was installed, the repaired paper.tex built with pdflatex, unchanged.
  • The film has no narration. No independent reviewer checked the film or the companion paper.

The construction, in the companion paper

A block is a nilpotent operator t on a space K of dimension d with a cyclic vector e. So e, te, …, t^{d−1}e is a basis, and t^d = 0. The film draws a block as a staircase.

The tower starts from nothing, $K_0 = \mathbb{C}$ and $T_0 = 0$. Each step takes $D$ orthogonal copies of the last level and ties them together with a small perturbation:

$$K_{n+1} = K_n^{D}, \qquad T_{n+1} = S = T_n \otimes 1 + \varepsilon R, \qquad |T_{n+1} - T_n \otimes 1| \le \tau_{n+1}$$

The multipliers of Lemma 3.1 are $u_0 = -1$, $u_{D-1} = 1$ and $|u_j| \le \tau$ for the other copies, with $\prod_j (1 - u_j z) \equiv 1 \pmod{z^d}$. These are the film's "two shouts, many whispers".

The step gives two properties. Reach: a polynomial tool in $I_1(S)$ carries the first copy to the last copy, with $\mathrm{Re}\langle Av, w\rangle \ge \mu$. Split: a tool acts on the first and last copies separately, at a cost of $24L\tau$. The costs are chosen in advance so that all later costs fit in a quarter of the gain:

$$\gamma_{n+1} = 24 L_n \tau_{n+1} \le 2^{-n-3}\min(\mu_0, \dots, \mu_n), \qquad \sum_{m>n}\gamma_m \le \tfrac14 \mu_n$$

The corrections shrink fast, so the limit exists: $T = \lim \hat T_n$ in norm, $|T| \le 1$.

Now suppose $T$ keeps a room $M$ with ${0} \ne M \ne \ell^2$. Take unit vectors $\xi \in M$ and $\zeta \perp M$. Then $\langle q(T)\xi, \zeta\rangle = 0$ for every polynomial $q$. The proof descends the tower along every path (Fibers), glues the tools into one (Splitting), and pays the last two costs (Limit). It builds one polynomial with

$$\mathrm{Re},\langle q(T)\xi, \zeta\rangle ;\ge; \tfrac12\mu - \rho_N - \gamma_{N+1} - \delta_N ;\ge; \tfrac14\mu - \delta_N ;>; 0$$

for large $N$. That is a contradiction, so no such room exists.

The companion paper adds exact numbers for the first levels. At level 1, $\tau_1 \le 1/192$, $T_1$ is a multiple of the shift on $\mathbb{C}^3$, and $\mu_1 = 1/8$. Level 2 already has $D_2 \ge 339{,}738{,}631$ copies and dimension $d_2 \ge 1{,}019{,}215{,}893$. Each finite level still has a full chain of invariant subspaces. Only the limit has none, and the film's last acts say this.

The source proof is formalized in Lean 4 and Mathlib (IspMinimal.exists_no_invariant_subspace, onL2, not_ISP in the source repository). This repository did not run that Lean development again.


The Mix That Cannot Kill a Pole: how it was made, the paper and the Lean file

How it was made

  • The input was Lee Crossley's question, with his DelayedPole.lean as context. The art direction was: one 3D world, and a zoom into every formula.
  • A Claude Fable 5.2 session answered the six Mythos stages and codegen through scripts/operate_mythos_chain.py. The harness validated each reply.
  • The chain wrote one Manim ThreeDScene, PoleSurvivesTheMixJourney (844 lines). The static check rejected the first version: six \tfrac12 fragments had no braces.
  • The harness rendered 187 animations at 1920 × 1080, 60 fps, in 891 seconds. The film is 264 seconds long. The GIF at the top of this page is 40 seconds of it.
  • Two new companion stages wrote the paper and the Lean file (docs/MYTHOS_COMPANIONS.md). The harness compiled the paper with pdflatex and checked the Lean file with Lean 4.33.1 and Mathlib.
  • The film has no narration. No independent reviewer checked the film or the paper.

The calculation, in the paper

The mix, with delays that are zero before they start:

$$D(u) = -g(u) + 3,g(u-\log 2) - 2,g(u-\log 4)$$

A delay by $a$ multiplies the Laplace transform by $e^{-sa}$. So the mix multiplies the transform by one function, the symbol. Write $q = 2^{-s}$:

$$m(s) = -1 + 3\cdot 2^{-s} - 2\cdot 4^{-s} = -1 + 3q - 2q^2 = (1-q)(2q-1)$$

The symbol is zero only when $q = 1$ or $q = \tfrac{1}{2}$. The size of $q$ depends only on the real part of $s$:

$$|q| = 2^{-\mathrm{Re},s}, \qquad 0 < \mathrm{Re},s < 1 ;\Longrightarrow; \tfrac{1}{2} < |q| < 1$$

So every zero of $m$ is on a wall of the strip, and no zero is inside:

$$m(s) = 0 \iff s = \frac{2\pi i k}{\log 2} \ \text{ or }\ s = 1 + \frac{2\pi i k}{\log 2}, \quad k \in \mathbb{Z}$$

The triangle inequality gives a floor and a ceiling on each vertical line $\mathrm{Re},s = \sigma$, with $x = 2^{-\sigma}$:

$$(1-x)(2x-1) ;\le; |m(\sigma + it)| ;\le; (1+x)(2x+1)$$

Near a pole, the transform is $r/(s-\rho)$ plus an analytic part. The symbol is entire, so the pole stays and only the residue changes:

$$m(s),\frac{r}{s-\rho} = \frac{m(\rho),r}{s-\rho} + r,\frac{m(s)-m(\rho)}{s-\rho}, \qquad m(\rho),r \ne 0$$

The worked example of the paper, at the first zeta zero $\rho_1 = \tfrac{1}{2} + 14.134725,i$:

Quantity Value
$q = 2^{-\rho_1}$ $-0.658571 + 0.257458,i$
$\lvert q\rvert = 2^{-1/2}$, $\arg q$ $0.707107$, $158.648^\circ$
$1 - q$ $1.658571 - 0.257458,i$
$2q - 1$ $-2.317141 + 0.514916,i$
$m(\rho_1) = (1-q)(2q-1)$ $-3.710574 + 1.450591,i$
$\lvert m(\rho_1)\rvert$ $3.984040$
floor and ceiling on the critical line, $3/\sqrt2 \mp 2$ $0.121320$ and $4.121320$
residue of the transform at $\rho_1$, $1/(\tfrac{1}{4} + \gamma_1^2)$ $0.004999$
size of the residue after the mix $0.019916$

The pole of the first zeta zero becomes about 4 times larger. The paper also shows that the two zeros on the walls are necessary: they are what makes the weight of the mix a compact tent on (1, 4).

The same calculation, in Lean

The file DelayedPoleSurvival.lean imports only Mathlib. It has no sorry. Its theorems use the axioms propext, Classical.choice and Quot.sound only.

The Lean reference is Lee Crossley's DelayedPole.lean (CC BY 4.0). Read his file first: it is the original, and it has the application to Dirichlet families that our file does not have. Our file restates his definitions delay, compactDifference (here mix) and symbol. It adapts his proofs of laplace_delay, symbol_real (here symbol_pos_of_real) and compactDifference_poleData (here mix_poleData).

The three definitions:

/-- Delay `g` by `a`, and put zero where the delayed curve has not started. -/
def delay (a : ℝ) (g : ℝ → ℝ) (u : ℝ) : ℝ := if a < u then g (u - a) else 0

/-- Three copies of `g` with delays `0`, `c`, `2c` and weights `-1`, `3`, `-2`. -/
def mix (c : ℝ) (g : ℝ → ℝ) (u : ℝ) : ℝ :=
  -delay 0 g u + 3 * delay c g u - 2 * delay (2 * c) g u

/-- The multiplier of the mix on the Laplace side. With `c = log 2` and
`q = 2^(-s)` this is `(1 - q)(2q - 1)`. -/
def symbol (c : ℝ) (s : ℂ) : ℂ := (1 - cexp (-s * c)) * (2 * cexp (-s * c) - 1)

The radius of q, and the strip that goes into the annulus:

/-- `|e^(-sc)| = e^(-Re(s) c)`: the radius of `q` depends only on `Re s`. -/
theorem norm_q (c : ℝ) (s : ℂ) : ‖cexp (-s * (c : ℂ))‖ = Real.exp (-s.re * c) := by
  simp [Complex.norm_exp]

/-- The strip `0 < Re s < 1` goes into the open annulus `1/2 < |q| < 1`. -/
theorem q_mem_annulus {s : ℂ} (h0 : 0 < s.re) (h1 : s.re < 1) :
    1 / 2 < ‖cexp (-s * (Real.log 2 : ℂ))‖ ∧ ‖cexp (-s * (Real.log 2 : ℂ))‖ < 1 := by
  rw [norm_q]; exact radius_bounds h0 h1

The floor (statement only; the proof is 12 lines), and the theorem that the symbol has no zero inside the strip:

/-- The quantitative floor: on the line `Re s = σ`, `0 < σ < 1`,
`|m(s)| ≥ (1 - 2^(-σ)) (2·2^(-σ) - 1) > 0`. -/
theorem symbol_norm_lower {s : ℂ} (h0 : 0 < s.re) (h1 : s.re < 1) :
    (1 - Real.exp (-s.re * Real.log 2)) * (2 * Real.exp (-s.re * Real.log 2) - 1)
      ≤ ‖symbol (Real.log 2) s‖

/-- **No blind spot inside the strip.** The symbol has no zero with `0 < Re s < 1`. -/
theorem symbol_ne_zero {s : ℂ} (h0 : 0 < s.re) (h1 : s.re < 1) :
    symbol (Real.log 2) s ≠ 0 :=
  norm_pos_iff.mp (lt_of_lt_of_le (floor_pos h0 h1) (symbol_norm_lower h0 h1))

The pole survives:

/-- **The pole survives the mix.** A simple pole of `Φ` at a point `ρ` of the
open strip, with residue `r ≠ 0`, is a simple pole of `m·Φ` with the nonzero
residue `m(ρ) r`. -/
theorem pole_survives_mix {Φ h : ℂ → ℂ} {ρ r : ℂ} (h0 : 0 < ρ.re) (h1 : ρ.re < 1)
    (hr : r ≠ 0) (hh : AnalyticAt ℂ h ρ)
    (hΦ : ∀ᶠ s in 𝓝[≠] ρ, Φ s = r / (s - ρ) + h s) :
    symbol (Real.log 2) ρ * r ≠ 0 ∧ ∃ h' : ℂ → ℂ, AnalyticAt ℂ h' ρ ∧
      ∀ᶠ s in 𝓝[≠] ρ, symbol (Real.log 2) s * Φ s =
        (symbol (Real.log 2) ρ * r) / (s - ρ) + h' s :=
  ⟨mul_ne_zero (symbol_ne_zero h0 h1) hr,
    pole_transfer (symbol_differentiable _) hh hΦ⟩

The file also evaluates the numbers in floating point. This is a test, not a proof. The comment on each #eval line is the value that Lean printed:

/-- `q = 2^(-s)` at `s = σ + i t`: radius `2^(-σ)`, angle `-t log 2`. -/
def q (σ t : Float) : Cx :=
  let r := Float.exp (-(σ * log2))
  ⟨r * Float.cos (t * log2), -(r * Float.sin (t * log2))⟩

/-- The symbol `m(s) = (1 - q)(2q - 1)` at `s = σ + i t`. -/
def symbolF (σ t : Float) : Cx :=
  let z := q σ t
  Cx.mul ⟨1 - z.re, -z.im⟩ ⟨2 * z.re - 1, 2 * z.im⟩

#eval (q 0.5 gamma1).re                     -- -0.658571
#eval (q 0.5 gamma1).im                     -- 0.257458
#eval (q 0.5 gamma1).abs                    -- 0.707107
#eval (symbolF 0.5 gamma1).re               -- -3.710574
#eval (symbolF 0.5 gamma1).im               -- 1.450591
#eval (symbolF 0.5 gamma1).abs              -- 3.984040
#eval floorF 0.5                            -- 0.121320
#eval gridMinRatio                          -- 1.000000
#eval gridMinAbs                            -- 0.003454
#eval 2 * 3.141592653589793 / log2          -- 9.064720

More theorems are in the file: laplace_delay and laplace_mix (a delay, and the mix, are multiplications on the Laplace side), symbol_zero_left and symbol_zero_right (both walls carry zeros), tent_eq (the tent weight), and mix_poleData, a Mathlib-only version of Crossley's compactDifference_poleData. The numbers of the scene are tested in tests/test_pole_survives_the_mix.py.


Featured: Chaining Theta Lifts to the Critical Line (math-to-manim-neon)

On November 20, 2026, two separate claimed proofs of the Generalized Riemann Hypothesis were announced on the same day:

  • Levent Alpöge & Claude (Anthropic): 4-page overview + 175,000+ Lean 4 files (~250,000 pages equivalent) bypassing the missing integer derivative in Stepanov's method by chaining roughly $\sqrt{X}$ automorphic theta lifts for a von Mangoldt sum of length $X$.
  • Alessandro Masullo (Stanford, announced by Ravi Vakil): 12-year, ~940-page all-human manuscript vetted by Brian Conrad.

Both claims are newly announced and await independent peer and formal-kernel verification.

How the Gemini 4 Neon-first CLI (src/neon/) works

Instead of splitting reasoning across six sequential JSON-handoff stages, math-to-manim-neon unifies planning, numerical verification, codegen, static scene checks, Manim rendering, and showcase publishing into one CLI call:

  • Pluggable Neon backends (src/neon/backends.py): native google-genai SDK (gemini-4-neon with ThinkingConfig + live function calling), official gemini-api CLI, or session-driven operator mode.
  • First-class toolbelt (src/neon/tools.py):
    • verify_math: sandboxed real & complex NumPy/AST numerical evaluator.
    • check_scene: AST syntax, ThreeDScene camera discipline, and banned-import guard.
    • render_scene: secret-scrubbed Manim render + ffprobe + 12-frame contact sheet & highlights GIF.
    • publish_film: writes showcase assets and production logs (01_neon_plan.json, tool_calls.jsonl, validation.json, manifest.json).
  • This film: RiemannThetaLiftJourney (421 lines) passed all 5 verify_math checks and check_scene with 0 repairs (outcome: film_published).


Featured: Base 12 Computer — From a Notebook Sketch

Watch the complete film (104 s, 720p30) · Original pencil sketch · Generated ThreeDScene (316 lines)

Made from a single photograph of a notebook page with zero formulas written on it: Claude Fable 5.2 recognized $K_{12}$ with $\binom{12}{2}=66$ wires, folded it onto an icosahedron ($66 = 30 + 30 + 6$), and rendered a base-12 counter on the first attempt with zero repairs.


Architecture & Testing

Every provider lives in an independent silo under src/ (neon, studio, mythos, argon, astra, grok, glm, mimo, sol) with strict zero-cross-import boundaries:

pytest tests/test_silo_boundaries.py tests/test_neon_silo.py

Full documentation for all silos, Studio (Blender EEVEE + Manim), Mythos MCP, and Astra+Jev lives in docs/SHOWCASE.md.


License

MIT — see LICENSE.

Nearby in the ranking

AI Rank for iPhone

Follow AI model rankings

Download on the App Store