[STATEMENT]
lemma cindex_poly_congr:
  fixes p q:: "real poly"
  assumes "a<a'" "a'<b'" "b'<b"
  assumes "\<forall>x. ((a<x\<and>x\<le>a') \<or> (b'\<le>x \<and> x<b)) \<longrightarrow> poly p x \<noteq>0"
  shows "cindex_poly a b q p=cindex_poly a' b' q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
proof (cases "p=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
 2. p \<noteq> 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
 2. p \<noteq> 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_poly a b q p = cindex_poly a' b' q p

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_poly a b q p = cindex_poly a' b' q p
[PROOF STEP]
unfolding cindex_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | poly p x = 0 \<and> a < x \<and> x < b. jump_poly q p x) = (\<Sum>x | poly p x = 0 \<and> a' < x \<and> x < b'. jump_poly q p x)
[PROOF STEP]
apply (rule sum.mono_neutral_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {x. poly p x = 0 \<and> a < x \<and> x < b}
 2. {x. poly p x = 0 \<and> a' < x \<and> x < b'} \<subseteq> {x. poly p x = 0 \<and> a < x \<and> x < b}
 3. \<forall>i\<in>{x. poly p x = 0 \<and> a < x \<and> x < b} - {x. poly p x = 0 \<and> a' < x \<and> x < b'}. jump_poly q p i = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. poly p x = 0 \<and> a < x \<and> x < b}
[PROOF STEP]
using poly_roots_finite[OF \<open>p\<noteq>0\<close>]
[PROOF STATE]
proof (prove)
using this:
finite {x. poly p x = 0}

