Equational Theories Project
Daniel Weber, Vlad Tsyrklevich
Jan 14, 2025
Contributors
Origin of the project
Definitions
Example
◇ | 0 | 1 |
0 | 0 | 1 |
1 | 1 | 1 |
Goal of the project
Project organization
Dashboard
Equation
Explorer
Graphiti
Results
Finite graph
Finite graph
Results: finite graph
Open question:
Does Equation 677 x = y ◇ (x ◇ ((y ◇ x) ◇ y))�imply or refute Equation 255 x = ((x ◇ x) ◇ x) ◇ x ?
Results
Infrastructure
Goal: Maintaining all possible implications, and their status.
Automatically use transitivity:
Infrastructure – continued
Infrastructure – Lean Technicalities
Proof Automation
Proof Automation – Classification
Proof Automation – Vampire
Vampire is a state-of-the-art automated theorem prover for first order logic (Kovács, L., Voronkov, A.. First-Order Theorem Proving and Vampire, CAV 2013). It implements superposition calculus, a generalization of resolution for equational logic. Its main deductive step is
where 𝜃 is the most general unifier of 𝑙, 𝑠.
Proof Automation – Example Interaction With Vampire
fof(lhs, axiom, X = mul(X, mul(mul(X, X), Y))).
fof(rhs, conjecture, X = mul(X, mul(X, X))).
danielweber:~$ vampire problem.tptp
1. ! [X0] : ! [X1] : mul(X0,mul(mul(X0,X0),X1)) = X0 [input]
2. ! [X0] : mul(X0,mul(X0,X0)) = X0 [input]
3. ~! [X0] : mul(X0,mul(X0,X0)) = X0 [negated conjecture 2]
4. ! [X0,X1] : mul(X0,mul(mul(X0,X0),X1)) = X0 [flattening 1]
5. ? [X0] : mul(X0,mul(X0,X0)) != X0 [ennf transformation 3]
6. ? [X0] : mul(X0,mul(X0,X0)) != X0 => sK0 != mul(sK0,mul(sK0,sK0)) [choice axiom]
7. sK0 != mul(sK0,mul(sK0,sK0)) [skolemisation 5,6]
8. mul(X0,mul(mul(X0,X0),X1)) = X0 [cnf transformation 4]
9. sK0 != mul(sK0,mul(sK0,sK0)) [cnf transformation 7]
10. mul(X0,mul(X0,X0)) = X0 [superposition 8,8]
11. sK0 != sK0 [superposition 9,10]
13. $false [trivial inequality removal 11]
Proof Automation – Example Implication
Proof Automation – Superposition in Lean
To justify superposition in Lean, we need to show it from simple substitution.
Counterexamples
Asterix Equation
Ruleset Approach
Ruleset Approach – Continued
Ruleset Approach – Decision Procedure
A complete ruleset gives a decision procedure - assign a variable for each intermediate value in the equation, and repeatedly apply the rules to figure out the operation on these values, and which ones are equal.
If the two sides of the equation become equal, then by necessity it’s implied by our equation, and if they don’t by validity it can be completed to a counterexample.
Validity from Greedy Extension
Greedy Extension – Example
Consider for example Equation 1648 - x = (x ◇ y) ◇ ((x ◇ y) ◇ y).
As a rule it becomes x ◇ y = a, a ◇ y = b -> a ◇ b = x.
Adding the rule for left injectivity, a ◇ x = y, b ◇ x = y -> a = b, this becomes a complete ruleset for equation 1648 via greedy extension.
Greedy Extension – Visualization
x ◇ b = a, a ◇ b = c -> a ◇ c = x
Refutes 3253 x ◇ x = x ◇ (x ◇ (x ◇ x))
◇ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
1 | 2 | 3 | 3 | 7 | | | 2 | | | |
2 | 4 | 5 | 8 | 1 | | | | | | |
3 | 6 | 9 | | | | | | | 1 | |
4 | 10 | | | | | | | | | 2 |
5 | | | | | | | | | | |
6 | | | | | | | | | | |
7 | | | | | | | | | | |
8 | | | | | | | | | | |
9 | | | | | | | | | | |
◇ | 1 | 2 | 3 |
1 | 2 | 3 | 3 |
2 | | | |
3 | | | |
◇ | 1 | 2 | 3 | 4 |
1 | 2 | 3 | 3 | |
2 | 4 | | | 1 |
3 | | | | |
4 | | | | |
◇ | 1 | 2 | 3 | 4 | 5 |
1 | 2 | 3 | 3 | | |
2 | 4 | 5 | | 1 | |
3 | | | | | |
4 | | | | | |
5 | | | | | |
◇ | 1 | 2 | 3 | 4 | 5 | 6 |
1 | 2 | 3 | 3 | | | |
2 | 4 | 5 | | 1 | | |
3 | 6 | | | | | |
4 | | | | | | |
5 | | | | | | |
6 | | | | | | |
◇ | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
1 | 2 | 3 | 3 | 7 | | | 2 |
2 | 4 | 5 | | 1 | | | |
3 | 6 | | | | | | |
4 | | | | | | | |
5 | | | | | | | |
6 | | | | | | | |
7 | | | | | | | |
◇ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
1 | 2 | 3 | 3 | 7 | | | 2 | |
2 | 4 | 5 | 8 | 1 | | | | |
3 | 6 | | | | | | | |
4 | | | | | | | | |
5 | | | | | | | | |
6 | | | | | | | | |
7 | | | | | | | | |
8 | | | | | | | | |
◇ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
1 | 2 | 3 | 3 | 7 | | | 2 | | |
2 | 4 | 5 | 8 | 1 | | | | | |
3 | 6 | 9 | | | | | | | 1 |
4 | | | | | | | | | |
5 | | | | | | | | | |
6 | | | | | | | | | |
7 | | | | | | | | | |
8 | | | | | | | | | |
9 | | | | | | | | | |
◇ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
1 | 2 | 3 | 3 | 7 | | | 2 | | | |
2 | 4 | 5 | 8 | 1 | | | | | | |
3 | 6 | 9 | | | | | | | 1 | |
4 | 10 | | | | | | | | | 2 |
5 | | | | | | | | | | |
6 | | | | | | | | | | |
7 | | | | | | | | | | |
8 | | | | | | | | | | |
9 | | | | | | | | | | |
Proof Automation – Ruleset Construction
Ruleset Construction – Example
Initial rules:
| a | b | x | c |
a | | c | | b/x |
b | a | a | a | |
x | a | a | a | |
c | | | | |
New rule:
3. b ◇ a = a, b ◇ b = a, b ◇ x = a, x ◇ a = a, x ◇ b = a, x ◇ x = a -> b = x
Problem – excessively specific rule
| a | b | x |
a | | | |
b | a | a | a |
x | a | a | a |
Proof Automation – Rule minimization
Vampire sometimes finds counterexample which aren’t minimal, in terms of the rules they produce.
Sometimes hypotheses can be dropped, or there are values which are equal but don’t necessarily need to be.
To make the code more efficient, before we add a rule to our ruleset, we minimize it - attempt to drop hypotheses, and attempt to make different occurrences of a variable different. We use Vampire to check that the minimized rules remain consequences of the equation.
In the previous example, the rule b ◇ a = a, b ◇ b = a, b ◇ x = a, x ◇ a = a, x ◇ b = a, x ◇ x = a -> b = x would be minimized to b ◇ a = a, x ◇ a = a -> b = x by dropping hypotheses, and then to b ◇ a = y, x ◇ a = y -> b = x by making occurrences different.
Theoretical Tools
In addition to what was discussed in here, many approaches were used in the project for handling specific equations, for example:
Conclusion
Proof assistants like Lean let us run mathematical projects at a large scale, allowing for contribution from anybody, with a high guarantee of correctness.