Skip to content
Snippets Groups Projects
Commit 75bbf7a2 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Merge branch 'stronger_list_core_id' into 'master'

Add a stronger version of `list_core_id`.

See merge request iris/iris!361
parents b73c677c d6dbed9e
No related branches found
No related tags found
No related merge requests found
...@@ -296,12 +296,17 @@ Section cmra. ...@@ -296,12 +296,17 @@ Section cmra.
by apply cmra_discrete_valid. by apply cmra_discrete_valid.
Qed. Qed.
Global Instance list_core_id l : ( x : A, CoreId x) CoreId l. Lemma list_core_id' l : ( x, x l CoreId x) CoreId l.
Proof. Proof.
intros ?; constructor; apply list_equiv_lookup=> i. intros Hyp. constructor. apply list_equiv_lookup=> i.
by rewrite list_lookup_core (core_id_core (l !! i)). rewrite list_lookup_core.
destruct (l !! i) eqn:E; last done.
by eapply Hyp, elem_of_list_lookup_2.
Qed. Qed.
Global Instance list_core_id l : ( x : A, CoreId x) CoreId l.
Proof. intros Hyp; by apply list_core_id'. Qed.
(** Internalized properties *) (** Internalized properties *)
Lemma list_equivI {M} l1 l2 : l1 l2 ⊣⊢@{uPredI M} i, l1 !! i l2 !! i. Lemma list_equivI {M} l1 l2 : l1 l2 ⊣⊢@{uPredI M} i, l1 !! i l2 !! i.
Proof. uPred.unseal; constructor=> n x ?. apply list_dist_lookup. Qed. Proof. uPred.unseal; constructor=> n x ?. apply list_dist_lookup. Qed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment