[STATEMENT]
lemma bij_betw_quotient_range_permutation_eq:
  assumes "finite A" "finite B"
  assumes "card A = card B"
  shows "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
 2. {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B
[PROOF STEP]
show "{{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B
[PROOF STEP]
by (simp add: bijections_in_range_permutation[OF assms])
[PROOF STATE]
proof (state)
this:
{{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
show "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
fix F
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
assume F_in: "F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B"
[PROOF STATE]
proof (state)
this:
F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
have "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {F \<in> ((A \<rightarrow>\<^sub>E B) // range_permutation A B). univ (\<lambda>f. bij_betw f A B) F}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
[PROOF STEP]
using equiv_range_permutation[of A B] bij_betw_respects_range_permutation[of A B]
[PROOF STATE]
proof (prove)
using this:
equiv (A \<rightarrow>\<^sub>E B) (range_permutation A B)
(\<lambda>f. bij_betw f A B) respects range_permutation A B

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
[PROOF STEP]
by (simp only: univ_preserves_predicate)
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. bij_betw f A B) F}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
from this F_in
[PROOF STATE]
proof (chain)
picking this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B
[PROOF STEP]
have "F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B"
      and "univ (\<lambda>f. bij_betw f A B) F"
[PROOF STATE]
proof (prove)
using this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B = {F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B. univ (\<lambda>f. bij_betw f A B) F}
F \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B

goal (1 subgoal):
 1. F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B &&& univ (\<lambda>f. bij_betw f A B) F
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B
univ (\<lambda>f. bij_betw f A B) F

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
have "F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
have "\<forall>f \<in> F. f \<in> A \<rightarrow>\<^sub>E B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
using \<open>F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B\<close>
[PROOF STATE]
proof (prove)
using this:
F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B

goal (1 subgoal):
 1. \<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
by (metis ImageE equiv_class_eq_iff equiv_range_permutation quotientE)
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B

goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B

goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
have "\<forall>f \<in> F. bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
using univ_predicate_impl_forall[OF equiv_range_permutation bij_betw_respects_range_permutation]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?X \<in> (?A1 \<rightarrow>\<^sub>E ?B1) // range_permutation ?A1 ?B1; univ (\<lambda>f. bij_betw f ?A1 ?B1) ?X\<rbrakk> \<Longrightarrow> \<forall>x\<in>?X. bij_betw x ?A1 ?B1

goal (1 subgoal):
 1. \<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
using \<open>F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B\<close> \<open>univ (\<lambda>f. bij_betw f A B) F\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?X \<in> (?A1 \<rightarrow>\<^sub>E ?B1) // range_permutation ?A1 ?B1; univ (\<lambda>f. bij_betw f ?A1 ?B1) ?X\<rbrakk> \<Longrightarrow> \<forall>x\<in>?X. bij_betw x ?A1 ?B1
F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B
univ (\<lambda>f. bij_betw f A B) F

goal (1 subgoal):
 1. \<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>F. bij_betw f A B

goal (2 subgoals):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
 2. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
\<forall>f\<in>F. bij_betw f A B
[PROOF STEP]
show "F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}"
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>F. f \<in> A \<rightarrow>\<^sub>E B
\<forall>f\<in>F. bij_betw f A B

goal (1 subgoal):
 1. F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
show "{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
fix f'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
assume "f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}"
[PROOF STATE]
proof (state)
this:
f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
have "f' \<in> A \<rightarrow>\<^sub>E B" "bij_betw f' A B"
[PROOF STATE]
proof (prove)
using this:
f' \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. f' \<in> A \<rightarrow>\<^sub>E B &&& bij_betw f' A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f' \<in> A \<rightarrow>\<^sub>E B
bij_betw f' A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
obtain f where "f \<in> A \<rightarrow>\<^sub>E B" and "F = range_permutation A B `` {f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; F = range_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B\<close>
[PROOF STATE]
proof (prove)
using this:
F \<in> (A \<rightarrow>\<^sub>E B) // range_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; F = range_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: quotientE)
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
F = range_permutation A B `` {f}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
have "bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f A B
[PROOF STEP]
using univ_commute'[OF equiv_range_permutation bij_betw_respects_range_permutation]
[PROOF STATE]
proof (prove)
using this:
?x \<in> ?A1 \<rightarrow>\<^sub>E ?B1 \<Longrightarrow> univ (\<lambda>f. bij_betw f ?A1 ?B1) (range_permutation ?A1 ?B1 `` {?x}) = bij_betw ?x ?A1 ?B1

goal (1 subgoal):
 1. bij_betw f A B
[PROOF STEP]
using \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> \<open>F = range_permutation A B `` {f}\<close> \<open>univ (\<lambda>f. bij_betw f A B) F\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> ?A1 \<rightarrow>\<^sub>E ?B1 \<Longrightarrow> univ (\<lambda>f. bij_betw f ?A1 ?B1) (range_permutation ?A1 ?B1 `` {?x}) = bij_betw ?x ?A1 ?B1
f \<in> A \<rightarrow>\<^sub>E B
F = range_permutation A B `` {f}
univ (\<lambda>f. bij_betw f A B) F

goal (1 subgoal):
 1. bij_betw f A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bij_betw f A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
obtain p where "p permutes B" "\<forall>x\<in>A. f x = p (f' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes B; \<forall>x\<in>A. f x = p (f' x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtain_range_permutation_for_two_bijections
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?f' ?A ?B; \<And>p. \<lbrakk>p permutes ?B; \<forall>a\<in>?A. ?f a = p (?f' a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes B; \<forall>x\<in>A. f x = p (f' x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>bij_betw f A B\<close> \<open>bij_betw f' A B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij_betw ?f ?A ?B; bij_betw ?f' ?A ?B; \<And>p. \<lbrakk>p permutes ?B; \<forall>a\<in>?A. ?f a = p (?f' a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
bij_betw f A B
bij_betw f' A B

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes B; \<forall>x\<in>A. f x = p (f' x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p permutes B
\<forall>x\<in>A. f x = p (f' x)

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
from this \<open>f \<in> A \<rightarrow>\<^sub>E B\<close> \<open>f' \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes B
\<forall>x\<in>A. f x = p (f' x)
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
have "(f, f') \<in> range_permutation A B"
[PROOF STATE]
proof (prove)
using this:
p permutes B
\<forall>x\<in>A. f x = p (f' x)
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. (f, f') \<in> range_permutation A B
[PROOF STEP]
unfolding range_permutation_def
[PROOF STATE]
proof (prove)
using this:
p permutes B
\<forall>x\<in>A. f x = p (f' x)
f \<in> A \<rightarrow>\<^sub>E B
f' \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. (f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes B \<and> (\<forall>x\<in>A. f x = p (f' x)))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f, f') \<in> range_permutation A B

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<Longrightarrow> x \<in> F
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> range_permutation A B
[PROOF STEP]
show "f' \<in> F"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> range_permutation A B

goal (1 subgoal):
 1. f' \<in> F
[PROOF STEP]
using \<open>F = range_permutation A B `` {f}\<close>
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> range_permutation A B
F = range_permutation A B `` {f}

goal (1 subgoal):
 1. f' \<in> F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f' \<in> F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} \<subseteq> F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. \<And>x. x \<in> {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<Longrightarrow> x \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}
[PROOF STEP]
show "F \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}"
[PROOF STATE]
proof (prove)
using this:
F = {f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}

goal (1 subgoal):
 1. F \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
F \<in> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // range_permutation A B \<subseteq> {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma usc_limsup_at:
  fixes f :: "'a::metric_space \<Rightarrow> ereal"
  shows "usc_at x0 f \<longleftrightarrow> f x0 \<ge> Limsup (at x0) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
have "usc_at x0 f \<longleftrightarrow> lsc_at x0 (\<lambda>x. -(f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. usc_at x0 f = lsc_at x0 (\<lambda>x. - f x)
[PROOF STEP]
by (metis lsc_uminus)
[PROOF STATE]
proof (state)
this:
usc_at x0 f = lsc_at x0 (\<lambda>x. - f x)

goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
usc_at x0 f = lsc_at x0 (\<lambda>x. - f x)

goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> -(f x0) \<le> Liminf (at x0) (\<lambda>x. -(f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lsc_at x0 (\<lambda>x. - f x) = (- f x0 \<le> Liminf (at x0) (\<lambda>x. - f x))
[PROOF STEP]
by (metis lsc_liminf_at)
[PROOF STATE]
proof (state)
this:
lsc_at x0 (\<lambda>x. - f x) = (- f x0 \<le> Liminf (at x0) (\<lambda>x. - f x))

goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lsc_at x0 (\<lambda>x. - f x) = (- f x0 \<le> Liminf (at x0) (\<lambda>x. - f x))

goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> -(f x0) \<le> -(Limsup (at x0) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- f x0 \<le> Liminf (at x0) (\<lambda>x. - f x)) = (- f x0 \<le> - Limsup (at x0) f)
[PROOF STEP]
by (metis ereal_Liminf_uminus)
[PROOF STATE]
proof (state)
this:
(- f x0 \<le> Liminf (at x0) (\<lambda>x. - f x)) = (- f x0 \<le> - Limsup (at x0) f)

goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
usc_at x0 f = (- f x0 \<le> - Limsup (at x0) f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
usc_at x0 f = (- f x0 \<le> - Limsup (at x0) f)

goal (1 subgoal):
 1. usc_at x0 f = (Limsup (at x0) f \<le> f x0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
usc_at x0 f = (Limsup (at x0) f \<le> f x0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_zero_power' [simp]: "summable (\<lambda>n. f n * 0 ^ n :: 'a::{ring_1,topological_space})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. f n * (0::'a) ^ n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. f n * (0::'a) ^ n)
[PROOF STEP]
have "(\<lambda>n. f n * 0 ^ n :: 'a) = (\<lambda>n. if n = 0 then f 0 * 0^0 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n * (0::'a) ^ n) = (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))
[PROOF STEP]
by (intro ext) (simp add: zero_power)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f n * (0::'a) ^ n) = (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable (\<lambda>n. f n * (0::'a) ^ n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f n * (0::'a) ^ n) = (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable (\<lambda>n. f n * (0::'a) ^ n)
[PROOF STEP]
have "summable \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable (\<lambda>n. f n * (0::'a) ^ n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. f n * (0::'a) ^ n) = (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))
summable (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f n * (0::'a) ^ n) = (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))
summable (\<lambda>n. if n = 0 then f 0 * (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable (\<lambda>n. f n * (0::'a) ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f n * (0::'a) ^ n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring) exp_base_closed:
  assumes "x \<in> carrier R" shows "set (exp_base x n) \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (exp_base x n) \<subseteq> carrier R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R

goal (1 subgoal):
 1. set (exp_base x n) \<subseteq> carrier R
[PROOF STEP]
by (induct n) (auto simp add: exp_base_def)


[STATEMENT]
lemma flatten_matrix_extract_matrix:
  "flatten_matrix (extract_matrix a m n) k = a k" if "k < m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
k < m * n
[PROOF STEP]
have "m * n > 0"
[PROOF STATE]
proof (prove)
using this:
k < m * n

goal (1 subgoal):
 1. 0 < m * n
[PROOF STEP]
by (cases "m * n = 0") simp_all
[PROOF STATE]
proof (state)
this:
0 < m * n

goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < m * n
[PROOF STEP]
have "m > 0" and "n > 0"
[PROOF STATE]
proof (prove)
using this:
0 < m * n

goal (1 subgoal):
 1. 0 < m &&& 0 < n
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < m
0 < n

goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
k < m * n
0 < m
0 < n
[PROOF STEP]
have "k div n < m"
[PROOF STATE]
proof (prove)
using this:
k < m * n
0 < m
0 < n

goal (1 subgoal):
 1. k div n < m
[PROOF STEP]
by (metis div_eq_0_iff div_mult2_eq mult.commute neq0_conv)
[PROOF STATE]
proof (state)
this:
k div n < m

goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
k div n < m

goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
have "k mod n < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k mod n < n
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n

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

goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
k div n < m
k mod n < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k div n < m
k mod n < n

goal (1 subgoal):
 1. flatten_matrix (extract_matrix a m n) k = a k
[PROOF STEP]
by (auto simp add: extract_matrix_def flatten_matrix_def)
[PROOF STATE]
proof (state)
this:
flatten_matrix (extract_matrix a m n) k = a k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_dim:
  assumes fin: "finite X"
    and X: "X \<subseteq> carrier_vec n"
  shows "dim_vec (lincomb a X) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (lincomb a X) = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_vec (lincomb a X) = n
[PROOF STEP]
let ?f = "\<lambda>v. a v \<cdot>\<^sub>v v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_vec (lincomb a X) = n
[PROOF STEP]
have f: "?f \<in> X \<rightarrow> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. a v \<cdot>\<^sub>v v) \<in> X \<rightarrow> carrier_vec n
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> X \<Longrightarrow> a x \<cdot>\<^sub>v x \<in> carrier_vec n
[PROOF STEP]
using X
[PROOF STATE]
proof (prove)
using this:
X \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>x. x \<in> X \<Longrightarrow> a x \<cdot>\<^sub>v x \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>v. a v \<cdot>\<^sub>v v) \<in> X \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. dim_vec (lincomb a X) = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (lincomb a X) = n
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (\<Oplus>\<^bsub>V\<^esub>v\<in>X. a v \<cdot>\<^sub>v v) = n
[PROOF STEP]
using finsum_dim[OF fin f]
[PROOF STATE]
proof (prove)
using this:
dim_vec (\<Oplus>\<^bsub>V\<^esub>v\<in>X. a v \<cdot>\<^sub>v v) = n

goal (1 subgoal):
 1. dim_vec (\<Oplus>\<^bsub>V\<^esub>v\<in>X. a v \<cdot>\<^sub>v v) = n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dim_vec (lincomb a X) = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d2_var:
  assumes "test p"
    shows "d (p \<sqinter> x) \<le> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
have "!p \<sqinter> p \<sqinter> x = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ! p \<sqinter> p \<sqinter> x = bot
[PROOF STEP]
by (simp add: assms neg_char)
[PROOF STATE]
proof (state)
this:
! p \<sqinter> p \<sqinter> x = bot

goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
hence "d (!p \<sqinter> p \<sqinter> x) = bot"
[PROOF STATE]
proof (prove)
using this:
! p \<sqinter> p \<sqinter> x = bot

goal (1 subgoal):
 1. d (! p \<sqinter> p \<sqinter> x) = bot
[PROOF STEP]
by (simp add: d_strict_eq_var)
[PROOF STATE]
proof (state)
this:
d (! p \<sqinter> p \<sqinter> x) = bot

goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
hence "d (!p \<sqinter> d (p \<sqinter> x)) = bot"
[PROOF STATE]
proof (prove)
using this:
d (! p \<sqinter> p \<sqinter> x) = bot

goal (1 subgoal):
 1. d (! p \<sqinter> d (p \<sqinter> x)) = bot
[PROOF STEP]
by (metis d3_var il_inf_associative less_eq_bot)
[PROOF STATE]
proof (state)
this:
d (! p \<sqinter> d (p \<sqinter> x)) = bot

goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
hence "!p \<sqinter> d (p \<sqinter> x) = bot"
[PROOF STATE]
proof (prove)
using this:
d (! p \<sqinter> d (p \<sqinter> x)) = bot

goal (1 subgoal):
 1. ! p \<sqinter> d (p \<sqinter> x) = bot
[PROOF STEP]
using d_bot_only
[PROOF STATE]
proof (prove)
using this:
d (! p \<sqinter> d (p \<sqinter> x)) = bot
d ?x = bot \<Longrightarrow> ?x = bot

goal (1 subgoal):
 1. ! p \<sqinter> d (p \<sqinter> x) = bot
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
! p \<sqinter> d (p \<sqinter> x) = bot

goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
! p \<sqinter> d (p \<sqinter> x) = bot

goal (1 subgoal):
 1. d (p \<sqinter> x) \<le> p
[PROOF STEP]
by (metis (no_types, opaque_lifting) assms d_sub_identity il_bot_unit il_inf_left_unit il_inf_right_dist_sup il_inf_right_unit il_sub_inf_right_isotone neg_char)
[PROOF STATE]
proof (state)
this:
d (p \<sqinter> x) \<le> p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sinh_real_eq_iff [simp]: "sinh x = sinh y \<longleftrightarrow> x = (y :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sinh x = sinh y) = (x = y)
[PROOF STEP]
using sinh_real_strict_mono
[PROOF STATE]
proof (prove)
using this:
strict_mono sinh

goal (1 subgoal):
 1. (sinh x = sinh y) = (x = y)
[PROOF STEP]
by (simp add: strict_mono_eq)


[STATEMENT]
lemma nullstellensatz_lemma:
  fixes p :: "complex poly"
  assumes "\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0"
    and "degree p = n"
    and "n \<noteq> 0"
  shows "p dvd (q ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0
degree p = n
n \<noteq> 0

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
proof (induct n arbitrary: p q rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p q. \<lbrakk>\<forall>m<n. \<forall>x xa. (\<forall>xb. poly x xb = 0 \<longrightarrow> poly xa xb = 0) \<longrightarrow> degree x = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> x dvd xa ^ m; \<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0; degree p = n; n \<noteq> 0\<rbrakk> \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p q. \<lbrakk>\<forall>m<n. \<forall>x xa. (\<forall>xb. poly x xb = 0 \<longrightarrow> poly xa xb = 0) \<longrightarrow> degree x = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> x dvd xa ^ m; \<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0; degree p = n; n \<noteq> 0\<rbrakk> \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
fix p q :: "complex poly"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n p q. \<lbrakk>\<forall>m<n. \<forall>x xa. (\<forall>xb. poly x xb = 0 \<longrightarrow> poly xa xb = 0) \<longrightarrow> degree x = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> x dvd xa ^ m; \<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0; degree p = n; n \<noteq> 0\<rbrakk> \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
assume IH: "\<forall>m<n. \<forall>p q.
                 (\<forall>x. poly p x = (0::complex) \<longrightarrow> poly q x = 0) \<longrightarrow>
                 degree p = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> p dvd (q ^ m)"
    and pq0: "\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0"
    and dpn: "degree p = n"
    and n0: "n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
\<forall>m<n. \<forall>p q. (\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0) \<longrightarrow> degree p = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> p dvd q ^ m
\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0
degree p = n
n \<noteq> 0

goal (1 subgoal):
 1. \<And>n p q. \<lbrakk>\<forall>m<n. \<forall>x xa. (\<forall>xb. poly x xb = 0 \<longrightarrow> poly xa xb = 0) \<longrightarrow> degree x = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> x dvd xa ^ m; \<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0; degree p = n; n \<noteq> 0\<rbrakk> \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
from dpn n0
[PROOF STATE]
proof (chain)
picking this:
degree p = n
n \<noteq> 0
[PROOF STEP]
have pne: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
degree p = n
n \<noteq> 0

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

goal (1 subgoal):
 1. \<And>n p q. \<lbrakk>\<forall>m<n. \<forall>x xa. (\<forall>xb. poly x xb = 0 \<longrightarrow> poly xa xb = 0) \<longrightarrow> degree x = m \<longrightarrow> m \<noteq> 0 \<longrightarrow> x dvd xa ^ m; \<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0; degree p = n; n \<noteq> 0\<rbrakk> \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
show "p dvd (q ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
proof (cases "\<exists>a. poly p a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
 2. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<exists>a. poly p a = 0

goal (2 subgoals):
 1. \<exists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
 2. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. poly p a = 0
[PROOF STEP]
obtain a where a: "poly p a = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. poly p a = 0

goal (1 subgoal):
 1. (\<And>a. poly p a = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
poly p a = 0

goal (2 subgoals):
 1. \<exists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
 2. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
have ?thesis if oa: "order a p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
let ?op = "order a p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
from pne
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
have ap: "([:- a, 1:] ^ ?op) dvd p" "\<not> [:- a, 1:] ^ (Suc ?op) dvd p"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. [:- a, 1:] ^ order a p dvd p &&& \<not> [:- a, 1:] ^ Suc (order a p) dvd p
[PROOF STEP]
using order
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
?p \<noteq> 0 \<Longrightarrow> [:- ?a, 1::?'a:] ^ order ?a ?p dvd ?p \<and> \<not> [:- ?a, 1::?'a:] ^ Suc (order ?a ?p) dvd ?p

goal (1 subgoal):
 1. [:- a, 1:] ^ order a p dvd p &&& \<not> [:- a, 1:] ^ Suc (order a p) dvd p
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
[:- a, 1:] ^ order a p dvd p
\<not> [:- a, 1:] ^ Suc (order a p) dvd p

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
note oop = order_degree[OF pne, unfolded dpn]
[PROOF STATE]
proof (state)
this:
order ?a p \<le> n

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
proof (cases "q = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. q = 0 \<Longrightarrow> p dvd q ^ n
 2. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
q = 0

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> p dvd q ^ n
 2. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
with n0
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
q = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
q = 0

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
by (simp add: power_0_left)
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
q \<noteq> 0

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
from pq0[rule_format, OF a, unfolded poly_eq_0_iff_dvd]
[PROOF STATE]
proof (chain)
picking this:
[:- a, 1:] dvd q
[PROOF STEP]
obtain r where r: "q = [:- a, 1:] * r"
[PROOF STATE]
proof (prove)
using this:
[:- a, 1:] dvd q

goal (1 subgoal):
 1. (\<And>r. q = [:- a, 1:] * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule dvdE)
[PROOF STATE]
proof (state)
this:
q = [:- a, 1:] * r

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
from ap(1)
[PROOF STATE]
proof (chain)
picking this:
[:- a, 1:] ^ order a p dvd p
[PROOF STEP]
obtain s where s: "p = [:- a, 1:] ^ ?op * s"
[PROOF STATE]
proof (prove)
using this:
[:- a, 1:] ^ order a p dvd p

goal (1 subgoal):
 1. (\<And>s. p = [:- a, 1:] ^ order a p * s \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule dvdE)
[PROOF STATE]
proof (state)
this:
p = [:- a, 1:] ^ order a p * s

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
have sne: "s \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<noteq> 0
[PROOF STEP]
using s pne
[PROOF STATE]
proof (prove)
using this:
p = [:- a, 1:] ^ order a p * s
p \<noteq> 0

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

goal (1 subgoal):
 1. q \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
proof (cases "degree s = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree s = 0 \<Longrightarrow> p dvd q ^ n
 2. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree s = 0

goal (2 subgoals):
 1. degree s = 0 \<Longrightarrow> p dvd q ^ n
 2. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree s = 0
[PROOF STEP]
obtain k where kpn: "s = [:k:]"
[PROOF STATE]
proof (prove)
using this:
degree s = 0

goal (1 subgoal):
 1. (\<And>k. s = [:k:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases s) (auto split: if_splits)
[PROOF STATE]
proof (state)
this:
s = [:k:]

goal (2 subgoals):
 1. degree s = 0 \<Longrightarrow> p dvd q ^ n
 2. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
from sne kpn
[PROOF STATE]
proof (chain)
picking this:
s \<noteq> 0
s = [:k:]
[PROOF STEP]
have k: "k \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
s \<noteq> 0
s = [:k:]

goal (1 subgoal):
 1. k \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (2 subgoals):
 1. degree s = 0 \<Longrightarrow> p dvd q ^ n
 2. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
let ?w = "([:1/k:] * ([:-a,1:] ^ (n - ?op))) * (r ^ n)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree s = 0 \<Longrightarrow> p dvd q ^ n
 2. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
have "q ^ n = p * ?w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q ^ n = p * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
apply (subst r)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([:- a, 1:] * r) ^ n = p * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
apply (subst s)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([:- a, 1:] * r) ^ n = [:- a, 1:] ^ order a p * s * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
apply (subst kpn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([:- a, 1:] * r) ^ n = [:- a, 1:] ^ order a p * [:k:] * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
using k oop [of a]
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
order a p \<le> n

goal (1 subgoal):
 1. ([:- a, 1:] * r) ^ n = [:- a, 1:] ^ order a p * [:k:] * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
apply (subst power_mult_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<noteq> 0; order a p \<le> n\<rbrakk> \<Longrightarrow> [:- a, 1:] ^ n * r ^ n = [:- a, 1:] ^ order a p * [:k:] * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<noteq> 0; order a p \<le> n\<rbrakk> \<Longrightarrow> r = 0 \<and> 0 < n \<or> [:- a, 1:] ^ n = [:- a, 1:] ^ order a p * [:- a, 1:] ^ (n - order a p)
[PROOF STEP]
apply (subst power_add [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>k \<noteq> 0; order a p \<le> n\<rbrakk> \<Longrightarrow> r = 0 \<and> 0 < n \<or> [:- a, 1:] ^ n = [:- a, 1:] ^ (order a p + (n - order a p))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
q ^ n = p * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)

goal (2 subgoals):
 1. degree s = 0 \<Longrightarrow> p dvd q ^ n
 2. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q ^ n = p * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
q ^ n = p * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
q ^ n = p * ([:1 / k:] * [:- a, 1:] ^ (n - order a p) * r ^ n)

goal (1 subgoal):
 1. \<exists>k. q ^ n = p * k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
degree s \<noteq> 0

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
with sne dpn s oa
[PROOF STATE]
proof (chain)
picking this:
s \<noteq> 0
degree p = n
p = [:- a, 1:] ^ order a p * s
order a p \<noteq> 0
degree s \<noteq> 0
[PROOF STEP]
have dsn: "degree s < n"
[PROOF STATE]
proof (prove)
using this:
s \<noteq> 0
degree p = n
p = [:- a, 1:] ^ order a p * s
order a p \<noteq> 0
degree s \<noteq> 0

goal (1 subgoal):
 1. degree s < n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<noteq> 0; p = [:- a, 1:] ^ order a p * s; 0 < order a p; 0 < degree s; n = degree p\<rbrakk> \<Longrightarrow> degree s < degree p
[PROOF STEP]
apply (erule ssubst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<noteq> 0; 0 < order a p; 0 < degree s; n = degree p\<rbrakk> \<Longrightarrow> degree s < degree ([:- a, 1:] ^ order a p * s)
[PROOF STEP]
apply (simp add: degree_mult_eq degree_linear_power)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
degree s < n

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
have "poly r x = 0" if h: "poly s x = 0" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly r x = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly r x = 0
[PROOF STEP]
have xa: "x \<noteq> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> a
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = a \<Longrightarrow> False
[PROOF STEP]
assume "x = a"
[PROOF STATE]
proof (state)
this:
x = a

goal (1 subgoal):
 1. x = a \<Longrightarrow> False
[PROOF STEP]
from h[unfolded this poly_eq_0_iff_dvd]
[PROOF STATE]
proof (chain)
picking this:
[:- a, 1:] dvd s
[PROOF STEP]
obtain u where u: "s = [:- a, 1:] * u"
[PROOF STATE]
proof (prove)
using this:
[:- a, 1:] dvd s

goal (1 subgoal):
 1. (\<And>u. s = [:- a, 1:] * u \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule dvdE)
[PROOF STATE]
proof (state)
this:
s = [:- a, 1:] * u

goal (1 subgoal):
 1. x = a \<Longrightarrow> False
[PROOF STEP]
have "p = [:- a, 1:] ^ (Suc ?op) * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = [:- a, 1:] ^ Suc (order a p) * u
[PROOF STEP]
apply (subst s)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- a, 1:] ^ order a p * s = [:- a, 1:] ^ Suc (order a p) * u
[PROOF STEP]
apply (subst u)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- a, 1:] ^ order a p * ([:- a, 1:] * u) = [:- a, 1:] ^ Suc (order a p) * u
[PROOF STEP]
apply (simp only: power_Suc ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
p = [:- a, 1:] ^ Suc (order a p) * u

goal (1 subgoal):
 1. x = a \<Longrightarrow> False
[PROOF STEP]
with ap(2)[unfolded dvd_def]
[PROOF STATE]
proof (chain)
picking this:
\<nexists>k. p = [:- a, 1:] ^ Suc (order a p) * k
p = [:- a, 1:] ^ Suc (order a p) * u
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<nexists>k. p = [:- a, 1:] ^ Suc (order a p) * k
p = [:- a, 1:] ^ Suc (order a p) * u

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

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

goal (1 subgoal):
 1. poly r x = 0
[PROOF STEP]
from h
[PROOF STATE]
proof (chain)
picking this:
poly s x = 0
[PROOF STEP]
have "poly p x = 0"
[PROOF STATE]
proof (prove)
using this:
poly s x = 0

goal (1 subgoal):
 1. poly p x = 0
[PROOF STEP]
by (subst s) simp
[PROOF STATE]
proof (state)
this:
poly p x = 0

goal (1 subgoal):
 1. poly r x = 0
[PROOF STEP]
with pq0
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0
poly p x = 0
[PROOF STEP]
have "poly q x = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0
poly p x = 0

goal (1 subgoal):
 1. poly q x = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poly q x = 0

goal (1 subgoal):
 1. poly r x = 0
[PROOF STEP]
with r xa
[PROOF STATE]
proof (chain)
picking this:
q = [:- a, 1:] * r
x \<noteq> a
poly q x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
q = [:- a, 1:] * r
x \<noteq> a
poly q x = 0

goal (1 subgoal):
 1. poly r x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly r x = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly s ?x = 0 \<Longrightarrow> poly r ?x = 0

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
with IH[rule_format, OF dsn, of s r] False
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x. poly s x = 0 \<Longrightarrow> poly r x = 0; degree s = degree s; degree s \<noteq> 0\<rbrakk> \<Longrightarrow> s dvd r ^ degree s
degree s \<noteq> 0
poly s ?x = 0 \<Longrightarrow> poly r ?x = 0
[PROOF STEP]
have "s dvd (r ^ (degree s))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. poly s x = 0 \<Longrightarrow> poly r x = 0; degree s = degree s; degree s \<noteq> 0\<rbrakk> \<Longrightarrow> s dvd r ^ degree s
degree s \<noteq> 0
poly s ?x = 0 \<Longrightarrow> poly r ?x = 0

goal (1 subgoal):
 1. s dvd r ^ degree s
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s dvd r ^ degree s

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s dvd r ^ degree s
[PROOF STEP]
obtain u where u: "r ^ (degree s) = s * u"
[PROOF STATE]
proof (prove)
using this:
s dvd r ^ degree s

goal (1 subgoal):
 1. (\<And>u. r ^ degree s = s * u \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
r ^ degree s = s * u

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r ^ degree s = s * u
[PROOF STEP]
have u': "\<And>x. poly s x * poly u x = poly r x ^ degree s"
[PROOF STATE]
proof (prove)
using this:
r ^ degree s = s * u

goal (1 subgoal):
 1. \<And>x. poly s x * poly u x = poly r x ^ degree s
[PROOF STEP]
by (simp only: poly_mult[symmetric] poly_power[symmetric])
[PROOF STATE]
proof (state)
this:
poly s ?x * poly u ?x = poly r ?x ^ degree s

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
let ?w = "(u * ([:-a,1:] ^ (n - ?op))) * (r ^ (n - degree s))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
from oop[of a] dsn
[PROOF STATE]
proof (chain)
picking this:
order a p \<le> n
degree s < n
[PROOF STEP]
have "q ^ n = p * ?w"
[PROOF STATE]
proof (prove)
using this:
order a p \<le> n
degree s < n

goal (1 subgoal):
 1. q ^ n = p * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> q ^ n = p * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))
[PROOF STEP]
apply (subst s)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> q ^ n = [:- a, 1:] ^ order a p * s * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))
[PROOF STEP]
apply (subst r)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> ([:- a, 1:] * r) ^ n = [:- a, 1:] ^ order a p * s * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))
[PROOF STEP]
apply (simp only: power_mult_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> [:- a, 1:] ^ n * r ^ n = [:- a, 1:] ^ order a p * s * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))
[PROOF STEP]
apply (subst mult.assoc [where b=s])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> [:- a, 1:] ^ n * r ^ n = [:- a, 1:] ^ order a p * (s * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s)))
[PROOF STEP]
apply (subst mult.assoc [where a=u])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> [:- a, 1:] ^ n * r ^ n = [:- a, 1:] ^ order a p * (s * (u * ([:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))))
[PROOF STEP]
apply (subst mult.assoc [where b=u, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> [:- a, 1:] ^ n * r ^ n = [:- a, 1:] ^ order a p * (s * u * ([:- a, 1:] ^ (n - order a p) * r ^ (n - degree s)))
[PROOF STEP]
apply (subst u [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order a p \<le> n; degree s < n\<rbrakk> \<Longrightarrow> [:- a, 1:] ^ n * r ^ n = [:- a, 1:] ^ order a p * (r ^ degree s * ([:- a, 1:] ^ (n - order a p) * r ^ (n - degree s)))
[PROOF STEP]
apply (simp add: ac_simps power_add [symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
q ^ n = p * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))

goal (1 subgoal):
 1. degree s \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q ^ n = p * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
q ^ n = p * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
q ^ n = p * (u * [:- a, 1:] ^ (n - order a p) * r ^ (n - degree s))

goal (1 subgoal):
 1. \<exists>k. q ^ n = p * k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
order a p \<noteq> 0 \<Longrightarrow> p dvd q ^ n

goal (2 subgoals):
 1. \<exists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
 2. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
order a p \<noteq> 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
order a p \<noteq> 0 \<Longrightarrow> p dvd q ^ n

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
using a order_root pne
[PROOF STATE]
proof (prove)
using this:
order a p \<noteq> 0 \<Longrightarrow> p dvd q ^ n
poly p a = 0
(poly ?p ?a = (0::?'a)) = (?p = 0 \<or> order ?a ?p \<noteq> 0)
p \<noteq> 0

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<nexists>a. poly p a = 0

goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
with fundamental_theorem_of_algebra_alt[of p]
[PROOF STATE]
proof (chain)
picking this:
\<nexists>a l. a \<noteq> 0 \<and> l = 0 \<and> p = pCons a l \<Longrightarrow> \<exists>z. poly p z = 0
\<nexists>a. poly p a = 0
[PROOF STEP]
obtain c where ccs: "c \<noteq> 0" "p = pCons c 0"
[PROOF STATE]
proof (prove)
using this:
\<nexists>a l. a \<noteq> 0 \<and> l = 0 \<and> p = pCons a l \<Longrightarrow> \<exists>z. poly p z = 0
\<nexists>a. poly p a = 0

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>c \<noteq> 0; p = [:c:]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c \<noteq> 0
p = [:c:]

goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
p = [:c:]
[PROOF STEP]
have pp: "poly p x = c" for x
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
p = [:c:]

goal (1 subgoal):
 1. poly p x = c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly p ?x = c

goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
let ?w = "[:1/c:] * (q ^ n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
from ccs
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
p = [:c:]
[PROOF STEP]
have "(q ^ n) = (p * ?w)"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
p = [:c:]

goal (1 subgoal):
 1. q ^ n = p * ([:1 / c:] * q ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q ^ n = p * ([:1 / c:] * q ^ n)

goal (1 subgoal):
 1. \<nexists>a. poly p a = 0 \<Longrightarrow> p dvd q ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q ^ n = p * ([:1 / c:] * q ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
q ^ n = p * ([:1 / c:] * q ^ n)

goal (1 subgoal):
 1. p dvd q ^ n
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
q ^ n = p * ([:1 / c:] * q ^ n)

goal (1 subgoal):
 1. \<exists>k. q ^ n = p * k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p dvd q ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powa_powrat_lemma2:
  assumes "a \<ge> 1" and "p < 0"
  shows "(a powa x) pow\<^sub>\<rat> p = (a powa (x * of_rat p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a powa x) pow\<^sub>\<rat> p = a powa (x * real_of_rat p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a powa x) pow\<^sub>\<rat> p = a powa (x * real_of_rat p)
[PROOF STEP]
have "(a powa x) pow\<^sub>\<rat> - p = a powa (x * real_of_rat (- p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a powa x) pow\<^sub>\<rat> - p = a powa (x * real_of_rat (- p))
[PROOF STEP]
by (simp add: assms(1) assms(2) less_imp_le powa_powrat_lemma1)
[PROOF STATE]
proof (state)
this:
(a powa x) pow\<^sub>\<rat> - p = a powa (x * real_of_rat (- p))

goal (1 subgoal):
 1. (a powa x) pow\<^sub>\<rat> p = a powa (x * real_of_rat p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a powa x) pow\<^sub>\<rat> - p = a powa (x * real_of_rat (- p))
[PROOF STEP]
have  "inverse ((a powa x) pow\<^sub>\<rat> p) = inverse (a powa (x * real_of_rat p))"
[PROOF STATE]
proof (prove)
using this:
(a powa x) pow\<^sub>\<rat> - p = a powa (x * real_of_rat (- p))

goal (1 subgoal):
 1. inverse ((a powa x) pow\<^sub>\<rat> p) = inverse (a powa (x * real_of_rat p))
[PROOF STEP]
by (simp add: assms(1) of_rat_minus powa_minus powrat_minus)
[PROOF STATE]
proof (state)
this:
inverse ((a powa x) pow\<^sub>\<rat> p) = inverse (a powa (x * real_of_rat p))

goal (1 subgoal):
 1. (a powa x) pow\<^sub>\<rat> p = a powa (x * real_of_rat p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse ((a powa x) pow\<^sub>\<rat> p) = inverse (a powa (x * real_of_rat p))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse ((a powa x) pow\<^sub>\<rat> p) = inverse (a powa (x * real_of_rat p))

goal (1 subgoal):
 1. (a powa x) pow\<^sub>\<rat> p = a powa (x * real_of_rat p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a powa x) pow\<^sub>\<rat> p = a powa (x * real_of_rat p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma asIMOD_igSubstAbs:
"igSubstAbs (asIMOD SEM) ys Y y A =
(\<lambda>val. if sWlsVal SEM val then A (val (y := Y val)_ys) else undefined)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. igSubstAbs (asIMOD SEM) ys Y y A = (\<lambda>val. if sWlsVal SEM val then A (val (y := Y val)_ys) else undefined)
[PROOF STEP]
unfolding asIMOD_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. igSubstAbs \<lparr>igWls = \<lambda>s X. \<forall>val. (sWlsVal SEM val \<or> X val = undefined) \<and> (sWlsVal SEM val \<longrightarrow> sWls SEM s (X val)), igWlsAbs = \<lambda>(xs, s) A. \<forall>val. (sWlsVal SEM val \<or> A val = undefined) \<and> (sWlsVal SEM val \<longrightarrow> sWlsAbs SEM (xs, s) (A val)), igVar = \<lambda>ys y val. if sWlsVal SEM val then val ys y else undefined, igAbs = \<lambda>xs x X val. if sWlsVal SEM val then sAbs xs (\<lambda>sX. if sWls SEM (asSort xs) sX then X (val (x := sX)_xs) else sDummy SEM (SOME s. sWls SEM s (X val))) else undefined, igOp = \<lambda>delta inp binp val. if sWlsVal SEM val then sOp SEM delta (lift (\<lambda>X. X val) inp) (lift (\<lambda>A. A val) binp) else undefined, igFresh = \<lambda>ys y X. \<forall>val val'. sWlsVal SEM val \<and> sWlsVal SEM val' \<and> eqBut val val' ys y \<longrightarrow> X val = X val', igFreshAbs = \<lambda>ys y A. \<forall>val val'. sWlsVal SEM val \<and> sWlsVal SEM val' \<and> eqBut val val' ys y \<longrightarrow> A val = A val', igSwap = \<lambda>zs z1 z2 X val. if sWlsVal SEM val then X (val ^[z1 \<and> z2]_zs) else undefined, igSwapAbs = \<lambda>zs z1 z2 A val. if sWlsVal SEM val then A (val ^[z1 \<and> z2]_zs) else undefined, igSubst = \<lambda>ys Y y X val. if sWlsVal SEM val then X (val (y := Y val)_ys) else undefined, igSubstAbs = \<lambda>ys Y y A val. if sWlsVal SEM val then A (val (y := Y val)_ys) else undefined\<rparr> ys Y y A = (\<lambda>val. if sWlsVal SEM val then A (val (y := Y val)_ys) else undefined)
[PROOF STEP]
by simp


[STATEMENT]
lemma measure_pmf_UNIV [simp]: "measure (measure_pmf p) UNIV = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob p UNIV = 1
[PROOF STEP]
using measure_pmf.prob_space[of p]
[PROOF STATE]
proof (prove)
using this:
measure_pmf.prob p (space (measure_pmf p)) = 1

goal (1 subgoal):
 1. measure_pmf.prob p UNIV = 1
[PROOF STEP]
by simp


[STATEMENT]
theorem thmD4:
  assumes P: "P \<subseteq> \<PP>"
  shows "\<W> P k = TokensAt k (Gen P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<W> P k = TokensAt k (Gen P)
[PROOF STEP]
using \<W>_elem_in_TokensAt TokensAt_elem_in_\<W>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?P \<subseteq> \<PP>; ?u \<in> \<W> ?P ?k\<rbrakk> \<Longrightarrow> ?u \<in> TokensAt ?k (Gen ?P)
\<lbrakk>?P \<subseteq> \<PP>; ?u \<in> TokensAt ?k (Gen ?P)\<rbrakk> \<Longrightarrow> ?u \<in> \<W> ?P ?k

goal (1 subgoal):
 1. \<W> P k = TokensAt k (Gen P)
[PROOF STEP]
by (metis Collect_cong Collect_mem_eq assms)


[STATEMENT]
lemma moebius_similarity_inf_iff [simp]:
  assumes "a \<noteq> 0"
  shows "moebius_pt (moebius_similarity a b) z = \<infinity>\<^sub>h \<longleftrightarrow> z = \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (moebius_pt (moebius_similarity a b) z = \<infinity>\<^sub>h) = (z = \<infinity>\<^sub>h)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (moebius_pt (moebius_similarity a b) z = \<infinity>\<^sub>h) = (z = \<infinity>\<^sub>h)
[PROOF STEP]
using moebius_similarity_only_inf_to_inf[of a b z]
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
\<lbrakk>a \<noteq> 0; moebius_pt (moebius_similarity a b) z = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> z = \<infinity>\<^sub>h

goal (1 subgoal):
 1. (moebius_pt (moebius_similarity a b) z = \<infinity>\<^sub>h) = (z = \<infinity>\<^sub>h)
[PROOF STEP]
by auto


[STATEMENT]
lemma card_1_singletonI: "\<lbrakk>finite S; card S = 1; x\<in>S\<rbrakk> \<Longrightarrow> S={x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; card S = 1; x \<in> S\<rbrakk> \<Longrightarrow> S = {x}
[PROOF STEP]
proof (safe, rule ccontr, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case prems: (1 x')
[PROOF STATE]
proof (state)
this:
finite S
card S = 1
x \<in> S
x' \<in> S
x' \<notin> {}
x' \<noteq> x

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "finite (S-{x})" "S-{x} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
finite S
card S = 1
x \<in> S
x' \<in> S
x' \<notin> {}
x' \<noteq> x

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

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "card (S-{x}) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
finite (S - {x})
S - {x} \<noteq> {}

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

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (S - {x}) \<noteq> 0

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from prems(1-3)
[PROOF STATE]
proof (chain)
picking this:
finite S
card S = 1
x \<in> S
[PROOF STEP]
have "card (S-{x}) = 0"
[PROOF STATE]
proof (prove)
using this:
finite S
card S = 1
x \<in> S

goal (1 subgoal):
 1. card (S - {x}) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (S - {x}) = 0

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (S - {x}) \<noteq> 0
card (S - {x}) = 0
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
card (S - {x}) \<noteq> 0
card (S - {x}) = 0

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

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>finite S; card S = 1; x \<in> S; xa \<in> S; xa \<notin> {}; xa \<noteq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma oSuc_less_omega [simp]: "(oSuc x < \<omega>) = (x < \<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (oSuc x < \<omega>) = (x < \<omega>)
[PROOF STEP]
by (rule oSuc_less_limit_ordinal[OF limit_ordinal_omega])


[STATEMENT]
lemma F1set2_bd: "|F1set2 x| <o bd_F1 +c bd_F2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |F1set2 x| <o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule ordLess_ordLeq_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. |F1set2 x| <o ?r'
 2. ?r' \<le>o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule F1.set_bd(2))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bd_F1 \<le>o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule ordLeq_csum1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order bd_F1
[PROOF STEP]
apply (rule F1.bd_Card_order)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma comb_planar_impl_altdef: "comb_planar_impl G = (\<exists>M\<in>set (all_maps_list G). genus_impl G M = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comb_planar_impl G = (\<exists>M\<in>set (all_maps_list G). genus_impl G M = 0)
[PROOF STEP]
unfolding comb_planar_impl_def Let_def genus_impl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case G of (V, A) \<Rightarrow> \<exists>M\<in>set (all_maps_list G). (int (2 * card (sccs_verts_impl G)) - int (length (isolated_verts_impl G)) - int (length V) + int (length A) div 2 - int (length (orbits_list_impl (lists_fc_succ M) A))) div 2 = 0) = (\<exists>M\<in>set (all_maps_list G). (case G of (V, A) \<Rightarrow> (int (2 * card (sccs_verts_impl G)) - int (length (isolated_verts_impl G)) - (int (length V) - int (length A) div 2 + int (length (orbits_list_impl (lists_fc_succ M) A)))) div 2) = 0)
[PROOF STEP]
by (cases G) (simp add: algebra_simps)


[STATEMENT]
lemma (in is_cat_obj_coprod_2) is_cat_obj_prod_2_op'[cat_op_intros]:
  assumes "\<CC>' = op_cat \<CC>"
  shows "op_ntcf \<pi> : P <\<^sub>C\<^sub>F\<^sub>.\<^sub>\<times> {a,b} : 2\<^sub>C \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_ntcf \<pi> : P <\<^sub>C\<^sub>F\<^sub>.\<^sub>\<times> {a,b} : 2\<^sub>C \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>'
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_ntcf \<pi> : P <\<^sub>C\<^sub>F\<^sub>.\<^sub>\<times> {a,b} : 2\<^sub>C \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> op_cat \<CC>
[PROOF STEP]
by (rule is_cat_obj_prod_2_op)


[STATEMENT]
lemma lemCProps:
  assumes "IOb m"
     and  "v = c m"
  shows "(v > 0) \<and> (\<forall>x y.((\<exists>p. (Ph p \<and> W m p x \<and> W m p y))
                      \<longleftrightarrow> ( space2 x y = (c m * c m)*time2 x y )))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))
[PROOF STEP]
have vExists: "(\<exists>v. cTest m v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. cTest m v
[PROOF STEP]
by (metis AxPh assms(1))
[PROOF STATE]
proof (state)
this:
\<exists>v. cTest m v

goal (1 subgoal):
 1. (0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))
[PROOF STEP]
hence "cTest m (c m)"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. cTest m v

goal (1 subgoal):
 1. cTest m (c m)
[PROOF STEP]
by (metis lemSomeFunc)
[PROOF STATE]
proof (state)
this:
cTest m (c m)

goal (1 subgoal):
 1. (0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cTest m (c m)

goal (1 subgoal):
 1. (0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
cTest m (c m)
v = c m

goal (1 subgoal):
 1. (0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) < v \<and> (\<forall>x y. (\<exists>p. Ph p \<and> m sees p at x \<and> m sees p at y) = (space2 x y = c m * c m * time2 x y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_sign_and:
  "bin_sign (i AND j) = - (bin_sign i * bin_sign j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_sign (i AND j) = - (bin_sign i * bin_sign j)
[PROOF STEP]
by(simp add: bin_sign_def)


[STATEMENT]
lemma real_atLeastGreaterThan_eq: "real_of_ereal ` {N<..<M::ereal} =
   (if N = \<infinity> then {} else
   if N = -\<infinity> then
    (if M = \<infinity> then UNIV
    else if M = -\<infinity> then {}
    else {..< real_of_ereal M})
  else if M = - \<infinity> then {}
  else if M = \<infinity> then {real_of_ereal N<..}
  else {real_of_ereal N <..< real_of_ereal M})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
proof (cases "M = -\<infinity> \<or> M = \<infinity> \<or> N = -\<infinity> \<or> N = \<infinity>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity> \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
 2. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>

goal (2 subgoals):
 1. M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity> \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
 2. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>

goal (1 subgoal):
 1. real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
by (auto simp: real_greaterThanLessThan_minus_infinity_eq real_greaterThanLessThan_infinity_eq )
[PROOF STATE]
proof (state)
this:
real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})

goal (1 subgoal):
 1. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>)

goal (1 subgoal):
 1. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>)
[PROOF STEP]
obtain p q where "M = ereal p" "N = ereal q"
[PROOF STATE]
proof (prove)
using this:
\<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>)

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>M = ereal p; N = ereal q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis MInfty_eq_minfinity ereal.distinct(3) uminus_ereal.elims)
[PROOF STATE]
proof (state)
this:
M = ereal p
N = ereal q

goal (1 subgoal):
 1. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
M = ereal p
N = ereal q

goal (1 subgoal):
 1. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
have "\<And>x. \<lbrakk>q < x; x < p\<rbrakk> \<Longrightarrow> x \<in> real_of_ereal ` {ereal q<..<ereal p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>q < x; x < p\<rbrakk> \<Longrightarrow> x \<in> real_of_ereal ` {ereal q<..<ereal p}
[PROOF STEP]
by (metis greaterThanLessThan_iff imageI less_ereal.simps(1) real_of_ereal.simps(1))
[PROOF STATE]
proof (state)
this:
\<lbrakk>q < ?x; ?x < p\<rbrakk> \<Longrightarrow> ?x \<in> real_of_ereal ` {ereal q<..<ereal p}

goal (1 subgoal):
 1. \<not> (M = - \<infinity> \<or> M = \<infinity> \<or> N = - \<infinity> \<or> N = \<infinity>) \<Longrightarrow> real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
M = ereal p
N = ereal q
\<lbrakk>q < ?x; ?x < p\<rbrakk> \<Longrightarrow> ?x \<in> real_of_ereal ` {ereal q<..<ereal p}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
M = ereal p
N = ereal q
\<lbrakk>q < ?x; ?x < p\<rbrakk> \<Longrightarrow> ?x \<in> real_of_ereal ` {ereal q<..<ereal p}

goal (1 subgoal):
 1. real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})
[PROOF STEP]
by (auto elim!: less_ereal.elims)
[PROOF STATE]
proof (state)
this:
real_of_ereal ` {N<..<M} = (if N = \<infinity> then {} else if N = - \<infinity> then if M = \<infinity> then UNIV else if M = - \<infinity> then {} else {..<real_of_ereal M} else if M = - \<infinity> then {} else if M = \<infinity> then {real_of_ereal N<..} else {real_of_ereal N<..<real_of_ereal M})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma primes_coprime:
  "prime p \<Longrightarrow> prime q \<Longrightarrow> p \<noteq> q \<Longrightarrow> coprime p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q\<rbrakk> \<Longrightarrow> coprime p q
[PROOF STEP]
using prime_imp_coprime primes_dvd_imp_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>prime ?p; \<not> ?p dvd ?n\<rbrakk> \<Longrightarrow> coprime ?p ?n
\<lbrakk>prime ?p; prime ?q; ?p dvd ?q\<rbrakk> \<Longrightarrow> ?p = ?q

goal (1 subgoal):
 1. \<lbrakk>prime p; prime q; p \<noteq> q\<rbrakk> \<Longrightarrow> coprime p q
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_mult_assoc: "(f::('a::type,'b::dioid_one_zero) fps) * (g * h) = (f * g) * h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<cdot> (g \<cdot> h) = f \<cdot> g \<cdot> h
[PROOF STEP]
proof (rule fps_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n
[PROOF STEP]
fix n :: "'a list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n
[PROOF STEP]
have "(f * (g * h)) $ n = \<Sum>{\<Sum>{f $ (fst p) * g $ (fst q) * h $ (snd q) | q. q \<in> splitset (snd p)} | p. p \<in> splitset n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<cdot> (g \<cdot> h)) $ n = \<Sum> {\<Sum> {f $ fst p \<cdot> g $ fst q \<cdot> h $ snd q |q. q \<in> splitset (snd p)} |p. p \<in> splitset n}
[PROOF STEP]
by (simp add: fps_mult_image sum_sum_distl_fun mult.assoc)
[PROOF STATE]
proof (state)
this:
(f \<cdot> (g \<cdot> h)) $ n = \<Sum> {\<Sum> {f $ fst p \<cdot> g $ fst q \<cdot> h $ snd q |q. q \<in> splitset (snd p)} |p. p \<in> splitset n}

goal (1 subgoal):
 1. \<And>n. (f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<cdot> (g \<cdot> h)) $ n = \<Sum> {\<Sum> {f $ fst p \<cdot> g $ fst q \<cdot> h $ snd q |q. q \<in> splitset (snd p)} |p. p \<in> splitset n}

goal (1 subgoal):
 1. \<And>n. (f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n
[PROOF STEP]
have "... = \<Sum>{\<Sum>{f $ (fst q) * g $ (snd q) * h $ (snd p) | q. q \<in> splitset (fst p)} | p. p \<in> splitset n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {\<Sum> {f $ fst p \<cdot> g $ fst q \<cdot> h $ snd q |q. q \<in> splitset (snd p)} |p. p \<in> splitset n} = \<Sum> {\<Sum> {f $ fst q \<cdot> g $ snd q \<cdot> h $ snd p |q. q \<in> splitset (fst p)} |p. p \<in> splitset n}
[PROOF STEP]
by (fact splitset_rearrange)
[PROOF STATE]
proof (state)
this:
\<Sum> {\<Sum> {f $ fst p \<cdot> g $ fst q \<cdot> h $ snd q |q. q \<in> splitset (snd p)} |p. p \<in> splitset n} = \<Sum> {\<Sum> {f $ fst q \<cdot> g $ snd q \<cdot> h $ snd p |q. q \<in> splitset (fst p)} |p. p \<in> splitset n}

goal (1 subgoal):
 1. \<And>n. (f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<cdot> (g \<cdot> h)) $ n = \<Sum> {\<Sum> {f $ fst q \<cdot> g $ snd q \<cdot> h $ snd p |q. q \<in> splitset (fst p)} |p. p \<in> splitset n}
[PROOF STEP]
show "(f * (g * h)) $ n = ((f * g) * h) $ n"
[PROOF STATE]
proof (prove)
using this:
(f \<cdot> (g \<cdot> h)) $ n = \<Sum> {\<Sum> {f $ fst q \<cdot> g $ snd q \<cdot> h $ snd p |q. q \<in> splitset (fst p)} |p. p \<in> splitset n}

goal (1 subgoal):
 1. (f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n
[PROOF STEP]
by (simp add: fps_mult_image sum_sum_distr_fun mult.assoc)
[PROOF STATE]
proof (state)
this:
(f \<cdot> (g \<cdot> h)) $ n = (f \<cdot> g \<cdot> h) $ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_smult_Cons:
shows "vec_smult \<alpha> (a # as) = (\<alpha> * a) # vec_smult \<alpha> as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_smult \<alpha> (a # as) = \<alpha> * a # vec_smult \<alpha> as
[PROOF STEP]
by (simp add: vec_smult_def)


[STATEMENT]
lemma box_vec_eq_empty [simp]:
  shows "cbox (vec a) (vec b) = {} \<longleftrightarrow> cbox a b = {}"
        "box (vec a) (vec b) = {} \<longleftrightarrow> box a b = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cbox (vec a) (vec b) = {}) = (cbox a b = {}) &&& (box (vec a) (vec b) = {}) = (box a b = {})
[PROOF STEP]
by (auto simp: Basis_vec_def mem_box box_eq_empty inner_axis)


[STATEMENT]
lemma mat_rel_eq: "((R ===> R ===> (=))) (=) (=) \<Longrightarrow>
  ((mat_rel R ===> mat_rel R ===> (=))) (=) (=)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (R ===> R ===> (=)) (=) (=) \<Longrightarrow> (mat_rel R ===> mat_rel R ===> (=)) (=) (=)
[PROOF STEP]
unfolding mat_rel_def rel_fun_def mat_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. R x y \<longrightarrow> (\<forall>xa ya. R xa ya \<longrightarrow> (x = xa) = (y = ya)) \<Longrightarrow> \<forall>x y. dim_row x = dim_row y \<and> dim_col x = dim_col y \<and> (\<forall>i j. i < dim_row y \<longrightarrow> j < dim_col y \<longrightarrow> R (x $$ (i, j)) (y $$ (i, j))) \<longrightarrow> (\<forall>xa ya. dim_row xa = dim_row ya \<and> dim_col xa = dim_col ya \<and> (\<forall>i j. i < dim_row ya \<longrightarrow> j < dim_col ya \<longrightarrow> R (xa $$ (i, j)) (ya $$ (i, j))) \<longrightarrow> (dim_row x = dim_row xa \<and> dim_col x = dim_col xa \<and> (\<forall>i j. i < dim_row xa \<longrightarrow> j < dim_col xa \<longrightarrow> x $$ (i, j) = xa $$ (i, j))) = (dim_row y = dim_row ya \<and> dim_col y = dim_col ya \<and> (\<forall>i j. i < dim_row ya \<longrightarrow> j < dim_col ya \<longrightarrow> y $$ (i, j) = ya $$ (i, j))))
[PROOF STEP]
by (auto, blast+)


[STATEMENT]
lemma eval_dioph_mod:
  "eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n
[PROOF STEP]
proof (induct ks xs rule: eval_dioph.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>k ks x xs. eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n \<Longrightarrow> eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n
 2. \<And>xs. eval_dioph [] xs mod int n = eval_dioph [] (map (\<lambda>x. x mod n) xs) mod int n
 3. \<And>ks. eval_dioph ks [] mod int n = eval_dioph ks (map (\<lambda>x. x mod n) []) mod int n
[PROOF STEP]
case (1 k ks x xs)
[PROOF STATE]
proof (state)
this:
eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n

goal (3 subgoals):
 1. \<And>k ks x xs. eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n \<Longrightarrow> eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n
 2. \<And>xs. eval_dioph [] xs mod int n = eval_dioph [] (map (\<lambda>x. x mod n) xs) mod int n
 3. \<And>ks. eval_dioph ks [] mod int n = eval_dioph ks (map (\<lambda>x. x mod n) []) mod int n
[PROOF STEP]
have "eval_dioph (k # ks) (x # xs) mod int n =
    ((k * int x) mod int n + eval_dioph ks xs mod int n) mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_dioph (k # ks) (x # xs) mod int n = (k * int x mod int n + eval_dioph ks xs mod int n) mod int n
[PROOF STEP]
by (simp add: mod_add_eq)
[PROOF STATE]
proof (state)
this:
eval_dioph (k # ks) (x # xs) mod int n = (k * int x mod int n + eval_dioph ks xs mod int n) mod int n

goal (3 subgoals):
 1. \<And>k ks x xs. eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n \<Longrightarrow> eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n
 2. \<And>xs. eval_dioph [] xs mod int n = eval_dioph [] (map (\<lambda>x. x mod n) xs) mod int n
 3. \<And>ks. eval_dioph ks [] mod int n = eval_dioph ks (map (\<lambda>x. x mod n) []) mod int n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_dioph (k # ks) (x # xs) mod int n = (k * int x mod int n + eval_dioph ks xs mod int n) mod int n

goal (3 subgoals):
 1. \<And>k ks x xs. eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n \<Longrightarrow> eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n
 2. \<And>xs. eval_dioph [] xs mod int n = eval_dioph [] (map (\<lambda>x. x mod n) xs) mod int n
 3. \<And>ks. eval_dioph ks [] mod int n = eval_dioph ks (map (\<lambda>x. x mod n) []) mod int n
[PROOF STEP]
have "\<dots> = ((k * (int x mod int n)) mod int n +
    eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n) mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k * int x mod int n + eval_dioph ks xs mod int n) mod int n = (k * (int x mod int n) mod int n + eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n) mod int n
[PROOF STEP]
by (simp add: 1 mod_mult_right_eq)
[PROOF STATE]
proof (state)
this:
(k * int x mod int n + eval_dioph ks xs mod int n) mod int n = (k * (int x mod int n) mod int n + eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n) mod int n

goal (3 subgoals):
 1. \<And>k ks x xs. eval_dioph ks xs mod int n = eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n \<Longrightarrow> eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n
 2. \<And>xs. eval_dioph [] xs mod int n = eval_dioph [] (map (\<lambda>x. x mod n) xs) mod int n
 3. \<And>ks. eval_dioph ks [] mod int n = eval_dioph ks (map (\<lambda>x. x mod n) []) mod int n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
eval_dioph (k # ks) (x # xs) mod int n = (k * (int x mod int n) mod int n + eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n) mod int n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
eval_dioph (k # ks) (x # xs) mod int n = (k * (int x mod int n) mod int n + eval_dioph ks (map (\<lambda>x. x mod n) xs) mod int n) mod int n

goal (1 subgoal):
 1. eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n
[PROOF STEP]
by (simp add: zmod_int mod_add_eq)
[PROOF STATE]
proof (state)
this:
eval_dioph (k # ks) (x # xs) mod int n = eval_dioph (k # ks) (map (\<lambda>x. x mod n) (x # xs)) mod int n

goal (2 subgoals):
 1. \<And>xs. eval_dioph [] xs mod int n = eval_dioph [] (map (\<lambda>x. x mod n) xs) mod int n
 2. \<And>ks. eval_dioph ks [] mod int n = eval_dioph ks (map (\<lambda>x. x mod n) []) mod int n
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma sigma_set_inter_init:
  assumes "\<And>i. i\<le>(n::nat) \<Longrightarrow> A i \<in> sigma_sets sp B"
and "B \<subseteq> Pow sp"
shows "(\<Inter> i\<in> {m. m\<le> n}. A i) \<in> sigma_sets sp B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (A ` {m. m \<le> n}) \<in> sigma_sets sp B
[PROOF STEP]
by (metis (full_types) assms(1) assms(2) bot.extremum empty_iff mem_Collect_eq sigma_sets_INTER)


[STATEMENT]
lemma sum_prod_le_prod_sum:
  fixes a :: "'a \<Rightarrow> 'b::linordered_idom"
  assumes "\<And>i. i \<in> I \<Longrightarrow> a i \<ge> 0 \<and> b i \<ge> 0"
  shows "(\<Sum>i\<in>I. \<Sum>j\<in>I. a i * b j) \<le> (\<Sum>i\<in>I. a i) * (\<Sum>i\<in>I. b i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. \<Sum>j\<in>I. a i * b j) \<le> sum a I * sum b I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> (0::'b) \<le> a ?i \<and> (0::'b) \<le> b ?i

goal (1 subgoal):
 1. (\<Sum>i\<in>I. \<Sum>j\<in>I. a i * b j) \<le> sum a I * sum b I
[PROOF STEP]
by (induction I rule: infinite_finite_induct) (auto simp add: algebra_simps sum.distrib sum_distrib_left)


[STATEMENT]
lemma mset_merge_lists [simp]: "mset (merge_lists xs ys) = mset xs + mset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (merge_lists xs ys) = mset xs + mset ys
[PROOF STEP]
by (induction xs ys rule: merge_lists.induct) auto


[STATEMENT]
lemma infinite_greaterThan: "infinite {(n::nat)<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {n<..}
[PROOF STEP]
by (simp add: atLeast_Suc_greaterThan[symmetric] infinite_atLeast)


[STATEMENT]
lemma Inf_inf_dual:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "Inf_dual f \<Longrightarrow> inf_dual f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_dual f \<Longrightarrow> inf_dual f
[PROOF STEP]
by (smt comp_eq_elim image_empty image_insert inf_Inf sup_Sup)


[STATEMENT]
lemma xor_Suc_0_eq:
  \<open>n XOR Suc 0 = n + of_bool (even n) - of_bool (odd n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n XOR Suc 0 = n + of_bool (even n) - of_bool (odd n)
[PROOF STEP]
using xor_one_eq [of n]
[PROOF STATE]
proof (prove)
using this:
n XOR 1 = n + of_bool (even n) - of_bool (odd n)

goal (1 subgoal):
 1. n XOR Suc 0 = n + of_bool (even n) - of_bool (odd n)
[PROOF STEP]
by simp


[STATEMENT]
lemma not_iSince: "
  (\<not> (P t1. t1 \<S> t2 I. Q t2)) =
  (\<box> t I. (Q t \<longrightarrow> (\<diamond> t' (I \<down>> t). \<not> P t')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (P t1. t1 \<S> t2 I. Q t2)) = (\<box> t I. Q t \<longrightarrow> (\<diamond> t' I \<down>> t. \<not> P t'))
[PROOF STEP]
unfolding iTL_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (\<exists>t\<in>I. Q t \<and> Ball (I \<down>> t) P)) = (\<forall>t\<in>I. Q t \<longrightarrow> (\<exists>t\<in>I \<down>> t. \<not> P t))
[PROOF STEP]
by blast


[STATEMENT]
lemma p_not_div_choose:
  assumes "k < K" and "k \<le> n"
      and eeq: "\<And>j. \<lbrakk>0<j; j<K\<rbrakk> \<Longrightarrow> multiplicity p (n - k + (K - j)) = multiplicity p (K - j)" "prime p"
    shows "multiplicity p (n choose k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (n choose k) = 0
[PROOF STEP]
apply (rule p_not_div_choose_lemma [of K p "n-k" k, simplified assms nat_minus_add_max max_absorb1])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. Suc i < K \<Longrightarrow> multiplicity p (Suc i) = multiplicity p (Suc (n - k + i))
 2. True
 3. True
[PROOF STEP]
apply (metis add_Suc_right eeq diff_diff_cancel order_less_imp_le zero_less_Suc zero_less_diff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. True
 2. True
[PROOF STEP]
apply (rule TrueI)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ln_approx_abs'':
  fixes x :: real and n :: nat
  defines "y \<equiv> (x-1)/(x+1)"
  defines "approx \<equiv> (\<Sum>k<n. 2*y^(2*k+1) / of_nat (2*k+1))"
  defines "d \<equiv> y^(2*n+1) / (1 - y^2) / of_nat (2*n+1)"
  assumes x: "x > 1"
  assumes A: "ln_approx_aux1 x' e n x"
  shows   "\<bar>ln x - x'\<bar> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>ln x - x'\<bar> \<le> e
[PROOF STEP]
proof (rule approx_coarsen[OF ln_approx_abs[OF x, of n]], goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
ln_approx_aux1 x' e n x
[PROOF STEP]
have "\<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d"
[PROOF STATE]
proof (prove)
using this:
ln_approx_aux1 x' e n x

goal (1 subgoal):
 1. \<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d
[PROOF STEP]
by (simp only: ln_approx_aux3_def ln_approx_aux2_def ln_approx_aux1_def
                   y_def [symmetric] d_def [symmetric])
[PROOF STATE]
proof (state)
this:
\<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) + d - x'\<bar> \<le> e - d

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
have "2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) =
               (\<Sum>k<n. 2 * y^(2*k+1) / (real (2 * k + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) = (\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1))
[PROOF STEP]
by (subst sum_distrib_left, simp, subst power_mult)
       (simp_all add: field_split_simps mult_ac power_mult)
[PROOF STATE]
proof (state)
this:
2 * y * (\<Sum>k<n. inverse (real (2 * k + 1)) * y\<^sup>2 ^ k) = (\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1))

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>(\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1)) + d - x'\<bar> \<le> e - d
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>(\<Sum>k<n. 2 * y ^ (2 * k + 1) / real (2 * k + 1)) + d - x'\<bar> \<le> e - d

goal (1 subgoal):
 1. \<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)
[PROOF STEP]
by (simp only: d_def y_def approx_def)
[PROOF STATE]
proof (state)
this:
\<bar>(\<Sum>k<n. 2 * ((x - 1) / (x + 1)) ^ (2 * k + 1) / real (2 * k + 1)) + ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1) - x'\<bar> \<le> e - ((x - 1) / (x + 1)) ^ (2 * n + 1) / (1 - ((x - 1) / (x + 1))\<^sup>2) / real (2 * n + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cbox_right_un:
  fixes x\<^sub>0 :: real and y\<^sub>0 :: real
  assumes "x\<^sub>0 \<le> x\<^sub>1" "x\<^sub>1 \<le> x\<^sub>2"
  shows "cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>1, y\<^sub>1) \<union> cbox (x\<^sub>1, y\<^sub>0) (x\<^sub>2, y\<^sub>1) = cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>2, y\<^sub>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>1, y\<^sub>1) \<union> cbox (x\<^sub>1, y\<^sub>0) (x\<^sub>2, y\<^sub>1) = cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>2, y\<^sub>1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x\<^sub>0 \<le> x\<^sub>1
x\<^sub>1 \<le> x\<^sub>2

goal (1 subgoal):
 1. cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>1, y\<^sub>1) \<union> cbox (x\<^sub>1, y\<^sub>0) (x\<^sub>2, y\<^sub>1) = cbox (x\<^sub>0, y\<^sub>0) (x\<^sub>2, y\<^sub>1)
[PROOF STEP]
by auto


[STATEMENT]
lemma PUZ012_1:
  "(\<forall>X. equal_fruits(X::'a,X)) &
  (\<forall>X. equal_boxes(X::'a,X)) &
  (\<forall>X Y. ~(label(X::'a,Y) & contains(X::'a,Y))) &
  (\<forall>X. contains(boxa::'a,X) | contains(boxb::'a,X) | contains(boxc::'a,X)) &
  (\<forall>X. contains(X::'a,apples) | contains(X::'a,bananas) | contains(X::'a,oranges)) &
  (\<forall>X Y Z. contains(X::'a,Y) & contains(X::'a,Z) --> equal_fruits(Y::'a,Z)) &
  (\<forall>Y X Z. contains(X::'a,Y) & contains(Z::'a,Y) --> equal_boxes(X::'a,Z)) &
  (~equal_boxes(boxa::'a,boxb)) &
  (~equal_boxes(boxb::'a,boxc)) &
  (~equal_boxes(boxa::'a,boxc)) &
  (~equal_fruits(apples::'a,bananas)) &
  (~equal_fruits(bananas::'a,oranges)) &
  (~equal_fruits(apples::'a,oranges)) &
  (label(boxa::'a,apples)) &
  (label(boxb::'a,oranges)) &
  (label(boxc::'a,bananas)) &
  (contains(boxb::'a,apples)) &
  (~(contains(boxa::'a,bananas) & contains(boxc::'a,oranges))) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>X. equal_fruits (X, X)) \<and> (\<forall>X. equal_boxes (X, X)) \<and> (\<forall>X Y. \<not> (label (X, Y) \<and> contains (X, Y))) \<and> (\<forall>X. contains (boxa, X) \<or> contains (boxb, X) \<or> contains (boxc, X)) \<and> (\<forall>X. contains (X, apples) \<or> contains (X, bananas) \<or> contains (X, oranges)) \<and> (\<forall>X Y Z. contains (X, Y) \<and> contains (X, Z) \<longrightarrow> equal_fruits (Y, Z)) \<and> (\<forall>Y X Z. contains (X, Y) \<and> contains (Z, Y) \<longrightarrow> equal_boxes (X, Z)) \<and> \<not> equal_boxes (boxa, boxb) \<and> \<not> equal_boxes (boxb, boxc) \<and> \<not> equal_boxes (boxa, boxc) \<and> \<not> equal_fruits (apples, bananas) \<and> \<not> equal_fruits (bananas, oranges) \<and> \<not> equal_fruits (apples, oranges) \<and> label (boxa, apples) \<and> label (boxb, oranges) \<and> label (boxc, bananas) \<and> contains (boxb, apples) \<and> \<not> (contains (boxa, bananas) \<and> contains (boxc, oranges)) \<longrightarrow> False
[PROOF STEP]
by meson