[STATEMENT]
lemma sum_norm_allsubsets_bound:
  fixes f :: "'a \<Rightarrow> 'n::euclidean_space"
  assumes fP: "finite P"
    and fPs: "\<And>Q. Q \<subseteq> P \<Longrightarrow> norm (sum f Q) \<le> e"
  shows "(\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
have "(\<Sum>x\<in>P. norm (f x)) \<le> (\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> (\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>)
[PROOF STEP]
by (rule sum_mono) (rule norm_le_l1)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>P. norm (f x)) \<le> (\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>)

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>P. norm (f x)) \<le> (\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>)

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
have "(\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>) = (\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>) = (\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>)
[PROOF STEP]
by (rule sum.swap)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>) = (\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>)

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>P. \<Sum>b\<in>Basis. \<bar>inner (f x) b\<bar>) = (\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>)

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
have "\<dots> \<le> of_nat (card (Basis :: 'n set)) * (2 * e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>) \<le> real DIM('n) * (2 * e)
[PROOF STEP]
proof (rule sum_bounded_above)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
fix i :: 'n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
assume i: "i \<in> Basis"
[PROOF STATE]
proof (state)
this:
i \<in> Basis

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
have "norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le>
      norm (inner (\<Sum>x\<in>P \<inter> - {x. inner (f x) i < 0}. f x) i) + norm (inner (\<Sum>x\<in>P \<inter> {x. inner (f x) i < 0}. f x) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> norm (inner (sum f (P \<inter> - {x. inner (f x) i < 0})) i) + norm (inner (sum f (P \<inter> {x. inner (f x) i < 0})) i)
[PROOF STEP]
by (simp add: abs_real_def sum.If_cases[OF fP] sum_negf norm_triangle_ineq4 inner_sum_left
        del: real_norm_def)
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> norm (inner (sum f (P \<inter> - {x. inner (f x) i < 0})) i) + norm (inner (sum f (P \<inter> {x. inner (f x) i < 0})) i)

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> norm (inner (sum f (P \<inter> - {x. inner (f x) i < 0})) i) + norm (inner (sum f (P \<inter> {x. inner (f x) i < 0})) i)

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
have "\<dots> \<le> e + e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (inner (sum f (P \<inter> - {x. inner (f x) i < 0})) i) + norm (inner (sum f (P \<inter> {x. inner (f x) i < 0})) i) \<le> e + e
[PROOF STEP]
unfolding real_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>inner (sum f (P \<inter> - {x. inner (f x) i < 0})) i\<bar> + \<bar>inner (sum f (P \<inter> {x. inner (f x) i < 0})) i\<bar> \<le> e + e
[PROOF STEP]
by (intro add_mono norm_bound_Basis_le i fPs) auto
[PROOF STATE]
proof (state)
this:
norm (inner (sum f (P \<inter> - {x. inner (f x) i < 0})) i) + norm (inner (sum f (P \<inter> {x. inner (f x) i < 0})) i) \<le> e + e

goal (1 subgoal):
 1. \<And>i. i \<in> Basis \<Longrightarrow> (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> e + e
[PROOF STEP]
show "(\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2*e"
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> e + e

goal (1 subgoal):
 1. (\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>P. \<bar>inner (f x) i\<bar>) \<le> 2 * e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>) \<le> real DIM('n) * (2 * e)

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. \<Sum>x\<in>P. \<bar>inner (f x) b\<bar>) \<le> real DIM('n) * (2 * e)

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
have "\<dots> = 2 * real DIM('n) * e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real DIM('n) * (2 * e) = 2 * real DIM('n) * e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real DIM('n) * (2 * e) = 2 * real DIM('n) * e

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e

goal (1 subgoal):
 1. (\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>P. norm (f x)) \<le> 2 * real DIM('n) * e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coord_ring_to_UP_SA_add:
  assumes "f \<in> carrier (Q\<^sub>p[\<X>\<^bsub>Suc n\<^esub>])"
  assumes "g \<in> carrier (Q\<^sub>p[\<X>\<^bsub>Suc n\<^esub>])"
  shows "coord_ring_to_UP_SA n (f \<oplus>\<^bsub>Q\<^sub>p[\<X>\<^bsub>Suc n\<^esub>]\<^esub>g) = coord_ring_to_UP_SA n f  \<oplus>\<^bsub>UP (SA n)\<^esub> coord_ring_to_UP_SA n g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coord_ring_to_UP_SA n (f \<oplus>\<^bsub>Q\<^sub>p [\<X>\<^bsub>Suc n\<^esub>]\<^esub> g) = coord_ring_to_UP_SA n f \<oplus>\<^bsub>UP (SA n)\<^esub> coord_ring_to_UP_SA n g
[PROOF STEP]
using assms coord_ring_to_UP_SA_is_hom ring_hom_add
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>Suc n\<^esub>])
g \<in> carrier (Q\<^sub>p [\<X>\<^bsub>Suc n\<^esub>])
coord_ring_to_UP_SA ?n \<in> ring_hom (Q\<^sub>p [\<X>\<^bsub>Suc ?n\<^esub>]) (UP (SA ?n))
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<oplus>\<^bsub>?R\<^esub> ?y) = ?h ?x \<oplus>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. coord_ring_to_UP_SA n (f \<oplus>\<^bsub>Q\<^sub>p [\<X>\<^bsub>Suc n\<^esub>]\<^esub> g) = coord_ring_to_UP_SA n f \<oplus>\<^bsub>UP (SA n)\<^esub> coord_ring_to_UP_SA n g
[PROOF STEP]
by (metis (mono_tags, opaque_lifting))


[STATEMENT]
lemma open_halfspace_lt: "open {x. inner a x < b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. a \<bullet> x < b}
[PROOF STEP]
by (simp add: open_Collect_less continuous_on_inner)


[STATEMENT]
lemma lift_imp_trans:
  assumes "\<turnstile> A \<longrightarrow> B" and "\<turnstile> B \<longrightarrow> C"
  shows "\<turnstile> A \<longrightarrow> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> A \<longrightarrow> C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<turnstile> A \<longrightarrow> B
\<turnstile> B \<longrightarrow> C

goal (1 subgoal):
 1. \<turnstile> A \<longrightarrow> C
[PROOF STEP]
by force


[STATEMENT]
lemma filter_size_blocks_eq_card_indexes: "size {# b \<in># \<B> . P b #} = card {j \<in> {..<(\<b>)}. P (\<B>s ! j)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
have "\<B> = image_mset (\<lambda> j . \<B>s ! j) (mset_set {..<(\<b>)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B> = image_mset ((!) \<B>s) (mset_set {..<\<b>})
[PROOF STEP]
using blocks_mset_image
[PROOF STATE]
proof (prove)
using this:
\<B> = image_mset ((!) \<B>s) (mset_set {..<\<b>})

goal (1 subgoal):
 1. \<B> = image_mset ((!) \<B>s) (mset_set {..<\<b>})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<B> = image_mset ((!) \<B>s) (mset_set {..<\<b>})

goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<B> = image_mset ((!) \<B>s) (mset_set {..<\<b>})
[PROOF STEP]
have helper: "{# b \<in># \<B> . P b #} = image_mset (\<lambda> j . \<B>s ! j) {# j \<in># (mset_set {..< \<b>}). P (\<B>s ! j) #} "
[PROOF STATE]
proof (prove)
using this:
\<B> = image_mset ((!) \<B>s) (mset_set {..<\<b>})

goal (1 subgoal):
 1. filter_mset P \<B> = image_mset ((!) \<B>s) {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}
[PROOF STEP]
by (simp add: filter_mset_image_mset)
[PROOF STATE]
proof (state)
this:
filter_mset P \<B> = image_mset ((!) \<B>s) {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}

goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
have "card {j \<in> {..<\<b>}. P (\<B>s ! j)} = size {# j \<in># (mset_set {..< \<b>}). P (\<B>s ! j) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {j \<in> {..<\<b>}. P (\<B>s ! j)} = size {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}
[PROOF STEP]
using card_size_filter_eq [of "{..<\<b>}"]
[PROOF STATE]
proof (prove)
using this:
finite {..<\<b>} \<Longrightarrow> card {a \<in> {..<\<b>}. ?P a} = size (filter_mset ?P (mset_set {..<\<b>}))

