[STATEMENT]
lemma synPrefix: "\<exists>t1 u1. (s @ t) setinterleaves ((ta, u), A)\<longrightarrow>
                  t1\<le>ta\<and>u1\<le>u\<and>s setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
proof (induction "length ta + length u" arbitrary: s t ta u rule:nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ta u s t. \<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)) \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))

goal (1 subgoal):
 1. \<And>ta u s t. \<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)) \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
apply(cases ta)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = []\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. \<And>a list. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
using synPrefix1
[PROOF STATE]
proof (prove)
using this:
?ta = [] \<Longrightarrow> \<exists>t1 u1. ?s @ ?t setinterleaves ((?ta, ?u), ?A) \<longrightarrow> t1 \<le> ?ta \<and> u1 \<le> ?u \<and> ?s setinterleaves ((t1, u1), ?A)

goal (2 subgoals):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = []\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. \<And>a list. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
apply(cases u)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a list. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = []\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. \<And>a list aa lista. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
using sym synPrefix1
[PROOF STATE]
proof (prove)
using this:
setinterleaving (?s, ?X, ?t) = setinterleaving (?t, ?X, ?s)
?ta = [] \<Longrightarrow> \<exists>t1 u1. ?s @ ?t setinterleaves ((?ta, ?u), ?A) \<longrightarrow> t1 \<le> ?ta \<and> u1 \<le> ?u \<and> ?s setinterleaves ((t1, u1), ?A)

goal (2 subgoals):
 1. \<And>a list. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = []\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. \<And>a list aa lista. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
fix a list aa lista s t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. sa__ @ tb__ setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> sa__ setinterleaves ((t1, u1), A)
[PROOF STEP]
assume a: " \<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow>
                 (\<forall>xb xc. \<exists>t1 u1. (xb @ xc) setinterleaves ((x, xa), A) \<longrightarrow>
                 t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))"
     and b: "ta = a # list"
     and c: "u = aa # lista "
[PROOF STATE]
proof (state)
this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. sa__ @ tb__ setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> sa__ setinterleaves ((t1, u1), A)
[PROOF STEP]
thus " \<exists>t1 u1. (s @ t) setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and>
            s setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
[PROOF STEP]
have th0: "\<forall>xb xc. \<exists>t1 u1. (xb @ xc) setinterleaves ((list, lista), A) \<longrightarrow>
                                  t1 \<le> list \<and> u1 \<le> lista \<and> xb setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))

goal (1 subgoal):
 1. \<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((list, lista), A) \<longrightarrow> t1 \<le> list \<and> u1 \<le> lista \<and> xb setinterleaves ((t1, u1), A)
[PROOF STEP]
by (metis add_less_le_mono b c impossible_Cons le_cases not_le_imp_less)
[PROOF STATE]
proof (state)
this:
\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((list, lista), A) \<longrightarrow> t1 \<le> list \<and> u1 \<le> lista \<and> xb setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
obtain yb where thp: "a=aa\<and>a\<in> A\<and>(s@t) setinterleaves ((ta, u), A)\<and>length s >1 \<Longrightarrow>
       yb=tl s"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. (\<And>yb. (a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
