Skip to content

About

Offline, verified math foundations solver: fractions, rounding, algebraic equations, systems and inequalities, polynomials, functions, logarithms, trigonometry (with the ambiguous case), conic sections, vectors and complex numbers, with steps, LaTeX and honest refusals

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

math-foundations-ai999x: offline, verified math foundations solver with step-by-step answers

tests PyPI Hugging Face

Desktop app & command line · Compute in your browser · Install (Python) · Guides · Evaluation · AI999X on Hugging Face · Website · Support: Buy Me a Coffee

License: Apache-2.0 · Author: Ibnul Jaif Farabi (creator and engineer) · Organization: AI999X · Version 1.5.0

Field: Mathematics & Statistics · Tasks: Question Answering

math-foundations-ai999x is an offline, deterministic math foundations solver written in Rust: a desktop app, a command-line program, a browser module and a Python package. It answers math foundations questions with verified results from 119 certified capabilities, gives 625 documented answers identically on Windows and Linux, and refuses rather than guesses when an answer cannot be verified.

math-foundations-ai999x reads a question in plain English (or a typed call), picks a certified math foundations capability, computes the answer exactly, checks it, and returns the result with its steps, units, LaTeX and assumptions, or a refusal that says what is missing. It runs fully offline on any CPU, needs no GPU, no API key and no internet, and is built to give zero wrong answers: when it is not sure, it refuses instead of guessing.

Buy me a coffee License Python Offline Rust

Run it your way. math-foundations-ai999x comes as the AI999X desktop app and as the command-line program math-foundations for Windows and Linux, runs in your browser as WebAssembly, and installs as a Python package. The desktop app, the command line and the browser run the same compiled Rust program on your own device: offline, no Python needed.

Get it

Way to run it For Get it
AI999X Math Foundations desktop app 1.5.0 Windows, Linux. This model in its own app: search, ask in words, forms, live figures, explanations, offline Windows (x86-64) · Linux (x86-64)
AI999X desktop app 1.5.0 Windows, Linux. Every AI999X model in one app: search, ask in words, forms, live figures, explanations, offline Windows (x86-64) · Linux (x86-64)
Command line (math-foundations) Windows, Linux. One program per model, offline, no Python Windows (x86-64) · Linux (x86-64)
In your browser any device. Nothing to install Compute on the model page
Python Python 3.10+ pip install math-foundations-ai999x

Checksums: SHA256SUMS · every version: https://downloads.ai999x.com/desktop/latest/ · install guide: desktop & command line

Quick start

Desktop app

Download AI999X Math Foundations for your system (above), unpack it and start it; type a question in words or pick a capability, fill in the form and press Compute. Figures and an explanation of the answer appear beside it. The AI999X desktop app has the same, with Math Foundations among all AI999X models.

Linux, from a terminal:

curl -LO https://downloads.ai999x.com/desktop/1.5.0/ai999x-math-foundations-1.5.0-linux-x86_64.tar.gz
curl -LO https://downloads.ai999x.com/desktop/1.5.0/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
tar xzf ai999x-math-foundations-1.5.0-linux-x86_64.tar.gz
./ai999x-math-foundations-1.5.0-linux-x86_64/ai999x-math-foundations

Command line

Linux:

curl -LO https://downloads.ai999x.com/desktop/1.5.0/ai999x-cli-1.5.0-linux-x86_64.tar.gz
curl -LO https://downloads.ai999x.com/desktop/1.5.0/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
mkdir -p ~/.local/share && tar xzf ai999x-cli-1.5.0-linux-x86_64.tar.gz -C ~/.local/share
echo 'export PATH="$HOME/.local/share/ai999x-cli-1.5.0-linux-x86_64:$PATH"' >> ~/.bashrc && source ~/.bashrc
math-foundations --version

Windows (PowerShell):

$F = "ai999x-cli-1.5.0-windows-x86_64.zip"
Invoke-WebRequest "https://downloads.ai999x.com/desktop/1.5.0/$F" -OutFile $F
Invoke-WebRequest "https://downloads.ai999x.com/desktop/1.5.0/SHA256SUMS" -OutFile SHA256SUMS
(Get-FileHash $F -Algorithm SHA256).Hash.ToLower() -eq ((Select-String -SimpleMatch $F SHA256SUMS).Line -split ' ')[0]
Expand-Archive $F -DestinationPath "$env:LOCALAPPDATA\AI999X" -Force
$D = "$env:LOCALAPPDATA\AI999X\ai999x-cli-1.5.0-windows-x86_64"; $env:Path += ";$D"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$D", "User")
math-foundations --version

