[STATEMENT]
lemma open_countable_basis_ex:
  assumes "p X"
  shows "\<exists>B' \<subseteq> B. X = \<Union>B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B'\<subseteq>B. X = \<Union> B'
[PROOF STEP]
using assms countable_basis is_basis
[PROOF STATE]
proof (prove)
using this:
p X
countable B
local.topological_basis B

goal (1 subgoal):
 1. \<exists>B'\<subseteq>B. X = \<Union> B'
[PROOF STEP]
unfolding topological_basis_def
[PROOF STATE]
proof (prove)
using this:
p X
countable B
Ball B p \<and> (\<forall>x. p x \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union> B' = x))

goal (1 subgoal):
 1. \<exists>B'\<subseteq>B. X = \<Union> B'
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_union_is_semialgebraic:
  assumes "finite Xs"
  shows "Xs \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Xs \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> Xs)
[PROOF STEP]
apply(rule finite.induct[of Xs])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite Xs
 2. {} \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> {})
 3. \<And>A a. \<lbrakk>finite A; A \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> A)\<rbrakk> \<Longrightarrow> insert a A \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> (insert a A))
[PROOF STEP]
apply (simp add: assms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {} \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> {})
 2. \<And>A a. \<lbrakk>finite A; A \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> A)\<rbrakk> \<Longrightarrow> insert a A \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> (insert a A))
[PROOF STEP]
apply (simp add: empty_is_semialgebraic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; A \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> A)\<rbrakk> \<Longrightarrow> insert a A \<subseteq> semialg_sets n \<longrightarrow> is_semialgebraic n (\<Union> (insert a A))
[PROOF STEP]
by (metis Sup_insert insert_subset is_semialgebraicI union_is_semialgebraic)


[STATEMENT]
lemma can_take_subset: "length i = Arity t \<Longrightarrow>
   Arity t = Arity t' \<Longrightarrow>
   set (Guards t') \<subseteq> set (Guards t) \<Longrightarrow>
   can_take_transition t i r \<Longrightarrow>
   can_take_transition t' i r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length i = Arity t; Arity t = Arity t'; set (Guards t') \<subseteq> set (Guards t); can_take_transition t i r\<rbrakk> \<Longrightarrow> can_take_transition t' i r
[PROOF STEP]
by (simp add: can_take_transition_def can_take_def apply_guards_subset)


[STATEMENT]
lemma unitarily_equivI':
  assumes "A =  mat_conj U B"
  and "unitary U"
  and "A\<in> carrier_mat n n"
  and "B\<in> carrier_mat n n"
shows "unitarily_equiv A B U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitarily_equiv A B U
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A = mat_conj U B
Complex_Matrix.unitary U
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. unitarily_equiv A B U
[PROOF STEP]
unfolding unitarily_equiv_def similar_mat_wit_def
[PROOF STATE]
proof (prove)
using this:
A = mat_conj U B
Complex_Matrix.unitary U
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. Complex_Matrix.unitary U \<and> (let n = dim_row A in {A, B, U, Complex_Matrix.adjoint U} \<subseteq> carrier_mat n n \<and> U * Complex_Matrix.adjoint U = 1\<^sub>m n \<and> Complex_Matrix.adjoint U * U = 1\<^sub>m n \<and> A = U * B * Complex_Matrix.adjoint U)
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) Complex_Matrix.unitary_def
      carrier_matD(1) empty_subsetI index_mult_mat(2) index_one_mat(2)
      insert_commute insert_subset unitary_adjoint unitary_simps(1)
      unitary_simps(2) mat_conj_def)


[STATEMENT]
lemma tanh_add:
  "tanh (x + y) = (tanh x + tanh y) / (1 + tanh x * tanh y)"
  if "cosh x \<noteq> 0" "cosh y \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
