[STATEMENT]
lemma enn2real_sum: shows "finite A \<Longrightarrow> (\<And>a. a\<in> A\<Longrightarrow> f a < top) \<Longrightarrow>enn2real (sum f A) = (\<Sum> a\<in> A. enn2real (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; \<And>a. a \<in> A \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f A) = (\<Sum>a\<in>A. enn2real (f a))
[PROOF STEP]
proof (induct rule:finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>a. a \<in> {} \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f {}) = (\<Sum>a\<in>{}. enn2real (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?a \<in> {} \<Longrightarrow> f ?a < \<top>

goal (2 subgoals):
 1. (\<And>a. a \<in> {} \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f {}) = (\<Sum>a\<in>{}. enn2real (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?a \<in> {} \<Longrightarrow> f ?a < \<top>

goal (1 subgoal):
 1. enn2real (sum f {}) = (\<Sum>a\<in>{}. enn2real (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enn2real (sum f {}) = (\<Sum>a\<in>{}. enn2real (f a))

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

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
have "enn2real (sum f (insert a A)) = enn2real (f a + (sum f A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (sum f (insert a A)) = enn2real (f a + sum f A)
[PROOF STEP]
by (simp add: insert.hyps(1) insert.hyps(2))
[PROOF STATE]
proof (state)
this:
enn2real (sum f (insert a A)) = enn2real (f a + sum f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enn2real (sum f (insert a A)) = enn2real (f a + sum f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
have "... = enn2real (f a) + enn2real (sum f A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (f a + sum f A) = enn2real (f a) + enn2real (sum f A)
[PROOF STEP]
by (simp add: enn2real_plus insert.hyps(1) insert.prems)
[PROOF STATE]
proof (state)
this:
enn2real (f a + sum f A) = enn2real (f a) + enn2real (sum f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enn2real (f a + sum f A) = enn2real (f a) + enn2real (sum f A)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
have "... = enn2real (f a) + (\<Sum> a\<in> A. enn2real (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (f a) + enn2real (sum f A) = enn2real (f a) + (\<Sum>a\<in>A. enn2real (f a))
[PROOF STEP]
by (simp add: insert.hyps(3) insert.prems)
[PROOF STATE]
proof (state)
this:
enn2real (f a) + enn2real (sum f A) = enn2real (f a) + (\<Sum>a\<in>A. enn2real (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
enn2real (f a) + enn2real (sum f A) = enn2real (f a) + (\<Sum>a\<in>A. enn2real (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
have "... = (\<Sum> a\<in> (insert a A). enn2real (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (f a) + (\<Sum>a\<in>A. enn2real (f a)) = (\<Sum>a\<in>insert a A. enn2real (f a))
[PROOF STEP]
by (metis calculation insert.hyps(1) insert.hyps(2) sum.insert)
[PROOF STATE]
proof (state)
this:
enn2real (f a) + (\<Sum>a\<in>A. enn2real (f a)) = (\<Sum>a\<in>insert a A. enn2real (f a))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> f a < \<top>) \<Longrightarrow> enn2real (sum f F) = (\<Sum>a\<in>F. enn2real (f a)); \<And>a. a \<in> insert x F \<Longrightarrow> f a < \<top>\<rbrakk> \<Longrightarrow> enn2real (sum f (insert x F)) = (\<Sum>a\<in>insert x F. enn2real (f a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
enn2real (sum f (insert a A)) = (\<Sum>a\<in>insert a A. enn2real (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
enn2real (sum f (insert a A)) = (\<Sum>a\<in>insert a A. enn2real (f a))

goal (1 subgoal):
 1. enn2real (sum f (insert a A)) = (\<Sum>a\<in>insert a A. enn2real (f a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
enn2real (sum f (insert a A)) = (\<Sum>a\<in>insert a A. enn2real (f a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_rest_shiftr: "(\<lambda>k::int. k div 2) (drop_bit n x) = drop_bit (Suc n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop_bit n x div 2 = drop_bit (Suc n) x
[PROOF STEP]
by (simp add: drop_bit_Suc drop_bit_half)


[STATEMENT]
lemma continuous_on_infdist [continuous_intros]:
  assumes "continuous_on S f"
  shows "continuous_on S (\<lambda>x. infdist (f x) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. infdist (f x) A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. infdist (f x) A)
[PROOF STEP]
unfolding continuous_on
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. (f \<longlongrightarrow> f x) (at x within S)

goal (1 subgoal):
 1. \<forall>x\<in>S. ((\<lambda>x. infdist (f x) A) \<longlongrightarrow> infdist (f x) A) (at x within S)
[PROOF STEP]
by (auto intro: tendsto_infdist)


[STATEMENT]
lemma subset_divisors_adds: "{c. c adds a} \<subseteq> {c. c adds b} \<longleftrightarrow> a adds b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({c. c adds a} \<subseteq> {c. c adds b}) = (a adds b)
[PROOF STEP]
by (auto simp add: subset_iff intro: adds_trans)


[STATEMENT]
lemma hom_into_subgroup_eq:
   "\<lbrakk>subgroup H G; group G\<rbrakk>
    \<Longrightarrow> (h \<in> hom K (subgroup_generated G H) \<longleftrightarrow> h \<in> hom K G \<and> h ` (carrier K) \<subseteq> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subgroup H G; Group.group G\<rbrakk> \<Longrightarrow> (h \<in> hom K (subgroup_generated G H)) = (h \<in> hom K G \<and> h ` carrier K \<subseteq> H)
[PROOF STEP]
by (simp add: hom_into_subgroup_eq_gen image_subset_iff subgroup.carrier_subgroup_generated_subgroup)


[STATEMENT]
lemma regular_division_division_of:
  assumes "a < b" "n>0"
  shows "(regular_division a b n) division_of {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular_division a b n division_of {a..b}
[PROOF STEP]
proof (rule division_ofI)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. finite (regular_division a b n)
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<subseteq> {a..b}
 3. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 4. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 5. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
 6. \<Union> (regular_division a b n) = {a..b}
[PROOF STEP]
show "finite (regular_division a b n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (regular_division a b n)
[PROOF STEP]
by (simp add: regular_division_def segments_def)
[PROOF STATE]
proof (state)
this:
finite (regular_division a b n)

goal (5 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<subseteq> {a..b}
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 3. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 4. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
 5. \<Union> (regular_division a b n) = {a..b}
[PROOF STEP]
show \<section>: "\<Union> (regular_division a b n) = {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (regular_division a b n) = {a..b}
[PROOF STEP]
using Union_regular_division assms
[PROOF STATE]
proof (prove)
using this:
?a \<le> ?b \<Longrightarrow> \<Union> (regular_division ?a ?b ?n) = (if ?n = 0 then {} else {?a..?b})
a < b
0 < n

goal (1 subgoal):
 1. \<Union> (regular_division a b n) = {a..b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (regular_division a b n) = {a..b}

goal (4 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<subseteq> {a..b}
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 3. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 4. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
fix K
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<subseteq> {a..b}
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 3. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 4. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
assume K: "K \<in> regular_division a b n"
[PROOF STATE]
proof (state)
this:
K \<in> regular_division a b n

goal (4 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<subseteq> {a..b}
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 3. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 4. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K \<in> regular_division a b n
[PROOF STEP]
obtain k where Keq: "K = {a + (b-a)*(k/n) .. a + (b-a)*((1 + real k) / n)}"
[PROOF STATE]
proof (prove)
using this:
K \<in> regular_division a b n

goal (1 subgoal):
 1. (\<And>k. K = {a + (b - a) * (real k / real n)..a + (b - a) * ((1 + real k) / real n)} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>a<b\<close> regular_divisionE
[PROOF STATE]
proof (prove)
using this:
K \<in> regular_division a b n
a < b
\<lbrakk>?K \<in> regular_division ?a ?b ?n; ?a < ?b; \<And>k. \<lbrakk>k < ?n; ?K = {?a + (?b - ?a) * (real k / real ?n)..?a + (?b - ?a) * ((1 + real k) / real ?n)}\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>k. K = {a + (b - a) * (real k / real n)..a + (b - a) * ((1 + real k) / real n)} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
K = {a + (b - a) * (real k / real n)..a + (b - a) * ((1 + real k) / real n)}

goal (4 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<subseteq> {a..b}
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 3. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 4. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
show "K \<subseteq> {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<subseteq> {a..b}
[PROOF STEP]
using K Union_regular_division \<open>n>0\<close>
[PROOF STATE]
proof (prove)
using this:
K \<in> regular_division a b n
?a \<le> ?b \<Longrightarrow> \<Union> (regular_division ?a ?b ?n) = (if ?n = 0 then {} else {?a..?b})
0 < n

goal (1 subgoal):
 1. K \<subseteq> {a..b}
[PROOF STEP]
by (metis Union_upper \<section>)
[PROOF STATE]
proof (state)
this:
K \<subseteq> {a..b}

goal (3 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> K \<noteq> {}
 2. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 3. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
show "K \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<noteq> {}
[PROOF STEP]
using K
[PROOF STATE]
proof (prove)
using this:
K \<in> regular_division a b n

goal (1 subgoal):
 1. K \<noteq> {}
[PROOF STEP]
by (auto simp: regular_division_def segment_nonempty segments_def)
[PROOF STATE]
proof (state)
this:
K \<noteq> {}

goal (2 subgoals):
 1. \<And>K. K \<in> regular_division a b n \<Longrightarrow> \<exists>a b. K = cbox a b
 2. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
show "\<exists>a b. K = cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. K = cbox a b
[PROOF STEP]
by (metis K \<open>a<b\<close> box_real(2) regular_divisionE)
[PROOF STATE]
proof (state)
this:
\<exists>a b. K = cbox a b

goal (1 subgoal):
 1. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
fix K'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
assume K': "K' \<in> regular_division a b n" and "K \<noteq> K'"
[PROOF STATE]
proof (state)
this:
K' \<in> regular_division a b n
K \<noteq> K'

goal (1 subgoal):
 1. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K' \<in> regular_division a b n
K \<noteq> K'
[PROOF STEP]
obtain k' where Keq': "K' = {a + (b-a)*(k'/n) .. a + (b-a)*((1 + real k') / n)}"
[PROOF STATE]
proof (prove)
using this:
K' \<in> regular_division a b n
K \<noteq> K'

goal (1 subgoal):
 1. (\<And>k'. K' = {a + (b - a) * (real k' / real n)..a + (b - a) * ((1 + real k') / real n)} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using K \<open>a<b\<close> regular_divisionE
[PROOF STATE]
proof (prove)
using this:
K' \<in> regular_division a b n
K \<noteq> K'
K \<in> regular_division a b n
a < b
\<lbrakk>?K \<in> regular_division ?a ?b ?n; ?a < ?b; \<And>k. \<lbrakk>k < ?n; ?K = {?a + (?b - ?a) * (real k / real ?n)..?a + (?b - ?a) * ((1 + real k) / real ?n)}\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>k'. K' = {a + (b - a) * (real k' / real n)..a + (b - a) * ((1 + real k') / real n)} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
K' = {a + (b - a) * (real k' / real n)..a + (b - a) * ((1 + real k') / real n)}

goal (1 subgoal):
 1. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
consider "1 + real k \<le> k'" | "1 + real k' \<le> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 + real k \<le> real k' \<Longrightarrow> thesis; 1 + real k' \<le> real k \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using Keq Keq' \<open>K \<noteq> K'\<close>
[PROOF STATE]
proof (prove)
using this:
K = {a + (b - a) * (real k / real n)..a + (b - a) * ((1 + real k) / real n)}
K' = {a + (b - a) * (real k' / real n)..a + (b - a) * ((1 + real k') / real n)}
K \<noteq> K'

goal (1 subgoal):
 1. \<lbrakk>1 + real k \<le> real k' \<Longrightarrow> thesis; 1 + real k' \<le> real k \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>1 + real k \<le> real k' \<Longrightarrow> ?thesis; 1 + real k' \<le> real k \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>K1 K2. \<lbrakk>K1 \<in> regular_division a b n; K2 \<in> regular_division a b n; K1 \<noteq> K2\<rbrakk> \<Longrightarrow> interior K1 \<inter> interior K2 = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>1 + real k \<le> real k' \<Longrightarrow> ?thesis; 1 + real k' \<le> real k \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "interior K \<inter> interior K' = {}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 + real k \<le> real k' \<Longrightarrow> ?thesis; 1 + real k' \<le> real k \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. interior K \<inter> interior K' = {}
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 + real k \<le> real k' \<Longrightarrow> interior K \<inter> interior K' = {}
 2. 1 + real k' \<le> real k \<Longrightarrow> interior K \<inter> interior K' = {}
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
1 + real k \<le> real k'

goal (2 subgoals):
 1. 1 + real k \<le> real k' \<Longrightarrow> interior K \<inter> interior K' = {}
 2. 1 + real k' \<le> real k \<Longrightarrow> interior K \<inter> interior K' = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 + real k \<le> real k'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 + real k \<le> real k'

goal (1 subgoal):
 1. interior K \<inter> interior K' = {}
[PROOF STEP]
by (simp add: Keq Keq' min_def max_def divide_right_mono assms)
[PROOF STATE]
proof (state)
this:
interior K \<inter> interior K' = {}

goal (1 subgoal):
 1. 1 + real k' \<le> real k \<Longrightarrow> interior K \<inter> interior K' = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 + real k' \<le> real k \<Longrightarrow> interior K \<inter> interior K' = {}
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
1 + real k' \<le> real k

goal (1 subgoal):
 1. 1 + real k' \<le> real k \<Longrightarrow> interior K \<inter> interior K' = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 + real k' \<le> real k
[PROOF STEP]
have "interior K' \<inter> interior K = {}"
[PROOF STATE]
proof (prove)
using this:
1 + real k' \<le> real k

goal (1 subgoal):
 1. interior K' \<inter> interior K = {}
[PROOF STEP]
by (simp add: Keq Keq' min_def max_def divide_right_mono assms)
[PROOF STATE]
proof (state)
this:
interior K' \<inter> interior K = {}

goal (1 subgoal):
 1. 1 + real k' \<le> real k \<Longrightarrow> interior K \<inter> interior K' = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interior K' \<inter> interior K = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interior K' \<inter> interior K = {}

goal (1 subgoal):
 1. interior K \<inter> interior K' = {}
[PROOF STEP]
by (simp add: inf_commute)
[PROOF STATE]
proof (state)
this:
interior K \<inter> interior K' = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
interior K \<inter> interior K' = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arg_mult_2kpi:
  assumes "z1 * z2 \<noteq> 0"
  shows "\<exists> k::int. Arg (z1 * z2) = Arg z1 + Arg z2 + 2*k*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. Arg (z1 * z2) = Arg z1 + Arg z2 + 2 * real_of_int x * pi
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. Arg (z1 * z2) = Arg z1 + Arg z2 + 2 * real_of_int x * pi
[PROOF STEP]
have "cis (Arg (z1*z2)) = cis (Arg z1 + Arg z2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (Arg (z1 * z2)) = cis (Arg z1 + Arg z2)
[PROOF STEP]
by (rule cis_arg_mult[OF assms])
[PROOF STATE]
proof (state)
this:
cis (Arg (z1 * z2)) = cis (Arg z1 + Arg z2)

goal (1 subgoal):
 1. \<exists>x. Arg (z1 * z2) = Arg z1 + Arg z2 + 2 * real_of_int x * pi
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cis (Arg (z1 * z2)) = cis (Arg z1 + Arg z2)

goal (1 subgoal):
 1. \<exists>x. Arg (z1 * z2) = Arg z1 + Arg z2 + 2 * real_of_int x * pi
[PROOF STEP]
using cis_eq[of "Arg (z1*z2)" "Arg z1 + Arg z2"]
[PROOF STATE]
proof (prove)
using this:
cis (Arg (z1 * z2)) = cis (Arg z1 + Arg z2)
cis (Arg (z1 * z2)) = cis (Arg z1 + Arg z2) \<Longrightarrow> \<exists>x. Arg (z1 * z2) - (Arg z1 + Arg z2) = 2 * real_of_int x * pi

goal (1 subgoal):
 1. \<exists>x. Arg (z1 * z2) = Arg z1 + Arg z2 + 2 * real_of_int x * pi
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<exists>x. Arg (z1 * z2) = Arg z1 + Arg z2 + 2 * real_of_int x * pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insertAt_removeAt:
  assumes "i < length ls"
  shows "insertAt i (ls!i) (removeAt i ls) = ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertAt i (ls ! i) (removeAt i ls) = ls
[PROOF STEP]
unfolding insertAt_def removeAt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take i (take i ls @ drop (i + 1) ls) @ ls ! i # drop i (take i ls @ drop (i + 1) ls) = ls
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < length ls

goal (1 subgoal):
 1. take i (take i ls @ drop (i + 1) ls) @ ls ! i # drop i (take i ls @ drop (i + 1) ls) = ls
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length ls \<Longrightarrow> take i ls @ ls ! i # drop (Suc i) ls = ls
[PROOF STEP]
by (simp add: Cons_nth_drop_Suc)


[STATEMENT]
lemma concat_drop_suc_iff:
  "Suc n < length tps \<Longrightarrow> concat (drop (Suc n) tps) =
           tps ! Suc n @ concat (drop (Suc (Suc n)) tps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n < length tps \<Longrightarrow> concat (drop (Suc n) tps) = tps ! Suc n @ concat (drop (Suc (Suc n)) tps)
[PROOF STEP]
proof(induct tps arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. Suc n < length [] \<Longrightarrow> concat (drop (Suc n) []) = [] ! Suc n @ concat (drop (Suc (Suc n)) [])
 2. \<And>a tps n. \<lbrakk>\<And>n. Suc n < length tps \<Longrightarrow> concat (drop (Suc n) tps) = tps ! Suc n @ concat (drop (Suc (Suc n)) tps); Suc n < length (a # tps)\<rbrakk> \<Longrightarrow> concat (drop (Suc n) (a # tps)) = (a # tps) ! Suc n @ concat (drop (Suc (Suc n)) (a # tps))
[PROOF STEP]
case (Cons a tps)
[PROOF STATE]
proof (state)
this:
Suc ?n < length tps \<Longrightarrow> concat (drop (Suc ?n) tps) = tps ! Suc ?n @ concat (drop (Suc (Suc ?n)) tps)
Suc n < length (a # tps)

goal (2 subgoals):
 1. \<And>n. Suc n < length [] \<Longrightarrow> concat (drop (Suc n) []) = [] ! Suc n @ concat (drop (Suc (Suc n)) [])
 2. \<And>a tps n. \<lbrakk>\<And>n. Suc n < length tps \<Longrightarrow> concat (drop (Suc n) tps) = tps ! Suc n @ concat (drop (Suc (Suc n)) tps); Suc n < length (a # tps)\<rbrakk> \<Longrightarrow> concat (drop (Suc n) (a # tps)) = (a # tps) ! Suc n @ concat (drop (Suc (Suc n)) (a # tps))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc ?n < length tps \<Longrightarrow> concat (drop (Suc ?n) tps) = tps ! Suc ?n @ concat (drop (Suc (Suc ?n)) tps)
Suc n < length (a # tps)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Suc ?n < length tps \<Longrightarrow> concat (drop (Suc ?n) tps) = tps ! Suc ?n @ concat (drop (Suc (Suc ?n)) tps)
Suc n < length (a # tps)

goal (1 subgoal):
 1. concat (drop (Suc n) (a # tps)) = (a # tps) ! Suc n @ concat (drop (Suc (Suc n)) (a # tps))
[PROOF STEP]
apply(cases tps, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>n. n < length list \<Longrightarrow> concat (drop n list) = list ! n @ concat (drop (Suc n) list); n < Suc (length list); tps = a # list\<rbrakk> \<Longrightarrow> concat (drop n (a # list)) = (a # list) ! n @ concat (drop n list)
[PROOF STEP]
apply(cases n, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
concat (drop (Suc n) (a # tps)) = (a # tps) ! Suc n @ concat (drop (Suc (Suc n)) (a # tps))

goal (1 subgoal):
 1. \<And>n. Suc n < length [] \<Longrightarrow> concat (drop (Suc n) []) = [] ! Suc n @ concat (drop (Suc (Suc n)) [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma opp_power_def:
  "power.power 1 (\<odot>) x n = x\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup>
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. power.power (1::'a) (\<odot>) x 0 = x\<^bsup>0\<^esup>
 2. \<And>n. power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup> \<Longrightarrow> power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. power.power (1::'a) (\<odot>) x 0 = x\<^bsup>0\<^esup>
 2. \<And>n. power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup> \<Longrightarrow> power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power.power (1::'a) (\<odot>) x 0 = x\<^bsup>0\<^esup>
[PROOF STEP]
by (metis power.power.power_0)
[PROOF STATE]
proof (state)
this:
power.power (1::'a) (\<odot>) x 0 = x\<^bsup>0\<^esup>

goal (1 subgoal):
 1. \<And>n. power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup> \<Longrightarrow> power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup> \<Longrightarrow> power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup>

goal (1 subgoal):
 1. \<And>n. power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup> \<Longrightarrow> power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
power.power (1::'a) (\<odot>) x n = x\<^bsup>n\<^esup>

goal (1 subgoal):
 1. power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>
[PROOF STEP]
by (metis power.power.power_Suc power_Suc2 times.opp_mult_def)
[PROOF STATE]
proof (state)
this:
power.power (1::'a) (\<odot>) x (Suc n) = x\<^bsup>Suc n\<^esup>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_le2_ordering:
  assumes finiteX: "finite X"
      and card_le2: "card X \<le> 2"
  shows "\<exists>f. ordering f ord X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
have card012: "card X = 0 \<or> card X = 1 \<or> card X = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card X = 0 \<or> card X = 1 \<or> card X = 2
[PROOF STEP]
using card_le2
[PROOF STATE]
proof (prove)
using this:
card X \<le> 2

goal (1 subgoal):
 1. card X = 0 \<or> card X = 1 \<or> card X = 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card X = 0 \<or> card X = 1 \<or> card X = 2

goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
have card0: "card X = 0 \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card X = 0 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
[PROOF STEP]
using finiteX
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. card X = 0 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card X = 0 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)

goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
have card1: "card X = 1 \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card X = 1 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
[PROOF STEP]
using card_eq_SucD
[PROOF STATE]
proof (prove)
using this:
card ?A = Suc ?k \<Longrightarrow> \<exists>b B. ?A = insert b B \<and> b \<notin> B \<and> card B = ?k \<and> (?k = 0 \<longrightarrow> B = {})

goal (1 subgoal):
 1. card X = 1 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card X = 1 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)

goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
have card2: "card X = 2 \<longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card X = 2 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
[PROOF STEP]
by (metis two_ordering card_eq_SucD numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
card X = 2 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)

goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card X = 2 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)

goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
using card012 card0 card1 card2
[PROOF STATE]
proof (prove)
using this:
card X = 2 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
card X = 0 \<or> card X = 1 \<or> card X = 2
card X = 0 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
card X = 1 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)
card X = 2 \<longrightarrow> (\<exists>f. TernaryOrdering.ordering f ord X)

goal (1 subgoal):
 1. \<exists>f. TernaryOrdering.ordering f ord X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f. TernaryOrdering.ordering f ord X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_surj_inj: "\<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)
[PROOF STEP]
obtain h where a: "\<forall>x. f x = h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<forall>x. f x = h x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x. f x = h x

goal (1 subgoal):
 1. \<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. f x = h x
[PROOF STEP]
have "surj_on h (range f)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. f x = h x

goal (1 subgoal):
 1. surj_on h (range f)
[PROOF STEP]
by (metis (mono_tags, lifting) imageE surj_on_def)
[PROOF STATE]
proof (state)
this:
surj_on h (range f)

goal (1 subgoal):
 1. \<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
surj_on h (range f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
surj_on h (range f)

goal (1 subgoal):
 1. \<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)
[PROOF STEP]
unfolding inj_on_def surj_on_def fun_eq_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>range f. \<exists>x. y = h x

goal (1 subgoal):
 1. \<exists>g h. (\<forall>x. f x = (g \<circ> h) x) \<and> (\<forall>y\<in>range f. \<exists>x. y = h x) \<and> (\<forall>x\<in>range f. \<forall>y\<in>range f. g x = g y \<longrightarrow> x = y)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>range f. \<exists>x. y = h x
\<forall>x. f x = h x

goal (1 subgoal):
 1. \<exists>g h. (\<forall>x. f x = (g \<circ> h) x) \<and> (\<forall>y\<in>range f. \<exists>x. y = h x) \<and> (\<forall>x\<in>range f. \<forall>y\<in>range f. g x = g y \<longrightarrow> x = y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>g h. f = g \<circ> h \<and> surj_on h (range f) \<and> inj_on g (range f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjointify_gen_boolean_algebra:
  assumes "finite As"
  assumes "As \<subseteq> gen_boolean_algebra S B"
  shows " disjointify As \<subseteq> gen_boolean_algebra S B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjointify As \<subseteq> gen_boolean_algebra S B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite As
As \<subseteq> gen_boolean_algebra S B

goal (1 subgoal):
 1. disjointify As \<subseteq> gen_boolean_algebra S B
[PROOF STEP]
unfolding disjointify_def
[PROOF STATE]
proof (prove)
using this:
finite As
As \<subseteq> gen_boolean_algebra S B

goal (1 subgoal):
 1. rec_disjointify (card As) (Generated_Boolean_Algebra.enumerate As) \<subseteq> gen_boolean_algebra S B
[PROOF STEP]
by (metis enumerate_enumerates enumeratesE(2) rec_disjointify_in_gen_boolean_algebra)


[STATEMENT]
lemma (in order_topology) tendsto_sandwich:
  assumes ev: "eventually (\<lambda>n. f n \<le> g n) net" "eventually (\<lambda>n. g n \<le> h n) net"
  assumes lim: "(f \<longlongrightarrow> c) net" "(h \<longlongrightarrow> c) net"
  shows "(g \<longlongrightarrow> c) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<longlongrightarrow> c) net
[PROOF STEP]
proof (rule order_tendstoI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < g x
 2. \<And>a. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < g x
 2. \<And>a. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
show "a < c \<Longrightarrow> eventually (\<lambda>x. a < g x) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < g x
[PROOF STEP]
using order_tendstoD[OF lim(1), of a] ev
[PROOF STATE]
proof (prove)
using this:
a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < f x
c < a \<Longrightarrow> \<forall>\<^sub>F x in net. f x < a
\<forall>\<^sub>F n in net. f n \<le> g n
\<forall>\<^sub>F n in net. g n \<le> h n

goal (1 subgoal):
 1. a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < g x
[PROOF STEP]
by (auto elim: eventually_elim2)
[PROOF STATE]
proof (state)
this:
a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < g x

goal (1 subgoal):
 1. \<And>a. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
show "c < a \<Longrightarrow> eventually (\<lambda>x. g x < a) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
using order_tendstoD[OF lim(2), of a] ev
[PROOF STATE]
proof (prove)
using this:
a < c \<Longrightarrow> \<forall>\<^sub>F x in net. a < h x
c < a \<Longrightarrow> \<forall>\<^sub>F x in net. h x < a
\<forall>\<^sub>F n in net. f n \<le> g n
\<forall>\<^sub>F n in net. g n \<le> h n

goal (1 subgoal):
 1. c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a
[PROOF STEP]
by (auto elim: eventually_elim2)
[PROOF STATE]
proof (state)
this:
c < a \<Longrightarrow> \<forall>\<^sub>F x in net. g x < a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_and_cross7_eq_0:
   "x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0 \<longleftrightarrow> x = 0 \<or> y = 0" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0) = (x = 0 \<or> y = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0 \<Longrightarrow> x = 0 \<or> y = 0
 2. x = 0 \<or> y = 0 \<Longrightarrow> x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0

goal (2 subgoals):
 1. x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0 \<Longrightarrow> x = 0 \<or> y = 0
 2. x = 0 \<or> y = 0 \<Longrightarrow> x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0

goal (1 subgoal):
 1. x = 0 \<or> y = 0
[PROOF STEP]
using cross7_eq_0 norm_cauchy_schwarz_equal
[PROOF STATE]
proof (prove)
using this:
x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
(?x \<times>\<^sub>7 ?y = 0) = collinear {0, ?x, ?y}
(\<bar>?x \<bullet> ?y\<bar> = norm ?x * norm ?y) = collinear {0::?'a, ?x, ?y}

goal (1 subgoal):
 1. x = 0 \<or> y = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x = 0 \<or> y = 0

goal (1 subgoal):
 1. x = 0 \<or> y = 0 \<Longrightarrow> x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = 0 \<or> y = 0 \<Longrightarrow> x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
x = 0 \<or> y = 0

goal (1 subgoal):
 1. x = 0 \<or> y = 0 \<Longrightarrow> x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = 0 \<or> y = 0
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
x = 0 \<or> y = 0

goal (1 subgoal):
 1. x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<bullet> y = 0 \<and> x \<times>\<^sub>7 y = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (* Detailed proof *)
  fixes f:: "'a::complete_lattice \<Rightarrow> 'a"
  assumes CONT: "cont f"
  shows "lfp f = (SUP i. (f^^i) bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = (SUP i. (f ^^ i) bot)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
let ?K="{ (f^^i) bot | i . True}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
note MONO=cont_is_mono[OF CONT]
[PROOF STATE]
proof (state)
this:
mono f

goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
mono f

goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
have "(f^^i) bot \<le> lfp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ i) bot \<le> lfp f
[PROOF STEP]
apply (induct i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f ^^ 0) bot \<le> lfp f
 2. \<And>i. (f ^^ i) bot \<le> lfp f \<Longrightarrow> (f ^^ Suc i) bot \<le> lfp f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (f ^^ i) bot \<le> lfp f \<Longrightarrow> (f ^^ Suc i) bot \<le> lfp f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (f ^^ i) bot \<le> lfp f \<Longrightarrow> f ((f ^^ i) bot) \<le> lfp f
[PROOF STEP]
by (metis MONO lfp_unfold monoD)
[PROOF STATE]
proof (state)
this:
(f ^^ i) bot \<le> lfp f

goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(f ^^ ?i2) bot \<le> lfp f

goal (2 subgoals):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
 2. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
thus "(SUP i. (f^^i) bot) \<le> lfp f"
[PROOF STATE]
proof (prove)
using this:
(f ^^ ?i2) bot \<le> lfp f

goal (1 subgoal):
 1. (SUP i. (f ^^ i) bot) \<le> lfp f
[PROOF STEP]
by (blast intro: SUP_least)
[PROOF STATE]
proof (state)
this:
(SUP i. (f ^^ i) bot) \<le> lfp f

goal (1 subgoal):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
[PROOF STEP]
show "lfp f \<le> (SUP i. (f^^i) bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f \<le> (SUP i. (f ^^ i) bot)
[PROOF STEP]
apply (rule lfp_lowerbound)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (SUP i. (f ^^ i) bot) \<le> (SUP i. (f ^^ i) bot)
[PROOF STEP]
apply (simp add: contD [OF CONT])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (f ` range (\<lambda>i. (f ^^ i) bot)) \<le> (SUP i. (f ^^ i) bot)
[PROOF STEP]
apply (rule Sup_subset_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` range (\<lambda>i. (f ^^ i) bot) \<subseteq> range (\<lambda>i. (f ^^ i) bot)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. f ((f ^^ i) bot) \<in> range (\<lambda>i. (f ^^ i) bot)
[PROOF STEP]
apply (rule_tac x="Suc i" in range_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. f ((f ^^ i) bot) = (f ^^ Suc i) bot
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
lfp f \<le> (SUP i. (f ^^ i) bot)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_to_sch_5: "c_fst n mod 7 = 5 \<Longrightarrow> nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst n mod 7 = 5 \<Longrightarrow> nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_fst n mod 7 = 5 \<Longrightarrow> nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
assume A1: "c_fst n mod 7 = 5"
[PROOF STATE]
proof (state)
this:
c_fst n mod 7 = 5

goal (1 subgoal):
 1. c_fst n mod 7 = 5 \<Longrightarrow> nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 5
[PROOF STEP]
have "nat_to_sch n = (let u=(c_fst n) mod 7; v=c_snd n; v1=c_fst v; v2 = c_snd v; sch1=nat_to_sch v1; sch2=nat_to_sch v2 in loc_f u sch1 sch2)"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 5

goal (1 subgoal):
 1. nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
by (simp add: loc_lm_2)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal (1 subgoal):
 1. c_fst n mod 7 = 5 \<Longrightarrow> nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 = 5
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
show "nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 = 5
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal (1 subgoal):
 1. nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))
[PROOF STEP]
by (simp add: Let_def loc_f_def)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = Pair_op (nat_to_sch (c_fst (c_snd n))) (nat_to_sch (c_snd (c_snd n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma binomial_strict_antimono:
  assumes "k < k'" "2 * k \<ge> n" "k' \<le> n"
  shows   "n choose k > n choose k'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose k' < n choose k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n choose k' < n choose k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
k < k'
n \<le> 2 * k
k' \<le> n
[PROOF STEP]
have "n choose (n - k) > n choose (n - k')"
[PROOF STATE]
proof (prove)
using this:
k < k'
n \<le> 2 * k
k' \<le> n

goal (1 subgoal):
 1. n choose (n - k') < n choose (n - k)
[PROOF STEP]
by (intro binomial_strict_mono) (simp_all add: algebra_simps)
[PROOF STATE]
proof (state)
this:
n choose (n - k') < n choose (n - k)

goal (1 subgoal):
 1. n choose k' < n choose k
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
k < k'
n \<le> 2 * k
k' \<le> n
n choose (n - k') < n choose (n - k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k < k'
n \<le> 2 * k
k' \<le> n
n choose (n - k') < n choose (n - k)

goal (1 subgoal):
 1. n choose k' < n choose k
[PROOF STEP]
by (simp add: binomial_symmetric [symmetric])
[PROOF STATE]
proof (state)
this:
n choose k' < n choose k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insertion_resultant_mpoly_poly_zero: fixes q :: "'a :: idom poly"
  assumes q: "q \<noteq> 0"
  shows "insertion \<alpha> (resultant_mpoly_poly x p q) = 0 \<longleftrightarrow> resultant (partial_insertion \<alpha> x p) q = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (insertion \<alpha> (resultant_mpoly_poly x p q) = (0::'a)) = (resultant (partial_insertion \<alpha> x p) q = (0::'a))
[PROOF STEP]
unfolding insertion_resultant_mpoly_poly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (resultant (partial_insertion \<alpha> x p) q * (lead_coeff q * (- (1::'a)) ^ degree q) ^ (degree (mpoly_to_mpoly_poly x p) - degree (partial_insertion \<alpha> x p)) = (0::'a)) = (resultant (partial_insertion \<alpha> x p) q = (0::'a))
[PROOF STEP]
using q
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0

goal (1 subgoal):
 1. (resultant (partial_insertion \<alpha> x p) q * (lead_coeff q * (- (1::'a)) ^ degree q) ^ (degree (mpoly_to_mpoly_poly x p) - degree (partial_insertion \<alpha> x p)) = (0::'a)) = (resultant (partial_insertion \<alpha> x p) q = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma zero_less_Limit: "Limit \<beta> \<Longrightarrow> 0 < \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limit \<beta> \<Longrightarrow> 0 < \<beta>
[PROOF STEP]
by (simp add: Limit_def OrdmemD)


[STATEMENT]
lemma (in -) divide_less_1_iff_ennreal: "a / b < (1::ennreal) \<longleftrightarrow> (0 < b \<and> a < b \<or> b = 0 \<and> a = 0 \<or> b = top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a / b < 1) = (0 < b \<and> a < b \<or> b = 0 \<and> a = 0 \<or> b = \<top>)
[PROOF STEP]
by (cases a; cases b; cases "b = 0")
     (auto simp: divide_ennreal ennreal_less_iff ennreal_top_divide)


[STATEMENT]
lemma restict_ODNmap_func:"\<lbrakk>Worder D; x = ordinal_number D\<rbrakk> \<Longrightarrow>
      restrict (ODNmap D) (segment ODnods (ordinal_number D))
               \<in> segment ODnods (ordinal_number D) \<rightarrow> carrier D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D\<rbrakk> \<Longrightarrow> restrict (ODNmap D) (segment ODnods (ordinal_number D)) \<in> segment ODnods (ordinal_number D) \<rightarrow> carrier D
[PROOF STEP]
apply (cut_tac Order_ODnods,
       frule Order.Iod_carr_segment[of "ODnods" "ordinal_number D"],
       frule Order.segment_sub[of "ODnods" "ordinal_number D"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder D; x = ordinal_number D; Order ODnods; carrier (Iod ODnods (segment ODnods (ordinal_number D))) = segment ODnods (ordinal_number D); segment ODnods (ordinal_number D) \<subseteq> carrier ODnods\<rbrakk> \<Longrightarrow> restrict (ODNmap D) (segment ODnods (ordinal_number D)) \<in> segment ODnods (ordinal_number D) \<rightarrow> carrier D
[PROOF STEP]
apply (rule Pi_I, simp,
        (frule Order.Iod_carr_segment[of ODnods "ordinal_number D"],
         simp,
         thin_tac "carrier (Iod ODnods (segment ODnods (ordinal_number D))) =
                            segment ODnods (ordinal_number D) "),
        rule ODNmap_mem1[of D], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Bernstein_coeffs_01_add:
  assumes "degree P \<le> p" and "degree Q \<le> p"
  shows "nth_default 0 (Bernstein_coeffs_01 p (P + Q)) i =
    nth_default 0 (Bernstein_coeffs_01 p P) i +
    nth_default 0 (Bernstein_coeffs_01 p Q) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default 0 (Bernstein_coeffs_01 p (P + Q)) i = nth_default 0 (Bernstein_coeffs_01 p P) i + nth_default 0 (Bernstein_coeffs_01 p Q) i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
degree Q \<le> p

goal (1 subgoal):
 1. nth_default 0 (Bernstein_coeffs_01 p (P + Q)) i = nth_default 0 (Bernstein_coeffs_01 p P) i + nth_default 0 (Bernstein_coeffs_01 p Q) i
[PROOF STEP]
by (auto simp: nth_default_Bernstein_coeffs_01 degree_add_le
                    reciprocal_add pcompose_add algebra_simps)


[STATEMENT]
lemma mset_poly_rel_minus: \<open>({#(a, b)#}, v') \<in> mset_poly_rel \<Longrightarrow>
       (mset yc, r') \<in> mset_poly_rel \<Longrightarrow>
       (r, yc)
       \<in> \<langle>unsorted_term_poly_list_rel \<times>\<^sub>r int_rel\<rangle>list_rel \<Longrightarrow>
       (add_mset (a, b) (mset yc),
        v' + r')
       \<in> mset_poly_rel\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>({#(a, b)#}, v') \<in> mset_poly_rel; (mset yc, r') \<in> mset_poly_rel; (r, yc) \<in> \<langle>unsorted_term_poly_list_rel \<times>\<^sub>r int_rel\<rangle>list_rel\<rbrakk> \<Longrightarrow> (add_mset (a, b) (mset yc), v' + r') \<in> mset_poly_rel
[PROOF STEP]
by (induction r arbitrary: r')
    (auto simp: mset_poly_rel_def polynomial_of_mset_uminus)


[STATEMENT]
lemma has_integral_reflect_lemma[intro]:
  assumes "(f has_integral i) (cbox a b)"
  shows "((\<lambda>x. f(-x)) has_integral i) (cbox (-b) (-a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (- x)) has_integral i) (cbox (- b) (- a))
[PROOF STEP]
using has_integral_affinity[OF assms, of "-1" 0]
[PROOF STATE]
proof (prove)
using this:
- 1 \<noteq> 0 \<Longrightarrow> ((\<lambda>x. f (- 1 *\<^sub>R x + (0::'a))) has_integral (1 / \<bar>- 1\<bar> ^ DIM('a)) *\<^sub>R i) ((\<lambda>x. (1 / - 1) *\<^sub>R x + - ((1 / - 1) *\<^sub>R (0::'a))) ` cbox a b)

goal (1 subgoal):
 1. ((\<lambda>x. f (- x)) has_integral i) (cbox (- b) (- a))
[PROOF STEP]
by auto


[STATEMENT]
lemma epred_max: "epred (max x y) = max (epred x) (epred y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. epred (max x y) = max (epred x) (epred y)
[PROOF STEP]
by(cases x y rule: enat.exhaust[case_product enat.exhaust]) simp_all


[STATEMENT]
lemma compress_no_mod:
  assumes "x\<in>{0..\<lceil>q-(q / (2*2^d))\<rceil>-1}"
          "of_nat d < \<lceil>(log 2 q)::real\<rceil>"
  shows "compress d x =
    round (real_of_int (2^d * x) / real_of_int q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compress d x = round (real_of_int (2 ^ d * x) / real_of_int q)
[PROOF STEP]
unfolding compress_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round (real_of_int (2 ^ d * x) / real_of_int q) mod 2 ^ d = round (real_of_int (2 ^ d * x) / real_of_int q)
[PROOF STEP]
using compress_in_range[OF assms] assms(1) q_gt_zero
[PROOF STATE]
proof (prove)
using this:
round (real_of_int (2 ^ d * x) / real_of_int q) < 2 ^ d
x \<in> {0..\<lceil>real_of_int q - real_of_int q / (2 * 2 ^ d)\<rceil> - 1}
0 < q

goal (1 subgoal):
 1. round (real_of_int (2 ^ d * x) / real_of_int q) mod 2 ^ d = round (real_of_int (2 ^ d * x) / real_of_int q)
[PROOF STEP]
by (smt (z3) atLeastAtMost_iff divide_nonneg_nonneg
  mod_pos_pos_trivial mult_less_cancel_left_pos
  of_int_nonneg of_nat_0_less_iff right_diff_distrib'
  round_0 round_mono zero_less_power)


[STATEMENT]
lemma sq_mtx_vec_mult_eq: "m *\<^sub>V x = (\<chi> i. sum (\<lambda>j. (m $$ i $ j) * (x $ j)) UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m *\<^sub>V x = (\<chi>i. \<Sum>j\<in>UNIV. m $$ i $ j * x $ j)
[PROOF STEP]
by (transfer, simp add: matrix_vector_mult_def)


[STATEMENT]
lemma powr_less_mono: "a < b \<Longrightarrow> 1 < x \<Longrightarrow> x powr a < x powr b"
  for a b x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; 1 < x\<rbrakk> \<Longrightarrow> x powr a < x powr b
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma (in conditionally_complete_linorder) cINF_le_iff:
  "A \<noteq> {} \<Longrightarrow> bdd_below (f`A) \<Longrightarrow> Inf (f ` A) \<le> x \<longleftrightarrow> (\<forall>y>x. \<exists>i\<in>A. y > f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; bdd_below (f ` A)\<rbrakk> \<Longrightarrow> (Inf (f ` A) \<le> x) = (\<forall>y>x. \<exists>i\<in>A. f i < y)
[PROOF STEP]
using cInf_le_iff [of "f ` A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f ` A \<noteq> {}; bdd_below (f ` A)\<rbrakk> \<Longrightarrow> (Inf (f ` A) \<le> ?x) = (\<forall>y>?x. \<exists>a\<in>f ` A. a < y)

goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; bdd_below (f ` A)\<rbrakk> \<Longrightarrow> (Inf (f ` A) \<le> x) = (\<forall>y>x. \<exists>i\<in>A. f i < y)
[PROOF STEP]
by simp


[STATEMENT]
lemma prod_norm: "prod (\<lambda>x. norm (f x)) A = norm (prod f A)"
  for f :: "'a \<Rightarrow> 'b::{comm_semiring_1,real_normed_div_algebra}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>A. norm (f x)) = norm (prod f A)
[PROOF STEP]
by (induct A rule: infinite_finite_induct) (auto simp: norm_mult)


[STATEMENT]
lemma fold_map_of:
    assumes "distinct xs"
    shows "fold (\<lambda> x (k, m). (Suc k, m (x \<mapsto> k))) xs (k, m) =
      (k + length xs, m ++ map_of (xs || [k ..< k + length xs]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs]))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs]))
[PROOF STEP]
proof (induct xs arbitrary: k m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k m. distinct [] \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) [] (k, m) = (k + length [], m ++ map_of ([] || [k..<k + length []]))
 2. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
distinct []

goal (2 subgoals):
 1. \<And>k m. distinct [] \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) [] (k, m) = (k + length [], m ++ map_of ([] || [k..<k + length []]))
 2. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold (\<lambda>x a. case a of (k, m) \<Rightarrow> (Suc k, m(x \<mapsto> k))) [] (k, m) = (k + length [], m ++ map_of ([] || [k..<k + length []]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fold (\<lambda>x a. case a of (k, m) \<Rightarrow> (Suc k, m(x \<mapsto> k))) [] (k, m) = (k + length [], m ++ map_of ([] || [k..<k + length []]))

goal (1 subgoal):
 1. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> fold (\<lambda>x a. case a of (k, m) \<Rightarrow> (Suc k, m(x \<mapsto> k))) xs (?k, ?m) = (?k + length xs, ?m ++ map_of (xs || [?k..<?k + length xs]))
distinct (x # xs)

goal (1 subgoal):
 1. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
have "fold (\<lambda> x (k, m). (Suc k, m (x \<mapsto> k))) (x # xs) (k, m) =
      (Suc k + length xs, (m ++ map_of (xs || [Suc k ..< Suc k + length xs])) (x \<mapsto> k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (Suc k + length xs, (m ++ map_of (xs || [Suc k..<Suc k + length xs]))(x \<mapsto> k))
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
distinct xs \<Longrightarrow> fold (\<lambda>x a. case a of (k, m) \<Rightarrow> (Suc k, m(x \<mapsto> k))) xs (?k, ?m) = (?k + length xs, ?m ++ map_of (xs || [?k..<?k + length xs]))
distinct (x # xs)

goal (1 subgoal):
 1. fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (Suc k + length xs, (m ++ map_of (xs || [Suc k..<Suc k + length xs]))(x \<mapsto> k))
[PROOF STEP]
by (fastforce simp add: map_add_upd_left)
[PROOF STATE]
proof (state)
this:
fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (Suc k + length xs, (m ++ map_of (xs || [Suc k..<Suc k + length xs]))(x \<mapsto> k))

goal (1 subgoal):
 1. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (Suc k + length xs, (m ++ map_of (xs || [Suc k..<Suc k + length xs]))(x \<mapsto> k))

goal (1 subgoal):
 1. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
have "\<dots> = (k + length (x # xs), m ++ map_of (x # xs || [k ..< k + length (x # xs)]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Suc k + length xs, (m ++ map_of (xs || [Suc k..<Suc k + length xs]))(x \<mapsto> k)) = (k + length (x # xs), m ++ map_of (x # xs || [k..<k + length (x # xs)]))
[PROOF STEP]
by (simp add: upt_rec)
[PROOF STATE]
proof (state)
this:
(Suc k + length xs, (m ++ map_of (xs || [Suc k..<Suc k + length xs]))(x \<mapsto> k)) = (k + length (x # xs), m ++ map_of (x # xs || [k..<k + length (x # xs)]))

goal (1 subgoal):
 1. \<And>a xs k m. \<lbrakk>\<And>k m. distinct xs \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) xs (k, m) = (k + length xs, m ++ map_of (xs || [k..<k + length xs])); distinct (a # xs)\<rbrakk> \<Longrightarrow> fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (a # xs) (k, m) = (k + length (a # xs), m ++ map_of (a # xs || [k..<k + length (a # xs)]))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (k + length (x # xs), m ++ map_of (x # xs || [k..<k + length (x # xs)]))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fold (\<lambda>x (k, m). (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (k + length (x # xs), m ++ map_of (x # xs || [k..<k + length (x # xs)]))

goal (1 subgoal):
 1. fold (\<lambda>x a. case a of (k, m) \<Rightarrow> (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (k + length (x # xs), m ++ map_of (x # xs || [k..<k + length (x # xs)]))
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
fold (\<lambda>x a. case a of (k, m) \<Rightarrow> (Suc k, m(x \<mapsto> k))) (x # xs) (k, m) = (k + length (x # xs), m ++ map_of (x # xs || [k..<k + length (x # xs)]))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_compl_induct[case_names 0 Suc]: "\<lbrakk>P 0; \<And>n . \<forall>nn. nn \<le> n \<longrightarrow> P nn \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply(induct_tac n rule: nat_less_induct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n); \<forall>m<n. P m\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply(case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n); \<forall>m<n. P m; n = 0\<rbrakk> \<Longrightarrow> P n
 2. \<And>n nat. \<lbrakk>P 0; \<And>n. \<forall>nn\<le>n. P nn \<Longrightarrow> P (Suc n); \<forall>m<n. P m; n = Suc nat\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma concat_map_distinct:
  "distinct (concat (map f xs)) \<Longrightarrow> y \<in> set (concat (map f xs)) \<Longrightarrow> \<exists>!x \<in> set xs. y \<in> set (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (concat (map f xs)); y \<in> set (concat (map f xs))\<rbrakk> \<Longrightarrow> \<exists>!x. x \<in> set xs \<and> y \<in> set (f x)
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>distinct (concat (map f [])); y \<in> set (concat (map f []))\<rbrakk> \<Longrightarrow> \<exists>!x. x \<in> set [] \<and> y \<in> set (f x)
 2. \<And>a xs. \<lbrakk>\<lbrakk>distinct (concat (map f xs)); y \<in> set (concat (map f xs))\<rbrakk> \<Longrightarrow> \<exists>!x. x \<in> set xs \<and> y \<in> set (f x); distinct (concat (map f (a # xs))); y \<in> set (concat (map f (a # xs)))\<rbrakk> \<Longrightarrow> \<exists>!x. x \<in> set (a # xs) \<and> y \<in> set (f x)
[PROOF STEP]
by(auto)


[STATEMENT]
lemma gcd_idem_int: "gcd x x = \<bar>x\<bar>"
  for x :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd x x = \<bar>x\<bar>
[PROOF STEP]
by (auto simp: gcd_int_def)


[STATEMENT]
lemma card_inj_subs: "inj_on f A \<Longrightarrow> B \<subseteq> A \<Longrightarrow> card (f ` B) = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f A; B \<subseteq> A\<rbrakk> \<Longrightarrow> card (f ` B) = card B
[PROOF STEP]
by (metis card_image subset_inj_on)


[STATEMENT]
lemma arcosh_cosh_real: "x \<ge> 0 \<Longrightarrow> arcosh (cosh x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> arcosh (cosh x) = x
[PROOF STEP]
by (simp add: arcosh_real_def powr_def cosh_square_eq cosh_real_ge_1 cosh_plus_sinh)


[STATEMENT]
lemma unat_shiftl_absorb:
  "\<lbrakk> x \<le> 2 ^ p; p + k < LENGTH('a) \<rbrakk> \<Longrightarrow> unat (x :: 'a :: len word) * 2 ^ k = unat (x * 2 ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> 2 ^ p; p + k < LENGTH('a)\<rbrakk> \<Longrightarrow> unat x * 2 ^ k = unat (x * 2 ^ k)
[PROOF STEP]
by (smt add_diff_cancel_right' add_lessD1 le_add2 le_less_trans mult.commute nat_le_power_trans
          unat_lt2p unat_mult_lem unat_power_lower word_le_nat_alt)


[STATEMENT]
lemma min_dist_succ:
    "\<lbrakk> conn v v'; v'' \<in> succ v' \<rbrakk> \<Longrightarrow> min_dist v v'' \<le> Suc (min_dist v v') "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>conn v v'; v'' \<in> succ v'\<rbrakk> \<Longrightarrow> min_dist v v'' \<le> Suc (min_dist v v')
[PROOF STEP]
by (rule min_distI2[where v'=v'])
       (auto elim: dist.cases intro!: min_dist_minD dist_suc)


[STATEMENT]
lemma Rats_infinite: "\<not> finite \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite \<rat>
[PROOF STEP]
by (auto dest!: finite_imageD simp: inj_on_def infinite_UNIV_char_0 Rats_def)


[STATEMENT]
lemma min_dist_succ:
  "\<lbrakk> connected v v'; (v',v'') \<in> E \<rbrakk> \<Longrightarrow> min_dist v v'' \<le> Suc (min_dist v v') "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected v v'; (v', v'') \<in> E\<rbrakk> \<Longrightarrow> min_dist v v'' \<le> Suc (min_dist v v')
[PROOF STEP]
apply (rule min_distI2[where v'=v'])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>connected v v'; (v', v'') \<in> E\<rbrakk> \<Longrightarrow> connected v v'
 2. \<And>d. \<lbrakk>connected v v'; (v', v'') \<in> E; dist v d v'; \<And>d'. dist v d' v' \<Longrightarrow> d \<le> d'\<rbrakk> \<Longrightarrow> min_dist v v'' \<le> Suc d
[PROOF STEP]
apply (auto intro!: min_dist_minD intro: dist_suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma echelon_form_upt_row_condition1_explicit:
  assumes "echelon_form_upt_row A k"
  and "to_nat i < k" and "is_zero_row i A"
  shows "\<not> (\<exists>j. j>i \<and> to_nat j < k \<and> \<not> is_zero_row j A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>j>i. mod_type_class.to_nat j < k \<and> \<not> is_zero_row j A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
echelon_form_upt_row A k
mod_type_class.to_nat i < k
is_zero_row i A

goal (1 subgoal):
 1. \<not> (\<exists>j>i. mod_type_class.to_nat j < k \<and> \<not> is_zero_row j A)
[PROOF STEP]
unfolding echelon_form_upt_row_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>i. mod_type_class.to_nat i < k \<and> is_zero_row i A \<longrightarrow> \<not> (\<exists>j>i. mod_type_class.to_nat j < k \<and> \<not> is_zero_row j A)) \<and> (\<forall>i j. i < j \<and> mod_type_class.to_nat j < k \<and> \<not> is_zero_row i A \<and> \<not> is_zero_row j A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ j $ n \<noteq> (0::'a)))
mod_type_class.to_nat i < k
is_zero_row i A

goal (1 subgoal):
 1. \<not> (\<exists>j>i. mod_type_class.to_nat j < k \<and> \<not> is_zero_row j A)
[PROOF STEP]
by blast


[STATEMENT]
lemma module_hom_iff_linear: "module_hom s1 s2 f \<longleftrightarrow> linear s1 s2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module_hom s1 s2 f = linear s1 s2 f
[PROOF STEP]
unfolding module_hom_def linear_def module_iff_vector_space
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vector_space s1 \<and> vector_space s2 \<and> module_hom_axioms s1 s2 f) = (vector_space s1 \<and> vector_space s2 \<and> vector_space s1 \<and> vector_space s2 \<and> module_hom_axioms s1 s2 f)
[PROOF STEP]
by auto


[STATEMENT]
lemma compactin_imp_Bolzano_Weierstrass:
   "\<lbrakk>compactin X S; infinite T \<and> T \<subseteq> S\<rbrakk> \<Longrightarrow> S \<inter> X derived_set_of T \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compactin X S; infinite T \<and> T \<subseteq> S\<rbrakk> \<Longrightarrow> S \<inter> X derived_set_of T \<noteq> {}
[PROOF STEP]
using compact_space_imp_Bolzano_Weierstrass [of "subtopology X S"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact_space (subtopology X S); infinite ?S; ?S \<subseteq> topspace (subtopology X S)\<rbrakk> \<Longrightarrow> subtopology X S derived_set_of ?S \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>compactin X S; infinite T \<and> T \<subseteq> S\<rbrakk> \<Longrightarrow> S \<inter> X derived_set_of T \<noteq> {}
[PROOF STEP]
by (simp add: compactin_subspace derived_set_of_subtopology inf_absorb2)


[STATEMENT]
lemma foldr_scene_append:
  "\<lbrakk> pairwise (##\<^sub>S) (set (xs @ ys)) \<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (xs @ ys) = \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (##\<^sub>S) (set (xs @ ys)) \<Longrightarrow> \<Squnion>\<^sub>S (xs @ ys) = \<Squnion>\<^sub>S xs \<squnion>\<^sub>S \<Squnion>\<^sub>S ys
[PROOF STEP]
by (simp add: foldr_scene_union_add_tail pairwise_compat_foldr pairwise_subset scene_compats_members)


[STATEMENT]
lemma RSpan_contains_RSpans_Cons_right :
  "m \<in> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (m#ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (m # ms)
[PROOF STEP]
using RSpan_Cons Group_RSpan_single AbGroup.intro AbGroup.subset_plus_right
[PROOF STATE]
proof (prove)
using this:
RSpan (?m # ?ms) = RSpan [?m] + RSpan ?ms
?m \<in> M \<Longrightarrow> Group (RSpan [?m])
Group ?G \<Longrightarrow> AbGroup ?G
AbGroup ?G \<Longrightarrow> ?A \<subseteq> ?G + ?A

goal (1 subgoal):
 1. m \<in> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (m # ms)
[PROOF STEP]
by fast


[STATEMENT]
lemma gval_gAnd_True:
  "(gval (gAnd g1 g2) s = true) = ((gval g1 s = true) \<and> gval g2 s = true)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (gval (gAnd g1 g2) s = true) = (gval g1 s = true \<and> gval g2 s = true)
[PROOF STEP]
by (simp add: maybe_and_true)


[STATEMENT]
lemma continuous_powr_complex:
  assumes "f (netlimit F) \<notin> \<real>\<^sub>\<le>\<^sub>0" "continuous F f" "continuous F g"
  shows   "continuous F (\<lambda>z. f z powr g z :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>z. f z powr g z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f (netlimit F) \<notin> \<real>\<^sub>\<le>\<^sub>0
continuous F f
continuous F g

goal (1 subgoal):
 1. continuous F (\<lambda>z. f z powr g z)
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
using this:
f (netlimit F) \<notin> \<real>\<^sub>\<le>\<^sub>0
(f \<longlongrightarrow> f (netlimit F)) F
(g \<longlongrightarrow> g (netlimit F)) F

goal (1 subgoal):
 1. ((\<lambda>z. f z powr g z) \<longlongrightarrow> f (netlimit F) powr g (netlimit F)) F
[PROOF STEP]
by (intro tendsto_powr_complex) simp_all


[STATEMENT]
lemma semilat_Def:
"semilat(A,r,f) \<equiv> order r \<and> closed A f \<and>
                 (\<forall>x\<in>A. \<forall>y\<in>A. x \<sqsubseteq>\<^sub>r x \<squnion>\<^sub>f y) \<and>
                 (\<forall>x\<in>A. \<forall>y\<in>A. y \<sqsubseteq>\<^sub>r x \<squnion>\<^sub>f y) \<and>
                 (\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^sub>r z \<and> y \<sqsubseteq>\<^sub>r z \<longrightarrow> x \<squnion>\<^sub>f y \<sqsubseteq>\<^sub>r z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semilat (A, r, f) \<equiv> order r \<and> closed A f \<and> (\<forall>x\<in>A. \<forall>y\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> x \<squnion>\<^bsub>f\<^esub> y) \<and> (\<forall>x\<in>A. \<forall>y\<in>A. y \<sqsubseteq>\<^bsub>r\<^esub> x \<squnion>\<^bsub>f\<^esub> y) \<and> (\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z \<longrightarrow> x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
by (unfold semilat_def) clarsimp


[STATEMENT]
lemma field_less_half_sum: "x < y \<Longrightarrow> x < (x + y) / 2"
  for x y :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> x < (x + y) / (2::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma m1mod2k: "- 1 mod 2 ^ n = (2 ^ n - 1 :: int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 mod 2 ^ n = 2 ^ n - 1
[PROOF STEP]
by (rule zmod_minus1) simp


[STATEMENT]
lemma "max (dist x y) \<bar>dist x z - dist z y\<bar> = dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (dist x y) \<bar>dist x z - dist z y\<bar> = dist x y
[PROOF STEP]
by metric


[STATEMENT]
lemma H_values_right_bottom:
  fixes i j:: nat
  assumes "i = 1 \<and> j = 1"
  shows "H $$ (i,j) = - 1/sqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (- 1 / sqrt 2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i = 1 \<and> j = 1

goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (- 1 / sqrt 2)
[PROOF STEP]
by (simp add: H_without_scalar_prod)


[STATEMENT]
lemma size_mset_tree_lower: "tree_invar t \<Longrightarrow>
  size (tree_to_multiset t) \<ge> (2::nat)^(rank t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_invar t \<Longrightarrow> 2 ^ rank t \<le> size (tree_to_multiset t)
[PROOF STEP]
apply (cases t)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x3 x4. \<lbrakk>tree_invar t; t = Node x1 x2 x3 x4\<rbrakk> \<Longrightarrow> 2 ^ rank t \<le> size (tree_to_multiset t)
[PROOF STEP]
by (simp only: tree_rank_estimate_lower SkewBinomialTree.sel(3))


[STATEMENT]
lemma size_tree_Node[simp,code]:
  "size_tree \<langle>l, x, r\<rangle> =
  (let m = size_tree l;
       n = size_tree r
   in m+n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Root_Balanced_Tree.size_tree \<langle>l, x, r\<rangle> = (let m = Root_Balanced_Tree.size_tree l; n = Root_Balanced_Tree.size_tree r in m + n + 1)
[PROOF STEP]
using val_cong[OF size_tree_tm.simps(2)]
[PROOF STATE]
proof (prove)
using this:
Time_Monad.val (size_tree_tm \<langle>?l1, ?x1, ?r1\<rangle>) = Time_Monad.val (size_tree_tm ?l1 \<bind> (\<lambda>m. size_tree_tm ?r1 \<bind> (\<lambda>n. return (m + n + 1))) \<bind> tick)

goal (1 subgoal):
 1. Root_Balanced_Tree.size_tree \<langle>l, x, r\<rangle> = (let m = Root_Balanced_Tree.size_tree l; n = Root_Balanced_Tree.size_tree r in m + n + 1)
[PROOF STEP]
by(simp only: size_tree_def val_simps)


[STATEMENT]
lemma locally_connected_sphere_gen:
  fixes S :: "'a::euclidean_space set"
  assumes "bounded S" and "convex S"
  shows "locally connected (rel_frontier S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected (rel_frontier S)
[PROOF STEP]
by (simp add: ANR_imp_locally_connected ANR_rel_frontier_convex assms)


[STATEMENT]
lemma ratrel_iff [simp]: "ratrel x y \<longleftrightarrow> snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ratrel x y = (snd x \<noteq> 0 \<and> snd y \<noteq> 0 \<and> fst x * snd y = fst y * snd x)
[PROOF STEP]
by (simp add: ratrel_def)


[STATEMENT]
lemma gkern2:"\<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow>
               gker\<^bsub>F,G\<^esub> f = {\<one>\<^bsub>F\<^esub>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f = {\<one>\<^bsub>F\<^esub>}
[PROOF STEP]
apply (frule gkernTr6[of "F" "G" "f"], assumption+,
       frule singleton_sub[of "\<one>\<^bsub>F\<^esub>" "gker\<^bsub>F,G\<^esub> f"],
       rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f; \<one>\<^bsub>F\<^esub> \<in> gker\<^bsub>F,G\<^esub> f; {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> gker\<^bsub>F,G\<^esub> f \<subseteq> {\<one>\<^bsub>F\<^esub>}
 2. \<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f; \<one>\<^bsub>F\<^esub> \<in> gker\<^bsub>F,G\<^esub> f; {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f
[PROOF STEP]
apply (rule subsetI,
        thin_tac "{\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f",
        simp add:gkernel_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f; \<one>\<^bsub>F\<^esub> \<in> carrier F; f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>; x \<in> carrier F; f x = \<one>\<^bsub>G\<^esub>\<rbrakk> \<Longrightarrow> x = \<one>\<^bsub>F\<^esub>
 2. \<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f; \<one>\<^bsub>F\<^esub> \<in> gker\<^bsub>F,G\<^esub> f; {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f
[PROOF STEP]
apply (frule sym, thin_tac "f \<one>\<^bsub>F\<^esub> = \<one>\<^bsub>G\<^esub>", simp, thin_tac "\<one>\<^bsub>G\<^esub> = f \<one>\<^bsub>F\<^esub>",
        simp add:ginjec_def, simp add:inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; ginj\<^bsub>F,G\<^esub> f; \<one>\<^bsub>F\<^esub> \<in> gker\<^bsub>F,G\<^esub> f; {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f\<rbrakk> \<Longrightarrow> {\<one>\<^bsub>F\<^esub>} \<subseteq> gker\<^bsub>F,G\<^esub> f
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lemma_2_9_i1:
  "b \<in> supremum A \<Longrightarrow> b * a \<in> supremum ((\<lambda> x . x * a) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> supremum A \<Longrightarrow> b * a \<in> supremum ((\<lambda>x. x * a) ` A)
[PROOF STEP]
apply (simp add: supremum_def upper_bound_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. x \<le> b) \<and> (\<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x) \<Longrightarrow> (\<forall>x\<in>A. x * a \<le> b * a) \<and> (\<forall>x. (\<forall>xa\<in>A. xa * a \<le> x) \<longrightarrow> b * a \<le> x)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>A. x \<le> b; \<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x; x \<in> A\<rbrakk> \<Longrightarrow> x * a \<le> b * a
 2. \<And>x. \<lbrakk>\<forall>x\<in>A. x \<le> b; \<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x; \<forall>xa\<in>A. xa * a \<le> x\<rbrakk> \<Longrightarrow> b * a \<le> x
[PROOF STEP]
apply (simp add: mult_right_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x\<in>A. x \<le> b; \<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x; \<forall>xa\<in>A. xa * a \<le> x\<rbrakk> \<Longrightarrow> b * a \<le> x
[PROOF STEP]
by (simp add: left_residual)