@@ -20,35 +20,57 @@ attribute [grind =] List.getElem_cons_zero in
2020attribute [grind =] List.getElem?_cons_zero in
2121
2222/--
23- info: Try this:
24- [ apply ] grind only [= List.getElem?_eq_none, = List.getElem?_replicate, = List.getElem?_eq_getElem]
23+ info: Try these:
24+ [ apply ] grind only [= List.getElem?_replicate]
25+ [ apply ] grind => instantiate only [= List.getElem?_replicate]
2526-/
2627#guard_msgs (info) in
2728theorem getElem?_replicate' : (List.replicate n a)[m]? = if m < n then some a else none := by
2829 grind?
2930
3031/--
31- info: Try this :
32+ info: Try these :
3233 [ apply ] grind only [= List.length_cons]
34+ [ apply ] grind => instantiate only [= List.length_cons]
3335-/
3436#guard_msgs (info) in
3537example : 0 < (x :: t).length := by
3638 grind?
3739
3840attribute [grind ext] List.ext_getElem?
3941/--
40- info: Try this:
41- [ apply ] grind only [= List.getElem?_eq_some_iff, = List.length_replicate, = List.getElem?_eq_none,
42- = List.getElem_replicate, = Option.map_some, = Option.map_none, = List.getElem?_replicate,
43- = List.getElem?_eq_getElem, = List.getElem?_map]
42+ info: Try these:
43+ [ apply ] grind only [= List.getElem?_replicate, = List.getElem?_map, = List.getElem?_eq_none,
44+ = List.getElem?_eq_getElem, = List.length_replicate, = List.getElem?_eq_some_iff, = Option.map_some,
45+ = Option.map_none, #b53f, #3f91, #ea98]
46+ [ apply ] grind only [= List.getElem?_replicate, = List.getElem?_map, = List.getElem?_eq_none,
47+ = List.getElem?_eq_getElem, = List.length_replicate, = List.getElem?_eq_some_iff, = Option.map_some,
48+ = Option.map_none]
49+ [ apply ] grind =>
50+ cases #b53f
51+ instantiate only [= List.getElem?_replicate, = List.getElem?_map, = List.getElem?_eq_none,
52+ = List.getElem?_eq_getElem]
53+ instantiate only [= List.getElem?_replicate, = List.getElem?_eq_none, = List.getElem?_eq_getElem,
54+ = List.length_replicate]
55+ instantiate only [= List.length_replicate]
56+ cases #3f91
57+ · instantiate only [= List.getElem?_eq_some_iff]
58+ cases #ea98
59+ · instantiate only [= Option.map_some]
60+ · instantiate only [= Option.map_none]
61+ · instantiate only [= Option.map_some]
4462-/
4563#guard_msgs (info) in
4664theorem map_replicate' : (List.replicate n a).map f = List.replicate n (f a) := by
4765 grind?
4866
4967/--
50- info: Try this:
68+ info: Try these:
69+ [ apply ] grind only [= List.getLast?_eq_some_iff, ← List.mem_concat_self, #e8ab]
5170 [ apply ] grind only [= List.getLast?_eq_some_iff, ← List.mem_concat_self]
71+ [ apply ] grind =>
72+ instantiate only [= List.getLast?_eq_some_iff]
73+ cases #e8ab <;> instantiate only [← List.mem_concat_self]
5274-/
5375#guard_msgs (info) in
5476theorem mem_of_getLast?_eq_some' {xs : List α} {a : α} (h : xs.getLast? = some a) : a ∈ xs := by
@@ -59,8 +81,9 @@ theorem mem_of_getLast?_eq_some' {xs : List α} {a : α} (h : xs.getLast? = some
5981 | _ => 2
6082
6183/--
62- info: Try this :
84+ info: Try these :
6385 [ apply ] grind only
86+ [ apply ] grind => instantiate only
6487-/
6588#guard_msgs (info) in
6689example : x = 0 → f x = 1 := by
@@ -70,8 +93,9 @@ example : x = 0 → f x = 1 := by
7093attribute [grind] f
7194
7295/--
73- info: Try this :
96+ info: Try these :
7497 [ apply ] grind only [ f ]
98+ [ apply ] grind => instantiate only [ f ]
7599-/
76100#guard_msgs (info) in
77101example : x = 0 → f x = 1 := by
@@ -84,8 +108,9 @@ theorem gthm : g (g x) = g x := sorry
84108grind_pattern gthm => g (g x)
85109
86110/--
87- info: Try this :
111+ info: Try these :
88112 [ apply ] grind only [usr gthm]
113+ [ apply ] grind => instantiate only [usr gthm]
89114-/
90115#guard_msgs (info) in
91116example : g (g (g x)) = g x := by
@@ -109,6 +134,12 @@ example : (List.replicate n a)[m]? = if m < n then some a else none := by
109134
110135reset_grind_attrs%
111136
137+ set_option warn.sorry false
138+
139+ /--
140+ info: Try these:
141+ [ apply ] grind => sorry
142+ -/
143+ #guard_msgs in
112144example : (List.replicate n a)[m]? = if m < n then some a else none := by
113- fail_if_success grind?
114- sorry
145+ grind?
0 commit comments