-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b24987f
commit 14ce186
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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₂) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Game.Metadata | ||
|
||
example (a : ℕ) : a = 0 ∨ ¬ (a = 0) := by | ||
by_cases h : a = 0 | ||
· left | ||
exact h | ||
· right | ||
-- here the goal should show `h : a ≠ 0` | ||
exact h | ||
|
||
-- set_option pp.all true in | ||
example (a : ℕ) : ¬ (a = 0) ↔ a ≠ 0 := by | ||
-- both should be displayed the same way | ||
rfl |