[STATEMENT]
lemma croots: assumes "p \<noteq> 0" "degree p \<le> 2"
  shows "set (croots p) = {x. poly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (croots p) = {x. poly p x = 0}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree p \<le> 2

goal (1 subgoal):
 1. set (croots p) = {x. poly p x = 0}
[PROOF STEP]
unfolding croots_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree p \<le> 2

goal (1 subgoal):
 1. set (if p = 0 \<or> 2 < degree p then [] else if degree p = 0 then [] else if degree p = 1 then [roots1 p] else croots2 p) = {x. poly p x = 0}
[PROOF STEP]
using roots0[of p] roots1[of p] croots2[of p]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree p \<le> 2
\<lbrakk>p \<noteq> 0; degree p = 0\<rbrakk> \<Longrightarrow> {x. poly p x = 0} = {}
degree p = 1 \<Longrightarrow> {x. poly p x = 0} = {roots1 p}
degree p = 2 \<Longrightarrow> {x. poly p x = 0} = set (croots2 p)

goal (1 subgoal):
 1. set (if p = 0 \<or> 2 < degree p then [] else if degree p = 0 then [] else if degree p = 1 then [roots1 p] else croots2 p) = {x. poly p x = 0}
[PROOF STEP]
by (auto split: if_splits)


[STATEMENT]
lemma chinese_remainder:
  fixes a::nat  assumes ab: "coprime a b" and a: "a \<noteq> 0" and b: "b \<noteq> 0"
  shows "\<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
from bezout_add_strong_nat[OF a, of b] bezout_add_strong_nat[OF b, of a]
[PROOF STATE]
proof (chain)
picking this:
\<exists>d x y. d dvd a \<and> d dvd b \<and> a * x = b * y + d
\<exists>d x y. d dvd b \<and> d dvd a \<and> b * x = a * y + d
[PROOF STEP]
obtain d1 x1 y1 d2 x2 y2 where dxy1: "d1 dvd a" "d1 dvd b" "a * x1 = b * y1 + d1"
    and dxy2: "d2 dvd b" "d2 dvd a" "b * x2 = a * y2 + d2"
[PROOF STATE]
proof (prove)
using this:
\<exists>d x y. d dvd a \<and> d dvd b \<and> a * x = b * y + d
\<exists>d x y. d dvd b \<and> d dvd a \<and> b * x = a * y + d

