diff --git a/theories/algebra/list.v b/theories/algebra/list.v index 669500516482021e9b5cff81e849443ebc3900b2..b1685f2eb274f1277cce8f55e0ae944ceaf230ab 100644 --- a/theories/algebra/list.v +++ b/theories/algebra/list.v @@ -363,6 +363,12 @@ Section properties. Qed. Lemma list_lookup_singletonM i x : ({[ i := x ]} : list A) !! i = Some x. Proof. induction i; by f_equal/=. Qed. + Lemma list_lookup_singletonM_lt i i' x: + (i' < i)%nat → ({[ i := x ]} : list A) !! i' = Some ε. + Proof. move: i'. induction i; intros [|i']; naive_solver auto with lia. Qed. + Lemma list_lookup_singletonM_gt i i' x: + (i < i')%nat → ({[ i := x ]} : list A) !! i' = None. + Proof. move: i'. induction i; intros [|i']; naive_solver auto with lia. Qed. Lemma list_lookup_singletonM_ne i j x : i ≠j → ({[ i := x ]} : list A) !! j = None ∨ ({[ i := x ]} : list A) !! j = Some ε.