lean4-htt/tests/lean/run/2942.lean
Kyle Miller 62521f4f2d
fix: let congr conv tactic handle "over-applied" functions (#5861)
Adds ability to chain congruence lemmas when a function's arity is less
than the number of supplied arguments. This improves `congr` as well as
all conv tactics implemented using `congr`, like `arg` and `enter`.

(The non-conv `congr` tactic still needs to be fixed.)

Toward #2942.
2024-10-28 07:34:33 +00:00

36 lines
641 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.

/-!
# `congr` conv tactic with "over-applied" functions
-/
/-!
The function `g` is "over-applied". Previously, conv-mode `congr` failed.
-/
/--
info: case a
a b : Nat
g : {α : Type} → αα
f : Nat → Nat
h : a = b
| f
case a
a b : Nat
g : {α : Type} → αα
f : Nat → Nat
h : a = b
| a
-/
#guard_msgs in
example (a b : Nat) (g : {α : Type} → αα) (f : Nat → Nat) (h : a = b) : g f a = g f b := by
conv =>
lhs
congr
trace_state
· rfl
· rw [h]
example (a b : Nat) (g : {α : Type} → αα) (f : Nat → Nat) (h : a = b) : g f a = g f b := by
conv =>
lhs
arg 2
rw [h]