(** * Trace erasure preserves spinlock clean and well-synchronized*)
From mathcomp.ssreflect Require Import ssreflect ssrbool ssrnat ssrfun eqtype seq fintype finfun.
Set Implicit Arguments.
(*NOTE: because of redefinition of [val], these imports must appear after Ssreflect eqtype.*)
Set Bullet Behavior "None".
Set Bullet Behavior "Strict Subproofs".
Module SpinLocksSC.
Open Scope nat.

Lemma trace_erasure_nth:
forall tr tr' i ev'
(Herased: trace_erasure tr tr')
(Hi: nth_error tr' i = Some ev'),
exists ev, nth_error tr i = Some ev /\
event_erasure ev ev'.