[STATEMENT]
lemma is_path_undir_split_distinct:
    assumes "is_path_undir G v p v'"
    assumes "(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p"
    shows "(\<exists>p' p'' u u'.
            is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and>
            length p' < length p \<and> length p'' < length p \<and>
            (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and>
            (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and>
            (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p

goal (1 subgoal):
 1. \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
proof (induction n == "length p" arbitrary: p v v' rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
[PROOF STEP]
obtain u u' where "(u, w, u') \<in> set p" and u: "u \<in> {a, b} \<and> u' \<in> {a, b}"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p

goal (1 subgoal):
 1. (\<And>u u'. \<lbrakk>(u, w, u') \<in> set p; u \<in> {a, b} \<and> u' \<in> {a, b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(u, w, u') \<in> set p
u \<in> {a, b} \<and> u' \<in> {a, b}

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
with split_list
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set ?xs \<Longrightarrow> \<exists>ys zs. ?xs = ys @ ?x # zs
(u, w, u') \<in> set p
u \<in> {a, b} \<and> u' \<in> {a, b}
[PROOF STEP]
obtain p' p''
      where p: "p = p' @ (u, w, u') # p''"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set ?xs \<Longrightarrow> \<exists>ys zs. ?xs = ys @ ?x # zs
(u, w, u') \<in> set p
u \<in> {a, b} \<and> u' \<in> {a, b}

goal (1 subgoal):
 1. (\<And>p' p''. p = p' @ (u, w, u') # p'' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
p = p' @ (u, w, u') # p''

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = p' @ (u, w, u') # p''
[PROOF STEP]
have len_p': "length p' < length p" and len_p'': "length p'' < length p"
[PROOF STATE]
proof (prove)
using this:
p = p' @ (u, w, u') # p''

goal (1 subgoal):
 1. length p' < length p &&& length p'' < length p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length p' < length p
length p'' < length p

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
from 1 p
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
p = p' @ (u, w, u') # p''
[PROOF STEP]
have p': "is_path_undir G v p' u" and p'': "is_path_undir G u' p'' v'"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
p = p' @ (u, w, u') # p''

goal (1 subgoal):
 1. is_path_undir G v p' u &&& is_path_undir G u' p'' v'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_path_undir G v p' u
is_path_undir G u' p'' v'

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
from 1 len_p' p'
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
length p' < length p
is_path_undir G v p' u
[PROOF STEP]
have "(a, w, b) \<in> set p' \<or> (b, w, a) \<in> set p' \<longrightarrow> (\<exists>p'2 u2.
            is_path_undir G v p'2 u2 \<and>
            length p'2 < length p' \<and>
            u2 \<in> {a, b} \<and>
            (a, w, b) \<notin> set p'2 \<and> (b, w, a) \<notin> set p'2)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
length p' < length p
is_path_undir G v p' u

goal (1 subgoal):
 1. (a, w, b) \<in> set p' \<or> (b, w, a) \<in> set p' \<longrightarrow> (\<exists>p'2 u2. is_path_undir G v p'2 u2 \<and> length p'2 < length p' \<and> u2 \<in> {a, b} \<and> (a, w, b) \<notin> set p'2 \<and> (b, w, a) \<notin> set p'2)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(a, w, b) \<in> set p' \<or> (b, w, a) \<in> set p' \<longrightarrow> (\<exists>p'2 u2. is_path_undir G v p'2 u2 \<and> length p'2 < length p' \<and> u2 \<in> {a, b} \<and> (a, w, b) \<notin> set p'2 \<and> (b, w, a) \<notin> set p'2)

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
with len_p' p' u
[PROOF STATE]
proof (chain)
picking this:
length p' < length p
is_path_undir G v p' u
u \<in> {a, b} \<and> u' \<in> {a, b}
(a, w, b) \<in> set p' \<or> (b, w, a) \<in> set p' \<longrightarrow> (\<exists>p'2 u2. is_path_undir G v p'2 u2 \<and> length p'2 < length p' \<and> u2 \<in> {a, b} \<and> (a, w, b) \<notin> set p'2 \<and> (b, w, a) \<notin> set p'2)
[PROOF STEP]
have p': "\<exists>p' u. is_path_undir G v p' u \<and> length p' < length p \<and>
      u \<in> {a,b} \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p'"
[PROOF STATE]
proof (prove)
using this:
length p' < length p
is_path_undir G v p' u
u \<in> {a, b} \<and> u' \<in> {a, b}
(a, w, b) \<in> set p' \<or> (b, w, a) \<in> set p' \<longrightarrow> (\<exists>p'2 u2. is_path_undir G v p'2 u2 \<and> length p'2 < length p' \<and> u2 \<in> {a, b} \<and> (a, w, b) \<notin> set p'2 \<and> (b, w, a) \<notin> set p'2)

goal (1 subgoal):
 1. \<exists>p' u. is_path_undir G v p' u \<and> length p' < length p \<and> u \<in> {a, b} \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>p' u. is_path_undir G v p' u \<and> length p' < length p \<and> u \<in> {a, b} \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p'

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
from 1 len_p'' p''
[PROOF STATE]
proof (chain)
picking this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
length p'' < length p
is_path_undir G u' p'' v'
[PROOF STEP]
have "(a, w, b) \<in> set p'' \<or> (b, w, a) \<in> set p'' \<longrightarrow> (\<exists>p''2 u'2.
            is_path_undir G u'2 p''2 v' \<and>
            length p''2 < length p'' \<and>
            u'2 \<in> {a, b} \<and>
            (a, w, b) \<notin> set p''2 \<and> (b, w, a) \<notin> set p''2)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''))
is_path_undir G v p v'
(a, w, b) \<in> set p \<or> (b, w, a) \<in> set p
length p'' < length p
is_path_undir G u' p'' v'

goal (1 subgoal):
 1. (a, w, b) \<in> set p'' \<or> (b, w, a) \<in> set p'' \<longrightarrow> (\<exists>p''2 u'2. is_path_undir G u'2 p''2 v' \<and> length p''2 < length p'' \<and> u'2 \<in> {a, b} \<and> (a, w, b) \<notin> set p''2 \<and> (b, w, a) \<notin> set p''2)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(a, w, b) \<in> set p'' \<or> (b, w, a) \<in> set p'' \<longrightarrow> (\<exists>p''2 u'2. is_path_undir G u'2 p''2 v' \<and> length p''2 < length p'' \<and> u'2 \<in> {a, b} \<and> (a, w, b) \<notin> set p''2 \<and> (b, w, a) \<notin> set p''2)

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
with len_p'' p'' u
[PROOF STATE]
proof (chain)
picking this:
length p'' < length p
is_path_undir G u' p'' v'
u \<in> {a, b} \<and> u' \<in> {a, b}
(a, w, b) \<in> set p'' \<or> (b, w, a) \<in> set p'' \<longrightarrow> (\<exists>p''2 u'2. is_path_undir G u'2 p''2 v' \<and> length p''2 < length p'' \<and> u'2 \<in> {a, b} \<and> (a, w, b) \<notin> set p''2 \<and> (b, w, a) \<notin> set p''2)
[PROOF STEP]
have "\<exists>p'' u'. is_path_undir G u' p'' v'\<and> length p'' < length p \<and>
      u' \<in> {a,b} \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''"
[PROOF STATE]
proof (prove)
using this:
length p'' < length p
is_path_undir G u' p'' v'
u \<in> {a, b} \<and> u' \<in> {a, b}
(a, w, b) \<in> set p'' \<or> (b, w, a) \<in> set p'' \<longrightarrow> (\<exists>p''2 u'2. is_path_undir G u'2 p''2 v' \<and> length p''2 < length p'' \<and> u'2 \<in> {a, b} \<and> (a, w, b) \<notin> set p''2 \<and> (b, w, a) \<notin> set p''2)

