lean4-htt/tests/lean/run/introLetFun.lean
Kyle Miller 31981090e4
feat: make intro be aware of let_fun (#3115)
Adds support for `let_fun` to the `intro` and `intros` tactics. Also
adds support to `intro` for anonymous binder names, since the default
variable name for a `letFun` with an eta reduced body is anonymous.
2024-01-31 08:55:52 +00:00

26 lines
445 B
Text

import Lean.Elab.Tactic.Basic
import Lean.Meta.Tactic.Intro
/-!
# Testing `intro` with `letFun`
-/
/-!
Explicit `intro`.
-/
example : have x := 2; ∀ _ : Nat, x = x := by
intro x _
rfl
/-!
`intros` is aware of `letFun`.
-/
example : have x := 2; ∀ _ : Nat, x = x := by
intros
rfl
/-!
Check that it works for `letFun` with an eta reduced argument.
-/
example (p : Nat → Prop) (h : ∀ x, p x) : letFun 2 p := by
intro
apply h