goal (1 subgoal):
 1. card {j \<in> {..<\<b>}. P (\<B>s ! j)} = size {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {j \<in> {..<\<b>}. P (\<B>s ! j)} = size {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}

goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card {j \<in> {..<\<b>}. P (\<B>s ! j)} = size {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}

goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
using helper
[PROOF STATE]
proof (prove)
using this:
card {j \<in> {..<\<b>}. P (\<B>s ! j)} = size {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}
filter_mset P \<B> = image_mset ((!) \<B>s) {#j \<in># mset_set {..<\<b>}. P (\<B>s ! j)#}

goal (1 subgoal):
 1. size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (filter_mset P \<B>) = card {j \<in> {..<\<b>}. P (\<B>s ! j)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma antisym_sum :
  fixes x :: "'a + 'b"
  fixes y :: "'a + 'b"
  shows "x \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (cases x; cases y; auto)


[STATEMENT]
lemma snd_proj_mem [simp]: "(B \<in> snd_proj M) = (\<exists>A. (A,B)\<in>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B \<in> snd_proj M) = (\<exists>A. (A, B) \<in> M)
[PROOF STEP]
unfolding snd_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B \<in> {B. \<exists>A. (A, B) \<in> M}) = (\<exists>A. (A, B) \<in> M)
[PROOF STEP]
by auto


[STATEMENT]
lemma DISJ_union[simp]: "finite X \<Longrightarrow> finite Y \<Longrightarrow> DISJ (X \<union> Y) \<triangleq> Disj (DISJ X) (DISJ Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; finite Y\<rbrakk> \<Longrightarrow> DISJ (X \<union> Y) \<triangleq> Disj (DISJ X) (DISJ Y)
[PROOF STEP]
by (induct X rule: finite_induct)
    (auto intro!: DISJ_insert[THEN equiv_trans] simp: equiv_def)


[STATEMENT]
lemma (in ring) eval_poly_add:
  assumes "set p \<subseteq> carrier R" "set q \<subseteq> carrier R" and "a \<in> carrier R"
  shows "eval (poly_add p q) a = (eval p a) \<oplus> (eval q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
fix p q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
assume A: "set p \<subseteq> carrier R" "set q \<subseteq> carrier R" "length p \<ge> length q"
[PROOF STATE]
proof (state)
this:
set p \<subseteq> carrier R
set q \<subseteq> carrier R
length q \<le> length p

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
hence "eval (poly_add p ((replicate (length p - length q) \<zero>) @ q)) a =
         (eval p a) \<oplus> (eval ((replicate (length p - length q) \<zero>) @ q) a)"
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R
set q \<subseteq> carrier R
length q \<le> length p

goal (1 subgoal):
 1. local.eval (poly_add p (replicate (length p - length q) \<zero> @ q)) a = local.eval p a \<oplus> local.eval (replicate (length p - length q) \<zero> @ q) a
[PROOF STEP]
using eval_poly_add_aux[OF A(1) _ _ assms(3), of "(replicate (length p - length q) \<zero>) @ q"]
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> carrier R
set q \<subseteq> carrier R
length q \<le> length p
\<lbrakk>set (replicate (length p - length q) \<zero> @ q) \<subseteq> carrier R; length p = length (replicate (length p - length q) \<zero> @ q)\<rbrakk> \<Longrightarrow> local.eval (poly_add p (replicate (length p - length q) \<zero> @ q)) a = local.eval p a \<oplus> local.eval (replicate (length p - length q) \<zero> @ q) a

goal (1 subgoal):
 1. local.eval (poly_add p (replicate (length p - length q) \<zero> @ q)) a = local.eval p a \<oplus> local.eval (replicate (length p - length q) \<zero> @ q) a
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
local.eval (poly_add p (replicate (length p - length q) \<zero> @ q)) a = local.eval p a \<oplus> local.eval (replicate (length p - length q) \<zero> @ q) a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
hence "eval (poly_add p q) a = (eval p a) \<oplus> (eval q a)"
[PROOF STATE]
proof (prove)
using this:
local.eval (poly_add p (replicate (length p - length q) \<zero> @ q)) a = local.eval p a \<oplus> local.eval (replicate (length p - length q) \<zero> @ q) a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
using eval_replicate[OF A(2) assms(3)] A(3)
[PROOF STATE]
proof (prove)
using this:
local.eval (poly_add p (replicate (length p - length q) \<zero> @ q)) a = local.eval p a \<oplus> local.eval (replicate (length p - length q) \<zero> @ q) a
local.eval (replicate ?n \<zero> @ q) a = local.eval q a
length q \<le> length p

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>set ?pa2 \<subseteq> carrier R; set ?qa2 \<subseteq> carrier R; length ?qa2 \<le> length ?pa2\<rbrakk> \<Longrightarrow> local.eval (poly_add ?pa2 ?qa2) a = local.eval ?pa2 a \<oplus> local.eval ?qa2 a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
note aux_lemma = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>set ?pa2 \<subseteq> carrier R; set ?qa2 \<subseteq> carrier R; length ?qa2 \<le> length ?pa2\<rbrakk> \<Longrightarrow> local.eval (poly_add ?pa2 ?qa2) a = local.eval ?pa2 a \<oplus> local.eval ?qa2 a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
have ?thesis if "length q \<ge> length p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
using assms(1-2)[THEN eval_in_carrier[OF _ assms(3)]] poly_add_comm[OF assms(1-2)]
          aux_lemma[OF assms(2,1) that]
[PROOF STATE]
proof (prove)
using this:
local.eval p a \<in> carrier R
local.eval q a \<in> carrier R
poly_add p q = poly_add q p
local.eval (poly_add q p) a = local.eval q a \<oplus> local.eval p a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
by (auto simp del: poly_add.simps simp add: add.m_comm)
[PROOF STATE]
proof (state)
this:
length p \<le> length q \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length p \<le> length q \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
have ?thesis if "length p \<ge> length q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
using aux_lemma[OF assms(1-2) that]
[PROOF STATE]
proof (prove)
using this:
local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length q \<le> length p \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length p \<le> length q \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
length q \<le> length p \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length p \<le> length q \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
length q \<le> length p \<Longrightarrow> local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal (1 subgoal):
 1. local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.eval (poly_add p q) a = local.eval p a \<oplus> local.eval q a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_unit_disc_fix_is_poincare_line_to_x_axis:
  assumes "is_poincare_line l"
  shows  "\<exists> M. unit_disc_fix M \<and> moebius_circline M l = x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_poincare_line l
[PROOF STEP]
obtain u v where "u \<noteq> v" "u \<in> unit_disc" "v \<in> unit_disc" and "{u, v} \<subseteq> circline_set l"
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<noteq> v; u \<in> unit_disc; v \<in> unit_disc; {u, v} \<subseteq> circline_set l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_is_poincare_line_points
[PROOF STATE]
proof (prove)
using this:
is_poincare_line l
is_poincare_line ?H \<Longrightarrow> \<exists>u v. u \<in> unit_disc \<and> v \<in> unit_disc \<and> u \<noteq> v \<and> {u, v} \<subseteq> circline_set ?H

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<noteq> v; u \<in> unit_disc; v \<in> unit_disc; {u, v} \<subseteq> circline_set l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
{u, v} \<subseteq> circline_set l

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
{u, v} \<subseteq> circline_set l
[PROOF STEP]
obtain M where *: "unit_disc_fix M" "moebius_pt M u = 0\<^sub>h" "moebius_pt M v \<in> positive_x_axis"
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
{u, v} \<subseteq> circline_set l

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>unit_disc_fix M; moebius_pt M u = 0\<^sub>h; moebius_pt M v \<in> positive_x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_unit_disc_fix_to_zero_positive_x_axis[of u v]
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
u \<in> unit_disc
v \<in> unit_disc
{u, v} \<subseteq> circline_set l
\<lbrakk>u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v\<rbrakk> \<Longrightarrow> \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>unit_disc_fix M; moebius_pt M u = 0\<^sub>h; moebius_pt M v \<in> positive_x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
hence "{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis"
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis

goal (1 subgoal):
 1. {0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis
[PROOF STEP]
unfolding positive_x_axis_def
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> {z \<in> circline_set x_axis. z \<noteq> \<infinity>\<^sub>h \<and> 0 < Re (to_complex z)}

goal (1 subgoal):
 1. {0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
have "moebius_pt M v \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt M v \<noteq> 0\<^sub>h
[PROOF STEP]
using \<open>u \<noteq> v\<close> *
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis

goal (1 subgoal):
 1. moebius_pt M v \<noteq> 0\<^sub>h
[PROOF STEP]
by (metis moebius_pt_neq_I)
[PROOF STATE]
proof (state)
this:
moebius_pt M v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
moebius_pt M v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
have "moebius_pt M v \<noteq> \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt M v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using \<open>unit_disc_fix M\<close> \<open>v \<in> unit_disc\<close>
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
v \<in> unit_disc

goal (1 subgoal):
 1. moebius_pt M v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using unit_disc_fix_discI
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
v \<in> unit_disc
\<lbrakk>unit_disc_fix ?M; ?u \<in> unit_disc\<rbrakk> \<Longrightarrow> moebius_pt ?M ?u \<in> unit_disc

goal (1 subgoal):
 1. moebius_pt M v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
moebius_pt M v \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis
{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis
moebius_pt M v \<noteq> 0\<^sub>h
moebius_pt M v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis
{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis
moebius_pt M v \<noteq> 0\<^sub>h
moebius_pt M v \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
using \<open>is_poincare_line l\<close> \<open>{u, v} \<subseteq> circline_set l\<close> \<open>unit_disc_fix M\<close>
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis
{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis
moebius_pt M v \<noteq> 0\<^sub>h
moebius_pt M v \<noteq> \<infinity>\<^sub>h
is_poincare_line l
{u, v} \<subseteq> circline_set l
unit_disc_fix M

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
using is_poincare_line_0_real_is_x_axis[of "moebius_circline M l" "moebius_pt M v"]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M
moebius_pt M u = 0\<^sub>h
moebius_pt M v \<in> positive_x_axis
{0\<^sub>h, moebius_pt M v} \<subseteq> circline_set x_axis
moebius_pt M v \<noteq> 0\<^sub>h
moebius_pt M v \<noteq> \<infinity>\<^sub>h
is_poincare_line l
{u, v} \<subseteq> circline_set l
unit_disc_fix M
\<lbrakk>is_poincare_line (moebius_circline M l); 0\<^sub>h \<in> circline_set (moebius_circline M l); moebius_pt M v \<in> circline_set (moebius_circline M l) \<inter> circline_set x_axis; moebius_pt M v \<noteq> 0\<^sub>h; moebius_pt M v \<noteq> \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> moebius_circline M l = x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis
[PROOF STEP]
by (rule_tac x="M" in exI, force)
[PROOF STATE]
proof (state)
this:
\<exists>M. unit_disc_fix M \<and> moebius_circline M l = x_axis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Y_nonzero: assumes y: "y \<in> Y"
  shows "y $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y $h i \<noteq> 0
[PROOF STEP]
using Y_pos[OF y, of i]
[PROOF STATE]
proof (prove)
using this:
0 < y $h i

goal (1 subgoal):
 1. y $h i \<noteq> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma Bseq_bdd_above': "Bseq X \<Longrightarrow> bdd_above (range (\<lambda>n. norm (X n)))"
  for X :: "nat \<Rightarrow> 'a :: real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq X \<Longrightarrow> bdd_above (range (\<lambda>n. norm (X n)))
[PROOF STEP]
proof (elim BseqE, intro bdd_aboveI2)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>K x. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K; x \<in> UNIV\<rbrakk> \<Longrightarrow> norm (X x) \<le> ?M1 K
[PROOF STEP]
fix K n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>K x. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K; x \<in> UNIV\<rbrakk> \<Longrightarrow> norm (X x) \<le> ?M1 K
[PROOF STEP]
assume "0 < K" "\<forall>n. norm (X n) \<le> K"
[PROOF STATE]
proof (state)
this:
0 < K
\<forall>n. norm (X n) \<le> K

goal (1 subgoal):
 1. \<And>K x. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K; x \<in> UNIV\<rbrakk> \<Longrightarrow> norm (X x) \<le> ?M1 K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < K
\<forall>n. norm (X n) \<le> K
[PROOF STEP]
show "norm (X n) \<le> K"
[PROOF STATE]
proof (prove)
using this:
0 < K
\<forall>n. norm (X n) \<le> K

goal (1 subgoal):
 1. norm (X n) \<le> K
[PROOF STEP]
by (auto elim!: allE[of _ n])
[PROOF STATE]
proof (state)
this:
norm (X n) \<le> K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lcm_dvdD: "Lcm A dvd x \<Longrightarrow> y \<in> A \<Longrightarrow> y dvd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Lcm A dvd x; y \<in> A\<rbrakk> \<Longrightarrow> y dvd x
[PROOF STEP]
using dvd_Lcm dvd_trans
[PROOF STATE]
proof (prove)
using this:
?a \<in> ?A \<Longrightarrow> ?a dvd Lcm ?A
\<lbrakk>?a dvd ?b; ?b dvd ?c\<rbrakk> \<Longrightarrow> ?a dvd ?c

goal (1 subgoal):
 1. \<lbrakk>Lcm A dvd x; y \<in> A\<rbrakk> \<Longrightarrow> y dvd x
[PROOF STEP]
by blast


[STATEMENT]
lemma l8_2:
  assumes "Per A B C"
  shows "Per C B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
obtain C' where P1: "B Midpoint C C' \<and> Cong A C A C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C'. B Midpoint C C' \<and> Cong A C A C' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Per_def assms
[PROOF STATE]
proof (prove)
using this:
Per ?A ?B ?C \<equiv> \<exists>C'. ?B Midpoint ?C C' \<and> Cong ?A ?C ?A C'
Per A B C

goal (1 subgoal):
 1. (\<And>C'. B Midpoint C C' \<and> Cong A C A C' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B Midpoint C C' \<and> Cong A C A C'

goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
obtain A' where P2: "B Midpoint A A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A'. B Midpoint A A' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using symmetric_point_construction
[PROOF STATE]
proof (prove)
using this:
\<exists>P'. ?A Midpoint ?P P'

goal (1 subgoal):
 1. (\<And>A'. B Midpoint A A' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B Midpoint A A'

goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
have "Cong C' A C A'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong C' A C A'
[PROOF STEP]
using Mid_perm P1 P2 l7_13
[PROOF STATE]
proof (prove)
using this:
?A Midpoint ?B ?C \<Longrightarrow> ?A Midpoint ?B ?C \<and> ?A Midpoint ?C ?B
B Midpoint C C' \<and> Cong A C A C'
B Midpoint A A'
\<lbrakk>?A Midpoint ?P' ?P; ?A Midpoint ?Q' ?Q\<rbrakk> \<Longrightarrow> Cong ?P ?Q ?P' ?Q'

goal (1 subgoal):
 1. Cong C' A C A'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Cong C' A C A'

goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Cong C' A C A'

goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
using P1 P2 Per_def cong_4321 cong_inner_transitivity
[PROOF STATE]
proof (prove)
using this:
Cong C' A C A'
B Midpoint C C' \<and> Cong A C A C'
B Midpoint A A'
Per ?A ?B ?C \<equiv> \<exists>C'. ?B Midpoint ?C C' \<and> Cong ?A ?C ?A C'
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?D ?C ?B ?A
\<forall>a b p q r s. Cong a b p q \<and> Cong a b r s \<longrightarrow> Cong p q r s

goal (1 subgoal):
 1. Per C B A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Per C B A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_segment_subset:
  assumes "j \<le> k"
  shows "set (list_segment i j as) \<subseteq> set (list_segment i k as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (list_segment i j as) \<subseteq> set (list_segment i k as)
[PROOF STEP]
apply(cases "i > j")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. j < i \<Longrightarrow> set (list_segment i j as) \<subseteq> set (list_segment i k as)
 2. \<not> j < i \<Longrightarrow> set (list_segment i j as) \<subseteq> set (list_segment i k as)
[PROOF STEP]
unfolding list_segment_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
 2. \<not> j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
apply (metis in_set_conv_nth length_map list.size(3) order.asym subsetI upt_rec zero_order(3))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
assume "\<not> j < i"
[PROOF STATE]
proof (state)
this:
\<not> j < i

goal (1 subgoal):
 1. \<not> j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> j < i
[PROOF STEP]
have "i \<le>j"
[PROOF STATE]
proof (prove)
using this:
\<not> j < i

goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
using not_le
[PROOF STATE]
proof (prove)
using this:
\<not> j < i
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i \<le> j

goal (1 subgoal):
 1. \<not> j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<le> j
[PROOF STEP]
have "list_segment i j as @ list_segment j k as = list_segment i k as"
[PROOF STATE]
proof (prove)
using this:
i \<le> j

goal (1 subgoal):
 1. list_segment i j as @ list_segment j k as = list_segment i k as
[PROOF STEP]
using assms list_segment_concat[of j k i as]
[PROOF STATE]
proof (prove)
using this:
i \<le> j
j \<le> k
\<lbrakk>j \<le> k; i \<le> j\<rbrakk> \<Longrightarrow> list_segment i j as @ list_segment j k as = list_segment i k as

goal (1 subgoal):
 1. list_segment i j as @ list_segment j k as = list_segment i k as
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_segment i j as @ list_segment j k as = list_segment i k as

goal (1 subgoal):
 1. \<not> j < i \<Longrightarrow> set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_segment i j as @ list_segment j k as = list_segment i k as
[PROOF STEP]
show "set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])"
[PROOF STATE]
proof (prove)
using this:
list_segment i j as @ list_segment j k as = list_segment i k as

goal (1 subgoal):
 1. set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
using set_append
[PROOF STATE]
proof (prove)
using this:
list_segment i j as @ list_segment j k as = list_segment i k as
set (?xs @ ?ys) = set ?xs \<union> set ?ys

goal (1 subgoal):
 1. set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
unfolding list_segment_def
[PROOF STATE]
proof (prove)
using this:
map ((!) as) [i..<j] @ map ((!) as) [j..<k] = map ((!) as) [i..<k]
set (?xs @ ?ys) = set ?xs \<union> set ?ys

goal (1 subgoal):
 1. set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])
[PROOF STEP]
by (metis Un_upper1)
[PROOF STATE]
proof (state)
this:
set (map ((!) as) [i..<j]) \<subseteq> set (map ((!) as) [i..<k])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Knaster_Tarski':
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  assumes "mono f"
  shows "\<exists>a. f a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. f a = a
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ?a = ?a
[PROOF STEP]
let ?H = "{u. f u \<le> u}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ?a = ?a
[PROOF STEP]
let ?a = "\<Sqinter>?H"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ?a = ?a
[PROOF STEP]
show "f ?a = ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) = \<Sqinter> {u. f u \<le> u}
[PROOF STEP]
proof (rule order_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f (\<Sqinter> {u. f u \<le> u}) \<le> \<Sqinter> {u. f u \<le> u}
 2. \<Sqinter> {u. f u \<le> u} \<le> f (\<Sqinter> {u. f u \<le> u})
[PROOF STEP]
show "f ?a \<le> ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) \<le> \<Sqinter> {u. f u \<le> u}
[PROOF STEP]
proof (rule Inf_greatest)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
assume "x \<in> ?H"
[PROOF STATE]
proof (state)
this:
x \<in> {u. f u \<le> u}

goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {u. f u \<le> u}
[PROOF STEP]
have "?a \<le> x"
[PROOF STATE]
proof (prove)
using this:
x \<in> {u. f u \<le> u}

goal (1 subgoal):
 1. \<Sqinter> {u. f u \<le> u} \<le> x
[PROOF STEP]
by (rule Inf_lower)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {u. f u \<le> u} \<le> x

goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
with \<open>mono f\<close>
[PROOF STATE]
proof (chain)
picking this:
mono f
\<Sqinter> {u. f u \<le> u} \<le> x
[PROOF STEP]
have "f ?a \<le> f x"
[PROOF STATE]
proof (prove)
using this:
mono f
\<Sqinter> {u. f u \<le> u} \<le> x

goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) \<le> f x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> {u. f u \<le> u}) \<le> f x

goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> {u. f u \<le> u}) \<le> f x

goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
from \<open>x \<in> ?H\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> {u. f u \<le> u}
[PROOF STEP]
have "\<dots> \<le> x"
[PROOF STATE]
proof (prove)
using this:
x \<in> {u. f u \<le> u}

goal (1 subgoal):
 1. f x \<le> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f x \<le> x

goal (1 subgoal):
 1. \<And>x. x \<in> {u. f u \<le> u} \<Longrightarrow> f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
show "f ?a \<le> x"
[PROOF STATE]
proof (prove)
using this:
f (\<Sqinter> {u. f u \<le> u}) \<le> x

goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) \<le> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> {u. f u \<le> u}) \<le> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> {u. f u \<le> u}) \<le> \<Sqinter> {u. f u \<le> u}

goal (1 subgoal):
 1. \<Sqinter> {u. f u \<le> u} \<le> f (\<Sqinter> {u. f u \<le> u})
[PROOF STEP]
show "?a \<le> f ?a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {u. f u \<le> u} \<le> f (\<Sqinter> {u. f u \<le> u})
[PROOF STEP]
proof (rule Inf_lower)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) \<in> {u. f u \<le> u}
[PROOF STEP]
from \<open>mono f\<close> and \<open>f ?a \<le> ?a\<close>
[PROOF STATE]
proof (chain)
picking this:
mono f
f (\<Sqinter> {u. f u \<le> u}) \<le> \<Sqinter> {u. f u \<le> u}
[PROOF STEP]
have "f (f ?a) \<le> f ?a"
[PROOF STATE]
proof (prove)
using this:
mono f
f (\<Sqinter> {u. f u \<le> u}) \<le> \<Sqinter> {u. f u \<le> u}

goal (1 subgoal):
 1. f (f (\<Sqinter> {u. f u \<le> u})) \<le> f (\<Sqinter> {u. f u \<le> u})
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f (f (\<Sqinter> {u. f u \<le> u})) \<le> f (\<Sqinter> {u. f u \<le> u})

goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) \<in> {u. f u \<le> u}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f (f (\<Sqinter> {u. f u \<le> u})) \<le> f (\<Sqinter> {u. f u \<le> u})
[PROOF STEP]
show "f ?a \<in> ?H"
[PROOF STATE]
proof (prove)
using this:
f (f (\<Sqinter> {u. f u \<le> u})) \<le> f (\<Sqinter> {u. f u \<le> u})