goal (1 subgoal):
 1. \<exists>p'' u'. is_path_undir G u' p'' v' \<and> length p'' < length p \<and> u' \<in> {a, b} \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>p'' u'. is_path_undir G u' p'' v' \<and> length p'' < length p \<and> u' \<in> {a, b} \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''

goal (1 subgoal):
 1. \<And>p v v'. \<lbrakk>\<forall>m<length p. \<forall>x. m = length x \<longrightarrow> (\<forall>xa xb. is_path_undir G xa x xb \<longrightarrow> (a, w, b) \<in> set x \<or> (b, w, a) \<in> set x \<longrightarrow> (\<exists>p' p'' u u'. is_path_undir G xa p' u \<and> is_path_undir G u' p'' xb \<and> length p' < length x \<and> length p'' < length x \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p'')); is_path_undir G v p v'; (a, w, b) \<in> set p \<or> (b, w, a) \<in> set p\<rbrakk> \<Longrightarrow> \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
with p'
[PROOF STATE]
proof (chain)
picking this:
\<exists>p' u. is_path_undir G v p' u \<and> length p' < length p \<and> u \<in> {a, b} \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p'
\<exists>p'' u'. is_path_undir G u' p'' v' \<and> length p'' < length p \<and> u' \<in> {a, b} \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>p' u. is_path_undir G v p' u \<and> length p' < length p \<and> u \<in> {a, b} \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p'
\<exists>p'' u'. is_path_undir G u' p'' v' \<and> length p'' < length p \<and> u' \<in> {a, b} \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''

goal (1 subgoal):
 1. \<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>p' p'' u u'. is_path_undir G v p' u \<and> is_path_undir G u' p'' v' \<and> length p' < length p \<and> length p'' < length p \<and> (u \<in> {a, b} \<and> u' \<in> {a, b}) \<and> (a, w, b) \<notin> set p' \<and> (b, w, a) \<notin> set p' \<and> (a, w, b) \<notin> set p'' \<and> (b, w, a) \<notin> set p''

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_multisets_covering_set:
  assumes "finite A"
  assumes "card A \<le> k"
  shows "card {M. set_mset M = A \<and> size M = k} = (k - 1) choose (k - card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
have "{M. set_mset M = A \<and> size M = k} = (\<lambda>M. M + mset_set A) `
    {M. set_mset M \<subseteq> A \<and> size M = k - card A}" (is "?S = ?f ` ?T")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. set_mset M = A \<and> size M = k} = (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {M. set_mset M = A \<and> size M = k} \<subseteq> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
 2. (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A} \<subseteq> {M. set_mset M = A \<and> size M = k}
[PROOF STEP]
show "?S \<subseteq> ?f ` ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {M. set_mset M = A \<and> size M = k} \<subseteq> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. set_mset M = A \<and> size M = k} \<Longrightarrow> x \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
fix M
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {M. set_mset M = A \<and> size M = k} \<Longrightarrow> x \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
assume "M \<in> ?S"
[PROOF STATE]
proof (state)
this:
M \<in> {M. set_mset M = A \<and> size M = k}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. set_mset M = A \<and> size M = k} \<Longrightarrow> x \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
M \<in> {M. set_mset M = A \<and> size M = k}
[PROOF STEP]
have "M = M - mset_set A + mset_set A"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M. set_mset M = A \<and> size M = k}

goal (1 subgoal):
 1. M = M - mset_set A + mset_set A
[PROOF STEP]
by (auto simp add: mset_set_set_mset_subseteq subset_mset.diff_add)
[PROOF STATE]
proof (state)
this:
M = M - mset_set A + mset_set A

goal (1 subgoal):
 1. \<And>x. x \<in> {M. set_mset M = A \<and> size M = k} \<Longrightarrow> x \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
M = M - mset_set A + mset_set A

goal (1 subgoal):
 1. \<And>x. x \<in> {M. set_mset M = A \<and> size M = k} \<Longrightarrow> x \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
from \<open>M \<in> ?S\<close>
[PROOF STATE]
proof (chain)
picking this:
M \<in> {M. set_mset M = A \<and> size M = k}
[PROOF STEP]
have "M - mset_set A \<in> ?T"
[PROOF STATE]
proof (prove)
using this:
M \<in> {M. set_mset M = A \<and> size M = k}

