Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All4x4Tables: update after #281 #294

Merged
merged 4 commits into from
Oct 5, 2024

Conversation

zaklogician
Copy link
Contributor

This PR:

1. Adds 4 more cancellative magmas that were found through hand-guided search and which refute 31 of the 29688 implications still open after #281, bringing down the number to 29657. The idea was to find for cancellative magmas that specifically fail to satisfy large one-variable laws. The addition of the new magmas also results in a slightly better plan (with fewer Lean checks required).

2. Re-runs the transitive closure pruning using the large number of recently proved implications. This further pushes down the number of explicitly proven implications from 604701 to 581162 .

3. Adds a minor QoL improvement to variable counting in finite_magma_tools, which makes it more useful for #278 -style experimentation.

The script at `equational_theories/Generated/All4x4Tables/src/generate_lean.py`
is supposed to read the implications.json file, and prune the finite magma
checks based on that, so that we don't have to generate redundant explicit
refutations that already follow from the known implications.

I recently ported this script to work with the cancellative magmas added
in teorth#224.

Unfortunately, there seems to be a bug in this naive port: once we move to
implicit refutations, the total proof_false decreases, and the number of
unknowns increases. For example, running on a now-recent main we have

```
BEFORE (explicit proofs in All4x4Tables):
{"explicit_proof_true": 28263,
"implicit_proof_true": 5457962,
"unknown": 2726304,
"implicit_proof_false": 3486,
"explicit_proof_false": 13845794
}

AFTER (implicit proofs in All4x4Tables):
{"explicit_proof_true": 28263,
"implicit_proof_true": 5457962,
"unknown": 2744422,
"implicit_proof_false": 13185894,
"explicit_proof_false": 645268
}
```

To reproduce,

1. Generate an `implications.json` using
 `lake exe extract_implications  --json --only-implications equational_theories`

2. Run the version of `generate_lean.py` from this commit.

3. Build the proofs, then inspect the output of
 `lake exe extract_implications outcomes --hist`.
Adds `make-plan` output format support to `generate_lean.py` so that it can
be used to prune the refutation set of the cancellative 5x5 magmas using the
already proven implications read from `implications.json`.

Of the previous 196990 facts that we had to check explicitly, pruning removed
172724 facts, leaving 24266 facts to check (a 87% improvement).

The count of unknowns is unaffected, as `extract_implications outcomes --hist`
confirms:

```
{"explicit_proof_true": 28264,
"implicit_proof_true": 5457961,
"unknown": 2726304,
"implicit_proof_false": 13243426,
"explicit_proof_false": 605854
}
```
Adds 4 more cancellative magmas that were found through hand-guided
search and which refute 31 still-open implications. These were still
open following the vampire theorems.

The magmas were found by hand-searching for cancellative magmas that
fail to satisfy large one-variable laws.

As an added benefit, the number of explicit false proofs is reduced
by a further 1.1k.

{"explicit_proof_true": 28264,
"implicit_proof_true": 5457961,
"unknown": 2726273,
"implicit_proof_false": 13244610,
"explicit_proof_false": 604701
}
Since the Vampire proofs (teorth#281) are merged, we re-run the transitive closure
pruning using the larger implication set. This further reduces the number of
explicit checks that we have to perform.

The number of unknown implications is reduced from 29688 to 29657
@teorth
Copy link
Owner

teorth commented Oct 5, 2024

Is there a standard location where one can input other medium size magmas for automated testing, such as the 8-element magma in #291 or the 9-element magma being used in #266?

@zaklogician
Copy link
Contributor Author

zaklogician commented Oct 5, 2024

@teorth

Is there a standard location where one can input other medium size magmas for automated testing, such as the 8-element magma in #291 or the 9-element magma being used in #266?

I'll probably get around to building something more user-friendly for this in the near future, but the current situation is this:

All4x4Tables has a data directory where we normally put these tables and where the proof planner make-plan can read them from. The proof planner can then determine which new anti-implications are resolved by a newly added magma, and can auto-create the Refutation*.lean scripts to resolve them.

[Here] is an example of such an input file, but as you can see it already has to contain an exact list of equations satisfied in a given magma. (FinSearch has something similar - the two dirs will eventually be merged, but we'll have to sort out how this goes).

The parse-mace4 tool in finite_magma_tools` can create this list in the required format from Mace4 outputs. Mace4-style output is actually easy to hand-craft if one has a multiplication table. Here's an example, whitespace does not matter:

interpretation( 6, [number=1, seconds=0], [
        function(+(_,_), [
			   1, 0, 3, 2, 5, 4,
			   2, 3, 5, 4, 1, 0,
			   4, 5, 1, 0, 2, 3,
			   0, 1, 2, 3, 4, 5,
			   5, 4, 0, 1, 3, 2,
			   3, 2, 4, 5, 0, 1 ])
]).

@teorth
Copy link
Owner

teorth commented Oct 5, 2024

Ultimately one could imagine a web interface where one could upload (in some standard format) a multiplication table, the tool displays all the equations it satisfies, checks if it creates any new refutations, and if so it accepts the table and adds it to some standard directory from which the refutations are generated. There may be a few thousand finite magma refutations left out there, so this might be worthwhile. Anyway, I made a link here from #180 which one can re-interpret as asking for this sort of user-friendly functionality.

@teorth teorth merged commit 86bd918 into teorth:main Oct 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants