Advanced hard-coded Python Classifier for Equation Theory

by Andrew Ren28 days ago
0

Background
The pilot task is equational implication over magmas: given Equation 1 and Equation 2, determine whether Equation 1 implies Equation 2.

This challenge is based on the Equational Theories Project:

Example: E_4: x = x * y implies E_3: x = x * x.

Raw implication graph: export_raw_implications
Law list (4694 laws): equations.txt

A previous classifier (predictor3) extended predictor2 with BFS term rewriting,
exhaustive size-3 magma enumeration, polynomial evaluation, and hill-climbing on
magmas up to size 5, achieving 100% accuracy on random samples from the graph.

predictor3: https://github.com/AndrewRqy/hardcoded-eq-implication-f0c0-claude

Error analysis reveals two soundness gaps:

(1) The BFS engine can spuriously "prove" a FALSE implication — reachable-term
sets collide through deep rewrite chains, returning p = 0.9999 incorrectly.

(2) Hill-climbing (sizes 3-5) misses counterexamples requiring larger magmas,
leaving genuine non-implications undetected.
Core Task
How far can we push a hard-coded Python classifier that solves implication problems of the form:

Does Equation 1 imply Equation 2?

to get the highest possible accuracy when applied on the entire raw implication graph?

The proposed fix replaces both with sound procedures:

  • Knuth-Bendix (KB) completion for the positive path: converts E1 into a confluent
    terminating rewriting system and decides E1 |= E2 via normal forms — no false
    proofs possible.

  • SMT model finding (Z3) for the negative path: searches for a counterexample
    magma of size n as a satisfiability query, complete for fixed n up to n = 10.

Full details on the competition are on this page:
https://competition.sair.foundation/competitions/mathematics-distillation-challenge-equational-theories-stage1/overview

Example python classifiers:
https://github.com/teorth/equational_theories/blob/main/scripts/predictor/predictor1.py
https://github.com/teorth/equational_theories/blob/main/scripts/predictor/predictor2.py

If you are inspired by this idea, you can reach out to the authors for collaboration or cite it:

@misc{ren-advanced-hardcoded-python-2026,
  author = {Ren, Andrew},
  title = {Advanced hard-coded Python Classifier for Equation Theory},
  year = {2026},
  url = {https://hypogenic.ai/ideahub/idea/0zd4ixdZptnQzSqq6UDW}
}

Comments (0)

Please sign in to comment on this idea.

No comments yet. Be the first to share your thoughts!