Definition msubst_extract_local (Delta: tycontext) (T1: PTree.t val) (T2: PTree.t (type * val)) (GV: option globals) (x: localdef): Prop :=
match x with
| temp i u =>
match T1 ! i with
| Some v => u = v
| None => False
end
| lvar i ti u =>
match T2 ! i with
| Some (tj, v) =>
if eqb_type ti tj
then u = v
else False
| _ => False
end
| gvars gv =>
match GV with
| Some gv0 => gv0 = gv
| _ => False
end
end.
Definition msubst_extract_locals (Delta: tycontext) (T1: PTree.t val) (T2: PTree.t (type * val)) (GV: option globals) := VST_floyd_map (msubst_extract_local Delta T1 T2 GV).

Lemma go_lower_localdef_canon_tc_LR {cs: compspecs} : forall Delta Ppre Qpre Rpre e lr T1 T2 GV,
local2ptree Qpre = (T1, T2, nil, GV) ->
local (tc_environ Delta) && PROPx Ppre (LOCALx Qpre (SEPx Rpre)) && `(msubst_tc_LR Delta T1 T2 GV e lr) |-- tc_LR Delta e lr.