This PR adds support to `grind` for case splitting on implications of the form `p -> q` and `(h : p) -> q h`. See the new option `(splitImp := true)`.
25 lines
630 B
Text
25 lines
630 B
Text
reset_grind_attrs%
|
||
|
||
reset_grind_attrs%
|
||
|
||
theorem getElem?_eq_some_iff {l : List α} : l[i]? = some a ↔ ∃ h : i < l.length, l[i] = a := by
|
||
induction l
|
||
· sorry
|
||
· cases i
|
||
· -- Better support for implication and dependent implication.
|
||
-- We need inequality propagation (or case-splits)
|
||
grind
|
||
· -- Similarly
|
||
grind
|
||
|
||
---
|
||
reset_grind_attrs%
|
||
|
||
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.
|
||
|
||
---
|