653141135d
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
23 lines
846 B
Text
23 lines
846 B
Text
----------------------------------------------------------------------------------------------------
|
||
-- Copyright (c) 2014 Floris van Doorn. All rights reserved.
|
||
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||
-- Author: Floris van Doorn
|
||
----------------------------------------------------------------------------------------------------
|
||
import logic
|
||
open tactic num
|
||
|
||
inductive nat : Type :=
|
||
zero : nat,
|
||
succ : nat → nat
|
||
|
||
notation `ℕ`:max := nat
|
||
|
||
abbreviation plus (x y : ℕ) : ℕ
|
||
:= nat_rec x (λ n r, succ r) y
|
||
|
||
definition to_nat [coercion] [inline] (n : num) : ℕ
|
||
:= num_rec zero (λ n, pos_num_rec (succ zero) (λ n r, plus r (plus r (succ zero))) (λ n r, plus r r) n) n
|
||
|
||
print "=================="
|
||
theorem nat_rec_zero {P : ℕ → Type} (x : P 0) (f : ∀m, P m → P (succ m)) : nat_rec x f 0 = x :=
|
||
refl _
|