{"id":20425283,"url":"https://github.com/catseye/eqthy","last_synced_at":"2025-04-12T18:54:50.098Z","repository":{"id":64679000,"uuid":"514838641","full_name":"catseye/Eqthy","owner":"catseye","description":"MIRROR of https://codeberg.org/catseye/Eqthy : A simple formalized language for equational proofs","archived":false,"fork":false,"pushed_at":"2023-11-10T17:36:52.000Z","size":107,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T13:11:33.722Z","etag":null,"topics":["equational-logic","equational-theory","proof-checker","proof-checking","proof-language"],"latest_commit_sha":null,"homepage":"https://catseye.tc/node/Eqthy","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/catseye.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-07-17T12:34:40.000Z","updated_at":"2023-10-25T15:32:31.000Z","dependencies_parsed_at":"2023-11-10T18:44:54.180Z","dependency_job_id":null,"html_url":"https://github.com/catseye/Eqthy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FEqthy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FEqthy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FEqthy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catseye%2FEqthy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catseye","download_url":"https://codeload.github.com/catseye/Eqthy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618262,"owners_count":21134200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["equational-logic","equational-theory","proof-checker","proof-checking","proof-language"],"created_at":"2024-11-15T07:12:46.405Z","updated_at":"2025-04-12T18:54:50.039Z","avatar_url":"https://github.com/catseye.png","language":"Python","readme":"Eqthy\n=====\n\n_Version 0.3_ | _See also:_ [Philomath](https://codeberg.org/catseye/Philomath#philomath)\n∘ [LCF-style-ND](https://codeberg.org/catseye/The-Dossier/src/branch/master/article/LCF-style-Natural-Deduction/README.md)\n\n- - - -\n\n**Eqthy** is a formalized language for equational proofs.  Its design attempts to\nreconcile _simplicity of implementation on a machine_ with _human usability_\n([more on this below](#design-principles)).  It supports an elementary linear\nstyle, where each line gives a step which is derived from the step on the previous\nline, and may optionally state the justification for the derivation in that step.\nHere is an example:\n\n    axiom (idright) mul(A, e) = A\n    axiom (idleft)  mul(e, A) = A\n    axiom (assoc)   mul(A, mul(B, C)) = mul(mul(A, B), C)\n    theorem (idcomm)\n        mul(A, e) = mul(e, A)\n    proof\n        A = A\n        mul(A, e) = A           [by idright]\n        mul(A, e) = mul(e, A)   [by idleft]\n    qed\n\nFor improved human usability, Eqthy is usually embedded within Markdown documents.\nThis allows proofs to be written in a more \"literate\" style, with interspersed\nexplanatory prose and references in the form of hyperlinks.\n\nFor a fuller description of the language, including a set of Falderal\ntests, see **[doc/Eqthy.md](doc/Eqthy.md)**.\n\nA number of proofs have been written in Eqthy to date.  These can be found in\nthe **[eg/](eg/)** directory.  In particular, there are worked-out proofs:\n\n*   of the [Socks and Shoes](eg/socks-and-shoes.eqthy.md) theorem in group theory;\n*   in [Propositional Algebra](eg/propositional-algebra.eqthy.md);\n*   of De Morgan's laws in [Boolean Algebra](eg/boolean-algebra.eqthy.md);\n*   in [Combinatory Logic](eg/combinatory-logic.eqthy.md),\n\nwith hopefully more to come in the future.\n\nThe Eqthy language is still at an early stage and is subject to change.  However,\nsince the idea is to accumulate a database of proofs which can be built upon,\nit is unlikely that the format of the language will change radically.\n\n### Design Principles\n\nProbably the language that Eqthy most resembles, in spirit, is\n[Metamath][]; but its underlying mechanics are rather different.\nEqthy is based on [equational logic][], so each step is an equation.\n\nEqthy's design attempts to reconcile simplicity of implementation on a machine\nwith human usability.  It should be understood that this is a balancing act;\nadding features to the language which improve usability will generally be\ndetrimental to simplicity, and vice versa.\n\nIt has been implemented in Python in about 550 lines of code; the core\nverifier module is less than 200 lines of code.  For more details, see\nthe [Implementations](#implementations) section below.\n\nIt is also possible for a human to write Eqthy documents by hand, and\nto read them, without much specialized knowledge.  The base logic\nis [equational logic][], which has only 5 rules of inference, and these\nrules are particularly widely understood; \"replace equals with equals\" is\na standard part of the high-school algebra cirriculum.\n\n(In comparison, `mmverifier.py`, a Python implementation of a Metamath\nchecker, is 360 lines of code; and while it is undoubtedly simple, the\nMetamath language is not widely regarded as being easy to write or read.)\n\n### Implementations\n\nWhile the language does not prescribe any specific application for proofs\nwritten in Eqthy, it is reasonable to expect that one of the main reasons\none would want a computer to read one would be for it to check it for validity.\n\nThis distribution contains such a proof checker, written in Python 3.\nThe source code for it can be found in the **[src/](src/)** directory.\n\nThe core module that does proof checking,\n**[eqthy.verifier](src/eqthy/verifier.py)**, is less than 200 lines in length,\ndespite having many logging statements (which both act as comments, and provide a\ntrace to help the user understand the execution of the verifier on any given\ndocument).\n\nThe desire is to make reading the code and understanding its behaviour as\nun-intimidating as possible.\n\nTODO\n----\n\n### Small Items\n\n*   Handle \"on LHS\", \"on RHS\" in hints.\n*   Allow context accumulated when verifying one document to be\n    carried over and used when verifying the next documnet.\n*   Allow the first line of a proof to be an axiom.\n*   Scanner should report correct line number in errors\n    when Eqthy document is embedded in Markdown.\n*   Arity checking?  Would prevent some silly errors in axioms.\n\n### Desired Examples\n\n*   [Interior algebra](https://en.wikipedia.org/wiki/Interior_algebra) (corresponding to the modal logic S4)\n*   [Relation algebra](https://en.wikipedia.org/wiki/Relation_algebra)\n*   Johnson's 1892 axiom system given in Meredith and Prior's 1967 paper [Equational Logic](https://projecteuclid.org/download/pdf_1/euclid.ndjfl/1093893457)\n*   The theorem of ring theory given in [Equational Logic, Spring 2017](https://people.math.sc.edu/mcnulty/alglatvar/equationallogic.pdf) by McNulty (but it's a bit of a monster all right)\n\n### Aspirational Items\n\n#### Preprocessor\n\nIt would make some sense to split off the code that\nparses an Eqthy document into its own program, which the main\nprogram calls when reading in an Eqthy document, much in the same\nvein as the C preprocessor does.  This would necessitate defining\na simple intermediate format (S-expressions or JSON) by which the\npreprocessor communicates the parsed document to the main prover.\n\nThis would allow the syntax to become more sophisticated (for\nexample, supporting infix syntax for operators) while the core\nproof checker is unchanged.  And would allow re-implementing the\ncore proof checker in another language without necessitating\nrewriting the entire parser too.\n\n#### AC-unification\n\nOr rather, AC-matching.  An awful lot of a typical Eqthy proof\ninvolves merely rearranging things around operators that are\nassociative and/or commutative.  If Eqthy can be taught that\n\n    add(add(1, 2), X)\n\nmatches\n\n    add(2, add(3, 1))\n\nwith the unifier `X=3` because it has been informed that `add`\nis an associative and commutative operator, then many proof steps\ncan be omitted.  The trick would be to have a simple syntax that\nindicates this, and a simple implementation of matching that supports\nit without adding too many lines of code to the proof checker.\n\n#### Embedding in a Functional Programming Language\n\nThis may by its nature be a seperate project, as it would\ninvolve creating a functional programming language of which Eqthy\nis a subset.\n\nThe idea is that we would introduce a special form of axiom with\nsome additional connotations.  For example,\n\n    def add(X, 0) =\u003e X\n\nwould be in all respects the same as\n\n    axiom add(X, 0) = X\n\nbut with the additional connotation that when a term such as\n`add(5, 0)` is \"evaluated\" it should \"reduce\" to `5`.  There\nis no connotation from this that \"evaluating\" 5 should \"reduce\"\nto anything however, but it would still be possible to appeal\nto the equality `add(5, 0) = 5` in both directions in a proof\nwritten in this language.\n\nThe practical upshot being that you could write small functional\nprograms and _also_ proofs of some of their properties, in this\none language, which is only a modest superset of Eqthy.\n\n[Metamath]: https://us.metamath.org/\n[equational logic]: doc/Equational-Logic.md\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Feqthy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatseye%2Feqthy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatseye%2Feqthy/lists"}