This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import Mathlib.Algebra.BigOperators.Fin
open BigOperators
open Lean PrettyPrinter Delaborator SubExpr
@[ delab app.Finset.sum]
def delabFinsetSum : Delab := do
guard $ (← getExpr).getAppNumArgs == 5
guard $ ((← getExpr).getArg! 3).isAppOf' ``Finset.univ
guard $ ((← getExpr).getArg! 4).isLambda
withNaryArg 4 do
let α ← withBindingDomain delab
withBindingBodyUnusedName fun n => do
let n : TSyntax `ident := ⟨n⟩
let b ← delab
`(∑ $n:ident : $α, $b)