Skip to content

Commit a9ca7e2

Browse files
committed
fix(Tactic/Convert): support over-applications again (#40740)
This PR fixes a regression introduced in #38071, which had caused the congruence algorithm of `convert` to not support over-applications. I added a test to show this now works again.
1 parent c36598a commit a9ca7e2

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Mathlib/Tactic/CongrExclamation.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ structure Congr!.Config where
130130
This can be used to control which side's definitions are expanded when applying the
131131
congruence lemma (if `preferLHS = true` then the RHS can be expanded). -/
132132
preferLHS : Bool := true
133-
/-- Allow both sides to be partial applications.
133+
/-- Allow both sides to be partial applications, and allow overapplications.
134134
When false, given an equality `f a b = g x y z` this means we never consider
135135
proving `f a = g x y`.
136136

Mathlib/Tactic/Convert.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ between `Convert.CheapConfig` and `Convert.ExpensiveConfig` based on other flags
7777
-/
7878
structure Convert.CheapConfig extends Congr!.Config where
7979
postTransparency := .reducible
80-
partialApp := false
8180
sameFun := true
8281

8382
/-- Internal elaborator for `Convert.CheapConfig`: use `Convert.elabConfig` instead. -/

MathlibTest/Tactic/Convert/Basic.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module
22
import Mathlib.Tactic.Convert
33
import Mathlib.Algebra.Group.Basic
44
import Mathlib.Data.Set.Image
5+
import Mathlib.Algebra.Notation.Pi.Defs
56

67
private axiom test_sorry : ∀ {α}, α
78
set_option autoImplicit true
@@ -153,4 +154,10 @@ example (P : ℕ → Prop) {a b : ℕ} (hab : b = a) (h : P a) : P (semireducibl
153154
example (P : ℕ → Prop) {a b : ℕ} (hab : b = a) (h : P (semireducibleId a)) : P b := by
154155
convert! h
155156

157+
-- Test that overapplications are supported
158+
example (f g h k : Nat → Nat) (H : (f + g) 1 = 0) : (h + k) 1 = 0 := by
159+
convert H
160+
guard_target =ₛ h = f
161+
all_goals exact test_sorry
162+
156163
end Tests

0 commit comments

Comments
 (0)