[STATEMENT]
lemma affine_hull_insert_span:
  assumes "a \<notin> S"
  shows "affine hull (insert a S) = {a + v | v . v \<in> span {x - a | x.  x \<in> S}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull insert a S = {a + v |v. v \<in> span {x - a |x. x \<in> S}}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. affine hull insert a S = {a + v |v. v \<in> span {x - a |x. x \<in> S}}
[PROOF STEP]
have *: "\<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y"
    if "v \<in> span {x - a |x. x \<in> S}" "y = a + v" for y v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
v \<in> span {x - a |x. x \<in> S}
y = a + v
[PROOF STEP]
obtain T u where u: "finite T" "T \<subseteq> {x - a |x. x \<in> S}" "a + (\<Sum>v\<in>T. u v *\<^sub>R v) = y"
[PROOF STATE]
proof (prove)
using this:
v \<in> span {x - a |x. x \<in> S}
y = a + v

goal (1 subgoal):
 1. (\<And>T u. \<lbrakk>finite T; T \<subseteq> {x - a |x. x \<in> S}; a + (\<Sum>v\<in>T. u v *\<^sub>R v) = y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding span_explicit
[PROOF STATE]
proof (prove)
using this:
v \<in> {\<Sum>a\<in>t. r a *\<^sub>R a |t r. finite t \<and> t \<subseteq> {x - a |x. x \<in> S}}
y = a + v

goal (1 subgoal):
 1. (\<And>T u. \<lbrakk>finite T; T \<subseteq> {x - a |x. x \<in> S}; a + (\<Sum>v\<in>T. u v *\<^sub>R v) = y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite T
T \<subseteq> {x - a |x. x \<in> S}
a + (\<Sum>v\<in>T. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
define F where "F = (\<lambda>x. x + a) ` T"
[PROOF STATE]
proof (state)
this:
F = (\<lambda>x. x + a) ` T

goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
have F: "finite F" "F \<subseteq> S" "(\<Sum>v\<in>F. u (v - a) *\<^sub>R (v - a)) = y - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite F &&& F \<subseteq> S &&& (\<Sum>v\<in>F. u (v - a) *\<^sub>R (v - a)) = y - a
[PROOF STEP]
unfolding F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>x. x + a) ` T) &&& (\<lambda>x. x + a) ` T \<subseteq> S &&& (\<Sum>v\<in>(\<lambda>x. x + a) ` T. u (v - a) *\<^sub>R (v - a)) = y - a
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
finite T
T \<subseteq> {x - a |x. x \<in> S}
a + (\<Sum>v\<in>T. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. finite ((\<lambda>x. x + a) ` T) &&& (\<lambda>x. x + a) ` T \<subseteq> S &&& (\<Sum>v\<in>(\<lambda>x. x + a) ` T. u (v - a) *\<^sub>R (v - a)) = y - a
[PROOF STEP]
by (auto simp: sum.reindex[unfolded inj_on_def])
[PROOF STATE]
proof (state)
this:
finite F
F \<subseteq> S
(\<Sum>v\<in>F. u (v - a) *\<^sub>R (v - a)) = y - a

goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
have *: "F \<inter> {a} = {}" "F \<inter> - {a} = F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<inter> {a} = {} &&& F \<inter> - {a} = F
[PROOF STEP]
using F assms
[PROOF STATE]
proof (prove)
using this:
finite F
F \<subseteq> S
(\<Sum>v\<in>F. u (v - a) *\<^sub>R (v - a)) = y - a
a \<notin> S

goal (1 subgoal):
 1. F \<inter> {a} = {} &&& F \<inter> - {a} = F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F \<inter> {a} = {}
F \<inter> - {a} = F

goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
show "\<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y
[PROOF STEP]
apply (rule_tac x = "insert a F" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. finite (insert a F) \<and> insert a F \<noteq> {} \<and> insert a F \<subseteq> insert a S \<and> sum u (insert a F) = 1 \<and> (\<Sum>v\<in>insert a F. u v *\<^sub>R v) = y
[PROOF STEP]
apply (rule_tac x = "\<lambda>x. if x=a then 1 - sum (\<lambda>x. u (x - a)) F else u (x - a)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (insert a F) \<and> insert a F \<noteq> {} \<and> insert a F \<subseteq> insert a S \<and> (\<Sum>x\<in>insert a F. if x = a then 1 - (\<Sum>x\<in>F. u (x - a)) else u (x - a)) = 1 \<and> (\<Sum>v\<in>insert a F. (if v = a then 1 - (\<Sum>x\<in>F. u (x - a)) else u (v - a)) *\<^sub>R v) = y
[PROOF STEP]
using assms F
[PROOF STATE]
proof (prove)
using this:
a \<notin> S
finite F
F \<subseteq> S
(\<Sum>v\<in>F. u (v - a) *\<^sub>R (v - a)) = y - a

goal (1 subgoal):
 1. finite (insert a F) \<and> insert a F \<noteq> {} \<and> insert a F \<subseteq> insert a S \<and> (\<Sum>x\<in>insert a F. if x = a then 1 - (\<Sum>x\<in>F. u (x - a)) else u (x - a)) = 1 \<and> (\<Sum>v\<in>insert a F. (if v = a then 1 - (\<Sum>x\<in>F. u (x - a)) else u (v - a)) *\<^sub>R v) = y
[PROOF STEP]
apply (auto simp:  sum_clauses sum.If_cases if_smult sum_subtractf scaleR_left.sum algebra_simps *)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?v \<in> span {x - a |x. x \<in> S}; ?y = a + ?v\<rbrakk> \<Longrightarrow> \<exists>G u. finite G \<and> G \<noteq> {} \<and> G \<subseteq> insert a S \<and> sum u G = 1 \<and> (\<Sum>v\<in>G. u v *\<^sub>R v) = ?y

goal (1 subgoal):
 1. affine hull insert a S = {a + v |v. v \<in> span {x - a |x. x \<in> S}}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull insert a S = {a + v |v. v \<in> span {x - a |x. x \<in> S}}
[PROOF STEP]
by (intro subset_antisym affine_hull_insert_subset_span) (auto simp: affine_hull_explicit dest!: *)
[PROOF STATE]
proof (state)
this:
affine hull insert a S = {a + v |v. v \<in> span {x - a |x. x \<in> S}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exact_decompI:
  "(\<And>h U. (h, U) \<in> set ps \<Longrightarrow> h \<in> P[X]) \<Longrightarrow> (\<And>h U. (h, U) \<in> set ps \<Longrightarrow> U \<subseteq> X) \<Longrightarrow>
    (\<And>h h' U U'. (h, U) \<in> set ps \<Longrightarrow> (h', U') \<in> set ps \<Longrightarrow> poly_deg h = poly_deg h' \<Longrightarrow>
            m < card U \<Longrightarrow> m < card U' \<Longrightarrow> (h, U) = (h', U')) \<Longrightarrow>
    exact_decomp m ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>h U. (h, U) \<in> set ps \<Longrightarrow> h \<in> P[X]; \<And>h U. (h, U) \<in> set ps \<Longrightarrow> U \<subseteq> X; \<And>h h' U U'. \<lbrakk>(h, U) \<in> set ps; (h', U') \<in> set ps; poly_deg h = poly_deg h'; m < card U; m < card U'\<rbrakk> \<Longrightarrow> (h, U) = (h', U')\<rbrakk> \<Longrightarrow> exact_decomp m ps
[PROOF STEP]
unfolding exact_decomp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>h U. (h, U) \<in> set ps \<Longrightarrow> h \<in> P[X]; \<And>h U. (h, U) \<in> set ps \<Longrightarrow> U \<subseteq> X; \<And>h h' U U'. \<lbrakk>(h, U) \<in> set ps; (h', U') \<in> set ps; poly_deg h = poly_deg h'; m < card U; m < card U'\<rbrakk> \<Longrightarrow> (h, U) = (h', U')\<rbrakk> \<Longrightarrow> (\<forall>(h, U)\<in>set ps. h \<in> P[X] \<and> U \<subseteq> X) \<and> (\<forall>(h, U)\<in>set ps. \<forall>(h', U')\<in>set ps. poly_deg h = poly_deg h' \<longrightarrow> m < card U \<longrightarrow> m < card U' \<longrightarrow> (h, U) = (h', U'))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma freshVarI2: "finite A ==> !x . x ~: A --> P x ==> P (freshVar A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; \<forall>x. x \<notin> A \<longrightarrow> P x\<rbrakk> \<Longrightarrow> P (freshVar A)
[PROOF STEP]
apply(auto dest!: finiteFreshVar)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma string_of_nat_bij: "bij string_of_nat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij string_of_nat
[PROOF STEP]
unfolding string_of_nat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (inv nat_of_string)
[PROOF STEP]
using nat_of_string_bij bij_betw_inv_into
[PROOF STATE]
proof (prove)
using this:
bij nat_of_string
bij_betw ?f ?A ?B \<Longrightarrow> bij_betw (inv_into ?A ?f) ?B ?A

goal (1 subgoal):
 1. bij (inv nat_of_string)
[PROOF STEP]
by auto


[STATEMENT]
lemma poincare_line_cvec_cmat_nonzero [simp]:
  assumes "z \<noteq> vec_zero" "w \<noteq> vec_zero"
  shows  "poincare_line_cvec_cmat z w \<noteq> mat_zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
obtain z1 z2 w1 w2 where *: "z = (z1, z2)" "w = (w1, w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z1 z2 w1 w2. \<lbrakk>z = (z1, z2); w = (w1, w2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases z, cases w, auto)
[PROOF STATE]
proof (state)
this:
z = (z1, z2)
w = (w1, w2)

goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
let ?den = "z1*cnj z2*cnj w1*w2 - w1*cnj w2*cnj z1*z2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
proof (cases "?den \<noteq> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
 2. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0

goal (2 subgoals):
 1. z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
 2. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
have "is_real (\<i> * ?den)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2))
[PROOF STEP]
using eq_cnj_iff_real[of "\<i> *?den"]
[PROOF STATE]
proof (prove)
using this:
(cnj (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) = \<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) = is_real (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2))

goal (1 subgoal):
 1. is_real (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
is_real (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2))

goal (2 subgoals):
 1. z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
 2. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
hence "Re (\<i> * ?den) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
is_real (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2))

goal (1 subgoal):
 1. Re (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) \<noteq> 0
[PROOF STEP]
using \<open>?den \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
is_real (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2))
z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0

goal (1 subgoal):
 1. Re (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) \<noteq> 0
[PROOF STEP]
by (metis complex_i_not_zero complex_surj mult_eq_0_iff zero_complex.code)
[PROOF STATE]
proof (state)
this:
Re (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) \<noteq> 0

goal (2 subgoals):
 1. z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
 2. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) \<noteq> 0

goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
using * \<open>?den \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
Re (\<i> * (z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2)) \<noteq> 0
z = (z1, z2)
w = (w1, w2)
z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0

goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
by (simp del: mk_poincare_line_cmat_def mat_zero_def add: mk_poincare_line_cmat_zero_iff)
[PROOF STATE]
proof (state)
this:
poincare_line_cvec_cmat z w \<noteq> mat_zero

goal (1 subgoal):
 1. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0

goal (1 subgoal):
 1. \<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0 \<Longrightarrow> poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0

goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<not> z1 * cnj z2 * cnj w1 * w2 - w1 * cnj w2 * cnj z1 * z2 \<noteq> 0
z = (z1, z2)
w = (w1, w2)

goal (1 subgoal):
 1. poincare_line_cvec_cmat z w \<noteq> mat_zero
[PROOF STEP]
by (simp del: mk_poincare_line_cmat_def mat_zero_def add: mk_poincare_line_cmat_zero_iff)
[PROOF STATE]
proof (state)
this:
poincare_line_cvec_cmat z w \<noteq> mat_zero

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poincare_line_cvec_cmat z w \<noteq> mat_zero

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_onb_some_chilbert_basis[simp]: \<open>is_onb (some_chilbert_basis :: 'a::chilbert_space set)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_onb some_chilbert_basis
[PROOF STEP]
using orthonormal_basis_exists[OF is_ortho_set_empty]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> {} \<Longrightarrow> norm x = 1) \<Longrightarrow> \<exists>B. {} \<subseteq> B \<and> is_onb B

goal (1 subgoal):
 1. is_onb some_chilbert_basis
[PROOF STEP]
by (auto simp add: some_chilbert_basis_def intro: someI2)


[STATEMENT]
lemma cnf_to_bool_append: "cnf_to_bool \<gamma> (a1 @ a2) \<longleftrightarrow> cnf_to_bool \<gamma> a1 \<and> cnf_to_bool \<gamma> a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf_to_bool \<gamma> (a1 @ a2) = (cnf_to_bool \<gamma> a1 \<and> cnf_to_bool \<gamma> a2)
[PROOF STEP]
by(induction \<gamma> a1 rule: cnf_to_bool.induct) (simp_all)


[STATEMENT]
lemma Show_nat_not_empty: \<open>(Show\<^sub>n\<^sub>a\<^sub>t n) \<noteq> []\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Show\<^sub>n\<^sub>a\<^sub>t n \<noteq> []
[PROOF STEP]
by (simp add: Show\<^sub>n\<^sub>a\<^sub>t_def nat_explode_not_empty)


[STATEMENT]
lemma eval_fds_prod:
  fixes s :: "'a :: {nat_power, real_normed_field, banach, second_countable_topology}"
  assumes "(\<And>x. x \<in> A \<Longrightarrow> fds_abs_converges (f x) s)"
  shows "eval_fds (prod f A) s = (\<Prod>x\<in>A. eval_fds (f x) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (prod f A) s = (\<Prod>x\<in>A. eval_fds (f x) s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> fds_abs_converges (f ?x) s

goal (1 subgoal):
 1. eval_fds (prod f A) s = (\<Prod>x\<in>A. eval_fds (f x) s)
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto simp: eval_fds_mult fds_abs_converges_prod)


[STATEMENT]
theorem divisibility_alpha:
  assumes "b>2" and "k>0"
    shows "\<alpha> b k dvd \<alpha> b m \<longleftrightarrow> k dvd m" (is "?P \<longleftrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<alpha> b k dvd \<alpha> b m) = (k dvd m)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
 2. k dvd m \<Longrightarrow> \<alpha> b k dvd \<alpha> b m
[PROOF STEP]
assume Q: "?Q"
[PROOF STATE]
proof (state)
this:
k dvd m

goal (2 subgoals):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
 2. k dvd m \<Longrightarrow> \<alpha> b k dvd \<alpha> b m
[PROOF STEP]
define n where "n = m mod k"
[PROOF STATE]
proof (state)
this:
n = m mod k

goal (2 subgoals):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
 2. k dvd m \<Longrightarrow> \<alpha> b k dvd \<alpha> b m
[PROOF STEP]
have N: "n=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 0
[PROOF STEP]
by (simp add: Q n_def)
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
 2. k dvd m \<Longrightarrow> \<alpha> b k dvd \<alpha> b m
[PROOF STEP]
from N
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
have Abn: "\<alpha> b n = 0"
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. \<alpha> b n = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> b n = 0

goal (2 subgoals):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
 2. k dvd m \<Longrightarrow> \<alpha> b k dvd \<alpha> b m
[PROOF STEP]
from Abn divisibility_lemma1 assms(1) assms(2) mult_eq_0_iff n_def
[PROOF STATE]
proof (chain)
picking this:
\<alpha> b n = 0
\<lbrakk>2 < ?b; 0 < ?k\<rbrakk> \<Longrightarrow> \<alpha> ?b ?m mod \<alpha> ?b ?k = \<alpha> ?b (?m mod ?k) * \<alpha> ?b (?k + 1) ^ ((?m - ?m mod ?k) div ?k) mod \<alpha> ?b ?k
2 < b
0 < k
(?a * ?b = (0::?'a)) = (?a = (0::?'a) \<or> ?b = (0::?'a))
n = m mod k
[PROOF STEP]
show "?P"
[PROOF STATE]
proof (prove)
using this:
\<alpha> b n = 0
\<lbrakk>2 < ?b; 0 < ?k\<rbrakk> \<Longrightarrow> \<alpha> ?b ?m mod \<alpha> ?b ?k = \<alpha> ?b (?m mod ?k) * \<alpha> ?b (?k + 1) ^ ((?m - ?m mod ?k) div ?k) mod \<alpha> ?b ?k
2 < b
0 < k
(?a * ?b = (0::?'a)) = (?a = (0::?'a) \<or> ?b = (0::?'a))
n = m mod k

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m
[PROOF STEP]
by (metis dvd_0_right dvd_imp_mod_0 mod_0_imp_dvd)
[PROOF STATE]
proof (state)
this:
\<alpha> b k dvd \<alpha> b m

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
assume P: "?P"
[PROOF STATE]
proof (state)
this:
\<alpha> b k dvd \<alpha> b m

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
define n where "n = m mod k"
[PROOF STATE]
proof (state)
this:
n = m mod k

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
define l where "l = (m-n) div k"
[PROOF STATE]
proof (state)
this:
l = (m - n) div k

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
define B where "B = (mat (int b) (-1) 1 0)"
[PROOF STATE]
proof (state)
this:
B = mat (int b) (- 1) 1 0

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
have S1: "(\<alpha> b n) mod (\<alpha> b k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> b n mod \<alpha> b k = 0
[PROOF STEP]
using divisibility_lemma2 assms(1) assms(2) n_def P
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 < ?b; 0 < ?k; \<alpha> ?b ?k dvd \<alpha> ?b ?m\<rbrakk> \<Longrightarrow> \<alpha> ?b ?k dvd \<alpha> ?b (?m mod ?k)
2 < b
0 < k
n = m mod k
\<alpha> b k dvd \<alpha> b m

goal (1 subgoal):
 1. \<alpha> b n mod \<alpha> b k = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> b n mod \<alpha> b k = 0

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
from n_def assms(2)
[PROOF STATE]
proof (chain)
picking this:
n = m mod k
0 < k
[PROOF STEP]
have m: "n < k"
[PROOF STATE]
proof (prove)
using this:
n = m mod k
0 < k

goal (1 subgoal):
 1. n < k
[PROOF STEP]
using mod_less_divisor
[PROOF STATE]
proof (prove)
using this:
n = m mod k
0 < k
0 < ?n \<Longrightarrow> ?m mod ?n < ?n

goal (1 subgoal):
 1. n < k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n < k

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
from alpha_strictly_increasing m assms(1)
[PROOF STATE]
proof (chain)
picking this:
2 \<le> int ?b \<Longrightarrow> \<alpha> ?b ?n < \<alpha> ?b (Suc ?n) \<and> 0 < \<alpha> ?b (Suc ?n)
n < k
2 < b
[PROOF STEP]
have S2: "\<alpha> b n < \<alpha> b k"
[PROOF STATE]
proof (prove)
using this:
2 \<le> int ?b \<Longrightarrow> \<alpha> ?b ?n < \<alpha> ?b (Suc ?n) \<and> 0 < \<alpha> ?b (Suc ?n)
n < k
2 < b

goal (1 subgoal):
 1. \<alpha> b n < \<alpha> b k
[PROOF STEP]
by (smt less_imp_of_nat_less lift_Suc_mono_less of_nat_0_less_iff pos2)
[PROOF STATE]
proof (state)
this:
\<alpha> b n < \<alpha> b k

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
\<alpha> b n mod \<alpha> b k = 0
\<alpha> b n < \<alpha> b k
[PROOF STEP]
have S3: "n=0"
[PROOF STATE]
proof (prove)
using this:
\<alpha> b n mod \<alpha> b k = 0
\<alpha> b n < \<alpha> b k

goal (1 subgoal):
 1. n = 0
[PROOF STEP]
by (smt alpha_superlinear assms(1) mod_pos_pos_trivial neq0_conv of_nat_0_less_iff)
[PROOF STATE]
proof (state)
this:
n = 0

goal (1 subgoal):
 1. \<alpha> b k dvd \<alpha> b m \<Longrightarrow> k dvd m
[PROOF STEP]
from S3 n_def
[PROOF STATE]
proof (chain)
picking this:
n = 0
n = m mod k
[PROOF STEP]
show "?Q"
[PROOF STATE]
proof (prove)
using this:
n = 0
n = m mod k

goal (1 subgoal):
 1. k dvd m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k dvd m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_insert: "size (insert x t) = (if isin t x then size t else Suc (size t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (local.insert x t) = (if isin t x then size t else Suc (size t))
[PROOF STEP]
by (induction t rule: tree2_induct) (auto simp: not_Leaf_if_not_balanced1)


[STATEMENT]
lemma filter_union_mset [simp]: "filter_mset P (M + N) = filter_mset P M + filter_mset P N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P (M + N) = filter_mset P M + filter_mset P N
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma l_inv [simp]: "x \<in> carrier R \<Longrightarrow> x \<noteq> \<zero> \<Longrightarrow> inv x \<otimes> x = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> inv x \<otimes> x = \<one>
[PROOF STEP]
by (simp add: field_Units)


[STATEMENT]
lemma card_fset_Suc:
  shows "card_fset S = Suc n \<Longrightarrow> \<exists>x T. x |\<notin>| T \<and> S = insert_fset x T \<and> card_fset T = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card_fset S = Suc n \<Longrightarrow> \<exists>x T. x |\<notin>| T \<and> S = insert_fset x T \<and> card_fset T = n
[PROOF STEP]
apply(descending)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S n. card_list S = Suc n \<Longrightarrow> \<exists>x T. \<not> List.member T x \<and> S \<approx> x # T \<and> card_list T = n
[PROOF STEP]
apply(auto dest!: card_eq_SucD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S b B. \<lbrakk>set S = insert b B; b \<notin> B; 0 < card B\<rbrakk> \<Longrightarrow> \<exists>x T. x \<notin> set T \<and> insert b B = insert x (set T) \<and> card (set T) = card B
[PROOF STEP]
by (metis Diff_insert_absorb set_removeAll)


[STATEMENT]
lemma poly_compose_mult:
  assumes "is_poly_tuple m fs"
  assumes "length fs = n"
  assumes "f \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  assumes "g \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  shows "poly_compose n m fs (f \<otimes>\<^bsub>R[\<X>\<^bsub>n\<^esub>]\<^esub> g) = (poly_compose n m fs f) \<otimes>\<^bsub>coord_ring R m\<^esub>  (poly_compose n m fs g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_compose n m fs (f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> g) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> poly_compose n m fs g
[PROOF STEP]
using assms poly_compose_ring_hom ring_hom_mult
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple m fs
length fs = n
f \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
g \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
\<lbrakk>is_poly_tuple ?m ?fs; length ?fs = ?n\<rbrakk> \<Longrightarrow> ring_hom_ring (R [\<X>\<^bsub>?n\<^esub>]) (R [\<X>\<^bsub>?m\<^esub>]) (poly_compose ?n ?m ?fs)
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?R\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. poly_compose n m fs (f \<otimes>\<^bsub>R [\<X>\<^bsub>n\<^esub>]\<^esub> g) = poly_compose n m fs f \<otimes>\<^bsub>R [\<X>\<^bsub>m\<^esub>]\<^esub> poly_compose n m fs g
[PROOF STEP]
by (metis (mono_tags, lifting) ring_hom_ring.homh)


[STATEMENT]
lemma line_in_open_segment_iff[simp]:
  "line a b i \<in> {a<--<b} \<longleftrightarrow> (a \<noteq> b \<and> 0 < i \<and> i < 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a -- b}\<^bsub>i\<^esub> \<in> {a<--<b}) = (a \<noteq> b \<and> 0 < i \<and> i < 1)
[PROOF STEP]
by (auto simp: in_open_segment_iff_line)


[STATEMENT]
lemma invar_NodeR2:
  "\<lbrakk> invar(Node l (x, n) r); sngl r'; n = lvl r + 1; invar r'; lvl r' = n \<rbrakk> \<Longrightarrow> invar(Node l (x, n) r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar \<langle>l, (x, n), r\<rangle>; sngl r'; n = lvl r + 1; invar r'; lvl r' = n\<rbrakk> \<Longrightarrow> invar \<langle>l, (x, n), r'\<rangle>
[PROOF STEP]
by(cases r' rule: sngl.cases) clarsimp+


[STATEMENT]
lemma hypnat_gt_zero_iff2: "0 < n \<longleftrightarrow> (\<exists>m. n = m + 1)" for n :: hypnat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < n) = (\<exists>m. n = m + 1)
[PROOF STEP]
by (auto intro!: add_nonneg_pos exI[of _ "n - 1"] simp: hypnat_gt_zero_iff)


[STATEMENT]
lemma infinite_int_iff_infinite_nat_abs: "infinite S \<longleftrightarrow> infinite ((nat \<circ> abs) ` S)"
  for S :: "int set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite S = infinite ((nat \<circ> abs) ` S)
[PROOF STEP]
proof (unfold Not_eq_iff, rule iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
 2. finite ((nat \<circ> abs) ` S) \<Longrightarrow> finite S
[PROOF STEP]
assume "finite ((nat \<circ> abs) ` S)"
[PROOF STATE]
proof (state)
this:
finite ((nat \<circ> abs) ` S)

goal (2 subgoals):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
 2. finite ((nat \<circ> abs) ` S) \<Longrightarrow> finite S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite ((nat \<circ> abs) ` S)
[PROOF STEP]
have "finite (nat ` (abs ` S))"
[PROOF STATE]
proof (prove)
using this:
finite ((nat \<circ> abs) ` S)

goal (1 subgoal):
 1. finite (nat ` abs ` S)
[PROOF STEP]
by (simp add: image_image cong: image_cong)
[PROOF STATE]
proof (state)
this:
finite (nat ` abs ` S)

goal (2 subgoals):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
 2. finite ((nat \<circ> abs) ` S) \<Longrightarrow> finite S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (nat ` abs ` S)

goal (2 subgoals):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
 2. finite ((nat \<circ> abs) ` S) \<Longrightarrow> finite S
[PROOF STEP]
have "inj_on nat (abs ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on nat (abs ` S)
[PROOF STEP]
by (rule inj_onI) auto
[PROOF STATE]
proof (state)
this:
inj_on nat (abs ` S)

goal (2 subgoals):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
 2. finite ((nat \<circ> abs) ` S) \<Longrightarrow> finite S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (nat ` abs ` S)
inj_on nat (abs ` S)
[PROOF STEP]
have "finite (abs ` S)"
[PROOF STATE]
proof (prove)
using this:
finite (nat ` abs ` S)
inj_on nat (abs ` S)

goal (1 subgoal):
 1. finite (abs ` S)
[PROOF STEP]
by (rule finite_imageD)
[PROOF STATE]
proof (state)
this:
finite (abs ` S)

goal (2 subgoals):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
 2. finite ((nat \<circ> abs) ` S) \<Longrightarrow> finite S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (abs ` S)
[PROOF STEP]
show "finite S"
[PROOF STATE]
proof (prove)
using this:
finite (abs ` S)

goal (1 subgoal):
 1. finite S
[PROOF STEP]
by (rule finite_image_absD)
[PROOF STATE]
proof (state)
this:
finite S

goal (1 subgoal):
 1. finite S \<Longrightarrow> finite ((nat \<circ> abs) ` S)
[PROOF STEP]
qed simp


[STATEMENT]
lemma groupWIs_complete: "(\<Union>x\<in> set (groupWIs c rs). wordinterval_list_to_set x) = (UNIV::'i::len word set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (wordinterval_list_to_set ` set (groupWIs c rs)) = UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (wordinterval_list_to_set ` set (groupWIs c rs)) = UNIV
[PROOF STEP]
have "(\<Union> y \<in> (\<Union>x\<in> set (groupWIs c rs). set x). wordinterval_to_set y) = (UNIV::'i word set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (wordinterval_to_set ` \<Union> (set ` set (groupWIs c rs))) = UNIV
[PROOF STEP]
apply(simp add: groupWIs_def Let_def groupF_Union_set)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (wordinterval_to_set ` set (getParts rs)) = UNIV
[PROOF STEP]
using getParts_complete wordinterval_list_to_set_def
[PROOF STATE]
proof (prove)
using this:
wordinterval_list_to_set (getParts ?rs) = UNIV
wordinterval_list_to_set ?ws = \<Union> (set (map wordinterval_to_set ?ws))

goal (1 subgoal):
 1. \<Union> (wordinterval_to_set ` set (getParts rs)) = UNIV
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<Union> (wordinterval_to_set ` \<Union> (set ` set (groupWIs c rs))) = UNIV

goal (1 subgoal):
 1. \<Union> (wordinterval_list_to_set ` set (groupWIs c rs)) = UNIV
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (wordinterval_to_set ` \<Union> (set ` set (groupWIs c rs))) = UNIV

goal (1 subgoal):
 1. \<Union> (wordinterval_list_to_set ` set (groupWIs c rs)) = UNIV
[PROOF STEP]
by(simp add: wordinterval_list_to_set_def)
[PROOF STATE]
proof (state)
this:
\<Union> (wordinterval_list_to_set ` set (groupWIs c rs)) = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma differentiable_image_in_sets_lebesgue:
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  assumes S: "S \<in> sets lebesgue" and dim: "DIM('m) \<le> DIM('n)" and f: "f differentiable_on S"
  shows "f`S \<in> sets lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` S \<in> sets lebesgue
[PROOF STEP]
proof (rule sets_lebesgue_continuous_image [OF S])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on ?S f
 2. \<And>T. \<lbrakk>negligible T; T \<subseteq> ?S\<rbrakk> \<Longrightarrow> negligible (f ` T)
 3. S \<subseteq> ?S
[PROOF STEP]
show "continuous_on S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
by (meson differentiable_imp_continuous_on f)
[PROOF STATE]
proof (state)
this:
continuous_on S f

goal (2 subgoals):
 1. \<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` T)
 2. S \<subseteq> S
[PROOF STEP]
show "\<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` T)
[PROOF STEP]
using differentiable_on_subset f
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f differentiable_on ?t; ?s \<subseteq> ?t\<rbrakk> \<Longrightarrow> ?f differentiable_on ?s
f differentiable_on S

goal (1 subgoal):
 1. \<And>T. \<lbrakk>negligible T; T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` T)
[PROOF STEP]
by (auto simp: intro!: negligible_differentiable_image_negligible [OF dim])
[PROOF STATE]
proof (state)
this:
\<lbrakk>negligible ?T; ?T \<subseteq> S\<rbrakk> \<Longrightarrow> negligible (f ` ?T)

goal (1 subgoal):
 1. S \<subseteq> S
[PROOF STEP]
qed auto


[STATEMENT]
lemma mem_samp_primes_excl_prime :
  shows "x \<in> set_spmf (sample_set_excl prime_set {y}) \<Longrightarrow> prime x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set_spmf (sample_set_excl prime_set {y}) \<Longrightarrow> prime x
[PROOF STEP]
apply (simp add: finite_prime_set sample_set_excl_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> prime_set \<and> x \<noteq> y \<Longrightarrow> prime x
[PROOF STEP]
using prime_set_ass
[PROOF STATE]
proof (prove)
using this:
prime_set \<subseteq> {x. prime x \<and> 2 < x}

goal (1 subgoal):
 1. x \<in> prime_set \<and> x \<noteq> y \<Longrightarrow> prime x
[PROOF STEP]
by blast


[STATEMENT]
lemma mult_on_union: "(M,N) \<in> mult r \<Longrightarrow> (K + M, K + N) \<in> mult r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M, N) \<in> mult r \<Longrightarrow> (K + M, K + N) \<in> mult r
[PROOF STEP]
using mulex_on_union[of "\<lambda>x y. (x,y) \<in> r" UNIV]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mulex (\<lambda>x y. (x, y) \<in> r) ?M ?N; ?K \<in> multisets UNIV\<rbrakk> \<Longrightarrow> mulex (\<lambda>x y. (x, y) \<in> r) (?K + ?M) (?K + ?N)

goal (1 subgoal):
 1. (M, N) \<in> mult r \<Longrightarrow> (K + M, K + N) \<in> mult r
[PROOF STEP]
by (auto simp: mulex_iff_mult)


[STATEMENT]
lemma  nodes_connected_sym: "nodes_connected G a b = nodes_connected G b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes_connected G a b = nodes_connected G b a
[PROOF STEP]
using is_path_undir_sym
[PROOF STATE]
proof (prove)
using this:
is_path_undir G ?v ?p ?v' \<Longrightarrow> is_path_undir G ?v' (rev (map (\<lambda>(u, w, u'). (u', w, u)) ?p)) ?v

goal (1 subgoal):
 1. nodes_connected G a b = nodes_connected G b a
[PROOF STEP]
by auto


[STATEMENT]
lemma reverse_conc: "reverse (conc xs ys) = conc (reverse ys) (reverse xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reverse (conc xs ys) = conc (reverse ys) (reverse xs)
[PROOF STEP]
by (induct xs) (simp_all add: conc_empty conc_assoc)


[STATEMENT]
lemma square_integrable_imp_absolutely_integrable_product:
  assumes f: "f square_integrable S" and g: "g square_integrable S"
  shows "(\<lambda>x. f x * g x) absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x * g x) absolutely_integrable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x * g x) absolutely_integrable_on S
[PROOF STEP]
have fS: "integrable (lebesgue_on S) (\<lambda>r. (f r)\<^sup>2)" "integrable (lebesgue_on S) (\<lambda>r. (g r)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on S) (\<lambda>r. (f r)\<^sup>2) &&& integrable (lebesgue_on S) (\<lambda>r. (g r)\<^sup>2)
[PROOF STEP]
using assms square_integrable_def
[PROOF STATE]
proof (prove)
using this:
f square_integrable S
g square_integrable S
?f square_integrable ?S \<equiv> ?S \<in> sets lebesgue \<and> ?f \<in> borel_measurable (lebesgue_on ?S) \<and> integrable (lebesgue_on ?S) (\<lambda>x. (?f x)\<^sup>2)

goal (1 subgoal):
 1. integrable (lebesgue_on S) (\<lambda>r. (f r)\<^sup>2) &&& integrable (lebesgue_on S) (\<lambda>r. (g r)\<^sup>2)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on S) (\<lambda>r. (f r)\<^sup>2)
integrable (lebesgue_on S) (\<lambda>r. (g r)\<^sup>2)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) absolutely_integrable_on S
[PROOF STEP]
have "integrable (lebesgue_on S) (\<lambda>x. \<bar>f x * g x\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on S) (\<lambda>x. \<bar>f x * g x\<bar>)
[PROOF STEP]
proof (intro integrable_abs Holder_inequality [of 2 2])
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. 0 < 2
 2. 0 < 2
 3. 1 / 2 + 1 / 2 = 1
 4. f \<in> borel_measurable (lebesgue_on S)
 5. g \<in> borel_measurable (lebesgue_on S)
 6. integrable (lebesgue_on S) (\<lambda>x. \<bar>f x\<bar> powr 2)
 7. integrable (lebesgue_on S) (\<lambda>x. \<bar>g x\<bar> powr 2)
[PROOF STEP]
show "f \<in> borel_measurable (lebesgue_on S)" "g \<in> borel_measurable (lebesgue_on S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) &&& g \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
using f g square_integrable_def
[PROOF STATE]
proof (prove)
using this:
f square_integrable S
g square_integrable S
?f square_integrable ?S \<equiv> ?S \<in> sets lebesgue \<and> ?f \<in> borel_measurable (lebesgue_on ?S) \<and> integrable (lebesgue_on ?S) (\<lambda>x. (?f x)\<^sup>2)

goal (1 subgoal):
 1. f \<in> borel_measurable (lebesgue_on S) &&& g \<in> borel_measurable (lebesgue_on S)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable (lebesgue_on S)
g \<in> borel_measurable (lebesgue_on S)

goal (5 subgoals):
 1. 0 < 2
 2. 0 < 2
 3. 1 / 2 + 1 / 2 = 1
 4. integrable (lebesgue_on S) (\<lambda>x. \<bar>f x\<bar> powr 2)
 5. integrable (lebesgue_on S) (\<lambda>x. \<bar>g x\<bar> powr 2)
[PROOF STEP]
show "integrable (lebesgue_on S) (\<lambda>x. \<bar>f x\<bar> powr 2)" "integrable (lebesgue_on S) (\<lambda>x. \<bar>g x\<bar> powr 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on S) (\<lambda>x. \<bar>f x\<bar> powr 2) &&& integrable (lebesgue_on S) (\<lambda>x. \<bar>g x\<bar> powr 2)
[PROOF STEP]
using nonnegative_absolutely_integrable_1 [of "(\<lambda>x. (f x)\<^sup>2)"] nonnegative_absolutely_integrable_1 [of "(\<lambda>x. (g x)\<^sup>2)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>x. (f x)\<^sup>2) integrable_on ?A; \<And>x. x \<in> ?A \<Longrightarrow> 0 \<le> (f x)\<^sup>2\<rbrakk> \<Longrightarrow> (\<lambda>x. (f x)\<^sup>2) absolutely_integrable_on ?A
\<lbrakk>(\<lambda>x. (g x)\<^sup>2) integrable_on ?A; \<And>x. x \<in> ?A \<Longrightarrow> 0 \<le> (g x)\<^sup>2\<rbrakk> \<Longrightarrow> (\<lambda>x. (g x)\<^sup>2) absolutely_integrable_on ?A

goal (1 subgoal):
 1. integrable (lebesgue_on S) (\<lambda>x. \<bar>f x\<bar> powr 2) &&& integrable (lebesgue_on S) (\<lambda>x. \<bar>g x\<bar> powr 2)
[PROOF STEP]
by (simp_all add: fS integrable_restrict_space set_integrable_def)
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x\<bar> powr 2)
integrable (lebesgue_on S) (\<lambda>x. \<bar>g x\<bar> powr 2)

goal (3 subgoals):
 1. 0 < 2
 2. 0 < 2
 3. 1 / 2 + 1 / 2 = 1
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x * g x\<bar>)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x * g x\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x * g x\<bar>)

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) absolutely_integrable_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x * g x\<bar>)
f square_integrable S
g square_integrable S