goal (1 subgoal):
 1. M - mset_set A \<in> {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
by (auto simp add: mset_set_set_mset_subseteq size_Diff_submset size_mset_set_eq_card in_diffD)
[PROOF STATE]
proof (state)
this:
M - mset_set A \<in> {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. \<And>x. x \<in> {M. set_mset M = A \<and> size M = k} \<Longrightarrow> x \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
M = M - mset_set A + mset_set A
M - mset_set A \<in> {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
show "M \<in> ?f ` ?T"
[PROOF STATE]
proof (prove)
using this:
M = M - mset_set A + mset_set A
M - mset_set A \<in> {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. M \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<in> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. set_mset M = A \<and> size M = k} \<subseteq> (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A} \<subseteq> {M. set_mset M = A \<and> size M = k}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A} \<subseteq> {M. set_mset M = A \<and> size M = k}
[PROOF STEP]
from \<open>finite A\<close> \<open>card A \<le> k\<close>
[PROOF STATE]
proof (chain)
picking this:
finite A
card A \<le> k
[PROOF STEP]
show "?f ` ?T \<subseteq> ?S"
[PROOF STATE]
proof (prove)
using this:
finite A
card A \<le> k

goal (1 subgoal):
 1. (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A} \<subseteq> {M. set_mset M = A \<and> size M = k}
[PROOF STEP]
by (auto simp add: size_mset_set_eq_card)+
[PROOF STATE]
proof (state)
this:
(\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A} \<subseteq> {M. set_mset M = A \<and> size M = k}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{M. set_mset M = A \<and> size M = k} = (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{M. set_mset M = A \<and> size M = k} = (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
have "inj_on ?f ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>M. M + mset_set A) {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
by (rule inj_onI) auto
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>M. M + mset_set A) {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{M. set_mset M = A \<and> size M = k} = (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
inj_on (\<lambda>M. M + mset_set A) {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
have "card ?S = card ?T"
[PROOF STATE]
proof (prove)
using this:
{M. set_mset M = A \<and> size M = k} = (\<lambda>M. M + mset_set A) ` {M. set_mset M \<subseteq> A \<and> size M = k - card A}
inj_on (\<lambda>M. M + mset_set A) {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = card {M. set_mset M \<subseteq> A \<and> size M = k - card A}
[PROOF STEP]
by (simp add: card_image)
[PROOF STATE]
proof (state)
this:
card {M. set_mset M = A \<and> size M = k} = card {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {M. set_mset M = A \<and> size M = k} = card {M. set_mset M \<subseteq> A \<and> size M = k - card A}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
have "\<dots> = card A + (k - card A) - 1 choose (k - card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {M. set_mset M \<subseteq> A \<and> size M = k - card A} = card A + (k - card A) - 1 choose (k - card A)
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card {M. set_mset M \<subseteq> A \<and> size M = k - card A} = card A + (k - card A) - 1 choose (k - card A)
[PROOF STEP]
by (simp only: card_multisets)
[PROOF STATE]
proof (state)
this:
card {M. set_mset M \<subseteq> A \<and> size M = k - card A} = card A + (k - card A) - 1 choose (k - card A)

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {M. set_mset M \<subseteq> A \<and> size M = k - card A} = card A + (k - card A) - 1 choose (k - card A)

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
have "\<dots> = (k - 1) choose (k - card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A + (k - card A) - 1 choose (k - card A) = k - 1 choose (k - card A)
[PROOF STEP]
using \<open>card A \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
card A \<le> k

goal (1 subgoal):
 1. card A + (k - card A) - 1 choose (k - card A) = k - 1 choose (k - card A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card A + (k - card A) - 1 choose (k - card A) = k - 1 choose (k - card A)

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {M. set_mset M = A \<and> size M = k} = k - 1 choose (k - card A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma C_omega_export:
  "C (x\<^sup>\<omega>) = (C x)\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
have "C (x\<^sup>\<omega>) = C x * C (x\<^sup>\<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x * C (x\<^sup>\<omega>)
[PROOF STEP]
by (metis C_mult_propagate n_L_T_meet_mult omega_unfold)
[PROOF STATE]
proof (state)
this:
C (x\<^sup>\<omega>) = C x * C (x\<^sup>\<omega>)

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
hence 1: "C (x\<^sup>\<omega>) \<le> (C x)\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
using this:
C (x\<^sup>\<omega>) = C x * C (x\<^sup>\<omega>)

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) \<le> C x\<^sup>\<omega>
[PROOF STEP]
using eq_refl omega_induct_mult
[PROOF STATE]
proof (prove)
using this:
C (x\<^sup>\<omega>) = C x * C (x\<^sup>\<omega>)
?x = ?y \<Longrightarrow> ?x \<le> ?y
?y \<le> ?x * ?y \<Longrightarrow> ?y \<le> ?x\<^sup>\<omega>

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) \<le> C x\<^sup>\<omega>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C (x\<^sup>\<omega>) \<le> C x\<^sup>\<omega>

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
have "(C x)\<^sup>\<omega> = C (x * (C x)\<^sup>\<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C x\<^sup>\<omega> = C (x * C x\<^sup>\<omega>)
[PROOF STEP]
using n_L_T_meet_mult omega_unfold
[PROOF STATE]
proof (prove)
using this:
C (?x * ?y) = C ?x * ?y
?y\<^sup>\<omega> = ?y * ?y\<^sup>\<omega>

goal (1 subgoal):
 1. C x\<^sup>\<omega> = C (x * C x\<^sup>\<omega>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C x\<^sup>\<omega> = C (x * C x\<^sup>\<omega>)

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C x\<^sup>\<omega> = C (x * C x\<^sup>\<omega>)

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
have "... \<le> C (x\<^sup>\<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C (x * C x\<^sup>\<omega>) \<le> C (x\<^sup>\<omega>)
[PROOF STEP]
by (metis calculation C_decreasing inf_le1 le_infI omega_induct_mult)
[PROOF STATE]
proof (state)
this:
C (x * C x\<^sup>\<omega>) \<le> C (x\<^sup>\<omega>)

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
C x\<^sup>\<omega> \<le> C (x\<^sup>\<omega>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C x\<^sup>\<omega> \<le> C (x\<^sup>\<omega>)

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
using 1 order.antisym
[PROOF STATE]
proof (prove)
using this:
C x\<^sup>\<omega> \<le> C (x\<^sup>\<omega>)
C (x\<^sup>\<omega>) \<le> C x\<^sup>\<omega>
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. C (x\<^sup>\<omega>) = C x\<^sup>\<omega>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
C (x\<^sup>\<omega>) = C x\<^sup>\<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_null_set:
  assumes "finite A" "A \<subseteq> space M"
  shows   "A \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
using countable_finite[OF assms(1)] countable_null_set[OF _ assms(2)]
[PROOF STATE]
proof (prove)
using this:
countable A
countable A \<Longrightarrow> A \<in> null_sets M

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
by simp


[STATEMENT]
lemma tabulate_nth: "i < n \<Longrightarrow> IArray.tabulate (integer_of_nat n, f) !! i = f (integer_of_nat i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> IArray.tabulate (integer_of_nat n, f) !! i = f (integer_of_nat i)
[PROOF STEP]
using of_fun_nth[of i n]
[PROOF STATE]
proof (prove)
using this:
i < n \<Longrightarrow> IArray.of_fun ?f n !! i = ?f i

goal (1 subgoal):
 1. i < n \<Longrightarrow> IArray.tabulate (integer_of_nat n, f) !! i = f (integer_of_nat i)
[PROOF STEP]
by auto


[STATEMENT]
lemma gset_gappend_if: "
  gset (a @\<^sub>g b) =
  (if glength a < \<infinity> then gset a \<union> gset b else gset a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gset (a @\<^sub>g b) = (if glength a < \<infinity> then gset a \<union> gset b else gset a)
[PROOF STEP]
by (unfold gappend_def, case_tac a, case_tac b, simp+)


[STATEMENT]
lemma (in vars) "\<Gamma>\<turnstile> \<lbrace>\<acute>N = 5\<rbrace> \<acute>N :== 2 * \<acute>N \<lbrace>\<acute>N = 10\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>N = 5\<rbrace> \<acute>N :== 2 * \<acute>N \<lbrace>\<acute>N = 10\<rbrace>
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. N = 5 \<Longrightarrow> 2 * N = 10
[PROOF STEP]
txt \<open>@{subgoals}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. N = 5 \<Longrightarrow> 2 * N = 10
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
txt \<open>@{subgoals}\<close>
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma splay_Leaf_iff: "(splay x t = Leaf) = (t = Leaf)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Splay_Map.splay x t = \<langle>\<rangle>) = (t = \<langle>\<rangle>)
[PROOF STEP]
by(induction x t rule: splay.induct) (auto split: tree.splits)


[STATEMENT]
lemma (in category) cf_rcomp_Hom_ArrMap_vrange:
  assumes "\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,\<GG>-)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,\<GG>-)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
using category_axioms assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,\<GG>-)\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding cf_rcomp_Hom_def
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<GG> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<CC> Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-) \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
by (intro cf_cn_cov_rcomp_ArrMap_vrange)
    (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros)


[STATEMENT]
lemma sincreasing_stl: "sincreasing s \<Longrightarrow> sincreasing (stl s)" for s :: "'a :: semilattice_sup stream"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sincreasing s \<Longrightarrow> sincreasing (stl s)
[PROOF STEP]
by (auto 0 4 simp: gr0_conv_Suc intro!: sincreasingI dest: sincreasing_grD[of s 0])


[STATEMENT]
lemma incident_own_polar_in_S: "proj2_incident p (polar p) \<longleftrightarrow> p \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident p (polar p) = (p \<in> S)
[PROOF STEP]
using incident_polar and S_alt_def
[PROOF STATE]
proof (prove)
using this:
proj2_incident ?p (polar ?q) = (proj2_rep ?p \<bullet> (M *v proj2_rep ?q) = 0)
(?p \<in> S) = (proj2_rep ?p \<bullet> (M *v proj2_rep ?p) = 0)

goal (1 subgoal):
 1. proj2_incident p (polar p) = (p \<in> S)
[PROOF STEP]
by simp


[STATEMENT]
lemma subst_eq_if_eq_vars: "(\<And>v. (Var v) \<cdot> \<theta> = (Var v) \<cdot> \<sigma>) \<Longrightarrow> \<theta> = \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. Var v \<cdot> \<theta> = Var v \<cdot> \<sigma>) \<Longrightarrow> \<theta> = \<sigma>
[PROOF STEP]
by (auto simp add: subst_agreement)


[STATEMENT]
lemma offs_next_cons_neq:
  assumes
    A: "index key x (length ns) mi ma = i" and
    B: "offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}" and
    C: "Max (offs_set_prev ns (x # xs) index key mi ma i) = j"
  shows "offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j =
    (if 0 < offs_num (length ns) xs index key mi ma i
     then Suc (ns ! i)
     else offs_next ns ub (x # xs) index key mi ma i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = (if 0 < offs_num (length ns) xs index key mi ma i then Suc (ns ! i) else offs_next ns ub (x # xs) index key mi ma i)
[PROOF STEP]
proof (simp, rule conjI, rule_tac [!] impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
let ?A = "offs_set_next ns (x # xs) index key mi ma j"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
assume "0 < offs_num (length ns) xs index key mi ma i"
[PROOF STATE]
proof (state)
this:
0 < offs_num (length ns) xs index key mi ma i

goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
index key x (length ns) mi ma = i
0 < offs_num (length ns) xs index key mi ma i
[PROOF STEP]
have "offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = ?A"
[PROOF STATE]
proof (prove)
using this:
index key x (length ns) mi ma = i
0 < offs_num (length ns) xs index key mi ma i

goal (1 subgoal):
 1. offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma j
[PROOF STEP]
by (rule_tac set_eqI, rule_tac iffI, simp_all add: offs_num_cons split:
     if_split_asm)
[PROOF STATE]
proof (state)
this:
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma j

goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma j

goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
have "0 < offs_num (length ns) (x # xs) index key mi ma i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < offs_num (length ns) (x # xs) index key mi ma i
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
index key x (length ns) mi ma = i

goal (1 subgoal):
 1. 0 < offs_num (length ns) (x # xs) index key mi ma i
[PROOF STEP]
by (simp add: offs_num_def)
[PROOF STATE]
proof (state)
this:
0 < offs_num (length ns) (x # xs) index key mi ma i

goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
hence "0 < offs_num (length ns) (x # xs) index key mi ma j \<and> ?A \<noteq> {} \<and>
    Min ?A = i"
[PROOF STATE]
proof (prove)
using this:
0 < offs_num (length ns) (x # xs) index key mi ma i

goal (1 subgoal):
 1. 0 < offs_num (length ns) (x # xs) index key mi ma j \<and> offs_set_next ns (x # xs) index key mi ma j \<noteq> {} \<and> Min (offs_set_next ns (x # xs) index key mi ma j) = i
[PROOF STEP]
using B and C
[PROOF STATE]
proof (prove)
using this:
0 < offs_num (length ns) (x # xs) index key mi ma i
offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}
Max (offs_set_prev ns (x # xs) index key mi ma i) = j

goal (1 subgoal):
 1. 0 < offs_num (length ns) (x # xs) index key mi ma j \<and> offs_set_next ns (x # xs) index key mi ma j \<noteq> {} \<and> Min (offs_set_next ns (x # xs) index key mi ma j) = i
[PROOF STEP]
by (subst offs_next_prev, simp)
[PROOF STATE]
proof (state)
this:
0 < offs_num (length ns) (x # xs) index key mi ma j \<and> offs_set_next ns (x # xs) index key mi ma j \<noteq> {} \<and> Min (offs_set_next ns (x # xs) index key mi ma j) = i

goal (2 subgoals):
 1. 0 < offs_num (length ns) xs index key mi ma i \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
 2. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma j
0 < offs_num (length ns) (x # xs) index key mi ma j \<and> offs_set_next ns (x # xs) index key mi ma j \<noteq> {} \<and> Min (offs_set_next ns (x # xs) index key mi ma j) = i
[PROOF STEP]
show "offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j =
    Suc (ns ! i)"
[PROOF STATE]
proof (prove)
using this:
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma j
0 < offs_num (length ns) (x # xs) index key mi ma j \<and> offs_set_next ns (x # xs) index key mi ma j \<noteq> {} \<and> Min (offs_set_next ns (x # xs) index key mi ma j) = i

goal (1 subgoal):
 1. offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma j
0 < offs_num (length ns) (x # xs) index key mi ma j \<and> offs_set_next ns (x # xs) index key mi ma j \<noteq> {} \<and> Min (offs_set_next ns (x # xs) index key mi ma j) = i
offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}

goal (1 subgoal):
 1. offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)
[PROOF STEP]
by (simp only: offs_next_def, simp, subst nth_list_update_eq, blast,
     simp)
[PROOF STATE]
proof (state)
this:
offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = Suc (ns ! i)

goal (1 subgoal):
 1. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
let ?A = "offs_set_prev ns (x # xs) index key mi ma i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
assume "offs_num (length ns) xs index key mi ma i = 0"
[PROOF STATE]
proof (state)
this:
offs_num (length ns) xs index key mi ma i = 0

goal (1 subgoal):
 1. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
index key x (length ns) mi ma = i
offs_num (length ns) xs index key mi ma i = 0
[PROOF STEP]
have "offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j =
    offs_set_next ns (x # xs) index key mi ma i"
[PROOF STATE]
proof (prove)
using this:
index key x (length ns) mi ma = i
offs_num (length ns) xs index key mi ma i = 0

goal (1 subgoal):
 1. offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i
[PROOF STEP]
proof (rule_tac set_eqI, rule_tac iffI, simp_all add: offs_num_cons split:
   if_split_asm, rule_tac conjI, rule_tac notI, simp, rule_tac impI,
   (erule_tac [!] conjE)+, rule_tac ccontr, simp_all)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
have "i < length ns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length ns
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}

goal (1 subgoal):
 1. i < length ns
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i < length ns

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length ns

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
assume "i \<noteq> k" and "\<not> i < k"
[PROOF STATE]
proof (state)
this:
i \<noteq> k
\<not> i < k

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
hence "k < i"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> k
\<not> i < k

goal (1 subgoal):
 1. k < i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k < i

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
k < i

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
assume "0 < offs_num (length ns) xs index key mi ma k"
[PROOF STATE]
proof (state)
this:
0 < offs_num (length ns) xs index key mi ma k

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i < length ns
k < i
0 < offs_num (length ns) xs index key mi ma k
[PROOF STEP]
have "k \<in> ?A"
[PROOF STATE]
proof (prove)
using this:
i < length ns
k < i
0 < offs_num (length ns) xs index key mi ma k

goal (1 subgoal):
 1. k \<in> offs_set_prev ns (x # xs) index key mi ma i
[PROOF STEP]
by (simp add: offs_num_cons)
[PROOF STATE]
proof (state)
this:
k \<in> offs_set_prev ns (x # xs) index key mi ma i

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
hence "k \<le> Max ?A"
[PROOF STATE]
proof (prove)
using this:
k \<in> offs_set_prev ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. k \<le> Max (offs_set_prev ns (x # xs) index key mi ma i)
[PROOF STEP]
by (rule_tac Max_ge, simp)
[PROOF STATE]
proof (state)
this:
k \<le> Max (offs_set_prev ns (x # xs) index key mi ma i)

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
k \<le> Max (offs_set_prev ns (x # xs) index key mi ma i)

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
assume "j < k"
[PROOF STATE]
proof (state)
this:
j < k

goal (2 subgoals):
 1. \<And>xa. \<lbrakk>i \<noteq> xa; xa < length ns; j < xa; 0 < offs_num (length ns) xs index key mi ma xa; \<not> i < xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
k \<le> Max (offs_set_prev ns (x # xs) index key mi ma i)
j < k
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
k \<le> Max (offs_set_prev ns (x # xs) index key mi ma i)
j < k

goal (1 subgoal):
 1. False
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
k \<le> Max (offs_set_prev ns (x # xs) index key mi ma i)
j < k
Max (offs_set_prev ns (x # xs) index key mi ma i) = j

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
have "Max ?A \<in> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (offs_set_prev ns (x # xs) index key mi ma i) \<in> offs_set_prev ns (x # xs) index key mi ma i
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}

goal (1 subgoal):
 1. Max (offs_set_prev ns (x # xs) index key mi ma i) \<in> offs_set_prev ns (x # xs) index key mi ma i
[PROOF STEP]
by (rule_tac Max_in, simp_all)
[PROOF STATE]
proof (state)
this:
Max (offs_set_prev ns (x # xs) index key mi ma i) \<in> offs_set_prev ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
hence "j < i"
[PROOF STATE]
proof (prove)
using this:
Max (offs_set_prev ns (x # xs) index key mi ma i) \<in> offs_set_prev ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. j < i
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
Max (offs_set_prev ns (x # xs) index key mi ma i) \<in> offs_set_prev ns (x # xs) index key mi ma i
Max (offs_set_prev ns (x # xs) index key mi ma i) = j

goal (1 subgoal):
 1. j < i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j < i

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
j < i

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
assume "i < k"
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>xa < length ns; i < xa; 0 < offs_num (length ns) xs index key mi ma xa; index key x (length ns) mi ma = i; offs_num (length ns) xs index key mi ma i = 0\<rbrakk> \<Longrightarrow> j < xa
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
j < i
i < k
[PROOF STEP]
show "j < k"
[PROOF STATE]
proof (prove)
using this:
j < i
i < k

goal (1 subgoal):
 1. j < k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
j < k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. offs_num (length ns) xs index key mi ma i = 0 \<Longrightarrow> offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
with B
[PROOF STATE]
proof (chain)
picking this:
offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i
[PROOF STEP]
show "offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j =
    offs_next ns ub (x # xs) index key mi ma i"
[PROOF STATE]
proof (prove)
using this:
offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}
offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i
[PROOF STEP]
proof (simp only: offs_next_def split: if_split, (rule_tac conjI, rule_tac [!] impI,
   simp)+, subst nth_list_update, blast, simp (no_asm_simp))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_next ns (x # xs) index key mi ma i \<noteq> {}; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_next ns (x # xs) index key mi ma i \<noteq> {}; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i\<rbrakk> \<Longrightarrow> i \<noteq> Min (offs_set_next ns (x # xs) index key mi ma i)
[PROOF STEP]
assume "offs_set_next ns (x # xs) index key mi ma i \<noteq> {}"
[PROOF STATE]
proof (state)
this:
offs_set_next ns (x # xs) index key mi ma i \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_next ns (x # xs) index key mi ma i \<noteq> {}; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_next ns (x # xs) index key mi ma i \<noteq> {}; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i\<rbrakk> \<Longrightarrow> i \<noteq> Min (offs_set_next ns (x # xs) index key mi ma i)
[PROOF STEP]
hence "Min (offs_set_next ns (x # xs) index key mi ma i)
      \<in> offs_set_next ns (x # xs) index key mi ma i"
[PROOF STATE]
proof (prove)
using this:
offs_set_next ns (x # xs) index key mi ma i \<noteq> {}

goal (1 subgoal):
 1. Min (offs_set_next ns (x # xs) index key mi ma i) \<in> offs_set_next ns (x # xs) index key mi ma i
[PROOF STEP]
by (rule_tac Min_in, simp)
[PROOF STATE]
proof (state)
this:
Min (offs_set_next ns (x # xs) index key mi ma i) \<in> offs_set_next ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. \<lbrakk>offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_next ns (x # xs) index key mi ma i \<noteq> {}; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_next ns (x # xs) index key mi ma i \<noteq> {}; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i; offs_set_prev ns (x # xs) index key mi ma i \<noteq> {}; offs_set_next (ns[i := Suc (ns ! i)]) xs index key mi ma j = offs_set_next ns (x # xs) index key mi ma i\<rbrakk> \<Longrightarrow> i \<noteq> Min (offs_set_next ns (x # xs) index key mi ma i)
[PROOF STEP]
thus "i \<noteq> Min (offs_set_next ns (x # xs) index key mi ma i)"
[PROOF STATE]
proof (prove)
using this:
Min (offs_set_next ns (x # xs) index key mi ma i) \<in> offs_set_next ns (x # xs) index key mi ma i

goal (1 subgoal):
 1. i \<noteq> Min (offs_set_next ns (x # xs) index key mi ma i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<noteq> Min (offs_set_next ns (x # xs) index key mi ma i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
offs_next (ns[i := Suc (ns ! i)]) ub xs index key mi ma j = offs_next ns ub (x # xs) index key mi ma i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjunctiveD: "x \<in> disjunctive \<Longrightarrow> times_abc x (sup_b y z) = sup_c (times_abc x y) (times_abc x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> disjunctive \<Longrightarrow> times_abc x (sup_b y z) = sup_c (times_abc x y) (times_abc x z)
[PROOF STEP]
by (simp add: disjunctive_def)


[STATEMENT]
lemma Borsukian_closed_Un:
  fixes S :: "'a::real_normed_vector set"
  assumes cloS: "closedin (top_of_set (S \<union> T)) S"
      and cloT: "closedin (top_of_set (S \<union> T)) T"
      and BS: "Borsukian S" and BT: "Borsukian T" and ST: "connected(S \<inter> T)"
    shows "Borsukian(S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Borsukian (S \<union> T)
[PROOF STEP]
by (force intro: Borsukian_Un_lemma [OF BS BT ST] continuous_on_cases_local [OF cloS cloT])


[STATEMENT]
lemma subset_\<Q>Suc: "\<Q> k \<subseteq> \<Q> (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Q> k \<subseteq> \<Q> (Suc k)
[PROOF STEP]
by (rule subset_trans[OF subset_\<Q>\<P>Suc subset_\<P>\<Q>k])


[STATEMENT]
lemma (in Corps) eqval_inv:"\<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K;
       y \<noteq> \<zero>; v x = v y\<rbrakk> \<Longrightarrow>  0 = v (x \<cdot>\<^sub>r (y\<^bsup>\<hyphen>K\<^esup>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K; y \<noteq> \<zero>; v x = v y\<rbrakk> \<Longrightarrow> 0 = v (x \<cdot>\<^sub>r y\<^bsup>\<hyphen> K\<^esup>)
[PROOF STEP]
by (cut_tac invf_closed[of y],
       simp add:val_t2p value_of_inv, simp add:aadd_minus_r,
       simp)


[STATEMENT]
lemma lm037:
  assumes "a \<in> injections (Domain a) (Range a)"
          "Range a \<in> all_partitions G"
          "Domain a \<subseteq> N"
  shows "a \<in> allAllocations N G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> allAllocations N G
[PROOF STEP]
using assms mem_Collect_eq posssibleAllocationsRelCharacterization injections_def
[PROOF STATE]
proof (prove)
using this:
a \<in> injections (Domain a) (Range a)
Range a \<in> all_partitions G
Domain a \<subseteq> N
(?a \<in> Collect ?P) = ?P ?a
(?a \<in> allAllocations ?N ?G) = (?a \<in> injectionsUniverse \<and> Domain ?a \<subseteq> ?N \<and> Range ?a \<in> all_partitions ?G)
injections ?X ?Y = {R. Domain R = ?X \<and> Range R \<subseteq> ?Y \<and> runiq R \<and> runiq (R\<inverse>)}

goal (1 subgoal):
 1. a \<in> allAllocations N G
[PROOF STEP]
by (metis (erased, lifting))


[STATEMENT]
lemma vifunion_vsingleton_is[simp]: "(\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>set {i}. f i) = f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (VLambda (set {i}) f `\<^sub>\<circ> set {i}) = f i
[PROOF STEP]
by force


[STATEMENT]
lemma sum_prime_inverses_fraction_coprime:
  fixes f :: "'a \<Rightarrow> nat"
  assumes "finite A" and primes: "\<And>x. x \<in> A \<Longrightarrow> prime (f x)" and inj: "inj_on f A"
  defines "a \<equiv> (\<Sum>x\<in>A. \<Prod>y\<in>A-{x}. f y)"
  shows   "coprime a (\<Prod>x\<in>A. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime a (prod f A)
[PROOF STEP]
proof (intro prod_coprime_right)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
assume x: "x \<in> A"
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
have "a = (\<Prod>y\<in>A-{x}. f y) + (\<Sum>y\<in>A-{x}. \<Prod>z\<in>A-{y}. f z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. prod f (A - {x})) = prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))
[PROOF STEP]
using \<open>finite A\<close> and x
[PROOF STATE]
proof (prove)
using this:
finite A
x \<in> A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. prod f (A - {x})) = prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))
[PROOF STEP]
by (rule sum.remove)
[PROOF STATE]
proof (state)
this:
a = prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a = prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
have "gcd \<dots> (f x) = gcd (\<Prod>y\<in>A-{x}. f y) (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))) (f x) = gcd (prod f (A - {x})) (f x)
[PROOF STEP]
using \<open>finite A\<close> and x
[PROOF STATE]
proof (prove)
using this:
finite A
x \<in> A

goal (1 subgoal):
 1. gcd (prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))) (f x) = gcd (prod f (A - {x})) (f x)