goal (1 subgoal):
 1. finite {x. poly p x = 0 \<and> a < x \<and> x < b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. poly p x = 0 \<and> a' < x \<and> x < b'} \<subseteq> {x. poly p x = 0 \<and> a < x \<and> x < b}
 2. \<forall>i\<in>{x. poly p x = 0 \<and> a < x \<and> x < b} - {x. poly p x = 0 \<and> a' < x \<and> x < b'}. jump_poly q p i = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. poly p x = 0 \<and> a' < x \<and> x < b'} \<subseteq> {x. poly p x = 0 \<and> a < x \<and> x < b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < a'
a' < b'
b' < b
\<forall>x. a < x \<and> x \<le> a' \<or> b' \<le> x \<and> x < b \<longrightarrow> poly p x \<noteq> 0

goal (1 subgoal):
 1. {x. poly p x = 0 \<and> a' < x \<and> x < b'} \<subseteq> {x. poly p x = 0 \<and> a < x \<and> x < b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{x. poly p x = 0 \<and> a < x \<and> x < b} - {x. poly p x = 0 \<and> a' < x \<and> x < b'}. jump_poly q p i = 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{x. poly p x = 0 \<and> a < x \<and> x < b} - {x. poly p x = 0 \<and> a' < x \<and> x < b'}. jump_poly q p i = 0
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
\<forall>x. a < x \<and> x \<le> a' \<or> b' \<le> x \<and> x < b \<longrightarrow> poly p x \<noteq> 0

goal (1 subgoal):
 1. \<forall>i\<in>{x. poly p x = 0 \<and> a < x \<and> x < b} - {x. poly p x = 0 \<and> a' < x \<and> x < b'}. jump_poly q p i = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cindex_poly a b q p = cindex_poly a' b' q p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scc_of_unique:
  assumes "w \<in> scc_of E v"
  shows "scc_of E v = scc_of E w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
have "is_scc E (scc_of E v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_scc E (scc_of E v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_scc E (scc_of E v)

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_scc E (scc_of E v)

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
note assms
[PROOF STATE]
proof (state)
this:
w \<in> scc_of E v

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
w \<in> scc_of E v

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
have "is_scc E (scc_of E w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_scc E (scc_of E w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_scc E (scc_of E w)

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_scc E (scc_of E w)

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
have "w \<in> scc_of E w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> scc_of E w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w \<in> scc_of E w

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
is_scc E (scc_of E v)
w \<in> scc_of E v
is_scc E (scc_of E w)
w \<in> scc_of E w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_scc E (scc_of E v)
w \<in> scc_of E v
is_scc E (scc_of E w)
w \<in> scc_of E w

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
using is_scc_unique
[PROOF STATE]
proof (prove)
using this:
is_scc E (scc_of E v)
w \<in> scc_of E v
is_scc E (scc_of E w)
w \<in> scc_of E w
\<lbrakk>is_scc ?E ?scc; is_scc ?E ?scc'; ?v \<in> ?scc; ?v \<in> ?scc'\<rbrakk> \<Longrightarrow> ?scc = ?scc'

goal (1 subgoal):
 1. scc_of E v = scc_of E w
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
scc_of E v = scc_of E w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_language_bij: "bij (Collect o in_language)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (Collect \<circ> in_language)
[PROOF STEP]
proof (rule bijI', unfold o_apply, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. Collect (in_language x) = Collect (in_language y) \<Longrightarrow> x = y
 2. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
fix L R :: "'a language"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. Collect (in_language x) = Collect (in_language y) \<Longrightarrow> x = y
 2. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
assume "Collect (in_language L) = Collect (in_language R)"
[PROOF STATE]
proof (state)
this:
Collect (in_language L) = Collect (in_language R)

goal (2 subgoals):
 1. \<And>x y. Collect (in_language x) = Collect (in_language y) \<Longrightarrow> x = y
 2. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Collect (in_language L) = Collect (in_language R)
[PROOF STEP]
show "L = R"
[PROOF STATE]
proof (prove)
using this:
Collect (in_language L) = Collect (in_language R)

goal (1 subgoal):
 1. L = R
[PROOF STEP]
unfolding set_eq_iff mem_Collect_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>x. in_language L x = in_language R x

goal (1 subgoal):
 1. L = R
[PROOF STEP]
by (coinduction arbitrary: L R) (metis in_language.simps)
[PROOF STATE]
proof (state)
this:
L = R

goal (1 subgoal):
 1. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
fix L :: "'a list set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
have "L = Collect (in_language (to_language L))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L = Collect (in_language (to_language L))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
L = Collect (in_language (to_language L))

goal (1 subgoal):
 1. \<And>y. \<exists>x. y = Collect (in_language x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L = Collect (in_language (to_language L))
[PROOF STEP]
show "\<exists>K. L = Collect (in_language K)"
[PROOF STATE]
proof (prove)
using this:
L = Collect (in_language (to_language L))

goal (1 subgoal):
 1. \<exists>K. L = Collect (in_language K)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>K. L = Collect (in_language K)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_fold:
  assumes "\<And>x ys. set (f (g x) ys) = set (g x) \<union> set ys"
  shows "set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys
[PROOF STEP]
proof (induct xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. set (fold (\<lambda>x. f (g x)) [] ys) = (\<Union>x\<in>set []. set (g x)) \<union> set ys
 2. \<And>a xs ys. (\<And>ys. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys) \<Longrightarrow> set (fold (\<lambda>x. f (g x)) (a # xs) ys) = (\<Union>x\<in>set (a # xs). set (g x)) \<union> set ys
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>ys. set (fold (\<lambda>x. f (g x)) [] ys) = (\<Union>x\<in>set []. set (g x)) \<union> set ys
 2. \<And>a xs ys. (\<And>ys. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys) \<Longrightarrow> set (fold (\<lambda>x. f (g x)) (a # xs) ys) = (\<Union>x\<in>set (a # xs). set (g x)) \<union> set ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fold (\<lambda>x. f (g x)) [] ys) = (\<Union>x\<in>set []. set (g x)) \<union> set ys
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (fold (\<lambda>x. f (g x)) [] ys) = (\<Union>x\<in>set []. set (g x)) \<union> set ys

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys) \<Longrightarrow> set (fold (\<lambda>x. f (g x)) (a # xs) ys) = (\<Union>x\<in>set (a # xs). set (g x)) \<union> set ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys) \<Longrightarrow> set (fold (\<lambda>x. f (g x)) (a # xs) ys) = (\<Union>x\<in>set (a # xs). set (g x)) \<union> set ys
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
set (fold (\<lambda>x. f (g x)) xs ?ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ?ys

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys) \<Longrightarrow> set (fold (\<lambda>x. f (g x)) (a # xs) ys) = (\<Union>x\<in>set (a # xs). set (g x)) \<union> set ys
[PROOF STEP]
have eq: "set (fold (\<lambda>x. f (g x)) xs (f (g x) ys)) = (\<Union>x\<in>set xs. set (g x)) \<union> set (f (g x) ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fold (\<lambda>x. f (g x)) xs (f (g x) ys)) = (\<Union>x\<in>set xs. set (g x)) \<union> set (f (g x) ys)
[PROOF STEP]
by (rule Cons)
[PROOF STATE]
proof (state)
this:
set (fold (\<lambda>x. f (g x)) xs (f (g x) ys)) = (\<Union>x\<in>set xs. set (g x)) \<union> set (f (g x) ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. set (fold (\<lambda>x. f (g x)) xs ys) = (\<Union>x\<in>set xs. set (g x)) \<union> set ys) \<Longrightarrow> set (fold (\<lambda>x. f (g x)) (a # xs) ys) = (\<Union>x\<in>set (a # xs). set (g x)) \<union> set ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (fold (\<lambda>x. f (g x)) (x # xs) ys) = (\<Union>x\<in>set (x # xs). set (g x)) \<union> set ys
[PROOF STEP]
by (simp add: o_def assms set_merge_wrt eq ac_simps)
[PROOF STATE]
proof (state)
this:
set (fold (\<lambda>x. f (g x)) (x # xs) ys) = (\<Union>x\<in>set (x # xs). set (g x)) \<union> set ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vtimes_vsubset_VPowVPow: "A \<times>\<^sub>\<circ> B \<subseteq>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times>\<^sub>\<circ> B \<subseteq>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
proof(intro vsubsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
assume "x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B"
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B
[PROOF STEP]
obtain a b where x_def: "x = \<langle>a, b\<rangle>" and "a \<in>\<^sub>\<circ> A" and "b \<in>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

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

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> A \<times>\<^sub>\<circ> B \<Longrightarrow> x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = \<langle>a, b\<rangle>
a \<in>\<^sub>\<circ> A
b \<in>\<^sub>\<circ> B
[PROOF STEP]
show "x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))"
[PROOF STATE]
proof (prove)
using this:
x = \<langle>a, b\<rangle>
a \<in>\<^sub>\<circ> A
b \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
unfolding x_def vpair_def
[PROOF STATE]
proof (prove)
using this:
set {set {a}, set {a, b}} = set {set {a}, set {a, b}}
a \<in>\<^sub>\<circ> A
b \<in>\<^sub>\<circ> B

goal (1 subgoal):
 1. set {set {a}, set {a, b}} \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in>\<^sub>\<circ> VPow (VPow (A \<union>\<^sub>\<circ> B))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_meas_self:
  assumes "pos_meas_set E"
  shows "0 \<le> \<mu> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<mu> E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pos_meas_set E

goal (1 subgoal):
 1. 0 \<le> \<mu> E
[PROOF STEP]
unfolding pos_meas_set_def
[PROOF STATE]
proof (prove)
using this:
E \<in> sets M \<and> (\<forall>A\<in>sets M. A \<subseteq> E \<longrightarrow> 0 \<le> \<mu> A)

goal (1 subgoal):
 1. 0 \<le> \<mu> E
[PROOF STEP]
by simp


[STATEMENT]
theorem sup_ty_opt_trans [trans]:
  "\<lbrakk>G \<turnstile> a <=o b; G \<turnstile> b <=o c\<rbrakk> \<Longrightarrow> G \<turnstile> a <=o c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<turnstile> a <=o b; G \<turnstile> b <=o c\<rbrakk> \<Longrightarrow> G \<turnstile> a <=o c
[PROOF STEP]
by (auto intro: widen_trans
           simp add: sup_ty_opt_def Err.le_def lesub_def subtype_def
           split: err.splits)


[STATEMENT]
lemma mult_matrix_zero_left[simp]: "\<lbrakk>fadd 0 0 = 0; \<forall>a. fmul 0 a = 0\<rbrakk> \<Longrightarrow> mult_matrix fmul fadd 0 A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul (0::'c) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix fmul fadd 0 A = 0
[PROOF STEP]
by (simp add: mult_matrix_def)


[STATEMENT]
lemma deriv_add_id_const [simp]:
  "deriv (\<lambda>x. x + a) = (\<lambda>z. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. x + a) = (\<lambda>z. 1::'a)
[PROOF STEP]
using ext trans[OF deriv_add]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. ?f x = ?g x) \<Longrightarrow> ?f = ?g
\<lbrakk>?f1 field_differentiable at ?z1; ?g1 field_differentiable at ?z1; deriv ?f1 ?z1 + deriv ?g1 ?z1 = ?t\<rbrakk> \<Longrightarrow> deriv (\<lambda>w. ?f1 w + ?g1 w) ?z1 = ?t

goal (1 subgoal):
 1. deriv (\<lambda>x. x + a) = (\<lambda>z. 1::'a)
[PROOF STEP]
by force


[STATEMENT]
lemma (in idom) irreducible_uminus[simp]: "irreducible (-x) \<longleftrightarrow> irreducible x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible (- x) = irreducible x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. irreducible (- x) = irreducible x
[PROOF STEP]
have "-x = -1 * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x = - (1::'a) * x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- x = - (1::'a) * x

goal (1 subgoal):
 1. irreducible (- x) = irreducible x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- x = - (1::'a) * x

goal (1 subgoal):
 1. irreducible (- x) = irreducible x
[PROOF STEP]
have "irreducible ... \<longleftrightarrow> irreducible x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible (- (1::'a) * x) = irreducible x
[PROOF STEP]
by (rule irreducible_mult_unit_left, auto)
[PROOF STATE]
proof (state)
this:
irreducible (- (1::'a) * x) = irreducible x

goal (1 subgoal):
 1. irreducible (- x) = irreducible x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
irreducible (- x) = irreducible x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
irreducible (- x) = irreducible x

goal (1 subgoal):
 1. irreducible (- x) = irreducible x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
irreducible (- x) = irreducible x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multisetUnionLeMono:
assumes
  "trans r"
  "multiset_le a1 a2 r"
  "multiset_le b1 b2 r"
shows
  "multiset_le (a1 + b1) (a2 + b2) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiset_le (a1 + b1) (a2 + b2) r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
trans r
multiset_le a1 a2 r
multiset_le b1 b2 r

goal (1 subgoal):
 1. multiset_le (a1 + b1) (a2 + b2) r
[PROOF STEP]
using multisetUnionLeMono1[of "r" "a1" "a2" "b1"]
[PROOF STATE]
proof (prove)
using this:
trans r
multiset_le a1 a2 r
multiset_le b1 b2 r
\<lbrakk>trans r; multiset_le a1 a2 r\<rbrakk> \<Longrightarrow> multiset_le (a1 + b1) (a2 + b1) r

goal (1 subgoal):
 1. multiset_le (a1 + b1) (a2 + b2) r
[PROOF STEP]
using multisetUnionLeMono2[of "r" "b1" "b2" "a2"]
[PROOF STATE]
proof (prove)
using this:
trans r
multiset_le a1 a2 r
multiset_le b1 b2 r
\<lbrakk>trans r; multiset_le a1 a2 r\<rbrakk> \<Longrightarrow> multiset_le (a1 + b1) (a2 + b1) r
\<lbrakk>trans r; multiset_le b1 b2 r\<rbrakk> \<Longrightarrow> multiset_le (a2 + b1) (a2 + b2) r

goal (1 subgoal):
 1. multiset_le (a1 + b1) (a2 + b2) r
[PROOF STEP]
using multisetLeTrans[of "r" "a1 + b1" "a2 + b1" "a2 + b2"]
[PROOF STATE]
proof (prove)
using this:
trans r
multiset_le a1 a2 r
multiset_le b1 b2 r
\<lbrakk>trans r; multiset_le a1 a2 r\<rbrakk> \<Longrightarrow> multiset_le (a1 + b1) (a2 + b1) r
\<lbrakk>trans r; multiset_le b1 b2 r\<rbrakk> \<Longrightarrow> multiset_le (a2 + b1) (a2 + b2) r
\<lbrakk>trans r; multiset_le (a1 + b1) (a2 + b1) r; multiset_le (a2 + b1) (a2 + b2) r\<rbrakk> \<Longrightarrow> multiset_le (a1 + b1) (a2 + b2) r

goal (1 subgoal):
 1. multiset_le (a1 + b1) (a2 + b2) r
[PROOF STEP]
by simp


[STATEMENT]
lemma fv_fo_fmla_list_forall: "fv_fo_fmla_list (Forall n \<phi>) = filter ((\<noteq>) n) (fv_fo_fmla_list \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv_fo_fmla_list (Forall n \<phi>) = filter ((\<noteq>) n) (fv_fo_fmla_list \<phi>)
[PROOF STEP]
by (auto simp: fv_fo_fmla_list_def)
     (metis (mono_tags, lifting) distinct_filter distinct_remdups_adj_sort
      distinct_remdups_id filter_set filter_sort remdups_adj_set sorted_list_of_set_sort_remdups
      sorted_remdups_adj sorted_sort sorted_sort_id)


[STATEMENT]
lemma symmetric_cong:
  "(\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> r a b \<longleftrightarrow> r' a b) \<Longrightarrow> symmetric A r \<longleftrightarrow> symmetric A r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> A; b \<in> A\<rbrakk> \<Longrightarrow> r a b = r' a b) \<Longrightarrow> symmetric A r = symmetric A r'
[PROOF STEP]
by (auto simp: symmetric_def)


[STATEMENT]
theorem finite_char: \<open>finite_char (mk_finite_char C)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_char (mk_finite_char C)
[PROOF STEP]
unfolding finite_char_def mk_finite_char_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S. (S \<in> {S. \<forall>S'\<subseteq>S. finite S' \<longrightarrow> S' \<in> C}) = (\<forall>S'. finite S' \<longrightarrow> S' \<subseteq> S \<longrightarrow> S' \<in> {S. \<forall>S'\<subseteq>S. finite S' \<longrightarrow> S' \<in> C})
[PROOF STEP]
by blast


[STATEMENT]
lemma unit_vec_nonzero[simp]:
  assumes i_n: "i < n" shows "unit_vec n i \<noteq> zero_vec n" (is "?l \<noteq> ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_vec n i \<noteq> 0\<^sub>v n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unit_vec n i \<noteq> 0\<^sub>v n
[PROOF STEP]
have "?l $ i = 1" "?r $ i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_vec n i $ i = (1::'a) &&& 0\<^sub>v n $ i = (0::'a)
[PROOF STEP]
using i_n
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. unit_vec n i $ i = (1::'a) &&& 0\<^sub>v n $ i = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unit_vec n i $ i = (1::'a)
0\<^sub>v n $ i = (0::'a)

goal (1 subgoal):
 1. unit_vec n i \<noteq> 0\<^sub>v n
[PROOF STEP]
thus "?l \<noteq> ?r"
[PROOF STATE]
proof (prove)
using this:
unit_vec n i $ i = (1::'a)
0\<^sub>v n $ i = (0::'a)

goal (1 subgoal):
 1. unit_vec n i \<noteq> 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unit_vec n i \<noteq> 0\<^sub>v n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma M_neg_imp_z_non_zero:
  assumes "v \<bullet> (M *v v) < 0"
  shows "v$3 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v $ 3 \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v $ 3 \<noteq> 0
[PROOF STEP]
have "(v$1)\<^sup>2 + (v$2)\<^sup>2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2

goal (1 subgoal):
 1. v $ 3 \<noteq> 0
[PROOF STEP]
with M_neg_imp_z_squared_big [of v] and \<open>v \<bullet> (M *v v) < 0\<close>
[PROOF STATE]
proof (chain)
picking this:
v \<bullet> (M *v v) < 0 \<Longrightarrow> (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2 < (v $ 3)\<^sup>2
v \<bullet> (M *v v) < 0
0 \<le> (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2
[PROOF STEP]
have "(v$3)\<^sup>2 > 0"
[PROOF STATE]
proof (prove)
using this:
v \<bullet> (M *v v) < 0 \<Longrightarrow> (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2 < (v $ 3)\<^sup>2
v \<bullet> (M *v v) < 0
0 \<le> (v $ 1)\<^sup>2 + (v $ 2)\<^sup>2

goal (1 subgoal):
 1. 0 < (v $ 3)\<^sup>2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 < (v $ 3)\<^sup>2

goal (1 subgoal):
 1. v $ 3 \<noteq> 0
[PROOF STEP]
thus "v$3 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < (v $ 3)\<^sup>2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lex_ord_EqI:
  "(\<And>k. k \<in> fst ` set (fst (list_of_oalistx xs)) \<union> fst ` set (fst (list_of_oalisty ys)) \<Longrightarrow>
     f k (lookup xs k) (oay.lookup ys k) = Some Eq) \<Longrightarrow>
  lex_ord ko f xs ys = Some Eq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. k \<in> fst ` set (fst (list_of_oalistx xs)) \<union> fst ` set (fst (list_of_oalisty ys)) \<Longrightarrow> f k (lookup xs k) (oay.lookup ys k) = Some Eq) \<Longrightarrow> lex_ord ko f xs ys = Some Eq
[PROOF STEP]
by (simp add: lex_ord_def lookup_def oay.lookup_def, rule lex_ord_raw_EqI,
      rule oalist_inv_list_of_oalist, rule oay.oalist_inv_list_of_oalist, blast)


[STATEMENT]
lemma fresh_floatarith_subst:
  fixes v::float
  assumes "fresh_floatarith e x"
  assumes "x < length vs"
  shows "interpret_floatarith e (vs[x:=v]) = interpret_floatarith e vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpret_floatarith e (map real_of_float (vs[x := v])) = interpret_floatarith e (map real_of_float vs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fresh_floatarith e x
x < length vs

goal (1 subgoal):
 1. interpret_floatarith e (map real_of_float (vs[x := v])) = interpret_floatarith e (map real_of_float vs)
[PROOF STEP]
by (induction e) (auto simp: map_update)


[STATEMENT]
lemma fref_ncD: "(f,g)\<in>R\<rightarrow>\<^sub>fS \<Longrightarrow> (f,g)\<in>R\<rightarrow>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f, g) \<in> R \<rightarrow>\<^sub>f S \<Longrightarrow> (f, g) \<in> R \<rightarrow> S
[PROOF STEP]
apply (rule fun_relI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a a'. \<lbrakk>(f, g) \<in> R \<rightarrow>\<^sub>f S; (a, a') \<in> R\<rbrakk> \<Longrightarrow> (f a, g a') \<in> S
[PROOF STEP]
apply (drule frefD)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a a'. (a, a') \<in> R \<Longrightarrow> True
 2. \<And>a a'. (a, a') \<in> R \<Longrightarrow> (?x2 a a', ?y2 a a') \<in> R
 3. \<And>a a'. \<lbrakk>(a, a') \<in> R; (f (?x2 a a'), g (?y2 a a')) \<in> S\<rbrakk> \<Longrightarrow> (f a, g a') \<in> S
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a a'. (a, a') \<in> R \<Longrightarrow> (?x2 a a', ?y2 a a') \<in> R
 2. \<And>a a'. \<lbrakk>(a, a') \<in> R; (f (?x2 a a'), g (?y2 a a')) \<in> S\<rbrakk> \<Longrightarrow> (f a, g a') \<in> S
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma quasi_isometry_on_perturb:
  assumes "lambda C-quasi_isometry_on X f"
          "D \<ge> 0"
          "\<And>x. x \<in> X \<Longrightarrow> dist (f x) (g x) \<le> D"
  shows "lambda (C + 2 * D)-quasi_isometry_on X g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lambda (C + 2 * D) -quasi_isometry_on X g
[PROOF STEP]
proof (rule quasi_isometry_onI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
 3. 1 \<le> lambda
 4. 0 \<le> C + 2 * D
[PROOF STEP]
show "lambda \<ge> 1" "C + 2 * D \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> lambda &&& 0 \<le> C + 2 * D
[PROOF STEP]
using \<open>D \<ge> 0\<close> quasi_isometry_onD[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
0 \<le> D
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> dist (f ?x) (f ?y) \<le> lambda * dist ?x ?y + C
\<lbrakk>?x \<in> X; ?y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist ?x ?y - C \<le> dist (f ?x) (f ?y)
1 \<le> lambda
0 \<le> C

goal (1 subgoal):
 1. 1 \<le> lambda &&& 0 \<le> C + 2 * D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> lambda
0 \<le> C + 2 * D

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
assume *: "x \<in> X" "y \<in> X"
[PROOF STATE]
proof (state)
this:
x \<in> X
y \<in> X

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
have "dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D
[PROOF STEP]
using assms(3)[OF *(1)] assms(3)[OF *(2)] dist_triangle4[of "g x" "g y" "f x" "f y"]
[PROOF STATE]
proof (prove)
using this:
dist (f x) (g x) \<le> D
dist (f y) (g y) \<le> D
dist (g x) (g y) \<le> dist (g x) (f x) + dist (f x) (f y) + dist (f y) (g y)

goal (1 subgoal):
 1. dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D
[PROOF STEP]
by (simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D

goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
 2. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D
[PROOF STEP]
show "dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)"
[PROOF STATE]
proof (prove)
using this:
dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D

goal (1 subgoal):
 1. dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
[PROOF STEP]
using quasi_isometry_onD(1)[OF assms(1) *]
[PROOF STATE]
proof (prove)
using this:
dist (g x) (g y) \<le> dist (f x) (f y) + 2 * D
dist (f x) (f y) \<le> lambda * dist x y + C

goal (1 subgoal):
 1. dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dist (g x) (g y) \<le> lambda * dist x y + (C + 2 * D)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
have "dist (g x) (g y) \<ge> dist (f x) (f y) - 2 * D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (f x) (f y) - 2 * D \<le> dist (g x) (g y)
[PROOF STEP]
using assms(3)[OF *(1)] assms(3)[OF *(2)] dist_triangle4[of "f x" "f y" "g x" "g y"]
[PROOF STATE]
proof (prove)
using this:
dist (f x) (g x) \<le> D
dist (f y) (g y) \<le> D
dist (f x) (f y) \<le> dist (f x) (g x) + dist (g x) (g y) + dist (g y) (f y)

goal (1 subgoal):
 1. dist (f x) (f y) - 2 * D \<le> dist (g x) (g y)
[PROOF STEP]
by (simp add: dist_commute)
[PROOF STATE]
proof (state)
this:
dist (f x) (f y) - 2 * D \<le> dist (g x) (g y)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> X; y \<in> X\<rbrakk> \<Longrightarrow> 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist (f x) (f y) - 2 * D \<le> dist (g x) (g y)
[PROOF STEP]
show "dist (g x) (g y) \<ge> (1/lambda) * dist x y - (C + 2 * D)"
[PROOF STATE]
proof (prove)
using this:
dist (f x) (f y) - 2 * D \<le> dist (g x) (g y)

goal (1 subgoal):
 1. 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
using quasi_isometry_onD(2)[OF assms(1) *]
[PROOF STATE]
proof (prove)
using this:
dist (f x) (f y) - 2 * D \<le> dist (g x) (g y)
1 / lambda * dist x y - C \<le> dist (f x) (f y)

goal (1 subgoal):
 1. 1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / lambda * dist x y - (C + 2 * D) \<le> dist (g x) (g y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sum_least:
  "test_seq t \<Longrightarrow> (\<forall>n . t n \<le> -p) \<Longrightarrow> Sum t \<le> -p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>test_seq t; \<forall>n. t n \<le> - p\<rbrakk> \<Longrightarrow> complete_tests_class.Sum t \<le> - p
[PROOF STEP]
using Sum_def sup_least test_seq_test_set
[PROOF STATE]
proof (prove)
using this:
complete_tests_class.Sum ?f \<equiv> Sup {?f n |n. True}
test_set ?A \<and> (\<forall>x\<in>?A. x \<le> - ?y) \<longrightarrow> Sup ?A \<le> - ?y
test_seq ?t \<Longrightarrow> test_set {?t n |n. True}

goal (1 subgoal):
 1. \<lbrakk>test_seq t; \<forall>n. t n \<le> - p\<rbrakk> \<Longrightarrow> complete_tests_class.Sum t \<le> - p
[PROOF STEP]
by force


[STATEMENT]
lemma eventually_at_open_segment:
  assumes "x \<in> {a<--<b}"
  shows "\<forall>\<^sub>F y in at x. (y-a) \<bullet> rot(a-b) = 0 \<longrightarrow> y \<in> {a <--< b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a<--<b}
[PROOF STEP]
have "a \<noteq> b"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a<--<b}

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

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a<--<b}
[PROOF STEP]
have x: "(x - a) \<bullet> rot (b - a) = 0" "x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a<--<b}

goal (1 subgoal):
 1. (x - a) \<bullet> rot (b - a) = 0 &&& x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}
[PROOF STEP]
unfolding in_open_segment_iff_rot[OF \<open>a \<noteq> b\<close>]
[PROOF STATE]
proof (prove)
using this:
(x - a) \<bullet> rot (b - a) = 0 \<and> x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}

goal (1 subgoal):
 1. (x - a) \<bullet> rot (b - a) = 0 &&& x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x - a) \<bullet> rot (b - a) = 0
x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x - a) \<bullet> rot (b - a) = 0
x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}
[PROOF STEP]
have "\<forall>\<^sub>F y in at x. y \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}"
[PROOF STATE]
proof (prove)
using this:
(x - a) \<bullet> rot (b - a) = 0
x \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. y \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}
[PROOF STEP]
by (intro topological_tendstoD) (auto intro!: tendsto_intros)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. y \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at x. y \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at x. y \<bullet> (b - a) \<in> {a \<bullet> (b - a)<..<b \<bullet> (b - a)}

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
[PROOF STEP]
by eventually_elim (auto simp: in_open_segment_iff_rot[OF \<open>a \<noteq> b\<close>] nrm_reverse[of _ a b] algebra_simps dist_commute)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem robbins_is_huntington:
  "class.huntington_algebra uminus (\<sqinter>) (\<squnion>) \<bottom> \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.huntington_algebra uminus (\<sqinter>) (\<squnion>) \<bottom> \<top>
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. - (- x \<squnion> - y) \<squnion> - (- x \<squnion> y) = x
[PROOF STEP]
apply (metis dbl_neg robbins sup_comm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hv_him_eq: "Hv(HIm q) = q \<longleftrightarrow> Ree q = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Hv (HIm q) = q) = (Ree q = 0)
[PROOF STEP]
by (simp add: hv_him octo_eq_iff)


[STATEMENT]
lemma less_list_take_iff: "x # xs < x # ys \<longleftrightarrow> xs < ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs < x # ys) = (xs < ys)
[PROOF STEP]
by (metis subseq_Cons2_iff less_list_def less_eq_list_def)


[STATEMENT]
lemma equalOn_vblcaseI: "(zeroX : A --> x=y) ==> equalOn (preImage nextX A) f g ==> equalOn A (vblcase x f) (vblcase y g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>zeroX \<in> A \<longrightarrow> x = y; equalOn (preImage nextX A) f g\<rbrakk> \<Longrightarrow> equalOn A (vblcase x f) (vblcase y g)
[PROOF STEP]
apply (rule equalOnI, rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>zeroX \<in> A \<longrightarrow> x = y; equalOn (preImage nextX A) f g; xa \<in> A\<rbrakk> \<Longrightarrow> (case xa of zeroX \<Rightarrow> x | nextX x \<Rightarrow> f x) = (case xa of zeroX \<Rightarrow> y | nextX x \<Rightarrow> g x)
[PROOF STEP]
apply (case_tac xa rule: vbl_casesE, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa ya. \<lbrakk>zeroX \<in> A \<longrightarrow> x = y; equalOn (preImage nextX A) f g; nextX ya \<in> A; xa = nextX ya\<rbrakk> \<Longrightarrow> f ya = g ya
[PROOF STEP]
apply(simp add: preImage_def equalOn_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma INF_of_enat_infty_iff1: "(INF x \<in> A. enat (f x)) = \<infinity> \<longleftrightarrow> A={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((INF x\<in>A. enat (f x)) = \<infinity>) = (A = {})
[PROOF STEP]
apply (cases "A={}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A = {} \<Longrightarrow> ((INF x\<in>A. enat (f x)) = \<infinity>) = (A = {})
 2. A \<noteq> {} \<Longrightarrow> ((INF x\<in>A. enat (f x)) = \<infinity>) = (A = {})
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = {} \<Longrightarrow> ((INF x\<in>A. enat (f x)) = \<infinity>) = (A = {})
[PROOF STEP]
by (simp add: top_enat_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> ((INF x\<in>A. enat (f x)) = \<infinity>) = (A = {})
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> ((INF x\<in>A. enat (f x)) = \<infinity>) = (A = {})
[PROOF STEP]
by safe (metis INF_top_conv(2) enat.distinct(1) top_enat_def)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lq_rq_assoc: "s \<le>s u \<Longrightarrow> r \<le>p (u\<^sup><\<inverse>s) \<Longrightarrow> (r\<inverse>\<^sup>>u)\<^sup><\<inverse>s = r\<inverse>\<^sup>>(u\<^sup><\<inverse>s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<le>s u; r \<le>p u\<^sup><\<inverse>s \<rbrakk> \<Longrightarrow> (r\<inverse>\<^sup>>u)\<^sup><\<inverse>s  = r\<inverse>\<^sup>>u\<^sup><\<inverse>s
[PROOF STEP]
using lq_reassoc[of r "u\<^sup><\<inverse>s" s] rq_suf[of s u] rqI[of "r\<inverse>\<^sup>>u\<^sup><\<inverse>s" s "r\<inverse>\<^sup>>u"]
[PROOF STATE]
proof (prove)
using this:
r \<le>p u\<^sup><\<inverse>s  \<Longrightarrow> r\<inverse>\<^sup>>u\<^sup><\<inverse>s  \<cdot> s = r\<inverse>\<^sup>>(u\<^sup><\<inverse>s  \<cdot> s)
s \<le>s u \<Longrightarrow> u\<^sup><\<inverse>s  \<cdot> s = u
r\<inverse>\<^sup>>u\<^sup><\<inverse>s  \<cdot> s = r\<inverse>\<^sup>>u \<Longrightarrow> (r\<inverse>\<^sup>>u)\<^sup><\<inverse>s  = r\<inverse>\<^sup>>u\<^sup><\<inverse>s

goal (1 subgoal):
 1. \<lbrakk>s \<le>s u; r \<le>p u\<^sup><\<inverse>s \<rbrakk> \<Longrightarrow> (r\<inverse>\<^sup>>u)\<^sup><\<inverse>s  = r\<inverse>\<^sup>>u\<^sup><\<inverse>s
[PROOF STEP]
by argo


[STATEMENT]
theorem FrobeniusReciprocity :
  "VectorSpace.isomorphic Tsmult1 (HRepHomSet smult' W) Tsmult2
        (GRepHomSet smult' W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>T. VectorSpaceIso (\<star>\<currency>) (HRepHomSet (\<star>) W) (\<star>\<cdot>) T (GRepHomSet (\<star>) W)
[PROOF STEP]
using VectorSpaceIso_\<phi>
[PROOF STATE]
proof (prove)
using this:
VectorSpaceIso (\<star>\<currency>) (HRepHomSet (\<star>) W) (\<star>\<cdot>) \<phi> (GRepHomSet (\<star>) W)

goal (1 subgoal):
 1. \<exists>T. VectorSpaceIso (\<star>\<currency>) (HRepHomSet (\<star>) W) (\<star>\<cdot>) T (GRepHomSet (\<star>) W)
[PROOF STEP]
by fast


[STATEMENT]
lemma integer_division:
  "PRE (\<lambda>s::nat store. x \<ge> 0)
    (''q'' ::= (\<lambda>s. 0));
    (''r'' ::= (\<lambda>s. x));
    (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0)
     DO
      (''q'' ::= (\<lambda>s. s ''q'' + 1));
      (''r'' ::= (\<lambda>s. s ''r'' - y))
      OD)
   POST (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0 \<and> s ''r'' < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rdom \<lceil>\<lambda>s. 0 \<le> x\<rceil> \<subseteq> wp ((''q'' ::= (\<lambda>s. 0)) ; (''r'' ::= (\<lambda>s. x)) ; (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> 0 \<le> s ''r'') DO (''q'' ::= (\<lambda>s. s ''q'' + 1)) ; (''r'' ::= (\<lambda>s. s ''r'' - y)) OD)) \<lceil>\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> 0 \<le> s ''r'' \<and> s ''r'' < y\<rceil>
[PROOF STEP]
by (rule rel_antidomain_kleene_algebra.fbox_whilei_break, simp_all)


[STATEMENT]
lemma order_divides: "[:-a, 1:] ^ n dvd p \<longleftrightarrow> p = 0 \<or> n \<le> order a p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([:- a, 1::'a:] ^ n dvd p) = (p = 0 \<or> n \<le> order a p)
[PROOF STEP]
by (meson dvd_0_right not_less_eq_eq order_1 order_2 power_le_dvd)


[STATEMENT]
lemma (in group) canonical_inj_is_hom: \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
  assumes "subgroup H G"
  shows "group_hom (G \<lparr> carrier := H \<rparr>) G id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom (G\<lparr>carrier := H\<rparr>) G id
[PROOF STEP]
unfolding group_hom_def group_hom_axioms_def hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr>) \<and> Group.group G \<and> id \<in> {h \<in> carrier (G\<lparr>carrier := H\<rparr>) \<rightarrow> carrier G. \<forall>x\<in>carrier (G\<lparr>carrier := H\<rparr>). \<forall>y\<in>carrier (G\<lparr>carrier := H\<rparr>). h (x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y) = h x \<otimes> h y}
[PROOF STEP]
using subgroup.subgroup_is_group[OF assms is_group]
        is_group subgroup.subset[OF assms]
[PROOF STATE]
proof (prove)
using this:
Group.group (G\<lparr>carrier := H\<rparr>)
Group.group G
H \<subseteq> carrier G

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr>) \<and> Group.group G \<and> id \<in> {h \<in> carrier (G\<lparr>carrier := H\<rparr>) \<rightarrow> carrier G. \<forall>x\<in>carrier (G\<lparr>carrier := H\<rparr>). \<forall>y\<in>carrier (G\<lparr>carrier := H\<rparr>). h (x \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> y) = h x \<otimes> h y}
[PROOF STEP]
by auto


[STATEMENT]
lemma solutions_le_iff_pell_valuation_le:
  fixes a b x y :: nat
  assumes "solution (a, b)" "solution (x, y)"
  shows   "a \<le> x \<and> b \<le> y \<longleftrightarrow> pell_valuation (a, b) \<le> pell_valuation (x, y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> x \<and> b \<le> y) = (pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))
 2. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
assume "a \<le> x \<and> b \<le> y"
[PROOF STATE]
proof (state)
this:
a \<le> x \<and> b \<le> y

goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))
 2. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
thus "pell_valuation (a, b) \<le> pell_valuation (x, y)"
[PROOF STATE]
proof (prove)
using this:
a \<le> x \<and> b \<le> y

goal (1 subgoal):
 1. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
unfolding pell_valuation_def prod.case
[PROOF STATE]
proof (prove)
using this:
a \<le> x \<and> b \<le> y

goal (1 subgoal):
 1. real_of_int (int a) + real_of_int (int b) * sqrt (real D) \<le> real_of_int (int x) + real_of_int (int y) * sqrt (real D)
[PROOF STEP]
using D_gt_1
[PROOF STATE]
proof (prove)
using this:
a \<le> x \<and> b \<le> y
1 < D

goal (1 subgoal):
 1. real_of_int (int a) + real_of_int (int b) * sqrt (real D) \<le> real_of_int (int x) + real_of_int (int y) * sqrt (real D)
[PROOF STEP]
by (intro add_mono mult_right_mono) auto
[PROOF STATE]
proof (state)
this:
pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))

goal (1 subgoal):
 1. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
assume *: "pell_valuation (a, b) \<le> pell_valuation (x, y)"
[PROOF STATE]
proof (state)
this:
pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))

goal (1 subgoal):
 1. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
solution (a, b)
solution (x, y)
[PROOF STEP]
have "a \<le> x \<and> b \<le> y \<or> x \<le> a \<and> y \<le> b"
[PROOF STATE]
proof (prove)
using this:
solution (a, b)
solution (x, y)

goal (1 subgoal):
 1. a \<le> x \<and> b \<le> y \<or> x \<le> a \<and> y \<le> b
[PROOF STEP]
by (rule solutions_linorder)
[PROOF STATE]
proof (state)
this:
a \<le> x \<and> b \<le> y \<or> x \<le> a \<and> y \<le> b

goal (1 subgoal):
 1. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
thus "a \<le> x \<and> b \<le> y"
[PROOF STATE]
proof (prove)
using this:
a \<le> x \<and> b \<le> y \<or> x \<le> a \<and> y \<le> b

goal (1 subgoal):
 1. a \<le> x \<and> b \<le> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> a \<le> x \<and> b \<le> y
 2. x \<le> a \<and> y \<le> b \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
assume "x \<le> a \<and> y \<le> b"
[PROOF STATE]
proof (state)
this:
x \<le> a \<and> y \<le> b

goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> a \<le> x \<and> b \<le> y
 2. x \<le> a \<and> y \<le> b \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
hence "pell_valuation (a, b) \<ge> pell_valuation (x, y)"
[PROOF STATE]
proof (prove)
using this:
x \<le> a \<and> y \<le> b

goal (1 subgoal):
 1. pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
unfolding pell_valuation_def prod.case
[PROOF STATE]
proof (prove)
using this:
x \<le> a \<and> y \<le> b

goal (1 subgoal):
 1. real_of_int (int x) + real_of_int (int y) * sqrt (real D) \<le> real_of_int (int a) + real_of_int (int b) * sqrt (real D)
[PROOF STEP]
using D_gt_1
[PROOF STATE]
proof (prove)
using this:
x \<le> a \<and> y \<le> b
1 < D

goal (1 subgoal):
 1. real_of_int (int x) + real_of_int (int y) * sqrt (real D) \<le> real_of_int (int a) + real_of_int (int b) * sqrt (real D)
[PROOF STEP]
by (intro add_mono mult_right_mono) auto
[PROOF STATE]
proof (state)
this:
pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y))

goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> a \<le> x \<and> b \<le> y
 2. x \<le> a \<and> y \<le> b \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))
pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
have "pell_valuation (a, b) = pell_valuation (x, y)"
[PROOF STATE]
proof (prove)
using this:
pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))
pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y)) \<le> pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y))

goal (1 subgoal):
 1. pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))

goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> a \<le> x \<and> b \<le> y
 2. x \<le> a \<and> y \<le> b \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
hence "(a, b) = (x, y)"
[PROOF STATE]
proof (prove)
using this:
pell_valuation (case (a, b) of (x, y) \<Rightarrow> (int x, int y)) = pell_valuation (case (x, y) of (x, y) \<Rightarrow> (int x, int y))

goal (1 subgoal):
 1. (a, b) = (x, y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a, b) = (x, y)

goal (2 subgoals):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> a \<le> x \<and> b \<le> y
 2. x \<le> a \<and> y \<le> b \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
thus "a \<le> x \<and> b \<le> y"
[PROOF STATE]
proof (prove)
using this:
(a, b) = (x, y)

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

goal (1 subgoal):
 1. a \<le> x \<and> b \<le> y \<Longrightarrow> a \<le> x \<and> b \<le> y
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
a \<le> x \<and> b \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indexed_const_ring_hom:
"ring_hom_ring R (Pring R I) (indexed_const)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_hom_ring R (Pring R I) indexed_const
[PROOF STEP]
apply(rule ring_hom_ringI)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. ring R
 2. ring (Pring R I)
 3. \<And>x. x \<in> carrier R \<Longrightarrow> indexed_const x \<in> carrier (Pring R I)
 4. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<otimes> y) = indexed_const x \<otimes>\<^bsub>Pring R I\<^esub> indexed_const y
 5. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<oplus> y) = indexed_const x \<oplus>\<^bsub>Pring R I\<^esub> indexed_const y
 6. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
apply (simp add: local.ring_axioms)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. ring (Pring R I)
 2. \<And>x. x \<in> carrier R \<Longrightarrow> indexed_const x \<in> carrier (Pring R I)
 3. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<otimes> y) = indexed_const x \<otimes>\<^bsub>Pring R I\<^esub> indexed_const y
 4. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<oplus> y) = indexed_const x \<oplus>\<^bsub>Pring R I\<^esub> indexed_const y
 5. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
apply (simp add: Pring_is_ring)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> indexed_const x \<in> carrier (Pring R I)
 2. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<otimes> y) = indexed_const x \<otimes>\<^bsub>Pring R I\<^esub> indexed_const y
 3. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<oplus> y) = indexed_const x \<oplus>\<^bsub>Pring R I\<^esub> indexed_const y
 4. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