goal (1 subgoal):
 1. (\<lambda>x. f x * g x) absolutely_integrable_on S
[PROOF STEP]
by (simp add: absolutely_integrable_measurable_real borel_measurable_times square_integrable_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x * g x) absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mahler_measure_constant[simp]: "mahler_measure_poly [:c:] = cmod c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly [:c:] = cmod c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure_poly [:c:] = cmod c
[PROOF STEP]
have main: "complex_roots_complex [:c:] = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_roots_complex [:c:] = []
[PROOF STEP]
unfolding complex_roots_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME as. Polynomial.smult (lead_coeff [:c:]) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = [:c:] \<and> length as = degree [:c:]) = []
[PROOF STEP]
by (rule some_equality, auto)
[PROOF STATE]
proof (state)
this:
complex_roots_complex [:c:] = []

goal (1 subgoal):
 1. mahler_measure_poly [:c:] = cmod c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure_poly [:c:] = cmod c
[PROOF STEP]
unfolding mahler_measure_poly_def main
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (lead_coeff [:c:]) * (\<Prod>a\<leftarrow>[]. max 1 (cmod a)) = cmod c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mahler_measure_poly [:c:] = cmod c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tan_periodic_n[simp]: "tan (x + numeral n * pi) = tan x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (x + numeral n * pi) = tan x
[PROOF STEP]
using tan_periodic_int[of _ "numeral n" ]
[PROOF STATE]
proof (prove)
using this:
tan (?x + real_of_int (numeral n) * pi) = tan ?x

