Definition getSt n d (C : QCoh d) : qstate :=
match find st (getLocal n d) as f return _ = f -> _ with
Some v => fun epf => icast (sym_eq (cohSt C epf)) (dyn_val v)
| _ => fun epf => ([::], [::])
end (erefl _).

(* Specifications: *)
Lemma getStK n d (C : QCoh d)  s :
getLocal n d = st :-> s -> getSt n C = s.
Lemma getStE n i j C C' (pf : n \in nodes) :
getLocal n j = getLocal n i ->
@getSt n j C' = @getSt n i C.
Lemma getStE' n i j C C' (pf : n \in nodes) :
@getSt n j C' = @getSt n i C ->
getLocal n j = getLocal n i.