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 _).

Lemma getStK n d (C : QCoh d)  s :
getLocal n d = st :-> s -> getSt n C = s.