From ad75d7fcc2a69108c47ae2bb7afa169049b4376a Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Fri, 18 Oct 2024 15:33:30 +0000 Subject: [PATCH] feat: generalize `ReduceEval (Fin n)` to use `NeZero` This requires a toolchain bump. --- Qq/ForLean/ReduceEval.lean | 4 ++-- lean-toolchain | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Qq/ForLean/ReduceEval.lean b/Qq/ForLean/ReduceEval.lean index a3f664e..97f8577 100644 --- a/Qq/ForLean/ReduceEval.lean +++ b/Qq/ForLean/ReduceEval.lean @@ -17,11 +17,11 @@ private partial def evalList [ReduceEval α] (e : Expr) : MetaM (List α) := do instance [ReduceEval α] : ReduceEval (List α) := ⟨evalList⟩ -instance : ReduceEval (Fin (n+1)) where +instance [NeZero n] : ReduceEval (Fin n) where reduceEval := fun e => do let e ← whnf e if e.isAppOfArity ``Fin.mk 3 then - return Fin.ofNat (← reduceEval (e.getArg! 1)) + return Fin.ofNat' _ (← reduceEval (e.getArg! 1)) else throwFailedToEval e diff --git a/lean-toolchain b/lean-toolchain index 98556ba..eff86fd 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.12.0-rc1 +leanprover/lean4:v4.13.0-rc3