Skip to content

Core: expressions, polynomials, integration

Planned for wave 4: the expression DAG, polynomials, GCD and factorisation, Gröbner bases, differentiation, integration, series, limits and exact linear algebra.

Status: planned, wave 4; repositories not created yet, names provisional (expr, poly, groebner, integrate, series, linalg).

The core is Mathematica’s symbolic core in Go: an expression DAG with canonical forms, polynomial arithmetic over Z, Q and F_p, GCD and factorisation, differentiation, LaTeX output, then Gröbner bases, integration, series and limits (PLAN.md items 18 and 21, wave 4).

No code exists yet: nothing on this page is released, measured or tested. It says what the library is planned to provide and how it will be checked. The wave and the order are in PLAN.md; the state of each item in STATUS.md.

What it will provide

Expression DAGhash-consed, canonical forms, diff, expand, LaTeX output through go-tex
Polynomialsover Z, Q and F_p, rational functions; word-sized uint64 fast paths for F_p
GCDmodular GCD (Brown) with CRT, heuristic GCD for small cases, sparse Zippel for multivariate
Factorisationover F_p: square-free, distinct-degree, equal-degree (Cantor-Zassenhaus); over Z: factor mod p, Hensel lifting, recombination by LLL (van Hoeij)
Gröbner basesBuchberger with criteria, then F4 modulo p and lifting; polynomial-system solving through lex order (FGLM), triangular sets and resultants
Integrationrational (Hermite reduction, Lazard-Rioboo-Trager), the Risch algorithm for elementary functions, Risch-Norman, and a rule-based engine importing Rubi’s rules
Series and limitstruncated power series with Newton iteration; Gruntz’s algorithm for limits
Exact linear algebraBareiss fraction-free elimination, multi-modular with CRT, Dixon p-adic lifting

References

The references the work starts from (bibliography first):

Reference implementations

ImplementationLicence and use
SymPy (Python)BSD-3 text; port permitted file by file after reading the appended notices; reference for Gruntz, Risch, solve, simplify
FriCAS (Common Lisp)BSD-3-Clause; port permitted; the most complete Risch implementation
Rubi (Mathematica rules and tests)MIT; rules and the 72,000-problem suite are reusable data
FLINT, PARI/GP, Maxima, Giac, SageLGPL or GPL: oracles only, never copied

How it will be validated

Reference tools are run as oracles, driven from Go by exec with JSON on a pipe; the unit suite must pass with no oracle installed.

OracleHow
SymPyuv run --with sympy; compare by simplify(a-b)==0 or numeric spot checks, not strings
python-flintuv run --with python-flint; fmpz_poly.factor(), fmpz_mpoly
PARI/GP, Maxima, FriCASexec with JSON or text on a pipe; FriCAS to verify Risch results
Rubi suiteconverted to JSON of (integrand, variable, optimal antiderivative); checked by differentiation

What “correct” means:

AreaCriterion
Polynomials, exact linear algebraexact equality after canonical form
Factorisationproduct equals the input and every factor is irreducible per the oracle
Gröbnerthe reduced basis is unique for a given order: exact equality with Singular, Giac or Sage output
Integrationderivative of the result minus the integrand simplifies to 0; Rubi grade histogram (A, B, C, F)
Limits, series, solveexact equality of normal forms, or numeric spot checks at random points with N-digit arithmetic
OutputLaTeX compiles and typesets through go-tex; round trip through a parser gives the same tree

Risks and open questions

  • A CAS comparable to Mathematica is a decades-long target; Rubi, Risch, Gröbner and polynomial factorisation are each a project.
  • Two correct antiderivatives can differ by a constant or a form, so the oracle comparison is by differentiation.
  • GC pressure on many small big.Int is a risk for polynomial arithmetic; word-sized coefficient fast paths for F_p come first.
  • GPL and LGPL systems are oracles only; SymPy, SymEngine and Reduce need their LICENSE files read before any port.

Created on by tannevaled

Modified on by tannevaled