refactor(library/data/unit): make unit universe polymorphic

Motivation: we need it for "padding".
Example 1: defining a n-ary tuple type.
Example 2: defining cases-on for mutually recursive datatypes
This commit is contained in:
Leonardo de Moura 2014-10-25 13:55:03 -07:00
parent cdcde661ef
commit 354b50a1f5

View file

@ -4,14 +4,14 @@
import logic.decidable logic.inhabited import logic.decidable logic.inhabited
open decidable open decidable
inductive unit : Type := inductive unit.{l} : Type.{l} :=
star : unit star : unit
namespace unit namespace unit
notation `⋆` := star notation `⋆` := star
-- remove duplication? -- remove duplication?
protected theorem equal (a b : unit) : a = b := protected theorem equal (a b : unit) : a = b :=
rec (rec rfl b) a rec_on a (rec_on b rfl)
protected theorem subsingleton [instance] : subsingleton unit := protected theorem subsingleton [instance] : subsingleton unit :=
subsingleton.intro (λ a b, equal a b) subsingleton.intro (λ a b, equal a b)