lean4-htt/tests/lean/run/def_ite_value.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

19 lines
563 B
Text

inductive bv : nat → Type
| nil : bv 0
| cons : Π n, bool → bv n → bv (n+1)
open bv
definition f : ∀ n : nat, bv n → nat → nat
| (n+1) (cons .(n) b v) 1000000 := f n v 0
| (n+1) (cons .(n) b v) x := f n v (x + 1)
| _ _ _ := 1
set_option pp.binder_types true
#check @f._main.equations._eqn_1
#check @f._main.equations._eqn_2
#check @f._main.equations._eqn_3
example (n : nat) (b : bool) (v : bv n) (x : nat) : x ≠ 1000000 → f (n+1) (cons n b v) x = f n v (x + 1) :=
assume H, f._main.equations._eqn_3 n b v x H