goal (1 subgoal):
 1. f (\<Sqinter> {u. f u \<le> u}) \<in> {u. f u \<le> u}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> {u. f u \<le> u}) \<in> {u. f u \<le> u}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Sqinter> {u. f u \<le> u} \<le> f (\<Sqinter> {u. f u \<le> u})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (\<Sqinter> {u. f u \<le> u}) = \<Sqinter> {u. f u \<le> u}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rev_maps_eq_iff: "rev_map g = rev_map h \<longleftrightarrow> g = h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rev_map g = rev_map h) = (g = h)
[PROOF STEP]
using arg_cong[of "rev_map g" "rev_map h" rev_map, unfolded rev_map_idemp]
[PROOF STATE]
proof (prove)
using this:
rev_map g = rev_map h \<Longrightarrow> g = h

goal (1 subgoal):
 1. (rev_map g = rev_map h) = (g = h)
[PROOF STEP]
by fast


[STATEMENT]
lemma product_dvd_irreducibleD:
  fixes a b x :: "'a :: algebraic_semidom"
  assumes "irreducible x"
  assumes "a * b dvd x"
  shows "a dvd 1 \<or> b dvd 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
irreducible x
a * b dvd x
[PROOF STEP]
obtain c where "x = a * b * c"
[PROOF STATE]
proof (prove)
using this:
irreducible x
a * b dvd x

