lean4-htt/tests/lean/run/grind_nonforall_params.lean
Leonardo de Moura 216f7e8753
feat: grind proof parameters whose type is not a forall (#11326)
This PR ensures that users can provide `grind` proof parameters whose
types are not `forall`-quantified. Examples:

```lean
opaque f : Nat → Nat
axiom le_f (a : Nat) : a ≤ f a

example (a : Nat) : a ≤ f a := by
  grind [le_f a]

example (a b : α) (h : ∀ x y : α, x = y) : a = b := by
  grind [h a b]
```
2025-11-23 18:36:04 +00:00

21 lines
469 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.

/-
Tests `grind` proof parameters whose type is not a `forall`.
-/
opaque f : Nat → Nat
axiom le_f (a : Nat) : a ≤ f a
example (a : Nat) : a ≤ f a := by
grind [le_f a]
example (a b : α) (h : ∀ x y : α, x = y) : a = b := by
fail_if_success grind
grind [h a b]
/--
error: invalid `grind` parameter, modifier is redundant since the parameter type is not a `forall`
a ≤ f a
-/
#guard_msgs in
example (a : Nat) : a ≤ f a := by
grind [← le_f a]