[STATEMENT]
lemma subcocycle_lim_ereal_birkhoff:
  assumes "integrable M u"
  shows "AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal(real_cond_exp M Invariants u x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
have "AE x in M. (\<lambda>n. birkhoff_sum u n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x
[PROOF STEP]
by (rule birkhoff_theorem_AE_nonergodic[OF assms])
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
have "AE x in M. (\<lambda>n. birkhoff_sum u n x / n) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x
[PROOF STEP]
by (rule kingman_theorem_AE_nonergodic_ereal[OF subcocycle_birkhoff[OF assms]])
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
assume H: "(\<lambda>n. birkhoff_sum u n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants u x"
                    "(\<lambda>n. birkhoff_sum u n x / n) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x"
[PROOF STATE]
proof (state)
this:
(\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x
(\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
have "(\<lambda>n. birkhoff_sum u n x / n) \<longlonglongrightarrow> ereal(real_cond_exp M Invariants u x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
using H(1)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x

goal (1 subgoal):
 1. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants u x)

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
have "subcocycle_lim_ereal (birkhoff_sum u) x = ereal(real_cond_exp M Invariants u x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants u x)

goal (1 subgoal):
 1. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
using H(2)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants u x)
(\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x

goal (1 subgoal):
 1. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
by (simp add: LIMSEQ_unique)
[PROOF STATE]
proof (state)
this:
subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>n. birkhoff_sum u n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u ?x5; (\<lambda>x. ereal (birkhoff_sum u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) ?x5\<rbrakk> \<Longrightarrow> subcocycle_lim_ereal (birkhoff_sum u) ?x5 = ereal (real_cond_exp M Invariants u ?x5)

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x
AE x in M. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x
\<lbrakk>(\<lambda>n. birkhoff_sum u n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u ?x5; (\<lambda>x. ereal (birkhoff_sum u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) ?x5\<rbrakk> \<Longrightarrow> subcocycle_lim_ereal (birkhoff_sum u) ?x5 = ereal (real_cond_exp M Invariants u ?x5)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum u n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u x
AE x in M. (\<lambda>xa. ereal (birkhoff_sum u xa x / real xa)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) x
\<lbrakk>(\<lambda>n. birkhoff_sum u n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants u ?x5; (\<lambda>x. ereal (birkhoff_sum u x ?x5 / real x)) \<longlonglongrightarrow> subcocycle_lim_ereal (birkhoff_sum u) ?x5\<rbrakk> \<Longrightarrow> subcocycle_lim_ereal (birkhoff_sum u) ?x5 = ereal (real_cond_exp M Invariants u ?x5)

goal (1 subgoal):
 1. AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. subcocycle_lim_ereal (birkhoff_sum u) x = ereal (real_cond_exp M Invariants u x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_factor_complex_main:
  "distinct (map fst (snd (factor_complex_main p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst (snd (factor_complex_main p)))
[PROOF STEP]
unfolding roots_of_complex_poly_via_factor_complex_main
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (roots_of_complex_poly p)
[PROOF STEP]
by (rule distinct_roots_of_complex_poly)


[STATEMENT]
lemma wf_sub_nmset[simp]: "wf sub_nmset"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf sub_nmset
[PROOF STEP]
proof (rule wfUNIVI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. \<forall>x. (\<forall>y. (y, x) \<in> sub_nmset \<longrightarrow> P y) \<longrightarrow> P x \<Longrightarrow> P x
[PROOF STEP]
fix P :: "'a nmultiset \<Rightarrow> bool" and M :: "'a nmultiset"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P x. \<forall>x. (\<forall>y. (y, x) \<in> sub_nmset \<longrightarrow> P y) \<longrightarrow> P x \<Longrightarrow> P x
[PROOF STEP]
assume IH: "\<forall>M. (\<forall>N. (N, M) \<in> sub_nmset \<longrightarrow> P N) \<longrightarrow> P M"
[PROOF STATE]
proof (state)
this:
\<forall>M. (\<forall>N. (N, M) \<in> sub_nmset \<longrightarrow> P N) \<longrightarrow> P M

goal (1 subgoal):
 1. \<And>P x. \<forall>x. (\<forall>y. (y, x) \<in> sub_nmset \<longrightarrow> P y) \<longrightarrow> P x \<Longrightarrow> P x
[PROOF STEP]
show "P M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P M
[PROOF STEP]
by (induct M; rule IH[rule_format]) (auto simp: sub_nmset.simps)
[PROOF STATE]
proof (state)
this:
P M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cardshift: "card {i::nat. i>n \<and> i \<le> n' \<and> p (n'' + i)} = card {i. i>(n + n'') \<and> i \<le> (n' + n'') \<and> p i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
let ?f="\<lambda>i. i+n''"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
have "bij_betw ?f {i::nat. i>n \<and> i \<le> n' \<and> p (n'' + i)} {i. i>(n + n'') \<and> i \<le> (n' + n'') \<and> p i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>i. i + n'') {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
proof (rule bij_betwI')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}; y \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}\<rbrakk> \<Longrightarrow> (x + n'' = y + n'') = (x = y)
 2. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 3. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}; y \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}\<rbrakk> \<Longrightarrow> (x + n'' = y + n'') = (x = y)
 2. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 3. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
assume "x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}" and "y \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}"
[PROOF STATE]
proof (state)
this:
x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}
y \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}; y \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}\<rbrakk> \<Longrightarrow> (x + n'' = y + n'') = (x = y)
 2. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 3. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
show "(x + n'' = y + n'') = (x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + n'' = y + n'') = (x = y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x + n'' = y + n'') = (x = y)

goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
fix x::nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
assume "x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}"
[PROOF STATE]
proof (state)
this:
x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}

goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
hence "n<x" and "x \<le> n'" and "p(n''+x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)}

goal (1 subgoal):
 1. n < x &&& x \<le> n' &&& p (n'' + x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < x
x \<le> n'
p (n'' + x)

goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n < x
x \<le> n'
p (n'' + x)

goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
have "n''+x=x+n''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n'' + x = x + n''
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n'' + x = x + n''

goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n < x
x \<le> n'
p (n'' + x)
n'' + x = x + n''
[PROOF STEP]
have "n + n'' < x + n''" and "x + n'' \<le> n' + n''" and "p (x + n'')"
[PROOF STATE]
proof (prove)
using this:
n < x
x \<le> n'
p (n'' + x)
n'' + x = x + n''

goal (1 subgoal):
 1. n + n'' < x + n'' &&& x + n'' \<le> n' + n'' &&& p (x + n'')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + n'' < x + n''
x + n'' \<le> n' + n''
p (x + n'')

goal (2 subgoals):
 1. \<And>x. x \<in> {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} \<Longrightarrow> x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
 2. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
thus "x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}"
[PROOF STATE]
proof (prove)
using this:
n + n'' < x + n''
x + n'' \<le> n' + n''
p (x + n'')

goal (1 subgoal):
 1. x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + n'' \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
fix y::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
assume "y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}"
[PROOF STATE]
proof (state)
this:
y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
hence "n+n''<y" and "y\<le>n'+n''" and "p y"
[PROOF STATE]
proof (prove)
using this:
y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}

goal (1 subgoal):
 1. n + n'' < y &&& y \<le> n' + n'' &&& p y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + n'' < y
y \<le> n' + n''
p y

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n + n'' < y
y \<le> n' + n''
p y
[PROOF STEP]
obtain x where "x=y-n''"
[PROOF STATE]
proof (prove)
using this:
n + n'' < y
y \<le> n' + n''
p y

goal (1 subgoal):
 1. (\<And>x. x = y - n'' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = y - n''

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
with \<open>n+n''<y\<close>
[PROOF STATE]
proof (chain)
picking this:
n + n'' < y
x = y - n''
[PROOF STEP]
have "y=x+n''"
[PROOF STATE]
proof (prove)
using this:
n + n'' < y
x = y - n''

goal (1 subgoal):
 1. y = x + n''
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = x + n''

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = x + n''

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
from \<open>x=y-n''\<close> \<open>n+n''<y\<close>
[PROOF STATE]
proof (chain)
picking this:
x = y - n''
n + n'' < y
[PROOF STEP]
have "x>n"
[PROOF STATE]
proof (prove)
using this:
x = y - n''
n + n'' < y

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

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n < x

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
from \<open>x=y-n''\<close> \<open>y\<le>n'+n''\<close>
[PROOF STATE]
proof (chain)
picking this:
x = y - n''
y \<le> n' + n''
[PROOF STEP]
have "x\<le>n'"
[PROOF STATE]
proof (prove)
using this:
x = y - n''
y \<le> n' + n''

goal (1 subgoal):
 1. x \<le> n'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<le> n'

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<le> n'

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
from \<open>y=x+n''\<close>
[PROOF STATE]
proof (chain)
picking this:
y = x + n''
[PROOF STEP]
have "y=n''+x"
[PROOF STATE]
proof (prove)
using this:
y = x + n''

goal (1 subgoal):
 1. y = n'' + x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = n'' + x

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
with \<open>p y\<close>
[PROOF STATE]
proof (chain)
picking this:
p y
y = n'' + x
[PROOF STEP]
have "p (n'' + x)"
[PROOF STATE]
proof (prove)
using this:
p y
y = n'' + x

goal (1 subgoal):
 1. p (n'' + x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p (n'' + x)

goal (1 subgoal):
 1. \<And>y. y \<in> {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i} \<Longrightarrow> \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y = x + n''
n < x
x \<le> n'
p (n'' + x)
[PROOF STEP]
show "\<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''"
[PROOF STATE]
proof (prove)
using this:
y = x + n''
n < x
x \<le> n'
p (n'' + x)

goal (1 subgoal):
 1. \<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{i. n < i \<and> i \<le> n' \<and> p (n'' + i)}. y = x + n''

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>i. i + n'') {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>i. i + n'') {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
using bij_betw_same_card
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>i. i + n'') {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
bij_betw ?f ?A ?B \<Longrightarrow> card ?A = card ?B

goal (1 subgoal):
 1. card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {i. n < i \<and> i \<le> n' \<and> p (n'' + i)} = card {i. n + n'' < i \<and> i \<le> n' + n'' \<and> p i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_coeff_append1: "i \<in> {0..<dim_vec a} \<Longrightarrow> coeff (vec_to_lpoly (a@\<^sub>vb)) i = a$i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> {0..<dim_vec a} \<Longrightarrow> Abstract_Linear_Poly.coeff (vec_to_lpoly (a @\<^sub>v b)) i = a $ i
[PROOF STEP]
by (metis atLeastLessThan_iff index_append_vec(1) index_append_vec(2) vec_to_lin_poly_coeff_access trans_less_add1)


[STATEMENT]
lemma (in valid_unSimpGraph) degree_two_windmill:
  assumes friend_assm:"\<And>v u. v\<in>V \<Longrightarrow> u\<in>V \<Longrightarrow> v\<noteq>u \<Longrightarrow> \<exists>! n. adjacent v n \<and> adjacent u n"
      and "finite E" and "card V\<ge>2"
  shows "(\<exists>v\<in>V. degree v G = 2) \<longleftrightarrow>(\<exists>v. \<forall>n\<in>V. n\<noteq>v \<longrightarrow> adjacent v n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>v\<in>V. degree v G = 2) = (\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
assume "\<exists>v\<in>V. degree v G = 2 "
[PROOF STATE]
proof (state)
this:
\<exists>v\<in>V. degree v G = 2

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v\<in>V. degree v G = 2
[PROOF STEP]
obtain v where "degree v G=2"
[PROOF STATE]
proof (prove)
using this:
\<exists>v\<in>V. degree v G = 2

goal (1 subgoal):
 1. (\<And>v. degree v G = 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree v G = 2

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
hence "card {n. adjacent v n}=2"
[PROOF STATE]
proof (prove)
using this:
degree v G = 2

goal (1 subgoal):
 1. card {n. adjacent v n} = 2
[PROOF STEP]
using degree_adjacent[OF \<open>finite E\<close>,of v]
[PROOF STATE]
proof (prove)
using this:
degree v G = 2
degree v G = card {n. adjacent v n}

goal (1 subgoal):
 1. card {n. adjacent v n} = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {n. adjacent v n} = 2

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {n. adjacent v n} = 2
[PROOF STEP]
obtain v1 v2 where v1v2:"{n. adjacent v n}={v1,v2}" and "v1\<noteq>v2"
[PROOF STATE]
proof (prove)
using this:
card {n. adjacent v n} = 2

goal (1 subgoal):
 1. (\<And>v1 v2. \<lbrakk>{n. adjacent v n} = {v1, v2}; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>v1 v2. \<lbrakk>{n. adjacent v n} = {v1, v2}; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> thesis; card {n. adjacent v n} = 2\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
obtain v1 S where "{n. adjacent v n} = insert v1 S" and  "v1 \<notin> S" and "card S = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v1 S. \<lbrakk>{n. adjacent v n} = insert v1 S; v1 \<notin> S; card S = 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>card {n. adjacent v n}=2\<close> card_Suc_eq[of "{n. adjacent v n}" 1]
[PROOF STATE]
proof (prove)
using this:
card {n. adjacent v n} = 2
(card {n. adjacent v n} = Suc 1) = (\<exists>b B. {n. adjacent v n} = insert b B \<and> b \<notin> B \<and> card B = 1 \<and> (1 = 0 \<longrightarrow> B = {}))

goal (1 subgoal):
 1. (\<And>v1 S. \<lbrakk>{n. adjacent v n} = insert v1 S; v1 \<notin> S; card S = 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{n. adjacent v n} = insert v1 S
v1 \<notin> S
card S = 1

goal (1 subgoal):
 1. \<lbrakk>\<And>v1 v2. \<lbrakk>{n. adjacent v n} = {v1, v2}; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> thesis; card {n. adjacent v n} = 2\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{n. adjacent v n} = insert v1 S
v1 \<notin> S
card S = 1
[PROOF STEP]
obtain v2 where "S=insert v2 {}"
[PROOF STATE]
proof (prove)
using this:
{n. adjacent v n} = insert v1 S
v1 \<notin> S
card S = 1

goal (1 subgoal):
 1. (\<And>v2. S = {v2} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using card_Suc_eq[of S 0]
[PROOF STATE]
proof (prove)
using this:
{n. adjacent v n} = insert v1 S
v1 \<notin> S
card S = 1
(card S = Suc 0) = (\<exists>b B. S = insert b B \<and> b \<notin> B \<and> card B = 0 \<and> (0 = 0 \<longrightarrow> B = {}))

goal (1 subgoal):
 1. (\<And>v2. S = {v2} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = {v2}

goal (1 subgoal):
 1. \<lbrakk>\<And>v1 v2. \<lbrakk>{n. adjacent v n} = {v1, v2}; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> thesis; card {n. adjacent v n} = 2\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "{n. adjacent v n}={v1,v2}" and "v1\<noteq>v2"
[PROOF STATE]
proof (prove)
using this:
S = {v2}

goal (1 subgoal):
 1. {n. adjacent v n} = {v1, v2} &&& v1 \<noteq> v2
[PROOF STEP]
using \<open>{n. adjacent v n} = insert v1 S\<close> \<open>v1 \<notin> S\<close>
[PROOF STATE]
proof (prove)
using this:
S = {v2}
{n. adjacent v n} = insert v1 S
v1 \<notin> S

goal (1 subgoal):
 1. {n. adjacent v n} = {v1, v2} &&& v1 \<noteq> v2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{n. adjacent v n} = {v1, v2}
v1 \<noteq> v2

goal (1 subgoal):
 1. \<lbrakk>\<And>v1 v2. \<lbrakk>{n. adjacent v n} = {v1, v2}; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> thesis; card {n. adjacent v n} = 2\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{n. adjacent v n} = {v1, v2}
v1 \<noteq> v2

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that[of v1 v2]
[PROOF STATE]
proof (prove)
using this:
{n. adjacent v n} = {v1, v2}
v1 \<noteq> v2
\<lbrakk>{n. adjacent v n} = {v1, v2}; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{n. adjacent v n} = {v1, v2}
v1 \<noteq> v2

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
have "adjacent v1 v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
obtain n where "adjacent v n" "adjacent v1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<lbrakk>adjacent v n; adjacent v1 n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using friend_assm[of v v1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>v \<in> V; v1 \<in> V; v \<noteq> v1\<rbrakk> \<Longrightarrow> \<exists>!n. adjacent v n \<and> adjacent v1 n

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>adjacent v n; adjacent v1 n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (full_types) adjacent_V(2) adjacent_sym insertI1 mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
adjacent v n
adjacent v1 n

goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
hence "n\<in>{n. adjacent v n}"
[PROOF STATE]
proof (prove)
using this:
adjacent v n
adjacent v1 n

goal (1 subgoal):
 1. n \<in> {n. adjacent v n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v n}

goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v n}

goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
have "n\<noteq>v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> v1
[PROOF STEP]
by (metis \<open>adjacent v1 n\<close> adjacent_no_loop)
[PROOF STATE]
proof (state)
this:
n \<noteq> v1

goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<in> {n. adjacent v n}
n \<noteq> v1
[PROOF STEP]
have "n=v2"
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. adjacent v n}
n \<noteq> v1

goal (1 subgoal):
 1. n = v2
[PROOF STEP]
using v1v2
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. adjacent v n}
n \<noteq> v1
{n. adjacent v n} = {v1, v2}

goal (1 subgoal):
 1. n = v2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = v2

goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = v2

goal (1 subgoal):
 1. adjacent v1 v2
[PROOF STEP]
by (metis \<open>adjacent v1 n\<close>)
[PROOF STATE]
proof (state)
this:
adjacent v1 v2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
adjacent v1 v2

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
have v1v2_adj:"\<forall>x\<in>V. x\<in>{n. adjacent v1 n} \<union> {n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>V. x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
assume "x\<in>V"
[PROOF STATE]
proof (state)
this:
x \<in> V

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
have "x=v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
by (metis Un_iff adjacent_sym insertI1 mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
x = v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
have "x\<noteq>v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
assume "x\<noteq>v"
[PROOF STATE]
proof (state)
this:
x \<noteq> v

goal (1 subgoal):
 1. x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> v
[PROOF STEP]
obtain y where "adjacent v y" "adjacent x y"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> v

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>adjacent v y; adjacent x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using friend_assm[of v x]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> v
\<lbrakk>v \<in> V; x \<in> V; v \<noteq> x\<rbrakk> \<Longrightarrow> \<exists>!n. adjacent v n \<and> adjacent x n

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>adjacent v y; adjacent x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Collect_empty_eq \<open>x \<in> V\<close> adjacent_V(1) all_not_in_conv insertCI v1v2)
[PROOF STATE]
proof (state)
this:
adjacent v y
adjacent x y

goal (1 subgoal):
 1. x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
hence "y=v1 \<or> y=v2"
[PROOF STATE]
proof (prove)
using this:
adjacent v y
adjacent x y

goal (1 subgoal):
 1. y = v1 \<or> y = v2
[PROOF STEP]
using v1v2
[PROOF STATE]
proof (prove)
using this:
adjacent v y
adjacent x y
{n. adjacent v n} = {v1, v2}

goal (1 subgoal):
 1. y = v1 \<or> y = v2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = v1 \<or> y = v2

goal (1 subgoal):
 1. x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
thus "x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
using this:
y = v1 \<or> y = v2

goal (1 subgoal):
 1. x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
using \<open>adjacent x y\<close>
[PROOF STATE]
proof (prove)
using this:
y = v1 \<or> y = v2
adjacent x y

goal (1 subgoal):
 1. x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
by (metis UnI1 UnI2 adjacent_sym mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (1 subgoal):
 1. \<And>x. x \<in> V \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
show "x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
using this:
x = v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
x \<noteq> v \<Longrightarrow> x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (1 subgoal):
 1. x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>V. x \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
have "{n. adjacent v1 n}-{v2,v}={} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. adjacent v1 n} - {v2, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
[PROOF STEP]
proof (rule exI[of _ v2],rule,rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v1 n} - {v2, v} = {}; n \<in> V; n \<noteq> v2\<rbrakk> \<Longrightarrow> adjacent v2 n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v1 n} - {v2, v} = {}; n \<in> V; n \<noteq> v2\<rbrakk> \<Longrightarrow> adjacent v2 n
[PROOF STEP]
assume v1_adj:"{n. adjacent v1 n} - {v2, v} = {}" and "n \<in> V" and "n \<noteq> v2"
[PROOF STATE]
proof (state)
this:
{n. adjacent v1 n} - {v2, v} = {}
n \<in> V
n \<noteq> v2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v1 n} - {v2, v} = {}; n \<in> V; n \<noteq> v2\<rbrakk> \<Longrightarrow> adjacent v2 n
[PROOF STEP]
have "n\<in>{n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> {n. adjacent v2 n}
[PROOF STEP]
proof (cases "n=v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = v \<Longrightarrow> n \<in> {n. adjacent v2 n}
 2. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v2 n}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = v

goal (2 subgoals):
 1. n = v \<Longrightarrow> n \<in> {n. adjacent v2 n}
 2. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v2 n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> {n. adjacent v2 n}
[PROOF STEP]
by (metis True adjacent_sym insertI1 insert_commute mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v2 n}

goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v2 n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v2 n}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> v

goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v2 n}
[PROOF STEP]
have "n\<notin>{n. adjacent v1 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<notin> {n. adjacent v1 n}
[PROOF STEP]
by (metis DiffI False \<open>n \<noteq> v2\<close> empty_iff insert_iff v1_adj)
[PROOF STATE]
proof (state)
this:
n \<notin> {n. adjacent v1 n}

goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v2 n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<notin> {n. adjacent v1 n}

goal (1 subgoal):
 1. n \<in> {n. adjacent v2 n}
[PROOF STEP]
by (metis Un_iff \<open>n \<in> V\<close> v1v2_adj)
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v2 n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v2 n}

goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v1 n} - {v2, v} = {}; n \<in> V; n \<noteq> v2\<rbrakk> \<Longrightarrow> adjacent v2 n
[PROOF STEP]
thus "adjacent v2 n"
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. adjacent v2 n}

goal (1 subgoal):
 1. adjacent v2 n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v2 n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{n. adjacent v1 n} - {v2, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{n. adjacent v1 n} - {v2, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
have "{n. adjacent v2 n}-{v1,v}={} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n. adjacent v2 n} - {v1, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
[PROOF STEP]
proof (rule exI[of _ v1],rule,rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v2 n} - {v1, v} = {}; n \<in> V; n \<noteq> v1\<rbrakk> \<Longrightarrow> adjacent v1 n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v2 n} - {v1, v} = {}; n \<in> V; n \<noteq> v1\<rbrakk> \<Longrightarrow> adjacent v1 n
[PROOF STEP]
assume v2_adj:"{n. adjacent v2 n} - {v1, v} = {}" and "n \<in> V" and "n \<noteq> v1"
[PROOF STATE]
proof (state)
this:
{n. adjacent v2 n} - {v1, v} = {}
n \<in> V
n \<noteq> v1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v2 n} - {v1, v} = {}; n \<in> V; n \<noteq> v1\<rbrakk> \<Longrightarrow> adjacent v1 n
[PROOF STEP]
have "n\<in>{n. adjacent v1 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> {n. adjacent v1 n}
[PROOF STEP]
proof (cases "n=v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = v \<Longrightarrow> n \<in> {n. adjacent v1 n}
 2. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v1 n}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = v

goal (2 subgoals):
 1. n = v \<Longrightarrow> n \<in> {n. adjacent v1 n}
 2. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v1 n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> {n. adjacent v1 n}
[PROOF STEP]
by (metis True adjacent_sym insertI1 mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v1 n}

goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v1 n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v1 n}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> v

goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v1 n}
[PROOF STEP]
have "n\<notin>{n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<notin> {n. adjacent v2 n}
[PROOF STEP]
by (metis DiffI False \<open>n \<noteq> v1\<close> empty_iff insert_iff v2_adj)
[PROOF STATE]
proof (state)
this:
n \<notin> {n. adjacent v2 n}

goal (1 subgoal):
 1. n \<noteq> v \<Longrightarrow> n \<in> {n. adjacent v1 n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<notin> {n. adjacent v2 n}

goal (1 subgoal):
 1. n \<in> {n. adjacent v1 n}
[PROOF STEP]
by (metis Un_iff \<open>n \<in> V\<close> v1v2_adj)
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v1 n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n \<in> {n. adjacent v1 n}

goal (1 subgoal):
 1. \<And>n. \<lbrakk>{n. adjacent v2 n} - {v1, v} = {}; n \<in> V; n \<noteq> v1\<rbrakk> \<Longrightarrow> adjacent v1 n
[PROOF STEP]
thus "adjacent v1 n"
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. adjacent v1 n}

goal (1 subgoal):
 1. adjacent v1 n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v1 n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{n. adjacent v2 n} - {v1, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{n. adjacent v2 n} - {v1, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
have "{n. adjacent v1 n}-{v2,v}\<noteq>{} \<Longrightarrow> {n. adjacent v2 n}-{v1,v}\<noteq>{} \<Longrightarrow>False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "{n. adjacent v1 n} - {v2, v} \<noteq> {}"  "{n. adjacent v2 n} - {v1, v} \<noteq> {}"
[PROOF STATE]
proof (state)
this:
{n. adjacent v1 n} - {v2, v} \<noteq> {}
{n. adjacent v2 n} - {v1, v} \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{n. adjacent v1 n} - {v2, v} \<noteq> {}
{n. adjacent v2 n} - {v1, v} \<noteq> {}
[PROOF STEP]
obtain a b where a:"a\<in>{n. adjacent v1 n} - {v2, v}"
          and b:"b\<in>{n. adjacent v2 n} - {v1, v}"
[PROOF STATE]
proof (prove)
using this:
{n. adjacent v1 n} - {v2, v} \<noteq> {}
{n. adjacent v2 n} - {v1, v} \<noteq> {}

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> {n. adjacent v1 n} - {v2, v}; b \<in> {n. adjacent v2 n} - {v1, v}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> {n. adjacent v1 n} - {v2, v}
b \<in> {n. adjacent v2 n} - {v1, v}

goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "a=b \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
assume "a=b"
[PROOF STATE]
proof (state)
this:
a = b

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
have "adjacent v1 a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v1 a
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> {n. adjacent v1 n} - {v2, v}

goal (1 subgoal):
 1. adjacent v1 a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v1 a

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 a

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
have "adjacent a v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent a v2
[PROOF STEP]
using b \<open>a=b\<close> adjacent_sym
[PROOF STATE]
proof (prove)
using this:
b \<in> {n. adjacent v2 n} - {v1, v}
a = b
adjacent ?v ?v' = adjacent ?v' ?v

goal (1 subgoal):
 1. adjacent a v2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent a v2

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent a v2

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
have "a\<noteq>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> v
[PROOF STEP]
by (metis DiffD2 \<open>a = b\<close> b doubleton_eq_iff insertI1)
[PROOF STATE]
proof (state)
this:
a \<noteq> v

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<noteq> v

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 v
[PROOF STEP]
by (metis (full_types) adjacent_sym inf_sup_aci(5) insertI1 insert_is_Un mem_Collect_eq
              v1v2)
[PROOF STATE]
proof (state)
this:
adjacent v2 v

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 v

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
have "adjacent v v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v v1
[PROOF STEP]
by (metis (full_types) insertI1 mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
adjacent v v1

goal (1 subgoal):
 1. a = b \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
adjacent v1 a
adjacent a v2
a \<noteq> v
adjacent v2 v
adjacent v v1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
adjacent v1 a
adjacent a v2
a \<noteq> v
adjacent v2 v
adjacent v v1

goal (1 subgoal):
 1. False
[PROOF STEP]
using no_quad[OF friend_assm]
[PROOF STATE]
proof (prove)
using this:
adjacent v1 a
adjacent a v2
a \<noteq> v
adjacent v2 v
adjacent v v1
\<lbrakk>\<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> u \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<noteq> u\<rbrakk> \<Longrightarrow> \<nexists>v1 v2 v3 v4. v2 \<noteq> v4 \<and> v1 \<noteq> v3 \<and> adjacent v1 v2 \<and> adjacent v2 v3 \<and> adjacent v3 v4 \<and> adjacent v4 v1

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>v1\<noteq>v2\<close>
[PROOF STATE]
proof (prove)
using this:
adjacent v1 a
adjacent a v2
a \<noteq> v
adjacent v2 v
adjacent v v1
\<lbrakk>\<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> u \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<noteq> u\<rbrakk> \<Longrightarrow> \<nexists>v1 v2 v3 v4. v2 \<noteq> v4 \<and> v1 \<noteq> v3 \<and> adjacent v1 v2 \<and> adjacent v2 v3 \<and> adjacent v3 v4 \<and> adjacent v4 v1
v1 \<noteq> v2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a = b \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a = b \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "a\<noteq>b\<Longrightarrow>False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
assume "a\<noteq>b"
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
have "a\<in>V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> V
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> {n. adjacent v1 n} - {v2, v}

goal (1 subgoal):
 1. a \<in> V
[PROOF STEP]
by (metis DiffD1 adjacent_V(2) mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
a \<in> V

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> V

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
have "b\<in>V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> V
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<in> {n. adjacent v2 n} - {v1, v}

goal (1 subgoal):
 1. b \<in> V
[PROOF STEP]
by (metis DiffD1 adjacent_V(2) mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
b \<in> V

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
a \<in> V
b \<in> V
[PROOF STEP]
obtain c where "adjacent a c" "adjacent b c"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
a \<in> V
b \<in> V

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>adjacent a c; adjacent b c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using friend_assm[of a b]
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
a \<in> V
b \<in> V
\<lbrakk>a \<in> V; b \<in> V; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>!n. adjacent a n \<and> adjacent b n

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>adjacent a c; adjacent b c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent a c
adjacent b c

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
hence "c\<in>{n. adjacent v1 n} \<union> {n. adjacent v2 n}"
[PROOF STATE]
proof (prove)
using this:
adjacent a c
adjacent b c

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
[PROOF STEP]
by (metis (full_types) adjacent_V(2) v1v2_adj)
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
have "c\<in>{n. adjacent v1 n} \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
assume "c\<in>{n. adjacent v1 n}"
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v1 n}

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
hence "adjacent v1 c"
[PROOF STATE]
proof (prove)
using this:
c \<in> {n. adjacent v1 n}

goal (1 subgoal):
 1. adjacent v1 c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v1 c

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 c

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
have "adjacent c b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent c b
[PROOF STEP]
by (metis \<open>adjacent b c\<close> adjacent_sym)
[PROOF STATE]
proof (state)
this:
adjacent c b

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent c b

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
have "adjacent b v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent b v2
[PROOF STEP]
by (metis (full_types) Diff_iff adjacent_sym b mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
adjacent b v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent b v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 v1
[PROOF STEP]
by (metis \<open>adjacent v1 v2\<close> adjacent_sym)
[PROOF STATE]
proof (state)
this:
adjacent v2 v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
have "c\<noteq>v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> v2
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> c \<noteq> v2"
[PROOF STATE]
proof (state)
this:
\<not> c \<noteq> v2

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
hence "c=v2"
[PROOF STATE]
proof (prove)
using this:
\<not> c \<noteq> v2

goal (1 subgoal):
 1. c = v2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = v2

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
hence "adjacent v2 a"
[PROOF STATE]
proof (prove)
using this:
c = v2

goal (1 subgoal):
 1. adjacent v2 a
[PROOF STEP]
by (metis \<open>adjacent a c\<close> adjacent_sym)
[PROOF STATE]
proof (state)
this:
adjacent v2 a

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 a

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 v
[PROOF STEP]
by (metis adjacent_sym insert_iff mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
adjacent v2 v

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 v

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v1 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v1 v
[PROOF STEP]
using adjacent_sym v1v2
[PROOF STATE]
proof (prove)
using this:
adjacent ?v ?v' = adjacent ?v' ?v
{n. adjacent v n} = {v1, v2}

goal (1 subgoal):
 1. adjacent v1 v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v1 v

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 v

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v1 a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v1 a
[PROOF STEP]
by (metis (full_types) Diff_iff a mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
adjacent v1 a

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
adjacent v2 a
adjacent v2 v
adjacent v1 v
adjacent v1 a
[PROOF STEP]
have "a=v"
[PROOF STATE]
proof (prove)
using this:
adjacent v2 a
adjacent v2 v
adjacent v1 v
adjacent v1 a

goal (1 subgoal):
 1. a = v
[PROOF STEP]
using friend_assm[of v1 v2]
[PROOF STATE]
proof (prove)
using this:
adjacent v2 a
adjacent v2 v
adjacent v1 v
adjacent v1 a
\<lbrakk>v1 \<in> V; v2 \<in> V; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> \<exists>!n. adjacent v1 n \<and> adjacent v2 n

goal (1 subgoal):
 1. a = v
[PROOF STEP]
by (metis \<open>v1 \<noteq> v2\<close> adjacent_V(1))
[PROOF STATE]
proof (state)
this:
a = v

goal (1 subgoal):
 1. \<not> c \<noteq> v2 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
a = v

goal (1 subgoal):
 1. False
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a = v
a \<in> {n. adjacent v1 n} - {v2, v}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c \<noteq> v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c \<noteq> v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
have "b\<noteq>v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> v1
[PROOF STEP]
by (metis DiffD2 b insertI1)
[PROOF STATE]
proof (state)
this:
b \<noteq> v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v1 n} \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
adjacent v1 c
adjacent c b
adjacent b v2
adjacent v2 v1
c \<noteq> v2
b \<noteq> v1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
adjacent v1 c
adjacent c b
adjacent b v2
adjacent v2 v1
c \<noteq> v2
b \<noteq> v1

goal (1 subgoal):
 1. False
[PROOF STEP]
using no_quad[OF friend_assm]
[PROOF STATE]
proof (prove)
using this:
adjacent v1 c
adjacent c b
adjacent b v2
adjacent v2 v1
c \<noteq> v2
b \<noteq> v1
\<lbrakk>\<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> u \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<noteq> u\<rbrakk> \<Longrightarrow> \<nexists>v1 v2 v3 v4. v2 \<noteq> v4 \<and> v1 \<noteq> v3 \<and> adjacent v1 v2 \<and> adjacent v2 v3 \<and> adjacent v3 v4 \<and> adjacent v4 v1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v1 n} \<Longrightarrow> False

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v1 n} \<Longrightarrow> False

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
have "c\<in>{n. adjacent v2 n} \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
assume "c\<in>{n. adjacent v2 n}"
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v2 n}

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
hence "adjacent c v2"
[PROOF STATE]
proof (prove)
using this:
c \<in> {n. adjacent v2 n}

goal (1 subgoal):
 1. adjacent c v2
[PROOF STEP]
by (metis adjacent_sym mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
adjacent c v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent c v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
have "adjacent a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent a c
[PROOF STEP]
using \<open>adjacent a c\<close>
[PROOF STATE]
proof (prove)
using this:
adjacent a c

goal (1 subgoal):
 1. adjacent a c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
adjacent a c

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent a c

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
have "adjacent v1 a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v1 a
[PROOF STEP]
by (metis (full_types) Diff_iff a mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
adjacent v1 a

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 a

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 v1
[PROOF STEP]
by (metis \<open>adjacent v1 v2\<close> adjacent_sym)
[PROOF STATE]
proof (state)
this:
adjacent v2 v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
have "c\<noteq>v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> v1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> c \<noteq> v1"
[PROOF STATE]
proof (state)
this:
\<not> c \<noteq> v1

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
hence "c=v1"
[PROOF STATE]
proof (prove)
using this:
\<not> c \<noteq> v1

goal (1 subgoal):
 1. c = v1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = v1

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
hence "adjacent v1 b"
[PROOF STATE]
proof (prove)
using this:
c = v1

goal (1 subgoal):
 1. adjacent v1 b
[PROOF STEP]
by (metis \<open>adjacent b c\<close> adjacent_sym)
[PROOF STATE]
proof (state)
this:
adjacent v1 b

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 b

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 v
[PROOF STEP]
by (metis adjacent_sym insert_iff mem_Collect_eq v1v2)
[PROOF STATE]
proof (state)
this:
adjacent v2 v

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 v

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v1 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v1 v
[PROOF STEP]
using adjacent_sym v1v2
[PROOF STATE]
proof (prove)
using this:
adjacent ?v ?v' = adjacent ?v' ?v
{n. adjacent v n} = {v1, v2}

goal (1 subgoal):
 1. adjacent v1 v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v1 v

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 v

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 b
[PROOF STEP]
by (metis Diff_iff b mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
adjacent v2 b

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
adjacent v1 b
adjacent v2 v
adjacent v1 v
adjacent v2 b
[PROOF STEP]
have "b=v"
[PROOF STATE]
proof (prove)
using this:
adjacent v1 b
adjacent v2 v
adjacent v1 v
adjacent v2 b

goal (1 subgoal):
 1. b = v
[PROOF STEP]
using friend_assm[of v1 v2]
[PROOF STATE]
proof (prove)
using this:
adjacent v1 b
adjacent v2 v
adjacent v1 v
adjacent v2 b
\<lbrakk>v1 \<in> V; v2 \<in> V; v1 \<noteq> v2\<rbrakk> \<Longrightarrow> \<exists>!n. adjacent v1 n \<and> adjacent v2 n

goal (1 subgoal):
 1. b = v
[PROOF STEP]
by (metis \<open>v1 \<noteq> v2\<close> adjacent_V(1))
[PROOF STATE]
proof (state)
this:
b = v

goal (1 subgoal):
 1. \<not> c \<noteq> v1 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
b = v

goal (1 subgoal):
 1. False
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b = v
b \<in> {n. adjacent v2 n} - {v1, v}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c \<noteq> v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c \<noteq> v1

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
have "a\<noteq>v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> v2
[PROOF STEP]
by (metis DiffD2 a insertI1)
[PROOF STATE]
proof (state)
this:
a \<noteq> v2

goal (1 subgoal):
 1. c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
adjacent c v2
adjacent a c
adjacent v1 a
adjacent v2 v1
c \<noteq> v1
a \<noteq> v2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
adjacent c v2
adjacent a c
adjacent v1 a
adjacent v2 v1
c \<noteq> v1
a \<noteq> v2

goal (1 subgoal):
 1. False
[PROOF STEP]
using no_quad[OF friend_assm]
[PROOF STATE]
proof (prove)
using this:
adjacent c v2
adjacent a c
adjacent v1 a
adjacent v2 v1
c \<noteq> v1
a \<noteq> v2
\<lbrakk>\<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> u \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<noteq> u\<rbrakk> \<Longrightarrow> \<nexists>v1 v2 v3 v4. v2 \<noteq> v4 \<and> v1 \<noteq> v3 \<and> adjacent v1 v2 \<and> adjacent v2 v3 \<and> adjacent v3 v4 \<and> adjacent v4 v1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c \<in> {n. adjacent v2 n} \<Longrightarrow> False

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
c \<in> {n. adjacent v1 n} \<Longrightarrow> False
c \<in> {n. adjacent v2 n} \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
c \<in> {n. adjacent v1 n} \<union> {n. adjacent v2 n}
c \<in> {n. adjacent v1 n} \<Longrightarrow> False
c \<in> {n. adjacent v2 n} \<Longrightarrow> False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<noteq> b \<Longrightarrow> False

goal (1 subgoal):
 1. \<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = b \<Longrightarrow> False
a \<noteq> b \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a = b \<Longrightarrow> False
a \<noteq> b \<Longrightarrow> False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False

goal (2 subgoals):
 1. \<exists>v\<in>V. degree v G = 2 \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
 2. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{n. adjacent v1 n} - {v2, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
{n. adjacent v2 n} - {v1, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
\<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show "\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n"
[PROOF STATE]
proof (prove)
using this:
{n. adjacent v1 n} - {v2, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
{n. adjacent v2 n} - {v1, v} = {} \<Longrightarrow> \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
\<lbrakk>{n. adjacent v1 n} - {v2, v} \<noteq> {}; {n. adjacent v2 n} - {v1, v} \<noteq> {}\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
assume "\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n"
[PROOF STATE]
proof (state)
this:
\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n
[PROOF STEP]
obtain v where v:"\<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (1 subgoal):
 1. (\<And>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
obtain v1 where "v1\<in>V" "v1\<noteq>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "v\<in>V")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<notin> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
v \<notin> V

goal (2 subgoals):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<notin> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "V\<noteq>{}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<noteq> {}
[PROOF STEP]
using \<open>2\<le>card V\<close>
[PROOF STATE]
proof (prove)
using this:
2 \<le> card V

goal (1 subgoal):
 1. V \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V \<noteq> {}

goal (2 subgoals):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<notin> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V \<noteq> {}
[PROOF STEP]
obtain v1 where "v1\<in>V"
[PROOF STATE]
proof (prove)
using this:
V \<noteq> {}

goal (1 subgoal):
 1. (\<And>v1. v1 \<in> V \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v1 \<in> V

goal (2 subgoals):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<notin> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v1 \<in> V

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using False that[of v1]
[PROOF STATE]
proof (prove)
using this:
v1 \<in> V
v \<notin> V
\<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis

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

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
v \<in> V

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> V
[PROOF STEP]
obtain S where  "V = insert v S" "v \<notin> S"
[PROOF STATE]
proof (prove)
using this:
v \<in> V

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>V = insert v S; v \<notin> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  mk_disjoint_insert[OF True]
[PROOF STATE]
proof (prove)
using this:
v \<in> V
\<exists>B. V = insert v B \<and> v \<notin> B

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>V = insert v S; v \<notin> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V = insert v S
v \<notin> S

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
V = insert v S
v \<notin> S

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "finite V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite V
[PROOF STEP]
using \<open>2\<le>card V\<close>
[PROOF STATE]
proof (prove)
using this:
2 \<le> card V

goal (1 subgoal):
 1. finite V
[PROOF STEP]
by (metis add_leE card.infinite not_one_le_zero numeral_Bit0 numeral_One)
[PROOF STATE]
proof (state)
this:
finite V

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
V = insert v S
v \<notin> S
finite V
[PROOF STEP]
have "1\<le>card S"
[PROOF STATE]
proof (prove)
using this:
V = insert v S
v \<notin> S
finite V

goal (1 subgoal):
 1. 1 \<le> card S
[PROOF STEP]
using \<open>2\<le>card V\<close>  card.insert[of S v]  finite_insert[of v S]
[PROOF STATE]
proof (prove)
using this:
V = insert v S
v \<notin> S
finite V
2 \<le> card V
\<lbrakk>finite S; v \<notin> S\<rbrakk> \<Longrightarrow> card (insert v S) = Suc (card S)
finite (insert v S) = finite S

goal (1 subgoal):
 1. 1 \<le> card S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> card S

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "S\<noteq>{}"
[PROOF STATE]
proof (prove)
using this:
1 \<le> card S

goal (1 subgoal):
 1. S \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain v1 where "v1\<in>S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>v1. v1 \<in> S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v1 \<in> S

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "v1\<noteq>v"
[PROOF STATE]
proof (prove)
using this:
v1 \<in> S

goal (1 subgoal):
 1. v1 \<noteq> v
[PROOF STEP]
using \<open>v\<notin>S\<close>
[PROOF STATE]
proof (prove)
using this:
v1 \<in> S
v \<notin> S

goal (1 subgoal):
 1. v1 \<noteq> v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v1 \<noteq> v

goal (1 subgoal):
 1. \<lbrakk>\<And>v1. \<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis; v \<in> V\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus thesis
[PROOF STATE]
proof (prove)
using this:
v1 \<noteq> v

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that[of v1] \<open>v1\<in>S\<close> \<open>V=insert v S\<close>
[PROOF STATE]
proof (prove)
using this:
v1 \<noteq> v
\<lbrakk>v1 \<in> V; v1 \<noteq> v\<rbrakk> \<Longrightarrow> thesis
v1 \<in> S
V = insert v S

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v1 \<in> V
v1 \<noteq> v

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
hence "v\<in>V"
[PROOF STATE]
proof (prove)
using this:
v1 \<in> V
v1 \<noteq> v

goal (1 subgoal):
 1. v \<in> V
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
v1 \<in> V
v1 \<noteq> v
\<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (1 subgoal):
 1. v \<in> V
[PROOF STEP]
by (metis adjacent_V(1))
[PROOF STATE]
proof (state)
this:
v \<in> V

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> V
[PROOF STEP]
obtain v2 where "adjacent v1 v2" "adjacent v v2"
[PROOF STATE]
proof (prove)
using this:
v \<in> V

goal (1 subgoal):
 1. (\<And>v2. \<lbrakk>adjacent v1 v2; adjacent v v2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using friend_assm[of v v1]
[PROOF STATE]
proof (prove)
using this:
v \<in> V
\<lbrakk>v \<in> V; v1 \<in> V; v \<noteq> v1\<rbrakk> \<Longrightarrow> \<exists>!n. adjacent v n \<and> adjacent v1 n

goal (1 subgoal):
 1. (\<And>v2. \<lbrakk>adjacent v1 v2; adjacent v v2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>v1 \<in> V\<close> \<open>v1 \<noteq> v\<close>)
[PROOF STATE]
proof (state)
this:
adjacent v1 v2
adjacent v v2

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
have "degree v1 G\<noteq>2 \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
assume "degree v1 G\<noteq>2"
[PROOF STATE]
proof (state)
this:
degree v1 G \<noteq> 2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
hence "card {n. adjacent v1 n}\<noteq>2"
[PROOF STATE]
proof (prove)
using this:
degree v1 G \<noteq> 2

goal (1 subgoal):
 1. card {n. adjacent v1 n} \<noteq> 2
[PROOF STEP]
by (metis assms(2) degree_adjacent)
[PROOF STATE]
proof (state)
this:
card {n. adjacent v1 n} \<noteq> 2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "{v,v2} \<subseteq> {n. adjacent v1 n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v, v2} \<subseteq> {n. adjacent v1 n}
[PROOF STEP]
by (metis \<open> adjacent v1 v2 \<close> \<open> v1 \<in> V \<close> \<open> v1 \<noteq> v \<close> adjacent_sym bot_least insert_subset
          mem_Collect_eq v)
[PROOF STATE]
proof (state)
this:
{v, v2} \<subseteq> {n. adjacent v1 n}

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{v, v2} \<subseteq> {n. adjacent v1 n}

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "v\<noteq>v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<noteq> v2
[PROOF STEP]
using \<open>adjacent v v2\<close> adjacent_no_loop
[PROOF STATE]
proof (prove)
using this:
adjacent v v2
adjacent ?v ?v' \<Longrightarrow> ?v \<noteq> ?v'

goal (1 subgoal):
 1. v \<noteq> v2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> v2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
hence "card {v,v2} = 2"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> v2

goal (1 subgoal):
 1. card {v, v2} = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {v, v2} = 2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{v, v2} \<subseteq> {n. adjacent v1 n}
card {v, v2} = 2
[PROOF STEP]
have "card {n. adjacent v1 n} \<ge>2"
[PROOF STATE]
proof (prove)
using this:
{v, v2} \<subseteq> {n. adjacent v1 n}
card {v, v2} = 2

goal (1 subgoal):
 1. 2 \<le> card {n. adjacent v1 n}
[PROOF STEP]
using adjacent_finite[OF \<open>finite E\<close>, of v1]
[PROOF STATE]
proof (prove)
using this:
{v, v2} \<subseteq> {n. adjacent v1 n}
card {v, v2} = 2
finite {n. adjacent v1 n}

goal (1 subgoal):
 1. 2 \<le> card {n. adjacent v1 n}
[PROOF STEP]
by (metis card_mono)
[PROOF STATE]
proof (state)
this:
2 \<le> card {n. adjacent v1 n}

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
hence "card {n. adjacent v1 n} \<ge>3"
[PROOF STATE]
proof (prove)
using this:
2 \<le> card {n. adjacent v1 n}

goal (1 subgoal):
 1. 3 \<le> card {n. adjacent v1 n}
[PROOF STEP]
using \<open>card {n. adjacent v1 n}\<noteq>2\<close>
[PROOF STATE]
proof (prove)
using this:
2 \<le> card {n. adjacent v1 n}
card {n. adjacent v1 n} \<noteq> 2

goal (1 subgoal):
 1. 3 \<le> card {n. adjacent v1 n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 \<le> card {n. adjacent v1 n}

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<le> card {n. adjacent v1 n}
[PROOF STEP]
obtain v3 where "v3\<in>{n. adjacent v1 n}" and "v3\<notin>{v,v2}"
[PROOF STATE]
proof (prove)
using this:
3 \<le> card {n. adjacent v1 n}

goal (1 subgoal):
 1. (\<And>v3. \<lbrakk>v3 \<in> {n. adjacent v1 n}; v3 \<notin> {v, v2}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>{v,v2} \<subseteq> {n. adjacent v1 n}\<close> \<open>card {v, v2} = 2\<close>
[PROOF STATE]
proof (prove)
using this:
3 \<le> card {n. adjacent v1 n}
{v, v2} \<subseteq> {n. adjacent v1 n}
card {v, v2} = 2

goal (1 subgoal):
 1. (\<And>v3. \<lbrakk>v3 \<in> {n. adjacent v1 n}; v3 \<notin> {v, v2}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>card {n. adjacent v1 n} \<noteq> 2\<close> subsetI subset_antisym)
[PROOF STATE]
proof (state)
this:
v3 \<in> {n. adjacent v1 n}
v3 \<notin> {v, v2}

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
hence "adjacent v1 v3"
[PROOF STATE]
proof (prove)
using this:
v3 \<in> {n. adjacent v1 n}
v3 \<notin> {v, v2}

goal (1 subgoal):
 1. adjacent v1 v3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v1 v3

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v1 v3

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v3 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v3 v
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n

goal (1 subgoal):
 1. adjacent v3 v
[PROOF STEP]
by (metis \<open>v3 \<notin> {v, v2}\<close> adjacent_V(2) adjacent_sym calculation insertCI)
[PROOF STATE]
proof (state)
this:
adjacent v3 v

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v3 v

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v v2
[PROOF STEP]
using \<open>adjacent v v2\<close>
[PROOF STATE]
proof (prove)
using this:
adjacent v v2

goal (1 subgoal):
 1. adjacent v v2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
adjacent v v2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v v2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "adjacent v2 v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v2 v1
[PROOF STEP]
using \<open>adjacent v1 v2\<close> adjacent_sym
[PROOF STATE]
proof (prove)
using this:
adjacent v1 v2
adjacent ?v ?v' = adjacent ?v' ?v

goal (1 subgoal):
 1. adjacent v2 v1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjacent v2 v1

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
adjacent v2 v1

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "v1\<noteq>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v1 \<noteq> v
[PROOF STEP]
using \<open>v1 \<noteq> v\<close>
[PROOF STATE]
proof (prove)
using this:
v1 \<noteq> v

goal (1 subgoal):
 1. v1 \<noteq> v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v1 \<noteq> v

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v1 \<noteq> v

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
have "v3\<noteq>v2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v3 \<noteq> v2
[PROOF STEP]
by (metis \<open>v3 \<notin> {v, v2}\<close> insert_subset subset_insertI)
[PROOF STATE]
proof (state)
this:
v3 \<noteq> v2

goal (1 subgoal):
 1. degree v1 G \<noteq> 2 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
adjacent v1 v3
adjacent v3 v
adjacent v v2
adjacent v2 v1
v1 \<noteq> v
v3 \<noteq> v2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
adjacent v1 v3
adjacent v3 v
adjacent v v2
adjacent v2 v1
v1 \<noteq> v
v3 \<noteq> v2

goal (1 subgoal):
 1. False
[PROOF STEP]
using no_quad[OF friend_assm]
[PROOF STATE]
proof (prove)
using this:
adjacent v1 v3
adjacent v3 v
adjacent v v2
adjacent v2 v1
v1 \<noteq> v
v3 \<noteq> v2
\<lbrakk>\<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> u \<in> V; \<And>v u. \<lbrakk>v \<in> V; u \<in> V; v \<noteq> u\<rbrakk> \<Longrightarrow> v \<noteq> u\<rbrakk> \<Longrightarrow> \<nexists>v1 v2 v3 v4. v2 \<noteq> v4 \<and> v1 \<noteq> v3 \<and> adjacent v1 v2 \<and> adjacent v2 v3 \<and> adjacent v3 v4 \<and> adjacent v4 v1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree v1 G \<noteq> 2 \<Longrightarrow> False

goal (1 subgoal):
 1. \<exists>v. \<forall>n\<in>V. n \<noteq> v \<longrightarrow> adjacent v n \<Longrightarrow> \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
thus "\<exists>v\<in>V. degree v G = 2"
[PROOF STATE]
proof (prove)
using this:
degree v1 G \<noteq> 2 \<Longrightarrow> False

goal (1 subgoal):
 1. \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
using \<open>v1\<in>V\<close>
[PROOF STATE]
proof (prove)
using this:
degree v1 G \<noteq> 2 \<Longrightarrow> False
v1 \<in> V

goal (1 subgoal):
 1. \<exists>v\<in>V. degree v G = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>v\<in>V. degree v G = 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem infiter_unfold_any: "c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof (induct i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c\<^sup>\<infinity> = (c \<^sup>;^ (0::nat)) ; c\<^sup>\<infinity>
 2. \<And>i::nat. c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity> \<Longrightarrow> c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. c\<^sup>\<infinity> = (c \<^sup>;^ (0::nat)) ; c\<^sup>\<infinity>
 2. \<And>i::nat. c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity> \<Longrightarrow> c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sup>\<infinity> = (c \<^sup>;^ (0::nat)) ; c\<^sup>\<infinity>
variables:
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<infinity> = (c \<^sup>;^ 0) ; c\<^sup>\<infinity>

goal (1 subgoal):
 1. \<And>i::nat. c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity> \<Longrightarrow> c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i::nat. c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity> \<Longrightarrow> c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<infinity> = (c \<^sup>;^ (i::nat)) ; c\<^sup>\<infinity>

goal (1 subgoal):
 1. \<And>i::nat. c\<^sup>\<infinity> = (c \<^sup>;^ i) ; c\<^sup>\<infinity> \<Longrightarrow> c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<infinity> = (c \<^sup>;^ (i::nat)) ; c\<^sup>\<infinity>

goal (1 subgoal):
 1. c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using infiter_unfold seq_assoc seq_power_Suc
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<infinity> = (c \<^sup>;^ (i::nat)) ; c\<^sup>\<infinity>
(?c::'a::refinement_lattice)\<^sup>\<infinity> = ?c ; ?c\<^sup>\<infinity>
(?a::'a::refinement_lattice) ; (?b::'a::refinement_lattice) ; (?c::'a::refinement_lattice) = ?a ; (?b ; ?c)
(?a::'a::refinement_lattice) \<^sup>;^ Suc (?n::nat) = ?a ; (?a \<^sup>;^ ?n)

goal (1 subgoal):
 1. c\<^sup>\<infinity> = (c \<^sup>;^ Suc i) ; c\<^sup>\<infinity>
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<infinity> = (c \<^sup>;^ Suc (i::nat)) ; c\<^sup>\<infinity>

goal:
No subgoals!
variables:
i :: nat
c, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma compact_arc_image: "arc g \<Longrightarrow> compact(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc g \<Longrightarrow> compact (path_image g)
[PROOF STEP]
by (metis compact_path_image arc_imp_path)


[STATEMENT]
lemma closed_Inter [continuous_intros, intro]: "\<forall>S\<in>K. closed S \<Longrightarrow> closed (\<Inter>K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S\<in>K. closed S \<Longrightarrow> closed (\<Inter> K)
[PROOF STEP]
unfolding closed_def uminus_Inf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S\<in>K. open (- S) \<Longrightarrow> open (\<Union> (uminus ` K))
[PROOF STEP]
by auto


[STATEMENT]
lemma moebius_comp_inv_right [simp]:
  shows "moebius_comp M (moebius_inv M) = id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_comp M (moebius_inv M) = id_moebius
[PROOF STEP]
by (metis right_minus plus_moebius_def uminus_moebius_def zero_moebius_def)


[STATEMENT]
lemma list_lemmas: "length []=0" "length (x#xs) = Suc(length xs)"
    "(x#xs) ! 0 = x" "(x#xs) ! Suc n = xs ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length [] = 0 &&& length (x # xs) = Suc (length xs)) &&& (x # xs) ! 0 = x &&& (x # xs) ! Suc n = xs ! n
[PROOF STEP]
by simp_all


[STATEMENT]
lemma ack_less_mono2: "j < k \<Longrightarrow> ack i j < ack i k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < k \<Longrightarrow> ack i j < ack i k
[PROOF STEP]
by (simp add: lift_Suc_mono_less)