lean4-htt/tests/elab/grind_try_exact.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

50 lines
975 B
Text

module
public section -- TODO: `try?` fails if theorems are private
opaque P : Nat → Prop
opaque Q : Nat → Prop
theorem Pall : Q x → P x := sorry
/--
info: Try this:
[apply] exact Pall h
-/
#guard_msgs (info) in
example (h : Q x) (_ : x > 0) : P x := by
try?
/--
info: Try this:
[apply] · intros; expose_names; exact Pall h
-/
#guard_msgs (info) in
example: Q x → True → P x := by
try?
/--
info: Try this:
[apply] · intros; expose_names; exact Pall h_1
-/
#guard_msgs (info) in
example: True → Q x → True → P x := by
try?
theorem Qall {x y : Nat} : Q x := sorry
/--
error: Tactic `try?` failed: consider using `grind` manually, or `try? +missing` for partial proofs containing `sorry`
x : Nat
⊢ Q x
-/
#guard_msgs (error) in
example : Q x := by
try? -- should fail, we cannot elaborate `exact Qall`
/--
info: Try this:
[apply] · expose_names; exact Pall h
-/
#guard_msgs (info) in
example (_ : Q x) (_ : x > 0) : P x := by
try?