feat(library/data/num): show that num has decidable equality
This commit is contained in:
parent
63b93cf762
commit
3b19de1974
1 changed files with 11 additions and 0 deletions
|
@ -510,3 +510,14 @@ namespace pos_num
|
|||
end
|
||||
|
||||
end pos_num
|
||||
|
||||
namespace num
|
||||
open pos_num
|
||||
|
||||
theorem decidable_eq [instance] : ∀ (a b : num), decidable (a = b)
|
||||
| zero zero := inl rfl
|
||||
| zero (pos b) := inr (by contradiction)
|
||||
| (pos a) zero := inr (by contradiction)
|
||||
| (pos a) (pos b) :=
|
||||
if H : a = b then inl (by rewrite H) else inr (suppose pos a = pos b, begin injection this, contradiction end)
|
||||
end num
|
||||
|
|
Loading…
Reference in a new issue