(* pass output context of f1 as input of f2 *)
Canonical Structure
union_struct i j k t1 t2 (f1 : ast i j t1) (f2 : ast j k t2) :=
Ast i k _ (union_tag (f1 :+ f2)) (union_pf f1 f2).

(* Specifications: *)
Lemma empty_pf i : invariant i i [::] (empty_tag empty).
Canonical Structure
pts_struct A hs xs1 xs2 x (d : A)
(xs : xfind xs1 xs2 x) :=
Ast (Context hs xs1) (Context hs xs2)
[:: Pts x (dyn d)]
(pts_tag (xuntag xs :-> d))
(pts_pf hs _ xs).
Lemma var_pf hs1 hs2 xs n (f : xfind hs1 hs2 n) :
invariant (Context hs1 xs) (Context hs2 xs) [:: Var n] (var_tag (xuntag f)).