Skip to content

Commit

Permalink
fix: structural equation proof generator
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura committed Feb 21, 2024
1 parent 75272cb commit 1fa5dc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Lean/Elab/PreDefinition/Structural/Eqns.lean
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ where
return ()
else if (← tryContradiction mvarId) then
return ()
else if let some mvarId ← whnfReducibleLHS? mvarId then
go mvarId
else if let some mvarId ← simpMatch? mvarId then
go mvarId
else if let some mvarId ← simpIf? mvarId then
go mvarId
else if let some mvarId ← whnfReducibleLHS? mvarId then
go mvarId
else match (← simpTargetStar mvarId {} (simprocs := {})).1 with
| TacticResultCNM.closed => return ()
| TacticResultCNM.modified mvarId => go mvarId
Expand Down
10 changes: 10 additions & 0 deletions tests/lean/run/simp_eqn_bug.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@[simp] def f (a : Nat) (xs : List Nat) : Nat :=
match a with
| 25 => 0
| _ => match xs with
| [] => a
| x::xs => x + f a xs

example : f 25 xs = 0 := by apply f._eq_1
example (h : a = 25 → False) : f a [] = a := by apply f._eq_2; assumption
example (h : a = 25 → False) : f a (x::xs) = x + f a xs := by apply f._eq_3; assumption

0 comments on commit 1fa5dc8

Please sign in to comment.