mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
test: add regression test for List.length implicit reducibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
13
tests/elab/implicit_reducible_list_length.lean
Normal file
13
tests/elab/implicit_reducible_list_length.lean
Normal file
@@ -0,0 +1,13 @@
|
||||
/-!
|
||||
Regression test: `simp` should be able to apply lemmas that depend on `List.length`
|
||||
even when `List.length` appears inside implicit type class instance arguments.
|
||||
See https://github.com/leanprover/lean4/pull/12924
|
||||
-/
|
||||
|
||||
theorem BitVec.getElem!_eq_testBit_toNat {w : Nat} (x : BitVec w) (i : Nat) :
|
||||
x[i]! = x.toNat.testBit i := by sorry
|
||||
|
||||
example (l : List Nat) (a : Nat) (j : Nat) :
|
||||
(0#((a :: l).length))[j]! = (0#((a :: l).length)).toNat.testBit j := by
|
||||
simp only [List.length_cons]
|
||||
simp only [BitVec.getElem!_eq_testBit_toNat]
|
||||
@@ -0,0 +1 @@
|
||||
implicit_reducible_list_length.lean:7:8-7:40: warning: declaration uses `sorry`
|
||||
Reference in New Issue
Block a user