lean4-htt/tests/lean/grind/sublist.lean
Kim Morrison eccc472e8d
chore: remove set_option grind.warning false (#8714)
This PR removes the now unnecessary `set_option grind.warning false`
statements, now that the warning is disabled by default.
2025-06-11 05:09:19 +00:00

17 lines
709 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.

open List
example (h : zs <+ ys) (w : xs ++ ys <+ zs) (h' : ¬xs = []) : False := by
fail_if_success grind
-- I'm not sure how to make progress here without manually adding that since `xs ≠ []`, it must be a `cons`.
have : ∃ y ys, xs = y :: ys := match xs, h' with | _ :: _, _ => by simp
grind (gen := 6)
example {xs ys zs : List α} (h : zs <+ ys) :
xs ++ ys <+ zs ↔ xs = [] ∧ ys = zs := by
constructor
· intro w
grind -- stuck, because of the failure of the example above.
-- An alternative idea would be to argue via inequalities about lengths,
-- but any grind pattern for `Sublist.length_le` seems to result in an explosion of useless facts.
· intro w
grind