Skip to content

v0.50.0

Choose a tag to compare

@gmpassos gmpassos released this 01 Dec 20:30
· 27 commits to main since this release
a1e1c47

Mathlib's lemmas in strategy search. Before, the search was offered only
the project's own theorems (by the shape of their conclusion), so a goal
that one Mathlib lemma closes (φ(p) = p - 1 from Prime(p)) failed. The
automation benchmark's search module gains three such obligations: Lean
closes 10 of its 11 (7 of 8 before), and the native build all 11.

  • With Lean: the library step. Once per search, on the goal as stated
    (only intros before it, no ∀ left), the search runs Lean's exact?.
    It looks the goal up among every lemma the module imports and closes the
    premises from the hypotheses.
    • It runs after the search has failed, on its own heartbeat budget
      rather than the time limit: within the limit, exact? (whose first
      call in a file indexes the imports) took the time a search needed for
      what its other steps find (gauss_search, exists_gt_three on CI).
      A search that fails therefore takes longer than its limit.
    • What it found is stored for replay as exact <term>: the proof term
      printed on one line, β-reduced, its proofs shown (exact Nat.totient_prime hp, exact Nat.coprime_comm.mp h), when that
      elaborates back (a heartbeat failure counts as not), else as
      exact?.
    • A find that depends on sorry (a project theorem with no proof, which
      Lean adds with sorryAx) is no find.
  • Natively: the snapshot's theorems by shape (native_library.dart).
    Each theorem of the native environment is keyed by its conclusion's
    relation and the heads of its two sides (≥/> as ≤/<, a
    predicate by its first and last arguments, an ↔ by each direction).
    One whose conclusion is variables only (Nat.Coprime.symm) is offered
    when the goal's hypotheses have the heads of all its explicit premises,
    and those are ranked first among the 8 tried. Each candidate is
    applyd and its premises closed by assumption only, so the native
    side finds no more than exact? would: the ℝ facts of
    NativeReal.lean, which Lean has not, and internal names (_simp_1,
    match_1), which exact? skips, are never offered. The index grows
    with the build: each search indexes the theorems proved since the last,
    so what it is offered does not depend on the native cache.
  • Benchmark: totient_prime_search, prime_two_le_search and
    coprime_symm_search (none closed by v0.49.0, with Lean or natively).
    The automation benchmark is 44 obligations, all of them proved natively.
  • Not done: the plan's Euler example rewrite. Its cited steps are
    about its own definitions (Totient, Coprime by gcd), not Mathlib's,
    or need apply with a function argument (Nat.Coprime.prod_left),
    which exact? does not unify.