Skip to content

v0.58.0

Choose a tag to compare

@gmpassos gmpassos released this 02 Dec 06:32
· 3 commits to main since this release
eb36a0a

Finding a lemma to cite. prooflang find PATTERN lists the theorems
whose statement contains the pattern, a ProofLang proposition or term in
which each _ is a hole: find '_ ∣ _ * _', find '_ * _ > 0'.

  • Matched on meaning, not text. The pattern, a proposition or a term
    (_ × _), is elaborated in the scope of the searched modules and
    matched against their elaborated IR, in a theorem's goal or in the type
    of one of its context entries, inside match arms too: a bound
    variable's name does not matter, an operator matches at any carrier
    (_ * _ in a group and in ℕ), and a numeral at any type, with what it
    fixes (_ ∈ {0, 1} matches a set of reals). Every _ is a hole, even
    under a binder named _.
  • Each match comes with its statement as a sequent, its obligation id
    (what submit takes), the last build's verdict, where it matched (the
    goal, or which hypothesis, variable or instance), and how to cite it:
    strategy simplify(using = [M.dvd_mul]) for a project theorem,
    qualified (two imported modules may share a name), which submit --strategy accepts as given.
  • Several projects are searched together: one whose scope lacks a name
    the pattern uses is skipped; the pattern fails only when it elaborates in
    none.
  • --lean MODULE searches a Lean module instead (find '_ < _ → _ ≤ _' --lean Mathlib.Order.Basic), as import-lean --all imports it: only
    what the importer can express (and self-checks) is searched; each match
    carries its Lean name, cited as by: exact <name> ….
  • --format json is one document for agents, pinned by a golden
    (test/golden/cli/find.json).
  • Outside a pattern, _ is a name as before: a project's a = _ is an
    unknown name, not a hole.