Skip to content

Commit

Permalink
fix: dsimp should reduce kernel projections (#3607)
Browse files Browse the repository at this point in the history
closes #3395
  • Loading branch information
leodemoura committed Mar 5, 2024
1 parent 414f0eb commit 436d7be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Lean/Meta/Tactic/Simp/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ private def reduceStep (e : Expr) : SimpM Expr := do
return f.betaRev e.getAppRevArgs
-- TODO: eta reduction
if cfg.proj then
match (← reduceProj? e) with
| some e => return e
| none =>
match (← reduceProjFn? e) with
| some e => return e
| none => pure ()
Expand Down
8 changes: 8 additions & 0 deletions tests/lean/run/3395.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
structure S where
f : Nat → Nat

example (h : g 1 = x) : { f := g : S }.f 1 = x := by
unfold S.f
dsimp
guard_target =ₛ g 1 = x
assumption

0 comments on commit 436d7be

Please sign in to comment.