[STATEMENT]
lemma w_method_via_h_framework_lists_completeness :
  fixes M1 :: "('a::linorder,'b::linorder,'c::linorder) fsm"
  fixes M2 :: "('d,'b,'c) fsm"
  assumes "observable M1"
  and     "observable M2"
  and     "minimal M1"
  and     "minimal M2"
  and     "size_r M1 \<le> m"
  and     "size M2 \<le> m"
  and     "inputs M2 = inputs M1"
  and     "outputs M2 = outputs M1"
shows "(L M1 = L M2) \<longleftrightarrow> list_all (passes_test_case M2 (initial M2)) (w_method_via_h_framework_lists M1 m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (w_method_via_h_framework_lists M1 m)
[PROOF STEP]
using h_framework_static_with_empty_graph_lists_completeness[OF assms, where dist_fun="(\<lambda> k q . distinguishing_set M1)", OF _ distinguishing_set_finite]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (distinguishing_set M1) \<inter> Prefix_Tree.set (distinguishing_set M1) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_empty_graph_lists M1 (\<lambda>k q. distinguishing_set M1) m)

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (w_method_via_h_framework_lists M1 m)
[PROOF STEP]
using distinguishing_set_distinguishes[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (distinguishing_set M1) \<inter> Prefix_Tree.set (distinguishing_set M1) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (h_framework_static_with_empty_graph_lists M1 (\<lambda>k q. distinguishing_set M1) m)
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (distinguishing_set M1). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (w_method_via_h_framework_lists M1 m)
[PROOF STEP]
unfolding w_method_via_h_framework_lists_def h_framework_static_with_empty_graph_lists_def w_method_via_h_framework_def
[PROOF STATE]
proof (prove)
using this:
(\<And>q1 q2. \<lbrakk>q1 \<in> FSM.states M1; q2 \<in> FSM.states M1; q1 \<noteq> q2\<rbrakk> \<Longrightarrow> \<exists>io. \<forall>k1 k2. io \<in> Prefix_Tree.set (distinguishing_set M1) \<inter> Prefix_Tree.set (distinguishing_set M1) \<and> distinguishes M1 q1 q2 io) \<Longrightarrow> (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_empty_graph M1 (\<lambda>k q. distinguishing_set M1) m)))
\<lbrakk>?q1.0 \<in> FSM.states M1; ?q2.0 \<in> FSM.states M1; ?q1.0 \<noteq> ?q2.0\<rbrakk> \<Longrightarrow> \<exists>io\<in>Prefix_Tree.set (distinguishing_set M1). distinguishes M1 ?q1.0 ?q2.0 io

goal (1 subgoal):
 1. (L M1 = L M2) = list_all (passes_test_case M2 (FSM.initial M2)) (sorted_list_of_maximal_sequences_in_tree (test_suite_from_io_tree M1 (FSM.initial M1) (h_framework_static_with_empty_graph M1 (\<lambda>k q. distinguishing_set M1) m)))
[PROOF STEP]
by blast


[STATEMENT]
lemma le_DT_adm: "cont (u::('a::cpo) \<Rightarrow> 'b process) \<Longrightarrow> monofun v \<Longrightarrow> adm(\<lambda>x. u x \<sqsubseteq>\<^sub>D\<^sub>T v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cont u; monofun v\<rbrakk> \<Longrightarrow> adm (\<lambda>x. u x \<sqsubseteq>\<^sub>D\<^sub>T v x)
[PROOF STEP]
using adm_conj[OF le_T_adm[of u v] le_D_adm[of u v]]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>cont u; monofun v; cont u; monofun v\<rbrakk> \<Longrightarrow> adm (\<lambda>x. u x \<sqsubseteq>\<^sub>T v x \<and> u x \<sqsubseteq>\<^sub>D v x)

goal (1 subgoal):
 1. \<lbrakk>cont u; monofun v\<rbrakk> \<Longrightarrow> adm (\<lambda>x. u x \<sqsubseteq>\<^sub>D\<^sub>T v x)
[PROOF STEP]
by (simp add:trace_divergence_refine_def)


[STATEMENT]
lemma T_nth_eq: "T_nth xs n = min n (length xs) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_nth xs n = min n (length xs) + 1
[PROOF STEP]
by (induction xs n rule: T_nth.induct) (auto split: nat.splits)


[STATEMENT]
lemma cong_scalar2_poly: "[(a::'b::{field_gcd} poly)= b] (mod m) \<Longrightarrow> [k * a = k * b] (mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a = b] (mod m) \<Longrightarrow> [k * a = k * b] (mod m)
[PROOF STEP]
by (fact cong_scalar_left)


