(****************************************************)
(********* Getter lemmas for local state ************)
(****************************************************)

(* Specifications: *)
Lemma cs_in_nodes n : n \in cs -> n \in nodes.
Definition getSt n d (C : CalCoh d) : cstate :=
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 : CalCoh 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.
(************** TODO: Refactor this!!! **************)
Lemma cohSt n d (C : QCoh d) s:
find st (getLocal n d) = Some s ->
dyn_tp s = qstate.