refactor(library/init): move num->nat coercion to init
This commit is contained in:
parent
193fed7061
commit
b094c1cf43
2 changed files with 3 additions and 4 deletions
|
@ -10,10 +10,6 @@ open eq.ops binary
|
||||||
|
|
||||||
namespace nat
|
namespace nat
|
||||||
|
|
||||||
definition of_num [coercion] [reducible] (n : num) : ℕ :=
|
|
||||||
num.rec zero
|
|
||||||
(λ n, pos_num.rec (succ zero) (λ n r, r + r + (succ zero)) (λ n r, r + r) n) n
|
|
||||||
|
|
||||||
definition addl (x y : ℕ) : ℕ :=
|
definition addl (x y : ℕ) : ℕ :=
|
||||||
nat.rec y (λ n r, succ r) x
|
nat.rec y (λ n r, succ r) x
|
||||||
infix `⊕`:65 := addl
|
infix `⊕`:65 := addl
|
||||||
|
|
|
@ -338,4 +338,7 @@ namespace nat
|
||||||
(le.refl a)
|
(le.refl a)
|
||||||
(λ b₁ ih, le.trans !pred_le ih)
|
(λ b₁ ih, le.trans !pred_le ih)
|
||||||
|
|
||||||
|
definition of_num [coercion] [reducible] (n : num) : ℕ :=
|
||||||
|
num.rec zero
|
||||||
|
(λ n, pos_num.rec (succ zero) (λ n r, r + r + (succ zero)) (λ n r, r + r) n) n
|
||||||
end nat
|
end nat
|
||||||
|
|
Loading…
Reference in a new issue