[STATEMENT]
lemma UINF_as_Sup_image: "(\<Sqinter> P | \<guillemotleft>P\<guillemotright> \<in>\<^sub>u \<guillemotleft>A\<guillemotright> \<bullet> f(P)) = \<Sqinter> (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> P \<in> A \<bullet> f P) = \<Sqinter>(f ` A)
[PROOF STEP]
apply (simp add: upred_defs bop.rep_eq lit.rep_eq Sup_uexpr_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sqinter> P \<in> A \<bullet> f P) = mk\<^sub>e (\<lambda>Aa. \<Sqinter>x\<in>A. \<lbrakk>f x\<rbrakk>\<^sub>e Aa)
[PROOF STEP]
apply (pred_simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<Sqinter>{uu_. \<exists>x. uu_ = \<lbrakk>f x\<rbrakk>\<^sub>e b \<and> x \<in> A} = (\<Sqinter>x\<in>A. \<lbrakk>f x\<rbrakk>\<^sub>e b)
[PROOF STEP]
apply (rule cong[of "Sup"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b. Sup = Sup
 2. \<And>b. {uu_. \<exists>x. uu_ = \<lbrakk>f x\<rbrakk>\<^sub>e b \<and> x \<in> A} = (\<lambda>x. \<lbrakk>f x\<rbrakk>\<^sub>e b) ` A
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma SUP_nat_Infty: "(SUP i. ereal (real i)) = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. ereal (real i)) = \<infinity>
[PROOF STEP]
by (rule SUP_PInfty) auto


[STATEMENT]
lemma AE_pairwise: "countable F \<Longrightarrow> pairwise (\<lambda>A B. AE x in M. R x A B) F \<longleftrightarrow> (AE x in M. pairwise (R x) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable F \<Longrightarrow> pairwise (\<lambda>A B. AE x in M. R x A B) F = (AE x in M. pairwise (R x) F)
[PROOF STEP]
unfolding pairwise_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable F \<Longrightarrow> (\<forall>x\<in>F. \<forall>B\<in>F - {x}. AE xa in M. R xa x B) = (AE x in M. \<forall>xa\<in>F. Ball (F - {xa}) (R x xa))
[PROOF STEP]
by (simp add: AE_ball_countable)


[STATEMENT]
lemma ball_eq_ball_iff:
  fixes x :: "'a :: euclidean_space"
  shows "ball x d = ball y e \<longleftrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x=y \<and> d=e"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ball x d = ball y e) = (d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ball x d = ball y e \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
 2. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e \<Longrightarrow> ball x d = ball y e
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
ball x d = ball y e

goal (2 subgoals):
 1. ball x d = ball y e \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
 2. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e \<Longrightarrow> ball x d = ball y e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball x d = ball y e
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
ball x d = ball y e

goal (1 subgoal):
 1. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
proof (cases "d \<le> 0 \<or> e \<le> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>ball x d = ball y e; d \<le> 0 \<or> e \<le> 0\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
 2. \<lbrakk>ball x d = ball y e; \<not> (d \<le> 0 \<or> e \<le> 0)\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
d \<le> 0 \<or> e \<le> 0

goal (2 subgoals):
 1. \<lbrakk>ball x d = ball y e; d \<le> 0 \<or> e \<le> 0\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
 2. \<lbrakk>ball x d = ball y e; \<not> (d \<le> 0 \<or> e \<le> 0)\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
with \<open>?lhs\<close>
[PROOF STATE]
proof (chain)
picking this:
ball x d = ball y e
d \<le> 0 \<or> e \<le> 0
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
ball x d = ball y e
d \<le> 0 \<or> e \<le> 0

goal (1 subgoal):
 1. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
by safe (simp_all only: ball_eq_empty [of y e, symmetric] ball_eq_empty [of x d, symmetric])
[PROOF STATE]
proof (state)
this:
d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e

goal (1 subgoal):
 1. \<lbrakk>ball x d = ball y e; \<not> (d \<le> 0 \<or> e \<le> 0)\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>ball x d = ball y e; \<not> (d \<le> 0 \<or> e \<le> 0)\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (d \<le> 0 \<or> e \<le> 0)

goal (1 subgoal):
 1. \<lbrakk>ball x d = ball y e; \<not> (d \<le> 0 \<or> e \<le> 0)\<rbrakk> \<Longrightarrow> d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
with \<open>?lhs\<close>
[PROOF STATE]
proof (chain)
picking this:
ball x d = ball y e
\<not> (d \<le> 0 \<or> e \<le> 0)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
ball x d = ball y e
\<not> (d \<le> 0 \<or> e \<le> 0)

goal (1 subgoal):
 1. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
apply (auto simp: set_eq_subset ball_subset_ball_iff dist_norm norm_minus_commute algebra_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>d + norm (x - y) \<le> e; e + norm (x - y) \<le> d; \<not> d \<le> 0; \<not> e \<le> 0\<rbrakk> \<Longrightarrow> x = y
 2. \<lbrakk>d + norm (x - y) \<le> e; e + norm (x - y) \<le> d; \<not> d \<le> 0; \<not> e \<le> 0\<rbrakk> \<Longrightarrow> d = e
[PROOF STEP]
apply (metis add_le_same_cancel1 le_add_same_cancel1 norm_ge_zero norm_pths(2) order_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d + norm (x - y) \<le> e; e + norm (x - y) \<le> d; \<not> d \<le> 0; \<not> e \<le> 0\<rbrakk> \<Longrightarrow> d = e
[PROOF STEP]
apply (metis add_increasing2 add_le_imp_le_right eq_iff norm_ge_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e

goal (1 subgoal):
 1. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e \<Longrightarrow> ball x d = ball y e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e \<Longrightarrow> ball x d = ball y e
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e

goal (1 subgoal):
 1. d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e \<Longrightarrow> ball x d = ball y e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
d \<le> 0 \<and> e \<le> 0 \<or> x = y \<and> d = e

goal (1 subgoal):
 1. ball x d = ball y e
[PROOF STEP]
by (auto simp: set_eq_subset ball_subset_ball_iff)
[PROOF STATE]
proof (state)
this:
ball x d = ball y e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma news_psubst: \<open>news c z \<Longrightarrow> d \<notin> image f (\<Union>p \<in> set z. params p) \<Longrightarrow>
    news d (map (psubst (f(c := d))) z)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>news c z; d \<notin> f ` \<Union> (params ` set z)\<rbrakk> \<Longrightarrow> news d (map (psubst (f(c := d))) z)
[PROOF STEP]
using new_psubst_image
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>new ?c ?p; ?d \<notin> ?f ` params ?p\<rbrakk> \<Longrightarrow> new ?d (psubst (?f(?c := ?d)) ?p)

goal (1 subgoal):
 1. \<lbrakk>news c z; d \<notin> f ` \<Union> (params ` set z)\<rbrakk> \<Longrightarrow> news d (map (psubst (f(c := d))) z)
[PROOF STEP]
by (induct z) auto


[STATEMENT]
lemma PiQ_correct: "Rep_quasi_borel (PiQ I M) = (\<Pi>\<^sub>E i\<in>I. qbs_space (M i), prod_qbs_Mx I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_quasi_borel (PiQ I M) = (\<Pi>\<^sub>E i\<in>I. qbs_space (M i), prod_qbs_Mx I M)
[PROOF STEP]
by(auto intro!: Abs_quasi_borel_inverse PiQ_f is_quasi_borel_intro simp: PiQ_def PiQ_closed1 PiQ_closed2 PiQ_closed3)


[STATEMENT]
lemma WCR_alt_def: "WCR A \<longleftrightarrow> A\<inverse> O A \<subseteq> A\<^sup>\<down>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. WCR A = (A\<inverse> O A \<subseteq> A\<^sup>\<down>)
[PROOF STEP]
by (auto simp: WCR_defs)


[STATEMENT]
lemma vproduct_vsingleton_def: "(\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>set {j}. A i) = (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>set {j}. A j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vproduct (set {j}) A = (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>set {j}. A j)
[PROOF STEP]
by auto


[STATEMENT]
lemma VEnd_composite_left :
  assumes "VEnd S"
  shows   "VEnd (S \<circ> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VEnd (S \<circ> T)
[PROOF STEP]
using endomorph VectorSpaceEnd.axioms(1)[OF assms] VectorSpaceHom_composite_left
        VectorSpaceEnd.endomorph[OF assms] VectorSpaceEndI[of smult V "S \<circ> T"]
[PROOF STATE]
proof (prove)
using this:
ImG \<subseteq> V
VectorSpaceHom (\<cdot>) V (\<cdot>) S
VectorSpaceHom (\<cdot>) V ?smult'' ?S \<Longrightarrow> VectorSpaceHom (\<cdot>) V ?smult'' (?S \<circ> T)
S ` V \<subseteq> V
\<lbrakk>VectorSpaceHom (\<cdot>) V (\<cdot>) (S \<circ> T); (S \<circ> T) ` V \<subseteq> V\<rbrakk> \<Longrightarrow> VEnd (S \<circ> T)

goal (1 subgoal):
 1. VEnd (S \<circ> T)
[PROOF STEP]
by    fastforce


[STATEMENT]
lemma observable_alt_def :
  "observable M = (\<forall> q1 x y q1' q1'' . (q1,x,y,q1') \<in> transitions M \<and> (q1,x,y,q1'') \<in> transitions M \<longrightarrow> q1' = q1'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. observable M = (\<forall>q1 x y q1' q1''. (q1, x, y, q1') \<in> FSM.transitions M \<and> (q1, x, y, q1'') \<in> FSM.transitions M \<longrightarrow> q1' = q1'')
[PROOF STEP]
by auto


[STATEMENT]
lemma not_false_eq_true: "(~ False) = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> False) = True
[PROOF STEP]
by simp


[STATEMENT]
theorem wls_subst_vsubst_trans:
assumes  "wls s X" and "wls (asSort ys) Y" and "fresh ys y1 X"
shows "((X #[y1 // y]_ys) #[Y / y1]_ys) = (X #[Y / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[y1 // y]_ys #[Y / y1]_ys = X #[Y / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
wls (asSort ys) Y
fresh ys y1 X

goal (1 subgoal):
 1. X #[y1 // y]_ys #[Y / y1]_ys = X #[Y / y]_ys
[PROOF STEP]
by (simp add: subst_vsubst_trans)


[STATEMENT]
lemma unity_periodic_arithmetic:
  "periodic_arithmetic (unity_root k) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>x. unity_root k (int x)) k
[PROOF STEP]
unfolding periodic_arithmetic_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
have "unity_root k (n + k) = unity_root k ((n+k) mod k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k (int (n + k)) = unity_root k (int ((n + k) mod k))
[PROOF STEP]
using unity_root_mod[of k] zmod_int
[PROOF STATE]
proof (prove)
using this:
unity_root k (?n mod int k) = unity_root k ?n
int (?a mod ?b) = int ?a mod int ?b

goal (1 subgoal):
 1. unity_root k (int (n + k)) = unity_root k (int ((n + k) mod k))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
unity_root k (int (n + k)) = unity_root k (int ((n + k) mod k))

goal (1 subgoal):
 1. \<And>n. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unity_root k (int (n + k)) = unity_root k (int ((n + k) mod k))

goal (1 subgoal):
 1. \<And>n. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
have "unity_root k ((n+k) mod k) = unity_root k n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k (int ((n + k) mod k)) = unity_root k (int n)
[PROOF STEP]
using unity_root_mod zmod_int
[PROOF STATE]
proof (prove)
using this:
unity_root ?k (?n mod int ?k) = unity_root ?k ?n
int (?a mod ?b) = int ?a mod int ?b

goal (1 subgoal):
 1. unity_root k (int ((n + k) mod k)) = unity_root k (int n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unity_root k (int ((n + k) mod k)) = unity_root k (int n)

goal (1 subgoal):
 1. \<And>n. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
show "unity_root k (n + k) = unity_root k n"
[PROOF STATE]
proof (prove)
using this:
unity_root k (int (n + k)) = unity_root k (int n)

goal (1 subgoal):
 1. unity_root k (int (n + k)) = unity_root k (int n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root k (int (n + k)) = unity_root k (int n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma V_reset_closed[intro]:
  assumes "u \<in> V"
  shows "[r \<rightarrow> (d::nat)]u \<in> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [r\<rightarrow>real d]u \<in> V
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> V

goal (1 subgoal):
 1. [r\<rightarrow>real d]u \<in> V
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
using this:
u \<in> {v. \<forall>x\<in>\<X>. 0 \<le> v x}

goal (1 subgoal):
 1. [r\<rightarrow>real d]u \<in> {v. \<forall>x\<in>\<X>. 0 \<le> v x}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x\<in>\<X>. 0 \<le> u x; x \<in> \<X>\<rbrakk> \<Longrightarrow> 0 \<le> ([r\<rightarrow>real d]u) x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>\<X>. 0 \<le> u x; x \<in> \<X>\<rbrakk> \<Longrightarrow> 0 \<le> ([r\<rightarrow>real d]u) x
[PROOF STEP]
by (cases "x \<in> set r"; auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ct_list_eq_cons_ct_list1:
  assumes "ct_list_eq (to_ct_list as) (xs @ (to_ct_list ys))"
  shows "\<exists>bs. as = bs @ ys \<and> ct_list_eq (to_ct_list bs) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>bs. as = bs @ ys \<and> ct_list_eq (to_ct_list bs) xs
[PROOF STEP]
using ct_list_eq_cons_ct_list[OF assms] ct_list_eq_ts_conv_eq
[PROOF STATE]
proof (prove)
using this:
\<exists>bs bs'. as = bs @ bs' \<and> ct_list_eq (to_ct_list bs) xs \<and> ct_list_eq (to_ct_list bs') (to_ct_list ys)
ct_list_eq (to_ct_list ?ts) (to_ct_list ?ts') = (?ts = ?ts')

goal (1 subgoal):
 1. \<exists>bs. as = bs @ ys \<and> ct_list_eq (to_ct_list bs) xs
[PROOF STEP]
by fastforce


[STATEMENT]
lemma trans_path_correct: "(i,j) \<in> set ps \<longleftrightarrow> (i+k\<^sub>1,j+k\<^sub>2) \<in> set (trans_path (k\<^sub>1,k\<^sub>2) ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((i, j) \<in> set ps) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) ps))
[PROOF STEP]
proof (induction ps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((i, j) \<in> set []) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) []))
 2. \<And>a ps. ((i, j) \<in> set ps) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) ps)) \<Longrightarrow> ((i, j) \<in> set (a # ps)) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) (a # ps)))
[PROOF STEP]
case (Cons s\<^sub>i ps)
[PROOF STATE]
proof (state)
this:
((i, j) \<in> set ps) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) ps))

goal (2 subgoals):
 1. ((i, j) \<in> set []) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) []))
 2. \<And>a ps. ((i, j) \<in> set ps) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) ps)) \<Longrightarrow> ((i, j) \<in> set (a # ps)) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) (a # ps)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((i, j) \<in> set ps) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) ps))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
((i, j) \<in> set ps) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) ps))

