fix: simp fails to discharge autoParam premises even when it can reduce them to True (#3314)
closes #3257
This commit is contained in:
parent
496a8d578e
commit
678797b67b
2 changed files with 19 additions and 0 deletions
|
|
@ -471,6 +471,7 @@ where
|
|||
return some mvarId
|
||||
|
||||
def dischargeDefault? (e : Expr) : SimpM (Option Expr) := do
|
||||
let e := e.cleanupAnnotations
|
||||
if isEqnThmHypothesis e then
|
||||
if let some r ← dischargeUsingAssumption? e then
|
||||
return some r
|
||||
|
|
|
|||
18
tests/lean/run/3257.lean
Normal file
18
tests/lean/run/3257.lean
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
structure T : Prop
|
||||
structure U : Prop
|
||||
|
||||
theorem foo : T → U := λ _ => {}
|
||||
theorem bar : (_ : T := by trivial) → U := λ _ => {}
|
||||
|
||||
-- fails as expected
|
||||
example : U := by
|
||||
fail_if_success simp
|
||||
sorry
|
||||
|
||||
-- works as expected, discharging `T` via `T.mk`
|
||||
example : U := by
|
||||
simp [foo, T.mk]
|
||||
|
||||
example : U := by
|
||||
set_option trace.Meta.Tactic.simp true in
|
||||
simp [bar, T.mk]
|
||||
Loading…
Add table
Reference in a new issue