https://github.com/dharmatech/symbolism.lean
https://github.com/dharmatech/symbolism.lean
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dharmatech/symbolism.lean
- Owner: dharmatech
- Created: 2026-04-11T01:58:35.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-12T04:17:44.000Z (2 months ago)
- Last Synced: 2026-04-12T06:15:35.464Z (2 months ago)
- Language: Lean
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# symbolism.lean
This is a very basic computer algebra simplifier written in the [Lean programming language](https://lean-lang.org/).
It's roughly based on the simplifier in the [Symbolism computer algebra library for C#](https://github.com/dharmatech/Symbolism).\
That is in turn based on the [mpl computer algebra library for Scheme](https://github.com/dharmatech/mpl).\
Which is based on the algorithms found in the books *Computer Algebra and Symbolic Computation* by Joel S. Cohen.
For examples of the expressions it can simplify, see the file [SymbolismTests.lean](SymbolismTests.lean).
Some examples from the unit tests:
```
def x : Expr := Expr.var "x"
def y : Expr := Expr.var "y"
#guard Expr.simplify (x * 0) == 0
#guard Expr.simplify (x + x) == 2 * x
#guard Expr.simplify ((2 * x * y) + (3 * x * y)) == 5 * x * y
```
The [current simplifier](Symbolism/Basic.lean) is less than 300 lines long.