test(tests/lean/run/pred_to_subtype_coercion): add coercion to subtype test

This commit is contained in:
Leonardo de Moura 2016-09-21 17:10:56 -07:00
parent b7abd61579
commit 952974f024

View file

@ -0,0 +1,18 @@
universe variables u
attribute [instance]
definition pred2subtype {A : Type u} : has_coe_to_sort (A → Prop) :=
⟨Type (max 1 u), λ p : A → Prop, subtype p⟩
definition below (n : nat) : nat → Prop :=
λ i, i < n
check λ x : below 10, x
definition f : below 10 → nat
| ⟨a, h⟩ := a
lemma zlt10 : 0 < 10 :=
sorry
check f ⟨0, zlt10⟩