[STATEMENT]
lemma time_vebt_buildup: "u = 2^n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p  n \<le> 26 * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = 2 ^ n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p n \<le> 26 * u
[PROOF STEP]
using vebt_buildup_bound
[PROOF STATE]
proof (prove)
using this:
?u = 2 ^ ?n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p ?n \<le> 26 * ?u

goal (1 subgoal):
 1. u = 2 ^ n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p n \<le> 26 * u
[PROOF STEP]
by simp


[STATEMENT]
lemma Qp_funs_Units_memI:
  assumes "f \<in> (carrier (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
  assumes "\<And> x. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow>  f x \<noteq> \<zero>\<^bsub>Q\<^sub>p\<^esub>"
  shows "f \<in> (Units (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
        "inv\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> f = (\<lambda> x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv\<^bsub>Q\<^sub>p\<^esub> (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p) &&& inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
 2. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
obtain g where g_def: "g = (\<lambda> x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv\<^bsub>Q\<^sub>p\<^esub> (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)

goal (2 subgoals):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
 2. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
have g_closed: "g \<in> (carrier (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
[PROOF STEP]
by(rule Qp_funs_car_memI, unfold  g_def, auto,
            intro field_inv(3) assms Qp.function_ring_car_memE[of _ n], auto )
[PROOF STATE]
proof (state)
this:
g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)

goal (2 subgoals):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
 2. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
have "\<And>x. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f x \<otimes> g x = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f x \<otimes> g x = \<one>
[PROOF STEP]
using assms g_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<noteq> \<zero>
g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)

goal (1 subgoal):
 1. \<And>x. x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f x \<otimes> g x = \<one>
[PROOF STEP]
by (metis (no_types, lifting) Qp.function_ring_car_memE field_inv(2) restrict_apply)
[PROOF STATE]
proof (state)
this:
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<otimes> g ?x5 = \<one>

goal (2 subgoals):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
 2. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<otimes> g ?x5 = \<one>
[PROOF STEP]
have 0: "f \<otimes>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> g = \<one>\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
using this:
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<otimes> g ?x5 = \<one>

goal (1 subgoal):
 1. f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
[PROOF STEP]
using assms g_def Qp_funs_mult''[of f n g] Qp_funs_one[of n] g_closed
[PROOF STATE]
proof (prove)
using this:
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<otimes> g ?x5 = \<one>
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<noteq> \<zero>
g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
\<lbrakk>f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)\<rbrakk> \<Longrightarrow> f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<otimes> g x)
\<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). \<one>)
g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)

goal (1 subgoal):
 1. f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
[PROOF STEP]
by (metis (no_types, lifting) restrict_ext)
[PROOF STATE]
proof (state)
this:
f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>

goal (2 subgoals):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
 2. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
[PROOF STEP]
show "f \<in> (Units (Fun\<^bsub>n\<^esub> Q\<^sub>p))"
[PROOF STATE]
proof (prove)
using this:
f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>

goal (1 subgoal):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
[PROOF STEP]
using comm_monoid.UnitsI[of "Fun\<^bsub>n\<^esub> Q\<^sub>p"] assms(1) g_closed local.F.comm_monoid_axioms
[PROOF STATE]
proof (prove)
using this:
f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
\<lbrakk>Group.comm_monoid (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?a \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?b \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?a \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> ?b = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>\<rbrakk> \<Longrightarrow> ?a \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
\<lbrakk>Group.comm_monoid (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?a \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?b \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?a \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> ?b = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>\<rbrakk> \<Longrightarrow> ?b \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
Group.comm_monoid (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p)

goal (1 subgoal):
 1. f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
f \<in> Units (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)

goal (1 subgoal):
 1. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
have "inv\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = g
[PROOF STEP]
using g_def g_closed 0 cring.invI[of "Fun\<^bsub>n\<^esub> Q\<^sub>p"] Qp_funs_is_cring assms(1)
[PROOF STATE]
proof (prove)
using this:
g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
g \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
\<lbrakk>cring (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?x \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?y \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?x \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> ?y = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>\<rbrakk> \<Longrightarrow> ?y = inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> ?x
\<lbrakk>cring (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?x \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?y \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p); ?x \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> ?y = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>\<rbrakk> \<Longrightarrow> ?x = inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> ?y
cring (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p)
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)

goal (1 subgoal):
 1. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = g
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = g

goal (1 subgoal):
 1. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
show "inv\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> f = (\<lambda> x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv\<^bsub>Q\<^sub>p\<^esub> (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
using assms g_def 0  \<open>inv\<^bsub>Fun\<^bsub>n\<^esub> Q\<^sub>p\<^esub> f = g\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p)
?x5 \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> f ?x5 \<noteq> \<zero>
g = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
f \<otimes>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> g = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub>
inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = g

goal (1 subgoal):
 1. inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>n\<^esup>)) Q\<^sub>p\<^esub> f = (\<lambda>x\<in>carrier (Q\<^sub>p\<^bsup>n\<^esup>). inv f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma space_PiM_empty_iff[simp]: "space (PiM I M) = {} \<longleftrightarrow>  (\<exists>i\<in>I. space (M i) = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (space (Pi\<^sub>M I M) = {}) = (\<exists>i\<in>I. space (M i) = {})
[PROOF STEP]
by (auto simp: space_PiM PiE_eq_empty_iff)


[STATEMENT]
lemma is_mset_set_def:
  \<open>is_mset_set X \<longleftrightarrow> (\<forall>x \<in># X. count X x = 1)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset X = (\<forall>x\<in>#X. count X x = 1)
[PROOF STEP]
by (auto simp add: distinct_mset_def)


[STATEMENT]
lemma mod_mult_eq_imp_mod_eq: "
  (a::nat) mod (m * k) = b mod (m * k) \<Longrightarrow> a mod m = b mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod (m * k) = b mod (m * k) \<Longrightarrow> a mod m = b mod m
[PROOF STEP]
apply (simp only: mod_mult2_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m * (a div m mod k) + a mod m = m * (b div m mod k) + b mod m \<Longrightarrow> a mod m = b mod m
[PROOF STEP]
apply (drule_tac arg_cong[where f="\<lambda>x. x mod m"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m * (a div m mod k) + a mod m) mod m = (m * (b div m mod k) + b mod m) mod m \<Longrightarrow> a mod m = b mod m
[PROOF STEP]
apply (simp add: add.commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ordinal_div_monoL: "x \<le> x' \<Longrightarrow> x div y \<le> x' div (y::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> x' \<Longrightarrow> x div y \<le> x' div y
[PROOF STEP]
by (erule monoD[OF ordinal_mono_div])


[STATEMENT]
lemma singletons_dotP [simp]: "[v]\<^sub>v \<bullet> [w]\<^sub>v = v * w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [v]\<^sub>v \<bullet> [w]\<^sub>v = v * w
[PROOF STEP]
by (metis dim_vec index_vec less_one singleton_dotP)


[STATEMENT]
lemma reachable: "reachable as r = {fold delta w (init r) | w. w \<in> lists (set as)}"
  and finite_reachable: "finite (reachable as r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)} &&& finite (reachable as r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)}
 2. finite (reachable as r)
[PROOF STEP]
obtain wsZ where *: "rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r) = Some wsZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>wsZ. rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r) = Some wsZ \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (atomize_elim,intro rtrancl_while_finite_Some Image_mono rtrancl_mono
      finite_subset[OF _ finite_rtrancl_delta_Image1[of "set as" r]]) auto
[PROOF STATE]
proof (state)
this:
rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r) = Some wsZ

goal (2 subgoals):
 1. reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)}
 2. finite (reachable as r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r) = Some wsZ
[PROOF STEP]
show "reachable as r = {fold delta w (init r) | w. w \<in> lists (set as)}"
[PROOF STATE]
proof (prove)
using this:
rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r) = Some wsZ

goal (1 subgoal):
 1. reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)}
[PROOF STEP]
unfolding reachable_def
[PROOF STATE]
proof (prove)
using this:
rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r) = Some wsZ

goal (1 subgoal):
 1. snd (the (rtrancl_while (\<lambda>_. True) (\<lambda>s. map (\<lambda>a. delta a s) as) (init r))) = {fold delta w (init r) |w. w \<in> lists (set as)}
[PROOF STEP]
by (cases wsZ)
      (auto dest!: rtrancl_while_Some split: if_splits simp: rtrancl_fold_product1 image_iff)
[PROOF STATE]
proof (state)
this:
reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)}

goal (1 subgoal):
 1. finite (reachable as r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)}