with b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s
[PROOF STEP]
have thp4: "a=aa\<and>a\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>length s >1 \<Longrightarrow>s=a#yb"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> s = a # yb
[PROOF STEP]
by (auto, metis Cons_eq_append_conv list.sel(3) list.size(3) not_less0)
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> s = a # yb

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have thp5: "a=aa\<and>a\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>length s >1 \<Longrightarrow>
       (yb @ t) setinterleaves ((list, lista), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb @ t setinterleaves ((list, lista), A)
[PROOF STEP]
using b c thp4
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> s = a # yb

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb @ t setinterleaves ((list, lista), A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb @ t setinterleaves ((list, lista), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from th0
[PROOF STATE]
proof (chain)
picking this:
\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((list, lista), A) \<longrightarrow> t1 \<le> list \<and> u1 \<le> lista \<and> xb setinterleaves ((t1, u1), A)
[PROOF STEP]
obtain yt yu where thp1: "a = aa \<and> a \<in> A \<Longrightarrow> (s @ t) setinterleaves ((ta, u), A) \<and>
       1 < length s\<Longrightarrow>yb setinterleaves ((yt, yu), A)\<and>yt\<le>list\<and>yu\<le>lista"
[PROOF STATE]
proof (prove)
using this:
\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((list, lista), A) \<longrightarrow> t1 \<le> list \<and> u1 \<le> lista \<and> xb setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. (\<And>yt yu. (\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using thp5
[PROOF STATE]
proof (prove)
using this:
\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((list, lista), A) \<longrightarrow> t1 \<le> list \<and> u1 \<le> lista \<and> xb setinterleaves ((t1, u1), A)
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb @ t setinterleaves ((list, lista), A)

goal (1 subgoal):
 1. (\<And>yt yu. (\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from thp thp1
[PROOF STATE]
proof (chain)
picking this:
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista
[PROOF STEP]
have thp2: "a=aa\<and>a\<in> A\<Longrightarrow> (s @ t) setinterleaves ((ta, u), A)\<and> length s >1\<longrightarrow>
       s setinterleaves ((a#yt, aa#yu), A)"
[PROOF STATE]
proof (prove)
using this:
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<longrightarrow> s setinterleaves ((a # yt, aa # yu), A)
[PROOF STEP]
using thp4
[PROOF STATE]
proof (prove)
using this:
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> yb = tl s
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista
a = aa \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<Longrightarrow> s = a # yb

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<longrightarrow> s setinterleaves ((a # yt, aa # yu), A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<longrightarrow> s setinterleaves ((a # yt, aa # yu), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have thp3: "a=aa\<and>a\<in> A\<Longrightarrow> (s @ t) setinterleaves ((ta, u), A) \<and> length s=1\<longrightarrow>
       s setinterleaves (([a], [aa]), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 1 \<longrightarrow> s setinterleaves (([a], [aa]), A)
[PROOF STEP]
using append_eq_append_conv2[of s t "[aa]"]
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
(s @ t = [aa] @ ?ts) = (\<exists>us. s = [aa] @ us \<and> us @ t = ?ts \<or> s @ us = [aa] \<and> t = us @ ?ts)

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 1 \<longrightarrow> s setinterleaves (([a], [aa]), A)
[PROOF STEP]
by (auto, metis append_Nil2
         append_eq_append_conv length_Cons list.size(3))
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 1 \<longrightarrow> s setinterleaves (([a], [aa]), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have thp6: "a=aa\<and>a\<in> A\<Longrightarrow> (s @ t) setinterleaves ((ta, u), A) \<and> length s=0\<longrightarrow>
       s setinterleaves (([], []), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> s setinterleaves (([], []), A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from thp1
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista
[PROOF STEP]
have thp7: "a=aa\<and>a\<in> A\<Longrightarrow> (s @ t) setinterleaves ((ta, u), A)\<and> length s >1\<Longrightarrow>
       (a # yt)\<le>ta \<and>(aa # yu)\<le>u"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> yb setinterleaves ((yt, yu), A) \<and> yt \<le> list \<and> yu \<le> lista

goal (1 subgoal):
 1. \<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> a # yt \<le> ta \<and> aa # yu \<le> u
[PROOF STEP]
by (metis b c le_less less_cons)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> a # yt \<le> ta \<and> aa # yu \<le> u

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th: "a=aa\<and>a\<in> A\<Longrightarrow>\<exists>t1 u1. (s @ t) setinterleaves ((ta, u), A) \<longrightarrow>
       t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
assume dd:"a=aa \<and> a\<in> A"
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
consider (aa) "length s = 0" | (bb) "length s = 1" | (cc) "length s > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = 0 \<Longrightarrow> thesis; length s = 1 \<Longrightarrow> thesis; 1 < length s \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>length s = 0 \<Longrightarrow> ?thesis; length s = 1 \<Longrightarrow> ?thesis; 1 < length s \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length s = 0 \<Longrightarrow> ?thesis; length s = 1 \<Longrightarrow> ?thesis; 1 < length s \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length s = 0 \<Longrightarrow> ?thesis; length s = 1 \<Longrightarrow> ?thesis; 1 < length s \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. length s = 0 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. length s = 1 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 3. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
case aa
[PROOF STATE]
proof (state)
this:
length s = 0

goal (3 subgoals):
 1. length s = 0 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. length s = 1 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 3. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
with thp6
[PROOF STATE]
proof (chain)
picking this:
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> s setinterleaves (([], []), A)
length s = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> s setinterleaves (([], []), A)
length s = 0

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by (rule_tac x="[]" in exI, rule_tac x="[]" in exI, simp)
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (2 subgoals):
 1. length s = 1 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length s = 1 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
case bb
[PROOF STATE]
proof (state)
this:
length s = 1

goal (2 subgoals):
 1. length s = 1 \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
 2. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
with dd thp3 b c
[PROOF STATE]
proof (chain)
picking this:
a = aa \<and> a \<in> A
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 1 \<longrightarrow> s setinterleaves (([a], [aa]), A)
ta = a # list
u = aa # lista
length s = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = aa \<and> a \<in> A
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> length s = 1 \<longrightarrow> s setinterleaves (([a], [aa]), A)
ta = a # list
u = aa # lista
length s = 1

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by (rule_tac x="[a]" in exI, rule_tac x="[a]" in exI, auto simp add: le_list_def)
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
case cc
[PROOF STATE]
proof (state)
this:
1 < length s

goal (1 subgoal):
 1. 1 < length s \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
with dd thp2 thp7 b c
[PROOF STATE]
proof (chain)
picking this:
a = aa \<and> a \<in> A
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<longrightarrow> s setinterleaves ((a # yt, aa # yu), A)
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> a # yt \<le> ta \<and> aa # yu \<le> u
ta = a # list
u = aa # lista
1 < length s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = aa \<and> a \<in> A
a = aa \<and> a \<in> A \<Longrightarrow> s @ t setinterleaves ((ta, u), A) \<and> 1 < length s \<longrightarrow> s setinterleaves ((a # yt, aa # yu), A)
\<lbrakk>a = aa \<and> a \<in> A; s @ t setinterleaves ((ta, u), A) \<and> 1 < length s\<rbrakk> \<Longrightarrow> a # yt \<le> ta \<and> aa # yu \<le> u
ta = a # list
u = aa # lista
1 < length s

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by (rule_tac x="a#yt" in exI, rule_tac x="a#yu" in exI, auto simp add: le_list_def)
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th1pre: "a\<notin>A\<and>aa\<in> A\<and>(s @ t) setinterleaves ((ta, u), A) \<longrightarrow>
      tl (s @ t) setinterleaves ((list, u), A)\<and>hd (s@t)=a"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from a b c
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
[PROOF STEP]
obtain yt1 yu1 where th1pre1: "a\<notin>A\<and>aa\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>
      length s>0\<longrightarrow>yt1\<le>list\<and> yu1 \<le> u\<and> tl s setinterleaves ((yt1, yu1), A)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. (\<And>yt1 yu1. a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt1 \<le> list \<and> yu1 \<le> u \<and> tl s setinterleaves ((yt1, yu1), A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) length_Cons length_greater_0_conv lessI plus_nat.simps(2)
        th1pre tl_append2)
[PROOF STATE]
proof (state)
this:
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt1 \<le> list \<and> yu1 \<le> u \<and> tl s setinterleaves ((yt1, yu1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
[PROOF STEP]
have th1pre2: "yt1\<le>list\<longrightarrow>a#yt1\<le>ta"
[PROOF STATE]
proof (prove)
using this:
ta = a # list

goal (1 subgoal):
 1. yt1 \<le> list \<longrightarrow> a # yt1 \<le> ta
[PROOF STEP]
by (simp add: le_less less_cons)
[PROOF STATE]
proof (state)
this:
yt1 \<le> list \<longrightarrow> a # yt1 \<le> ta

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th1pre3: "a\<notin>A\<and>aa\<in> A\<and>tl s setinterleaves ((yt1, yu1), A)\<longrightarrow>
      (a#(tl s)) setinterleaves ((a#yt1, yu1), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<and> tl s setinterleaves ((yt1, yu1), A) \<longrightarrow> a # tl s setinterleaves ((a # yt1, yu1), A)
[PROOF STEP]
by (metis (mono_tags, lifting) addNonSync doubleReverse rev.simps(2) rev_rev_ident)
[PROOF STATE]
proof (state)
this:
a \<notin> A \<and> aa \<in> A \<and> tl s setinterleaves ((yt1, yu1), A) \<longrightarrow> a # tl s setinterleaves ((a # yt1, yu1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c th1pre1 th1pre2
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt1 \<le> list \<and> yu1 \<le> u \<and> tl s setinterleaves ((yt1, yu1), A)
yt1 \<le> list \<longrightarrow> a # yt1 \<le> ta
[PROOF STEP]
have th1pre4: "a\<notin>A\<and>aa\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>
      length s>0 \<longrightarrow>a#yt1\<le>ta\<and> yu1 \<le>u\<and> s setinterleaves ((a#yt1, yu1), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt1 \<le> list \<and> yu1 \<le> u \<and> tl s setinterleaves ((yt1, yu1), A)
yt1 \<le> list \<longrightarrow> a # yt1 \<le> ta

goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> a # yt1 \<le> ta \<and> yu1 \<le> u \<and> s setinterleaves ((a # yt1, yu1), A)
[PROOF STEP]
using th1pre th1pre3
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt1 \<le> list \<and> yu1 \<le> u \<and> tl s setinterleaves ((yt1, yu1), A)
yt1 \<le> list \<longrightarrow> a # yt1 \<le> ta
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
a \<notin> A \<and> aa \<in> A \<and> tl s setinterleaves ((yt1, yu1), A) \<longrightarrow> a # tl s setinterleaves ((a # yt1, yu1), A)

goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> a # yt1 \<le> ta \<and> yu1 \<le> u \<and> s setinterleaves ((a # yt1, yu1), A)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> a # yt1 \<le> ta \<and> yu1 \<le> u \<and> s setinterleaves ((a # yt1, yu1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th1pre5:"a\<notin>A\<and>aa\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>length s=0 \<longrightarrow>[]\<le>ta\<and> [] \<le>u\<and>
      s setinterleaves (([], []), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th1: "a\<notin>A\<and>aa\<in> A\<Longrightarrow>\<exists>t1 u1. (s @ t) setinterleaves ((ta, u), A) \<longrightarrow>
      t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
using th1pre4 th1pre5
[PROOF STATE]
proof (prove)
using this:
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> a # yt1 \<le> ta \<and> yu1 \<le> u \<and> s setinterleaves ((a # yt1, yu1), A)
a \<notin> A \<and> aa \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. a \<notin> A \<and> aa \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<notin> A \<and> aa \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th2pre: "aa\<notin>A\<and>a\<in> A\<and>(s @ t) setinterleaves ((ta, u), A) \<longrightarrow>
      tl (s @ t) setinterleaves ((ta, lista), A)\<and>hd (s@t)=aa"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from a b c
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
[PROOF STEP]
obtain yt2 yu2 where th2pre1: "aa\<notin>A\<and>a\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>
      length s>0\<longrightarrow>yt2\<le>ta\<and> yu2 \<le> lista\<and> (tl s) setinterleaves ((yt2, yu2), A)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. (\<And>yt2 yu2. aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> yu2 \<le> lista \<and> tl s setinterleaves ((yt2, yu2), A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) add_Suc_right length_Cons length_greater_0_conv lessI
        th2pre tl_append2)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> yu2 \<le> lista \<and> tl s setinterleaves ((yt2, yu2), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from c
[PROOF STATE]
proof (chain)
picking this:
u = aa # lista
[PROOF STEP]
have th2pre2: "yu2\<le>lista\<longrightarrow>aa#yu2\<le>u"
[PROOF STATE]
proof (prove)
using this:
u = aa # lista

goal (1 subgoal):
 1. yu2 \<le> lista \<longrightarrow> aa # yu2 \<le> u
[PROOF STEP]
by (simp add: le_less less_cons)
[PROOF STATE]
proof (state)
this:
yu2 \<le> lista \<longrightarrow> aa # yu2 \<le> u

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th2pre3: "aa\<notin>A\<and>a\<in> A\<and>tl s setinterleaves ((yt2, yu2), A)\<longrightarrow>
      (aa#(tl s)) setinterleaves ((yt2, aa#yu2), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<and> tl s setinterleaves ((yt2, yu2), A) \<longrightarrow> aa # tl s setinterleaves ((yt2, aa # yu2), A)
[PROOF STEP]
by (metis (mono_tags, lifting) addNonSync doubleReverse rev.simps(2) rev_rev_ident)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<in> A \<and> tl s setinterleaves ((yt2, yu2), A) \<longrightarrow> aa # tl s setinterleaves ((yt2, aa # yu2), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c th2pre1 th2pre2
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> yu2 \<le> lista \<and> tl s setinterleaves ((yt2, yu2), A)
yu2 \<le> lista \<longrightarrow> aa # yu2 \<le> u
[PROOF STEP]
have th2pre4: "aa\<notin>A\<and>a\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>
      length s>0 \<longrightarrow>yt2\<le>ta\<and> aa#yu2 \<le>u\<and> s setinterleaves ((yt2, aa#yu2), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> yu2 \<le> lista \<and> tl s setinterleaves ((yt2, yu2), A)
yu2 \<le> lista \<longrightarrow> aa # yu2 \<le> u

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> aa # yu2 \<le> u \<and> s setinterleaves ((yt2, aa # yu2), A)
[PROOF STEP]
using th2pre th2pre3
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> yu2 \<le> lista \<and> tl s setinterleaves ((yt2, yu2), A)
yu2 \<le> lista \<longrightarrow> aa # yu2 \<le> u
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa
aa \<notin> A \<and> a \<in> A \<and> tl s setinterleaves ((yt2, yu2), A) \<longrightarrow> aa # tl s setinterleaves ((yt2, aa # yu2), A)

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> aa # yu2 \<le> u \<and> s setinterleaves ((yt2, aa # yu2), A)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> aa # yu2 \<le> u \<and> s setinterleaves ((yt2, aa # yu2), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th2pre5:"aa\<notin>A\<and>a\<in> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>length s=0 \<longrightarrow>
      []\<le>ta\<and> [] \<le>u\<and> s setinterleaves (([], []), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th2: "aa\<notin>A\<and>a\<in> A\<Longrightarrow>\<exists>t1 u1. (s @ t) setinterleaves ((ta, u), A) \<longrightarrow>
      t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
using th2pre4 th2pre5
[PROOF STATE]
proof (prove)
using this:
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<longrightarrow> yt2 \<le> ta \<and> aa # yu2 \<le> u \<and> s setinterleaves ((yt2, aa # yu2), A)
aa \<notin> A \<and> a \<in> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th3pre: "aa\<notin>A\<and>a\<notin> A\<and>(s @ t) setinterleaves ((ta, u), A)\<longrightarrow>tl (s @ t)
      setinterleaves ((ta, lista), A)\<and>hd (s@t)=aa\<or>tl (s @ t)setinterleaves((list, u), A)\<and>hd(s@t)=a"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from a b c th3pre
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
[PROOF STEP]
obtain yt31 yu31 where th3pre1: "aa\<notin>A\<and>a\<notin> A\<and>
      (s @ t) setinterleaves ((ta, u), A)\<and>tl (s @ t) setinterleaves ((ta, lista), A)\<and>
      hd (s@t)=aa\<and>length s>0\<longrightarrow>yt31\<le>ta\<and> yu31 \<le> lista\<and> (tl s) setinterleaves ((yt31, yu31), A)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a

goal (1 subgoal):
 1. (\<And>yt31 yu31. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(metis(no_types,lifting)add_Suc_right length_Cons length_greater_0_conv lessI tl_append2)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from a b c th3pre
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
[PROOF STEP]
obtain yt32 yu32 where th3pre2: "aa\<notin>A\<and>a\<notin>A\<and>(s@t)setinterleaves ((ta, u),A)\<and>
      tl (s @ t) setinterleaves ((list, u), A)\<and>hd (s@t)=a\<and>length s>0\<longrightarrow>yt32\<le>list\<and> yu32 \<le>u\<and>
      (tl s) setinterleaves ((yt32, yu32), A)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a

goal (1 subgoal):
 1. (\<And>yt32 yu32. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis add_less_mono1 impossible_Cons le_neq_implies_less length_greater_0_conv
        nat_le_linear tl_append2)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th3pre3: "aa\<notin>A\<and>a\<notin> A\<and>tl s setinterleaves ((yt31, yu31), A)\<longrightarrow>
      (aa#(tl s)) setinterleaves ((yt31, aa#yu31), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> tl s setinterleaves ((yt31, yu31), A) \<longrightarrow> aa # tl s setinterleaves ((yt31, aa # yu31), A)
[PROOF STEP]
by (metis (mono_tags, lifting) addNonSync doubleReverse rev.simps(2) rev_rev_ident)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> tl s setinterleaves ((yt31, yu31), A) \<longrightarrow> aa # tl s setinterleaves ((yt31, aa # yu31), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c th3pre1 th3pre2
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A)
[PROOF STEP]
have th3pre4: "aa\<notin>A\<and>a\<notin> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>
      length s>0\<and>tl (s @ t) setinterleaves ((ta, lista), A)\<and>hd (s@t)=aa \<longrightarrow>yt31\<le>ta\<and> aa#yu31 \<le>u\<and>
      s setinterleaves ((yt31, aa#yu31), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A)

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<longrightarrow> yt31 \<le> ta \<and> aa # yu31 \<le> u \<and> s setinterleaves ((yt31, aa # yu31), A)
[PROOF STEP]
by (metis hd_append2 le_less length_greater_0_conv less_cons list.exhaust_sel th3pre3)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<longrightarrow> yt31 \<le> ta \<and> aa # yu31 \<le> u \<and> s setinterleaves ((yt31, aa # yu31), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
[PROOF STEP]
have th3pre5: "aa\<notin>A\<and>a\<notin> A\<and>tl s setinterleaves ((yt32, yu32), A)\<longrightarrow>
      (a#(tl s)) setinterleaves ((a#yt32, yu32), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> tl s setinterleaves ((yt32, yu32), A) \<longrightarrow> a # tl s setinterleaves ((a # yt32, yu32), A)
[PROOF STEP]
by (metis (mono_tags, lifting) addNonSync doubleReverse rev.simps(2) rev_rev_ident)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> tl s setinterleaves ((yt32, yu32), A) \<longrightarrow> a # tl s setinterleaves ((a # yt32, yu32), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
from b c th3pre1 th3pre2
[PROOF STATE]
proof (chain)
picking this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A)
[PROOF STEP]
have th3pre6: "aa\<notin>A\<and>a\<notin> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>
      length s>0\<and>tl (s @ t) setinterleaves ((list, u), A)\<and>hd (s@t)=a \<longrightarrow>a#yt32\<le>ta\<and> yu32 \<le>u\<and>
      s setinterleaves ((a#yt32, yu32), A)"
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A)

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<longrightarrow> a # yt32 \<le> ta \<and> yu32 \<le> u \<and> s setinterleaves ((a # yt32, yu32), A)
[PROOF STEP]
using th3pre th3pre5
[PROOF STATE]
proof (prove)
using this:
ta = a # list
u = aa # lista
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<and> 0 < length s \<longrightarrow> yt31 \<le> ta \<and> yu31 \<le> lista \<and> tl s setinterleaves ((yt31, yu31), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<and> 0 < length s \<longrightarrow> yt32 \<le> list \<and> yu32 \<le> u \<and> tl s setinterleaves ((yt32, yu32), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
aa \<notin> A \<and> a \<notin> A \<and> tl s setinterleaves ((yt32, yu32), A) \<longrightarrow> a # tl s setinterleaves ((a # yt32, yu32), A)

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<longrightarrow> a # yt32 \<le> ta \<and> yu32 \<le> u \<and> s setinterleaves ((a # yt32, yu32), A)
[PROOF STEP]
by (metis hd_append2 le_less length_greater_0_conv less_cons
        list.exhaust_sel)
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<longrightarrow> a # yt32 \<le> ta \<and> yu32 \<le> u \<and> s setinterleaves ((a # yt32, yu32), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th3pre7:"aa\<notin>A\<and>a\<notin> A\<and>(s @ t) setinterleaves ((ta, u), A)\<and>length s=0 \<longrightarrow>
      []\<le>ta\<and> [] \<le>u\<and> s setinterleaves (([], []), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
have th3: "aa\<notin>A\<and>a\<notin> A\<Longrightarrow>\<exists>t1 u1. (s @ t) setinterleaves ((ta, u), A) \<longrightarrow>
      t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
using th3pre th3pre4 th3pre6 th3pre7
[PROOF STATE]
proof (prove)
using this:
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<longrightarrow> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<or> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((ta, lista), A) \<and> hd (s @ t) = aa \<longrightarrow> yt31 \<le> ta \<and> aa # yu31 \<le> u \<and> s setinterleaves ((yt31, aa # yu31), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> 0 < length s \<and> tl (s @ t) setinterleaves ((list, u), A) \<and> hd (s @ t) = a \<longrightarrow> a # yt32 \<le> ta \<and> yu32 \<le> u \<and> s setinterleaves ((a # yt32, yu32), A)
aa \<notin> A \<and> a \<notin> A \<and> s @ t setinterleaves ((ta, u), A) \<and> length s = 0 \<longrightarrow> [] \<le> ta \<and> [] \<le> u \<and> s setinterleaves (([], []), A)

goal (1 subgoal):
 1. aa \<notin> A \<and> a \<notin> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
aa \<notin> A \<and> a \<notin> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. \<lbrakk>\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A)); ta = a # list; u = aa # lista\<rbrakk> \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
with a b c th th1 th2
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
a \<notin> A \<and> aa \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
aa \<notin> A \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
aa \<notin> A \<and> a \<notin> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length ta + length u. \<forall>x xa. m = length x + length xa \<longrightarrow> (\<forall>xb xc. \<exists>t1 u1. xb @ xc setinterleaves ((x, xa), A) \<longrightarrow> t1 \<le> x \<and> u1 \<le> xa \<and> xb setinterleaves ((t1, u1), A))
ta = a # list
u = aa # lista
a = aa \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
a \<notin> A \<and> aa \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
aa \<notin> A \<and> a \<in> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
aa \<notin> A \<and> a \<notin> A \<Longrightarrow> \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal (1 subgoal):
 1. \<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>t1 u1. s @ t setinterleaves ((ta, u), A) \<longrightarrow> t1 \<le> ta \<and> u1 \<le> u \<and> s setinterleaves ((t1, u1), A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma acyclic_star_below_complement:
  "acyclic w \<longleftrightarrow> w\<^sup>T\<^sup>\<star> \<le> -w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic w = (w\<^sup>T\<^sup>\<star> \<le> - w)
[PROOF STEP]
by (simp add: conv_star_commute schroeder_4_p)


[STATEMENT]
lemma prv_eqv_eqv_neg_prv_fls:
  "\<phi> \<in> fmla \<Longrightarrow> \<chi> \<in> fmla \<Longrightarrow>
prv (eqv \<phi> \<chi>) \<Longrightarrow> prv (eqv \<phi> (neg \<chi>))\<Longrightarrow> prv fls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<phi> \<in> fmla; \<chi> \<in> fmla; prv (eqv \<phi> \<chi>); prv (eqv \<phi> (neg \<chi>))\<rbrakk> \<Longrightarrow> prv fls
[PROOF STEP]
by (meson neg prv_eqv_neg_prv_fls prv_eqv_sym prv_eqv_trans)