Tree @master (Download .tar.gz)
Eqthy
Version 0.6 | See also: Lome ∘ Philomath ∘ LCF-style-ND

Eqthy is a formal language for equational proofs. Its design attempts to reconcile simplicity of implementation on a machine with potential for usability by a human (more on this below). It supports an elementary linear style, where each line gives a step which is derived from the step on the previous line, and may optionally state the justification for the derivation in that step.
Here is a simple example: a proof that, in a monoid, the identity element commutes with any element.
axiom (idright) mul(A, e) = A
axiom (idleft) mul(e, A) = A
axiom (assoc) mul(A, mul(B, C)) = mul(mul(A, B), C)
theorem (idcomm)
mul(A, e) = mul(e, A)
proof
A = A
mul(A, e) = A [by idright]
mul(A, e) = mul(e, A) [by idleft]
qed
For improved human usability, Eqthy is usually embedded within Markdown documents. This allows proofs to be written in a more "literate" style, with interspersed explanatory prose and references in the form of hyperlinks.
For a fuller description of the language, including a set of Falderal tests, see doc/Eqthy.md.
A number of proofs have been written in Eqthy to date. These can be found in the eg/ directory. In particular, there are worked-out proofs:
- in Group Theory, including:
- some simple theorems about the inverse element;
- the Socks and Shoes theorem;
- in Ring Theory;
- in Boolean Algebra, including:
- De Morgan's laws;
- the Absorption laws in an alternate axiomatization;
- some properties of set difference;
- in Interior Algebra (building on Boolean algebra);
- in Propositional Algebra;
- in Johnson's 1892 axiom system for propositional logic, including:
- in Combinatory Logic;
with hopefully more to come in the future.
The Eqthy language is still at an early stage and is subject to change. However, since the idea is to accumulate a database of proofs which can be built upon, it is unlikely that the format of the language will change radically.
Design Principles
Probably the language that Eqthy most resembles, in spirit, is Metamath; but its underlying mechanics are rather different. Eqthy is based on equational logic, so each step is an equation.
Eqthy's design attempts to reconcile simplicity of implementation on a machine with human usability. It should be understood that this is a balancing act; adding features to the language which improve usability will generally be detrimental to simplicity, and vice versa.
It has been implemented in Python 3 in about 760 lines of code; the core (term manipulation and verifier modules) is about 340 lines of code. For more details, see the Implementations section below.
It is also possible for a human to write Eqthy documents by hand, and to read them, without much specialized knowledge. The base logic is equational logic, which has only 5 rules of inference, and these rules are particularly widely understood; "replace equals with equals" is a standard part of the high-school algebra cirriculum.
In comparison, mmverify.py, a Python implementation of a Metamath checker, is about 630 lines of code; and while it is undoubtedly simple, the Metamath language is not widely regarded as being easy to write or read.
In fairness it should not go unstated that equational logic, lacking as it does implication and existential quantifiers, is widely regarded as more awkward to use than first-order predicate logic as a formal language for proofs.
Implementations
While the language does not prescribe any specific application for proofs written in Eqthy, it is reasonable to expect that one of the main reasons one would want a computer to read one would be for it to check it for validity.
This distribution contains such a proof checker, written in pure Python 3, with no dependencies. It has been tested under 3.10, 3.11, and 3.14. Its source code can be found in the src/ directory.
The core module that does proof checking, eqthy.verifier, is less than 200 lines in length, despite having many logging statements (which both act as comments, and provide a trace to help the user understand the execution of the verifier on any given document).
The desire is to make reading the code and understanding its behaviour as un-intimidating as possible.
For todo items for this project, see TODO.md.
Commit History
@master
git clone https://git.catseye.tc/Eqthy/
- Move loading logic into loader module. Chris Pressey 2 years ago
- Replace --bare command line flag with --input-format choices. Chris Pressey 2 years ago
- A slightly less trivial result in the theory of interior algebras. Chris Pressey 2 years ago
- Add document with axioms for Interior Algebra. Chris Pressey 2 years ago
- Fix link Chris Pressey 2 years ago
- Have all examples live in the same directory right now. Chris Pressey 2 years ago
- Update copyright year and run `reuse lint` as part of the test. Chris Pressey 2 years ago
- Update HISTORY file. Chris Pressey 2 years ago
- Show that context is accumulated from one document to the next. Chris Pressey 2 years ago
- Add 'Context' type, minor edits elsewhere as well. Chris Pressey 2 years ago
- Two proofs of properties of the set difference operator. Chris Pressey 2 years ago
- Raise a syntax error if axioms (or anything else) follow a theorem. Chris Pressey 2 years ago
- Add development of the algebra of sets. Chris Pressey 2 years ago
- Add proper "Group Element Commutes with Inverse" proof, and rename the other one. Chris Pressey 2 years ago
- I don't really know if this was a very old statistic, or a typo. Chris Pressey 2 years ago
- Small formatting updates and fixes. Chris Pressey 2 years ago
- Update HISTORY for recent changes going into 0.4. Chris Pressey 2 years ago
- Bump version number. Chris Pressey 2 years ago
- All modules now pass strict mypy checking. Chris Pressey 2 years ago
- flake8 Chris Pressey 2 years ago
- Have terms module able to pass strict mypy checking. Chris Pressey 2 years ago
- Make scanner pass strict mypy check. Chris Pressey 2 years ago
- Begin adding some type annotations. Refactor Term type. Chris Pressey 2 years ago
- Replace namedtuples with dataclasses. Chris Pressey 2 years ago
- Arrange license info in repo to follow REUSE 3.0 convention. Chris Pressey 2 years ago
- Merge branch 'master' of https://codeberg.org/catseye/Eqthy Chris Pressey 3 years ago
- Update links in "see-also bar". Chris Pressey 3 years ago
- Merge pull request 'add second De Morgan's law' (#2) from pro465/Eqthy-fork:de-morgans into master cpressey 3 years ago
- add second De Morgan's law Proloy Mishra 3 years ago
- Merge pull request 'update description of proof of boolean algebra in list' (#1) from pro465/Eqthy-fork:pro465-patch-1 into master cpressey 3 years ago