goal (1 subgoal):
 1. (\<And>c. x = a * b * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = a * b * c

goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
hence "x = a * (b * c)"
[PROOF STATE]
proof (prove)
using this:
x = a * b * c

goal (1 subgoal):
 1. x = a * (b * c)
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
x = a * (b * c)

goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
from irreducibleD[OF assms(1) this]
[PROOF STATE]
proof (chain)
picking this:
is_unit a \<or> is_unit (b * c)
[PROOF STEP]
show "a dvd 1 \<or> b dvd 1"
[PROOF STATE]
proof (prove)
using this:
is_unit a \<or> is_unit (b * c)

goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
by (auto simp: is_unit_mult_iff)
[PROOF STATE]
proof (state)
this:
is_unit a \<or> is_unit b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma open_translation:
  fixes S :: "'a::real_normed_vector set"
  assumes "open S"
  shows "open((\<lambda>x. a + x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
have "continuous (at x) (\<lambda>x. x - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. x - a) x
[PROOF STEP]
by (intro continuous_diff continuous_ident continuous_const)
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - a) x

goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - a) ?x2

goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. x - a) ?x2

goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
have "{x. x - a \<in> S} = (+) a ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. x - a \<in> S} = (+) a ` S
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{x. x - a \<in> S} = (+) a ` S

goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
isCont (\<lambda>x. x - a) ?x2
{x. x - a \<in> S} = (+) a ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. x - a) ?x2
{x. x - a \<in> S} = (+) a ` S

