Skip to content

mlnjsh/animated-proof-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Animated Proof Gallery

Mathematical Proofs Come Alive --- Powered by Manim

Python 3.10+ Manim Community License: MIT Proofs Made with LaTeX


Rigorous mathematics deserves more than static ink on paper.

This repository contains animated visualizations of key theorems and proof techniques spanning Topological Data Analysis, Fixed Point Theory, Multi-Objective Optimization, Banach Algebras, and Support Vector Machine Classification. Every animation is written in Manim Community Edition and is fully reproducible from source.


Gallery Preview

Proof Domain Key Idea
Persistent Homology Topological Data Analysis Vietoris--Rips filtration and persistence barcodes
Banach Fixed Point Theorem Functional Analysis Contraction mappings and cobweb iteration
Pareto Front Construction Optimization Dominance, non-dominated sets, and the Pareto frontier
Banach Algebra Spectrum Abstract Algebra / Analysis Norms, spectral radius, and invertibility
SVM Maximum Margin Machine Learning Theory Optimal separating hyperplane and support vectors

Proof Catalog

1. Persistent Homology

File: proofs/persistent_homology/scene.py

Visualizes the core pipeline of persistent homology:

  • A random 2D point cloud is sampled.
  • Balls of increasing radius grow around each point (Vietoris--Rips construction).
  • Edges appear when balls overlap; triangles fill when three-way intersections form.
  • A persistence barcode diagram is drawn, showing birth and death of topological features.

Mathematical context: Persistent homology tracks how topological features (connected components, loops, voids) appear and disappear across a filtration of simplicial complexes built from data. The resulting barcodes provide a multi-scale signature of the shape of data.


2. Banach Fixed Point Theorem

File: proofs/fixed_point_theorems/scene.py

Animates the classical Banach contraction mapping theorem on the real line:

  • A contraction mapping f: [0,1] -> [0,1] is plotted alongside y = x.
  • Starting from an arbitrary initial point, the cobweb iteration is traced.
  • The iterates visibly converge to the unique fixed point.
  • The contraction constant and convergence rate are displayed.

Mathematical context: If (X, d) is a complete metric space and T: X -> X satisfies d(Tx, Ty) <= q * d(x, y) for some q in (0,1), then T has a unique fixed point, and every Picard iteration converges to it.


3. Pareto Front / Multi-Objective Optimization

File: proofs/optimization/scene.py

Demonstrates Pareto optimality in bi-objective optimization:

  • A scatter of candidate solutions is plotted in objective space.
  • Dominated solutions are identified and dimmed.
  • Non-dominated (Pareto-optimal) solutions are highlighted.
  • The Pareto front curve is traced through the non-dominated set.

Mathematical context: A point x* is Pareto optimal if there is no feasible x such that f_i(x) <= f_i(x*) for all objectives with strict inequality for at least one. The set of all Pareto-optimal points forms the Pareto front.


4. Banach Algebra Spectrum

File: proofs/banach_algebra/scene.py

Visualizes fundamental concepts in Banach algebra theory:

  • A Banach space norm ball is drawn in an abstract 2D representation.
  • The spectrum of an element is displayed in the complex plane.
  • The spectral radius is shown as a bounding circle.
  • Invertibility regions are highlighted with the resolvent set.

Mathematical context: In a unital Banach algebra A, the spectrum sigma(a) of an element a is the set of lambda in C for which lambda e - a is not invertible. The spectral radius formula states r(a) = lim ||a^n||^{1/n} = inf ||a^n||^{1/n}.


5. SVM Maximum Margin Classifier

File: proofs/svm_classification/scene.py

Builds intuition for the Support Vector Machine optimization problem:

  • Two-class data is plotted in 2D feature space.
  • Several candidate separating hyperplanes are drawn.
  • The maximum-margin hyperplane is identified.
  • Support vectors are highlighted and the margin band is shaded.

Mathematical context: The SVM solves min (1/2)||w||^2 subject to y_i(w . x_i + b) >= 1. The optimal hyperplane maximizes the geometric margin 2/||w|| between classes. Only the support vectors (points on the margin boundary) determine the solution.


How to Run

Render a Single Proof

# Low quality (fast preview, 480p @ 15fps)
manim render -ql proofs/persistent_homology/scene.py PersistentHomologyScene

# High quality (production, 1080p @ 60fps)
manim render -qh proofs/persistent_homology/scene.py PersistentHomologyScene

Render All Proofs

for scene_dir in proofs/*/; do
    manim render -qh "${scene_dir}scene.py"
done

Export to GIF

manim render -qh --format=gif proofs/persistent_homology/scene.py PersistentHomologyScene
# Output: media/videos/scene/1080p60/PersistentHomologyScene.gif

Extract Frame Sequences (for Beamer embedding)

mkdir -p frames/persistent_homology
ffmpeg -i media/videos/scene/1080p60/PersistentHomologyScene.mp4 \
       -vf "fps=30" \
       frames/persistent_homology/frame_%04d.png

Dependencies

Python

Package Version Purpose
manim >= 0.18 Animation engine (Community Edition)
numpy >= 1.24 Numerical computation
scipy >= 1.11 Scientific computing utilities

System

Tool Purpose
ffmpeg Video/frame conversion
pdflatex Beamer slide compilation (optional)
Python 3.10+ Runtime

Quick Install

pip install -r requirements.txt

Repository Structure

animated-proof-gallery/
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ proofs/
β”‚   β”œβ”€β”€ persistent_homology/
β”‚   β”‚   └── scene.py          # Vietoris-Rips filtration + persistence barcodes
β”‚   β”œβ”€β”€ fixed_point_theorems/
β”‚   β”‚   └── scene.py          # Banach contraction mapping + cobweb diagram
β”‚   β”œβ”€β”€ optimization/
β”‚   β”‚   └── scene.py          # Pareto front construction
β”‚   β”œβ”€β”€ banach_algebra/
β”‚   β”‚   └── scene.py          # Spectrum and spectral radius visualization
β”‚   └── svm_classification/
β”‚       └── scene.py          # Maximum margin hyperplane + support vectors
└── media/
    β”œβ”€β”€ gifs/                  # Exported GIF animations
    └── videos/                # Rendered MP4 videos

Contributing

Contributions are welcome. To add a new animated proof:

  1. Create a new directory under proofs/ with a descriptive name.
  2. Add a scene.py file containing one or more Manim Scene subclasses.
  3. Ensure the animation renders cleanly with manim render -qh.
  4. Update this README with a description of the proof.
  5. Open a pull request.

Please follow the existing code style: descriptive class names, consistent color palettes, clear mathematical labels, and animations between 10--20 seconds.


Citation

If you use these animations in a talk, lecture, or publication, please cite:

@misc{joshi2026animatedproofgallery,
  author       = {Joshi, Milan Amrut},
  title        = {Animated Proof Gallery: Mathematical Proofs Come Alive},
  year         = {2026},
  publisher    = {GitHub},
  howpublished = {\url{https://github.com/mlnjsh/animated-proof-gallery}},
  note         = {Manim Community Edition visualizations of theorems in TDA,
                  optimization, functional analysis, and machine learning}
}

License

This project is licensed under the MIT License. See LICENSE for details.


Built by Prof. Milan Amrut Joshi
mlnjsh@gmail.com Β· github.com/mlnjsh

Mathematics Β· Topology Β· Optimization Β· Machine Learning

About

🎬 Beautiful Manim-animated mathematical proofs from my published research β€” Persistent Homology, Fixed Point Theorems, Optimization Algorithms & more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages