[STATEMENT]
lemma Brouwer_degree2_unique:
  assumes f: "continuous_map (nsphere p) (nsphere p) f"
    and hi: "\<And>x. x \<in> carrier(reduced_homology_group p (nsphere p))
               \<Longrightarrow> hom_induced p (nsphere p) {} (nsphere p) {} f x = pow (reduced_homology_group p (nsphere p)) x d"
          (is "\<And>x. x \<in> carrier ?G \<Longrightarrow> ?h x = _")
  shows "Brouwer_degree2 p f = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Brouwer_degree2 p f = d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Brouwer_degree2 p f = d
[PROOF STEP]
obtain a where a: "a \<in> carrier ?G"
    and aeq: "subgroup_generated ?G {a} = ?G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> carrier (reduced_homology_group (int p) (nsphere p)); subgroup_generated (reduced_homology_group (int p) (nsphere p)) {a} = reduced_homology_group (int p) (nsphere p)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cyclic_reduced_homology_group_nsphere [of p p]
[PROOF STATE]
proof (prove)
using this:
cyclic_group (reduced_homology_group (int p) (nsphere p))

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> carrier (reduced_homology_group (int p) (nsphere p)); subgroup_generated (reduced_homology_group (int p) (nsphere p)) {a} = reduced_homology_group (int p) (nsphere p)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: cyclic_group_def)
[PROOF STATE]
proof (state)
this:
a \<in> carrier (reduced_homology_group (int p) (nsphere p))
subgroup_generated (reduced_homology_group (int p) (nsphere p)) {a} = reduced_homology_group (int p) (nsphere p)

goal (1 subgoal):
 1. Brouwer_degree2 p f = d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Brouwer_degree2 p f = d
[PROOF STEP]
using hi [OF a]
[PROOF STATE]
proof (prove)
using this:
hom_induced (int p) (nsphere p) {} (nsphere p) {} f a = a [^]\<^bsub>reduced_homology_group (int p) (nsphere p)\<^esub> d

goal (1 subgoal):
 1. Brouwer_degree2 p f = d
[PROOF STEP]
apply (simp add: Brouwer_degree2 a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^]\<^bsub>reduced_homology_group (int p) (nsphere p)\<^esub> Brouwer_degree2 p f = a [^]\<^bsub>reduced_homology_group (int p) (nsphere p)\<^esub> d \<Longrightarrow> Brouwer_degree2 p f = d
[PROOF STEP]
by (metis Brouwer_degree2_iff a aeq f group.trivial_group_subgroup_generated group_reduced_homology_group subsetI trivial_reduced_homology_group_nsphere)
[PROOF STATE]
proof (state)
this:
Brouwer_degree2 p f = d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "filterlim (\<lambda>x::real. x / (ln (x powr (ln x powr (ln 2 / ln x))))) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. x / ln (x powr ln x powr (ln 2 / ln x)) :> at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma set1_FGco_bound:
  fixes x :: "(_, 'co1, 'co2, 'co3, 'co4, 'co5, 'co6,
    'contra1, 'contra2, 'contra3, 'contra4, 'f1, 'f2) FGco"
  shows "card_of (set1_FGco x) <o (bd_FGco :: ('co1, 'co2, 'co3, 'co4, 'co5, 'co6,
    'contra1, 'contra2, 'contra3, 'contra4, 'f1, 'f2) FGcobd rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |set1_FGco x| <o bd_FGco
[PROOF STEP]
unfolding set1_FGco_def bd_FGco_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |set1_F x| <o bd_F
[PROOF STEP]
using set1_F_bound
[PROOF STATE]
proof (prove)
using this:
|set1_F ?x| <o bd_F

goal (1 subgoal):
 1. |set1_F x| <o bd_F
[PROOF STEP]
.


[STATEMENT]
lemma Hausdorff_space_subtopology:
  assumes "Hausdorff_space X" shows "Hausdorff_space(subtopology X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hausdorff_space (subtopology X S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Hausdorff_space (subtopology X S)
[PROOF STEP]
have *: "disjnt U V \<Longrightarrow> disjnt (S \<inter> U) (S \<inter> V)" for U V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjnt U V \<Longrightarrow> disjnt (S \<inter> U) (S \<inter> V)
[PROOF STEP]
by (simp add: disjnt_iff)
[PROOF STATE]
proof (state)
this:
disjnt ?U ?V \<Longrightarrow> disjnt (S \<inter> ?U) (S \<inter> ?V)

goal (1 subgoal):
 1. Hausdorff_space (subtopology X S)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Hausdorff_space X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Hausdorff_space X

goal (1 subgoal):
 1. Hausdorff_space (subtopology X S)
