Skip to content

Commit 03dc334

Browse files
authored
fix: simp have in Sym (#12370)
This PR fixes a proof construction bug in `Sym.simp`. Closes #12336
1 parent 9f2f33b commit 03dc334

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Lean/Meta/Sym/Simp/Have.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,13 @@ For each application `f a`:
318318
-/
319319
def simpBetaApp (e : Expr) (fType : Expr) (fnUnivs argUnivs : Array Level)
320320
(simpBody : Simproc) : SimpM Result := do
321-
return (← go e 0).1
321+
let numArgs := argUnivs.size
322+
return (← go e (numArgs - 1)).1
322323
where
323324
go (e : Expr) (i : Nat) : SimpM (Result × Expr) := do
324325
match e with
325326
| .app f a =>
326-
let (rf, fType) ← go f (i+1)
327+
let (rf, fType) ← go f (i-1)
327328
let r ← match rf, (← simp a) with
328329
| .rfl _, .rfl _ =>
329330
pure .rfl

tests/lean/run/sym_cbv_12336.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Std
2+
set_option cbv.warning false
3+
4+
def test : ((Std.TreeSet.empty : Std.TreeSet Nat).insertMany [1]).toList = [1] := by
5+
conv => lhs; cbv

0 commit comments

Comments
 (0)