Skip to content

Commit

Permalink
chore(logic/unique): a true prop is unique (#7688)
Browse files Browse the repository at this point in the history
I found myself needing to construct this instance by hand somewhere; since we already need it to construct `unique true`, we may as well make a def.
  • Loading branch information
eric-wieser committed May 23, 2021
1 parent 57cd5ef commit 6cffc9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/logic/unique.lean
Expand Up @@ -57,7 +57,11 @@ instance punit.unique : unique punit.{u} :=
{ default := punit.star,
uniq := λ x, punit_eq x _ }

instance : unique true := { default := trivial, uniq := λ x, rfl }
/-- Every provable proposition is unique, as all proofs are equal. -/
def unique_prop {p : Prop} (h : p) : unique p :=
{ default := h, uniq := λ x, rfl }

instance : unique true := unique_prop trivial

lemma fin.eq_zero : ∀ n : fin 1, n = 0
| ⟨n, hn⟩ := fin.eq_of_veq (nat.eq_zero_of_le_zero (nat.le_of_lt_succ hn))
Expand Down

0 comments on commit 6cffc9f

Please sign in to comment.