test(tests/lean/run/pred_to_subtype_coercion): add coercion to subtype test
This commit is contained in:
parent
b7abd61579
commit
952974f024
1 changed files with 18 additions and 0 deletions
18
tests/lean/run/pred_to_subtype_coercion.lean
Normal file
18
tests/lean/run/pred_to_subtype_coercion.lean
Normal 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⟩
|
||||
Loading…
Add table
Reference in a new issue