Skip to main content
╔════════════════════════════════════════════════════════════════════════════════════════════╗
║                                                                                            ║
║              ███╗   ███╗███╗   ███╗███████╗ ██████╗ ██████╗  ██████╗ ███████╗              ║
║              ████╗ ████║████╗ ████║██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝              ║
║              ██╔████╔██║██╔████╔██║█████╗  ██║   ██║██████╔╝██║  ███╗█████╗                ║
║              ██║╚██╔╝██║██║╚██╔╝██║██╔══╝  ██║   ██║██╔══██╗██║   ██║██╔══╝                ║
║              ██║ ╚═╝ ██║██║ ╚═╝ ██║██║     ╚██████╔╝██║  ██║╚██████╔╝███████╗              ║
║              ╚═╝     ╚═╝╚═╝     ╚═╝╚═╝      ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚══════╝              ║
║                                                                                            ║
║                              what a formal database rests on                               ║
║                                                                                            ║
╚════════════════════════════════════════════════════════════════════════════════════════════╝

mmforge

Find axiom dependencies a Metamath database does not need, and build the proofs that remove them. No dependencies; runs against a stock set.mm.

pip install mmforge

Six repairs built with this were submitted to metamath/set.mm. The first was merged on 19 August 2026, freeing 36 statements — Bayes' theorem among them — from the axiom of choice. The author of another said he had not noticed the dependency when he wrote the theorem.

For reading and verifying Metamath databases in Python, see metamath-py (Katz & Smith) and mmverify.py (Levien, Wheeler). mmforge is for the other direction — analysing where an axiom is spent and constructing the proof that avoids it — and it hands its output to those verifiers rather than replacing them.

One loop, two halves

mmforge reach       set.mm --axiom ax-ac ax-ac2
mmforge impact      set.mm --axiom ax-ac ax-ac2 --top 40
mmforge guards      set.mm
mmforge domination  set.mm
mmforge steps       set.mm madefi --grep imadomg
mmforge compress    --selftest 300
mmforge conformance set.mm

reach gives every statement whose proof transitively cites an axiom, and traces any one of them down to where it enters.

impact ranks candidates by how many theorems a repair would actually free. That is not the count of theorems below a statement — it is the dominator subtree of the proof DAG reversed and rooted at the axiom, because a theorem with a second route to the axiom is not freed by repairing the first. In set.mm, difelsiga has 64 theorems below it and frees 36.

guards counts the database's own $j usage 'X' avoids 'A' directives, which the verifiers check and which record work earlier contributors already did. Guarded theorems over the size of the cone gives a ratio that says whether a seam is worth working at all: ax-13 sits at 0.751 and yields nothing.

steps replays a stored proof through a verifier and prints what each step proves, with its instantiation. That is what makes a general lemma applied to a special case visible — the file says one thing, the step says what it was actually used on. On madefi it puts the imadomg call at step 968, two hundred steps after the finiteness that would have avoided it.

compress writes a proof back in the compressed format the database stores. As far as the Metamath tool list records, the Python tooling verifies compressed proofs and does not write them. compress --selftest N re-encodes the first N proofs of a database and reports how many came out byte-identical to what is stored; conformance below is the check that decides correctness.

Measure reach over every packaging of an axiom. ax-ac alone reaches 9 statements in set.mm; ax-ac with ax-ac2 reaches 546. A survey quoting the first has measured a label rather than an axiom.

conformance — why byte-agreement is the wrong test

The obvious check for a proof encoder is whether its output matches what metamath.exe stored. That number is worth reporting and it is not the correctness criterion, because the compressed format admits more than one valid encoding of the same proof. Two encodings can differ in a tie-break, have identical length and label count, and both be right.

mmforge conformance re-encodes every proof in a database, writes the database back, and hands it to a verifier this package did not write. If it verifies, the encoding is correct whatever bytes it chose.

That is the Metamath community's own epistemology, stated in mmverify.py's README — "Multiple Metamath verifiers (written in different languages by different people) are used to verify them, reducing the risk that a software defect will lead to an incorrectly verified proof." This applies it to the encoder rather than asking to be trusted.

The suite is checked against a deliberately corrupted database before it is believed: flipping one letter of idi's proof gets a hard rejection, so an accept carries information.

Library use

from mmforge.mmapi import Database
from mmforge.mmcompress import compress

db = Database("set.mm")
bloc, text = compress(db, "difelsiga", rpn)

mmapi carries frames, mandatory hypotheses and first-order matching over token sequences; mmassemble builds a proof from a list of justified steps; mmswap locates a subproof as an RPN span and splices a replacement. mmframe, mmfind, mmstmt and mmdecomp are importable but have no subcommand — they were written against this project's own repository layout.

Vendored code

mmforge._vendor.mmverify is Raph Levien and David A. Wheeler's mmverify.py, MIT licensed, included because there is no Metamath package on PyPI to depend on. Its copyright notice travels with it in LICENSE-mmverify.

Licence

MIT.


╔════════════════════════════════════════════════════════════╗
║                                                            ║
║      ███████╗      ██╗  ██╗███████╗██╗   ██╗███████╗       ║
║      ██╔════╝      ██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝       ║
║      █████╗  █████╗█████╔╝ █████╗   ╚████╔╝ ███████╗       ║
║      ██╔══╝  ╚════╝██╔═██╗ ██╔══╝    ╚██╔╝  ╚════██║       ║
║      ██║           ██║  ██╗███████╗   ██║   ███████║       ║
║      ╚═╝           ╚═╝  ╚═╝╚══════╝   ╚═╝   ╚══════╝       ║
║                                                            ║
║               ·   C  R  E  A  T  I  V  E   ·               ║
║                                                            ║
║          ────────────────────────────────────────          ║
║                                                            ║
║                      Vincent Gonzalez                      ║
║                         f-keys.com                         ║
║                 ORCID 0009-0005-3640-014X                  ║
║                                                            ║
╚════════════════════════════════════════════════════════════╝

Part of F-Keys — independent hardware, software and internet products. See the working log and live status.

Metadata

Release files for mmforge 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mmforge 0.1.3
File Size Uploaded
mmforge-0.1.3.tar.gz 54.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mmforge 0.1.3
File Interpreter ABI Platform
mmforge-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 110.7 kB

Release files / mmforge-0.1.3.tar.gz

Download URL mmforge-0.1.3.tar.gz
Size 54.4 kB
Tags Source
SHA-256 checksum
How to use checksums
350b4d6274f4a9d37ed3a26f9c48b3daeef7608abe79b7d6b37791f1c9012ea9
BLAKE2b-256 checksum
How to use checksums
140034c40e7b1bc0a7d2738706035e0f300863184c27ea6a0e71c7fb95cb9764
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mmforge-0.1.3-py3-none-any.whl

Download URL mmforge-0.1.3-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9b0dee51e35807663efeb24337673d3290c6bde213a6da8592fd65cdc4440fd
BLAKE2b-256 checksum
How to use checksums
d12f5ca88fdc2165f538f86ed947bfd5490151eb474afe7b41187e58dae88366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page