lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

fix: generalize equality `@[spec]` rules over their explicit arguments

Open sgraf812 opened this issue 5 months ago • 2 comments

This PR fixes vcgen failing to apply an equality @[spec] (such as a @[spec] def) at one argument after it was already used at a different one: the cached backward rule no longer bakes in the concrete explicit arguments, so it applies at any arguments. It also lets such specs apply to non-monadic program types.

The backward rule for an equality spec is cached per spec theorem, assertion instance and excess-argument count, so it must stay generic over the program's explicit arguments. eqSpecToWp? now classifies the program and value type directly from the goal's wp arguments instead of assuming a monadic m α shape, and no longer unifies the equation's left-hand side against the goal's concrete program, which previously specialized the rule to those arguments.

sgraf812 avatar Jun 26 '26 14:06 sgraf812

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 8f37bc8b0a305a55285825b3535e4da5ed2a2d31 --onto 0758b1d2e33c65ccea578abb0c668aab1f811608. You can force Mathlib CI using the force-mathlib-ci label. (2026-06-26 15:58:41)

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 8f37bc8b0a305a55285825b3535e4da5ed2a2d31 --onto c500da3e893f814e54e3392d5d637085fac8bc37. You can force reference manual CI using the force-manual-ci label. (2026-06-26 15:58:42)

leanprover-bot avatar Jun 26 '26 15:06 leanprover-bot