lean4-htt/tests/lean/coe1.lean
Leonardo de Moura 8993d0738a feat(frontends/lean): remove #elab command
The check command is now using the new elaborator.
2016-08-02 15:05:24 -07:00

40 lines
872 B
Text

check if tt then "a" else "b"
/- Remark: in the standard library nat_to_int and int_to_real are has_lift instances
instead of has_coe. -/
constant int : Type₁
constant real : Type₁
constant nat_to_int : has_coe nat int
constant int_to_real : has_coe int real
attribute [instance] nat_to_int int_to_real
constant sine : real → real
constants n m : nat
constants i j : int
constants x y : real
check sine x
check sine n
check sine i
constant int_has_add : has_add int
constant real_has_add : has_add real
attribute [instance] int_has_add real_has_add
check x + i
/- The following one does not work because the implicit argument ?A of add is bound to int
when x is processed. -/
check i + x -- FAIL
/- The workaround is to use the explicit lift -/
check ↑i + x
check x + n
check n + x -- FAIL
check ↑n + x
check (i:real) + x
check (n:real) + x