[STATEMENT]
lemma cindex_polyE_smult_2:
  fixes p q::"real poly" and c::real
  shows "cindex_polyE a b q (smult c p) =  (sgn c) * cindex_polyE a b q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
proof (cases "c=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
 2. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
 2. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = 0

goal (1 subgoal):
 1. cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
have "cindex_polyE a b q (smult c p)
          = cindex_polyE a b ([:1/c:]*q) ([:1/c:]*(smult c p))"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. cindex_polyE a b q (smult c p) = cindex_polyE a b ([:1 / c:] * q) ([:1 / c:] * smult c p)
[PROOF STEP]
apply (subst cindex_polyE_mult_cancel)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c \<noteq> 0 \<Longrightarrow> [:1 / c:] \<noteq> 0
 2. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = cindex_polyE a b q (smult c p)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q (smult c p) = cindex_polyE a b ([:1 / c:] * q) ([:1 / c:] * smult c p)

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q (smult c p) = cindex_polyE a b ([:1 / c:] * q) ([:1 / c:] * smult c p)

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
have "... = cindex_polyE a b (smult (1/c) q) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b ([:1 / c:] * q) ([:1 / c:] * smult c p) = cindex_polyE a b (smult (1 / c) q) p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindex_polyE a b ([:1 / c:] * q) ([:1 / c:] * smult c p) = cindex_polyE a b (smult (1 / c) q) p

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE a b ([:1 / c:] * q) ([:1 / c:] * smult c p) = cindex_polyE a b (smult (1 / c) q) p

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
have "... = (sgn (1/c)) * cindex_polyE a b q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b (smult (1 / c) q) p = sgn (1 / c) * cindex_polyE a b q p
[PROOF STEP]
using cindex_polyE_smult_1
[PROOF STATE]
proof (prove)
using this:
cindex_polyE ?a ?b (smult ?c ?q) ?p = sgn ?c * cindex_polyE ?a ?b ?q ?p

goal (1 subgoal):
 1. cindex_polyE a b (smult (1 / c) q) p = sgn (1 / c) * cindex_polyE a b q p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindex_polyE a b (smult (1 / c) q) p = sgn (1 / c) * cindex_polyE a b q p

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE a b (smult (1 / c) q) p = sgn (1 / c) * cindex_polyE a b q p

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
have "... = (sgn c) * cindex_polyE a b q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (1 / c) * cindex_polyE a b q p = sgn c * cindex_polyE a b q p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sgn (1 / c) * cindex_polyE a b q p = sgn c * cindex_polyE a b q p

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p

goal (1 subgoal):
 1. cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q (smult c p) = sgn c * cindex_polyE a b q p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma signed_take_bit_numeral_bit0 [simp]:
  \<open>signed_take_bit (numeral l) (numeral (Num.Bit0 k)) = signed_take_bit (pred_numeral l) (numeral k) * (2 :: int)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit (numeral l) (numeral (num.Bit0 k)) = signed_take_bit (pred_numeral l) (numeral k) * 2
[PROOF STEP]
by (simp add: signed_take_bit_rec)


[STATEMENT]
lemma height'_node32:
  "height r > 0 \<Longrightarrow> hD(node32 l a m b r) =
   max (height l) (max (hD m) (height r)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height r \<Longrightarrow> hD (node32 l a m b r) = max (height l) (max (hD m) (height r)) + 1
[PROOF STEP]
by(induct l a m b r rule: node32.induct)(simp_all add: max_def)


[STATEMENT]
lemma sumSym:
  fixes P   :: pi
  and   Q   :: pi
  and   Rel :: "(pi \<times> pi) set"

  assumes Id: "Id \<subseteq> Rel"

  shows "P \<oplus> Q \<leadsto>[Rel] Q \<oplus> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<oplus> Q \<leadsto>[Rel] Q \<oplus> P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Id \<subseteq> Rel

goal (1 subgoal):
 1. P \<oplus> Q \<leadsto>[Rel] Q \<oplus> P
[PROOF STEP]
by(fastforce simp add: simulation_def elim: sumCases intro: Sum1 Sum2 derivativeReflexive)


[STATEMENT]
lemma frestrictionD[dest]:
  assumes "[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<restriction>\<^sub>\<bullet> A"
  shows "a \<in>\<^sub>\<circ> A" and "b \<in>\<^sub>\<circ> A" and "[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> A &&& b \<in>\<^sub>\<circ> A &&& [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r \<restriction>\<^sub>\<bullet> A

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> A &&& b \<in>\<^sub>\<circ> A &&& [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r
[PROOF STEP]
unfolding frestriction_def
[PROOF STATE]
proof (prove)
using this:
[a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> set {[a, b]\<^sub>\<circ> |a b. a \<in>\<^sub>\<circ> A \<and> b \<in>\<^sub>\<circ> A \<and> [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> A &&& b \<in>\<^sub>\<circ> A &&& [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_at_top_withinE:
  fixes f::"'a::linorder_topology \<Rightarrow> 'b::metric_space"
  assumes "s \<noteq> {}"
  assumes "(f \<longlongrightarrow> l) (at_top_within s)"
  assumes "e > 0"
  obtains x0 where "x0 \<in> s" "\<And>x. x \<in> {x0..} \<inter> s \<Longrightarrow> dist (f x) l < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x0. \<lbrakk>x0 \<in> s; \<And>x. x \<in> {x0..} \<inter> s \<Longrightarrow> dist (f x) l < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>x0. \<lbrakk>x0 \<in> s; \<And>x. x \<in> {x0..} \<inter> s \<Longrightarrow> dist (f x) l < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms(2)[THEN tendstoD, OF assms(3)]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top_within s. dist (f x) l < e
[PROOF STEP]
have "\<forall>\<^sub>F x in at_top_within s. dist (f x) l < e"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top_within s. dist (f x) l < e

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top_within s. dist (f x) l < e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top_within s. dist (f x) l < e

goal (1 subgoal):
 1. (\<And>x0. \<lbrakk>x0 \<in> s; \<And>x. x \<in> {x0..} \<inter> s \<Longrightarrow> dist (f x) l < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top_within s. dist (f x) l < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top_within s. dist (f x) l < e

goal (1 subgoal):
 1. thesis
[PROOF STEP]
unfolding eventually_at_top_within_linorder[OF \<open>s \<noteq> {}\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>x0\<in>s. \<forall>x\<ge>x0. x \<in> s \<longrightarrow> dist (f x) l < e

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_lebesgue_integral_gt_eq:
  fixes a b f
  assumes "a > b"
  shows "interval_lebesgue_integral M a b f = -(LINT x : einterval b a | M. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral M a b f = - set_lebesgue_integral M (einterval b a) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b < a

goal (1 subgoal):
 1. interval_lebesgue_integral M a b f = - set_lebesgue_integral M (einterval b a) f
[PROOF STEP]
by (auto simp: interval_lebesgue_integral_def less_imp_le einterval_def)


[STATEMENT]
lemma Unifier_subst_idem_subst:
  "subst_idem r \<Longrightarrow> Unifier s (t \<cdot> r) (u \<cdot> r) \<Longrightarrow> Unifier (r \<circ>\<^sub>s s) (t \<cdot> r) (u \<cdot> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subst_idem r; Unifier s (t \<cdot> r) (u \<cdot> r)\<rbrakk> \<Longrightarrow> Unifier (r \<circ>\<^sub>s s) (t \<cdot> r) (u \<cdot> r)
[PROOF STEP]
by (metis (no_types, lifting) subst_idem_def subst_subst_compose)


[STATEMENT]
lemma vquot_fm_empty [simp]: fixes A::fm shows "\<lfloor>A\<rfloor>{} = \<guillemotleft>A\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>A\<rfloor>{} = \<guillemotleft>A\<guillemotright>
[PROOF STEP]
by (simp add: vquot_fm_def quot_fm_def)


[STATEMENT]
lemma pivot_positions_form_helper_2:
  shows "sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))
[PROOF STEP]
proof  (induct i j rule: pivot_positions_main_gen.induct[of nr nc A z])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>\<lbrakk>i < nr; j < nc; A $$ (i, j) = z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i (Suc j))); \<lbrakk>i < nr; j < nc; A $$ (i, j) \<noteq> z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc (Suc i) (Suc j)))\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))
[PROOF STEP]
case (1 i j)
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < nr; j < nc; A $$ (i, j) = z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i (Suc j)))
\<lbrakk>i < nr; j < nc; A $$ (i, j) \<noteq> z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc (Suc i) (Suc j)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>\<lbrakk>i < nr; j < nc; A $$ (i, j) = z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i (Suc j))); \<lbrakk>i < nr; j < nc; A $$ (i, j) \<noteq> z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc (Suc i) (Suc j)))\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i < nr; j < nc; A $$ (i, j) = z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i (Suc j)))
\<lbrakk>i < nr; j < nc; A $$ (i, j) \<noteq> z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc (Suc i) (Suc j)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < nr; j < nc; A $$ (i, j) = z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i (Suc j)))
\<lbrakk>i < nr; j < nc; A $$ (i, j) \<noteq> z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc (Suc i) (Suc j)))

