Compare commits

...

1 Commits

Author SHA1 Message Date
Leonardo de Moura
8eae5cb6b0 fix: simp fails to discharge auto_param premises even when it can reduce them to True
closes #3257
2024-02-12 15:39:02 -08:00
2 changed files with 19 additions and 0 deletions

View File

@@ -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
View 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]