Every command below was run as shown; the text under it is what the program printed.

Ask in words: Write the question as you would say it: the program reads the quantities and their units, picks the capability and answers.

$ math-foundations ask "Solve x^2 - 5x + 6 = 0."
Read as: Roots of a quadratic equation
x1 = 2
x2 = 3
discriminant = 1
  by: Roots of a quadratic equation  (quadratic formula in a numerically stable form (q = -(b + sign(b)*sqrt(b^2 - 4ac))/2, x = q/a and c/q))
  a = 1
  b = -5
  c = 6
  assumes: a != 0 (otherwise the equation is linear); real coefficients

What a capability needs: The equation or method, every input and output with its SI unit. Read this before solve: it tells you the input names.

$ math-foundations info quadratic_roots
Roots of a quadratic equation
  quadratic formula in a numerically stable form (q = -(b + sign(b)*sqrt(b^2 - 4ac))/2, x = q/a and c/q)
  in   a        coefficient of x^2 [1]
  in   b        coefficient of x [1]
  in   c        constant term [1]
  out  x1       first root (the smaller real root, or the one with positive imaginary part) [1]
  out  x2       second root [1]
  out  discriminant b^2 - 4ac [1]

Solve: Inputs as name=value, each with any unit of the right kind. The answer lists every output, the method used, each input converted to SI, and the conditions the answer assumes.

$ math-foundations solve quadratic_roots a=1.0 b=-5.0 c=6.0
x1 = 2
x2 = 3
discriminant = 1
  by: Roots of a quadratic equation  (quadratic formula in a numerically stable form (q = -(b + sign(b)*sqrt(b^2 - 4ac))/2, x = q/a and c/q))
  a = 1
  b = -5
  c = 6
  assumes: a != 0 (otherwise the equation is linear); real coefficients

Many questions at once: One JSON request per line in, one JSON answer per line out, in order: for scripts, notebooks and agents (the program starts once). In PowerShell: Get-Content cases.jsonl | math-foundations batch

cases.jsonl:

{"key": "quadratic_roots", "inputs": {"a": 1.0, "b": -5.0, "c": 6.0}}
{"key": "law_of_sines_ssa", "inputs": {"a": 8.0, "b": 10.0, "A": 40.0}}
$ math-foundations batch < cases.jsonl
{"outcome":"SOLVED","message":"","value":2.0,"unit":"","solved_for":"x1","si":[["a",1.0],["b",-5.0],["c",6.0]],"values":[["x1",2.0,""],["x2",3.0,""],["discriminant",1.0,""]],"target":"x1","phrase":"first root (the smaller real root, or the one with positive imaginary part)","assumptions":["a != 0 (otherwise the equation is linear)","real coefficients"],"name":"Roots of a quadratic equation","equation":"quadratic formula in a numerically stable form (q = -(b + sign(b)*sqrt(b^2 - 4ac))/2, x = q/a and c/q)"}
{"outcome":"SOLVED","message":"","value":2.0,"unit":"","solved_for":"count","si":[["a",8.0],["b",10.0],["A",40.0]],"values":[["count",2.0,""],["B1",53.464149014388475,""],["C1",86.53585098561152,""],["c1",12.42304969336998,""],["B2",126.53585098561152,""],["C2",13.464149014388482,""],["c2",2.897839169009583,""]],"target":"count","phrase":"number of triangles (1 or 2; none is refused)","assumptions":["a, b > 0","0 < A < 180","a triangle exists (else refused)"],"name":"Law of sines, the ambiguous case (two sides and a non-included angle)","equation":"sin B = b sin A / a; B and 180 - B both give a triangle when A + B < 180 (the ambiguous case)"}

In your browser

Open Math Foundations on ai999x.com, choose a capability and press Compute: the model runs on your own device as WebAssembly; nothing is sent anywhere. Change any input (any unit of the right kind) and the answer, its explanation and the figures follow.

