File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ private def hasLinearOrder (u : Level) (α : Q(Type u)) (cls : Q(Type u → Type
100100
101101/-- Delaborate `max x y` into `x ⊔ y` if the type is not a linear order. -/
102102@[delab app.Max.max]
103- def delabSup : Delab := do
103+ def delabSup : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do
104104 let_expr f@Max.max α inst _ _ := ← getExpr | failure
105105 have u := f.constLevels![0 ]!
106106 if ← hasLinearOrder u α q(Max) q($(linearOrderToMax u)) inst then
@@ -112,7 +112,7 @@ def delabSup : Delab := do
112112
113113/-- Delaborate `min x y` into `x ⊓ y` if the type is not a linear order. -/
114114@[delab app.Min.min]
115- def delabInf : Delab := do
115+ def delabInf : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation do
116116 let_expr f@Min.min α inst _ _ := ← getExpr | failure
117117 have u := f.constLevels![0 ]!
118118 if ← hasLinearOrder u α q(Min) q($(linearOrderToMin u)) inst then
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import Mathlib
1313#guard_msgs in
1414#check (max (min (max (max {0 } {1 }) (max {2 } {3 })) (max {4 } {5 })) (min (min {6 } {7 }) (min {8 } {9 })) : Set ℕ)
1515
16-
1716section
1817
1918variable {α : Type *} (a b : α)
@@ -62,3 +61,24 @@ info: fun α [ConditionallyCompleteLinearOrder α] a b =>
6261-/
6362#guard_msgs in
6463#check fun (α : Type u) [ConditionallyCompleteLinearOrder α] (a b : α) => max a b
64+
65+ -- In this section we check that the delaborator respects the options `pp.explicit` and `pp.notation`.
66+ section
67+
68+ variable [Min α] [Max α] (a b c : α)
69+
70+ /-- info: (a ⊔ b) ⊓ c : α -/
71+ #guard_msgs in
72+ #check min (max a b) c
73+
74+ set_option pp.notation false in
75+ /-- info: min (max a b) c : α -/
76+ #guard_msgs in
77+ #check min (max a b) c
78+
79+ set_option pp.explicit true in
80+ /-- info: @min α inst✝¹ (@max α inst✝ a b) c : α -/
81+ #guard_msgs in
82+ #check min (max a b) c
83+
84+ end
You can’t perform that action at this time.
0 commit comments