Skip to content

Repository files navigation

GEML — Graph Learning over a Single-Operator Representation of Mathematics

CI License: MIT Python 3.12 tests

A controlled representation study. GEML collapses every elementary math operator into one primitive — eml(x, y) = exp(x) − ln(y) — so any expression becomes a graph where every internal node is the same operation. That homogeneity is not free: the single-operator form is ~40× larger than the AST at the median. The whole project measures one thing — whether that cost buys a graph neural network anything on symbolic reasoning — and publishes the answer either way, nulls included.

Target venue: MathNLP 2026 · Project site: docs/

Lead: Quang Bui (@duckyquang) · Members: Muhammad Rayyan (@Mray229), Sibi Gokul (@Sisigoks), Daksh Jain (@Daksh-QE), Sahil Singh (@gensahilsingh)


1. What GEML is

Odrzywołek (2026) showed that the standard elementary functions and constants (π, e, i) can be built from the constant 1 and a single binary operator:

eml(x, y) = exp(x) − ln(y)

Any continuous mathematical expression therefore maps to a strict binary tree in which every internal node is the same operation. GEML asks whether that homogeneity is useful for machine learning. Instead of feeding math to a model as a token sequence ([sin, (, x, +, 1, )]), it feeds the structural topology of the EML tree to a graph neural network that only has to learn where things connect, never what the operator is. The one quantitative question the project measures is whether that representation — far larger than an ordinary AST — earns its keep on symbolic reasoning, and it commits to publishing the answer whichever way it lands.

Contributors / coding agents: a v0 prototype exists but is off-limits. Build clean-room from the current repository specs and issues, never from the prototype's code, tests, schemas, or history. See AGENTS.md and docs/CLEANROOM_RULES.md.

Quickstart

GEML is a Python 3.12 package with a src/ layout; runtime code lives under src/geml/.

python -m pip install -e ".[dev]"   # install package + dev tools
python -m pytest                     # run the suite (2,805 tests)
python -m ruff check . && python -m ruff format . --check

Where to look: per-goal results are under docs/goals/, the frozen contracts under docs/specs/, and the rendered overview in docs/index.html. For the full dev guide — environment, clean-room rules, contribution workflow — see CONTRIBUTING.md.

2. Framework

Topology, not vocabulary

A conventional model of mathematics has to learn a vocabulary: sin, exp, +, /, and dozens more, each a distinct token or node type. The EML rewrite erases that vocabulary — one operator does everything — so the only thing left to learn is structure. A graph neural network over an EML tree never sees an operator label; it sees how the graph is wired. GEML's bet is that a model freed from operator identity might generalize better across the shape of an expression. The cost of that bet is measured, not assumed, and the measurement is the α threshold.

The α threshold — the central quantitative question

Let α = |T_EML| / |T_AST| be the expansion factor when an AST is rewritten in pure EML form. Counting the representable expressions of size x as N(x) = C_x · K^x · L^(x+1) (Catalan tree shapes × operator labels × leaf symbols, with C_x → 4^x / (x^{3/2}√π)), the reduced EML operator vocabulary is only a net win when

α < 1 + ln(K) / ln(4L)

where K is the number of operator types and L the number of leaf symbols. For the full grammar this counting break-even is ≈ 1.56; across the six preregistered per-family grammars the operative thresholds run from 1.29 to 1.50 (Goal 2) — even the most generous bar sits near 1.5. Whether raw EML clears that bar, and whether compression can bring it under, is the quantitative spine of the whole project. (It does not: see Results.)

Four representation channels

Every learning experiment is run over the same four channels so a win can be attributed to the right cause — graph sharing vs. the EML rewrite vs. motif compression:

  1. AST-DAG — the source AST with exact subtree sharing. The fairness baseline that separates "graph sharing helps" from "EML helps."
  2. Pure EML-DAG — the canonical single-operator channel, assumption-free. Every EML claim traces back to it.
  3. Frequent-motif EML-DAG — a lossless dictionary of common EML subgraphs; the "practical EML" channel (smaller, still reconstructable).
  4. Motif-AST — the same motif compression applied to the AST, a train-only fair control so a motif gain is never mistaken for an EML gain.

Semantic verification — e-graph, verifier-gated

