lean4-htt/tests/lean/grind/list_problems.lean
Leonardo de Moura 5f2f010d66
fix: missing forall normalization rules in grind (#7808)
This PR adds missing forall normalization rules to `grind`.
2025-04-03 22:57:49 +00:00

16 lines
561 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

theorem getElem?_eq_some_iff {l : List α} : l[i]? = some a ↔ ∃ h : i < l.length, l[i] = a := by
induction l
· grind
· cases i
· -- Better support for implication and dependent implication.
-- We need inequality propagation (or case-splits)
grind
· -- Similarly
grind
attribute [grind] List.getElem_append_left List.getElem_append_right
attribute [grind] List.length_cons List.length_nil
example {l : List α} {a : α} {i : Nat} (h : i = l.length) (w) :
(l ++ [a])[i]'w = a := by
grind -- Similar to issue above.