[PROOF STEP]
by (intro gcd_add_dvd_left2 dvd_sum dvd_prodI) auto
[PROOF STATE]
proof (state)
this:
gcd (prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))) (f x) = gcd (prod f (A - {x})) (f x)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gcd (prod f (A - {x}) + (\<Sum>y\<in>A - {x}. prod f (A - {y}))) (f x) = gcd (prod f (A - {x})) (f x)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
from x primes inj
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
?x \<in> A \<Longrightarrow> prime (f ?x)
inj_on f A
[PROOF STEP]
have "coprime (\<Prod>y\<in>A-{x}. f y) (f x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
?x \<in> A \<Longrightarrow> prime (f ?x)
inj_on f A

goal (1 subgoal):
 1. coprime (prod f (A - {x})) (f x)
[PROOF STEP]
by (intro prod_coprime_left) (auto intro!: primes_coprime simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
coprime (prod f (A - {x})) (f x)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
hence "gcd (\<Prod>y\<in>A-{x}. f y) (f x) = 1"
[PROOF STATE]
proof (prove)
using this:
coprime (prod f (A - {x})) (f x)

goal (1 subgoal):
 1. gcd (prod f (A - {x})) (f x) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gcd (prod f (A - {x})) (f x) = 1

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> coprime a (f x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gcd a (f x) = 1
[PROOF STEP]
show "coprime a (f x)"
[PROOF STATE]
proof (prove)
using this:
gcd a (f x) = 1

goal (1 subgoal):
 1. coprime a (f x)
[PROOF STEP]
by (simp only: coprime_iff_gcd_eq_1)
[PROOF STATE]
proof (state)
this:
coprime a (f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma get_distinguishing_sequence_from_ofsm_tables_is_minimally_distinguishing :
  fixes M :: "('a,'b::linorder,'c::linorder) fsm"
  assumes "observable M"
  and     "minimal M"
  and     "q1 \<in> states M"
  and     "q2 \<in> states M"
  and     "q1 \<noteq> q2"
shows "minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
have *:"ofsm_table_fix M (\<lambda>q . states M) 0 q1 \<noteq> ofsm_table_fix M (\<lambda>q . states M) 0 q2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q2
[PROOF STEP]
using \<open>minimal M\<close>
[PROOF STATE]
proof (prove)
using this:
minimal M

goal (1 subgoal):
 1. ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q2
[PROOF STEP]
unfolding minimal_observable_code[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
\<forall>q\<in>FSM.states M. ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q = {q}

goal (1 subgoal):
 1. ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q2
[PROOF STEP]
using assms(3,4,5)
[PROOF STATE]
proof (prove)
using this:
\<forall>q\<in>FSM.states M. ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q = {q}
q1 \<in> FSM.states M
q2 \<in> FSM.states M
q1 \<noteq> q2

goal (1 subgoal):
 1. ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q1 \<noteq> ofsm_table_fix M (\<lambda>q. FSM.states M) 0 q2

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
obtain k where "k = find_first_distinct_ofsm_table M q1 q2"
             and "get_distinguishing_sequence_from_ofsm_tables M q1 q2 = assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k = find_first_distinct_ofsm_table_gt M q1 q2 0; get_distinguishing_sequence_from_ofsm_tables M q1 q2 = assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k = find_first_distinct_ofsm_table_gt M q1 q2 0
get_distinguishing_sequence_from_ofsm_tables M q1 q2 = assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = find_first_distinct_ofsm_table_gt M q1 q2 0
get_distinguishing_sequence_from_ofsm_tables M q1 q2 = assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k
[PROOF STEP]
have "length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k"
[PROOF STATE]
proof (prove)
using this:
k = find_first_distinct_ofsm_table_gt M q1 q2 0
get_distinguishing_sequence_from_ofsm_tables M q1 q2 = assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k

goal (1 subgoal):
 1. length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
[PROOF STEP]
using assemble_distinguishing_sequence_from_ofsm_table_length
[PROOF STATE]
proof (prove)
using this:
k = find_first_distinct_ofsm_table_gt M q1 q2 0
get_distinguishing_sequence_from_ofsm_tables M q1 q2 = assemble_distinguishing_sequence_from_ofsm_table M q1 q2 k
length (assemble_distinguishing_sequence_from_ofsm_table ?M ?q1.0 ?q2.0 ?k) \<le> ?k

goal (1 subgoal):
 1. length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
have "\<And> io . length io < k \<Longrightarrow> \<not>distinguishes M q1 q2 io"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>io. length io < k \<Longrightarrow> \<not> distinguishes M q1 q2 io
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>io. length io < k \<Longrightarrow> \<not> distinguishes M q1 q2 io
[PROOF STEP]
fix io :: "('b \<times> 'c) list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>io. length io < k \<Longrightarrow> \<not> distinguishes M q1 q2 io
[PROOF STEP]
assume "length io < k"
[PROOF STATE]
proof (state)
this:
length io < k

goal (1 subgoal):
 1. \<And>io. length io < k \<Longrightarrow> \<not> distinguishes M q1 q2 io
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length io < k
[PROOF STEP]
have "ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2"
[PROOF STATE]
proof (prove)
using this:
length io < k

goal (1 subgoal):
 1. ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
[PROOF STEP]
using find_first_distinct_ofsm_table_is_first[OF assms(3,4) *]
[PROOF STATE]
proof (prove)
using this:
length io < k
ofsm_table M (\<lambda>q. FSM.states M) (find_first_distinct_ofsm_table_gt M q1 q2 0) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (find_first_distinct_ofsm_table_gt M q1 q2 0) q2
?k' < find_first_distinct_ofsm_table_gt M q1 q2 0 \<Longrightarrow> ofsm_table M (\<lambda>q. FSM.states M) ?k' q1 = ofsm_table M (\<lambda>q. FSM.states M) ?k' q2

goal (1 subgoal):
 1. ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
[PROOF STEP]
unfolding \<open>k = find_first_distinct_ofsm_table M q1 q2\<close>
[PROOF STATE]
proof (prove)
using this:
length io < find_first_distinct_ofsm_table_gt M q1 q2 0
ofsm_table M (\<lambda>q. FSM.states M) (find_first_distinct_ofsm_table_gt M q1 q2 0) q1 \<noteq> ofsm_table M (\<lambda>q. FSM.states M) (find_first_distinct_ofsm_table_gt M q1 q2 0) q2
?k' < find_first_distinct_ofsm_table_gt M q1 q2 0 \<Longrightarrow> ofsm_table M (\<lambda>q. FSM.states M) ?k' q1 = ofsm_table M (\<lambda>q. FSM.states M) ?k' q2

goal (1 subgoal):
 1. ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2

goal (1 subgoal):
 1. \<And>io. length io < k \<Longrightarrow> \<not> distinguishes M q1 q2 io
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
[PROOF STEP]
show "\<not>distinguishes M q1 q2 io"
[PROOF STATE]
proof (prove)
using this:
ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2

goal (1 subgoal):
 1. \<not> distinguishes M q1 q2 io
[PROOF STEP]
using ofsm_table_set_observable[OF assms(1,3) minimise_initial_partition]
[PROOF STATE]
proof (prove)
using this:
ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
ofsm_table M (\<lambda>q. FSM.states M) ?k q1 = {q' \<in> FSM.states M. \<forall>io. length io \<le> ?k \<longrightarrow> (io \<in> LS M q1) = (io \<in> LS M q') \<and> (io \<in> LS M q1 \<longrightarrow> after M q' io \<in> FSM.states M)}

goal (1 subgoal):
 1. \<not> distinguishes M q1 q2 io
[PROOF STEP]
using ofsm_table_set_observable[OF assms(1,4) minimise_initial_partition]
[PROOF STATE]
proof (prove)
using this:
ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
ofsm_table M (\<lambda>q. FSM.states M) ?k q1 = {q' \<in> FSM.states M. \<forall>io. length io \<le> ?k \<longrightarrow> (io \<in> LS M q1) = (io \<in> LS M q') \<and> (io \<in> LS M q1 \<longrightarrow> after M q' io \<in> FSM.states M)}
ofsm_table M (\<lambda>q. FSM.states M) ?k q2 = {q' \<in> FSM.states M. \<forall>io. length io \<le> ?k \<longrightarrow> (io \<in> LS M q2) = (io \<in> LS M q') \<and> (io \<in> LS M q2 \<longrightarrow> after M q' io \<in> FSM.states M)}

goal (1 subgoal):
 1. \<not> distinguishes M q1 q2 io
[PROOF STEP]
unfolding distinguishes_def
[PROOF STATE]
proof (prove)
using this:
ofsm_table M (\<lambda>q. FSM.states M) (length io) q1 = ofsm_table M (\<lambda>q. FSM.states M) (length io) q2
ofsm_table M (\<lambda>q. FSM.states M) ?k q1 = {q' \<in> FSM.states M. \<forall>io. length io \<le> ?k \<longrightarrow> (io \<in> LS M q1) = (io \<in> LS M q') \<and> (io \<in> LS M q1 \<longrightarrow> after M q' io \<in> FSM.states M)}
ofsm_table M (\<lambda>q. FSM.states M) ?k q2 = {q' \<in> FSM.states M. \<forall>io. length io \<le> ?k \<longrightarrow> (io \<in> LS M q2) = (io \<in> LS M q') \<and> (io \<in> LS M q2 \<longrightarrow> after M q' io \<in> FSM.states M)}

goal (1 subgoal):
 1. \<not> (io \<in> LS M q1 \<union> LS M q2 \<and> io \<notin> LS M q1 \<inter> LS M q2)
[PROOF STEP]
by (metis (mono_tags, lifting) Int_iff Un_iff assms(3) le_refl mem_Collect_eq ofsm_table_containment)
[PROOF STATE]
proof (state)
this:
\<not> distinguishes M q1 q2 io

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
length ?io < k \<Longrightarrow> \<not> distinguishes M q1 q2 ?io

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
length ?io < k \<Longrightarrow> \<not> distinguishes M q1 q2 ?io
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
length ?io < k \<Longrightarrow> \<not> distinguishes M q1 q2 ?io

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
using get_distinguishing_sequence_from_ofsm_tables_is_distinguishing_trace(1,2)[OF assms]
[PROOF STATE]
proof (prove)
using this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
length ?io < k \<Longrightarrow> \<not> distinguishes M q1 q2 ?io
get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<in> LS M q1 \<union> LS M q2
get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<notin> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)
[PROOF STEP]
unfolding minimally_distinguishes_def distinguishes_def
[PROOF STATE]
proof (prove)
using this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
length ?io < k \<Longrightarrow> \<not> (?io \<in> LS M q1 \<union> LS M q2 \<and> ?io \<notin> LS M q1 \<inter> LS M q2)
get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<in> LS M q1 \<union> LS M q2
get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<notin> LS M q1 \<inter> LS M q2

goal (1 subgoal):
 1. (get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<in> LS M q1 \<union> LS M q2 \<and> get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<notin> LS M q1 \<inter> LS M q2) \<and> (\<forall>io'. io' \<in> LS M q1 \<union> LS M q2 \<and> io' \<notin> LS M q1 \<inter> LS M q2 \<longrightarrow> length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> length io')
[PROOF STEP]
using le_neq_implies_less not_le_imp_less
[PROOF STATE]
proof (prove)
using this:
length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> k
length ?io < k \<Longrightarrow> \<not> (?io \<in> LS M q1 \<union> LS M q2 \<and> ?io \<notin> LS M q1 \<inter> LS M q2)
get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<in> LS M q1 \<union> LS M q2
get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<notin> LS M q1 \<inter> LS M q2
\<lbrakk>?m \<le> ?n; ?m \<noteq> ?n\<rbrakk> \<Longrightarrow> ?m < ?n
\<not> ?y \<le> ?x \<Longrightarrow> ?x < ?y

goal (1 subgoal):
 1. (get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<in> LS M q1 \<union> LS M q2 \<and> get_distinguishing_sequence_from_ofsm_tables M q1 q2 \<notin> LS M q1 \<inter> LS M q2) \<and> (\<forall>io'. io' \<in> LS M q1 \<union> LS M q2 \<and> io' \<notin> LS M q1 \<inter> LS M q2 \<longrightarrow> length (get_distinguishing_sequence_from_ofsm_tables M q1 q2) \<le> length io')
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
minimally_distinguishes M q1 q2 (get_distinguishing_sequence_from_ofsm_tables M q1 q2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bottom_meet: "x \<in> carrier L \<Longrightarrow> \<bottom> \<sqinter> x .= \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier L \<Longrightarrow> \<bottom> \<sqinter> x .= \<bottom>
[PROOF STEP]
by (metis bottom_least least_def meet_closed meet_left weak_le_antisym)


[STATEMENT]
lemma mirror_revorder_rev: "revorder (mirror t) = rev (revorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. revorder (mirror t) = rev (revorder t)
[PROOF STEP]
by(induction t) auto


[STATEMENT]
lemma f_Max\<^sub>0_equiv: "f_Max\<^sub>0 f n = Max\<^sub>0 (f ` {1..n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f_Max\<^sub>0 f n = Max\<^sub>0 (f ` {1..n})
[PROOF STEP]
by (induction n) (auto simp: not_le atLeastAtMostSuc_conv)


[STATEMENT]
lemma x_infinite:
  "infinite (UNIV :: x set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
apply(simp add: infinite_iff_countable_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj f
[PROOF STEP]
apply(rule_tac x = "\<lambda>n. if n = 0 then x_this else x_var (replicate n c)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>n. if n = 0 then x_this else x_var (replicate n c))
[PROOF STEP]
apply(rule linorder_injI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> (if x = 0 then x_this else x_var (replicate x c)) \<noteq> (if y = 0 then x_this else x_var (replicate y c))
[PROOF STEP]
apply(clarsimp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIM_cos_div_sin: "(\<lambda>x. cos(x)/sin(x)) \<midarrow>pi/2\<rightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. cos x / sin x) \<midarrow>pi / 2\<rightarrow> 0
[PROOF STEP]
by (rule tendsto_cong_limit, (rule tendsto_intros)+, simp_all)


[STATEMENT]
lemma t_prod_iff:
  "w \<in> X\<cdot>Y \<longleftrightarrow> (\<exists>u v. w = t_fusion u v \<and> u \<in> X \<and> v \<in> Y \<and> last u = first v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w \<in> X \<cdot> Y) = (\<exists>u v. w = t_fusion u v \<and> u \<in> X \<and> v \<in> Y \<and> Dioid_Models.last u = first v)
[PROOF STEP]
by (unfold t_prod_def) auto


[STATEMENT]
lemma wf_nabla_aux: "(P \<subseteq> (converse R) `` P \<longrightarrow> P = {}) \<longleftrightarrow> (s2r P \<subseteq> relfdia R (s2r P) \<longrightarrow> s2r P = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<subseteq> R\<inverse> `` P \<longrightarrow> P = {}) = (s2r P \<subseteq> relfdia R (s2r P) \<longrightarrow> s2r P = {})
[PROOF STEP]
apply (standard, metis Domain_Id_on Domain_mono Id_on_empty fdia_rel_im1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s2r P \<subseteq> relfdia R (s2r P) \<longrightarrow> s2r P = {} \<Longrightarrow> P \<subseteq> R\<inverse> `` P \<longrightarrow> P = {}
[PROOF STEP]
using fdia_rel_im1
[PROOF STATE]
proof (prove)
using this:
s2r (?R\<inverse> `` ?P) = relfdia ?R (s2r ?P)

goal (1 subgoal):
 1. s2r P \<subseteq> relfdia R (s2r P) \<longrightarrow> s2r P = {} \<Longrightarrow> P \<subseteq> R\<inverse> `` P \<longrightarrow> P = {}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma from_nat_CARD:
  shows "from_nat (CARD('a)) = (0::'a::{mod_type})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.from_nat CARD('a) = (0::'a)
[PROOF STEP]
unfolding from_nat_def o_def Abs'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs (int CARD('a) mod int CARD('a)) = (0::'a)
[PROOF STEP]
by (simp add: zero_def)


[STATEMENT]
lemma list_conj: "Ifm bs (list_conj ps) = (\<forall>p\<in> set ps. Ifm bs p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (list_conj ps) = (\<forall>p\<in>set ps. Ifm bs p)
[PROOF STEP]
by (induct ps, auto simp add: list_conj_def)


[STATEMENT]
lemma funpow_add': "(f ^^ (m + n)) x = (f ^^ m) ((f ^^ n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ (m + n)) x = (f ^^ m) ((f ^^ n) x)
[PROOF STEP]
by (simp add: funpow_add)


[STATEMENT]
lemma advantage\<^sub>n_nonneg: "advantage\<^sub>n \<A> \<eta> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> advantage\<^sub>n \<A> \<eta>
[PROOF STEP]
by(simp add: advantage\<^sub>n_def pmf_nonneg)


[STATEMENT]
lemma inverse_divide [simp]: "inverse (a / b) = b / a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (a / b) = b / a
[PROOF STEP]
by (metis div_conv_mult_inverse inverse_distrib mult.commute mult.inverse_inverse)


[STATEMENT]
lemma xor_left_inverse [simp]: "x \<oplus> x \<oplus> y = y" if "x \<in> carrier L" "y \<in> carrier L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus> x \<oplus> y = y
[PROOF STEP]
using that xor_assoc
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
\<lbrakk>?x \<in> carrier L; ?y \<in> carrier L; ?z \<in> carrier L\<rbrakk> \<Longrightarrow> (?x \<oplus> ?y) \<oplus> ?z = ?x \<oplus> ?y \<oplus> ?z

goal (1 subgoal):
 1. x \<oplus> x \<oplus> y = y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma nn_integral_dens_ctxt_measure:
  assumes "\<rho> \<in> space (state_measure V' \<Gamma>)"
          "f \<in> borel_measurable (state_measure (V \<union> V') \<Gamma>)"
  shows "(\<integral>\<^sup>+x. f x \<partial>dens_ctxt_measure (V,V',\<Gamma>,\<delta>) \<rho>) =
           \<integral>\<^sup>+ x. \<delta> (merge V V' (x, \<rho>)) * f (merge V V' (x, \<rho>)) \<partial>state_measure V \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (dens_ctxt_measure \<Y> \<rho>) f = \<integral>\<^sup>+ x. \<delta> (merge V V' (x, \<rho>)) * f (merge V V' (x, \<rho>)) \<partial>state_measure V \<Gamma>
[PROOF STEP]
unfolding dens_ctxt_measure_def state_measure'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N ((case \<Y> of (V, V', \<Gamma>, \<delta>) \<Rightarrow> \<lambda>\<rho>. density (distr (state_measure V \<Gamma>) (state_measure (V \<union> V') \<Gamma>) (\<lambda>\<sigma>. merge V V' (\<sigma>, \<rho>))) \<delta>) \<rho>) f = \<integral>\<^sup>+ x. \<delta> (merge V V' (x, \<rho>)) * f (merge V V' (x, \<rho>)) \<partial>state_measure V \<Gamma>
[PROOF STEP]
using assms measurable_dens
[PROOF STATE]
proof (prove)
using this:
\<rho> \<in> space (state_measure V' \<Gamma>)
f \<in> borel_measurable (state_measure (V \<union> V') \<Gamma>)
\<delta> \<in> borel_measurable (state_measure (V \<union> V') \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N ((case \<Y> of (V, V', \<Gamma>, \<delta>) \<Rightarrow> \<lambda>\<rho>. density (distr (state_measure V \<Gamma>) (state_measure (V \<union> V') \<Gamma>) (\<lambda>\<sigma>. merge V V' (\<sigma>, \<rho>))) \<delta>) \<rho>) f = \<integral>\<^sup>+ x. \<delta> (merge V V' (x, \<rho>)) * f (merge V V' (x, \<rho>)) \<partial>state_measure V \<Gamma>
[PROOF STEP]
by (simp only: prod.case, subst nn_integral_density)
     (auto simp: nn_integral_distr state_measure_def )


[STATEMENT]
lemma ipurge_tr_del_failures [rule_format]:
  assumes
    S: "secure P I D" and
    A: "\<forall>v \<in> sinks I D u ys. \<forall>z \<in> Z \<union> set zs. (v, D z) \<notin> I" and
    B: "(xs @ ipurge_tr I D u ys @ zs, Z) \<in> failures P" and
    C: "xs @ ys \<in> traces P"
  shows "(xs @ ys @ zs, Z) \<in> failures P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ ys @ zs, Z) \<in> failures P
[PROOF STEP]
proof (rule ipurge_tr_aux_del_failures [OF S _ _ C, where U = "{u}"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ua z. \<lbrakk>ua \<in> sinks_aux_less I D {u} ys; z \<in> Z \<union> set zs\<rbrakk> \<Longrightarrow> (ua, D z) \<notin> I
 2. (xs @ ipurge_tr_aux I D {u} ys @ zs, Z) \<in> failures P
[PROOF STEP]
qed (simp add: A sinks_aux_less_single_dom, simp add: B ipurge_tr_aux_single_dom)


[STATEMENT]
lemma PosOrd_ex_eq2:
  shows "v1 :\<sqsubset>val v2 \<longleftrightarrow> (v1 :\<sqsubseteq>val v2 \<and> v1 \<noteq> v2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v1 :\<sqsubset>val v2 = (v1 :\<sqsubseteq>val v2 \<and> v1 \<noteq> v2)
[PROOF STEP]
using PosOrd_ordering
[PROOF STATE]
proof (prove)
using this:
ordering PosOrd_ex_eq PosOrd_ex

goal (1 subgoal):
 1. v1 :\<sqsubset>val v2 = (v1 :\<sqsubseteq>val v2 \<and> v1 \<noteq> v2)
[PROOF STEP]
using PosOrd_ex_eq_def PosOrd_irrefl
[PROOF STATE]
proof (prove)
using this:
ordering PosOrd_ex_eq PosOrd_ex
?v1.0 :\<sqsubseteq>val ?v2.0 \<equiv> ?v1.0 :\<sqsubset>val ?v2.0 \<or> ?v1.0 = ?v2.0
?v :\<sqsubset>val ?v \<Longrightarrow> False

goal (1 subgoal):
 1. v1 :\<sqsubset>val v2 = (v1 :\<sqsubseteq>val v2 \<and> v1 \<noteq> v2)
[PROOF STEP]
by blast


[STATEMENT]
lemma (in comm_group) hom_imp_img_comm_group: \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
  assumes "h \<in> hom G H"
  shows "comm_group (H \<lparr> carrier := h ` (carrier G), one := h \<one>\<^bsub>G\<^esub> \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>)
[PROOF STEP]
unfolding comm_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.comm_monoid (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>) \<and> Group.group (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>)
[PROOF STEP]
using hom_imp_img_group[OF assms] hom_imp_img_comm_monoid[OF assms]
[PROOF STATE]
proof (prove)
using this:
Group.group (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>)
Group.comm_monoid (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>)

goal (1 subgoal):
 1. Group.comm_monoid (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>) \<and> Group.group (H\<lparr>carrier := h ` carrier G, one := h \<one>\<rparr>)
[PROOF STEP]
by simp