have "(sinh x * cosh y + cosh x * sinh y) * (1 + sinh x * sinh y / (cosh x * cosh y)) =
    (cosh x * cosh y + sinh x * sinh y) * ((sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (cosh x * cosh y + sinh x * sinh y) * ((sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cosh x \<noteq> (0::'a)
cosh y \<noteq> (0::'a)

goal (1 subgoal):
 1. (sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (cosh x * cosh y + sinh x * sinh y) * ((sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x))
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (cosh x * cosh y + sinh x * sinh y) * ((sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x))

goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (cosh x * cosh y + sinh x * sinh y) * ((sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x))

goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
have "(sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x) = sinh x / cosh x + sinh y / cosh y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x) = sinh x / cosh x + sinh y / cosh y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cosh x \<noteq> (0::'a)
cosh y \<noteq> (0::'a)

goal (1 subgoal):
 1. (sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x) = sinh x / cosh x + sinh y / cosh y
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
(sinh x * cosh y + sinh y * cosh x) / (cosh y * cosh x) = sinh x / cosh x + sinh y / cosh y

goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (cosh x * cosh y + sinh x * sinh y) * (sinh x / cosh x + sinh y / cosh y)
[PROOF STEP]
have "(sinh x * cosh y + cosh x * sinh y) * (1 + sinh x * sinh y / (cosh x * cosh y)) =
    (sinh x / cosh x + sinh y / cosh y) * (cosh x * cosh y + sinh x * sinh y)"
[PROOF STATE]
proof (prove)
using this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (cosh x * cosh y + sinh x * sinh y) * (sinh x / cosh x + sinh y / cosh y)

goal (1 subgoal):
 1. (sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (sinh x / cosh x + sinh y / cosh y) * (cosh x * cosh y + sinh x * sinh y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (sinh x / cosh x + sinh y / cosh y) * (cosh x * cosh y + sinh x * sinh y)

goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (sinh x / cosh x + sinh y / cosh y) * (cosh x * cosh y + sinh x * sinh y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (sinh x / cosh x + sinh y / cosh y) * (cosh x * cosh y + sinh x * sinh y)

goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
(sinh x * cosh y + cosh x * sinh y) * ((1::'a) + sinh x * sinh y / (cosh x * cosh y)) = (sinh x / cosh x + sinh y / cosh y) * (cosh x * cosh y + sinh x * sinh y)
cosh x \<noteq> (0::'a)
cosh y \<noteq> (0::'a)

goal (1 subgoal):
 1. tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)
[PROOF STEP]
by (auto simp add: tanh_def sinh_add cosh_add eq_divide_eq)
     (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
tanh (x + y) = (tanh x + tanh y) / ((1::'a) + tanh x * tanh y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bind_has_density:
  assumes "sigma_finite_measure M" "sigma_finite_measure N"
          "space M \<noteq> {}" "\<And>x. x \<in> space M \<Longrightarrow> has_density (f x) N (g x)"
          "case_prod g \<in> borel_measurable (M \<Otimes>\<^sub>M N)"
          "f \<in> measurable M (subprob_algebra N)"
  shows "has_density (M \<bind> f) N (\<lambda>y. \<integral>\<^sup>+x. g x y \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_density (M \<bind> f) N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M) \<in> borel_measurable N
 2. M \<bind> f = density N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)
 3. space N \<noteq> {}
[PROOF STEP]
interpret sigma_finite_measure M
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure M
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M) \<in> borel_measurable N
 2. M \<bind> f = density N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)
 3. space N \<noteq> {}
[PROOF STEP]
show "(\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M) \<in> borel_measurable N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M) \<in> borel_measurable N
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure M
sigma_finite_measure N
space M \<noteq> {}
?x \<in> space M \<Longrightarrow> has_density (f ?x) N (g ?x)
(\<lambda>(x, y). g x y) \<in> borel_measurable (M \<Otimes>\<^sub>M N)
f \<in> M \<rightarrow>\<^sub>M subprob_algebra N

goal (1 subgoal):
 1. (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M) \<in> borel_measurable N
[PROOF STEP]
by (intro borel_measurable_nn_integral, subst measurable_pair_swap_iff) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M) \<in> borel_measurable N

goal (2 subgoals):
 1. M \<bind> f = density N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)
 2. space N \<noteq> {}
[PROOF STEP]
show "M \<bind> f = density N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<bind> f = density N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)
[PROOF STEP]
by (intro bind_density) (simp_all add: assms)
[PROOF STATE]
proof (state)
this:
M \<bind> f = density N (\<lambda>y. \<integral>\<^sup>+ x. g x y \<partial>M)

goal (1 subgoal):
 1. space N \<noteq> {}
[PROOF STEP]
from \<open>space M \<noteq> {}\<close>
[PROOF STATE]
proof (chain)
picking this:
space M \<noteq> {}
[PROOF STEP]
obtain x where "x \<in> space M"
[PROOF STATE]
proof (prove)
using this:
space M \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. x \<in> space M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> space M

goal (1 subgoal):
 1. space N \<noteq> {}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
sigma_finite_measure M
sigma_finite_measure N
space M \<noteq> {}
?x \<in> space M \<Longrightarrow> has_density (f ?x) N (g ?x)
(\<lambda>(x, y). g x y) \<in> borel_measurable (M \<Otimes>\<^sub>M N)
f \<in> M \<rightarrow>\<^sub>M subprob_algebra N
x \<in> space M
[PROOF STEP]
have "has_density (f x) N (g x)"
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure M
sigma_finite_measure N
space M \<noteq> {}
?x \<in> space M \<Longrightarrow> has_density (f ?x) N (g ?x)
(\<lambda>(x, y). g x y) \<in> borel_measurable (M \<Otimes>\<^sub>M N)
f \<in> M \<rightarrow>\<^sub>M subprob_algebra N
x \<in> space M

goal (1 subgoal):
 1. has_density (f x) N (g x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
has_density (f x) N (g x)

goal (1 subgoal):
 1. space N \<noteq> {}
[PROOF STEP]
thus "space N \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
has_density (f x) N (g x)

goal (1 subgoal):
 1. space N \<noteq> {}
[PROOF STEP]
by (rule has_densityD)
[PROOF STATE]
proof (state)
this:
space N \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tagged_division_split_left_inj:
  assumes d: "d tagged_division_of i"
  and tags: "(x1, K1) \<in> d" "(x2, K2) \<in> d"
  and "K1 \<noteq> K2"
  and eq: "K1 \<inter> {x. x \<bullet> k \<le> c} = K2 \<inter> {x. x \<bullet> k \<le> c}"
    shows "interior (K1 \<inter> {x. x\<bullet>k \<le> c}) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (K1 \<inter> {x. x \<bullet> k \<le> c}) = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior (K1 \<inter> {x. x \<bullet> k \<le> c}) = {}
[PROOF STEP]
have "interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)
[PROOF STEP]
using tags d
[PROOF STATE]
proof (prove)
using this:
(x1, K1) \<in> d
(x2, K2) \<in> d
d tagged_division_of i

goal (1 subgoal):
 1. interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)
[PROOF STEP]
by (metis (no_types) interior_Int tagged_division_ofD(5))
[PROOF STATE]
proof (state)
this:
interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)

goal (1 subgoal):
 1. interior (K1 \<inter> {x. x \<bullet> k \<le> c}) = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)

goal (1 subgoal):
 1. interior (K1 \<inter> {x. x \<bullet> k \<le> c}) = {}
[PROOF STEP]
using eq \<open>K1 \<noteq> K2\<close>
[PROOF STATE]
proof (prove)
using this:
interior (K1 \<inter> K2) = {} \<or> (x2, K2) = (x1, K1)
K1 \<inter> {x. x \<bullet> k \<le> c} = K2 \<inter> {x. x \<bullet> k \<le> c}
K1 \<noteq> K2

goal (1 subgoal):
 1. interior (K1 \<inter> {x. x \<bullet> k \<le> c}) = {}
[PROOF STEP]
by (metis (no_types) inf_assoc inf_bot_left inf_left_idem interior_Int old.prod.inject)
[PROOF STATE]
proof (state)
this:
interior (K1 \<inter> {x. x \<bullet> k \<le> c}) = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_minus_le_minus[simp]:
  fixes a b :: ereal
  shows "- a \<le> - b \<longleftrightarrow> b \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- a \<le> - b) = (b \<le> a)
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) auto


[STATEMENT]
lemma keys_proj_poly_syz: "keys (proj_poly_syz n p) = map_component (\<lambda>k. k + n) -` keys p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (proj_poly_syz n p) = map_component (\<lambda>k. k + n) -` keys p
[PROOF STEP]
by (simp add: proj_poly_syz_def keys_map_key[OF inj_map_component_plus])


[STATEMENT]
lemma ev_at_HLD_single_imp_snth: "ev_at (HLD {x}) n \<omega> \<Longrightarrow> \<omega> !! n = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ev_at (HLD {x}) n \<omega> \<Longrightarrow> \<omega> !! n = x
[PROOF STEP]
by (drule ev_at_HLD_imp_snth) simp


[STATEMENT]
lemma obtain_extensional_function_from_number_partition:
  assumes "finite A" "finite B"
  assumes "number_partition (card A) N"
  assumes "size N \<le> card B"
  shows "\<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset (\<lambda>X. card X) (mset_set (((\<lambda>b. {x \<in> A. f x = b})) ` B - {{}})) = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
obtain P where "partition_on A P" and eq_N: "image_mset card (mset_set P) = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. \<lbrakk>partition_on A P; image_mset card (mset_set P) = N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms obtain_partition
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
number_partition (card A) N
size N \<le> card B
\<lbrakk>finite ?A; number_partition (card ?A) ?N\<rbrakk> \<Longrightarrow> \<exists>P. partition_on ?A P \<and> image_mset card (mset_set P) = ?N

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>partition_on A P; image_mset card (mset_set P) = N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
partition_on A P
image_mset card (mset_set P) = N

goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
from eq_N[symmetric] \<open>size N \<le> card B\<close>
[PROOF STATE]
proof (chain)
picking this:
N = image_mset card (mset_set P)
size N \<le> card B
[PROOF STEP]
have "card P \<le> card B"
[PROOF STATE]
proof (prove)
using this:
N = image_mset card (mset_set P)
size N \<le> card B

goal (1 subgoal):
 1. card P \<le> card B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card P \<le> card B

goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
from \<open>partition_on A P\<close> this
[PROOF STATE]
proof (chain)
picking this:
partition_on A P
card P \<le> card B
[PROOF STEP]
obtain f where "f \<in> A \<rightarrow>\<^sub>E B"
    and eq_P: "(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P"
[PROOF STATE]
proof (prove)
using this:
partition_on A P
card P \<le> card B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtain_function_with_partition[OF \<open>finite A\<close> \<open>finite B\<close>]
[PROOF STATE]
proof (prove)
using this:
partition_on A P
card P \<le> card B
\<lbrakk>partition_on A ?P; card ?P \<le> card B\<rbrakk> \<Longrightarrow> \<exists>f\<in>A \<rightarrow>\<^sub>E B. (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = ?P

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P

goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
have "image_mset (\<lambda>X. card X) (mset_set (((\<lambda>b. {x \<in> A. f x = b})) ` B - {{}})) = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
using eq_P eq_N
[PROOF STATE]
proof (prove)
using this:
(\<lambda>b. {x \<in> A. f x = b}) ` B - {{}} = P
image_mset card (mset_set P) = N

goal (1 subgoal):
 1. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N

goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
from this \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (chain)
picking this:
image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
f \<in> A \<rightarrow>\<^sub>E B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>A \<rightarrow>\<^sub>E B. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})) = N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invariance_of_domain_homeomorphism:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "open S" "continuous_on S f" "DIM('b) \<le> DIM('a)" "inj_on f S"
  obtains g where "homeomorphism S (f ` S) f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. homeomorphism S (f ` S) f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. homeomorphism S (f ` S) f g \<Longrightarrow> thesis) \<Longrightarrow> homeomorphism S (f ` S) f ?g2
[PROOF STEP]
show "homeomorphism S (f ` S) f (inv_into S f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism S (f ` S) f (inv_into S f)
[PROOF STEP]
by (simp add: assms continuous_on_inverse_open homeomorphism_def)
[PROOF STATE]
proof (state)
this:
homeomorphism S (f ` S) f (inv_into S f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_prod_simps [simp]:
  "(x1, x2) \<sqsubset> (y1, y2) \<longleftrightarrow> x1 \<sqsubset>\<^sub>a y1 \<or> x1 \<sqsubseteq>\<^sub>a y1 \<and> x2 \<sqsubset>\<^sub>b y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x1, x2) \<sqsubset> (y1, y2)) = (x1 \<sqsubset>\<^sub>a y1 \<or> x1 \<sqsubseteq>\<^sub>a y1 \<and> x2 \<sqsubset>\<^sub>b y2)
[PROOF STEP]
by(simp add: less_prod_def)


[STATEMENT]
lemma finite_jumpFs_combine:
  assumes "finite_jumpFs f a b" "finite_jumpFs f b c"
  shows "finite_jumpFs f a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
define P where "P=(\<lambda>x. jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
P = (\<lambda>x. jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0)

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
have "{x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x\<le>b} \<union> {x. P x \<and> b \<le>x \<and> x\<le>c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c}

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c}

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
have "finite ({x. P x \<and> a \<le> x \<and> x\<le>b} \<union> {x. P x \<and> b \<le>x \<and> x\<le>c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ({x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_jumpFs f a b
finite_jumpFs f b c

goal (1 subgoal):
 1. finite ({x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c})
[PROOF STEP]
unfolding finite_jumpFs_def P_def
[PROOF STATE]
proof (prove)
using this:
finite {x. (jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0) \<and> a \<le> x \<and> x \<le> b}
finite {x. (jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0) \<and> b \<le> x \<and> x \<le> c}

goal (1 subgoal):
 1. finite ({x. (jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0) \<and> a \<le> x \<and> x \<le> b} \<union> {x. (jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0) \<and> b \<le> x \<and> x \<le> c})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ({x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c})

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c}
finite ({x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c})
[PROOF STEP]
have "finite {x. P x \<and> a \<le> x \<and> x \<le> c}"
[PROOF STATE]
proof (prove)
using this:
{x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c}
finite ({x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c})

goal (1 subgoal):
 1. finite {x. P x \<and> a \<le> x \<and> x \<le> c}
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
{x. P x \<and> a \<le> x \<and> x \<le> c} \<subseteq> {x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c}
finite ({x. P x \<and> a \<le> x \<and> x \<le> b} \<union> {x. P x \<and> b \<le> x \<and> x \<le> c})
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {x. P x \<and> a \<le> x \<and> x \<le> c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {x. P x \<and> a \<le> x \<and> x \<le> c}

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {x. P x \<and> a \<le> x \<and> x \<le> c}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {x. P x \<and> a \<le> x \<and> x \<le> c}

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
unfolding finite_jumpFs_def P_def
[PROOF STATE]
proof (prove)
using this:
finite {x. (jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0) \<and> a \<le> x \<and> x \<le> c}

goal (1 subgoal):
 1. finite {x. (jumpF f (at_left x) \<noteq> 0 \<or> jumpF f (at_right x) \<noteq> 0) \<and> a \<le> x \<and> x \<le> c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite_jumpFs f a c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gauss_jordan_check_invertable: assumes A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n nc"
  shows "(A \<in> Units (ring_mat TYPE('a :: field) n b)) \<longleftrightarrow> fst (gauss_jordan A B) = 1\<^sub>m n"
  (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> Units (ring_mat TYPE('a) n b)) = (fst (gauss_jordan A B) = 1\<^sub>m n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b) \<Longrightarrow> fst (gauss_jordan A B) = 1\<^sub>m n
 2. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
assume ?l
[PROOF STATE]
proof (state)
this:
A \<in> Units (ring_mat TYPE('a) n b)

goal (2 subgoals):
 1. A \<in> Units (ring_mat TYPE('a) n b) \<Longrightarrow> fst (gauss_jordan A B) = 1\<^sub>m n
 2. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
show ?r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (gauss_jordan A B) = 1\<^sub>m n
[PROOF STEP]
by (rule gauss_jordan_inverse_other_direction[OF \<open>?l\<close> B])
[PROOF STATE]
proof (state)
this:
fst (gauss_jordan A B) = 1\<^sub>m n

goal (1 subgoal):
 1. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
let ?g = "gauss_jordan A B"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
assume ?r
[PROOF STATE]
proof (state)
this:
fst (gauss_jordan A B) = 1\<^sub>m n

goal (1 subgoal):
 1. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fst (gauss_jordan A B) = 1\<^sub>m n
[PROOF STEP]
obtain B' where "?g = (1\<^sub>m n, B')"
[PROOF STATE]
proof (prove)
using this:
fst (gauss_jordan A B) = 1\<^sub>m n

goal (1 subgoal):
 1. (\<And>B'. gauss_jordan A B = (1\<^sub>m n, B') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases ?g, auto)
[PROOF STATE]
proof (state)
this:
gauss_jordan A B = (1\<^sub>m n, B')

goal (1 subgoal):
 1. fst (gauss_jordan A B) = 1\<^sub>m n \<Longrightarrow> A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
from gauss_jordan_inverse_one_direction(1)[OF A B this]
[PROOF STATE]
proof (chain)
picking this:
A \<in> Units (ring_mat TYPE('a) n ?b)
[PROOF STEP]
show ?l
[PROOF STATE]
proof (prove)
using this:
A \<in> Units (ring_mat TYPE('a) n ?b)

goal (1 subgoal):
 1. A \<in> Units (ring_mat TYPE('a) n b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A \<in> Units (ring_mat TYPE('a) n b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_leq:
  fixes f :: "'a \<Rightarrow> ('b :: linorder)"
  assumes "x \<in> arg_max_set f S"
  shows "\<forall>y \<in> S. f x \<ge> f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>S. f y \<le> f x
[PROOF STEP]
by (meson assms leI no_better_in_s)


[STATEMENT]
lemma subgraphs_of_union:
  assumes "wf_digraph G" "wf_digraph G'" "compatible G G'"
  shows "subgraph G (union G G')"
    and "subgraph G' (union G G')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph G (Digraph_Component.union G G') &&& subgraph G' (Digraph_Component.union G G')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wf_digraph G
wf_digraph G'
compatible G G'

goal (1 subgoal):
 1. subgraph G (Digraph_Component.union G G') &&& subgraph G' (Digraph_Component.union G G')
[PROOF STEP]
by (auto intro!: subgraphI wellformed_union simp: compatible_def)


[STATEMENT]
lemma map_nth_eq_drop_take[simp]: "j \<le> length xs \<Longrightarrow> map (nth xs) [i ..< j] = drop i (take j xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> length xs \<Longrightarrow> map ((!) xs) [i..<j] = drop i (take j xs)
[PROOF STEP]
by (induct j) (auto simp: take_Suc_conv_app_nth)


[STATEMENT]
lemma sigma_algebra_single_set:
  assumes "X \<subseteq> S"
  shows "sigma_algebra S { {}, X, S - X, S }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra S {{}, X, S - X, S}
[PROOF STEP]
using algebra.is_sigma_algebra[OF algebra_single_set[OF \<open>X \<subseteq> S\<close>]]
[PROOF STATE]
proof (prove)
using this:
finite {{}, X, S - X, S} \<Longrightarrow> sigma_algebra S {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_algebra S {{}, X, S - X, S}
[PROOF STEP]
by simp


[STATEMENT]
lemma expands_to_powr_nat:
  assumes "trimmed_pos F" "basis_wf basis'" "(f expands_to F) basis'"
  assumes "((\<lambda>x. exp (ln (f x) * g x)) expands_to E) basis"
  shows   "((\<lambda>x. powr_nat (f x) (g x)) expands_to E) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. powr_nat (f x) (g x)) expands_to E) basis
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. exp (ln (f x) * g x)) expands_to E) basis

goal (1 subgoal):
 1. ((\<lambda>x. powr_nat (f x) (g x)) expands_to E) basis
[PROOF STEP]
proof (rule expands_to_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. exp (ln (f x) * g x) = powr_nat (f x) (g x)
[PROOF STEP]
from eval_pos_if_dominant_term_pos[of basis' F] assms(1-4)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>basis_wf basis'; is_expansion F basis'; trimmed F; 0 < fst (dominant_term F)\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. 0 < eval F x
trimmed_pos F
basis_wf basis'
(f expands_to F) basis'
((\<lambda>x. exp (ln (f x) * g x)) expands_to E) basis
[PROOF STEP]
show "eventually (\<lambda>x. exp (ln (f x) * g x) = powr_nat (f x) (g x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>basis_wf basis'; is_expansion F basis'; trimmed F; 0 < fst (dominant_term F)\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. 0 < eval F x
trimmed_pos F
basis_wf basis'
(f expands_to F) basis'
((\<lambda>x. exp (ln (f x) * g x)) expands_to E) basis

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. exp (ln (f x) * g x) = powr_nat (f x) (g x)
[PROOF STEP]
by (auto simp: expands_to.simps trimmed_pos_def powr_def powr_nat_def elim: eventually_elim2)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. exp (ln (f x) * g x) = powr_nat (f x) (g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eNorm_uminus [simp]:
  "eNorm N (-x) = eNorm N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N (- x) = eNorm N x
[PROOF STEP]
using eNorm_cmult[of N "-1" x]
[PROOF STATE]
proof (prove)
using this:
eNorm N (- 1 *\<^sub>R x) = ennreal \<bar>- 1\<bar> * eNorm N x

goal (1 subgoal):
 1. eNorm N (- x) = eNorm N x
[PROOF STEP]
by auto


[STATEMENT]
lemma one_chain_line_integral_point_paths:
  assumes "finite one_chain"
  assumes "finite basis"
  assumes "(\<forall>(k, \<gamma>)\<in>ps. point_path \<gamma>)"
  shows "one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis (one_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis one_chain
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis one_chain
[PROOF STEP]
have 0:"(\<forall>x\<in>ps. case x of (k, g) \<Rightarrow>  (real_of_int k * line_integral F basis g) = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>ps. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g = 0
[PROOF STEP]
using line_integral_point_path assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>point_path ?\<gamma>; finite ?basis\<rbrakk> \<Longrightarrow> line_integral ?F ?basis ?\<gamma> = 0
finite one_chain
finite basis
\<forall>(k, \<gamma>)\<in>ps. point_path \<gamma>

goal (1 subgoal):
 1. \<forall>x\<in>ps. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>ps. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g = 0

goal (1 subgoal):
 1. one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis one_chain
[PROOF STEP]
show "one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis one_chain"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis one_chain
[PROOF STEP]
unfolding one_chain_line_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>one_chain - ps. real_of_int k * line_integral F basis g) = (\<Sum>(k, g)\<in>one_chain. real_of_int k * line_integral F basis g)
[PROOF STEP]
using 0 \<open>finite one_chain\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>ps. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F basis g = 0
finite one_chain

goal (1 subgoal):
 1. (\<Sum>(k, g)\<in>one_chain - ps. real_of_int k * line_integral F basis g) = (\<Sum>(k, g)\<in>one_chain. real_of_int k * line_integral F basis g)
[PROOF STEP]
by (force simp add:  intro: comm_monoid_add_class.sum.mono_neutral_left)
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F basis (one_chain - ps) = one_chain_line_integral F basis one_chain

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma from_bool_all_helper:
  "(\<forall>bool. from_bool bool = val \<longrightarrow> P bool)
      = ((\<exists>bool. from_bool bool = val) \<longrightarrow> P (val \<noteq> 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>bool. from_bool bool = val \<longrightarrow> P bool) = ((\<exists>bool. from_bool bool = val) \<longrightarrow> P (val \<noteq> 0))
[PROOF STEP]
by (auto simp: from_bool_0)


[STATEMENT]
lemma blaschke_0_minus_a [simp]:
  assumes "cmod a \<noteq> 1"
  shows "moebius_pt (blaschke a) 0\<^sub>h = ~\<^sub>h (of_complex a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (blaschke a) 0\<^sub>h = ~\<^sub>h (of_complex a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod a \<noteq> 1

goal (1 subgoal):
 1. moebius_pt (blaschke a) 0\<^sub>h = ~\<^sub>h (of_complex a)
[PROOF STEP]
by (transfer, transfer, simp)


[STATEMENT]
lemma p_H_p_f_pos: "0 < p_H * p_f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p_H * p_f
[PROOF STEP]
using p_f p_H
[PROOF STATE]
proof (prove)
using this:
0 < p_f
p_f < 1
0 < p_H
p_H < 1

goal (1 subgoal):
 1. 0 < p_H * p_f
[PROOF STEP]
by (simp add: zero_less_mult_iff)


[STATEMENT]
lemma sorted_map_of_Some_eq:
  "sorted1 xs \<Longrightarrow> map_of xs k = Some v \<longleftrightarrow> (k,v)\<in>set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted1 xs \<Longrightarrow> (map_of xs k = Some v) = ((k, v) \<in> set xs)
[PROOF STEP]
by (induction xs arbitrary: k v) (auto split: if_splits simp: sorted_Cons_iff)


[STATEMENT]
lemma min_int_poly_conv_Gcd:
  fixes x :: "'a :: {field_char_0, field_gcd}"
  assumes "algebraic x"
  shows "min_int_poly x = Gcd {p. p \<noteq> 0 \<and> p represents x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_int_poly x = Gcd {p. p \<noteq> 0 \<and> p represents x}
[PROOF STEP]
proof (rule sym, rule Gcd_eqI, (safe)?)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
 3. \<And>c. (\<And>b. b \<in> {p. p \<noteq> 0 \<and> p represents x} \<Longrightarrow> c dvd b) \<Longrightarrow> c dvd min_int_poly x
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
 3. \<And>c. (\<And>b. b \<in> {p. p \<noteq> 0 \<and> p represents x} \<Longrightarrow> c dvd b) \<Longrightarrow> c dvd min_int_poly x
[PROOF STEP]
assume p: "\<And>q. q \<in> {p. p \<noteq> 0 \<and> p represents x} \<Longrightarrow> p dvd q"
[PROOF STATE]
proof (state)
this:
?q \<in> {p. p \<noteq> 0 \<and> p represents x} \<Longrightarrow> p dvd ?q

goal (3 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
 3. \<And>c. (\<And>b. b \<in> {p. p \<noteq> 0 \<and> p represents x} \<Longrightarrow> c dvd b) \<Longrightarrow> c dvd min_int_poly x
[PROOF STEP]
show "p dvd min_int_poly x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd min_int_poly x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
algebraic x

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

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
assume p: "p \<noteq> 0" "p represents x"
[PROOF STATE]
proof (state)
this:
p \<noteq> 0
p represents x

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
have "min_int_poly x represents x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_int_poly x represents x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
algebraic x

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

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
hence "poly (gcd (of_int_poly (min_int_poly x)) (of_int_poly p)) x = 0"
[PROOF STATE]
proof (prove)
using this:
min_int_poly x represents x

goal (1 subgoal):
 1. poly (gcd (of_int_poly (min_int_poly x)) (of_int_poly p)) x = (0::'a)
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
min_int_poly x represents x
p \<noteq> 0
p represents x

goal (1 subgoal):
 1. poly (gcd (of_int_poly (min_int_poly x)) (of_int_poly p)) x = (0::'a)
[PROOF STEP]
by (intro poly_gcd_eq_0I) auto
[PROOF STATE]
proof (state)
this:
poly (gcd (of_int_poly (min_int_poly x)) (of_int_poly p)) x = (0::'a)

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
hence "ipoly (gcd (min_int_poly x) p) x = 0"
[PROOF STATE]
proof (prove)
using this:
poly (gcd (of_int_poly (min_int_poly x)) (of_int_poly p)) x = (0::'a)

goal (1 subgoal):
 1. ipoly (gcd (min_int_poly x) p) x = (0::'a)
[PROOF STEP]
by (subst (asm) gcd_of_int_poly) auto
[PROOF STATE]
proof (state)
this:
ipoly (gcd (min_int_poly x) p) x = (0::'a)

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
hence "gcd (min_int_poly x) p represents x"
[PROOF STATE]
proof (prove)
using this:
ipoly (gcd (min_int_poly x) p) x = (0::'a)

goal (1 subgoal):
 1. gcd (min_int_poly x) p represents x
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
ipoly (gcd (min_int_poly x) p) x = (0::'a)
p \<noteq> 0
p represents x

goal (1 subgoal):
 1. gcd (min_int_poly x) p represents x
[PROOF STEP]
unfolding represents_def
[PROOF STATE]
proof (prove)
using this:
ipoly (gcd (min_int_poly x) p) x = (0::'a)
p \<noteq> 0
ipoly p x = (0::'a) \<and> p \<noteq> 0

goal (1 subgoal):
 1. ipoly (gcd (min_int_poly x) p) x = (0::'a) \<and> gcd (min_int_poly x) p \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd (min_int_poly x) p represents x

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
have "min_int_poly x dvd gcd (min_int_poly x) p \<or> is_unit (gcd (min_int_poly x) p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_int_poly x dvd gcd (min_int_poly x) p \<or> is_unit (gcd (min_int_poly x) p)
[PROOF STEP]
by (intro irreducibleD') auto
[PROOF STATE]
proof (state)
this:
min_int_poly x dvd gcd (min_int_poly x) p \<or> is_unit (gcd (min_int_poly x) p)

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
min_int_poly x dvd gcd (min_int_poly x) p \<or> is_unit (gcd (min_int_poly x) p)

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
from \<open>gcd (min_int_poly x) p represents x\<close>
[PROOF STATE]
proof (chain)
picking this:
gcd (min_int_poly x) p represents x
[PROOF STEP]
have "\<not>is_unit (gcd (min_int_poly x) p)"
[PROOF STATE]
proof (prove)
using this:
gcd (min_int_poly x) p represents x

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

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
min_int_poly x dvd gcd (min_int_poly x) p \<or> is_unit (gcd (min_int_poly x) p)
\<not> is_unit (gcd (min_int_poly x) p)
[PROOF STEP]
have "min_int_poly x dvd gcd (min_int_poly x) p"
[PROOF STATE]
proof (prove)
using this:
min_int_poly x dvd gcd (min_int_poly x) p \<or> is_unit (gcd (min_int_poly x) p)
\<not> is_unit (gcd (min_int_poly x) p)

goal (1 subgoal):
 1. min_int_poly x dvd gcd (min_int_poly x) p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
min_int_poly x dvd gcd (min_int_poly x) p

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
min_int_poly x dvd gcd (min_int_poly x) p

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
have "\<dots> dvd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (min_int_poly x) p dvd p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gcd (min_int_poly x) p dvd p

goal (2 subgoals):
 1. normalize (min_int_poly x) = min_int_poly x
 2. \<And>b. \<lbrakk>b \<noteq> 0; b represents x\<rbrakk> \<Longrightarrow> min_int_poly x dvd b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
min_int_poly x dvd p
[PROOF STEP]
show "min_int_poly x dvd p"
[PROOF STATE]
proof (prove)
using this:
min_int_poly x dvd p

goal (1 subgoal):
 1. min_int_poly x dvd p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
min_int_poly x dvd p

goal (1 subgoal):
 1. normalize (min_int_poly x) = min_int_poly x
[PROOF STEP]
qed auto


[STATEMENT]
lemma stabilizer_coset_subset:
  assumes "A \<subseteq> G" and "x \<in> A"
  shows "sumset {x} (stabilizer A) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset {x} (stabilizer A) \<subseteq> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
assume "y \<in> sumset {x} (stabilizer A)"
[PROOF STATE]
proof (state)
this:
y \<in> sumset {x} (stabilizer A)

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<in> sumset {x} (stabilizer A)

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
hence "stabilizer A \<subseteq> differenceset A {x}"
[PROOF STATE]
proof (prove)
using this:
y \<in> sumset {x} (stabilizer A)

goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset A {x}
[PROOF STEP]
using assms
      stabilizer_subset_difference_singleton
[PROOF STATE]
proof (prove)
using this:
y \<in> sumset {x} (stabilizer A)
A \<subseteq> G
x \<in> A
\<lbrakk>?S \<subseteq> G; ?s \<in> ?S\<rbrakk> \<Longrightarrow> stabilizer ?S \<subseteq> differenceset ?S {?s}

goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset A {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
stabilizer A \<subseteq> differenceset A {x}

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
stabilizer A \<subseteq> differenceset A {x}

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
have "sumset {x} (differenceset A {x}) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset {x} (differenceset A {x}) \<subseteq> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (differenceset A {x}) \<Longrightarrow> xa \<in> A
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (differenceset A {x}) \<Longrightarrow> xa \<in> A
[PROOF STEP]
assume "z \<in> sumset {x} (differenceset A {x})"
[PROOF STATE]
proof (state)
this:
z \<in> sumset {x} (differenceset A {x})

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (differenceset A {x}) \<Longrightarrow> xa \<in> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> sumset {x} (differenceset A {x})
[PROOF STEP]
obtain a where "a \<in> A" and "z = x \<oplus> (a \<ominus> x)"
[PROOF STATE]
proof (prove)
using this:
z \<in> sumset {x} (differenceset A {x})

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> A; z = x \<oplus> a \<ominus> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using additive_abelian_group.sumset.cases additive_abelian_group_axioms singletonD
        minusset.cases assms subsetD
[PROOF STATE]
proof (prove)
using this:
z \<in> sumset {x} (differenceset A {x})
\<lbrakk>additive_abelian_group ?G ?addition ?zero; ?a \<in> additive_abelian_group.sumset ?G ?addition ?A ?B; \<And>a b. \<lbrakk>?a = ?addition a b; a \<in> ?A; a \<in> ?G; b \<in> ?B; b \<in> ?G\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
additive_abelian_group G (\<oplus>) \<zero>
?b \<in> {?a} \<Longrightarrow> ?b = ?a
\<lbrakk>?a \<in> minusset ?A; \<And>a. \<lbrakk>?a = local.inverse a; a \<in> ?A; a \<in> G\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
A \<subseteq> G
x \<in> A
\<lbrakk>?A \<subseteq> ?B; ?c \<in> ?A\<rbrakk> \<Longrightarrow> ?c \<in> ?B

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> A; z = x \<oplus> a \<ominus> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (smt (verit, ccfv_SIG))
[PROOF STATE]
proof (state)
this:
a \<in> A
z = x \<oplus> a \<ominus> x

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (differenceset A {x}) \<Longrightarrow> xa \<in> A
[PROOF STEP]
thus "z \<in> A"
[PROOF STATE]
proof (prove)
using this:
a \<in> A
z = x \<oplus> a \<ominus> x

goal (1 subgoal):
 1. z \<in> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> A
z = x \<oplus> a \<ominus> x
A \<subseteq> G
x \<in> A

goal (1 subgoal):
 1. z \<in> A
[PROOF STEP]
by (metis additive_abelian_group.inverse_closed additive_abelian_group_axioms
          commutative in_mono invertible invertible_right_inverse2)
[PROOF STATE]
proof (state)
this:
z \<in> A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sumset {x} (differenceset A {x}) \<subseteq> A

goal (1 subgoal):
 1. \<And>xa. xa \<in> sumset {x} (stabilizer A) \<Longrightarrow> xa \<in> A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y \<in> sumset {x} (stabilizer A)
stabilizer A \<subseteq> differenceset A {x}
sumset {x} (differenceset A {x}) \<subseteq> A
[PROOF STEP]
show "y \<in> A"
[PROOF STATE]
proof (prove)
using this:
y \<in> sumset {x} (stabilizer A)
stabilizer A \<subseteq> differenceset A {x}
sumset {x} (differenceset A {x}) \<subseteq> A

goal (1 subgoal):
 1. y \<in> A
[PROOF STEP]
by (meson in_mono subset_singleton_iff sumset_mono)
[PROOF STATE]
proof (state)
this:
y \<in> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code abstract]: "Rep_\<I> (interval l r) = (if l \<le> r then (l, r) else Rep_\<I> undefined)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_\<I> (interval l r) = (if enat l \<le> r then (l, r) else Rep_\<I> undefined)
[PROOF STEP]
unfolding interval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_\<I> (if enat l \<le> r then Abs_\<I> (l, r) else undefined) = (if enat l \<le> r then (l, r) else Rep_\<I> undefined)
[PROOF STEP]
using Abs_\<I>_inverse
[PROOF STATE]
proof (prove)
using this:
?y \<in> {(x, j). enat x \<le> j} \<Longrightarrow> Rep_\<I> (Abs_\<I> ?y) = ?y

goal (1 subgoal):
 1. Rep_\<I> (if enat l \<le> r then Abs_\<I> (l, r) else undefined) = (if enat l \<le> r then (l, r) else Rep_\<I> undefined)
[PROOF STEP]
by simp


[STATEMENT]
lemma equiv_up_to_True:
  "((\<lambda>_. True) \<Turnstile> c \<sim> c') = (c \<sim> c')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. True) \<Turnstile> c \<sim> c') = (c \<sim> c')
[PROOF STEP]
by (simp add: equiv_def equiv_up_to_def)


[STATEMENT]
lemma complex_cnj_i [simp]: "cnj \<i> = - \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj \<i> = - \<i>
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma os_is_empty_rule:
  "<os_list xs b> os_is_empty b <\<lambda>r. os_list xs b * \<up>(r \<longleftrightarrow> xs = [])>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. <os_list xs b> os_is_empty b <\<lambda>r. os_list xs b * \<up> (r = (xs = []))>
[PROOF STEP]
unfolding os_is_empty_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. <os_list xs b> return (b = None) <\<lambda>r. os_list xs b * \<up> (r = (xs = []))>
[PROOF STEP]
apply sep_auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dickson_grading_lcs:
  assumes "dickson_grading d"
  shows "d (lcs s t) \<le> max (d s) (d t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (lcs s t) \<le> max (d s) (d t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d (lcs s t) \<le> max (d s) (d t)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
dickson_grading d
[PROOF STEP]
have "d (lcs s t) \<le> d (s + t)"
[PROOF STATE]
proof (prove)
using this:
dickson_grading d

goal (1 subgoal):
 1. d (lcs s t) \<le> d (s + t)
[PROOF STEP]
by (rule dickson_grading_adds_imp_le, intro lcs_adds_plus)
[PROOF STATE]
proof (state)
this:
d (lcs s t) \<le> d (s + t)

goal (1 subgoal):
 1. d (lcs s t) \<le> max (d s) (d t)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d (lcs s t) \<le> d (s + t)

goal (1 subgoal):
 1. d (lcs s t) \<le> max (d s) (d t)
[PROOF STEP]
by (simp only: dickson_gradingD1[OF assms])
[PROOF STATE]
proof (state)
this:
d (lcs s t) \<le> max (d s) (d t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tm_append_second_step_eq:
  assumes
    exec: "step0 (s, l, r) B = (s', l', r')"
    and notfinal: "s' \<noteq> 0"
    and off: "off = length A div 2"
    and even: "length A mod 2 = 0"
  shows "step0 (s + off, l, r) (A @ shift B off) = (s' + off, l', r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. step0 (s + off, l, r) (A @ shift B off) = (s' + off, l', r')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
step0 (s, l, r) B = (s', l', r')
s' \<noteq> 0
off = length A div 2
is_even (length A)

goal (1 subgoal):
 1. step0 (s + off, l, r) (A @ shift B off) = (s' + off, l', r')
[PROOF STEP]
apply(simp add: step.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(case fetch B s (read r) of (a, s') \<Rightarrow> (s', update a (l, r))) = (s', l', r'); 0 < s'; off = length A div 2; is_even (length A)\<rbrakk> \<Longrightarrow> (r = [] \<longrightarrow> (case fetch (A @ shift B (length A div 2)) (s + length A div 2) Bk of (a, s') \<Rightarrow> (s', update a (l, []))) = (s' + length A div 2, l', r')) \<and> (r \<noteq> [] \<longrightarrow> (case fetch (A @ shift B (length A div 2)) (s + length A div 2) (hd r) of (a, s') \<Rightarrow> (s', update a (l, r))) = (s' + length A div 2, l', r'))
[PROOF STEP]
apply(cases "fetch B s (read r)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(case fetch B s (read r) of (a, s') \<Rightarrow> (s', update a (l, r))) = (s', l', r'); 0 < s'; off = length A div 2; is_even (length A); fetch B s (read r) = (a, b)\<rbrakk> \<Longrightarrow> (r = [] \<longrightarrow> (case fetch (A @ shift B (length A div 2)) (s + length A div 2) Bk of (a, s') \<Rightarrow> (s', update a (l, []))) = (s' + length A div 2, l', r')) \<and> (r \<noteq> [] \<longrightarrow> (case fetch (A @ shift B (length A div 2)) (s + length A div 2) (hd r) of (a, s') \<Rightarrow> (s', update a (l, r))) = (s' + length A div 2, l', r'))
[PROOF STEP]
apply(frule_tac tm_append_second_fetch_eq, simp_all, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prim_impl_alt: "prim_impl = (let
  \<comment> \<open>Initialization\<close>
  (Q,\<pi>) = (Q_update r 0 Q_empty, M_empty);
  \<comment> \<open>Main loop: Iterate until PQ is empty\<close>
  (Q, \<pi>) =
  while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let
    (u, _) = Q_getmin Q;
    \<comment> \<open>Inner loop: Update for adjacent nodes\<close>
    (Q, \<pi>) =
    foldr ((\<lambda>(v, d) (Q, \<pi>). let
        qv = Q_lookup Q v;
        \<pi>v = M_lookup \<pi> v
      in
        if v\<noteq>r \<and> (qv\<noteq>None \<or> \<pi>v=None) \<and> enat d < enat_of_option qv
        then (Q_update v d Q, M_update v u \<pi>)
        else (Q, \<pi>))
    ) (G_adj g u) (Q, \<pi>);
    Q = Q_delete u Q
    in (Q, \<pi>)) (Q, \<pi>)
  in \<pi>
)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prim_impl = (let (Q, \<pi>) = (Q_update r 0 Q_empty, M_empty); (Q, \<pi>) = while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let (u, uu_) = Q_getmin Q; (Q, \<pi>) = foldr (\<lambda>(v, d) (Q, \<pi>). let qv = Q_lookup Q v; \<pi>v = M_lookup \<pi> v in if v \<noteq> r \<and> (qv \<noteq> None \<or> \<pi>v = None) \<and> enat d < enat_of_option qv then (Q_update v d Q, M_update v u \<pi>) else (Q, \<pi>)) (G_adj g u) (Q, \<pi>); Q = Q_delete u Q in (Q, \<pi>)) (Q, \<pi>) in \<pi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prim_impl = (let (Q, \<pi>) = (Q_update r 0 Q_empty, M_empty); (Q, \<pi>) = while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let (u, uu_) = Q_getmin Q; (Q, \<pi>) = foldr (\<lambda>(v, d) (Q, \<pi>). let qv = Q_lookup Q v; \<pi>v = M_lookup \<pi> v in if v \<noteq> r \<and> (qv \<noteq> None \<or> \<pi>v = None) \<and> enat d < enat_of_option qv then (Q_update v d Q, M_update v u \<pi>) else (Q, \<pi>)) (G_adj g u) (Q, \<pi>); Q = Q_delete u Q in (Q, \<pi>)) (Q, \<pi>) in \<pi>)
[PROOF STEP]
have 1: "foreach_impl_body u = (\<lambda>(v,d) (Qi,\<pi>i). let
        qiv = (Q_lookup Qi v);
        \<pi>iv = M_lookup \<pi>i v
      in
        if v\<noteq>r \<and> (qiv\<noteq>None \<or> \<pi>iv=None) \<and> enat d < enat_of_option qiv
        then (Q_update v d Qi, M_update v u \<pi>i)
        else (Qi, \<pi>i))" for u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foreach_impl_body u = (\<lambda>(v, d) (Qi, \<pi>i). let qiv = Q_lookup Qi v; \<pi>iv = M_lookup \<pi>i v in if v \<noteq> r \<and> (qiv \<noteq> None \<or> \<pi>iv = None) \<and> enat d < enat_of_option qiv then (Q_update v d Qi, M_update v u \<pi>i) else (Qi, \<pi>i))
[PROOF STEP]
unfolding foreach_impl_body_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(v, d) (Qi, \<pi>i). if v = r then (Qi, \<pi>i) else case (Q_lookup Qi v, M_lookup \<pi>i v) of (None, None) \<Rightarrow> (Q_update v d Qi, M_update v u \<pi>i) | (None, Some xa) \<Rightarrow> (Qi, \<pi>i) | (Some d', x) \<Rightarrow> if d < d' then (Q_update v d Qi, M_update v u \<pi>i) else (Qi, \<pi>i)) = (\<lambda>(v, d) (Qi, \<pi>i). let qiv = Q_lookup Qi v; \<pi>iv = M_lookup \<pi>i v in if v \<noteq> r \<and> (qiv \<noteq> None \<or> \<pi>iv = None) \<and> enat d < enat_of_option qiv then (Q_update v d Qi, M_update v u \<pi>i) else (Qi, \<pi>i))
[PROOF STEP]
apply (intro ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. (case x of (v, d) \<Rightarrow> \<lambda>(Qi, \<pi>i). if v = r then (Qi, \<pi>i) else case (Q_lookup Qi v, M_lookup \<pi>i v) of (None, None) \<Rightarrow> (Q_update v d Qi, M_update v u \<pi>i) | (None, Some xa) \<Rightarrow> (Qi, \<pi>i) | (Some d', x) \<Rightarrow> if d < d' then (Q_update v d Qi, M_update v u \<pi>i) else (Qi, \<pi>i)) xa = (case x of (v, d) \<Rightarrow> \<lambda>(Qi, \<pi>i). let qiv = Q_lookup Qi v; \<pi>iv = M_lookup \<pi>i v in if v \<noteq> r \<and> (qiv \<noteq> None \<or> \<pi>iv = None) \<and> enat d < enat_of_option qiv then (Q_update v d Qi, M_update v u \<pi>i) else (Qi, \<pi>i)) xa
[PROOF STEP]
by (auto split: option.split)
[PROOF STATE]
proof (state)
this:
foreach_impl_body ?u = (\<lambda>(v, d) (Qi, \<pi>i). let qiv = Q_lookup Qi v; \<pi>iv = M_lookup \<pi>i v in if v \<noteq> r \<and> (qiv \<noteq> None \<or> \<pi>iv = None) \<and> enat d < enat_of_option qiv then (Q_update v d Qi, M_update v ?u \<pi>i) else (Qi, \<pi>i))

goal (1 subgoal):
 1. prim_impl = (let (Q, \<pi>) = (Q_update r 0 Q_empty, M_empty); (Q, \<pi>) = while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let (u, uu_) = Q_getmin Q; (Q, \<pi>) = foldr (\<lambda>(v, d) (Q, \<pi>). let qv = Q_lookup Q v; \<pi>v = M_lookup \<pi> v in if v \<noteq> r \<and> (qv \<noteq> None \<or> \<pi>v = None) \<and> enat d < enat_of_option qv then (Q_update v d Q, M_update v u \<pi>) else (Q, \<pi>)) (G_adj g u) (Q, \<pi>); Q = Q_delete u Q in (Q, \<pi>)) (Q, \<pi>) in \<pi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prim_impl = (let (Q, \<pi>) = (Q_update r 0 Q_empty, M_empty); (Q, \<pi>) = while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let (u, uu_) = Q_getmin Q; (Q, \<pi>) = foldr (\<lambda>(v, d) (Q, \<pi>). let qv = Q_lookup Q v; \<pi>v = M_lookup \<pi> v in if v \<noteq> r \<and> (qv \<noteq> None \<or> \<pi>v = None) \<and> enat d < enat_of_option qv then (Q_update v d Q, M_update v u \<pi>) else (Q, \<pi>)) (G_adj g u) (Q, \<pi>); Q = Q_delete u Q in (Q, \<pi>)) (Q, \<pi>) in \<pi>)
[PROOF STEP]
unfolding prim_impl_def outer_loop_impl_def foreach_impl_def 1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let Qi = Q_update r 0 Q_empty; \<pi>i = M_empty; (Qi, \<pi>i) = while (\<lambda>(Qi, \<pi>i). \<not> Q_is_empty Qi) (\<lambda>(Qi, \<pi>i). let (u, uu_) = Q_getmin Qi; adjs = G_adj g u; (Qi, \<pi>i) = foldr (\<lambda>(v, d) (Qi, \<pi>i). let qiv = Q_lookup Qi v; \<pi>iv = M_lookup \<pi>i v in if v \<noteq> r \<and> (qiv \<noteq> None \<or> \<pi>iv = None) \<and> enat d < enat_of_option qiv then (Q_update v d Qi, M_update v u \<pi>i) else (Qi, \<pi>i)) adjs (Qi, \<pi>i); Qi = Q_delete u Qi in (Qi, \<pi>i)) (Qi, \<pi>i) in \<pi>i) = (let (Q, \<pi>) = (Q_update r 0 Q_empty, M_empty); (Q, \<pi>) = while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let (u, uu_) = Q_getmin Q; (Q, \<pi>) = foldr (\<lambda>(v, d) (Q, \<pi>). let qv = Q_lookup Q v; \<pi>v = M_lookup \<pi> v in if v \<noteq> r \<and> (qv \<noteq> None \<or> \<pi>v = None) \<and> enat d < enat_of_option qv then (Q_update v d Q, M_update v u \<pi>) else (Q, \<pi>)) (G_adj g u) (Q, \<pi>); Q = Q_delete u Q in (Q, \<pi>)) (Q, \<pi>) in \<pi>)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
prim_impl = (let (Q, \<pi>) = (Q_update r 0 Q_empty, M_empty); (Q, \<pi>) = while (\<lambda>(Q, \<pi>). \<not> Q_is_empty Q) (\<lambda>(Q, \<pi>). let (u, uu_) = Q_getmin Q; (Q, \<pi>) = foldr (\<lambda>(v, d) (Q, \<pi>). let qv = Q_lookup Q v; \<pi>v = M_lookup \<pi> v in if v \<noteq> r \<and> (qv \<noteq> None \<or> \<pi>v = None) \<and> enat d < enat_of_option qv then (Q_update v d Q, M_update v u \<pi>) else (Q, \<pi>)) (G_adj g u) (Q, \<pi>); Q = Q_delete u Q in (Q, \<pi>)) (Q, \<pi>) in \<pi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem soundness:
  assumes f: "tfinite t" and w: "wf t"
  shows "ssat (fst (root t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssat (fst (tree.root t))
[PROOF STEP]
using f w
[PROOF STATE]
proof (prove)
using this:
tfinite t
local.wf t

goal (1 subgoal):
 1. ssat (fst (tree.root t))
[PROOF STEP]
proof (induction t rule: tfinite.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>\<And>t'. t' |\<in>| cont t \<Longrightarrow> tfinite t'; \<And>t'. \<lbrakk>t' |\<in>| cont t; local.wf t'\<rbrakk> \<Longrightarrow> ssat (fst (tree.root t')); local.wf t\<rbrakk> \<Longrightarrow> ssat (fst (tree.root t))
[PROOF STEP]
case (tfinite t)
[PROOF STATE]
proof (state)
this:
?t'1 |\<in>| cont t \<Longrightarrow> tfinite ?t'1
\<lbrakk>?t'1 |\<in>| cont t; local.wf ?t'1\<rbrakk> \<Longrightarrow> ssat (fst (tree.root ?t'1))
local.wf t

goal (1 subgoal):
 1. \<And>t. \<lbrakk>\<And>t'. t' |\<in>| cont t \<Longrightarrow> tfinite t'; \<And>t'. \<lbrakk>t' |\<in>| cont t; local.wf t'\<rbrakk> \<Longrightarrow> ssat (fst (tree.root t')); local.wf t\<rbrakk> \<Longrightarrow> ssat (fst (tree.root t))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssat (fst (tree.root t))
[PROOF STEP]
by (rule local_soundness[of "snd (root t)" _ "fimage (fst o root) (cont t)"], insert tfinite)
      (fastforce elim!: wf.cases)+
[PROOF STATE]
proof (state)
this:
ssat (fst (tree.root t))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma last_message_hold_init_append[rule_format]: "
  \<And>xs m. last_message_hold_init (xs @ ys) m =
  last_message_hold_init xs m @ last_message_hold_init ys (last_message (m # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs m. last_message_hold_init (xs @ ys) m = last_message_hold_init xs m @ last_message_hold_init ys (last_message (m # xs))
[PROOF STEP]
apply (induct ys, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs m. (\<And>xs m. last_message_hold_init (xs @ ys) m = last_message_hold_init xs m @ last_message_hold_init ys (last_message (m # xs))) \<Longrightarrow> last_message_hold_init (xs @ a # ys) m = last_message_hold_init xs m @ last_message_hold_init (a # ys) (last_message (m # xs))
[PROOF STEP]
apply (rule_tac x=a in subst[OF append_eq_Cons, rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs m. (\<And>xs m. last_message_hold_init (xs @ ys) m = last_message_hold_init xs m @ last_message_hold_init ys (last_message (m # xs))) \<Longrightarrow> last_message_hold_init (xs @ [a] @ ys) m = last_message_hold_init xs m @ last_message_hold_init ([a] @ ys) (last_message (m # xs))
[PROOF STEP]
apply (simp only: append_Cons[symmetric] append_assoc[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ys xs m. (\<And>xs m. last_message_hold_init (xs @ ys) m = last_message_hold_init xs m @ last_message_hold_init ys (last_message (m # xs))) \<Longrightarrow> last_message_hold_init (xs @ [a]) m @ last_message_hold_init ys (last_message ((m # xs) @ [a])) = (last_message_hold_init xs m @ last_message_hold_init [a] (last_message (m # xs))) @ last_message_hold_init ys (last_message [last_message (m # xs), a])
[PROOF STEP]
apply (simp add: last_message_hold_init_snoc last_message_append)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hom_of_fst:
  assumes "group H"
  shows "(f \<circ> fst) \<in> hom (DirProd G H) K \<longleftrightarrow> f \<in> hom G K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> fst \<in> hom (G \<times>\<times> H) K) = (f \<in> hom G K)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<circ> fst \<in> hom (G \<times>\<times> H) K) = (f \<in> hom G K)
[PROOF STEP]
interpret group H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group H
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<circ> fst \<in> hom (G \<times>\<times> H) K) = (f \<in> hom G K)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> fst \<in> hom (G \<times>\<times> H) K) = (f \<in> hom G K)
[PROOF STEP]
using one_closed
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>H\<^esub> \<in> carrier H

goal (1 subgoal):
 1. (f \<circ> fst \<in> hom (G \<times>\<times> H) K) = (f \<in> hom G K)
[PROOF STEP]
by (auto simp: hom_def Pi_def)
[PROOF STATE]
proof (state)
this:
(f \<circ> fst \<in> hom (G \<times>\<times> H) K) = (f \<in> hom G K)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_sup_closed: "Sup_closed_set (X::'a::complete_lattice set) \<Longrightarrow> sup_closed_set X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_closed_set X \<Longrightarrow> sup_closed_set X
[PROOF STEP]
by (metis Sup_closed_set_def empty_subsetI insert_subsetI sup_Sup sup_closed_set_def)


[STATEMENT]
lemma distinct_map_nth:
  assumes "distinct ls"
  assumes "distinct inds"
  assumes "\<And>j. j \<in> set inds \<Longrightarrow> j < length ls"
  shows "distinct (map ((!) ls) inds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map ((!) ls) inds)
[PROOF STEP]
by (simp add: assms(1) assms(2) assms(3) distinct_map inj_on_nth)


[STATEMENT]
lemma f_plus_minus2: "(f::'a \<Rightarrow> real) = (\<lambda>t. pp f t - np f t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>t. pp f t - np f t)
[PROOF STEP]
using f_plus_minus
[PROOF STATE]
proof (prove)
using this:
?f ?x = pp ?f ?x - np ?f ?x

goal (1 subgoal):
 1. f = (\<lambda>t. pp f t - np f t)
[PROOF STEP]
by (rule ext)


[STATEMENT]
lemma nth_of_radiant_2 [simp]:
  "of_radiant \<omega> $ 2 = sin \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_radiant \<omega> $ 2 = sin \<omega>
[PROOF STEP]
unfolding of_radiant_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (axis 1 (cos \<omega>) + axis 2 (sin \<omega>)) $ 2 = sin \<omega>
[PROOF STEP]
by simp


[STATEMENT]
lemma sub_complement_antitone:
  "-x \<le> -y \<Longrightarrow> --y \<le> --x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x \<le> - y \<Longrightarrow> - - y \<le> - - x
[PROOF STEP]
by (metis inf_absorb inf_demorgan sub_less_eq_def)


[STATEMENT]
lemma upper_3_tendsto: "upper_3 x \<longlonglongrightarrow> real_of_3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_3 x \<longlonglongrightarrow> real_of_3 x
[PROOF STEP]
proof(rule dist_tendsto_0_imp_tendsto, rule sandwitch_real)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?l2 \<longlonglongrightarrow> 0
 2. ?r2 \<longlonglongrightarrow> 0
 3. \<And>i. ?l2 i \<le> \<bar>upper_3 x i - real_of_3 x\<bar>
 4. \<And>i. \<bar>upper_3 x i - real_of_3 x\<bar> \<le> ?r2 i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?l2 \<longlonglongrightarrow> 0
 2. ?r2 \<longlonglongrightarrow> 0
 3. \<And>i. ?l2 i \<le> \<bar>upper_3 x i - real_of_3 x\<bar>
 4. \<And>i. \<bar>upper_3 x i - real_of_3 x\<bar> \<le> ?r2 i
[PROOF STEP]
obtain l r where lr: "get_itvl_3 ((tighten_bounds_3 ^^ i) x) = Interval l r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l r. get_itvl_3 ((tighten_bounds_3 ^^ i) x) = Interval l r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis interval.collapse)
[PROOF STATE]
proof (state)
this:
get_itvl_3 ((tighten_bounds_3 ^^ i) x) = Interval l r

goal (4 subgoals):
 1. ?l2 \<longlonglongrightarrow> 0
 2. ?r2 \<longlonglongrightarrow> 0
 3. \<And>i. ?l2 i \<le> \<bar>upper_3 x i - real_of_3 x\<bar>
 4. \<And>i. \<bar>upper_3 x i - real_of_3 x\<bar> \<le> ?r2 i
[PROOF STEP]
with get_itvl_3[of "(tighten_bounds_3 ^^ i) x"]
[PROOF STATE]
proof (chain)
picking this:
real_of_3 ((tighten_bounds_3 ^^ i) x) \<in>\<^sub>i get_itvl_3 ((tighten_bounds_3 ^^ i) x)
get_itvl_3 ((tighten_bounds_3 ^^ i) x) = Interval l r
[PROOF STEP]
show "\<bar>(upper_3 x) i - real_of_3 x\<bar> \<le> (upper_3 x i - lower_3 x i)"
[PROOF STATE]
proof (prove)
using this:
real_of_3 ((tighten_bounds_3 ^^ i) x) \<in>\<^sub>i get_itvl_3 ((tighten_bounds_3 ^^ i) x)
get_itvl_3 ((tighten_bounds_3 ^^ i) x) = Interval l r

goal (1 subgoal):
 1. \<bar>upper_3 x i - real_of_3 x\<bar> \<le> upper_3 x i - lower_3 x i
[PROOF STEP]
unfolding upper_3_def lower_3_def
[PROOF STATE]
proof (prove)
using this:
real_of_3 ((tighten_bounds_3 ^^ i) x) \<in>\<^sub>i get_itvl_3 ((tighten_bounds_3 ^^ i) x)
get_itvl_3 ((tighten_bounds_3 ^^ i) x) = Interval l r

goal (1 subgoal):
 1. \<bar>interval.upper (get_itvl_3 ((tighten_bounds_3 ^^ i) x)) - real_of_3 x\<bar> \<le> interval.upper (get_itvl_3 ((tighten_bounds_3 ^^ i) x)) - interval.lower (get_itvl_3 ((tighten_bounds_3 ^^ i) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>upper_3 x i - real_of_3 x\<bar> \<le> upper_3 x i - lower_3 x i

goal (3 subgoals):
 1. ?l2 \<longlonglongrightarrow> 0
 2. (\<lambda>i. upper_3 x i - lower_3 x i) \<longlonglongrightarrow> 0
 3. \<And>i. ?l2 i \<le> \<bar>upper_3 x i - real_of_3 x\<bar>
[PROOF STEP]
qed (insert interval_size_3_tendsto_0, auto)


[STATEMENT]
lemma (in prime_number_theorem) prime_in_interval_exists:
  fixes c :: real
  assumes "c > 1"
  shows   "eventually (\<lambda>x. \<exists>p. prime p \<and> real p \<in> {x<..c*x}) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
from \<open>c > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < c
[PROOF STEP]
have "(\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>x. ((c * x) / ln (c * x)) / (x / ln x))"
[PROOF STATE]
proof (prove)
using this:
1 < c

goal (1 subgoal):
 1. (\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>x. c * x / ln (c * x) / (x / ln x))
[PROOF STEP]
by (intro asymp_equiv_intros asymp_equiv_compose'[OF prime_number_theorem]) real_asymp+
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>x. c * x / ln (c * x) / (x / ln x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>x. c * x / ln (c * x) / (x / ln x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
have "\<dots> \<sim>[at_top] (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * x / ln (c * x) / (x / ln x)) \<sim>[at_top] (\<lambda>x. c)
[PROOF STEP]
using \<open>c > 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < c

goal (1 subgoal):
 1. (\<lambda>x. c * x / ln (c * x) / (x / ln x)) \<sim>[at_top] (\<lambda>x. c)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c * x / ln (c * x) / (x / ln x)) \<sim>[at_top] (\<lambda>x. c)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>c d. c \<sim>[at_top] d \<Longrightarrow> c \<sim>[at_top] d) \<Longrightarrow> (\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>a. c)
[PROOF STEP]
have "(\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>a. c)"
[PROOF STATE]
proof (prove)
using this:
(\<And>c d. c \<sim>[at_top] d \<Longrightarrow> c \<sim>[at_top] d) \<Longrightarrow> (\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>a. c)

goal (1 subgoal):
 1. (\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>a. c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>a. c)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
hence "((\<lambda>x. \<pi> (c * x) / \<pi> x) \<longlongrightarrow> c) at_top"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<pi> (c * x) / \<pi> x) \<sim>[at_top] (\<lambda>a. c)

goal (1 subgoal):
 1. ((\<lambda>x. \<pi> (c * x) / \<pi> x) \<longlongrightarrow> c) at_top
[PROOF STEP]
by (rule asymp_equivD_const)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<pi> (c * x) / \<pi> x) \<longlongrightarrow> c) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
from this and \<open>c > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<pi> (c * x) / \<pi> x) \<longlongrightarrow> c) at_top
1 < c
[PROOF STEP]
have "eventually (\<lambda>x. \<pi> (c * x) / \<pi> x > 1) at_top"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<pi> (c * x) / \<pi> x) \<longlongrightarrow> c) at_top
1 < c

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 < \<pi> (c * x) / \<pi> x
[PROOF STEP]
by (rule order_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 < \<pi> (c * x) / \<pi> x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 < \<pi> (c * x) / \<pi> x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
have "eventually (\<lambda>x. \<pi> x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < \<pi> x
[PROOF STEP]
using \<pi>_at_top
[PROOF STATE]
proof (prove)
using this:
filterlim \<pi> at_top at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < \<pi> x
[PROOF STEP]
by (auto simp: filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < \<pi> x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. 1 < \<pi> (c * x) / \<pi> x
\<forall>\<^sub>F x in at_top. 0 < \<pi> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 1 < \<pi> (c * x) / \<pi> x
\<forall>\<^sub>F x in at_top. 0 < \<pi> x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
using eventually_gt_at_top[of 1]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 1 < \<pi> (c * x) / \<pi> x
\<forall>\<^sub>F x in at_top. 0 < \<pi> x
eventually ((<) (1::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
1 < \<pi> (c * x) / \<pi> x
0 < \<pi> x
1 < x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
define P where "P = {p. prime p \<and> real p \<in> {x<..c*x}}"
[PROOF STATE]
proof (state)
this:
P = {p. prime p \<and> real p \<in> {x<..c * x}}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
from elim and \<open>c > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < \<pi> (c * x) / \<pi> x
0 < \<pi> x
1 < x
1 < c
[PROOF STEP]
have "1 * x < c * x"
[PROOF STATE]
proof (prove)
using this:
1 < \<pi> (c * x) / \<pi> x
0 < \<pi> x
1 < x
1 < c

goal (1 subgoal):
 1. 1 * x < c * x
[PROOF STEP]
by (intro mult_strict_right_mono) auto
[PROOF STATE]
proof (state)
this:
1 * x < c * x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
hence "x < c * x"
[PROOF STATE]
proof (prove)
using this:
1 * x < c * x

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
have "P = {p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = {p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}
[PROOF STEP]
by (auto simp: P_def)
[PROOF STATE]
proof (state)
this:
P = {p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P = {p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
have "card \<dots> = card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}) = card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}
[PROOF STEP]
using \<open>x < c * x\<close>
[PROOF STATE]
proof (prove)
using this:
x < c * x

goal (1 subgoal):
 1. card ({p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}) = card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}
[PROOF STEP]
by (subst card_Diff_subset) (auto intro: finite_primes_le)
[PROOF STATE]
proof (state)
this:
card ({p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}) = card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ({p. prime p \<and> real p \<le> c * x} - {p. prime p \<and> real p \<le> x}) = card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
have "real \<dots> = \<pi> (c * x) - \<pi> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}) = \<pi> (c * x) - \<pi> x
[PROOF STEP]
using \<pi>_mono[of x "c * x"] \<open>x < c * x\<close>
[PROOF STATE]
proof (prove)
using this:
x \<le> c * x \<Longrightarrow> \<pi> x \<le> \<pi> (c * x)
x < c * x

goal (1 subgoal):
 1. real (card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}) = \<pi> (c * x) - \<pi> x
[PROOF STEP]
by (subst of_nat_diff) (auto simp: primes_pi_def prime_sum_upto_def)
[PROOF STATE]
proof (state)
this:
real (card {p. prime p \<and> real p \<le> c * x} - card {p. prime p \<and> real p \<le> x}) = \<pi> (c * x) - \<pi> x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (card P) = \<pi> (c * x) - \<pi> x
[PROOF STEP]
have "real (card P) = \<pi> (c * x) - \<pi> x"
[PROOF STATE]
proof (prove)
using this:
real (card P) = \<pi> (c * x) - \<pi> x

goal (1 subgoal):
 1. real (card P) = \<pi> (c * x) - \<pi> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (card P) = \<pi> (c * x) - \<pi> x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real (card P) = \<pi> (c * x) - \<pi> x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
have "\<pi> (c * x) - \<pi> x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<pi> (c * x) - \<pi> x
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
1 < \<pi> (c * x) / \<pi> x
0 < \<pi> x
1 < x

goal (1 subgoal):
 1. 0 < \<pi> (c * x) - \<pi> x
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
0 < \<pi> (c * x) - \<pi> x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real (card P) = \<pi> (c * x) - \<pi> x
0 < \<pi> (c * x) - \<pi> x
[PROOF STEP]
have "real (card P) > 0"
[PROOF STATE]
proof (prove)
using this:
real (card P) = \<pi> (c * x) - \<pi> x
0 < \<pi> (c * x) - \<pi> x

goal (1 subgoal):
 1. 0 < real (card P)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < real (card P)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
hence "card P > 0"
[PROOF STATE]
proof (prove)
using this:
0 < real (card P)

goal (1 subgoal):
 1. 0 < card P
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < card P

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
hence "P \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
0 < card P

goal (1 subgoal):
 1. P \<noteq> {}
[PROOF STEP]
by (intro notI) simp
[PROOF STATE]
proof (state)
this:
P \<noteq> {}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 < \<pi> (c * x) / \<pi> x; 0 < \<pi> x; 1 < x\<rbrakk> \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
P \<noteq> {}

goal (1 subgoal):
 1. \<exists>p. prime p \<and> real p \<in> {x<..c * x}
[PROOF STEP]
by (auto simp: P_def)
[PROOF STATE]
proof (state)
this:
\<exists>p. prime p \<and> real p \<in> {x<..c * x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..c * x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deriv_deriv_inverse [simp]:
  assumes "x \<noteq> 0"
  shows "deriv (deriv inverse) x = 2 * inverse (x ^ 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
have "deriv (\<lambda>x. inverse (x ^ 2)) x = - (of_nat 2 * x) / ((x ^ 2) ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
have "(\<lambda>x. inverse (x ^ 2)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x
[PROOF STEP]
by (simp add: field_differentiable_inverse)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2
(\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x
[PROOF STEP]
have "deriv (\<lambda>x. - (inverse (x ^ 2))) x = of_nat 2 * x / (x ^ 4)"
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2
(\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x

goal (1 subgoal):
 1. deriv (\<lambda>x. - inverse (x\<^sup>2)) x = of_nat 2 * x / x ^ 4
[PROOF STEP]
using deriv_chain[of "\<lambda>x. inverse (x ^ 2)" x]
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. inverse (x\<^sup>2)) x = - (of_nat 2 * x) / (x\<^sup>2)\<^sup>2
(\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x
\<lbrakk>(\<lambda>x. inverse (x\<^sup>2)) field_differentiable at x; ?g field_differentiable at (inverse (x\<^sup>2))\<rbrakk> \<Longrightarrow> deriv (?g \<circ> (\<lambda>x. inverse (x\<^sup>2))) x = deriv ?g (inverse (x\<^sup>2)) * deriv (\<lambda>x. inverse (x\<^sup>2)) x

goal (1 subgoal):
 1. deriv (\<lambda>x. - inverse (x\<^sup>2)) x = of_nat 2 * x / x ^ 4
[PROOF STEP]
by (simp add: comp_def field_differentiable_minus field_simps)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. - inverse (x\<^sup>2)) x = of_nat 2 * x / x ^ 4

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. - inverse (x\<^sup>2)) x = of_nat 2 * x / x ^ 4
[PROOF STEP]
have "deriv (\<lambda>x. - 1 / (x ^ 2)) x = 2 * inverse (x ^ 3)"
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. - inverse (x\<^sup>2)) x = of_nat 2 * x / x ^ 4

goal (1 subgoal):
 1. deriv (\<lambda>x. - (1::'a) / x\<^sup>2) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
by (simp add: power4_eq_xxxx power3_eq_cube field_simps)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. - (1::'a) / x\<^sup>2) x = (2::'a) * inverse (x ^ 3)

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. - (1::'a) / x\<^sup>2) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. - (1::'a) / x\<^sup>2) x = (2::'a) * inverse (x ^ 3)

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
using assms eventually_deriv_inverse deriv_cong_ev
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. - (1::'a) / x\<^sup>2) x = (2::'a) * inverse (x ^ 3)
x \<noteq> (0::'a)
?x \<noteq> (0::?'a) \<Longrightarrow> \<forall>\<^sub>F x in nhds ?x. deriv inverse x = - (1::?'a) / x\<^sup>2
\<lbrakk>\<forall>\<^sub>F x in nhds ?x. ?f x = ?g x; ?x = ?y\<rbrakk> \<Longrightarrow> deriv ?f ?x = deriv ?g ?y

goal (1 subgoal):
 1. deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
deriv (deriv inverse) x = (2::'a) * inverse (x ^ 3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefixes_set: "{v. v \<le> w} = {ltake k w |k. k \<le> llength w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v. v \<le> w} = {ltake k w |k. k \<le> llength w}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma int_of_integer_minus: "int_of_integer (x - y) = (int_of_integer x - int_of_integer y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_integer (x - y) = int_of_integer x - int_of_integer y
[PROOF STEP]
by simp


[STATEMENT]
lemma qequiv_trans: "\<lbrakk> a \<cong>\<^sub>Q b; b \<cong>\<^sub>Q c \<rbrakk> \<Longrightarrow> a \<cong>\<^sub>Q c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<cong>\<^sub>Q b; b \<cong>\<^sub>Q c\<rbrakk> \<Longrightarrow> a \<cong>\<^sub>Q c
[PROOF STEP]
by (simp add: qequiv_def)


[STATEMENT]
lemma eucl_of_list_interpret_floatariths_cong:
  fixes y::"'a::executable_euclidean_space"
  assumes "\<And>b. b \<in> Basis \<Longrightarrow> interpret_floatarith (fa (index Basis_list b)) vs = y \<bullet> b"
  assumes "length xs = DIM('a)"
  shows "eucl_of_list (interpret_floatariths (map fa [0..<DIM('a)]) vs) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. einterpret (map fa [0..<DIM('a)]) vs = y
[PROOF STEP]
apply (rule euclidean_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in> Basis \<Longrightarrow> einterpret (map fa [0..<DIM('a)]) vs \<bullet> b = y \<bullet> b
[PROOF STEP]
apply (subst eucl_of_list_inner)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>b. b \<in> Basis \<Longrightarrow> b \<in> Basis
 2. \<And>b. b \<in> Basis \<Longrightarrow> length (interpret_floatariths (map fa [0..<DIM('a)]) vs) = DIM('a)
 3. \<And>b. b \<in> Basis \<Longrightarrow> interpret_floatariths (map fa [0..<DIM('a)]) vs ! index Basis_list b = y \<bullet> b
[PROOF STEP]
by (auto simp: assms)


[STATEMENT]
lemma ennreal_add_left_cancel_less: "a + b < a + c \<longleftrightarrow> a \<noteq> (\<infinity>::ennreal) \<and> b < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b < a + c) = (a \<noteq> \<infinity> \<and> b < c)
[PROOF STEP]
unfolding infinity_ennreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + b < a + c) = (a \<noteq> top \<and> b < c)
[PROOF STEP]
by transfer (simp add: top_ereal_def ereal_add_left_cancel_less)


[STATEMENT]
theorem "check = valid"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. check = valid
[PROOF STEP]
using soundness completeness finite_deriv_prove
[PROOF STATE]
proof (prove)
using this:
finite (deriv (ns_of_s ?s)) \<Longrightarrow> Svalid ?s
infinite (deriv (ns_of_s ?s)) \<Longrightarrow> \<not> Svalid ?s
finite (deriv ?s) = prove ?s

goal (1 subgoal):
 1. check = valid
[PROOF STEP]
by auto


[STATEMENT]
lemma card1:"card {a} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a} = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma lm018:
  "(R outside X1) outside X2 = (R outside X2) outside X1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (R outside X1) outside X2 = (R outside X2) outside X1
[PROOF STEP]
by (metis outsideOutside sup_commute)


[STATEMENT]
theorem V_valid: "valid Vaxiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid Vaxiom
[PROOF STEP]
apply(simp only: valid_def Vaxiom_def impl_sem box_sem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>I \<nu>. is_interp I \<longrightarrow> \<nu> \<in> fml_sem I ($\<phi> vid1 local.empty) \<longrightarrow> \<nu> \<in> {\<nu>. \<forall>\<omega>. (\<nu>, \<omega>) \<in> prog_sem I ($\<alpha> vid1) \<longrightarrow> \<omega> \<in> fml_sem I ($\<phi> vid1 local.empty)}
[PROOF STEP]
apply(rule allI | rule impI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I \<nu>. \<lbrakk>is_interp I; \<nu> \<in> fml_sem I ($\<phi> vid1 local.empty)\<rbrakk> \<Longrightarrow> \<nu> \<in> {\<nu>. \<forall>\<omega>. (\<nu>, \<omega>) \<in> prog_sem I ($\<alpha> vid1) \<longrightarrow> \<omega> \<in> fml_sem I ($\<phi> vid1 local.empty)}
[PROOF STEP]
apply(auto simp add: empty_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(a::real) * x\<^sup>2 + b * x + c = 0 \<longrightarrow> b\<^sup>2 \<ge> 4 * a * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * x\<^sup>2 + b * x + c = 0 \<longrightarrow> 4 * a * c \<le> b\<^sup>2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (R<1 * (R<1 * [2*a*x + b]^2))))")


[STATEMENT]
lemma finite_singletons: "finite S \<Longrightarrow> finite ({{v} | v. v \<in> S})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> finite {{v} |v. v \<in> S}
[PROOF STEP]
by (auto)


[STATEMENT]
lemma cnj_one [simp]: "cnj 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Octonions.cnj 1 = 1
[PROOF STEP]
by (simp add: octo_eq_iff)


[STATEMENT]
lemma not_enat_eq [iff]: "(\<forall>y. x \<noteq> enat y) = (x = \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y. x \<noteq> enat y) = (x = \<infinity>)
[PROOF STEP]
by (cases x) auto


[STATEMENT]
lemma "(3 :: int) + 1 = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 + 1 = 4
[PROOF STEP]
by (smt (verit))


[STATEMENT]
lemma nl2: "\<lbrakk> ll \<ge> 1; lr \<ge> 1; r \<ge> 1 \<rbrakk> \<Longrightarrow>
  log \<alpha> (ll + lr) + \<beta> * log \<alpha> (lr + r)
  \<le> \<beta> * log \<alpha> (ll + lr) + log \<alpha> (ll + lr + r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> ll; 1 \<le> lr; 1 \<le> r\<rbrakk> \<Longrightarrow> log \<alpha> (ll + lr) + \<beta> * log \<alpha> (lr + r) \<le> \<beta> * log \<alpha> (ll + lr) + log \<alpha> (ll + lr + r)
[PROOF STEP]
apply(rule powr_le_cancel_iff[THEN iffD1, OF a1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> ll; 1 \<le> lr; 1 \<le> r\<rbrakk> \<Longrightarrow> \<alpha> powr (log \<alpha> (ll + lr) + \<beta> * log \<alpha> (lr + r)) \<le> \<alpha> powr (\<beta> * log \<alpha> (ll + lr) + log \<alpha> (ll + lr + r))
[PROOF STEP]
apply(simp add: powr_add mult.commute[of \<beta>] powr_powr[symmetric] A1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lem: "(0::nat) < n \<Longrightarrow> n + n \<le> Suc (n * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n + n \<le> Suc (n * n)
[PROOF STEP]
by (induct n) simp_all