goal (1 subgoal):
 1. open ((+) a ` S)
[PROOF STEP]
by (metis assms continuous_open_vimage vimage_def)
[PROOF STATE]
proof (state)
this:
open ((+) a ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trancl_eqI:
  assumes "\<forall>(a,b) \<in> A. \<forall>(c,d) \<in> A. b = c \<longrightarrow> (a,d) \<in> A"
  shows "A = A\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = A\<^sup>+
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<subseteq> A\<^sup>+
 2. A\<^sup>+ \<subseteq> A
[PROOF STEP]
show "A\<^sup>+ \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>+ \<subseteq> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A\<^sup>+ \<Longrightarrow> x \<in> A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A\<^sup>+ \<Longrightarrow> x \<in> A
[PROOF STEP]
assume x: "x \<in> A\<^sup>+"
[PROOF STATE]
proof (state)
this:
x \<in> A\<^sup>+

goal (1 subgoal):
 1. \<And>x. x \<in> A\<^sup>+ \<Longrightarrow> x \<in> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> A\<^sup>+
[PROOF STEP]
obtain a b where ab: "x = (a,b)"
[PROOF STATE]
proof (prove)
using this:
x \<in> A\<^sup>+

goal (1 subgoal):
 1. (\<And>a b. x = (a, b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis surj_pair)
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. \<And>x. x \<in> A\<^sup>+ \<Longrightarrow> x \<in> A
[PROOF STEP]
hence "(a,b) \<in> A\<^sup>+"
[PROOF STATE]
proof (prove)
using this:
x = (a, b)

goal (1 subgoal):
 1. (a, b) \<in> A\<^sup>+
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x = (a, b)
x \<in> A\<^sup>+

goal (1 subgoal):
 1. (a, b) \<in> A\<^sup>+
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(a, b) \<in> A\<^sup>+

goal (1 subgoal):
 1. \<And>x. x \<in> A\<^sup>+ \<Longrightarrow> x \<in> A
[PROOF STEP]
hence "(a,b) \<in> A"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> A\<^sup>+

goal (1 subgoal):
 1. (a, b) \<in> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> A\<^sup>+
\<forall>(a, b)\<in>A. \<forall>(c, d)\<in>A. b = c \<longrightarrow> (a, d) \<in> A

goal (1 subgoal):
 1. (a, b) \<in> A
[PROOF STEP]
by (induct rule: trancl_induct) auto
[PROOF STATE]
proof (state)
this:
(a, b) \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A\<^sup>+ \<Longrightarrow> x \<in> A
[PROOF STEP]
thus "x \<in> A"
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> A

goal (1 subgoal):
 1. x \<in> A
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> A
x = (a, b)

goal (1 subgoal):
 1. x \<in> A
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x \<in> A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A\<^sup>+ \<subseteq> A

goal (1 subgoal):
 1. A \<subseteq> A\<^sup>+
[PROOF STEP]
qed auto


[STATEMENT]
lemma continuous_rabs [continuous_intros]:
  "continuous F f \<Longrightarrow> continuous F (\<lambda>x. \<bar>f x :: real\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F f \<Longrightarrow> continuous F (\<lambda>x. \<bar>f x\<bar>)
[PROOF STEP]
unfolding real_norm_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F f \<Longrightarrow> continuous F (\<lambda>x. norm (f x))
[PROOF STEP]
by (rule continuous_norm)


[STATEMENT]
lemma cauchy_diff [simp]:
  assumes "cauchy X" "cauchy Y"
  shows "cauchy (\<lambda>n. X n - Y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy (\<lambda>n. X n - Y n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cauchy X
cauchy Y

goal (1 subgoal):
 1. cauchy (\<lambda>n. X n - Y n)
[PROOF STEP]
unfolding diff_conv_add_uminus
[PROOF STATE]
proof (prove)
using this:
cauchy X
cauchy Y

goal (1 subgoal):
 1. cauchy (\<lambda>n. X n + - Y n)
[PROOF STEP]
by (simp del: add_uminus_conv_diff)


[STATEMENT]
lemma surj_to_el2:"\<lbrakk>surj_to f A B; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. f a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>surj_to f A B; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. f a = b
[PROOF STEP]
apply (simp add:surj_to_def image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>{y. \<exists>x\<in>A. y = f x} = B; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. f a = b
[PROOF STEP]
apply (frule sym, thin_tac "{y. \<exists>x\<in>A. y = f x} = B", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>x\<in>A. b = f x; B = {y. \<exists>x\<in>A. y = f x}\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. f a = b
[PROOF STEP]
apply (erule bexE, simp, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma apply_comp_disjunctive: "Apply.disjunctive = Comp.disjunctive"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Apply.disjunctive = Comp.disjunctive
[PROOF STEP]
apply (simp add: Apply.disjunctive_def Comp.disjunctive_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<forall>y z. x (sup y z) = sup (x y) (x z)} = {x. \<forall>y z. x \<circ> sup y z = sup (x \<circ> y) (x \<circ> z)}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<forall>y z. x (sup y z) = sup (x y) (x z) \<Longrightarrow> x \<circ> sup y z = sup (x \<circ> y) (x \<circ> z)
 2. \<And>x y z. \<forall>y z. x \<circ> sup y z = sup (x \<circ> y) (x \<circ> z) \<Longrightarrow> x (sup y z) = sup (x y) (x z)
[PROOF STEP]
apply (simp_all add: fun_eq_iff sup_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<forall>y z xa. x (sup (y xa) (z xa)) = sup (x (y xa)) (x (z xa)) \<Longrightarrow> x (sup y z) = sup (x y) (x z)
[PROOF STEP]
apply (drule_tac x = "\<lambda> u . y" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<forall>z xa. x (sup y (z xa)) = sup (x y) (x (z xa)) \<Longrightarrow> x (sup y z) = sup (x y) (x z)
[PROOF STEP]
apply (drule_tac x = "\<lambda> u . z" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<forall>xa. x (sup y z) = sup (x y) (x z) \<Longrightarrow> x (sup y z) = sup (x y) (x z)
[PROOF STEP]
by simp


[STATEMENT]
lemma no_pseudominimal_in_pow_is_empty:
  "(\<And>x. \<not> order.pseudominimal_in (Pow A) {x}) \<Longrightarrow> A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<not> order.pseudominimal_in (Pow A) {x}) \<Longrightarrow> A = {}
[PROOF STEP]
using pseudominimal_in_pow_singleton
[PROOF STATE]
proof (prove)
using this:
?a \<in> ?A \<Longrightarrow> order.pseudominimal_in (Pow ?A) {?a}

goal (1 subgoal):
 1. (\<And>x. \<not> order.pseudominimal_in (Pow A) {x}) \<Longrightarrow> A = {}
[PROOF STEP]
by (fast intro: equals0I)


[STATEMENT]
lemma group_closure_scalar_mult_left:
  "of_nat n * s \<in> group_closure S" if "s \<in> group_closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n * s \<in> group_closure S
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
s \<in> group_closure S

goal (1 subgoal):
 1. of_nat n * s \<in> group_closure S
[PROOF STEP]
by (induction n) (auto simp add: algebra_simps intro: group_closure_add)


[STATEMENT]
lemma emeasure_main_part_UN:
  fixes S :: "nat \<Rightarrow> 'a set"
  assumes "range S \<subseteq> sets (completion M)"
  shows "emeasure M (main_part M (\<Union>i. (S i))) = emeasure M (\<Union>i. main_part M (S i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have S: "\<And>i. S i \<in> sets (completion M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. S i \<in> sets (completion M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
range S \<subseteq> sets (completion M)

goal (1 subgoal):
 1. \<And>i. S i \<in> sets (completion M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S ?i \<in> sets (completion M)

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S ?i \<in> sets (completion M)
[PROOF STEP]
have UN: "(\<Union>i. S i) \<in> sets (completion M)"
[PROOF STATE]
proof (prove)
using this:
S ?i \<in> sets (completion M)

goal (1 subgoal):
 1. \<Union> (range S) \<in> sets (completion M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (range S) \<in> sets (completion M)

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "\<forall>i. \<exists>N. N \<in> null_sets M \<and> null_part M (S i) \<subseteq> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. \<exists>N. N \<in> null_sets M \<and> null_part M (S i) \<subseteq> N
[PROOF STEP]
using null_part[OF S]
[PROOF STATE]
proof (prove)
using this:
\<exists>N. N \<in> null_sets M \<and> null_part M (S ?i1) \<subseteq> N

goal (1 subgoal):
 1. \<forall>i. \<exists>N. N \<in> null_sets M \<and> null_part M (S i) \<subseteq> N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. \<exists>N. N \<in> null_sets M \<and> null_part M (S i) \<subseteq> N

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. \<exists>N. N \<in> null_sets M \<and> null_part M (S i) \<subseteq> N
[PROOF STEP]
obtain N where N: "\<forall>x. N x \<in> null_sets M \<and> null_part M (S x) \<subseteq> N x"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. \<exists>N. N \<in> null_sets M \<and> null_part M (S i) \<subseteq> N

goal (1 subgoal):
 1. (\<And>N. \<forall>x. N x \<in> null_sets M \<and> null_part M (S x) \<subseteq> N x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>x. N x \<in> null_sets M \<and> null_part M (S x) \<subseteq> N x

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. N x \<in> null_sets M \<and> null_part M (S x) \<subseteq> N x
[PROOF STEP]
have UN_N: "(\<Union>i. N i) \<in> null_sets M"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. N x \<in> null_sets M \<and> null_part M (S x) \<subseteq> N x

goal (1 subgoal):
 1. \<Union> (range N) \<in> null_sets M
[PROOF STEP]
by (intro null_sets_UN) auto
[PROOF STATE]
proof (state)
this:
\<Union> (range N) \<in> null_sets M

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
from S
[PROOF STATE]
proof (chain)
picking this:
S ?i \<in> sets (completion M)
[PROOF STEP]
have "(\<Union>i. S i) \<in> sets (completion M)"
[PROOF STATE]
proof (prove)
using this:
S ?i \<in> sets (completion M)

goal (1 subgoal):
 1. \<Union> (range S) \<in> sets (completion M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (range S) \<in> sets (completion M)

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
from null_part[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>N. N \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N
[PROOF STEP]
obtain N' where N': "N' \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N'"
[PROOF STATE]
proof (prove)
using this:
\<exists>N. N \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N

goal (1 subgoal):
 1. (\<And>N'. N' \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
N' \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N'

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
let ?N = "(\<Union>i. N i) \<union> N'"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have null_set: "?N \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range N) \<union> N' \<in> null_sets M
[PROOF STEP]
using N' UN_N
[PROOF STATE]
proof (prove)
using this:
N' \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N'
\<Union> (range N) \<in> null_sets M

goal (1 subgoal):
 1. \<Union> (range N) \<union> N' \<in> null_sets M
[PROOF STEP]
by (intro null_sets.Un) auto
[PROOF STATE]
proof (state)
this:
\<Union> (range N) \<union> N' \<in> null_sets M

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "main_part M (\<Union>i. S i) \<union> ?N = (main_part M (\<Union>i. S i) \<union> null_part M (\<Union>i. S i)) \<union> ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
using N'
[PROOF STATE]
proof (prove)
using this:
N' \<in> null_sets M \<and> null_part M (\<Union> (range S)) \<subseteq> N'

goal (1 subgoal):
 1. main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "\<dots> = (\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
unfolding main_part_null_part_Un[OF S] main_part_null_part_Un[OF UN]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range S) \<union> (\<Union> (range N) \<union> N') = \<Union> (range S) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
main_part M (\<Union> (range S)) \<union> null_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "\<dots> = (\<Union>i. main_part M (S i)) \<union> ?N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
using N
[PROOF STATE]
proof (prove)
using this:
\<forall>x. N x \<in> null_sets M \<and> null_part M (S x) \<subseteq> N x

goal (1 subgoal):
 1. (\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>i. main_part M (S i) \<union> null_part M (S i)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
have *: "main_part M (\<Union>i. S i) \<union> ?N = (\<Union>i. main_part M (S i)) \<union> ?N"
[PROOF STATE]
proof (prove)
using this:
main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N') = (\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "emeasure M (main_part M (\<Union>i. S i)) = emeasure M (main_part M (\<Union>i. S i) \<union> ?N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N'))
[PROOF STEP]
using null_set UN
[PROOF STATE]
proof (prove)
using this:
\<Union> (range N) \<union> N' \<in> null_sets M
\<Union> (range S) \<in> sets (completion M)

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N'))
[PROOF STEP]
by (intro emeasure_Un_null_set[symmetric]) auto
[PROOF STATE]
proof (state)
this:
emeasure M (main_part M (\<Union> (range S))) = emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N'))

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (main_part M (\<Union> (range S))) = emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N'))

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "\<dots> = emeasure M ((\<Union>i. main_part M (S i)) \<union> ?N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')) = emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N'))
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')) = emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N'))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')) = emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N'))

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (main_part M (\<Union> (range S)) \<union> (\<Union> (range N) \<union> N')) = emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N'))

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
have "\<dots> = emeasure M (\<Union>i. main_part M (S i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
using null_set S
[PROOF STATE]
proof (prove)
using this:
\<Union> (range N) \<union> N' \<in> null_sets M
S ?i \<in> sets (completion M)

goal (1 subgoal):
 1. emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
by (intro emeasure_Un_null_set) auto
[PROOF STATE]
proof (state)
this:
emeasure M ((\<Union>i. main_part M (S i)) \<union> (\<Union> (range N) \<union> N')) = emeasure M (\<Union>i. main_part M (S i))

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))

goal (1 subgoal):
 1. emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure M (main_part M (\<Union> (range S))) = emeasure M (\<Union>i. main_part M (S i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_zero:
  fixes A :: "'a::conjugatable_field mat"
  assumes "A \<in> carrier_mat 0 0"
  shows "unitary A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary A
[PROOF STEP]
unfolding unitary_def inverts_mat_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_row A) (dim_row A) \<and> A * adjoint A = 1\<^sub>m (dim_row A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat 0 0

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_row A) (dim_row A) \<and> A * adjoint A = 1\<^sub>m (dim_row A)
[PROOF STEP]
by auto


[STATEMENT]
lemma permutes_pair_eq:
  \<open>{(p s, s) |s. s \<in> S} = {(s, inv p s) |s. s \<in> S}\<close> (is \<open>?L = ?R\<close>) if \<open>p permutes S\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(p s, s) |s. s \<in> S} = {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {(p s, s) |s. s \<in> S} \<subseteq> {(s, inv p s) |s. s \<in> S}
 2. {(s, inv p s) |s. s \<in> S} \<subseteq> {(p s, s) |s. s \<in> S}
[PROOF STEP]
show "?L \<subseteq> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(p s, s) |s. s \<in> S} \<subseteq> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
assume "x \<in> ?L"
[PROOF STATE]
proof (state)
this:
x \<in> {(p s, s) |s. s \<in> S}

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
obtain s where x: "x = (p s, s)" and s: "s \<in> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(p s, s) |s. s \<in> S}

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>x = (p s, s); s \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (p s, s)
s \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
note x
[PROOF STATE]
proof (state)
this:
x = (p s, s)

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = (p s, s)

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
have "(p s, s) = (p s, Hilbert_Choice.inv p (p s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p s, s) = (p s, inv p (p s))
[PROOF STEP]
using permutes_inj [OF that] inv_f_f
[PROOF STATE]
proof (prove)
using this:
inj p
inj ?f \<Longrightarrow> inv ?f (?f ?x) = ?x

goal (1 subgoal):
 1. (p s, s) = (p s, inv p (p s))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(p s, s) = (p s, inv p (p s))

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p s, s) = (p s, inv p (p s))

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
have "... \<in> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p s, inv p (p s)) \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
using s permutes_in_image[OF that]
[PROOF STATE]
proof (prove)
using this:
s \<in> S
(p ?x \<in> S) = (?x \<in> S)

goal (1 subgoal):
 1. (p s, inv p (p s)) \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(p s, inv p (p s)) \<in> {(s, inv p s) |s. s \<in> S}

goal (1 subgoal):
 1. \<And>x. x \<in> {(p s, s) |s. s \<in> S} \<Longrightarrow> x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
show "x \<in> ?R"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(s, inv p s) |s. s \<in> S}

goal (1 subgoal):
 1. x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<in> {(s, inv p s) |s. s \<in> S}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{(p s, s) |s. s \<in> S} \<subseteq> {(s, inv p s) |s. s \<in> S}

goal (1 subgoal):
 1. {(s, inv p s) |s. s \<in> S} \<subseteq> {(p s, s) |s. s \<in> S}
[PROOF STEP]
show "?R \<subseteq> ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(s, inv p s) |s. s \<in> S} \<subseteq> {(p s, s) |s. s \<in> S}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
assume "x \<in> ?R"
[PROOF STATE]
proof (state)
this:
x \<in> {(s, inv p s) |s. s \<in> S}

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(s, inv p s) |s. s \<in> S}
[PROOF STEP]
obtain s
      where x: "x = (s, Hilbert_Choice.inv p s)" (is "_ = (s, ?ips)")
        and s: "s \<in> S"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(s, inv p s) |s. s \<in> S}

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>x = (s, inv p s); s \<in> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (s, inv p s)
s \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
note x
[PROOF STATE]
proof (state)
this:
x = (s, inv p s)

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = (s, inv p s)

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
have "(s, ?ips) = (p ?ips, ?ips)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s, inv p s) = (p (inv p s), inv p s)
[PROOF STEP]
using inv_f_f[OF permutes_inj[OF permutes_inv[OF that]]]
[PROOF STATE]
proof (prove)
using this:
inv (inv p) (inv p ?x) = ?x

goal (1 subgoal):
 1. (s, inv p s) = (p (inv p s), inv p s)
[PROOF STEP]
using inv_inv_eq[OF permutes_bij[OF that]]
[PROOF STATE]
proof (prove)
using this:
inv (inv p) (inv p ?x) = ?x
inv (inv p) = p

goal (1 subgoal):
 1. (s, inv p s) = (p (inv p s), inv p s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(s, inv p s) = (p (inv p s), inv p s)

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(s, inv p s) = (p (inv p s), inv p s)

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
have "... \<in> ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p (inv p s), inv p s) \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
using s permutes_in_image[OF permutes_inv[OF that]]
[PROOF STATE]
proof (prove)
using this:
s \<in> S
(inv p ?x \<in> S) = (?x \<in> S)

goal (1 subgoal):
 1. (p (inv p s), inv p s) \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(p (inv p s), inv p s) \<in> {(p s, s) |s. s \<in> S}

goal (1 subgoal):
 1. \<And>x. x \<in> {(s, inv p s) |s. s \<in> S} \<Longrightarrow> x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
show "x \<in> ?L"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(p s, s) |s. s \<in> S}

goal (1 subgoal):
 1. x \<in> {(p s, s) |s. s \<in> S}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<in> {(p s, s) |s. s \<in> S}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{(s, inv p s) |s. s \<in> S} \<subseteq> {(p s, s) |s. s \<in> S}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Set_filter_unchanged: "Set.filter P X = X" if "\<And>x. x\<in>X \<Longrightarrow> P x" for P and X :: "'z set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Set.filter P X = X
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> P ?x

goal (1 subgoal):
 1. Set.filter P X = X
[PROOF STEP]
unfolding Set.filter_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> X \<Longrightarrow> P ?x

goal (1 subgoal):
 1. {a \<in> X. P a} = X
[PROOF STEP]
by auto


[STATEMENT]
lemma monomial_is_monomial:
  assumes "c \<noteq> 0"
  shows "is_monomial (monomial c t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_monomial (monomial c t)
[PROOF STEP]
using keys_single[of t c] assms
[PROOF STATE]
proof (prove)
using this:
keys (monomial c t) = (if c = (0::'a) then {} else {t})
c \<noteq> (0::'a)

goal (1 subgoal):
 1. is_monomial (monomial c t)
[PROOF STEP]
by (simp add: is_monomial_def)


[STATEMENT]
lemma infs_union[iff]: "infs (A \<union> B) w \<longleftrightarrow> infs A w \<or> infs B w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infs (A \<union> B) w = (infs A w \<or> infs B w)
[PROOF STEP]
unfolding infs_snth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n. \<exists>k\<ge>n. w !! k \<in> A \<union> B) = ((\<forall>n. \<exists>k\<ge>n. w !! k \<in> A) \<or> (\<forall>n. \<exists>k\<ge>n. w !! k \<in> B))
[PROOF STEP]
by (auto) (meson le_trans nat_le_linear)


[STATEMENT]
lemma uminus_nonneg_Reals_iff [simp]: "-x \<in> \<real>\<^sub>\<ge>\<^sub>0 \<longleftrightarrow> x \<in> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<in> \<real>\<^sub>\<ge>\<^sub>0) = (x \<in> \<real>\<^sub>\<le>\<^sub>0)
[PROOF STEP]
apply (auto simp: nonpos_Reals_def nonneg_Reals_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. \<lbrakk>- x = of_real r; 0 \<le> r\<rbrakk> \<Longrightarrow> \<exists>r. x = of_real r \<and> r \<le> 0
[PROOF STEP]
apply (metis nonpos_Reals_of_real_iff minus_minus neg_le_0_iff_le of_real_minus)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma frontier_disjoint_eq: "frontier S \<inter> S = {} \<longleftrightarrow> open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (frontier S \<inter> S = {}) = open S
[PROOF STEP]
using frontier_complement frontier_subset_eq[of "- S"]
[PROOF STATE]
proof (prove)
using this:
frontier (- ?S) = frontier ?S
(frontier (- S) \<subseteq> - S) = closed (- S)

goal (1 subgoal):
 1. (frontier S \<inter> S = {}) = open S
[PROOF STEP]
unfolding open_closed
[PROOF STATE]
proof (prove)
using this:
frontier (- ?S) = frontier ?S
(frontier (- S) \<subseteq> - S) = closed (- S)

goal (1 subgoal):
 1. (frontier S \<inter> S = {}) = closed (- S)
[PROOF STEP]
by auto


[STATEMENT]
lemma on_unit_circle_conjugate [simp]:
  shows "on_circline unit_circle (conjugate z) \<longleftrightarrow> on_circline unit_circle z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_circline unit_circle (conjugate z) = on_circline unit_circle z
[PROOF STEP]
by (transfer, transfer, auto simp add: vec_cnj_def field_simps)


[STATEMENT]
lemma (in prob_space) char_approx3':
  fixes \<mu> :: "real measure" and X
  assumes rv_X [simp]: "random_variable borel X"
    and [simp]: "integrable M X" "integrable M (\<lambda>x. (X x)^2)" "expectation X = 0"
    and var_X: "variance X = \<sigma>2"
    and \<mu>_def: "\<mu> = distr M borel X"
  shows "cmod (char \<mu> t - (1 - t^2 * \<sigma>2 / 2)) \<le>
    (t^2 / 6) * expectation (\<lambda>x. min (6 * (X x)^2) (\<bar>t\<bar> * \<bar>X x\<bar>^3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (char \<mu> t - complex_of_real (1 - t\<^sup>2 * \<sigma>2 / 2)) \<le> t\<^sup>2 / 6 * expectation (\<lambda>x. min (6 * (X x)\<^sup>2) (\<bar>t\<bar> * \<bar>X x\<bar> ^ 3))
[PROOF STEP]
using var_X
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2

goal (1 subgoal):
 1. cmod (char \<mu> t - complex_of_real (1 - t\<^sup>2 * \<sigma>2 / 2)) \<le> t\<^sup>2 / 6 * expectation (\<lambda>x. min (6 * (X x)\<^sup>2) (\<bar>t\<bar> * \<bar>X x\<bar> ^ 3))
[PROOF STEP]
unfolding \<mu>_def
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2

goal (1 subgoal):
 1. cmod (char (distr M borel X) t - complex_of_real (1 - t\<^sup>2 * \<sigma>2 / 2)) \<le> t\<^sup>2 / 6 * expectation (\<lambda>x. min (6 * (X x)\<^sup>2) (\<bar>t\<bar> * \<bar>X x\<bar> ^ 3))
[PROOF STEP]
apply (subst integral_distr [symmetric, OF rv_X], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2 \<Longrightarrow> cmod (char (distr M borel X) t - complex_of_real (1 - t\<^sup>2 * \<sigma>2 / 2)) \<le> t\<^sup>2 / 6 * (LINT a|distr M borel X. min (6 * a\<^sup>2) (\<bar>t\<bar> * \<bar>a\<bar> ^ 3))
[PROOF STEP]
apply (intro real_distribution.char_approx3)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2 \<Longrightarrow> real_distribution (distr M borel X)
 2. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2 \<Longrightarrow> integrable (distr M borel X) (\<lambda>x. x)
 3. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2 \<Longrightarrow> LINT x|distr M borel X. x = 0
 4. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2 \<Longrightarrow> integrable (distr M borel X) power2
 5. expectation (\<lambda>x. (X x - expectation X)\<^sup>2) = \<sigma>2 \<Longrightarrow> LINT x|distr M borel X. (x - (LINT x|distr M borel X. x))\<^sup>2 = \<sigma>2
[PROOF STEP]
apply (auto simp add: integrable_distr_eq integral_distr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inc_matrix_point_in_block: "i < length Vs \<Longrightarrow> j < length Bs \<Longrightarrow> (inc_mat_of Vs Bs) $$ (i, j) = 1
    \<Longrightarrow> Vs ! i \<in> Bs ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length Vs; j < length Bs; inc_mat_of Vs Bs $$ (i, j) = (1::'b)\<rbrakk> \<Longrightarrow> Vs ! i \<in> Bs ! j
[PROOF STEP]
using inc_matrix_point_not_in_block_zero
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length ?Vs; ?j < length ?Bs; ?Vs ! ?i \<notin> ?Bs ! ?j\<rbrakk> \<Longrightarrow> inc_mat_of ?Vs ?Bs $$ (?i, ?j) = (0::?'b)

goal (1 subgoal):
 1. \<lbrakk>i < length Vs; j < length Bs; inc_mat_of Vs Bs $$ (i, j) = (1::'b)\<rbrakk> \<Longrightarrow> Vs ! i \<in> Bs ! j
[PROOF STEP]
by (metis zero_neq_one)


[STATEMENT]
lemma lm149:
  "trivial A = (card (Pow A) \<in> {1,2})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial A = (card (Pow A) \<in> {1, 2})
[PROOF STEP]
using lm148 lm142
[PROOF STATE]
proof (prove)
using this:
card (Pow ?X) = 1 \<or> card (Pow ?X) = 2 \<Longrightarrow> trivial ?X
trivial ?X \<Longrightarrow> card (Pow ?X) \<in> {1, 2}

goal (1 subgoal):
 1. trivial A = (card (Pow A) \<in> {1, 2})
[PROOF STEP]
by blast


[STATEMENT]
lemma all_edges_disjoint: "S \<inter> T = {} \<Longrightarrow> all_edges S \<inter> all_edges T = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> T = {} \<Longrightarrow> all_edges S \<inter> all_edges T = {}
[PROOF STEP]
unfolding all_edges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> T = {} \<Longrightarrow> mk_uedge ` {uv \<in> S \<times> S. fst uv \<noteq> snd uv} \<inter> mk_uedge ` {uv \<in> T \<times> T. fst uv \<noteq> snd uv} = {}
[PROOF STEP]
by force


[STATEMENT]
lemma INF_emeasure_decseq:
  assumes A: "range A \<subseteq> sets M" and "decseq A"
  and finite: "\<And>i. emeasure M (A i) \<noteq> \<infinity>"
  shows "(INF n. emeasure M (A n)) = emeasure M (\<Inter>i. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
have le_MI: "emeasure M (\<Inter>i. A i) \<le> emeasure M (A 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Inter> (range A)) \<le> emeasure M (A 0)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> sets M

goal (1 subgoal):
 1. emeasure M (\<Inter> (range A)) \<le> emeasure M (A 0)
[PROOF STEP]
by (auto intro!: emeasure_mono)
[PROOF STATE]
proof (state)
this:
emeasure M (\<Inter> (range A)) \<le> emeasure M (A 0)

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
hence *: "emeasure M (\<Inter>i. A i) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
using this:
emeasure M (\<Inter> (range A)) \<le> emeasure M (A 0)

goal (1 subgoal):
 1. emeasure M (\<Inter> (range A)) \<noteq> \<infinity>
[PROOF STEP]
using finite[of 0]
[PROOF STATE]
proof (prove)
using this:
emeasure M (\<Inter> (range A)) \<le> emeasure M (A 0)
emeasure M (A 0) \<noteq> \<infinity>

goal (1 subgoal):
 1. emeasure M (\<Inter> (range A)) \<noteq> \<infinity>
[PROOF STEP]
by (auto simp: top_unique)
[PROOF STATE]
proof (state)
this:
emeasure M (\<Inter> (range A)) \<noteq> \<infinity>

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
have "emeasure M (A 0) - (INF n. emeasure M (A n)) = (SUP n. emeasure M (A 0) - emeasure M (A n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (A 0) - (INF n. emeasure M (A n)) = (SUP n. emeasure M (A 0) - emeasure M (A n))
[PROOF STEP]
by (simp add: ennreal_INF_const_minus)
[PROOF STATE]
proof (state)
this:
emeasure M (A 0) - (INF n. emeasure M (A n)) = (SUP n. emeasure M (A 0) - emeasure M (A n))

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M (A 0) - (INF n. emeasure M (A n)) = (SUP n. emeasure M (A 0) - emeasure M (A n))

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
have "\<dots> = (SUP n. emeasure M (A 0 - A n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP n. emeasure M (A 0) - emeasure M (A n)) = (SUP n. emeasure M (A 0 - A n))
[PROOF STEP]
using A finite \<open>decseq A\<close>[unfolded decseq_def]
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> sets M
emeasure M (A ?i) \<noteq> \<infinity>
\<forall>m n. m \<le> n \<longrightarrow> A n \<subseteq> A m

goal (1 subgoal):
 1. (SUP n. emeasure M (A 0) - emeasure M (A n)) = (SUP n. emeasure M (A 0 - A n))
[PROOF STEP]
by (subst emeasure_Diff) auto
[PROOF STATE]
proof (state)
this:
(SUP n. emeasure M (A 0) - emeasure M (A n)) = (SUP n. emeasure M (A 0 - A n))

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(SUP n. emeasure M (A 0) - emeasure M (A n)) = (SUP n. emeasure M (A 0 - A n))

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
have "\<dots> = emeasure M (\<Union>i. A 0 - A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP n. emeasure M (A 0 - A n)) = emeasure M (\<Union>i. A 0 - A i)
[PROOF STEP]
proof (rule SUP_emeasure_incseq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. range (\<lambda>n. A 0 - A n) \<subseteq> sets M
 2. incseq (\<lambda>n. A 0 - A n)
[PROOF STEP]
show "range (\<lambda>n. A 0 - A n) \<subseteq> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (\<lambda>n. A 0 - A n) \<subseteq> sets M
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> sets M

goal (1 subgoal):
 1. range (\<lambda>n. A 0 - A n) \<subseteq> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
range (\<lambda>n. A 0 - A n) \<subseteq> sets M

goal (1 subgoal):
 1. incseq (\<lambda>n. A 0 - A n)
[PROOF STEP]
show "incseq (\<lambda>n. A 0 - A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>n. A 0 - A n)
[PROOF STEP]
using \<open>decseq A\<close>
[PROOF STATE]
proof (prove)
using this:
monotone (\<le>) (\<lambda>x y. y \<subseteq> x) A

goal (1 subgoal):
 1. incseq (\<lambda>n. A 0 - A n)
[PROOF STEP]
by (auto simp add: incseq_def decseq_def)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>n. A 0 - A n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(SUP n. emeasure M (A 0 - A n)) = emeasure M (\<Union>i. A 0 - A i)

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(SUP n. emeasure M (A 0 - A n)) = emeasure M (\<Union>i. A 0 - A i)

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
have "\<dots> = emeasure M (A 0) - emeasure M (\<Inter>i. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (\<Union>i. A 0 - A i) = emeasure M (A 0) - emeasure M (\<Inter> (range A))
[PROOF STEP]
using A finite *
[PROOF STATE]
proof (prove)
using this:
range A \<subseteq> sets M
emeasure M (A ?i) \<noteq> \<infinity>
emeasure M (\<Inter> (range A)) \<noteq> \<infinity>

goal (1 subgoal):
 1. emeasure M (\<Union>i. A 0 - A i) = emeasure M (A 0) - emeasure M (\<Inter> (range A))
[PROOF STEP]
by (simp, subst emeasure_Diff) auto
[PROOF STATE]
proof (state)
this:
emeasure M (\<Union>i. A 0 - A i) = emeasure M (A 0) - emeasure M (\<Inter> (range A))

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure M (A 0) - (INF n. emeasure M (A n)) = emeasure M (A 0) - emeasure M (\<Inter> (range A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure M (A 0) - (INF n. emeasure M (A n)) = emeasure M (A 0) - emeasure M (\<Inter> (range A))

goal (1 subgoal):
 1. (INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))
[PROOF STEP]
by (rule ennreal_minus_cancel[rotated 3])
       (insert finite A, auto intro: INF_lower emeasure_mono)
[PROOF STATE]
proof (state)
this:
(INF n. emeasure M (A n)) = emeasure M (\<Inter> (range A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSDERIV_iff2:
  "(NSDERIV f x :> D) \<longleftrightarrow>
    (\<forall>w. w \<noteq> star_of x \<and> w \<approx> star_of x \<longrightarrow> ( *f* (\<lambda>z. (f z - f x) / (z - x))) w \<approx> star_of D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSDERIV f x :> D = (\<forall>w. w \<noteq> star_of x \<and> w \<approx> star_of x \<longrightarrow> (*f* (\<lambda>z. (f z - f x) / (z - x))) w \<approx> star_of D)
[PROOF STEP]
by (simp add: NSDERIV_NSLIM_iff2 NSLIM_def)


[STATEMENT]
lemma powr_nat_of_nat: "powr_nat x (of_nat n) = x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. powr_nat x (real n) = x ^ n
[PROOF STEP]
by (cases "x > 0") (auto simp: powr_nat_def powr_realpow not_less power_mult_distrib [symmetric])


[STATEMENT]
lemma (in Order) ord_isom_surj:"\<lbrakk>Order E; ord_isom D E f; b \<in> carrier E\<rbrakk> \<Longrightarrow>
         \<exists>a\<in>carrier D. b = f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f; b \<in> carrier E\<rbrakk> \<Longrightarrow> \<exists>a\<in>carrier D. b = f a
[PROOF STEP]
apply (simp add:ord_isom_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; b \<in> carrier E; ord_inj D E f; surj_to f (carrier D) (carrier E)\<rbrakk> \<Longrightarrow> \<exists>a\<in>carrier D. b = f a
[PROOF STEP]
apply (simp add:surj_to_def image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; b \<in> carrier E; ord_inj D E f; {y. \<exists>x\<in>carrier D. y = f x} = carrier E\<rbrakk> \<Longrightarrow> \<exists>a\<in>carrier D. b = f a
[PROOF STEP]
apply (frule sym, thin_tac "{y. \<exists>x\<in>carrier D. y = f x} = carrier E",
       simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem infinite_UNIV_prod1 [simp]:
"infinite (UNIV :: 'a set) \<Longrightarrow>
 infinite (UNIV :: ('a \<times> 'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> infinite UNIV
[PROOF STEP]
apply (erule contrapos_nn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> finite UNIV
[PROOF STEP]
apply (simp add: finite_prod)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma square_bounded_le:
  fixes a b::"'a :: linordered_ring_strict"
  shows "-a \<le> b \<and> b \<le> a \<Longrightarrow> b*b \<le> a*a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a \<le> b \<and> b \<le> a \<Longrightarrow> b * b \<le> a * a
[PROOF STEP]
by (metis le_less minus_mult_minus square_bounded_less)


[STATEMENT]
lemma list_all3_conv_all_nth:
  "list_all3 P xs ys zs =
  (length xs = length ys \<and> length ys = length zs \<and> (\<forall>i < length xs. P (xs!i) (ys!i) (zs!i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all3 P xs ys zs = (length xs = length ys \<and> length ys = length zs \<and> (\<forall>i<length xs. P (xs ! i) (ys ! i) (zs ! i)))
[PROOF STEP]
by (auto simp add: list_all3_list_all2_eq list_all2_conv_all_nth)


[STATEMENT]
lemma closedin_limpt:
  "closedin (top_of_set T) S \<longleftrightarrow> S \<subseteq> T \<and> (\<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) S = (S \<subseteq> T \<and> (\<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S))
[PROOF STEP]
apply (simp add: closedin_closed, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>Ta x. \<lbrakk>closed Ta; S = T \<inter> Ta; x islimpt T \<inter> Ta; x \<in> T\<rbrakk> \<Longrightarrow> x \<in> Ta
 2. \<lbrakk>S \<subseteq> T; \<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S\<rbrakk> \<Longrightarrow> \<exists>Ta. closed Ta \<and> S = T \<inter> Ta
[PROOF STEP]
apply (simp add: closed_limpt islimpt_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; \<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S\<rbrakk> \<Longrightarrow> \<exists>Ta. closed Ta \<and> S = T \<inter> Ta
[PROOF STEP]
apply (rule_tac x="closure S" in exI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; \<forall>x. x islimpt S \<and> x \<in> T \<longrightarrow> x \<in> S\<rbrakk> \<Longrightarrow> S = T \<inter> closure S
[PROOF STEP]
apply (force simp: closure_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma incr_correct: "\<not> idx < l \<Longrightarrow> idx < l + iam_increment l idx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> idx < l \<Longrightarrow> idx < l + iam_increment l idx
[PROOF STEP]
unfolding iam_increment_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> idx < l \<Longrightarrow> idx < l + max (idx + 1 - l) (2 * l + 3)
[PROOF STEP]
by auto


[STATEMENT]
lemma Re_tendsto_upperbound:
   "\<lbrakk>(f \<longlongrightarrow> l) net; \<forall>\<^sub>F x in net. quat.Re (f x) \<le> b; net \<noteq> bot\<rbrakk> \<Longrightarrow> Re l \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> l) net; \<forall>\<^sub>F x in net. quat.Re (f x) \<le> b; net \<noteq> bot\<rbrakk> \<Longrightarrow> quat.Re l \<le> b
[PROOF STEP]
by (blast intro: tendsto_upperbound [OF tendsto_Re])


[STATEMENT]
lemma ordertype_list_seg: "ordertype {l. length l = n} (lenlex less_than) = \<omega>\<up>n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype {l. length l = n} (lenlex less_than) = \<omega> \<up> ord_of_nat n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordertype {l. length l = n} (lenlex less_than) = \<omega> \<up> ord_of_nat n
[PROOF STEP]
have "bij_betw omega_sum {l. length l = n} (elts (\<omega>\<up>n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw omega_sum {l. length l = n} (elts (\<omega> \<up> ord_of_nat n))
[PROOF STEP]
unfolding WW_seg_def bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on omega_sum {l. length l = n} \<and> omega_sum ` {l. length l = n} = elts (\<omega> \<up> ord_of_nat n)
[PROOF STEP]
by (auto simp: inj_omega_sum Ord_mem_iff_lt omega_sum_less dest: Ex_omega_sum)
[PROOF STATE]
proof (state)
this:
bij_betw omega_sum {l. length l = n} (elts (\<omega> \<up> ord_of_nat n))

goal (1 subgoal):
 1. ordertype {l. length l = n} (lenlex less_than) = \<omega> \<up> ord_of_nat n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw omega_sum {l. length l = n} (elts (\<omega> \<up> ord_of_nat n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw omega_sum {l. length l = n} (elts (\<omega> \<up> ord_of_nat n))

goal (1 subgoal):
 1. ordertype {l. length l = n} (lenlex less_than) = \<omega> \<up> ord_of_nat n
[PROOF STEP]
by (force simp: ordertype_eq_iff simp flip: eq_omega_sum_less_iff)
[PROOF STATE]
proof (state)
this:
ordertype {l. length l = n} (lenlex less_than) = \<omega> \<up> ord_of_nat n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma obs_consistent_trans [intro]:
  "\<lbrakk> obs_consistent R1 pi1 S1 S2; obs_consistent R2 pi2 S2 S3 \<rbrakk>
  \<Longrightarrow> obs_consistent (R1 O R2) (pi1 o pi2) S1 S3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>obs_consistent R1 pi1 S1 S2; obs_consistent R2 pi2 S2 S3\<rbrakk> \<Longrightarrow> obs_consistent (R1 O R2) (pi1 \<circ> pi2) S1 S3
[PROOF STEP]
by (auto simp add: obs_consistent_def)


[STATEMENT]
lemma inf_eq_top_iff [simp]:
  "(inf x y = top) = (x = top \<and> y = top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> y = top) = (x = top \<and> y = top)
[PROOF STEP]
by (simp add: order.eq_iff)


[STATEMENT]
lemma UNIV_state: "UNIV = {A, B, C1, C2, C3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {A, B, C1, C2, C3}
[PROOF STEP]
using state.nchotomy
[PROOF STATE]
proof (prove)
using this:
\<forall>state. state = A \<or> state = B \<or> state = C1 \<or> state = C2 \<or> state = C3

goal (1 subgoal):
 1. UNIV = {A, B, C1, C2, C3}
[PROOF STEP]
by auto


[STATEMENT]
lemma simple_ruleset_append: "simple_ruleset (rs\<^sub>1 @ rs\<^sub>2) \<longleftrightarrow> simple_ruleset rs\<^sub>1 \<and> simple_ruleset rs\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_ruleset (rs\<^sub>1 @ rs\<^sub>2) = (simple_ruleset rs\<^sub>1 \<and> simple_ruleset rs\<^sub>2)
[PROOF STEP]
by(simp add: simple_ruleset_def, blast)


[STATEMENT]
lemma real_cos_eq [simp]: "Re(cos(of_real x)) = cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (cos (complex_of_real x)) = cos x
[PROOF STEP]
by (simp add: cos_of_real)