(* Lemma join_te_denote : forall te1 te2 id b t1, (join_te te1 te2) ! id = Some (t1, b) -> (exists b1, te1 ! id = Some (t1, b || b1)) /\ match te2 ! id with Some (t2,b2) => b = b && b2 | None => True end.  Lemma typecheck_environ_join1: forall rho Delta1 Delta2, var_types Delta1 = var_types Delta2 -> glob_types Delta1 = glob_types Delta2 ->  typecheck_environ Delta1 rho -> typecheck_environ (join_tycon Delta1 Delta2) rho. *)
Definition tycontext_evolve (Delta Delta' : tycontext) :=
(forall id, match (temp_types Delta) ! id, (temp_types Delta') ! id with
| Some t, Some t' => t=t'
| None, None => True
| _, _ => False
end)
/\ (forall id, (var_types Delta) ! id = (var_types Delta') ! id)
/\ ret_type Delta = ret_type Delta'
/\ (forall id, (glob_types Delta) ! id = (glob_types Delta') ! id)
/\ (forall id, (glob_specs Delta) ! id = (glob_specs Delta') ! id)
/\ (forall id, (annotations Delta) ! id = (annotations Delta') ! id).
(*(temp_types Delta) ! id =  Some (Tpointer t a, init) ->*) (*modified for init changes*)

Lemma typecheck_environ_put_te' : forall ge te ve Delta id v ,
typecheck_environ  Delta (mkEnviron ge ve te) ->
(forall t , ((temp_types Delta) ! id = Some t -> tc_val' t v)) ->
typecheck_environ Delta (mkEnviron ge ve (Map.set id v te)).