pretty-printer for not equal

This commit is contained in:
joneugster
2023-10-28 22:00:41 +02:00
parent b24987fc19
commit 14ce186239
3 changed files with 30 additions and 0 deletions

15
Game/Tactic/Ne.lean Normal file
View File

@@ -0,0 +1,15 @@
import Lean
/-!
A pretty-printer that displays `¬ (a = b)` as `a ≠ b`.
-/
open Lean PrettyPrinter Delaborator SubExpr
@[delab app.Not] def delab_not_mem :=
whenPPOption Lean.getPPNotation do
let #[f] := ( SubExpr.getExpr).getAppArgs | failure
unless f.getAppFn matches .const `Eq _ do failure
let stx₁ SubExpr.withAppArg <| SubExpr.withNaryArg 1 delab
let stx₂ SubExpr.withAppArg <| SubExpr.withNaryArg 2 delab
return `($stx₁ $stx₂)