7db84c7036
The commit also fixes vector to use the new definition.
19 lines
513 B
Text
19 lines
513 B
Text
open nat
|
|
|
|
inductive fin : nat → Type :=
|
|
| fz : Π n, fin (succ n)
|
|
| fs : Π {n}, fin n → fin (succ n)
|
|
|
|
open fin
|
|
|
|
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
|
|
reverts [n, f],
|
|
show ∀ (n : nat) (f : fin (succ n)), C n f
|
|
| m (fz m) := by apply H₁
|
|
| m (fs f') := by apply H₂
|
|
end
|