2014-12-23 20:35:06 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Module: data.unit
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
-/
|
2015-04-01 18:48:18 +00:00
|
|
|
import logic.eq
|
2014-12-23 20:35:06 +00:00
|
|
|
|
|
|
|
namespace unit
|
|
|
|
notation `⋆` := star
|
|
|
|
|
|
|
|
protected theorem equal (a b : unit) : a = b :=
|
2015-02-11 20:49:27 +00:00
|
|
|
unit.rec_on a (unit.rec_on b rfl)
|
2014-12-23 20:35:06 +00:00
|
|
|
|
|
|
|
theorem eq_star (a : unit) : a = star :=
|
2015-02-11 20:49:27 +00:00
|
|
|
unit.equal a star
|
2014-12-23 20:35:06 +00:00
|
|
|
|
|
|
|
protected theorem subsingleton [instance] : subsingleton unit :=
|
2015-05-19 05:35:18 +00:00
|
|
|
subsingleton.intro (λ a b, unit.equal a b)
|
2014-12-23 20:35:06 +00:00
|
|
|
|
|
|
|
protected definition is_inhabited [instance] : inhabited unit :=
|
|
|
|
inhabited.mk unit.star
|
|
|
|
|
|
|
|
protected definition has_decidable_eq [instance] : decidable_eq unit :=
|
2015-05-19 05:35:18 +00:00
|
|
|
take (a b : unit), decidable.inl (unit.equal a b)
|
2014-12-23 20:35:06 +00:00
|
|
|
end unit
|