goal (1 subgoal):
 1. sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))
[PROOF STEP]
using  pivot_positions_main_gen.simps[of z A nr nc i j]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < nr; j < nc; A $$ (i, j) = z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i (Suc j)))
\<lbrakk>i < nr; j < nc; A $$ (i, j) \<noteq> z\<rbrakk> \<Longrightarrow> sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc (Suc i) (Suc j)))
pivot_positions_main_gen z A nr nc i j = (if i < nr then if j < nc then if A $$ (i, j) = z then pivot_positions_main_gen z A nr nc i (Suc j) else (i, j) # pivot_positions_main_gen z A nr nc (Suc i) (Suc j) else [] else [])

goal (1 subgoal):
 1. sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))
[PROOF STEP]
by (auto simp: pivot_positions_form_helper_1 Suc_le_lessD)
[PROOF STATE]
proof (state)
this:
sorted_wrt (<) (map fst (pivot_positions_main_gen z A nr nc i j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_mono_on_imp_inj_on: "
  strict_mono_on f (A::'a::linorder set) \<Longrightarrow> inj_on f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SetInterval2.strict_mono_on f A \<Longrightarrow> inj_on f A
[PROOF STEP]
apply (unfold strict_mono_on_def inj_on_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a < b \<longrightarrow> f a < f b; x \<in> A; y \<in> A; f x = f y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a < b \<longrightarrow> f a < f b; x \<in> A; y \<in> A; f x = f y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (fastforce simp add: linorder_neq_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma at_right_minus: "at_right a = filtermap (\<lambda>x. - x) (at_left (- a))"
  for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_right a = filtermap uminus (at_left (- a))
[PROOF STEP]
by (simp add: filter_eq_iff eventually_filtermap eventually_at_filter filtermap_nhds_minus[symmetric])


[STATEMENT]
lemma comp_min_basis_distinct: "distinct (comp_min_basis xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (comp_min_basis xs)
[PROOF STEP]
unfolding comp_min_basis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter_min (\<lambda>x y. lt x adds\<^sub>t lt y) (filter (\<lambda>x. x \<noteq> 0) xs))
[PROOF STEP]
by (rule filter_min_distinct) (simp add: reflp_def adds_term_refl)


[STATEMENT]
lemma ket_10_dim:
  shows "dim_vec ket_10 = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec ket_10 = 4
[PROOF STEP]
unfolding ket_10_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (ket_1 \<otimes> ket_0) = 4
[PROOF STEP]
by (simp add: ket_0_dim ket_1_dim)


[STATEMENT]
lemma integral_dominated_convergence_at_left:
  fixes s :: "real \<Rightarrow> 'a \<Rightarrow> 'b::{banach, second_countable_topology}" and w :: "'a \<Rightarrow> real"
    and f :: "'a \<Rightarrow> 'b" and M and c :: real
  assumes "f \<in> borel_measurable M" "\<And>t. s t \<in> borel_measurable M" "integrable M w"
  assumes lim: "AE x in M. ((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c)"
  assumes bound: "\<forall>\<^sub>F i in at_left c. AE x in M. norm (s i x) \<le> w x"
  shows "((\<lambda>t. integral\<^sup>L M (s t)) \<longlongrightarrow> integral\<^sup>L M f) (at_left c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. integral\<^sup>L M (s t)) \<longlongrightarrow> integral\<^sup>L M f) (at_left c)
[PROOF STEP]
proof (rule tendsto_at_left_realI_sequentially)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>X. filterlim X (at_left c) sequentially \<Longrightarrow> (\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f
[PROOF STEP]
fix X :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>X. filterlim X (at_left c) sequentially \<Longrightarrow> (\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f
[PROOF STEP]
assume X: "filterlim X (at_left c) sequentially"
[PROOF STATE]
proof (state)
this:
filterlim X (at_left c) sequentially

goal (1 subgoal):
 1. \<And>X. filterlim X (at_left c) sequentially \<Longrightarrow> (\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f
[PROOF STEP]
from filterlim_iff[THEN iffD1, OF this, rule_format, OF bound]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. AE xa in M. norm (s (X x) xa) \<le> w xa
[PROOF STEP]
obtain N where w: "\<And>n. N \<le> n \<Longrightarrow> AE x in M. norm (s (X n) x) \<le> w x"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. AE xa in M. norm (s (X x) xa) \<le> w xa

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> AE x in M. norm (s (X n) x) \<le> w x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_sequentially)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> AE x in M. norm (s (X ?n) x) \<le> w x

goal (1 subgoal):
 1. \<And>X. filterlim X (at_left c) sequentially \<Longrightarrow> (\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f
[PROOF STEP]
show "(\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f
[PROOF STEP]
proof (rule LIMSEQ_offset, rule integral_dominated_convergence)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. f \<in> borel_measurable M
 2. \<And>n. s (X (n + ?k)) \<in> borel_measurable M
 3. integrable M ?w2
 4. AE x in M. (\<lambda>n. s (X (n + ?k)) x) \<longlonglongrightarrow> f x
 5. \<And>n. AE x in M. norm (s (X (n + ?k)) x) \<le> ?w2 x
[PROOF STEP]
show "AE x in M. norm (s (X (n + N)) x) \<le> w x" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. norm (s (X (n + N)) x) \<le> w x
[PROOF STEP]
by (rule w) auto
[PROOF STATE]
proof (state)
this:
AE x in M. norm (s (X (?n + N)) x) \<le> w x

goal (4 subgoals):
 1. f \<in> borel_measurable M
 2. \<And>n. s (X (n + N)) \<in> borel_measurable M
 3. integrable M w
 4. AE x in M. (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
show "AE x in M. (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
using lim
[PROOF STATE]
proof (prove)
using this:
AE x in M. ((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c)

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c) \<Longrightarrow> (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c) \<Longrightarrow> (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
assume "((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c)"
[PROOF STATE]
proof (state)
this:
((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c)

goal (1 subgoal):
 1. \<And>x. ((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c) \<Longrightarrow> (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c)
[PROOF STEP]
show "(\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>i. s i x) \<longlongrightarrow> f x) (at_left c)

goal (1 subgoal):
 1. (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x
[PROOF STEP]
by (intro LIMSEQ_ignore_initial_segment filterlim_compose[OF _ X])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. s (X (n + N)) x) \<longlonglongrightarrow> f x

goal (3 subgoals):
 1. f \<in> borel_measurable M
 2. \<And>n. s (X (n + N)) \<in> borel_measurable M
 3. integrable M w
[PROOF STEP]
qed fact+
[PROOF STATE]
proof (state)
this:
(\<lambda>n. integral\<^sup>L M (s (X n))) \<longlonglongrightarrow> integral\<^sup>L M f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_point_not_in_block: "i < \<v> \<Longrightarrow> j < \<b> \<Longrightarrow> N $$ (i, j) = 0 \<Longrightarrow> \<V>s ! i \<notin> \<B>s ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < \<v>; j < \<b>; N $$ (i, j) = 0\<rbrakk> \<Longrightarrow> \<V>s ! i \<notin> \<B>s ! j
[PROOF STEP]
by (metis blocks_list_length points_list_length inc_matrix_point_not_in_block)


[STATEMENT]
lemma codegree_neighbors: "codegree v u = card (neighborhood v \<inter> neighborhood u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codegree v u = card (neighborhood v \<inter> neighborhood u)
[PROOF STEP]
unfolding codegree_def neighborhood_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x \<in> V. vert_adj v x \<and> vert_adj u x} = card ({va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {x \<in> V. vert_adj v x \<and> vert_adj u x} = card ({va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v})
[PROOF STEP]
have "{x \<in> V. vert_adj v x \<and> vert_adj u x} = {va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> V. vert_adj v x \<and> vert_adj u x} = {va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x \<in> V. vert_adj v x \<and> vert_adj u x} = {va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v}

goal (1 subgoal):
 1. card {x \<in> V. vert_adj v x \<and> vert_adj u x} = card ({va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v})
[PROOF STEP]
thus "card {x \<in> V. vert_adj v x \<and> vert_adj u x} = card ({va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v})"
[PROOF STATE]
proof (prove)
using this:
{x \<in> V. vert_adj v x \<and> vert_adj u x} = {va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v}

goal (1 subgoal):
 1. card {x \<in> V. vert_adj v x \<and> vert_adj u x} = card ({va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {x \<in> V. vert_adj v x \<and> vert_adj u x} = card ({va \<in> V. vert_adj v va} \<inter> {v \<in> V. vert_adj u v})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SubstTermP_subst [simp]:
      "(SubstTermP v i t u)(j::=w) = SubstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SubstTermP v i t u)(j::=w) = SubstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (SubstTermP v i t u)(j::=w) = SubstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
obtain s::name and k::name
    where "atom s \<sharp> (v,i,t,u,w,j,k)"  "atom k \<sharp> (v,i,t,u,w,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s k. \<lbrakk>atom s \<sharp> (v, i, t, u, w, j, k); atom k \<sharp> (v, i, t, u, w, j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s \<sharp> (v, i, t, u, w, j, k)
atom k \<sharp> (v, i, t, u, w, j)

goal (1 subgoal):
 1. (SubstTermP v i t u)(j::=w) = SubstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s \<sharp> (v, i, t, u, w, j, k)
atom k \<sharp> (v, i, t, u, w, j)

goal (1 subgoal):
 1. (SubstTermP v i t u)(j::=w) = SubstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)
[PROOF STEP]
by (simp add: SubstTermP.simps [of s _ _ _ _ k])
[PROOF STATE]
proof (state)
this:
(SubstTermP v i t u)(j::=w) = SubstTermP (subst j w v) (subst j w i) (subst j w t) (subst j w u)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_integrable_bound:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  assumes le: "\<And>x. x\<in>S \<Longrightarrow> norm (f x) \<le> g x" and f: "f integrable_on S" and g: "g integrable_on S"
  shows "f absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on S
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
proof (rule Bochner_Integration.integrable_bound)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable lebesgue ?f
 2. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
 3. AE x in lebesgue. norm (indicat_real S x *\<^sub>R f x) \<le> norm (?f x)
[PROOF STEP]
have "g absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g absolutely_integrable_on S
[PROOF STEP]
unfolding absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g integrable_on S \<and> (\<lambda>x. norm (g x)) integrable_on S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g integrable_on S
 2. (\<lambda>x. norm (g x)) integrable_on S
[PROOF STEP]
show "(\<lambda>x. norm (g x)) integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (g x)) integrable_on S
[PROOF STEP]
using le norm_ge_zero[of "f _"]
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> norm (f ?x) \<le> g ?x
0 \<le> norm (f ?uu3)

goal (1 subgoal):
 1. (\<lambda>x. norm (g x)) integrable_on S
[PROOF STEP]
by (intro integrable_spike_finite[OF _ _ g, of "{}"])
         (auto intro!: abs_of_nonneg intro: order_trans simp del: norm_ge_zero)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. norm (g x)) integrable_on S

goal (1 subgoal):
 1. g integrable_on S
[PROOF STEP]
qed fact
[PROOF STATE]
proof (state)
this:
g absolutely_integrable_on S

goal (3 subgoals):
 1. integrable lebesgue ?f
 2. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
 3. AE x in lebesgue. norm (indicat_real S x *\<^sub>R f x) \<le> norm (?f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g absolutely_integrable_on S
[PROOF STEP]
show "integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R g x)"
[PROOF STATE]
proof (prove)
using this:
g absolutely_integrable_on S

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R g x)
[PROOF STEP]
by (simp add: set_integrable_def)
[PROOF STATE]
proof (state)
this:
integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R g x)

goal (2 subgoals):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
 2. AE x in lebesgue. norm (indicat_real S x *\<^sub>R f x) \<le> norm (indicat_real S x *\<^sub>R g x)
[PROOF STEP]
show "(\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f integrable_on S

goal (1 subgoal):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
by (auto intro: has_integral_implies_lebesgue_measurable simp: integrable_on_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. AE x in lebesgue. norm (indicat_real S x *\<^sub>R f x) \<le> norm (indicat_real S x *\<^sub>R g x)
[PROOF STEP]
qed (use le in \<open>force intro!: always_eventually split: split_indicator\<close>)


[STATEMENT]
lemma char_poly_factorized: fixes A :: "complex mat"
  assumes A: "A \<in> carrier_mat n n"
  shows "\<exists> as. char_poly A = (\<Prod> a \<leftarrow> as. [:- a, 1:]) \<and> length as = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
let ?p = "char_poly A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
from fundamental_theorem_algebra_factorized[of ?p]
[PROOF STATE]
proof (chain)
picking this:
\<exists>as. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A \<and> length as = degree (char_poly A)
[PROOF STEP]
obtain as
  where "Polynomial.smult (coeff ?p (degree ?p)) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = ?p"
[PROOF STATE]
proof (prove)
using this:
\<exists>as. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A \<and> length as = degree (char_poly A)

goal (1 subgoal):
 1. (\<And>as. Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polynomial.smult (lead_coeff (char_poly A)) (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
have "coeff ?p (degree ?p) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (char_poly A)
[PROOF STEP]
using degree_monic_char_poly[OF A]
[PROOF STATE]
proof (prove)
using this:
degree (char_poly A) = n \<and> coeff (char_poly A) n = 1

goal (1 subgoal):
 1. monic (char_poly A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monic (char_poly A)

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Polynomial.smult 1 (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A
[PROOF STEP]
have cA: "?p = (\<Prod>a\<leftarrow>as. [:- a, 1:])"
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult 1 (\<Prod>a\<leftarrow>as. [:- a, 1:]) = char_poly A

goal (1 subgoal):
 1. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:])

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
from degree_monic_char_poly[OF A]
[PROOF STATE]
proof (chain)
picking this:
degree (char_poly A) = n \<and> coeff (char_poly A) n = 1
[PROOF STEP]
have "degree ?p = n"
[PROOF STATE]
proof (prove)
using this:
degree (char_poly A) = n \<and> coeff (char_poly A) n = 1

goal (1 subgoal):
 1. degree (char_poly A) = n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
degree (char_poly A) = n

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
with degree_linear_factors[of uminus as, folded cA]
[PROOF STATE]
proof (chain)
picking this:
degree (char_poly A) = length as
degree (char_poly A) = n
[PROOF STEP]
have "length as = n"
[PROOF STATE]
proof (prove)
using this:
degree (char_poly A) = length as
degree (char_poly A) = n

goal (1 subgoal):
 1. length as = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length as = n

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
with cA
[PROOF STATE]
proof (chain)
picking this:
char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:])
length as = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:])
length as = n

goal (1 subgoal):
 1. \<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transp_ln_smallo_ln: "transp (\<lambda>f g. (\<lambda>x::real. ln (g x)) \<in> o(\<lambda>x. ln (f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp (\<lambda>f g. (\<lambda>x. ln (g x)) \<in> o(\<lambda>x. ln (f x)))
[PROOF STEP]
by (rule transpI, erule landau_o.small.trans)


[STATEMENT]
lemma iT_Plus_neg_Max_singleton: "\<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow> I \<oplus>- Max I= {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> I \<oplus>- Max I = {0}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (x \<in> I \<oplus>- Max I) = (x \<in> {0})
[PROOF STEP]
apply (simp add: iT_Plus_neg_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> (x + Max I \<in> I) = (x = 0)
[PROOF STEP]
apply (case_tac "x = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>finite I; I \<noteq> {}; x = 0\<rbrakk> \<Longrightarrow> (x + Max I \<in> I) = (x = 0)
 2. \<And>x. \<lbrakk>finite I; I \<noteq> {}; x \<noteq> 0\<rbrakk> \<Longrightarrow> (x + Max I \<in> I) = (x = 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>finite I; I \<noteq> {}; x \<noteq> 0\<rbrakk> \<Longrightarrow> (x + Max I \<in> I) = (x = 0)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma winning_position_can_remain_winning_Even:
  assumes "even (length p)" "\<forall> m. position (p @ [m])" "winning_position_Even p"
  shows "\<exists> m. winning_position_Even (p @ [m])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. winning_position_Even (p @ [m])
[PROOF STEP]
using assms winning_moves_remain_winning_Even[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
even (length p)
\<forall>m. position (p @ [m])
winning_position_Even p
strategy_winning_by_Even ?\<sigma> p \<Longrightarrow> strategy_winning_by_Even ?\<sigma> (augment_list ?\<sigma> p)

goal (1 subgoal):
 1. \<exists>m. winning_position_Even (p @ [m])
[PROOF STEP]
by auto


[STATEMENT]
lemma loc_lm_2: "c_fst n mod 7 \<noteq> 0 \<Longrightarrow> nat_to_sch n = (let u=(c_fst n) mod 7; v=c_snd n; v1=c_fst v; v2 = c_snd v; sch1=nat_to_sch v1; sch2=nat_to_sch v2 in loc_f u sch1 sch2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst n mod 7 \<noteq> 0 \<Longrightarrow> nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_fst n mod 7 \<noteq> 0 \<Longrightarrow> nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
assume "c_fst n mod 7 \<noteq> 0"
[PROOF STATE]
proof (state)
this:
c_fst n mod 7 \<noteq> 0

goal (1 subgoal):
 1. c_fst n mod 7 \<noteq> 0 \<Longrightarrow> nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_fst n mod 7 \<noteq> 0
[PROOF STEP]
have "n > 0"
[PROOF STATE]
proof (prove)
using this:
c_fst n mod 7 \<noteq> 0

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by (rule loc_lm_1)
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. c_fst n mod 7 \<noteq> 0 \<Longrightarrow> nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))
[PROOF STEP]
by (rule nat_to_sch_at_pos)
[PROOF STATE]
proof (state)
this:
nat_to_sch n = (let u = c_fst n mod 7; v = c_snd n; v1 = c_fst v; v2 = c_snd v; sch1 = nat_to_sch v1 in Let (nat_to_sch v2) (loc_f u sch1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural (m div n) = integer_of_natural m div integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural (m div n) = integer_of_natural m div integer_of_natural n
[PROOF STEP]
by transfer (simp add: zdiv_int)


[STATEMENT]
lemma spmf_of_set_singleton: "spmf_of_set {x} = return_spmf x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spmf_of_set {x} = return_spmf x
[PROOF STEP]
by(simp add: spmf_of_set_def pmf_of_set_singleton)


[STATEMENT]
lemma finite_intersection_of_Int:
   "\<lbrakk>(finite intersection_of P) S; (finite intersection_of P) T\<rbrakk>
           \<Longrightarrow> (finite intersection_of P) (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(finite intersection_of P) S; (finite intersection_of P) T\<rbrakk> \<Longrightarrow> (finite intersection_of P) (S \<inter> T)
[PROOF STEP]
by (auto simp: intersection_of_def)


[STATEMENT]
lemma rel_adv_eq_dis_log_adv:
  "Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \
[PROOF STEP]
have "Schnorr_\<Sigma>_commit.rel_game \ = discrete_log.dis_log \"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Schnorr_\<Sigma>_commit.rel_game \ = discrete_log.dis_log \
[PROOF STEP]
unfolding Schnorr_\<Sigma>_commit.rel_game_def discrete_log.dis_log_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TRY G \<bind> (\<lambda>(h, w). \ h \<bind> (\<lambda>w'. return_spmf ((h, w') \<in> R_DL))) ELSE return_spmf False = TRY sample_uniform (order \<G>) \<bind> (\<lambda>x. let h = \<^bold>g [^] x in \ h \<bind> (\<lambda>x'. return_spmf [x = x'] (mod order \<G>))) ELSE return_spmf False
[PROOF STEP]
by(auto intro: try_spmf_cong bind_spmf_cong[OF refl]
       simp add: G_def R_DL_def cong_less_modulus_unique_nat group_eq_pow_eq_mod finite_carrier pow_generator_eq_iff_cong)
[PROOF STATE]
proof (state)
this:
Schnorr_\<Sigma>_commit.rel_game \ = discrete_log.dis_log \

goal (1 subgoal):
 1. Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Schnorr_\<Sigma>_commit.rel_game \ = discrete_log.dis_log \

goal (1 subgoal):
 1. Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \
[PROOF STEP]
using Schnorr_\<Sigma>_commit.rel_advantage_def discrete_log.advantage_def
[PROOF STATE]
proof (prove)
using this:
Schnorr_\<Sigma>_commit.rel_game \ = discrete_log.dis_log \
Schnorr_\<Sigma>_commit.rel_advantage ?\ \<equiv> spmf (Schnorr_\<Sigma>_commit.rel_game ?\) True
discrete_log.advantage ?\ \<equiv> spmf (discrete_log.dis_log ?\) True

goal (1 subgoal):
 1. Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Schnorr_\<Sigma>_commit.rel_advantage \ = discrete_log.advantage \

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_factor_content_real:
  "(f has_integral i) {a..b::real} \<longleftrightarrow>
    (\<forall>e>0. \<exists>d. gauge d \<and> (\<forall>p. p tagged_division_of {a..b}  \<and> d fine p \<longrightarrow>
      norm (sum (\<lambda>(x,k). content k *\<^sub>R f x) p - i) \<le> e * content {a..b} ))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral i) {a..b} = (\<forall>e>0. \<exists>d. gauge d \<and> (\<forall>p. p tagged_division_of {a..b} \<and> d fine p \<longrightarrow> norm ((\<Sum>(x, k)\<in>p. content k *\<^sub>R f x) - i) \<le> e * content {a..b}))
[PROOF STEP]
unfolding box_real[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral i) (cbox a b) = (\<forall>e>0. \<exists>d. gauge d \<and> (\<forall>p. p tagged_division_of cbox a b \<and> d fine p \<longrightarrow> norm ((\<Sum>(x, k)\<in>p. content k *\<^sub>R f x) - i) \<le> e * content (cbox a b)))
[PROOF STEP]
by (rule has_integral_factor_content)


[STATEMENT]
lemma bin_nth_take_bit_iff:
  \<open>(bit :: int \<Rightarrow> nat \<Rightarrow> bool) (take_bit n c) k \<longleftrightarrow> k < n \<and> (bit :: int \<Rightarrow> nat \<Rightarrow> bool) c k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit (take_bit n c) k = (k < n \<and> bit c k)
[PROOF STEP]
by (fact bit_take_bit_iff)


[STATEMENT]
lemma nucleus_alt_def:
  fixes f :: "'a::unital_quantale \<Rightarrow> 'a"
  shows "nucleus f = (\<forall> x y. f x \<rightarrow> f y = x \<rightarrow> f y \<and> f y \<leftarrow> f x = f y \<leftarrow> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nucleus f = (\<forall>x y. f x \<rightarrow> f y = x \<rightarrow> f y \<and> f y \<leftarrow> f x = f y \<leftarrow> x)
[PROOF STEP]
using nucleus_alt_def1 nucleus_alt_def2 nucleus_alt_def3
[PROOF STATE]
proof (prove)
using this:
nucleus ?f \<Longrightarrow> ?f ?x \<rightarrow> ?f ?y = ?x \<rightarrow> ?f ?y
nucleus ?f \<Longrightarrow> ?f ?y \<leftarrow> ?f ?x = ?f ?y \<leftarrow> ?x
\<lbrakk>\<forall>x y. ?f x \<rightarrow> ?f y = x \<rightarrow> ?f y; \<forall>x y. ?f y \<leftarrow> ?f x = ?f y \<leftarrow> x\<rbrakk> \<Longrightarrow> nucleus ?f

goal (1 subgoal):
 1. nucleus f = (\<forall>x y. f x \<rightarrow> f y = x \<rightarrow> f y \<and> f y \<leftarrow> f x = f y \<leftarrow> x)
[PROOF STEP]
by blast


[STATEMENT]
lemma hrabs_le_Infinitesimal: "e \<in> Infinitesimal \<Longrightarrow> \<bar>x\<bar> \<le> e \<Longrightarrow> x \<in> Infinitesimal"
  for x :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<in> Infinitesimal; \<bar>x\<bar> \<le> e\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
by (erule hnorm_le_Infinitesimal) simp


[STATEMENT]
lemma ereal_less_minus_iff:
  fixes x y z :: ereal
  shows "x < z - y \<longleftrightarrow>
    (y = \<infinity> \<longrightarrow> z = \<infinity> \<and> x \<noteq> \<infinity>) \<and>
    (y = -\<infinity> \<longrightarrow> x \<noteq> \<infinity>) \<and>
    (\<bar>y\<bar> \<noteq> \<infinity>\<longrightarrow> x + y < z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x < z - y) = ((y = \<infinity> \<longrightarrow> z = \<infinity> \<and> x \<noteq> \<infinity>) \<and> (y = - \<infinity> \<longrightarrow> x \<noteq> \<infinity>) \<and> (\<bar>y\<bar> \<noteq> \<infinity> \<longrightarrow> x + y < z))
[PROOF STEP]
by (cases rule: ereal3_cases[of x y z]) auto


[STATEMENT]
lemma square_part_square_dvd [simp, intro]: "square_part n ^ 2 dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (square_part n)\<^sup>2 dvd n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> (square_part n)\<^sup>2 dvd n
 2. n \<noteq> (0::'a) \<Longrightarrow> (square_part n)\<^sup>2 dvd n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> (0::'a)

goal (2 subgoals):
 1. n = (0::'a) \<Longrightarrow> (square_part n)\<^sup>2 dvd n
 2. n \<noteq> (0::'a) \<Longrightarrow> (square_part n)\<^sup>2 dvd n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> (0::'a)

goal (1 subgoal):
 1. (square_part n)\<^sup>2 dvd n
[PROOF STEP]
by (intro multiplicity_le_imp_dvd)
       (auto simp: prime_multiplicity_square_part prime_elem_multiplicity_power_distrib)
[PROOF STATE]
proof (state)
this:
(square_part n)\<^sup>2 dvd n

goal (1 subgoal):
 1. n = (0::'a) \<Longrightarrow> (square_part n)\<^sup>2 dvd n
[PROOF STEP]
qed auto


[STATEMENT]
lemma RSpan_contains_RSpans_append_left :
  "set ns \<subseteq> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (ms@ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ns \<subseteq> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (ms @ ns)
[PROOF STEP]
using RSpan_append Group_RSpan AbGroup.intro AbGroup.subset_plus_left
[PROOF STATE]
proof (prove)
using this:
RSpan (?ms @ ?ns) = RSpan ?ms + RSpan ?ns
set ?ms \<subseteq> M \<Longrightarrow> Group (RSpan ?ms)
Group ?G \<Longrightarrow> AbGroup ?G
AbGroup ?G \<Longrightarrow> ?A \<subseteq> ?A + ?G

goal (1 subgoal):
 1. set ns \<subseteq> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (ms @ ns)
[PROOF STEP]
by    fast


[STATEMENT]
lemma locally_connected_UNIV: "locally connected (UNIV::'a :: real_normed_vector set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected UNIV
[PROOF STEP]
by (simp add: open_imp_locally_connected)


[STATEMENT]
lemma prod_mset_fract_poly:
  "(\<Prod>x\<in>#A. map_poly to_fract (f x)) = fract_poly (prod_mset (image_mset f A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>#A. map_poly to_fract (f x)) = map_poly to_fract (\<Prod>\<^sub># (image_mset f A))
[PROOF STEP]
by (induct A) (simp_all add: ac_simps)


[STATEMENT]
lemma combining_sys_satisfies_properties_helper_R:
  fixes p:: "real poly"
  fixes qs1 :: "real poly list"
  fixes qs2 :: "real poly list"
  fixes subsets1 subsets2 :: "(nat list * nat list) list"
  fixes signs1 signs2 :: "rat list list"
  fixes matrix1 matrix2:: "rat mat"
  assumes nonzero: "p \<noteq> 0"
  assumes nontriv1: "length qs1 > 0"
  assumes nontriv2: "length qs2 > 0"
  assumes satisfies_properties_sys1: "satisfies_properties_R p qs1 subsets1 signs1 matrix1"
  assumes satisfies_properties_sys2: "satisfies_properties_R p qs2 subsets2 signs2 matrix2"
  shows  "satisfies_properties_R p (qs1@qs2) (get_subsets_R (snd ((combine_systems_R p (qs1,(matrix1, (subsets1, signs1))) (qs2,(matrix2, (subsets2, signs2)))))))
  (get_signs_R (snd ((combine_systems_R p (qs1,(matrix1, (subsets1, signs1))) (qs2,(matrix2, (subsets2, signs2)))))))
  (get_matrix_R (snd ((combine_systems_R p (qs1,(matrix1, (subsets1, signs1))) (qs2,(matrix2, (subsets2, signs2)))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
let ?subsets = "(get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1)
              (qs2, matrix2, subsets2, signs2))))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
let ?signs = "(get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
let ?matrix = "(get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h1: "all_list_constr_R ?subsets (length (qs1 @ qs2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_list_constr_R (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (length (qs1 @ qs2))
[PROOF STEP]
using well_def_step_R[of subsets1 qs1 subsets2 qs2] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>all_list_constr_R subsets1 (length qs1); all_list_constr_R subsets2 (length qs2)\<rbrakk> \<Longrightarrow> all_list_constr_R (subsets_smash_R (length qs1) subsets1 subsets2) (length (qs1 @ qs2))
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2

goal (1 subgoal):
 1. all_list_constr_R (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (length (qs1 @ qs2))
[PROOF STEP]
by (simp add: nontriv2 get_subsets_R_def satisfies_properties_R_def smash_systems_R_def)
[PROOF STATE]
proof (state)
this:
all_list_constr_R (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (length (qs1 @ qs2))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h2: "well_def_signs (length (qs1 @ qs2)) ?signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using well_def_signs_step[of qs1 qs2 signs1 signs2]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length qs1; 0 < length qs2; well_def_signs (length qs1) signs1; well_def_signs (length qs2) signs2\<rbrakk> \<Longrightarrow> well_def_signs (length (qs1 @ qs2)) (signs_smash signs1 signs2)

goal (1 subgoal):
 1. well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using get_signs_R_def nontriv1 nontriv2 satisfies_properties_R_def satisfies_properties_sys1 satisfies_properties_sys2 smash_systems_R_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length qs1; 0 < length qs2; well_def_signs (length qs1) signs1; well_def_signs (length qs2) signs2\<rbrakk> \<Longrightarrow> well_def_signs (length (qs1 @ qs2)) (signs_smash signs1 signs2)
get_signs_R ?data = snd (snd ?data)
0 < length qs1
0 < length qs2
satisfies_properties_R ?p ?qs ?subsets ?signs ?matrix = (all_list_constr_R ?subsets (length ?qs) \<and> well_def_signs (length ?qs) ?signs \<and> distinct ?signs \<and> satisfy_equation_R ?p ?qs ?subsets ?signs \<and> invertible_mat ?matrix \<and> ?matrix = M_mat_R ?signs ?subsets \<and> set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs)
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2
smash_systems_R ?p ?qs1.0 ?qs2.0 ?subsets1.0 ?subsets2.0 ?signs1.0 ?signs2.0 ?mat1.0 ?mat2.0 = (?qs1.0 @ ?qs2.0, kronecker_product ?mat1.0 ?mat2.0, subsets_smash_R (length ?qs1.0) ?subsets1.0 ?subsets2.0, signs_smash ?signs1.0 ?signs2.0)

goal (1 subgoal):
 1. well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
by (metis combining_to_smash_R snd_conv)
[PROOF STATE]
proof (state)
this:
well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h3: "distinct ?signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using distinct_step[of _ signs1 _ signs2] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_def_signs ?n1.0 signs1; well_def_signs ?n2.0 signs2; distinct signs1; distinct signs2\<rbrakk> \<Longrightarrow> distinct (signs_smash signs1 signs2)
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2

goal (1 subgoal):
 1. distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using combine_systems.simps get_signs_R_def satisfies_properties_R_def smash_systems_R_def snd_conv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_def_signs ?n1.0 signs1; well_def_signs ?n2.0 signs2; distinct signs1; distinct signs2\<rbrakk> \<Longrightarrow> distinct (signs_smash signs1 signs2)
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2
combine_systems ?p (?qs1.0, ?m1.0, ?sub1.0, ?sgn1.0) (?qs2.0, ?m2.0, ?sub2.0, ?sgn2.0) = smash_systems ?p ?qs1.0 ?qs2.0 ?sub1.0 ?sub2.0 ?sgn1.0 ?sgn2.0 ?m1.0 ?m2.0
get_signs_R ?data = snd (snd ?data)
satisfies_properties_R ?p ?qs ?subsets ?signs ?matrix = (all_list_constr_R ?subsets (length ?qs) \<and> well_def_signs (length ?qs) ?signs \<and> distinct ?signs \<and> satisfy_equation_R ?p ?qs ?subsets ?signs \<and> invertible_mat ?matrix \<and> ?matrix = M_mat_R ?signs ?subsets \<and> set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs)
smash_systems_R ?p ?qs1.0 ?qs2.0 ?subsets1.0 ?subsets2.0 ?signs1.0 ?signs2.0 ?mat1.0 ?mat2.0 = (?qs1.0 @ ?qs2.0, kronecker_product ?mat1.0 ?mat2.0, subsets_smash_R (length ?qs1.0) ?subsets1.0 ?subsets2.0, signs_smash ?signs1.0 ?signs2.0)
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
by (metis combining_to_smash_R)
[PROOF STATE]
proof (state)
this:
distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h4: "satisfy_equation_R p (qs1 @ qs2) ?subsets ?signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using assms inductive_step_R[of p qs1 qs2 signs1 signs2 subsets1 subsets2]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2
\<lbrakk>p \<noteq> 0; 0 < length qs1; 0 < length qs2; well_def_signs (length qs1) signs1; well_def_signs (length qs2) signs2; distinct signs1; distinct signs2; set (characterize_consistent_signs_at_roots p qs1) \<subseteq> set signs1; set (characterize_consistent_signs_at_roots p qs2) \<subseteq> set signs2; all_list_constr_R subsets1 (length qs1); all_list_constr_R subsets2 (length qs2); invertible_mat (M_mat_R signs1 subsets1); invertible_mat (M_mat_R signs2 subsets2)\<rbrakk> \<Longrightarrow> satisfy_equation_R p (qs1 @ qs2) (subsets_smash_R (length qs1) subsets1 subsets2) (signs_smash signs1 signs2) \<and> invertible_mat (M_mat_R (signs_smash signs1 signs2) (subsets_smash_R (length qs1) subsets1 subsets2))

goal (1 subgoal):
 1. satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using get_signs_R_def get_subsets_R_def satisfies_properties_R_def smash_systems_R_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2
\<lbrakk>p \<noteq> 0; 0 < length qs1; 0 < length qs2; well_def_signs (length qs1) signs1; well_def_signs (length qs2) signs2; distinct signs1; distinct signs2; set (characterize_consistent_signs_at_roots p qs1) \<subseteq> set signs1; set (characterize_consistent_signs_at_roots p qs2) \<subseteq> set signs2; all_list_constr_R subsets1 (length qs1); all_list_constr_R subsets2 (length qs2); invertible_mat (M_mat_R signs1 subsets1); invertible_mat (M_mat_R signs2 subsets2)\<rbrakk> \<Longrightarrow> satisfy_equation_R p (qs1 @ qs2) (subsets_smash_R (length qs1) subsets1 subsets2) (signs_smash signs1 signs2) \<and> invertible_mat (M_mat_R (signs_smash signs1 signs2) (subsets_smash_R (length qs1) subsets1 subsets2))
get_signs_R ?data = snd (snd ?data)
get_subsets_R ?data = fst (snd ?data)
satisfies_properties_R ?p ?qs ?subsets ?signs ?matrix = (all_list_constr_R ?subsets (length ?qs) \<and> well_def_signs (length ?qs) ?signs \<and> distinct ?signs \<and> satisfy_equation_R ?p ?qs ?subsets ?signs \<and> invertible_mat ?matrix \<and> ?matrix = M_mat_R ?signs ?subsets \<and> set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs)
smash_systems_R ?p ?qs1.0 ?qs2.0 ?subsets1.0 ?subsets2.0 ?signs1.0 ?signs2.0 ?mat1.0 ?mat2.0 = (?qs1.0 @ ?qs2.0, kronecker_product ?mat1.0 ?mat2.0, subsets_smash_R (length ?qs1.0) ?subsets1.0 ?subsets2.0, signs_smash ?signs1.0 ?signs2.0)

goal (1 subgoal):
 1. satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
by (metis (no_types, opaque_lifting) combining_to_smash_R h1 h3 matrix_equation_R snd_conv subset_step_R)
[PROOF STATE]
proof (state)
this:
satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h5: " invertible_mat ?matrix"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using assms inductive_step_R[of p qs1 qs2 signs1 signs2 subsets1 subsets2]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2
\<lbrakk>p \<noteq> 0; 0 < length qs1; 0 < length qs2; well_def_signs (length qs1) signs1; well_def_signs (length qs2) signs2; distinct signs1; distinct signs2; set (characterize_consistent_signs_at_roots p qs1) \<subseteq> set signs1; set (characterize_consistent_signs_at_roots p qs2) \<subseteq> set signs2; all_list_constr_R subsets1 (length qs1); all_list_constr_R subsets2 (length qs2); invertible_mat (M_mat_R signs1 subsets1); invertible_mat (M_mat_R signs2 subsets2)\<rbrakk> \<Longrightarrow> satisfy_equation_R p (qs1 @ qs2) (subsets_smash_R (length qs1) subsets1 subsets2) (signs_smash signs1 signs2) \<and> invertible_mat (M_mat_R (signs_smash signs1 signs2) (subsets_smash_R (length qs1) subsets1 subsets2))

goal (1 subgoal):
 1. invertible_mat (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
by (metis combining_to_smash_R fst_conv get_matrix_R_def kronecker_invertible satisfies_properties_R_def smash_systems_R_def snd_conv)
[PROOF STATE]
proof (state)
this:
invertible_mat (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h6: "?matrix = matrix_A_R ?signs ?subsets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))) = M_mat_R (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
unfolding get_matrix_R_def combine_systems_R.simps smash_systems_R_def get_signs_R_def get_subsets_R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (qs1 @ qs2, kronecker_product matrix1 matrix2, subsets_smash_R (length qs1) subsets1 subsets2, signs_smash signs1 signs2)) = M_mat_R (snd (snd (snd (qs1 @ qs2, kronecker_product matrix1 matrix2, subsets_smash_R (length qs1) subsets1 subsets2, signs_smash signs1 signs2)))) (fst (snd (snd (qs1 @ qs2, kronecker_product matrix1 matrix2, subsets_smash_R (length qs1) subsets1 subsets2, signs_smash signs1 signs2))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kronecker_product matrix1 matrix2 = M_mat_R (signs_smash signs1 signs2) (subsets_smash_R (length qs1) subsets1 subsets2)
[PROOF STEP]
apply (subst matrix_construction_is_kronecker_product_R[of subsets1 _ signs1 signs2 subsets2])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>l i. \<lbrakk>l \<in> set subsets1; i \<in> set (fst l) \<or> i \<in> set (snd l)\<rbrakk> \<Longrightarrow> i < length qs1
 2. \<And>j. j \<in> set signs1 \<Longrightarrow> length j = length qs1
 3. kronecker_product matrix1 matrix2 = kronecker_product (M_mat_R signs1 subsets1) (M_mat_R signs2 subsets2)
[PROOF STEP]
apply (metis Ball_set all_list_constr_R_def in_set_member list_constr_def satisfies_properties_R_def satisfies_properties_sys1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. j \<in> set signs1 \<Longrightarrow> length j = length qs1
 2. kronecker_product matrix1 matrix2 = kronecker_product (M_mat_R signs1 subsets1) (M_mat_R signs2 subsets2)
[PROOF STEP]
using satisfies_properties_R_def satisfies_properties_sys1 well_def_signs_def
[PROOF STATE]
proof (prove)
using this:
satisfies_properties_R ?p ?qs ?subsets ?signs ?matrix = (all_list_constr_R ?subsets (length ?qs) \<and> well_def_signs (length ?qs) ?signs \<and> distinct ?signs \<and> satisfy_equation_R ?p ?qs ?subsets ?signs \<and> invertible_mat ?matrix \<and> ?matrix = M_mat_R ?signs ?subsets \<and> set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs)
satisfies_properties_R p qs1 subsets1 signs1 matrix1
well_def_signs ?num_polys ?sign_conds \<equiv> \<forall>signs\<in>set ?sign_conds. length signs = ?num_polys

goal (2 subgoals):
 1. \<And>j. j \<in> set signs1 \<Longrightarrow> length j = length qs1
 2. kronecker_product matrix1 matrix2 = kronecker_product (M_mat_R signs1 subsets1) (M_mat_R signs2 subsets2)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kronecker_product matrix1 matrix2 = kronecker_product (M_mat_R signs1 subsets1) (M_mat_R signs2 subsets2)
[PROOF STEP]
using satisfies_properties_R_def satisfies_properties_sys1 satisfies_properties_sys2
[PROOF STATE]
proof (prove)
using this:
satisfies_properties_R ?p ?qs ?subsets ?signs ?matrix = (all_list_constr_R ?subsets (length ?qs) \<and> well_def_signs (length ?qs) ?signs \<and> distinct ?signs \<and> satisfy_equation_R ?p ?qs ?subsets ?signs \<and> invertible_mat ?matrix \<and> ?matrix = M_mat_R ?signs ?subsets \<and> set (characterize_consistent_signs_at_roots ?p ?qs) \<subseteq> set ?signs)
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2

goal (1 subgoal):
 1. kronecker_product matrix1 matrix2 = kronecker_product (M_mat_R signs1 subsets1) (M_mat_R signs2 subsets2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))) = M_mat_R (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
have h7: "set (characterize_consistent_signs_at_roots p (qs1 @ qs2))
    \<subseteq> set (?signs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using subset_step_R[of p qs1 signs1 qs2  signs2] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set (characterize_consistent_signs_at_roots p qs1) \<subseteq> set signs1; set (characterize_consistent_signs_at_roots p qs2) \<subseteq> set signs2\<rbrakk> \<Longrightarrow> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (signs_smash signs1 signs2)
p \<noteq> 0
0 < length qs1
0 < length qs2
satisfies_properties_R p qs1 subsets1 signs1 matrix1
satisfies_properties_R p qs2 subsets2 signs2 matrix2

goal (1 subgoal):
 1. set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
by (simp add: nonzero get_signs_R_def satisfies_properties_R_def smash_systems_R_def)
[PROOF STATE]
proof (state)
this:
set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
unfolding satisfies_properties_R_def
[PROOF STATE]
proof (prove)
using this:
set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. all_list_constr_R (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (length (qs1 @ qs2)) \<and> well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> invertible_mat (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))) = M_mat_R (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
using h1 h2 h3 h4 h5 h6 h7
[PROOF STATE]
proof (prove)
using this:
set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
all_list_constr_R (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (length (qs1 @ qs2))
well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
invertible_mat (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))) = M_mat_R (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal (1 subgoal):
 1. all_list_constr_R (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (length (qs1 @ qs2)) \<and> well_def_signs (length (qs1 @ qs2)) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> distinct (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> satisfy_equation_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> invertible_mat (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))) = M_mat_R (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) \<and> set (characterize_consistent_signs_at_roots p (qs1 @ qs2)) \<subseteq> set (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
satisfies_properties_R p (qs1 @ qs2) (get_subsets_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_signs_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2)))) (get_matrix_R (snd (combine_systems_R p (qs1, matrix1, subsets1, signs1) (qs2, matrix2, subsets2, signs2))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bintrunc_numeral:
  "(take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (numeral k) x = of_bool (odd x) + 2 * (take_bit :: nat \<Rightarrow> int \<Rightarrow> int) (pred_numeral k) (x div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (numeral k) x = of_bool (odd x) + 2 * take_bit (pred_numeral k) (x div 2)
[PROOF STEP]
by (simp add: numeral_eq_Suc take_bit_Suc mod_2_eq_odd)


[STATEMENT]
lemma is_subprob_densityD[dest]:
  "is_subprob_density M f \<Longrightarrow> f \<in> borel_measurable M"
  "is_subprob_density M f \<Longrightarrow> x \<in> space M \<Longrightarrow> f x \<ge> 0"
  "is_subprob_density M f \<Longrightarrow> space M \<noteq> {}"
  "is_subprob_density M f \<Longrightarrow> (\<integral>\<^sup>+x. f x \<partial>M) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((is_subprob_density M f \<Longrightarrow> f \<in> borel_measurable M) &&& (\<lbrakk>is_subprob_density M f; x \<in> space M\<rbrakk> \<Longrightarrow> 0 \<le> f x)) &&& (is_subprob_density M f \<Longrightarrow> space M \<noteq> {}) &&& (is_subprob_density M f \<Longrightarrow> integral\<^sup>N M f \<le> 1)
[PROOF STEP]
unfolding is_subprob_density_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f \<in> borel_measurable M \<and> space M \<noteq> {} \<and> (\<forall>x\<in>space M. 0 \<le> f x) \<and> integral\<^sup>N M f \<le> 1 \<Longrightarrow> f \<in> borel_measurable M) &&& (\<lbrakk>f \<in> borel_measurable M \<and> space M \<noteq> {} \<and> (\<forall>x\<in>space M. 0 \<le> f x) \<and> integral\<^sup>N M f \<le> 1; x \<in> space M\<rbrakk> \<Longrightarrow> 0 \<le> f x)) &&& (f \<in> borel_measurable M \<and> space M \<noteq> {} \<and> (\<forall>x\<in>space M. 0 \<le> f x) \<and> integral\<^sup>N M f \<le> 1 \<Longrightarrow> space M \<noteq> {}) &&& (f \<in> borel_measurable M \<and> space M \<noteq> {} \<and> (\<forall>x\<in>space M. 0 \<le> f x) \<and> integral\<^sup>N M f \<le> 1 \<Longrightarrow> integral\<^sup>N M f \<le> 1)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma separating_mono: \<open>A \<subseteq> B \<Longrightarrow> separating TYPE('a::finite) A \<Longrightarrow> separating TYPE('a) B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; separating TYPE('a) A\<rbrakk> \<Longrightarrow> separating TYPE('a) B
[PROOF STEP]
unfolding separating_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; \<forall>F G. clinear F \<longrightarrow> clinear G \<longrightarrow> (\<forall>x\<in>A. F x = G x) \<longrightarrow> F = G\<rbrakk> \<Longrightarrow> \<forall>F G. clinear F \<longrightarrow> clinear G \<longrightarrow> (\<forall>x\<in>B. F x = G x) \<longrightarrow> F = G
[PROOF STEP]
by (meson in_mono)


[STATEMENT]
lemma set_restrictionI: "f = (\<lambda>A. {x \<in> A. P x}) \<Longrightarrow> set_restriction f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>A. {x \<in> A. P x}) \<Longrightarrow> set_restriction f
[PROOF STEP]
unfolding set_restriction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>A. {x \<in> A. P x}) \<Longrightarrow> \<exists>P. \<forall>A. f A = {x \<in> A. P x}
[PROOF STEP]
by blast


[STATEMENT]
theorem complement_impl_correct:
    assumes "finite (NBA.nodes A)"
    assumes "(Ai, A) \<in> \<langle>Id, nat_rel\<rangle> nbai_nba_rel"
    shows "NBA.language (nbae_nba (nbaei_nbae (complement_impl Ai))) =
      streams (nba.alphabet A) - NBA.language A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NBA.language (nbae_nba (nbaei_nbae (complement_impl Ai))) = streams (nba.alphabet A) - NBA.language A
[PROOF STEP]
using op_translate_language[OF complement_impl.refine[OF assms]]
[PROOF STATE]
proof (prove)
using this:
NBA.language (nbae_nba (nbaei_nbae (complement_impl Ai))) = NBA.language (complement_4 A)

goal (1 subgoal):
 1. NBA.language (nbae_nba (nbaei_nbae (complement_impl Ai))) = streams (nba.alphabet A) - NBA.language A
[PROOF STEP]
using complement_4_correct[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
NBA.language (nbae_nba (nbaei_nbae (complement_impl Ai))) = NBA.language (complement_4 A)
NBA.language (complement_4 A) = streams (nba.alphabet A) - NBA.language A

goal (1 subgoal):
 1. NBA.language (nbae_nba (nbaei_nbae (complement_impl Ai))) = streams (nba.alphabet A) - NBA.language A
[PROOF STEP]
by simp