theory Deterministic_AI

lemma next_not_child_eq_next_sib_None:
  notes split_paired_All[simp del] split_paired_Ex[simp del]
  shows "\<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a;
           a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m\<rbrakk>
    \<Longrightarrow> next_sib a t m = None" apply(case_tac "next_not_child p t m") apply(drule(1) next_not_child_NoneD) apply(fastforce) apply(case_tac "next_not_child q t m") apply(simp) apply(subgoal_tac "aa=aaa") prefer 2 apply(simp) apply(drule(2) next_not_childD)+ apply(erule_tac P="next_sib p t m = Some aa" in disjE) apply(erule_tac P="next_sib q t m = Some aaa" in disjE) apply(simp) apply(drule(2) next_sib_inj) apply(simp) apply(erule disjE) apply(drule_tac a=q and c=q in descendants_trans) apply(simp) apply(simp add: no_mloop_descendants) apply(simp add: no_mloop_descendants) apply(elim exE conjE) apply(drule_tac a=p and b=qa in next_sib_inj) apply(simp) apply(simp) apply(simp) apply(erule disjE) apply(drule_tac a=qa and c=q in descendants_trans, simp) apply(drule_tac a=qa and c=qa in descendants_trans, simp) apply(simp add: no_mloop_descendants) apply(simp) apply(drule_tac a=a and c=a in descendants_trans, simp) apply(simp add: no_mloop_descendants) apply(erule_tac P="next_sib q t m = Some aaa" in disjE) apply(elim exE conjE, simp) apply(drule(2) next_sib_inj, fastforce) apply(elim exE conjE, simp) apply(drule(2) next_sib_inj, simp) apply(erule_tac x=a in allE)+ apply(erule disjE) apply(simp) apply(erule impE) apply(rule_tac b=q in descendants_trans, simp+) done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; (\<forall>q. p \<in> descendants_of q m \<longrightarrow> next_sib q t m = None) \<and> next_sib p t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa; aa = aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa\<rbrakk> \<Longrightarrow> aa = aaa proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa\<rbrakk> \<Longrightarrow> aa = aaa
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa; aa = aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; next_not_child p t m = Some aa; next_not_child q t m = Some aaa; aa = aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa \<or> next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = Some aa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = Some aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aaa; next_sib q t m = Some aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa. \<lbrakk>q \<in> descendants_of a m \<or> q = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (4 subgoals):
 1. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q \<in> descendants_of a m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 4. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (5 subgoals):
 1. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q\<rbrakk> \<Longrightarrow> a \<in> descendants_of q m
 2. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q \<in> descendants_of q m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 4. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 5. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (4 subgoals):
 1. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q \<in> descendants_of q m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 4. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa. \<lbrakk>a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; p = q; q = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = Some aa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (4 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None\<rbrakk> \<Longrightarrow> next_sib qa t m = Some aa
 2. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None\<rbrakk> \<Longrightarrow> valid_list_2 t m
 3. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 4. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None\<rbrakk> \<Longrightarrow> valid_list_2 t m
 2. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; qa \<in> descendants_of a m \<or> qa = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa \<in> descendants_of a m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa \<in> descendants_of q m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa \<in> descendants_of qa m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child qa t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib qa t m = Some aaa; q \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = qa; qa = a\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child a t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib a t m = Some aaa; q \<in> descendants_of a m; \<forall>q'. q' \<in> descendants_of a m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = a; qa = a\<rbrakk> \<Longrightarrow> False
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child a t m = next_not_child q t m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = None; next_sib a t m = Some aaa; q \<in> descendants_of a m; \<forall>q'. q' \<in> descendants_of a m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; p = a; qa = a; a \<in> descendants_of a m\<rbrakk> \<Longrightarrow> False
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa \<or> next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib q t m = Some aaa\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib q t m = Some aaa; next_sib p t m = None; next_sib qa t m = Some aaa; p \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None \<and> (\<exists>q. next_sib q t m = Some aa \<and> p \<in> descendants_of q m \<and> (\<forall>q'. q' \<in> descendants_of q m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None)); next_sib q t m = None \<and> (\<exists>qa. next_sib qa t m = Some aaa \<and> q \<in> descendants_of qa m \<and> (\<forall>q'. q' \<in> descendants_of qa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None))\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qa t m = Some aaa; next_sib qaa t m = Some aaa; p \<in> descendants_of qa m; \<forall>q'. q' \<in> descendants_of qa m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; q \<in> descendants_of qaa m; \<forall>q'. q' \<in> descendants_of qaa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; \<forall>q'. q' \<in> descendants_of qaa m \<and> p \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; q \<in> descendants_of qaa m; \<forall>q'. q' \<in> descendants_of qaa m \<and> q \<in> descendants_of q' m \<longrightarrow> next_sib q' t m = None; qa = qaa\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (1 subgoal):
 1. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; p \<in> descendants_of a m \<or> p = a; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; a \<in> descendants_of qaa m \<and> p \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; a \<in> descendants_of qaa m \<and> q \<in> descendants_of a m \<longrightarrow> next_sib a t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; a \<in> descendants_of qaa m \<and> p \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; a \<in> descendants_of qaa m \<and> q \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; p \<in> descendants_of a m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; a \<in> descendants_of qaa m \<and> p \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; a \<in> descendants_of qaa m \<and> q \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; p = a\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (2 subgoals):
 1. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; a \<in> descendants_of qaa m \<longrightarrow> next_sib a t m = None; p \<in> descendants_of a m\<rbrakk> \<Longrightarrow> next_sib a t m = None
 2. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; a \<in> descendants_of qaa m \<and> p \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; a \<in> descendants_of qaa m \<and> q \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; p = a\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal (3 subgoals):
 1. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; p \<in> descendants_of a m\<rbrakk> \<Longrightarrow> a \<in> descendants_of qaa m
 2. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; p \<in> descendants_of a m; next_sib a t m = None\<rbrakk> \<Longrightarrow> next_sib a t m = None
 3. \<And>aa aaa qa qaa. \<lbrakk>next_not_child p t m = next_not_child q t m; a \<in> descendants_of q m; valid_list_2 t m; finite_depth m; no_mloop m; aa = aaa; next_sib p t m = None; next_sib q t m = None; next_sib qaa t m = Some aaa; p \<in> descendants_of qaa m; q \<in> descendants_of qaa m; qa = qaa; a \<in> descendants_of qaa m \<and> p \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; a \<in> descendants_of qaa m \<and> q \<in> descendants_of a m \<longrightarrow> next_sib a t m = None; p = a\<rbrakk> \<Longrightarrow> next_sib a t m = None proof (prove)
goal:
No subgoals!