[STATEMENT]
lemma step_3_a_similar: "A \<in> carrier_mat n n \<Longrightarrow> i < j \<Longrightarrow> j < n \<Longrightarrow> similar_mat (step_3_a i j A) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j A) A
[PROOF STEP]
proof (induct i j A rule: step_3_a.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j A. \<lbrakk>A \<in> carrier_mat n n; 0 < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a 0 j A) A
 2. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
case (1 j A)
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n
0 < j
j < n

goal (2 subgoals):
 1. \<And>j A. \<lbrakk>A \<in> carrier_mat n n; 0 < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a 0 j A) A
 2. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
0 < j
j < n

goal (1 subgoal):
 1. similar_mat (step_3_a 0 j A) A
[PROOF STEP]
by (simp add: similar_mat_refl)
[PROOF STATE]
proof (state)
this:
similar_mat (step_3_a 0 j A) A

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
case (2 i j A)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x = A $$ (i, j); ?xa = (if A $$ (i, i + 1) = (1::'a) \<and> ?x \<noteq> (0::'a) then add_col_sub_row (- ?x) (Suc i) j A else A); ?xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j ?xa) ?xa
A \<in> carrier_mat n n
Suc i < j
j < n

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
from 2(2-)
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
Suc i < j
j < n
[PROOF STEP]
have A: "A \<in> carrier_mat n n" and ij: "Suc i < j" and j: "j < n"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
Suc i < j
j < n

goal (1 subgoal):
 1. A \<in> carrier_mat n n &&& Suc i < j &&& j < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n
Suc i < j
j < n

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
let ?B = "if A $$ (i, i + 1) = 1 \<and> A $$ (i, j) \<noteq> 0
    then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
obtain B where B: "B = ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. B = (if A $$ (i, i + 1) = (1::'a) \<and> A $$ (i, j) \<noteq> (0::'a) then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B = (if A $$ (i, i + 1) = (1::'a) \<and> A $$ (i, j) \<noteq> (0::'a) then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A)

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
[PROOF STEP]
have Bn: "B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
unfolding B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. (if A $$ (i, i + 1) = (1::'a) \<and> A $$ (i, j) \<noteq> (0::'a) then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A) \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat n n

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
note IH = 2(1)[OF refl B Bn _ j]
[PROOF STATE]
proof (state)
this:
i < j \<Longrightarrow> similar_mat (step_3_a i j B) B

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
have id: "step_3_a (Suc i) j A = step_3_a i j B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. step_3_a (Suc i) j A = step_3_a i j B
[PROOF STEP]
unfolding B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. step_3_a (Suc i) j A = step_3_a i j (if A $$ (i, i + 1) = (1::'a) \<and> A $$ (i, j) \<noteq> (0::'a) then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A)
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
step_3_a (Suc i) j A = step_3_a i j B

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
from ij j
[PROOF STATE]
proof (chain)
picking this:
Suc i < j
j < n
[PROOF STEP]
have *: "Suc i < n" "j < n" "Suc i \<noteq> j"
[PROOF STATE]
proof (prove)
using this:
Suc i < j
j < n

goal (1 subgoal):
 1. Suc i < n &&& j < n &&& Suc i \<noteq> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc i < n
j < n
Suc i \<noteq> j

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
have BA: "similar_mat B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat B A
[PROOF STEP]
unfolding B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (if A $$ (i, i + 1) = (1::'a) \<and> A $$ (i, j) \<noteq> (0::'a) then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A) A
[PROOF STEP]
using similar_mat_refl[OF A] add_col_sub_row_similar[OF A *]
[PROOF STATE]
proof (prove)
using this:
similar_mat A A
similar_mat (add_col_sub_row ?a (Suc i) j A) A

goal (1 subgoal):
 1. similar_mat (if A $$ (i, i + 1) = (1::'a) \<and> A $$ (i, j) \<noteq> (0::'a) then add_col_sub_row (- A $$ (i, j)) (Suc i) j A else A) A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat B A

goal (1 subgoal):
 1. \<And>i j A. \<lbrakk>\<And>x xa. \<lbrakk>x = A $$ (i, j); xa = (if A $$ (i, i + 1) = (1::'a) \<and> x \<noteq> (0::'a) then add_col_sub_row (- x) (Suc i) j A else A); xa \<in> carrier_mat n n; i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a i j xa) xa; A \<in> carrier_mat n n; Suc i < j; j < n\<rbrakk> \<Longrightarrow> similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (step_3_a (Suc i) j A) A
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (step_3_a i j B) A
[PROOF STEP]
by (rule similar_mat_trans[OF IH BA], insert ij, auto)
[PROOF STATE]
proof (state)
this:
similar_mat (step_3_a (Suc i) j A) A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma \<Delta>_zero:
  assumes "\<And>i j. i \<in> I \<Longrightarrow> j \<in> I \<Longrightarrow> i \<noteq> j \<Longrightarrow> indep (A i) (A j)"
  shows "\<Delta>\<^sub>d = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
assume "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
hence "{j. j \<in> I \<and> ineq_dep i j} = {}"
[PROOF STATE]
proof (prove)
using this:
i \<in> I

goal (1 subgoal):
 1. {j \<in> I. i \<noteq> j \<and> \<not> indep (A i) (A j)} = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<in> I
\<lbrakk>?i12 \<in> I; ?j12 \<in> I; ?i12 \<noteq> ?j12\<rbrakk> \<Longrightarrow> indep (A ?i12) (A ?j12)

goal (1 subgoal):
 1. {j \<in> I. i \<noteq> j \<and> \<not> indep (A i) (A j)} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{j \<in> I. i \<noteq> j \<and> \<not> indep (A i) (A j)} = {}

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
hence "(\<Sum>j | j \<in> I \<and> ineq_dep i j. prob (A i \<inter> A j)) = 0"
[PROOF STATE]
proof (prove)
using this:
{j \<in> I. i \<noteq> j \<and> \<not> indep (A i) (A j)} = {}

goal (1 subgoal):
 1. (\<Sum>j | j \<in> I \<and> i \<noteq> j \<and> \<not> indep (A i) (A j). prob (A i \<inter> A j)) = 0
[PROOF STEP]
using sum.empty
[PROOF STATE]
proof (prove)
using this:
{j \<in> I. i \<noteq> j \<and> \<not> indep (A i) (A j)} = {}
sum ?g {} = (0::?'a)

goal (1 subgoal):
 1. (\<Sum>j | j \<in> I \<and> i \<noteq> j \<and> \<not> indep (A i) (A j). prob (A i \<inter> A j)) = 0
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<Sum>j | j \<in> I \<and> i \<noteq> j \<and> \<not> indep (A i) (A j). prob (A i \<inter> A j)) = 0

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i14 \<in> I \<Longrightarrow> (\<Sum>j | j \<in> I \<and> ?i14 \<noteq> j \<and> \<not> indep (A ?i14) (A j). prob (A ?i14 \<inter> A j)) = 0

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
hence "\<Delta>\<^sub>d = (0 :: real) * card I"
[PROOF STATE]
proof (prove)
using this:
?i14 \<in> I \<Longrightarrow> (\<Sum>j | j \<in> I \<and> ?i14 \<noteq> j \<and> \<not> indep (A ?i14) (A j). prob (A ?i14 \<inter> A j)) = 0

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0 * real (card I)
[PROOF STEP]
unfolding \<Delta>\<^sub>d_def
[PROOF STATE]
proof (prove)
using this:
?i14 \<in> I \<Longrightarrow> (\<Sum>j | j \<in> I \<and> ?i14 \<noteq> j \<and> \<not> indep (A ?i14) (A j). prob (A ?i14 \<inter> A j)) = 0

goal (1 subgoal):
 1. (\<Sum>i\<in>I. \<Sum>j | j \<in> I \<and> i \<noteq> j \<and> \<not> indep (A i) (A j). prob (A i \<inter> A j)) = 0 * real (card I)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Delta>\<^sub>d = 0 * real (card I)

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Delta>\<^sub>d = 0 * real (card I)

