[STATEMENT]
lemma join_distr:
  "x \<squnion> (y \<sqinter> z) = (x \<squnion> y) \<sqinter> (x \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
txt \<open>Jacobson I, p.\ 462\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
have "x \<squnion> (y \<sqinter> z) = (x \<squnion> (x \<sqinter> z)) \<squnion> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = x \<squnion> x \<sqinter> z \<squnion> y \<sqinter> z
[PROOF STEP]
by (simp add: L4)
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<sqinter> z = x \<squnion> x \<sqinter> z \<squnion> y \<sqinter> z

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<sqinter> z = x \<squnion> x \<sqinter> z \<squnion> y \<sqinter> z

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
have "... = x \<squnion> ((x \<sqinter> z) \<squnion> (y \<sqinter> z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> x \<sqinter> z \<squnion> y \<sqinter> z = x \<squnion> (x \<sqinter> z \<squnion> y \<sqinter> z)
[PROOF STEP]
by (simp add: L2)
[PROOF STATE]
proof (state)
this:
x \<squnion> x \<sqinter> z \<squnion> y \<sqinter> z = x \<squnion> (x \<sqinter> z \<squnion> y \<sqinter> z)

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<squnion> x \<sqinter> z \<squnion> y \<sqinter> z = x \<squnion> (x \<sqinter> z \<squnion> y \<sqinter> z)

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
have "... = x \<squnion> ((x \<squnion> y) \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> (x \<sqinter> z \<squnion> y \<sqinter> z) = x \<squnion> (x \<squnion> y) \<sqinter> z
[PROOF STEP]
by (simp add: L1 meet_distr)
[PROOF STATE]
proof (state)
this:
x \<squnion> (x \<sqinter> z \<squnion> y \<sqinter> z) = x \<squnion> (x \<squnion> y) \<sqinter> z

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<squnion> (x \<sqinter> z \<squnion> y \<sqinter> z) = x \<squnion> (x \<squnion> y) \<sqinter> z

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
have "... = ((x \<squnion> y) \<sqinter> x) \<squnion> ((x \<squnion> y) \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> (x \<squnion> y) \<sqinter> z = (x \<squnion> y) \<sqinter> x \<squnion> (x \<squnion> y) \<sqinter> z
[PROOF STEP]
by (simp add: L1 L4)
[PROOF STATE]
proof (state)
this:
x \<squnion> (x \<squnion> y) \<sqinter> z = (x \<squnion> y) \<sqinter> x \<squnion> (x \<squnion> y) \<sqinter> z

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<squnion> (x \<squnion> y) \<sqinter> z = (x \<squnion> y) \<sqinter> x \<squnion> (x \<squnion> y) \<sqinter> z

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
have "... = (x \<squnion> y) \<sqinter> (x \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y) \<sqinter> x \<squnion> (x \<squnion> y) \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
by (simp add: meet_distr)
[PROOF STATE]
proof (state)
this:
(x \<squnion> y) \<sqinter> x \<squnion> (x \<squnion> y) \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)

goal (1 subgoal):
 1. x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<sqinter> z = (x \<squnion> y) \<sqinter> (x \<squnion> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nn_integral_0_iff_AE:
  assumes u: "u \<in> borel_measurable M"
  shows "integral\<^sup>N M u = 0 \<longleftrightarrow> (AE x in M. u x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral\<^sup>N M u = 0) = (AE x in M. u x = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (integral\<^sup>N M u = 0) = (AE x in M. u x = 0)
[PROOF STEP]
have sets: "{x\<in>space M. u x \<noteq> 0} \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. u x \<noteq> 0} \<in> sets M
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
u \<in> borel_measurable M

goal (1 subgoal):
 1. {x \<in> space M. u x \<noteq> 0} \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> space M. u x \<noteq> 0} \<in> sets M

goal (1 subgoal):
 1. (integral\<^sup>N M u = 0) = (AE x in M. u x = 0)
[PROOF STEP]
show "integral\<^sup>N M u = 0 \<longleftrightarrow> (AE x in M. u x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral\<^sup>N M u = 0) = (AE x in M. u x = 0)
[PROOF STEP]
using nn_integral_0_iff[of u] AE_iff_null[OF sets] u
[PROOF STATE]
proof (prove)
using this:
u \<in> borel_measurable ?M \<Longrightarrow> (integral\<^sup>N ?M u = 0) = (emeasure ?M {x \<in> space ?M. u x \<noteq> 0} = 0)
(AE x in M. u x = 0) = ({x \<in> space M. u x \<noteq> 0} \<in> null_sets M)
u \<in> borel_measurable M

