@@ -77,6 +77,14 @@ public meta section
7777
7878open Lean Meta Elab Tactic
7979
80+ /-- Configuration for the `convert` family of tactics.
81+ This is `Congr!.Config` with different, less aggressive, defaults.
82+ -/
83+ structure Convert.Config extends Congr!.Config where
84+ postTransparency := .reducible
85+
86+ declare_config_elab Convert.elabConfig Convert.Config
87+
8088/--
8189Close the goal `g` using `Eq.mp v e`,
8290where `v` is a metavariable asserting that the type of `g` and `e` are equal.
@@ -201,7 +209,7 @@ def elabTermForConvert (term : Syntax) (expectedType? : Option Expr) :
201209elab_rules : tactic
202210| `(tactic| convert%$tk $[!%$semired]? $cfg $[←%$sym]? $term $[using $n]? $[with $ps?*]?) =>
203211 withMainContext do
204- let baseConfig ← Congr! .elabConfig (mkOptionalNode cfg)
212+ let baseConfig := { ← Convert .elabConfig cfg with }
205213 let mut config := baseConfig
206214 if semired.isSome then
207215 config := { config with
@@ -276,7 +284,7 @@ elab_rules : tactic
276284| `(tactic| convert_to $[!%$semireducible]? $cfg $[←%$sym]? $newType $[using $n]?
277285 $[with $ps?*]? $[$loc?:location]?) => do
278286 let n : ℕ := n |>.map (·.getNat) |>.getD 1
279- let config ← Congr! .elabConfig (mkOptionalNode cfg)
287+ let config := { ← Convert .elabConfig cfg with }
280288 let patterns := (ps?.getD #[]).toList
281289 withLocation (expandOptLocation (mkOptionalNode loc?))
282290 (atLocal := fun fvarId ↦ do
@@ -321,7 +329,9 @@ syntax (name := acChange) "ac_change " term (" using " num)? : tactic
321329syntax (name := acChange!) "ac_change! " term (" using " num)? : tactic
322330
323331macro_rules
324- | `(tactic| ac_change $t $[using $n]?) => `(tactic| convert_to $t:term $[using $n]? <;> try ac_rfl)
325- | `(tactic| ac_change! $t $[using $n]?) => `(tactic| convert_to! $t:term $[using $n]? <;> try ac_rfl)
332+ | `(tactic| ac_change $t $[using $n]?) =>
333+ `(tactic| convert_to $t:term $[using $n]? <;> try ac_rfl)
334+ | `(tactic| ac_change! $t $[using $n]?) =>
335+ `(tactic| convert_to! $t:term $[using $n]? <;> try ac_rfl)
326336
327337end Mathlib.Tactic
0 commit comments