| 1 |
Axiom _0: Prop. |
| 2 |
|
| 3 |
From Corelib Require Export Morphisms Setoid. |
| 4 |
|
| 5 |
Class Equiv A := equiv: relation A. |
| 6 |
|
| 7 |
Reserved Notation "P ⊢ Q" (at level 99, Q at level 200, right associativity). |
| 8 |
Reserved Notation "P ⊣⊢ Q" (at level 95, no associativity). |
| 9 |
Reserved Notation "■ P" (at level 20, right associativity). |
| 10 |
|
| 11 |
(** Define the scope *) |
| 12 |
Declare Scope bi_scope. |
| 13 |
Delimit Scope bi_scope with I. |
| 14 |
|
| 15 |
Structure bi := |
| 16 |
Bi { bi_car :> Type; |
| 17 |
bi_entails : bi_car -> bi_car -> Prop; |
| 18 |
bi_impl : bi_car -> bi_car -> bi_car; |
| 19 |
bi_forall : forall A, (A -> bi_car) -> bi_car; }. |
| 20 |
|
| 21 |
#[export] Declare Instance bi_equiv `{PROP:bi} : Equiv (bi_car PROP). |
| 22 |
|
| 23 |
Arguments bi_car : simpl never. |
| 24 |
Arguments bi_entails {PROP} _%_I _%_I : simpl never, rename. |
| 25 |
Arguments bi_impl {PROP} _%_I _%_I : simpl never, rename. |
| 26 |
Arguments bi_forall {PROP _} _%_I : simpl never, rename. |
| 27 |
|
| 28 |
Notation "P ⊢ Q" := (bi_entails P%I Q%I) . |
| 29 |
Notation "P ⊣⊢ Q" := (equiv (A:=bi_car _) P%I Q%I) . |
| 30 |
|
| 31 |
Infix "->" := bi_impl : bi_scope. |
| 32 |
Reserved Notation "∀ x .. y , P" |
| 33 |
(at level 10, x binder, y binder, P at level 200, |
| 34 |
format "'[ ' '[ ' ∀ x .. y ']' , '/' P ']'"). |
| 35 |
Notation "∀ x .. y , P" := |
| 36 |
(bi_forall (fun x => .. (bi_forall (fun y => P)) ..)%I) : bi_scope. |
| 37 |
|
| 38 |
(* bug disappears if definitional class *) |
| 39 |
Class Plainly (PROP : bi) := { plainly : PROP -> PROP; }. |
| 40 |
Notation "■ P" := (plainly P) : bi_scope. |
| 41 |
|
| 42 |
Section S. |
| 43 |
Context {I : Type} {PROP : bi} `(Plainly PROP). |
| 44 |
|
| 45 |
Lemma plainly_forall `{Plainly PROP} {A} (Ψ : A -> PROP) : (∀ a, ■ (Ψ a)) ⊣⊢ ■ (∀ a, Ψ a). |
| 46 |
Proof. Admitted. |
| 47 |
|
| 48 |
Global Instance entails_proper : |
| 49 |
Proper (equiv ==> equiv ==> iff) (bi_entails : relation PROP). |
| 50 |
Proof. Admitted. |
| 51 |
|
| 52 |
Global Instance impl_proper : |
| 53 |
Proper (equiv ==> equiv ==> equiv) (@bi_impl PROP). |
| 54 |
Proof. Admitted. |
| 55 |
|
| 56 |
Global Instance forall_proper A : |
| 57 |
Proper (pointwise_relation _ equiv ==> equiv) (@bi_forall PROP A). |
| 58 |
Proof. Admitted. |
| 59 |
|
| 60 |
Declare Instance PROP_Equivalence: Equivalence (@equiv PROP _). |
| 61 |
|
| 62 |
Set Mangle Names. |
| 63 |
Lemma foo (P : I -> PROP) K: |
| 64 |
K ⊢ ∀ (j : I) |
| 65 |
(_ : Prop) (* bug disappears if this is removed *) |
| 66 |
, (∀ i0, ■ P i0) -> P j. |
| 67 |
Proof. |
| 68 |
setoid_rewrite plainly_forall. |
| 69 |
(* retype in case the tactic did some nonsense *) |
| 70 |
match goal with |- ?T => let _ := type of T in idtac end. |
| 71 |
Abort. |
| 72 |
End S. |