lean4-htt/tests/lean/run/binderNameHintScope.lean
jrr6 62f14514da
refactor: update built-in tactic error messages (#9633)
This PR updates various error messages produced by or associated with
built-in tactics and adapts their formatting to current conventions.
2025-07-31 14:16:57 +00:00

28 lines
958 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.

import Lean
-- This checks that binderNameHint freshens up a variable.:
axiom allPairs (l : List α) (p : αα → Bool) : Bool
#guard_msgs (drop warning) in
theorem all_eq_allPairs (l : List α) (p : α → Bool) :
l.all p ↔ ∀ x y z, binderNameHint x p <| binderNameHint y () <| p x && p y && p z:= sorry
-- below we should get `a` from the user (no dagger), `y` with dagger (binderNameHint added a macro
-- scope) and `z` without dagger (because intro1P is not hygienic)
/--
error: Failed: `fail` tactic was invoked
f : String → Bool
names : List String
a y✝ z : String
⊢ (f a && f y✝ && f z) = true
-/
#guard_msgs in
open Lean Elab Tactic in
example {f : String → Bool} (names : List String) : names.all (fun a => f a) = true := by
rw [all_eq_allPairs]
run_tac liftMetaTactic1 ((some ·.2) <$> ·.intro1P)
run_tac liftMetaTactic1 ((some ·.2) <$> ·.intro1P)
run_tac liftMetaTactic1 ((some ·.2) <$> ·.intro1P)
fail