2014-11-29 05:56:13 +00:00
|
|
|
open nat
|
|
|
|
|
2015-06-05 17:32:24 +00:00
|
|
|
inductive fin : nat → Type :=
|
|
|
|
| fz : Π n, fin (succ n)
|
|
|
|
| fs : Π {n}, fin n → fin (succ n)
|
|
|
|
|
2014-11-29 05:56:13 +00:00
|
|
|
namespace fin
|
|
|
|
|
|
|
|
definition z_cases_on2 (C : fin zero → Type) (p : fin zero) : C p :=
|
|
|
|
by cases p
|
|
|
|
|
|
|
|
definition nz_cases_on2 {C : Π n, fin (succ n) → Type}
|
|
|
|
(H₁ : Π n, C n (fz n))
|
|
|
|
(H₂ : Π n (f : fin n), C n (fs f))
|
|
|
|
{n : nat}
|
|
|
|
(f : fin (succ n)) : C n f :=
|
|
|
|
begin
|
|
|
|
cases f,
|
2015-05-14 21:32:54 +00:00
|
|
|
apply (H₁ n),
|
|
|
|
apply (H₂ n a)
|
2014-11-29 05:56:13 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end fin
|