| 1 |
From Corelib Require Export Morphisms Setoid. |
| 2 |
|
| 3 |
Class Empty A := empty : A. |
| 4 |
|
| 5 |
Class MapFold K A M := map_fold B : (K -> A -> B -> B) -> B -> M -> B. |
| 6 |
Global Arguments map_fold {_ _ _ _ _}. |
| 7 |
|
| 8 |
Class FinMap K M `{forall A, Empty (M A), forall A, MapFold K A (M A)} := { }. |
| 9 |
|
| 10 |
Definition map_filter {K A M} `{MapFold K A M, Empty M} (P : A -> Prop) : M -> M := |
| 11 |
map_fold (fun k v m => m) empty. |
| 12 |
|
| 13 |
Global Instance map_filter_proper {K A M} `{FinMap K M} (P : A -> Prop) : |
| 14 |
Proper (@eq (M A) ==> eq) (map_filter P). |
| 15 |
Proof. Admitted. |
| 16 |
|
| 17 |
#[projections(primitive=yes)] |
| 18 |
Record seal {A} (f : A) := { unseal : A; seal_eq : unseal = f }. |
| 19 |
Global Arguments unseal {_ _}. |
| 20 |
|
| 21 |
Record ofe := { ofe_car :> Type }. |
| 22 |
|
| 23 |
Definition iProto (Σ V : Type) : ofe. Admitted. |
| 24 |
|
| 25 |
Definition iProto_dual_def {Σ V} (p : iProto Σ V) : iProto Σ V := p. |
| 26 |
Definition iProto_dual_aux : seal (@iProto_dual_def). Proof. eexists. reflexivity. Qed. |
| 27 |
Definition iProto_dual : forall {Σ V}, iProto Σ V -> iProto Σ V := iProto_dual_aux.(unseal). |
| 28 |
|
| 29 |
Lemma test {Σ V} (p q q' : iProto Σ V) (Hq : q = q') : |
| 30 |
iProto_dual q = p. |
| 31 |
Proof. |
| 32 |
setoid_rewrite Hq. |
| 33 |
Abort. |