lean4-htt/tests/lean/run/def13.lean
Leonardo de Moura 87932f1c56 feat(frontends/lean): change notation for inaccessible patterns
The following are accepted
 .(t)
 ._

We don't accept .t anymore because it will conflict with the field
access notation.
2017-03-28 16:09:15 -07:00

18 lines
492 B
Text

inductive vec (A : Type) : nat → Type
| nil {} : vec 0
| cons : Π {n}, A → vec n → vec (n+1)
open vec
variables {A : Type}
variables f : A → A → A
definition map_head_1 : ∀ {n}, vec A n → vec A n → vec A n
| .(0) nil nil := nil
| .(n+1) (@cons .(A) n a va) (cons b vb) := cons (f a b) va
example : map_head_1 f nil nil = nil :=
rfl
example (a b : A) (n : nat) (va vb : vec A n) : map_head_1 f (cons a va) (cons b vb) = cons (f a b) va :=
rfl