[PROOF STEP]
apply (simp add: Hausdorff_space_def openin_subtopology_alt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<in> topspace X \<and> y \<in> topspace X \<and> x \<noteq> y \<longrightarrow> (\<exists>U. openin X U \<and> (\<exists>V. openin X V \<and> x \<in> U \<and> y \<in> V \<and> disjnt U V)) \<Longrightarrow> \<forall>x y. x \<in> topspace X \<and> x \<in> S \<and> y \<in> topspace X \<and> y \<in> S \<and> x \<noteq> y \<longrightarrow> (\<exists>U. openin X U \<and> x \<in> U \<and> (\<exists>V. openin X V \<and> y \<in> V \<and> disjnt (S \<inter> U) (S \<inter> V)))
[PROOF STEP]
apply (fast intro: * elim!: all_forward)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Hausdorff_space (subtopology X S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_funpower:
  assumes mono: "mono f"
  shows "mono (funpower f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (funpower f n)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mono (funpower f 0)
 2. \<And>n. mono (funpower f n) \<Longrightarrow> mono (funpower f (Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. mono (funpower f 0)
 2. \<And>n. mono (funpower f n) \<Longrightarrow> mono (funpower f (Suc n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (funpower f 0)
[PROOF STEP]
by (simp add: id_def[symmetric])
[PROOF STATE]
proof (state)
this:
mono (funpower f 0)

goal (1 subgoal):
 1. \<And>n. mono (funpower f n) \<Longrightarrow> mono (funpower f (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. mono (funpower f n) \<Longrightarrow> mono (funpower f (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
mono (funpower f n)

goal (1 subgoal):
 1. \<And>n. mono (funpower f n) \<Longrightarrow> mono (funpower f (Suc n))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (funpower f (Suc n))
[PROOF STEP]
by (simp add: Suc.hyps mono monoD monoI)
[PROOF STATE]
proof (state)
this:
mono (funpower f (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_H_eq: "card H = p^a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H = p ^ a
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card H \<le> p ^ a
 2. p ^ a \<le> card H
[PROOF STEP]
show "p^a \<le> card H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ a \<le> card H
[PROOF STEP]
proof (rule dvd_imp_le)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p ^ a dvd card H
 2. 0 < card H
[PROOF STEP]
show "p ^ a dvd card H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ a dvd card H
[PROOF STEP]
apply (rule div_combine [OF prime_imp_prime_elem[OF prime_p] not_dvd_M])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ (a + multiplicity p m) dvd card M * card H
[PROOF STEP]
by (simp add: index_lem multiplicity_dvd order_G power_add)
[PROOF STATE]
proof (state)
this:
p ^ a dvd card H

goal (1 subgoal):
 1. 0 < card H
[PROOF STEP]
show "0 < card H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < card H
[PROOF STEP]
by (blast intro: subgroup.finite_imp_card_positive H_is_subgroup)
[PROOF STATE]
proof (state)
this:
0 < card H

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p ^ a \<le> card H

goal (1 subgoal):
 1. card H \<le> p ^ a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card H \<le> p ^ a
[PROOF STEP]
show "card H \<le> p^a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card H \<le> p ^ a
[PROOF STEP]
using M1_inj_H card_M1 card_inj finite_M1
[PROOF STATE]
proof (prove)
using this:
\<exists>f\<in>H \<rightarrow> M1. inj_on f H
card M1 = p ^ a
\<lbrakk>?f \<in> ?A \<rightarrow> ?B; inj_on ?f ?A; finite ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B
finite M1

goal (1 subgoal):
 1. card H \<le> p ^ a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card H \<le> p ^ a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bound_int_simp[code]:
  "bounded_index.size (Bound (l1, l2) (u1, u2)) = nat (u1 - l1) * nat (u2 - l2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_index.size (Bound (l1, l2) (u1, u2)) = nat (u1 - l1) * nat (u2 - l2)
[PROOF STEP]
by (simp add: bounded_index.size_def,unfold size_int_def[symmetric] size_prod,simp add: size_int)


[STATEMENT]
lemma degree_sum_le:
  shows "(\<And>x. x \<in> A \<Longrightarrow> degree (f x) \<le> n) \<Longrightarrow> degree (\<Sum>x\<in>A. f x) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> degree (f x) \<le> n) \<Longrightarrow> degree (sum f A) \<le> n
[PROOF STEP]
by (induct rule: infinite_finite_induct) (auto intro!: degree_add_le)


[STATEMENT]
lemma moebius_rotation_zero [simp]:
  shows "moebius_rotation 0 = id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_rotation 0 = id_moebius
[PROOF STEP]
unfolding moebius_rotation_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_similarity (cis 0) 0 = id_moebius
[PROOF STEP]
using moebius_similarity_id
[PROOF STATE]
proof (prove)
using this:
moebius_similarity 1 0 = id_moebius

goal (1 subgoal):
 1. moebius_similarity (cis 0) 0 = id_moebius
[PROOF STEP]
by simp


[STATEMENT]
lemma max_Sup_absorb_left:
  fixes f g::\<open>'a \<Rightarrow> real\<close>
  assumes \<open>X \<noteq> {}\<close> and \<open>bdd_above (f ` X)\<close> and \<open>bdd_above (g ` X)\<close> and \<open>Sup (f ` X) \<ge> Sup (g ` X)\<close>
  shows \<open>Sup ((pointwise_max f g) ` X) = Sup (f ` X)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
text \<open>Explanation: For real-valued functions \<^term>\<open>f\<close> and \<^term>\<open>g\<close>, if the supremum of \<^term>\<open>f\<close> is
    greater-equal the supremum of \<^term>\<open>g\<close>, then the supremum of \<^term>\<open>max f g\<close> equals the supremum of
    \<^term>\<open>f\<close>. (Under some technical conditions.)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
have y_Sup: \<open>y \<in> ((\<lambda> x. max (f x) (g x)) ` X) \<Longrightarrow> y \<le> Sup (f ` X)\<close> for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
assume \<open>y \<in> ((\<lambda> x. max (f x) (g x)) ` X)\<close>
[PROOF STATE]
proof (state)
this:
y \<in> (\<lambda>x. max (f x) (g x)) ` X

goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> (\<lambda>x. max (f x) (g x)) ` X
[PROOF STEP]
obtain x where \<open>y = max (f x) (g x)\<close> and \<open>x \<in> X\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> (\<lambda>x. max (f x) (g x)) ` X

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>y = max (f x) (g x); x \<in> X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = max (f x) (g x)
x \<in> X

goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
have \<open>f x \<le> Sup (f ` X)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<le> Sup (f ` X)
[PROOF STEP]
by (simp add:  \<open>x \<in> X\<close> \<open>bdd_above (f ` X)\<close> cSUP_upper)
[PROOF STATE]
proof (state)
this:
f x \<le> Sup (f ` X)

goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f x \<le> Sup (f ` X)

goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
have  \<open>g x \<le> Sup (g ` X)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x \<le> Sup (g ` X)
[PROOF STEP]
by (simp add:  \<open>x \<in> X\<close> \<open>bdd_above (g ` X)\<close> cSUP_upper)
[PROOF STATE]
proof (state)
this:
g x \<le> Sup (g ` X)

goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f x \<le> Sup (f ` X)
g x \<le> Sup (g ` X)
[PROOF STEP]
have \<open>max (f x) (g x) \<le> Sup (f ` X)\<close>
[PROOF STATE]
proof (prove)
using this:
f x \<le> Sup (f ` X)
g x \<le> Sup (g ` X)

goal (1 subgoal):
 1. max (f x) (g x) \<le> Sup (f ` X)
[PROOF STEP]
using  \<open>Sup (f ` X) \<ge> Sup (g ` X)\<close>
[PROOF STATE]
proof (prove)
using this:
f x \<le> Sup (f ` X)
g x \<le> Sup (g ` X)
Sup (g ` X) \<le> Sup (f ` X)

goal (1 subgoal):
 1. max (f x) (g x) \<le> Sup (f ` X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max (f x) (g x) \<le> Sup (f ` X)

goal (1 subgoal):
 1. y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> y \<le> Sup (f ` X)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
max (f x) (g x) \<le> Sup (f ` X)

goal (1 subgoal):
 1. y \<le> Sup (f ` X)
[PROOF STEP]
by (simp add: \<open>y = max (f x) (g x)\<close>)
[PROOF STATE]
proof (state)
this:
y \<le> Sup (f ` X)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> ?y \<le> Sup (f ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
have y_f_X: \<open>y \<in> f ` X \<Longrightarrow> y \<le> Sup ((\<lambda> x. max (f x) (g x)) ` X)\<close> for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
assume \<open>y \<in> f ` X\<close>
[PROOF STATE]
proof (state)
this:
y \<in> f ` X

goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> f ` X
[PROOF STEP]
obtain x where \<open>x \<in> X\<close> and \<open>y = f x\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> f ` X

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> X; y = f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> X
y = f x

goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
have  \<open>bdd_above ((\<lambda> \<xi>. max (f \<xi>) (g \<xi>)) ` X)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above ((\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X)
[PROOF STEP]
by (metis (no_types) \<open>bdd_above (f ` X)\<close> \<open>bdd_above (g ` X)\<close> bdd_above_image_sup sup_max)
[PROOF STATE]
proof (state)
this:
bdd_above ((\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X)

goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bdd_above ((\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X)

goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
have \<open>e > 0 \<Longrightarrow> \<exists> k \<in> (\<lambda> \<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + e\<close>
      for e::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<exists>k\<in>(\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + e
[PROOF STEP]
using \<open>Sup (f ` X) \<ge> Sup (g ` X)\<close>
[PROOF STATE]
proof (prove)
using this:
Sup (g ` X) \<le> Sup (f ` X)

goal (1 subgoal):
 1. 0 < e \<Longrightarrow> \<exists>k\<in>(\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + e
[PROOF STEP]
by (smt \<open>x \<in> X\<close> \<open>y = f x\<close> image_eqI)
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<exists>k\<in>(\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + ?e

goal (1 subgoal):
 1. y \<in> f ` X \<Longrightarrow> y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bdd_above ((\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X)
0 < ?e \<Longrightarrow> \<exists>k\<in>(\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + ?e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bdd_above ((\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X)
0 < ?e \<Longrightarrow> \<exists>k\<in>(\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + ?e

goal (1 subgoal):
 1. y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
using \<open>x \<in> X\<close> \<open>y = f x\<close> cSUP_upper
[PROOF STATE]
proof (prove)
using this:
bdd_above ((\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X)
0 < ?e \<Longrightarrow> \<exists>k\<in>(\<lambda>\<xi>. max (f \<xi>) (g \<xi>)) ` X. y \<le> k + ?e
x \<in> X
y = f x
\<lbrakk>?x \<in> ?A; bdd_above (?f ` ?A)\<rbrakk> \<Longrightarrow> ?f ?x \<le> Sup (?f ` ?A)

goal (1 subgoal):
 1. y \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y \<le> (SUP x\<in>X. max (f x) (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> f ` X \<Longrightarrow> ?y \<le> (SUP x\<in>X. max (f x) (g x))

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
have \<open>Sup ((\<lambda> x. max (f x) (g x)) ` X) \<le> Sup (f ` X)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)
[PROOF STEP]
using y_Sup
[PROOF STATE]
proof (prove)
using this:
?y \<in> (\<lambda>x. max (f x) (g x)) ` X \<Longrightarrow> ?y \<le> Sup (f ` X)

goal (1 subgoal):
 1. (SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)
[PROOF STEP]
by (simp add: \<open>X \<noteq> {}\<close> cSup_least)
[PROOF STATE]
proof (state)
this:
(SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
have \<open>Sup ((\<lambda> x. max (f x) (g x)) ` X) \<ge> Sup (f ` X)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (f ` X) \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
using y_f_X
[PROOF STATE]
proof (prove)
using this:
?y \<in> f ` X \<Longrightarrow> ?y \<le> (SUP x\<in>X. max (f x) (g x))

goal (1 subgoal):
 1. Sup (f ` X) \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
by (metis (mono_tags) cSup_least calculation empty_is_image)
[PROOF STATE]
proof (state)
this:
Sup (f ` X) \<le> (SUP x\<in>X. max (f x) (g x))

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)
Sup (f ` X) \<le> (SUP x\<in>X. max (f x) (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)
Sup (f ` X) \<le> (SUP x\<in>X. max (f x) (g x))

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (f ` X)
[PROOF STEP]
unfolding pointwise_max_def
[PROOF STATE]
proof (prove)
using this:
(SUP x\<in>X. max (f x) (g x)) \<le> Sup (f ` X)
Sup (f ` X) \<le> (SUP x\<in>X. max (f x) (g x))

goal (1 subgoal):
 1. (SUP x\<in>X. max (f x) (g x)) = Sup (f ` X)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sup (pointwise_max f g ` X) = Sup (f ` X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_divprod_pow:
  assumes p: "prime_elem p" and ab: "coprime a b" and pab: "p^n dvd a * b"
  shows   "p^n dvd a \<or> p^n dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime_elem p
coprime a b
p ^ n dvd a * b

goal (1 subgoal):
 1. p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>prime_elem p; coprime a b; p ^ n dvd a * b\<rbrakk> \<Longrightarrow> p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
from p
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
[PROOF STEP]
have "\<not> is_unit p"
[PROOF STATE]
proof (prove)
using this:
prime_elem p

goal (1 subgoal):
 1. \<not> is_unit p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> is_unit p

goal (1 subgoal):
 1. \<lbrakk>prime_elem p; coprime a b; p ^ n dvd a * b\<rbrakk> \<Longrightarrow> p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
with ab p
[PROOF STATE]
proof (chain)
picking this:
coprime a b
prime_elem p
\<not> is_unit p
[PROOF STEP]
have "\<not> p dvd a \<or> \<not> p dvd b"
[PROOF STATE]
proof (prove)
using this:
coprime a b
prime_elem p
\<not> is_unit p

goal (1 subgoal):
 1. \<not> p dvd a \<or> \<not> p dvd b
[PROOF STEP]
using not_coprimeI
[PROOF STATE]
proof (prove)
using this:
coprime a b
prime_elem p
\<not> is_unit p
\<lbrakk>?c dvd ?a; ?c dvd ?b; \<not> is_unit ?c\<rbrakk> \<Longrightarrow> \<not> coprime ?a ?b

goal (1 subgoal):
 1. \<not> p dvd a \<or> \<not> p dvd b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> p dvd a \<or> \<not> p dvd b

goal (1 subgoal):
 1. \<lbrakk>prime_elem p; coprime a b; p ^ n dvd a * b\<rbrakk> \<Longrightarrow> p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
with p
[PROOF STATE]
proof (chain)
picking this:
prime_elem p
\<not> p dvd a \<or> \<not> p dvd b
[PROOF STEP]
have "coprime (p ^ n) a \<or> coprime (p ^ n) b"
[PROOF STATE]
proof (prove)
using this:
prime_elem p
\<not> p dvd a \<or> \<not> p dvd b

goal (1 subgoal):
 1. coprime (p ^ n) a \<or> coprime (p ^ n) b
[PROOF STEP]
by (auto dest: prime_elem_imp_power_coprime simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
coprime (p ^ n) a \<or> coprime (p ^ n) b

goal (1 subgoal):
 1. \<lbrakk>prime_elem p; coprime a b; p ^ n dvd a * b\<rbrakk> \<Longrightarrow> p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
with pab
[PROOF STATE]
proof (chain)
picking this:
p ^ n dvd a * b
coprime (p ^ n) a \<or> coprime (p ^ n) b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd a * b
coprime (p ^ n) a \<or> coprime (p ^ n) b

goal (1 subgoal):
 1. p ^ n dvd a \<or> p ^ n dvd b
[PROOF STEP]
by (auto simp add: coprime_dvd_mult_left_iff coprime_dvd_mult_right_iff)
[PROOF STATE]
proof (state)
this:
p ^ n dvd a \<or> p ^ n dvd b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_combine:
  assumes "j \<le> i"
  shows "f i * (\<Prod>l\<leftarrow>[j..<i]. (f l :: 'a::comm_monoid_mult)) = prod_list (map f [j..<Suc i])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i * prod_list (map f [j..<i]) = prod_list (map f [j..<Suc i])
[PROOF STEP]
proof(subst prod_list_map_remove1[of i "[j..<Suc i]" f],goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i \<in> set [j..<Suc i]
 2. f i * prod_list (map f [j..<i]) = f i * prod_list (map f (remove1 i [j..<Suc i]))
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. i \<in> set [j..<Suc i]
 2. f i * prod_list (map f [j..<i]) = f i * prod_list (map f (remove1 i [j..<Suc i]))
[PROOF STEP]
have "remove1 i ([j..<i] @ [i]) = [j..<i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remove1 i ([j..<i] @ [i]) = [j..<i]
[PROOF STEP]
by (simp add: remove1_append)
[PROOF STATE]
proof (state)
this:
remove1 i ([j..<i] @ [i]) = [j..<i]

goal (2 subgoals):
 1. i \<in> set [j..<Suc i]
 2. f i * prod_list (map f [j..<i]) = f i * prod_list (map f (remove1 i [j..<Suc i]))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
remove1 i ([j..<i] @ [i]) = [j..<i]

goal (1 subgoal):
 1. f i * prod_list (map f [j..<i]) = f i * prod_list (map f (remove1 i [j..<Suc i]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f i * prod_list (map f [j..<i]) = f i * prod_list (map f (remove1 i [j..<Suc i]))

goal (1 subgoal):
 1. i \<in> set [j..<Suc i]
[PROOF STEP]
qed (insert assms, auto)


[STATEMENT]
lemma combine_in_carrier [simp, intro]:
  "\<lbrakk> set Ks \<subseteq> carrier R; set Us \<subseteq> carrier R \<rbrakk> \<Longrightarrow> combine Ks Us \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set Ks \<subseteq> carrier R; set Us \<subseteq> carrier R\<rbrakk> \<Longrightarrow> combine Ks Us \<in> carrier R
[PROOF STEP]
by (induct Ks Us rule: combine.induct) (auto)


[STATEMENT]
lemma mult_left_dist_sup:
  assumes "test_set A"
  shows "-p * Sup A = Sup { -p * x | x . x \<in> A }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
have 1: "Sup A * -p = Sup { x * -p | x . x \<in> A }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup A * - p = Sup {x * - p |x. x \<in> A}
[PROOF STEP]
by (simp add: assms mult_right_dist_sup)
[PROOF STATE]
proof (state)
this:
Sup A * - p = Sup {x * - p |x. x \<in> A}

goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
have 2: "-p * Sup A = Sup A * -p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p * Sup A = Sup A * - p
[PROOF STEP]
by (metis assms sub_comm sup_test)
[PROOF STATE]
proof (state)
this:
- p * Sup A = Sup A * - p

goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
have "{ -p * x | x . x \<in> A } = { x * -p | x . x \<in> A }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {- p * x |x. x \<in> A} = {x * - p |x. x \<in> A}
[PROOF STEP]
by (metis assms test_set_def tests_dual.sub_commutative)
[PROOF STATE]
proof (state)
this:
{- p * x |x. x \<in> A} = {x * - p |x. x \<in> A}

goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{- p * x |x. x \<in> A} = {x * - p |x. x \<in> A}

goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
{- p * x |x. x \<in> A} = {x * - p |x. x \<in> A}
Sup A * - p = Sup {x * - p |x. x \<in> A}
- p * Sup A = Sup A * - p

goal (1 subgoal):
 1. - p * Sup A = Sup {- p * x |x. x \<in> A}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- p * Sup A = Sup {- p * x |x. x \<in> A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Maclaurin_cos_expansion2:
  assumes "x > 0" "n > 0"
  shows "\<exists>t. 0 < t \<and> t < x \<and>
      cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + (cos (t + 1/2 * real n * pi) / fact n) * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
let ?diff = "\<lambda>n x. cos (x + 1/2 * real n * pi)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
have "\<exists>t. 0 < t \<and> t < x \<and> cos x = (\<Sum>m<n. ?diff m 0 / (fact m) * x ^ m) + ?diff n t / fact n * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
proof (rule Maclaurin)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 < x
 2. 0 < n
 3. (\<lambda>a. cos (a + 1 / 2 * real 0 * pi)) = cos
 4. \<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>a. cos (a + 1 / 2 * real m * pi)) has_real_derivative cos (t + 1 / 2 * real (Suc m) * pi)) (at t)
[PROOF STEP]
show "\<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow>
              ((\<lambda>u. cos (u + 1 / 2 * real m * pi)) has_real_derivative
               cos (t + 1 / 2 * real (Suc m) * pi)) (at t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>u. cos (u + 1 / 2 * real m * pi)) has_real_derivative cos (t + 1 / 2 * real (Suc m) * pi)) (at t)
[PROOF STEP]
by (simp add: cos_expansion_lemma del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>u. cos (u + 1 / 2 * real m * pi)) has_real_derivative cos (t + 1 / 2 * real (Suc m) * pi)) (at t)

goal (3 subgoals):
 1. 0 < x
 2. 0 < n
 3. (\<lambda>a. cos (a + 1 / 2 * real 0 * pi)) = cos
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
\<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
apply (rule ex_forward, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t \<and> t < x \<and> cos x = (\<Sum>m<n. cos (real m * pi / 2) * x ^ m / fact m) + cos (t + real n * pi / 2) * x ^ n / fact n; \<exists>ta>0. ta < x \<and> cos (t + real n * pi / 2) = cos (ta + real n * pi / 2)\<rbrakk> \<Longrightarrow> (\<Sum>m<n. cos (real m * pi / 2) * x ^ m / fact m) = (\<Sum>m<n. cos_coeff m * x ^ m)
[PROOF STEP]
apply (rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t xa. \<lbrakk>0 < t \<and> t < x \<and> cos x = (\<Sum>m<n. cos (real m * pi / 2) * x ^ m / fact m) + cos (t + real n * pi / 2) * x ^ n / fact n; \<exists>ta>0. ta < x \<and> cos (t + real n * pi / 2) = cos (ta + real n * pi / 2); xa \<in> {..<n}\<rbrakk> \<Longrightarrow> cos (real xa * pi / 2) * x ^ xa / fact xa = cos_coeff xa * x ^ xa
[PROOF STEP]
apply (auto simp: cos_coeff_def cos_zero_iff elim: evenE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>t>0. t < x \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_mult_mono_strict:
  fixes a b c d::ereal
  assumes "b > 0" "c > 0" "a < b" "c < d"
  shows "a * c < b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
have "c < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < \<infinity>
[PROOF STEP]
using \<open>c < d\<close>
[PROOF STATE]
proof (prove)
using this:
c < d

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

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c < \<infinity>
[PROOF STEP]
have "a * c < b * c"
[PROOF STATE]
proof (prove)
using this:
c < \<infinity>

goal (1 subgoal):
 1. a * c < b * c
[PROOF STEP]
by (metis ereal_mult_strict_left_mono[OF assms(3) assms(2)] mult.commute)
[PROOF STATE]
proof (state)
this:
a * c < b * c

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a * c < b * c

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
have "b * c \<le> b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * c \<le> b * d
[PROOF STEP]
using assms(2) assms(4)
[PROOF STATE]
proof (prove)
using this:
0 < c
c < d

goal (1 subgoal):
 1. b * c \<le> b * d
[PROOF STEP]
by (simp add: assms(1) ereal_mult_left_mono less_imp_le)
[PROOF STATE]
proof (state)
this:
b * c \<le> b * d

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a * c < b * c
b * c \<le> b * d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a * c < b * c
b * c \<le> b * d

goal (1 subgoal):
 1. a * c < b * d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a * c < b * d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem completeness: "finite H ==> H |= p ==> H |- p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite H; H |= p\<rbrakk> \<Longrightarrow> H |- p
[PROOF STEP]
apply (induct arbitrary: p rule: finite_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p. {} |= p \<Longrightarrow> {} |- p
 2. \<And>x F p. \<lbrakk>finite F; x \<notin> F; \<And>p. F |= p \<Longrightarrow> F |- p; insert x F |= p\<rbrakk> \<Longrightarrow> insert x F |- p
[PROOF STEP]
apply (blast intro: completeness_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F p. \<lbrakk>finite F; x \<notin> F; \<And>p. F |= p \<Longrightarrow> F |- p; insert x F |= p\<rbrakk> \<Longrightarrow> insert x F |- p
[PROOF STEP]
apply (iprover intro: sat_imp thms.H insertI1 weaken_left_insert [THEN thms.MP])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma minimize_wrt_append:
  assumes "\<forall>x\<in>set xs. \<forall>y\<in>set (xs @ ys). P y x"
  shows "minimize_wrt P (xs @ ys) = xs @ filter (\<lambda>y. \<forall>x\<in>set xs. P x y) (minimize_wrt P ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minimize_wrt P (xs @ ys) = xs @ filter (\<lambda>y. \<forall>x\<in>set xs. P x y) (minimize_wrt P ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>set xs. \<forall>y\<in>set (xs @ ys). P y x

goal (1 subgoal):
 1. minimize_wrt P (xs @ ys) = xs @ filter (\<lambda>y. \<forall>x\<in>set xs. P x y) (minimize_wrt P ys)
[PROOF STEP]
by (induct xs) (auto intro: filter_cong)


[STATEMENT]
lemma d_OUT_split_Vertex [simp]: "d_OUT (split f) (Vertex x) = d_OUT f x" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (split f) (Vertex x) = d_OUT f x
[PROOF STEP]
proof(rule trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d_OUT (split f) (Vertex x) = ?s
 2. ?s = d_OUT f x
[PROOF STEP]
show "?lhs = (\<Sum>\<^sup>+ v'\<in>range (Edge x). split f (Vertex x, v'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (split f) (Vertex x) = (\<Sum>\<^sup>+ v'\<in>range (Edge x). split f (Vertex x, v'))
[PROOF STEP]
by(auto intro!: nn_integral_cong split_Vertex1_eq_0I simp add: d_OUT_def nn_integral_count_space_indicator split: split_indicator)
[PROOF STATE]
proof (state)
this:
d_OUT (split f) (Vertex x) = (\<Sum>\<^sup>+ v'\<in>range (Edge x). split f (Vertex x, v'))

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ v'\<in>range (Edge x). split f (Vertex x, v')) = d_OUT f x
[PROOF STEP]
show "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ v'\<in>range (Edge x). split f (Vertex x, v')) = d_OUT f x
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex d_OUT_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ v'\<in>range (Edge x). split f (Vertex x, v')) = d_OUT f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_leq_pref:
  assumes "x \<in> carrier" and "y \<in> carrier"
  shows "card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
   \<longleftrightarrow> y \<succeq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)) = y \<succeq> x
[PROOF STEP]
proof (rule iffI, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation) \<Longrightarrow> y \<succeq> x
 2. y \<succeq> x \<Longrightarrow> card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)

goal (2 subgoals):
 1. card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation) \<Longrightarrow> y \<succeq> x
 2. y \<succeq> x \<Longrightarrow> card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)

goal (1 subgoal):
 1. y \<succeq> x
[PROOF STEP]
using assms(1) assms(2) nbt_subset_imp_card_leq no_better_thansubset_rel
[PROOF STATE]
proof (prove)
using this:
card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
x \<in> carrier
y \<in> carrier
\<lbrakk>?x \<in> carrier; ?y \<in> carrier\<rbrakk> \<Longrightarrow> (no_better_than ?x carrier relation \<subseteq> no_better_than ?y carrier relation) = (card (no_better_than ?x carrier relation) \<le> card (no_better_than ?y carrier relation))
\<lbrakk>?x \<in> carrier; ?y \<in> carrier; no_better_than ?y carrier relation \<subseteq> no_better_than ?x carrier relation\<rbrakk> \<Longrightarrow> ?x \<succeq> ?y

goal (1 subgoal):
 1. y \<succeq> x
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
y \<succeq> x

goal (1 subgoal):
 1. y \<succeq> x \<Longrightarrow> card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<succeq> x \<Longrightarrow> card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
y \<succeq> x

goal (1 subgoal):
 1. y \<succeq> x \<Longrightarrow> card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<succeq> x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
y \<succeq> x

goal (1 subgoal):
 1. card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
using assms(1) assms(2) nbt_subset_imp_card_leq no_better_subset_pref
[PROOF STATE]
proof (prove)
using this:
y \<succeq> x
x \<in> carrier
y \<in> carrier
\<lbrakk>?x \<in> carrier; ?y \<in> carrier\<rbrakk> \<Longrightarrow> (no_better_than ?x carrier relation \<subseteq> no_better_than ?y carrier relation) = (card (no_better_than ?x carrier relation) \<le> card (no_better_than ?y carrier relation))
?x \<succeq> ?y \<Longrightarrow> no_better_than ?y carrier relation \<subseteq> no_better_than ?x carrier relation

goal (1 subgoal):
 1. card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card (no_better_than x carrier relation) \<le> card (no_better_than y carrier relation)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lucas_lehmer_mult_cong:
  "[fst (lucas_lehmer_mult m x y) = fst x * fst y + 3 * snd x * snd y] (mod m)"
  "[snd (lucas_lehmer_mult m x y) = fst x * snd y + snd x * fst y] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [fst (lucas_lehmer_mult m x y) = fst x * fst y + 3 * snd x * snd y] (mod m) &&& [snd (lucas_lehmer_mult m x y) = fst x * snd y + snd x * fst y] (mod m)
[PROOF STEP]
by (simp_all add: lucas_lehmer_mult_def cong_def case_prod_unfold)


[STATEMENT]
lemma ccspan_range_ket[simp]: "ccspan (range ket) = (top::('a ell2 ccsubspace))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (range ket) = \<top>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ccspan (range ket) = \<top>
[PROOF STEP]
have \<open>closure (complex_vector.span (range ket)) = (UNIV::'a ell2 set)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan (range ket)) = UNIV
[PROOF STEP]
using Complex_L2.closed_cspan_range_ket
[PROOF STATE]
proof (prove)
using this:
closure (cspan (range ket)) = UNIV

goal (1 subgoal):
 1. closure (cspan (range ket)) = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closure (cspan (range ket)) = UNIV

goal (1 subgoal):
 1. ccspan (range ket) = \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
closure (cspan (range ket)) = UNIV

goal (1 subgoal):
 1. ccspan (range ket) = \<top>
[PROOF STEP]
by (simp add: ccspan.abs_eq top_ccsubspace.abs_eq)
[PROOF STATE]
proof (state)
this:
ccspan (range ket) = \<top>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gauge_integral_by_substitution:
  fixes f::"(real \<Rightarrow> real)" and
    g::"(real \<Rightarrow> real)" and
    g'::"real \<Rightarrow> real" and
    a::"real" and
    b::"real"
  assumes a_le_b: "a \<le> b" and
    ga_le_gb: "g a \<le> g b" and
    g'_derivative: "\<forall>x \<in> {a..b}. (g has_vector_derivative (g' x)) (at x within {a..b})" and
    g'_continuous: "continuous_on {a..b} g'" and
    f_continuous: "continuous_on (g ` {a..b}) f"
  shows "integral {g a..g b} (f) = integral {a..b} (\<lambda>x. f(g x) * (g' x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
have "\<forall>x \<in> {a..b}. (g has_real_derivative (g' x)) (at x within {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{a..b}. (g has_real_derivative g' x) (at x within {a..b})
[PROOF STEP]
using has_real_derivative_iff_has_vector_derivative[of "g"] and g'_derivative
[PROOF STATE]
proof (prove)
using this:
(g has_real_derivative ?y) ?F = (g has_vector_derivative ?y) ?F
\<forall>x\<in>{a..b}. (g has_vector_derivative g' x) (at x within {a..b})

goal (1 subgoal):
 1. \<forall>x\<in>{a..b}. (g has_real_derivative g' x) (at x within {a..b})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{a..b}. (g has_real_derivative g' x) (at x within {a..b})

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{a..b}. (g has_real_derivative g' x) (at x within {a..b})
[PROOF STEP]
have 2: "interval_lebesgue_integral lborel (ereal (a)) (ereal (b)) (\<lambda>x. g' x *\<^sub>R f (g x))
                    = interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{a..b}. (g has_real_derivative g' x) (at x within {a..b})

goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f
[PROOF STEP]
using interval_integral_substitution_finite[of "a" "b" "g" "g'" "f"] and g'_continuous and a_le_b and f_continuous
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{a..b}. (g has_real_derivative g' x) (at x within {a..b})
\<lbrakk>a \<le> b; \<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (g has_real_derivative g' x) (at x within {a..b}); continuous_on (g ` {a..b}) f; continuous_on {a..b} g'\<rbrakk> \<Longrightarrow> LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f
continuous_on {a..b} g'
a \<le> b
continuous_on (g ` {a..b}) f

goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
have g_continuous: "continuous_on {a .. b}  g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} g
[PROOF STEP]
using Derivative.differentiable_imp_continuous_on
[PROOF STATE]
proof (prove)
using this:
?f differentiable_on ?s \<Longrightarrow> continuous_on ?s ?f

goal (1 subgoal):
 1. continuous_on {a..b} g
[PROOF STEP]
apply (simp add: differentiable_on_def differentiable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f s. \<forall>x\<in>s. \<exists>D. (f has_derivative D) (at x within s) \<Longrightarrow> continuous_on s f) \<Longrightarrow> continuous_on {a..b} g
[PROOF STEP]
by (metis continuous_on_vector_derivative g'_derivative)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} g

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
have "set_integrable lborel {a .. b} (\<lambda>x. g' x *\<^sub>R f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
have "continuous_on {a .. b} (\<lambda>x. g' x *\<^sub>R f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
have "continuous_on {a .. b} (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
using Topological_Spaces.continuous_on_compose f_continuous g_continuous
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
continuous_on (g ` {a..b}) f
continuous_on {a..b} g

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
using Limits.continuous_on_mult g'_continuous
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (\<lambda>x. f (g x))
\<lbrakk>continuous_on ?s ?f; continuous_on ?s ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (\<lambda>x. ?f x * ?g x)
continuous_on {a..b} g'

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal (1 subgoal):
 1. set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal (1 subgoal):
 1. set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
using borel_integrable_atLeastAtMost'
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
continuous_on {?a..?b} ?f \<Longrightarrow> set_integrable lborel {?a..?b} ?f

goal (1 subgoal):
 1. set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
have 0: "interval_lebesgue_integral lborel (ereal (a)) (ereal (b)) (\<lambda>x. g' x *\<^sub>R f (g x))
                      = integral {a .. b} (\<lambda>x. g' x *\<^sub>R f (g x))"
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = integral {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
using a_le_b and interval_integral_eq_integral
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
a \<le> b
\<lbrakk>?a \<le> ?b; set_integrable lborel {?a..?b} ?f\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel (ereal ?a) (ereal ?b) ?f = integral {?a..?b} ?f

goal (1 subgoal):
 1. LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = integral {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = integral {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
have "set_integrable lborel {g a .. g b} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {g a..g b} f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable lborel {g a..g b} f
[PROOF STEP]
have "continuous_on {g a .. g b} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {g a..g b} f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on {g a..g b} f
[PROOF STEP]
have "{g a .. g b} \<subseteq> g ` {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {g a..g b} \<subseteq> g ` {a..b}
[PROOF STEP]
using g_continuous
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} g

goal (1 subgoal):
 1. {g a..g b} \<subseteq> g ` {a..b}
[PROOF STEP]
by (metis a_le_b atLeastAtMost_iff atLeastatMost_subset_iff continuous_image_closed_interval imageI order_refl)
[PROOF STATE]
proof (state)
this:
{g a..g b} \<subseteq> g ` {a..b}

goal (1 subgoal):
 1. continuous_on {g a..g b} f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{g a..g b} \<subseteq> g ` {a..b}
[PROOF STEP]
show "continuous_on {g a .. g b} f"
[PROOF STATE]
proof (prove)
using this:
{g a..g b} \<subseteq> g ` {a..b}

goal (1 subgoal):
 1. continuous_on {g a..g b} f
[PROOF STEP]
using f_continuous continuous_on_subset
[PROOF STATE]
proof (prove)
using this:
{g a..g b} \<subseteq> g ` {a..b}
continuous_on (g ` {a..b}) f
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f

goal (1 subgoal):
 1. continuous_on {g a..g b} f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on {g a..g b} f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on {g a..g b} f

goal (1 subgoal):
 1. set_integrable lborel {g a..g b} f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {g a..g b} f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on {g a..g b} f

goal (1 subgoal):
 1. set_integrable lborel {g a..g b} f
[PROOF STEP]
using borel_integrable_atLeastAtMost'
[PROOF STATE]
proof (prove)
using this:
continuous_on {g a..g b} f
continuous_on {?a..?b} ?f \<Longrightarrow> set_integrable lborel {?a..?b} ?f

goal (1 subgoal):
 1. set_integrable lborel {g a..g b} f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set_integrable lborel {g a..g b} f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_integrable lborel {g a..g b} f

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_integrable lborel {g a..g b} f
[PROOF STEP]
have 1: "interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f
                      = integral {g a .. g b} f"
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {g a..g b} f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f
[PROOF STEP]
using ga_le_gb and interval_integral_eq_integral
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {g a..g b} f
g a \<le> g b
\<lbrakk>?a \<le> ?b; set_integrable lborel {?a..?b} ?f\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel (ereal ?a) (ereal ?b) ?f = integral {?a..?b} ?f

goal (1 subgoal):
 1. interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f
[PROOF STEP]
by (metis (no_types))
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
using 0 and 1 and 2
[PROOF STATE]
proof (prove)
using this:
interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f
LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = integral {a..b} (\<lambda>x. g' x *\<^sub>R f (g x))
interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f = integral {g a..g b} f
LBINT x=ereal a..ereal b. g' x *\<^sub>R f (g x) = interval_lebesgue_integral lborel (ereal (g a)) (ereal (g b)) f

goal (1 subgoal):
 1. integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)
[PROOF STEP]
by (metis (no_types, lifting)  Henstock_Kurzweil_Integration.integral_cong mult.commute real_scaleR_def)
[PROOF STATE]
proof (state)
this:
integral {g a..g b} f = integral {a..b} (\<lambda>x. f (g x) * g' x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "OF_match_fields m p =
  (if \<exists>f \<in> m. \<not>prerequisites f m then None else
    if \<forall>f \<in> m. match_no_prereq f p then Some True else Some False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OF_match_fields m p = (if \<exists>f\<in>m. \<not> prerequisites f m then None else if \<forall>f\<in>m. match_no_prereq f p then Some True else Some False)
[PROOF STEP]
by(fact OF_match_fields_alt)


[STATEMENT]
lemma llist_all2_lsetD2: "\<lbrakk> llist_all2 P xs ys; y \<in> lset ys \<rbrakk> \<Longrightarrow> \<exists>x\<in>lset xs. P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>llist_all2 P xs ys; y \<in> lset ys\<rbrakk> \<Longrightarrow> \<exists>x\<in>lset xs. P x y
[PROOF STEP]
by(auto 4 4 simp add: llist_all2_conv_lzip lset_lzip lset_conv_lnth split_beta lnth_lzip simp del: split_paired_All)


[STATEMENT]
lemma fcard_seteq: "A |\<subseteq>| B \<Longrightarrow> fcard B \<le> fcard A \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A |\<subseteq>| B; fcard B \<le> fcard A\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by transfer (rule card_seteq)


[STATEMENT]
lemma transp_on_list_emb:
  assumes "transp_on P A"
  shows "transp_on (list_emb P) (lists A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp_on (list_emb P) (lists A)
[PROOF STEP]
using assms and list_emb_trans [of _ _ _ P]
[PROOF STATE]
proof (prove)
using this:
transp_on P A
\<lbrakk>\<And>x y z. \<lbrakk>x \<in> set ?xs; y \<in> set ?ys; z \<in> set ?zs; P x y; P y z\<rbrakk> \<Longrightarrow> P x z; list_emb P ?xs ?ys; list_emb P ?ys ?zs\<rbrakk> \<Longrightarrow> list_emb P ?xs ?zs

goal (1 subgoal):
 1. transp_on (list_emb P) (lists A)
[PROOF STEP]
unfolding transp_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. \<forall>y\<in>A. \<forall>z\<in>A. P x y \<and> P y z \<longrightarrow> P x z
\<lbrakk>\<And>x y z. \<lbrakk>x \<in> set ?xs; y \<in> set ?ys; z \<in> set ?zs; P x y; P y z\<rbrakk> \<Longrightarrow> P x z; list_emb P ?xs ?ys; list_emb P ?ys ?zs\<rbrakk> \<Longrightarrow> list_emb P ?xs ?zs

goal (1 subgoal):
 1. \<forall>x\<in>lists A. \<forall>y\<in>lists A. \<forall>z\<in>lists A. list_emb P x y \<and> list_emb P y z \<longrightarrow> list_emb P x z
[PROOF STEP]
by blast


[STATEMENT]
lemma quat_eq_0_iff: "q = 0 \<longleftrightarrow> (Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (q = 0) = ((quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. q = 0 \<Longrightarrow> (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0
 2. (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0 \<Longrightarrow> q = 0
[PROOF STEP]
assume "(quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0"
[PROOF STATE]
proof (state)
this:
(quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0
 2. (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0 \<Longrightarrow> q = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0
[PROOF STEP]
have "\<forall>qa. qa - q = qa"
[PROOF STATE]
proof (prove)
using this:
(quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0

goal (1 subgoal):
 1. \<forall>qa. qa - q = qa
[PROOF STEP]
by (simp add: add_nonneg_eq_0_iff minus_quat.ctr)
[PROOF STATE]
proof (state)
this:
\<forall>qa. qa - q = qa

goal (2 subgoals):
 1. q = 0 \<Longrightarrow> (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0
 2. (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0 \<Longrightarrow> q = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>qa. qa - q = qa
[PROOF STEP]
show "q = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>qa. qa - q = qa

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

goal (1 subgoal):
 1. q = 0 \<Longrightarrow> (quat.Re q)\<^sup>2 + (Im1 q)\<^sup>2 + (Im2 q)\<^sup>2 + (Im3 q)\<^sup>2 = 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in monoid) nat_pow_mult:
  "x \<in> carrier G ==> x [^] (n::nat) \<otimes> x [^] m = x [^] (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> x [^] n \<otimes> x [^] m = x [^] (n + m)
[PROOF STEP]
by (induct m) (simp_all add: m_assoc [THEN sym])


[STATEMENT]
lemma drop_n:
  fixes n :: nat and l :: "'a list" and g :: "'a list"
  assumes "drop n l = drop n g" and "Suc n \<le> length g" and "length l = length g"
  shows "drop (Suc n) (l[n := g!n]) = drop (Suc n) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop (Suc n) (l[n := g ! n]) = drop (Suc n) g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. drop (Suc n) (l[n := g ! n]) = drop (Suc n) g
[PROOF STEP]
from assms(2-3)
[PROOF STATE]
proof (chain)
picking this:
Suc n \<le> length g
length l = length g
[PROOF STEP]
have "Suc n \<le> length l"
[PROOF STATE]
proof (prove)
using this:
Suc n \<le> length g
length l = length g

goal (1 subgoal):
 1. Suc n \<le> length l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc n \<le> length l

goal (1 subgoal):
 1. drop (Suc n) (l[n := g ! n]) = drop (Suc n) g
[PROOF STEP]
from drop_n_lem[OF this] assms(1)
[PROOF STATE]
proof (chain)
picking this:
drop (Suc n) (l[n := ?x]) = drop (Suc n) l
drop n l = drop n g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
drop (Suc n) (l[n := ?x]) = drop (Suc n) l
drop n l = drop n g

goal (1 subgoal):
 1. drop (Suc n) (l[n := g ! n]) = drop (Suc n) g
[PROOF STEP]
by (simp, (subst drop_Suc)+, (subst drop_tl)+, simp)
[PROOF STATE]
proof (state)
this:
drop (Suc n) (l[n := g ! n]) = drop (Suc n) g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_nat_iff_bounded: "finite S \<longleftrightarrow> (\<exists>k. S \<subseteq> {..<k})"
  for S :: "nat set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S = (\<exists>k. S \<subseteq> {..<k})
[PROOF STEP]
using infinite_nat_iff_unbounded_le[of S]
[PROOF STATE]
proof (prove)
using this:
infinite S = (\<forall>m. \<exists>n\<ge>m. n \<in> S)

goal (1 subgoal):
 1. finite S = (\<exists>k. S \<subseteq> {..<k})
[PROOF STEP]
by (simp add: subset_eq) (metis not_le)


[STATEMENT]
lemma nonneg_dirichlet_series_mult [intro]:
  assumes "nonneg_dirichlet_series f" "nonneg_dirichlet_series g"
  shows   "nonneg_dirichlet_series (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f * g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f * g)
[PROOF STEP]
interpret f: nonneg_dirichlet_series f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f * g)
[PROOF STEP]
interpret g: nonneg_dirichlet_series g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series g
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f * g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nonneg_dirichlet_series (f * g)
[PROOF STEP]
by standard (auto intro!: nonneg_Reals_sum nonneg_Reals_mult_I f.nonneg_coeffs g.nonneg_coeffs
                      simp: fds_nth_mult dirichlet_prod_def)
[PROOF STATE]
proof (state)
this:
nonneg_dirichlet_series (f * g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bex_Infinitesimal_iff2: "(\<exists>y \<in> Infinitesimal. x = z + y) \<longleftrightarrow> x \<approx> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y\<in>Infinitesimal. x = z + y) = (x \<approx> z)
[PROOF STEP]
by (force simp add: bex_Infinitesimal_iff [symmetric])


[STATEMENT]
lemma ssorted_monoD: "ssorted s \<Longrightarrow> i \<le> j \<Longrightarrow> s !! i \<le> s !! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j
[PROOF STEP]
proof (induct "j - i" arbitrary: j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j. \<lbrakk>0 = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j
 2. \<And>x j. \<lbrakk>\<And>j. \<lbrakk>x = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j; Suc x = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = ?j - i; ssorted s; i \<le> ?j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! ?j
Suc x = j - i
ssorted s
i \<le> j

goal (2 subgoals):
 1. \<And>j. \<lbrakk>0 = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j
 2. \<And>x j. \<lbrakk>\<And>j. \<lbrakk>x = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j; Suc x = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j
[PROOF STEP]
from Suc(1)[of "j - 1"] Suc(2-4) ssortedD[of s "j - 1"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x = j - 1 - i; ssorted s; i \<le> j - 1\<rbrakk> \<Longrightarrow> s !! i \<le> s !! (j - 1)
Suc x = j - i
ssorted s
i \<le> j
ssorted s \<Longrightarrow> s !! (j - 1) \<le> stl s !! (j - 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = j - 1 - i; ssorted s; i \<le> j - 1\<rbrakk> \<Longrightarrow> s !! i \<le> s !! (j - 1)
Suc x = j - i
ssorted s
i \<le> j
ssorted s \<Longrightarrow> s !! (j - 1) \<le> stl s !! (j - 1)

goal (1 subgoal):
 1. s !! i \<le> s !! j
[PROOF STEP]
by (cases j) (auto simp: le_Suc_eq Suc_diff_le)
[PROOF STATE]
proof (state)
this:
s !! i \<le> s !! j

goal (1 subgoal):
 1. \<And>j. \<lbrakk>0 = j - i; ssorted s; i \<le> j\<rbrakk> \<Longrightarrow> s !! i \<le> s !! j
[PROOF STEP]
qed simp


[STATEMENT]
lemma similar_mat_wit_kernel_dim: assumes A: "A \<in> carrier_mat n n"
  and wit: "similar_mat_wit A B P Q"
  shows "kernel.dim n A = kernel.dim n B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)
[PROOF STEP]
from similar_mat_witD2[OF A wit]
[PROOF STATE]
proof (chain)
picking this:
P * Q = 1\<^sub>m n
Q * P = 1\<^sub>m n
A = P * B * Q
A \<in> carrier_mat n n
B \<in> carrier_mat n n
P \<in> carrier_mat n n
Q \<in> carrier_mat n n
[PROOF STEP]
have QP: "Q * P = 1\<^sub>m n" and AB: "A = P * B * Q" and
    A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n n" and P: "P \<in> carrier_mat n n" and Q: "Q \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
P * Q = 1\<^sub>m n
Q * P = 1\<^sub>m n
A = P * B * Q
A \<in> carrier_mat n n
B \<in> carrier_mat n n
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. (Q * P = 1\<^sub>m n &&& A = P * B * Q &&& A \<in> carrier_mat n n) &&& B \<in> carrier_mat n n &&& P \<in> carrier_mat n n &&& Q \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Q * P = 1\<^sub>m n
A = P * B * Q
A \<in> carrier_mat n n
B \<in> carrier_mat n n
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)
[PROOF STEP]
from P B
[PROOF STATE]
proof (chain)
picking this:
P \<in> carrier_mat n n
B \<in> carrier_mat n n
[PROOF STEP]
have PB: "P * B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. P * B \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * B \<in> carrier_mat n n

goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)
[PROOF STEP]
unfolding AB mat_kernel_dim_mult_eq_right[OF PB Q P QP] mat_kernel_mult_eq[OF B P Q QP]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma OrdLeast_Ord:
  assumes "Ord k" "P k"shows "Ord(LEAST n. Ord n \<and> P n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord (LEAST n. Ord n \<and> P n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Ord (LEAST n. Ord n \<and> P n)
[PROOF STEP]
obtain n where "Ord n" "P n" "\<forall>m. Ord m \<and> P m \<longrightarrow> n \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<lbrakk>Ord n; P n; \<forall>m. Ord m \<and> P m \<longrightarrow> n \<le> m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Ord_minimal assms)
[PROOF STATE]
proof (state)
this:
Ord n
P n
\<forall>m. Ord m \<and> P m \<longrightarrow> n \<le> m

goal (1 subgoal):
 1. Ord (LEAST n. Ord n \<and> P n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Ord n
P n
\<forall>m. Ord m \<and> P m \<longrightarrow> n \<le> m

goal (1 subgoal):
 1. Ord (LEAST n. Ord n \<and> P n)
[PROOF STEP]
by (metis (lifting) Least_equality)
[PROOF STATE]
proof (state)
this:
Ord (LEAST n. Ord n \<and> P n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_ord_l_bal:
 "is_ord (MKT\<^sub>0 x l r) \<Longrightarrow> height l = Suc (Suc (height r)) \<Longrightarrow>
  is_ord (l_bal\<^sub>0 x l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_ord (MKT\<^sub>0 x l r); height l = Suc (Suc (height r))\<rbrakk> \<Longrightarrow> is_ord (l_bal\<^sub>0 x l r)
[PROOF STEP]
by (cases l) (auto split: tree\<^sub>0.splits intro: order_less_trans)


[STATEMENT]
lemma exCasePairSimp: "(\<exists>x. x \<in> A \<and> (case x of (e1, e2) \<Rightarrow> P e1 e2)) = (\<exists>(e1, e2) \<in> A. (P e1 e2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. x \<in> A \<and> (case x of (e1, e2) \<Rightarrow> P e1 e2)) = (\<exists>(e1, e2)\<in>A. P e1 e2)
[PROOF STEP]
by auto


[STATEMENT]
lemma eventually_at_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>t. t \<in> ball z d \<and> t \<in> A) (at z within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d \<Longrightarrow> \<forall>\<^sub>F t in at z within A. t \<in> ball z d \<and> t \<in> A
[PROOF STEP]
unfolding eventually_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d \<Longrightarrow> \<exists>da>0. \<forall>x\<in>A. x \<noteq> z \<and> dist x z < da \<longrightarrow> x \<in> ball z d \<and> x \<in> A
[PROOF STEP]
by (intro exI[of _ d]) (simp_all add: dist_commute)


[STATEMENT]
lemma not_ccw'_eq: "\<not> ccw' t p s \<longleftrightarrow> ccw' t s p \<or> det3 t s p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> ccw' t p s) = (ccw' t s p \<or> det3 t s p = 0)
[PROOF STEP]
by (auto simp: ccw'_def det3_def' algebra_simps)


[STATEMENT]
lemma zero_less_ceiling [simp]: "0 < \<lceil>x\<rceil> \<longleftrightarrow> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < \<lceil>x\<rceil>) = ((0::'a) < x)
[PROOF STEP]
by (simp add: less_ceiling_iff)


[STATEMENT]
theorem second_countable_borel_measurable:
  fixes X :: "'a::second_countable_topology set set"
  assumes eq: "open = generate_topology X"
  shows "borel = sigma UNIV X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel = sigma UNIV X
[PROOF STEP]
unfolding borel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma UNIV (Collect open) = sigma UNIV X
[PROOF STEP]
proof (intro sigma_eqI sigma_sets_eqI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Collect open \<subseteq> Pow UNIV
 2. X \<subseteq> Pow UNIV
 3. \<And>a. a \<in> Collect open \<Longrightarrow> a \<in> sigma_sets UNIV X
 4. \<And>b. b \<in> X \<Longrightarrow> b \<in> sigma_sets UNIV (Collect open)
[PROOF STEP]
interpret X: sigma_algebra UNIV "sigma_sets UNIV X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra UNIV (sigma_sets UNIV X)
[PROOF STEP]
by (rule sigma_algebra_sigma_sets) simp
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Collect open \<subseteq> Pow UNIV
 2. X \<subseteq> Pow UNIV
 3. \<And>a. a \<in> Collect open \<Longrightarrow> a \<in> sigma_sets UNIV X
 4. \<And>b. b \<in> X \<Longrightarrow> b \<in> sigma_sets UNIV (Collect open)
[PROOF STEP]
fix S :: "'a set"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Collect open \<subseteq> Pow UNIV
 2. X \<subseteq> Pow UNIV
 3. \<And>a. a \<in> Collect open \<Longrightarrow> a \<in> sigma_sets UNIV X
 4. \<And>b. b \<in> X \<Longrightarrow> b \<in> sigma_sets UNIV (Collect open)
[PROOF STEP]
assume "S \<in> Collect open"
[PROOF STATE]
proof (state)
this:
S \<in> Collect open

goal (4 subgoals):
 1. Collect open \<subseteq> Pow UNIV
 2. X \<subseteq> Pow UNIV
 3. \<And>a. a \<in> Collect open \<Longrightarrow> a \<in> sigma_sets UNIV X
 4. \<And>b. b \<in> X \<Longrightarrow> b \<in> sigma_sets UNIV (Collect open)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<in> Collect open
[PROOF STEP]
have "generate_topology X S"
[PROOF STATE]
proof (prove)
using this:
S \<in> Collect open

goal (1 subgoal):
 1. generate_topology X S
[PROOF STEP]
by (auto simp: eq)
[PROOF STATE]
proof (state)
this:
generate_topology X S

goal (4 subgoals):
 1. Collect open \<subseteq> Pow UNIV
 2. X \<subseteq> Pow UNIV
 3. \<And>a. a \<in> Collect open \<Longrightarrow> a \<in> sigma_sets UNIV X
 4. \<And>b. b \<in> X \<Longrightarrow> b \<in> sigma_sets UNIV (Collect open)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generate_topology X S
[PROOF STEP]
show "S \<in> sigma_sets UNIV X"
[PROOF STATE]
proof (prove)
using this:
generate_topology X S

goal (1 subgoal):
 1. S \<in> sigma_sets UNIV X
[PROOF STEP]
proof induction
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
case (UN K)
[PROOF STATE]
proof (state)
this:
?k \<in> K \<Longrightarrow> generate_topology X ?k
?k \<in> K \<Longrightarrow> ?k \<in> sigma_sets UNIV X

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k \<in> K \<Longrightarrow> generate_topology X ?k
?k \<in> K \<Longrightarrow> ?k \<in> sigma_sets UNIV X
[PROOF STEP]
have K: "\<And>k. k \<in> K \<Longrightarrow> open k"
[PROOF STATE]
proof (prove)
using this:
?k \<in> K \<Longrightarrow> generate_topology X ?k
?k \<in> K \<Longrightarrow> ?k \<in> sigma_sets UNIV X

goal (1 subgoal):
 1. \<And>k. k \<in> K \<Longrightarrow> open k
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
using this:
?k \<in> K \<Longrightarrow> generate_topology X ?k
?k \<in> K \<Longrightarrow> ?k \<in> sigma_sets UNIV X

goal (1 subgoal):
 1. \<And>k. k \<in> K \<Longrightarrow> generate_topology X k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k \<in> K \<Longrightarrow> open ?k

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
from ex_countable_basis
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. countable B \<and> topological_basis B
[PROOF STEP]
obtain B :: "'a set set" where
      B:  "\<And>b. b \<in> B \<Longrightarrow> open b" "\<And>X. open X \<Longrightarrow> \<exists>b\<subseteq>B. (\<Union>b) = X" and "countable B"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. countable B \<and> topological_basis B

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>\<And>b. b \<in> B \<Longrightarrow> open b; \<And>X. open X \<Longrightarrow> \<exists>b\<subseteq>B. \<Union> b = X; countable B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: topological_basis_def)
[PROOF STATE]
proof (state)
this:
?b \<in> B \<Longrightarrow> open ?b
open ?X \<Longrightarrow> \<exists>b\<subseteq>B. \<Union> b = ?X
countable B

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
from B(2)[OF K]
[PROOF STATE]
proof (chain)
picking this:
?X \<in> K \<Longrightarrow> \<exists>b\<subseteq>B. \<Union> b = ?X
[PROOF STEP]
obtain m where m: "\<And>k. k \<in> K \<Longrightarrow> m k \<subseteq> B" "\<And>k. k \<in> K \<Longrightarrow> \<Union>(m k) = k"
[PROOF STATE]
proof (prove)
using this:
?X \<in> K \<Longrightarrow> \<exists>b\<subseteq>B. \<Union> b = ?X

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> m k \<subseteq> B; \<And>k. k \<in> K \<Longrightarrow> \<Union> (m k) = k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?k \<in> K \<Longrightarrow> m ?k \<subseteq> B
?k \<in> K \<Longrightarrow> \<Union> (m ?k) = ?k

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
define U where "U = (\<Union>k\<in>K. m k)"
[PROOF STATE]
proof (state)
this:
U = \<Union> (m ` K)

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
with m
[PROOF STATE]
proof (chain)
picking this:
?k \<in> K \<Longrightarrow> m ?k \<subseteq> B
?k \<in> K \<Longrightarrow> \<Union> (m ?k) = ?k
U = \<Union> (m ` K)
[PROOF STEP]
have "countable U"
[PROOF STATE]
proof (prove)
using this:
?k \<in> K \<Longrightarrow> m ?k \<subseteq> B
?k \<in> K \<Longrightarrow> \<Union> (m ?k) = ?k
U = \<Union> (m ` K)

goal (1 subgoal):
 1. countable U
[PROOF STEP]
by (intro countable_subset[OF _ \<open>countable B\<close>]) auto
[PROOF STATE]
proof (state)
this:
countable U

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
have "\<Union>U = (\<Union>A\<in>U. A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> U = (\<Union>A\<in>U. A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> U = (\<Union>A\<in>U. A)

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> U = (\<Union>A\<in>U. A)

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
have "\<dots> = \<Union>K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>A\<in>U. A) = \<Union> K
[PROOF STEP]
unfolding U_def UN_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>a\<in>K. \<Union>A\<in>m a. A) = \<Union> K
[PROOF STEP]
by (simp add: m)
[PROOF STATE]
proof (state)
this:
(\<Union>A\<in>U. A) = \<Union> K

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Union> U = \<Union> K
[PROOF STEP]
have "\<Union>U = \<Union>K"
[PROOF STATE]
proof (prove)
using this:
\<Union> U = \<Union> K

goal (1 subgoal):
 1. \<Union> U = \<Union> K
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Union> U = \<Union> K

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
have "\<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
?k \<in> K \<Longrightarrow> m ?k \<subseteq> B
?k \<in> K \<Longrightarrow> \<Union> (m ?k) = ?k

goal (1 subgoal):
 1. \<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k
[PROOF STEP]
by (auto simp: U_def)
[PROOF STATE]
proof (state)
this:
\<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k
[PROOF STEP]
obtain u where u: "\<And>b. b \<in> U \<Longrightarrow> u b \<in> K" and "\<And>b. b \<in> U \<Longrightarrow> b \<subseteq> u b"
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>U. \<exists>k\<in>K. b \<subseteq> k

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>\<And>b. b \<in> U \<Longrightarrow> u b \<in> K; \<And>b. b \<in> U \<Longrightarrow> b \<subseteq> u b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?b \<in> U \<Longrightarrow> u ?b \<in> K
?b \<in> U \<Longrightarrow> ?b \<subseteq> u ?b

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?b \<in> U \<Longrightarrow> u ?b \<in> K
?b \<in> U \<Longrightarrow> ?b \<subseteq> u ?b
[PROOF STEP]
have "(\<Union>b\<in>U. u b) \<subseteq> \<Union>K" "\<Union>U \<subseteq> (\<Union>b\<in>U. u b)"
[PROOF STATE]
proof (prove)
using this:
?b \<in> U \<Longrightarrow> u ?b \<in> K
?b \<in> U \<Longrightarrow> ?b \<subseteq> u ?b

goal (1 subgoal):
 1. \<Union> (u ` U) \<subseteq> \<Union> K &&& \<Union> U \<subseteq> \<Union> (u ` U)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (u ` U) \<subseteq> \<Union> K
\<Union> U \<subseteq> \<Union> (u ` U)

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Union> (u ` U) \<subseteq> \<Union> K
\<Union> U \<subseteq> \<Union> (u ` U)
[PROOF STEP]
have "\<Union>K = (\<Union>b\<in>U. u b)"
[PROOF STATE]
proof (prove)
using this:
\<Union> (u ` U) \<subseteq> \<Union> K
\<Union> U \<subseteq> \<Union> (u ` U)

goal (1 subgoal):
 1. \<Union> K = \<Union> (u ` U)
[PROOF STEP]
unfolding \<open>\<Union>U = \<Union>K\<close>
[PROOF STATE]
proof (prove)
using this:
\<Union> (u ` U) \<subseteq> \<Union> K
\<Union> K \<subseteq> \<Union> (u ` U)

goal (1 subgoal):
 1. \<Union> K = \<Union> (u ` U)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> K = \<Union> (u ` U)

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> K = \<Union> (u ` U)

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
have "\<dots> \<in> sigma_sets UNIV X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (u ` U) \<in> sigma_sets UNIV X
[PROOF STEP]
using u UN
[PROOF STATE]
proof (prove)
using this:
?b \<in> U \<Longrightarrow> u ?b \<in> K
?k \<in> K \<Longrightarrow> generate_topology X ?k
?k \<in> K \<Longrightarrow> ?k \<in> sigma_sets UNIV X

goal (1 subgoal):
 1. \<Union> (u ` U) \<in> sigma_sets UNIV X
[PROOF STEP]
by (intro X.countable_UN' \<open>countable U\<close>) auto
[PROOF STATE]
proof (state)
this:
\<Union> (u ` U) \<in> sigma_sets UNIV X

goal (4 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>K. \<lbrakk>\<And>k. k \<in> K \<Longrightarrow> generate_topology X k; \<And>k. k \<in> K \<Longrightarrow> k \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> \<Union> K \<in> sigma_sets UNIV X
 4. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Union> K \<in> sigma_sets UNIV X
[PROOF STEP]
show "\<Union>K \<in> sigma_sets UNIV X"
[PROOF STATE]
proof (prove)
using this:
\<Union> K \<in> sigma_sets UNIV X

goal (1 subgoal):
 1. \<Union> K \<in> sigma_sets UNIV X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Union> K \<in> sigma_sets UNIV X

goal (3 subgoals):
 1. UNIV \<in> sigma_sets UNIV X
 2. \<And>a b. \<lbrakk>generate_topology X a; a \<in> sigma_sets UNIV X; generate_topology X b; b \<in> sigma_sets UNIV X\<rbrakk> \<Longrightarrow> a \<inter> b \<in> sigma_sets UNIV X
 3. \<And>s. s \<in> X \<Longrightarrow> s \<in> sigma_sets UNIV X
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
S \<in> sigma_sets UNIV X

goal (3 subgoals):
 1. Collect open \<subseteq> Pow UNIV
 2. X \<subseteq> Pow UNIV
 3. \<And>b. b \<in> X \<Longrightarrow> b \<in> sigma_sets UNIV (Collect open)
[PROOF STEP]
qed (auto simp: eq intro: generate_topology.Basis)


[STATEMENT]
lemma fds_abs_converges_add:
  assumes "fds_abs_converges f s" "fds_abs_converges g s"
  shows   "fds_abs_converges (f + g) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_abs_converges (f + g) s
[PROOF STEP]
unfolding fds_abs_converges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth (f + g) n / nat_power n s))
[PROOF STEP]
proof (rule summable_comparison_test, intro exI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> ?g n
 2. summable ?g
[PROOF STEP]
let ?A = "(\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> ?g n
 2. summable ?g
[PROOF STEP]
from summable_add[OF assms[unfolded fds_abs_converges_def]]
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))
[PROOF STEP]
show "summable ?A"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s))

goal (1 subgoal):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N3 \<le> n \<Longrightarrow> norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)
[PROOF STEP]
show "norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> ?A n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)
[PROOF STEP]
by (simp add: norm_triangle_ineq add_divide_distrib)
[PROOF STATE]
proof (state)
this:
norm (norm (fds_nth (f + g) n / nat_power n s)) \<le> norm (fds_nth f n / nat_power n s) + norm (fds_nth g n / nat_power n s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wp_iff: "(A <= wp act B) = (act `` A <= B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq> wp act B) = (act `` A \<subseteq> B)
[PROOF STEP]
by (force simp add: wp_def)


[STATEMENT]
lemma iT_Mult_mem_iff: "
  0 < k \<Longrightarrow> x \<in> (I \<otimes> k) = (x mod k = 0 \<and> x div k \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (x \<in> I \<otimes> k) = (x mod k = 0 \<and> x div k \<in> I)
[PROOF STEP]
by (fastforce simp: iT_Mult_def image_iff)


[STATEMENT]
lemma nc_meet_closed: "(x \<sqinter> nc) \<sqinter> (y \<sqinter> nc) = x \<sqinter> y \<sqinter> nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> nc \<sqinter> (y \<sqinter> nc) = x \<sqinter> y \<sqinter> nc
[PROOF STEP]
using local.meet_assoc local.meet_comm local.inf_le1 local.inf.absorb_iff1
[PROOF STATE]
proof (prove)
using this:
?x \<sqinter> ?y \<sqinter> ?z = ?x \<sqinter> (?y \<sqinter> ?z)
?x \<sqinter> ?y = ?y \<sqinter> ?x
?x \<sqinter> ?y \<le> ?x
(?a \<le> ?b) = (?a \<sqinter> ?b = ?a)

goal (1 subgoal):
 1. x \<sqinter> nc \<sqinter> (y \<sqinter> nc) = x \<sqinter> y \<sqinter> nc
[PROOF STEP]
by fastforce


[STATEMENT]
lemma one_mod_card [simp]: "1 mod CARD('a::nontriv) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 mod CARD('a) = 1
[PROOF STEP]
using mod_less nontriv
[PROOF STATE]
proof (prove)
using this:
?m < ?n \<Longrightarrow> ?m mod ?n = ?m
1 < CARD(?'a)

goal (1 subgoal):
 1. 1 mod CARD('a) = 1
[PROOF STEP]
by blast


[STATEMENT]
lemma "let word_upto = ((\<lambda> i j. map (of_nat \<circ> nat) [i .. j]) :: int \<Rightarrow> int \<Rightarrow> 32 word list)
       in map (string_of_word_single False) (word_upto 1 35) =
  [''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7'', ''8'', ''9'',
   ''A'', ''B'', ''C'', ''D'', ''E'', ''F'', ''G'', ''H'', ''I'',
   ''J'', ''K'', ''L'', ''M'', ''N'', ''O'', ''P'', ''Q'', ''R'',
   ''S'', ''T'', ''U'', ''V'', ''W'', ''X'', ''Y'', ''Z'']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. let word_upto = \<lambda>i j. map (word_of_nat \<circ> nat) [i..j] in map (string_of_word_single False) (word_upto 1 35) = [''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7'', ''8'', ''9'', ''A'', ''B'', ''C'', ''D'', ''E'', ''F'', ''G'', ''H'', ''I'', ''J'', ''K'', ''L'', ''M'', ''N'', ''O'', ''P'', ''Q'', ''R'', ''S'', ''T'', ''U'', ''V'', ''W'', ''X'', ''Y'', ''Z'']
[PROOF STEP]
by eval


[STATEMENT]
lemma set_of_mul_inc_left:
  "set_of (A * B) \<subseteq> set_of (A' * B)"
  if "set_of A \<subseteq> set_of A'"
  for A :: "'a::{linordered_ring, real_normed_algebra, linear_continuum_topology} interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (A * B) \<subseteq> set_of (A' * B)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
set_of A \<subseteq> set_of A'

goal (1 subgoal):
 1. set_of (A * B) \<subseteq> set_of (A' * B)
[PROOF STEP]
unfolding set_of_times
[PROOF STATE]
proof (prove)
using this:
set_of A \<subseteq> set_of A'

goal (1 subgoal):
 1. {x * y |x y. x \<in>\<^sub>i A \<and> y \<in>\<^sub>i B} \<subseteq> {x * y |x y. x \<in>\<^sub>i A' \<and> y \<in>\<^sub>i B}
[PROOF STEP]
by auto


[STATEMENT]
lemma gfp_lfp_prop: "gfp (\<lambda>X. R \<cdot> X) \<union> lfp (\<lambda>X. S \<union> R \<cdot> X) \<subseteq> gfp (\<lambda>X. S \<union> R \<cdot> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp ((\<cdot>) R) \<union> lfp (\<lambda>X. S \<union> R \<cdot> X) \<subseteq> gfp (\<lambda>X. S \<union> R \<cdot> X)
[PROOF STEP]
by (simp add: lfp_le_gfp gfp_mono iso_prop)


[STATEMENT]
lemma sum_up_index_split: "(\<Sum>k\<le>m + n. f k) = (\<Sum>k\<le>m. f k) + (\<Sum>k = Suc m..m + n. f k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..m + n} = sum f {..m} + sum f {Suc m..m + n}
[PROOF STEP]
by (metis atLeast0AtMost Suc_eq_plus1 le0 sum.ub_add_nat)


[STATEMENT]
lemma cmod_complex_polar: "cmod (r * (cos a + \<i> * sin a)) = \<bar>r\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real r * (complex_of_real (cos a) + \<i> * complex_of_real (sin a))) = \<bar>r\<bar>
[PROOF STEP]
by (simp add: norm_mult cmod_unit_one)


[STATEMENT]
lemma msort_map:
  "\<lbrakk> distinct xs; sorted xs; inj_on f (set xs); mono_on f (set xs) \<rbrakk> \<Longrightarrow> msort (List.map f xs) = List.map f xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; sorted xs; inj_on f (set xs); order_class.mono_on f (set xs)\<rbrakk> \<Longrightarrow> msort (map f xs) = map f xs
[PROOF STEP]
apply (rule msort_idle)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>distinct xs; sorted xs; inj_on f (set xs); order_class.mono_on f (set xs)\<rbrakk> \<Longrightarrow> distinct (map f xs)
 2. \<lbrakk>distinct xs; sorted xs; inj_on f (set xs); order_class.mono_on f (set xs)\<rbrakk> \<Longrightarrow> sorted (map f xs)
[PROOF STEP]
apply (simp add: distinct_map)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; sorted xs; inj_on f (set xs); order_class.mono_on f (set xs)\<rbrakk> \<Longrightarrow> sorted (map f xs)
[PROOF STEP]
apply (simp add: sorted_mono_map)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done