[STATEMENT]
lemma type_to_set2:
  shows "class.nontriv TYPE('c)" (is ?a) and "n=CARD('c)" (is ?b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.nontriv TYPE('c) &&& n = CARD('c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. class.nontriv TYPE('c)
 2. n = CARD('c)
[PROOF STEP]
from local_typedef2
[PROOF STATE]
proof (chain)
picking this:
\<exists>Rep Abs. type_definition Rep Abs {0..<int n}
[PROOF STEP]
obtain Rep::"('c \<Rightarrow> int)" and Abs
    where t: "type_definition Rep Abs {0..<n :: int}"
[PROOF STATE]
proof (prove)
using this:
\<exists>Rep Abs. type_definition Rep Abs {0..<int n}

goal (1 subgoal):
 1. (\<And>Rep Abs. type_definition Rep Abs {0..<int n} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
type_definition Rep Abs {0..<int n}

goal (2 subgoals):
 1. class.nontriv TYPE('c)
 2. n = CARD('c)
[PROOF STEP]
have "card (UNIV :: 'c set) = card {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('c) = card {0..<n}
[PROOF STEP]
using t type_definition.card
[PROOF STATE]
proof (prove)
using this:
type_definition Rep Abs {0..<int n}
type_definition ?Rep ?Abs ?A \<Longrightarrow> CARD(?'b) = card ?A

goal (1 subgoal):
 1. CARD('c) = card {0..<n}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
CARD('c) = card {0..<n}

goal (2 subgoals):
 1. class.nontriv TYPE('c)
 2. n = CARD('c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
CARD('c) = card {0..<n}

goal (2 subgoals):
 1. class.nontriv TYPE('c)
 2. n = CARD('c)
[PROOF STEP]
have "... = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {0..<n} = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {0..<n} = n

goal (2 subgoals):
 1. class.nontriv TYPE('c)
 2. n = CARD('c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
CARD('c) = n
[PROOF STEP]
show ?b
[PROOF STATE]
proof (prove)
using this:
CARD('c) = n

goal (1 subgoal):
 1. n = CARD('c)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
n = CARD('c)

goal (1 subgoal):
 1. class.nontriv TYPE('c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = CARD('c)
[PROOF STEP]
show ?a
[PROOF STATE]
proof (prove)
using this:
n = CARD('c)

goal (1 subgoal):
 1. class.nontriv TYPE('c)
[PROOF STEP]
unfolding class.nontriv_def
[PROOF STATE]
proof (prove)
using this:
n = CARD('c)

goal (1 subgoal):
 1. 1 < CARD('c)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n = CARD('c)
1 < n

goal (1 subgoal):
 1. 1 < CARD('c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
class.nontriv TYPE('c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma topological_tendstoD:
  "(f \<longlongrightarrow> l) F \<Longrightarrow> open S \<Longrightarrow> l \<in> S \<Longrightarrow> eventually (\<lambda>x. f x \<in> S) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> l) F; open S; l \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. f x \<in> S
[PROOF STEP]
by (auto simp: tendsto_def)


[STATEMENT]
lemma std_simplex:
  "convex hull (insert 0 Basis) =
    {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> sum (\<lambda>i. x\<bullet>i) Basis \<le> 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull insert (0::'a) Basis = {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1}
[PROOF STEP]
using substd_simplex[of Basis]
[PROOF STATE]
proof (prove)
using this:
Basis \<subseteq> Basis \<Longrightarrow> convex hull insert (0::?'b1) Basis = {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1 \<and> (\<forall>i\<in>Basis. i \<notin> Basis \<longrightarrow> x \<bullet> i = 0)}

goal (1 subgoal):
 1. convex hull insert (0::'a) Basis = {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1}
[PROOF STEP]
by auto


[STATEMENT]
lemma inner_scaleR_pdevs_0: "inner_scaleR_pdevs 0 One_pdevs = zero_pdevs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_scaleR_pdevs (0::'a) One_pdevs = zero_pdevs
[PROOF STEP]
unfolding inner_scaleR_pdevs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unop_pdevs (\<lambda>x. ((0::'a) \<bullet> x) *\<^sub>R x) One_pdevs = zero_pdevs
[PROOF STEP]
by transfer (auto simp: unop_pdevs_raw_def)


[STATEMENT]
lemma from_nat_into_surj: "countable A \<Longrightarrow> a \<in> A \<Longrightarrow> \<exists>n. from_nat_into A n = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; a \<in> A\<rbrakk> \<Longrightarrow> \<exists>n. from_nat_into A n = a
[PROOF STEP]
by (rule exI[of _ "to_nat_on A a"]) simp


[STATEMENT]
lemma nat_even_induct [case_names _ 0 SucSuc]:
  assumes   even: "even n"
  and          0: "P 0"
  and     SucSuc: "\<And>m. even m \<Longrightarrow> P m \<Longrightarrow> P (Suc (Suc m))"
  shows   "P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
even n
P 0
\<lbrakk>even ?m; P ?m\<rbrakk> \<Longrightarrow> P (Suc (Suc ?m))
[PROOF STEP]
obtain k where "n = 2*k"
[PROOF STATE]
proof (prove)
using this:
even n
P 0
\<lbrakk>even ?m; P ?m\<rbrakk> \<Longrightarrow> P (Suc (Suc ?m))

goal (1 subgoal):
 1. (\<And>k. n = 2 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using evenE
[PROOF STATE]
proof (prove)
using this:
even n
P 0
\<lbrakk>even ?m; P ?m\<rbrakk> \<Longrightarrow> P (Suc (Suc ?m))
\<lbrakk>even ?a; \<And>b. ?a = (2::?'a) * b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>k. n = 2 * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = 2 * k

goal (1 subgoal):
 1. P n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n = 2 * k

goal (1 subgoal):
 1. P n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
even n
P 0
\<lbrakk>even ?m; P ?m\<rbrakk> \<Longrightarrow> P (Suc (Suc ?m))
[PROOF STEP]
have "P (2*k)"
[PROOF STATE]
proof (prove)
using this:
even n
P 0
\<lbrakk>even ?m; P ?m\<rbrakk> \<Longrightarrow> P (Suc (Suc ?m))

goal (1 subgoal):
 1. P (2 * k)
[PROOF STEP]
by (induct k) auto
[PROOF STATE]
proof (state)
this:
P (2 * k)

goal (1 subgoal):
 1. P n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n = 2 * k
P (2 * k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 2 * k
P (2 * k)

goal (1 subgoal):
 1. P n
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
P n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_block_one_mat[simp]:
  "diag_block_mat (map (\<lambda>A. 1\<^sub>m (dim_row A)) As) = (1\<^sub>m (sum_list (map dim_row As)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (map (\<lambda>A. 1\<^sub>m (dim_row A)) As) = 1\<^sub>m (sum_list (map dim_row As))
[PROOF STEP]
by (induct As, auto simp: Let_def)


[STATEMENT]
lemma nodes_empty[simp]: "nodes empty = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes FiniteGraph.empty = {}
[PROOF STEP]
unfolding empty_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes \<lparr>nodes = {}, edges = {}\<rparr> = {}
[PROOF STEP]
by simp


[STATEMENT]
lemma full_embedding_functors_compose:
  assumes "full_embedding_functor A B F" and "full_embedding_functor B C G"
  shows "full_embedding_functor A C (G o F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_embedding_functor A C (G \<circ> F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_embedding_functor A C (G \<circ> F)
[PROOF STEP]
interpret F: full_embedding_functor A B F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_embedding_functor A B F
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
full_embedding_functor A B F

goal (1 subgoal):
 1. full_embedding_functor A B F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_embedding_functor A C (G \<circ> F)
[PROOF STEP]
interpret G: full_embedding_functor B C G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_embedding_functor B C G
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
full_embedding_functor B C G

goal (1 subgoal):
 1. full_embedding_functor B C G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_embedding_functor A C (G \<circ> F)
[PROOF STEP]
interpret composite_functor A B C F G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composite_functor A B C F G
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_embedding_functor A C local.map
[PROOF STEP]
interpret embedding_functor A C \<open>G o F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embedding_functor A C local.map
[PROOF STEP]
using F.embedding_functor_axioms G.embedding_functor_axioms embedding_functors_compose
[PROOF STATE]
proof (prove)
using this:
embedding_functor A B F
embedding_functor B C G
\<lbrakk>embedding_functor ?A ?B ?F; embedding_functor ?B ?C ?G\<rbrakk> \<Longrightarrow> embedding_functor ?A ?C (?G \<circ> ?F)

goal (1 subgoal):
 1. embedding_functor A C local.map
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_embedding_functor A C local.map
[PROOF STEP]
interpret full_functor A C \<open>G o F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
using F.full_functor_axioms G.full_functor_axioms full_functors_compose
[PROOF STATE]
proof (prove)
using this:
full_functor A B F
full_functor B C G
\<lbrakk>full_functor ?A ?B ?F; full_functor ?B ?C ?G\<rbrakk> \<Longrightarrow> full_functor ?A ?C (?G \<circ> ?F)

goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_embedding_functor A C local.map
[PROOF STEP]
show "full_embedding_functor A C (G o F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_embedding_functor A C local.map
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
full_embedding_functor A C local.map

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_component_of_set:
   "connected_component_of_set X x = {y. \<exists>T. connectedin X T \<and> x \<in> T \<and> y \<in> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_component_of_set X x = {y. \<exists>T. connectedin X T \<and> x \<in> T \<and> y \<in> T}
[PROOF STEP]
by (meson connected_component_of_def)


[STATEMENT]
lemma d_delta_ln_upper_3: "x > 0 \<Longrightarrow>
    ((\<lambda>x. ln_upper_3 x - ln x) has_field_derivative diff_delta_ln_upper_3 x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. ln_upper_3 x - ln x) has_real_derivative diff_delta_ln_upper_3 x) (at x)
[PROOF STEP]
unfolding ln_upper_3_def diff_delta_ln_upper_3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((\<lambda>x. (x + 5) * (x - 1) / (2 * (2 * x + 1)) - ln x) has_real_derivative (x - 1) ^ 3 / ((2 * x + 1)\<^sup>2 * x)) (at x)
[PROOF STEP]
apply (intro derivative_eq_intros | simp)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ((2 * x + 4) * (4 * x + 2) - (x + 5) * (x - 1) * 4) / ((4 * x + 2) * (4 * x + 2)) - 1 / x = (x - 1) ^ 3 / ((2 * x + 1)\<^sup>2 * x)
[PROOF STEP]
apply (simp add: divide_simps add_nonneg_eq_0_iff, algebra)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma to_depressed_quartic: fixes a4 :: "'a :: field_char_0"
  assumes a4: "a4 \<noteq> 0"
  and b: "b = a3 / a4"
  and c: "c = a2 / a4"
  and d: "d = a1 / a4"
  and e: "e = a0 / a4"
  and p: "p = c - (3/8) * b^2"
  and q: "q = (b^3 - 4*b*c + 8 * d) / 8"
  and r: "r = ( -3 * b^4 + 256 * e - 64 * b * d + 16 * b^2 * c) / 256"
  and x: "x = y - b/4"
shows "a4 * x^4 + a3 * x^3 + a2 * x^2 + a1 * x + a0 = 0
  \<longleftrightarrow> y^4 + p * y^2 + q * y + r = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
have "a4 * x^4 + a3 * x^3 + a2 * x^2 + a1 * x + a0 = 0 \<longleftrightarrow>
    (a4 * x^4 + a3 * x^3 + a2 * x^2 + a1 * x + a0) / a4 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = ((a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = (0::'a))
[PROOF STEP]
using a4
[PROOF STATE]
proof (prove)
using this:
a4 \<noteq> (0::'a)

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = ((a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = ((a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = (0::'a))

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = ((a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = (0::'a))

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
have "(a4 * x^4 + a3 * x^3 + a2 * x^2 + a1 * x + a0) / a4
    = x^4 + b * x^3 + c * x^2 + d * x + e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = x ^ 4 + b * x ^ 3 + c * x\<^sup>2 + d * x + e
[PROOF STEP]
unfolding b c d e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = x ^ 4 + a3 / a4 * x ^ 3 + a2 / a4 * x\<^sup>2 + a1 / a4 * x + a0 / a4
[PROOF STEP]
using a4
[PROOF STATE]
proof (prove)
using this:
a4 \<noteq> (0::'a)

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = x ^ 4 + a3 / a4 * x ^ 3 + a2 / a4 * x\<^sup>2 + a1 / a4 * x + a0 / a4
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = x ^ 4 + b * x ^ 3 + c * x\<^sup>2 + d * x + e

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0) / a4 = x ^ 4 + b * x ^ 3 + c * x\<^sup>2 + d * x + e

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
have "\<dots> = y^4 + p * y^2 + q * y + r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ 4 + b * x ^ 3 + c * x\<^sup>2 + d * x + e = y ^ 4 + p * y\<^sup>2 + q * y + r
[PROOF STEP]
unfolding x p q r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y - b / (4::'a)) ^ 4 + b * (y - b / (4::'a)) ^ 3 + c * (y - b / (4::'a))\<^sup>2 + d * (y - b / (4::'a)) + e = y ^ 4 + (c - (3::'a) / (8::'a) * b\<^sup>2) * y\<^sup>2 + (b ^ 3 - (4::'a) * b * c + (8::'a) * d) / (8::'a) * y + (- (3::'a) * b ^ 4 + (256::'a) * e - (64::'a) * b * d + (16::'a) * b\<^sup>2 * c) / (256::'a)
[PROOF STEP]
by (simp add: field_simps power4_eq_xxxx power3_eq_cube power2_eq_square)
[PROOF STATE]
proof (state)
this:
x ^ 4 + b * x ^ 3 + c * x\<^sup>2 + d * x + e = y ^ 4 + p * y\<^sup>2 + q * y + r

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))

goal (1 subgoal):
 1. (a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(a4 * x ^ 4 + a3 * x ^ 3 + a2 * x\<^sup>2 + a1 * x + a0 = (0::'a)) = (y ^ 4 + p * y\<^sup>2 + q * y + r = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma denote_dim_pdo:
  "well_com S \<Longrightarrow> \<rho> \<in> carrier_mat d d \<Longrightarrow> partial_density_operator \<rho>
   \<Longrightarrow> (denote S \<rho> \<in> carrier_mat d d) \<and> (partial_density_operator (denote S \<rho>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>well_com S; \<rho> \<in> carrier_mat d d; partial_density_operator \<rho>\<rbrakk> \<Longrightarrow> denote S \<rho> \<in> carrier_mat d d \<and> partial_density_operator (denote S \<rho>)
[PROOF STEP]
using denote_positive_trace_dim
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_com ?S; ?\<rho> \<in> carrier_mat d d; partial_density_operator ?\<rho>\<rbrakk> \<Longrightarrow> positive (denote ?S ?\<rho>) \<and> trace (denote ?S ?\<rho>) \<le> trace ?\<rho> \<and> denote ?S ?\<rho> \<in> carrier_mat d d

goal (1 subgoal):
 1. \<lbrakk>well_com S; \<rho> \<in> carrier_mat d d; partial_density_operator \<rho>\<rbrakk> \<Longrightarrow> denote S \<rho> \<in> carrier_mat d d \<and> partial_density_operator (denote S \<rho>)
[PROOF STEP]
unfolding partial_density_operator_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_com ?S; ?\<rho> \<in> carrier_mat d d; positive ?\<rho> \<and> trace ?\<rho> \<le> 1\<rbrakk> \<Longrightarrow> positive (denote ?S ?\<rho>) \<and> trace (denote ?S ?\<rho>) \<le> trace ?\<rho> \<and> denote ?S ?\<rho> \<in> carrier_mat d d

goal (1 subgoal):
 1. \<lbrakk>well_com S; \<rho> \<in> carrier_mat d d; positive \<rho> \<and> trace \<rho> \<le> 1\<rbrakk> \<Longrightarrow> denote S \<rho> \<in> carrier_mat d d \<and> positive (denote S \<rho>) \<and> trace (denote S \<rho>) \<le> 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma newton_poly_sound: assumes "k \<le> n"
  shows "poly (newton_poly n) (x k) = f k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
have "poly (newton_poly n) (x k) =
    sum_list (map (\<lambda> j. xij_f 0 (0 + j) * pprod k 0 (0 + j)) [0..<Suc k - 0])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = (\<Sum>j\<leftarrow>[0..<Suc k - 0]. xij_f 0 (0 + j) * pprod k 0 (0 + j))
[PROOF STEP]
unfolding poly_newton_poly_xj[OF assms] c_def poly_N_xi
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<leftarrow>[0..<Suc k]. xij_f 0 i * pprod k 0 i) = (\<Sum>j\<leftarrow>[0..<Suc k - 0]. xij_f 0 (0 + j) * pprod k 0 (0 + j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (local.newton_poly n) (x k) = (\<Sum>j\<leftarrow>[0..<Suc k - 0]. xij_f 0 (0 + j) * pprod k 0 (0 + j))

goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (local.newton_poly n) (x k) = (\<Sum>j\<leftarrow>[0..<Suc k - 0]. xij_f 0 (0 + j) * pprod k 0 (0 + j))

goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
have "\<dots> = f k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<leftarrow>[0..<Suc k - 0]. xij_f 0 (0 + j) * pprod k 0 (0 + j)) = f k
[PROOF STEP]
by (rule divided_differences[OF assms], simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<leftarrow>[0..<Suc k - 0]. xij_f 0 (0 + j) * pprod k 0 (0 + j)) = f k

goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly (local.newton_poly n) (x k) = f k

goal (1 subgoal):
 1. poly (local.newton_poly n) (x k) = f k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (local.newton_poly n) (x k) = f k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code]:
  \<open>Enum.enum_all P \<longleftrightarrow> Ball UNIV P\<close>
  \<open>Enum.enum_ex P \<longleftrightarrow> Bex UNIV P\<close> for P :: \<open>'a word \<Rightarrow> bool\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enum_class.enum_all P = Ball UNIV P &&& enum_class.enum_ex P = Bex UNIV P
[PROOF STEP]
by (simp_all add: enum_all_word_def enum_ex_word_def)


[STATEMENT]
lemma compact_sing [simp]: "compact {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {a}
[PROOF STEP]
unfolding compact_eq_Heine_Borel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>C. Ball C open \<and> {a} \<subseteq> \<Union> C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> {a} \<subseteq> \<Union> D)
[PROOF STEP]
by auto


[STATEMENT]
lemma subdesign_image_is_design:
  assumes "sub_set_system V B \<V> \<B>"
  assumes "design V B"
  shows "design (\<pi> ` V) (blocks_image B \<pi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. design (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. design (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
interpret fin: finite_incidence_system "(\<pi> ` V)" "(blocks_image B \<pi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_incidence_system (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
design V B

goal (1 subgoal):
 1. finite_incidence_system (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
by (simp add: design.axioms(1) finite_incidence_system.image_set_system_finite)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. design (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
interpret des: sub_design V B \<V> \<B>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sub_design V B \<V> \<B>
[PROOF STEP]
using assms design.wf_design_iff
[PROOF STATE]
proof (prove)
using this:
sub_set_system V B \<V> \<B>
design V B
\<lbrakk>design ?point_set ?block_collection; ?bl \<in># ?block_collection\<rbrakk> \<Longrightarrow> design ?point_set ?block_collection = (?bl \<subseteq> ?point_set \<and> finite ?point_set \<and> ?bl \<noteq> {})

goal (1 subgoal):
 1. sub_design V B \<V> \<B>
[PROOF STEP]
by (unfold_locales, auto simp add: sub_set_system.points_subset sub_set_system.blocks_subset)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. design (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
have bl_img: "blocks_image B \<pi> \<subseteq># \<B>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blocks_image B \<pi> \<subseteq># \<B>'
[PROOF STEP]
by (simp add: blocks_image_def des.blocks_subset image_mset_subseteq_mono iso_is_image_block)
[PROOF STATE]
proof (state)
this:
blocks_image B \<pi> \<subseteq># \<B>'

goal (1 subgoal):
 1. design (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
blocks_image B \<pi> \<subseteq># \<B>'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
blocks_image B \<pi> \<subseteq># \<B>'

goal (1 subgoal):
 1. design (\<pi> ` V) (blocks_image B \<pi>)
[PROOF STEP]
proof (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>{} \<in># blocks_image B \<pi>; blocks_image B \<pi> \<subseteq># \<B>'\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show "{} \<in># blocks_image B \<pi> \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<in># blocks_image B \<pi> \<Longrightarrow> False
[PROOF STEP]
using assms subdesign_iso_implies target.blocks_nempty bl_img
[PROOF STATE]
proof (prove)
using this:
sub_set_system V B \<V> \<B>
design V B
sub_set_system ?V ?B \<V> \<B> \<Longrightarrow> sub_set_system (\<pi> ` ?V) (blocks_image ?B \<pi>) \<V>' \<B>'
?bl \<in># \<B>' \<Longrightarrow> ?bl \<noteq> {}
blocks_image B \<pi> \<subseteq># \<B>'

goal (1 subgoal):
 1. {} \<in># blocks_image B \<pi> \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{} \<in># blocks_image B \<pi> \<Longrightarrow> False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
design (\<pi> ` V) (blocks_image B \<pi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locally_finite_onE:
  assumes "locally_finite_on X I U"
  assumes "p \<in> X"
  obtains N where "p \<in> N" "open N" "finite {i\<in>I. U i \<inter> N \<noteq> {}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<lbrakk>p \<in> N; open N; finite {i \<in> I. U i \<inter> N \<noteq> {}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally_finite_on X I U
p \<in> X

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>p \<in> N; open N; finite {i \<in> I. U i \<inter> N \<noteq> {}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: locally_finite_on_def)


[STATEMENT]
lemma path_connected_Ico[simp]: "path_connected {a..<b}" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected {a..<b}
[PROOF STEP]
by (simp add: convex_imp_path_connected)


[STATEMENT]
lemma sublist_list_if_append: "
  sublist_list_if xs (ys @ zs) = sublist_list_if xs ys @ sublist_list_if xs zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sublist_list_if xs (ys @ zs) = sublist_list_if xs ys @ sublist_list_if xs zs
[PROOF STEP]
by (simp add: sublist_list_if_sublist_list_filter_conv sublist_list_append)


[STATEMENT]
lemma scaleR_nonpos_nonneg: "a \<le> 0 \<Longrightarrow> 0 \<le> x \<Longrightarrow> a *\<^sub>R x \<le> 0"
  for x :: "'a::ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> 0; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> (0::'a)
[PROOF STEP]
using scaleR_right_mono [of a 0 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> 0; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> 0 *\<^sub>R x

goal (1 subgoal):
 1. \<lbrakk>a \<le> 0; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma Minimal_SolutionsI:
  assumes "(x, y) \<in> Solutions a b"
    and "nonzero x"
    and "\<not> (\<exists>(u, v) \<in> Solutions a b. nonzero u \<and> u @ v <\<^sub>v x @ y)"
  shows "(x, y) \<in> Minimal_Solutions a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> Minimal_Solutions a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> Solutions a b
nonzero x
\<not> (\<exists>(u, v)\<in>Solutions a b. nonzero u \<and> u @ v <\<^sub>v x @ y)

goal (1 subgoal):
 1. (x, y) \<in> Minimal_Solutions a b
[PROOF STEP]
by (auto simp: hlde_ops.Minimal_Solutions_def)


[STATEMENT]
lemma fds_truncate_deriv: "fds_truncate m (fds_deriv f) = fds_deriv (fds_truncate m f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_truncate m (fds_deriv f) = fds_deriv (fds_truncate m f)
[PROOF STEP]
by (simp add: fds_eq_iff fds_nth_truncate fds_deriv_def)


[STATEMENT]
lemma continuous_map_closedin:
   "continuous_map X Y f \<longleftrightarrow>
         (\<forall>x \<in> topspace X. f x \<in> topspace Y) \<and>
         (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X Y f = ((\<forall>x\<in>topspace X. f x \<in> topspace Y) \<and> (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_map X Y f = ((\<forall>x\<in>topspace X. f x \<in> topspace Y) \<and> (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}))
[PROOF STEP]
have "(\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) =
        (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})"
    if "\<And>x. x \<in> topspace X \<Longrightarrow> f x \<in> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})
[PROOF STEP]
have eq: "{x \<in> topspace X. f x \<in> topspace Y \<and> f x \<notin> C} = (topspace X - {x \<in> topspace X. f x \<in> C})" for C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> topspace X. f x \<in> topspace Y \<and> f x \<notin> C} = topspace X - {x \<in> topspace X. f x \<in> C}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
?x \<in> topspace X \<Longrightarrow> f ?x \<in> topspace Y

goal (1 subgoal):
 1. {x \<in> topspace X. f x \<in> topspace Y \<and> f x \<notin> C} = topspace X - {x \<in> topspace X. f x \<in> C}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> topspace X. f x \<in> topspace Y \<and> f x \<notin> ?C} = topspace X - {x \<in> topspace X. f x \<in> ?C}

goal (1 subgoal):
 1. (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})
[PROOF STEP]
proof (intro iffI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>C. \<lbrakk>\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}; closedin Y C\<rbrakk> \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
 2. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>C. \<lbrakk>\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}; closedin Y C\<rbrakk> \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
 2. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
assume "\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}" and "closedin Y C"
[PROOF STATE]
proof (state)
this:
\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
closedin Y C

goal (2 subgoals):
 1. \<And>C. \<lbrakk>\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}; closedin Y C\<rbrakk> \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
 2. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
closedin Y C
[PROOF STEP]
have "openin X {x \<in> topspace X. f x \<in> topspace Y - C}"
[PROOF STATE]
proof (prove)
using this:
\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
closedin Y C

goal (1 subgoal):
 1. openin X {x \<in> topspace X. f x \<in> topspace Y - C}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
openin X {x \<in> topspace X. f x \<in> topspace Y - C}

goal (2 subgoals):
 1. \<And>C. \<lbrakk>\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}; closedin Y C\<rbrakk> \<Longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
 2. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin X {x \<in> topspace X. f x \<in> topspace Y - C}
[PROOF STEP]
show "closedin X {x \<in> topspace X. f x \<in> C}"
[PROOF STATE]
proof (prove)
using this:
openin X {x \<in> topspace X. f x \<in> topspace Y - C}

goal (1 subgoal):
 1. closedin X {x \<in> topspace X. f x \<in> C}
[PROOF STEP]
by (auto simp add: closedin_def eq)
[PROOF STATE]
proof (state)
this:
closedin X {x \<in> topspace X. f x \<in> C}

goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
fix U
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
assume "\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}" and "openin Y U"
[PROOF STATE]
proof (state)
this:
\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
openin Y U

goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
openin Y U
[PROOF STEP]
have "closedin X {x \<in> topspace X. f x \<in> topspace Y - U}"
[PROOF STATE]
proof (prove)
using this:
\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}
openin Y U

goal (1 subgoal):
 1. closedin X {x \<in> topspace X. f x \<in> topspace Y - U}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closedin X {x \<in> topspace X. f x \<in> topspace Y - U}

goal (1 subgoal):
 1. \<And>U. \<lbrakk>\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}; openin Y U\<rbrakk> \<Longrightarrow> openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closedin X {x \<in> topspace X. f x \<in> topspace Y - U}
[PROOF STEP]
show "openin X {x \<in> topspace X. f x \<in> U}"
[PROOF STATE]
proof (prove)
using this:
closedin X {x \<in> topspace X. f x \<in> topspace Y - U}

goal (1 subgoal):
 1. openin X {x \<in> topspace X. f x \<in> U}
[PROOF STEP]
by (auto simp add: openin_closedin_eq eq)
[PROOF STATE]
proof (state)
this:
openin X {x \<in> topspace X. f x \<in> U}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> topspace X \<Longrightarrow> f x \<in> topspace Y) \<Longrightarrow> (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})

goal (1 subgoal):
 1. continuous_map X Y f = ((\<forall>x\<in>topspace X. f x \<in> topspace Y) \<and> (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> topspace X \<Longrightarrow> f x \<in> topspace Y) \<Longrightarrow> (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> topspace X \<Longrightarrow> f x \<in> topspace Y) \<Longrightarrow> (\<forall>U. openin Y U \<longrightarrow> openin X {x \<in> topspace X. f x \<in> U}) = (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C})

goal (1 subgoal):
 1. continuous_map X Y f = ((\<forall>x\<in>topspace X. f x \<in> topspace Y) \<and> (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}))
[PROOF STEP]
by (auto simp: continuous_map_def)
[PROOF STATE]
proof (state)
this:
continuous_map X Y f = ((\<forall>x\<in>topspace X. f x \<in> topspace Y) \<and> (\<forall>C. closedin Y C \<longrightarrow> closedin X {x \<in> topspace X. f x \<in> C}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diagonal_to_Smith_i_dvd2:
  fixes A::"'a:: {bezout_ring}^'b::mod_type^'c::mod_type"
  assumes ib: "is_bezout_ext bezout"
  and i_min: "i < min (nrows A) (ncols A)"
  and elements_xs_range: "\<forall>x. x \<in> set xs \<longrightarrow> x<min (nrows A) (ncols A)"
  and dvd_condition: "\<forall>a b. to_nat a \<in> insert i (set xs) \<and> to_nat a = to_nat b \<longrightarrow>
      A $ (from_nat c) $ (from_nat c) dvd A $ a $ b"
  and c_notin: "c \<notin> (set xs)"
  and c: "c < min (nrows A) (ncols A)"
  and distinct: "distinct xs"
  and ab: "to_nat a = to_nat b"
  and a_in: "to_nat a \<in> insert i (set xs)"
  shows "A $ (from_nat c) $ (from_nat c) dvd (diagonal_to_Smith_i xs A i bezout) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
proof (cases "a = from_nat i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
 2. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = from_nat i

goal (2 subgoals):
 1. a = from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
 2. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
hence b: "b = from_nat i"
[PROOF STATE]
proof (prove)
using this:
a = from_nat i

goal (1 subgoal):
 1. b = from_nat i
[PROOF STEP]
by (metis ab from_nat_to_nat_id i_min min_less_iff_conj nrows_def to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
b = from_nat i

goal (2 subgoals):
 1. a = from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
 2. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
by (unfold True b, rule diagonal_to_Smith_i_dvd, insert assms, auto)
[PROOF STATE]
proof (state)
this:
A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> from_nat i

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
have ai: "to_nat a \<noteq> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_nat a \<noteq> i
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
a \<noteq> from_nat i

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

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
hence bi: "to_nat b \<noteq> i"
[PROOF STATE]
proof (prove)
using this:
to_nat a \<noteq> i

goal (1 subgoal):
 1. to_nat b \<noteq> i
[PROOF STEP]
by (simp add: ab)
[PROOF STATE]
proof (state)
this:
to_nat b \<noteq> i

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
have "A $ (from_nat c) $ (from_nat c) dvd (diagonal_to_Smith_i xs A i bezout) $ from_nat i $ from_nat i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ from_nat i $ from_nat i
[PROOF STEP]
by (rule diagonal_to_Smith_i_dvd, insert assms, auto)
[PROOF STATE]
proof (state)
this:
A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ from_nat i $ from_nat i

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ from_nat i $ from_nat i

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
have "... dvd (diagonal_to_Smith_i xs A i bezout) $ a $ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_to_Smith_i xs A i bezout $ from_nat i $ from_nat i dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
by (rule diagonal_to_Smith_i_dvd_jj, insert assms False ai bi, auto)
[PROOF STATE]
proof (state)
this:
diagonal_to_Smith_i xs A i bezout $ from_nat i $ from_nat i dvd diagonal_to_Smith_i xs A i bezout $ a $ b

goal (1 subgoal):
 1. a \<noteq> from_nat i \<Longrightarrow> A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b

goal (1 subgoal):
 1. A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A $ from_nat c $ from_nat c dvd diagonal_to_Smith_i xs A i bezout $ a $ b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma congruence_jneg:
  fixes b m j l :: nat
  assumes "b>2" and "2*l*m > j" and "j>=1"
  defines "n \<equiv> nat(int 2*l*m- int j)"
  shows "A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
from A_pow assms(1)
[PROOF STATE]
proof (chain)
picking this:
2 < ?b \<Longrightarrow> A ?b ?n = mat_pow ?n (B ?b)
2 < b
[PROOF STEP]
have Abm2: "A b n = mat_pow n (B b)"
[PROOF STATE]
proof (prove)
using this:
2 < ?b \<Longrightarrow> A ?b ?n = mat_pow ?n (B ?b)
2 < b

goal (1 subgoal):
 1. A b n = mat_pow n (B b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A b n = mat_pow n (B b)

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
from Abm2 n_def
[PROOF STATE]
proof (chain)
picking this:
A b n = mat_pow n (B b)
n \<equiv> nat (int 2 * int l * int m - int j)
[PROOF STEP]
have Bn: "A b n = mat_pow (nat(int 2*l*m- int j)) (B b)"
[PROOF STATE]
proof (prove)
using this:
A b n = mat_pow n (B b)
n \<equiv> nat (int 2 * int l * int m - int j)

goal (1 subgoal):
 1. A b n = mat_pow (nat (int 2 * int l * int m - int j)) (B b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A b n = mat_pow (nat (int 2 * int l * int m - int j)) (B b)

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
from Bn congruence_mult assms(1) assms(2)
[PROOF STATE]
proof (chain)
picking this:
A b n = mat_pow (nat (int 2 * int l * int m - int j)) (B b)
\<lbrakk>2 < ?b; ?m < ?n\<rbrakk> \<Longrightarrow> mat_pow (nat (int ?n - int ?m)) (B ?b) = mat_mul (mat_pow ?n (B ?b)) (mat_pow ?m (B_inv ?b))
2 < b
j < 2 * l * m
[PROOF STEP]
have Bn2: "A b n = mat_mul (mat_pow (2*l*m) (B b)) (mat_pow j (B_inv b))"
[PROOF STATE]
proof (prove)
using this:
A b n = mat_pow (nat (int 2 * int l * int m - int j)) (B b)
\<lbrakk>2 < ?b; ?m < ?n\<rbrakk> \<Longrightarrow> mat_pow (nat (int ?n - int ?m)) (B ?b) = mat_mul (mat_pow ?n (B ?b)) (mat_pow ?m (B_inv ?b))
2 < b
j < 2 * l * m

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow (2 * l * m) (B b)) (mat_pow j (B_inv b))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A b n = mat_mul (mat_pow (2 * l * m) (B b)) (mat_pow j (B_inv b))

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
from assms(1) assms(3) congruence_inverse Bn2 add.commute le_Suc_ex
[PROOF STATE]
proof (chain)
picking this:
2 < b
1 \<le> j
2 < ?b \<Longrightarrow> mat_pow (?n + 1) (B_inv ?b) = A_inv ?b (?n + 1)
A b n = mat_mul (mat_pow (2 * l * m) (B b)) (mat_pow j (B_inv b))
?a + ?b = ?b + ?a
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n
[PROOF STEP]
have Bn3: "A b n = mat_mul (mat_pow (2*l*m) (B b)) (A_inv b j)"
[PROOF STATE]
proof (prove)
using this:
2 < b
1 \<le> j
2 < ?b \<Longrightarrow> mat_pow (?n + 1) (B_inv ?b) = A_inv ?b (?n + 1)
A b n = mat_mul (mat_pow (2 * l * m) (B b)) (mat_pow j (B_inv b))
?a + ?b = ?b + ?a
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow (2 * l * m) (B b)) (A_inv b j)
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
A b n = mat_mul (mat_pow (2 * l * m) (B b)) (A_inv b j)

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
from Bn3 A_pow assms(1) mult.commute B.simps mat_exp_law_mult
[PROOF STATE]
proof (chain)
picking this:
A b n = mat_mul (mat_pow (2 * l * m) (B b)) (A_inv b j)
2 < ?b \<Longrightarrow> A ?b ?n = mat_pow ?n (B ?b)
2 < b
?a * ?b = ?b * ?a
B ?b = mat (int ?b) (- 1) 1 0
mat_pow (?n * ?m) ?M = mat_pow ?n (mat_pow ?m ?M)
[PROOF STEP]
have as3: "A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)"
[PROOF STATE]
proof (prove)
using this:
A b n = mat_mul (mat_pow (2 * l * m) (B b)) (A_inv b j)
2 < ?b \<Longrightarrow> A ?b ?n = mat_pow ?n (B ?b)
2 < b
?a * ?b = ?b * ?a
B ?b = mat (int ?b) (- 1) 1 0
mat_pow (?n * ?m) ?M = mat_pow ?n (mat_pow ?m ?M)

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
from as3 A_pow add.commute assms(1) mat_exp_law mat_exp_law_mult
[PROOF STATE]
proof (chain)
picking this:
A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
2 < ?b \<Longrightarrow> A ?b ?n = mat_pow ?n (B ?b)
?a + ?b = ?b + ?a
2 < b
mat_mul (mat_pow ?n ?M) (mat_pow ?m ?M) = mat_pow (?n + ?m) ?M
mat_pow (?n * ?m) ?M = mat_pow ?n (mat_pow ?m ?M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
2 < ?b \<Longrightarrow> A ?b ?n = mat_pow ?n (B ?b)
?a + ?b = ?b + ?a
2 < b
mat_mul (mat_pow ?n ?M) (mat_pow ?m ?M) = mat_pow (?n + ?m) ?M
mat_pow (?n * ?m) ?M = mat_pow ?n (mat_pow ?m ?M)

goal (1 subgoal):
 1. A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A b n = mat_mul (mat_pow l (mat_pow 2 (A b m))) (A_inv b j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hcomplex_hcnj_add: "\<And>w z. hcnj (w + z) = hcnj w + hcnj z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w z. hcnj (w + z) = hcnj w + hcnj z
[PROOF STEP]
by transfer (rule complex_cnj_add)


[STATEMENT]
lemma bounded_imp_bdd_above: "bounded S \<Longrightarrow> bdd_above (S :: real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> bdd_above S
[PROOF STEP]
by (auto simp: bounded_def bdd_above_def dist_real_def)
     (metis abs_le_D1 abs_minus_commute diff_le_eq)


[STATEMENT]
lemma gtrace_infinite:
    assumes "grun A w V r v"
    shows "infinite (sset (gtrace r v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (sset (gtrace r v))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
grun A w V r v

goal (1 subgoal):
 1. infinite (sset (gtrace r v))
[PROOF STEP]
by (metis grun_elim gtrace_alt_def infinite_Ici sset_fromN sset_szip_finite)


[STATEMENT]
lemma step_nonneg': "i < k \<Longrightarrow> x \<ge> x\<^sub>1 \<Longrightarrow> bs ! i + (hs ! i) x / x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < k; x\<^sub>1 \<le> x\<rbrakk> \<Longrightarrow> 0 \<le> bs ! i + (hs ! i) x / x
[PROOF STEP]
by (frule (1) step_nonneg, insert x0_pos x0_le_x1) (simp_all add: field_simps)


[STATEMENT]
lemma eexp_ineq_iff [simp]:
  "eexp x \<le> 1 \<longleftrightarrow> x \<le> 0"
  "eexp x \<ge> 1 \<longleftrightarrow> x \<ge> 0"
  "eexp x > 1 \<longleftrightarrow> x > 0"
  "eexp x < 1 \<longleftrightarrow> x < 0"
  "eexp x \<ge> 0"
  "eexp x > 0 \<longleftrightarrow> x \<noteq> - \<infinity>"
  "eexp x < \<infinity> \<longleftrightarrow> x \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((eexp x \<le> 1) = (x \<le> 0) &&& (1 \<le> eexp x) = (0 \<le> x) &&& (1 < eexp x) = (0 < x)) &&& ((eexp x < 1) = (x < 0) &&& 0 \<le> eexp x) &&& (0 < eexp x) = (x \<noteq> - \<infinity>) &&& (eexp x < \<infinity>) = (x \<noteq> \<infinity>)
[PROOF STEP]
apply (metis eexp_le_eexp_iff_le eexp_lt_eexp_iff_lt eexp_special_values)+
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 \<le> eexp x
 2. (0 < eexp x) = (x \<noteq> - \<infinity>)
 3. (eexp x < \<infinity>) = (x \<noteq> \<infinity>)
[PROOF STEP]
apply (simp add: eexp_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (0 < eexp x) = (x \<noteq> - \<infinity>)
 2. (eexp x < \<infinity>) = (x \<noteq> \<infinity>)
[PROOF STEP]
using eexp_strict_mono2
[PROOF STATE]
proof (prove)
using this:
?x < ?y \<Longrightarrow> eexp ?x < eexp ?y

goal (2 subgoals):
 1. (0 < eexp x) = (x \<noteq> - \<infinity>)
 2. (eexp x < \<infinity>) = (x \<noteq> \<infinity>)
[PROOF STEP]
apply (force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eexp x < \<infinity>) = (x \<noteq> \<infinity>)
[PROOF STEP]
by simp


[STATEMENT]
lemma ccspan_Times_sing2: \<open>ccspan (B \<times> {0::'a::complex_normed_vector}) = ccsubspace_Times (ccspan B) 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (B \<times> {0::'a}) = ccsubspace_Times (ccspan B) 0
[PROOF STEP]
proof (transfer fixing: B)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
have \<open>closure (cspan (B \<times> {0::'a})) = closure (cspan B \<times> {0})\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B \<times> {0::'a})
[PROOF STEP]
by (simp add: complex_vector.span_Times_sing2)
[PROOF STATE]
proof (state)
this:
closure (cspan (B \<times> {0::'a})) = closure (cspan B \<times> {0::'a})

goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure (cspan (B \<times> {0::'a})) = closure (cspan B \<times> {0::'a})

goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
have \<open>\<dots> = closure (cspan B) \<times> closure {0}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan B \<times> {0::'a}) = closure (cspan B) \<times> closure {0::'a}
[PROOF STEP]
using closure_Times
[PROOF STATE]
proof (prove)
using this:
closure (?A \<times> ?B) = closure ?A \<times> closure ?B

goal (1 subgoal):
 1. closure (cspan B \<times> {0::'a}) = closure (cspan B) \<times> closure {0::'a}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closure (cspan B \<times> {0::'a}) = closure (cspan B) \<times> closure {0::'a}

goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure (cspan B \<times> {0::'a}) = closure (cspan B) \<times> closure {0::'a}

goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
have \<open>\<dots> = closure (cspan B) \<times> {0}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan B) \<times> closure {0::'a} = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closure (cspan B) \<times> closure {0::'a} = closure (cspan B) \<times> {0::'a}

goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
show \<open>closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0}\<close>
[PROOF STATE]
proof (prove)
using this:
closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}

goal (1 subgoal):
 1. closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
closure (cspan (B \<times> {0::'a})) = closure (cspan B) \<times> {0::'a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma moebius_dilatation_plus [simp]:
  assumes "a1 > 0" and "a2 > 0"
  shows "(moebius_dilatation a1) + (moebius_dilatation a2) = moebius_dilatation (a1 * a2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_dilatation a1 + moebius_dilatation a2 = moebius_dilatation (a1 * a2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a1
0 < a2

goal (1 subgoal):
 1. moebius_dilatation a1 + moebius_dilatation a2 = moebius_dilatation (a1 * a2)
[PROOF STEP]
by simp


[STATEMENT]
lemma sum_rel_range[relator_props]:
  "\<lbrakk> Range Rl=UNIV; Range Rr=UNIV \<rbrakk> \<Longrightarrow> Range (\<langle>Rl,Rr\<rangle>sum_rel) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Range Rl = UNIV; Range Rr = UNIV\<rbrakk> \<Longrightarrow> Range (\<langle>Rl, Rr\<rangle>sum_rel) = UNIV
[PROOF STEP]
apply (auto simp: sum_rel_def Range_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Range Rl = UNIV; Range Rr = UNIV\<rbrakk> \<Longrightarrow> \<exists>y. (\<exists>a. y = Inl a \<and> (\<exists>a'. x = Inl a' \<and> (a, a') \<in> Rl)) \<or> (\<exists>a. y = Inr a \<and> (\<exists>a'. x = Inr a' \<and> (a, a') \<in> Rr))
[PROOF STEP]
by (metis Range_iff UNIV_I sumE)


[STATEMENT]
lemma lens_quotient_comp:
  "\<lbrakk> weak_lens Y; X \<subseteq>\<^sub>L Y \<rbrakk> \<Longrightarrow> (X /\<^sub>L Y) ;\<^sub>L Y = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>weak_lens Y; X \<subseteq>\<^sub>L Y\<rbrakk> \<Longrightarrow> X /\<^sub>L Y ;\<^sub>L Y = X
[PROOF STEP]
by (auto simp add: lens_quotient_def lens_comp_def comp_def sublens_def)


[STATEMENT]
theorem (in tree_automaton) remap_lang:
  "inj_on f (ta_rstates TA) \<Longrightarrow> ta_lang (ta_remap f TA) = ta_lang TA"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f Q \<Longrightarrow> ta_lang (ta_remap f TA) = ta_lang TA
[PROOF STEP]
by (auto intro: remap_lang1 remap_lang2)


[STATEMENT]
lemma right_associativity: "x\<otimes>(y\<otimes>z) =x \<otimes> y \<otimes>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<otimes> y \<otimes> z = x \<otimes> y \<otimes> z
[PROOF STEP]
by auto


[STATEMENT]
lemma tmp: "(!x : A. P x | Q) ==> (! x : A. P x) | Q "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. P x \<or> Q \<Longrightarrow> (\<forall>x\<in>A. P x) \<or> Q
[PROOF STEP]
by blast


[STATEMENT]
lemma "[| (x::nat) > y; y > z; z > x |] ==> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y < x; z < y; x < z\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by linarith


[STATEMENT]
lemma X_I_XpZ_eq:
  shows "X_I * I_XpZ = X_XpZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X_I * I_XpZ = X_XpZ
[PROOF STEP]
unfolding X_I_def I_XpZ_def X_XpZ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<Otimes> 1\<^sub>m 2) * (1\<^sub>m 2 \<Otimes> XpZ) = X \<Otimes> XpZ
[PROOF STEP]
using mult_distr_tensor
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dim_col ?A = dim_row ?B; dim_col ?C = dim_row ?D; 0 < dim_col ?A; 0 < dim_col ?B; 0 < dim_col ?C; 0 < dim_col ?D\<rbrakk> \<Longrightarrow> ?A * ?B \<Otimes> ?C * ?D = (?A \<Otimes> ?C) * (?B \<Otimes> ?D)

goal (1 subgoal):
 1. (X \<Otimes> 1\<^sub>m 2) * (1\<^sub>m 2 \<Otimes> XpZ) = X \<Otimes> XpZ
[PROOF STEP]
by (metis (no_types, lifting) X_inv XpZ_inv index_mult_mat(2) index_mult_mat(3) index_one_mat(2)
      index_one_mat(3) left_mult_one_mat' pos2 right_mult_one_mat')


[STATEMENT]
lemma Z_I_XpZ_eq:
  shows "Z_I * I_XpZ = Z_XpZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z_I * I_XpZ = Z_XpZ
[PROOF STEP]
unfolding Z_I_def I_XpZ_def Z_XpZ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Z \<Otimes> 1\<^sub>m 2) * (1\<^sub>m 2 \<Otimes> XpZ) = Z \<Otimes> XpZ
[PROOF STEP]
using mult_distr_tensor
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dim_col ?A = dim_row ?B; dim_col ?C = dim_row ?D; 0 < dim_col ?A; 0 < dim_col ?B; 0 < dim_col ?C; 0 < dim_col ?D\<rbrakk> \<Longrightarrow> ?A * ?B \<Otimes> ?C * ?D = (?A \<Otimes> ?C) * (?B \<Otimes> ?D)

goal (1 subgoal):
 1. (Z \<Otimes> 1\<^sub>m 2) * (1\<^sub>m 2 \<Otimes> XpZ) = Z \<Otimes> XpZ
[PROOF STEP]
by (metis (no_types, lifting) Z_inv XpZ_inv index_mult_mat(2) index_mult_mat(3) index_one_mat(2)
      index_one_mat(3) left_mult_one_mat' pos2 right_mult_one_mat')


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


[STATEMENT]
theorem p10: "q \<longrightarrow> r \<Longrightarrow> r \<longrightarrow> p \<and> q \<Longrightarrow> p \<longrightarrow> q \<or> r \<Longrightarrow> p \<longleftrightarrow> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q \<longrightarrow> r; r \<longrightarrow> p \<and> q; p \<longrightarrow> q \<or> r\<rbrakk> \<Longrightarrow> p = q
[PROOF STEP]
by auto2


[STATEMENT]
lemma isLub_le_isUb: "isLub R S x \<Longrightarrow> isUb R S y \<Longrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isLub R S x; isUb R S y\<rbrakk> \<Longrightarrow> x \<le> y
[PROOF STEP]
unfolding isLub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>leastP (isUb R S) x; isUb R S y\<rbrakk> \<Longrightarrow> x \<le> y
[PROOF STEP]
by (blast intro!: leastPD3)


[STATEMENT]
lemma eucl_le_Basis_list_iff:
  "(x::'a::executable_euclidean_space) \<le> y \<longleftrightarrow>
  (\<forall>i<DIM('a). x \<bullet> Basis_list ! i \<le> y \<bullet> Basis_list ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (\<forall>i<DIM('a). x \<bullet> Basis_list ! i \<le> y \<bullet> Basis_list ! i)
[PROOF STEP]
apply (auto simp:  eucl_le[where 'a='a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<forall>i<DIM('a). x \<bullet> Basis_list ! i \<le> y \<bullet> Basis_list ! i; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> y \<bullet> i
[PROOF STEP]
subgoal for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<DIM('a). x \<bullet> Basis_list ! i \<le> y \<bullet> Basis_list ! i; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> y \<bullet> i
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<DIM('a). x \<bullet> Basis_list ! i \<le> y \<bullet> Basis_list ! i; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> y \<bullet> i
[PROOF STEP]
by (auto dest!: spec[where x="index Basis_list i"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fps_square_nth: "(f^2) $ n = (\<Sum>k\<le>n. f $ k * f $ (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f\<^sup>2 $ n = (\<Sum>k\<le>n. f $ k * f $ (n - k))
[PROOF STEP]
by (simp add: power2_eq_square fps_mult_nth atLeast0AtMost)


[STATEMENT]
lemma RDirProd_iso6:
  assumes "f \<in> ring_iso R R'" and "g \<in> ring_iso S S'"
  shows "(\<lambda>(r, s). (f r, g s)) \<in> ring_iso (RDirProd R S) (RDirProd R' S')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(r, s). (f r, g s)) \<in> ring_iso (RDirProd R S) (RDirProd R' S')
[PROOF STEP]
using ring_iso_set_trans[OF RDirProd_iso4[OF assms(1)] RDirProd_iso5[OF assms(2)]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(r, s). (r, g s)) \<circ> (\<lambda>(r, t). (f r, t)) \<in> ring_iso (RDirProd R S) (RDirProd R' S')

goal (1 subgoal):
 1. (\<lambda>(r, s). (f r, g s)) \<in> ring_iso (RDirProd R S) (RDirProd R' S')
[PROOF STEP]
by (simp add: case_prod_beta' comp_def)


[STATEMENT]
lemma sqrt_int_ceiling_bound: "0 \<le> x \<Longrightarrow> x \<le> (sqrt_int_ceiling x)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> x \<le> (sqrt_int_ceiling x)\<^sup>2
[PROOF STEP]
unfolding sqrt_int_ceiling
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> x \<le> \<lceil>sqrt (real_of_int x)\<rceil>\<^sup>2
[PROOF STEP]
using le_of_int_ceiling sqrt_le_D
[PROOF STATE]
proof (prove)
using this:
?x \<le> of_int \<lceil>?x\<rceil>
sqrt ?x \<le> ?y \<Longrightarrow> ?x \<le> ?y\<^sup>2

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> x \<le> \<lceil>sqrt (real_of_int x)\<rceil>\<^sup>2
[PROOF STEP]
by (metis of_int_power_le_of_int_cancel_iff)


[STATEMENT]
lemma sd_power_prop2 [simp]: "sd_power (x,y) i = (x ^ i, \<Squnion>{\<alpha> (x ^ k) y|k. k < i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
[PROOF STEP]
apply (case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
 2. \<And>nat. i = Suc nat \<Longrightarrow> sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
[PROOF STEP]
using sd_unit_def
[PROOF STATE]
proof (prove)
using this:
sd_unit = (1::?'c, \<bottom>)

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
 2. \<And>nat. i = Suc nat \<Longrightarrow> sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
[PROOF STEP]
using le_simps(2) unital_quantale_module.sd_power_prop1 unital_quantale_module_axioms
[PROOF STATE]
proof (prove)
using this:
(?m < Suc ?n) = (?m \<le> ?n)
unital_quantale_module ?act \<Longrightarrow> power.power sd_unit (unital_quantale_module.sd_prod ?act) (?x, ?y) (Suc ?i) = (?x ^ Suc ?i, \<Squnion> {?act (?x ^ k) ?y |k. k \<le> ?i})
unital_quantale_module \<alpha>

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> sd_power (x, y) i = (x ^ i, \<Squnion> {\<alpha> (x ^ k) y |k. k < i})
[PROOF STEP]
by fastforce


[STATEMENT]
lemma finalConflictingState:
  fixes state :: State
  assumes
  "\<not> applicableBacktrack state F0" and
  "formulaFalse F0 (elements (getM state))"
  shows
  "decisions (getM state) = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decisions (getM state) = []
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> applicableBacktrack state F0
formulaFalse F0 (elements (getM state))

goal (1 subgoal):
 1. decisions (getM state) = []
[PROOF STEP]
using applicableBacktrackCharacterization
[PROOF STATE]
proof (prove)
using this:
\<not> applicableBacktrack state F0
formulaFalse F0 (elements (getM state))
applicableBacktrack ?stateA ?F0.0 = (formulaFalse ?F0.0 (elements (getM ?stateA)) \<and> decisions (getM ?stateA) \<noteq> [])

goal (1 subgoal):
 1. decisions (getM state) = []
[PROOF STEP]
by auto


[STATEMENT]
lemma "bar x n y = (case n of 0 \<Rightarrow> 0 + x | Suc n' \<Rightarrow> n' + x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bar x n y = (case n of 0 \<Rightarrow> 0 + x | Suc n' \<Rightarrow> n' + x)
[PROOF STEP]
by(fact bar_cases)


[STATEMENT]
lemma bigo_compose2:
"f =o g +o O(h) \<Longrightarrow> (\<lambda>x. f(k x)) =o (\<lambda>x. g(k x)) +o O(\<lambda>x. h(k x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>x. f (k x)) \<in> (\<lambda>x. g (k x)) +o O(\<lambda>x. h (k x))
[PROOF STEP]
apply (simp only: set_minus_plus [symmetric] fun_Compl_def func_plus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f - g \<in> O(h) \<Longrightarrow> (\<lambda>x. f (k x)) - (\<lambda>x. g (k x)) \<in> O(\<lambda>x. h (k x))
[PROOF STEP]
apply (drule bigo_compose1 [of "f - g" h k])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f - g) (k x)) \<in> O(\<lambda>x. h (k x)) \<Longrightarrow> (\<lambda>x. f (k x)) - (\<lambda>x. g (k x)) \<in> O(\<lambda>x. h (k x))
[PROOF STEP]
apply (simp add: fun_diff_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in field) pirreducible_imp_not_splitted:
  assumes "p \<in> carrier (poly_ring R)" and "pirreducible (carrier R) p" and "degree p \<noteq> 1"
  shows "\<not> splitted p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> splitted p
[PROOF STEP]
using pirreducible_roots[of p] pirreducible_degree[OF carrier_is_subfield, of p] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<in> carrier (poly_ring R); pirreducible (carrier R) p; degree p \<noteq> 1\<rbrakk> \<Longrightarrow> roots p = {#}
\<lbrakk>p \<in> carrier (poly_ring R); pirreducible (carrier R) p\<rbrakk> \<Longrightarrow> 1 \<le> degree p
p \<in> carrier (poly_ring R)
pirreducible (carrier R) p
degree p \<noteq> 1

goal (1 subgoal):
 1. \<not> splitted p
[PROOF STEP]
by (simp add: splitted_def)


[STATEMENT]
lemma (in Module) monofun_add:"\<lbrakk>R module N; free_generator R M H;
       f \<in> H \<rightarrow> carrier N; h \<in> H; x \<in> fgs R M {h}; y \<in> fgs R M {h}\<rbrakk> \<Longrightarrow>
       monofun R M N f H h (x \<plusminus> y) =
                   monofun R M N f H h x \<plusminus>\<^bsub>N\<^esub> (monofun R M N f H h y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module N; free_generator R M H; f \<in> H \<rightarrow> carrier N; h \<in> H; x \<in> fgs R M {h}; y \<in> fgs R M {h}\<rbrakk> \<Longrightarrow> monofun R M N f H h (x \<plusminus> y) = monofun R M N f H h x \<plusminus>\<^bsub>N\<^esub> monofun R M N f H h y
[PROOF STEP]
apply (frule free_generator_sub,
       cut_tac sc_Ring, frule Ring.ring_is_ag,
       frule subsetD[of H "carrier M" h], assumption+,
       frule fgs_single_span[of h x], assumption+,
       frule fgs_single_span[of h y], assumption+, (erule bexE)+, simp,
       simp add:sc_l_distr[THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>R module N; free_generator R M H; f \<in> H \<rightarrow> carrier N; h \<in> H; a \<cdot>\<^sub>s h \<in> fgs R M {h}; aa \<cdot>\<^sub>s h \<in> fgs R M {h}; H \<subseteq> carrier M; Ring R; aGroup R; h \<in> carrier M; a \<in> carrier R; x = a \<cdot>\<^sub>s h; aa \<in> carrier R; y = aa \<cdot>\<^sub>s h\<rbrakk> \<Longrightarrow> monofun R M N f H h ((a \<plusminus>\<^bsub>R\<^esub> aa) \<cdot>\<^sub>s h) = monofun R M N f H h (a \<cdot>\<^sub>s h) \<plusminus>\<^bsub>N\<^esub> monofun R M N f H h (aa \<cdot>\<^sub>s h)
[PROOF STEP]
apply (frule_tac x = a and y = aa in aGroup.ag_pOp_closed[of R], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>R module N; free_generator R M H; f \<in> H \<rightarrow> carrier N; h \<in> H; a \<cdot>\<^sub>s h \<in> fgs R M {h}; aa \<cdot>\<^sub>s h \<in> fgs R M {h}; H \<subseteq> carrier M; Ring R; aGroup R; h \<in> carrier M; a \<in> carrier R; x = a \<cdot>\<^sub>s h; aa \<in> carrier R; y = aa \<cdot>\<^sub>s h; a \<plusminus>\<^bsub>R\<^esub> aa \<in> carrier R\<rbrakk> \<Longrightarrow> monofun R M N f H h ((a \<plusminus>\<^bsub>R\<^esub> aa) \<cdot>\<^sub>s h) = monofun R M N f H h (a \<cdot>\<^sub>s h) \<plusminus>\<^bsub>N\<^esub> monofun R M N f H h (aa \<cdot>\<^sub>s h)
[PROOF STEP]
apply (simp add:monofun_mhomTr1,
       frule funcset_mem[of f H "carrier N" h], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>R module N; free_generator R M H; f \<in> H \<rightarrow> carrier N; h \<in> H; a \<cdot>\<^sub>s h \<in> fgs R M {h}; aa \<cdot>\<^sub>s h \<in> fgs R M {h}; H \<subseteq> carrier M; Ring R; aGroup R; h \<in> carrier M; a \<in> carrier R; x = a \<cdot>\<^sub>s h; aa \<in> carrier R; y = aa \<cdot>\<^sub>s h; a \<plusminus>\<^bsub>R\<^esub> aa \<in> carrier R; f h \<in> carrier N\<rbrakk> \<Longrightarrow> (a \<plusminus>\<^bsub>R\<^esub> aa) \<cdot>\<^sub>s\<^bsub>N\<^esub> f h = a \<cdot>\<^sub>s\<^bsub>N\<^esub> f h \<plusminus>\<^bsub>N\<^esub> aa \<cdot>\<^sub>s\<^bsub>N\<^esub> f h
[PROOF STEP]
apply (simp add:Module.sc_l_distr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma reduce_system_matrix_subsets_helper_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "(nat list*nat list) list"
  fixes signs :: "rat list list"
  fixes S:: "nat list"
  assumes nonzero: "p \<noteq> 0"
  assumes inv: "length subsets \<ge> length signs"
  assumes well_def_h: "\<forall>x. List.member S x \<longrightarrow> x < length subsets"
  shows "matrix_A_R signs (take_indices subsets S) = take_rows_from_matrix (matrix_A_R signs subsets) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_mat_R signs (take_indices subsets S) = take_rows_from_matrix (M_mat_R signs subsets) S
[PROOF STEP]
using assms reduce_system_matrix_subsets_helper_aux_R alt_matrix_char_R
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
length signs \<le> length subsets
\<forall>x. List.member S x \<longrightarrow> x < length subsets
\<lbrakk>length ?signs \<le> length ?subsets; \<forall>x. List.member ?S x \<longrightarrow> x < length ?subsets; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> alt_matrix_A_R ?signs (take_indices ?subsets ?S) = take_rows_from_matrix (alt_matrix_A_R ?signs ?subsets) ?S
alt_matrix_A_R ?signs ?subsets = M_mat_R ?signs ?subsets

goal (1 subgoal):
 1. M_mat_R signs (take_indices subsets S) = take_rows_from_matrix (M_mat_R signs subsets) S
[PROOF STEP]
by auto


[STATEMENT]
lemma telescope:
  assumes "length (xs :: int list) < Suc (nat n)"
    "set xs \<subseteq> {0..<q}"
  shows "(map to_int_mod_ring)
    (coeffs (of_qr (to_qr (Poly
    (map (of_int_mod_ring :: int \<Rightarrow> 'a mod_ring) xs))))) =
    strip_while (\<lambda>x. x mod q = 0) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
proof (cases "xs = strip_while (\<lambda>x. x mod q = 0) xs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
 2. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
xs = strip_while (\<lambda>x. x mod q = 0) xs

goal (2 subgoals):
 1. xs = strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
 2. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs = strip_while (\<lambda>x. x mod q = 0) xs

goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
using telescope_stripped assms
[PROOF STATE]
proof (prove)
using this:
xs = strip_while (\<lambda>x. x mod q = 0) xs
\<lbrakk>length ?xs < Suc (nat n); strip_while (\<lambda>x. x mod q = 0) ?xs = ?xs; set ?xs \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring ?xs))))) = ?xs
length xs < Suc (nat n)
set xs \<subseteq> {0..<q}

goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
let ?of_int = "(map (of_int_mod_ring ::
    int \<Rightarrow> 'a mod_ring) xs)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
have "xs \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> []
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs

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

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
have "(map to_int_mod_ring)
    (coeffs (of_qr (to_qr (Poly ?of_int)))) =
    (map to_int_mod_ring) (coeffs (Poly ?of_int))"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs)))
[PROOF STEP]
using of_qr_to_qr_Poly[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
xs \<noteq> [] \<Longrightarrow> of_qr (to_qr (Poly (map of_int_mod_ring xs))) = Poly (map of_int_mod_ring xs)

goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs)))

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs)))

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
have "\<dots> = (map to_int_mod_ring)
    (strip_while ((=) 0) ?of_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs))) = map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs))) = map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs))

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (coeffs (Poly (map of_int_mod_ring xs))) = map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs))

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
have "\<dots> = map (to_int_mod_ring \<circ>
    (of_int_mod_ring :: int \<Rightarrow> 'a mod_ring))
    (strip_while (\<lambda>x. x mod q = 0) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs)) = map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs)
[PROOF STEP]
using strip_while_mod_ring
[PROOF STATE]
proof (prove)
using this:
strip_while ((=) 0) (map of_int_mod_ring ?xs) = map of_int_mod_ring (strip_while (\<lambda>x. x mod q = 0) ?xs)

goal (1 subgoal):
 1. map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs)) = map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs)) = map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs)

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (strip_while ((=) 0) (map of_int_mod_ring xs)) = map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs)

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
have "\<dots> = strip_while (\<lambda>x. x mod q = 0) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> {0..<q}

goal (1 subgoal):
 1. map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
proof (induct xs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
case (snoc y ys)
[PROOF STATE]
proof (state)
this:
set ys \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) = strip_while (\<lambda>x. x mod q = 0) ys
set (ys @ [y]) \<subseteq> {0..<q}

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
let ?to_of_mod_ring = "to_int_mod_ring \<circ>
      (of_int_mod_ring :: int \<Rightarrow> 'a mod_ring)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
have "map ?to_of_mod_ring
      (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) =
      (if y mod q = 0
       then map ?to_of_mod_ring (strip_while (\<lambda>x. x mod q = 0) ys)
       else map ?to_of_mod_ring ys @ [?to_of_mod_ring y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = (if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])
[PROOF STEP]
by (subst strip_while_snoc) auto
[PROOF STATE]
proof (state)
this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = (if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = (if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
have "\<dots> = (if y mod q = 0
        then strip_while (\<lambda>x. x mod q = 0) ys
        else map ?to_of_mod_ring ys @ [?to_of_mod_ring y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])
[PROOF STEP]
using snoc
[PROOF STATE]
proof (prove)
using this:
set ys \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) = strip_while (\<lambda>x. x mod q = 0) ys
set (ys @ [y]) \<subseteq> {0..<q}

goal (1 subgoal):
 1. (if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if y mod q = 0 then map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) ys) else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
have "\<dots> = (if y mod q = 0
        then strip_while (\<lambda>x. x mod q = 0) ys
        else ys @ [y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else ys @ [y])
[PROOF STEP]
using map_to_of_mod_ring[OF snoc(2)]
[PROOF STATE]
proof (prove)
using this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (ys @ [y]) = ys @ [y]

goal (1 subgoal):
 1. (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else ys @ [y])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else ys @ [y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else map (to_int_mod_ring \<circ> of_int_mod_ring) ys @ [(to_int_mod_ring \<circ> of_int_mod_ring) y]) = (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else ys @ [y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
have "\<dots> = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else ys @ [y]) = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if y mod q = 0 then strip_while (\<lambda>x. x mod q = 0) ys else ys @ [y]) = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])

goal (2 subgoals):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs; set (xs @ [x]) \<subseteq> {0..<q}\<rbrakk> \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (xs @ [x])) = strip_while (\<lambda>x. x mod q = 0) (xs @ [x])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])

goal (1 subgoal):
 1. map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) (ys @ [y])) = strip_while (\<lambda>x. x mod q = 0) (ys @ [y])

goal (1 subgoal):
 1. set [] \<subseteq> {0..<q} \<Longrightarrow> map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) []) = strip_while (\<lambda>x. x mod q = 0) []
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
map (to_int_mod_ring \<circ> of_int_mod_ring) (strip_while (\<lambda>x. x mod q = 0) xs) = strip_while (\<lambda>x. x mod q = 0) xs

goal (1 subgoal):
 1. xs \<noteq> strip_while (\<lambda>x. x mod q = 0) xs \<Longrightarrow> map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs

goal (1 subgoal):
 1. map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map to_int_mod_ring (coeffs (of_qr (to_qr (Poly (map of_int_mod_ring xs))))) = strip_while (\<lambda>x. x mod q = 0) xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Minus_less_Min_empty: "k < iMin I \<Longrightarrow> k \<ominus> I = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < iMin I \<Longrightarrow> k \<ominus> I = {}
[PROOF STEP]
by (simp add: iT_Minus_image_conv cut_le_Min_empty)


[STATEMENT]
lemma hyperpow_two_le [simp]: "\<And>r. (0::'a::{monoid_mult,linordered_ring_strict} star) \<le> r pow 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. 0 \<le> r pow 2
[PROOF STEP]
by (auto simp add: hyperpow_two zero_le_mult_iff)


[STATEMENT]
lemma double_sum_equiv:
  fixes f::"nat \<Rightarrow> real"
  shows
  "(\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) =
   (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f j * g k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f j * g k)
[PROOF STEP]
by (rule sum.swap)


[STATEMENT]
lemma stut_ex: "(\<And>x. STUTINV (F x)) \<Longrightarrow> STUTINV (\<exists> x. F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. STUTINV F x) \<Longrightarrow> STUTINV (\<exists>x. F x)
[PROOF STEP]
by (simp add: stutinv_def)


[STATEMENT]
lemma same_diag_ev_blocks: "same_diag A B \<Longrightarrow> ev_blocks A \<Longrightarrow> ev_blocks B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.same_diag A B; local.ev_blocks A\<rbrakk> \<Longrightarrow> local.ev_blocks B
[PROOF STEP]
unfolding same_diag_def ev_blocks_def ev_blocks_part_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<n. A $$ (i, i) = B $$ (i, i); \<forall>i j k. i < j \<longrightarrow> j < k \<longrightarrow> k < n \<longrightarrow> A $$ (k, k) = A $$ (i, i) \<longrightarrow> A $$ (j, j) = A $$ (i, i)\<rbrakk> \<Longrightarrow> \<forall>i j k. i < j \<longrightarrow> j < k \<longrightarrow> k < n \<longrightarrow> B $$ (k, k) = B $$ (i, i) \<longrightarrow> B $$ (j, j) = B $$ (i, i)
[PROOF STEP]
by auto


[STATEMENT]
lemma prod_prime_factors'': "n > 0 \<Longrightarrow> f n = (\<Prod>p\<in>prime_factors n. f_prime p ^ multiplicity p n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> f n = (\<Prod>p\<in>prime_factors n. f_prime p ^ multiplicity p n)
[PROOF STEP]
by (subst prod_prime_factors') (auto simp: f_prime prime_factors_multiplicity intro!: prod.cong)


[STATEMENT]
lemma (in ring) inv_neg_one [simp]: "inv (\<ominus> \<one>) = \<ominus> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (\<ominus> \<one>) = \<ominus> \<one>
[PROOF STEP]
by (simp add: inv_char local.ring_axioms ring.r_minus)