goal (1 subgoal):
 1. (\<And>d1 x1 y1 d2 x2 y2. \<lbrakk>d1 dvd a; d1 dvd b; a * x1 = b * y1 + d1; d2 dvd b; d2 dvd a; b * x2 = a * y2 + d2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d1 dvd a
d1 dvd b
a * x1 = b * y1 + d1
d2 dvd b
d2 dvd a
b * x2 = a * y2 + d2

goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d1 dvd a
d1 dvd b
a * x1 = b * y1 + d1
d2 dvd b
d2 dvd a
b * x2 = a * y2 + d2
[PROOF STEP]
have d12: "d1 = 1" "d2 = 1"
[PROOF STATE]
proof (prove)
using this:
d1 dvd a
d1 dvd b
a * x1 = b * y1 + d1
d2 dvd b
d2 dvd a
b * x2 = a * y2 + d2

goal (1 subgoal):
 1. d1 = 1 &&& d2 = 1
[PROOF STEP]
using ab coprime_common_divisor_nat [of a b]
[PROOF STATE]
proof (prove)
using this:
d1 dvd a
d1 dvd b
a * x1 = b * y1 + d1
d2 dvd b
d2 dvd a
b * x2 = a * y2 + d2
coprime a b
\<lbrakk>coprime a b; ?x dvd a; ?x dvd b\<rbrakk> \<Longrightarrow> ?x = 1

goal (1 subgoal):
 1. d1 = 1 &&& d2 = 1
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
d1 = 1
d2 = 1

goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
let ?x = "v * a * x1 + u * b * x2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
let ?q1 = "v * x1 + u * y2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
let ?q2 = "v * y1 + u * x2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
from dxy2(3)[simplified d12] dxy1(3)[simplified d12]
[PROOF STATE]
proof (chain)
picking this:
b * x2 = a * y2 + 1
a * x1 = b * y1 + 1
[PROOF STEP]
have "?x = u + ?q1 * a" "?x = v + ?q2 * b"
[PROOF STATE]
proof (prove)
using this:
b * x2 = a * y2 + 1
a * x1 = b * y1 + 1

goal (1 subgoal):
 1. v * a * x1 + u * b * x2 = u + (v * x1 + u * y2) * a &&& v * a * x1 + u * b * x2 = v + (v * y1 + u * x2) * b
[PROOF STEP]
by algebra+
[PROOF STATE]
proof (state)
this:
v * a * x1 + u * b * x2 = u + (v * x1 + u * y2) * a
v * a * x1 + u * b * x2 = v + (v * y1 + u * x2) * b

goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v * a * x1 + u * b * x2 = u + (v * x1 + u * y2) * a
v * a * x1 + u * b * x2 = v + (v * y1 + u * x2) * b

goal (1 subgoal):
 1. \<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x q1 q2. x = u + q1 * a \<and> x = v + q2 * b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (in Group) isom2:"\<lbrakk>G \<triangleright> H; G \<triangleright> N; H \<subseteq> N\<rbrakk> \<Longrightarrow>
               ((G/H)/(carrier ((Gp G N)/H))) \<cong>  (G/N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> H; G \<triangleright> N; H \<subseteq> N\<rbrakk> \<Longrightarrow> (G / H / carrier (\<natural>N / H)) \<cong> (G / N)
[PROOF STEP]
apply (frule homom2 [of "H" "N"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> H; G \<triangleright> N; H \<subseteq> N; gbij\<^bsub>(G / H / carrier (\<natural>N / H)),(G / N)\<^esub> (Qm\<^bsub>G H,N\<^esub>\<dieresis>\<^bsub>(G / H),(G / N)\<^esub>)\<rbrakk> \<Longrightarrow> (G / H / carrier (\<natural>N / H)) \<cong> (G / N)
[PROOF STEP]
apply (simp add:isomorphic_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<triangleright> H; G \<triangleright> N; H \<subseteq> N; gbij\<^bsub>(G / H / carrier (\<natural>N / H)),(G / N)\<^esub> (Qm\<^bsub>G H,N\<^esub>\<dieresis>\<^bsub>(G / H),(G / N)\<^esub>)\<rbrakk> \<Longrightarrow> \<exists>f. gbij\<^bsub>(G / H / carrier (\<natural>N / H)),(G / N)\<^esub> f
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma count_list_append: "count_list (xs@ys) v = count_list xs v + count_list ys v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_list (xs @ ys) v = count_list xs v + count_list ys v
[PROOF STEP]
by (induction xs, simp, simp)


[STATEMENT]
lemma R_therm_dyn_up:
  assumes "a > 0" and "0 \<le> \<tau>" and "0 < Tmin" and "Tmax < L"
  shows "Ref \<lceil>\<lambda>s. s$4 \<noteq> 0 \<and> I Tmin Tmax s \<and> s$2 = 0 \<and> s$3 = s$1\<rceil> \<lceil>I Tmin Tmax\<rceil> \<ge>
    (x\<acute>= (\<lambda>t. f a L) & G Tmin Tmax a L on (\<lambda>s. {0..\<tau>}) UNIV @ 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<acute>= \<lambda>t. f a L & G Tmin Tmax a L on \<lambda>s. {0..\<tau>} UNIV @ 0 \<le> Ref \<lceil>\<lambda>s. s $ 4 \<noteq> 0 \<and> I Tmin Tmax s \<and> s $ 2 = 0 \<and> s $ 3 = s $ 1\<rceil> \<lceil>I Tmin Tmax\<rceil>
[PROOF STEP]
apply(rule local_flow.R_g_ode_ivl[OF local_flow_therm])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 < a
 2. 0 \<le> \<tau>
 3. s2p UNIV \<tau>
 4. \<forall>s\<in>UNIV. s $ 4 \<noteq> 0 \<and> I Tmin Tmax s \<and> s $ 2 = 0 \<and> s $ 3 = s $ 1 \<longrightarrow> (\<forall>t\<in>{0..\<tau>}. (\<forall>\<tau>\<in>{0..t}. G Tmin Tmax a L (\<phi> a L \<tau> s)) \<longrightarrow> I Tmin Tmax (\<phi> a L t s))
[PROOF STEP]
using assms therm_dyn_up_real_arith[OF assms(1) _ _ assms(4), of Tmin]
[PROOF STATE]
proof (prove)
using this:
0 < a
0 \<le> \<tau>
0 < Tmin
Tmax < L
\<lbrakk>Tmin \<le> ?T; ?T \<le> Tmax; 0 \<le> ?\<tau>; \<forall>\<tau>\<in>{0..?\<tau>}. \<tau> \<le> - (ln ((L - Tmax) / (L - ?T)) / a)\<rbrakk> \<Longrightarrow> L - Tmax \<le> exp (- (a \<cdot> ?\<tau>)) \<cdot> (L - ?T)
\<lbrakk>Tmin \<le> ?T; ?T \<le> Tmax; 0 \<le> ?\<tau>; \<forall>\<tau>\<in>{0..?\<tau>}. \<tau> \<le> - (ln ((L - Tmax) / (L - ?T)) / a)\<rbrakk> \<Longrightarrow> L - exp (- (a \<cdot> ?\<tau>)) \<cdot> (L - ?T) \<le> Tmax
\<lbrakk>Tmin \<le> ?T; ?T \<le> Tmax; 0 \<le> ?\<tau>; \<forall>\<tau>\<in>{0..?\<tau>}. \<tau> \<le> - (ln ((L - Tmax) / (L - ?T)) / a)\<rbrakk> \<Longrightarrow> Tmin \<le> L - exp (- (a \<cdot> ?\<tau>)) \<cdot> (L - ?T)

goal (4 subgoals):
 1. 0 < a
 2. 0 \<le> \<tau>
 3. s2p UNIV \<tau>
 4. \<forall>s\<in>UNIV. s $ 4 \<noteq> 0 \<and> I Tmin Tmax s \<and> s $ 2 = 0 \<and> s $ 3 = s $ 1 \<longrightarrow> (\<forall>t\<in>{0..\<tau>}. (\<forall>\<tau>\<in>{0..t}. G Tmin Tmax a L (\<phi> a L \<tau> s)) \<longrightarrow> I Tmin Tmax (\<phi> a L t s))
[PROOF STEP]
by auto


[STATEMENT]
lemma measure_Union:
  "emeasure M A \<noteq> \<infinity> \<Longrightarrow> emeasure M B \<noteq> \<infinity> \<Longrightarrow> A \<in> sets M \<Longrightarrow> B \<in> sets M \<Longrightarrow> A \<inter> B = {} \<Longrightarrow>
    measure M (A \<union> B) = measure M A + measure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>emeasure M A \<noteq> \<infinity>; emeasure M B \<noteq> \<infinity>; A \<in> sets M; B \<in> sets M; A \<inter> B = {}\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> B) = Sigma_Algebra.measure M A + Sigma_Algebra.measure M B
[PROOF STEP]
by (simp add: measure_def plus_emeasure[symmetric] enn2real_plus less_top)


[STATEMENT]
lemma is_pref_profile_iff:
  "is_pref_profile A \<longleftrightarrow> set_mset A \<subseteq> Pow parties - {{}} \<and> size A = n_voters"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pref_profile A = (set_mset A \<subseteq> Pow parties - {{}} \<and> size A = n_voters)
[PROOF STEP]
unfolding anon_papp_profile_def anon_papp_profile_axioms_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (anon_papp_election n_voters parties \<and> (\<forall>X. X \<in># A \<longrightarrow> X \<subseteq> parties) \<and> {} \<notin># A \<and> size A = n_voters) = (set_mset A \<subseteq> Pow parties - {{}} \<and> size A = n_voters)
[PROOF STEP]
using anon_papp_election_axioms
[PROOF STATE]
proof (prove)
using this:
anon_papp_election n_voters parties

goal (1 subgoal):
 1. (anon_papp_election n_voters parties \<and> (\<forall>X. X \<in># A \<longrightarrow> X \<subseteq> parties) \<and> {} \<notin># A \<and> size A = n_voters) = (set_mset A \<subseteq> Pow parties - {{}} \<and> size A = n_voters)
[PROOF STEP]
by auto


[STATEMENT]
lemma topologyI:
  "\<lbrakk> \<And> x y. \<lbrakk> is_open T x; is_open T y\<rbrakk> \<Longrightarrow> is_open T (x \<inter> y);
     \<And> M. \<forall> m \<in> M. is_open T m \<Longrightarrow> is_open T (\<Union> M)
   \<rbrakk> \<Longrightarrow> topology T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. \<lbrakk>x open\<^bsub>T\<^esub>; y open\<^bsub>T\<^esub>\<rbrakk> \<Longrightarrow> x \<inter> y open\<^bsub>T\<^esub>; \<And>M. \<forall>m\<in>M. m open\<^bsub>T\<^esub> \<Longrightarrow> \<Union> M open\<^bsub>T\<^esub>\<rbrakk> \<Longrightarrow> topology T
[PROOF STEP]
by (auto simp: topology_def)


[STATEMENT]
lemma volumeI:
  assumes "f {} = 0"
  assumes "\<And>a. a \<in> M \<Longrightarrow> 0 \<le> f a"
  assumes "\<And>C. C \<subseteq> M \<Longrightarrow> disjoint C \<Longrightarrow> finite C \<Longrightarrow> \<Union>C \<in> M \<Longrightarrow> f (\<Union>C) = (\<Sum>c\<in>C. f c)"
  shows "volume M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. volume M f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f {} = 0
?a \<in> M \<Longrightarrow> 0 \<le> f ?a
\<lbrakk>?C \<subseteq> M; disjoint ?C; finite ?C; \<Union> ?C \<in> M\<rbrakk> \<Longrightarrow> f (\<Union> ?C) = sum f ?C

goal (1 subgoal):
 1. volume M f
[PROOF STEP]
by (auto simp: volume_def)


[STATEMENT]
lemma vifunion_iff: "b \<in>\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i) \<longleftrightarrow> (\<exists>i\<in>\<^sub>\<circ>I. b \<in>\<^sub>\<circ> f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)) = (\<exists>i\<in>elts I. b \<in>\<^sub>\<circ> f i)
[PROOF STEP]
by force


[STATEMENT]
lemma capped_omega_isotone:
  "y \<le> u \<Longrightarrow> u * v \<le> v \<Longrightarrow> t \<le> y \<Longrightarrow> t\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<le> u; u * v \<le> v; t \<le> y\<rbrakk> \<Longrightarrow> t\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
by (metis capped_omega_induct_meet capped_omega_unfold le_iff_sup inf.sup_left_isotone mult_right_sub_dist_sup_left)


[STATEMENT]
lemma inext_less_mono_rev: "
  \<lbrakk> inext a I < inext b I; a \<in> I; b \<in> I \<rbrakk> \<Longrightarrow> a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inext a I < inext b I; a \<in> I; b \<in> I\<rbrakk> \<Longrightarrow> a < b
[PROOF STEP]
by (metis inext_le_mono not_le)


[STATEMENT]
lemma fixp_induct_set_scott:
  fixes F :: "'c \<Rightarrow> 'c"
  and U :: "'c \<Rightarrow> 'b \<Rightarrow> 'a set"
  and C :: "('b \<Rightarrow> 'a set) \<Rightarrow> 'c"
  and P :: "'b \<Rightarrow> 'a \<Rightarrow> bool"
  and x and y
  assumes mono: "\<And>x. mono_set (\<lambda>f. U (F (C f)) x)"
  and eq: "f \<equiv> C (ccpo.fixp (fun_lub Sup) (fun_ord (\<le>)) (\<lambda>f. U (F (C f))))"
  and inverse2: "\<And>f. U (C f) = f"
  and step: "\<And>f x y. \<lbrakk> \<And>x y. y \<in> U f x \<Longrightarrow> P x y; y \<in> U (F f) x \<rbrakk> \<Longrightarrow> P x y"
  and enforce_variable_ordering: "x = x"
  and elem: "y \<in> U f x"
  shows "P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x y
[PROOF STEP]
using step elem set.fixp_induct_uc[of U F C, OF mono eq inverse2 set_admissible, of P]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. y \<in> U ?f x \<Longrightarrow> P x y; ?y \<in> U (F ?f) ?x\<rbrakk> \<Longrightarrow> P ?x ?y
y \<in> U f x
\<lbrakk>\<forall>x y. y \<in> \<Union> {} \<longrightarrow> P x y; \<And>f. \<forall>x y. y \<in> U f x \<longrightarrow> P x y \<Longrightarrow> \<forall>x y. y \<in> U (F f) x \<longrightarrow> P x y\<rbrakk> \<Longrightarrow> \<forall>x y. y \<in> U f x \<longrightarrow> P x y

goal (1 subgoal):
 1. P x y
[PROOF STEP]
by blast


[STATEMENT]
lemma powsum_mpoly_recurrence':
  assumes k: "k > card X" and X: "finite X"
  shows   "(powsum_mpoly X k :: 'a :: comm_ring_1 mpoly) =
             -(\<Sum>i=1..card X. (-1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
define e p :: "nat \<Rightarrow> 'a mpoly" where [simp]: "e = sym_mpoly X" "p = powsum_mpoly X"
[PROOF STATE]
proof (state)
this:
e = sym_mpoly X
p = powsum_mpoly X

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
have "p k = (-1) ^ (k + 1) * of_nat k * e k - (\<Sum>i=1..<k. (-1) ^ i * e i * p (k - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p k = (- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))
[PROOF STEP]
unfolding e_p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. powsum_mpoly X k = (- 1) ^ (k + 1) * of_nat k * sym_mpoly X k - (\<Sum>i = 1..<k. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card X < k
finite X

goal (1 subgoal):
 1. powsum_mpoly X k = (- 1) ^ (k + 1) * of_nat k * sym_mpoly X k - (\<Sum>i = 1..<k. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
by (intro powsum_mpoly_recurrence) auto
[PROOF STATE]
proof (state)
this:
p k = (- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p k = (- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
have "\<dots> = -(\<Sum>i=1..<k. (-1) ^ i * e i * p (k - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card X < k
finite X

goal (1 subgoal):
 1. (- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1) ^ (k + 1) * of_nat k * e k - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = - (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
have "(\<Sum>i=1..<k. (-1) ^ i * e i * p (k - i)) = (\<Sum>i=1..card X. (-1) ^ i * e i * p (k - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = (\<Sum>i = 1..card X. (- 1) ^ i * e i * p (k - i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card X < k
finite X

goal (1 subgoal):
 1. (\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = (\<Sum>i = 1..card X. (- 1) ^ i * e i * p (k - i))
[PROOF STEP]
by (intro sum.mono_neutral_right) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 1..<k. (- 1) ^ i * e i * p (k - i)) = (\<Sum>i = 1..card X. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p k = - (\<Sum>i = 1..card X. (- 1) ^ i * e i * p (k - i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p k = - (\<Sum>i = 1..card X. (- 1) ^ i * e i * p (k - i))

goal (1 subgoal):
 1. powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
powsum_mpoly X k = - (\<Sum>i = 1..card X. (- 1) ^ i * sym_mpoly X i * powsum_mpoly X (k - i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuity_lem_gt0:
  fixes r:: "real"
  fixes a b c:: "real"
  shows "poly [:c, b, a:] r > 0 \<Longrightarrow>
    \<exists>y'> r. \<forall>x\<in>{r<..y'}. poly [:c, b, a:] x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
assume r_gtz: "poly [:c, b, a:] r > 0 "
[PROOF STATE]
proof (state)
this:
0 < poly [:c, b, a:] r

goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
let ?p = "[:-c, -b, -a:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
have revpoly: "\<forall>x. -1*(poly [:c, b, a:] x) = poly [:-c, -b, -a:] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x
[PROOF STEP]
by (metis (no_types, opaque_lifting) Polynomial.poly_minus minus_pCons mult_minus1 neg_equal_0_iff_equal)
[PROOF STATE]
proof (state)
this:
\<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x

goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x
[PROOF STEP]
have "poly ?p r < 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x

goal (1 subgoal):
 1. poly [:- c, - b, - a:] r < 0
[PROOF STEP]
using r_gtz
[PROOF STATE]
proof (prove)
using this:
\<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x
0 < poly [:c, b, a:] r

goal (1 subgoal):
 1. poly [:- c, - b, - a:] r < 0
[PROOF STEP]
by (metis mult_minus1 neg_less_0_iff_less)
[PROOF STATE]
proof (state)
this:
poly [:- c, - b, - a:] r < 0

goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly [:- c, - b, - a:] r < 0
[PROOF STEP]
have "\<exists>y'> r. \<forall>x\<in>{r<..y'}. poly ?p x < 0"
[PROOF STATE]
proof (prove)
using this:
poly [:- c, - b, - a:] r < 0

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0
[PROOF STEP]
using continuity_lem_lt0
[PROOF STATE]
proof (prove)
using this:
poly [:- c, - b, - a:] r < 0
poly [:?c, ?b, ?a:] ?r < 0 \<Longrightarrow> \<exists>y'>?r. \<forall>x\<in>{?r<..y'}. poly [:?c, ?b, ?a:] x < 0

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0

goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0
[PROOF STEP]
obtain y' where y_prop: "y' > r \<and> (\<forall>x\<in>{r<..y'}. poly ?p x < 0)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0

goal (1 subgoal):
 1. (\<And>y'. r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0)

goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0)
[PROOF STEP]
have "\<forall>x\<in>{r<..y'}. poly [:c, b, a:] x > 0 "
[PROOF STATE]
proof (prove)
using this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0)

goal (1 subgoal):
 1. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
using revpoly
[PROOF STATE]
proof (prove)
using this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0)
\<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x

goal (1 subgoal):
 1. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
using neg_less_0_iff_less
[PROOF STATE]
proof (prove)
using this:
r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0)
\<forall>x. - 1 * poly [:c, b, a:] x = poly [:- c, - b, - a:] x
(- ?a < (0::?'a)) = ((0::?'a) < ?a)

goal (1 subgoal):
 1. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x

goal (1 subgoal):
 1. 0 < poly [:c, b, a:] r \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
using y_prop
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
r < y' \<and> (\<forall>x\<in>{r<..y'}. poly [:- c, - b, - a:] x < 0)

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. 0 < poly [:c, b, a:] x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powreal_divide:
  "\<lbrakk> 0 \<le> a; 0 \<le> b \<rbrakk> \<Longrightarrow> (a/b) pow\<^sub>\<real> x = (a pow\<^sub>\<real> x) / (b pow\<^sub>\<real> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 \<le> b\<rbrakk> \<Longrightarrow> (a / b) pow\<^sub>\<real> x = a pow\<^sub>\<real> x / b pow\<^sub>\<real> x
[PROOF STEP]
by (simp add: divide_inverse powreal_inverse powreal_mult_base)


[STATEMENT]
lemma xor_list_left_inverse [simp]:
  fixes xs :: "'a :: boolean_algebra list"
  shows "length ys \<le> length xs \<Longrightarrow> xs [\<oplus>] (xs [\<oplus>] ys) = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ys \<le> length xs \<Longrightarrow> xs [\<oplus>] xs [\<oplus>] ys = ys
[PROOF STEP]
by(subst xor_list_assoc[symmetric])(simp)


[STATEMENT]
lemma greaterThanAtMost_eq_atLeastAtMost_diff: "{a<\<^sub>a..\<le>\<^sub>ab} = {a\<le>\<^sub>a..\<le>\<^sub>ab} - {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<\<^sub>a..\<le>\<^sub>ab} = {a\<le>\<^sub>a..\<le>\<^sub>ab} - {a}
[PROOF STEP]
unfolding interval_def ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> UNIV. a <\<^sub>a x} \<inter> {x \<in> UNIV. x \<le>\<^sub>a b} = {x \<in> UNIV. a \<le>\<^sub>a x} \<inter> {x \<in> UNIV. x \<le>\<^sub>a b} - {a}
[PROOF STEP]
by (auto simp: less_imp_le le_less)


[STATEMENT]
lemma excess_eq1:
  "\<lbrakk> inv g; final g; tame g; except g v = 0; v \<in> set(vertices g) \<rbrakk> \<Longrightarrow>
   ExcessAt g v + (tri g v) * \<d> 3 + (quad g v) * \<d>  4
   = \<b> (tri g v) (quad g v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; tame g; except g v = 0; v \<in> \<V> g\<rbrakk> \<Longrightarrow> ExcessAt g v + tri g v * \<d> 3 + quad g v * \<d> 4 = \<b> (tri g v) (quad g v)
[PROOF STEP]
apply(subgoal_tac "finalVertex g v")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Invariants.inv g; final g; tame g; except g v = 0; v \<in> \<V> g; finalVertex g v\<rbrakk> \<Longrightarrow> ExcessAt g v + tri g v * \<d> 3 + quad g v * \<d> 4 = \<b> (tri g v) (quad g v)
 2. \<lbrakk>Invariants.inv g; final g; tame g; except g v = 0; v \<in> \<V> g\<rbrakk> \<Longrightarrow> finalVertex g v
[PROOF STEP]
apply(simp add: ExcessAt_def excess_eq faceCountMax_bound)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Invariants.inv g; final g; tame g; except g v = 0; v \<in> \<V> g\<rbrakk> \<Longrightarrow> finalVertex g v
[PROOF STEP]
apply(auto simp:finalVertex_def plane_final_facesAt)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dtree_size_decr[termination_simp]:
  assumes "(x, y) \<in> fset (xs:: (('a, 'b) dtree \<times> 'b) fset)"
  shows "size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
let ?xs = "(map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y)) ` fset xs"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
have "size x < (\<Sum>u\<in>?xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size x < (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1
[PROOF STEP]
using dtree_size_decr_aux assms
[PROOF STATE]
proof (prove)
using this:
(?x, ?y) \<in> fset ?xs \<Longrightarrow> size ?x < size (Node ?r ?xs)
(x, y) \<in> fset xs

goal (1 subgoal):
 1. size x < (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
size x < (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1

goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
size x < (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1

goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
have "\<dots> = Suc (\<Sum>u\<in>?xs. Suc (Suc (snd (fst u))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1 = Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
by (simp add: size_prod_simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (size_prod snd (\<lambda>_. 0) u)) + 1 = Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))

goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))

goal (1 subgoal):
 1. size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
size x < Suc (\<Sum>u\<in>map_prod (\<lambda>x. (x, size x)) (\<lambda>y. y) ` fset xs. Suc (Suc (snd (fst u))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_times_monomial_right: "lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)"
  for c::"'b::semiring_0" and t::"'a::comm_powerprod"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
proof (induct p rule: poly_mapping_except_induct, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
fix p::"'a \<Rightarrow>\<^sub>0 'b" and w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
assume "p \<noteq> 0" and "w \<in> keys p"
    and IH: "lookup (except p {w} * monomial c t) s =
             ((lookup (except p {w}) (s - t)) * c when t adds s)"
            (is "_ = ?x")
[PROOF STATE]
proof (state)
this:
p \<noteq> 0
w \<in> keys p
lookup (except p {w} * monomial c t) s = (lookup (except p {w}) (s - t) * c when t adds s)

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
have "p * monomial c t = (monomial (lookup p w) w + except p {w}) * monomial c t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * monomial c t = (monomial (lookup p w) w + except p {w}) * monomial c t
[PROOF STEP]
by (simp only: plus_except[symmetric])
[PROOF STATE]
proof (state)
this:
p * monomial c t = (monomial (lookup p w) w + except p {w}) * monomial c t

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p * monomial c t = (monomial (lookup p w) w + except p {w}) * monomial c t

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
have "... = monomial (lookup p w) w * monomial c t + except p {w} * monomial c t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (monomial (lookup p w) w + except p {w}) * monomial c t = monomial (lookup p w) w * monomial c t + except p {w} * monomial c t
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(monomial (lookup p w) w + except p {w}) * monomial c t = monomial (lookup p w) w * monomial c t + except p {w} * monomial c t

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(monomial (lookup p w) w + except p {w}) * monomial c t = monomial (lookup p w) w * monomial c t + except p {w} * monomial c t

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
have "... = monomial (lookup p w * c) (w + t) + except p {w} * monomial c t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomial (lookup p w) w * monomial c t + except p {w} * monomial c t = monomial (lookup p w * c) (w + t) + except p {w} * monomial c t
[PROOF STEP]
by (simp only: mult_single)
[PROOF STATE]
proof (state)
this:
monomial (lookup p w) w * monomial c t + except p {w} * monomial c t = monomial (lookup p w * c) (w + t) + except p {w} * monomial c t

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p * monomial c t = monomial (lookup p w * c) (w + t) + except p {w} * monomial c t
[PROOF STEP]
have "lookup (p * monomial c t) s = lookup (monomial (lookup p w * c) (w + t)) s + ?x"
[PROOF STATE]
proof (prove)
using this:
p * monomial c t = monomial (lookup p w * c) (w + t) + except p {w} * monomial c t

goal (1 subgoal):
 1. lookup (p * monomial c t) s = lookup (monomial (lookup p w * c) (w + t)) s + (lookup (except p {w}) (s - t) * c when t adds s)
[PROOF STEP]
by (simp only: lookup_add IH)
[PROOF STATE]
proof (state)
this:
lookup (p * monomial c t) s = lookup (monomial (lookup p w * c) (w + t)) s + (lookup (except p {w}) (s - t) * c when t adds s)

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (p * monomial c t) s = lookup (monomial (lookup p w * c) (w + t)) s + (lookup (except p {w}) (s - t) * c when t adds s)

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
have "... = (lookup (monomial (lookup p w * c) (w + t)) s +
                    lookup (except p {w}) (s - t) * c when t adds s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monomial (lookup p w * c) (w + t)) s + (lookup (except p {w}) (s - t) * c when t adds s) = (lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c when t adds s)
[PROOF STEP]
by (rule when_distrib, auto simp add: lookup_single when_def)
[PROOF STATE]
proof (state)
this:
lookup (monomial (lookup p w * c) (w + t)) s + (lookup (except p {w}) (s - t) * c when t adds s) = (lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c when t adds s)

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lookup (monomial (lookup p w * c) (w + t)) s + (lookup (except p {w}) (s - t) * c when t adds s) = (lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c when t adds s)

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
from refl
[PROOF STATE]
proof (chain)
picking this:
?t = ?t
[PROOF STEP]
have "... = (lookup p (s - t) * c when t adds s)"
[PROOF STATE]
proof (prove)
using this:
?t = ?t

goal (1 subgoal):
 1. (lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c when t adds s) = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
proof (rule when_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t adds s \<Longrightarrow> lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c = lookup p (s - t) * c
[PROOF STEP]
assume "t adds s"
[PROOF STATE]
proof (state)
this:
t adds s

goal (1 subgoal):
 1. t adds s \<Longrightarrow> lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c = lookup p (s - t) * c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t adds s
[PROOF STEP]
obtain u where u: "s = t + u"
[PROOF STATE]
proof (prove)
using this:
t adds s

goal (1 subgoal):
 1. (\<And>u. s = t + u \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
s = t + u

goal (1 subgoal):
 1. t adds s \<Longrightarrow> lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c = lookup p (s - t) * c
[PROOF STEP]
show "lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c =
          lookup p (s - t) * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c = lookup p (s - t) * c
[PROOF STEP]
by (simp add: u, cases "u = w", simp_all add: lookup_except lookup_single add.commute)
[PROOF STATE]
proof (state)
this:
lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c = lookup p (s - t) * c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(lookup (monomial (lookup p w * c) (w + t)) s + lookup (except p {w}) (s - t) * c when t adds s) = (lookup p (s - t) * c when t adds s)

goal (1 subgoal):
 1. \<And>p ta. \<lbrakk>p \<noteq> 0; ta \<in> keys p; lookup (except p {ta} * monomial c t) s = (lookup (except p {ta}) (s - t) * c when t adds s)\<rbrakk> \<Longrightarrow> lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
show "lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)"
[PROOF STATE]
proof (prove)
using this:
lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)

goal (1 subgoal):
 1. lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lookup (p * monomial c t) s = (lookup p (s - t) * c when t adds s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma language_state_for_inputs_union :
  shows "LS\<^sub>i\<^sub>n M q T1 \<union> LS\<^sub>i\<^sub>n M q T2 = LS\<^sub>i\<^sub>n M q (T1 \<union> T2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LS\<^sub>i\<^sub>n M q T1 \<union> LS\<^sub>i\<^sub>n M q T2 = LS\<^sub>i\<^sub>n M q (T1 \<union> T2)
[PROOF STEP]
unfolding language_state_for_inputs.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs || ys |xs ys. xs \<in> T1 \<and> length xs = length ys \<and> xs || ys \<in> LS M q} \<union> {xs || ys |xs ys. xs \<in> T2 \<and> length xs = length ys \<and> xs || ys \<in> LS M q} = {xs || ys |xs ys. xs \<in> T1 \<union> T2 \<and> length xs = length ys \<and> xs || ys \<in> LS M q}
[PROOF STEP]
by blast


[STATEMENT]
lemma self_list_diff:
  "xs - xs = replicate (length(xs::'a::group_add list)) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs - xs = replicate (length xs) (0::'a)
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma (in normal) normal_oVeblen_0:
"0 < F 0 \<Longrightarrow> normal (\<lambda>x. oVeblen F x 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < F 0 \<Longrightarrow> normal (\<lambda>x. oVeblen F x 0)
[PROOF STEP]
apply (rule normalI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. \<lbrakk>0 < F 0; OrdinalInduct.strict_mono f\<rbrakk> \<Longrightarrow> oVeblen F (oLimit f) 0 = oLimit (\<lambda>n. oVeblen F (f n) 0)
 2. \<And>x. 0 < F 0 \<Longrightarrow> oVeblen F x 0 < oVeblen F (oSuc x) 0
[PROOF STEP]
apply (rule oVeblen_oLimit_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < F 0 \<Longrightarrow> oVeblen F x 0 < oVeblen F (oSuc x) 0
[PROOF STEP]
apply (simp only: oVeblen_oSuc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < F 0 \<Longrightarrow> oVeblen F x 0 < oDeriv (oVeblen F x) 0
[PROOF STEP]
apply (subst oDeriv_fixed[OF normal_oVeblen, symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < F 0 \<Longrightarrow> oVeblen F x 0 < oVeblen F x (oDeriv (oVeblen F x) 0)
[PROOF STEP]
apply (rule normal.strict_monoD[OF normal_oVeblen])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < F 0 \<Longrightarrow> 0 < oDeriv (oVeblen F x) 0
[PROOF STEP]
apply (simp add: zero_less_oFix_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < F 0 \<Longrightarrow> 0 < oVeblen F x 0
[PROOF STEP]
apply (erule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. F 0 \<le> oVeblen F x 0
[PROOF STEP]
apply (subgoal_tac "oVeblen F 0 0 \<le> oVeblen F x 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. oVeblen F 0 0 \<le> oVeblen F x 0 \<Longrightarrow> F 0 \<le> oVeblen F x 0
 2. \<And>x. oVeblen F 0 0 \<le> oVeblen F x 0
[PROOF STEP]
apply (simp add: oVeblen_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. oVeblen F 0 0 \<le> oVeblen F x 0
[PROOF STEP]
apply (rule continuous.monoD[OF _ ordinal_0_le])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. continuous (\<lambda>a. oVeblen F a 0)
[PROOF STEP]
apply (rule continuous_oVeblen_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subst_idx_map:
  assumes "\<forall>i \<in> set I. i < length T"
  shows "(map ((!) T) I) \<cdot>\<^sub>l\<^sub>i\<^sub>s\<^sub>t \<delta> = map ((!) (map (\<lambda>t. t \<cdot> \<delta>) T)) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((!) T) I \<cdot>\<^sub>l\<^sub>i\<^sub>s\<^sub>t \<delta> = map ((!) (T \<cdot>\<^sub>l\<^sub>i\<^sub>s\<^sub>t \<delta>)) I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>set I. i < length T

goal (1 subgoal):
 1. map ((!) T) I \<cdot>\<^sub>l\<^sub>i\<^sub>s\<^sub>t \<delta> = map ((!) (T \<cdot>\<^sub>l\<^sub>i\<^sub>s\<^sub>t \<delta>)) I
[PROOF STEP]
by auto


[STATEMENT]
lemma length_pps_to_list: "length (pps_to_list S) = card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (pps_to_list S) = card S
[PROOF STEP]
proof (cases "finite S")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite S \<Longrightarrow> length (pps_to_list S) = card S
 2. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite S

goal (2 subgoals):
 1. finite S \<Longrightarrow> length (pps_to_list S) = card S
 2. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
from distinct_card[OF distinct_pps_to_list]
[PROOF STATE]
proof (chain)
picking this:
card (set (pps_to_list ?S1)) = length (pps_to_list ?S1)
[PROOF STEP]
have "length (pps_to_list S) = card (set (pps_to_list S))"
[PROOF STATE]
proof (prove)
using this:
card (set (pps_to_list ?S1)) = length (pps_to_list ?S1)

goal (1 subgoal):
 1. length (pps_to_list S) = card (set (pps_to_list S))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (pps_to_list S) = card (set (pps_to_list S))

goal (2 subgoals):
 1. finite S \<Longrightarrow> length (pps_to_list S) = card S
 2. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (pps_to_list S) = card (set (pps_to_list S))

goal (2 subgoals):
 1. finite S \<Longrightarrow> length (pps_to_list S) = card S
 2. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
finite S
[PROOF STEP]
have "... = card S"
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. card (set (pps_to_list S)) = card S
[PROOF STEP]
by (simp only: set_pps_to_list)
[PROOF STATE]
proof (state)
this:
card (set (pps_to_list S)) = card S

goal (2 subgoals):
 1. finite S \<Longrightarrow> length (pps_to_list S) = card S
 2. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length (pps_to_list S) = card S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (pps_to_list S) = card S

goal (1 subgoal):
 1. length (pps_to_list S) = card S
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length (pps_to_list S) = card S

goal (1 subgoal):
 1. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite S

goal (1 subgoal):
 1. infinite S \<Longrightarrow> length (pps_to_list S) = card S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite S

goal (1 subgoal):
 1. length (pps_to_list S) = card S
[PROOF STEP]
by (simp add: pps_to_list_def)
[PROOF STATE]
proof (state)
this:
length (pps_to_list S) = card S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subst_cls_lists_append[simp]:
  "length Cs = length \<sigma>s \<Longrightarrow> length Cs' = length \<sigma>s' \<Longrightarrow>
   (Cs @ Cs') \<cdot>\<cdot>cl (\<sigma>s @ \<sigma>s') = Cs \<cdot>\<cdot>cl \<sigma>s @ Cs' \<cdot>\<cdot>cl \<sigma>s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length Cs = length \<sigma>s; length Cs' = length \<sigma>s'\<rbrakk> \<Longrightarrow> (Cs @ Cs') \<cdot>\<cdot>cl (\<sigma>s @ \<sigma>s') = Cs \<cdot>\<cdot>cl \<sigma>s @ Cs' \<cdot>\<cdot>cl \<sigma>s'
[PROOF STEP]
unfolding subst_cls_lists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length Cs = length \<sigma>s; length Cs' = length \<sigma>s'\<rbrakk> \<Longrightarrow> Map2.map2 (\<cdot>) (Cs @ Cs') (\<sigma>s @ \<sigma>s') = Map2.map2 (\<cdot>) Cs \<sigma>s @ Map2.map2 (\<cdot>) Cs' \<sigma>s'
[PROOF STEP]
by auto


[STATEMENT]
lemma (in prob_space) indep_sets_finite:
  assumes I: "I \<noteq> {}" "finite I"
    and F: "\<And>i. i \<in> I \<Longrightarrow> F i \<subseteq> events" "\<And>i. i \<in> I \<Longrightarrow> space M \<in> F i"
  shows "indep_sets F I \<longleftrightarrow> (\<forall>A\<in>Pi I F. prob (\<Inter>j\<in>I. A j) = (\<Prod>j\<in>I. prob (A j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets F I = (\<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. indep_sets F I \<Longrightarrow> \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))
 2. \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j)) \<Longrightarrow> indep_sets F I
[PROOF STEP]
assume *: "indep_sets F I"
[PROOF STATE]
proof (state)
this:
indep_sets F I

goal (2 subgoals):
 1. indep_sets F I \<Longrightarrow> \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))
 2. \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j)) \<Longrightarrow> indep_sets F I
[PROOF STEP]
from I
[PROOF STATE]
proof (chain)
picking this:
I \<noteq> {}
finite I
[PROOF STEP]
show "\<forall>A\<in>Pi I F. prob (\<Inter>j\<in>I. A j) = (\<Prod>j\<in>I. prob (A j))"
[PROOF STATE]
proof (prove)
using this:
I \<noteq> {}
finite I

goal (1 subgoal):
 1. \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))
[PROOF STEP]
by (intro indep_setsD[OF *] ballI) auto
[PROOF STATE]
proof (state)
this:
\<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))

goal (1 subgoal):
 1. \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j)) \<Longrightarrow> indep_sets F I
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j)) \<Longrightarrow> indep_sets F I
[PROOF STEP]
assume indep: "\<forall>A\<in>Pi I F. prob (\<Inter>j\<in>I. A j) = (\<Prod>j\<in>I. prob (A j))"
[PROOF STATE]
proof (state)
this:
\<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))

goal (1 subgoal):
 1. \<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j)) \<Longrightarrow> indep_sets F I
[PROOF STEP]
show "indep_sets F I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indep_sets F I
[PROOF STEP]
proof (rule indep_setsI[OF F(1)])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
fix A J
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
assume J: "J \<noteq> {}" "J \<subseteq> I" "finite J"
[PROOF STATE]
proof (state)
this:
J \<noteq> {}
J \<subseteq> I
finite J

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
assume A: "\<forall>j\<in>J. A j \<in> F j"
[PROOF STATE]
proof (state)
this:
\<forall>j\<in>J. A j \<in> F j

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
let ?A = "\<lambda>j. if j \<in> J then A j else space M"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
have "prob (\<Inter>j\<in>I. ?A j) = prob (\<Inter>j\<in>J. A j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = prob (\<Inter> (A ` J))
[PROOF STEP]
using subset_trans[OF F(1) sets.space_closed] J A
[PROOF STATE]
proof (prove)
using this:
?i10 \<in> I \<Longrightarrow> F ?i10 \<subseteq> Pow (space M)
J \<noteq> {}
J \<subseteq> I
finite J
\<forall>j\<in>J. A j \<in> F j

goal (1 subgoal):
 1. prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = prob (\<Inter> (A ` J))
[PROOF STEP]
by (auto intro!: arg_cong[where f=prob] split: if_split_asm) blast
[PROOF STATE]
proof (state)
this:
prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = prob (\<Inter> (A ` J))

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = prob (\<Inter> (A ` J))

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
from A F
[PROOF STATE]
proof (chain)
picking this:
\<forall>j\<in>J. A j \<in> F j
?i8 \<in> I \<Longrightarrow> F ?i8 \<subseteq> events
?i8 \<in> I \<Longrightarrow> space M \<in> F ?i8
[PROOF STEP]
have "(\<lambda>j. if j \<in> J then A j else space M) \<in> Pi I F" (is "?A \<in> _")
[PROOF STATE]
proof (prove)
using this:
\<forall>j\<in>J. A j \<in> F j
?i8 \<in> I \<Longrightarrow> F ?i8 \<subseteq> events
?i8 \<in> I \<Longrightarrow> space M \<in> F ?i8

goal (1 subgoal):
 1. (\<lambda>j. if j \<in> J then A j else space M) \<in> Pi I F
[PROOF STEP]
by (auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<lambda>j. if j \<in> J then A j else space M) \<in> Pi I F

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
with indep
[PROOF STATE]
proof (chain)
picking this:
\<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))
(\<lambda>j. if j \<in> J then A j else space M) \<in> Pi I F
[PROOF STEP]
have "prob (\<Inter>j\<in>I. ?A j) = (\<Prod>j\<in>I. prob (?A j))"
[PROOF STATE]
proof (prove)
using this:
\<forall>A\<in>Pi I F. prob (\<Inter> (A ` I)) = (\<Prod>j\<in>I. prob (A j))
(\<lambda>j. if j \<in> J then A j else space M) \<in> Pi I F

goal (1 subgoal):
 1. prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = (\<Prod>j\<in>I. prob (if j \<in> J then A j else space M))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = (\<Prod>j\<in>I. prob (if j \<in> J then A j else space M))

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob (\<Inter>j\<in>I. if j \<in> J then A j else space M) = (\<Prod>j\<in>I. prob (if j \<in> J then A j else space M))

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
have "\<dots> = (\<Prod>j\<in>J. prob (A j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>j\<in>I. prob (if j \<in> J then A j else space M)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
unfolding if_distrib prod.If_cases[OF \<open>finite I\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>j\<in>I \<inter> {j. j \<in> J}. prob (A j)) * (\<Prod>j\<in>I \<inter> - {j. j \<in> J}. prob (space M)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
using prob_space \<open>J \<subseteq> I\<close>
[PROOF STATE]
proof (prove)
using this:
prob (space M) = 1
J \<subseteq> I

goal (1 subgoal):
 1. (\<Prod>j\<in>I \<inter> {j. j \<in> J}. prob (A j)) * (\<Prod>j\<in>I \<inter> - {j. j \<in> J}. prob (space M)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
by (simp add: Int_absorb1 prod.neutral_const)
[PROOF STATE]
proof (state)
this:
(\<Prod>j\<in>I. prob (if j \<in> J then A j else space M)) = (\<Prod>j\<in>J. prob (A j))

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
 2. \<And>A J. \<lbrakk>J \<noteq> {}; J \<subseteq> I; finite J; \<forall>j\<in>J. A j \<in> F j\<rbrakk> \<Longrightarrow> prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>j\<in>J. prob (A j)) = prob (\<Inter> (A ` J))
[PROOF STEP]
show "prob (\<Inter>j\<in>J. A j) = (\<Prod>j\<in>J. prob (A j))"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>j\<in>J. prob (A j)) = prob (\<Inter> (A ` J))

goal (1 subgoal):
 1. prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
prob (\<Inter> (A ` J)) = (\<Prod>j\<in>J. prob (A j))

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> i \<in> I
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
indep_sets F I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fixes a b c::ereal
  shows not_inftyI: "a < b \<Longrightarrow> b < c \<Longrightarrow> abs b \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; b < c\<rbrakk> \<Longrightarrow> \<bar>b\<bar> \<noteq> \<infinity>
[PROOF STEP]
by force


[STATEMENT]
lemma fres_bres_clop: "clop (\<lambda>x::'a::proto_quantale. (y \<leftarrow> x) \<rightarrow> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clop (\<lambda>x. (y \<leftarrow> x) \<rightarrow> y)
[PROOF STEP]
unfolding clop_def comp_def mono_def le_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. id x \<le> (y \<leftarrow> x) \<rightarrow> y) \<and> (\<forall>x ya. x \<le> ya \<longrightarrow> (y \<leftarrow> x) \<rightarrow> y \<le> (y \<leftarrow> ya) \<rightarrow> y) \<and> (\<forall>x. (y \<leftarrow> ((y \<leftarrow> x) \<rightarrow> y)) \<rightarrow> y \<le> (y \<leftarrow> x) \<rightarrow> y)
[PROOF STEP]
by (metis bres_anti bres_canc1 bres_galois_imp fres_anti fres_canc1 fres_galois id_apply)


[STATEMENT]
lemma comm_ring_ow: "class.comm_ring = comm_ring_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.comm_ring = comm_ring_ow UNIV
[PROOF STEP]
unfolding
    class.comm_ring_def comm_ring_ow_def
    ab_group_add_ow comm_semiring_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>plus zero minus uminus times. ab_group_add_ow UNIV plus zero minus uminus \<and> comm_semiring_ow UNIV plus times) = (\<lambda>plus zero minus uminus times. comm_semiring_ow UNIV plus times \<and> ab_group_add_ow UNIV plus zero minus uminus)
[PROOF STEP]
by (simp add: conj_commute)


[STATEMENT]
lemma observable_transition_unique :
  assumes "observable M"
      and "t \<in> transitions M"
    shows "\<exists>! t' \<in> transitions M . t_source t' = t_source t \<and>
                                    t_input t' = t_input t \<and>
                                    t_output t' = t_output t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!t'. t' \<in> FSM.transitions M \<and> t_source t' = t_source t \<and> t_input t' = t_input t \<and> t_output t' = t_output t
[PROOF STEP]
by (metis assms observable.elims(2) prod.expand)


[STATEMENT]
lemma "filterlim (\<lambda>x::real. \<lfloor>x\<rfloor>) at_top at_top"
      "filterlim (\<lambda>x::real. \<lceil>x\<rceil>) at_top at_top"
      "filterlim (\<lambda>x::real. nat \<lfloor>x\<rfloor>) at_top at_top"
      "filterlim (\<lambda>x::real. nat \<lceil>x\<rceil>) at_top at_top"
      "filterlim (\<lambda>x::int. nat x) at_top at_top"
      "filterlim (\<lambda>x::int. nat x) at_top at_top"
      "filterlim (\<lambda>n::nat. real (n mod 42) + real n) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filterlim floor at_top at_top &&& filterlim ceiling at_top at_top &&& LIM x at_top. nat \<lfloor>x\<rfloor> :> sequentially) &&& (LIM x at_top. nat \<lceil>x\<rceil> :> sequentially &&& filterlim nat sequentially at_top) &&& filterlim nat sequentially at_top &&& LIM n sequentially. real (n mod 42) + real n :> at_top
[PROOF STEP]
by real_asymp+


[STATEMENT]
lemma l9_18:
  assumes "Col X Y P" and
    "Col A B P"
  shows "X Y TS A B \<longleftrightarrow> (Bet A P B \<and> \<not> Col X Y A \<and> \<not> Col X Y B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X Y TS A B) = (Bet A P B \<and> \<not> Col X Y A \<and> \<not> Col X Y B)
[PROOF STEP]
using l9_18_R1 l9_18_R2 assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Col ?X ?Y ?P; Col ?A ?B ?P; ?X ?Y TS ?A ?B\<rbrakk> \<Longrightarrow> Bet ?A ?P ?B \<and> \<not> Col ?X ?Y ?A \<and> \<not> Col ?X ?Y ?B
\<lbrakk>Col ?X ?Y ?P; Col ?A ?B ?P; Bet ?A ?P ?B; \<not> Col ?X ?Y ?A; \<not> Col ?X ?Y ?B\<rbrakk> \<Longrightarrow> ?X ?Y TS ?A ?B
Col X Y P
Col A B P

goal (1 subgoal):
 1. (X Y TS A B) = (Bet A P B \<and> \<not> Col X Y A \<and> \<not> Col X Y B)
[PROOF STEP]
by blast


[STATEMENT]
lemma wqo_on_hom:
  assumes "transp_on Q (h ` A)"
    and "\<forall>x\<in>A. \<forall>y\<in>A. P x y \<longrightarrow> Q (h x) (h y)"
    and "wqo_on P A"
  shows "wqo_on Q (h ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on Q (h ` A)
[PROOF STEP]
using assms and almost_full_on_hom [of A P Q h]
[PROOF STATE]
proof (prove)
using this:
transp_on Q (h ` A)
\<forall>x\<in>A. \<forall>y\<in>A. P x y \<longrightarrow> Q (h x) (h y)
wqo_on P A
\<lbrakk>\<And>x y. \<lbrakk>x \<in> A; y \<in> A; P x y\<rbrakk> \<Longrightarrow> Q (h x) (h y); almost_full_on P A\<rbrakk> \<Longrightarrow> almost_full_on Q (h ` A)

goal (1 subgoal):
 1. wqo_on Q (h ` A)
[PROOF STEP]
unfolding wqo_on_def
[PROOF STATE]
proof (prove)
using this:
transp_on Q (h ` A)
\<forall>x\<in>A. \<forall>y\<in>A. P x y \<longrightarrow> Q (h x) (h y)
transp_on P A \<and> almost_full_on P A
\<lbrakk>\<And>x y. \<lbrakk>x \<in> A; y \<in> A; P x y\<rbrakk> \<Longrightarrow> Q (h x) (h y); almost_full_on P A\<rbrakk> \<Longrightarrow> almost_full_on Q (h ` A)

goal (1 subgoal):
 1. transp_on Q (h ` A) \<and> almost_full_on Q (h ` A)
[PROOF STEP]
by blast


[STATEMENT]
lemma "eval (ExQ (ExQ F)) L = eval (ExQ (ExQ (swap_fm 0 1 F))) L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (ExQ (ExQ F)) L = eval (ExQ (ExQ (swap_fm 0 1 F))) L
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x xa. eval F (xa # x # L)) = (\<exists>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. eval F (xa # x # L) \<Longrightarrow> \<exists>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L)
 2. \<And>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L) \<Longrightarrow> \<exists>x xa. eval F (xa # x # L)
[PROOF STEP]
subgoal for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> \<exists>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L)
[PROOF STEP]
apply(rule exI[where x=j])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> \<exists>x. eval (swap_fm 0 (Suc 0) F) (x # j # L)
[PROOF STEP]
apply(rule exI[where x=i])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> eval (swap_fm 0 (Suc 0) F) (i # j # L)
[PROOF STEP]
using swap_fm[of 0 "j # i # L" "Suc 0" F]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (j # i # L); Suc 0 < length (j # i # L)\<rbrakk> \<Longrightarrow> eval F (j # i # L) = eval (swap_fm 0 (Suc 0) F) (swap_list 0 (Suc 0) (j # i # L))

goal (1 subgoal):
 1. eval F (j # i # L) \<Longrightarrow> eval (swap_fm 0 (Suc 0) F) (i # j # L)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. eval (swap_fm 0 (Suc 0) F) (xa # x # L) \<Longrightarrow> \<exists>x xa. eval F (xa # x # L)
[PROOF STEP]
subgoal for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> \<exists>x xa. eval F (xa # x # L)
[PROOF STEP]
apply(rule exI[where x=j])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> \<exists>x. eval F (x # j # L)
[PROOF STEP]
apply(rule exI[where x=i])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> eval F (i # j # L)
[PROOF STEP]
using swap_fm[of 0 "i # j # L" "Suc 0" F]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (i # j # L); Suc 0 < length (i # j # L)\<rbrakk> \<Longrightarrow> eval F (i # j # L) = eval (swap_fm 0 (Suc 0) F) (swap_list 0 (Suc 0) (i # j # L))

goal (1 subgoal):
 1. eval (swap_fm 0 (Suc 0) F) (j # i # L) \<Longrightarrow> eval F (i # j # L)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nextState_decide:
  assumes run:"HORun OTR_M rho HOs"
  and chg: "decide (rho (Suc n) p) \<noteq> decide (rho n p)"
  shows "TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n))
                   (the (decide (rho (Suc n) p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
from run
[PROOF STATE]
proof (chain)
picking this:
HORun OTR_M rho HOs
[PROOF STEP]
have "OTR_nextState n p (rho n p)
                    (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)"
[PROOF STATE]
proof (prove)
using this:
HORun OTR_M rho HOs

goal (1 subgoal):
 1. OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)
[PROOF STEP]
by (simp add: HORun_eq HOnextConfig_eq OTR_HOMachine_def nextState_def)
[PROOF STATE]
proof (state)
this:
OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)

goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
with chg
[PROOF STATE]
proof (chain)
picking this:
decide (rho (Suc n) p) \<noteq> decide (rho n p)
OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
decide (rho (Suc n) p) \<noteq> decide (rho n p)
OTR_nextState n p (rho n p) (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (rho (Suc n) p)

goal (1 subgoal):
 1. TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))
[PROOF STEP]
by (auto simp: OTR_nextState_def elim: someI)
[PROOF STATE]
proof (state)
this:
TwoThirds (HOrcvdMsgs OTR_M n p (HOs n p) (rho n)) (the (decide (rho (Suc n) p)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Shuffle_PlusR[simp]: "Shuffle r (Plus s t) = Plus (Shuffle r s) (Shuffle r t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Shuffle r (Plus s t) = Plus (Shuffle r s) (Shuffle r t)
[PROOF STEP]
by (coinduction arbitrary: r s t rule: language_coinduct_upto_Plus)
    (force intro!: Trans[OF Plus[OF Base Base] Refl])


[STATEMENT]
lemma exp_cf4_pos: "exp_cf4 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp_cf4 x
[PROOF STEP]
unfolding exp_cf4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < numer_cf4 x / numer_cf4 (- x)
[PROOF STEP]
by (auto simp add: divide_simps numer_cf4_pos)


[STATEMENT]
lemma ket_injective[simp]: \<open>ket i = ket j \<longleftrightarrow> i = j\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ket i = ket j) = (i = j)
[PROOF STEP]
by (metis cinner_ket one_neq_zero)


[STATEMENT]
lemma justified_sum:
  assumes "\<forall>p\<in>P. justified (f p) (g p)"
    and   "\<forall>p\<in>P. \<forall>t. 0 \<le> zcount (f p) t"
  shows   "justified (\<Sum>p\<in>P. f p) (\<Sum>p\<in>P. g p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. justified (sum f P) (sum g P)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>P. justified (f p) (g p)
\<forall>p\<in>P. \<forall>t. 0 \<le> zcount (f p) t

goal (1 subgoal):
 1. justified (sum f P) (sum g P)
[PROOF STEP]
by (induct P rule: infinite_finite_induct)
    (auto intro!: justified_add sum_nonneg simp: zcount_sum)


[STATEMENT]
lemma winding_number_comp_linear:
  assumes "c\<noteq>0" "valid_path \<gamma>" and not_image: "(z-b)/c \<notin> path_image \<gamma>"
  shows "winding_number ((\<lambda>x. c*x+b) \<circ> \<gamma>) z = winding_number \<gamma> ((z-b)/c)" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
define cc where "cc=1 / (complex_of_real (2 * pi) * \<i>)"
[PROOF STATE]
proof (state)
this:
cc = 1 / (complex_of_real (2 * pi) * \<i>)

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
define zz where "zz=(z-b)/c"
[PROOF STATE]
proof (state)
this:
zz = (z - b) / c

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
have "?L = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
apply (subst winding_number_comp[of UNIV,simplified])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (\<lambda>x. c * x + b) holomorphic_on UNIV
 2. valid_path \<gamma>
 3. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
 4. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * x + b) holomorphic_on UNIV
[PROOF STEP]
by (auto intro:holomorphic_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. valid_path \<gamma>
 2. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
 3. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
using \<open>valid_path \<gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path \<gamma>

goal (1 subgoal):
 1. valid_path \<gamma>
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
 2. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
[PROOF STEP]
using not_image \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
(z - b) / c \<notin> path_image \<gamma>
c \<noteq> 0

goal (1 subgoal):
 1. z \<notin> path_image ((\<lambda>x. c * x + b) \<circ> \<gamma>)
[PROOF STEP]
unfolding path_image_compose
[PROOF STATE]
proof (prove)
using this:
(z - b) / c \<notin> path_image \<gamma>
c \<noteq> 0

goal (1 subgoal):
 1. z \<notin> (\<lambda>x. c * x + b) ` path_image \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
unfolding cc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) / (2 * complex_of_real pi * \<i>) = 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
have "\<dots> = cc * contour_integral \<gamma> (\<lambda>w.1 / (w - zz))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
have "deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)
[PROOF STEP]
by (auto intro:derivative_intros)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)

goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)

goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))
[PROOF STEP]
unfolding zz_def cc_def
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)

goal (1 subgoal):
 1. 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. 1 / (w - (z - b) / c))
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. c * x + b) = (\<lambda>x. c)
c \<noteq> 0

goal (1 subgoal):
 1. 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = 1 / (complex_of_real (2 * pi) * \<i>) * contour_integral \<gamma> (\<lambda>w. 1 / (w - (z - b) / c))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. deriv (\<lambda>x. c * x + b) w / (c * w + b - z)) = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
have "\<dots> = winding_number \<gamma> zz"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz)) = winding_number \<gamma> zz
[PROOF STEP]
using winding_number_valid_path[OF \<open>valid_path \<gamma>\<close> not_image,folded zz_def cc_def]
[PROOF STATE]
proof (prove)
using this:
winding_number \<gamma> zz = cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz))

goal (1 subgoal):
 1. cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz)) = winding_number \<gamma> zz
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cc * contour_integral \<gamma> (\<lambda>w. 1 / (w - zz)) = winding_number \<gamma> zz

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> ((z - b) / c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz
[PROOF STEP]
show "winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz"
[PROOF STATE]
proof (prove)
using this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz

goal (1 subgoal):
 1. winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
winding_number ((\<lambda>x. c * x + b) \<circ> \<gamma>) z = winding_number \<gamma> zz

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma join_expansion:
    assumes "t \<frown> u"
    shows "t \<squnion> u = t \<cdot> (u \\ t)" and "seq t (u \\ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<squnion> u = t \<cdot> u \ t &&& seq t (u \ t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t \<squnion> u = t \<cdot> u \ t
 2. seq t (u \ t)
[PROOF STEP]
show "t \<squnion> u = t \<cdot> (u \\ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<squnion> u = t \<cdot> u \ t
[PROOF STEP]
by (metis assms comp_is_composite_of(2) has_joins join_is_join_of join_of_def)
[PROOF STATE]
proof (state)
this:
t \<squnion> u = t \<cdot> u \ t

goal (1 subgoal):
 1. seq t (u \ t)
[PROOF STEP]
thus "seq t (u \\ t)"
[PROOF STATE]
proof (prove)
using this:
t \<squnion> u = t \<cdot> u \ t

goal (1 subgoal):
 1. seq t (u \ t)
[PROOF STEP]
by (meson assms composable_def composable_iff_seq has_joins join_is_join_of join_of_def)
[PROOF STATE]
proof (state)
this:
seq t (u \ t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powreal_not_zero: "a > 0 \<Longrightarrow> a pow\<^sub>\<real> x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> a pow\<^sub>\<real> x \<noteq> 0
[PROOF STEP]
by (metis order_less_imp_not_eq powreal_gt_zero)


[STATEMENT]
lemma numeral_less_real_of_nat_iff [simp]: "numeral w < real n \<longleftrightarrow> numeral w < n"
  for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral w < real n) = (numeral w < n)
[PROOF STEP]
by (metis of_nat_less_iff of_nat_numeral)


[STATEMENT]
lemma multiplicity_aprimedivisor_gt_0_nat [simp]:
  "d > Suc 0 \<Longrightarrow> multiplicity (aprimedivisor d) d > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < d \<Longrightarrow> 0 < multiplicity (aprimedivisor d) d
[PROOF STEP]
by (subst multiplicity_gt_zero_iff) (auto intro: aprimedivisor_dvd')


[STATEMENT]
lemma fps_shift_add:
  "fps_shift n (f + g) = fps_shift n f + fps_shift n g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_shift n (f + g) = fps_shift n f + fps_shift n g
[PROOF STEP]
by (simp add: fps_eq_iff)


[STATEMENT]
lemma tranclp_eq_rtranclp [iff]:
  "(\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ = P\<^sup>*\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ = P\<^sup>*\<^sup>*
[PROOF STEP]
proof (intro ext iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa \<Longrightarrow> P\<^sup>*\<^sup>* x xa
 2. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa \<Longrightarrow> P\<^sup>*\<^sup>* x xa
 2. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
have "(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y
[PROOF STEP]
by (rule mono_rtranclp) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y

goal (2 subgoals):
 1. \<And>x xa. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa \<Longrightarrow> P\<^sup>*\<^sup>* x xa
 2. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
thus "(\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y
[PROOF STEP]
using tranclp_into_rtranclp
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>*\<^sup>* x y \<longrightarrow> P\<^sup>=\<^sup>=\<^sup>*\<^sup>* x y
?r\<^sup>+\<^sup>+ ?a ?b \<Longrightarrow> ?r\<^sup>*\<^sup>* ?a ?b

goal (1 subgoal):
 1. (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y \<Longrightarrow> P\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. \<And>x xa. P\<^sup>*\<^sup>* x xa \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x xa
[PROOF STEP]
show "P\<^sup>*\<^sup>* x y \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P\<^sup>*\<^sup>* x y \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y
[PROOF STEP]
by (metis (mono_tags, lifting) mono_rtranclp rtranclpD tranclp.r_into_trancl)
[PROOF STATE]
proof (state)
this:
P\<^sup>*\<^sup>* x y \<Longrightarrow> (\<lambda>x y. P x y \<or> x = y)\<^sup>+\<^sup>+ x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma independent_injective_image: "m1.independent s \<Longrightarrow> inj_on f (m1.span s) \<Longrightarrow> m2.independent (f ` s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m1.independent s; inj_on f (m1.span s)\<rbrakk> \<Longrightarrow> m2.independent (f ` s)
[PROOF STEP]
using dependent_inj_imageD[of s]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>m2.dependent (f ` s); inj_on f (m1.span s)\<rbrakk> \<Longrightarrow> m1.dependent s

goal (1 subgoal):
 1. \<lbrakk>m1.independent s; inj_on f (m1.span s)\<rbrakk> \<Longrightarrow> m2.independent (f ` s)
[PROOF STEP]
by auto


[STATEMENT]
lemma col_cong2_bet1:
  assumes "Col A B D" and
    "Bet A C B" and
    "Cong A B C D" and
    "Cong A C B D"
  shows "Bet C B D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bet C B D
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) assms(4) bet__le1213 bet_cong_eq between_symmetry col_cong_bet cong__le cong_left_commutativity l5_12_b l5_6 outer_transitivity_between2)


[STATEMENT]
lemma properfactor_lless:
  fixes G (structure)
  shows "properfactor G = lless (division_rel G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. properfactor G = (\<sqsubset>\<^bsub>division_rel G\<^esub>)
[PROOF STEP]
by (force simp: lless_def properfactor_def associated_def)


[STATEMENT]
lemma constants_are_not_variables :
  assumes "is_a_constant x"
  shows "\<not> (is_a_variable x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_a_variable x
[PROOF STEP]
by (metis assms is_a_constant.elims(2) is_a_variable.elims(2) trm.distinct(2))


[STATEMENT]
theorem while_rule_lemma:
  assumes invariant: "!!s. P s ==> b s ==> P (c s)"
    and terminate: "!!s. P s ==> \<not> b s ==> Q s"
    and wf: "wf {(t, s). P s \<and> b s \<and> t = c s}"
  shows "P s \<Longrightarrow> Q (while b c s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P s \<Longrightarrow> Q (while b c s)
[PROOF STEP]
using wf
[PROOF STATE]
proof (prove)
using this:
wf {(t, s). P s \<and> b s \<and> t = c s}

goal (1 subgoal):
 1. P s \<Longrightarrow> Q (while b c s)
[PROOF STEP]
apply (induct s)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>y. \<lbrakk>(y, x) \<in> {(t, s). P s \<and> b s \<and> t = c s}; P y\<rbrakk> \<Longrightarrow> Q (while b c y); P x\<rbrakk> \<Longrightarrow> Q (while b c x)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<lbrakk>b x; P (c x)\<rbrakk> \<Longrightarrow> Q (while b c (c x)); P x\<rbrakk> \<Longrightarrow> Q (while b c x)
[PROOF STEP]
apply (subst while_unfold)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<lbrakk>b x; P (c x)\<rbrakk> \<Longrightarrow> Q (while b c (c x)); P x\<rbrakk> \<Longrightarrow> Q (if b x then while b c (c x) else x)
[PROOF STEP]
apply (simp add: invariant terminate)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pj_mem:"\<lbrakk>Ring R; ideal R I; x \<in> carrier R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (frule Ring.ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:aGroup.ag_carrier_carrier [THEN sym])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier (b_ag R); aGroup R\<rbrakk> \<Longrightarrow> pj R I x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:pj_def Pj_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; x \<in> carrier (b_ag R); aGroup R\<rbrakk> \<Longrightarrow> I \<bullet>\<^bsub>b_ag R\<^esub> x = x \<uplus>\<^bsub>R\<^esub> I
[PROOF STEP]
apply (simp add:ar_coset_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_connected_space_path_component_set:
   "path_connected_space X \<longleftrightarrow> (\<forall>x \<in> topspace X. Collect(path_component_of X x) = topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space X = (\<forall>x\<in>topspace X. path_component_of_set X x = topspace X)
[PROOF STEP]
using path_component_of_subset_topspace path_connected_space_iff_path_component
[PROOF STATE]
proof (prove)
using this:
path_component_of_set ?X ?x \<subseteq> topspace ?X
path_connected_space ?X = (\<forall>x\<in>topspace ?X. \<forall>y\<in>topspace ?X. path_component_of ?X x y)

goal (1 subgoal):
 1. path_connected_space X = (\<forall>x\<in>topspace X. path_component_of_set X x = topspace X)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma distinct_roots_of_real_poly: "distinct (roots_of_real_poly p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (roots_of_real_poly p)
[PROOF STEP]
unfolding roots_of_real_poly_def roots_of_real_rf_polys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (if p = 0 then [] else concat (map roots_of_real_rf_poly (polys_rf (yun_polys p))))
[PROOF STEP]
using roots_of_rf_yun_polys_distinct[of roots_of_real_rf_poly p, OF roots_of_real_rf_poly]
[PROOF STATE]
proof (prove)
using this:
distinct (concat (map roots_of_real_rf_poly (polys_rf (yun_polys p))))

goal (1 subgoal):
 1. distinct (if p = 0 then [] else concat (map roots_of_real_rf_poly (polys_rf (yun_polys p))))
[PROOF STEP]
by auto


[STATEMENT]
lemma prob_space_eP: "x \<in> space (PiM {0..<n} M) \<Longrightarrow> prob_space (eP n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space (Pi\<^sub>M {0..<n} M) \<Longrightarrow> prob_space (eP n x)
[PROOF STEP]
unfolding eP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space (Pi\<^sub>M {0..<n} M) \<Longrightarrow> prob_space (distr (P n x) (Pi\<^sub>M {0..<Suc n} M) (fun_upd x n))
[PROOF STEP]
by (intro prob_space.prob_space_distr prob_space_P measurable_fun_upd[where J="{0..<n}"]) auto


[STATEMENT]
lemma nonempty_connected_components_of:
   "C \<in> connected_components_of X \<Longrightarrow> C \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<in> connected_components_of X \<Longrightarrow> C \<noteq> {}
[PROOF STEP]
unfolding connected_components_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<in> connected_component_of_set X ` topspace X \<Longrightarrow> C \<noteq> {}
[PROOF STEP]
by (metis (no_types, lifting) connected_component_of_eq_empty imageE)


[STATEMENT]
lemma tensor_op_nonzero:
  fixes a :: \<open>'a::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L 'c::finite ell2\<close> and b :: \<open>'b::finite ell2 \<Rightarrow>\<^sub>C\<^sub>L 'd::finite ell2\<close>
  assumes \<open>a \<noteq> 0\<close> and \<open>b \<noteq> 0\<close>
  shows \<open>a \<otimes>\<^sub>o b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
from \<open>a \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
obtain i where i: \<open>a *\<^sub>V ket i \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (\<And>i. a *\<^sub>V ket i \<noteq> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis cblinfun.zero_left equal_ket)
[PROOF STATE]
proof (state)
this:
a *\<^sub>V ket i \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
from \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> 0
[PROOF STEP]
obtain j where j: \<open>b *\<^sub>V ket j \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0

goal (1 subgoal):
 1. (\<And>j. b *\<^sub>V ket j \<noteq> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis cblinfun.zero_left equal_ket)
[PROOF STATE]
proof (state)
this:
b *\<^sub>V ket j \<noteq> 0

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
from i j
[PROOF STATE]
proof (chain)
picking this:
a *\<^sub>V ket i \<noteq> 0
b *\<^sub>V ket j \<noteq> 0
[PROOF STEP]
have ijneq0: \<open>(a *\<^sub>V ket i) \<otimes>\<^sub>s (b *\<^sub>V ket j) \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a *\<^sub>V ket i \<noteq> 0
b *\<^sub>V ket j \<noteq> 0

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

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
have \<open>(a *\<^sub>V ket i) \<otimes>\<^sub>s (b *\<^sub>V ket j) = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i,j)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)
[PROOF STEP]
by (simp add: tensor_op_ket)
[PROOF STATE]
proof (state)
this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)

goal (1 subgoal):
 1. a \<otimes>\<^sub>o b \<noteq> 0
[PROOF STEP]
with ijneq0
[PROOF STATE]
proof (chain)
picking this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j \<noteq> 0
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)
[PROOF STEP]
show \<open>a \<otimes>\<^sub>o b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j \<noteq> 0
(a *\<^sub>V ket i) \<otimes>\<^sub>s b *\<^sub>V ket j = (a \<otimes>\<^sub>o b) *\<^sub>V ket (i, j)

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

goal:
No subgoals!
[PROOF STEP]
qed