lean4-htt/tests/lean/run/PUnit_syntax.lean
Joachim Breitner 180c6aaa5e
feat: PProd and MProd syntax (part 2) (#4730)
the internal constructions for structural and well-founded recursion
use plenty of `PProd` and `MProd`, and reading these, deeply
nested and in prefix notation, is unnecessarily troublesome.

Therefore this introduces notations
```
a ×ₚ b   -- PProd a b
a ×ₘ b   -- MProd a b
()ₚ      -- PUnit.unit
(x,y,z)ₚ -- PProd.mk x (PProd.mk y z)
(x,y,z)ₘ -- MProd.mk x (MProd.mk y z)
```

(This is the post-stage0-part 2.)
2024-07-15 15:40:42 +00:00

47 lines
1.2 KiB
Text

/-- info: Bool ×ₚ Nat ×ₚ List Unit : Type -/
#guard_msgs in
#check Bool ×ₚ Nat ×ₚ List Unit
/-- info: Bool ×ₚ Nat ×ₚ List Unit : Type -/
#guard_msgs in
#check PProd Bool (PProd Nat (List Unit))
/-- info: (Bool ×ₚ Nat) ×ₚ List Unit : Type -/
#guard_msgs in
#check PProd (PProd Bool Nat) (List Unit)
/-- info: Bool ×ₘ Nat ×ₘ List Unit : Type -/
#guard_msgs in
#check Bool ×ₘ Nat ×ₘ List Unit
/-- info: Bool ×ₘ Nat ×ₘ List Unit : Type -/
#guard_msgs in
#check MProd Bool (MProd Nat (List Unit))
/-- info: (Bool ×ₘ Nat) ×ₘ List Unit : Type -/
#guard_msgs in
#check MProd (MProd Bool Nat) (List Unit)
/-- info: PUnit.unit : PUnit -/
#guard_msgs in
#check ()ₚ
/-- info: (true, 5, [()])ₚ : Bool ×ₚ Nat ×ₚ List Unit -/
#guard_msgs in
#check (true, 5, [()])ₚ
/-- info: (true, 5, [()])ₘ : Bool ×ₘ Nat ×ₘ List Unit -/
#guard_msgs in
#check (true, 5, [()])ₘ
/-- info: (true, 5, [()])ₚ : Bool ×ₚ Nat ×ₚ List Unit -/
#guard_msgs in
#check PProd.mk true (PProd.mk 5 [()])
/-- info: (true, 5, [()])ₘ : Bool ×ₘ Nat ×ₘ List Unit -/
#guard_msgs in
#check MProd.mk true (MProd.mk 5 [()])
/-- info: PUnit.unit.{u} : PUnit -/
#guard_msgs in
#check PUnit.unit