blob: 1cad01b7f1dbe6e1029c77a959f79fa0061c5cc1 [file]
/-!
Regression test for #16037: non-chronological backtracking only drops a case-split from the
script generated by `grind?` if the script still closes the goal. Here, the proof does not use
the case-split on `if h : (w ++ l₁).isEmpty = true then ... else ...`, but E-matching uses a term
it introduces.
-/
variable {l₁ l₂ : List α} (h : l₁ <:+: l₂) {hne : l₂ ≠ []} (hl : l₂.head hne ∈ l₁) (hnd : l₂.Nodup)
/--
info: Try these:
[apply] grind only [→ List.IsInfix.mem, = List.head_eq_getElem, = List.nodup_iff_pairwise_ne, List.IsInfix,
usr List.IsPrefix.length_le, usr List.length_pos_of_mem, = List.pairwise_append, = List.length_append,
usr List.append_assoc, = List.head_append, = List.mem_append, → List.nil_of_isEmpty, usr List.prefix_append,
usr List.getElem_mem, #936c, #c8c5, #b14b, #90fe]
[apply] grind only [→ List.IsInfix.mem, = List.head_eq_getElem, = List.nodup_iff_pairwise_ne, List.IsInfix,
usr List.IsPrefix.length_le, usr List.length_pos_of_mem, = List.pairwise_append, = List.length_append,
usr List.append_assoc, = List.head_append, = List.mem_append, → List.nil_of_isEmpty, usr List.prefix_append,
usr List.getElem_mem]
[apply] grind =>
instantiate only [→ List.IsInfix.mem, = List.head_eq_getElem, = List.nodup_iff_pairwise_ne, List.IsInfix]
instantiate only [usr List.IsPrefix.length_le]
instantiate only [usr List.length_pos_of_mem]
cases #936c
instantiate only [= List.pairwise_append, = List.length_append, usr List.append_assoc]
instantiate only [= List.pairwise_append, = List.length_append, = List.head_append, = List.mem_append,
→ List.nil_of_isEmpty]
instantiate only [→ List.nil_of_isEmpty, #c8c5]
cases #b14b
· ac
· instantiate only [= List.head_append]
cases #90fe
· ac
instantiate only [usr List.prefix_append]
· instantiate only [= List.head_eq_getElem]
instantiate only [usr List.getElem_mem]
-/
#guard_msgs in
example : l₁ <+: l₂ := by grind? [List.IsInfix]
example : l₁ <+: l₂ := by
grind only [→ List.IsInfix.mem, = List.head_eq_getElem, = List.nodup_iff_pairwise_ne, List.IsInfix,
usr List.IsPrefix.length_le, usr List.length_pos_of_mem, = List.pairwise_append, = List.length_append,
usr List.append_assoc, = List.head_append, = List.mem_append, → List.nil_of_isEmpty, usr List.prefix_append,
usr List.getElem_mem, #936c, #c8c5, #b14b, #90fe]
example : l₁ <+: l₂ := by
grind only [→ List.IsInfix.mem, = List.head_eq_getElem, = List.nodup_iff_pairwise_ne, List.IsInfix,
usr List.IsPrefix.length_le, usr List.length_pos_of_mem, = List.pairwise_append, = List.length_append,
usr List.append_assoc, = List.head_append, = List.mem_append, → List.nil_of_isEmpty, usr List.prefix_append,
usr List.getElem_mem]
example : l₁ <+: l₂ := by
grind =>
instantiate only [→ List.IsInfix.mem, = List.head_eq_getElem, = List.nodup_iff_pairwise_ne, List.IsInfix]
instantiate only [usr List.IsPrefix.length_le]
instantiate only [usr List.length_pos_of_mem]
cases #936c
instantiate only [= List.pairwise_append, = List.length_append, usr List.append_assoc]
instantiate only [= List.pairwise_append, = List.length_append, = List.head_append, = List.mem_append,
→ List.nil_of_isEmpty]
instantiate only [→ List.nil_of_isEmpty, #c8c5]
cases #b14b
· ac
· instantiate only [= List.head_append]
cases #90fe
· ac
instantiate only [usr List.prefix_append]
· instantiate only [= List.head_eq_getElem]
instantiate only [usr List.getElem_mem]