subst_term_graph_aux_def: shows "subst_term_graph_aux \<equiv> lfp (\<lambda>p x1 x2. (\<exists>subst_term_aux t' x. x1 = (Unit, t', x) \<and> x2 = Unit) \<or> (\<exists>subst_term_aux y t' x. x1 = (Var y, t', x) \<and> x2 = (if x = y then t' else Var y)) \<or> (\<exists>subst_term_aux y x t' t. x1 = (Lam y t, t', x) \<and> x2 = Lam y (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> atom y \<sharp> (x, t') \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux y x t' t. x1 = (Rec y t, t', x) \<and> x2 = Rec y (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> atom y \<sharp> (x, t') \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Inj1 t, t', x) \<and> x2 = Inj1 (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Inj2 t, t', x) \<and> x2 = Inj2 (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t1 t2 t' x. x1 = (Syntax.Pair t1 t2, t', x) \<and> x2 = Syntax.Pair (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x)) \<and> p (t1, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) \<and> p (t2, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Roll t, t', x) \<and> x2 = Roll (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux y x t' t1 t2. x1 = (Syntax.Let t1 y t2, t', x) \<and> x2 = Syntax.Let (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) y (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x)) \<and> atom y \<sharp> (x, t') \<and> p (t1, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) \<and> p (t2, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x))) \<or> (\<exists>subst_term_aux t1 t2 t' x. x1 = (App t1 t2, t', x) \<and> x2 = App (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x)) \<and> p (t1, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) \<and> p (t2, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x))) \<or> (\<exists>subst_term_aux t1 t2 t3 t' x. x1 = (Case t1 t2 t3, t', x) \<and> x2 = Case (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x)) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t3, t', x)) \<and> p (t1, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t1, t', x)) \<and> p (t2, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t2, t', x)) \<and> p (t3, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t3, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Prj1 t, t', x) \<and> x2 = Prj1 (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Prj2 t, t', x) \<and> x2 = Prj2 (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Unroll t, t', x) \<and> x2 = Unroll (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Auth t, t', x) \<and> x2 = Auth (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux t t' x. x1 = (Unauth t, t', x) \<and> x2 = Unauth (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))) \<or> (\<exists>subst_term_aux h t' x. x1 = (Hash h, t', x) \<and> x2 = Hash h) \<or> (\<exists>subst_term_aux h t t' x. x1 = (Hashed h t, t', x) \<and> x2 = Hashed h (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x)) \<and> p (t, t', x) (((\<lambda>uu_. uu_) \<circ> subst_term_aux) (t, t', x))))"