[STATEMENT]
lemma fact_ineq: "n \<ge> 1 \<Longrightarrow> fact n + k \<le> fact (n + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k)
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> fact n + 0 \<le> fact (n + 0)
 2. \<And>k. \<lbrakk>1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k); 1 \<le> n\<rbrakk> \<Longrightarrow> fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k)
1 \<le> n

goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> fact n + 0 \<le> fact (n + 0)
 2. \<And>k. \<lbrakk>1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k); 1 \<le> n\<rbrakk> \<Longrightarrow> fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k)
1 \<le> n
[PROOF STEP]
have "fact n + Suc k \<le> fact (n + k) + 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k)
1 \<le> n

goal (1 subgoal):
 1. fact n + Suc k \<le> fact (n + k) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact n + Suc k \<le> fact (n + k) + 1

goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> fact n + 0 \<le> fact (n + 0)
 2. \<And>k. \<lbrakk>1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k); 1 \<le> n\<rbrakk> \<Longrightarrow> fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact n + Suc k \<le> fact (n + k) + 1

goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> fact n + 0 \<le> fact (n + 0)
 2. \<And>k. \<lbrakk>1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k); 1 \<le> n\<rbrakk> \<Longrightarrow> fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k)
1 \<le> n
[PROOF STEP]
have "\<dots> \<le> fact (n + Suc k)"
[PROOF STATE]
proof (prove)
using this:
1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k)
1 \<le> n