goal (1 subgoal):
 1. (integral\<^sup>N M u = 0) = (AE x in M. u x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(integral\<^sup>N M u = 0) = (AE x in M. u x = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_powr_eq_mult_powr_iff_asym:
  fixes m1 m2 e1 e2 :: int
  assumes m1: "\<not> 2 dvd m1"
    and "e1 \<le> e2"
  shows "m1 * 2 powr e1 = m2 * 2 powr e2 \<longleftrightarrow> m1 = m2 \<and> e1 = e2"
  (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2) = (m1 = m2 \<and> e1 = e2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2 \<Longrightarrow> m1 = m2 \<and> e1 = e2
 2. m1 = m2 \<and> e1 = e2 \<Longrightarrow> real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2
[PROOF STEP]
show ?rhs if eq: ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
have "m1 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m1 \<noteq> 0
[PROOF STEP]
using m1
[PROOF STATE]
proof (prove)
using this:
odd m1

goal (1 subgoal):
 1. m1 \<noteq> 0
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<nexists>k. m1 = 2 * k

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

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
from \<open>e1 \<le> e2\<close> eq
[PROOF STATE]
proof (chain)
picking this:
e1 \<le> e2
real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2
[PROOF STEP]
have "m1 = m2 * 2 powr nat (e2 - e1)"
[PROOF STATE]
proof (prove)
using this:
e1 \<le> e2
real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2

goal (1 subgoal):
 1. real_of_int m1 = real_of_int m2 * 2 powr real (nat (e2 - e1))
[PROOF STEP]
by (simp add: powr_diff field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int m1 = real_of_int m2 * 2 powr real (nat (e2 - e1))

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int m1 = real_of_int m2 * 2 powr real (nat (e2 - e1))

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
have "\<dots> = m2 * 2^nat (e2 - e1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int m2 * 2 powr real (nat (e2 - e1)) = real_of_int (m2 * 2 ^ nat (e2 - e1))
[PROOF STEP]
by (simp add: powr_realpow)
[PROOF STATE]
proof (state)
this:
real_of_int m2 * 2 powr real (nat (e2 - e1)) = real_of_int (m2 * 2 ^ nat (e2 - e1))

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int m1 = real_of_int (m2 * 2 ^ nat (e2 - e1))
[PROOF STEP]
have m1_eq: "m1 = m2 * 2^nat (e2 - e1)"
[PROOF STATE]
proof (prove)
using this:
real_of_int m1 = real_of_int (m2 * 2 ^ nat (e2 - e1))

goal (1 subgoal):
 1. m1 = m2 * 2 ^ nat (e2 - e1)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
m1 = m2 * 2 ^ nat (e2 - e1)

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
with m1
[PROOF STATE]
proof (chain)
picking this:
odd m1
m1 = m2 * 2 ^ nat (e2 - e1)
[PROOF STEP]
have "m1 = m2"
[PROOF STATE]
proof (prove)
using this:
odd m1
m1 = m2 * 2 ^ nat (e2 - e1)

goal (1 subgoal):
 1. m1 = m2
[PROOF STEP]
by (cases "nat (e2 - e1)") (auto simp add: dvd_def)
[PROOF STATE]
proof (state)
this:
m1 = m2

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m1 = m2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m1 = m2

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
using eq \<open>m1 \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
m1 = m2
real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2
m1 \<noteq> 0

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2
[PROOF STEP]
by (simp add: powr_inj)
[PROOF STATE]
proof (state)
this:
m1 = m2 \<and> e1 = e2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2 \<Longrightarrow> m1 = m2 \<and> e1 = e2

goal (1 subgoal):
 1. m1 = m2 \<and> e1 = e2 \<Longrightarrow> real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2
[PROOF STEP]
show ?lhs if ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m1 = m2 \<and> e1 = e2

goal (1 subgoal):
 1. real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m1 = m2 \<and> e1 = e2 \<Longrightarrow> real_of_int m1 * 2 powr real_of_int e1 = real_of_int m2 * 2 powr real_of_int e2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma if_SE_split_asm : " (\<sigma> \<Turnstile> if\<^sub>S\<^sub>E P B\<^sub>1 B\<^sub>2) = ((P \<sigma> \<and> (\<sigma> \<Turnstile> B\<^sub>1)) \<or> (\<not> P \<sigma> \<and> (\<sigma> \<Turnstile> B\<^sub>2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<sigma> \<Turnstile> if\<^sub>S\<^sub>E P B\<^sub>1 B\<^sub>2) = (P \<sigma> \<and> (\<sigma> \<Turnstile> B\<^sub>1) \<or> \<not> P \<sigma> \<and> (\<sigma> \<Turnstile> B\<^sub>2))
[PROOF STEP]
by(cases "P \<sigma>",auto simp: if_SE_D1 if_SE_D2)


[STATEMENT]
lemma finite_after[simp]: "finite (after x xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (after x xs)
[PROOF STEP]
apply(rule finite_subset[where B = "set xs"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. after x xs \<subseteq> set xs
 2. finite (set xs)
[PROOF STEP]
apply (auto dest: before_in_setD2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma jumpF_cong:
  assumes "F=G" and "eventually (\<lambda>x. f x=g x) F"
  shows "jumpF f F = jumpF g G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f F = jumpF g G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f F = jumpF g G
[PROOF STEP]
have "\<forall>\<^sub>F r in G. f r = g r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F r in G. f r = g r
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
F = G
\<forall>\<^sub>F x in F. f x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F r in G. f r = g r
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F r in G. f r = g r

goal (1 subgoal):
 1. jumpF f F = jumpF g G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F r in G. f r = g r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F r in G. f r = g r

goal (1 subgoal):
 1. jumpF f F = jumpF g G
[PROOF STEP]
by (simp add: assms(1) filterlim_cong jumpF_def)
[PROOF STATE]
proof (state)
this:
jumpF f F = jumpF g G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_times_plus_distrib3: "(a +o C) * D \<subseteq> a *o D + C * D"
  for a :: "'a::semiring"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a +o C * D \<subseteq> a *o D + C * D
[PROOF STEP]
using distrib_right
[PROOF STATE]
proof (prove)
using this:
(?a + ?b) * ?c = ?a * ?c + ?b * ?c

goal (1 subgoal):
 1. a +o C * D \<subseteq> a *o D + C * D
[PROOF STEP]
by (fastforce simp add: elt_set_plus_def elt_set_times_def set_times_def set_plus_def)


[STATEMENT]
lemma finite_set_fold_singleton[simp]: "Finite_Set.fold f z {x} = f x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
have "fold_graph f z {x} (f x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold_graph f z {x} (f x z)
[PROOF STEP]
by (auto intro: fold_graph.intros)
[PROOF STATE]
proof (state)
this:
fold_graph f z {x} (f x z)

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fold_graph f z {x} (f x z)

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
fold_graph f z {x} (f x z)

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
fix X y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
have "fold_graph f z X y \<Longrightarrow> (X = {} \<longrightarrow> y = z) \<and> (X = {x} \<longrightarrow> y = f x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold_graph f z X y \<Longrightarrow> (X = {} \<longrightarrow> y = z) \<and> (X = {x} \<longrightarrow> y = f x z)
[PROOF STEP]
by (induct rule: fold_graph.induct) auto
[PROOF STATE]
proof (state)
this:
fold_graph f z X y \<Longrightarrow> (X = {} \<longrightarrow> y = z) \<and> (X = {x} \<longrightarrow> y = f x z)

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
fold_graph f z ?X2 ?y2 \<Longrightarrow> (?X2 = {} \<longrightarrow> ?y2 = z) \<and> (?X2 = {x} \<longrightarrow> ?y2 = f x z)

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fold_graph f z {x} (f x z)
fold_graph f z ?X2 ?y2 \<Longrightarrow> (?X2 = {} \<longrightarrow> ?y2 = z) \<and> (?X2 = {x} \<longrightarrow> ?y2 = f x z)
[PROOF STEP]
have "(THE y. fold_graph f z {x} y) = f x z"
[PROOF STATE]
proof (prove)
using this:
fold_graph f z {x} (f x z)
fold_graph f z ?X2 ?y2 \<Longrightarrow> (?X2 = {} \<longrightarrow> ?y2 = z) \<and> (?X2 = {x} \<longrightarrow> ?y2 = f x z)

goal (1 subgoal):
 1. (THE y. fold_graph f z {x} y) = f x z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(THE y. fold_graph f z {x} y) = f x z

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(THE y. fold_graph f z {x} y) = f x z

goal (1 subgoal):
 1. Finite_Set.fold f z {x} = f x z
[PROOF STEP]
by (simp add: Finite_Set.fold_def)
[PROOF STATE]
proof (state)
this:
Finite_Set.fold f z {x} = f x z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_set_mono:"A \<subseteq> B \<Longrightarrow> add_set f A n \<subseteq> add_set f B n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> add_set f A n \<subseteq> add_set f B n
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A \<subseteq> B \<Longrightarrow> add_set f A 0 \<subseteq> add_set f B 0
 2. \<And>n. \<lbrakk>A \<subseteq> B; add_set f A n \<subseteq> add_set f B n\<rbrakk> \<Longrightarrow> add_set f A (Suc n) \<subseteq> add_set f B (Suc n)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>A \<subseteq> B; add_set f A n \<subseteq> add_set f B n\<rbrakk> \<Longrightarrow> add_set f A (Suc n) \<subseteq> add_set f B (Suc n)
[PROOF STEP]
apply (rule subsetI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n x. \<lbrakk>A \<subseteq> B; add_set f A n \<subseteq> add_set f B n; \<exists>s\<in>add_set f A n. \<exists>t\<in>A. x = s \<^sub>f+ t\<rbrakk> \<Longrightarrow> \<exists>s\<in>add_set f B n. \<exists>t\<in>B. x = s \<^sub>f+ t
[PROOF STEP]
apply (erule bexE)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n x s t. \<lbrakk>A \<subseteq> B; add_set f A n \<subseteq> add_set f B n; s \<in> add_set f A n; t \<in> A; x = s \<^sub>f+ t\<rbrakk> \<Longrightarrow> \<exists>s\<in>add_set f B n. \<exists>t\<in>B. x = s \<^sub>f+ t
[PROOF STEP]
apply (frule_tac A = "add_set f A n" and B = "add_set f B n" and c = s in
        subsetD, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n x s t. \<lbrakk>A \<subseteq> B; add_set f A n \<subseteq> add_set f B n; s \<in> add_set f A n; t \<in> A; x = s \<^sub>f+ t; s \<in> add_set f B n\<rbrakk> \<Longrightarrow> \<exists>s\<in>add_set f B n. \<exists>t\<in>B. x = s \<^sub>f+ t
[PROOF STEP]
apply (frule_tac A = A and B = B and c = t in subsetD, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n x s t. \<lbrakk>A \<subseteq> B; add_set f A n \<subseteq> add_set f B n; s \<in> add_set f A n; t \<in> A; x = s \<^sub>f+ t; s \<in> add_set f B n; t \<in> B\<rbrakk> \<Longrightarrow> \<exists>s\<in>add_set f B n. \<exists>t\<in>B. x = s \<^sub>f+ t
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma language_finite: "finite {io . io \<in> L M \<and> length io \<le> k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {io \<in> L M. length io \<le> k}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {io \<in> L M. length io \<le> k}
[PROOF STEP]
have "{io . io \<in> L M \<and> length io \<le> k} \<subseteq> p_io  ` {p. path M (FSM.initial M) p \<and> length p \<le> k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {io \<in> L M. length io \<le> k} \<subseteq> p_io ` {p. path M (FSM.initial M) p \<and> length p \<le> k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{io \<in> L M. length io \<le> k} \<subseteq> p_io ` {p. path M (FSM.initial M) p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite {io \<in> L M. length io \<le> k}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{io \<in> L M. length io \<le> k} \<subseteq> p_io ` {p. path M (FSM.initial M) p \<and> length p \<le> k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{io \<in> L M. length io \<le> k} \<subseteq> p_io ` {p. path M (FSM.initial M) p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite {io \<in> L M. length io \<le> k}
[PROOF STEP]
using paths_finite[of M "initial M" k]
[PROOF STATE]
proof (prove)
using this:
{io \<in> L M. length io \<le> k} \<subseteq> p_io ` {p. path M (FSM.initial M) p \<and> length p \<le> k}
finite {p. path M (FSM.initial M) p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite {io \<in> L M. length io \<le> k}
[PROOF STEP]
using finite_surj
[PROOF STATE]
proof (prove)
using this:
{io \<in> L M. length io \<le> k} \<subseteq> p_io ` {p. path M (FSM.initial M) p \<and> length p \<le> k}
finite {p. path M (FSM.initial M) p \<and> length p \<le> k}
\<lbrakk>finite ?A; ?B \<subseteq> ?f ` ?A\<rbrakk> \<Longrightarrow> finite ?B

goal (1 subgoal):
 1. finite {io \<in> L M. length io \<le> k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {io \<in> L M. length io \<le> k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma natpermute_split:
  assumes "h \<le> k"
  shows "natpermute n k =
    (\<Union>m \<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})"
  (is "?L = ?R" is "_ = (\<Union>m \<in>{0..n}. ?S m)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natpermute n k = (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. natpermute n k \<subseteq> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
 2. (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<subseteq> natpermute n k
[PROOF STEP]
show "?R \<subseteq> ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<subseteq> natpermute n k
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<Longrightarrow> x \<in> natpermute n k
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<Longrightarrow> x \<in> natpermute n k
[PROOF STEP]
assume l: "l \<in> ?R"
[PROOF STATE]
proof (state)
this:
l \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<Longrightarrow> x \<in> natpermute n k
[PROOF STEP]
from l
[PROOF STATE]
proof (chain)
picking this:
l \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
obtain m xs ys where h: "m \<in> {0..n}"
      and xs: "xs \<in> natpermute m h"
      and ys: "ys \<in> natpermute (n - m) (k - h)"
      and leq: "l = xs@ys"
[PROOF STATE]
proof (prove)
using this:
l \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})

goal (1 subgoal):
 1. (\<And>m xs ys. \<lbrakk>m \<in> {0..n}; xs \<in> natpermute m h; ys \<in> natpermute (n - m) (k - h); l = xs @ ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m \<in> {0..n}
xs \<in> natpermute m h
ys \<in> natpermute (n - m) (k - h)
l = xs @ ys

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<Longrightarrow> x \<in> natpermute n k
[PROOF STEP]
from xs
[PROOF STATE]
proof (chain)
picking this:
xs \<in> natpermute m h
[PROOF STEP]
have xs': "sum_list xs = m"
[PROOF STATE]
proof (prove)
using this:
xs \<in> natpermute m h

goal (1 subgoal):
 1. sum_list xs = m
[PROOF STEP]
by (simp add: natpermute_def)
[PROOF STATE]
proof (state)
this:
sum_list xs = m

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<Longrightarrow> x \<in> natpermute n k
[PROOF STEP]
from ys
[PROOF STATE]
proof (chain)
picking this:
ys \<in> natpermute (n - m) (k - h)
[PROOF STEP]
have ys': "sum_list ys = n - m"
[PROOF STATE]
proof (prove)
using this:
ys \<in> natpermute (n - m) (k - h)

goal (1 subgoal):
 1. sum_list ys = n - m
[PROOF STEP]
by (simp add: natpermute_def)
[PROOF STATE]
proof (state)
this:
sum_list ys = n - m

goal (1 subgoal):
 1. \<And>x. x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<Longrightarrow> x \<in> natpermute n k
[PROOF STEP]
show "l \<in> ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<in> natpermute n k
[PROOF STEP]
using leq xs ys h
[PROOF STATE]
proof (prove)
using this:
l = xs @ ys
xs \<in> natpermute m h
ys \<in> natpermute (n - m) (k - h)
m \<in> {0..n}

goal (1 subgoal):
 1. l \<in> natpermute n k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l = xs @ ys
xs \<in> natpermute m h
ys \<in> natpermute (n - m) (k - h)
m \<in> {0..n}
h \<le> k

goal (1 subgoal):
 1. l \<in> natpermute n k
[PROOF STEP]
by (force simp add: natpermute_def)
[PROOF STATE]
proof (state)
this:
l \<in> natpermute n k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)}) \<subseteq> natpermute n k

goal (1 subgoal):
 1. natpermute n k \<subseteq> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
show "?L \<subseteq> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natpermute n k \<subseteq> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
assume l: "l \<in> natpermute n k"
[PROOF STATE]
proof (state)
this:
l \<in> natpermute n k

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
let ?xs = "take h l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
let ?ys = "drop h l"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
let ?m = "sum_list ?xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
from l
[PROOF STATE]
proof (chain)
picking this:
l \<in> natpermute n k
[PROOF STEP]
have ls: "sum_list (?xs @ ?ys) = n"
[PROOF STATE]
proof (prove)
using this:
l \<in> natpermute n k

goal (1 subgoal):
 1. sum_list (take h l @ drop h l) = n
[PROOF STEP]
by (simp add: natpermute_def)
[PROOF STATE]
proof (state)
this:
sum_list (take h l @ drop h l) = n

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
have xs: "?xs \<in> natpermute ?m h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take h l \<in> natpermute (sum_list (take h l)) h
[PROOF STEP]
using l assms
[PROOF STATE]
proof (prove)
using this:
l \<in> natpermute n k
h \<le> k

goal (1 subgoal):
 1. take h l \<in> natpermute (sum_list (take h l)) h
[PROOF STEP]
by (simp add: natpermute_def)
[PROOF STATE]
proof (state)
this:
take h l \<in> natpermute (sum_list (take h l)) h

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
have l_take_drop: "sum_list l = sum_list (take h l @ drop h l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list l = sum_list (take h l @ drop h l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list l = sum_list (take h l @ drop h l)

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum_list l = sum_list (take h l @ drop h l)
[PROOF STEP]
have ys: "?ys \<in> natpermute (n - ?m) (k - h)"
[PROOF STATE]
proof (prove)
using this:
sum_list l = sum_list (take h l @ drop h l)

goal (1 subgoal):
 1. drop h l \<in> natpermute (n - sum_list (take h l)) (k - h)
[PROOF STEP]
using l assms ls
[PROOF STATE]
proof (prove)
using this:
sum_list l = sum_list (take h l @ drop h l)
l \<in> natpermute n k
h \<le> k
sum_list (take h l @ drop h l) = n

goal (1 subgoal):
 1. drop h l \<in> natpermute (n - sum_list (take h l)) (k - h)
[PROOF STEP]
by (auto simp add: natpermute_def simp del: append_take_drop_id)
[PROOF STATE]
proof (state)
this:
drop h l \<in> natpermute (n - sum_list (take h l)) (k - h)

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
from ls
[PROOF STATE]
proof (chain)
picking this:
sum_list (take h l @ drop h l) = n
[PROOF STEP]
have m: "?m \<in> {0..n}"
[PROOF STATE]
proof (prove)
using this:
sum_list (take h l @ drop h l) = n

goal (1 subgoal):
 1. sum_list (take h l) \<in> {0..n}
[PROOF STEP]
by (simp add: l_take_drop del: append_take_drop_id)
[PROOF STATE]
proof (state)
this:
sum_list (take h l) \<in> {0..n}

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
have "sum_list (take h l) \<le> sum_list l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (take h l) \<le> sum_list l
[PROOF STEP]
using l_take_drop ls m
[PROOF STATE]
proof (prove)
using this:
sum_list l = sum_list (take h l @ drop h l)
sum_list (take h l @ drop h l) = n
sum_list (take h l) \<in> {0..n}

goal (1 subgoal):
 1. sum_list (take h l) \<le> sum_list l
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
sum_list (take h l) \<le> sum_list l

goal (1 subgoal):
 1. \<And>x. x \<in> natpermute n k \<Longrightarrow> x \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
with xs ys ls l
[PROOF STATE]
proof (chain)
picking this:
take h l \<in> natpermute (sum_list (take h l)) h
drop h l \<in> natpermute (n - sum_list (take h l)) (k - h)
sum_list (take h l @ drop h l) = n
l \<in> natpermute n k
sum_list (take h l) \<le> sum_list l
[PROOF STEP]
show "l \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
take h l \<in> natpermute (sum_list (take h l)) h
drop h l \<in> natpermute (n - sum_list (take h l)) (k - h)
sum_list (take h l @ drop h l) = n
l \<in> natpermute n k
sum_list (take h l) \<le> sum_list l

goal (1 subgoal):
 1. l \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})
[PROOF STEP]
by simp (metis append_take_drop_id m)
[PROOF STATE]
proof (state)
this:
l \<in> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
natpermute n k \<subseteq> (\<Union>m\<in>{0..n}. {l1 @ l2 |l1 l2. l1 \<in> natpermute m h \<and> l2 \<in> natpermute (n - m) (k - h)})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma residue_hom_p:
  assumes "(n::nat) \<ge> m"
  assumes "m >0"
  assumes "prime (p::int)"
  shows "residue (p^m) \<in> ring_hom (residue_ring (p^n)) (residue_ring (p^m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (p ^ m) \<in> ring_hom (residue_ring (p ^ n)) (residue_ring (p ^ m))
[PROOF STEP]
proof(rule residue_is_hom_1)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 1 < p ^ m
 2. 1 < p ^ n
 3. p ^ m dvd p ^ n
[PROOF STEP]
show " 1 < p^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < p ^ n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<le> n
0 < m
prime p

goal (1 subgoal):
 1. 1 < p ^ n
[PROOF STEP]
using prime_gt_1_int
[PROOF STATE]
proof (prove)
using this:
m \<le> n
0 < m
prime p
prime ?p \<Longrightarrow> 1 < ?p

goal (1 subgoal):
 1. 1 < p ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < p ^ n

goal (2 subgoals):
 1. 1 < p ^ m
 2. p ^ m dvd p ^ n
[PROOF STEP]
show "1 < p^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < p ^ m
[PROOF STEP]
by (simp add: assms(2) assms(3) prime_gt_1_int)
[PROOF STATE]
proof (state)
this:
1 < p ^ m

goal (1 subgoal):
 1. p ^ m dvd p ^ n
[PROOF STEP]
show "p ^ m dvd p ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ m dvd p ^ n
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
m \<le> n

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma drop_drop [simp]: "drop n (drop m xs) = drop (n + m) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (drop m xs) = drop (n + m) xs
[PROOF STEP]
proof (induct m arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. drop n (drop 0 xs) = drop (n + 0) xs
 2. \<And>m xs. (\<And>xs. drop n (drop m xs) = drop (n + m) xs) \<Longrightarrow> drop n (drop (Suc m) xs) = drop (n + Suc m) xs
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs. drop n (drop 0 xs) = drop (n + 0) xs
 2. \<And>m xs. (\<And>xs. drop n (drop m xs) = drop (n + m) xs) \<Longrightarrow> drop n (drop (Suc m) xs) = drop (n + Suc m) xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop n (drop 0 xs) = drop (n + 0) xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
drop n (drop 0 xs) = drop (n + 0) xs

goal (1 subgoal):
 1. \<And>m xs. (\<And>xs. drop n (drop m xs) = drop (n + m) xs) \<Longrightarrow> drop n (drop (Suc m) xs) = drop (n + Suc m) xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m xs. (\<And>xs. drop n (drop m xs) = drop (n + m) xs) \<Longrightarrow> drop n (drop (Suc m) xs) = drop (n + Suc m) xs
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
drop n (drop m_ ?xs) = drop (n + m_) ?xs

goal (1 subgoal):
 1. \<And>m xs. (\<And>xs. drop n (drop m xs) = drop (n + m) xs) \<Longrightarrow> drop n (drop (Suc m) xs) = drop (n + Suc m) xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
drop n (drop m_ ?xs) = drop (n + m_) ?xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
drop n (drop m_ ?xs) = drop (n + m_) ?xs

goal (1 subgoal):
 1. drop n (drop (Suc m_) xs) = drop (n + Suc m_) xs
[PROOF STEP]
by (cases xs) simp_all
[PROOF STATE]
proof (state)
this:
drop n (drop (Suc m_) xs) = drop (n + Suc m_) xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma superset_preserves_strict_redundancy:
  assumes "strictly_redundant C S"
  assumes "S \<subseteq> SS"
  shows "strictly_redundant C SS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strictly_redundant C SS
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
strictly_redundant C S
S \<subseteq> SS

goal (1 subgoal):
 1. strictly_redundant C SS
[PROOF STEP]
unfolding strictly_redundant_def
[PROOF STATE]
proof (prove)
using this:
tautology C \<or> (\<exists>D. D \<in> S \<and> D \<subset> C)
S \<subseteq> SS

goal (1 subgoal):
 1. tautology C \<or> (\<exists>D. D \<in> SS \<and> D \<subset> C)
[PROOF STEP]
by blast


[STATEMENT]
lemma keys_default [simp]: "keys (default k v m) = insert k (keys m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (Mapping.default k v m) = insert k (keys m)
[PROOF STEP]
unfolding default_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (if k \<in> keys m then m else update k v m) = insert k (keys m)
[PROOF STEP]
by transfer (simp add: insert_absorb)


[STATEMENT]
lemma frontier_halfspace_gt:
  assumes "a \<noteq> 0 \<or> b \<noteq> 0"
    shows "frontier {x. a \<bullet> x > b} = {x. a \<bullet> x = b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
 2. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
 2. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a) \<or> b \<noteq> 0
a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a) \<or> b \<noteq> 0
a = (0::'a)

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

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}
[PROOF STEP]
by (force simp: frontier_def interior_open open_halfspace_gt)
[PROOF STATE]
proof (state)
this:
frontier {x. b < a \<bullet> x} = {x. a \<bullet> x = b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isLub_mono_imp_LIMSEQ:
  fixes X :: "nat \<Rightarrow> real"
  assumes u: "isLub UNIV {x. \<exists>n. X n = x} u" (* FIXME: use \<open>range X\<close> *)
  assumes X: "\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n"
  shows "X \<longlonglongrightarrow> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<longlonglongrightarrow> u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X \<longlonglongrightarrow> u
[PROOF STEP]
have "X \<longlonglongrightarrow> (SUP i. X i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<longlonglongrightarrow> Sup (range X)
[PROOF STEP]
using u[THEN isLubD1] X
[PROOF STATE]
proof (prove)
using this:
{x. \<exists>n. X n = x} *<= u
\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n

goal (1 subgoal):
 1. X \<longlonglongrightarrow> Sup (range X)
[PROOF STEP]
by (intro LIMSEQ_incseq_SUP) (auto simp: incseq_def image_def eq_commute bdd_above_setle)
[PROOF STATE]
proof (state)
this:
X \<longlonglongrightarrow> Sup (range X)

goal (1 subgoal):
 1. X \<longlonglongrightarrow> u
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
X \<longlonglongrightarrow> Sup (range X)

goal (1 subgoal):
 1. X \<longlonglongrightarrow> u
[PROOF STEP]
have "(SUP i. X i) = u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (range X) = u
[PROOF STEP]
using isLub_cSup[of "range X"] u[THEN isLubD1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>range X \<noteq> {}; \<exists>b. range X *<= b\<rbrakk> \<Longrightarrow> isLub UNIV (range X) (Sup (range X))
{x. \<exists>n. X n = x} *<= u

goal (1 subgoal):
 1. Sup (range X) = u
[PROOF STEP]
by (intro isLub_unique[OF _ u]) (auto simp add: image_def eq_commute)
[PROOF STATE]
proof (state)
this:
Sup (range X) = u

goal (1 subgoal):
 1. X \<longlonglongrightarrow> u
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
X \<longlonglongrightarrow> u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X \<longlonglongrightarrow> u

goal (1 subgoal):
 1. X \<longlonglongrightarrow> u
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
X \<longlonglongrightarrow> u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_to_iarray_nth':
  fixes A::"'a^'n::{mod_type}"
  shows "(vec_to_iarray A) !! (to_nat i) = A $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray A !! mod_type_class.to_nat i = A $ i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_to_iarray A !! mod_type_class.to_nat i = A $ i
[PROOF STEP]
have to_nat_less_card: "to_nat i<CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat i < CARD('n)
[PROOF STEP]
using bij_to_nat[where ?'a='n]
[PROOF STATE]
proof (prove)
using this:
bij_betw mod_type_class.to_nat UNIV {0..<CARD('n)}

goal (1 subgoal):
 1. mod_type_class.to_nat i < CARD('n)
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj mod_type_class.to_nat \<and> range mod_type_class.to_nat = {0..<CARD('n)}

goal (1 subgoal):
 1. mod_type_class.to_nat i < CARD('n)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat i < CARD('n)

goal (1 subgoal):
 1. vec_to_iarray A !! mod_type_class.to_nat i = A $ i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray A !! mod_type_class.to_nat i = A $ i
[PROOF STEP]
unfolding vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat i) CARD('n) !! mod_type_class.to_nat i = A $ i
[PROOF STEP]
unfolding of_fun_nth[OF to_nat_less_card] from_nat_to_nat_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ i = A $ i
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
vec_to_iarray A !! mod_type_class.to_nat i = A $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible\<^sub>dI2:
  fixes p :: "'a::{comm_semiring_1,semiring_no_zero_divisors} poly"
  assumes deg: "degree p > 0" and ndvd: "\<And> q. degree q > 0 \<Longrightarrow> degree q \<le> degree p div 2 \<Longrightarrow> \<not> q dvd p"
  shows "irreducible\<^sub>d p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible\<^sub>d p
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> irreducible\<^sub>d p

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> False
[PROOF STEP]
from this[unfolded irreducible\<^sub>d_def] deg
[PROOF STATE]
proof (chain)
picking this:
\<not> (0 < degree p \<and> (\<forall>q r. degree q < degree p \<longrightarrow> degree r < degree p \<longrightarrow> p \<noteq> q * r))
0 < degree p
[PROOF STEP]
obtain q r where dq: "degree q < degree p" and dr: "degree r < degree p"
    and p: "p = q * r"
[PROOF STATE]
proof (prove)
using this:
\<not> (0 < degree p \<and> (\<forall>q r. degree q < degree p \<longrightarrow> degree r < degree p \<longrightarrow> p \<noteq> q * r))
0 < degree p

goal (1 subgoal):
 1. (\<And>q r. \<lbrakk>degree q < degree p; degree r < degree p; p = q * r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree q < degree p
degree r < degree p
p = q * r

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> False
[PROOF STEP]
from deg
[PROOF STATE]
proof (chain)
picking this:
0 < degree p
[PROOF STEP]
have p0: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < degree p

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

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> False
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p = q * r
p \<noteq> 0
[PROOF STEP]
have "q \<noteq> 0" "r \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p = q * r
p \<noteq> 0

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

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> False
[PROOF STEP]
from degree_mult_eq[OF this] p
[PROOF STATE]
proof (chain)
picking this:
degree (q * r) = degree q + degree r
p = q * r
[PROOF STEP]
have dp: "degree p = degree q + degree r"
[PROOF STATE]
proof (prove)
using this:
degree (q * r) = degree q + degree r
p = q * r

goal (1 subgoal):
 1. degree p = degree q + degree r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree p = degree q + degree r

goal (1 subgoal):
 1. \<not> irreducible\<^sub>d p \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof (cases "degree q \<le> degree p div 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree q \<le> degree p div 2 \<Longrightarrow> False
 2. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree q \<le> degree p div 2

goal (2 subgoals):
 1. degree q \<le> degree p div 2 \<Longrightarrow> False
 2. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
from ndvd[OF _ True] dq dr dp p
[PROOF STATE]
proof (chain)
picking this:
0 < degree q \<Longrightarrow> \<not> q dvd p
degree q < degree p
degree r < degree p
degree p = degree q + degree r
p = q * r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
0 < degree q \<Longrightarrow> \<not> q dvd p
degree q < degree p
degree r < degree p
degree p = degree q + degree r
p = q * r

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

goal (1 subgoal):
 1. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> degree q \<le> degree p div 2

goal (1 subgoal):
 1. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
with dp
[PROOF STATE]
proof (chain)
picking this:
degree p = degree q + degree r
\<not> degree q \<le> degree p div 2
[PROOF STEP]
have dr: "degree r \<le> degree p div 2"
[PROOF STATE]
proof (prove)
using this:
degree p = degree q + degree r
\<not> degree q \<le> degree p div 2

goal (1 subgoal):
 1. degree r \<le> degree p div 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree r \<le> degree p div 2

goal (1 subgoal):
 1. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
p = q * r
[PROOF STEP]
have dvd: "r dvd p"
[PROOF STATE]
proof (prove)
using this:
p = q * r

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

goal (1 subgoal):
 1. \<not> degree q \<le> degree p div 2 \<Longrightarrow> False
[PROOF STEP]
from ndvd[OF _ dr] dvd dp dq
[PROOF STATE]
proof (chain)
picking this:
0 < degree r \<Longrightarrow> \<not> r dvd p
r dvd p
degree p = degree q + degree r
degree q < degree p
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
0 < degree r \<Longrightarrow> \<not> r dvd p
r dvd p
degree p = degree q + degree r
degree q < degree p

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:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fincomp_Suc3:
  assumes "f \<in> {..n :: nat} \<rightarrow> M"
  shows "fincomp f {.. n} = (f n) \<cdot> fincomp f {..< n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
 2. n \<noteq> 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
 2. n \<noteq> 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
using assms atMost_Suc
[PROOF STATE]
proof (prove)
using this:
n = 0
f \<in> {..n} \<rightarrow> M
{..Suc ?k} = insert (Suc ?k) {..?k}

goal (1 subgoal):
 1. fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fincomp f {..n} = f n \<cdot> fincomp f {..<n}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
obtain k where "n = Suc k"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<And>k. n = Suc k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using not0_implies_Suc
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
?n \<noteq> 0 \<Longrightarrow> \<exists>m. ?n = Suc m

goal (1 subgoal):
 1. (\<And>k. n = Suc k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = Suc k

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc k

goal (1 subgoal):
 1. fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
using fincomp_Suc[of f k] assms atMost_Suc lessThan_Suc_atMost
[PROOF STATE]
proof (prove)
using this:
n = Suc k
f \<in> {..Suc k} \<rightarrow> M \<Longrightarrow> fincomp f {..Suc k} = f (Suc k) \<cdot> fincomp f {..k}
f \<in> {..n} \<rightarrow> M
{..Suc ?k} = insert (Suc ?k) {..?k}
{..<Suc ?k} = {..?k}

goal (1 subgoal):
 1. fincomp f {..n} = f n \<cdot> fincomp f {..<n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fincomp f {..n} = f n \<cdot> fincomp f {..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quarter_discrim_invariant:
  assumes "t = i *\<^sub>R a + r"
  shows "quarter_discrim a t = quarter_discrim a r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
from \<open>t = i *\<^sub>R a + r\<close>
[PROOF STATE]
proof (chain)
picking this:
t = i *\<^sub>R a + r
[PROOF STEP]
have "a \<bullet> (M *v t) = i * (a \<bullet> (M *v a)) + a \<bullet> (M *v r)"
[PROOF STATE]
proof (prove)
using this:
t = i *\<^sub>R a + r

goal (1 subgoal):
 1. a \<bullet> (M *v t) = i * (a \<bullet> (M *v a)) + a \<bullet> (M *v r)
[PROOF STEP]
by (simp add:
      matrix_vector_right_distrib
      inner_add_right
      matrix_scaleR_vector_ac
      scaleR_matrix_vector_assoc [symmetric])
[PROOF STATE]
proof (state)
this:
a \<bullet> (M *v t) = i * (a \<bullet> (M *v a)) + a \<bullet> (M *v r)

goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
hence "(a \<bullet> (M *v t))\<^sup>2 =
    (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 +
    2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i +
    (a \<bullet> (M *v r))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
a \<bullet> (M *v t) = i * (a \<bullet> (M *v a)) + a \<bullet> (M *v r)

goal (1 subgoal):
 1. (a \<bullet> (M *v t))\<^sup>2 = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + (a \<bullet> (M *v r))\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
(a \<bullet> (M *v t))\<^sup>2 = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + (a \<bullet> (M *v r))\<^sup>2

goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a \<bullet> (M *v t))\<^sup>2 = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + (a \<bullet> (M *v r))\<^sup>2

goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
from collinear_quadratic and \<open>t = i *\<^sub>R a + r\<close>
[PROOF STATE]
proof (chain)
picking this:
?t = ?i *\<^sub>R ?a + ?r \<Longrightarrow> ?t \<bullet> (M *v ?t) = ?a \<bullet> (M *v ?a) * ?i\<^sup>2 + 2 * (?a \<bullet> (M *v ?r)) * ?i + ?r \<bullet> (M *v ?r)
t = i *\<^sub>R a + r
[PROOF STEP]
have "a \<bullet> (M *v a) * (t \<bullet> (M *v t)) =
    (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 +
    2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i +
    a \<bullet> (M *v a) * (r \<bullet> (M *v r))"
[PROOF STATE]
proof (prove)
using this:
?t = ?i *\<^sub>R ?a + ?r \<Longrightarrow> ?t \<bullet> (M *v ?t) = ?a \<bullet> (M *v ?a) * ?i\<^sup>2 + 2 * (?a \<bullet> (M *v ?r)) * ?i + ?r \<bullet> (M *v ?r)
t = i *\<^sub>R a + r

goal (1 subgoal):
 1. a \<bullet> (M *v a) * (t \<bullet> (M *v t)) = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + a \<bullet> (M *v a) * (r \<bullet> (M *v r))
[PROOF STEP]
by (simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
a \<bullet> (M *v a) * (t \<bullet> (M *v t)) = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + a \<bullet> (M *v a) * (r \<bullet> (M *v r))

goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a \<bullet> (M *v t))\<^sup>2 = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + (a \<bullet> (M *v r))\<^sup>2
a \<bullet> (M *v a) * (t \<bullet> (M *v t)) = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + a \<bullet> (M *v a) * (r \<bullet> (M *v r))
[PROOF STEP]
show "quarter_discrim a t = quarter_discrim a r"
[PROOF STATE]
proof (prove)
using this:
(a \<bullet> (M *v t))\<^sup>2 = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + (a \<bullet> (M *v r))\<^sup>2
a \<bullet> (M *v a) * (t \<bullet> (M *v t)) = (a \<bullet> (M *v a))\<^sup>2 * i\<^sup>2 + 2 * (a \<bullet> (M *v a)) * (a \<bullet> (M *v r)) * i + a \<bullet> (M *v a) * (r \<bullet> (M *v r))

goal (1 subgoal):
 1. quarter_discrim a t = quarter_discrim a r
[PROOF STEP]
by (unfold quarter_discrim_def, simp)
[PROOF STATE]
proof (state)
this:
quarter_discrim a t = quarter_discrim a r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in porder) flip: "porder (\<lambda>x y. y << x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. porder (\<lambda>x y. y << x)
[PROOF STEP]
apply (rule porder.intro)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x << x
 2. \<And>x y z. \<lbrakk>y << x; z << y\<rbrakk> \<Longrightarrow> z << x
 3. \<And>x y. \<lbrakk>y << x; x << y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (rule po_refl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<lbrakk>y << x; z << y\<rbrakk> \<Longrightarrow> z << x
 2. \<And>x y. \<lbrakk>y << x; x << y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (rule po_trans, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>y << x; x << y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (rule po_antisym, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma length_coeffs_degree':
  "length (coeffs p) = (if p = 0 then 0 else Suc (degree p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (coeffs p) = (if p = 0 then 0 else Suc (degree p))
[PROOF STEP]
by (cases "p = 0") (auto simp: length_coeffs_degree)


[STATEMENT]
lemma compact_imp_fip_image:
  assumes "compact s"
    and P: "\<And>i. i \<in> I \<Longrightarrow> closed (f i)"
    and Q: "\<And>I'. finite I' \<Longrightarrow> I' \<subseteq> I \<Longrightarrow> (s \<inter> (\<Inter>i\<in>I'. f i) \<noteq> {})"
  shows "s \<inter> (\<Inter>i\<in>I. f i) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> closed (f ?i)
[PROOF STEP]
have "\<forall>i \<in> f ` I. closed i"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> closed (f ?i)

goal (1 subgoal):
 1. \<forall>i\<in>f ` I. closed i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>f ` I. closed i

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>f ` I. closed i

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
have "\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> (s \<inter> (\<Inter>A) \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}
[PROOF STEP]
by (metis Q finite_subset_image)
[PROOF STATE]
proof (state)
this:
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>f ` I. closed i
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}
[PROOF STEP]
show "s \<inter> (\<Inter>(f ` I)) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>f ` I. closed i
\<forall>A. finite A \<and> A \<subseteq> f ` I \<longrightarrow> s \<inter> \<Inter> A \<noteq> {}

goal (1 subgoal):
 1. s \<inter> \<Inter> (f ` I) \<noteq> {}
[PROOF STEP]
by (metis \<open>compact s\<close> compact_imp_fip)
[PROOF STATE]
proof (state)
this:
s \<inter> \<Inter> (f ` I) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_take_eq [simp]: "\<forall>n. take (take xs n) n = take xs n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. SList.take (SList.take xs n) n = SList.take xs n
[PROOF STEP]
apply (induct xs rule: list_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>n. SList.take (SList.take [] n) n = SList.take [] n
 2. \<And>x xs. \<forall>n. SList.take (SList.take xs n) n = SList.take xs n \<Longrightarrow> \<forall>n. SList.take (SList.take (x # xs) n) n = SList.take (x # xs) n
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<forall>n. SList.take (SList.take xs n) n = SList.take xs n \<Longrightarrow> \<forall>n. SList.take (SList.take (x # xs) n) n = SList.take (x # xs) n
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs n. \<forall>n. SList.take (SList.take xs n) n = SList.take xs n \<Longrightarrow> SList.take (SList.take (x # xs) n) n = SList.take (x # xs) n
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs n. \<forall>n. SList.take (SList.take xs n) n = SList.take xs n \<Longrightarrow> SList.take (SList.take (x # xs) 0) 0 = SList.take (x # xs) 0
 2. \<And>x xs n na. \<lbrakk>\<forall>n. SList.take (SList.take xs n) n = SList.take xs n; SList.take (SList.take (x # xs) na) na = SList.take (x # xs) na\<rbrakk> \<Longrightarrow> SList.take (SList.take (x # xs) (Suc na)) (Suc na) = SList.take (x # xs) (Suc na)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma strongly_fair_imp_weakly_fair:
  assumes "strongly_fair enabled taken \<sigma>"
  shows "weakly_fair enabled taken \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weakly_fair enabled taken \<sigma>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
strongly_fair enabled taken \<sigma>

goal (1 subgoal):
 1. weakly_fair enabled taken \<sigma>
[PROOF STEP]
unfolding strongly_fair_def3 weakly_fair_def3
[PROOF STATE]
proof (prove)
using this:
(\<box>\<diamond>enabled) \<sigma> \<longrightarrow> (\<box>\<diamond>taken) \<sigma>

goal (1 subgoal):
 1. (\<diamond>\<box>enabled) \<sigma> \<longrightarrow> (\<box>\<diamond>taken) \<sigma>
[PROOF STEP]
by (simp add: eventually_always_imp_always_eventually)


[STATEMENT]
lemma minus_cont: "f \<in> bfun \<Longrightarrow> g \<in> bfun \<Longrightarrow> (\<lambda>x. f x - g x) \<in> bfun" for f g::"'a \<Rightarrow> 'b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> bfun; g \<in> bfun\<rbrakk> \<Longrightarrow> (\<lambda>x. f x - g x) \<in> bfun
[PROOF STEP]
by (auto simp: bfun_def bounded_minus_comp)


[STATEMENT]
lemma filterlim_at_top_smallomega_1:
  assumes "f \<in> \<omega>[F](\<lambda>x. 1 :: real)" "eventually (\<lambda>x. f x > 0) F"
  shows   "filterlim f at_top F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<in> \<omega>[F](\<lambda>x. 1)
\<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
have "filterlim (\<lambda>x. norm (f x / 1)) at_top F"
[PROOF STATE]
proof (prove)
using this:
f \<in> \<omega>[F](\<lambda>x. 1)
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. LIM x F. norm (f x / 1) :> at_top
[PROOF STEP]
by (intro smallomegaD_filterlim_at_top_norm) (auto elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
LIM x F. norm (f x / 1) :> at_top

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LIM x F. norm (f x / 1) :> at_top

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
have "?this \<longleftrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LIM x F. norm (f x / 1) :> at_top) = filterlim f at_top F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> \<omega>[F](\<lambda>x. 1)
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. (LIM x F. norm (f x / 1) :> at_top) = filterlim f at_top F
[PROOF STEP]
by (intro filterlim_cong refl) (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
(LIM x F. norm (f x / 1) :> at_top) = filterlim f at_top F

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
filterlim f at_top F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsubset_vunion_leftD[dest]:
  assumes "(A \<union>\<^sub>\<circ> B) \<subseteq>\<^sub>\<circ> C"
  shows "A \<subseteq>\<^sub>\<circ> C" and "B \<subseteq>\<^sub>\<circ> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq>\<^sub>\<circ> C &&& B \<subseteq>\<^sub>\<circ> C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<union>\<^sub>\<circ> B \<subseteq>\<^sub>\<circ> C

goal (1 subgoal):
 1. A \<subseteq>\<^sub>\<circ> C &&& B \<subseteq>\<^sub>\<circ> C
[PROOF STEP]
by auto


[STATEMENT]
lemma Limsup_compose_continuous_antimono:
  fixes f :: "'a::{complete_linorder, linorder_topology} \<Rightarrow> 'b::{complete_linorder, linorder_topology}"
  assumes c: "continuous_on UNIV f" and am: "antimono f" and F: "F \<noteq> bot"
  shows "Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
assume "eventually P F"
[PROOF STATE]
proof (state)
this:
eventually P F

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
have "\<exists>x. P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. P x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>x. P x \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<exists>x. P x)"
[PROOF STATE]
proof (state)
this:
\<nexists>x. P x

goal (1 subgoal):
 1. \<nexists>x. P x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<nexists>x. P x
[PROOF STEP]
have "P = (\<lambda>x. False)"
[PROOF STATE]
proof (prove)
using this:
\<nexists>x. P x

goal (1 subgoal):
 1. P = (\<lambda>x. False)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P = (\<lambda>x. False)

goal (1 subgoal):
 1. \<nexists>x. P x \<Longrightarrow> False
[PROOF STEP]
with \<open>eventually P F\<close> F
[PROOF STATE]
proof (chain)
picking this:
eventually P F
F \<noteq> bot
P = (\<lambda>x. False)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
eventually P F
F \<noteq> bot
P = (\<lambda>x. False)

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:
\<exists>x. P x

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
eventually ?P2 F \<Longrightarrow> \<exists>x. ?P2 x

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
eventually ?P2 F \<Longrightarrow> \<exists>x. ?P2 x

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
have "f (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P)) =
    Inf (f ` (\<lambda>P. Inf (g ` Collect P)) ` {P. eventually P F})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P)) = Inf (f ` (\<lambda>P. Inf (g ` Collect P)) ` {P. eventually P F})
[PROOF STEP]
using am continuous_on_imp_continuous_within [OF c]
[PROOF STATE]
proof (prove)
using this:
antimono f
\<lbrakk>?t \<subseteq> UNIV; ?x \<in> UNIV\<rbrakk> \<Longrightarrow> continuous (at ?x within ?t) f

goal (1 subgoal):
 1. f (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P)) = Inf (f ` (\<lambda>P. Inf (g ` Collect P)) ` {P. eventually P F})
[PROOF STEP]
by (rule continuous_at_Sup_antimono) (auto intro: eventually_True)
[PROOF STATE]
proof (state)
this:
f (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P)) = Inf (f ` (\<lambda>P. Inf (g ` Collect P)) ` {P. eventually P F})

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P)) = Inf (f ` (\<lambda>P. Inf (g ` Collect P)) ` {P. eventually P F})
[PROOF STEP]
have "f (Liminf F g) = (INF P \<in> {P. eventually P F}. f (Inf (g ` Collect P)))"
[PROOF STATE]
proof (prove)
using this:
f (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P)) = Inf (f ` (\<lambda>P. Inf (g ` Collect P)) ` {P. eventually P F})

goal (1 subgoal):
 1. f (Liminf F g) = (INF P\<in>{P. eventually P F}. f (Inf (g ` Collect P)))
[PROOF STEP]
by (simp add: Liminf_def image_comp)
[PROOF STATE]
proof (state)
this:
f (Liminf F g) = (INF P\<in>{P. eventually P F}. f (Inf (g ` Collect P)))

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (Liminf F g) = (INF P\<in>{P. eventually P F}. f (Inf (g ` Collect P)))

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
have "\<dots> = (INF P \<in> {P. eventually P F}. Sup (f ` (g ` Collect P)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF P\<in>{P. eventually P F}. f (Inf (g ` Collect P))) = (INF P\<in>{P. eventually P F}. Sup (f ` g ` Collect P))
[PROOF STEP]
using * continuous_at_Inf_antimono [OF am continuous_on_imp_continuous_within [OF c]]
[PROOF STATE]
proof (prove)
using this:
eventually ?P2 F \<Longrightarrow> \<exists>x. ?P2 x
\<lbrakk>{Inf ?S<..} \<subseteq> UNIV; Inf ?S \<in> UNIV; ?S \<noteq> {}; bdd_below ?S\<rbrakk> \<Longrightarrow> f (Inf ?S) = Sup (f ` ?S)

goal (1 subgoal):
 1. (INF P\<in>{P. eventually P F}. f (Inf (g ` Collect P))) = (INF P\<in>{P. eventually P F}. Sup (f ` g ` Collect P))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(INF P\<in>{P. eventually P F}. f (Inf (g ` Collect P))) = (INF P\<in>{P. eventually P F}. Sup (f ` g ` Collect P))

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (Liminf F g) = (INF P\<in>{P. eventually P F}. Sup (f ` g ` Collect P))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (Liminf F g) = (INF P\<in>{P. eventually P F}. Sup (f ` g ` Collect P))

goal (1 subgoal):
 1. Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)
[PROOF STEP]
by (auto simp: Limsup_def image_comp)
[PROOF STATE]
proof (state)
this:
Limsup F (\<lambda>n. f (g n)) = f (Liminf F g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_real_abs [simp]: "cosh (abs x :: real) = cosh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cosh \<bar>x\<bar> = cosh x
[PROOF STEP]
by (simp add: abs_if)


[STATEMENT]
lemma subterms_finite[simp]: "finite (subterms t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subterms t)
[PROOF STEP]
by (induction rule: subterms.induct) auto


[STATEMENT]
lemma card_le_leq_0:
  \<open>card {i::nat. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
have \<open>{i::nat. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
have \<open>{i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
have \<open>finite {i. i < n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i < n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {i. i < n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {i. i < n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
have \<open>finite {i. i = n \<and> P i}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {i. i = n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {i. i = n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}
{i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}
finite {i. i < n \<and> P i}
finite {i. i = n \<and> P i}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}
{i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}
finite {i. i < n \<and> P i}
finite {i. i = n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
using card_Un_disjoint[of \<open>{i. i < n \<and> P i}\<close> \<open>{i. i = n \<and> P i}\<close>]
[PROOF STATE]
proof (prove)
using this:
{i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}
{i. i < n \<and> P i} \<union> {i. i = n \<and> P i} = {i. i \<le> n \<and> P i}
finite {i. i < n \<and> P i}
finite {i. i = n \<and> P i}
\<lbrakk>finite {i. i < n \<and> P i}; finite {i. i = n \<and> P i}; {i. i < n \<and> P i} \<inter> {i. i = n \<and> P i} = {}\<rbrakk> \<Longrightarrow> card ({i. i < n \<and> P i} \<union> {i. i = n \<and> P i}) = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}

goal (1 subgoal):
 1. card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {i. i \<le> n \<and> P i} = card {i. i < n \<and> P i} + card {i. i = n \<and> P i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma base_in_grid: assumes p_grid: "p \<in> sparsegrid' dm" shows "base ds p \<in> grid (start dm) {0..<dm}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
let ?ds = "ds \<union> {0..<dm}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
have ds_eq: "{ d \<in> ?ds. d < length (start dm) } = { 0..< dm}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {d \<in> ds \<union> {0..<dm}. d < length (start dm)} = {0..<dm}
[PROOF STEP]
unfolding start_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {d \<in> ds \<union> {0..<dm}. d < length (replicate dm (0, 1))} = {0..<dm}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{d \<in> ds \<union> {0..<dm}. d < length (start dm)} = {0..<dm}

goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
have "base ds p \<in> grid (start dm) ?ds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. base ds p \<in> grid (start dm) (ds \<union> {0..<dm})
[PROOF STEP]
using grid_union_dims[OF _ baseE(1)[OF p_grid, where ds=ds], where ds'="?ds"]
[PROOF STATE]
proof (prove)
using this:
{0..<dm} - ds \<subseteq> ds \<union> {0..<dm} \<Longrightarrow> base ds p \<in> grid (start dm) (ds \<union> {0..<dm})

goal (1 subgoal):
 1. base ds p \<in> grid (start dm) (ds \<union> {0..<dm})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
base ds p \<in> grid (start dm) (ds \<union> {0..<dm})

goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
base ds p \<in> grid (start dm) (ds \<union> {0..<dm})

goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
using grid_dim_remove_outer[where b="start dm" and ds="?ds"]
[PROOF STATE]
proof (prove)
using this:
base ds p \<in> grid (start dm) (ds \<union> {0..<dm})
grid (start dm) (ds \<union> {0..<dm}) = grid (start dm) {d \<in> ds \<union> {0..<dm}. d < length (start dm)}

goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
unfolding ds_eq
[PROOF STATE]
proof (prove)
using this:
base ds p \<in> grid (start dm) (ds \<union> {0..<dm})
grid (start dm) (ds \<union> {0..<dm}) = grid (start dm) {0..<dm}

goal (1 subgoal):
 1. base ds p \<in> grid (start dm) {0..<dm}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
base ds p \<in> grid (start dm) {0..<dm}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma binA_neq_cases: assumes neq: "a \<noteq> b"
  obtains "a = bin0" and "b = bin1" | "a = bin1" and "b = bin0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>a = bin0; b = bin1\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>a = bin1; b = bin0\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using alphabet_or_neq assms
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> ?y \<Longrightarrow> ?x = ?a \<or> ?y = ?a
a \<noteq> b

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>a = bin0; b = bin1\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>a = bin1; b = bin0\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma truncate_up_nonpos: "x \<le> 0 \<Longrightarrow> truncate_up prec x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> 0 \<Longrightarrow> truncate_up prec x \<le> 0
[PROOF STEP]
by (auto simp: truncate_up_def round_up_def intro!: mult_nonpos_nonneg)


[STATEMENT]
lemma map_to_set_empty_iff: "map_to_set m = {} \<longleftrightarrow> m = Map.empty"
                            "{} = map_to_set m \<longleftrightarrow> m = Map.empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_to_set m = {}) = (m = Map.empty) &&& ({} = map_to_set m) = (m = Map.empty)
[PROOF STEP]
unfolding map_to_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({(k, v). m k = Some v} = {}) = (m = Map.empty) &&& ({} = {(k, v). m k = Some v}) = (m = Map.empty)
[PROOF STEP]
by auto


[STATEMENT]
lemma drop_zero_ms_aux:
  assumes "eventually (\<lambda>x. eval C x = 0) at_top"
  assumes "is_expansion_aux (MSLCons (C, e) xs) f basis"
  shows   "is_expansion_aux xs f basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion_aux xs f basis
[PROOF STEP]
proof (rule is_expansion_aux_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_expansion_aux xs ?f basis
 2. \<forall>\<^sub>F x in at_top. ?f x = f x
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
is_expansion_aux (MSLCons (C, e) xs) f basis
[PROOF STEP]
show "is_expansion_aux xs (\<lambda>x. f x - eval C x * hd basis x powr e) basis"
[PROOF STATE]
proof (prove)
using this:
is_expansion_aux (MSLCons (C, e) xs) f basis

goal (1 subgoal):
 1. is_expansion_aux xs (\<lambda>x. f x - eval C x * hd basis x powr e) basis
[PROOF STEP]
by (auto elim: is_expansion_aux_MSLCons)
[PROOF STATE]
proof (state)
this:
is_expansion_aux xs (\<lambda>x. f x - eval C x * hd basis x powr e) basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x - eval C x * hd basis x powr e = f x
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. eval C x = 0
[PROOF STEP]
show "eventually (\<lambda>x. f x - eval C x * hd basis x powr e = f x) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. eval C x = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x - eval C x * hd basis x powr e = f x
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. f x - eval C x * hd basis x powr e = f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_mset_ge0:"(\<And> x . f x \<ge> 0) \<Longrightarrow> (\<Sum> x \<in># A. f x ) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A)
[PROOF STEP]
proof (induction A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f {#})
 2. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> f ?x1

goal (2 subgoals):
 1. (\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f {#})
 2. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> f ?x1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> f ?x1

goal (1 subgoal):
 1. (0::'a) \<le> \<Sum>\<^sub># (image_mset f {#})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> \<Sum>\<^sub># (image_mset f {#})

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
case (add x A)
[PROOF STATE]
proof (state)
this:
(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A)
(0::'a) \<le> f ?x1

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A)
(0::'a) \<le> f ?x1
[PROOF STEP]
have hyp2: "0 \<le> sum_mset (image_mset f A)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A)
(0::'a) \<le> f ?x1

goal (1 subgoal):
 1. (0::'a) \<le> \<Sum>\<^sub># (image_mset f A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> \<Sum>\<^sub># (image_mset f A)

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> \<Sum>\<^sub># (image_mset f A)
[PROOF STEP]
have " sum_mset (image_mset f (add_mset x A)) =  sum_mset (image_mset f  A) + f x"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> \<Sum>\<^sub># (image_mset f A)

goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f (add_mset x A)) = \<Sum>\<^sub># (image_mset f A) + f x
[PROOF STEP]
by (simp add: add_commute)
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f (add_mset x A)) = \<Sum>\<^sub># (image_mset f A) + f x

goal (1 subgoal):
 1. \<And>x A. \<lbrakk>(\<And>x. (0::'a) \<le> f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f A); \<And>x. (0::'a) \<le> f x\<rbrakk> \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Sum>\<^sub># (image_mset f (add_mset x A)) = \<Sum>\<^sub># (image_mset f A) + f x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<Sum>\<^sub># (image_mset f (add_mset x A)) = \<Sum>\<^sub># (image_mset f A) + f x

goal (1 subgoal):
 1. (0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))
[PROOF STEP]
by (simp add: add.IH add.prems)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> \<Sum>\<^sub># (image_mset f (add_mset x A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_ordered_subset: "B \<subseteq> A \<Longrightarrow> strict_ordered_set B (\<sqsubset>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> strict_ordered_set B (\<sqsubset>)
[PROOF STEP]
apply intro_locales
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. B \<subseteq> A \<Longrightarrow> irreflexive B (\<sqsubset>)
 2. B \<subseteq> A \<Longrightarrow> transitive B (\<sqsubset>)
[PROOF STEP]
using irreflexive_subset transitive_subset
[PROOF STATE]
proof (prove)
using this:
?B \<subseteq> A \<Longrightarrow> irreflexive ?B (\<sqsubset>)
?B \<subseteq> A \<Longrightarrow> transitive ?B (\<sqsubset>)

goal (2 subgoals):
 1. B \<subseteq> A \<Longrightarrow> irreflexive B (\<sqsubset>)
 2. B \<subseteq> A \<Longrightarrow> transitive B (\<sqsubset>)
[PROOF STEP]
by auto


[STATEMENT]
lemma vfieldD[dest]:
  assumes "\<langle>r, s\<rangle> \<in>\<^sub>\<circ> vfield A"
  shows "r \<in>\<^sub>\<circ> A" and "s = \<F>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = \<F>\<^sub>\<circ> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<langle>r, s\<rangle> \<in>\<^sub>\<circ> vfield A

goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = \<F>\<^sub>\<circ> r
[PROOF STEP]
unfolding vfield_def
[PROOF STATE]
proof (prove)
using this:
\<langle>r, s\<rangle> \<in>\<^sub>\<circ> (\<lambda>r\<in>\<^sub>\<circ>A. \<D>\<^sub>\<circ> r \<union>\<^sub>\<circ> \<R>\<^sub>\<circ> r)

goal (1 subgoal):
 1. r \<in>\<^sub>\<circ> A &&& s = (\<lambda>r\<in>\<^sub>\<circ>set {r}. \<D>\<^sub>\<circ> r \<union>\<^sub>\<circ> \<R>\<^sub>\<circ> r)\<lparr>r\<rparr>
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_eq_permutation:
  fixes xs ys :: "'a list"
  assumes mset_eq: "mset xs = mset ys"
  obtains p where "p permutes {..<length ys}" "permute_list p ys = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from mset_eq
[PROOF STATE]
proof (chain)
picking this:
mset xs = mset ys
[PROOF STEP]
have length_eq: "length xs = length ys"
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys

goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
by (rule mset_eq_length)
[PROOF STATE]
proof (state)
this:
length xs = length ys

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "mset_set {..<length ys} = mset [0..<length ys]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set {..<length ys} = mset [0..<length ys]
[PROOF STEP]
by (rule mset_set_upto_eq_mset_upto)
[PROOF STATE]
proof (state)
this:
mset_set {..<length ys} = mset [0..<length ys]

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with mset_eq length_eq
[PROOF STATE]
proof (chain)
picking this:
mset xs = mset ys
length xs = length ys
mset_set {..<length ys} = mset [0..<length ys]
[PROOF STEP]
have "image_mset (\<lambda>i. xs ! i) (mset_set {..<length ys}) =
    image_mset (\<lambda>i. ys ! i) (mset_set {..<length ys})"
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys
length xs = length ys
mset_set {..<length ys} = mset [0..<length ys]

goal (1 subgoal):
 1. image_mset ((!) xs) (mset_set {..<length ys}) = image_mset ((!) ys) (mset_set {..<length ys})
[PROOF STEP]
by (metis map_nth mset_map)
[PROOF STATE]
proof (state)
this:
image_mset ((!) xs) (mset_set {..<length ys}) = image_mset ((!) ys) (mset_set {..<length ys})

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from image_mset_eq_implies_permutes[OF _ this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite {..<length ys}; \<And>p. \<lbrakk>p permutes {..<length ys}; \<forall>x\<in>{..<length ys}. xs ! x = ys ! p x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
obtain p where p: "p permutes {..<length ys}" and "\<forall>i\<in>{..<length ys}. xs ! i = ys ! (p i)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {..<length ys}; \<And>p. \<lbrakk>p permutes {..<length ys}; \<forall>x\<in>{..<length ys}. xs ! x = ys ! p x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; \<forall>i\<in>{..<length ys}. xs ! i = ys ! p i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p permutes {..<length ys}
\<forall>i\<in>{..<length ys}. xs ! i = ys ! p i

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with length_eq
[PROOF STATE]
proof (chain)
picking this:
length xs = length ys
p permutes {..<length ys}
\<forall>i\<in>{..<length ys}. xs ! i = ys ! p i
[PROOF STEP]
have "permute_list p ys = xs"
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
p permutes {..<length ys}
\<forall>i\<in>{..<length ys}. xs ! i = ys ! p i

goal (1 subgoal):
 1. permute_list p ys = xs
[PROOF STEP]
by (auto intro!: nth_equalityI simp: permute_list_nth)
[PROOF STATE]
proof (state)
this:
permute_list p ys = xs

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
p permutes {..<length ys}
permute_list p ys = xs
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
p permutes {..<length ys}
permute_list p ys = xs

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cinner_canonical_basis_eq:
  defines "basisA == set (canonical_basis::'a::onb_enum list)"
    and   "basisB == set (canonical_basis::'b::onb_enum list)"
  assumes "\<And>u v. u\<in>basisA \<Longrightarrow> v\<in>basisB \<Longrightarrow> v \<bullet>\<^sub>C (F *\<^sub>V u) = v \<bullet>\<^sub>C (G *\<^sub>V u)"
  shows "F = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = G
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F = G
[PROOF STEP]
define H where "H = F - G"
[PROOF STATE]
proof (state)
this:
H = F - G

goal (1 subgoal):
 1. F = G
[PROOF STEP]
have "\<And>u v. u\<in>basisA \<Longrightarrow> v\<in>basisB \<Longrightarrow> is_orthogonal v (H *\<^sub>V u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>u \<in> basisA; v \<in> basisB\<rbrakk> \<Longrightarrow> is_orthogonal v (H *\<^sub>V u)
[PROOF STEP]
unfolding H_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u v. \<lbrakk>u \<in> basisA; v \<in> basisB\<rbrakk> \<Longrightarrow> is_orthogonal v ((F - G) *\<^sub>V u)
[PROOF STEP]
by (simp add: assms(3) cinner_diff_right minus_cblinfun.rep_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?u \<in> basisA; ?v \<in> basisB\<rbrakk> \<Longrightarrow> is_orthogonal ?v (H *\<^sub>V ?u)

goal (1 subgoal):
 1. F = G
[PROOF STEP]
hence "H = 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<in> basisA; ?v \<in> basisB\<rbrakk> \<Longrightarrow> is_orthogonal ?v (H *\<^sub>V ?u)

goal (1 subgoal):
 1. H = 0
[PROOF STEP]
by (simp add: basisA_def basisB_def cinner_canonical_basis_eq_0)
[PROOF STATE]
proof (state)
this:
H = 0

goal (1 subgoal):
 1. F = G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
H = 0

goal (1 subgoal):
 1. F = G
[PROOF STEP]
unfolding H_def
[PROOF STATE]
proof (prove)
using this:
F - G = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_zero_eq':
  assumes A: "A = {} \<or> A = {0}"
  shows "dim A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim A = 0
[PROOF STEP]
using assms local.dim_span local.indep_card_eq_dim_span local.independent_empty
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> A = {0::'b}
local.dim (local.span ?S) = local.dim ?S
local.independent ?B \<Longrightarrow> finite ?B \<and> card ?B = local.dim (local.span ?B)
local.independent {}

goal (1 subgoal):
 1. local.dim A = 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma nonempty_path_components_of:
  assumes "C \<in> path_components_of X" shows "C \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<noteq> {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C \<noteq> {}
[PROOF STEP]
have "C \<in> path_component_of_set X ` topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<in> path_component_of_set X ` topspace X
[PROOF STEP]
using assms path_components_of_def
[PROOF STATE]
proof (prove)
using this:
C \<in> path_components_of X
path_components_of ?X \<equiv> path_component_of_set ?X ` topspace ?X

goal (1 subgoal):
 1. C \<in> path_component_of_set X ` topspace X
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
C \<in> path_component_of_set X ` topspace X

goal (1 subgoal):
 1. C \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C \<in> path_component_of_set X ` topspace X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C \<in> path_component_of_set X ` topspace X

goal (1 subgoal):
 1. C \<noteq> {}
[PROOF STEP]
using path_component_of_refl
[PROOF STATE]
proof (prove)
using this:
C \<in> path_component_of_set X ` topspace X
path_component_of ?X ?x ?x = (?x \<in> topspace ?X)

goal (1 subgoal):
 1. C \<noteq> {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
C \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_pos:
  assumes "n \<noteq> 0"
  shows   "N n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
have "0 < 1 / q ^ (nat \<bar>n\<bar>+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / q ^ (nat \<bar>n\<bar> + 1)
[PROOF STEP]
using q_gt_1
[PROOF STATE]
proof (prove)
using this:
1 < q

goal (1 subgoal):
 1. 0 < 1 / q ^ (nat \<bar>n\<bar> + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / q ^ (nat \<bar>n\<bar> + 1)

goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < 1 / q ^ (nat \<bar>n\<bar> + 1)

goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
have "\<not>1 + \<bar>n\<bar> dvd \<bar>n\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 1 + \<bar>n\<bar> dvd \<bar>n\<bar>
[PROOF STEP]
using zdvd_imp_le[of "1 + \<bar>n\<bar>" "\<bar>n\<bar>"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 + \<bar>n\<bar> dvd \<bar>n\<bar>; 0 < \<bar>n\<bar>\<rbrakk> \<Longrightarrow> 1 + \<bar>n\<bar> \<le> \<bar>n\<bar>
n \<noteq> 0

goal (1 subgoal):
 1. \<not> 1 + \<bar>n\<bar> dvd \<bar>n\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> 1 + \<bar>n\<bar> dvd \<bar>n\<bar>

goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
hence "1 / q ^ (nat \<bar>n\<bar>+1) \<le> N n"
[PROOF STATE]
proof (prove)
using this:
\<not> 1 + \<bar>n\<bar> dvd \<bar>n\<bar>

goal (1 subgoal):
 1. 1 / q ^ (nat \<bar>n\<bar> + 1) \<le> N n
[PROOF STEP]
by (intro not_dvd_imp_N_ge) (use assms in auto)
[PROOF STATE]
proof (state)
this:
1 / q ^ (nat \<bar>n\<bar> + 1) \<le> N n

goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < N n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < N n

goal (1 subgoal):
 1. 0 < N n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < N n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_on_superset:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::banach"
  assumes f: "(f has_integral i) S"
      and "\<And>x. x \<notin> S \<Longrightarrow> f x = 0"
      and "S \<subseteq> T"
    shows "(f has_integral i) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral i) T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral i) T
[PROOF STEP]
have "(\<lambda>x. if x \<in> S then f x else 0) = (\<lambda>x. if x \<in> T then f x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<in> S then f x else (0::'a)) = (\<lambda>x. if x \<in> T then f x else (0::'a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_integral i) S
?x \<notin> S \<Longrightarrow> f ?x = (0::'a)
S \<subseteq> T

goal (1 subgoal):
 1. (\<lambda>x. if x \<in> S then f x else (0::'a)) = (\<lambda>x. if x \<in> T then f x else (0::'a))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> S then f x else (0::'a)) = (\<lambda>x. if x \<in> T then f x else (0::'a))

goal (1 subgoal):
 1. (f has_integral i) T
[PROOF STEP]
with f
[PROOF STATE]
proof (chain)
picking this:
(f has_integral i) S
(\<lambda>x. if x \<in> S then f x else (0::'a)) = (\<lambda>x. if x \<in> T then f x else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f has_integral i) S
(\<lambda>x. if x \<in> S then f x else (0::'a)) = (\<lambda>x. if x \<in> T then f x else (0::'a))

goal (1 subgoal):
 1. (f has_integral i) T
[PROOF STEP]
by (simp only: has_integral_restrict_UNIV [symmetric, of f])
[PROOF STATE]
proof (state)
this:
(f has_integral i) T

goal:
No subgoals!
[PROOF STEP]
qed