In your own page: math_foundations_ai999x.wasm and the loader ax-wasm.js (https://www.ai999x.com/compute/rust/ax-wasm.js).

Python

pip install math-foundations-ai999x

Worked examples in every form

The same worked example from the command line, from Python and in the browser. Each command-line output is what the program printed.

Absolute value inequality |ax + b| compared with c

Solve |a*x + b| < c, <= c, > c or >= c (c > 0): the two boundary points and whether x lies between or outside them.

Command line:

$ math-foundations solve abs_linear_inequality a=2 b=3 c=7 "rel=<"
lower = -5
upper = 2
region = between
solution = -5 < x < 2
  by: Absolute value inequality |ax + b| compared with c  (|u| < c means -c < u < c; |u| > c means u < -c or u > c; solve each linear piece for x)
  a = 2
  b = 3
  c = 7
  rel = <
  assumes: a != 0; c > 0

Python:

import math_foundations_ai999x as m

a = m.solve("abs_linear_inequality", a="2", b="3", c="7", rel="<")
print(a.values or (a.value, a.unit))

Browser: open this capability on the model page and press Compute in your browser.

Factor a quadratic over the integers

Factor ax^2 + bx + c with whole-number coefficients as g(px + q)(rx + s), or say that it does not factor over the integers.

Command line:

$ math-foundations solve factor_quadratic_integer a=6 b=5 c=-6
g = 1
p = 2
q = 3
r = 3
s = -2
factored = (2x + 3)(3x - 2)
  by: Factor a quadratic over the integers  (take out the greatest common factor; the rational roots -q/p and -s/r of the primitive quadratic give its factors (Gauss's lemma))
  assumes: whole-number coefficients; a != 0; the discriminant is a perfect square

Python:

import math_foundations_ai999x as m

a = m.solve("factor_quadratic_integer", a="6", b="5", c="-6")
print(a.values or (a.value, a.unit))

Browser: open this capability on the model page and press Compute in your browser.

What this means: This calculation determines if the quadratic expression defined by input coefficients 6, 5, and -6 can be written as a product of two linear binomials with integer coefficients. The process first extracts any greatest common factor, resulting in the constant 1. It then identifies the remaining primitive quadratic structure to find the x-coefficients 2 and 3, and the constant terms 3 and -2. If these values are integers, the final factored form is presented as (2x + 3)(3x - 2); otherwise, the system indicates that no such integer factorization exists.

Partial fractions (two distinct linear factors)

Write (p*x + q)/((x - r1)(x - r2)) as A/(x - r1) + B/(x - r2).

Command line:

$ math-foundations solve partial_fractions_linear p=5 q=1 r1=1 r2=-2
A = 2
B = 3
  by: Partial fractions (two distinct linear factors)  (cover-up rule: A = (p r1 + q)/(r1 - r2), B = (p r2 + q)/(r2 - r1))
  p = 5
  q = 1
  r1 = 1
  r2 = -2
  assumes: r1 != r2

Python:

import math_foundations_ai999x as m

a = m.solve("partial_fractions_linear", p="5", q="1", r1="1", r2="-2")
print(a.values or (a.value, a.unit))

Browser: open this capability on the model page and press Compute in your browser.

What this means: This calculation decomposes the rational expression with numerator coefficient 5 and constant 1, divided by factors rooted at 1 and -2, into two simpler fractions. The resulting numerators are computed as 2 for the first term and 3 for the second term, allowing the original complex fraction to be expressed as a sum of these basic components.

Polynomial long division

Divide one polynomial by another: quotient and remainder, with p = q*d + r and deg r < deg d.

Command line:

$ math-foundations solve polynomial_long_division "dividend=[2, 3, -1, 5]" "divisor=[1, 0, 1]"
quotient = [2.0,3.0]
remainder = [-3.0,2.0]
  by: Polynomial long division  (long division: divide leading terms, multiply back, subtract, repeat; exact rational arithmetic)
  assumes: divisor of degree >= 1

Python:

import math_foundations_ai999x as m

a = m.solve("polynomial_long_division", dividend=[2, 3, -1, 5], divisor=[1, 0, 1])
print(a.values or (a.value, a.unit))

Browser: open this capability on the model page and press Compute in your browser.

What this means: This calculation performs polynomial long division on the input polynomials. The dividend, represented by [2, 3, -1, 5], is divided by the divisor, represented by [1, 0, 1]. The result consists of two parts: the quotient [2, 3], which indicates how many times the divisor fits into the dividend, and the remainder [-3, 2], which is what is left over after subtraction. Together they satisfy the fundamental relationship where the original dividend equals the product of the divisor and quotient plus the remainder.

Documentation

Highlights

  • Verified, not generated. Every answer is computed by a certified math foundations capability and checked (substituted back, dimension-checked or compared with an independent computation) before it is returned.
  • Zero wrong answers by design. Seven explicit outcomes (SOLVED, NEEDS_INPUT, AMBIGUOUS, INVALID_INPUT, OUT_OF_SCOPE, UNRECOGNIZED_FORMAT, INTERNAL_ERROR), never a silent guess. Every one of its 625 documented answers is reproduced exactly on every tested platform.
  • Plain-English questions and a guaranteed typed interface. ask() reads documented question forms; solve(capability_id, **inputs) always solves a supported task with valid inputs.
  • Explains itself. Steps, formulas in LaTeX, units, assumptions and the model used, ready for notebooks, tutoring apps and homework checkers.
  • Native and in the browser. Every capability also computes natively in Rust: the desktop app and the math-foundations command line for Windows and Linux, and WebAssembly on the model page, no Python, no network.
  • Small and portable. Pure Python (sympy, mpmath); identical answers on Windows and Linux (Python 3.10, 3.11, 3.12, 3.13, 3.14).
  • Coverage: arithmetic, algebra, functions, exponentials and logarithms, trigonometry, precalculus and complex numbers.

Model overview

Property Value
Package math-foundations-ai999x 1.5.0 (import math_foundations_ai999x)
Type Deterministic neuro-symbolic math foundations engine (rule-based reading + certified symbolic capabilities)
Capabilities 19 certified derivations, 100 certified procedures
Knowledge pack version 1.0.2
Golden answers 625 documented answers, identical on every tested platform
Platforms tested Windows (Python 3.13), Linux x86-64 (Python 3.10, 3.11, 3.12, 3.13, 3.14)
Runtime CPU only, offline; no GPU, no network, no API key
License Apache-2.0
Creator / engineer Ibnul Jaif Farabi
Organization AI999X

Python quick start

pip install math-foundations-ai999x
import math_foundations_ai999x as math_foundations

math_foundations.ask("Solve x^2 - 5x + 6 = 0.").show()
# -> SOLVED — x1 = 2, x2 = 3, discriminant = 1  (quadratic_roots)
math_foundations.ask("In triangle ABC, a = 8, b = 10 and A = 40 degrees. Solve the triangle.").show()
# -> SOLVED — count = 2, B1 = 53.4641, C1 = 86.5359, c1 = 12.423  (law_of_sines_ssa)
math_foundations.ask("Compute (3 + 2i) / (1 - i).").show()
# -> SOLVED — re = 0.5, im = 2.5  (complex_arithmetic)
math_foundations.ask("Find the coefficient of x^3 in (2x - 1)^5.").show()
# -> SOLVED — coefficient = 80, binomial = 10  (binomial_coefficient_term)
math_foundations.solve("de_moivre_power", a=1, b=1, n=8).show()
# -> SOLVED — re = 16, im = 0, modulus = 16, argument_deg = 0  (de_moivre_power)
math_foundations.ask("Who created you?").message
# -> math-foundations-ai999x was created and engineered by Ibnul Jaif Farabi at AI999X.

The Python package also installs a Python command, math-foundations-ai999x "<question>"; for the native program use math-foundations (above). The outputs above were produced by running this exact code on math-foundations-ai999x 1.5.0.

How every answer is verified

  1. Reading: the question is turned into typed quantities (value, unit, kind, role) and one asked quantity; every stated number must be used or the question is refused.
  2. Planning: only certified capabilities may answer; a capability applies only under the conditions the wording states (for example a pendulum, a liquid at rest, boiling).
  3. Computing: exact symbolic or high-precision numeric evaluation.
  4. Checking: dimensions, substitution back into the defining equation, and agreement between independent readings; any disagreement becomes a refusal, never a number.

Capabilities are certified before they ship: each must reproduce hand-worked reference cases, reject a deliberately wrong variant (a control), and leave every benchmark answer unchanged.

Python worked examples, with their steps

Each question was put to math-foundations-ai999x; the answer is the one it returned, with the steps it took.

Roots of a quadratic equation · Polynomial equations

Solve x^2 - 5x + 6 = 0.

→ x1 = 2, x2 = 3, discriminant = 1

Steps
  • Roots of a quadratic equation: a = 1, b = -5, c = 6 → x1 = 2, x2 = 3, discriminant = 1

Law of sines, the ambiguous case (two sides and a non-included angle) · Trigonometry

In triangle ABC, a = 8, b = 10 and A = 40 degrees. Solve the triangle.

→ count = 2, B1 = 53.46414901, C1 = 86.53585099, c1 = 12.42304969, B2 = 126.535851, C2 = 13.46414901, c2 = 2.897839169

Steps
  • Law of sines, the ambiguous case (two sides and a non-included angle): a = 8, b = 10, A = 40 → count = 2, B1 = 53.46414901, C1 = 86.53585099, c1 = 12.42304969, B2 = 126.535851, C2 = 13.46414901, c2 = 2.897839169

Arithmetic with complex numbers · Complex numbers

Compute (3 + 2i) / (1 - i).

→ re = 0.5, im = 2.5

Steps
  • Arithmetic with complex numbers: a = 3, b = 2, c = 1, d = -1, op = / → re = 0.5, im = 2.5

Coefficient of a term in a binomial expansion · Precalculus

Find the coefficient of x^3 in (2x - 1)^5.

→ coefficient = 80, binomial = 10

Steps
  • Coefficient of a term in a binomial expansion: a = 2, b = -1, n = 5, k = 3 → coefficient = 80, binomial = 10

Power of a complex number (De Moivre) · Complex numbers

m.solve("de_moivre_power", a=1, b=1, n=8)

→ re = 16, im = 0, modulus = 16, argument_deg = 0

Steps
  • Power of a complex number (De Moivre): a = 1, b = 1, n = 8 → re = 16, im = 0, modulus = 16, argument_deg = 0

Absolute value inequality |ax + b| compared with c · Algebra

Solve |2x + 3| < 7.

→ lower = -5, upper = 2, region = between, solution = -5 < x < 2

Steps
  • Absolute value inequality |ax + b| compared with c: a = 2, b = 3, c = 7, rel = < → lower = -5, upper = 2, region = between, solution = -5 < x < 2

Figures

Every point was computed by math-foundations-ai999x.

The five fifth roots of 8i

The five fifth roots of 8i, computed by math-foundations-ai999x

The 5 complex roots of z⁵ = 0 + 8i returned by the package (-0.890916 − 1.22624i, 0.890916 − 1.22624i, 1.44153 + 0.468382i, 0 + 1.51572i, -1.44153 + 0.468382i), the vertices of a regular pentagon on the circle of radius 1.51572 (= 8^(1/5)).

Ellipse and hyperbola with their foci

Ellipse and hyperbola with their foci, computed by math-foundations-ai999x

An ellipse and a hyperbola drawn from the parameters the package returns: ellipse a = 5, b = 3, foci (±4, 0), eccentricity 0.8; hyperbola a = 4, b = 3, foci (±5, 0), eccentricity 1.25, asymptotes of slope ±0.75.

A cubic and its three roots

A cubic and its three roots, computed by math-foundations-ai999x

The cubic y = x³ − 6x² + 11x − 6, evaluated by the package at 81 points, and its three real roots as the package returns them: x = 1, 2 and 3.

Powers of 1 + i spiral outwards (de Moivre)

Powers of 1 + i spiral outwards (de Moivre), computed by math-foundations-ai999x

The powers (1 + i)ⁿ for n = 0 … 8, each computed by the package: every step turns by 45° and stretches by √2; marked: n = 8, (1 + i)⁸ = 16 + 0i, modulus 16, argument 0°.

The unit circle with exact values

The unit circle with exact values, computed by math-foundations-ai999x

The unit circle with the exact cosine and sine the package returns at the multiples of 30° and 45° (16 angles; six labelled); for example cos 150° = -√3/2 = -0.866025 and sin 150° = 1/2 = 0.5 (marked).

An alternating geometric sequence and its partial sums

An alternating geometric sequence and its partial sums, computed by math-foundations-ai999x

The geometric sequence g₁ = 3, q = -0.5: the alternating terms (stems) and the partial sums (dots), each computed by the package, settle on the sum of the infinite series, 2; g₁₂ = -0.00146484, s₁₂ = 1.99951.

Capabilities

19 certified derivations, 100 certified procedures. A few of them:

  • Derivations: area of rectangle; associative property of addition; cramer rule x solution; determinant cramer two variables; difference of cubes factorization; difference of squares; distributive property verification; elimination method identity; elimination solution two variables; linear equation solution formula; partial fraction decomposition linear factors; perfect square trinomial; product of sums; quadratic vertex form conversion; radical equation squaring; square of difference; substitution method identity; substitution solution two variables; sum of cubes factorization
  • Procedures: Absolute value inequality |ax + b| compared with c; Add rational expressions with same denominator; Amount remaining after radioactive decay (half-life); Area of a triangle from its three sides (Heron); Arithmetic with complex numbers; Arithmetic with fractions; Asymptotes of a linear rational function; Average rate of change between two points; Average rate of change of a function between two inputs; Centre and radius of a circle from its general equation; Coefficient of a term in a binomial expansion; Combinations and permutations; Composition of two linear functions; Compound interest; Continuous exponential growth or decay; Degrees to radians; Determinant and inverse of a 2 by 2 matrix; Determinant of 2x2 matrix; Discriminant of a quadratic; Distance between two points; Distance from a point to a line; Divide a quantity in a given ratio; Domain of a square-root function; Dot product and angle between two vectors …

math_foundations_ai999x.templates() lists every question form ask() reads; the capability guide (PDF, every example executed) is included in this repository.

Out of scope

  • Open-ended explanation, essay writing or tutoring dialogue: it is a solver, not a chatbot.
  • Questions outside its certified math foundations capabilities, and any question whose stated numbers it cannot all use: it refuses with the reason instead.
  • High-stakes engineering, medical or legal decisions without independent review.

Limitations

  • It answers what its certified capabilities cover (arithmetic, algebra, functions, exponentials and logarithms, trigonometry, precalculus and complex numbers); anything else is refused with a reason.
  • ask() reads documented question forms and common phrasings; unusual wording may be refused; use solve() for guaranteed results.
  • Results are as correct as the certified relations and their stated conditions; a certified relation is a checked model, not a claim about every physical situation.

Citation

@software{math_foundations_ai999x_1_5_0,
  title  = {math-foundations-ai999x: an offline, verified math foundations solver},
  author = {Farabi, Ibnul Jaif}, organization = {AI999X},
  year   = {2026}, version = {1.5.0},
  url    = {https://huggingface.co/AI999X/math-foundations-ai999x}
}

Contact

Questions, bug reports and requests: open a discussion on https://huggingface.co/AI999X/math-foundations-ai999x/discussions or visit https://ai999x.com.

Support the project

math-foundations-ai999x is free and open source. If it helps you, you can support further development on Buy Me a Coffee.

Created and engineered by Ibnul Jaif Farabi · AI999X · ai999x.com

Source and releases

This repository holds the installable source of each release, exactly as published on PyPI (pip install . builds it). Releases are tagged v1.5.0; the GitHub release carries the wheel, the desktop app and the command-line program for Windows and Linux, and their checksums.

Build the program from source

rust/ holds the Rust source of the math-foundations command-line program and browser module: the AI999X engine (rust/ax-engine), this model (rust/math-foundations) and its data (rust/models/math_foundations/pack.json). With Rust 1.80 or later:

cd rust
cargo build --release -p math-foundations-ai999x
./target/release/math-foundations --help
cargo test -p math-foundations-ai999x

About

Offline, verified math foundations solver: fractions, rounding, algebraic equations, systems and inequalities, polynomials, functions, logarithms, trigonometry (with the ambiguous case), conic sections, vectors and complex numbers, with steps, LaTeX and honest refusals

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages