[STATEMENT]
lemma finite_set_of_finite_maps:
  fixes A :: "'a set"
    and B :: "'b set"
  assumes "finite A"
    and "finite B"
  shows "finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}
[PROOF STEP]
have "{m. dom m \<subseteq> A \<and> ran m \<subseteq> B} \<subseteq> (\<Union> S \<in> {S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. dom m \<subseteq> A \<and> ran m \<subseteq> B} \<subseteq> (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{m. dom m \<subseteq> A \<and> ran m \<subseteq> B} \<subseteq> (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})

goal (1 subgoal):
 1. finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{m. dom m \<subseteq> A \<and> ran m \<subseteq> B} \<subseteq> (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})

goal (1 subgoal):
 1. finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}
[PROOF STEP]
have "finite \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. finite (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})
[PROOF STEP]
by (auto intro!: finite_set_of_finite_maps intro: finite_subset)
[PROOF STATE]
proof (state)
this:
finite (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})

goal (1 subgoal):
 1. finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{m. dom m \<subseteq> A \<and> ran m \<subseteq> B} \<subseteq> (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})
finite (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{m. dom m \<subseteq> A \<and> ran m \<subseteq> B} \<subseteq> (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})
finite (\<Union>S\<in>{S. S \<subseteq> A}. {m. dom m = S \<and> ran m \<subseteq> B})

goal (1 subgoal):
 1. finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite {m. dom m \<subseteq> A \<and> ran m \<subseteq> B}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stirling_limit_aux1:
  "((\<lambda>y. Ln (1 + z * of_real y) / of_real y) \<longlongrightarrow> z) (at_right 0)" for z :: complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
proof (cases "z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
 2. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z = 0

goal (2 subgoals):
 1. z = 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
 2. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z = 0

goal (1 subgoal):
 1. ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> 0

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
have "((\<lambda>y. ln (1 + z * of_real y)) has_vector_derivative 1 * z) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. Ln (1 + z * complex_of_real y)) has_vector_derivative 1 * z) (at 0)
[PROOF STEP]
by (rule has_vector_derivative_real_field) (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. Ln (1 + z * complex_of_real y)) has_vector_derivative 1 * z) (at 0)

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>y. Ln (1 + z * complex_of_real y)) has_vector_derivative 1 * z) (at 0)
[PROOF STEP]
have "(\<lambda>y. (Ln (1 + z * of_real y) - of_real y * z) / of_real \<bar>y\<bar>) \<midarrow>0\<rightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>y. Ln (1 + z * complex_of_real y)) has_vector_derivative 1 * z) (at 0)

goal (1 subgoal):
 1. (\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<midarrow>0\<rightarrow> 0
[PROOF STEP]
by (auto simp add: has_vector_derivative_def has_derivative_def netlimit_at
          scaleR_conv_of_real field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<midarrow>0\<rightarrow> 0

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<midarrow>0\<rightarrow> 0
[PROOF STEP]
have "((\<lambda>y. (Ln (1 + z * of_real y) - of_real y * z) / of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<midarrow>0\<rightarrow> 0

goal (1 subgoal):
 1. ((\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
by (rule filterlim_mono[OF _ _ at_le]) simp_all
[PROOF STATE]
proof (state)
this:
((\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0)

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0)

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
have "?this \<longleftrightarrow> ((\<lambda>y. Ln (1 + z * of_real y) / (of_real y) - z) \<longlongrightarrow> 0) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0) = ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y - z) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
using eventually_at_right_less[of "0::real"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) (at_right 0)

goal (1 subgoal):
 1. ((\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0) = ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y - z) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
by (intro filterlim_cong refl) (auto elim!: eventually_mono simp: field_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. (Ln (1 + z * complex_of_real y) - complex_of_real y * z) / complex_of_real \<bar>y\<bar>) \<longlongrightarrow> 0) (at_right 0) = ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y - z) \<longlongrightarrow> 0) (at_right 0)

goal (1 subgoal):
 1. z \<noteq> 0 \<Longrightarrow> ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y - z) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y - z) \<longlongrightarrow> 0) (at_right 0)

goal (1 subgoal):
 1. ((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)
[PROOF STEP]
by (simp only: LIM_zero_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. Ln (1 + z * complex_of_real y) / complex_of_real y) \<longlongrightarrow> z) (at_right 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_eq_zero_iff:
  assumes "summable f" and pos: "\<And>n. 0 \<le> f n"
  shows "suminf f = 0 \<longleftrightarrow> (\<forall>n. f n = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (suminf f = (0::'a)) = (\<forall>n. f n = (0::'a))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. suminf f = (0::'a) \<Longrightarrow> \<forall>n. f n = (0::'a)
 2. \<forall>n. f n = (0::'a) \<Longrightarrow> suminf f = (0::'a)
[PROOF STEP]
assume L: "suminf f = 0"
[PROOF STATE]
proof (state)
this:
suminf f = (0::'a)

goal (2 subgoals):
 1. suminf f = (0::'a) \<Longrightarrow> \<forall>n. f n = (0::'a)
 2. \<forall>n. f n = (0::'a) \<Longrightarrow> suminf f = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
suminf f = (0::'a)
[PROOF STEP]
have f: "(\<lambda>n. \<Sum>i<n. f i) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
suminf f = (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
using summable_LIMSEQ[of f] assms
[PROOF STATE]
proof (prove)
using this:
suminf f = (0::'a)
summable f \<Longrightarrow> (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> suminf f
summable f
(0::'a) \<le> f ?n

goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (0::'a)

goal (2 subgoals):
 1. suminf f = (0::'a) \<Longrightarrow> \<forall>n. f n = (0::'a)
 2. \<forall>n. f n = (0::'a) \<Longrightarrow> suminf f = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
have "\<And>i. (\<Sum>n\<in>{i}. f n) \<le> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> (0::'a)

goal (1 subgoal):
 1. \<And>i. sum f {i} \<le> (0::'a)
[PROOF STEP]
by (metis L \<open>summable f\<close> order_refl pos sum.infinite sum_le_suminf)
[PROOF STATE]
proof (state)
this:
sum f {?i} \<le> (0::'a)

goal (2 subgoals):
 1. suminf f = (0::'a) \<Longrightarrow> \<forall>n. f n = (0::'a)
 2. \<forall>n. f n = (0::'a) \<Longrightarrow> suminf f = (0::'a)
[PROOF STEP]
with pos
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> f ?n
sum f {?i} \<le> (0::'a)
[PROOF STEP]
show "\<forall>n. f n = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> f ?n
sum f {?i} \<le> (0::'a)

goal (1 subgoal):
 1. \<forall>n. f n = (0::'a)
[PROOF STEP]
by (simp add: order.antisym)
[PROOF STATE]
proof (state)
this:
\<forall>n. f n = (0::'a)

goal (1 subgoal):
 1. \<forall>n. f n = (0::'a) \<Longrightarrow> suminf f = (0::'a)
[PROOF STEP]
qed (metis suminf_zero fun_eq_iff)


[STATEMENT]
lemma poly_Bernstein_nonneg:
  assumes "x \<ge> 0" and "1 \<ge> x"
  shows "poly (Bernstein_Poly_01 j p) x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> poly (Bernstein_Poly_01 j p) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x \<le> 1

goal (1 subgoal):
 1. 0 \<le> poly (Bernstein_Poly_01 j p) x
[PROOF STEP]
by (simp add: poly_monom poly_pcompose Bernstein_Poly_01_def)


[STATEMENT]
lemma expected_utility_strict_preference:
  assumes "p \<in> lotteries_on outcomes"
    and "q \<in> lotteries_on outcomes"
  shows   "p \<succ>[relation] q \<longleftrightarrow> measure_pmf.expectation p u > measure_pmf.expectation q u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<succeq> q \<and> (q, p) \<notin> relation) = (measure_pmf.expectation q u < measure_pmf.expectation p u)
[PROOF STEP]
using assms expected_utility_weak_preference less_eq_real_def not_le
[PROOF STATE]
proof (prove)
using this:
p \<in> \<P> outcomes
q \<in> \<P> outcomes
\<lbrakk>?p \<in> \<P> outcomes; ?q \<in> \<P> outcomes\<rbrakk> \<Longrightarrow> ?p \<succeq> ?q = ((\<Sum>z\<in>outcomes. pmf ?q z * u z) \<le> (\<Sum>z\<in>outcomes. pmf ?p z * u z))
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. (p \<succeq> q \<and> (q, p) \<notin> relation) = (measure_pmf.expectation q u < measure_pmf.expectation p u)
[PROOF STEP]
by (metis (no_types, lifting) util_def_conf)


[STATEMENT]
lemma (in prime_number_theorem) primes_omega_primorial'_asymp_equiv:
  "(\<lambda>k. primes_omega (primorial' k)) \<sim>[at_top]
     (\<lambda>k. ln (primorial' k) / ln (ln (primorial' k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (primes_omega (primorial' x))) \<sim>[sequentially] (\<lambda>k. ln (real (primorial' k)) / ln (ln (real (primorial' k))))
[PROOF STEP]
using ln_over_ln_ln_primorial'_asymp_equiv
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. ln (real (primorial' k)) / ln (ln (real (primorial' k)))) \<sim>[sequentially] real

goal (1 subgoal):
 1. (\<lambda>x. real (primes_omega (primorial' x))) \<sim>[sequentially] (\<lambda>k. ln (real (primorial' k)) / ln (ln (real (primorial' k))))
[PROOF STEP]
by (simp add: asymp_equiv_sym)


[STATEMENT]
lemma finite_distrib_lattice_complete_inf_Sup:
  "inf (x::'a::finite_distrib_lattice_complete) (Sup A) = (SUP y\<in>A. inf x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf x (Sup A) = Sup (inf x ` A)
[PROOF STEP]
using finite [of A]
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. inf x (Sup A) = Sup (inf x ` A)
[PROOF STEP]
by induct (simp_all add: inf_sup_distrib1)


[STATEMENT]
lemma infinite_Pow:
assumes "\<not> finite A"
shows "\<not> finite (Pow A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (Pow A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (Pow A)
[PROOF STEP]
have "|A| \<le>o |Pow A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |Pow A|
[PROOF STEP]
by (metis card_of_Pow ordLess_imp_ordLeq)
[PROOF STATE]
proof (state)
this:
|A| \<le>o |Pow A|

goal (1 subgoal):
 1. infinite (Pow A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
|A| \<le>o |Pow A|

goal (1 subgoal):
 1. infinite (Pow A)
[PROOF STEP]
by (metis assms finite_Pow_iff)
[PROOF STATE]
proof (state)
this:
infinite (Pow A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_slice2_length: "
  length (list_slice2 xs k) = (
  if length xs mod k = 0 then length xs div k else Suc (length xs div k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_slice2 xs k) = (if length xs mod k = 0 then length xs div k else Suc (length xs div k))
[PROOF STEP]
by (simp add: list_slice2_def list_slice_length)


[STATEMENT]
lemma sum_const: "(\<Sum>i=0..<(x::nat). (c::('a::prime_card) mod_ring)) = (of_int_mod_ring x) * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<x. c) = of_int_mod_ring (int x) * c
[PROOF STEP]
by(induction x, simp add: algebra_simps,  simp add: algebra_simps)
    (metis distrib_left mult.right_neutral of_int_of_int_mod_ring of_int_of_nat_eq of_nat_Suc)


[STATEMENT]
lemma has_derivative_iff_norm:
  "(f has_derivative f') (at x within s) \<longleftrightarrow>
    bounded_linear f' \<and> ((\<lambda>y. norm ((f y - f x) - f' (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at x within s) = (bounded_linear f' \<and> ((\<lambda>y. norm (f y - f x - f' (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within s))
[PROOF STEP]
using tendsto_norm_zero_iff[of _ "at x within s", where 'b="'b", symmetric]
[PROOF STATE]
proof (prove)
using this:
(?f \<longlongrightarrow> (0::'b)) (at x within s) = ((\<lambda>x. norm (?f x)) \<longlongrightarrow> 0) (at x within s)

goal (1 subgoal):
 1. (f has_derivative f') (at x within s) = (bounded_linear f' \<and> ((\<lambda>y. norm (f y - f x - f' (y - x)) / norm (y - x)) \<longlongrightarrow> 0) (at x within s))
[PROOF STEP]
by (simp add: has_derivative_at_within divide_inverse ac_simps)


[STATEMENT]
lemma integral_const [simp]:
  fixes a b :: "'a::euclidean_space"
  shows "integral (cbox a b) (\<lambda>x. c) = content (cbox a b) *\<^sub>R c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox a b) (\<lambda>x. c) = content (cbox a b) *\<^sub>R c
[PROOF STEP]
by (rule integral_unique) (rule has_integral_const)


[STATEMENT]
lemma diagonal_is_algebraic:
  shows "is_algebraic R (n + n) (diagonal n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_algebraic R (n + n) (diagonal n)
[PROOF STEP]
apply(rule is_algebraicI[of "diag_def_poly_set n"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (diag_def_poly_set n)
 2. diag_def_poly_set n \<subseteq> carrier (R [\<X>\<^bsub>n + n\<^esub>])
 3. diagonal n = affine_alg_set R (n + n) (diag_def_poly_set n)
[PROOF STEP]
apply (simp add: diag_def_poly_set_finite)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. diag_def_poly_set n \<subseteq> carrier (R [\<X>\<^bsub>n + n\<^esub>])
 2. diagonal n = affine_alg_set R (n + n) (diag_def_poly_set n)
[PROOF STEP]
using  diag_def_poly_set_in_coord_ring
[PROOF STATE]
proof (prove)
using this:
diag_def_poly_set ?n \<subseteq> carrier (R [\<X>\<^bsub>?n + ?n\<^esub>])

goal (2 subgoals):
 1. diag_def_poly_set n \<subseteq> carrier (R [\<X>\<^bsub>n + n\<^esub>])
 2. diagonal n = affine_alg_set R (n + n) (diag_def_poly_set n)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal n = affine_alg_set R (n + n) (diag_def_poly_set n)
[PROOF STEP]
by (simp add:  diagonal_as_affine_alg_set)


[STATEMENT]
lemma integral_abs_bound_integral:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes "integrable M f" "integrable M g" "\<And>x. x \<in> space M \<Longrightarrow> \<bar>f x\<bar> \<le> g x"
  shows "\<bar>\<integral>x. f x \<partial>M\<bar> \<le> (\<integral>x. g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>integral\<^sup>L M f\<bar> \<le> integral\<^sup>L M g
[PROOF STEP]
by (metis integral_norm_bound_integral assms real_norm_def)


[STATEMENT]
lemma IDFT_upper:
  assumes mbound: "0 < m" and ibound: "m <= i"
  shows "IDFT (2 * m) a i =
    IDFT m (%i. a (2 * i)) (i - m) -
    (1 / root (2 * m)) ^ (i - m) *
    IDFT m (%i. a (2 * i + 1)) (i - m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IDFT (2 * m) a i = IDFT m (\<lambda>i. a (2 * i)) (i - m) - (1 / FFT.root (2 * m)) ^ (i - m) * IDFT m (\<lambda>i. a (2 * i + 1)) (i - m)
[PROOF STEP]
proof (unfold IDFT_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k = 0..<2 * m. a k / FFT.root (2 * m) ^ (i * k)) = (\<Sum>k = 0..<m. a (2 * k) / FFT.root m ^ ((i - m) * k)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>k = 0..<m. a (2 * k + 1) / FFT.root m ^ ((i - m) * k))
[PROOF STEP]
have "(\<Sum>j = 0..<2 * m. a j / root (2 * m) ^ (i * j)) =
    (\<Sum>j = 0..<m. a (2 * j) / root (2 * m) ^ (i * (2 * j))) +
    (\<Sum>j = 0..<m. a (2 * j + 1) / root (2 * m) ^ (i * (2 * j + 1)))"
    (is "?s = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root (2 * m) ^ (i * (2 * j))) + (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root (2 * m) ^ (i * (2 * j + 1)))
[PROOF STEP]
by (simp add: sum_splice)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root (2 * m) ^ (i * (2 * j))) + (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root (2 * m) ^ (i * (2 * j + 1)))

goal (1 subgoal):
 1. (\<Sum>k = 0..<2 * m. a k / FFT.root (2 * m) ^ (i * k)) = (\<Sum>k = 0..<m. a (2 * k) / FFT.root m ^ ((i - m) * k)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>k = 0..<m. a (2 * k + 1) / FFT.root m ^ ((i - m) * k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root (2 * m) ^ (i * (2 * j))) + (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root (2 * m) ^ (i * (2 * j + 1)))

goal (1 subgoal):
 1. (\<Sum>k = 0..<2 * m. a k / FFT.root (2 * m) ^ (i * k)) = (\<Sum>k = 0..<m. a (2 * k) / FFT.root m ^ ((i - m) * k)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>k = 0..<m. a (2 * k + 1) / FFT.root m ^ ((i - m) * k))
[PROOF STEP]
have "... =
    (\<Sum>j = 0..<m. a (2 * j) / root m ^ ((i - m) * j)) -
    (1 / root (2 * m)) ^ (i - m) *
    (\<Sum>j = 0..<m. a (2 * j + 1) / root m ^ ((i - m) * j))"
    (is "_ = ?t")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (2 * j) / FFT.root (2 * m) ^ (i * (2 * j))) + (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root (2 * m) ^ (i * (2 * j + 1))) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))
[PROOF STEP]
txt \<open>First pair of sums\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (2 * j) / FFT.root (2 * m) ^ (i * (2 * j))) + (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root (2 * m) ^ (i * (2 * j + 1))) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))
[PROOF STEP]
apply (simp add: root_cancel1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ (i * j)) + (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root (2 * m) ^ (i + i * (2 * j))) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root m ^ ((i - m) * j))
[PROOF STEP]
apply (simp add: root_unity ibound root_nonzero power_diff power_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root (2 * m) ^ (i + i * (2 * j))) = - ((1 / FFT.root (2 * m)) ^ i * (\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root m ^ i) ^ j) / (1 / FFT.root (2 * m)) ^ m)
[PROOF STEP]
txt \<open>Second pair of sums\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root (2 * m) ^ (i + i * (2 * j))) = - ((1 / FFT.root (2 * m)) ^ i * (\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root m ^ i) ^ j) / (1 / FFT.root (2 * m)) ^ m)
[PROOF STEP]
apply (simp add: power_divide root_nonzero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root (2 * m) ^ (i + i * (2 * j))) = - ((\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root m ^ i) ^ j) * FFT.root (2 * m) ^ m / FFT.root (2 * m) ^ i)
[PROOF STEP]
apply (simp add: mbound root_cancel2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root (2 * m) ^ (i + i * (2 * j))) = (\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root m ^ i) ^ j) / FFT.root (2 * m) ^ i
[PROOF STEP]
apply (simp add: sum_divide_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / FFT.root (2 * m) ^ (i + i * (2 * j))) = (\<Sum>n = 0..<m. a (Suc (2 * n)) / ((FFT.root m ^ i) ^ n * FFT.root (2 * m) ^ i))
[PROOF STEP]
apply (simp add: power_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root (2 * m) ^ i * FFT.root (2 * m) ^ (i * (2 * j)))) = (\<Sum>n = 0..<m. a (Suc (2 * n)) / ((FFT.root m ^ i) ^ n * FFT.root (2 * m) ^ i))
[PROOF STEP]
apply (simp add: root_cancel1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root (2 * m) ^ i * FFT.root m ^ (i * j))) = (\<Sum>n = 0..<m. a (Suc (2 * n)) / ((FFT.root m ^ i) ^ n * FFT.root (2 * m) ^ i))
[PROOF STEP]
apply (simp add: power_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<m. a (Suc (2 * j)) / (FFT.root (2 * m) ^ i * (FFT.root m ^ i) ^ j)) = (\<Sum>n = 0..<m. a (Suc (2 * n)) / ((FFT.root m ^ i) ^ n * FFT.root (2 * m) ^ i))
[PROOF STEP]
apply (simp add: ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<m. a (2 * j) / FFT.root (2 * m) ^ (i * (2 * j))) + (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root (2 * m) ^ (i * (2 * j + 1))) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))

goal (1 subgoal):
 1. (\<Sum>k = 0..<2 * m. a k / FFT.root (2 * m) ^ (i * k)) = (\<Sum>k = 0..<m. a (2 * k) / FFT.root m ^ ((i - m) * k)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>k = 0..<m. a (2 * k + 1) / FFT.root m ^ ((i - m) * k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))
[PROOF STEP]
show "?s = ?t"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))

goal (1 subgoal):
 1. (\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<2 * m. a j / FFT.root (2 * m) ^ (i * j)) = (\<Sum>j = 0..<m. a (2 * j) / FFT.root m ^ ((i - m) * j)) - (1 / FFT.root (2 * m)) ^ (i - m) * (\<Sum>j = 0..<m. a (2 * j + 1) / FFT.root m ^ ((i - m) * j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ufa_find_correct: "\<lbrakk>ufa_invar l; x<length l; y<length l\<rbrakk>
  \<Longrightarrow> rep_of l x = rep_of l y \<longleftrightarrow> (x,y)\<in>ufa_\<alpha> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ufa_invar l; x < length l; y < length l\<rbrakk> \<Longrightarrow> (rep_of l x = rep_of l y) = ((x, y) \<in> ufa_\<alpha> l)
[PROOF STEP]
unfolding ufa_\<alpha>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ufa_invar l; x < length l; y < length l\<rbrakk> \<Longrightarrow> (rep_of l x = rep_of l y) = ((x, y) \<in> {(x, y). x < length l \<and> y < length l \<and> rep_of l x = rep_of l y})
[PROOF STEP]
by auto


[STATEMENT]
theorem (in group) subgroups_complete_lattice:
  "complete_lattice \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>"
    (is "complete_lattice ?L")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete_lattice \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
proof (rule partial_order.complete_lattice_criterion1)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. partial_order \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 2. \<exists>g. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> g (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
 3. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
show "partial_order ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partial_order \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
by (rule subgroups_partial_order)
[PROOF STATE]
proof (state)
this:
partial_order \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>

goal (2 subgoals):
 1. \<exists>g. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> g (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
 2. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>g. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> g (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
 2. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
have "greatest ?L (carrier G) (carrier ?L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (carrier G) (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
[PROOF STEP]
by (unfold greatest_def) (simp add: subgroup.subset subgroup_self)
[PROOF STATE]
proof (state)
this:
greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (carrier G) (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)

goal (2 subgoals):
 1. \<exists>g. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> g (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
 2. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (carrier G) (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
[PROOF STEP]
show "\<exists>G. greatest ?L G (carrier ?L)"
[PROOF STATE]
proof (prove)
using this:
greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (carrier G) (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)

goal (1 subgoal):
 1. \<exists>G. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> G (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>G. greatest \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> G (carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>)

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
assume L: "A \<subseteq> carrier ?L" and non_empty: "A \<noteq> {}"
[PROOF STATE]
proof (state)
this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
A \<noteq> {}

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
A \<noteq> {}
[PROOF STEP]
have Int_subgroup: "subgroup (\<Inter>A) G"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
A \<noteq> {}

goal (1 subgoal):
 1. subgroup (\<Inter> A) G
[PROOF STEP]
by (fastforce intro: subgroups_Inter)
[PROOF STATE]
proof (state)
this:
subgroup (\<Inter> A) G

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
have "greatest ?L (\<Inter>A) (Lower ?L A)" (is "greatest _ ?Int _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (\<Inter> A) A
[PROOF STEP]
proof (rule greatest_LowerI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
fix H
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
assume H: "H \<in> A"
[PROOF STATE]
proof (state)
this:
H \<in> A

goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
H \<in> A
[PROOF STEP]
have subgroupH: "subgroup H G"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
H \<in> A

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

goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
from subgroupH
[PROOF STATE]
proof (chain)
picking this:
subgroup H G
[PROOF STEP]
have groupH: "group (G \<lparr>carrier := H\<rparr>)" (is "group ?H")
[PROOF STATE]
proof (prove)
using this:
subgroup H G

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by (rule subgroup_imp_group)
[PROOF STATE]
proof (state)
this:
Group.group (G\<lparr>carrier := H\<rparr>)

goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
from groupH
[PROOF STATE]
proof (chain)
picking this:
Group.group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
have monoidH: "monoid ?H"
[PROOF STATE]
proof (prove)
using this:
Group.group (G\<lparr>carrier := H\<rparr>)

goal (1 subgoal):
 1. Group.monoid (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by (rule group.is_monoid)
[PROOF STATE]
proof (state)
this:
Group.monoid (G\<lparr>carrier := H\<rparr>)

goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
from H
[PROOF STATE]
proof (chain)
picking this:
H \<in> A
[PROOF STEP]
have Int_subset: "?Int \<subseteq> H"
[PROOF STATE]
proof (prove)
using this:
H \<in> A

goal (1 subgoal):
 1. \<Inter> A \<subseteq> H
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<Inter> A \<subseteq> H

goal (4 subgoals):
 1. \<And>x. x \<in> A \<Longrightarrow> \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> x
 2. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 3. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 4. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Inter> A \<subseteq> H
[PROOF STEP]
show "le ?L ?Int H"
[PROOF STATE]
proof (prove)
using this:
\<Inter> A \<subseteq> H

goal (1 subgoal):
 1. \<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Inter> A \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> H

goal (3 subgoals):
 1. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 2. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 3. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 2. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 3. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
fix H
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 2. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 3. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
assume H: "H \<in> Lower ?L A"
[PROOF STATE]
proof (state)
this:
H \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A

goal (3 subgoals):
 1. \<And>y. y \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A \<Longrightarrow> y \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
 2. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 3. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
with L Int_subgroup
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
subgroup (\<Inter> A) G
H \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A
[PROOF STEP]
show "le ?L H ?Int"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
subgroup (\<Inter> A) G
H \<in> Lower \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> A

goal (1 subgoal):
 1. H \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A
[PROOF STEP]
by (fastforce simp: Lower_def intro: Inter_greatest)
[PROOF STATE]
proof (state)
this:
H \<sqsubseteq>\<^bsub>\<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>\<^esub> \<Inter> A

goal (2 subgoals):
 1. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 2. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
 2. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
show "A \<subseteq> carrier ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
by (rule L)
[PROOF STATE]
proof (state)
this:
A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>

goal (1 subgoal):
 1. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
show "?Int \<in> carrier ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>
[PROOF STEP]
by simp (rule Int_subgroup)
[PROOF STATE]
proof (state)
this:
\<Inter> A \<in> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (\<Inter> A) A

goal (1 subgoal):
 1. \<And>A. \<lbrakk>A \<subseteq> carrier \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr>; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>i. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> i A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (\<Inter> A) A
[PROOF STEP]
show "\<exists>I. greatest ?L I (Lower ?L A)"
[PROOF STATE]
proof (prove)
using this:
is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> (\<Inter> A) A

goal (1 subgoal):
 1. \<exists>I. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> I A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>I. is_glb \<lparr>carrier = {H. subgroup H G}, eq = (=), le = (\<subseteq>)\<rparr> I A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quasinorm_subsetD:
  assumes "N1 \<subseteq>\<^sub>N N2"
  shows "\<exists>C\<ge>(0::real). \<forall>f. eNorm N2 f \<le> C * eNorm N1 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>C\<ge>0. \<forall>f. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
N1 \<subseteq>\<^sub>N N2

goal (1 subgoal):
 1. \<exists>C\<ge>0. \<forall>f. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
unfolding less_eq_quasinorm_def
[PROOF STATE]
proof (prove)
using this:
\<exists>C\<ge>0. \<forall>f. eNorm N2 f \<le> ennreal C * eNorm N1 f

goal (1 subgoal):
 1. \<exists>C\<ge>0. \<forall>f. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_factors :
  assumes "is_prime p"
      and "p = n * m"
    shows "(n = 1 \<and> m = p) \<or> (n = p \<and> m = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 1 \<and> m = p \<or> n = p \<and> m = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_prime p
p = n * m

goal (1 subgoal):
 1. n = 1 \<and> m = p \<or> n = p \<and> m = 1
[PROOF STEP]
proof(clarsimp simp: is_prime_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>p = n * m; Suc 0 < n * m; \<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m; 0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0\<rbrakk> \<Longrightarrow> n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)
[PROOF STEP]
assume "\<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m"
[PROOF STATE]
proof (state)
this:
\<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m

goal (1 subgoal):
 1. \<lbrakk>p = n * m; Suc 0 < n * m; \<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m; 0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0\<rbrakk> \<Longrightarrow> n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)
[PROOF STEP]
hence a: "n = Suc 0 \<or> n = n * m \<and> m = Suc 0 \<or> m = n * m"
[PROOF STATE]
proof (prove)
using this:
\<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m

goal (1 subgoal):
 1. n = Suc 0 \<or> n = n * m \<and> m = Suc 0 \<or> m = n * m
[PROOF STEP]
by (meson dvd_triv_left dvd_triv_right)
[PROOF STATE]
proof (state)
this:
n = Suc 0 \<or> n = n * m \<and> m = Suc 0 \<or> m = n * m

goal (1 subgoal):
 1. \<lbrakk>p = n * m; Suc 0 < n * m; \<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m; 0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0\<rbrakk> \<Longrightarrow> n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)
[PROOF STEP]
assume "0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0" and "Suc 0 < n*m"
[PROOF STATE]
proof (state)
this:
0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0
Suc 0 < n * m

goal (1 subgoal):
 1. \<lbrakk>p = n * m; Suc 0 < n * m; \<forall>d. d dvd n * m \<longrightarrow> d = Suc 0 \<or> d = n * m; 0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0\<rbrakk> \<Longrightarrow> n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
n = Suc 0 \<or> n = n * m \<and> m = Suc 0 \<or> m = n * m
0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0
Suc 0 < n * m
[PROOF STEP]
show "n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)"
[PROOF STATE]
proof (prove)
using this:
n = Suc 0 \<or> n = n * m \<and> m = Suc 0 \<or> m = n * m
0 < n \<and> Suc 0 \<noteq> m \<or> m \<noteq> Suc 0
Suc 0 < n * m

goal (1 subgoal):
 1. n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
n = Suc 0 \<and> (m = 0 \<or> Suc 0 = n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_to_01open_01 :
 "0 < real_to_01open r \<and> real_to_01open r < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < real_to_01open r \<and> real_to_01open r < 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < real_to_01open r
 2. real_to_01open r < 1
[PROOF STEP]
have "- pi / 2 < arctan r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - pi / 2 < arctan r
[PROOF STEP]
by(simp add: arctan_lbound)
[PROOF STATE]
proof (state)
this:
- pi / 2 < arctan r

goal (2 subgoals):
 1. 0 < real_to_01open r
 2. real_to_01open r < 1
[PROOF STEP]
hence "0 < arctan r + pi / 2"
[PROOF STATE]
proof (prove)
using this:
- pi / 2 < arctan r

goal (1 subgoal):
 1. 0 < arctan r + pi / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < arctan r + pi / 2

goal (2 subgoals):
 1. 0 < real_to_01open r
 2. real_to_01open r < 1
[PROOF STEP]
hence "0 < (1 / pi) * (arctan r + pi / 2)"
[PROOF STATE]
proof (prove)
using this:
0 < arctan r + pi / 2

goal (1 subgoal):
 1. 0 < 1 / pi * (arctan r + pi / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / pi * (arctan r + pi / 2)

goal (2 subgoals):
 1. 0 < real_to_01open r
 2. real_to_01open r < 1
[PROOF STEP]
thus "0 < real_to_01open r"
[PROOF STATE]
proof (prove)
using this:
0 < 1 / pi * (arctan r + pi / 2)

goal (1 subgoal):
 1. 0 < real_to_01open r
[PROOF STEP]
by (simp add: add_divide_distrib real_to_01open_def)
[PROOF STATE]
proof (state)
this:
0 < real_to_01open r

goal (1 subgoal):
 1. real_to_01open r < 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_to_01open r < 1
[PROOF STEP]
have "arctan r < pi / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan r < pi / 2
[PROOF STEP]
using arctan_ubound
[PROOF STATE]
proof (prove)
using this:
arctan ?y < pi / 2

goal (1 subgoal):
 1. arctan r < pi / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arctan r < pi / 2

goal (1 subgoal):
 1. real_to_01open r < 1
[PROOF STEP]
hence "arctan r + pi / 2 < pi"
[PROOF STATE]
proof (prove)
using this:
arctan r < pi / 2

goal (1 subgoal):
 1. arctan r + pi / 2 < pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arctan r + pi / 2 < pi

goal (1 subgoal):
 1. real_to_01open r < 1
[PROOF STEP]
hence "(1 / pi) * (arctan r + pi / 2) < 1"
[PROOF STATE]
proof (prove)
using this:
arctan r + pi / 2 < pi

goal (1 subgoal):
 1. 1 / pi * (arctan r + pi / 2) < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / pi * (arctan r + pi / 2) < 1

goal (1 subgoal):
 1. real_to_01open r < 1
[PROOF STEP]
thus "real_to_01open r < 1"
[PROOF STATE]
proof (prove)
using this:
1 / pi * (arctan r + pi / 2) < 1

goal (1 subgoal):
 1. real_to_01open r < 1
[PROOF STEP]
by(simp add: real_to_01open_def add_divide_distrib)
[PROOF STATE]
proof (state)
this:
real_to_01open r < 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem fast_select_correct: "k < length xs \<Longrightarrow> fast_select k xs = select k xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < length xs \<Longrightarrow> fast_select k xs = select k xs
[PROOF STEP]
using fast_select_termination
[PROOF STATE]
proof (prove)
using this:
All fast_select_dom

goal (1 subgoal):
 1. k < length xs \<Longrightarrow> fast_select k xs = select k xs
[PROOF STEP]
by (intro fast_select_correct_aux) auto


[STATEMENT]
lemma convex_standard_simplex:
   "\<lbrakk>x \<in> standard_simplex p; y \<in> standard_simplex p;
     0 \<le> u; u \<le> 1\<rbrakk>
    \<Longrightarrow> (\<lambda>i. (1 - u) * x i + u * y i) \<in> standard_simplex p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> standard_simplex p; y \<in> standard_simplex p; 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * x i + u * y i) \<in> standard_simplex p
[PROOF STEP]
by (simp add: standard_simplex_def sum.distrib convex_bound_le flip: sum_distrib_left)


[STATEMENT]
lemma has_derivative_local_max:
  fixes f :: "'a::real_normed_vector \<Rightarrow> real"
  assumes "(f has_derivative f') (at x)"
  assumes "eventually (\<lambda>y. f y \<le> f x) (at x)"
  shows "f' = (\<lambda>h. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f' = (\<lambda>h. 0)
[PROOF STEP]
using has_derivative_local_min [of "\<lambda>x. - f x" "\<lambda>h. - f' h" "x"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>((\<lambda>x. - f x) has_derivative (\<lambda>h. - f' h)) (at x); \<forall>\<^sub>F y in at x. - f x \<le> - f y\<rbrakk> \<Longrightarrow> (\<lambda>h. - f' h) = (\<lambda>h. 0)

goal (1 subgoal):
 1. f' = (\<lambda>h. 0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>((\<lambda>x. - f x) has_derivative (\<lambda>h. - f' h)) (at x); \<forall>\<^sub>F y in at x. - f x \<le> - f y\<rbrakk> \<Longrightarrow> (\<lambda>h. - f' h) = (\<lambda>h. 0)
(f has_derivative f') (at x)
\<forall>\<^sub>F y in at x. f y \<le> f x

goal (1 subgoal):
 1. f' = (\<lambda>h. 0)
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>((\<lambda>x. - f x) has_derivative (\<lambda>h. - f' h)) (at x); \<forall>\<^sub>F y in at x. - f x \<le> - f y\<rbrakk> \<Longrightarrow> \<forall>x. - f' x = 0
(f has_derivative f') (at x)
\<forall>\<^sub>F y in at x. f y \<le> f x

goal (1 subgoal):
 1. \<forall>x. f' x = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma arith_mult_neq_nzero1:
  fixes i::nat
  assumes "i < n"
         and "0 < i"
  shows "i + n * t \<noteq> n * q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
i < n
0 < i
[PROOF STEP]
have sg1:"(i + n * t) mod n = i"
[PROOF STATE]
proof (prove)
using this:
i < n
0 < i

goal (1 subgoal):
 1. (i + n * t) mod n = i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i + n * t) mod n = i

goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(i + n * t) mod n = i

goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
have sg2:"(n * q) mod n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n * q mod n = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n * q mod n = 0

goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
from this and assms
[PROOF STATE]
proof (chain)
picking this:
n * q mod n = 0
i < n
0 < i
[PROOF STEP]
have "(i + n * t) mod n \<noteq> (n * q) mod n"
[PROOF STATE]
proof (prove)
using this:
n * q mod n = 0
i < n
0 < i

goal (1 subgoal):
 1. (i + n * t) mod n \<noteq> n * q mod n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(i + n * t) mod n \<noteq> n * q mod n

goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(i + n * t) mod n \<noteq> n * q mod n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(i + n * t) mod n \<noteq> n * q mod n

goal (1 subgoal):
 1. i + n * t \<noteq> n * q
[PROOF STEP]
by (rule arith_mod_neq)
[PROOF STATE]
proof (state)
this:
i + n * t \<noteq> n * q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ocircline_01inf:
  assumes "0\<^sub>h \<in> ocircline_set H \<and> 1\<^sub>h \<in> ocircline_set H \<and> \<infinity>\<^sub>h \<in> ocircline_set H"
  shows "H = o_x_axis \<or> H = opposite_ocircline o_x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H = o_x_axis \<or> H = opposite_ocircline o_x_axis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H = o_x_axis \<or> H = opposite_ocircline o_x_axis
[PROOF STEP]
have "0\<^sub>h \<in> circline_set (of_ocircline H) \<and> 1\<^sub>h \<in> circline_set (of_ocircline H) \<and> \<infinity>\<^sub>h \<in> circline_set (of_ocircline H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set (of_ocircline H) \<and> 1\<^sub>h \<in> circline_set (of_ocircline H) \<and> \<infinity>\<^sub>h \<in> circline_set (of_ocircline H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> ocircline_set H \<and> 1\<^sub>h \<in> ocircline_set H \<and> \<infinity>\<^sub>h \<in> ocircline_set H

goal (1 subgoal):
 1. 0\<^sub>h \<in> circline_set (of_ocircline H) \<and> 1\<^sub>h \<in> circline_set (of_ocircline H) \<and> \<infinity>\<^sub>h \<in> circline_set (of_ocircline H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0\<^sub>h \<in> circline_set (of_ocircline H) \<and> 1\<^sub>h \<in> circline_set (of_ocircline H) \<and> \<infinity>\<^sub>h \<in> circline_set (of_ocircline H)

goal (1 subgoal):
 1. H = o_x_axis \<or> H = opposite_ocircline o_x_axis
[PROOF STEP]
hence "of_ocircline H = x_axis"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> circline_set (of_ocircline H) \<and> 1\<^sub>h \<in> circline_set (of_ocircline H) \<and> \<infinity>\<^sub>h \<in> circline_set (of_ocircline H)

goal (1 subgoal):
 1. of_ocircline H = x_axis
[PROOF STEP]
using unique_circline_01inf'
[PROOF STATE]
proof (prove)
using this:
0\<^sub>h \<in> circline_set (of_ocircline H) \<and> 1\<^sub>h \<in> circline_set (of_ocircline H) \<and> \<infinity>\<^sub>h \<in> circline_set (of_ocircline H)
0\<^sub>h \<in> circline_set x_axis \<and> 1\<^sub>h \<in> circline_set x_axis \<and> \<infinity>\<^sub>h \<in> circline_set x_axis \<and> (\<forall>H. 0\<^sub>h \<in> circline_set H \<and> 1\<^sub>h \<in> circline_set H \<and> \<infinity>\<^sub>h \<in> circline_set H \<longrightarrow> H = x_axis)

goal (1 subgoal):
 1. of_ocircline H = x_axis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_ocircline H = x_axis

goal (1 subgoal):
 1. H = o_x_axis \<or> H = opposite_ocircline o_x_axis
[PROOF STEP]
thus "H = o_x_axis \<or> H = opposite_ocircline o_x_axis"
[PROOF STATE]
proof (prove)
using this:
of_ocircline H = x_axis

goal (1 subgoal):
 1. H = o_x_axis \<or> H = opposite_ocircline o_x_axis
[PROOF STEP]
by (metis inj_of_ocircline of_ocircline_o_x_axis)
[PROOF STATE]
proof (state)
this:
H = o_x_axis \<or> H = opposite_ocircline o_x_axis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj2_line_abs_mult:
  assumes "k \<noteq> 0"
  shows "proj2_line_abs (k *\<^sub>R v) = proj2_line_abs v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_line_abs (k *\<^sub>R v) = proj2_line_abs v
[PROOF STEP]
unfolding proj2_line_abs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P2L (proj2_abs (k *\<^sub>R v)) = P2L (proj2_abs v)
[PROOF STEP]
using \<open>k \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0

goal (1 subgoal):
 1. P2L (proj2_abs (k *\<^sub>R v)) = P2L (proj2_abs v)
[PROOF STEP]
by (subst proj2_abs_mult) simp_all


[STATEMENT]
lemma power_le_one: "0 \<le> a \<Longrightarrow> a \<le> 1 \<Longrightarrow> a ^ n \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> a; a \<le> (1::'a)\<rbrakk> \<Longrightarrow> a ^ n \<le> (1::'a)
[PROOF STEP]
using power_mono [of a 1 n]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> (1::'a); (0::'a) \<le> a\<rbrakk> \<Longrightarrow> a ^ n \<le> (1::'a) ^ n

goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> a; a \<le> (1::'a)\<rbrakk> \<Longrightarrow> a ^ n \<le> (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma aff_dim_2 [simp]:
  fixes a :: "'n::euclidean_space"
  shows "aff_dim {a,b} = (if a = b then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim {a, b} = (if a = b then 0 else 1)
[PROOF STEP]
proof (clarsimp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> aff_dim {a, b} = 1
[PROOF STEP]
assume "a \<noteq> b"
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> aff_dim {a, b} = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
[PROOF STEP]
have "aff_dim{a,b} = card{a,b} - 1"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. aff_dim {a, b} = int (card {a, b} - 1)
[PROOF STEP]
using affine_independent_2 [of a b] aff_dim_affine_independent
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
\<not> affine_dependent {a, b}
\<not> affine_dependent ?B \<Longrightarrow> int (card ?B) = aff_dim ?B + 1

goal (1 subgoal):
 1. aff_dim {a, b} = int (card {a, b} - 1)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
aff_dim {a, b} = int (card {a, b} - 1)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> aff_dim {a, b} = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
aff_dim {a, b} = int (card {a, b} - 1)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> aff_dim {a, b} = 1
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card {a, b} - 1) = 1
[PROOF STEP]
using \<open>a \<noteq> b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. int (card {a, b} - 1) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (card {a, b} - 1) = 1

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> aff_dim {a, b} = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
aff_dim {a, b} = 1
[PROOF STEP]
show "aff_dim {a, b} = 1"
[PROOF STATE]
proof (prove)
using this:
aff_dim {a, b} = 1

goal (1 subgoal):
 1. aff_dim {a, b} = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
aff_dim {a, b} = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_increasing_convergent:
  fixes f :: "nat \<Rightarrow> real"
  shows "\<lbrakk>bounded (range f); \<And>n. f n \<le> f (Suc n)\<rbrakk> \<Longrightarrow> \<exists>l. f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bounded (range f); \<And>n. f n \<le> f (Suc n)\<rbrakk> \<Longrightarrow> \<exists>l. f \<longlonglongrightarrow> l
[PROOF STEP]
using Bseq_mono_convergent[of f] incseq_Suc_iff[of f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Bseq f; \<forall>m n. m \<le> n \<longrightarrow> f m \<le> f n\<rbrakk> \<Longrightarrow> convergent f
incseq f = (\<forall>n. f n \<le> f (Suc n))

goal (1 subgoal):
 1. \<lbrakk>bounded (range f); \<And>n. f n \<le> f (Suc n)\<rbrakk> \<Longrightarrow> \<exists>l. f \<longlonglongrightarrow> l
[PROOF STEP]
by (auto simp: image_def Bseq_eq_bounded convergent_def incseq_def)


[STATEMENT]
lemma change_eval_leq:
  fixes x y:: "real"
  assumes "((aEvalUni (LeqUni (a,b,c)) x \<noteq> aEvalUni (LeqUni (a,b,c)) y) \<and> x < y)"
  shows "(\<exists>w. x \<le> w \<and> w \<le> y \<and> a*w^2 + b*w + c = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
let ?p = "[:c, b, a:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
have "sign ?p x \<noteq> sign ?p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign [:c, b, a:] x \<noteq> sign [:c, b, a:] y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
aEvalUni (LeqUni (a, b, c)) x \<noteq> aEvalUni (LeqUni (a, b, c)) y \<and> x < y

goal (1 subgoal):
 1. sign [:c, b, a:] x \<noteq> sign [:c, b, a:] y
[PROOF STEP]
unfolding sign_def
[PROOF STATE]
proof (prove)
using this:
aEvalUni (LeqUni (a, b, c)) x \<noteq> aEvalUni (LeqUni (a, b, c)) y \<and> x < y

goal (1 subgoal):
 1. (if poly [:c, b, a:] x = 0 then 0 else if 0 < poly [:c, b, a:] x then 1 else - 1) \<noteq> (if poly [:c, b, a:] y = 0 then 0 else if 0 < poly [:c, b, a:] y then 1 else - 1)
[PROOF STEP]
apply (simp add: distrib_left mult.commute mult.left_commute power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * (x * x) + b * x + c \<le> 0) = (\<not> a * (y * y) + b * y + c \<le> 0) \<and> x < y \<Longrightarrow> (0 < c + (b * x + a * (x * x)) \<longrightarrow> \<not> 0 < c + (b * y + a * (y * y))) \<and> (\<not> 0 < c + (b * x + a * (x * x)) \<longrightarrow> (c + (b * x + a * (x * x)) = 0 \<longrightarrow> \<not> 0 < c + (b * y + a * (y * y)) \<longrightarrow> c + (b * y + a * (y * y)) \<noteq> 0) \<and> (c + (b * x + a * (x * x)) \<noteq> 0 \<longrightarrow> \<not> 0 < c + (b * y + a * (y * y)) \<longrightarrow> c + (b * y + a * (y * y)) = 0))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
sign [:c, b, a:] x \<noteq> sign [:c, b, a:] y

goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sign [:c, b, a:] x \<noteq> sign [:c, b, a:] y
[PROOF STEP]
have "(\<exists>w \<in> (root_list ?p). x \<le> w \<and> w \<le> y)"
[PROOF STATE]
proof (prove)
using this:
sign [:c, b, a:] x \<noteq> sign [:c, b, a:] y

goal (1 subgoal):
 1. \<exists>w\<in>root_list [:c, b, a:]. x \<le> w \<and> w \<le> y
[PROOF STEP]
using changes_sign
      assms
[PROOF STATE]
proof (prove)
using this:
sign [:c, b, a:] x \<noteq> sign [:c, b, a:] y
\<forall>x y. sign ?p x \<noteq> sign ?p y \<and> x < y \<longrightarrow> (\<exists>c\<in>root_list ?p. x \<le> c \<and> c \<le> y)
aEvalUni (LeqUni (a, b, c)) x \<noteq> aEvalUni (LeqUni (a, b, c)) y \<and> x < y

goal (1 subgoal):
 1. \<exists>w\<in>root_list [:c, b, a:]. x \<le> w \<and> w \<le> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w\<in>root_list [:c, b, a:]. x \<le> w \<and> w \<le> y

goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>w\<in>root_list [:c, b, a:]. x \<le> w \<and> w \<le> y
[PROOF STEP]
obtain w where w_prop: "w \<in> (root_list ?p) \<and> x \<le> w \<and> w \<le> y"
[PROOF STATE]
proof (prove)
using this:
\<exists>w\<in>root_list [:c, b, a:]. x \<le> w \<and> w \<le> y

goal (1 subgoal):
 1. (\<And>w. w \<in> root_list [:c, b, a:] \<and> x \<le> w \<and> w \<le> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> root_list [:c, b, a:] \<and> x \<le> w \<and> w \<le> y

goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> root_list [:c, b, a:] \<and> x \<le> w \<and> w \<le> y
[PROOF STEP]
have "a*w^2 + b*w + c = 0"
[PROOF STATE]
proof (prove)
using this:
w \<in> root_list [:c, b, a:] \<and> x \<le> w \<and> w \<le> y

goal (1 subgoal):
 1. a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
unfolding root_list_def
[PROOF STATE]
proof (prove)
using this:
w \<in> {x. poly [:c, b, a:] x = 0} \<and> x \<le> w \<and> w \<le> y

goal (1 subgoal):
 1. a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
using add.commute distrib_right mult.assoc mult.commute power2_eq_square
[PROOF STATE]
proof (prove)
using this:
w \<in> {x. poly [:c, b, a:] x = 0} \<and> x \<le> w \<and> w \<le> y
?a + ?b = ?b + ?a
(?a + ?b) * ?c = ?a * ?c + ?b * ?c
?a * ?b * ?c = ?a * (?b * ?c)
?a * ?b = ?b * ?a
?a\<^sup>2 = ?a * ?a

goal (1 subgoal):
 1. a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
using quadratic_poly_eval
[PROOF STATE]
proof (prove)
using this:
w \<in> {x. poly [:c, b, a:] x = 0} \<and> x \<le> w \<and> w \<le> y
?a + ?b = ?b + ?a
(?a + ?b) * ?c = ?a * ?c + ?b * ?c
?a * ?b * ?c = ?a * (?b * ?c)
?a * ?b = ?b * ?a
?a\<^sup>2 = ?a * ?a
poly [:?c, ?b, ?a:] ?x = ?a * ?x\<^sup>2 + ?b * ?x + ?c

goal (1 subgoal):
 1. a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a * w\<^sup>2 + b * w + c = 0

goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a * w\<^sup>2 + b * w + c = 0

goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
using w_prop
[PROOF STATE]
proof (prove)
using this:
a * w\<^sup>2 + b * w + c = 0
w \<in> root_list [:c, b, a:] \<and> x \<le> w \<and> w \<le> y

goal (1 subgoal):
 1. \<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w\<ge>x. w \<le> y \<and> a * w\<^sup>2 + b * w + c = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Liouville_theorem:
    assumes holf: "f holomorphic_on UNIV"
        and bf: "bounded (range f)"
      shows "f constant_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f constant_on UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f constant_on UNIV
[PROOF STEP]
obtain B where "\<And>z. cmod (f z) \<le> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. (\<And>z. cmod (f z) \<le> B) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson bf bounded_pos rangeI)
[PROOF STATE]
proof (state)
this:
cmod (f ?z) \<le> B

goal (1 subgoal):
 1. f constant_on UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (f ?z) \<le> B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (f ?z) \<le> B

goal (1 subgoal):
 1. f constant_on UNIV
[PROOF STEP]
using Liouville_polynomial [OF holf, of 0 B 0, simplified]
[PROOF STATE]
proof (prove)
using this:
cmod (f ?z) \<le> B
(\<And>z. cmod (f z) \<le> B) \<Longrightarrow> f ?\<xi> = f 0

goal (1 subgoal):
 1. f constant_on UNIV
[PROOF STEP]
by (meson constant_on_def)
[PROOF STATE]
proof (state)
this:
f constant_on UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_of_real_nn_iff[simp]:
  "0 \<le> complex_of_real y \<longleftrightarrow> 0 \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> complex_of_real y) = (0 \<le> y)
[PROOF STEP]
unfolding less_eq_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re 0 \<le> Re (complex_of_real y) \<and> Im 0 = Im (complex_of_real y)) = (0 \<le> y)
[PROOF STEP]
by auto


[STATEMENT]
lemma eval_fds_at_numeral: "eval_fds f (numeral k) = (\<Sum>n. fds_nth f n / of_nat n ^ numeral k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds f (numeral k) = (\<Sum>n. fds_nth f n / of_nat n ^ numeral k)
[PROOF STEP]
using eval_fds_at_nat[of f "numeral k"]
[PROOF STATE]
proof (prove)
using this:
eval_fds f (of_nat (numeral k)) = (\<Sum>n. fds_nth f n / of_nat n ^ numeral k)

goal (1 subgoal):
 1. eval_fds f (numeral k) = (\<Sum>n. fds_nth f n / of_nat n ^ numeral k)
[PROOF STEP]
by simp


[STATEMENT]
lemma arity_ne_infinity_if_\<delta>_gt_0: "\<delta> > 0 \<Longrightarrow> arity s \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<delta> \<Longrightarrow> arity s \<noteq> \<infinity>
[PROOF STEP]
unfolding arity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<delta> \<Longrightarrow> arity_hd (head s) - enat (num_args s) \<noteq> \<infinity>
[PROOF STEP]
by (induct s rule: tm_induct_apps)
    (metis arity_hd_ne_infinity_if_\<delta>_gt_0 enat.distinct(2) enat.exhaust idiff_enat_enat)


[STATEMENT]
lemma cos_minus_pi [simp]: "cos (x - pi) = - (cos x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x - pi) = - cos x
[PROOF STEP]
by (simp add: cos_diff)


[STATEMENT]
lemma card_arcs_iso[simp]: "card (iso_arcs hom ` arcs G) = card (arcs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (iso_arcs hom ` arcs G) = card (arcs G)
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. card (iso_arcs hom ` arcs G) = card (arcs G)
[PROOF STEP]
by (intro card_image digraph_isomorphism_inj_on_arcs)


[STATEMENT]
lemma coprime_of_nat_gauss_int: "coprime (of_nat a :: gauss_int) (of_nat b) = coprime a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (of_nat a) (of_nat b) = coprime a b
[PROOF STEP]
unfolding coprime_iff_gcd_eq_1 gcd_of_nat_gauss_int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat (gcd a b) = 1) = (gcd a b = 1)
[PROOF STEP]
by auto


[STATEMENT]
lemma catalan_closed_form_aux:
  "catalan n * Suc n = (2*n) choose n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
have "real ((2*n) choose n) = fact (2*n) / (fact n)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (2 * n choose n) = fact (2 * n) / (fact n)\<^sup>2
[PROOF STEP]
by (simp add: binomial_fact power2_eq_square)
[PROOF STATE]
proof (state)
this:
real (2 * n choose n) = fact (2 * n) / (fact n)\<^sup>2

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (2 * n choose n) = fact (2 * n) / (fact n)\<^sup>2

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
have "(fact (2*n) :: real) = 4^n * pochhammer (1 / 2) n * fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (2 * n) = 4 ^ n * pochhammer (1 / 2) n * fact n
[PROOF STEP]
by (simp add: fact_double power_mult)
[PROOF STATE]
proof (state)
this:
fact (2 * n) = 4 ^ n * pochhammer (1 / 2) n * fact n

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact (2 * n) = 4 ^ n * pochhammer (1 / 2) n * fact n

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
have "\<dots> / (fact n)^2 / real (n+1) = real (catalan n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 ^ n * pochhammer (1 / 2) n * fact n / (fact n)\<^sup>2 / real (n + 1) = real (catalan n)
[PROOF STEP]
by (simp add: catalan_closed_form_gbinomial gbinomial_pochhammer pochhammer_rec
          field_simps power2_eq_square power_mult_distrib [symmetric] del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
4 ^ n * pochhammer (1 / 2) n * fact n / (fact n)\<^sup>2 / real (n + 1) = real (catalan n)

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (2 * n choose n) / real (n + 1) = real (catalan n)
[PROOF STEP]
have "real (catalan n * Suc n) = real ((2*n) choose n)"
[PROOF STATE]
proof (prove)
using this:
real (2 * n choose n) / real (n + 1) = real (catalan n)

goal (1 subgoal):
 1. real (catalan n * Suc n) = real (2 * n choose n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
real (catalan n * Suc n) = real (2 * n choose n)

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
real (catalan n * Suc n) = real (2 * n choose n)

goal (1 subgoal):
 1. catalan n * Suc n = 2 * n choose n
[PROOF STEP]
by (simp only: of_nat_eq_iff)
[PROOF STATE]
proof (state)
this:
catalan n * Suc n = 2 * n choose n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_less_floor [simp]: "0 < \<lfloor>x\<rfloor> \<longleftrightarrow> 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < \<lfloor>x\<rfloor>) = ((1::'a) \<le> x)
[PROOF STEP]
by (simp add: less_floor_iff)


[STATEMENT]
lemma Least_limit_ordinal: "(LEAST x. limit_ordinal x) = \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST x. limit_ordinal x) = \<omega>
[PROOF STEP]
apply (rule Least_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. limit_ordinal \<omega>
 2. \<And>y. limit_ordinal y \<Longrightarrow> \<omega> \<le> y
[PROOF STEP]
apply (rule limit_ordinal_omega)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. limit_ordinal y \<Longrightarrow> \<omega> \<le> y
[PROOF STEP]
apply (erule contrapos_pp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<not> \<omega> \<le> y \<Longrightarrow> \<not> limit_ordinal y
[PROOF STEP]
apply (simp add: linorder_not_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y < \<omega> \<Longrightarrow> \<not> limit_ordinal y
[PROOF STEP]
apply (drule less_omegaD, erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y n. y = ordinal_of_nat n \<Longrightarrow> \<not> limit_ordinal y
[PROOF STEP]
apply (simp add: not_limit_ordinal_nat)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nonzero_norm_divide: "b \<noteq> 0 \<Longrightarrow> norm (a / b) = norm a / norm b"
  for a b :: "'a::real_normed_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> norm (a / b) = norm a / norm b
[PROOF STEP]
by (simp add: divide_inverse norm_mult nonzero_norm_inverse)


[STATEMENT]
lemma  det_row_0:
  fixes b :: "'n::finite \<Rightarrow> _ ^ 'n"
  shows "det((\<chi> i. if i = k then 0 else b i)::'a::comm_ring_1^'n^'n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i. if i = k then 0 else b i) = (0::'a)
[PROOF STEP]
using det_row_mul[of k 0 "\<lambda>i. 1" b]
[PROOF STATE]
proof (prove)
using this:
det (\<chi>i. if i = k then (0::'a) *s 1 else b i) = (0::'a) * det (\<chi>i. if i = k then 1 else b i)

goal (1 subgoal):
 1. det (\<chi>i. if i = k then 0 else b i) = (0::'a)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i. if i = k then (0::'a) *s 1 else b i) = (0::'a) \<Longrightarrow> det (\<chi>i. if i = k then 0 else b i) = (0::'a)
[PROOF STEP]
apply (simp only: vector_smult_lzero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma closed_segment_image_interval:
     "closed_segment a b = (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b = (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0..1}
[PROOF STEP]
by (auto simp: set_eq_iff image_iff closed_segment_def)


[STATEMENT]
lemma three_intervals_lemma:
  fixes a b c::real
  assumes a: "a \<in> A - B"
    and b: "b \<in> B - A"
    and c: "c \<in> A \<inter> B"
    and iA: "is_interval A" and iB: "is_interval B"
    and aI: "a \<in> I"
    and bI: "b \<in> I"
    and iI: "is_interval I"
  shows "c \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> I
[PROOF STEP]
apply (rule mem_is_intervalI[OF iI aI bI])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> c \<bullet> i \<and> c \<bullet> i \<le> b \<bullet> i \<or> b \<bullet> i \<le> c \<bullet> i \<and> c \<bullet> i \<le> a \<bullet> i
[PROOF STEP]
using iA iB
[PROOF STATE]
proof (prove)
using this:
is_interval A
is_interval B

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> a \<bullet> i \<le> c \<bullet> i \<and> c \<bullet> i \<le> b \<bullet> i \<or> b \<bullet> i \<le> c \<bullet> i \<and> c \<bullet> i \<le> a \<bullet> i
[PROOF STEP]
apply (auto simp: is_interval_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. \<forall>x. (a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> A) \<and> (b \<le> x \<and> x \<le> a \<longrightarrow> x \<in> A); \<forall>a\<in>B. \<forall>b\<in>B. \<forall>x. (a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> B) \<and> (b \<le> x \<and> x \<le> a \<longrightarrow> x \<in> B); \<not> b \<le> c\<rbrakk> \<Longrightarrow> a \<le> c
 2. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. \<forall>x. (a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> A) \<and> (b \<le> x \<and> x \<le> a \<longrightarrow> x \<in> A); \<forall>a\<in>B. \<forall>b\<in>B. \<forall>x. (a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> B) \<and> (b \<le> x \<and> x \<le> a \<longrightarrow> x \<in> B); \<not> c \<le> a\<rbrakk> \<Longrightarrow> c \<le> b
[PROOF STEP]
apply (metis Diff_iff Int_iff a b c le_cases)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. \<forall>x. (a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> A) \<and> (b \<le> x \<and> x \<le> a \<longrightarrow> x \<in> A); \<forall>a\<in>B. \<forall>b\<in>B. \<forall>x. (a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> B) \<and> (b \<le> x \<and> x \<le> a \<longrightarrow> x \<in> B); \<not> c \<le> a\<rbrakk> \<Longrightarrow> c \<le> b
[PROOF STEP]
apply (metis Diff_iff Int_iff a b c le_cases)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_domain_and_range_permutation:
  assumes "finite A" "finite B"
  shows "card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
have "bij_betw (number_partition_of A B) ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N \<le> card B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (number_partition_of A B) ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N \<le> card B}
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. bij_betw (number_partition_of A B) ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N \<le> card B}
[PROOF STEP]
by (rule bij_betw_number_partition_of)
[PROOF STATE]
proof (state)
this:
bij_betw (number_partition_of A B) ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N \<le> card B}

goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bij_betw (number_partition_of A B) ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N \<le> card B}
[PROOF STEP]
have "card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = card {N. number_partition (card A) N \<and> size N \<le> card B}"
[PROOF STATE]
proof (prove)
using this:
bij_betw (number_partition_of A B) ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) {N. number_partition (card A) N \<and> size N \<le> card B}

goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = card {N. number_partition (card A) N \<and> size N \<le> card B}
[PROOF STEP]
by (rule bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = card {N. number_partition (card A) N \<and> size N \<le> card B}

goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = card {N. number_partition (card A) N \<and> size N \<le> card B}

goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
have "card {N. number_partition (card A) N \<and> size N \<le> card B} = Partition (card A + card B) (card B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {N. number_partition (card A) N \<and> size N \<le> card B} = Partition (card A + card B) (card B)
[PROOF STEP]
by (rule card_number_partitions_with_atmost_k_parts)
[PROOF STATE]
proof (state)
this:
card {N. number_partition (card A) N \<and> size N \<le> card B} = Partition (card A + card B) (card B)

goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)

goal (1 subgoal):
 1. card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card ((A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B) = Partition (card A + card B) (card B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_list_True_False: "count_list xs True + count_list xs False = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list xs True + count_list xs False = length xs
[PROOF STEP]
by(induct xs) auto


[STATEMENT]
lemma numeral_5_eq_5: "5 = Suc (Suc (Suc (Suc (Suc 0))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 5 = Suc (Suc (Suc (Suc (Suc 0))))
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma lcm_is_Min_multiple_nat:
  assumes "c \<noteq> 0" "(a::nat) dvd c" "(b::nat) dvd c"
  shows "c \<ge> lcm a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm a b \<le> c
[PROOF STEP]
using lcm_least[of a c b] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a dvd c; b dvd c\<rbrakk> \<Longrightarrow> lcm a b dvd c
c \<noteq> 0
a dvd c
b dvd c

goal (1 subgoal):
 1. lcm a b \<le> c
[PROOF STEP]
by fastforce


[STATEMENT]
lemma flatten_PLUS_inject: "\<lbrakk>\<forall>x \<in> R \<union> S. \<not> is_Zero x \<and> \<not> is_Plus x; finite R; finite S\<rbrakk> \<Longrightarrow>
  (flatten PLUS R = flatten PLUS S) = (R = S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>R \<union> S. \<not> is_Zero x \<and> \<not> is_Plus x; finite R; finite S\<rbrakk> \<Longrightarrow> (flatten PLUS R = flatten PLUS S) = (R = S)
[PROOF STEP]
by (rule trans[OF PLUS_inject sorted_list_of_set_inject]) auto