| 1 |
|
| 2 |
Module PretypingWasRejectingFormerConvPbs. |
| 3 |
|
| 4 |
Notation "x .+1" := (S x) (at level 1, left associativity, format "x .+1"). |
| 5 |
|
| 6 |
(** A Yoneda-style encoding of le *) |
| 7 |
Parameter leR : nat -> nat -> SProp. |
| 8 |
Class leY n m := le_intro : forall p, leR p n -> leR p m. |
| 9 |
Infix "<=" := leY: nat_scope. |
| 10 |
|
| 11 |
Definition leY_trans {n m p} (Hnm: n <= m) (Hmp: m <= p): n <= p := |
| 12 |
fun q (Hqn: leR q n) => Hmp _ (Hnm _ Hqn). |
| 13 |
Axiom leY_down : forall {n m} (Hnm: n.+1 <= m), n <= m. |
| 14 |
|
| 15 |
Infix "↕" := leY_trans (at level 45). |
| 16 |
Notation "↓ p" := (leY_down p) (at level 40). |
| 17 |
|
| 18 |
Ltac find _ := assumption || (apply leY_down; eapply leY_trans; eassumption). |
| 19 |
|
| 20 |
(* Below, the presence of open constraints in the goal makes that the typing of 0 fails *) |
| 21 |
Hint Extern 10 (_ <= _) => (find 0) : typeclass_instances. |
| 22 |
|
| 23 |
Parameter p n q r : nat. |
| 24 |
Parameter F : forall (Hp: p <= n), Type. |
| 25 |
Parameter R : forall (Hpq: p <= q) (Hq: q <= n), F (Hpq ↕ Hq). |
| 26 |
|
| 27 |
Section S. |
| 28 |
Context {Hpr: p.+1 <= r} {Hrq: r <= q} {Hq: q <= n}. |
| 29 |
Context (P : F (↓ (Hpr ↕ (Hrq ↕ Hq))) -> Prop). |
| 30 |
Context (C : P (R _ _)). |
| 31 |
End S. |
| 32 |
|
| 33 |
End PretypingWasRejectingFormerConvPbs. |
| 34 |
|
| 35 |
Module PretypingShouldCheckConvPbsAboutExpectedType. |
| 36 |
|
| 37 |
Goal forall x y, x + y = 0 -> exists P, P x y. |
| 38 |
eexists. |
| 39 |
try exact H. |
| 40 |
Abort. |
| 41 |
|
| 42 |
End PretypingShouldCheckConvPbsAboutExpectedType. |