Definition oboxopt Delta ret P :=
match ret with
| Some id => obox Delta id P
| _ => P
end.
Definition odiaopt Delta ret P :=
match ret with
| Some id => odia Delta id P
| _ => P
end.
Definition temp_guard_opt (Delta : tycontext) (i: option ident): Prop :=
match i with
| Some i => temp_guard Delta i
| None => True
end.

Lemma oboxopt_left2: forall Delta i P Q,
temp_guard_opt Delta i ->
local (tc_environ Delta) && P |-- Q ->
local (tc_environ Delta) && oboxopt Delta i P |-- oboxopt Delta i Q.