lean4-htt/tests/lean/run/rvec.lean
Leonardo de Moura 3b38f71f11 fix(library,tests/lean): fix run/interactive tests, and problems in the standard library due to the new interpretation for Type
We had to change subtype to use Sort since the axiom
strong_indefinite_description uses it.

see #1341
2017-01-30 11:54:00 -08:00

23 lines
571 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open nat
universe variables u
inductive rvec (α : Type u) : nat → Type u
| nil {} : rvec 0
| cons : Π {n}, rvec n → α → rvec (succ n)
namespace rvec
local infix :: := cons
variables {α β δ : Type u}
def map (f : α → β) : Π {n : nat}, rvec α n → rvec β n
| 0 nil := nil
| (succ n) (v::a) := map v :: f a
def map₂ (f : α → β → δ) : Π {n : nat}, rvec α n → rvec β n → rvec δ n
| 0 nil nil := nil
| (succ n) (v::a) (w::b) := map₂ v w :: f a b
lemma ex1 : map succ (nil::1::2) = nil::2::3 :=
rfl
end rvec