lean4-htt/tests/pkg/cbv_attr/CbvAttr/InvertedLocalTheorem.lean
Wojciech Różowski 424fbbdf26
feat: add support to cbv_eval attribute (#12506)
This PR adds the ability to register theorems with the `cbv_eval`
attribute in the reverse direction using the `←` modifier, mirroring the
existing `simp` attribute behavior. When `@[cbv_eval ←]` is used, the
equation `lhs = rhs` is inverted to `rhs = lhs`, allowing `cbv` to
rewrite occurrences of `rhs` to `lhs`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 12:23:17 +00:00

12 lines
234 B
Text

module
set_option cbv.warning false
@[cbv_opaque] public def f7 (x : Nat) :=
x + 1
private axiom myAx : x + 1 = f7 x
@[local cbv_eval ←] public theorem f7_spec : x + 1 = f7 x := myAx
example : f7 1 = 2 := by conv => lhs; cbv