using Pring_car indexed_pset.indexed_const
[PROOF STATE]
proof (prove)
using this:
carrier (Pring R ?I) = carrier R [\<X>\<^bsub>?I\<^esub>]
?k \<in> ?K \<Longrightarrow> indexed_const ?k \<in> ?K [\<X>\<^bsub>?I\<^esub>]

goal (4 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> indexed_const x \<in> carrier (Pring R I)
 2. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<otimes> y) = indexed_const x \<otimes>\<^bsub>Pring R I\<^esub> indexed_const y
 3. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<oplus> y) = indexed_const x \<oplus>\<^bsub>Pring R I\<^esub> indexed_const y
 4. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<otimes> y) = indexed_const x \<otimes>\<^bsub>Pring R I\<^esub> indexed_const y
 2. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<oplus> y) = indexed_const x \<oplus>\<^bsub>Pring R I\<^esub> indexed_const y
 3. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
apply (metis Pring_mult indexed_const_P_mult_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> indexed_const (x \<oplus> y) = indexed_const x \<oplus>\<^bsub>Pring R I\<^esub> indexed_const y
 2. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
apply (metis indexed_padd_const local.ring_axioms ring.Pring_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indexed_const \<one> = \<one>\<^bsub>Pring R I\<^esub>
[PROOF STEP]
by (metis Pring_one)


[STATEMENT]
lemma register_tensor_apply[simp]:
  fixes F :: "'a::type update \<Rightarrow> 'b::type update" and G :: "'c::type update \<Rightarrow> 'd::type update"
  assumes \<open>register F\<close> and \<open>register G\<close>
  shows "(F \<otimes>\<^sub>r G) (a \<otimes>\<^sub>u b) = F a \<otimes>\<^sub>u G b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<otimes>\<^sub>r G) (a \<otimes>\<^sub>u b) = F a \<otimes>\<^sub>u G b
[PROOF STEP]
unfolding register_tensor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. F a \<otimes>\<^sub>u Some;\<lambda>b. Some \<otimes>\<^sub>u G b) (a \<otimes>\<^sub>u b) = F a \<otimes>\<^sub>u G b
[PROOF STEP]
apply (subst register_pair_apply)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. register (\<lambda>a. F a \<otimes>\<^sub>u Some)
 2. register (\<lambda>b. Some \<otimes>\<^sub>u G b)
 3. \<And>a b. F a \<otimes>\<^sub>u Some *\<^sub>u Some \<otimes>\<^sub>u G b = Some \<otimes>\<^sub>u G b *\<^sub>u F a \<otimes>\<^sub>u Some
 4. F a \<otimes>\<^sub>u Some *\<^sub>u Some \<otimes>\<^sub>u G b = F a \<otimes>\<^sub>u G b
[PROOF STEP]
unfolding register_tensor_def
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. register (\<lambda>a. F a \<otimes>\<^sub>u Some)
 2. register (\<lambda>b. Some \<otimes>\<^sub>u G b)
 3. \<And>a b. F a \<otimes>\<^sub>u Some *\<^sub>u Some \<otimes>\<^sub>u G b = Some \<otimes>\<^sub>u G b *\<^sub>u F a \<otimes>\<^sub>u Some
 4. F a \<otimes>\<^sub>u Some *\<^sub>u Some \<otimes>\<^sub>u G b = F a \<otimes>\<^sub>u G b
[PROOF STEP]
by (simp_all add: assms tensor_update_mult)


[STATEMENT]
lemma integral_bounded_linear':
  assumes T: "bounded_linear T" and T': "bounded_linear T'"
  assumes *: "\<not> (\<forall>x. T x = 0) \<Longrightarrow> (\<forall>x. T' (T x) = x)"
  shows "integral\<^sup>L M (\<lambda>x. T (f x)) = T (integral\<^sup>L M f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
 2. \<not> ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
assume "(\<forall>x. T x = 0)"
[PROOF STATE]
proof (state)
this:
\<forall>x. T x = (0::'b)

goal (2 subgoals):
 1. ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
 2. \<not> ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. T x = (0::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x. T x = (0::'b)

goal (1 subgoal):
 1. LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. T (f x) = T (integral\<^sup>L M f)

goal (1 subgoal):
 1. \<not> (\<forall>x. T x = (0::'b)) \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x. T x = (0::'b)) \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
assume **: "\<not> (\<forall>x. T x = 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x. T x = (0::'b))

goal (1 subgoal):
 1. \<not> (\<forall>x. T x = (0::'b)) \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
 2. \<not> ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
assume "integrable M f"
[PROOF STATE]
proof (state)
this:
integrable M f

goal (2 subgoals):
 1. ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
 2. \<not> ?P \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
with T
[PROOF STATE]
proof (chain)
picking this:
bounded_linear T
integrable M f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bounded_linear T
integrable M f

goal (1 subgoal):
 1. LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
by (rule integral_bounded_linear)
[PROOF STATE]
proof (state)
this:
LINT x|M. T (f x) = T (integral\<^sup>L M f)

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
assume not: "\<not> integrable M f"
[PROOF STATE]
proof (state)
this:
\<not> integrable M f

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> integrable M f

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
have "\<not> integrable M (\<lambda>x. T (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> integrable M (\<lambda>x. T (f x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable M (\<lambda>x. T (f x)) \<Longrightarrow> False
[PROOF STEP]
assume "integrable M (\<lambda>x. T (f x))"
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. T (f x))

goal (1 subgoal):
 1. integrable M (\<lambda>x. T (f x)) \<Longrightarrow> False
[PROOF STEP]
from integrable_bounded_linear[OF T' this] not *[OF **]
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. T' (T (f x)))
\<not> integrable M f
\<forall>x. T' (T x) = x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. T' (T (f x)))
\<not> integrable M f
\<forall>x. T' (T x) = x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> integrable M (\<lambda>x. T (f x))

goal (1 subgoal):
 1. \<not> integrable M f \<Longrightarrow> LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> integrable M f
\<not> integrable M (\<lambda>x. T (f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> integrable M f
\<not> integrable M (\<lambda>x. T (f x))

goal (1 subgoal):
 1. LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
\<not> integrable M f
\<not> integrable M (\<lambda>x. T (f x))
bounded_linear T

goal (1 subgoal):
 1. LINT x|M. T (f x) = T (integral\<^sup>L M f)
[PROOF STEP]
by (simp add: not_integrable_integral_eq linear_simps)
[PROOF STATE]
proof (state)
this:
LINT x|M. T (f x) = T (integral\<^sup>L M f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
LINT x|M. T (f x) = T (integral\<^sup>L M f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in pseudo_hoop_lattice) sup_times_right:
  "(b \<squnion> c) * a = (b * a) \<squnion> (c * a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<squnion> c) * a = b * a \<squnion> c * a
[PROOF STEP]
apply (cut_tac A = "{b, c}" and b = "b \<squnion> c" and a = a in lemma_2_9_i1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. b \<squnion> c \<in> supremum {b, c}
 2. (b \<squnion> c) * a \<in> supremum ((\<lambda>x. x * a) ` {b, c}) \<Longrightarrow> (b \<squnion> c) * a = b * a \<squnion> c * a
[PROOF STEP]
by simp_all


[STATEMENT]
lemma osum_ozeroR: "r +o ozero =o r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r +o ozero =o r
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
Well_order r

goal (1 subgoal):
 1. r +o ozero =o r
[PROOF STEP]
unfolding osum_def ozero_def
[PROOF STATE]
proof (prove)
using this:
Well_order r

goal (1 subgoal):
 1. map_prod Inl Inl ` r \<union> map_prod Inr Inr ` {} \<union> {(Inl a, Inr a') |a a'. a \<in> Field r \<and> a' \<in> Field {}} =o r
[PROOF STEP]
by (auto intro: map_prod_ordIso)


[STATEMENT]
lemma a_z_z:"(ant m) * (ant n) = ant (m*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ant m * ant n = ant (m * n)
[PROOF STEP]
apply (simp add:mult_ant_def ant_def,
       cut_tac ant_z_in_Ainteg[of "m"],
       cut_tac ant_z_in_Ainteg[of "n"],
       simp add:Abs_Ainteg_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(m, 0) \<in> Ainteg; (n, 0) \<in> Ainteg\<rbrakk> \<Longrightarrow> Abs_Ainteg (zag_t (m, 0) (n, 0)) = Abs_Ainteg (m * n, 0)
[PROOF STEP]
apply (simp add:zag_t_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_root_mult: "root n (x * y) = root n x * root n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root n (x * y) = root n x * root n y
[PROOF STEP]
by (auto split: split_root elim!: sgn_power_injE
      simp: sgn_mult abs_mult power_mult_distrib)


[STATEMENT]
lemma hd_filter_take_more: "\<And>n m.\<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow>
       hd (filter P (take n xs)) =  hd (filter P (take m xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs))
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n m. \<lbrakk>filter P (take n []) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n [])) = hd (filter P (take m []))
 2. \<And>a xs n m. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
[PROOF STEP]
apply  simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs n m. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs n m. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m; n = 0\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
 2. \<And>a xs n m nat. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m; n = Suc nat\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
[PROOF STEP]
apply  simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs n m nat. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m; n = Suc nat\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
[PROOF STEP]
apply (case_tac m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs n m nat. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m; n = Suc nat; m = 0\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
 2. \<And>a xs n m nat nata. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m; n = Suc nat; m = Suc nata\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
[PROOF STEP]
apply  simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs n m nat nata. \<lbrakk>\<And>n m. \<lbrakk>filter P (take n xs) \<noteq> []; n \<le> m\<rbrakk> \<Longrightarrow> hd (filter P (take n xs)) = hd (filter P (take m xs)); filter P (take n (a # xs)) \<noteq> []; n \<le> m; n = Suc nat; m = Suc nata\<rbrakk> \<Longrightarrow> hd (filter P (take n (a # xs))) = hd (filter P (take m (a # xs)))
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Dirichlet_L_0:
  "Dirichlet_L n \<chi> 0 = (if \<chi> (n - 1) = 1 then 0 else -(\<Sum>k=1..<n. of_nat k * \<chi> k) / of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dirichlet_L n \<chi> 0 = (if \<chi> (n - 1) = 1 then 0 else - (\<Sum>k = 1..<n. of_nat k * \<chi> k) / of_nat n)
[PROOF STEP]
by (cases "\<chi> = \<chi>\<^sub>0") (auto simp: Dirichlet_L_0_nonprincipal)


[STATEMENT]
lemma map_list_drop: "\<And>n xs.
  (map_list fs xs) \<up> n =
  (map_list (fs \<up> n) (xs \<up> n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n xs. map_list fs xs \<up> n = map_list (fs \<up> n) (xs \<up> n)
[PROOF STEP]
apply (induct fs, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs n xs. (\<And>n xs. map_list fs xs \<up> n = map_list (fs \<up> n) (xs \<up> n)) \<Longrightarrow> map_list (a # fs) xs \<up> n = map_list ((a # fs) \<up> n) (xs \<up> n)
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a fs n xs. \<lbrakk>\<And>n xs. map_list fs xs \<up> n = map_list (fs \<up> n) (xs \<up> n); n = 0\<rbrakk> \<Longrightarrow> map_list (a # fs) xs \<up> n = map_list ((a # fs) \<up> n) (xs \<up> n)
 2. \<And>a fs n xs nat. \<lbrakk>\<And>n xs. map_list fs xs \<up> n = map_list (fs \<up> n) (xs \<up> n); n = Suc nat\<rbrakk> \<Longrightarrow> map_list (a # fs) xs \<up> n = map_list ((a # fs) \<up> n) (xs \<up> n)
[PROOF STEP]
apply (simp add: drop_Suc)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done