[PROOF STEP]
show "finite (reachable as r)"
[PROOF STATE]
proof (prove)
using this:
reachable as r = {fold delta w (init r) |w. w \<in> lists (set as)}

goal (1 subgoal):
 1. finite (reachable as r)
[PROOF STEP]
by (auto intro: finite_subset[OF _ fin])
[PROOF STATE]
proof (state)
this:
finite (reachable as r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "!!a::int. [| a+b+c+d <= i+j+k+l; a<=b; b<=c; c<=d; i<=j; j<=k; k<=l |]
      ==> a <= l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a + b + c + d \<le> i + j + k + l; a \<le> b; b \<le> c; c \<le> d; i \<le> j; j \<le> k; k \<le> l\<rbrakk> \<Longrightarrow> a \<le> l
[PROOF STEP]
by arith


[STATEMENT]
lemma infinite_Func:
assumes A: "\<not>finite A" and B: "{b1,b2} \<subseteq> B" "b1 \<noteq> b2"
shows "\<not>finite (Func A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (Func A B)
[PROOF STEP]
using ordLeq_Func[OF B]
[PROOF STATE]
proof (prove)
using this:
|?A| \<le>o |Func ?A B|

goal (1 subgoal):
 1. infinite (Func A B)
[PROOF STEP]
by (metis A card_of_ordLeq_finite)


[STATEMENT]
lemma word_clz_sint_lower[simp]:
  "LENGTH('a) \<ge> 3
   \<Longrightarrow> - sint (of_nat (word_clz (w :: 'a :: len word)) :: 'a signed word) \<le> int (LENGTH('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> LENGTH('a) \<Longrightarrow> - sint (word_of_nat (word_clz w)) \<le> int LENGTH('a)
[PROOF STEP]
apply (subst sint_eq_uint)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 3 \<le> LENGTH('a) \<Longrightarrow> \<not> msb (word_of_nat (word_clz w))
 2. 3 \<le> LENGTH('a) \<Longrightarrow> - uint (word_of_nat (word_clz w)) \<le> int LENGTH('a)
[PROOF STEP]
using word_clz_max [of w]
[PROOF STATE]
proof (prove)
using this:
word_clz w \<le> size w

goal (2 subgoals):
 1. 3 \<le> LENGTH('a) \<Longrightarrow> \<not> msb (word_of_nat (word_clz w))
 2. 3 \<le> LENGTH('a) \<Longrightarrow> - uint (word_of_nat (word_clz w)) \<le> int LENGTH('a)
[PROOF STEP]
apply (simp_all add: word_size unsigned_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>3 \<le> LENGTH('a); word_clz w \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> \<not> msb (word_of_nat (word_clz w))
[PROOF STEP]
apply (rule not_msb_from_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>3 \<le> LENGTH('a); word_clz w \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> word_of_nat (word_clz w) < 2 ^ (LENGTH('a signed) - 1)
[PROOF STEP]
apply (simp add: word_less_nat_alt unsigned_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>3 \<le> LENGTH('a); word_clz w \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> take_bit LENGTH('a) (word_clz w) < 2 ^ (LENGTH('a) - Suc 0)
[PROOF STEP]
apply (subst take_bit_nat_eq_self)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>3 \<le> LENGTH('a); word_clz w \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> word_clz w < 2 ^ LENGTH('a)
 2. \<lbrakk>3 \<le> LENGTH('a); word_clz w \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> word_clz w < 2 ^ (LENGTH('a) - Suc 0)
[PROOF STEP]
apply (simp add: le_less_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>3 \<le> LENGTH('a); word_clz w \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> word_clz w < 2 ^ (LENGTH('a) - Suc 0)
[PROOF STEP]
apply (drule small_powers_of_2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>word_clz w \<le> LENGTH('a); LENGTH('a) < 2 ^ (LENGTH('a) - 1)\<rbrakk> \<Longrightarrow> word_clz w < 2 ^ (LENGTH('a) - Suc 0)
[PROOF STEP]
apply (erule le_less_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LENGTH('a) < 2 ^ (LENGTH('a) - 1) \<Longrightarrow> LENGTH('a) < 2 ^ (LENGTH('a) - Suc 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_ordering_img: "\<lbrakk>X \<noteq> {}; finite X; ordering f ord X\<rbrakk> \<Longrightarrow> f ` {0..card X - 1} = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; finite X; TernaryOrdering.ordering f ord X\<rbrakk> \<Longrightarrow> f ` {0..card X - 1} = X
[PROOF STEP]
by (force simp add: ordering_def image_def)


[STATEMENT]
lemma wf_action_translation_on_actionD:
  "\<lbrakk> wf_action_translation_on E E' A f; a \<in> A \<rbrakk>
  \<Longrightarrow> action_tid E a = action_tid E' (f a) \<and> action_obs E a \<approx> action_obs E' (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_action_translation_on E E' A f; a \<in> A\<rbrakk> \<Longrightarrow> action_tid E a = action_tid E' (f a) \<and> action_obs E a \<approx> action_obs E' (f a)
[PROOF STEP]
unfolding wf_action_translation_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj_on f (actions E) \<and> (\<forall>a\<in>A. action_tid E a = action_tid E' (f a) \<and> action_obs E a \<approx> action_obs E' (f a)); a \<in> A\<rbrakk> \<Longrightarrow> action_tid E a = action_tid E' (f a) \<and> action_obs E a \<approx> action_obs E' (f a)
[PROOF STEP]
by blast


[STATEMENT]
theorem n_subset_enum_distinct: "distinct xs \<Longrightarrow> distinct (n_subset_enum xs n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> distinct (n_subset_enum xs n)
[PROOF STEP]
by(auto simp: distinct_map n_bool_lists_distinct inj_on_def filter_bool_list_inj_aux n_bool_lists_length)


[STATEMENT]
lemma finprod_multf [simp]:
  "\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow>
   finprod G (\<lambda>x. f x \<otimes> g x) A = (finprod G f A \<otimes> finprod G g A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
[PROOF STEP]
proof (induct A rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<lbrakk>f \<in> {} \<rightarrow> carrier G; g \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>{}. f x \<otimes> g x) = finprod G f {} \<otimes> finprod G g {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
f \<in> {} \<rightarrow> carrier G
g \<in> {} \<rightarrow> carrier G

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<lbrakk>f \<in> {} \<rightarrow> carrier G; g \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>{}. f x \<otimes> g x) = finprod G f {} \<otimes> finprod G g {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Otimes>x\<in>{}. f x \<otimes> g x) = finprod G f {} \<otimes> finprod G g {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Otimes>x\<in>{}. f x \<otimes> g x) = finprod G f {} \<otimes> finprod G g {}

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G
[PROOF STEP]
have fA: "f \<in> A \<rightarrow> carrier G"
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G

goal (1 subgoal):
 1. f \<in> A \<rightarrow> carrier G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow> carrier G

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G
[PROOF STEP]
have fa: "f a \<in> carrier G"
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G

goal (1 subgoal):
 1. f a \<in> carrier G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f a \<in> carrier G

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G
[PROOF STEP]
have gA: "g \<in> A \<rightarrow> carrier G"
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G

goal (1 subgoal):
 1. g \<in> A \<rightarrow> carrier G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
g \<in> A \<rightarrow> carrier G

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G
[PROOF STEP]
have ga: "g a \<in> carrier G"
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G

goal (1 subgoal):
 1. g a \<in> carrier G
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
g a \<in> carrier G

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
from insert
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G
[PROOF STEP]
have fgA: "(%x. f x \<otimes> g x) \<in> A \<rightarrow> carrier G"
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
\<lbrakk>f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
f \<in> insert a A \<rightarrow> carrier G
g \<in> insert a A \<rightarrow> carrier G

goal (1 subgoal):
 1. (\<lambda>x. f x \<otimes> g x) \<in> A \<rightarrow> carrier G
[PROOF STEP]
by (simp add: Pi_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x \<otimes> g x) \<in> A \<rightarrow> carrier G

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>f \<in> F \<rightarrow> carrier G; g \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>F. f x \<otimes> g x) = finprod G f F \<otimes> finprod G g F; f \<in> insert x F \<rightarrow> carrier G; g \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>insert x F. f x \<otimes> g x) = finprod G f (insert x F) \<otimes> finprod G g (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Otimes>x\<in>insert a A. f x \<otimes> g x) = finprod G f (insert a A) \<otimes> finprod G g (insert a A)
[PROOF STEP]
by (simp add: insert fA fa gA ga fgA m_ac)
[PROOF STATE]
proof (state)
this:
(\<Otimes>x\<in>insert a A. f x \<otimes> g x) = finprod G f (insert a A) \<otimes> finprod G g (insert a A)

goal (1 subgoal):
 1. \<And>A. \<lbrakk>infinite A; f \<in> A \<rightarrow> carrier G; g \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> (\<Otimes>x\<in>A. f x \<otimes> g x) = finprod G f A \<otimes> finprod G g A
[PROOF STEP]
qed simp


[STATEMENT]
lemma mset_shuffles: "zs \<in> shuffles xs ys \<Longrightarrow> mset zs = mset xs + mset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zs \<in> shuffles xs ys \<Longrightarrow> mset zs = mset xs + mset ys
[PROOF STEP]
by (induction xs ys arbitrary: zs rule: shuffles.induct) auto


[STATEMENT]
lemma triangular_eq_diagonal_1x2:
 "(\<forall>A\<in>carrier_mat 1 2. admits_triangular_reduction (A::'a mat))
  = (\<forall>A\<in>carrier_mat 1 2. admits_diagonal_reduction (A::'a mat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>A\<in>carrier_mat 1 2. admits_triangular_reduction A) = (\<forall>A\<in>carrier_mat 1 2. admits_diagonal_reduction A)
[PROOF STEP]
using triangular_imp_diagonal_1x2 diagonal_imp_triangular_1x2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat 1 2; admits_triangular_reduction ?A\<rbrakk> \<Longrightarrow> admits_diagonal_reduction ?A
\<lbrakk>?A \<in> carrier_mat 1 2; admits_diagonal_reduction ?A\<rbrakk> \<Longrightarrow> admits_triangular_reduction ?A

goal (1 subgoal):
 1. (\<forall>A\<in>carrier_mat 1 2. admits_triangular_reduction A) = (\<forall>A\<in>carrier_mat 1 2. admits_diagonal_reduction A)
[PROOF STEP]
by auto


[STATEMENT]
lemma unit_disc_fix_preserve_poincare_collinear_iff [simp]:
  assumes "unit_circle_fix M"
  shows "poincare_collinear (moebius_pt M ` A) \<longleftrightarrow> poincare_collinear A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_collinear (moebius_pt M ` A) = poincare_collinear A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M

goal (1 subgoal):
 1. poincare_collinear (moebius_pt M ` A) = poincare_collinear A
[PROOF STEP]
using unit_disc_fix_preserve_poincare_collinear[of M A]
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
\<lbrakk>unit_circle_fix M; poincare_collinear A\<rbrakk> \<Longrightarrow> poincare_collinear (moebius_pt M ` A)

goal (1 subgoal):
 1. poincare_collinear (moebius_pt M ` A) = poincare_collinear A
[PROOF STEP]
using unit_disc_fix_preserve_poincare_collinear[of "moebius_inv M" "moebius_pt M ` A"]
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M
\<lbrakk>unit_circle_fix M; poincare_collinear A\<rbrakk> \<Longrightarrow> poincare_collinear (moebius_pt M ` A)
\<lbrakk>unit_circle_fix (moebius_inv M); poincare_collinear (moebius_pt M ` A)\<rbrakk> \<Longrightarrow> poincare_collinear (moebius_pt (moebius_inv M) ` moebius_pt M ` A)

goal (1 subgoal):
 1. poincare_collinear (moebius_pt M ` A) = poincare_collinear A
[PROOF STEP]
by (auto simp del: unit_disc_fix_preserve_poincare_collinear)


[STATEMENT]
lemma subprob_space_bind:
  assumes "subprob_space M" "f \<in> measurable M (subprob_algebra N)"
  shows "subprob_space (M \<bind> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subprob_space (M \<bind> f)
[PROOF STEP]
proof (rule subprob_space_kernel[of "\<lambda>x. x \<bind> f"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. x \<bind> f) \<in> ?M \<rightarrow>\<^sub>M subprob_algebra ?N
 2. M \<in> space ?M
[PROOF STEP]
show "(\<lambda>x. x \<bind> f) \<in> measurable (subprob_algebra M) (subprob_algebra N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x \<bind> f) \<in> subprob_algebra M \<rightarrow>\<^sub>M subprob_algebra N
[PROOF STEP]
by (rule measurable_bind, rule measurable_ident_sets, rule refl,
        rule measurable_compose[OF measurable_snd assms(2)])
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x \<bind> f) \<in> subprob_algebra M \<rightarrow>\<^sub>M subprob_algebra N

goal (1 subgoal):
 1. M \<in> space (subprob_algebra M)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
subprob_space M
[PROOF STEP]
show "M \<in> space (subprob_algebra M)"
[PROOF STATE]
proof (prove)
using this:
subprob_space M

goal (1 subgoal):
 1. M \<in> space (subprob_algebra M)
[PROOF STEP]
by (simp add: space_subprob_algebra)
[PROOF STATE]
proof (state)
this:
M \<in> space (subprob_algebra M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sum_splitlist_nonempty:
  "\<Sum>{f ys zs |ys zs. xs = ys @ zs} = ((f [] xs)::'a::join_semilattice_zero) + \<Sum>{f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f ys zs |ys zs. xs = ys @ zs} = f [] xs + \<Sum> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sum> {f ys zs |ys zs. xs = ys @ zs} = f [] xs + \<Sum> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}
[PROOF STEP]
have "{f ys zs |ys zs. xs = ys @ zs} = {f ys zs |ys zs. xs = ys @ zs \<and> ys = []} \<union> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f ys zs |ys zs. xs = ys @ zs} = {f ys zs |ys zs. xs = ys @ zs \<and> ys = []} \<union> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{f ys zs |ys zs. xs = ys @ zs} = {f ys zs |ys zs. xs = ys @ zs \<and> ys = []} \<union> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}

goal (1 subgoal):
 1. \<Sum> {f ys zs |ys zs. xs = ys @ zs} = f [] xs + \<Sum> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{f ys zs |ys zs. xs = ys @ zs} = {f ys zs |ys zs. xs = ys @ zs \<and> ys = []} \<union> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}

goal (1 subgoal):
 1. \<Sum> {f ys zs |ys zs. xs = ys @ zs} = f [] xs + \<Sum> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}
[PROOF STEP]
using [[simproc add: finite_Collect]]
[PROOF STATE]
proof (prove)
using this:
{f ys zs |ys zs. xs = ys @ zs} = {f ys zs |ys zs. xs = ys @ zs \<and> ys = []} \<union> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}

goal (1 subgoal):
 1. \<Sum> {f ys zs |ys zs. xs = ys @ zs} = f [] xs + \<Sum> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}
[PROOF STEP]
by (simp add: sum.insert)
[PROOF STATE]
proof (state)
this:
\<Sum> {f ys zs |ys zs. xs = ys @ zs} = f [] xs + \<Sum> {f ys zs |ys zs. xs = ys @ zs \<and> ys \<noteq> []}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tranclD3 [rule_format]:
  "(S,T) \<in> R^+ \<Longrightarrow> (S,T) \<notin> R \<longrightarrow> (\<exists> U. (S,U) \<in> R \<and> (U,T) \<in> R^+)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S, T) \<in> R\<^sup>+ \<Longrightarrow> (S, T) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R \<and> (U, T) \<in> R\<^sup>+)
[PROOF STEP]
apply (rule_tac a="S" and b="T" and r=R in trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (S, T) \<in> R\<^sup>+ \<Longrightarrow> (S, T) \<in> R\<^sup>+
 2. \<And>y. \<lbrakk>(S, T) \<in> R\<^sup>+; (S, y) \<in> R\<rbrakk> \<Longrightarrow> (S, y) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R \<and> (U, y) \<in> R\<^sup>+)
 3. \<And>y z. \<lbrakk>(S, T) \<in> R\<^sup>+; (S, y) \<in> R\<^sup>+; (y, z) \<in> R; (S, y) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R \<and> (U, y) \<in> R\<^sup>+)\<rbrakk> \<Longrightarrow> (S, z) \<notin> R \<longrightarrow> (\<exists>U. (S, U) \<in> R \<and> (U, z) \<in> R\<^sup>+)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma primepow_iff_even_sqr:
  "primepow n \<longleftrightarrow> primepow_even (n^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primepow n = primepow_even (n\<^sup>2)
[PROOF STEP]
by (cases "n = 0")
     (auto simp: primepow_even_altdef aprimedivisor_primepow_power primepow_power_iff_nat
                 prime_elem_multiplicity_power_distrib prime_aprimedivisor' prime_imp_prime_elem
                 unit_factor_nat_def primepow_gt_0_nat dest: primepow_gt_Suc_0)


[STATEMENT]
lemma rank_succ [simp]: "rank(succ x) = succ(rank x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (ZFC_in_HOL.succ x) = ZFC_in_HOL.succ (rank x)
[PROOF STEP]
proof (rule order_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rank (ZFC_in_HOL.succ x) \<le> ZFC_in_HOL.succ (rank x)
 2. ZFC_in_HOL.succ (rank x) \<le> rank (ZFC_in_HOL.succ x)
[PROOF STEP]
show "rank (succ x) \<le> succ (rank x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (ZFC_in_HOL.succ x) \<le> ZFC_in_HOL.succ (rank x)
[PROOF STEP]
by (metis (no_types, lifting) Sup_insert elts_of_set elts_succ image_insert rank small_UN small_elts subset_insertI sup.orderE vsubsetI)
[PROOF STATE]
proof (state)
this:
rank (ZFC_in_HOL.succ x) \<le> ZFC_in_HOL.succ (rank x)

goal (1 subgoal):
 1. ZFC_in_HOL.succ (rank x) \<le> rank (ZFC_in_HOL.succ x)
[PROOF STEP]
show "succ (rank x) \<le> rank (succ x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.succ (rank x) \<le> rank (ZFC_in_HOL.succ x)
[PROOF STEP]
by (metis (mono_tags, lifting) ZFC_in_HOL.Sup_upper elts_succ image_insert insertI1 rank_Sup replacement small_elts)
[PROOF STATE]
proof (state)
this:
ZFC_in_HOL.succ (rank x) \<le> rank (ZFC_in_HOL.succ x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in encoding) enc_reflects_pred_iff_source_target_rel_preserves_pred:
  fixes Pred :: "('procS, 'procT) Proc \<Rightarrow> bool"
  shows "enc_reflects_pred Pred
         = (\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_preserves_pred Rel Pred)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enc_reflects_pred Pred = (\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_preserves_pred Rel Pred)
[PROOF STEP]
using enc_reflects_pred_iff_source_target_rel_reflects_pred[where Pred="Pred"]
            indRelR_cond_reflection_iff_indRelL_cond_preservation[where Pred="Pred"]
[PROOF STATE]
proof (prove)
using this:
enc_reflects_pred Pred = (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_reflects_pred Rel Pred)
enc_reflects_pred Pred = (\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_reflects_pred Rel Pred \<and> preorder Rel)
(\<exists>Rel. (\<forall>S. (SourceTerm S, TargetTerm (\<lbrakk>S\<rbrakk>)) \<in> Rel) \<and> rel_reflects_pred Rel Pred) = (\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_preserves_pred Rel Pred)

goal (1 subgoal):
 1. enc_reflects_pred Pred = (\<exists>Rel. (\<forall>S. (TargetTerm (\<lbrakk>S\<rbrakk>), SourceTerm S) \<in> Rel) \<and> rel_preserves_pred Rel Pred)
[PROOF STEP]
by simp


[STATEMENT]
lemma clop_Inf_closed:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows  "clop f \<Longrightarrow> Inf_closed_set (Fix f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clop f \<Longrightarrow> Inf_closed_set (Fix f)
[PROOF STEP]
unfolding clop_def Inf_closed_set_def mono_def le_fun_def comp_def id_def Fix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<le> f x) \<and> (\<forall>x y. x \<le> y \<longrightarrow> f x \<le> f y) \<and> (\<forall>x. f (f x) \<le> f x) \<Longrightarrow> \<forall>Y\<subseteq>{x. f x = x}. \<Sqinter> Y \<in> {x. f x = x}
[PROOF STEP]
by (smt Inf_greatest Inf_lower antisym mem_Collect_eq subsetCE)


[STATEMENT]
lemma set_to_nat_at_empty: "set_to_nat {} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_to_nat {} = 0
[PROOF STEP]
by (unfold set_to_nat_def, rule sum.empty)


[STATEMENT]
lemma nat_of_ord_inject: "Ord x \<Longrightarrow> Ord y \<Longrightarrow> nat_of_ord x = nat_of_ord y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord x; Ord y\<rbrakk> \<Longrightarrow> (nat_of_ord x = nat_of_ord y) = (x = y)
[PROOF STEP]
by (metis ord_of_nat_of_ord)


[STATEMENT]
lemma nth_pow_wits_SA_fun_prep:
  assumes "n > 0"
  assumes "h \<in> carrier (SA m)"
  assumes "\<rho> \<in> nth_pow_wits n"
  shows "is_semialgebraic m (h \<inverse>\<^bsub>m\<^esub>pow_res n \<rho>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic m (h \<inverse>\<^bsub>m\<^esub> pow_res n \<rho>)
[PROOF STEP]
by(intro evimage_is_semialg assms  pow_res_is_univ_semialgebraic nth_pow_wits_closed(1)[of n])


[STATEMENT]
lemma openin_Times:
  "openin (top_of_set S) S' \<Longrightarrow> openin (top_of_set T) T' \<Longrightarrow>
    openin (top_of_set (S \<times> T)) (S' \<times> T')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>openin (top_of_set S) S'; openin (top_of_set T) T'\<rbrakk> \<Longrightarrow> openin (top_of_set (S \<times> T)) (S' \<times> T')
[PROOF STEP]
unfolding openin_open
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>T. open T \<and> S' = S \<inter> T; \<exists>Ta. open Ta \<and> T' = T \<inter> Ta\<rbrakk> \<Longrightarrow> \<exists>Ta. open Ta \<and> S' \<times> T' = S \<times> T \<inter> Ta
[PROOF STEP]
using open_Times
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open ?S; open ?T\<rbrakk> \<Longrightarrow> open (?S \<times> ?T)

goal (1 subgoal):
 1. \<lbrakk>\<exists>T. open T \<and> S' = S \<inter> T; \<exists>Ta. open Ta \<and> T' = T \<inter> Ta\<rbrakk> \<Longrightarrow> \<exists>Ta. open Ta \<and> S' \<times> T' = S \<times> T \<inter> Ta
[PROOF STEP]
by blast


[STATEMENT]
lemma compl_compl_eq_id [simp]:
  "UNIV - (UNIV - s) = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV - (UNIV - s) = s
[PROOF STEP]
by auto


[STATEMENT]
lemma the_inverse_matrix:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
assumes "invertible A"
shows "the (inverse_matrix A) = P_Gauss_Jordan A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. the (inverse_matrix A) = P_Gauss_Jordan A
[PROOF STEP]
by (metis P_Gauss_Jordan_def assms inverse_matrix_def matrix_inv_Gauss_Jordan_PA option.sel)


[STATEMENT]
lemma min_height_size_log_if_incomplete:
  "\<not> complete kdt \<Longrightarrow> min_height kdt < log 2 (size_kdt kdt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> KD_Tree.complete kdt \<Longrightarrow> real (min_height kdt) < log 2 (real (KD_Tree.size_kdt kdt))
[PROOF STEP]
by (simp add: less_log2_of_power min_height_size_if_incomplete)


[STATEMENT]
lemma (in sigma_finite_measure) measurable_measure[measurable (raw)]:
  "(\<And>x. x \<in> space N \<Longrightarrow> A x \<subseteq> space M) \<Longrightarrow>
    {x \<in> space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} \<in> sets (N \<Otimes>\<^sub>M M) \<Longrightarrow>
    (\<lambda>x. measure M (A x)) \<in> borel_measurable N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> space N \<Longrightarrow> A x \<subseteq> space M; {x \<in> space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} \<in> sets (N \<Otimes>\<^sub>M M)\<rbrakk> \<Longrightarrow> (\<lambda>x. Sigma_Algebra.measure M (A x)) \<in> borel_measurable N
[PROOF STEP]
unfolding measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> space N \<Longrightarrow> A x \<subseteq> space M; {x \<in> space (N \<Otimes>\<^sub>M M). snd x \<in> A (fst x)} \<in> sets (N \<Otimes>\<^sub>M M)\<rbrakk> \<Longrightarrow> (\<lambda>x. enn2real (emeasure M (A x))) \<in> borel_measurable N
[PROOF STEP]
by (intro measurable_emeasure borel_measurable_enn2real) auto


[STATEMENT]
lemma propagate_CLAMP:
  "CLAMP (\<lambda>x. f x * g x) = CLAMP' (\<lambda>x. CLAMP f x * CLAMP g x)"
  "CLAMP (\<lambda>x. f x / g x) = CLAMP' (\<lambda>x. CLAMP f x / CLAMP g x)"
  "CLAMP (\<lambda>x. inverse (f x)) = CLAMP' (\<lambda>x. inverse (CLAMP f x))"
  "CLAMP (\<lambda>x. real x) = CLAMP' (MASTER_BOUND 1 0 0)"
  "CLAMP (\<lambda>x. real x powr a) = CLAMP' (MASTER_BOUND a 0 0)"
  "CLAMP (\<lambda>x. real x ^ a') = CLAMP' (MASTER_BOUND (real a') 0 0)"
  "CLAMP (\<lambda>x. ln (real x)) = CLAMP' (MASTER_BOUND 0 1 0)"
  "CLAMP (\<lambda>x. ln (real x) powr b) = CLAMP' (MASTER_BOUND 0 b 0)"
  "CLAMP (\<lambda>x. ln (real x) ^ b') = CLAMP' (MASTER_BOUND 0 (real b') 0)"
  "CLAMP (\<lambda>x. ln (ln (real x))) = CLAMP' (MASTER_BOUND 0 0 1)"
  "CLAMP (\<lambda>x. ln (ln (real x)) powr c) = CLAMP' (MASTER_BOUND 0 0 c)"
  "CLAMP (\<lambda>x. ln (ln (real x)) ^ c') = CLAMP' (MASTER_BOUND 0 0 (real c'))"
  "CLAMP' (CLAMP f) = CLAMP' f"
  "CLAMP' (\<lambda>x. CLAMP' (MASTER_BOUND a1 b1 c1) x * CLAMP' (MASTER_BOUND a2 b2 c2) x) =
       CLAMP' (MASTER_BOUND (a1+a2) (b1+b2) (c1+c2))"
  "CLAMP' (\<lambda>x. CLAMP' (MASTER_BOUND a1 b1 c1) x / CLAMP' (MASTER_BOUND a2 b2 c2) x) =
       CLAMP' (MASTER_BOUND (a1-a2) (b1-b2) (c1-c2))"
  "CLAMP' (\<lambda>x. inverse (MASTER_BOUND a1 b1 c1 x)) = CLAMP' (MASTER_BOUND (-a1) (-b1) (-c1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((CLAMP (\<lambda>x. f x * g x) = CLAMP' (\<lambda>x. CLAMP f x * CLAMP g x) &&& CLAMP (\<lambda>x. f x / g x) = CLAMP' (\<lambda>x. CLAMP f x / CLAMP g x)) &&& CLAMP (\<lambda>x. inverse (f x)) = CLAMP' (\<lambda>x. inverse (CLAMP f x)) &&& CLAMP real = CLAMP' (MASTER_BOUND 1 0 0)) &&& (CLAMP (\<lambda>x. real x powr a) = CLAMP' (MASTER_BOUND a 0 0) &&& CLAMP (\<lambda>x. real x ^ a') = CLAMP' (MASTER_BOUND (real a') 0 0)) &&& CLAMP (\<lambda>x. ln (real x)) = CLAMP' (MASTER_BOUND 0 1 0) &&& CLAMP (\<lambda>x. ln (real x) powr b) = CLAMP' (MASTER_BOUND 0 b 0)) &&& ((CLAMP (\<lambda>x. ln (real x) ^ b') = CLAMP' (MASTER_BOUND 0 (real b') 0) &&& CLAMP (\<lambda>x. ln (ln (real x))) = CLAMP' (MASTER_BOUND 0 0 1)) &&& CLAMP (\<lambda>x. ln (ln (real x)) powr c) = CLAMP' (MASTER_BOUND 0 0 c) &&& CLAMP (\<lambda>x. ln (ln (real x)) ^ c') = CLAMP' (MASTER_BOUND 0 0 (real c'))) &&& (CLAMP' (CLAMP f) = CLAMP' f &&& CLAMP' (\<lambda>x. CLAMP' (MASTER_BOUND a1 b1 c1) x * CLAMP' (MASTER_BOUND a2 b2 c2) x) = CLAMP' (MASTER_BOUND (a1 + a2) (b1 + b2) (c1 + c2))) &&& CLAMP' (\<lambda>x. CLAMP' (MASTER_BOUND a1 b1 c1) x / CLAMP' (MASTER_BOUND a2 b2 c2) x) = CLAMP' (MASTER_BOUND (a1 - a2) (b1 - b2) (c1 - c2)) &&& CLAMP' (\<lambda>x. inverse (MASTER_BOUND a1 b1 c1 x)) = CLAMP' (MASTER_BOUND (- a1) (- b1) (- c1))
[PROOF STEP]
by (insert ln_1_imp_less_3')
   (rule ext, simp add: CLAMP_def CLAMP'_def MASTER_BOUND_def
      powr_realpow powr_one[OF ln_ln_nonneg'] powr_realpow[OF ln_ln_pos] powr_add
      powr_diff powr_minus)+


[STATEMENT]
lemma size_merge2: "size(merge2 t1 t2) = size t1 + size t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (merge2 t1 t2) = size t1 + size t2
[PROOF STEP]
by(induction t1 t2 rule: merge2.induct) auto


[STATEMENT]
lemma sets_image_in_sets':
  assumes X: "X \<in> sets N"
  assumes f: "\<And>A. A \<in> sets M \<Longrightarrow> f -` A \<inter> X \<in> sets N"
  shows "sets (vimage_algebra X f M) \<subseteq> sets N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (vimage_algebra X f M) \<subseteq> sets N
[PROOF STEP]
unfolding sets_vimage_algebra
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets X {f -` A \<inter> X |A. A \<in> sets M} \<subseteq> sets N
[PROOF STEP]
by (rule sets.sigma_sets_subset') (auto intro!: measurable_sets X f)


[STATEMENT]
lemma inf_distribI':
  fixes f :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  assumes B: "\<And>C. f (Sup C) = Sup (f`C)"
  shows "inf_distrib f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_distrib f
[PROOF STEP]
apply (rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. strict f
 2. cont f
[PROOF STEP]
apply (rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f bot = bot
 2. cont f
[PROOF STEP]
apply (rule B[of "{}", simplified])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cont f
[PROOF STEP]
apply (rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>C. C \<noteq> {} \<Longrightarrow> f (Sup C) = Sup (f ` C)
[PROOF STEP]
apply (rule B)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inverse_le_imp_le_neg:
  "inverse a \<le> inverse b \<Longrightarrow> b < 0 \<Longrightarrow> b \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inverse a \<le> inverse b; b < (0::'a)\<rbrakk> \<Longrightarrow> b \<le> a
[PROOF STEP]
by (metis local.inverse_le_imp_le local.inverse_minus_eq local.neg_0_less_iff_less
      local.neg_le_iff_le)


[STATEMENT]
lemma "x - (x + y) = -(y::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - (x + y) = - y
[PROOF STEP]
by arith


[STATEMENT]
lemma opp_opp: "opp (opp p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. opp (opp p) = p
[PROOF STEP]
by (simp add: opp_def split: point.split)


[STATEMENT]
lemma abs_Gcd_eq [simp]:
  "\<bar>Gcd K\<bar> = Gcd K" for K :: "int set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Gcd K\<bar> = Gcd K
[PROOF STEP]
by (simp only: Gcd_int_def)


[STATEMENT]
lemma interior_of_eq_empty_complement:
  "X interior_of S = {} \<longleftrightarrow> X closure_of (topspace X - S) = topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X interior_of S = {}) = (X closure_of (topspace X - S) = topspace X)
[PROOF STEP]
using interior_of_subset_topspace [of X S] closure_of_complement
[PROOF STATE]
proof (prove)
using this:
X interior_of S \<subseteq> topspace X
?X closure_of (topspace ?X - ?S) = topspace ?X - ?X interior_of ?S

goal (1 subgoal):
 1. (X interior_of S = {}) = (X closure_of (topspace X - S) = topspace X)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma is_proper_suffix_length_cmp: "is_proper_suffix a b \<Longrightarrow> length a < length b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_proper_suffix a b \<Longrightarrow> length a < length b
[PROOF STEP]
by (metis add_diff_cancel_right' append_Nil append_eq_append_conv
  diff_is_0_eq is_proper_suffix_def leI length_append list.size(3))


[STATEMENT]
lemma "[r, mod m, 4] = {r, r+m, r+2*m, r+3*m, r+4*m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [ r, mod m, 4 ] = {r, r + m, r + 2 * m, r + 3 * m, r + 4 * m}
[PROOF STEP]
apply (simp only: iMODb_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<dots>4] \<otimes> m \<oplus> r = {r, r + m, r + 2 * m, r + 3 * m, r + 4 * m}
[PROOF STEP]
apply (simp add: iT_defs iT_Mult_def iT_Plus_def atMost_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. n + r) ` (\<lambda>n. n * m) ` {x. x \<le> 4} = {r, r + m, r + 2 * m, r + 3 * m, r + 4 * m}
[PROOF STEP]
apply (simp add: image_Collect)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {uu_ + r |uu_. \<exists>x. uu_ = x * m \<and> x \<le> 4} = {r, r + m, r + 2 * m, r + 3 * m, r + 4 * m}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>x _ xa. \<lbrakk>xa * m + r \<noteq> r; xa * m + r \<noteq> r + m; xa * m + r \<noteq> r + 2 * m; xa * m + r \<noteq> r + 3 * m; xa * m + r \<notin> {}; xa \<le> 4\<rbrakk> \<Longrightarrow> xa * m + r = r + 4 * m
 2. \<And>x. \<exists>uu_. r = uu_ + r \<and> (\<exists>x. uu_ = x * m \<and> x \<le> 4)
 3. \<And>x. \<exists>uu_. r + m = uu_ + r \<and> (\<exists>x. uu_ = x * m \<and> x \<le> 4)
 4. \<And>x. \<exists>uu_. r + 2 * m = uu_ + r \<and> (\<exists>x. uu_ = x * m \<and> x \<le> 4)
 5. \<And>x. \<exists>uu_. r + 3 * m = uu_ + r \<and> (\<exists>x. uu_ = x * m \<and> x \<le> 4)
 6. \<And>x. \<exists>uu_. r + 4 * m = uu_ + r \<and> (\<exists>x. uu_ = x * m \<and> x \<le> 4)
[PROOF STEP]
apply fastforce+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma poly_map_poly_cnj [simp]: "poly (map_poly cnj p) x = cnj (poly p (cnj x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (map_poly cnj p) x = cnj (poly p (cnj x))
[PROOF STEP]
by (induction p) (auto simp: map_poly_pCons)


[STATEMENT]
lemma contour_integral_cong:
  assumes "g = g'" "\<And>x. x \<in> path_image g \<Longrightarrow> f x = f' x"
  shows   "contour_integral g f = contour_integral g' f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral g f = contour_integral g' f'
[PROOF STEP]
unfolding contour_integral_integral
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. f (g x) * vector_derivative g (at x)) = integral {0..1} (\<lambda>x. f' (g' x) * vector_derivative g' (at x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g = g'
?x \<in> path_image g \<Longrightarrow> f ?x = f' ?x

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. f (g x) * vector_derivative g (at x)) = integral {0..1} (\<lambda>x. f' (g' x) * vector_derivative g' (at x))
[PROOF STEP]
by (intro integral_cong) (auto simp: path_image_def)


[STATEMENT]
lemma det_smult[simp]: "det (a \<cdot>\<^sub>m A) = a ^ dim_col A * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (a \<cdot>\<^sub>m A) = a ^ dim_col A * det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (a \<cdot>\<^sub>m A) = a ^ dim_col A * det A
[PROOF STEP]
have [simp]: "(\<Prod>i = 0..<dim_col A. a) = a ^ dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<dim_col A. a) = a ^ dim_col A
[PROOF STEP]
by(subst prod_constant;simp)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<dim_col A. a) = a ^ dim_col A

goal (1 subgoal):
 1. det (a \<cdot>\<^sub>m A) = a ^ dim_col A * det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (a \<cdot>\<^sub>m A) = a ^ dim_col A * det A
[PROOF STEP]
unfolding det_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if dim_row (a \<cdot>\<^sub>m A) = dim_col (a \<cdot>\<^sub>m A) then \<Sum>p | p permutes {0..<dim_row (a \<cdot>\<^sub>m A)}. of_int (sign p) * (\<Prod>i = 0..<dim_row (a \<cdot>\<^sub>m A). (a \<cdot>\<^sub>m A) $$ (i, p i)) else (0::'a)) = a ^ dim_col A * (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. A $$ (i, p i)) else (0::'a))
[PROOF STEP]
unfolding index_smult_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. (a \<cdot>\<^sub>m A) $$ (i, p i)) else (0::'a)) = a ^ dim_col A * (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. A $$ (i, p i)) else (0::'a))
[PROOF STEP]
by (auto intro: sum.cong simp: sum_distrib_left prod.distrib)
[PROOF STATE]
proof (state)
this:
det (a \<cdot>\<^sub>m A) = a ^ dim_col A * det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cpx_sq_mat) spectrum_meas_outcome_val_eq':
  assumes "hermitian A"
  and "A \<in> fc_mats"
and "make_pm A = (p, M)"
shows "{Re x|x. x\<in> spectrum A} = (\<lambda>i. meas_outcome_val (M i)) `{..< p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum A} = (\<lambda>i. meas_outcome_val (M i)) ` {..<p}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {Re x |x. x \<in> spectrum A} \<subseteq> (\<lambda>i. meas_outcome_val (M i)) ` {..<p}
 2. (\<lambda>i. meas_outcome_val (M i)) ` {..<p} \<subseteq> {Re x |x. x \<in> spectrum A}
[PROOF STEP]
show "{Re x |x. x \<in> spectrum A} \<subseteq> (\<lambda>i. meas_outcome_val (M i)) ` {..<p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum A} \<subseteq> (\<lambda>i. meas_outcome_val (M i)) ` {..<p}
[PROOF STEP]
using spectrum_meas_outcome_val_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>hermitian ?A; ?A \<in> fc_mats; make_pm ?A = (?p, ?M)\<rbrakk> \<Longrightarrow> spectrum ?A = (\<lambda>x. complex_of_real (meas_outcome_val (?M x))) ` {..<?p}
hermitian A
A \<in> fc_mats
make_pm A = (p, M)

goal (1 subgoal):
 1. {Re x |x. x \<in> spectrum A} \<subseteq> (\<lambda>i. meas_outcome_val (M i)) ` {..<p}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{Re x |x. x \<in> spectrum A} \<subseteq> (\<lambda>i. meas_outcome_val (M i)) ` {..<p}

goal (1 subgoal):
 1. (\<lambda>i. meas_outcome_val (M i)) ` {..<p} \<subseteq> {Re x |x. x \<in> spectrum A}
[PROOF STEP]
show "(\<lambda>i. meas_outcome_val (M i)) ` {..<p} \<subseteq> {Re x |x. x \<in> spectrum A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. meas_outcome_val (M i)) ` {..<p} \<subseteq> {Re x |x. x \<in> spectrum A}
[PROOF STEP]
using spectrum_meas_outcome_val_eq assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>hermitian ?A; ?A \<in> fc_mats; make_pm ?A = (?p, ?M)\<rbrakk> \<Longrightarrow> spectrum ?A = (\<lambda>x. complex_of_real (meas_outcome_val (?M x))) ` {..<?p}
hermitian A
A \<in> fc_mats
make_pm A = (p, M)

goal (1 subgoal):
 1. (\<lambda>i. meas_outcome_val (M i)) ` {..<p} \<subseteq> {Re x |x. x \<in> spectrum A}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<lambda>i. meas_outcome_val (M i)) ` {..<p} \<subseteq> {Re x |x. x \<in> spectrum A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sq_norm_vec_rat_code[code]: "sq_norm_vec_rat x = (\<Sum>x\<leftarrow>list_of_vec x. square_rat x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sq_norm_vec_rat x = sum_list (map square_rat (list_of_vec x))
[PROOF STEP]
unfolding sq_norm_vec_rat_def sq_norm_vec_def square_rat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map sq_norm (list_of_vec x)) = (\<Sum>x\<leftarrow>list_of_vec x. x * x)
[PROOF STEP]
by auto


[STATEMENT]
lemma exp_plus_inverse_exp:
  fixes x::real
  shows "2 \<le> exp x + inverse (exp x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> exp x + inverse (exp x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 \<le> exp x + inverse (exp x)
[PROOF STEP]
have "2 \<le> exp x + exp (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> exp x + exp (- x)
[PROOF STEP]
using exp_ge_add_one_self [of x] exp_ge_add_one_self [of "-x"]
[PROOF STATE]
proof (prove)
using this:
1 + x \<le> exp x
1 + - x \<le> exp (- x)

goal (1 subgoal):
 1. 2 \<le> exp x + exp (- x)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 \<le> exp x + exp (- x)

goal (1 subgoal):
 1. 2 \<le> exp x + inverse (exp x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 \<le> exp x + exp (- x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 \<le> exp x + exp (- x)

goal (1 subgoal):
 1. 2 \<le> exp x + inverse (exp x)
[PROOF STEP]
by (simp add: exp_minus)
[PROOF STATE]
proof (state)
this:
2 \<le> exp x + inverse (exp x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_jnf_complexity:
  assumes A: "A \<in> carrier_mat n n"
  and upper_t: "upper_triangular (A :: 'a :: real_normed_field mat)"
  and le_1: "\<And> n a. (n,a) \<in> set (triangular_to_jnf_vector A) \<Longrightarrow> norm a \<le> 1"
  and le_N: "\<And> n a. (n,a) \<in> set (triangular_to_jnf_vector A) \<Longrightarrow> norm a = 1 \<Longrightarrow> n \<le> N"
  shows "\<exists> c1 c2. \<forall> k. norm_bound (A ^\<^sub>m k) (c1 + c2 * of_nat k ^ (N - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k. norm_bound (A ^\<^sub>m k) (c1 + c2 * real k ^ (N - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k. norm_bound (A ^\<^sub>m k) (c1 + c2 * real k ^ (N - 1))
[PROOF STEP]
let ?jnf = "triangular_to_jnf_vector A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k. norm_bound (A ^\<^sub>m k) (c1 + c2 * real k ^ (N - 1))
[PROOF STEP]
from triangular_to_jnf_vector[OF A upper_t]
[PROOF STATE]
proof (chain)
picking this:
jordan_nf A (triangular_to_jnf_vector A)
[PROOF STEP]
have jnf: "jordan_nf A ?jnf"
[PROOF STATE]
proof (prove)
using this:
jordan_nf A (triangular_to_jnf_vector A)

goal (1 subgoal):
 1. jordan_nf A (triangular_to_jnf_vector A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
jordan_nf A (triangular_to_jnf_vector A)

goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k. norm_bound (A ^\<^sub>m k) (c1 + c2 * real k ^ (N - 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c1 c2. \<forall>k. norm_bound (A ^\<^sub>m k) (c1 + c2 * real k ^ (N - 1))
[PROOF STEP]
by (rule jordan_nf_matrix_poly_bound[OF A le_1 le_N jnf])
[PROOF STATE]
proof (state)
this:
\<exists>c1 c2. \<forall>k. norm_bound (A ^\<^sub>m k) (c1 + c2 * real k ^ (N - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_unique: "of_int z - 1 < x \<Longrightarrow> x \<le> of_int z \<Longrightarrow> \<lceil>x\<rceil> = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>of_int z - (1::'a) < x; x \<le> of_int z\<rbrakk> \<Longrightarrow> \<lceil>x\<rceil> = z
[PROOF STEP]
unfolding ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>of_int z - (1::'a) < x; x \<le> of_int z\<rbrakk> \<Longrightarrow> - \<lfloor>- x\<rfloor> = z
[PROOF STEP]
using floor_unique [of "- z" "- x"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>of_int (- z) \<le> - x; - x < of_int (- z) + (1::'a)\<rbrakk> \<Longrightarrow> \<lfloor>- x\<rfloor> = - z

goal (1 subgoal):
 1. \<lbrakk>of_int z - (1::'a) < x; x \<le> of_int z\<rbrakk> \<Longrightarrow> - \<lfloor>- x\<rfloor> = z
[PROOF STEP]
by simp


[STATEMENT]
lemma iMODb_icard_if: "icard [r, mod m, c] = enat (if m = 0 then Suc 0 else Suc c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. icard [ r, mod m, c ] = enat (if m = 0 then Suc 0 else Suc c)
[PROOF STEP]
by (simp add: icard_finite iT_finite iMODb_card_if)


[STATEMENT]
lemma of_rat_less_0_iff [simp]: "(of_rat r :: 'a::linordered_field) < 0 \<longleftrightarrow> r < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r < (0::'a)) = (r < 0)
[PROOF STEP]
using of_rat_less [of r 0, where 'a = 'a]
[PROOF STATE]
proof (prove)
using this:
(of_rat r < of_rat 0) = (r < 0)

goal (1 subgoal):
 1. (of_rat r < (0::'a)) = (r < 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma rbt_lookup_fold_rbt_insert:
  "is_rbt t \<Longrightarrow>
  rbt_lookup (fold (\<lambda>k. rbt_insert k (f k)) xs t) =
  rbt_lookup t ++ map_of (map (\<lambda>k. (k, f k)) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_rbt t \<Longrightarrow> rbt_lookup (fold (\<lambda>k. rbt_insert k (f k)) xs t) = rbt_lookup t ++ map_of (map (\<lambda>k. (k, f k)) xs)
[PROOF STEP]
by(induct xs arbitrary: t)(auto simp add: rbt_lookup_rbt_insert map_add_def fun_eq_iff map_of_map_Pair_key split: option.splits)


[STATEMENT]
lemma append_cols_mult_left:
  assumes A: "A \<in> carrier_mat n a"
  and B: "B \<in> carrier_mat n b"
  and P: "P \<in> carrier_mat n n"
shows "P * (A @\<^sub>c B) = (P*A) @\<^sub>c (P*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
let ?P = "four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
have "P = ?P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0)
[PROOF STEP]
by (rule eq_matI, auto)
[PROOF STATE]
proof (state)
this:
P = four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0)

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
hence "P * (A @\<^sub>c B) = ?P * (A @\<^sub>c B)"
[PROOF STATE]
proof (prove)
using this:
P = four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0)

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * (A @\<^sub>c B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P * (A @\<^sub>c B) = four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * (A @\<^sub>c B)

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P * (A @\<^sub>c B) = four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * (A @\<^sub>c B)

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
have "?P * (A @\<^sub>c B) = four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A))
  (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A))
  (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * (A @\<^sub>c B) = four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B))
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) = four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B))
[PROOF STEP]
by (rule mult_four_block_mat, insert A B P, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * (A @\<^sub>c B) = four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B))

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat P (0\<^sub>m n 0) (0\<^sub>m 0 n) (0\<^sub>m 0 0) * (A @\<^sub>c B) = four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B))

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
have "... = four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P*A))) (0\<^sub>m 0 (dim_col (P*B)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B)) = four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B)))
[PROOF STEP]
by (rule cong_four_block_mat, insert P, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B)) = four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B)))

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat (P * A + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col A)) (P * B + 0\<^sub>m n 0 * 0\<^sub>m 0 (dim_col B)) (0\<^sub>m 0 n * A + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 n * B + 0\<^sub>m 0 0 * 0\<^sub>m 0 (dim_col B)) = four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B)))

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
have "... = (P*A) @\<^sub>c (P*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B))) = P * A @\<^sub>c P * B
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B))) = four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat (P * A) (P * B) (0\<^sub>m 0 (dim_col (P * A))) (0\<^sub>m 0 (dim_col (P * B))) = P * A @\<^sub>c P * B

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P * (A @\<^sub>c B) = P * A @\<^sub>c P * B

goal (1 subgoal):
 1. P * (A @\<^sub>c B) = P * A @\<^sub>c P * B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P * (A @\<^sub>c B) = P * A @\<^sub>c P * B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_nat_plus_one_less_card: "\<forall>a. a+1 \<noteq> 0 --> to_nat a + 1 < CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. a + (1::'a) \<noteq> (0::'a) \<longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
proof (clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a + (1::'a) \<noteq> (0::'a) \<Longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. a + (1::'a) \<noteq> (0::'a) \<Longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
assume a: "a + 1 \<noteq> 0"
[PROOF STATE]
proof (state)
this:
a + (1::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>a. a + (1::'a) \<noteq> (0::'a) \<Longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
have "Rep a + 1 < int CARD('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep a + 1 < int CARD('a)
[PROOF STEP]
using Rep_plus_one_le_card[OF a]
[PROOF STATE]
proof (prove)
using this:
Rep a + 1 < int CARD('a)

goal (1 subgoal):
 1. Rep a + 1 < int CARD('a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Rep a + 1 < int CARD('a)

goal (1 subgoal):
 1. \<And>a. a + (1::'a) \<noteq> (0::'a) \<Longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
hence "nat (Rep a + 1) < nat (int CARD('a))"
[PROOF STATE]
proof (prove)
using this:
Rep a + 1 < int CARD('a)

goal (1 subgoal):
 1. nat (Rep a + 1) < nat (int CARD('a))
[PROOF STEP]
unfolding zless_nat_conj
[PROOF STATE]
proof (prove)
using this:
Rep a + 1 < int CARD('a)

goal (1 subgoal):
 1. 0 < int CARD('a) \<and> Rep a + 1 < int CARD('a)
[PROOF STEP]
using size0
[PROOF STATE]
proof (prove)
using this:
Rep a + 1 < int CARD('a)
0 < int CARD('a)

goal (1 subgoal):
 1. 0 < int CARD('a) \<and> Rep a + 1 < int CARD('a)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
nat (Rep a + 1) < nat (int CARD('a))

goal (1 subgoal):
 1. \<And>a. a + (1::'a) \<noteq> (0::'a) \<Longrightarrow> mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
thus "to_nat a + 1 < CARD('a)"
[PROOF STATE]
proof (prove)
using this:
nat (Rep a + 1) < nat (int CARD('a))

goal (1 subgoal):
 1. mod_type_class.to_nat a + 1 < CARD('a)
[PROOF STEP]
unfolding to_nat_def o_def
[PROOF STATE]
proof (prove)
using this:
nat (Rep a + 1) < nat (int CARD('a))

goal (1 subgoal):
 1. nat (Rep a) + 1 < CARD('a)
[PROOF STEP]
using nat_add_distrib[OF Rep_ge_0]
[PROOF STATE]
proof (prove)
using this:
nat (Rep a + 1) < nat (int CARD('a))
0 \<le> ?z' \<Longrightarrow> nat (Rep ?x1 + ?z') = nat (Rep ?x1) + nat ?z'

goal (1 subgoal):
 1. nat (Rep a) + 1 < CARD('a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a + 1 < CARD('a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_holo:
  assumes ab: "min a b > 0" "max a b < 1"
  shows "(\<lambda>z. LBINT u=ereal a..ereal b. f z u) holomorphic_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
proof (cases "a \<le> b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
 2. \<not> a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
 2. \<not> a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
using assms integral_holo_aux[of a b]
[PROOF STATE]
proof (prove)
using this:
a \<le> b
0 < min a b
max a b < 1
\<lbrakk>0 < a; a \<le> b; b < 1\<rbrakk> \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on ?A

goal (1 subgoal):
 1. (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> a \<le> b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
have "(\<lambda>z. -(LBINT u=ereal b..ereal a. f z u)) holomorphic_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. - complex_interval_lebesgue_integral lborel (ereal b) (ereal a) (f z)) holomorphic_on A
[PROOF STEP]
using False assms
[PROOF STATE]
proof (prove)
using this:
\<not> a \<le> b
0 < min a b
max a b < 1

goal (1 subgoal):
 1. (\<lambda>z. - complex_interval_lebesgue_integral lborel (ereal b) (ereal a) (f z)) holomorphic_on A
[PROOF STEP]
by (intro holomorphic_intros integral_holo_aux) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>z. - complex_interval_lebesgue_integral lborel (ereal b) (ereal a) (f z)) holomorphic_on A

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>z. - complex_interval_lebesgue_integral lborel (ereal b) (ereal a) (f z)) holomorphic_on A

goal (1 subgoal):
 1. (\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A
[PROOF STEP]
by (subst interval_integral_endpoints_reverse)
[PROOF STATE]
proof (state)
this:
(\<lambda>z. complex_interval_lebesgue_integral lborel (ereal a) (ereal b) (f z)) holomorphic_on A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bi_unique_rel_converter [transfer_rule]:
  "\<lbrakk> bi_total A; bi_unique B; bi_unique C; bi_total R \<rbrakk> \<Longrightarrow> bi_unique (rel_converter A B C R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bi_total A; bi_unique B; bi_unique C; bi_total R\<rbrakk> \<Longrightarrow> bi_unique (rel_converter A B C R)
[PROOF STEP]
unfolding bi_unique_alt_def bi_total_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>left_total A \<and> right_total A; left_unique B \<and> right_unique B; left_unique C \<and> right_unique C; left_total R \<and> right_total R\<rbrakk> \<Longrightarrow> left_unique (rel_converter A B C R) \<and> right_unique (rel_converter A B C R)
[PROOF STEP]
by(blast intro: left_unique_rel_converter right_unique_rel_converter)


[STATEMENT]
lemma proj_poly_syz_sum: "proj_poly_syz n (sum f A) = (\<Sum>a\<in>A. proj_poly_syz n (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly_syz n (sum f A) = (\<Sum>a\<in>A. proj_poly_syz n (f a))
[PROOF STEP]
by (rule fun_sum_commute, simp_all add: proj_poly_syz_plus)


[STATEMENT]
lemma prod_rel_mono[relator_props]:
"\<lbrakk> R2\<subseteq>R1; R3\<subseteq>R4 \<rbrakk> \<Longrightarrow> \<langle>R2,R3\<rangle>prod_rel \<subseteq> \<langle>R1,R4\<rangle>prod_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R2 \<subseteq> R1; R3 \<subseteq> R4\<rbrakk> \<Longrightarrow> R2 \<times>\<^sub>r R3 \<subseteq> R1 \<times>\<^sub>r R4
[PROOF STEP]
by (auto simp: prod_rel_def)


[STATEMENT]
lemma LIM_zero_iff: "((\<lambda>x. f x - l) \<longlongrightarrow> 0) F = (f \<longlongrightarrow> l) F"
  for f :: "'a \<Rightarrow> 'b::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x - l) \<longlongrightarrow> (0::'b)) F = (f \<longlongrightarrow> l) F
[PROOF STEP]
unfolding tendsto_iff dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>e>0. \<forall>\<^sub>F x in F. norm (f x - l - (0::'b)) < e) = (\<forall>e>0. \<forall>\<^sub>F x in F. norm (f x - l) < e)
[PROOF STEP]
by simp


[STATEMENT]
lemma proots_count_pCons_1_iff:
  fixes a::"'a::idom"
  shows "proots_count [:-a,1:] s = (if a\<in>s then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count [:- a, 1::'a:] s = (if a \<in> s then 1 else 0)
[PROOF STEP]
unfolding proots_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r\<in>proots_within [:- a, 1::'a:] s. order r [:- a, 1::'a:]) = (if a \<in> s then 1 else 0)
[PROOF STEP]
by (cases "a\<in>s",auto simp add:proots_within_pCons_1_iff order_power_n_n[of _ 1,simplified])


[STATEMENT]
lemma Im_rcis [simp]: "Im(rcis r a) = r * sin a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (rcis r a) = r * sin a
[PROOF STEP]
by (simp add: rcis_def)


[STATEMENT]
lemma E_finite_sum: "finite (set_pmf X) \<Longrightarrow> E X = (\<Sum>x\<in>(set_pmf X). pmf X x * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> E X = (\<Sum>x\<in>set_pmf X. pmf X x * x)
[PROOF STEP]
unfolding E_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set_pmf X) \<Longrightarrow> measure_pmf.expectation X (\<lambda>x. x) = (\<Sum>x\<in>set_pmf X. pmf X x * x)
[PROOF STEP]
by (subst integral_measure_pmf) simp_all


[STATEMENT]
lemma monom_mult_sum_left: "monom_mult (sum f C) t p = (\<Sum>c\<in>C. monom_mult (f c) t p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom_mult (sum f C) t p = (\<Sum>c\<in>C. monom_mult (f c) t p)
[PROOF STEP]
by (rule fun_sum_commute, simp_all add: monom_mult_dist_left)


[STATEMENT]
lemma dupe_monic_unique: fixes D :: "'a ::  {factorial_ring_gcd,semiring_gcd_mult_normalize} poly"
  assumes 1: "D*S + H*T = 1"
  and mon: "monic D"
  and dupe: "dupe_monic D H S T U = (A,B)"
  and cop: "coprime D H"
  and other: "A' * D + B' * H = U" "B' = 0 \<or> degree B' < degree D"
shows "A' = A" "B' = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A' = A &&& B' = B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A' = A
 2. B' = B
[PROOF STEP]
from dupe_monic[OF 1 mon dupe]
[PROOF STATE]
proof (chain)
picking this:
A * D + B * H = U
B = 0 \<or> degree B < degree D
[PROOF STEP]
have one: "A * D + B * H = U" "B = 0 \<or> degree B < degree D"
[PROOF STATE]
proof (prove)
using this:
A * D + B * H = U
B = 0 \<or> degree B < degree D

goal (1 subgoal):
 1. A * D + B * H = U &&& B = 0 \<or> degree B < degree D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * D + B * H = U
B = 0 \<or> degree B < degree D

goal (2 subgoals):
 1. A' = A
 2. B' = B
[PROOF STEP]
from mon
[PROOF STATE]
proof (chain)
picking this:
monic D
[PROOF STEP]
have D0: "D \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
monic D

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

goal (2 subgoals):
 1. A' = A
 2. B' = B
[PROOF STEP]
from uniqueness_poly_equality[OF cop one(2) other(2) D0, of A A', unfolded other, OF one(1)]
[PROOF STATE]
proof (chain)
picking this:
A = A'
B = B'
[PROOF STEP]
show "A' = A" "B' = B"
[PROOF STATE]
proof (prove)
using this:
A = A'
B = B'

goal (1 subgoal):
 1. A' = A &&& B' = B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A' = A
B' = B

goal:
No subgoals!
[PROOF STEP]
qed