Closed dwrensha closed 4 hours ago
Will it be easy to detect Facts
statements from https://github.com/teorth/equational_theories/pull/19 when it's merged, and generate non-implications from them? This will help us avoid writing O(n^2) non-implications as Lean theorems.
It should be straightforward to expand this logic to accommodate whatever conventions we adopt.
Currently, this iterates over all items in the equational_theories.Basic
module. Once we have results living in multiple files, we'll need some other strategy.
As discussed on zulip, one way to do that would be to look in the environment for all items under a given namespace (EquationalTheories
perhaps).
We could do that like this:
for ⟨name, const_info⟩ in env.constants do
if Name.isPrefixOf `EquationalTheories name then
-- process `const_info`
You might worry that this is slow, because the environment is going to include stuff from mathlib, which is larger. However, when I tried it just now, it was tolerably fast (less than a second) with env.constants
having 626k elements (from all of mathlib).
This is a start on porting process_implications.py into Lean.
When I run this on the current repo via
lake exe extract_implications
, it outputs: