2015-06-05 17:32:24 +00:00
|
|
|
open nat
|
|
|
|
|
|
|
|
inductive fin : nat → Type :=
|
|
|
|
| fz : Π n, fin (succ n)
|
|
|
|
| fs : Π {n}, fin n → fin (succ n)
|
|
|
|
|
|
|
|
open fin
|
2015-03-07 03:04:09 +00:00
|
|
|
|
|
|
|
definition nz_cases_on {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
|
2015-03-28 00:26:06 +00:00
|
|
|
reverts [n, f],
|
2015-03-07 03:04:09 +00:00
|
|
|
show ∀ (n : nat) (f : fin (succ n)), C n f
|
|
|
|
| m (fz m) := by apply H₁
|
|
|
|
| m (fs f') := by apply H₂
|
|
|
|
end
|