subst_subst_heap_graph_aux_def: shows "subst_subst_heap_graph_aux \<equiv> lfp (\<lambda>p x1 x2. (\<exists>subst_aux subst_heap_aux x y z. x1 = Inl (Var x, y, z) \<and> x2 = Inl (Var x[y::v=z])) \<or> (\<exists>subst_aux subst_heap_aux e v y z. x1 = Inl (App e v, y, z) \<and> x2 = Inl (App (projl (case Inl (e, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) v[y::v=z]) \<and> p (Inl (e, y, z)) (case Inl (e, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<or> (\<exists>subst_aux subst_heap_aux \<Gamma> y z body. x1 = Inl (Let \<Gamma> body, y, z) \<and> x2 = Inl (Let (projr (case Inr (\<Gamma>, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) (projl (case Inl (body, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x))) \<and> atom ` domA \<Gamma> \<sharp>* (y, z) \<and> p (Inr (\<Gamma>, y, z)) (case Inr (\<Gamma>, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x) \<and> p (Inl (body, y, z)) (case Inl (body, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<or> (\<exists>subst_aux subst_heap_aux x y z e. x1 = Inl (Lam [x]. e, y, z) \<and> x2 = Inl (Lam [x]. projl (case Inl (e, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<and> atom x \<sharp> (y, z) \<and> p (Inl (e, y, z)) (case Inl (e, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<or> (\<exists>subst_aux subst_heap_aux b y z. x1 = Inl (Bool b, y, z) \<and> x2 = Inl (Bool b)) \<or> (\<exists>subst_aux subst_heap_aux scrut e1 e2 y z. x1 = Inl (scrut ? e1 : e2, y, z) \<and> x2 = Inl (projl (case Inl (scrut, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x) ? projl (case Inl (e1, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x) : projl (case Inl (e2, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<and> p (Inl (scrut, y, z)) (case Inl (scrut, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x) \<and> p (Inl (e1, y, z)) (case Inl (e1, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x) \<and> p (Inl (e2, y, z)) (case Inl (e2, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<or> (\<exists>subst_aux subst_heap_aux y z. x1 = Inr ([], y, z) \<and> x2 = Inr []) \<or> (\<exists>subst_aux subst_heap_aux v e \<Gamma> y z. x1 = Inr ((v, e) # \<Gamma>, y, z) \<and> x2 = Inr ((v, projl (case Inl (e, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) # projr (case Inr (\<Gamma>, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)) \<and> p (Inl (e, y, z)) (case Inl (e, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x) \<and> p (Inr (\<Gamma>, y, z)) (case Inr (\<Gamma>, y, z) of Inl x \<Rightarrow> (Inl \<circ> subst_aux) x | Inr x \<Rightarrow> (Inr \<circ> subst_heap_aux) x)))"