File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ def elabDischarger (stx : TSyntax ``discharger) : TacticM Simp.Discharge :=
211211def push (cfg : Config) (disch? : Option Simp.Discharge) (head : Head) (loc : Location)
212212 (failIfUnchanged : Bool := true ) : TacticM Unit := do
213213 let cfg := { distrib := cfg.distrib || (← getBoolOption `push_neg.use_distrib) }
214- transformAtLocation (pushCore head cfg disch? ·) "push" loc failIfUnchanged
214+ transformAtLocation (pushCore head cfg disch? ·) s! "push { head } " loc failIfUnchanged
215215
216216/--
217217`push c` rewrites the goal by pushing the constant `c` deeper into an expression.
Original file line number Diff line number Diff line change @@ -80,15 +80,15 @@ def transformAtLocalDecl (m : Expr → ReaderT Simp.Context MetaM Simp.Result) (
8080 ReaderT Simp.Context MetaM (Option MVarId) := do
8181 let ldecl ← fvarId.getDecl
8282 if ldecl.isImplementationDetail then
83- throwError "Cannot run `{proc}` at `{ldecl.userName }`, it is an implementation detail"
83+ throwError "Cannot run `{proc}` at `{Expr.fvar fvarId }`, it is an implementation detail"
8484 let tgt ← instantiateMVars (← fvarId.getType)
8585 let eraseFVarId (ctx : Simp.Context) :=
8686 ctx.setSimpTheorems <| ctx.simpTheorems.eraseTheorem (.fvar fvarId)
8787 let r ← withReader eraseFVarId <| m tgt
8888 -- we use expression equality here (rather than defeq) to be consistent with, e.g.,
8989 -- `applySimpResultToLocalDeclCore`
9090 if failIfUnchanged && tgt.cleanupAnnotations == r.expr.cleanupAnnotations then
91- throwError "`{proc}` made no progress at `{ldecl.userName }`"
91+ throwError "`{proc}` made no progress at `{Expr.fvar fvarId }`"
9292 return (← applySimpResultToLocalDecl goal fvarId r mayCloseGoal).map Prod.snd
9393
9494/-- Use the procedure `m` to transform at specified locations (hypotheses and/or goal).
Original file line number Diff line number Diff line change @@ -145,25 +145,29 @@ example (h : p ∧ q) : ¬¬(p ∧ q) := by
145145 exact h
146146
147147-- new error message as of https://github.com/leanprover-community/mathlib4/issues/27562
148- /-- error: `push` made no progress anywhere -/
148+ /-- error: `push Not ` made no progress anywhere -/
149149#guard_msgs in
150150example {P : Prop } (h : P) : P := by push Not at *
151151
152152-- new behaviour as of https://github.com/leanprover-community/mathlib4/issues/27562
153153-- (Previously, because of a metavariable instantiation issue, the tactic succeeded as a no-op.)
154- /-- error: `push` made no progress at `h` -/
154+ /-- error: `push Not ` made no progress at `h` -/
155155#guard_msgs in
156156example {x y : ℕ} : True := by
157157 have h : x ≤ y := test_sorry
158158 push Not at h
159159
160160-- new behaviour as of https://github.com/leanprover-community/mathlib4/issues/27562 (previously the tactic succeeded as a no-op)
161- /-- error: Cannot run `push` at `inductive_proof`, it is an implementation detail -/
161+ /-- error: Cannot run `push Not ` at `inductive_proof`, it is an implementation detail -/
162162#guard_msgs in
163163def inductive_proof : True := by
164164 push Not at inductive_proof
165165 trivial
166166
167+ /-- error: `push Not` made no progress on the goal -/
168+ #guard_msgs in
169+ example {P : Prop } (h : P) : P := by push Not
170+
167171section use_distrib
168172
169173example (h : ¬ p ∨ ¬ q) : ¬ (p ∧ q) := by
You can’t perform that action at this time.
0 commit comments