goal (1 subgoal):
 1. ((i, j) \<in> set (s\<^sub>i # ps)) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) (s\<^sub>i # ps)))
[PROOF STEP]
by (cases s\<^sub>i) auto
[PROOF STATE]
proof (state)
this:
((i, j) \<in> set (s\<^sub>i # ps)) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) (s\<^sub>i # ps)))

goal (1 subgoal):
 1. ((i, j) \<in> set []) = ((i + k\<^sub>1, j + k\<^sub>2) \<in> set (trans_path (k\<^sub>1, k\<^sub>2) []))
[PROOF STEP]
qed auto


[STATEMENT]
lemma sum_list_closed : "set (map f as) \<subseteq> G \<Longrightarrow> (\<Sum>a\<leftarrow>as. f a) \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map f as) \<subseteq> G \<Longrightarrow> sum_list (map f as) \<in> G
[PROOF STEP]
using zero_closed add_closed
[PROOF STATE]
proof (prove)
using this:
(0::'g) \<in> G
\<lbrakk>?g \<in> G; ?h \<in> G\<rbrakk> \<Longrightarrow> ?g + ?h \<in> G

goal (1 subgoal):
 1. set (map f as) \<subseteq> G \<Longrightarrow> sum_list (map f as) \<in> G
[PROOF STEP]
by (induct as) auto


[STATEMENT]
lemma keysFor_UN [simp]: "keysFor (\<Union>i\<in>A. H i) = (\<Union>i\<in>A. keysFor (H i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keysFor (\<Union> (H ` A)) = (\<Union>i\<in>A. keysFor (H i))
[PROOF STEP]
by (unfold keysFor_def, blast)


[STATEMENT]
lemma bw_diff_sum_pow [simp]:
  "(bw_diff ^^ k) (\<lambda>x. (\<Sum>i\<in>I. f i x)) = (\<lambda>x. (\<Sum>i\<in>I. (bw_diff ^^ k) (f i) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bw_diff ^^ k) (\<lambda>x. \<Sum>i\<in>I. f i x) = (\<lambda>x. \<Sum>i\<in>I. (bw_diff ^^ k) (f i) x)
[PROOF STEP]
by (induct I rule: infinite_finite_induct, simp_all add: bw_diff_const_pow)


[STATEMENT]
lemma msubstltneg_nb: "tmbound0 t \<Longrightarrow> islin (Lt (CNP 0 a r)) \<Longrightarrow> bound0 (msubstltneg c t a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>tmbound0 t; islin (Lt (CNP 0 a r))\<rbrakk> \<Longrightarrow> bound0 (msubstltneg c t a r)
[PROOF STEP]
by (simp add: msubstltneg_def)


[STATEMENT]
lemma proots_within_iff[simp]:
  "x\<in>proots_within p s \<longleftrightarrow> poly p x=0 \<and> x\<in>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> proots_within p s) = (poly p x = (0::'a) \<and> x \<in> s)
[PROOF STEP]
unfolding proots_within_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {x \<in> s. poly p x = (0::'a)}) = (poly p x = (0::'a) \<and> x \<in> s)
[PROOF STEP]
by auto


[STATEMENT]
lemma divide_lt1:
  "\<lbrakk>c *R (a::'a) < b; (c::rat) < 0\<rbrakk> \<Longrightarrow> a > (1/c) *R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c *R a < b; c < 0\<rbrakk> \<Longrightarrow> (1 / c) *R b < a
[PROOF STEP]
using scaleRat_less2[of "c *R a" b "1/c"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>c *R a < b; 1 / c < 0\<rbrakk> \<Longrightarrow> (1 / c) *R b < (1 / c) *R c *R a

goal (1 subgoal):
 1. \<lbrakk>c *R a < b; c < 0\<rbrakk> \<Longrightarrow> (1 / c) *R b < a
[PROOF STEP]
by (simp add: scaleRat_scaleRat scaleRat_one)


[STATEMENT]
lemma fls_inverse_regpart:
  assumes "fls_subdegree f = 0"
  shows   "fls_regpart (inverse f) = inverse (fls_regpart f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_regpart (inverse f) = inverse (fls_regpart f)
[PROOF STEP]
by      (simp add: assms fls_inverse_def)


[STATEMENT]
lemma mapCollect_empty[simp]: "{f k v | k \<mapsto> v \<in> Map.empty} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mapCollect f Map.empty = {}
[PROOF STEP]
unfolding mapCollect_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f k v |k v. None = Some v} = {}
[PROOF STEP]
by simp


[STATEMENT]
lemma restrict_mono_map: "A \<subseteq>\<^sub>s B \<Longrightarrow>  (A \<ominus>\<^bsub>x\<^esub> C) \<subseteq>\<^sub>s (B \<ominus>\<^bsub>x\<^esub> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq>\<^sub>s B \<Longrightarrow> A \<ominus>\<^bsub>x\<^esub> C \<subseteq>\<^sub>s B \<ominus>\<^bsub>x\<^esub> C
[PROOF STEP]
by (auto simp add:  restrict_shared_def shared_le_def map_le_def read_only_def dom_def split: option.splits if_split_asm)


[STATEMENT]
lemma card_eq_bij:
  assumes cardAB: "card A = card B"
      and finiteA: "finite A" and finiteB: "finite B"
  obtains f where "bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from finiteA
[PROOF STATE]
proof (chain)
picking this:
finite A
[PROOF STEP]
obtain g where G: "bij_betw g A {0..<card A}"
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (\<And>g. bij_betw g A {0..<card A} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast dest: ex_bij_betw_finite_nat)
[PROOF STATE]
proof (state)
this:
bij_betw g A {0..<card A}

goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from finiteB
[PROOF STATE]
proof (chain)
picking this:
finite B
[PROOF STEP]
obtain h where H: "bij_betw h {0..<card B} B"
[PROOF STATE]
proof (prove)
using this:
finite B

goal (1 subgoal):
 1. (\<And>h. bij_betw h {0..<card B} B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast dest: ex_bij_betw_nat_finite)
[PROOF STATE]
proof (state)
this:
bij_betw h {0..<card B} B

goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from G H cardAB
[PROOF STATE]
proof (chain)
picking this:
bij_betw g A {0..<card A}
bij_betw h {0..<card B} B
card A = card B
[PROOF STEP]
have I: "inj_on (h \<circ> g) A"
[PROOF STATE]
proof (prove)
using this:
bij_betw g A {0..<card A}
bij_betw h {0..<card B} B
card A = card B

goal (1 subgoal):
 1. inj_on (h \<circ> g) A
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on g A \<and> g ` A = {0..<card A}
inj_on h {0..<card B} \<and> h ` {0..<card B} = B
card A = card B

goal (1 subgoal):
 1. inj_on (h \<circ> g) A
[PROOF STEP]
by - (rule comp_inj_on, simp_all)
[PROOF STATE]
proof (state)
this:
inj_on (h \<circ> g) A

goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from G H cardAB
[PROOF STATE]
proof (chain)
picking this:
bij_betw g A {0..<card A}
bij_betw h {0..<card B} B
card A = card B
[PROOF STEP]
have "(h \<circ> g) ` A = B"
[PROOF STATE]
proof (prove)
using this:
bij_betw g A {0..<card A}
bij_betw h {0..<card B} B
card A = card B

goal (1 subgoal):
 1. (h \<circ> g) ` A = B
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on g A \<and> g ` A = {0..<card A}
inj_on h {0..<card B} \<and> h ` {0..<card B} = B
card A = card B

goal (1 subgoal):
 1. (h \<circ> g) ` A = B
[PROOF STEP]
by auto (metis image_cong image_image)
[PROOF STATE]
proof (state)
this:
(h \<circ> g) ` A = B

goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with I
[PROOF STATE]
proof (chain)
picking this:
inj_on (h \<circ> g) A
(h \<circ> g) ` A = B
[PROOF STEP]
have "bij_betw (h \<circ> g) A B"
[PROOF STATE]
proof (prove)
using this:
inj_on (h \<circ> g) A
(h \<circ> g) ` A = B

goal (1 subgoal):
 1. bij_betw (h \<circ> g) A B
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on (h \<circ> g) A
(h \<circ> g) ` A = B

goal (1 subgoal):
 1. inj_on (h \<circ> g) A \<and> (h \<circ> g) ` A = B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw (h \<circ> g) A B

goal (1 subgoal):
 1. (\<And>f. bij_betw f A B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw (h \<circ> g) A B

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monoI2: "\<forall>m. \<forall>n \<ge> m. X n \<le> X m \<Longrightarrow> monoseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m \<Longrightarrow> monoseq X
[PROOF STEP]
by (simp add: monoseq_def)


[STATEMENT]
lemma iMOD_singleton_subset_conv: "([r, mod m] \<subseteq> {a}) = (r = a \<and> m = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r, mod m ] \<subseteq> {a}) = (r = a \<and> m = 0)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [ r, mod m ] \<subseteq> {a} \<Longrightarrow> r = a \<and> m = 0
 2. r = a \<and> m = 0 \<Longrightarrow> [ r, mod m ] \<subseteq> {a}
[PROOF STEP]
apply (simp add: subset_singleton_conv iT_not_empty)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [ r, mod m ] = {a} \<Longrightarrow> r = a \<and> m = 0
 2. r = a \<and> m = 0 \<Longrightarrow> [ r, mod m ] \<subseteq> {a}
[PROOF STEP]
apply (simp add: set_eq_iff iT_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x. (x mod m = r mod m \<and> r \<le> x) = (x = a) \<Longrightarrow> r = a \<and> m = 0
 2. r = a \<and> m = 0 \<Longrightarrow> [ r, mod m ] \<subseteq> {a}
[PROOF STEP]
apply (frule_tac x=r in spec, drule_tac x="r+m" in spec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(r mod m = r mod m \<and> r \<le> r) = (r = a); ((r + m) mod m = r mod m \<and> r \<le> r + m) = (r + m = a)\<rbrakk> \<Longrightarrow> r = a \<and> m = 0
 2. r = a \<and> m = 0 \<Longrightarrow> [ r, mod m ] \<subseteq> {a}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = a \<and> m = 0 \<Longrightarrow> [ r, mod m ] \<subseteq> {a}
[PROOF STEP]
apply (simp add: iMOD_0 iIN_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cblinfun_of_matrix_works:
  fixes f::"'a::ceuclidean_space \<Rightarrow>\<^sub>C\<^sub>L 'b::ceuclidean_space"
  shows "cblinfun_of_matrix (\<lambda>i j. i \<bullet>\<^sub>C (f j)) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_of_matrix (\<lambda>i j. i \<bullet>\<^sub>C cblinfun_apply f j) = f
[PROOF STEP]
proof (transfer, rule,  rule ceuclidean_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
fix f::"'a \<Rightarrow> 'b" and x::'a and b::'b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
assume "bounded_clinear f" and b: "b \<in> CBasis"
[PROOF STATE]
proof (state)
this:
bounded_clinear f
b \<in> CBasis

goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_clinear f
b \<in> CBasis
[PROOF STEP]
interpret bounded_clinear f
[PROOF STATE]
proof (prove)
using this:
bounded_clinear f
b \<in> CBasis

goal (1 subgoal):
 1. bounded_clinear f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
have "(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b
    = (\<Sum>j\<in>CBasis. if j = b then (\<Sum>i\<in>CBasis. (x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j))) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = (\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0)
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<in> CBasis

goal (1 subgoal):
 1. (\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = (\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0)
[PROOF STEP]
apply (simp add: cinner_sum_left cinner_CBasis if_distrib cong: if_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> CBasis \<Longrightarrow> (\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. if j = b then x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b) else 0) = (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b))
[PROOF STEP]
by (simp add: sum.swap)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = (\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0)

goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = (\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0)

goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>CBasis. ((x \<bullet>\<^sub>C i) * (f i \<bullet>\<^sub>C b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0) = (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b))
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
b \<in> CBasis

goal (1 subgoal):
 1. (\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0) = (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b))
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0) = (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b))

goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>CBasis. if j = b then \<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C j) else 0) = (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b))

goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
have "\<dots> = f x \<bullet>\<^sub>C b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
have \<open>(\<Sum>i\<in>CBasis. (x \<bullet>\<^sub>C i) * (f i \<bullet>\<^sub>C b)) = (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x) *\<^sub>C f i) \<bullet>\<^sub>C b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x) *\<^sub>C f i) \<bullet>\<^sub>C b
[PROOF STEP]
by (auto simp: cinner_sum_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x) *\<^sub>C f i) \<bullet>\<^sub>C b

goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x) *\<^sub>C f i) \<bullet>\<^sub>C b

goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
have \<open>\<dots> = f x \<bullet>\<^sub>C b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x) *\<^sub>C f i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
by (simp add: ceuclidean_representation sum[symmetric] scale[symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x) *\<^sub>C f i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b

goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b

goal (1 subgoal):
 1. (\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>CBasis. x \<bullet>\<^sub>C i * (f i \<bullet>\<^sub>C b)) = f x \<bullet>\<^sub>C b

goal (1 subgoal):
 1. \<And>f x b. \<lbrakk>bounded_clinear f; b \<in> CBasis\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * (i \<bullet>\<^sub>C f j)) *\<^sub>C i) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
show "(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b

goal (1 subgoal):
 1. (\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>CBasis. \<Sum>i\<in>CBasis. (i \<bullet>\<^sub>C x * (j \<bullet>\<^sub>C f i)) *\<^sub>C j) \<bullet>\<^sub>C b = f x \<bullet>\<^sub>C b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homogenize_uminus [simp]: "homogenize x (- p) = - homogenize x (p::_ \<Rightarrow>\<^sub>0 'a::ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homogenize x (- p) = - homogenize x p
[PROOF STEP]
by (simp add: homogenize_def keys_uminus sum.reindex inj_on_def single_uminus sum_negf)


[STATEMENT]
lemma H_below_regular_g:
  assumes "f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T"
    and "f \<le> --g"
    and "symmetric g"
  shows "h \<le> --g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<le> - - g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h \<le> - - g
[PROOF STEP]
have "h \<le> f \<squnion> f\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<le> f \<squnion> f\<^sup>T
[PROOF STEP]
using assms(1) sup_assoc
[PROOF STATE]
proof (prove)
using this:
f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
?x \<squnion> ?y \<squnion> ?z = ?x \<squnion> (?y \<squnion> ?z)

goal (1 subgoal):
 1. h \<le> f \<squnion> f\<^sup>T
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h \<le> f \<squnion> f\<^sup>T

goal (1 subgoal):
 1. h \<le> - - g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h \<le> f \<squnion> f\<^sup>T

goal (1 subgoal):
 1. h \<le> - - g
[PROOF STEP]
have "... \<le> --g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<squnion> f\<^sup>T \<le> - - g
[PROOF STEP]
using assms(2, 3) conv_complement conv_isotone
[PROOF STATE]
proof (prove)
using this:
f \<le> - - g
symmetric g
(- ?x)\<^sup>T = - ?x\<^sup>T
?x \<le> ?y \<Longrightarrow> ?x\<^sup>T \<le> ?y\<^sup>T

goal (1 subgoal):
 1. f \<squnion> f\<^sup>T \<le> - - g
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f \<squnion> f\<^sup>T \<le> - - g

goal (1 subgoal):
 1. h \<le> - - g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
h \<le> - - g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h \<le> - - g

goal (1 subgoal):
 1. h \<le> - - g
[PROOF STEP]
using order_trans
[PROOF STATE]
proof (prove)
using this:
h \<le> - - g
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_least_le:
    assumes "enat n < esize A"
    shows "n \<le> nth_least A n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> nth_least A n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
enat n < esize A

goal (1 subgoal):
 1. n \<le> nth_least A n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. enat 0 < esize A \<Longrightarrow> 0 \<le> nth_least A 0
 2. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
enat 0 < esize A

goal (2 subgoals):
 1. enat 0 < esize A \<Longrightarrow> 0 \<le> nth_least A 0
 2. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> nth_least A 0
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
enat 0 < esize A

goal (1 subgoal):
 1. 0 \<le> nth_least A 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> nth_least A 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
enat n < esize A \<Longrightarrow> n \<le> nth_least A n
enat (Suc n) < esize A

goal (1 subgoal):
 1. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
have "n \<le> nth_least A n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> nth_least A n
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
enat n < esize A \<Longrightarrow> n \<le> nth_least A n
enat (Suc n) < esize A

goal (1 subgoal):
 1. n \<le> nth_least A n
[PROOF STEP]
by (metis Suc_ile_eq less_imp_le)
[PROOF STATE]
proof (state)
this:
n \<le> nth_least A n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n \<le> nth_least A n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
have "\<dots> < nth_least A (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_least A n < nth_least A (Suc n)
[PROOF STEP]
using nth_least_strict_mono Suc(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>enat ?l < esize ?A; ?k < ?l\<rbrakk> \<Longrightarrow> nth_least ?A ?k < nth_least ?A ?l
enat (Suc n) < esize A

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>enat n < esize A \<Longrightarrow> n \<le> nth_least A n; enat (Suc n) < esize A\<rbrakk> \<Longrightarrow> Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n < nth_least A (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
n < nth_least A (Suc n)

goal (1 subgoal):
 1. Suc n \<le> nth_least A (Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc n \<le> nth_least A (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_pow_free_Abelian_group [simp]:
  fixes n::int
  assumes "Poly_Mapping.keys x \<subseteq> S"
  shows "Group.pow (free_Abelian_group S) x n = frag_cmul n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>free_Abelian_group S\<^esub> n = frag_cmul n x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> int n = frag_cmul (int n) x
 2. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
case (nonneg n)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> int n = frag_cmul (int n) x
 2. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>free_Abelian_group S\<^esub> int n = frag_cmul (int n) x
[PROOF STEP]
by (simp add: int_pow_int)
[PROOF STATE]
proof (state)
this:
x [^]\<^bsub>free_Abelian_group S\<^esub> int n = frag_cmul (int n) x

goal (1 subgoal):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
case (neg n)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
have "x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n)
     = inv\<^bsub>free_Abelian_group S\<^esub> (x [^]\<^bsub>free_Abelian_group S\<^esub> int (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = inv\<^bsub>free_Abelian_group S\<^esub> (x [^]\<^bsub>free_Abelian_group S\<^esub> int (Suc n))
[PROOF STEP]
by (rule group.int_pow_neg [OF group_free_Abelian_group]) (use assms in \<open>simp add: free_Abelian_group_def\<close>)
[PROOF STATE]
proof (state)
this:
x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = inv\<^bsub>free_Abelian_group S\<^esub> (x [^]\<^bsub>free_Abelian_group S\<^esub> int (Suc n))

goal (1 subgoal):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = inv\<^bsub>free_Abelian_group S\<^esub> (x [^]\<^bsub>free_Abelian_group S\<^esub> int (Suc n))

goal (1 subgoal):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
have "\<dots> = frag_cmul (- int (Suc n)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>free_Abelian_group S\<^esub> (x [^]\<^bsub>free_Abelian_group S\<^esub> int (Suc n)) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
by (metis assms inv_free_Abelian_group pow_free_Abelian_group int_pow_int minus_frag_cmul
              order_trans keys_cmul)
[PROOF STATE]
proof (state)
this:
inv\<^bsub>free_Abelian_group S\<^esub> (x [^]\<^bsub>free_Abelian_group S\<^esub> int (Suc n)) = frag_cmul (- int (Suc n)) x

goal (1 subgoal):
 1. \<And>n. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x

goal (1 subgoal):
 1. x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x [^]\<^bsub>free_Abelian_group S\<^esub> - int (Suc n) = frag_cmul (- int (Suc n)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma binary_chinese_remainder_int:
  fixes m1 m2 :: int
  assumes a: "coprime m1 m2"
  shows "\<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
have "\<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
from cong_solve_coprime_int [OF a]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. [m1 * x = 1] (mod m2)
[PROOF STEP]
obtain x1 where 1: "[m1 * x1 = 1] (mod m2)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. [m1 * x = 1] (mod m2)

goal (1 subgoal):
 1. (\<And>x1. [m1 * x1 = 1] (mod m2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[m1 * x1 = 1] (mod m2)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
coprime m1 m2
[PROOF STEP]
have b: "coprime m2 m1"
[PROOF STATE]
proof (prove)
using this:
coprime m1 m2

goal (1 subgoal):
 1. coprime m2 m1
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
coprime m2 m1

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
from cong_solve_coprime_int [OF b]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. [m2 * x = 1] (mod m1)
[PROOF STEP]
obtain x2 where 2: "[m2 * x2 = 1] (mod m1)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. [m2 * x = 1] (mod m1)

goal (1 subgoal):
 1. (\<And>x2. [m2 * x2 = 1] (mod m1) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[m2 * x2 = 1] (mod m1)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
have "[m1 * x1 = 0] (mod m1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [m1 * x1 = 0] (mod m1)
[PROOF STEP]
by (simp add: cong_mult_self_left)
[PROOF STATE]
proof (state)
this:
[m1 * x1 = 0] (mod m1)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[m1 * x1 = 0] (mod m1)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
have "[m2 * x2 = 0] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [m2 * x2 = 0] (mod m2)
[PROOF STEP]
by (simp add: cong_mult_self_left)
[PROOF STATE]
proof (state)
this:
[m2 * x2 = 0] (mod m2)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[m1 * x1 = 0] (mod m1)
[m2 * x2 = 0] (mod m2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[m1 * x1 = 0] (mod m1)
[m2 * x2 = 0] (mod m2)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
[m1 * x1 = 0] (mod m1)
[m2 * x2 = 0] (mod m2)
[m1 * x1 = 1] (mod m2)
[m2 * x2 = 1] (mod m1)

goal (1 subgoal):
 1. \<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)
[PROOF STEP]
obtain b1 b2
    where "[b1 = 1] (mod m1)" and "[b1 = 0] (mod m2)"
      and "[b2 = 0] (mod m1)" and "[b2 = 1] (mod m2)"
[PROOF STATE]
proof (prove)
using this:
\<exists>b1 b2. [b1 = 1] (mod m1) \<and> [b1 = 0] (mod m2) \<and> [b2 = 0] (mod m1) \<and> [b2 = 1] (mod m2)

goal (1 subgoal):
 1. (\<And>b1 b2. \<lbrakk>[b1 = 1] (mod m1); [b1 = 0] (mod m2); [b2 = 0] (mod m1); [b2 = 1] (mod m2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[b1 = 1] (mod m1)
[b1 = 0] (mod m2)
[b2 = 0] (mod m1)
[b2 = 1] (mod m2)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
let ?x = "u1 * b1 + u2 * b2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
have "[?x = u1 * 1 + u2 * 0] (mod m1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [u1 * b1 + u2 * b2 = u1 * 1 + u2 * 0] (mod m1)
[PROOF STEP]
using \<open>[b1 = 1] (mod m1)\<close> \<open>[b2 = 0] (mod m1)\<close> cong_add cong_scalar_left
[PROOF STATE]
proof (prove)
using this:
[b1 = 1] (mod m1)
[b2 = 0] (mod m1)
\<lbrakk>[?b = ?c] (mod ?a); [?d = ?e] (mod ?a)\<rbrakk> \<Longrightarrow> [?b + ?d = ?c + ?e] (mod ?a)
[?b = ?c] (mod ?a) \<Longrightarrow> [?d * ?b = ?d * ?c] (mod ?a)

goal (1 subgoal):
 1. [u1 * b1 + u2 * b2 = u1 * 1 + u2 * 0] (mod m1)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[u1 * b1 + u2 * b2 = u1 * 1 + u2 * 0] (mod m1)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[u1 * b1 + u2 * b2 = u1 * 1 + u2 * 0] (mod m1)
[PROOF STEP]
have "[?x = u1] (mod m1)"
[PROOF STATE]
proof (prove)
using this:
[u1 * b1 + u2 * b2 = u1 * 1 + u2 * 0] (mod m1)

goal (1 subgoal):
 1. [u1 * b1 + u2 * b2 = u1] (mod m1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[u1 * b1 + u2 * b2 = u1] (mod m1)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
have "[?x = u1 * 0 + u2 * 1] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [u1 * b1 + u2 * b2 = u1 * 0 + u2 * 1] (mod m2)
[PROOF STEP]
using \<open>[b1 = 0] (mod m2)\<close> \<open>[b2 = 1] (mod m2)\<close> cong_add cong_scalar_left
[PROOF STATE]
proof (prove)
using this:
[b1 = 0] (mod m2)
[b2 = 1] (mod m2)
\<lbrakk>[?b = ?c] (mod ?a); [?d = ?e] (mod ?a)\<rbrakk> \<Longrightarrow> [?b + ?d = ?c + ?e] (mod ?a)
[?b = ?c] (mod ?a) \<Longrightarrow> [?d * ?b = ?d * ?c] (mod ?a)

goal (1 subgoal):
 1. [u1 * b1 + u2 * b2 = u1 * 0 + u2 * 1] (mod m2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[u1 * b1 + u2 * b2 = u1 * 0 + u2 * 1] (mod m2)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[u1 * b1 + u2 * b2 = u1 * 0 + u2 * 1] (mod m2)
[PROOF STEP]
have "[?x = u2] (mod m2)"
[PROOF STATE]
proof (prove)
using this:
[u1 * b1 + u2 * b2 = u1 * 0 + u2 * 1] (mod m2)

goal (1 subgoal):
 1. [u1 * b1 + u2 * b2 = u2] (mod m2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[u1 * b1 + u2 * b2 = u2] (mod m2)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
with \<open>[?x = u1] (mod m1)\<close>
[PROOF STATE]
proof (chain)
picking this:
[u1 * b1 + u2 * b2 = u1] (mod m1)
[u1 * b1 + u2 * b2 = u2] (mod m2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[u1 * b1 + u2 * b2 = u1] (mod m1)
[u1 * b1 + u2 * b2 = u2] (mod m2)

goal (1 subgoal):
 1. \<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. [x = u1] (mod m1) \<and> [x = u2] (mod m2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder) set_iterator_linord_foldri_correct :
assumes dist_xs: "distinct xs"
assumes sorted_xs: "sorted (rev xs)"
shows "set_iterator_linord (foldri xs) (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_linord (foldri xs) (set xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs
sorted (rev xs)

goal (1 subgoal):
 1. set_iterator_linord (foldri xs) (set xs)
[PROOF STEP]
by (rule_tac set_iterator_linord_I[of "rev xs"]) (simp_all add: foldri_def)


[STATEMENT]
lemma andfold_MatchExp_normalized_nnf: "\<forall>m \<in> set ms. normalized_nnf_match m \<Longrightarrow>
    normalized_nnf_match (andfold_MatchExp ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m\<in>set ms. normalized_nnf_match m \<Longrightarrow> normalized_nnf_match (andfold_MatchExp ms)
[PROOF STEP]
by(induction ms rule: andfold_MatchExp.induct)(simp)+


[STATEMENT]
lemma non_empty_finite_path_root_end_iff:
  "finite_path_root_end (start_points x) x (end_points x) \<longleftrightarrow> terminating_path x \<and> x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_path_root_end (start_points x) x (end_points x) = (terminating_path x \<and> x \<noteq> 0)
[PROOF STEP]
using non_empty_terminating_path_root_end_iff end_point_no_successor
[PROOF STATE]
proof (prove)
using this:
terminating_path_root_end (start_points ?x) ?x (end_points ?x) = (terminating_path ?x \<and> ?x \<noteq> 0)
?x\<^sup>T ; end_points ?x = 0

goal (1 subgoal):
 1. finite_path_root_end (start_points x) x (end_points x) = (terminating_path x \<and> x \<noteq> 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma Rat_interval_closure:
  fixes x :: real
  assumes "x < y"
  shows "closure ({x<..<y} \<inter> \<rat>) = {x..y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure ({x<..<y} \<inter> \<rat>) = {x..y}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x < y

goal (1 subgoal):
 1. closure ({x<..<y} \<inter> \<rat>) = {x..y}
[PROOF STEP]
by (metis (no_types, lifting) Rat_closure closure_closure closure_greaterThanLessThan closure_mono inf_le1 inf_top.right_neutral open_Int_closure_subset open_real_greaterThanLessThan subset_antisym)


[STATEMENT]
lemma list_all2_upt_append: "list_all2 P [a..<b] xs \<Longrightarrow> list_all2 P [b..<c] ys \<Longrightarrow>
  a \<le> b \<Longrightarrow> b \<le> c \<Longrightarrow> list_all2 P [a..<c] (xs @ ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 P [a..<b] xs; list_all2 P [b..<c] ys; a \<le> b; b \<le> c\<rbrakk> \<Longrightarrow> list_all2 P [a..<c] (xs @ ys)
[PROOF STEP]
by (induction xs arbitrary: a) (auto simp add: list_all2_Cons2 upt_eq_Cons_conv)


[STATEMENT]
lemma less_RealD:
  assumes "cauchy Y"
  shows "x < Real Y \<Longrightarrow> \<exists>n. x < of_rat (Y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < Real Y \<Longrightarrow> \<exists>n. x < of_rat (Y n)
[PROOF STEP]
apply (erule contrapos_pp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>n. x < of_rat (Y n) \<Longrightarrow> \<not> x < Real Y
[PROOF STEP]
apply (simp add: not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. of_rat (Y n) \<le> x \<Longrightarrow> Real Y \<le> x
[PROOF STEP]
apply (erule Real_leI [OF assms])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma index_by_eq_SomeD:
  shows "index_by f l n = Some x \<Longrightarrow> (x\<in>set l \<and> f x = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index_by f l n = Some x \<Longrightarrow> x \<in> set l \<and> f x = n
[PROOF STEP]
unfolding index_by_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (map (\<lambda>x. (f x, x)) l) n = Some x \<Longrightarrow> x \<in> set l \<and> f x = n
[PROOF STEP]
by (auto dest: map_of_SomeD)


[STATEMENT]
lemma lta_left_comm:
  assumes "A B C LtA D E F"
  shows "C B A LtA D E F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C B A LtA D E F
[PROOF STEP]
by (meson LtA_def Tarski_neutral_dimensionless.conga_left_comm Tarski_neutral_dimensionless.lea_left_comm Tarski_neutral_dimensionless_axioms assms)


[STATEMENT]
lemma hgt_resid_ide:
    shows "\<lbrakk>ide u; u \<sqsubseteq> t\<rbrakk> \<Longrightarrow> hgt (resid t u) \<le> hgt t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ide u; u \<sqsubseteq> t\<rbrakk> \<Longrightarrow> hgt (t \ u) \<le> hgt t
[PROOF STEP]
by (metis con_sym eq_imp_le resid_arr_ide prfx_implies_con subs_implies_prfx)


[STATEMENT]
lemma istopology_base_eq:
   "istopology (arbitrary union_of P) \<longleftrightarrow>
    (\<forall>S T. P S \<and> P T \<longrightarrow> (arbitrary union_of P) (S \<inter> T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. istopology (arbitrary union_of P) = (\<forall>S T. P S \<and> P T \<longrightarrow> (arbitrary union_of P) (S \<inter> T))
[PROOF STEP]
by (simp add: istopology_base_alt arbitrary_union_of_Int_eq)


[STATEMENT]
lemma set_less_eq_aux_trans [trans]:
  "\<lbrakk> A \<sqsubseteq>' B; B \<sqsubseteq>' C \<rbrakk> \<Longrightarrow> A \<sqsubseteq>' C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<sqsubseteq>' B; B \<sqsubseteq>' C\<rbrakk> \<Longrightarrow> A \<sqsubseteq>' C
[PROOF STEP]
by(auto simp add: set_less_eq_aux_def dest: set_less_aux_trans)


[STATEMENT]
theorem eval_type_preservation:
  assumes a: "t \<Down> t'"
  and     b: "\<Gamma> \<turnstile> t : T"
  shows "\<Gamma> \<turnstile> t' : T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma> \<turnstile> t' : T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma> \<turnstile> t' : T
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
t \<Down> t'
[PROOF STEP]
have "<t,[]> \<mapsto>* <t',[]>"
[PROOF STATE]
proof (prove)
using this:
t \<Down> t'

goal (1 subgoal):
 1. <t,[]> \<mapsto>* <t',[]>
[PROOF STEP]
by (simp add: eval_implies_machine_star)
[PROOF STATE]
proof (state)
this:
<t,[]> \<mapsto>* <t',[]>

goal (1 subgoal):
 1. \<Gamma> \<turnstile> t' : T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
<t,[]> \<mapsto>* <t',[]>
[PROOF STEP]
show "\<Gamma> \<turnstile> t' : T"
[PROOF STATE]
proof (prove)
using this:
<t,[]> \<mapsto>* <t',[]>

goal (1 subgoal):
 1. \<Gamma> \<turnstile> t' : T
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
<t,[]> \<mapsto>* <t',[]>
\<Gamma> \<turnstile> t : T

goal (1 subgoal):
 1. \<Gamma> \<turnstile> t' : T
[PROOF STEP]
by (simp add: machine_type_preservation)
[PROOF STATE]
proof (state)
this:
\<Gamma> \<turnstile> t' : T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma confs_rev: "P,h \<turnstile> rev s [:\<le>] t = (P,h \<turnstile> s [:\<le>] rev t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P,h \<turnstile> rev s [:\<le>] t) = (P,h \<turnstile> s [:\<le>] rev t)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. P,h \<turnstile> rev s [:\<le>] t \<Longrightarrow> P,h \<turnstile> s [:\<le>] rev t
 2. P,h \<turnstile> s [:\<le>] rev t \<Longrightarrow> P,h \<turnstile> rev s [:\<le>] t
[PROOF STEP]
apply (rule subst [OF list_all2_rev])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. P,h \<turnstile> rev s [:\<le>] t \<Longrightarrow> P,h \<turnstile> rev s [:\<le>] rev (rev t)
 2. P,h \<turnstile> s [:\<le>] rev t \<Longrightarrow> P,h \<turnstile> rev s [:\<le>] t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P,h \<turnstile> s [:\<le>] rev t \<Longrightarrow> P,h \<turnstile> rev s [:\<le>] t
[PROOF STEP]
apply (rule subst [OF list_all2_rev])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P,h \<turnstile> s [:\<le>] rev t \<Longrightarrow> P,h \<turnstile> rev (rev s) [:\<le>] rev t
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma in_smallo_zero_iff [simp]: "f \<in> o[F](\<lambda>_. 0) \<longleftrightarrow> eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> o[F](\<lambda>_. 0::'b)) = (\<forall>\<^sub>F x in F. f x = (0::'b))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> o[F](\<lambda>_. 0::'b) \<Longrightarrow> \<forall>\<^sub>F x in F. f x = (0::'b)
 2. \<forall>\<^sub>F x in F. f x = (0::'b) \<Longrightarrow> f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
assume "f \<in> o[F](\<lambda>_. 0)"
[PROOF STATE]
proof (state)
this:
f \<in> o[F](\<lambda>_. 0::'b)

goal (2 subgoals):
 1. f \<in> o[F](\<lambda>_. 0::'b) \<Longrightarrow> \<forall>\<^sub>F x in F. f x = (0::'b)
 2. \<forall>\<^sub>F x in F. f x = (0::'b) \<Longrightarrow> f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
from landau_o.smallD[OF this, of 1]
[PROOF STATE]
proof (chain)
picking this:
0 < 1 \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) \<le> 1 * norm (0::'b)
[PROOF STEP]
show "eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<Longrightarrow> \<forall>\<^sub>F x in F. norm (f x) \<le> 1 * norm (0::'b)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x = (0::'b)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x = (0::'b) \<Longrightarrow> f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x = (0::'b) \<Longrightarrow> f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
assume "eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x = (0::'b)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x = (0::'b) \<Longrightarrow> f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
hence "\<forall>c>0. eventually (\<lambda>x. (norm (f x)) \<le> c * \<bar>0\<bar>) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x = (0::'b)

goal (1 subgoal):
 1. \<forall>c>0. \<forall>\<^sub>F x in F. norm (f x) \<le> c * \<bar>0\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>c>0. \<forall>\<^sub>F x in F. norm (f x) \<le> c * \<bar>0\<bar>

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x = (0::'b) \<Longrightarrow> f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
thus "f \<in> o[F](\<lambda>_. 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>c>0. \<forall>\<^sub>F x in F. norm (f x) \<le> c * \<bar>0\<bar>

goal (1 subgoal):
 1. f \<in> o[F](\<lambda>_. 0::'b)
[PROOF STEP]
unfolding smallo_def
[PROOF STATE]
proof (prove)
using this:
\<forall>c>0. \<forall>\<^sub>F x in F. norm (f x) \<le> c * \<bar>0\<bar>

goal (1 subgoal):
 1. f \<in> {f. \<forall>c>0. \<forall>\<^sub>F x in F. norm (f x) \<le> c * norm (0::'b)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> o[F](\<lambda>_. 0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Subseqs_insert [simp]: "Subseqs (insert xs A) = set (subseqs xs) \<union> Subseqs A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Subseqs (insert xs A) = set (subseqs xs) \<union> Subseqs A
[PROOF STEP]
by (simp add: Subseqs_def)


[STATEMENT]
lemma p_prod_distr: "(X \<union> Y) \<cdot> Z = X \<cdot> Z \<union> Y \<cdot> Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<union> Y) \<cdot> Z = X \<cdot> Z \<union> Y \<cdot> Z
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> (X \<union> Y) \<cdot> Z) = (x \<in> X \<cdot> Z \<union> Y \<cdot> Z)
[PROOF STEP]
fix ps
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> (X \<union> Y) \<cdot> Z) = (x \<in> X \<cdot> Z \<union> Y \<cdot> Z)
[PROOF STEP]
show "ps \<in> (X \<union> Y) \<cdot> Z \<longleftrightarrow> ps \<in> X \<cdot> Z \<union> Y \<cdot> Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ps \<in> (X \<union> Y) \<cdot> Z) = (ps \<in> X \<cdot> Z \<union> Y \<cdot> Z)
[PROOF STEP]
by (cases ps) (auto simp add: p_prod_iff)
[PROOF STATE]
proof (state)
this:
(ps \<in> (X \<union> Y) \<cdot> Z) = (ps \<in> X \<cdot> Z \<union> Y \<cdot> Z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma keysFor_UN [simp]: "keysFor (\<Union>i\<in>A. H i) = (\<Union>i\<in>A. keysFor (H i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keysFor (\<Union> (H ` A)) = (\<Union>i\<in>A. keysFor (H i))
[PROOF STEP]
by (unfold keysFor_def, blast)


[STATEMENT]
lemma lens_obs_equiv: "equivp (\<simeq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivp (\<simeq>)
[PROOF STEP]
proof (rule equivpI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. reflp (\<simeq>)
 2. symp (\<simeq>)
 3. transp (\<simeq>)
[PROOF STEP]
show "reflp (\<simeq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflp (\<simeq>)
[PROOF STEP]
by (rule reflpI, simp add: lens_obs_eq_def get_put)
[PROOF STATE]
proof (state)
this:
reflp (\<simeq>)

goal (2 subgoals):
 1. symp (\<simeq>)
 2. transp (\<simeq>)
[PROOF STEP]
show "symp (\<simeq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symp (\<simeq>)
[PROOF STEP]
by (rule sympI, simp add: lens_obs_eq_def, metis get_put put_put)
[PROOF STATE]
proof (state)
this:
symp (\<simeq>)

goal (1 subgoal):
 1. transp (\<simeq>)
[PROOF STEP]
show "transp (\<simeq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transp (\<simeq>)
[PROOF STEP]
by (rule transpI, simp add: lens_obs_eq_def, metis put_put)
[PROOF STATE]
proof (state)
this:
transp (\<simeq>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma biexp01_well_formedI:
  assumes "\<And>n. a n \<in> {0,1}"
      and "\<And>n. \<exists>m\<ge>n. a m = 0"
    shows "biexp01_well_formed a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. biexp01_well_formed a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a ?n \<in> {0, 1}
\<exists>m\<ge>?n. a m = 0

goal (1 subgoal):
 1. biexp01_well_formed a
[PROOF STEP]
by(simp add: biexp01_well_formed_def)


[STATEMENT]
lemma length_le_list_ex: "length xs \<le> n \<Longrightarrow> \<exists>ys. length (xs @ ys) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs \<le> n \<Longrightarrow> \<exists>ys. length (xs @ ys) = n
[PROOF STEP]
by (rule exI[where x="replicate (n - length xs) z" for z]) simp


[STATEMENT]
lemma gt_imp_vars: "t >\<^sub>t s \<Longrightarrow> vars t \<supseteq> vars s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t >\<^sub>t s \<Longrightarrow> vars s \<subseteq> vars t
[PROOF STEP]
using set_mset_mono[OF gt_imp_vars_mset]
[PROOF STATE]
proof (prove)
using this:
?t1 >\<^sub>t ?s1 \<Longrightarrow> set_mset (vars_mset ?s1) \<subseteq> set_mset (vars_mset ?t1)

goal (1 subgoal):
 1. t >\<^sub>t s \<Longrightarrow> vars s \<subseteq> vars t
[PROOF STEP]
by simp


[STATEMENT]
lemma fdisjnt_subset_right: "N' |\<subseteq>| N \<Longrightarrow> fdisjnt M N \<Longrightarrow> fdisjnt M N'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>N' |\<subseteq>| N; fdisjnt M N\<rbrakk> \<Longrightarrow> fdisjnt M N'
[PROOF STEP]
unfolding fdisjnt_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>N' |\<subseteq>| N; M |\<inter>| N = {||}\<rbrakk> \<Longrightarrow> M |\<inter>| N' = {||}
[PROOF STEP]
by auto


[STATEMENT]
lemma seq_compactI:
  assumes "\<And>f. \<forall>n. f n \<in> S \<Longrightarrow> \<exists>l\<in>S. \<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
  shows "seq_compact S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_compact S
[PROOF STEP]
unfolding seq_compact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>n. ?f n \<in> S \<Longrightarrow> \<exists>l\<in>S. \<exists>r. strict_mono r \<and> (?f \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<forall>f. (\<forall>n. f n \<in> S) \<longrightarrow> (\<exists>l\<in>S. \<exists>r. strict_mono r \<and> (f \<circ> r) \<longlonglongrightarrow> l)
[PROOF STEP]
by fast


[STATEMENT]
lemma filterlim_at_top_imp_at_infinity: "filterlim f at_top F \<Longrightarrow> filterlim f at_infinity F"
  for f :: "_ \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F \<Longrightarrow> filterlim f at_infinity F
[PROOF STEP]
by (rule filterlim_mono[OF _ at_top_le_at_infinity order_refl])


[STATEMENT]
lemma unzip_3_tailrec_rev: "unzip_3_tailrec_rev l (as, bs, cs) = ((map_tailrec_rev fst l as), (map_tailrec_rev (fst \<circ> snd) l bs), (map_tailrec_rev (snd \<circ> snd) l cs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unzip_3_tailrec_rev l (as, bs, cs) = (map_tailrec_rev fst l as, map_tailrec_rev (fst \<circ> snd) l bs, map_tailrec_rev (snd \<circ> snd) l cs)
[PROOF STEP]
by (induct l arbitrary: as bs cs, auto)


[STATEMENT]
lemma (in group) finite_pos_order:
  assumes finite:"finite (carrier G)"
  shows "0 < order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < order G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < order G
[PROOF STEP]
from one_closed finite
[PROOF STATE]
proof (chain)
picking this:
\<one> \<in> carrier G
finite (carrier G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> carrier G
finite (carrier G)

goal (1 subgoal):
 1. 0 < order G
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
\<one> \<in> carrier G
finite (carrier G)

goal (1 subgoal):
 1. 0 < card (carrier G)
[PROOF STEP]
by (metis card_gt_0_iff subgroup_nonempty subgroup_self)
[PROOF STATE]
proof (state)
this:
0 < order G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem univ_ce_is_not_comp2: "\<not> total_recursive (chf univ_ce)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> total_recursive (chf univ_ce)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. total_recursive (chf univ_ce) \<Longrightarrow> False
[PROOF STEP]
assume "total_recursive (chf univ_ce)"
[PROOF STATE]
proof (state)
this:
total_recursive (chf univ_ce)

goal (1 subgoal):
 1. total_recursive (chf univ_ce) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
total_recursive (chf univ_ce)
[PROOF STEP]
have "computable univ_ce"
[PROOF STATE]
proof (prove)
using this:
total_recursive (chf univ_ce)

goal (1 subgoal):
 1. computable univ_ce
[PROOF STEP]
by (rule tot_rec_impl_comp)
[PROOF STATE]
proof (state)
this:
computable univ_ce

goal (1 subgoal):
 1. total_recursive (chf univ_ce) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
computable univ_ce
[PROOF STEP]
have "- univ_ce \<in> ce_sets"
[PROOF STATE]
proof (prove)
using this:
computable univ_ce

goal (1 subgoal):
 1. - univ_ce \<in> ce_sets
[PROOF STEP]
by (unfold computable_def, auto)
[PROOF STATE]
proof (state)
this:
- univ_ce \<in> ce_sets

goal (1 subgoal):
 1. total_recursive (chf univ_ce) \<Longrightarrow> False
[PROOF STEP]
with univ_ce_is_not_comp1
[PROOF STATE]
proof (chain)
picking this:
- univ_ce \<notin> ce_sets
- univ_ce \<in> ce_sets
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
- univ_ce \<notin> ce_sets
- univ_ce \<in> ce_sets

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_1_dvd_root: assumes q: "degree (q :: 'a :: field poly) = 1"
  and rt: "\<And> x. poly p x \<noteq> 0"
  shows "\<not> q dvd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> q dvd p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> q dvd p
[PROOF STEP]
from degree1_coeffs[OF q]
[PROOF STATE]
proof (chain)
picking this:
\<exists>a b. q = [:b, a:] \<and> a \<noteq> (0::'a)
[PROOF STEP]
obtain a b where q: "q = [: b, a :]" and a: "a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>a b. q = [:b, a:] \<and> a \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>b a. \<lbrakk>q = [:b, a:]; a \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q = [:b, a:]
a \<noteq> (0::'a)

goal (1 subgoal):
 1. \<not> q dvd p
[PROOF STEP]
have q: "q = smult a [: - (- b / a), 1 :]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = smult a [:- (- b / a), 1::'a:]
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:b, a:] = smult a [:- (- b / a), 1::'a:]
[PROOF STEP]
by (rule poly_eqI, unfold coeff_smult, insert a, auto simp: field_simps coeff_pCons
      split: nat.splits)
[PROOF STATE]
proof (state)
this:
q = smult a [:- (- b / a), 1::'a:]

goal (1 subgoal):
 1. \<not> q dvd p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> q dvd p
[PROOF STEP]
unfolding q smult_dvd_iff poly_eq_0_iff_dvd[symmetric, of _ p]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (if a = (0::'a) then p = 0 else poly p (- b / a) = (0::'a))
[PROOF STEP]
using a rt
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
poly p ?x \<noteq> (0::'a)

goal (1 subgoal):
 1. \<not> (if a = (0::'a) then p = 0 else poly p (- b / a) = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> q dvd p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_DT: "P \<sqsubseteq>\<^sub>D\<^sub>T Q \<Longrightarrow> Q \<sqsubseteq>\<^sub>D\<^sub>T S \<Longrightarrow> P \<sqsubseteq>\<^sub>D\<^sub>T S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<sqsubseteq>\<^sub>D\<^sub>T Q; Q \<sqsubseteq>\<^sub>D\<^sub>T S\<rbrakk> \<Longrightarrow> P \<sqsubseteq>\<^sub>D\<^sub>T S
[PROOF STEP]
by (meson trace_divergence_refine_def order_trans trans_D trans_T)


[STATEMENT]
lemma adj_cancel_eq2:
  fixes f :: "'a::order \<Rightarrow> 'b::preorder"
  shows "f \<stileturn> g \<Longrightarrow> g \<circ> f \<circ> g = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> g \<circ> f \<circ> g = g
[PROOF STEP]
unfolding adj_def comp_def fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> \<forall>x. g (f (g x)) = g x
[PROOF STEP]
by (meson eq_iff order_refl order_trans)


[STATEMENT]
lemma inj_tensor_ell2_right: \<open>inj (\<lambda>b::'b::finite ell2. a \<otimes>\<^sub>s b)\<close> if \<open>a \<noteq> 0\<close> for a :: \<open>'a::finite ell2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj ((\<otimes>\<^sub>s) a)
[PROOF STEP]
proof (rule injI, rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix x y :: \<open>'b ell2\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume eq: \<open>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y\<close>
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume neq: \<open>x \<noteq> y\<close>
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
define b where \<open>b = x - y\<close>
[PROOF STATE]
proof (state)
this:
b = x - y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from neq b_def
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
b = x - y
[PROOF STEP]
have neq0: \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
b = x - y

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

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with \<open>a \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
b \<noteq> 0
[PROOF STEP]
have \<open>a \<otimes>\<^sub>s b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
b \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>s b \<noteq> 0
[PROOF STEP]
by (simp add: tensor_ell2_nonzero)
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^sub>s b \<noteq> 0

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes>\<^sub>s b \<noteq> 0
[PROOF STEP]
have \<open>a \<otimes>\<^sub>s x \<noteq> a \<otimes>\<^sub>s y\<close>
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^sub>s b \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>s x \<noteq> a \<otimes>\<^sub>s y
[PROOF STEP]
unfolding b_def
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^sub>s (x - y) \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>s x \<noteq> a \<otimes>\<^sub>s y
[PROOF STEP]
by (metis add_cancel_left_left diff_add_cancel tensor_ell2_add2)
[PROOF STATE]
proof (state)
this:
a \<otimes>\<^sub>s x \<noteq> a \<otimes>\<^sub>s y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y; x \<noteq> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with eq
[PROOF STATE]
proof (chain)
picking this:
a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y
a \<otimes>\<^sub>s x \<noteq> a \<otimes>\<^sub>s y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a \<otimes>\<^sub>s x = a \<otimes>\<^sub>s y
a \<otimes>\<^sub>s x \<noteq> a \<otimes>\<^sub>s y

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem LIMSEQ_NSLIMSEQ_iff: "f \<longlonglongrightarrow> L \<longleftrightarrow> f \<longlonglongrightarrow>\<^sub>N\<^sub>S L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> L = f \<longlonglongrightarrow>\<^sub>N\<^sub>S L
[PROOF STEP]
by (blast intro: LIMSEQ_NSLIMSEQ NSLIMSEQ_LIMSEQ)


[STATEMENT]
lemma bounded_simple_path_image: "simple_path g \<Longrightarrow> bounded(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_path g \<Longrightarrow> bounded (path_image g)
[PROOF STEP]
by (metis bounded_path_image simple_path_imp_path)


[STATEMENT]
lemma pair_map_spmf: "pair_spmf (map_spmf f p) (map_spmf g q) = map_spmf (map_prod f g) (pair_spmf p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pair_spmf (map_spmf f p) (map_spmf g q) = map_spmf (map_prod f g) (pair_spmf p q)
[PROOF STEP]
unfolding pair_map_spmf2 pair_map_spmf1 spmf.map_comp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (apsnd g \<circ> apfst f) (pair_spmf p q) = map_spmf (map_prod f g) (pair_spmf p q)
[PROOF STEP]
by(simp add: apfst_def apsnd_def o_def prod.map_comp)


[STATEMENT]
lemma ipoly_of_real[simp]:
  "ipoly p (of_real x :: 'a :: {field,real_algebra_1}) = of_real (ipoly p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipoly p (of_real x) = of_real (poly (real_of_int_poly p) x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ipoly p (of_real x) = of_real (poly (real_of_int_poly p) x)
[PROOF STEP]
have id: "of_int = of_real o of_int"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int = of_real \<circ> real_of_int
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int = (\<lambda>x. of_real (real_of_int x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_int = of_real \<circ> real_of_int

goal (1 subgoal):
 1. ipoly p (of_real x) = of_real (poly (real_of_int_poly p) x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipoly p (of_real x) = of_real (poly (real_of_int_poly p) x)
[PROOF STEP]
by (subst id, subst map_poly_map_poly[symmetric], auto)
[PROOF STATE]
proof (state)
this:
ipoly p (of_real x) = of_real (poly (real_of_int_poly p) x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_prod_distr: "(X \<union> Y) \<cdot> Z = X \<cdot> Z \<union> Y \<cdot> Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X \<union> Y) \<cdot> Z = X \<cdot> Z \<union> Y \<cdot> Z
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> (X \<union> Y) \<cdot> Z) = (x \<in> X \<cdot> Z \<union> Y \<cdot> Z)
[PROOF STEP]
fix ps
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> (X \<union> Y) \<cdot> Z) = (x \<in> X \<cdot> Z \<union> Y \<cdot> Z)
[PROOF STEP]
show "ps \<in> (X \<union> Y) \<cdot> Z \<longleftrightarrow> ps \<in> X \<cdot> Z \<union> Y \<cdot> Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ps \<in> (X \<union> Y) \<cdot> Z) = (ps \<in> X \<cdot> Z \<union> Y \<cdot> Z)
[PROOF STEP]
by (cases ps) (auto simp add: p_prod_iff)
[PROOF STATE]
proof (state)
this:
(ps \<in> (X \<union> Y) \<cdot> Z) = (ps \<in> X \<cdot> Z \<union> Y \<cdot> Z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bin_rest_set_bit:
  "(set_bit x n b :: int) div 2 = (if n > 0 then set_bit (x div 2) (n - 1) b else x div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_bit_class.set_bit x n b div 2 = (if 0 < n then set_bit_class.set_bit (x div 2) (n - 1) b else x div 2)
[PROOF STEP]
by (cases n) (simp_all add: int_set_bit_Suc)


[STATEMENT]
lemma foldl_append_empty:
  \<open>NO_MATCH [] xs \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs p = foldl (\<lambda>b x. f x @ b) [] p @ xs\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NO_MATCH [] xs \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs p = foldl (\<lambda>b x. f x @ b) [] p @ xs
[PROOF STEP]
apply (induction p arbitrary: xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xs. NO_MATCH [] xs \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs [] = foldl (\<lambda>b x. f x @ b) [] [] @ xs
 2. \<And>a p xs. \<lbrakk>\<And>xs. NO_MATCH [] xs \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs p = foldl (\<lambda>b x. f x @ b) [] p @ xs; NO_MATCH [] xs\<rbrakk> \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs (a # p) = foldl (\<lambda>b x. f x @ b) [] (a # p) @ xs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a p xs. \<lbrakk>\<And>xs. NO_MATCH [] xs \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs p = foldl (\<lambda>b x. f x @ b) [] p @ xs; NO_MATCH [] xs\<rbrakk> \<Longrightarrow> foldl (\<lambda>b x. f x @ b) xs (a # p) = foldl (\<lambda>b x. f x @ b) [] (a # p) @ xs
[PROOF STEP]
by (metis (mono_tags, lifting) NO_MATCH_def append.assoc append_self_conv foldl_Cons)


[STATEMENT]
lemma abs_summable_on_uminus [intro]:
  "f abs_summable_on A \<Longrightarrow> (\<lambda>x. -f x) abs_summable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on A \<Longrightarrow> (\<lambda>x. - f x) abs_summable_on A
[PROOF STEP]
unfolding abs_summable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (count_space A) f \<Longrightarrow> integrable (count_space A) (\<lambda>x. - f x)
[PROOF STEP]
by (rule Bochner_Integration.integrable_minus)


[STATEMENT]
lemma keysFor_UN [simp]: "keysFor (\<Union>i\<in>A. H i) = (\<Union>i\<in>A. keysFor (H i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keysFor (\<Union> (H ` A)) = (\<Union>i\<in>A. keysFor (H i))
[PROOF STEP]
by (unfold keysFor_def, blast)


[STATEMENT]
lemma fls_divide_fls_base_factor_to_fps':
  fixes f g :: "'a::{comm_monoid_add,uminus,inverse,mult_zero} fls"
  shows
    "fls_base_factor_to_fps f / fls_base_factor_to_fps g =
      fls_regpart (fls_shift (fls_subdegree f - fls_subdegree g) (f / g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps f / fls_base_factor_to_fps g = fls_regpart (fls_shift (fls_subdegree f - fls_subdegree g) (f / g))
[PROOF STEP]
using fls_base_factor_subdegree[of f] fls_base_factor_subdegree[of g]
        fls_divide_regpart[of "fls_base_factor f" "fls_base_factor g"]
        fls_divide_base_factor'[of f g]
[PROOF STATE]
proof (prove)
using this:
fls_subdegree (fls_base_factor f) = 0
fls_subdegree (fls_base_factor g) = 0
\<lbrakk>0 \<le> fls_subdegree (fls_base_factor f); 0 \<le> fls_subdegree (fls_base_factor g)\<rbrakk> \<Longrightarrow> fls_regpart (fls_base_factor f / fls_base_factor g) = fls_base_factor_to_fps f / fls_base_factor_to_fps g
fls_base_factor f / fls_base_factor g = fls_shift (fls_subdegree f - fls_subdegree g) (f / g)

goal (1 subgoal):
 1. fls_base_factor_to_fps f / fls_base_factor_to_fps g = fls_regpart (fls_shift (fls_subdegree f - fls_subdegree g) (f / g))
[PROOF STEP]
by  simp


[STATEMENT]
lemma Some_in_map_option_set_conv: "Some y \<in> map_option_set f x \<longleftrightarrow> (\<exists>z. x = Some z \<and> Some y \<in> f z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Some y \<in> map_option_set f x) = (\<exists>z. x = Some z \<and> Some y \<in> f z)
[PROOF STEP]
by(cases x) auto


[STATEMENT]
lemma replacement_fun: "\<exists>z. \<forall>v. v \<^bold>\<in> z \<longleftrightarrow> (\<exists>u. u \<^bold>\<in> x \<and> v = f u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. \<forall>v. (v \<^bold>\<in> z) = (\<exists>u. u \<^bold>\<in> x \<and> v = f u)
[PROOF STEP]
by (rule replacement [where R = "\<lambda>u v. v = f u"]) auto


[STATEMENT]
lemma out_arcs_app_iso_eq':
  assumes "digraph_isomorphism hom" and "u \<in> verts (app_iso hom G)"
  shows "out_arcs (app_iso hom G) u = iso_arcs hom ` out_arcs G (iso_verts (inv_iso hom) u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_arcs (app_iso hom G) u = iso_arcs hom ` out_arcs G (iso_verts (inv_iso hom) u)
[PROOF STEP]
using assms out_arcs_app_iso_eq[of hom "iso_verts (inv_iso hom) u"]
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
u \<in> verts (app_iso hom G)
\<lbrakk>digraph_isomorphism hom; iso_verts (inv_iso hom) u \<in> verts G\<rbrakk> \<Longrightarrow> out_arcs (app_iso hom G) (iso_verts hom (iso_verts (inv_iso hom) u)) = iso_arcs hom ` out_arcs G (iso_verts (inv_iso hom) u)

goal (1 subgoal):
 1. out_arcs (app_iso hom G) u = iso_arcs hom ` out_arcs G (iso_verts (inv_iso hom) u)
[PROOF STEP]
by auto