test(tests/lean/hott): add test to demonstrate limitations of the current compilation procedure
This commit is contained in:
parent
21a9cd58a3
commit
5bf8141af2
1 changed files with 16 additions and 0 deletions
16
tests/lean/hott/eq1.hlean
Normal file
16
tests/lean/hott/eq1.hlean
Normal file
|
@ -0,0 +1,16 @@
|
|||
open nat
|
||||
|
||||
inductive vector (A : Type) : nat → Type :=
|
||||
nil {} : vector A zero,
|
||||
cons : Π {n}, A → vector A n → vector A (succ n)
|
||||
|
||||
infixr `::` := vector.cons
|
||||
|
||||
definition swap {A : Type} : Π {n}, vector A (succ (succ n)) → vector A (succ (succ n)),
|
||||
swap (a :: b :: vs) := b :: a :: vs
|
||||
|
||||
-- Remark: in the current approach for HoTT, the equation
|
||||
-- swap (a :: b :: v) = b :: a :: v
|
||||
-- holds definitionally only when the index is a closed term.
|
||||
example (a b : num) (v : vector num 5) : swap (a :: b :: v) = b :: a :: v :=
|
||||
rfl
|
Loading…
Reference in a new issue