goal (1 subgoal):
 1. tan (x + numeral n * pi) = tan x
[PROOF STEP]
by simp


[STATEMENT]
lemma (in finite_comm_group) finite_comm_FactGroup:
  assumes "subgroup H G"
  shows "finite_comm_group (G Mod H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (G Mod H)
[PROOF STEP]
unfolding finite_comm_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group (G Mod H) \<and> comm_group (G Mod H)
[PROOF STEP]
proof(safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite_group (G Mod H)
 2. comm_group (G Mod H)
[PROOF STEP]
show "finite_group (G Mod H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_group (G Mod H)
[PROOF STEP]
using finite_FactGroup[OF subgroup_imp_normal[OF assms]]
[PROOF STATE]
proof (prove)
using this:
finite_group (G Mod H)

goal (1 subgoal):
 1. finite_group (G Mod H)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite_group (G Mod H)

goal (1 subgoal):
 1. comm_group (G Mod H)
[PROOF STEP]
show "comm_group (G Mod H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (G Mod H)
[PROOF STEP]
by (simp add: abelian_FactGroup assms)
[PROOF STATE]
proof (state)
this:
comm_group (G Mod H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_onTr0:"\<lbrakk> f \<in> A \<rightarrow> B; x \<in> A; y \<in> A; inj_on f A; f x = f y\<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; x \<in> A; y \<in> A; inj_on f A; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (simp add:inj_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Inf_lim:
  fixes a :: "'a::{complete_linorder,linorder_topology}"
  assumes "\<And>n. b n \<in> s"
    and "b \<longlonglongrightarrow> a"
  shows "Inf s \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf s \<le> a
[PROOF STEP]
by (metis Lim_bounded2 assms complete_lattice_class.Inf_lower)


[STATEMENT]
lemma snd_scaleC [simp]: "snd (scaleC r A) = scaleC r (snd A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (r *\<^sub>C A) = r *\<^sub>C snd A
[PROOF STEP]
unfolding scaleC_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (r *\<^sub>C fst A, r *\<^sub>C snd A) = r *\<^sub>C snd A
[PROOF STEP]
by simp


[STATEMENT]
lemma test_distrib_left: "test p \<Longrightarrow>  test q \<Longrightarrow> test r \<Longrightarrow> p \<cdot> (q + r) = p \<cdot> q + p \<cdot> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>test p; test q; test r\<rbrakk> \<Longrightarrow> p \<cdot> (q + r) = p \<cdot> q + p \<cdot> r
[PROOF STEP]
using n_distrib_left
[PROOF STATE]
proof (prove)
using this:
!?x \<cdot> (!?y + !?z) = !?x \<cdot> !?y + !?x \<cdot> !?z

goal (1 subgoal):
 1. \<lbrakk>test p; test q; test r\<rbrakk> \<Longrightarrow> p \<cdot> (q + r) = p \<cdot> q + p \<cdot> r
[PROOF STEP]
by auto


[STATEMENT]
lemma if_edit_Nil2: "edit es ([]::'a list) = ys \<Longrightarrow> length ys \<le> cost es"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edit es [] = ys \<Longrightarrow> length ys \<le> cost es
[PROOF STEP]
apply(induction es "[]::'a list" arbitrary: ys rule: edit.induct)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>a es ys. \<lbrakk>\<And>ys. edit es [] = ys \<Longrightarrow> length ys \<le> cost es; edit (Ins a # es) [] = ys\<rbrakk> \<Longrightarrow> length ys \<le> cost (Ins a # es)
 2. \<And>es ys. \<lbrakk>\<And>ys. edit es [] = ys \<Longrightarrow> length ys \<le> cost es; edit (Copy # es) [] = ys\<rbrakk> \<Longrightarrow> length ys \<le> cost (Copy # es)
 3. \<And>a es ys. \<lbrakk>\<And>ys. edit es [] = ys \<Longrightarrow> length ys \<le> cost es; edit (Repl a # es) [] = ys\<rbrakk> \<Longrightarrow> length ys \<le> cost (Repl a # es)
 4. \<And>es ys. \<lbrakk>\<And>ys. edit es [] = ys \<Longrightarrow> length ys \<le> cost es; edit (Del # es) [] = ys\<rbrakk> \<Longrightarrow> length ys \<le> cost (Del # es)
 5. \<And>ys. edit [] [] = ys \<Longrightarrow> length ys \<le> cost []
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma covering_space_locally_path_connected:
  fixes p :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
  assumes "locally path_connected C" "covering_space C p S"
  shows "locally path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally path_connected S
[PROOF STEP]
using assms covering_space_locally_path_connected_eq
[PROOF STATE]
proof (prove)
using this:
locally path_connected C
covering_space C p S
covering_space ?C ?p ?S \<Longrightarrow> locally path_connected ?S = locally path_connected ?C

goal (1 subgoal):
 1. locally path_connected S
[PROOF STEP]
by blast


[STATEMENT]
lemma ppoint_mult_correct: "on_curvep a b p \<Longrightarrow>
  make_affine (ppoint_mult a n p) = point_mult a n (make_affine p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_curvep a b p \<Longrightarrow> make_affine (ppoint_mult a n p) = point_mult a n (make_affine p)
[PROOF STEP]
by (induct n) (simp_all add: padd_correct)


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


[STATEMENT]
lemma SUP_const_minus_ennreal:
  fixes f :: "'a \<Rightarrow> ennreal" shows "I \<noteq> {} \<Longrightarrow> (SUP x\<in>I. c - f x) = c - (INF x\<in>I. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> (SUP x\<in>I. c - f x) = c - Inf (f ` I)
[PROOF STEP]
including ennreal.lifting
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> (SUP x\<in>I. c - f x) = c - Inf (f ` I)
[PROOF STEP]
by (transfer fixing: I)
     (simp add: SUP_sup_distrib[symmetric] SUP_ereal_minus_right
           flip: sup_ereal_def)


[STATEMENT]
lemma (in Module) mem_fsps_snd_mHom:"\<lbrakk>R module N; free_generator R M H;
     f \<in> H \<rightarrow> carrier N; (a, b) \<in> fsps R M N f H\<rbrakk>  \<Longrightarrow>
                    b \<in> mHom R (mdl M (fgs R M a)) N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; free_generator R M H; f \<in> H \<rightarrow> carrier N; (a, b) \<in> fsps R M N f H\<rbrakk> \<Longrightarrow> b \<in> mHom R (mdl M (fgs R M a)) N
[PROOF STEP]
by (simp add:fsps_def fsp_def)


[STATEMENT]
lemma sums_finite:
  assumes [simp]: "finite N"
    and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 0"
  shows "f sums (\<Sum>n\<in>N. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums sum f N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f sums sum f N
[PROOF STEP]
have eq: "sum f {..<n + Suc (Max N)} = sum f N" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<n + Suc (Max N)} = sum f N
[PROOF STEP]
by (rule sum.mono_neutral_right) (auto simp: add_increasing less_Suc_eq_le f)
[PROOF STATE]
proof (state)
this:
sum f {..<?n + Suc (Max N)} = sum f N

goal (1 subgoal):
 1. f sums sum f N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums sum f N
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> sum f N
[PROOF STEP]
by (rule LIMSEQ_offset[of _ "Suc (Max N)"])
      (simp add: eq atLeast0LessThan del: add_Suc_right)
[PROOF STATE]
proof (state)
this:
f sums sum f N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma s1_P2:
  assumes x: "x < q"
    and y: "y < q"
    and "b < q"
    and "e2 < q"
    and "r < q"
    and "s1 < q"
  shows "((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) =
                ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) = ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) = ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)
[PROOF STEP]
have "s1 = (x*y + q - ((x*y + q - s1) mod q)) mod q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s1 = (x * y + q - (x * y + q - s1) mod q) mod q
[PROOF STEP]
using assms secure_mult.s1 secure_mult_axioms
[PROOF STATE]
proof (prove)
using this:
x < q
y < q
b < q
e2 < q
r < q
s1 < q
\<lbrakk>secure_mult ?q; ?s2.0 = (?x * ?y + ?q - ?s1.0) mod ?q; ?x < ?q; ?y < ?q; ?s1.0 < ?q\<rbrakk> \<Longrightarrow> ?s1.0 = (?x * ?y + ?q - ?s2.0) mod ?q
secure_mult q

goal (1 subgoal):
 1. s1 = (x * y + q - (x * y + q - s1) mod q) mod q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s1 = (x * y + q - (x * y + q - s1) mod q) mod q

goal (1 subgoal):
 1. ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) = ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s1 = (x * y + q - (x * y + q - s1) mod q) mod q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s1 = (x * y + q - (x * y + q - s1) mod q) mod q

goal (1 subgoal):
 1. ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) = ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)
[PROOF STEP]
using assms s1
[PROOF STATE]
proof (prove)
using this:
s1 = (x * y + q - (x * y + q - s1) mod q) mod q
x < q
y < q
b < q
e2 < q
r < q
s1 < q
\<lbrakk>?s2.0 = (?x * ?y + q - ?s1.0) mod q; ?x < q; ?y < q; ?s1.0 < q\<rbrakk> \<Longrightarrow> ?s1.0 = (?x * ?y + q - ?s2.0) mod q

goal (1 subgoal):
 1. ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) = ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), r, (x * y + q - r) mod q) = ((y, b, (e2 * b + q - (x * y + q - r) mod q) mod q, e2), (x * y + q - (x * y + q - r) mod q) mod q, (x * y + q - r) mod q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VWO_antisym:
  assumes "(x,y) \<in> VWO" "(y,x) \<in> VWO" shows "x=y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (metis Diff_iff IdD Linear_order_VWO Linear_order_in_diff_Id UNIV_I VWO assms)


[STATEMENT]
lemma Pi_split_domain[simp]: "x \<in> Pi (I \<union> J) X \<longleftrightarrow> x \<in> Pi I X \<and> x \<in> Pi J X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> Pi (I \<union> J) X) = (x \<in> Pi I X \<and> x \<in> Pi J X)
[PROOF STEP]
by (auto simp: Pi_def)


[STATEMENT]
theorem (in group) Zassenhaus:
  assumes "subgroup  H G"
    and "H1\<lhd>G\<lparr>carrier := H\<rparr>"
    and  "subgroup K G"
    and "K1\<lhd>G\<lparr>carrier:=K\<rparr>"
  shows "(G\<lparr>carrier:= H1 <#> (H\<inter>K)\<rparr> Mod (H1<#>(H\<inter>K1)))  \<cong>
         (G\<lparr>carrier:= K1 <#> (H\<inter>K)\<rparr> Mod (K1<#>(K\<inter>H1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
define Gmod1 Gmod2 Gmod3 Gmod4
    where "Gmod1 = (G\<lparr>carrier:= H1 <#> (H\<inter>K)\<rparr> Mod (H1<#>(H\<inter>K1))) "
      and "Gmod2 = (G\<lparr>carrier:= K1 <#> (K\<inter>H)\<rparr> Mod (K1<#>(K\<inter>H1)))"
      and "Gmod3 = (G\<lparr>carrier:= (H\<inter>K)\<rparr> Mod  ((H1\<inter>K)<#>(H\<inter>K1)))"
      and "Gmod4 = (G\<lparr>carrier:= (K\<inter>H)\<rparr> Mod  ((K1\<inter>H)<#>(K\<inter>H1)))"
[PROOF STATE]
proof (state)
this:
Gmod1 = G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1)
Gmod2 = G\<lparr>carrier := K1 <#> K \<inter> H\<rparr> Mod (K1 <#> K \<inter> H1)
Gmod3 = G\<lparr>carrier := H \<inter> K\<rparr> Mod (H1 \<inter> K <#> H \<inter> K1)
Gmod4 = G\<lparr>carrier := K \<inter> H\<rparr> Mod (K1 \<inter> H <#> K \<inter> H1)

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
have Hyp :  "Gmod1  \<cong> Gmod3" "Gmod2  \<cong>  Gmod4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gmod1 \<cong> Gmod3 &&& Gmod2 \<cong> Gmod4
[PROOF STEP]
using Zassenhaus_1 assms Gmod1_def Gmod2_def Gmod3_def Gmod4_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subgroup ?H G; ?H1.0 \<lhd> G\<lparr>carrier := ?H\<rparr>; subgroup ?K G; ?K1.0 \<lhd> G\<lparr>carrier := ?K\<rparr>\<rbrakk> \<Longrightarrow> G\<lparr>carrier := ?H1.0 <#> ?H \<inter> ?K\<rparr> Mod (?H1.0 <#> ?H \<inter> ?K1.0) \<cong> G\<lparr>carrier := ?H \<inter> ?K\<rparr> Mod (?H1.0 \<inter> ?K <#> ?H \<inter> ?K1.0)
subgroup H G
H1 \<lhd> G\<lparr>carrier := H\<rparr>
subgroup K G
K1 \<lhd> G\<lparr>carrier := K\<rparr>
Gmod1 = G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1)
Gmod2 = G\<lparr>carrier := K1 <#> K \<inter> H\<rparr> Mod (K1 <#> K \<inter> H1)
Gmod3 = G\<lparr>carrier := H \<inter> K\<rparr> Mod (H1 \<inter> K <#> H \<inter> K1)
Gmod4 = G\<lparr>carrier := K \<inter> H\<rparr> Mod (K1 \<inter> H <#> K \<inter> H1)

goal (1 subgoal):
 1. Gmod1 \<cong> Gmod3 &&& Gmod2 \<cong> Gmod4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Gmod1 \<cong> Gmod3
Gmod2 \<cong> Gmod4

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
have Hp : "Gmod3 = G\<lparr>carrier:= (K\<inter>H)\<rparr> Mod ((K\<inter>H1)<#>(K1\<inter>H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gmod3 = G\<lparr>carrier := K \<inter> H\<rparr> Mod (K \<inter> H1 <#> K1 \<inter> H)
[PROOF STEP]
by (simp add: Gmod3_def inf_commute)
[PROOF STATE]
proof (state)
this:
Gmod3 = G\<lparr>carrier := K \<inter> H\<rparr> Mod (K \<inter> H1 <#> K1 \<inter> H)

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
have "(K\<inter>H1)<#>(K1\<inter>H) = (K1\<inter>H)<#>(K\<inter>H1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<inter> H1 <#> K1 \<inter> H = K1 \<inter> H <#> K \<inter> H1
[PROOF STEP]
proof (intro commut_normal_subgroup[OF subgroups_Inter_pair[OF assms(1)assms(3)]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. K1 \<inter> H \<lhd> G\<lparr>carrier := H \<inter> K\<rparr>
 2. subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)
[PROOF STEP]
show "K1 \<inter> H \<lhd> G\<lparr>carrier := H \<inter> K\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K1 \<inter> H \<lhd> G\<lparr>carrier := H \<inter> K\<rparr>
[PROOF STEP]
using normal_inter[OF assms(3)assms(1)assms(4)]
[PROOF STATE]
proof (prove)
using this:
K1 \<inter> H \<lhd> G\<lparr>carrier := K \<inter> H\<rparr>

goal (1 subgoal):
 1. K1 \<inter> H \<lhd> G\<lparr>carrier := H \<inter> K\<rparr>
[PROOF STEP]
by (simp add: inf_commute)
[PROOF STATE]
proof (state)
this:
K1 \<inter> H \<lhd> G\<lparr>carrier := H \<inter> K\<rparr>

goal (1 subgoal):
 1. subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)
[PROOF STEP]
show "subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)
[PROOF STEP]
using subgroup_incl
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subgroup ?I G; subgroup ?J G; ?I \<subseteq> ?J\<rbrakk> \<Longrightarrow> subgroup ?I (G\<lparr>carrier := ?J\<rparr>)

goal (1 subgoal):
 1. subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)
[PROOF STEP]
by (simp add: assms inf_commute normal_imp_subgroup normal_inter)
[PROOF STATE]
proof (state)
this:
subgroup (K \<inter> H1) (G\<lparr>carrier := H \<inter> K\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
K \<inter> H1 <#> K1 \<inter> H = K1 \<inter> H <#> K \<inter> H1

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
hence  "Gmod3  = Gmod4"
[PROOF STATE]
proof (prove)
using this:
K \<inter> H1 <#> K1 \<inter> H = K1 \<inter> H <#> K \<inter> H1

goal (1 subgoal):
 1. Gmod3 = Gmod4
[PROOF STEP]
using Hp Gmod4_def
[PROOF STATE]
proof (prove)
using this:
K \<inter> H1 <#> K1 \<inter> H = K1 \<inter> H <#> K \<inter> H1
Gmod3 = G\<lparr>carrier := K \<inter> H\<rparr> Mod (K \<inter> H1 <#> K1 \<inter> H)
Gmod4 = G\<lparr>carrier := K \<inter> H\<rparr> Mod (K1 \<inter> H <#> K \<inter> H1)

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

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
hence "Gmod1 \<cong> Gmod2"
[PROOF STATE]
proof (prove)
using this:
Gmod3 = Gmod4

goal (1 subgoal):
 1. Gmod1 \<cong> Gmod2
[PROOF STEP]
by (metis assms group.iso_sym iso_trans Hyp normal.factorgroup_is_group Gmod2_def preliminary2)
[PROOF STATE]
proof (state)
this:
Gmod1 \<cong> Gmod2

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Gmod1 \<cong> Gmod2

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
using Gmod1_def Gmod2_def
[PROOF STATE]
proof (prove)
using this:
Gmod1 \<cong> Gmod2
Gmod1 = G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1)
Gmod2 = G\<lparr>carrier := K1 <#> K \<inter> H\<rparr> Mod (K1 <#> K \<inter> H1)

goal (1 subgoal):
 1. G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)
[PROOF STEP]
by (simp add: inf_commute)
[PROOF STATE]
proof (state)
this:
G\<lparr>carrier := H1 <#> H \<inter> K\<rparr> Mod (H1 <#> H \<inter> K1) \<cong> G\<lparr>carrier := K1 <#> H \<inter> K\<rparr> Mod (K1 <#> K \<inter> H1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtos_hom1:"\<lbrakk>(0::nat) < r; 0 < s; l \<le> (r * s - Suc 0)\<rbrakk> \<Longrightarrow>
 (rtos r s) l \<le> (s * r - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0\<rbrakk> \<Longrightarrow> rtos r s l \<le> s * r - Suc 0
[PROOF STEP]
apply (simp add:rtos_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0\<rbrakk> \<Longrightarrow> (l < r * s \<longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0) \<and> (\<not> l < r * s \<longrightarrow> r * s \<le> s * r - Suc 0)
[PROOF STEP]
apply (frule le_less_trans [of "l" "r * s - Suc 0" "r * s"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0\<rbrakk> \<Longrightarrow> r * s - Suc 0 < r * s
 2. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s\<rbrakk> \<Longrightarrow> (l < r * s \<longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0) \<and> (\<not> l < r * s \<longrightarrow> r * s \<le> s * r - Suc 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s\<rbrakk> \<Longrightarrow> (l < r * s \<longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0) \<and> (\<not> l < r * s \<longrightarrow> r * s \<le> s * r - Suc 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s\<rbrakk> \<Longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0
[PROOF STEP]
apply (frule mod_less_divisor [of "s" "l"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s; l mod s < s\<rbrakk> \<Longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0
[PROOF STEP]
apply (frule less_le_diff [of "l mod s" "s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s; l mod s < s; l mod s \<le> s - Suc 0\<rbrakk> \<Longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0
[PROOF STEP]
apply (frule_tac i = "l mod s" and j = "s - Suc 0" and k = r and l = r in
         mult_le_mono, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s; l mod s < s; l mod s \<le> s - Suc 0; l mod s * r \<le> (s - Suc 0) * r\<rbrakk> \<Longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0
[PROOF STEP]
apply (frule_tac i = "l mod s * r" and j = "(s - Suc 0) * r" and k = "l div s" and l = "r - Suc 0" in add_le_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s; l mod s < s; l mod s \<le> s - Suc 0; l mod s * r \<le> (s - Suc 0) * r\<rbrakk> \<Longrightarrow> l div s \<le> r - Suc 0
 2. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s; l mod s < s; l mod s \<le> s - Suc 0; l mod s * r \<le> (s - Suc 0) * r; l mod s * r + l div s \<le> (s - Suc 0) * r + (r - Suc 0)\<rbrakk> \<Longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0
[PROOF STEP]
apply (rule div_Tr2, assumption+, simp add:mult.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l \<le> r * s - Suc 0; l < r * s; l mod s < s; l mod s \<le> s - Suc 0; l mod s * r \<le> (s - Suc 0) * r; l mod s * r + l div s \<le> (s - Suc 0) * r + (r - Suc 0)\<rbrakk> \<Longrightarrow> l mod s * r + l div s \<le> s * r - Suc 0
[PROOF STEP]
apply (simp add:diff_mult_distrib)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma height_slim_node: "height (slim_node k a h) = h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height (slim_node k a h) = h
[PROOF STEP]
apply(induction k a h rule: full_node.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k c. height (slim_node k c 0) = 0
 2. \<And>k c n. \<lbrakk>height (slim_node k c n) = n; height (slim_node k c n) = n\<rbrakk> \<Longrightarrow> height (slim_node k c (Suc n)) = Suc n
[PROOF STEP]
apply (auto simp add: set_replicate_conv_if)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_sq_matrix_sum:
  "f 0 = 0 \<Longrightarrow> (\<And>a b. f (a + b) = f a + f b) \<Longrightarrow>
  map_sq_matrix f (\<Sum>i\<in>I. A i) = (\<Sum>i\<in>I. map_sq_matrix f (A i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f (0::'b) = (0::'a); \<And>a b. f (a + b) = f a + f b\<rbrakk> \<Longrightarrow> map_sq_matrix f (sum A I) = (\<Sum>i\<in>I. map_sq_matrix f (A i))
[PROOF STEP]
by (induction I rule: infinite_finite_induct)
     (auto simp: zero_map_sq_matrix map_sq_matrix_add)


[STATEMENT]
lemma least_enum_eq: "\<exists>x. P x \<Longrightarrow> least_enum P = (LEAST x. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. P x \<Longrightarrow> least_enum P = (LEAST x. P x)
[PROOF STEP]
by (auto simp: least_list[symmetric] least_enum_def)


[STATEMENT]
lemma l2_same: "l2_\<phi> (p!d) (p!d) = 1/3 / 2^(lv p d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l2_\<phi> (p ! d) (p ! d) = 1 / 3 / 2 ^ lv p d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l2_\<phi> (p ! d) (p ! d) = 1 / 3 / 2 ^ lv p d
[PROOF STEP]
have "l2_\<phi> (p!d) (p!d) = l2_\<phi> (lv p d, ix p d) (lv p d, ix p d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l2_\<phi> (p ! d) (p ! d) = l2_\<phi> (lv p d, ix p d) (lv p d, ix p d)
[PROOF STEP]
by (auto simp add: lv_def ix_def)
[PROOF STATE]
proof (state)
this:
l2_\<phi> (p ! d) (p ! d) = l2_\<phi> (lv p d, ix p d) (lv p d, ix p d)

goal (1 subgoal):
 1. l2_\<phi> (p ! d) (p ! d) = 1 / 3 / 2 ^ lv p d
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
l2_\<phi> (p ! d) (p ! d) = l2_\<phi> (lv p d, ix p d) (lv p d, ix p d)

goal (1 subgoal):
 1. l2_\<phi> (p ! d) (p ! d) = 1 / 3 / 2 ^ lv p d
[PROOF STEP]
using l2_when_same
[PROOF STATE]
proof (prove)
using this:
l2_\<phi> (p ! d) (p ! d) = l2_\<phi> (lv p d, ix p d) (lv p d, ix p d)
l2_\<phi> (?l, ?i) (?l, ?i) = 1 / 3 / 2 ^ ?l

goal (1 subgoal):
 1. l2_\<phi> (p ! d) (p ! d) = 1 / 3 / 2 ^ lv p d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l2_\<phi> (p ! d) (p ! d) = 1 / 3 / 2 ^ lv p d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Hausdorff_space_retraction_map_image:
   "\<lbrakk>retraction_map X Y r; Hausdorff_space X\<rbrakk> \<Longrightarrow> Hausdorff_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_map X Y r; Hausdorff_space X\<rbrakk> \<Longrightarrow> Hausdorff_space Y
[PROOF STEP]
unfolding retraction_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>g. retraction_maps X Y r g; Hausdorff_space X\<rbrakk> \<Longrightarrow> Hausdorff_space Y
[PROOF STEP]
using Hausdorff_space_subtopology homeomorphic_Hausdorff_space retraction_maps_section_image2
[PROOF STATE]
proof (prove)
using this:
Hausdorff_space ?X \<Longrightarrow> Hausdorff_space (subtopology ?X ?S)
?X homeomorphic_space ?Y \<Longrightarrow> Hausdorff_space ?X = Hausdorff_space ?Y
retraction_maps ?X ?Y ?r ?s \<Longrightarrow> subtopology ?X (?s ` topspace ?Y) homeomorphic_space ?Y

goal (1 subgoal):
 1. \<lbrakk>\<exists>g. retraction_maps X Y r g; Hausdorff_space X\<rbrakk> \<Longrightarrow> Hausdorff_space Y
[PROOF STEP]
by blast


[STATEMENT]
lemma has_vderiv_on_ln[THEN has_vderiv_on_eq_rhs, derivative_intros]:
  fixes g::"real \<Rightarrow> real"
  assumes "\<And>x. x \<in> s \<Longrightarrow> 0 < g x"
  assumes "(g has_vderiv_on g') s"
  shows "((\<lambda>x. ln (g x)) has_vderiv_on (\<lambda>x. g' x / g x)) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln (g x)) has_vderiv_on (\<lambda>x. g' x / g x)) s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> s \<Longrightarrow> 0 < g ?x
(g has_vderiv_on g') s

goal (1 subgoal):
 1. ((\<lambda>x. ln (g x)) has_vderiv_on (\<lambda>x. g' x / g x)) s
[PROOF STEP]
unfolding has_vderiv_on_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> s \<Longrightarrow> 0 < g ?x
\<forall>x\<in>s. (g has_vector_derivative g' x) (at x within s)

goal (1 subgoal):
 1. \<forall>x\<in>s. ((\<lambda>x. ln (g x)) has_vector_derivative g' x / g x) (at x within s)
[PROOF STEP]
by (auto simp: has_vderiv_on_def has_real_derivative_iff_has_vector_derivative[symmetric]
    intro!: derivative_eq_intros)


[STATEMENT]
lemma mat_inv_l:
  assumes "mat_det A \<noteq> 0"
  shows "(mat_inv A) *\<^sub>m\<^sub>m A  = eye"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_inv A *\<^sub>m\<^sub>m A = eye
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0

goal (1 subgoal):
 1. mat_inv A *\<^sub>m\<^sub>m A = eye
[PROOF STEP]
proof (cases A, auto simp add: field_simps)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix a b c d :: complex
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))"
[PROOF STATE]
proof (state)
this:
a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "(a*d - b*c)*(a*d - b*c) = 0"
[PROOF STATE]
proof (prove)
using this:
a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))

goal (1 subgoal):
 1. (a * d - b * c) * (a * d - b * c) = 0
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(a * d - b * c) * (a * d - b * c) = 0

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence *: "a*d - b*c = 0"
[PROOF STATE]
proof (prove)
using this:
(a * d - b * c) * (a * d - b * c) = 0

goal (1 subgoal):
 1. a * d - b * c = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * d - b * c = 0

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "a*d \<noteq> b*c"
[PROOF STATE]
proof (state)
this:
a * d \<noteq> b * c

goal (1 subgoal):
 1. \<And>a b c d. \<lbrakk>a * d \<noteq> b * c; A = (a, b, c, d); a * (a * (d * d)) + b * (b * (c * c)) = a * (b * (c * (d * 2)))\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
a * d - b * c = 0
a * d \<noteq> b * c
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a * d - b * c = 0
a * d \<noteq> b * c

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ofsm_table_partition_fixpoint_Suc :
  assumes "equivalence_relation_on_states M f"
  and     "q \<in> states M"
shows "ofsm_table M f (size M - card (f ` states M)) q = ofsm_table M f (Suc (size M - card (f ` states M))) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
have "\<And> q . q \<in> states M \<Longrightarrow> f q = ofsm_table M f 0 q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> f q = ofsm_table M f 0 q
[PROOF STEP]
unfolding ofsm_table.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> f q = (if q \<in> FSM.states M then f q else {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?q \<in> FSM.states M \<Longrightarrow> f ?q = ofsm_table M f 0 ?q

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
define n where n: "n = (\<lambda> i . card (ofsm_table M f i ` states M))"
[PROOF STATE]
proof (state)
this:
n = (\<lambda>i. card (ofsm_table M f i ` FSM.states M))

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
have "\<And> i j . i \<le> j \<Longrightarrow> n i \<le> n j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. i \<le> j \<Longrightarrow> n i \<le> n j
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. i \<le> j \<Longrightarrow> card (ofsm_table M f i ` FSM.states M) \<le> card (ofsm_table M f j ` FSM.states M)
[PROOF STEP]
using ofsm_table_refinement_card[OF assms(1), where A="states M"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>FSM.states M \<subseteq> FSM.states M; ?i \<le> ?j\<rbrakk> \<Longrightarrow> card (ofsm_table M f ?i ` FSM.states M) \<le> card (ofsm_table M f ?j ` FSM.states M)

goal (1 subgoal):
 1. \<And>i j. i \<le> j \<Longrightarrow> card (ofsm_table M f i ` FSM.states M) \<le> card (ofsm_table M f j ` FSM.states M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?i \<le> ?j \<Longrightarrow> n ?i \<le> n ?j

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?i \<le> ?j \<Longrightarrow> n ?i \<le> n ?j

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
have "\<And> i j m . i < j \<Longrightarrow> n i = n j \<Longrightarrow> j \<le> m \<Longrightarrow> n i = n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
fix i j m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
assume "i < j" and "n i = n j" and "j \<le> m"
[PROOF STATE]
proof (state)
this:
i < j
n i = n j
j \<le> m

goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < j
n i = n j
j \<le> m
[PROOF STEP]
have "Suc i \<le> j" and "i \<le> Suc i" and "i \<le> m"
[PROOF STATE]
proof (prove)
using this:
i < j
n i = n j
j \<le> m

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

goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
have "\<And> q . q \<in> states M \<Longrightarrow> ofsm_table M f j q = ofsm_table M f i q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j q = ofsm_table M f i q
[PROOF STEP]
using \<open>i < j\<close> \<open>n i = n j\<close> ofsm_table_refinement_card_fix[OF assms(1) _]
[PROOF STATE]
proof (prove)
using this:
i < j
n i = n j
\<lbrakk>card (ofsm_table M f ?j ` FSM.states M) = card (ofsm_table M f ?i ` FSM.states M); ?q \<in> FSM.states M; ?i \<le> ?j\<rbrakk> \<Longrightarrow> ofsm_table M f ?j ?q = ofsm_table M f ?i ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j q = ofsm_table M f i q
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
using this:
i < j
card (ofsm_table M f i ` FSM.states M) = card (ofsm_table M f j ` FSM.states M)
\<lbrakk>card (ofsm_table M f ?j ` FSM.states M) = card (ofsm_table M f ?i ` FSM.states M); ?q \<in> FSM.states M; ?i \<le> ?j\<rbrakk> \<Longrightarrow> ofsm_table M f ?j ?q = ofsm_table M f ?i ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j q = ofsm_table M f i q
[PROOF STEP]
using less_imp_le_nat
[PROOF STATE]
proof (prove)
using this:
i < j
card (ofsm_table M f i ` FSM.states M) = card (ofsm_table M f j ` FSM.states M)
\<lbrakk>card (ofsm_table M f ?j ` FSM.states M) = card (ofsm_table M f ?i ` FSM.states M); ?q \<in> FSM.states M; ?i \<le> ?j\<rbrakk> \<Longrightarrow> ofsm_table M f ?j ?q = ofsm_table M f ?i ?q
?m < ?n \<Longrightarrow> ?m \<le> ?n

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j q = ofsm_table M f i q
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j ?q = ofsm_table M f i ?q
[PROOF STEP]
have "\<And> q . q \<in> states M \<Longrightarrow> ofsm_table M f (Suc i) q = ofsm_table M f i q"
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) q = ofsm_table M f i q
[PROOF STEP]
using ofsm_table_subset[OF \<open>Suc i \<le> j\<close>, of M f]
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j ?q = ofsm_table M f i ?q
ofsm_table M f j ?q \<subseteq> ofsm_table M f (Suc i) ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) q = ofsm_table M f i q
[PROOF STEP]
using ofsm_table_subset[OF \<open>i \<le> Suc i\<close>, of M f]
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f j ?q = ofsm_table M f i ?q
ofsm_table M f j ?q \<subseteq> ofsm_table M f (Suc i) ?q
ofsm_table M f (Suc i) ?q \<subseteq> ofsm_table M f i ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) q = ofsm_table M f i q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) ?q = ofsm_table M f i ?q
[PROOF STEP]
have "\<And> q . q \<in> states M \<Longrightarrow> ofsm_table M f m q = ofsm_table M f i q"
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f m q = ofsm_table M f i q
[PROOF STEP]
using ofsm_table_fixpoint[OF \<open>i \<le> m\<close>]
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f (Suc i) ?q = ofsm_table M f i ?q
\<lbrakk>\<And>q. q \<in> FSM.states ?M \<Longrightarrow> ofsm_table ?M ?f (Suc i) q = ofsm_table ?M ?f i q; ?q \<in> FSM.states ?M\<rbrakk> \<Longrightarrow> ofsm_table ?M ?f m ?q = ofsm_table ?M ?f i ?q

goal (1 subgoal):
 1. \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M f m q = ofsm_table M f i q
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f m ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f m ?q = ofsm_table M f i ?q
[PROOF STEP]
show "n i = n m"
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f m ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. n i = n m
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f m ?q = ofsm_table M f i ?q

goal (1 subgoal):
 1. card (ofsm_table M f i ` FSM.states M) = card (ofsm_table M f m ` FSM.states M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n i = n m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < ?j; n ?i = n ?j; ?j \<le> ?m\<rbrakk> \<Longrightarrow> n ?i = n ?m

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < ?j; n ?i = n ?j; ?j \<le> ?m\<rbrakk> \<Longrightarrow> n ?i = n ?m

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
have "\<And> i . n i \<le> size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. n i \<le> FSM.size M
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. card (ofsm_table M f i ` FSM.states M) \<le> FSM.size M
[PROOF STEP]
using ofsm_table_states[of M f, OF equivalence_relation_on_states_ran[OF assms(1)]]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q. q \<in> FSM.states M \<Longrightarrow> q \<in> FSM.states M; ?q \<in> FSM.states M\<rbrakk> \<Longrightarrow> ofsm_table M f ?k ?q \<subseteq> FSM.states M

goal (1 subgoal):
 1. \<And>i. card (ofsm_table M f i ` FSM.states M) \<le> FSM.size M
[PROOF STEP]
using fsm_states_finite[of M]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q. q \<in> FSM.states M \<Longrightarrow> q \<in> FSM.states M; ?q \<in> FSM.states M\<rbrakk> \<Longrightarrow> ofsm_table M f ?k ?q \<subseteq> FSM.states M
finite (FSM.states M)

goal (1 subgoal):
 1. \<And>i. card (ofsm_table M f i ` FSM.states M) \<le> FSM.size M
[PROOF STEP]
by (simp add: card_image_le)
[PROOF STATE]
proof (state)
this:
n ?i \<le> FSM.size M

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?i \<le> ?j \<Longrightarrow> n ?i \<le> n ?j
\<lbrakk>?i < ?j; n ?i = n ?j; ?j \<le> ?m\<rbrakk> \<Longrightarrow> n ?i = n ?m
n ?i \<le> FSM.size M
[PROOF STEP]
obtain k where "n (Suc k) = n k"
                        and "k \<le> size M - n 0"
[PROOF STATE]
proof (prove)
using this:
?i \<le> ?j \<Longrightarrow> n ?i \<le> n ?j
\<lbrakk>?i < ?j; n ?i = n ?j; ?j \<le> ?m\<rbrakk> \<Longrightarrow> n ?i = n ?m
n ?i \<le> FSM.size M

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>n (Suc k) = n k; k \<le> FSM.size M - n 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using monotone_function_with_limit_witness_helper[where f=n and k="size M"]
[PROOF STATE]
proof (prove)
using this:
?i \<le> ?j \<Longrightarrow> n ?i \<le> n ?j
\<lbrakk>?i < ?j; n ?i = n ?j; ?j \<le> ?m\<rbrakk> \<Longrightarrow> n ?i = n ?m
n ?i \<le> FSM.size M
\<lbrakk>\<And>i j. i \<le> j \<Longrightarrow> n i \<le> n j; \<And>i j m. \<lbrakk>i < j; n i = n j; j \<le> m\<rbrakk> \<Longrightarrow> n i = n m; \<And>i. n i \<le> FSM.size M; \<And>x. \<lbrakk>n (Suc x) = n x; x \<le> FSM.size M - n 0\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>n (Suc k) = n k; k \<le> FSM.size M - n 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n (Suc k) = n k
k \<le> FSM.size M - n 0

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n (Suc k) = n k
k \<le> FSM.size M - n 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n (Suc k) = n k
k \<le> FSM.size M - n 0

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
unfolding n
[PROOF STATE]
proof (prove)
using this:
card (ofsm_table M f (Suc k) ` FSM.states M) = card (ofsm_table M f k ` FSM.states M)
k \<le> FSM.size M - card (ofsm_table M f 0 ` FSM.states M)

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
using \<open>\<And> q . q \<in> states M \<Longrightarrow> f q = ofsm_table M f 0 q\<close>[symmetric]
[PROOF STATE]
proof (prove)
using this:
card (ofsm_table M f (Suc k) ` FSM.states M) = card (ofsm_table M f k ` FSM.states M)
k \<le> FSM.size M - card (ofsm_table M f 0 ` FSM.states M)
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f 0 ?q = f ?q

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
using ofsm_table_refinement_card_fix_Suc[OF assms(1) _ ]
[PROOF STATE]
proof (prove)
using this:
card (ofsm_table M f (Suc k) ` FSM.states M) = card (ofsm_table M f k ` FSM.states M)
k \<le> FSM.size M - card (ofsm_table M f 0 ` FSM.states M)
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f 0 ?q = f ?q
\<lbrakk>card (ofsm_table M f (Suc ?k) ` FSM.states M) = card (ofsm_table M f ?k ` FSM.states M); ?q \<in> FSM.states M\<rbrakk> \<Longrightarrow> ofsm_table M f (Suc ?k) ?q = ofsm_table M f ?k ?q

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
using ofsm_table_fixpoint[OF _ _ assms(2)]
[PROOF STATE]
proof (prove)
using this:
card (ofsm_table M f (Suc k) ` FSM.states M) = card (ofsm_table M f k ` FSM.states M)
k \<le> FSM.size M - card (ofsm_table M f 0 ` FSM.states M)
?q \<in> FSM.states M \<Longrightarrow> ofsm_table M f 0 ?q = f ?q
\<lbrakk>card (ofsm_table M f (Suc ?k) ` FSM.states M) = card (ofsm_table M f ?k ` FSM.states M); ?q \<in> FSM.states M\<rbrakk> \<Longrightarrow> ofsm_table M f (Suc ?k) ?q = ofsm_table M f ?k ?q
\<lbrakk>?i \<le> ?j; \<And>q. q \<in> FSM.states M \<Longrightarrow> ofsm_table M ?f (Suc ?i) q = ofsm_table M ?f ?i q\<rbrakk> \<Longrightarrow> ofsm_table M ?f ?j q = ofsm_table M ?f ?i q

goal (1 subgoal):
 1. ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q
[PROOF STEP]
by (metis (mono_tags, lifting) image_cong nat_le_linear not_less_eq_eq)
[PROOF STATE]
proof (state)
this:
ofsm_table M f (FSM.size M - card (f ` FSM.states M)) q = ofsm_table M f (Suc (FSM.size M - card (f ` FSM.states M))) q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ipoly_mult_rat_main:
  fixes x :: "'a :: {field,ring_char_0}"
  assumes "d \<noteq> 0" and "n \<noteq> 0"
  shows "ipoly (poly_mult_rat_main n d p) x = of_int n ^ degree p * ipoly p (x * of_int d / of_int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipoly (poly_mult_rat_main n d p) x = of_int n ^ degree p * ipoly p (x * of_int d / of_int n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ipoly (poly_mult_rat_main n d p) x = of_int n ^ degree p * ipoly p (x * of_int d / of_int n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
d \<noteq> 0
n \<noteq> 0
[PROOF STEP]
have d: "(if d = 0 then t else f) = f" for t f :: 'b
[PROOF STATE]
proof (prove)
using this:
d \<noteq> 0
n \<noteq> 0

goal (1 subgoal):
 1. (if d = 0 then t else f) = f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if d = 0 then ?t1 else ?f1) = ?f1

goal (1 subgoal):
 1. ipoly (poly_mult_rat_main n d p) x = of_int n ^ degree p * ipoly p (x * of_int d / of_int n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipoly (poly_mult_rat_main n d p) x = of_int n ^ degree p * ipoly p (x * of_int d / of_int n)
[PROOF STEP]
unfolding poly_altdef of_int_hom.coeff_map_poly_hom mult.assoc[symmetric] of_int_mult[symmetric]
      sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree (of_int_poly (poly_mult_rat_main n d p)). of_int (coeff (poly_mult_rat_main n d p) i) * x ^ i) = (\<Sum>na\<le>degree (of_int_poly p). of_int n ^ degree p * of_int (coeff p na) * (x * of_int d / of_int n) ^ na)
[PROOF STEP]
unfolding of_int_hom.degree_map_poly_hom degree_poly_mult_rat_main[OF assms(2)] d
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree p. of_int (coeff (poly_mult_rat_main n d p) i) * x ^ i) = (\<Sum>na\<le>degree p. of_int n ^ degree p * of_int (coeff p na) * (x * of_int d / of_int n) ^ na)
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {..degree p} \<Longrightarrow> of_int (coeff (poly_mult_rat_main n d p) xa) * x ^ xa = of_int n ^ degree p * of_int (coeff p xa) * (x * of_int d / of_int n) ^ xa
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {..degree p} \<Longrightarrow> of_int (coeff (poly_mult_rat_main n d p) xa) * x ^ xa = of_int n ^ degree p * of_int (coeff p xa) * (x * of_int d / of_int n) ^ xa
[PROOF STEP]
assume "i \<in> {..degree p}"
[PROOF STATE]
proof (state)
this:
i \<in> {..degree p}

goal (1 subgoal):
 1. \<And>xa. xa \<in> {..degree p} \<Longrightarrow> of_int (coeff (poly_mult_rat_main n d p) xa) * x ^ xa = of_int n ^ degree p * of_int (coeff p xa) * (x * of_int d / of_int n) ^ xa
[PROOF STEP]
hence i: "i \<le> degree p"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..degree p}

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

goal (1 subgoal):
 1. \<And>xa. xa \<in> {..degree p} \<Longrightarrow> of_int (coeff (poly_mult_rat_main n d p) xa) * x ^ xa = of_int n ^ degree p * of_int (coeff p xa) * (x * of_int d / of_int n) ^ xa
[PROOF STEP]
hence id: "of_int n ^ (degree p - i) = (of_int n ^ degree p / of_int n ^ i :: 'a)"
[PROOF STATE]
proof (prove)
using this:
i \<le> degree p

goal (1 subgoal):
 1. of_int n ^ (degree p - i) = of_int n ^ degree p / of_int n ^ i
[PROOF STEP]
by (simp add: assms(2) power_diff)
[PROOF STATE]
proof (state)
this:
of_int n ^ (degree p - i) = of_int n ^ degree p / of_int n ^ i

goal (1 subgoal):
 1. \<And>xa. xa \<in> {..degree p} \<Longrightarrow> of_int (coeff (poly_mult_rat_main n d p) xa) * x ^ xa = of_int n ^ degree p * of_int (coeff p xa) * (x * of_int d / of_int n) ^ xa
[PROOF STEP]
thus "of_int (coeff (poly_mult_rat_main n d p) i) * x ^ i = of_int n ^ degree p * of_int (coeff p i) * (x * of_int d / of_int n) ^ i"
[PROOF STATE]
proof (prove)
using this:
of_int n ^ (degree p - i) = of_int n ^ degree p / of_int n ^ i

goal (1 subgoal):
 1. of_int (coeff (poly_mult_rat_main n d p) i) * x ^ i = of_int n ^ degree p * of_int (coeff p i) * (x * of_int d / of_int n) ^ i
[PROOF STEP]
unfolding coeff_poly_mult_rat_main
[PROOF STATE]
proof (prove)
using this:
of_int n ^ (degree p - i) = of_int n ^ degree p / of_int n ^ i

goal (1 subgoal):
 1. of_int (coeff p i * n ^ (degree p - i) * d ^ i) * x ^ i = of_int n ^ degree p * of_int (coeff p i) * (x * of_int d / of_int n) ^ i
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
of_int (coeff (poly_mult_rat_main n d p) i) * x ^ i = of_int n ^ degree p * of_int (coeff p i) * (x * of_int d / of_int n) ^ i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ipoly (poly_mult_rat_main n d p) x = of_int n ^ degree p * ipoly p (x * of_int d / of_int n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hull_redundant_eq: "a \<in> (S hull s) \<longleftrightarrow> S hull (insert a s) = S hull s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> S hull s) = (S hull insert a s = S hull s)
[PROOF STEP]
unfolding hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> \<Inter> {t. S t \<and> s \<subseteq> t}) = (\<Inter> {t. S t \<and> insert a s \<subseteq> t} = \<Inter> {t. S t \<and> s \<subseteq> t})
[PROOF STEP]
by blast


[STATEMENT]
lemma homeomorphic_subspace_Euclidean_space_dim:
  fixes S :: "'a::euclidean_space set"
  assumes "subspace S"
  shows "top_of_set S homeomorphic_space Euclidean_space (dim S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top_of_set S homeomorphic_space Euclidean_space (dim S)
[PROOF STEP]
by (simp add: homeomorphic_subspace_Euclidean_space assms)


[STATEMENT]
lemma Inl_m_oplus[simp]: "Inl -` (id \<oplus> f) ` tns = Inl -` tns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inl -` (id \<oplus> f) ` tns = Inl -` tns
[PROOF STEP]
using Inl_oplus_iff
[PROOF STATE]
proof (prove)
using this:
(Inl ?tr \<in> (id \<oplus> ?f) ` ?tns) = (Inl ?tr \<in> ?tns)

goal (1 subgoal):
 1. Inl -` (id \<oplus> f) ` tns = Inl -` tns
[PROOF STEP]
unfolding vimage_def
[PROOF STATE]
proof (prove)
using this:
(Inl ?tr \<in> (id \<oplus> ?f) ` ?tns) = (Inl ?tr \<in> ?tns)

goal (1 subgoal):
 1. {x. Inl x \<in> (id \<oplus> f) ` tns} = {x. Inl x \<in> tns}
[PROOF STEP]
by auto


[STATEMENT]
lemma sset_sdrop: \<open>sset (sdrop n s) \<subseteq> sset s\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i.R (sdrop n s) \<subseteq> i.R s
[PROOF STEP]
proof (induct n arbitrary: s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s. i.R (sdrop 0 s) \<subseteq> i.R s
 2. \<And>n s. (\<And>s. i.R (sdrop n s) \<subseteq> i.R s) \<Longrightarrow> i.R (sdrop (Suc n) s) \<subseteq> i.R s
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
i.R (sdrop n ?s) \<subseteq> i.R ?s

goal (2 subgoals):
 1. \<And>s. i.R (sdrop 0 s) \<subseteq> i.R s
 2. \<And>n s. (\<And>s. i.R (sdrop n s) \<subseteq> i.R s) \<Longrightarrow> i.R (sdrop (Suc n) s) \<subseteq> i.R s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i.R (sdrop n ?s) \<subseteq> i.R ?s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i.R (sdrop n ?s) \<subseteq> i.R ?s

goal (1 subgoal):
 1. i.R (sdrop (Suc n) s) \<subseteq> i.R s
[PROOF STEP]
by (metis in_mono sdrop_simps(2) stl_sset subsetI)
[PROOF STATE]
proof (state)
this:
i.R (sdrop (Suc n) s) \<subseteq> i.R s

goal (1 subgoal):
 1. \<And>s. i.R (sdrop 0 s) \<subseteq> i.R s
[PROOF STEP]
qed simp