goal (1 subgoal):
 1. fact (n + k) + 1 \<le> fact (n + Suc k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact (n + k) + 1 \<le> fact (n + Suc k)

goal (2 subgoals):
 1. 1 \<le> n \<Longrightarrow> fact n + 0 \<le> fact (n + 0)
 2. \<And>k. \<lbrakk>1 \<le> n \<Longrightarrow> fact n + k \<le> fact (n + k); 1 \<le> n\<rbrakk> \<Longrightarrow> fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fact n + Suc k \<le> fact (n + Suc k)

goal (1 subgoal):
 1. fact n + Suc k \<le> fact (n + Suc k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fact n + Suc k \<le> fact (n + Suc k)

goal (1 subgoal):
 1. 1 \<le> n \<Longrightarrow> fact n + 0 \<le> fact (n + 0)
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma  det_linear_rows_sum:
  fixes S :: "'n::finite set"
  assumes fS: "finite S"
  shows "det (\<chi> i. sum (a i) S) =
    sum (\<lambda>f. det (\<chi> i. a i (f i) :: 'a::comm_ring_1 ^ 'n^'n)) {f. \<forall>i. f i \<in> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i. sum (a i) S) = (\<Sum>f | \<forall>i. f i \<in> S. det (\<chi>i. a i (f i)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (\<chi>i. sum (a i) S) = (\<Sum>f | \<forall>i. f i \<in> S. det (\<chi>i. a i (f i)))
[PROOF STEP]
have th0: "\<And>x y. ((\<chi> i. if i \<in> (UNIV:: 'n set) then x i else y i) :: 'a^'n^'n) = (\<chi> i. x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (\<chi>i. if i \<in> UNIV then x i else y i) = (\<chi>i. x i)
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
(\<chi>i. if i \<in> UNIV then ?x i else ?y i) = (\<chi>i. ?x i)

goal (1 subgoal):
 1. det (\<chi>i. sum (a i) S) = (\<Sum>f | \<forall>i. f i \<in> S. det (\<chi>i. a i (f i)))
[PROOF STEP]
from det_linear_rows_sum_lemma[OF fS, of "UNIV :: 'n set" a, unfolded th0, OF finite]
[PROOF STATE]
proof (chain)
picking this:
det (\<chi>i. sum (a i) S) = (\<Sum>f | (\<forall>i\<in>UNIV. f i \<in> S) \<and> (\<forall>i. i \<notin> UNIV \<longrightarrow> f i = i). det (\<chi>i. a i (f i)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (\<chi>i. sum (a i) S) = (\<Sum>f | (\<forall>i\<in>UNIV. f i \<in> S) \<and> (\<forall>i. i \<notin> UNIV \<longrightarrow> f i = i). det (\<chi>i. a i (f i)))

goal (1 subgoal):
 1. det (\<chi>i. sum (a i) S) = (\<Sum>f | \<forall>i. f i \<in> S. det (\<chi>i. a i (f i)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (\<chi>i. sum (a i) S) = (\<Sum>f | \<forall>i. f i \<in> S. det (\<chi>i. a i (f i)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_pCons_imp_dvd_pCons_mod:
  \<open>y dvd pCons a (x mod y)\<close> if \<open>y dvd pCons a x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
have \<open>pCons a x = pCons a (x div y * y + x mod y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pCons a x = pCons a (x div y * y + x mod y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pCons a x = pCons a (x div y * y + x mod y)

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pCons a x = pCons a (x div y * y + x mod y)

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
have \<open>\<dots> = pCons 0 (x div y * y) + pCons a (x mod y)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pCons a (x div y * y + x mod y) = pCons (0::'a) (x div y * y) + pCons a (x mod y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pCons a (x div y * y + x mod y) = pCons (0::'a) (x div y * y) + pCons a (x mod y)

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pCons a (x div y * y + x mod y) = pCons (0::'a) (x div y * y) + pCons a (x mod y)

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
have \<open>pCons 0 (x div y * y) = (x div y * monom 1 (Suc 0)) * y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pCons (0::'a) (x div y * y) = x div y * monom (1::'a) (Suc 0) * y
[PROOF STEP]
by (simp add: monom_Suc)
[PROOF STATE]
proof (state)
this:
pCons (0::'a) (x div y * y) = x div y * monom (1::'a) (Suc 0) * y

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pCons a x = x div y * monom (1::'a) (Suc 0) * y + pCons a (x mod y)
[PROOF STEP]
show \<open>y dvd pCons a (x mod y)\<close>
[PROOF STATE]
proof (prove)
using this:
pCons a x = x div y * monom (1::'a) (Suc 0) * y + pCons a (x mod y)

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
using \<open>y dvd pCons a x\<close>
[PROOF STATE]
proof (prove)
using this:
pCons a x = x div y * monom (1::'a) (Suc 0) * y + pCons a (x mod y)
y dvd pCons a x

goal (1 subgoal):
 1. y dvd pCons a (x mod y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y dvd pCons a (x mod y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_dep_pair_set:
  assumes "finite A" "\<And>a. a \<subseteq> A \<Longrightarrow> finite (f a)"
  shows "card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)" (is "card ?S = ?C")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
have S: "?S = Sigma {a. a \<subseteq> A \<and> card a = n} (\<lambda>a. {b. b \<subseteq> f a \<and> card b = g a})" (is "_ = Sigma ?A ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a})

goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
have "card (Sigma ?A ?B) = (\<Sum>a \<in> {a. a \<subseteq> A \<and> card a = n}. card (?B a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card {b. b \<subseteq> f a \<and> card b = g a})
[PROOF STEP]
proof (rule card_SigmaI, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {a. a \<subseteq> A \<and> card a = n}
 2. \<And>a. \<lbrakk>a \<subseteq> A; n = card a\<rbrakk> \<Longrightarrow> finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
show "finite ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a. a \<subseteq> A \<and> card a = n}
[PROOF STEP]
by (rule finite_subset[OF _ finite_Collect_subsets[OF assms(1)]]) blast
[PROOF STATE]
proof (state)
this:
finite {a. a \<subseteq> A \<and> card a = n}

goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<subseteq> A; n = card a\<rbrakk> \<Longrightarrow> finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<subseteq> A; n = card a\<rbrakk> \<Longrightarrow> finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<subseteq> A; n = card a\<rbrakk> \<Longrightarrow> finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
assume "a \<subseteq> A"
[PROOF STATE]
proof (state)
this:
a \<subseteq> A

goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<subseteq> A; n = card a\<rbrakk> \<Longrightarrow> finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
hence "finite (f a)"
[PROOF STATE]
proof (prove)
using this:
a \<subseteq> A

goal (1 subgoal):
 1. finite (f a)
[PROOF STEP]
by (fact assms(2))
[PROOF STATE]
proof (state)
this:
finite (f a)

goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<subseteq> A; n = card a\<rbrakk> \<Longrightarrow> finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
thus "finite (?B a)"
[PROOF STATE]
proof (prove)
using this:
finite (f a)

goal (1 subgoal):
 1. finite {b. b \<subseteq> f a \<and> card b = g a}
[PROOF STEP]
by (rule finite_subset[rotated, OF finite_Collect_subsets]) blast
[PROOF STATE]
proof (state)
this:
finite {b. b \<subseteq> f a \<and> card b = g a}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card {b. b \<subseteq> f a \<and> card b = g a})

goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card {b. b \<subseteq> f a \<and> card b = g a})

goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
have "\<dots> = ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a | a \<subseteq> A \<and> card a = n. card {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
proof (rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {a. a \<subseteq> A \<and> card a = n} = {a. a \<subseteq> A \<and> card a = n}
 2. \<And>x. x \<in> {a. a \<subseteq> A \<and> card a = n} \<Longrightarrow> card {b. b \<subseteq> f x \<and> card b = g x} = card (f x) choose g x
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {a. a \<subseteq> A \<and> card a = n} = {a. a \<subseteq> A \<and> card a = n}
 2. \<And>x. x \<in> {a. a \<subseteq> A \<and> card a = n} \<Longrightarrow> card {b. b \<subseteq> f x \<and> card b = g x} = card (f x) choose g x
[PROOF STEP]
assume "a \<in> {a. a \<subseteq> A \<and> card a = n}"
[PROOF STATE]
proof (state)
this:
a \<in> {a. a \<subseteq> A \<and> card a = n}

goal (2 subgoals):
 1. {a. a \<subseteq> A \<and> card a = n} = {a. a \<subseteq> A \<and> card a = n}
 2. \<And>x. x \<in> {a. a \<subseteq> A \<and> card a = n} \<Longrightarrow> card {b. b \<subseteq> f x \<and> card b = g x} = card (f x) choose g x
[PROOF STEP]
hence "finite (f a)"
[PROOF STATE]
proof (prove)
using this:
a \<in> {a. a \<subseteq> A \<and> card a = n}

goal (1 subgoal):
 1. finite (f a)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
a \<in> {a. a \<subseteq> A \<and> card a = n}
?a \<subseteq> A \<Longrightarrow> finite (f ?a)

goal (1 subgoal):
 1. finite (f a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (f a)

goal (2 subgoals):
 1. {a. a \<subseteq> A \<and> card a = n} = {a. a \<subseteq> A \<and> card a = n}
 2. \<And>x. x \<in> {a. a \<subseteq> A \<and> card a = n} \<Longrightarrow> card {b. b \<subseteq> f x \<and> card b = g x} = card (f x) choose g x
[PROOF STEP]
thus "card (?B a) = card (f a) choose g a"
[PROOF STATE]
proof (prove)
using this:
finite (f a)

goal (1 subgoal):
 1. card {b. b \<subseteq> f a \<and> card b = g a} = card (f a) choose g a
[PROOF STEP]
by (fact n_subsets)
[PROOF STATE]
proof (state)
this:
card {b. b \<subseteq> f a \<and> card b = g a} = card (f a) choose g a

goal (1 subgoal):
 1. {a. a \<subseteq> A \<and> card a = n} = {a. a \<subseteq> A \<and> card a = n}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
(\<Sum>a | a \<subseteq> A \<and> card a = n. card {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)

goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
have "card (Sigma ?A ?B) = ?C"
[PROOF STATE]
proof (prove)
using this:
card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)

goal (1 subgoal):
 1. card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)

goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card (SIGMA a:{a. a \<subseteq> A \<and> card a = n}. {b. b \<subseteq> f a \<and> card b = g a}) = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)

goal (1 subgoal):
 1. card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)
[PROOF STEP]
by (subst S)
[PROOF STATE]
proof (state)
this:
card {(a, b). a \<subseteq> A \<and> card a = n \<and> b \<subseteq> f a \<and> card b = g a} = (\<Sum>a | a \<subseteq> A \<and> card a = n. card (f a) choose g a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_axis_1 [simp]: "norm (axis m (1::real)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (axis m 1) = 1
[PROOF STEP]
by (simp add: inner_axis' norm_eq_1)


[STATEMENT]
lemma gr_one_powr[simp]:
  fixes x y :: real shows "\<lbrakk> x > 1; y > 0 \<rbrakk> \<Longrightarrow> 1 < x powr y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < x; 0 < y\<rbrakk> \<Longrightarrow> 1 < x powr y
[PROOF STEP]
by(simp add: less_powr_iff)


[STATEMENT]
lemma ran_upd:
  "\<lbrakk> inj_on f (dom f); f y = Some z \<rbrakk> \<Longrightarrow> ran (\<lambda>x. if x = y then None else f x) = ran f - {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f (dom f); f y = Some z\<rbrakk> \<Longrightarrow> ran (\<lambda>x. if x = y then None else f x) = ran f - {z}
[PROOF STEP]
unfolding ran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f (dom f); f y = Some z\<rbrakk> \<Longrightarrow> {b. \<exists>a. (if a = y then None else f a) = Some b} = {b. \<exists>a. f a = Some b} - {z}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>inj_on f (dom f); f y = Some z\<rbrakk> \<Longrightarrow> (x \<in> {b. \<exists>a. (if a = y then None else f a) = Some b}) = (x \<in> {b. \<exists>a. f a = Some b} - {z})
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>inj_on f (dom f); f y = Some z\<rbrakk> \<Longrightarrow> (\<exists>a. a \<noteq> y \<and> (a \<noteq> y \<longrightarrow> f a = Some x)) = ((\<exists>a. f a = Some x) \<and> x \<noteq> z)
[PROOF STEP]
by (metis domI inj_on_eq_iff option.sel)


[STATEMENT]
lemma sq_norm_vec_of_poly [simp]:
  fixes p :: "'a :: conjugatable_ring poly"
  shows "\<parallel>vec_of_poly p\<parallel>\<^sup>2 = \<parallel>p\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>vec_of_poly p\<parallel>\<^sup>2 = \<parallel>p\<parallel>\<^sup>2
[PROOF STEP]
apply (unfold sq_norm_poly_def sq_norm_vec_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map sq_norm (list_of_vec (vec_of_poly p))) = sum_list (map sq_norm (coeffs p))
[PROOF STEP]
apply (fold sum_mset_sum_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (mset (map sq_norm (list_of_vec (vec_of_poly p)))) = \<Sum>\<^sub># (mset (map sq_norm (coeffs p)))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.


[STATEMENT]
lemma board_leq_subset: "n\<^sub>1 \<le> n\<^sub>2 \<and> m\<^sub>1 \<le> m\<^sub>2 \<Longrightarrow> board n\<^sub>1 m\<^sub>1 \<subseteq> board n\<^sub>2 m\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n\<^sub>1 \<le> n\<^sub>2 \<and> m\<^sub>1 \<le> m\<^sub>2 \<Longrightarrow> board n\<^sub>1 m\<^sub>1 \<subseteq> board n\<^sub>2 m\<^sub>2
[PROOF STEP]
unfolding board_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n\<^sub>1 \<le> n\<^sub>2 \<and> m\<^sub>1 \<le> m\<^sub>2 \<Longrightarrow> {(i, j) |i j. 1 \<le> i \<and> i \<le> int n\<^sub>1 \<and> 1 \<le> j \<and> j \<le> int m\<^sub>1} \<subseteq> {(i, j) |i j. 1 \<le> i \<and> i \<le> int n\<^sub>2 \<and> 1 \<le> j \<and> j \<le> int m\<^sub>2}
[PROOF STEP]
by auto


[STATEMENT]
lemma Polygamma_real_even_neg:
  assumes "(x::real) > 0" "n > 0" "even n"
  shows   "Polygamma n x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma n x < 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < n
even n

goal (1 subgoal):
 1. Polygamma n x < 0
[PROOF STEP]
unfolding Polygamma_def
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < n
even n

goal (1 subgoal):
 1. (if n = 0 then (\<Sum>k. inverse (real (Suc k)) - inverse (x + real k)) - euler_mascheroni else (- 1) ^ Suc n * fact n * (\<Sum>k. inverse ((x + real k) ^ Suc n))) < 0
[PROOF STEP]
using Polygamma_converges'[of x "Suc n"]
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < n
even n
\<lbrakk>x \<noteq> 0; 2 \<le> Suc n\<rbrakk> \<Longrightarrow> summable (\<lambda>k. inverse ((x + real k) ^ Suc n))

goal (1 subgoal):
 1. (if n = 0 then (\<Sum>k. inverse (real (Suc k)) - inverse (x + real k)) - euler_mascheroni else (- 1) ^ Suc n * fact n * (\<Sum>k. inverse ((x + real k) ^ Suc n))) < 0
[PROOF STEP]
by (auto intro!: mult_pos_pos suminf_pos)


[STATEMENT]
lemma continuous_on_prod [continuous_intros]:
  fixes f :: "'a \<Rightarrow> _ \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
  shows "(\<And>i. i \<in> S \<Longrightarrow> continuous_on s (f i)) \<Longrightarrow> continuous_on s (\<lambda>x. \<Prod>i\<in>S. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> S \<Longrightarrow> continuous_on s (f i)) \<Longrightarrow> continuous_on s (\<lambda>x. \<Prod>i\<in>S. f i x)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> S \<Longrightarrow> \<forall>x\<in>s. (f i \<longlongrightarrow> f i x) (at x within s)) \<Longrightarrow> \<forall>x\<in>s. ((\<lambda>x. \<Prod>i\<in>S. f i x) \<longlongrightarrow> (\<Prod>i\<in>S. f i x)) (at x within s)
[PROOF STEP]
by (auto intro: tendsto_prod)


[STATEMENT]
lemma nth_elem_Suc:
  assumes "card S > Suc n"
  shows "nth_elem S (Suc n) > nth_elem S n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_elem S n < nth_elem S (Suc n)
[PROOF STEP]
using assms sorted_sorted_list_of_set[of S] set_to_list_length[of S]
[PROOF STATE]
proof (prove)
using this:
Suc n < card S
sorted (sorted_list_of_set S)
finite S \<Longrightarrow> length (sorted_list_of_set S) = card S

goal (1 subgoal):
 1. nth_elem S n < nth_elem S (Suc n)
[PROOF STEP]
by (metis Suc_lessD card.infinite distinct_sorted_list_of_set lessI nat_less_le not_less0 nth_elem.elims nth_eq_iff_index_eq sorted_iff_nth_mono_less)


[STATEMENT]
lemma uniformly_continuous_on_def:
  fixes f :: "'a::metric_space \<Rightarrow> 'b::metric_space"
  shows "uniformly_continuous_on s f \<longleftrightarrow>
    (\<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on s f = (\<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)
[PROOF STEP]
unfolding uniformly_continuous_on_uniformity
    uniformity_dist filterlim_INF filterlim_principal eventually_inf_principal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>b\<in>{0<..}. \<forall>\<^sub>F x in INF e\<in>{0<..}. principal {(x, y). dist x y < e}. x \<in> s \<times> s \<longrightarrow> (case x of (x, y) \<Rightarrow> (f x, f y)) \<in> {(x, y). dist x y < b}) = (\<forall>e>0. \<exists>d>0. \<forall>x\<in>s. \<forall>x'\<in>s. dist x' x < d \<longrightarrow> dist (f x') (f x) < e)
[PROOF STEP]
by (force simp: Ball_def uniformity_dist[symmetric] eventually_uniformity_metric)


[STATEMENT]
lemma match_Times: "(i, i + n) \<in> match (Times r s) \<longleftrightarrow>
  (\<exists>k \<le> n. (i, i + k) \<in> match r \<and> (i + k, i + n) \<in> match s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((i, i + n) \<in> match (Times r s)) = (\<exists>k\<le>n. (i, i + k) \<in> match r \<and> (i + k, i + n) \<in> match s)
[PROOF STEP]
using match_le
[PROOF STATE]
proof (prove)
using this:
(?i, ?j) \<in> match ?r \<Longrightarrow> ?i \<le> ?j

goal (1 subgoal):
 1. ((i, i + n) \<in> match (Times r s)) = (\<exists>k\<le>n. (i, i + k) \<in> match r \<and> (i + k, i + n) \<in> match s)
[PROOF STEP]
by auto (metis le_iff_add nat_add_left_cancel_le)


[STATEMENT]
lemma neg_inf_eq_sup: "- inf a b = sup (- a) (- b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - inf a b = sup (- a) (- b)
[PROOF STEP]
by (simp add: inf_eq_neg_sup)


[STATEMENT]
lemma ln_primorial: "ln (primorial x) = primes_theta x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real (primorial x)) = primes_theta x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (real (primorial x)) = primes_theta x
[PROOF STEP]
have "finite {p. prime p \<and> real p \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {p. prime p \<and> real p \<le> x}
[PROOF STEP]
by (rule finite_subset[of _ "{..nat \<lfloor>x\<rfloor>}"]) (auto simp: le_nat_iff le_floor_iff)
[PROOF STATE]
proof (state)
this:
finite {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. ln (real (primorial x)) = primes_theta x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. ln (real (primorial x)) = primes_theta x
[PROOF STEP]
unfolding of_nat_prod primorial_def
[PROOF STATE]
proof (prove)
using this:
finite {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. ln (prod real {p. prime p \<and> real p \<le> x}) = primes_theta x
[PROOF STEP]
by (subst ln_prod) (auto dest: prime_gt_0_nat simp: \<theta>_def prime_sum_upto_def)
[PROOF STATE]
proof (state)
this:
ln (real (primorial x)) = primes_theta x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prob_space) normal_distributed_variance:
  fixes a b :: real
  assumes [simp, arith]: "0 < \<sigma>"
  assumes D: "distributed M lborel X (normal_density \<mu> \<sigma>)"
  shows "variance X = \<sigma>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>\<^sup>2
[PROOF STEP]
using integral_normal_moment_even[of \<sigma> \<mu> 1]
[PROOF STATE]
proof (prove)
using this:
0 < \<sigma> \<Longrightarrow> LBINT x. normal_density \<mu> \<sigma> x * (x - \<mu>) ^ (2 * 1) = fact (2 * 1) / ((2 / \<sigma>\<^sup>2) ^ 1 * fact 1)

goal (1 subgoal):
 1. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>\<^sup>2
[PROOF STEP]
by (subst distributed_integral[OF D, symmetric])
     (simp_all add: eval_nat_numeral normal_distributed_expectation[OF assms])


[STATEMENT]
lemma contour_integral_part_circlepath_eq:
  assumes "a < b"
  shows "contour_integral (part_circlepath c r a b) f =
           integral {a..b} (\<lambda>t. f (c + r * cis t) * r * \<i> * cis t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
proof (cases "f contour_integrable_on part_circlepath c r a b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
 2. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f contour_integrable_on part_circlepath c r a b

goal (2 subgoals):
 1. f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
 2. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
hence "(\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on part_circlepath c r a b

goal (1 subgoal):
 1. (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on part_circlepath c r a b
a < b

goal (1 subgoal):
 1. (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
[PROOF STEP]
by (simp add: contour_integrable_part_circlepath_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}

goal (2 subgoals):
 1. f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
 2. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
f contour_integrable_on part_circlepath c r a b
(\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on part_circlepath c r a b
(\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}

goal (1 subgoal):
 1. contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
using has_contour_integral_part_circlepath_iff[OF assms]
          contour_integral_unique has_integral_integrable_integral
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on part_circlepath c r a b
(\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
(?f has_contour_integral ?I) (part_circlepath ?c ?r a b) = ((\<lambda>t. ?f (?c + complex_of_real ?r * cis t) * complex_of_real ?r * \<i> * cis t) has_integral ?I) {a..b}
(?f has_contour_integral ?i) ?g \<Longrightarrow> contour_integral ?g ?f = ?i
(?f has_integral ?i) ?s = (?f integrable_on ?s \<and> integral ?s ?f = ?i)

goal (1 subgoal):
 1. contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)

goal (1 subgoal):
 1. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f contour_integrable_on part_circlepath c r a b

goal (1 subgoal):
 1. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
hence "\<not>(\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on part_circlepath c r a b

goal (1 subgoal):
 1. \<not> (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on part_circlepath c r a b
a < b

goal (1 subgoal):
 1. \<not> (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
[PROOF STEP]
by (simp add: contour_integrable_part_circlepath_iff)
[PROOF STATE]
proof (state)
this:
\<not> (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}

goal (1 subgoal):
 1. \<not> f contour_integrable_on part_circlepath c r a b \<Longrightarrow> contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> f contour_integrable_on part_circlepath c r a b
\<not> (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on part_circlepath c r a b
\<not> (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t) integrable_on {a..b}

goal (1 subgoal):
 1. contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)
[PROOF STEP]
by (simp add: not_integrable_contour_integral not_integrable_integral)
[PROOF STATE]
proof (state)
this:
contour_integral (part_circlepath c r a b) f = integral {a..b} (\<lambda>t. f (c + complex_of_real r * cis t) * complex_of_real r * \<i> * cis t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma P_set_memI:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "a \<noteq> \<zero>"
  assumes "b \<in> carrier Q\<^sub>p"
  assumes "b[^](n::nat) = a"
  shows "a \<in> P_set n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> P_set n
[PROOF STEP]
unfolding P_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
a \<noteq> \<zero>
b \<in> carrier Q\<^sub>p
b [^] n = a

goal (1 subgoal):
 1. a \<in> {a \<in> nonzero Q\<^sub>p. \<exists>y\<in>carrier Q\<^sub>p. y [^] n = a}
[PROOF STEP]
by (metis (mono_tags, lifting) mem_Collect_eq not_nonzero_Qp)


[STATEMENT]
lemma card_of_Un_singl_ordLess_infinite:
assumes "\<not>finite B"
shows "( |A| <o |B| ) = ( |{a} Un A| <o |B| )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (|A| <o |B|) = (|{a} \<union> A| <o |B|)
[PROOF STEP]
using assms card_of_Un_singl_ordLess_infinite1[of B A]
[PROOF STATE]
proof (prove)
using this:
infinite B
\<lbrakk>infinite B; |A| <o |B|\<rbrakk> \<Longrightarrow> |{?a} \<union> A| <o |B|

goal (1 subgoal):
 1. (|A| <o |B|) = (|{a} \<union> A| <o |B|)
[PROOF STEP]
proof(auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>infinite B; \<And>a. |A| <o |B| \<Longrightarrow> |insert a A| <o |B|; |insert a A| <o |B|\<rbrakk> \<Longrightarrow> |A| <o |B|
[PROOF STEP]
assume "|insert a A| <o |B|"
[PROOF STATE]
proof (state)
this:
|insert a A| <o |B|

goal (1 subgoal):
 1. \<lbrakk>infinite B; \<And>a. |A| <o |B| \<Longrightarrow> |insert a A| <o |B|; |insert a A| <o |B|\<rbrakk> \<Longrightarrow> |A| <o |B|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|insert a A| <o |B|

goal (1 subgoal):
 1. \<lbrakk>infinite B; \<And>a. |A| <o |B| \<Longrightarrow> |insert a A| <o |B|; |insert a A| <o |B|\<rbrakk> \<Longrightarrow> |A| <o |B|
[PROOF STEP]
have "|A| <=o |insert a A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |insert a A|
[PROOF STEP]
using card_of_mono1[of A "insert a A"]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> insert a A \<Longrightarrow> |A| \<le>o |insert a A|

goal (1 subgoal):
 1. |A| \<le>o |insert a A|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A| \<le>o |insert a A|

goal (1 subgoal):
 1. \<lbrakk>infinite B; \<And>a. |A| <o |B| \<Longrightarrow> |insert a A| <o |B|; |insert a A| <o |B|\<rbrakk> \<Longrightarrow> |A| <o |B|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|insert a A| <o |B|
|A| \<le>o |insert a A|
[PROOF STEP]
show "|A| <o |B|"
[PROOF STATE]
proof (prove)
using this:
|insert a A| <o |B|
|A| \<le>o |insert a A|

goal (1 subgoal):
 1. |A| <o |B|
[PROOF STEP]
using ordLeq_ordLess_trans
[PROOF STATE]
proof (prove)
using this:
|insert a A| <o |B|
|A| \<le>o |insert a A|
\<lbrakk>?r \<le>o ?r'; ?r' <o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. |A| <o |B|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A| <o |B|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powrat_add_neg:
  assumes "0 < x" and "r < 0" and "s < 0"
  shows "x pow\<^sub>\<rat> (r + s) = (x pow\<^sub>\<rat> r) * (x pow\<^sub>\<rat> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
have "x pow\<^sub>\<rat> (- r + - s) = x pow\<^sub>\<rat> - r * x pow\<^sub>\<rat> - s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (- r + - s) = x pow\<^sub>\<rat> - r * x pow\<^sub>\<rat> - s
[PROOF STEP]
using assms powrat_add_pos neg_0_less_iff_less
[PROOF STATE]
proof (prove)
using this:
0 < x
r < 0
s < 0
\<lbrakk>0 < ?x; 0 < ?r; 0 < ?s\<rbrakk> \<Longrightarrow> ?x pow\<^sub>\<rat> (?r + ?s) = ?x pow\<^sub>\<rat> ?r * ?x pow\<^sub>\<rat> ?s
((0::?'a) < - ?a) = (?a < (0::?'a))

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (- r + - s) = x pow\<^sub>\<rat> - r * x pow\<^sub>\<rat> - s
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (- r + - s) = x pow\<^sub>\<rat> - r * x pow\<^sub>\<rat> - s

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x pow\<^sub>\<rat> (- r + - s) = x pow\<^sub>\<rat> - r * x pow\<^sub>\<rat> - s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x pow\<^sub>\<rat> (- r + - s) = x pow\<^sub>\<rat> - r * x pow\<^sub>\<rat> - s

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
by (metis inverse_eq_imp_eq inverse_mult_distrib
         minus_add_distrib powrat_minus)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_powr_iff:
  assumes "0 < p" "eventually (\<lambda>x. f x \<ge> 0) F" "eventually (\<lambda>x. g x \<ge> 0) F"
  shows "(\<lambda>x. (f x :: real) powr p) \<in> O[F](\<lambda>x. g x powr p) \<longleftrightarrow> f \<in> O[F](g)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)) = (f \<in> O[F](g))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p) \<Longrightarrow> f \<in> O[F](g)
 2. f \<in> O[F](g) \<Longrightarrow> (\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)

goal (2 subgoals):
 1. (\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p) \<Longrightarrow> f \<in> O[F](g)
 2. f \<in> O[F](g) \<Longrightarrow> (\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)
[PROOF STEP]
with assms bigo_powr[OF this, of "inverse p"]
[PROOF STATE]
proof (chain)
picking this:
0 < p
\<forall>\<^sub>F x in F. 0 \<le> f x
\<forall>\<^sub>F x in F. 0 \<le> g x
0 \<le> inverse p \<Longrightarrow> (\<lambda>x. \<bar>f x powr p\<bar> powr inverse p) \<in> O[F](\<lambda>x. \<bar>g x powr p\<bar> powr inverse p)
(\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
0 < p
\<forall>\<^sub>F x in F. 0 \<le> f x
\<forall>\<^sub>F x in F. 0 \<le> g x
0 \<le> inverse p \<Longrightarrow> (\<lambda>x. \<bar>f x powr p\<bar> powr inverse p) \<in> O[F](\<lambda>x. \<bar>g x powr p\<bar> powr inverse p)
(\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)

goal (1 subgoal):
 1. f \<in> O[F](g)
[PROOF STEP]
by (simp add: powr_powr landau_simps)
[PROOF STATE]
proof (state)
this:
f \<in> O[F](g)

goal (1 subgoal):
 1. f \<in> O[F](g) \<Longrightarrow> (\<lambda>x. f x powr p) \<in> O[F](\<lambda>x. g x powr p)
[PROOF STEP]
qed (insert assms, simp_all add: bigo_powr_nonneg)


[STATEMENT]
lemma ex_bij_betw_strict_mono_card:
  fixes M :: "'a::wellorder set"
  assumes "finite M"
  obtains h where "bij_betw h {..<card M} M" and "strict_mono_on {..<card M} h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>bij_betw h {..<card M} M; strict_mono_on {..<card M} h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>h. \<lbrakk>bij_betw h {..<card M} M; strict_mono_on {..<card M} h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> bij_betw ?h2 {..<card M} M
 2. (\<And>h. \<lbrakk>bij_betw h {..<card M} M; strict_mono_on {..<card M} h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> strict_mono_on {..<card M} ?h2
[PROOF STEP]
show "bij_betw (enumerate M) {..<card M} M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (wellorder_class.enumerate M) {..<card M} M
[PROOF STEP]
by (simp add: assms finite_bij_enumerate)
[PROOF STATE]
proof (state)
this:
bij_betw (wellorder_class.enumerate M) {..<card M} M

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>bij_betw h {..<card M} M; strict_mono_on {..<card M} h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> strict_mono_on {..<card M} (wellorder_class.enumerate M)
[PROOF STEP]
show "strict_mono_on {..<card M} (enumerate M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono_on {..<card M} (wellorder_class.enumerate M)
[PROOF STEP]
by (simp add: assms finite_enumerate_mono strict_mono_on_def)
[PROOF STATE]
proof (state)
this:
strict_mono_on {..<card M} (wellorder_class.enumerate M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<exists>x::'a::linordered_field.
  \<bar>4 * x + 17\<bar> < 4 \<and> (\<forall>y. \<bar>x * 34 - 34 * y - 9\<bar> \<noteq> 0 \<longrightarrow> (\<exists>z. 5 * x - 3 * \<bar>y\<bar> \<le> 7 * z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. \<bar>(4::'a) * x + (17::'a)\<bar> < (4::'a) \<and> (\<forall>y. \<bar>x * (34::'a) - (34::'a) * y - (9::'a)\<bar> \<noteq> (0::'a) \<longrightarrow> (\<exists>z. (5::'a) * x - (3::'a) * \<bar>y\<bar> \<le> (7::'a) * z))
[PROOF STEP]
by ferrack


[STATEMENT]
lemma lex_convex2':
  assumes "lex q p" "lex r p" "0 \<le> u" "u \<le> 1"
  shows "lex (u *\<^sub>R q + (1 - u) *\<^sub>R r) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex (u *\<^sub>R q + (1 - u) *\<^sub>R r) p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex (u *\<^sub>R q + (1 - u) *\<^sub>R r) p
[PROOF STEP]
have "lex (- p) (u *\<^sub>R (-q) + (1 - u) *\<^sub>R (-r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex (- p) (u *\<^sub>R - q + (1 - u) *\<^sub>R - r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Counterclockwise_2D_Arbitrary.lex q p
Counterclockwise_2D_Arbitrary.lex r p
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex (- p) (u *\<^sub>R - q + (1 - u) *\<^sub>R - r)
[PROOF STEP]
by (intro lex_convex2) (auto simp: lex_def)
[PROOF STATE]
proof (state)
this:
Counterclockwise_2D_Arbitrary.lex (- p) (u *\<^sub>R - q + (1 - u) *\<^sub>R - r)

goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex (u *\<^sub>R q + (1 - u) *\<^sub>R r) p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Counterclockwise_2D_Arbitrary.lex (- p) (u *\<^sub>R - q + (1 - u) *\<^sub>R - r)

goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex (u *\<^sub>R q + (1 - u) *\<^sub>R r) p
[PROOF STEP]
by (auto simp: lex_def algebra_simps)
[PROOF STATE]
proof (state)
this:
Counterclockwise_2D_Arbitrary.lex (u *\<^sub>R q + (1 - u) *\<^sub>R r) p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_median_altdef:
  "is_median x xs \<longleftrightarrow> size (filter_mset (\<lambda>y. y < x) (mset xs)) \<le> length xs div 2 \<and>
                      size (filter_mset (\<lambda>y. y > x) (mset xs)) \<le> length xs div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_median x xs = (size {#y \<in># mset xs. y < x#} \<le> length xs div 2 \<and> size (filter_mset ((<) x) (mset xs)) \<le> length xs div 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_median x xs = (size {#y \<in># mset xs. y < x#} \<le> length xs div 2 \<and> size (filter_mset ((<) x) (mset xs)) \<le> length xs div 2)
[PROOF STEP]
have *: "length (filter P xs) = size (filter_mset P (mset xs))" for P and xs :: "'a list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter P xs) = size (filter_mset P (mset xs))
[PROOF STEP]
by (simp flip: mset_filter)
[PROOF STATE]
proof (state)
this:
length (filter ?P ?xs) = size (filter_mset ?P (mset ?xs))

goal (1 subgoal):
 1. is_median x xs = (size {#y \<in># mset xs. y < x#} \<le> length xs div 2 \<and> size (filter_mset ((<) x) (mset xs)) \<le> length xs div 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_median x xs = (size {#y \<in># mset xs. y < x#} \<le> length xs div 2 \<and> size (filter_mset ((<) x) (mset xs)) \<le> length xs div 2)
[PROOF STEP]
by (simp only: is_median_def *)
[PROOF STATE]
proof (state)
this:
is_median x xs = (size {#y \<in># mset xs. y < x#} \<le> length xs div 2 \<and> size (filter_mset ((<) x) (mset xs)) \<le> length xs div 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_UNIV_iff: "S=UNIV \<longleftrightarrow> (\<forall>x. x\<in>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S = UNIV) = (\<forall>x. x \<in> S)
[PROOF STEP]
by auto


[STATEMENT]
lemma connected_in_Euclidean_complements:
  assumes "closedin (Euclidean_space n) S" "closedin (Euclidean_space n) T"
          "(subtopology (Euclidean_space n) S) homeomorphic_space (subtopology (Euclidean_space n) T)"
  shows "connectedin (Euclidean_space n) (topspace(Euclidean_space n) - S)
     \<longleftrightarrow> connectedin (Euclidean_space n) (topspace(Euclidean_space n) - T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin (Euclidean_space n) (topspace (Euclidean_space n) - S) = connectedin (Euclidean_space n) (topspace (Euclidean_space n) - T)
[PROOF STEP]
apply (simp add: connectedin_def connected_space_iff_components_subset_singleton subset_singleton_iff_lepoll)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<lesssim> {()}) = (connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T)) \<lesssim> {()})
[PROOF STEP]
using eqpoll_connected_components_Euclidean_complements [OF assms]
[PROOF STATE]
proof (prove)
using this:
connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<approx> connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T))

goal (1 subgoal):
 1. (connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<lesssim> {()}) = (connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T)) \<lesssim> {()})
[PROOF STEP]
by (meson eqpoll_sym lepoll_trans1)


[STATEMENT]
lemma sqrt_series':
  "\<bar>z\<bar> < a \<Longrightarrow> (\<lambda>n. ((1/2) gchoose n) * a powr (1/2 - real_of_nat n) * z ^ n) sums
                  sqrt (a + z :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>z\<bar> < a \<Longrightarrow> (\<lambda>n. (1 / 2 gchoose n) * a powr (1 / 2 - real n) * z ^ n) sums sqrt (a + z)
[PROOF STEP]
using gen_binomial_real''[of z a "1/2"]
[PROOF STATE]
proof (prove)
using this:
\<bar>z\<bar> < a \<Longrightarrow> (\<lambda>n. (1 / 2 gchoose n) * a powr (1 / 2 - real n) * z ^ n) sums (a + z) powr (1 / 2)

goal (1 subgoal):
 1. \<bar>z\<bar> < a \<Longrightarrow> (\<lambda>n. (1 / 2 gchoose n) * a powr (1 / 2 - real n) * z ^ n) sums sqrt (a + z)
[PROOF STEP]
by (simp add: powr_half_sqrt)


[STATEMENT]
lemma SUP_Lim:
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
  assumes inc: "incseq X"
    and l: "X \<longlonglongrightarrow> l"
  shows "(SUP n. X n) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (range X) = l
[PROOF STEP]
using LIMSEQ_SUP[OF inc] tendsto_unique[OF trivial_limit_sequentially l]
[PROOF STATE]
proof (prove)
using this:
X \<longlonglongrightarrow> Sup (range X)
X \<longlonglongrightarrow> ?b \<Longrightarrow> l = ?b

goal (1 subgoal):
 1. Sup (range X) = l
[PROOF STEP]
by simp


[STATEMENT]
lemma prime_factorization_exists_nat:
  "n > 0 \<Longrightarrow> (\<exists>M. (\<forall>p::nat \<in> set_mset M. prime p) \<and> n = (\<Prod>i \<in># M. i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> \<exists>M. (\<forall>p\<in>#M. prime p) \<and> n = (\<Prod>i\<in>#M. i)
[PROOF STEP]
using prime_factorization_exists[of n]
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0 \<Longrightarrow> \<exists>A. (\<forall>x. x \<in># A \<longrightarrow> prime_elem x) \<and> normalize (\<Prod>\<^sub># A) = normalize n

goal (1 subgoal):
 1. 0 < n \<Longrightarrow> \<exists>M. (\<forall>p\<in>#M. prime p) \<and> n = (\<Prod>i\<in>#M. i)
[PROOF STEP]
by auto


[STATEMENT]
lemma resultant_swap: "resultant f g = (-1)^(degree f * degree g) * (resultant g f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant f g = (- (1::'a)) ^ (degree f * degree g) * resultant g f
[PROOF STEP]
unfolding coeff_subresultant_0_0_resultant[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (subresultant 0 f g) 0 = (- (1::'a)) ^ (degree f * degree g) * coeff (subresultant 0 g f) 0
[PROOF STEP]
unfolding arg_cong[OF subresultant_swap[of 0 f g], of "\<lambda> x. coeff x 0"] coeff_smult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ ((degree f - 0) * (degree g - 0)) * coeff (subresultant 0 g f) 0 = (- (1::'a)) ^ (degree f * degree g) * coeff (subresultant 0 g f) 0
[PROOF STEP]
by simp


[STATEMENT]
lemma mahler_measure_l2norm: "mahler_measure f \<le> sqrt (of_int \<parallel>f\<parallel>\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure f \<le> sqrt (real_of_int \<parallel>f\<parallel>\<^sup>2)
[PROOF STEP]
using Landau_inequality_mahler_measure[of f]
[PROOF STATE]
proof (prove)
using this:
mahler_measure f \<le> sqrt (real_of_int (\<Sum>a\<leftarrow>coeffs f. a * a))

goal (1 subgoal):
 1. mahler_measure f \<le> sqrt (real_of_int \<parallel>f\<parallel>\<^sup>2)
[PROOF STEP]
unfolding sq_norm_poly_def
[PROOF STATE]
proof (prove)
using this:
mahler_measure f \<le> sqrt (real_of_int (\<Sum>a\<leftarrow>coeffs f. a * a))

goal (1 subgoal):
 1. mahler_measure f \<le> sqrt (real_of_int (sum_list (map sq_norm (coeffs f))))
[PROOF STEP]
by (auto simp: power2_eq_square)


[STATEMENT]
lemma leadsETo_Union_Int:
 "(!!A. A \<in> S ==> F \<in> (A Int C) leadsTo[CC] B)
  ==> F \<in> (\<Union>S Int C) leadsTo[CC] B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> (A \<inter> C) leadsTo[CC] B) \<Longrightarrow> F \<in> (\<Union> S \<inter> C) leadsTo[CC] B
[PROOF STEP]
apply (unfold leadsETo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> {F. (A \<inter> C, B) \<in> elt CC F}) \<Longrightarrow> F \<in> {F. (\<Union> S \<inter> C, B) \<in> elt CC F}
[PROOF STEP]
apply (simp only: Int_Union_Union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. A \<in> S \<Longrightarrow> F \<in> {F. (A \<inter> C, B) \<in> elt CC F}) \<Longrightarrow> F \<in> {F. (\<Union>Ca\<in>S. Ca \<inter> C, B) \<in> elt CC F}
[PROOF STEP]
apply (blast intro: elt.Union)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma codegree_normalized_altY:
  assumes "y \<in> Y" and "y' \<in> Y"
  shows "codegree_normalized y y' X = card (neighbors_ss y X \<inter> neighbors_ss y' X) / card X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codegree_normalized y y' X = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codegree_normalized y y' X = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)
[PROOF STEP]
have "neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'
[PROOF STEP]
using neighbors_ss_eq_neighborhoodY assms
[PROOF STATE]
proof (prove)
using this:
?v \<in> Y \<Longrightarrow> neighborhood ?v = neighbors_ss ?v X
y \<in> Y
y' \<in> Y

goal (1 subgoal):
 1. neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'

goal (1 subgoal):
 1. codegree_normalized y y' X = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'

goal (1 subgoal):
 1. codegree_normalized y y' X = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)
[PROOF STEP]
unfolding codegree_normalized_def
[PROOF STATE]
proof (prove)
using this:
neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'

goal (1 subgoal):
 1. real (codegree y y') / real (card X) = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)
[PROOF STEP]
using codegree_def codegree_neighbors
[PROOF STATE]
proof (prove)
using this:
neighbors_ss y X \<inter> neighbors_ss y' X = neighborhood y \<inter> neighborhood y'
codegree ?v ?u \<equiv> card {x \<in> V. vert_adj ?v x \<and> vert_adj ?u x}
codegree ?v ?u = card (neighborhood ?v \<inter> neighborhood ?u)

goal (1 subgoal):
 1. real (codegree y y') / real (card X) = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
codegree_normalized y y' X = real (card (neighbors_ss y X \<inter> neighbors_ss y' X)) / real (card X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_nat_greaterThan:
  fixes m::nat
  assumes "infinite N"
  shows "infinite (N \<inter> {m<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
have "N \<subseteq> -{m<..} \<union> (N \<inter> {m<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<subseteq> - {m<..} \<union> N \<inter> {m<..}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
N \<subseteq> - {m<..} \<union> N \<inter> {m<..}

goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
N \<subseteq> - {m<..} \<union> N \<inter> {m<..}

goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
have "finite (-{m<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (- {m<..})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (- {m<..})

goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
N \<subseteq> - {m<..} \<union> N \<inter> {m<..}
finite (- {m<..})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
N \<subseteq> - {m<..} \<union> N \<inter> {m<..}
finite (- {m<..})

goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
using assms finite_subset
[PROOF STATE]
proof (prove)
using this:
N \<subseteq> - {m<..} \<union> N \<inter> {m<..}
finite (- {m<..})
infinite N
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. infinite (N \<inter> {m<..})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infinite (N \<inter> {m<..})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cGDERIV_scaleC:
  "\<lbrakk>DERIV f x :> df; cGDERIV g x :> dg\<rbrakk>
     \<Longrightarrow> cGDERIV (\<lambda>x. scaleC (f x) (g x)) x
      :> (scaleC (cnj (f x)) dg + scaleC (cnj df) (cnj (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_field_derivative df) (at x); cGDERIV g x :> dg\<rbrakk> \<Longrightarrow> cGDERIV (\<lambda>x. f x *\<^sub>C g x) x :> cnj (f x) *\<^sub>C dg + cnj df *\<^sub>C cnj (g x)
[PROOF STEP]
unfolding cgderiv_def has_field_derivative_def cinner_add_left cinner_scaleC_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_derivative (*) df) (at x); (g has_derivative cinner dg) (at x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x *\<^sub>C g x) has_derivative (\<lambda>z. cnj (cnj (f x)) * cinner dg z + cnj (cnj df) * cinner (cnj (g x)) z)) (at x)
[PROOF STEP]
apply (rule has_derivative_subst)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(f has_derivative (*) df) (at x); (g has_derivative cinner dg) (at x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x *\<^sub>C g x) has_derivative ?df) (at x)
 2. \<lbrakk>(f has_derivative (*) df) (at x); (g has_derivative cinner dg) (at x)\<rbrakk> \<Longrightarrow> ?df = (\<lambda>z. cnj (cnj (f x)) * cinner dg z + cnj (cnj df) * cinner (cnj (g x)) z)
[PROOF STEP]
apply (erule (1) has_derivative_scaleC)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_derivative (*) df) (at x); (g has_derivative cinner dg) (at x)\<rbrakk> \<Longrightarrow> (\<lambda>h. f x *\<^sub>C cinner dg h + (df * h) *\<^sub>C g x) = (\<lambda>z. cnj (cnj (f x)) * cinner dg z + cnj (cnj df) * cinner (cnj (g x)) z)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma real_average_minus_first [simp]: "(a + b) / 2 - a = (b - a) / 2"
  for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b) / 2 - a = (b - a) / 2
[PROOF STEP]
by simp