goal (1 subgoal):
 1. \<Delta>\<^sub>d = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Delta>\<^sub>d = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_not_div_choose_lemma:
  fixes p :: nat
  assumes eeq: "\<And>i. Suc i < K \<Longrightarrow> multiplicity p (Suc i) = multiplicity p (Suc (j + i))"
      and "k < K" and p: "prime p"
    shows "multiplicity p (j + k choose k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (j + k choose k) = 0
[PROOF STEP]
using \<open>k < K\<close>
[PROOF STATE]
proof (prove)
using this:
k < K

goal (1 subgoal):
 1. multiplicity p (j + k choose k) = 0
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < K \<Longrightarrow> multiplicity p (j + 0 choose 0) = 0
 2. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < K

goal (2 subgoals):
 1. 0 < K \<Longrightarrow> multiplicity p (j + 0 choose 0) = 0
 2. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < K
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < K

goal (1 subgoal):
 1. multiplicity p (j + 0 choose 0) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
multiplicity p (j + 0 choose 0) = 0

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K
[PROOF STEP]
have *: "(Suc (j+k) choose Suc k) > 0"
[PROOF STATE]
proof (prove)
using this:
k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0
Suc k < K

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

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < Suc (j + k) choose Suc k
[PROOF STEP]
have "multiplicity p ((Suc (j+k) choose Suc k) * Suc k) = multiplicity p (Suc k)"
[PROOF STATE]
proof (prove)
using this:
0 < Suc (j + k) choose Suc k

goal (1 subgoal):
 1. multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)
[PROOF STEP]
by (subst Suc_times_binomial_eq [symmetric], subst prime_elem_multiplicity_mult_distrib)
       (insert p Suc.prems, simp_all add: eeq [symmetric] Suc.IH)
[PROOF STATE]
proof (state)
this:
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k < K \<Longrightarrow> multiplicity p (j + k choose k) = 0; Suc k < K\<rbrakk> \<Longrightarrow> multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
with p *
[PROOF STATE]
proof (chain)
picking this:
prime p
0 < Suc (j + k) choose Suc k
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prime p
0 < Suc (j + k) choose Suc k
multiplicity p ((Suc (j + k) choose Suc k) * Suc k) = multiplicity p (Suc k)

goal (1 subgoal):
 1. multiplicity p (j + Suc k choose Suc k) = 0
[PROOF STEP]
by (subst (asm) prime_elem_multiplicity_mult_distrib) simp_all
[PROOF STATE]
proof (state)
this:
multiplicity p (j + Suc k choose Suc k) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_conv_radius_norm [simp]:
  "fps_conv_radius (Abs_fps (\<lambda>n. norm (fps_nth f n))) = fps_conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_conv_radius (Abs_fps (\<lambda>n. norm (fps_nth f n))) = fps_conv_radius f
[PROOF STEP]
by (simp add: fps_conv_radius_def)


[STATEMENT]
lemma list_vec [simp]:
  assumes "v \<in> state_qbit 1"
  shows "list_of_vec v = [v $ 0, v $ 1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
have "Rep_vec v = (fst(Rep_vec v), snd(Rep_vec v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_vec v = (fst (Rep_vec v), snd (Rep_vec v))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Rep_vec v = (fst (Rep_vec v), snd (Rep_vec v))

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Rep_vec v = (fst (Rep_vec v), snd (Rep_vec v))

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
have "\<dots> = (2, vec_index v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fst (Rep_vec v), snd (Rep_vec v)) = (2, ($) v)
[PROOF STEP]
by (metis (mono_tags, lifting) assms dim_vec.rep_eq mem_Collect_eq power_one_right state_qbit_def vec_index.rep_eq)
[PROOF STATE]
proof (state)
this:
(fst (Rep_vec v), snd (Rep_vec v)) = (2, ($) v)

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(fst (Rep_vec v), snd (Rep_vec v)) = (2, ($) v)

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
have "[0..<2::nat] = [0,1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<2] = [0, 1]
[PROOF STEP]
by(simp add: upt_rec)
[PROOF STATE]
proof (state)
this:
[0..<2] = [0, 1]

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Rep_vec v = (fst (Rep_vec v), snd (Rep_vec v))
(fst (Rep_vec v), snd (Rep_vec v)) = (2, ($) v)
[0..<2] = [0, 1]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Rep_vec v = (fst (Rep_vec v), snd (Rep_vec v))
(fst (Rep_vec v), snd (Rep_vec v)) = (2, ($) v)
[0..<2] = [0, 1]

goal (1 subgoal):
 1. list_of_vec v = [v $ 0, v $ 1]
[PROOF STEP]
by(simp add: list_of_vec_def)
[PROOF STATE]
proof (state)
this:
list_of_vec v = [v $ 0, v $ 1]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W'_geI:
  assumes "y * exp y \<ge> x" "y \<le> -1" "x \<ge> -exp(-1)"
  shows   "Lambert_W' x \<ge> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> Lambert_W' x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<le> Lambert_W' x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<le> y * exp y
y \<le> - 1
- exp (- 1) \<le> x
[PROOF STEP]
have "y * exp y < 0"
[PROOF STATE]
proof (prove)
using this:
x \<le> y * exp y
y \<le> - 1
- exp (- 1) \<le> x

goal (1 subgoal):
 1. y * exp y < 0
[PROOF STEP]
by (intro mult_neg_pos) auto
[PROOF STATE]
proof (state)
this:
y * exp y < 0

goal (1 subgoal):
 1. y \<le> Lambert_W' x
[PROOF STEP]
hence "Lambert_W' x \<ge> Lambert_W' (y * exp y)"
[PROOF STATE]
proof (prove)
using this:
y * exp y < 0

goal (1 subgoal):
 1. Lambert_W' (y * exp y) \<le> Lambert_W' x
[PROOF STEP]
using assms exp_times_self_ge[of y]
[PROOF STATE]
proof (prove)
using this:
y * exp y < 0
x \<le> y * exp y
y \<le> - 1
- exp (- 1) \<le> x
- exp (- 1) \<le> y * exp y

goal (1 subgoal):
 1. Lambert_W' (y * exp y) \<le> Lambert_W' x
[PROOF STEP]
by (intro Lambert_W'_antimono) auto
[PROOF STATE]
proof (state)
this:
Lambert_W' (y * exp y) \<le> Lambert_W' x

goal (1 subgoal):
 1. y \<le> Lambert_W' x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Lambert_W' (y * exp y) \<le> Lambert_W' x

goal (1 subgoal):
 1. y \<le> Lambert_W' x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Lambert_W' (y * exp y) \<le> Lambert_W' x
x \<le> y * exp y
y \<le> - 1
- exp (- 1) \<le> x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsv_vsubset_vimageE:
  assumes "B \<subseteq>\<^sub>\<circ> r `\<^sub>\<circ> A"
  obtains C where "C \<subseteq>\<^sub>\<circ> A" and "B = r `\<^sub>\<circ> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define C where C_def: "C = (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B) \<inter>\<^sub>\<circ> A"
[PROOF STATE]
proof (state)
this:
C = r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C = r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A
[PROOF STEP]
have "C \<subseteq>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
C = r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A

goal (1 subgoal):
 1. C \<subseteq>\<^sub>\<circ> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C \<subseteq>\<^sub>\<circ> A

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
C \<subseteq>\<^sub>\<circ> A

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "B = r `\<^sub>\<circ> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = r `\<^sub>\<circ> C
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
[PROOF STEP]
proof(intro vsubset_antisym vsubsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
 2. \<And>x. x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A) \<Longrightarrow> x \<in>\<^sub>\<circ> B
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
 2. \<And>x. x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A) \<Longrightarrow> x \<in>\<^sub>\<circ> B
[PROOF STEP]
assume "b \<in>\<^sub>\<circ> B"
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> B

goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
 2. \<And>x. x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A) \<Longrightarrow> x \<in>\<^sub>\<circ> B
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq>\<^sub>\<circ> r `\<^sub>\<circ> A
b \<in>\<^sub>\<circ> B
[PROOF STEP]
obtain a where "a \<in>\<^sub>\<circ> A" and "\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq>\<^sub>\<circ> r `\<^sub>\<circ> A
b \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in>\<^sub>\<circ> A; \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using app_vimageE vsubsetD
[PROOF STATE]
proof (prove)
using this:
B \<subseteq>\<^sub>\<circ> r `\<^sub>\<circ> A
b \<in>\<^sub>\<circ> B
\<lbrakk>?b \<in>\<^sub>\<circ> ?r `\<^sub>\<circ> ?A; \<And>a. \<lbrakk>\<langle>a, ?b\<rangle> \<in>\<^sub>\<circ> ?r; a \<in>\<^sub>\<circ> ?A\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
\<lbrakk>?A \<subseteq>\<^sub>\<circ> ?B; ?x \<in>\<^sub>\<circ> ?A\<rbrakk> \<Longrightarrow> ?x \<in>\<^sub>\<circ> ?B

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in>\<^sub>\<circ> A; \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
a \<in>\<^sub>\<circ> A
\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r

goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
 2. \<And>x. x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A) \<Longrightarrow> x \<in>\<^sub>\<circ> B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> A
\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r
[PROOF STEP]
have "a \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A
\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A
[PROOF STEP]
by (auto simp: \<open>b \<in>\<^sub>\<circ> B\<close>)
[PROOF STATE]
proof (state)
this:
a \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A

goal (2 subgoals):
 1. \<And>x. x \<in>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
 2. \<And>x. x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A) \<Longrightarrow> x \<in>\<^sub>\<circ> B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A
[PROOF STEP]
show "b \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A

goal (1 subgoal):
 1. b \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)
[PROOF STEP]
by (auto intro: \<open>\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r\<close>)
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> r `\<^sub>\<circ> (r\<inverse>\<^sub>\<circ> `\<^sub>\<circ> B \<inter>\<^sub>\<circ> A) \<Longrightarrow> x \<in>\<^sub>\<circ> B
[PROOF STEP]
qed (use vsv_axioms in auto)
[PROOF STATE]
proof (state)
this:
B = r `\<^sub>\<circ> C

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
C \<subseteq>\<^sub>\<circ> A
B = r `\<^sub>\<circ> C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C \<subseteq>\<^sub>\<circ> A
B = r `\<^sub>\<circ> C

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
C \<subseteq>\<^sub>\<circ> A
B = r `\<^sub>\<circ> C
\<lbrakk>?C \<subseteq>\<^sub>\<circ> A; B = r `\<^sub>\<circ> ?C\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma harmonic_aux3 [rule_format]:
  shows "\<forall>(M::nat). (\<Sum>n\<in>{1..(2::nat)^M}. 1 / real n) \<ge> 1 + (real M)/2"
  (is "\<forall>M. ?P M \<ge> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>M. 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
proof (rule allI, cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M. ?P2 M \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
 2. \<And>M. \<not> ?P2 M \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
fix M::nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M. ?P2 M \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
 2. \<And>M. \<not> ?P2 M \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
assume "M=0"
[PROOF STATE]
proof (state)
this:
M = 0

goal (2 subgoals):
 1. \<And>M. ?P2 M \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
 2. \<And>M. \<not> ?P2 M \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M = 0
[PROOF STEP]
show "?P M \<ge> 1 + (real M)/2"
[PROOF STATE]
proof (prove)
using this:
M = 0

goal (1 subgoal):
 1. 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
fix M::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
assume "M\<noteq>0"
[PROOF STATE]
proof (state)
this:
M \<noteq> 0

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M \<noteq> 0
[PROOF STEP]
have "M > 0"
[PROOF STATE]
proof (prove)
using this:
M \<noteq> 0

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

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < M
[PROOF STEP]
have
    "(?P M) =
     (1 + (\<Sum>m\<in>{1..M}. \<Sum>n\<in>{(2::nat)^(m - 1)+1..2^m}. 1/real n))"
[PROOF STATE]
proof (prove)
using this:
0 < M

goal (1 subgoal):
 1. (\<Sum>n = 1..2 ^ M. 1 / real n) = 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
by (rule harmonic_aux2)
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 ^ M. 1 / real n) = 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 ^ M. 1 / real n) = 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
have
    "\<dots> \<ge> (1 + (\<Sum>m\<in>{1..M}. 1/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
let ?f = "(\<lambda>x. 1/2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
let ?g = "(\<lambda>x. (\<Sum>n\<in>{(2::nat)^(x - 1)+1..2^x}. 1/real n))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
from harmonic_aux
[PROOF STATE]
proof (chain)
picking this:
\<forall>m>0. 1 / 2 \<le> (\<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
have "\<And>x. x\<in>{1..M} \<Longrightarrow> ?f x \<le> ?g x"
[PROOF STATE]
proof (prove)
using this:
\<forall>m>0. 1 / 2 \<le> (\<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal (1 subgoal):
 1. \<And>x. x \<in> {1..M} \<Longrightarrow> 1 / 2 \<le> (\<Sum>n = 2 ^ (x - 1) + 1..2 ^ x. 1 / real n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x1 \<in> {1..M} \<Longrightarrow> 1 / 2 \<le> (\<Sum>n = 2 ^ (?x1 - 1) + 1..2 ^ ?x1. 1 / real n)

goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x1 \<in> {1..M} \<Longrightarrow> 1 / 2 \<le> (\<Sum>n = 2 ^ (?x1 - 1) + 1..2 ^ ?x1. 1 / real n)
[PROOF STEP]
have "(\<Sum>m\<in>{1..M}. ?g m) \<ge> (\<Sum>m\<in>{1..M}. ?f m)"
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> {1..M} \<Longrightarrow> 1 / 2 \<le> (\<Sum>n = 2 ^ (?x1 - 1) + 1..2 ^ ?x1. 1 / real n)

goal (1 subgoal):
 1. (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
by (rule sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> 1 + (\<Sum>m = 1..M. \<Sum>n = 2 ^ (m - 1) + 1..2 ^ m. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
have "(?P M) \<ge> (1 + (\<Sum>m\<in>{1..M}. 1/2))"
[PROOF STATE]
proof (prove)
using this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)

goal (1 subgoal):
 1. 1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
have
      "(\<Sum>m\<in>{1..M}. (1::real)/2) = 1/2 * (\<Sum>m\<in>{1..M}. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..M. 1 / 2) = 1 / 2 * (\<Sum>m = 1..M. 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..M. 1 / 2) = 1 / 2 * (\<Sum>m = 1..M. 1)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..M. 1 / 2) = 1 / 2 * (\<Sum>m = 1..M. 1)

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
have
      "\<dots> = 1/2*(real (card {1..M}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 * (\<Sum>m = 1..M. 1) = 1 / 2 * real (card {1..M})
[PROOF STEP]
by (simp only: real_of_card[symmetric])
[PROOF STATE]
proof (state)
this:
1 / 2 * (\<Sum>m = 1..M. 1) = 1 / 2 * real (card {1..M})

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / 2 * (\<Sum>m = 1..M. 1) = 1 / 2 * real (card {1..M})

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
have
      "\<dots> = 1/2*(real M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 * real (card {1..M}) = 1 / 2 * real M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 * real (card {1..M}) = 1 / 2 * real M

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / 2 * real (card {1..M}) = 1 / 2 * real M

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
have
      "\<dots> = (real M)/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 * real M = real M / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 * real M = real M / 2

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>m = 1..M. 1 / 2) = real M / 2
[PROOF STEP]
have "(\<Sum>m\<in>{1..M}. (1::real)/2) = (real M)/2"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m = 1..M. 1 / 2) = real M / 2

goal (1 subgoal):
 1. (\<Sum>m = 1..M. 1 / 2) = real M / 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..M. 1 / 2) = real M / 2

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..M. 1 / 2) = real M / 2

goal (1 subgoal):
 1. \<And>M. M \<noteq> 0 \<Longrightarrow> 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
(\<Sum>m = 1..M. 1 / 2) = real M / 2
[PROOF STEP]
show "(?P M) \<ge> (1 + (real M)/2)"
[PROOF STATE]
proof (prove)
using this:
1 + (\<Sum>m = 1..M. 1 / 2) \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
(\<Sum>m = 1..M. 1 / 2) = real M / 2

goal (1 subgoal):
 1. 1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 + real M / 2 \<le> (\<Sum>n = 1..2 ^ M. 1 / real n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_filter_mset_sorted_nth:
  assumes "distinct xs" "n < length xs" "sorted xs"
  shows "{# x \<in># mset xs. x \<le> xs ! n #} = mset (take (n + 1) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs
n < length xs
sorted xs

goal (1 subgoal):
 1. {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs)
[PROOF STEP]
proof (induction xs arbitrary: n rule: list.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>distinct []; n < length []; sorted []\<rbrakk> \<Longrightarrow> {#x \<in># mset []. x \<le> [] ! n#} = mset (take (n + 1) [])
 2. \<And>x1 x2 n. \<lbrakk>\<And>n. \<lbrakk>distinct x2; n < length x2; sorted x2\<rbrakk> \<Longrightarrow> {#x \<in># mset x2. x \<le> x2 ! n#} = mset (take (n + 1) x2); distinct (x1 # x2); n < length (x1 # x2); sorted (x1 # x2)\<rbrakk> \<Longrightarrow> {#x \<in># mset (x1 # x2). x \<le> (x1 # x2) ! n#} = mset (take (n + 1) (x1 # x2))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>distinct xs; ?n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! ?n#} = mset (take (?n + 1) xs)
distinct (x # xs)
n < length (x # xs)
sorted (x # xs)

goal (2 subgoals):
 1. \<And>n. \<lbrakk>distinct []; n < length []; sorted []\<rbrakk> \<Longrightarrow> {#x \<in># mset []. x \<le> [] ! n#} = mset (take (n + 1) [])
 2. \<And>x1 x2 n. \<lbrakk>\<And>n. \<lbrakk>distinct x2; n < length x2; sorted x2\<rbrakk> \<Longrightarrow> {#x \<in># mset x2. x \<le> x2 ! n#} = mset (take (n + 1) x2); distinct (x1 # x2); n < length (x1 # x2); sorted (x1 # x2)\<rbrakk> \<Longrightarrow> {#x \<in># mset (x1 # x2). x \<le> (x1 # x2) ! n#} = mset (take (n + 1) (x1 # x2))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct xs; ?n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! ?n#} = mset (take (?n + 1) xs)
distinct (x # xs)
n < length (x # xs)
sorted (x # xs)

goal (1 subgoal):
 1. {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = 0\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
 2. \<And>nat. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = Suc nat\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = 0\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
 2. \<And>nat. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = Suc nat\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
using Cons.prems(1,3) filter_mset_is_empty_iff
[PROOF STATE]
proof (prove)
using this:
n = 0
distinct (x # xs)
sorted (x # xs)
(filter_mset ?P ?A = {#}) = (\<forall>x. x \<in># ?A \<longrightarrow> \<not> ?P x)

goal (1 subgoal):
 1. {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))

goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = Suc nat\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = Suc nat\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
case (Suc n')
[PROOF STATE]
proof (state)
this:
n = Suc n'

goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<And>n. \<lbrakk>distinct xs; n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! n#} = mset (take (n + 1) xs); distinct (x # xs); n < length (x # xs); sorted (x # xs); n = Suc nat\<rbrakk> \<Longrightarrow> {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc n'

goal (1 subgoal):
 1. {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
n = Suc n'
\<lbrakk>distinct xs; ?n < length xs; sorted xs\<rbrakk> \<Longrightarrow> {#x \<in># mset xs. x \<le> xs ! ?n#} = mset (take (?n + 1) xs)
distinct (x # xs)
n < length (x # xs)
sorted (x # xs)

goal (1 subgoal):
 1. {#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{#xa \<in># mset (x # xs). xa \<le> (x # xs) ! n#} = mset (take (n + 1) (x # xs))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>distinct []; n < length []; sorted []\<rbrakk> \<Longrightarrow> {#x \<in># mset []. x \<le> [] ! n#} = mset (take (n + 1) [])
[PROOF STEP]
qed auto


[STATEMENT]
lemma Hilbert_fun_empty [simp]: "Hilbert_fun {} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hilbert_fun {} = 0
[PROOF STEP]
by (rule ext) (simp add: Hilbert_fun_def hom_deg_set_def)


[STATEMENT]
lemma (in group) inv_mult_group:
  "[| x \<in> carrier G; y \<in> carrier G |] ==> inv (x \<otimes> y) = inv y \<otimes> inv x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
assume G: "x \<in> carrier G"  "y \<in> carrier G"
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
[PROOF STEP]
have "inv (x \<otimes> y) \<otimes> (x \<otimes> y) = (inv y \<otimes> inv x) \<otimes> (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)
[PROOF STEP]
by (simp add: m_assoc) (simp add: m_assoc [symmetric])
[PROOF STATE]
proof (state)
this:
inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
with G
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
inv (x \<otimes> y) \<otimes> (x \<otimes> y) = inv y \<otimes> inv x \<otimes> (x \<otimes> y)

goal (1 subgoal):
 1. inv (x \<otimes> y) = inv y \<otimes> inv x
[PROOF STEP]
by (simp del: l_inv Units_l_inv)
[PROOF STATE]
proof (state)
this:
inv (x \<otimes> y) = inv y \<otimes> inv x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma del_UnEdge_odd_odd:
    assumes "valid_unMultigraph G" "finite(edges G)" "finite(nodes G)" "(v, w, v')\<in>edges G"
    assumes parity_assms: "odd (degree v G)" "odd (degree v' G)"
    shows "num_of_odd_nodes G=num_of_odd_nodes(del_unEdge v w v' G)+2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
interpret G:valid_unMultigraph
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_unMultigraph G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have  "v\<notin>odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
by (metis G.del_UnEdge_even assms(2) assms(4) parity_assms(1))
[PROOF STATE]
proof (state)
this:
v \<notin> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<notin> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have  "v'\<notin>odd_nodes_set(del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v' \<notin> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
by (metis G.del_UnEdge_even' assms(2) assms(4) parity_assms(2))
[PROOF STATE]
proof (state)
this:
v' \<notin> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<notin> odd_nodes_set (del_unEdge v w v' G)
v' \<notin> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
have vv'_disjoint: "{v,v'} \<inter> odd_nodes_set(del_unEdge v w v' G) = {}"
[PROOF STATE]
proof (prove)
using this:
v \<notin> odd_nodes_set (del_unEdge v w v' G)
v' \<notin> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. {v, v'} \<inter> odd_nodes_set (del_unEdge v w v' G) = {}
[PROOF STEP]
by (metis (full_types) Int_insert_left_if0 inf_bot_left)
[PROOF STATE]
proof (state)
this:
{v, v'} \<inter> odd_nodes_set (del_unEdge v w v' G) = {}

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{v, v'} \<inter> odd_nodes_set (del_unEdge v w v' G) = {}

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have extra_odd_nodes:"{v,v'} \<subseteq> odd_nodes_set( G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v, v'} \<subseteq> odd_nodes_set G
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v, v'} \<subseteq> {v \<in> G.V. odd (degree v G)}
[PROOF STEP]
using \<open>(v,w,v')\<in>edges G\<close>
[PROOF STATE]
proof (prove)
using this:
(v, w, v') \<in> G.E

goal (1 subgoal):
 1. {v, v'} \<subseteq> {v \<in> G.V. odd (degree v G)}
[PROOF STEP]
by (metis (lifting) G.E_validD empty_subsetI insert_subset mem_Collect_eq parity_assms)
[PROOF STATE]
proof (state)
this:
{v, v'} \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{v, v'} \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have "odd_nodes_set G -{v,v'}\<subseteq>odd_nodes_set (del_unEdge v w v' G) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd_nodes_set G - {v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
assume x_odd_set: "x \<in> odd_nodes_set G - {v, v'}"
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set G - {v, v'}

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
hence "degree x G = degree x (del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set G - {v, v'}

goal (1 subgoal):
 1. degree x G = degree x (del_unEdge v w v' G)
[PROOF STEP]
by (metis Diff_iff G.degree_frame assms(2))
[PROOF STATE]
proof (state)
this:
degree x G = degree x (del_unEdge v w v' G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
hence "odd(degree x (del_unEdge v w v' G))"
[PROOF STATE]
proof (prove)
using this:
degree x G = degree x (del_unEdge v w v' G)

goal (1 subgoal):
 1. odd (degree x (del_unEdge v w v' G))
[PROOF STEP]
using x_odd_set
[PROOF STATE]
proof (prove)
using this:
degree x G = degree x (del_unEdge v w v' G)
x \<in> odd_nodes_set G - {v, v'}

goal (1 subgoal):
 1. odd (degree x (del_unEdge v w v' G))
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
degree x G = degree x (del_unEdge v w v' G)
x \<in> {v \<in> G.V. odd (degree v G)} - {v, v'}

goal (1 subgoal):
 1. odd (degree x (del_unEdge v w v' G))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd (degree x (del_unEdge v w v' G))

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd (degree x (del_unEdge v w v' G))

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
have "x \<in> nodes (del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> nodes (del_unEdge v w v' G)
[PROOF STEP]
using x_odd_set
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set G - {v, v'}

goal (1 subgoal):
 1. x \<in> nodes (del_unEdge v w v' G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {v \<in> G.V. odd (degree v G)} - {v, v'}

goal (1 subgoal):
 1. x \<in> nodes (del_unEdge v w v' G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> nodes (del_unEdge v w v' G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set G - {v, v'} \<Longrightarrow> x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
odd (degree x (del_unEdge v w v' G))
x \<in> nodes (del_unEdge v w v' G)
[PROOF STEP]
show "x \<in> odd_nodes_set (del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
using this:
odd (degree x (del_unEdge v w v' G))
x \<in> nodes (del_unEdge v w v' G)

goal (1 subgoal):
 1. x \<in> odd_nodes_set (del_unEdge v w v' G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
odd (degree x (del_unEdge v w v' G))
x \<in> nodes (del_unEdge v w v' G)

goal (1 subgoal):
 1. x \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set (del_unEdge v w v' G)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd_nodes_set G - {v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd_nodes_set G - {v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have "odd_nodes_set (del_unEdge v w v' G) \<subseteq> odd_nodes_set G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) \<subseteq> odd_nodes_set G
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
assume x_odd_set:  "x \<in> odd_nodes_set (del_unEdge v w v' G)"
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
hence "x\<notin>{v,v'} \<Longrightarrow> odd(degree x G)"
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set (del_unEdge v w v' G)

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)
[PROOF STEP]
using assms G.degree_frame
[PROOF STATE]
proof (prove)
using this:
x \<in> odd_nodes_set (del_unEdge v w v' G)
valid_unMultigraph G
finite G.E
finite G.V
(v, w, v') \<in> G.E
odd (degree v G)
odd (degree v' G)
\<lbrakk>finite G.E; ?x \<notin> {?v, ?v'}\<rbrakk> \<Longrightarrow> degree ?x (del_unEdge ?v ?w ?v' G) = degree ?x G

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
valid_unMultigraph G
finite G.E
finite G.V
(v, w, v') \<in> G.E
odd (degree v G)
odd (degree v' G)
\<lbrakk>finite G.E; ?x \<notin> {?v, ?v'}\<rbrakk> \<Longrightarrow> degree ?x (del_unEdge ?v ?w ?v' G) = degree ?x G

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
hence "x\<notin>{v,v'} \<Longrightarrow> x\<in>odd_nodes_set G"
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
using x_odd_set del_UnEdge_node
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)
x \<in> odd_nodes_set (del_unEdge v w v' G)
(?v \<in> nodes (del_unEdge ?u ?e ?u' ?G)) = (?v \<in> nodes ?G)

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> odd (degree x G)
x \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
(?v \<in> nodes (del_unEdge ?u ?e ?u' ?G)) = (?v \<in> nodes ?G)

goal (1 subgoal):
 1. x \<notin> {v, v'} \<Longrightarrow> x \<in> {v \<in> G.V. odd (degree v G)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
have "x\<in>{v,v'} \<Longrightarrow> x\<in>odd_nodes_set G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
using extra_odd_nodes
[PROOF STATE]
proof (prove)
using this:
{v, v'} \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G

goal (1 subgoal):
 1. \<And>x. x \<in> odd_nodes_set (del_unEdge v w v' G) \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
[PROOF STEP]
show "x \<in> odd_nodes_set G"
[PROOF STATE]
proof (prove)
using this:
x \<notin> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G
x \<in> {v, v'} \<Longrightarrow> x \<in> odd_nodes_set G

goal (1 subgoal):
 1. x \<in> odd_nodes_set G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> odd_nodes_set G

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{v, v'} \<inter> odd_nodes_set (del_unEdge v w v' G) = {}
{v, v'} \<subseteq> odd_nodes_set G
odd_nodes_set G - {v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)
odd_nodes_set (del_unEdge v w v' G) \<subseteq> odd_nodes_set G
[PROOF STEP]
have "odd_nodes_set G=odd_nodes_set (del_unEdge v w v' G) \<union> {v,v'}"
[PROOF STATE]
proof (prove)
using this:
{v, v'} \<inter> odd_nodes_set (del_unEdge v w v' G) = {}
{v, v'} \<subseteq> odd_nodes_set G
odd_nodes_set G - {v, v'} \<subseteq> odd_nodes_set (del_unEdge v w v' G)
odd_nodes_set (del_unEdge v w v' G) \<subseteq> odd_nodes_set G

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
assume "odd_nodes_set G=odd_nodes_set (del_unEdge v w v' G) \<union> {v,v'}"
[PROOF STATE]
proof (state)
this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have " odd_nodes_set (del_unEdge v w v' G) \<inter> {v,v'} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}
[PROOF STEP]
using vv'_disjoint
[PROOF STATE]
proof (prove)
using this:
{v, v'} \<inter> odd_nodes_set (del_unEdge v w v' G) = {}

goal (1 subgoal):
 1. odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have "finite(odd_nodes_set (del_unEdge v w v' G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (odd_nodes_set (del_unEdge v w v' G))
[PROOF STEP]
using assms del_UnEdge_node finite_subset
[PROOF STATE]
proof (prove)
using this:
valid_unMultigraph G
finite G.E
finite G.V
(v, w, v') \<in> G.E
odd (degree v G)
odd (degree v' G)
(?v \<in> nodes (del_unEdge ?u ?e ?u' ?G)) = (?v \<in> nodes ?G)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (odd_nodes_set (del_unEdge v w v' G))
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
valid_unMultigraph G
finite G.E
finite G.V
(v, w, v') \<in> G.E
odd (degree v G)
odd (degree v' G)
(?v \<in> nodes (del_unEdge ?u ?e ?u' ?G)) = (?v \<in> nodes ?G)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (odd_nodes_set (del_unEdge v w v' G))

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (odd_nodes_set (del_unEdge v w v' G))

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have "finite {v,v'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {v, v'}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {v, v'}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}
odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}
finite (odd_nodes_set (del_unEdge v w v' G))
finite {v, v'}
[PROOF STEP]
have "card(odd_nodes_set G)
                       = card(odd_nodes_set  (del_unEdge v w v' G)) + card{v,v'}"
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}
odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}
finite (odd_nodes_set (del_unEdge v w v' G))
finite {v, v'}

goal (1 subgoal):
 1. card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}
[PROOF STEP]
unfolding num_of_odd_nodes_def
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}
odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}
finite (odd_nodes_set (del_unEdge v w v' G))
finite {v, v'}

goal (1 subgoal):
 1. card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}
[PROOF STEP]
using card_Un_disjoint
[PROOF STATE]
proof (prove)
using this:
odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'}
odd_nodes_set (del_unEdge v w v' G) \<inter> {v, v'} = {}
finite (odd_nodes_set (del_unEdge v w v' G))
finite {v, v'}
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> card (?A \<union> ?B) = card ?A + card ?B

goal (1 subgoal):
 1. card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
have "v\<noteq>v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<noteq> v'
[PROOF STEP]
using G.no_id \<open>(v,w,v')\<in>edges G\<close>
[PROOF STATE]
proof (prove)
using this:
(?v, ?w, ?v) \<notin> G.E
(v, w, v') \<in> G.E

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

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
hence "card{v,v'}=2"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> v'

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

goal (1 subgoal):
 1. odd_nodes_set G = odd_nodes_set (del_unEdge v w v' G) \<union> {v, v'} \<Longrightarrow> num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}
card {v, v'} = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}
card {v, v'} = 2

goal (1 subgoal):
 1. num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2
[PROOF STEP]
unfolding num_of_odd_nodes_def
[PROOF STATE]
proof (prove)
using this:
card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + card {v, v'}
card {v, v'} = 2

goal (1 subgoal):
 1. card (odd_nodes_set G) = card (odd_nodes_set (del_unEdge v w v' G)) + 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes G = num_of_odd_nodes (del_unEdge v w v' G) + 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniformly_convergent_eval_fds_aux':
  assumes conv: "fds_converges f (s0 :: 'a)"
  assumes B: "compact B" "\<And>z. z \<in> B \<Longrightarrow> z \<bullet> 1 > s0 \<bullet> 1"
  shows   "uniformly_convergent_on B (\<lambda>N z. \<Sum>n\<le>N. fds_nth f n / nat_power n z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_convergent_on B (\<lambda>N z. \<Sum>n\<le>N. fds_nth f n / nat_power n z)
[PROOF STEP]
proof (rule uniformly_convergent_eval_fds_aux)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Bseq (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k ?s0.0)
 2. compact B
 3. \<And>z. z \<in> B \<Longrightarrow> ?s0.0 \<bullet> (1::'a) < z \<bullet> (1::'a)
[PROOF STEP]
from conv
[PROOF STATE]
proof (chain)
picking this:
fds_converges f s0
[PROOF STEP]
have "convergent (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)"
[PROOF STATE]
proof (prove)
using this:
fds_converges f s0

goal (1 subgoal):
 1. convergent (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)
[PROOF STEP]
by (simp add: fds_converges_def summable_iff_convergent')
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)

goal (3 subgoals):
 1. Bseq (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k ?s0.0)
 2. compact B
 3. \<And>z. z \<in> B \<Longrightarrow> ?s0.0 \<bullet> (1::'a) < z \<bullet> (1::'a)
[PROOF STEP]
thus "Bseq (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)

goal (1 subgoal):
 1. Bseq (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)
[PROOF STEP]
by (rule convergent_imp_Bseq)
[PROOF STATE]
proof (state)
this:
Bseq (\<lambda>n. \<Sum>k\<le>n. fds_nth f k / nat_power k s0)

goal (2 subgoals):
 1. compact B
 2. \<And>z. z \<in> B \<Longrightarrow> s0 \<bullet> (1::'a) < z \<bullet> (1::'a)
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma ereal_pos_sum_distrib_left:
  fixes f :: "'a \<Rightarrow> ereal"
  assumes "r\<ge>0" "r \<noteq> \<infinity>"
  shows "r * sum f A = sum (\<lambda>n. r * f n) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
 2. infinite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
 2. infinite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r * sum f {} = (\<Sum>n\<in>{}. r * f n)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; r * sum f F = (\<Sum>n\<in>F. r * f n)\<rbrakk> \<Longrightarrow> r * sum f (insert x F) = (\<Sum>n\<in>insert x F. r * f n)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. r * sum f {} = (\<Sum>n\<in>{}. r * f n)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; r * sum f F = (\<Sum>n\<in>F. r * f n)\<rbrakk> \<Longrightarrow> r * sum f (insert x F) = (\<Sum>n\<in>insert x F. r * f n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * sum f {} = (\<Sum>n\<in>{}. r * f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r * sum f {} = (\<Sum>n\<in>{}. r * f n)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; r * sum f F = (\<Sum>n\<in>F. r * f n)\<rbrakk> \<Longrightarrow> r * sum f (insert x F) = (\<Sum>n\<in>insert x F. r * f n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; r * sum f F = (\<Sum>n\<in>F. r * f n)\<rbrakk> \<Longrightarrow> r * sum f (insert x F) = (\<Sum>n\<in>insert x F. r * f n)
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
r * sum f A = (\<Sum>n\<in>A. r * f n)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; r * sum f F = (\<Sum>n\<in>F. r * f n)\<rbrakk> \<Longrightarrow> r * sum f (insert x F) = (\<Sum>n\<in>insert x F. r * f n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
r * sum f A = (\<Sum>n\<in>A. r * f n)

goal (1 subgoal):
 1. r * sum f (insert x A) = (\<Sum>n\<in>insert x A. r * f n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
r * sum f A = (\<Sum>n\<in>A. r * f n)
0 \<le> r
r \<noteq> \<infinity>

goal (1 subgoal):
 1. r * sum f (insert x A) = (\<Sum>n\<in>insert x A. r * f n)
[PROOF STEP]
by (simp add: ereal_pos_distrib)
[PROOF STATE]
proof (state)
this:
r * sum f (insert x A) = (\<Sum>n\<in>insert x A. r * f n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
r * sum f A = (\<Sum>n\<in>A. r * f n)

goal (1 subgoal):
 1. infinite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. r * sum f A = (\<Sum>n\<in>A. r * f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r * sum f A = (\<Sum>n\<in>A. r * f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroup_of_subgroup_generated:
  assumes "H \<subseteq> B" "subgroup H G"
    shows "subgroup H (subgroup_generated G B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H (subgroup_generated G B)
[PROOF STEP]
proof unfold_locales
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. H \<subseteq> carrier (subgroup_generated G B)
 2. \<And>x y. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G B\<^esub> y \<in> H
 3. \<one>\<^bsub>subgroup_generated G B\<^esub> \<in> H
 4. \<And>x. x \<in> H \<Longrightarrow> inv\<^bsub>subgroup_generated G B\<^esub> x \<in> H
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. H \<subseteq> carrier (subgroup_generated G B)
 2. \<And>x y. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G B\<^esub> y \<in> H
 3. \<one>\<^bsub>subgroup_generated G B\<^esub> \<in> H
 4. \<And>x. x \<in> H \<Longrightarrow> inv\<^bsub>subgroup_generated G B\<^esub> x \<in> H
[PROOF STEP]
assume "x \<in> H"
[PROOF STATE]
proof (state)
this:
x \<in> H

goal (4 subgoals):
 1. H \<subseteq> carrier (subgroup_generated G B)
 2. \<And>x y. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G B\<^esub> y \<in> H
 3. \<one>\<^bsub>subgroup_generated G B\<^esub> \<in> H
 4. \<And>x. x \<in> H \<Longrightarrow> inv\<^bsub>subgroup_generated G B\<^esub> x \<in> H
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
H \<subseteq> B
subgroup H G
x \<in> H
[PROOF STEP]
show "inv\<^bsub>subgroup_generated G B\<^esub> x \<in> H"
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> B
subgroup H G
x \<in> H

goal (1 subgoal):
 1. inv\<^bsub>subgroup_generated G B\<^esub> x \<in> H
[PROOF STEP]
unfolding subgroup_generated_def
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> B
subgroup H G
x \<in> H

goal (1 subgoal):
 1. inv\<^bsub>G\<lparr>carrier := generate G (carrier G \<inter> B)\<rparr>\<^esub> x \<in> H
[PROOF STEP]
by (metis IntI Int_commute Int_lower2 generate.incl generate_is_subgroup m_inv_consistent subgroup_def subsetCE)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>subgroup_generated G B\<^esub> x \<in> H

goal (3 subgoals):
 1. H \<subseteq> carrier (subgroup_generated G B)
 2. \<And>x y. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G B\<^esub> y \<in> H
 3. \<one>\<^bsub>subgroup_generated G B\<^esub> \<in> H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. H \<subseteq> carrier (subgroup_generated G B)
 2. \<And>x y. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G B\<^esub> y \<in> H
 3. \<one>\<^bsub>subgroup_generated G B\<^esub> \<in> H
[PROOF STEP]
show "H \<subseteq> carrier (subgroup_generated G B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H \<subseteq> carrier (subgroup_generated G B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> B
subgroup H G

goal (1 subgoal):
 1. H \<subseteq> carrier (subgroup_generated G B)
[PROOF STEP]
apply (auto simp: carrier_subgroup_generated)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>H \<subseteq> B; subgroup H G; x \<in> H\<rbrakk> \<Longrightarrow> x \<in> generate G (carrier G \<inter> B)
[PROOF STEP]
by (metis Int_iff generate.incl inf.orderE subgroup.mem_carrier)
[PROOF STATE]
proof (state)
this:
H \<subseteq> carrier (subgroup_generated G B)

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> H; y \<in> H\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>subgroup_generated G B\<^esub> y \<in> H
 2. \<one>\<^bsub>subgroup_generated G B\<^esub> \<in> H
[PROOF STEP]
qed (use assms in \<open>auto simp: subgroup_generated_def subgroup_def\<close>)


[STATEMENT]
lemma ln_x_over_x_mono:
  fixes x :: real
  assumes x: "exp 1 \<le> x" "x \<le> y"
  shows "ln y / y \<le> ln x / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
note x
[PROOF STATE]
proof (state)
this:
exp 1 \<le> x
x \<le> y

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
exp 1 \<le> x
x \<le> y

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "0 < exp (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < exp 1

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
exp 1 \<le> x
x \<le> y
0 < exp 1
[PROOF STEP]
have a: "0 < x" and b: "0 < y"
[PROOF STATE]
proof (prove)
using this:
exp 1 \<le> x
x \<le> y
0 < exp 1

goal (1 subgoal):
 1. 0 < x &&& 0 < y
[PROOF STEP]
by (fast intro: less_le_trans order_trans)+
[PROOF STATE]
proof (state)
this:
0 < x
0 < y

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "x * ln y - x * ln x = x * (ln y - ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * ln y - x * ln x = x * (ln y - ln x)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
x * ln y - x * ln x = x * (ln y - ln x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * ln y - x * ln x = x * (ln y - ln x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> = x * ln (y / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (ln y - ln x) = x * ln (y / x)
[PROOF STEP]
by (simp only: ln_div a b)
[PROOF STATE]
proof (state)
this:
x * (ln y - ln x) = x * ln (y / x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * (ln y - ln x) = x * ln (y / x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "y / x = (x + (y - x)) / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y / x = (x + (y - x)) / x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y / x = (x + (y - x)) / x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y / x = (x + (y - x)) / x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> = 1 + (y - x) / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + (y - x)) / x = 1 + (y - x) / x
[PROOF STEP]
using x a
[PROOF STATE]
proof (prove)
using this:
exp 1 \<le> x
x \<le> y
0 < x

goal (1 subgoal):
 1. (x + (y - x)) / x = 1 + (y - x) / x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(x + (y - x)) / x = 1 + (y - x) / x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x + (y - x)) / x = 1 + (y - x) / x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "x * ln (1 + (y - x) / x) \<le> x * ((y - x) / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * ln (1 + (y - x) / x) \<le> x * ((y - x) / x)
[PROOF STEP]
using x a
[PROOF STATE]
proof (prove)
using this:
exp 1 \<le> x
x \<le> y
0 < x

goal (1 subgoal):
 1. x * ln (1 + (y - x) / x) \<le> x * ((y - x) / x)
[PROOF STEP]
by (intro mult_left_mono ln_add_one_self_le_self) simp_all
[PROOF STATE]
proof (state)
this:
x * ln (1 + (y - x) / x) \<le> x * ((y - x) / x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * ln (1 + (y - x) / x) \<le> x * ((y - x) / x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> = y - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * ((y - x) / x) = y - x
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. x * ((y - x) / x) = y - x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x * ((y - x) / x) = y - x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * ((y - x) / x) = y - x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> = (y - x) * ln (exp 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y - x = (y - x) * ln (exp 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y - x = (y - x) * ln (exp 1)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y - x = (y - x) * ln (exp 1)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> \<le> (y - x) * ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y - x) * ln (exp 1) \<le> (y - x) * ln x
[PROOF STEP]
using a x exp_total of_nat_1 x(1)
[PROOF STATE]
proof (prove)
using this:
0 < x
exp 1 \<le> x
x \<le> y
0 < ?y \<Longrightarrow> \<exists>x. exp x = ?y
of_nat 1 = (1::?'a)
exp 1 \<le> x

goal (1 subgoal):
 1. (y - x) * ln (exp 1) \<le> (y - x) * ln x
[PROOF STEP]
by (fastforce intro: mult_left_mono)
[PROOF STATE]
proof (state)
this:
(y - x) * ln (exp 1) \<le> (y - x) * ln x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(y - x) * ln (exp 1) \<le> (y - x) * ln x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> = y * ln x - x * ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y - x) * ln x = y * ln x - x * ln x
[PROOF STEP]
by (rule left_diff_distrib)
[PROOF STATE]
proof (state)
this:
(y - x) * ln x = y * ln x - x * ln x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * ln y - x * ln x \<le> y * ln x - x * ln x
[PROOF STEP]
have "x * ln y \<le> y * ln x"
[PROOF STATE]
proof (prove)
using this:
x * ln y - x * ln x \<le> y * ln x - x * ln x

goal (1 subgoal):
 1. x * ln y \<le> y * ln x
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
x * ln y \<le> y * ln x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x * ln y \<le> y * ln x
[PROOF STEP]
have "ln y \<le> (y * ln x) / x"
[PROOF STATE]
proof (prove)
using this:
x * ln y \<le> y * ln x

goal (1 subgoal):
 1. ln y \<le> y * ln x / x
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
x * ln y \<le> y * ln x
0 < x

goal (1 subgoal):
 1. ln y \<le> y * ln x / x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
ln y \<le> y * ln x / x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln y \<le> y * ln x / x

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
have "\<dots> = y * (ln x / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * ln x / x = y * (ln x / x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y * ln x / x = y * (ln x / x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln y \<le> y * (ln x / x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln y \<le> y * (ln x / x)

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
ln y \<le> y * (ln x / x)
0 < y

goal (1 subgoal):
 1. ln y / y \<le> ln x / x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
ln y / y \<le> ln x / x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) prod_mem_prod_ideals:"\<lbrakk>ideal R I; ideal R J; i \<in> I; j \<in> J\<rbrakk> \<Longrightarrow>
                            i \<cdot>\<^sub>r j \<in> (I \<diamondsuit>\<^sub>r J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; ideal R J; i \<in> I; j \<in> J\<rbrakk> \<Longrightarrow> i \<cdot>\<^sub>r j \<in> I \<diamondsuit>\<^sub>r J
[PROOF STEP]
apply (simp add:ideal_prod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R I; ideal R J; i \<in> I; j \<in> J\<rbrakk> \<Longrightarrow> \<forall>x. ideal R x \<and> {x. \<exists>i\<in>I. \<exists>j\<in>J. x = i \<cdot>\<^sub>r j} \<subseteq> x \<longrightarrow> i \<cdot>\<^sub>r j \<in> x
[PROOF STEP]
apply (rule allI, rule impI, erule conjE, rename_tac X)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>ideal R I; ideal R J; i \<in> I; j \<in> J; ideal R X; {x. \<exists>i\<in>I. \<exists>j\<in>J. x = i \<cdot>\<^sub>r j} \<subseteq> X\<rbrakk> \<Longrightarrow> i \<cdot>\<^sub>r j \<in> X
[PROOF STEP]
apply (rule_tac A = "{x. \<exists>i\<in>I. \<exists>j\<in>J. x = Ring.tp R i j}" and B = X and c = "i \<cdot>\<^sub>r j" in  subsetD, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>ideal R I; ideal R J; i \<in> I; j \<in> J; ideal R X; {x. \<exists>i\<in>I. \<exists>j\<in>J. x = i \<cdot>\<^sub>r j} \<subseteq> X\<rbrakk> \<Longrightarrow> i \<cdot>\<^sub>r j \<in> {x. \<exists>i\<in>I. \<exists>j\<in>J. x = i \<cdot>\<^sub>r j}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<lbrakk>ideal R I; ideal R J; i \<in> I; j \<in> J; ideal R X; {x. \<exists>i\<in>I. \<exists>j\<in>J. x = i \<cdot>\<^sub>r j} \<subseteq> X\<rbrakk> \<Longrightarrow> \<exists>ia\<in>I. \<exists>ja\<in>J. i \<cdot>\<^sub>r j = ia \<cdot>\<^sub>r ja
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Jacobi_eq_0_not_coprime:
  assumes "n \<noteq> 0" "\<not>coprime a n"
  shows   "Jacobi a n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
\<not> coprime a n
[PROOF STEP]
have "\<exists>p. p dvd gcd a n \<and> prime p"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
\<not> coprime a n

goal (1 subgoal):
 1. \<exists>p. p dvd gcd a n \<and> prime p
[PROOF STEP]
by (intro prime_divisor_exists) auto
[PROOF STATE]
proof (state)
this:
\<exists>p. p dvd gcd a n \<and> prime p

goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. p dvd gcd a n \<and> prime p
[PROOF STEP]
obtain p where p: "p dvd a" "p dvd n" "prime p"
[PROOF STATE]
proof (prove)
using this:
\<exists>p. p dvd gcd a n \<and> prime p

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p dvd a; p dvd n; prime p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p dvd a
p dvd n
prime p

goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
hence "Legendre a p = 0"
[PROOF STATE]
proof (prove)
using this:
p dvd a
p dvd n
prime p

goal (1 subgoal):
 1. Legendre a p = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p dvd a
p dvd n
prime p
n \<noteq> 0
\<not> coprime a n

goal (1 subgoal):
 1. Legendre a p = 0
[PROOF STEP]
by (auto simp: prime_int_iff)
[PROOF STATE]
proof (state)
this:
Legendre a p = 0

goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Legendre a p = 0

goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
using p assms
[PROOF STATE]
proof (prove)
using this:
Legendre a p = 0
p dvd a
p dvd n
prime p
n \<noteq> 0
\<not> coprime a n

goal (1 subgoal):
 1. Jacobi a n = 0
[PROOF STEP]
unfolding Jacobi_def
[PROOF STATE]
proof (prove)
using this:
Legendre a p = 0
p dvd a
p dvd n
prime p
n \<noteq> 0
\<not> coprime a n

goal (1 subgoal):
 1. (if n = 0 then 0 else \<Prod>\<^sub># (image_mset (Legendre a) (prime_factorization n))) = 0
[PROOF STEP]
by (auto simp: image_iff prime_factors_dvd)
[PROOF STATE]
proof (state)
this:
Jacobi a n = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lhd_ldrop:
  assumes "n < llength xs"
  shows "lhd (ldrop n xs) = lnth xs (the_enat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lhd (ldrop n xs) = lnth xs (the_enat n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lhd (ldrop n xs) = lnth xs (the_enat n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n < llength xs
[PROOF STEP]
obtain n' where n: "n = enat n'"
[PROOF STATE]
proof (prove)
using this:
n < llength xs

goal (1 subgoal):
 1. (\<And>n'. n = enat n' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases n) auto
[PROOF STATE]
proof (state)
this:
n = enat n'

goal (1 subgoal):
 1. lhd (ldrop n xs) = lnth xs (the_enat n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
n < llength xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n < llength xs

goal (1 subgoal):
 1. lhd (ldrop n xs) = lnth xs (the_enat n)
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
using this:
enat n' < llength xs

goal (1 subgoal):
 1. lhd (ldrop (enat n') xs) = lnth xs (the_enat (enat n'))
[PROOF STEP]
proof(induction n' arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. enat 0 < llength xs \<Longrightarrow> lhd (ldrop (enat 0) xs) = lnth xs (the_enat (enat 0))
 2. \<And>n' xs. \<lbrakk>\<And>xs. enat n' < llength xs \<Longrightarrow> lhd (ldrop (enat n') xs) = lnth xs (the_enat (enat n')); enat (Suc n') < llength xs\<rbrakk> \<Longrightarrow> lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
enat 0 < llength xs

goal (2 subgoals):
 1. \<And>xs. enat 0 < llength xs \<Longrightarrow> lhd (ldrop (enat 0) xs) = lnth xs (the_enat (enat 0))
 2. \<And>n' xs. \<lbrakk>\<And>xs. enat n' < llength xs \<Longrightarrow> lhd (ldrop (enat n') xs) = lnth xs (the_enat (enat n')); enat (Suc n') < llength xs\<rbrakk> \<Longrightarrow> lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
enat 0 < llength xs

goal (1 subgoal):
 1. lhd (ldrop (enat 0) xs) = lnth xs (the_enat (enat 0))
[PROOF STEP]
by(simp add: zero_enat_def[symmetric] lhd_conv_lnth)
[PROOF STATE]
proof (state)
this:
lhd (ldrop (enat 0) xs) = lnth xs (the_enat (enat 0))

goal (1 subgoal):
 1. \<And>n' xs. \<lbrakk>\<And>xs. enat n' < llength xs \<Longrightarrow> lhd (ldrop (enat n') xs) = lnth xs (the_enat (enat n')); enat (Suc n') < llength xs\<rbrakk> \<Longrightarrow> lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n' xs. \<lbrakk>\<And>xs. enat n' < llength xs \<Longrightarrow> lhd (ldrop (enat n') xs) = lnth xs (the_enat (enat n')); enat (Suc n') < llength xs\<rbrakk> \<Longrightarrow> lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))
[PROOF STEP]
case (Suc n')
[PROOF STATE]
proof (state)
this:
enat n' < llength ?xs \<Longrightarrow> lhd (ldrop (enat n') ?xs) = lnth ?xs (the_enat (enat n'))
enat (Suc n') < llength xs

goal (1 subgoal):
 1. \<And>n' xs. \<lbrakk>\<And>xs. enat n' < llength xs \<Longrightarrow> lhd (ldrop (enat n') xs) = lnth xs (the_enat (enat n')); enat (Suc n') < llength xs\<rbrakk> \<Longrightarrow> lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
enat n' < llength ?xs \<Longrightarrow> lhd (ldrop (enat n') ?xs) = lnth ?xs (the_enat (enat n'))
enat (Suc n') < llength xs

goal (1 subgoal):
 1. lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))
[PROOF STEP]
by(cases xs)(simp_all add: eSuc_enat[symmetric], simp add: eSuc_enat)
[PROOF STATE]
proof (state)
this:
lhd (ldrop (enat (Suc n')) xs) = lnth xs (the_enat (enat (Suc n')))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lhd (ldrop n xs) = lnth xs (the_enat n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_exp_eq_1_iff [simp]: "fps_exp (c :: 'a :: field_char_0) = 1 \<longleftrightarrow> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_exp c = 1) = (c = (0::'a))
[PROOF STEP]
unfolding fps_const_1_eq_1 [symmetric] fps_exp_eq_fps_const_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c = (0::'a) \<and> (1::'a) = (1::'a)) = (c = (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma Cons_mem_set_subseqs_sorted:
  "sorted xs \<Longrightarrow> y#ys \<in> set (subseqs xs) \<Longrightarrow> y#ys \<in> set (subseqs (filter (\<lambda>x. y \<le> x) xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; y # ys \<in> set (subseqs xs)\<rbrakk> \<Longrightarrow> y # ys \<in> set (subseqs (filter ((\<le>) y) xs))
[PROOF STEP]
by (induct xs) (auto simp: Let_def)