Equivalence in GEML is semantic, not structural: two equal expressions are generally not isomorphic graphs. Equivalence pairs and rewrite candidates come from equality saturation over an e-graph, and every candidate is checked two ways — same-e-class membership (formal evidence relative to the enabled rule set and each row's recorded domain assumptions) plus an independent domain-aware numeric probe that catches bugs the formal check cannot. Every rewrite, proof, and simplification step passes a verifier before it counts. The gate is sound, not complete: it never accepts an unverified step, but its bounded rule set and bounded search mean it can miss valid rewrites rather than emit wrong ones. Pure EML stays canonical throughout; positive-real results are labelled as conditional findings, never as universal complex identities.

The experimental program

The structural layer above (Goals 1–5) feeds a four-track learning program. Each track is representation-agnostic and ends at an explicit gate — a pass/fail rule that decides whether the next track proceeds, proceeds narrowed, or stops. No model has been trained yet: the tracks below are implemented and fixture-tested, and their gates return an honest insufficient_evidence until a production run exists. Their code is built so a missing run yields an explicit missing-state, never a plausible-looking number.

  • Equivalence learning (Goal 6, production pending) — can a GNN learn E₁ ≡ E₂, and under which channel? Six arms (four graph channels + a compute-matched prefix transformer + a trivial op-count floor) × three seeds. Gate G6: every GNN arm must beat the trivial floor; the EML-vs-AST verdict is recorded either way, and if pure EML loses on OOD the later tracks proceed with the EML claim narrowed.
  • Rewrite-step prediction (Goal 7, production pending) — from a state graph, predict the next (rule id, application site). Scored by top-k verifier-valid step accuracy across channels — the sharpest test of whether homogeneous topology helps rule transfer. Gate G7: the learned policy beats a uniform valid-step baseline by a wide margin, with no dead rules.
  • Verified proof paths (Goal 8, insufficient_evidence) — best-first/beam search over rewrites with the verifier gating every step, plus a simplification mode compared against SymPy on the exact Goal 4/5 cost. Gate G8: guided search beats uniform search on nodes-expanded at equal success rate, with zero invalid steps emitted.
  • Symbolic regression (Goal 9, insufficient_evidence) — recover an in-grammar expression from numeric samples via encoder-guided search, EML-space vs. AST-space, against PySR/GP and transformer-SR references. Gate G9: exact-recovery above the GP baseline at matched budget, or a documented negative.

Domain expansion (Goal 10) adds a grammar-v2 surface (asin, acos, atan, π, e) and re-audits the compiler — that audit produced a final published result (see below). A scale-up and parameter-efficiency comparison (Goal 11, production pending) is the capstone that synthesizes the four tracks without retraining.

3. Results

These are the final numbers that exist. The structural verdict (Goals 1–5) is complete on the full 250,000-expression corpus, and it is unfavorable to raw EML — exactly the kind of answer GEML commits to reporting rather than burying. The two preregistered nulls and the published Gate G10 fail are results in their own right, not caveats. Every row links to its full, machine-generated summary.

Goal Result
1 250,000 unique expressions, QA-gated, split exactly 175k / 25k / 25k / 25k (train / validation / test_iid / test_ood).
2 Raw pure-EML expansion: median α = 40.6602, mean 952.1371 (p99 ≈ 10,448.6 — a heavy right tail). 0 / 250,000 expressions fall below the preregistered 1.29–1.50 per-family thresholds.
3 Lossless DAG sharing compresses the expanded EML tree 39.375× on average — yet the EML DAG still beats the AST tree on 0 / 250,000 expressions (best remaining ratio 8/7). Compressing well and becoming competitive are different claims.
4 Verifier-gated e-graph rewriting improves 23.9% (safe_real) / 27.6% (positive_real_formal) of costed rows at 2.4–2.8% mean relative savings, on 60.7% vocabulary coverage.
5 NULL: the learned motif vocabulary loses to the equal-budget frequent baseline (324,485,346 vs. 317,678,264 MDL bits, test_iid). NULL: the neural ranker loses to a plain structural heuristic.
10 Gate G10 published: fail — on exactly the 8 preregistered asin/acos endpoint cells. Publishing the honest fail rather than revising the criteria was a deliberate decision.

What the structural numbers say. The single-operator rewrite is more than an order of magnitude over the most generous counting threshold (median α 40.66 vs. a ~1.5 bar), and exact graph sharing — though it shrinks the expanded form ~39× — never closes the gap to the ordinary AST. So homogeneity is not free structure; if EML pays off it will be on learning, which is what the four tracks in the framework are built to measure. That verdict is still open, and until a model is trained it stays open — no learning result is claimed here.

What the nulls say. Learned selection did not beat frequency-ranked motifs at equal budget, and the neural ranker did not beat a hand-coded structural heuristic. Both were preregistered comparisons and both are reported at full prominence, ahead of the favorable comparisons in the same summary, so a positive result cannot visually displace a null.

All numbers above come from clean-committed production runs; the exact commands, config hashes, and content hashes are in each goal's summary. Gate G10 was executed on Apple M1 Pro (CPU only, Python 3.12.5) and produced a byte-identical records.jsonl across three runs.

References

  • Odrzywołek, A. (2026). The EML function — reduction of elementary functions to exp(x) − ln(y). The official EML compiler is used for all pure-EML conversions: no abbreviations, no hidden derived leaves.
  • Per-goal machine-generated summaries and QA evidence: docs/goals/; frozen contracts: docs/specs/.

License

GEML is released under the MIT License, Copyright (c) 2026 GEML contributors.

About

Does representing all of mathematics with one operator, eml(x,y)=exp(x)−ln(y), help GNNs learn symbolic reasoning? A preregistered study measured honestly at 250k-expression scale — nulls and one published gate fail included.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages