[STATEMENT]
lemma lax_aux:
  fixes X :: "'a::quantale set"
  assumes "\<forall>x.\<forall>y \<in> X. x \<rightarrow> y \<in> X"
  and "\<forall>x. \<forall>y \<in> X. y \<leftarrow> x \<in> X"
shows "\<Sqinter>{z \<in> X. x \<le> z} \<cdot> \<Sqinter>{z \<in> X. y \<le> z} \<le> \<Sqinter>{z \<in> X. x \<cdot> y \<le> z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
let ?\<phi> = "\<lambda>x. \<Sqinter>{w \<in> X. x \<le> w}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
assume a: "x \<cdot> y \<le> z"
  and b: "z \<in> X"
[PROOF STATE]
proof (state)
this:
x \<cdot> y \<le> z
z \<in> X

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
hence c: "x \<le> z \<leftarrow> y"
[PROOF STATE]
proof (prove)
using this:
x \<cdot> y \<le> z
z \<in> X

goal (1 subgoal):
 1. x \<le> z \<leftarrow> y
[PROOF STEP]
by (simp add: fres_galois)
[PROOF STATE]
proof (state)
this:
x \<le> z \<leftarrow> y

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
hence "z \<leftarrow> y \<in> X"
[PROOF STATE]
proof (prove)
using this:
x \<le> z \<leftarrow> y

goal (1 subgoal):
 1. z \<leftarrow> y \<in> X
[PROOF STEP]
by (simp add: assms(2) b)
[PROOF STATE]
proof (state)
this:
z \<leftarrow> y \<in> X

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
hence "?\<phi> x \<le> z \<leftarrow> y"
[PROOF STATE]
proof (prove)
using this:
z \<leftarrow> y \<in> X

goal (1 subgoal):
 1. \<Sqinter> {w \<in> X. x \<le> w} \<le> z \<leftarrow> y
[PROOF STEP]
by (simp add: Inf_lower c)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {w \<in> X. x \<le> w} \<le> z \<leftarrow> y

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
hence d: "y \<le> ?\<phi> x \<rightarrow> z"
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> {w \<in> X. x \<le> w} \<le> z \<leftarrow> y

goal (1 subgoal):
 1. y \<le> \<Sqinter> {w \<in> X. x \<le> w} \<rightarrow> z
[PROOF STEP]
by (simp add: bres_galois_imp fres_galois)
[PROOF STATE]
proof (state)
this:
y \<le> \<Sqinter> {w \<in> X. x \<le> w} \<rightarrow> z

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
hence "?\<phi> x  \<rightarrow> z \<in> X"
[PROOF STATE]
proof (prove)
using this:
y \<le> \<Sqinter> {w \<in> X. x \<le> w} \<rightarrow> z

goal (1 subgoal):
 1. \<Sqinter> {w \<in> X. x \<le> w} \<rightarrow> z \<in> X
[PROOF STEP]
by (simp add: assms(1) b)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {w \<in> X. x \<le> w} \<rightarrow> z \<in> X

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
hence "?\<phi> x \<cdot> ?\<phi> y \<le> z"
[PROOF STATE]
proof (prove)
using this:
\<Sqinter> {w \<in> X. x \<le> w} \<rightarrow> z \<in> X

goal (1 subgoal):
 1. \<Sqinter> {w \<in> X. x \<le> w} \<cdot> \<Sqinter> {w \<in> X. y \<le> w} \<le> z
[PROOF STEP]
by (simp add: Inf_lower d bres_galois)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {w \<in> X. x \<le> w} \<cdot> \<Sqinter> {w \<in> X. y \<le> w} \<le> z

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<cdot> y \<le> ?z2; ?z2 \<in> X\<rbrakk> \<Longrightarrow> \<Sqinter> {w \<in> X. x \<le> w} \<cdot> \<Sqinter> {w \<in> X. y \<le> w} \<le> ?z2

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<cdot> y \<le> ?z2; ?z2 \<in> X\<rbrakk> \<Longrightarrow> \<Sqinter> {w \<in> X. x \<le> w} \<cdot> \<Sqinter> {w \<in> X. y \<le> w} \<le> ?z2

goal (1 subgoal):
 1. \<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}
[PROOF STEP]
by (simp add: le_Inf_iff)
[PROOF STATE]
proof (state)
this:
\<Sqinter> {z \<in> X. x \<le> z} \<cdot> \<Sqinter> {z \<in> X. y \<le> z} \<le> \<Sqinter> {z \<in> X. x \<cdot> y \<le> z}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sym_eq[simp]: "x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x \<sim> y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x \<sim> y) = (x = y)
[PROOF STEP]
by (auto simp: refl dest: antisym)


[STATEMENT]
lemma fin_incidence_mat_elems: "finite (elements_mat (inc_mat_of Vs Bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (elements_mat (inc_mat_of Vs Bs))
[PROOF STEP]
using finite_subset inc_mat_one_zero_elems
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
elements_mat (inc_mat_of ?Vs ?Bs) \<subseteq> {0::?'a, 1::?'a}

goal (1 subgoal):
 1. finite (elements_mat (inc_mat_of Vs Bs))
[PROOF STEP]
by auto


[STATEMENT]
lemma difference_supp:
  fixes xs ys::"tvar list"
  shows "((supp (xs - ys))::tvar set) = supp xs - supp ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (xs - ys) = supp xs - supp ys
[PROOF STEP]
by (induct xs)
   (auto simp add: supp_list_nil supp_list_cons ftv_tvars)


[STATEMENT]
lemma fpairs_vintersection: "fpairs (A \<inter>\<^sub>\<circ> B) = fpairs A \<inter>\<^sub>\<circ> fpairs B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpairs (A \<inter>\<^sub>\<circ> B) = fpairs A \<inter>\<^sub>\<circ> fpairs B
[PROOF STEP]
by auto


[STATEMENT]
lemma eventually_disj_distrib: "(\<diamond>(P \<^bold>\<or> Q)) = (\<diamond>P \<^bold>\<or> \<diamond>Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<diamond>(\<lambda>s. P s \<or> Q s) = (\<lambda>s. (\<diamond>P) s \<or> (\<diamond>Q) s)
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<sigma>. \<exists>i. (P (\<sigma> |\<^sub>s i) \<or> Q (\<sigma> |\<^sub>s i)) \<and> (\<forall>k<i. True)) = (\<lambda>s. (\<exists>i. P (s |\<^sub>s i) \<and> (\<forall>k<i. True)) \<or> (\<exists>i. Q (s |\<^sub>s i) \<and> (\<forall>k<i. True)))
[PROOF STEP]
by auto


[STATEMENT]
lemma in_joinE: "v \<in> join X b Y \<Longrightarrow> table n A X \<Longrightarrow> table n B Y \<Longrightarrow> (\<not> b \<Longrightarrow> B \<subseteq> A) \<Longrightarrow>
  (wf_tuple n (A \<union> B) v \<Longrightarrow> restrict A v \<in> X \<Longrightarrow> if b then restrict B v \<in> Y else restrict B v \<notin> Y \<Longrightarrow> P) \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> join X b Y; table n A X; table n B Y; \<not> b \<Longrightarrow> B \<subseteq> A; \<lbrakk>wf_tuple n (A \<union> B) v; restrict A v \<in> X; if b then restrict B v \<in> Y else restrict B v \<notin> Y\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
unfolding table_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<in> join X b Y; Ball X (wf_tuple n A); Ball Y (wf_tuple n B); \<not> b \<Longrightarrow> B \<subseteq> A; \<lbrakk>wf_tuple n (A \<union> B) v; restrict A v \<in> X; if b then restrict B v \<in> Y else restrict B v \<notin> Y\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (subst (asm) join_restrict) (auto)


[STATEMENT]
lemma Lyndon_mono_nth: "Lyndon_mono ws \<Longrightarrow> i \<le> j \<Longrightarrow> j < \<^bold>|ws\<^bold>| \<Longrightarrow> ws!j \<le>lex ws!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Lyndon_mono ws; i \<le> j; j < \<^bold>|ws\<^bold>|\<rbrakk> \<Longrightarrow> ws ! j \<le>lex ws ! i
[PROOF STEP]
unfolding Lyndon_mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ball (set ws) Lyndon \<and> sorted_wrt lexordp_eq (rev ws); i \<le> j; j < \<^bold>|ws\<^bold>|\<rbrakk> \<Longrightarrow> ws ! j \<le>lex ws ! i
[PROOF STEP]
using  rlex.sorted_rev_nth_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted_wrt (\<le>lex) (rev ?xs); ?i \<le> ?j; ?j < \<^bold>|?xs\<^bold>|\<rbrakk> \<Longrightarrow> ?xs ! ?j \<le>lex ?xs ! ?i

goal (1 subgoal):
 1. \<lbrakk>Ball (set ws) Lyndon \<and> sorted_wrt lexordp_eq (rev ws); i \<le> j; j < \<^bold>|ws\<^bold>|\<rbrakk> \<Longrightarrow> ws ! j \<le>lex ws ! i
[PROOF STEP]
by blast


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

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

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

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

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

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_poly_to_row: "dim_vec (poly_to_row ts p) = length ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (poly_to_row ts p) = length ts
[PROOF STEP]
by (simp add: poly_to_row_def)


[STATEMENT]
lemma isSome_eq:
  "isSome x \<longleftrightarrow> (\<exists>y. x = Some y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isSome x = (\<exists>y. x = Some y)
[PROOF STEP]
unfolding isSome_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case x of None \<Rightarrow> False | Some x \<Rightarrow> True) = (\<exists>y. x = Some y)
[PROOF STEP]
by (auto split: option.split)


[STATEMENT]
lemma funpow_prop:
    assumes "\<And>x. P (f x) \<longleftrightarrow> P x"
    shows "P ((f ^^ n) x) \<longleftrightarrow> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((f ^^ n) x) = P x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P (f ?x2) = P ?x2

goal (1 subgoal):
 1. P ((f ^^ n) x) = P x
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma ffield_vunion[simp]: "ffield (r \<union>\<^sub>\<circ> s) = ffield r \<union>\<^sub>\<circ> ffield s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<F>\<^sub>\<bullet> (r \<union>\<^sub>\<circ> s) = \<F>\<^sub>\<bullet> r \<union>\<^sub>\<circ> \<F>\<^sub>\<bullet> s
[PROOF STEP]
unfolding ffield_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<bullet> (r \<union>\<^sub>\<circ> s) \<union>\<^sub>\<circ> \<R>\<^sub>\<bullet> (r \<union>\<^sub>\<circ> s) = \<D>\<^sub>\<bullet> r \<union>\<^sub>\<circ> \<R>\<^sub>\<bullet> r \<union>\<^sub>\<circ> (\<D>\<^sub>\<bullet> s \<union>\<^sub>\<circ> \<R>\<^sub>\<bullet> s)
[PROOF STEP]
by auto


[STATEMENT]
lemma pivot_positions: assumes A: "A \<in> carrier_mat nr nc"
  and pivot: "pivot_fun A f nc"
  shows
    "set (pivot_positions A) = {(i, f i) | i. i < nr \<and> f i \<noteq> nc}"
    "distinct (map fst (pivot_positions A))"
    "distinct (map snd (pivot_positions A))"
    "length (pivot_positions A) = card { i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc} &&& distinct (map fst (pivot_positions A))) &&& distinct (map snd (pivot_positions A)) &&& length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc}
 2. distinct (map fst (pivot_positions A))
 3. distinct (map snd (pivot_positions A))
 4. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat nr nc
[PROOF STEP]
have dim: "dim_row A = nr"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. dim_row A = nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row A = nr

goal (4 subgoals):
 1. set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc}
 2. distinct (map fst (pivot_positions A))
 3. distinct (map snd (pivot_positions A))
 4. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
let ?pp = "pivot_positions A"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc}
 2. distinct (map fst (pivot_positions A))
 3. distinct (map snd (pivot_positions A))
 4. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
show id: "set ?pp = {(i, f i) | i. i < nr \<and> f i \<noteq> nc}"
    and dist: "distinct (map fst ?pp)"
    and "distinct (map snd ?pp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc} &&& distinct (map fst (pivot_positions A)) &&& distinct (map snd (pivot_positions A))
[PROOF STEP]
using pivot_positions_main[OF A pivot, of 0 0] A
[PROOF STATE]
proof (prove)
using this:
0 \<le> f 0 \<or> nr \<le> 0 \<Longrightarrow> set (pivot_positions_main A nr nc 0 0) = {(i', f i') |i'. 0 \<le> i' \<and> i' < nr} - UNIV \<times> {nc} \<and> distinct (map snd (pivot_positions_main A nr nc 0 0)) \<and> distinct (map fst (pivot_positions_main A nr nc 0 0))
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc} &&& distinct (map fst (pivot_positions A)) &&& distinct (map snd (pivot_positions A))
[PROOF STEP]
unfolding pivot_positions_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> f 0 \<or> nr \<le> 0 \<Longrightarrow> set (pivot_positions_main A nr nc 0 0) = {(i', f i') |i'. 0 \<le> i' \<and> i' < nr} - UNIV \<times> {nc} \<and> distinct (map snd (pivot_positions_main A nr nc 0 0)) \<and> distinct (map fst (pivot_positions_main A nr nc 0 0))
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. set (pivot_positions_main A (dim_row A) (dim_col A) 0 0) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc} &&& distinct (map fst (pivot_positions_main A (dim_row A) (dim_col A) 0 0)) &&& distinct (map snd (pivot_positions_main A (dim_row A) (dim_col A) 0 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (pivot_positions A) = {(i, f i) |i. i < nr \<and> f i \<noteq> nc}
distinct (map fst (pivot_positions A))
distinct (map snd (pivot_positions A))

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
have "length ?pp = length (map fst ?pp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (pivot_positions A) = length (map fst (pivot_positions A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (pivot_positions A) = length (map fst (pivot_positions A))

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (pivot_positions A) = length (map fst (pivot_positions A))

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
have "\<dots> = card (fst ` set ?pp)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map fst (pivot_positions A)) = card (fst ` set (pivot_positions A))
[PROOF STEP]
using distinct_card[OF dist]
[PROOF STATE]
proof (prove)
using this:
card (set (map fst (pivot_positions A))) = length (map fst (pivot_positions A))

goal (1 subgoal):
 1. length (map fst (pivot_positions A)) = card (fst ` set (pivot_positions A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (map fst (pivot_positions A)) = card (fst ` set (pivot_positions A))

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (map fst (pivot_positions A)) = card (fst ` set (pivot_positions A))

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
have "fst ` set ?pp = { i. i < nr \<and> f i \<noteq> nc}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set (pivot_positions A) = {i. i < nr \<and> f i \<noteq> nc}
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` {(i, f i) |i. i < nr \<and> f i \<noteq> nc} = {i. i < nr \<and> f i \<noteq> nc}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
fst ` set (pivot_positions A) = {i. i < nr \<and> f i \<noteq> nc}

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fst ` set (pivot_positions A) = {i. i < nr \<and> f i \<noteq> nc}

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
have "\<dots> = { i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < nr \<and> f i \<noteq> nc} = {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
using pivot_fun_zero_row_iff[OF pivot A]
[PROOF STATE]
proof (prove)
using this:
?i < nr \<Longrightarrow> (f ?i = nc) = (row A ?i = 0\<^sub>v nc)

goal (1 subgoal):
 1. {i. i < nr \<and> f i \<noteq> nc} = {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < nr \<and> f i \<noteq> nc} = {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
show "length ?pp = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}"
[PROOF STATE]
proof (prove)
using this:
length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}

goal (1 subgoal):
 1. length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
length (pivot_positions A) = card {i. i < nr \<and> row A i \<noteq> 0\<^sub>v nc}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIM_unique: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> f \<midarrow>a\<rightarrow> M \<Longrightarrow> L = M"
  for a :: "'a::perfect_space" and L M :: "'b::t2_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> L; f \<midarrow>a\<rightarrow> M\<rbrakk> \<Longrightarrow> L = M
[PROOF STEP]
using at_neq_bot
[PROOF STATE]
proof (prove)
using this:
at ?a \<noteq> bot

goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> L; f \<midarrow>a\<rightarrow> M\<rbrakk> \<Longrightarrow> L = M
[PROOF STEP]
by (rule tendsto_unique)


[STATEMENT]
lemma rep_list_mult_scalar: "rep_list (c \<odot> r) = c * rep_list r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rep_list (c \<odot> r) = c * rep_list r
[PROOF STEP]
by (simp add: rep_list_def vectorize_mult_scalar pm_of_idx_pm_monom_mult punit.rep_mult_scalar[simplified])


[STATEMENT]
theorem T5: "\<turnstile> \<box>[[P]_w]_v \<longrightarrow> \<box>[[P]_v]_w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w
[PROOF STEP]
have "|~ [[P]_w]_v \<longrightarrow> [[P]_v]_w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ _actrans (_actrans P w) v \<longrightarrow> _actrans (_actrans P v) w
[PROOF STEP]
by (auto simp: actrans_def)
[PROOF STATE]
proof (state)
this:
|~ _actrans (_actrans P w) v \<longrightarrow> _actrans (_actrans P v) w

goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w
[PROOF STEP]
hence "\<turnstile> \<box>[[[P]_w]_v]_w \<longrightarrow> \<box>[[[P]_v]_w]_w"
[PROOF STATE]
proof (prove)
using this:
|~ _actrans (_actrans P w) v \<longrightarrow> _actrans (_actrans P v) w

goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans (_actrans P w) v]_w \<longrightarrow> \<box>[_actrans (_actrans P v) w]_w
[PROOF STEP]
by (rule M2)
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>[_actrans (_actrans P w) v]_w \<longrightarrow> \<box>[_actrans (_actrans P v) w]_w

goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w
[PROOF STEP]
with T4
[PROOF STATE]
proof (chain)
picking this:
\<turnstile> \<box>[?P]_?v \<longrightarrow> \<box>[_actrans ?P ?v]_?w
\<turnstile> \<box>[_actrans (_actrans P w) v]_w \<longrightarrow> \<box>[_actrans (_actrans P v) w]_w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>[?P]_?v \<longrightarrow> \<box>[_actrans ?P ?v]_?w
\<turnstile> \<box>[_actrans (_actrans P w) v]_w \<longrightarrow> \<box>[_actrans (_actrans P v) w]_w

goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w
[PROOF STEP]
unfolding T3[int_rewrite]
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>[?P]_?v \<longrightarrow> \<box>[_actrans ?P ?v]_?w
\<turnstile> \<box>[_actrans (_actrans P w) v]_w \<longrightarrow> \<box>[_actrans P v]_w

goal (1 subgoal):
 1. \<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w
[PROOF STEP]
by (rule lift_imp_trans)
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>[_actrans P w]_v \<longrightarrow> \<box>[_actrans P v]_w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_bheight_rbt_baliR: "bheight l = bheight r \<Longrightarrow> bheight (rbt_baliR l a b r) = Suc (bheight l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bheight l = bheight r \<Longrightarrow> bheight (rbt_baliR l a b r) = Suc (bheight l)
[PROOF STEP]
by (induct l a b r rule: rbt_baliR.induct) auto


[STATEMENT]
lemma ord_option_compp: "ord_option (A OO B) = ord_option A OO ord_option B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_option (A OO B) = ord_option A OO ord_option B
[PROOF STEP]
by(auto simp add: fun_eq_iff elim!: ord_option.cases intro: ord_option.intros)


[STATEMENT]
lemma field_differentiable_inverse [derivative_intros]:
  assumes "f field_differentiable (at a within S)" "f a \<noteq> 0"
  shows "(\<lambda>z. inverse (f z)) field_differentiable (at a within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. inverse (f z)) field_differentiable at a within S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f field_differentiable at a within S
f a \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>z. inverse (f z)) field_differentiable at a within S
[PROOF STEP]
unfolding field_differentiable_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f'. (f has_field_derivative f') (at a within S)
f a \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>f'. ((\<lambda>z. inverse (f z)) has_field_derivative f') (at a within S)
[PROOF STEP]
by (metis DERIV_inverse_fun)


[STATEMENT]
lemma image_lim_subset_lim_fimage:
  fixes f and S (structure) and T (structure) and fimage
  defines "fimage \<equiv> fimg T f"
  assumes "continuous f S T"
  shows "F \<in> Filters\<^bsub>S\<^esub> \<Longrightarrow> f`(lims F) \<subseteq> lims\<^bsub>T\<^esub> (fimage F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<in> Filters \<Longrightarrow> f ` lims F \<subseteq> lims\<^bsub>T\<^esub> (fimage F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F \<in> Filters \<Longrightarrow> f ` lims F \<subseteq> lims\<^bsub>T\<^esub> (fimage F)
[PROOF STEP]
interpret continuous f S T fimage
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous f S T &&& fimage \<equiv> fimg T f
[PROOF STEP]
by fact fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F \<in> Filters \<Longrightarrow> f ` lims F \<subseteq> lims\<^bsub>T\<^esub> (fimage F)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` lims F \<subseteq> lims\<^bsub>T\<^esub> (fimage F)
[PROOF STEP]
by (auto simp: limites_def intro: fimage_converges)
[PROOF STATE]
proof (state)
this:
f ` lims F \<subseteq> lims\<^bsub>T\<^esub> (fimage F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_space_eq_not_separated:
     "connected_space X \<longleftrightarrow>
      (\<nexists>C1 C2. C1 \<union> C2 = topspace X \<and> C1 \<noteq> {} \<and> C2 \<noteq> {} \<and> separatedin X C1 C2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space X = (\<nexists>C1 C2. C1 \<union> C2 = topspace X \<and> C1 \<noteq> {} \<and> C2 \<noteq> {} \<and> separatedin X C1 C2)
[PROOF STEP]
by (simp add: connectedin_eq_not_separated flip: connectedin_topspace)


[STATEMENT]
lemma open_connected_component:
  fixes S :: "'a::real_normed_vector set"
  assumes "open S"
  shows "open (connected_component_set S x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (connected_component_set S x)
[PROOF STEP]
proof (clarsimp simp: open_contains_ball)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. connected_component S x xa \<Longrightarrow> \<exists>e>0. ball xa e \<subseteq> connected_component_set S x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. connected_component S x xa \<Longrightarrow> \<exists>e>0. ball xa e \<subseteq> connected_component_set S x
[PROOF STEP]
assume xy: "connected_component S x y"
[PROOF STATE]
proof (state)
this:
connected_component S x y

goal (1 subgoal):
 1. \<And>xa. connected_component S x xa \<Longrightarrow> \<exists>e>0. ball xa e \<subseteq> connected_component_set S x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
connected_component S x y
[PROOF STEP]
obtain e where "e>0" "ball y e \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
connected_component S x y

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball y e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms connected_component_in openE
[PROOF STATE]
proof (prove)
using this:
connected_component S x y
open S
connected_component ?S ?x ?y \<Longrightarrow> ?x \<in> ?S \<and> ?y \<in> ?S
\<lbrakk>open ?S; ?x \<in> ?S; \<And>e. \<lbrakk>0 < e; ball ?x e \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball y e \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < e
ball y e \<subseteq> S

goal (1 subgoal):
 1. \<And>xa. connected_component S x xa \<Longrightarrow> \<exists>e>0. ball xa e \<subseteq> connected_component_set S x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
ball y e \<subseteq> S
[PROOF STEP]
show "\<exists>e>0. ball y e  \<subseteq> connected_component_set S x"
[PROOF STATE]
proof (prove)
using this:
0 < e
ball y e \<subseteq> S

goal (1 subgoal):
 1. \<exists>e>0. ball y e \<subseteq> connected_component_set S x
[PROOF STEP]
by (metis xy centre_in_ball connected_ball connected_component_eq_eq connected_component_in connected_component_maximal)
[PROOF STATE]
proof (state)
this:
\<exists>e>0. ball y e \<subseteq> connected_component_set S x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma must_wait_mono:
  "(\<And>x. x \<in> A \<longrightarrow> x \<in> B) \<Longrightarrow> must_wait s t lt A \<longrightarrow> must_wait s t lt B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<longrightarrow> x \<in> B) \<Longrightarrow> must_wait s t lt A \<longrightarrow> must_wait s t lt B
[PROOF STEP]
by(auto simp add: must_wait_iff split: sum.split elim: all_final_except_mono')


[STATEMENT]
lemma lit_power [lit_simps]: "\<guillemotleft>x ^ n\<guillemotright> = \<guillemotleft>x\<guillemotright> ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>x ^ n\<guillemotright> = \<guillemotleft>x\<guillemotright> ^ n
[PROOF STEP]
by (simp add: lit.rep_eq power_rep_eq uexpr_eq_iff)


[STATEMENT]
lemma set_fst_sinter_with [simp]:
  "\<lbrakk> sorted (map fst xs); sorted (map fst ys) \<rbrakk>
  \<Longrightarrow> set (map fst (sinter_with f xs ys)) = set (map fst xs) \<inter> set (map fst ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted (map fst xs); sorted (map fst ys)\<rbrakk> \<Longrightarrow> set (map fst (sinter_with f xs ys)) = set (map fst xs) \<inter> set (map fst ys)
[PROOF STEP]
by(induct f xs ys rule: sinter_with.induct)(auto simp del: set_map)


[STATEMENT]
lemma compact_Union [intro]: "finite S \<Longrightarrow> (\<And>T. T \<in> S \<Longrightarrow> compact T) \<Longrightarrow> compact (\<Union>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; \<And>T. T \<in> S \<Longrightarrow> compact T\<rbrakk> \<Longrightarrow> compact (\<Union> S)
[PROOF STEP]
by (induct set: finite) auto


[STATEMENT]
lemma focus_one [simp]: "focus X 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. focus X 1 = 1
[PROOF STEP]
by (simp add: focus_def)


[STATEMENT]
lemma (in linorder_topology) eventually_at_left:
  "y < x \<Longrightarrow> eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
unfolding at_left_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> eventually P (INF a\<in>{..<x}. principal {a<..<x}) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)


[STATEMENT]
lemma wordinterval_empty_set_eq[simp]: "wordinterval_empty r \<longleftrightarrow> wordinterval_to_set r = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_empty r = (wordinterval_to_set r = {})
[PROOF STEP]
by(induction r) auto


[STATEMENT]
lemma continuous_inverse_map:
  assumes "compact_space X" "Hausdorff_space Y"
    and cmf: "continuous_map X Y f" and gf: "\<And>x. x \<in> topspace X \<Longrightarrow> g(f x) = x"
    and Sf:  "S \<subseteq> f ` (topspace X)"
  shows "continuous_map (subtopology Y S) X g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology Y S) X g
[PROOF STEP]
proof (rule continuous_map_from_subtopology_mono [OF _ \<open>S \<subseteq> f ` (topspace X)\<close>])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_map (subtopology Y (f ` topspace X)) X g
[PROOF STEP]
show "continuous_map (subtopology Y (f ` (topspace X))) X g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology Y (f ` topspace X)) X g
[PROOF STEP]
unfolding continuous_map_closedin
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>topspace (subtopology Y (f ` topspace X)). g x \<in> topspace X) \<and> (\<forall>C. closedin X C \<longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C})
[PROOF STEP]
proof (intro conjI ballI allI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> topspace (subtopology Y (f ` topspace X)) \<Longrightarrow> g x \<in> topspace X
 2. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> topspace (subtopology Y (f ` topspace X)) \<Longrightarrow> g x \<in> topspace X
 2. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
assume "x \<in> topspace (subtopology Y (f ` topspace X))"
[PROOF STATE]
proof (state)
this:
x \<in> topspace (subtopology Y (f ` topspace X))

goal (2 subgoals):
 1. \<And>x. x \<in> topspace (subtopology Y (f ` topspace X)) \<Longrightarrow> g x \<in> topspace X
 2. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> topspace (subtopology Y (f ` topspace X))
[PROOF STEP]
show "g x \<in> topspace X"
[PROOF STATE]
proof (prove)
using this:
x \<in> topspace (subtopology Y (f ` topspace X))

goal (1 subgoal):
 1. g x \<in> topspace X
[PROOF STEP]
by (auto simp: gf)
[PROOF STATE]
proof (state)
this:
g x \<in> topspace X

goal (1 subgoal):
 1. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
assume C: "closedin X C"
[PROOF STATE]
proof (state)
this:
closedin X C

goal (1 subgoal):
 1. \<And>C. closedin X C \<Longrightarrow> closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
show "closedin (subtopology Y (f ` topspace X))
           {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
proof (rule compactin_imp_closedin)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Hausdorff_space (subtopology Y (f ` topspace X))
 2. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
show "Hausdorff_space (subtopology Y (f ` topspace X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hausdorff_space (subtopology Y (f ` topspace X))
[PROOF STEP]
using Hausdorff_space_subtopology [OF \<open>Hausdorff_space Y\<close>]
[PROOF STATE]
proof (prove)
using this:
Hausdorff_space (subtopology Y ?S)

goal (1 subgoal):
 1. Hausdorff_space (subtopology Y (f ` topspace X))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Hausdorff_space (subtopology Y (f ` topspace X))

goal (1 subgoal):
 1. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
have "compactin Y (f ` C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compactin Y (f ` C)
[PROOF STEP]
using C cmf image_compactin closedin_compact_space [OF \<open>compact_space X\<close>]
[PROOF STATE]
proof (prove)
using this:
closedin X C
continuous_map X Y f
\<lbrakk>compactin ?X ?S; continuous_map ?X ?Y ?f\<rbrakk> \<Longrightarrow> compactin ?Y (?f ` ?S)
closedin X ?S \<Longrightarrow> compactin X ?S

goal (1 subgoal):
 1. compactin Y (f ` C)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
compactin Y (f ` C)

goal (1 subgoal):
 1. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
compactin Y (f ` C)

goal (1 subgoal):
 1. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
have "{x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C} = f ` C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C} = f ` C
[PROOF STEP]
using closedin_subset [OF C] cmf
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> topspace X
continuous_map X Y f

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

goal (1 subgoal):
 1. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
compactin Y (f ` C)
{x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C} = f ` C
[PROOF STEP]
have "compactin Y {x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C}"
[PROOF STATE]
proof (prove)
using this:
compactin Y (f ` C)
{x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C} = f ` C

goal (1 subgoal):
 1. compactin Y {x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compactin Y {x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C}

goal (1 subgoal):
 1. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compactin Y {x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C}
[PROOF STEP]
show "compactin (subtopology Y (f ` topspace X))
              {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}"
[PROOF STATE]
proof (prove)
using this:
compactin Y {x \<in> topspace Y. x \<in> f ` topspace X \<and> g x \<in> C}

goal (1 subgoal):
 1. compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}
[PROOF STEP]
by (auto simp add: compactin_subtopology)
[PROOF STATE]
proof (state)
this:
compactin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closedin (subtopology Y (f ` topspace X)) {x \<in> topspace (subtopology Y (f ` topspace X)). g x \<in> C}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_map (subtopology Y (f ` topspace X)) X g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fpxs_nth_power_val [simp]:
  fixes f :: "'a :: {comm_semiring_1, semiring_no_zero_divisors} fpxs"
  shows "fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
proof (cases "f \<noteq> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
 2. \<not> f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (2 subgoals):
 1. f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
 2. \<not> f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
proof (induction r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fpxs_nth (f ^ 0) (rat_of_nat 0 * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ 0
 2. \<And>r. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r \<Longrightarrow> fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
case (Suc r)
[PROOF STATE]
proof (state)
this:
fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r

goal (2 subgoals):
 1. fpxs_nth (f ^ 0) (rat_of_nat 0 * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ 0
 2. \<And>r. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r \<Longrightarrow> fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
have "fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) =
          fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0

goal (1 subgoal):
 1. fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r))
[PROOF STEP]
by (simp add: fpxs_nth_mult_val ring_distribs)
[PROOF STATE]
proof (state)
this:
fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r))

goal (2 subgoals):
 1. fpxs_nth (f ^ 0) (rat_of_nat 0 * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ 0
 2. \<And>r. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r \<Longrightarrow> fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r))

goal (2 subgoals):
 1. fpxs_nth (f ^ 0) (rat_of_nat 0 * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ 0
 2. \<And>r. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r \<Longrightarrow> fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
have "\<dots> = fpxs_nth f (fpxs_val f) ^ Suc r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r)) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
using Suc True
[PROOF STATE]
proof (prove)
using this:
fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
f \<noteq> 0

goal (1 subgoal):
 1. fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r)) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
by (subst fpxs_nth_mult_val) auto
[PROOF STATE]
proof (state)
this:
fpxs_nth (f * f ^ r) (fpxs_val f + fpxs_val (f ^ r)) = fpxs_nth f (fpxs_val f) ^ Suc r

goal (2 subgoals):
 1. fpxs_nth (f ^ 0) (rat_of_nat 0 * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ 0
 2. \<And>r. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r \<Longrightarrow> fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r

goal (1 subgoal):
 1. fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fpxs_nth (f ^ Suc r) (rat_of_nat (Suc r) * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ Suc r

goal (1 subgoal):
 1. fpxs_nth (f ^ 0) (rat_of_nat 0 * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ 0
[PROOF STEP]
qed (auto simp: fpxs_nth_1')
[PROOF STATE]
proof (state)
this:
fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r

goal (1 subgoal):
 1. \<not> f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f \<noteq> 0

goal (1 subgoal):
 1. \<not> f \<noteq> 0 \<Longrightarrow> fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f \<noteq> 0

goal (1 subgoal):
 1. fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r
[PROOF STEP]
by (cases r) (auto simp: fpxs_nth_1')
[PROOF STATE]
proof (state)
this:
fpxs_nth (f ^ r) (rat_of_nat r * fpxs_val f) = fpxs_nth f (fpxs_val f) ^ r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma merge_overlap_length:
    "\<exists>s' \<in> set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow>
      length (merge_overlap A ss) = length ss"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A ss) = length ss
[PROOF STEP]
apply(induction ss)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>s'\<in>set []. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A []) = length []
 2. \<And>a ss. \<lbrakk>\<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A ss) = length ss; \<exists>s'\<in>set (a # ss). \<not> disjoint (interval_of A) (interval_of s')\<rbrakk> \<Longrightarrow> length (merge_overlap A (a # ss)) = length (a # ss)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a ss. \<lbrakk>\<exists>s'\<in>set ss. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A ss) = length ss; \<exists>s'\<in>set (a # ss). \<not> disjoint (interval_of A) (interval_of s')\<rbrakk> \<Longrightarrow> length (merge_overlap A (a # ss)) = length (a # ss)
[PROOF STEP]
apply(rename_tac x xs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A xs) = length xs; \<exists>s'\<in>set (x # xs). \<not> disjoint (interval_of A) (interval_of s')\<rbrakk> \<Longrightarrow> length (merge_overlap A (x # xs)) = length (x # xs)
[PROOF STEP]
apply(cases A, rename_tac a b)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A xs) = length xs; \<exists>s'\<in>set (x # xs). \<not> disjoint (interval_of A) (interval_of s'); A = (a, b)\<rbrakk> \<Longrightarrow> length (merge_overlap A (x # xs)) = length (x # xs)
[PROOF STEP]
apply(case_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs a b aa ba. \<lbrakk>\<exists>s'\<in>set xs. \<not> disjoint (interval_of A) (interval_of s') \<Longrightarrow> length (merge_overlap A xs) = length xs; \<exists>s'\<in>set (x # xs). \<not> disjoint (interval_of A) (interval_of s'); A = (a, b); x = (aa, ba)\<rbrakk> \<Longrightarrow> length (merge_overlap A (x # xs)) = length (x # xs)
[PROOF STEP]
apply(simp add: not_disjoint_intervals_def interval_of.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integer_division:
  "PRE (\<lambda>s::nat store. s ''x'' \<ge> 0)
    (''q'' ::= (\<lambda>s. 0));
    (''r'' ::= (\<lambda>s. s ''x''));
    (WHILE (\<lambda>s. s ''y'' \<le> s ''r'') INV (\<lambda>s. s ''x'' = s ''q'' * s ''y'' + s ''r'' \<and> s ''r'' \<ge> 0)
     DO
      (''q'' ::= (\<lambda>s. s ''q'' + 1));
      (''r'' ::= (\<lambda>s. s ''r'' - s ''y''))
      OD)
   POST (\<lambda>s. s ''x'' = s ''q'' * s ''y'' + s ''r'' \<and> s ''r'' \<ge> 0 \<and> s ''r'' < s ''y'')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PRE (\<lambda>s. 0 \<le> s ''x'') (''q'' ::= (\<lambda>s. 0)) ; (''r'' ::= (\<lambda>s. s ''x'')) ; (WHILE (\<lambda>s. s ''y'' \<le> s ''r'') INV (\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'' \<and> 0 \<le> s ''r'') DO (''q'' ::= (\<lambda>s. s ''q'' + 1)) ; (''r'' ::= (\<lambda>s. s ''r'' - s ''y'')) OD) POST (\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'' \<and> 0 \<le> s ''r'' \<and> s ''r'' < s ''y'')
[PROOF STEP]
apply (intro rel_kat.H_seq, subst sH_while_inv, simp_all)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>s. ?P3 s \<longrightarrow> s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r''
 2. PRE (\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'') \<sqinter> (\<lambda>s. s ''y'' \<le> s ''r'') (''q'' ::= (\<lambda>s. Suc (s ''q''))) ; (''r'' ::= (\<lambda>s. s ''r'' - s ''y'')) POST (\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'')
 3. rel_kat.H ?r1 (''r'' ::= (\<lambda>s. s ''x'')) \<lceil>?P3\<rceil>
 4. rel_kat.H \<lceil>\<lambda>s. True\<rceil> (''q'' ::= (\<lambda>s. 0)) ?r1
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. PRE (\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'') \<sqinter> (\<lambda>s. s ''y'' \<le> s ''r'') (''q'' ::= (\<lambda>s. Suc (s ''q''))) ; (''r'' ::= (\<lambda>s. s ''r'' - s ''y'')) POST (\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'')
 2. rel_kat.H ?r1 (''r'' ::= (\<lambda>s. s ''x'')) \<lceil>\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r''\<rceil>
 3. rel_kat.H \<lceil>\<lambda>s. True\<rceil> (''q'' ::= (\<lambda>s. 0)) ?r1
[PROOF STEP]
apply (intro rel_kat.H_seq)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. rel_kat.H ?r23 (''r'' ::= (\<lambda>s. s ''r'' - s ''y'')) \<lceil>\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r''\<rceil>
 2. rel_kat.H \<lceil>(\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r'') \<sqinter> (\<lambda>s. s ''y'' \<le> s ''r'')\<rceil> (''q'' ::= (\<lambda>s. Suc (s ''q''))) ?r23
 3. rel_kat.H ?r1 (''r'' ::= (\<lambda>s. s ''x'')) \<lceil>\<lambda>s. s ''x'' = s ''q'' \<cdot> s ''y'' + s ''r''\<rceil>
 4. rel_kat.H \<lceil>\<lambda>s. True\<rceil> (''q'' ::= (\<lambda>s. 0)) ?r1
[PROOF STEP]
by (subst H_assign, simp_all)+


[STATEMENT]
lemma interior_atLeastAtMost_real [simp]: "interior {a..b} = {a<..<b :: real}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
have "{a..b} = {a..} \<inter> {..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a..b} = {a..} \<inter> {..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a..b} = {a..} \<inter> {..b}

goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{a..b} = {a..} \<inter> {..b}

goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
have "interior \<dots> = {a<..} \<inter> {..<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior ({a..} \<inter> {..b}) = {a<..} \<inter> {..<b}
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
interior ({a..} \<inter> {..b}) = {a<..} \<inter> {..<b}

goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
interior ({a..} \<inter> {..b}) = {a<..} \<inter> {..<b}

goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
have "\<dots> = {a<..<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<..} \<inter> {..<b} = {a<..<b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a<..} \<inter> {..<b} = {a<..<b}

goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
interior {a..b} = {a<..<b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interior {a..b} = {a<..<b}

goal (1 subgoal):
 1. interior {a..b} = {a<..<b}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
interior {a..b} = {a<..<b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_wtn_sets:
  assumes "E\<in> sets M"
  shows "pos_wtn E n \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_wtn E n \<in> sets M
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pos_wtn E 0 \<in> sets M
 2. \<And>n. pos_wtn E n \<in> sets M \<Longrightarrow> pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. pos_wtn E 0 \<in> sets M
 2. \<And>n. pos_wtn E n \<in> sets M \<Longrightarrow> pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_wtn E 0 \<in> sets M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
E \<in> sets M

goal (1 subgoal):
 1. pos_wtn E 0 \<in> sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pos_wtn E 0 \<in> sets M

goal (1 subgoal):
 1. \<And>n. pos_wtn E n \<in> sets M \<Longrightarrow> pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. pos_wtn E n \<in> sets M \<Longrightarrow> pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
pos_wtn E n \<in> sets M

goal (1 subgoal):
 1. \<And>n. pos_wtn E n \<in> sets M \<Longrightarrow> pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pos_wtn E n \<in> sets M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
pos_wtn E n \<in> sets M

goal (1 subgoal):
 1. pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
using pos_wtn_step rep_neg_sets
[PROOF STATE]
proof (prove)
using this:
pos_wtn E n \<in> sets M
pos_wtn ?E (Suc ?n) = pos_wtn ?E ?n - rep_neg (pos_wtn ?E ?n)
rep_neg ?A \<in> sets M

goal (1 subgoal):
 1. pos_wtn E (Suc n) \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pos_wtn E (Suc n) \<in> sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Complex_scale2:
  shows "Complex (a * c) (b * c) = Complex a b * cor c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex (a * c) (b * c) = Complex a b * cor c
[PROOF STEP]
unfolding complex_of_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex (a * c) (b * c) = Complex a b * Complex c 0
[PROOF STEP]
unfolding Complex_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cor (a * c) + \<i> * cor (b * c) = (cor a + \<i> * cor b) * (cor c + \<i> * cor 0)
[PROOF STEP]
by (auto simp add: field_simps)


[STATEMENT]
lemma pp_is_le_rel_canc_right:
  assumes "ordered_powerprod_lin.is_le_rel rel"
  shows "rel (s + u) (t + u) \<longleftrightarrow> rel s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel (s + u) (t + u) = rel s t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ordered_powerprod_lin.is_le_rel rel

goal (1 subgoal):
 1. rel (s + u) (t + u) = rel s t
[PROOF STEP]
by (rule ordered_powerprod_lin.is_le_relE, auto dest: ord_canc ord_strict_canc plus_monotone plus_monotone_strict)


[STATEMENT]
lemma eval_cnf_alt_def: "eval_cnf \<alpha> cnf = Ball (set cnf) (\<lambda> c. Bex (set c) (\<lambda> l. \<alpha> (fst l) = snd l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_cnf \<alpha> cnf = (\<forall>c\<in>set cnf. \<exists>l\<in>set c. \<alpha> (fst l) = snd l)
[PROOF STEP]
unfolding eval_cnf_def formula_of_cnf_def o_def eval.simps set_map Ball_image_comp bex_simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set cnf. \<exists>x\<in>set x. eval \<alpha> (formula_of_lit x)) = (\<forall>c\<in>set cnf. \<exists>l\<in>set c. \<alpha> (fst l) = snd l)
[PROOF STEP]
apply (intro ball_cong bex_cong refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> set cnf; xa \<in> set x\<rbrakk> \<Longrightarrow> eval \<alpha> (formula_of_lit xa) = (\<alpha> (fst xa) = snd xa)
[PROOF STEP]
subgoal for c l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<in> set cnf; l \<in> set c\<rbrakk> \<Longrightarrow> eval \<alpha> (formula_of_lit l) = (\<alpha> (fst l) = snd l)
[PROOF STEP]
by (cases l; cases "snd l", auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIM_unique: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> f \<midarrow>a\<rightarrow> M \<Longrightarrow> L = M"
  for a :: "'a::perfect_space" and L M :: "'b::t2_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> L; f \<midarrow>a\<rightarrow> M\<rbrakk> \<Longrightarrow> L = M
[PROOF STEP]
using at_neq_bot
[PROOF STATE]
proof (prove)
using this:
at ?a \<noteq> bot

goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>a\<rightarrow> L; f \<midarrow>a\<rightarrow> M\<rbrakk> \<Longrightarrow> L = M
[PROOF STEP]
by (rule tendsto_unique)


[STATEMENT]
lemma one_root_a_lt0_var:
  fixes a b c r y'::"real"
  assumes alt: "a < 0"
  assumes beq: "b = 2 * a * r"
  assumes root: " a * r^2 - 2*a*r*r + c = 0"
  shows "\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2*a*r*x + c \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
have h1: "\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow>
     \<exists>y'>-r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a *r * x + c \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
using less_eq_real_def
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)

goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0

goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0

goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
using one_root_a_lt0[of a b r] assms
[PROOF STATE]
proof (prove)
using this:
\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c < 0 \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
\<lbrakk>a < 0; b = 2 * a * r; a * r\<^sup>2 - 2 * a * r * r + ?c = 0\<rbrakk> \<Longrightarrow> \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + ?c < 0
a < 0
b = 2 * a * r
a * r\<^sup>2 - 2 * a * r * r + c = 0

goal (1 subgoal):
 1. \<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y'>- r. \<forall>x\<in>{- r<..y'}. a * x\<^sup>2 + 2 * a * r * x + c \<le> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_rules_concat_map:
    "normalize_rules f rs = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize_rules f rs = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs)
[PROOF STEP]
apply(induction rs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. normalize_rules f [] = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) [])
 2. \<And>a rs. normalize_rules f rs = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs) \<Longrightarrow> normalize_rules f (a # rs) = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) (a # rs))
[PROOF STEP]
apply(simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a rs. normalize_rules f rs = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs) \<Longrightarrow> normalize_rules f (a # rs) = map (\<lambda>m. Rule m (get_action a)) (f (get_match a)) @ concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs)
[PROOF STEP]
apply(rename_tac r rs, case_tac r)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r rs x1 x2. \<lbrakk>normalize_rules f rs = concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs); r = Rule x1 x2\<rbrakk> \<Longrightarrow> normalize_rules f (r # rs) = map (\<lambda>m. Rule m (get_action r)) (f (get_match r)) @ concat (map (\<lambda>r. map (\<lambda>m. Rule m (get_action r)) (f (get_match r))) rs)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rqs_cost_exp_leI: "m \<le> n \<Longrightarrow> rqs_cost_exp m \<le> rqs_cost_exp n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> rqs_cost_exp m \<le> rqs_cost_exp n
[PROOF STEP]
using mono_rqs_cost_exp
[PROOF STATE]
proof (prove)
using this:
incseq rqs_cost_exp

goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> rqs_cost_exp m \<le> rqs_cost_exp n
[PROOF STEP]
by (simp add: mono_def)


[STATEMENT]
lemma is_zero_row_upt_ncols:
  fixes A::"'a::{zero}^'columns::{mod_type}^'rows"
  shows "is_zero_row_upt_k i (ncols A) A = (\<forall>j::'columns. A $ i $ j = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row_upt_k i (ncols A) A = (\<forall>j. A $ i $ j = (0::'a))
[PROOF STEP]
unfolding is_zero_row_def is_zero_row_upt_k_def ncols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j. mod_type_class.to_nat j < CARD('columns) \<longrightarrow> A $ i $ j = (0::'a)) = (\<forall>j. A $ i $ j = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma mod_ring_finite_field_ops_integer: "mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p
[PROOF STEP]
interpret ring_ops "finite_field_ops_integer (integer_of_int p)" mod_ring_rel_integer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_ops (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer
[PROOF STEP]
by (rule ring_finite_field_ops_integer, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p
[PROOF STEP]
have pp: "p = int_of_integer (integer_of_int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = int_of_integer (integer_of_int p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = int_of_integer (integer_of_int p)

goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p
[PROOF STEP]
interpret int: mod_ring_gen "finite_field_ops_int p" mod_ring_rel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_int p) mod_ring_rel p
[PROOF STEP]
by (rule mod_ring_finite_field_ops_int)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p
[PROOF STEP]
by (unfold_locales, rule p, auto simp: finite_field_ops_integer_def
      mod_ring_rel_integer_def[OF pp] urel_integer_def[OF pp] mod_ring_rel_of_int
      int.to_int[symmetric] finite_field_ops_int_def)
[PROOF STATE]
proof (state)
this:
mod_ring_gen (finite_field_ops_integer (integer_of_int p)) mod_ring_rel_integer p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ipcidr_conjunct_correct: "(case ipcidr_conjunct (b1, m1) (b2, m2)
                                          of Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx
                                          |  None \<Rightarrow> {}) =
                                   (ipset_from_cidr b1 m1) \<inter> (ipset_from_cidr b2 m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case ipcidr_conjunct (b1, m1) (b2, m2) of None \<Rightarrow> {} | Some (bx, mx) \<Rightarrow> ipset_from_cidr bx mx) = ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2
[PROOF STEP]
apply(simp split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ipset_from_cidr b1 m1 \<subseteq> ipset_from_cidr b2 m2 \<longrightarrow> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2 \<noteq> {} \<longrightarrow> ipset_from_cidr b1 m1 = ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2) \<and> (\<not> ipset_from_cidr b1 m1 \<subseteq> ipset_from_cidr b2 m2 \<longrightarrow> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2 \<noteq> {} \<longrightarrow> ipset_from_cidr b2 m2 = ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2)
[PROOF STEP]
using ip_cidr_intersect
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> ipset_from_cidr ?b2.0 ?m2.0 \<subseteq> ipset_from_cidr ?b1.0 ?m1.0; \<not> ipset_from_cidr ?b1.0 ?m1.0 \<subseteq> ipset_from_cidr ?b2.0 ?m2.0\<rbrakk> \<Longrightarrow> ipset_from_cidr ?b1.0 ?m1.0 \<inter> ipset_from_cidr ?b2.0 ?m2.0 = {}

goal (1 subgoal):
 1. (ipset_from_cidr b1 m1 \<subseteq> ipset_from_cidr b2 m2 \<longrightarrow> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2 \<noteq> {} \<longrightarrow> ipset_from_cidr b1 m1 = ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2) \<and> (\<not> ipset_from_cidr b1 m1 \<subseteq> ipset_from_cidr b2 m2 \<longrightarrow> ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2 \<noteq> {} \<longrightarrow> ipset_from_cidr b2 m2 = ipset_from_cidr b1 m1 \<inter> ipset_from_cidr b2 m2)
[PROOF STEP]
by fast


[STATEMENT]
lemma foldl_pair_constr: "foldl (\<lambda>s e. map_prod (\<lambda>l. f l e) (\<lambda>_. c) s) (sl, c) l =
   Pair (foldl (\<lambda>s e. f s e) sl l) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>s e. map_prod (\<lambda>l. f l e) (\<lambda>_. c) s) (sl, c) l = (foldl f sl l, c)
[PROOF STEP]
by (induction l arbitrary: sl) (auto simp add: map_prod_def split_def)


[STATEMENT]
lemma cSup_add:
  fixes c::real
  assumes ne: "S \<noteq> {}"
      and bS: "\<And>x. x\<in>S \<Longrightarrow> x \<le> b"
  shows "Sup S + c = Sup {x + c |x. x \<in> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup S + c = Sup {x + c |x. x \<in> S}
[PROOF STEP]
proof(rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sup S + c \<le> Sup {x + c |x. x \<in> S}
 2. Sup {x + c |x. x \<in> S} \<le> Sup S + c
[PROOF STEP]
from ne bS
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
?x \<in> S \<Longrightarrow> ?x \<le> b
[PROOF STEP]
show "Sup {x + c |x. x \<in> S} \<le> Sup S + c"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
?x \<in> S \<Longrightarrow> ?x \<le> b

goal (1 subgoal):
 1. Sup {x + c |x. x \<in> S} \<le> Sup S + c
[PROOF STEP]
by(auto intro!:cSup_least add_right_mono cSup_upper bdd_aboveI)
[PROOF STATE]
proof (state)
this:
Sup {x + c |x. x \<in> S} \<le> Sup S + c

goal (1 subgoal):
 1. Sup S + c \<le> Sup {x + c |x. x \<in> S}
[PROOF STEP]
have "Sup S \<le> Sup {x + c |x. x \<in> S} - c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup S \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
proof(intro cSup_least ne)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
assume xin: "x \<in> S"
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
from bS
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> ?x \<le> b
[PROOF STEP]
have "\<And>x. x\<in>S \<Longrightarrow> x + c \<le> b + c"
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> ?x \<le> b

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x + c \<le> b + c
[PROOF STEP]
by(auto intro:add_right_mono)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> ?x + c \<le> b + c

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
hence "bdd_above {x + c |x. x \<in> S}"
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> ?x + c \<le> b + c

goal (1 subgoal):
 1. bdd_above {x + c |x. x \<in> S}
[PROOF STEP]
by(intro bdd_aboveI, blast)
[PROOF STATE]
proof (state)
this:
bdd_above {x + c |x. x \<in> S}

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
with xin
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
bdd_above {x + c |x. x \<in> S}
[PROOF STEP]
have "x + c \<le> Sup {x + c |x. x \<in> S}"
[PROOF STATE]
proof (prove)
using this:
x \<in> S
bdd_above {x + c |x. x \<in> S}

goal (1 subgoal):
 1. x + c \<le> Sup {x + c |x. x \<in> S}
[PROOF STEP]
by(auto intro:cSup_upper)
[PROOF STATE]
proof (state)
this:
x + c \<le> Sup {x + c |x. x \<in> S}

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
thus "x \<le> Sup {x + c |x. x \<in> S} - c"
[PROOF STATE]
proof (prove)
using this:
x + c \<le> Sup {x + c |x. x \<in> S}

goal (1 subgoal):
 1. x \<le> Sup {x + c |x. x \<in> S} - c
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
x \<le> Sup {x + c |x. x \<in> S} - c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Sup S \<le> Sup {x + c |x. x \<in> S} - c

goal (1 subgoal):
 1. Sup S + c \<le> Sup {x + c |x. x \<in> S}
[PROOF STEP]
thus "Sup S + c \<le> Sup {x + c |x. x \<in> S}"
[PROOF STATE]
proof (prove)
using this:
Sup S \<le> Sup {x + c |x. x \<in> S} - c

goal (1 subgoal):
 1. Sup S + c \<le> Sup {x + c |x. x \<in> S}
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
Sup S + c \<le> Sup {x + c |x. x \<in> S}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder_topology) eventually_at_left:
  "y < x \<Longrightarrow> eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
unfolding at_left_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> eventually P (INF a\<in>{..<x}. principal {a<..<x}) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)


[STATEMENT]
lemma complete_lattice_lattice [simp]:
  assumes "complete_lattice X"
  shows "lattice X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice X
[PROOF STEP]
interpret c: complete_lattice X
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete_lattice X
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice X
[PROOF STEP]
by (unfold_locales)
[PROOF STATE]
proof (state)
this:
lattice X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conj_mono_left: "c\<^sub>0 \<sqsubseteq> c\<^sub>1 \<Longrightarrow> c\<^sub>0 \<iinter> d \<sqsubseteq> c\<^sub>1 \<iinter> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c\<^sub>0 \<sqsubseteq> c\<^sub>1 \<Longrightarrow> c\<^sub>0 \<iinter> d \<sqsubseteq> c\<^sub>1 \<iinter> d
variables:
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c\<^sub>0, c\<^sub>1, d :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: conj_mono)


[STATEMENT]
lemma moebius_ocircline_comp_inv_right [simp]:
  shows "moebius_ocircline M (moebius_ocircline (moebius_inv M) H) = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_ocircline M (moebius_ocircline (moebius_inv M) H) = H
[PROOF STEP]
by (subst moebius_ocircline_comp[symmetric]) simp


[STATEMENT]
lemma preal_add_le_cancel_left [simp]: "(t + (r::preal) \<le> t + s) = (r \<le> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t + r \<le> t + s) = (r \<le> s)
[PROOF STEP]
by (simp add: linorder_not_less [symmetric])


[STATEMENT]
lemma positions_border: "\<forall>j<l. w!j = w!(length w - l + j) \<Longrightarrow> border (take l w) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j<l. w ! j = w ! (length w - l + j) \<Longrightarrow> border (take l w) w
[PROOF STEP]
by (cases "l < length w") (simp_all add: border_def all_positions_suffix_take take_is_prefix)


[STATEMENT]
lemma lexord_same_pref_iff:
  "(xs @ ys, xs @ zs) \<in> lexord r \<longleftrightarrow> (\<exists>x \<in> set xs. (x,x) \<in> r) \<or> (ys, zs) \<in> lexord r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((xs @ ys, xs @ zs) \<in> lexord r) = ((\<exists>x\<in>set xs. (x, x) \<in> r) \<or> (ys, zs) \<in> lexord r)
[PROOF STEP]
by(induction xs) auto


[STATEMENT]
lemma int_of_uint64_mult: "int_of_uint64 (x * y) = (int_of_uint64 x * int_of_uint64 y) mod 18446744073709551616"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_of_uint64 (x * y) = int_of_uint64 x * int_of_uint64 y mod 18446744073709551616
[PROOF STEP]
by (transfer, unfold uint_word_ariths two_64, rule refl)


[STATEMENT]
lemma "(x::real) \<ge> 1 \<and> y \<ge> 1 \<longrightarrow> x * y \<ge> x + y - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> x \<and> 1 \<le> y \<longrightarrow> x + y - 1 \<le> x * y
[PROOF STEP]
by sos


[STATEMENT]
lemma convolution_emeasure':
  assumes [simp]:"A \<in> sets borel"
  assumes [simp]: "finite_measure M" "finite_measure N"
  assumes [simp]: "sets N = sets borel" "sets M = sets borel"
  shows  "emeasure (M \<star> N) A = \<integral>\<^sup>+x. \<integral>\<^sup>+y.  (indicator  A (x + y)) \<partial>N  \<partial>M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (M \<star> N) A = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator A (x + y) \<partial>N \<partial>M
[PROOF STEP]
by (auto simp del: nn_integral_indicator simp: nn_integral_convolution
    nn_integral_indicator[symmetric] borel_measurable_indicator)


[STATEMENT]
lemma max_add_distrib_left: "max y z + x = max (y+x) (z+x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max y z + x = max (y + x) (z + x)
[PROOF STEP]
by (metis add_right_mono max.absorb_iff1 max_def)


[STATEMENT]
lemma array_length_list: "array_length a = length (list_of_array a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. array_length a = length (list_of_array a)
[PROOF STEP]
by (cases a) simp


[STATEMENT]
theorem matrix_equation:
  fixes p:: "real poly"
  fixes qs:: "real poly list"
  fixes subsets:: "nat list list"
  fixes signs:: "rat list list"
  assumes nonzero: "p\<noteq>0"
  assumes distinct_signs: "distinct signs"
  assumes all_info: "set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set(signs)"
  assumes pairwise_rel_prime: "\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))"
  assumes welldefined: "all_list_constr (subsets) (length qs)"
  shows "satisfy_equation p qs subsets signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. satisfy_equation p qs subsets signs
[PROOF STEP]
unfolding satisfy_equation_def matrix_A_def
    construct_lhs_vector_def construct_rhs_vector_def all_list_constr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows_list (length signs) (map (mtx_row signs) subsets) *\<^sub>v vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs) = vec_of_list (map (\<lambda>I. construct_NofI p (retrieve_polys qs I)) subsets)
[PROOF STEP]
apply (subst mult_mat_vec_of_list)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. length (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs) = length signs
 2. list_all (\<lambda>r. length r = length signs) (map (mtx_row signs) subsets)
 3. vec_of_list (map (\<lambda>r. vec_of_list r \<bullet> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs)) (map (mtx_row signs) subsets)) = vec_of_list (map (\<lambda>I. construct_NofI p (retrieve_polys qs I)) subsets)
[PROOF STEP]
apply (auto simp add: mtx_row_length intro!: map_vec_vec_of_list_eq_intro)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set subsets \<Longrightarrow> vec_of_list (mtx_row signs x) \<bullet> map_vec (\<lambda>w. rat_of_nat (length (filter ((\<lambda>v. v = w) \<circ> consistent_sign_vec_copr qs) (characterize_root_list_p p)))) (vec_of_list signs) = construct_NofI p (retrieve_polys qs x)
[PROOF STEP]
using matrix_equation_main_step[OF assms(1-3) _ assms(4), unfolded construct_lhs_vector_def]
[PROOF STATE]
proof (prove)
using this:
list_constr ?I (length qs) \<Longrightarrow> vec_of_list (mtx_row signs ?I) \<bullet> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs) = construct_NofI p (retrieve_polys qs ?I)

goal (1 subgoal):
 1. \<And>x. x \<in> set subsets \<Longrightarrow> vec_of_list (mtx_row signs x) \<bullet> map_vec (\<lambda>w. rat_of_nat (length (filter ((\<lambda>v. v = w) \<circ> consistent_sign_vec_copr qs) (characterize_root_list_p p)))) (vec_of_list signs) = construct_NofI p (retrieve_polys qs x)
[PROOF STEP]
using all_list_constr_def in_set_member welldefined
[PROOF STATE]
proof (prove)
using this:
list_constr ?I (length qs) \<Longrightarrow> vec_of_list (mtx_row signs ?I) \<bullet> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs) = construct_NofI p (retrieve_polys qs ?I)
all_list_constr ?L ?n \<equiv> \<forall>x. List.member ?L x \<longrightarrow> list_constr x ?n
(?x \<in> set ?xs) = List.member ?xs ?x
all_list_constr subsets (length qs)

goal (1 subgoal):
 1. \<And>x. x \<in> set subsets \<Longrightarrow> vec_of_list (mtx_row signs x) \<bullet> map_vec (\<lambda>w. rat_of_nat (length (filter ((\<lambda>v. v = w) \<circ> consistent_sign_vec_copr qs) (characterize_root_list_p p)))) (vec_of_list signs) = construct_NofI p (retrieve_polys qs x)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma R14 [simp]: "pmf (sds R14) b = 0" "pmf (sds R14) d = 0" "pmf (sds R14) c = 1 - pmf (sds R14) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (sds R14) b = 0 &&& pmf (sds R14) d = 0 &&& pmf (sds R14) c = 1 - pmf (sds R14) a
[PROOF STEP]
using R14_R34.strategyproofness(1) R14.support lottery_conditions[OF R14.wf]
[PROOF STATE]
proof (prove)
using this:
pmf (sds R34) d + (pmf (sds R34) b + pmf (sds R34) a) \<le> pmf (sds R14) c + (pmf (sds R14) b + pmf (sds R14) a)
pmf (sds R14) b = 0
0 \<le> pmf (sds R14) a
0 \<le> pmf (sds R14) b
0 \<le> pmf (sds R14) c
0 \<le> pmf (sds R14) d
pmf (sds R14) a + pmf (sds R14) b + pmf (sds R14) c + pmf (sds R14) d = 1

goal (1 subgoal):
 1. pmf (sds R14) b = 0 &&& pmf (sds R14) d = 0 &&& pmf (sds R14) c = 1 - pmf (sds R14) a
[PROOF STEP]
by (auto simp del: pmf_nonneg)


[STATEMENT]
lemma card_convert_triangle_rep:
  fixes G :: "ugraph"
  assumes "X \<subseteq> uverts G" and "Y \<subseteq> uverts G" and "Z \<subseteq> uverts G" and fin: "finite (uverts G)"
and wf: "uwellformed G"
  shows "card (triangle_set G) \<ge> 1/6 * card {(x,y,z) \<in> X \<times> Y \<times> Z . (triangle_in_graph x y z G)}"
         (is  "_ \<ge> 1/6 * card ?TT")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
define tofl where "tofl \<equiv> \<lambda>l::nat list. (hd l, hd(tl l), hd(tl(tl l)))"
[PROOF STATE]
proof (state)
this:
tofl \<equiv> \<lambda>l. (hd l, hd (tl l), hd (tl (tl l)))

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have in_tofl: "(x,y,z) \<in> tofl ` permutations_of_set {x,y,z}" if "x\<noteq>y" "y\<noteq>z" "x\<noteq>z" for x y z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y, z) \<in> tofl ` permutations_of_set {x, y, z}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, y, z) \<in> tofl ` permutations_of_set {x, y, z}
[PROOF STEP]
have "distinct[x,y,z]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct [x, y, z]
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
y \<noteq> z
x \<noteq> z

goal (1 subgoal):
 1. distinct [x, y, z]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
distinct [x, y, z]

goal (1 subgoal):
 1. (x, y, z) \<in> tofl ` permutations_of_set {x, y, z}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct [x, y, z]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distinct [x, y, z]

goal (1 subgoal):
 1. (x, y, z) \<in> tofl ` permutations_of_set {x, y, z}
[PROOF STEP]
unfolding tofl_def image_iff
[PROOF STATE]
proof (prove)
using this:
distinct [x, y, z]

goal (1 subgoal):
 1. \<exists>xa\<in>permutations_of_set {x, y, z}. (x, y, z) = (hd xa, hd (tl xa), hd (tl (tl xa)))
[PROOF STEP]
by (smt (verit, best) list.sel(1) list.sel(3) set_simps permutations_of_setI set_empty)
[PROOF STATE]
proof (state)
this:
(x, y, z) \<in> tofl ` permutations_of_set {x, y, z}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<noteq> ?y; ?y \<noteq> ?z; ?x \<noteq> ?z\<rbrakk> \<Longrightarrow> (?x, ?y, ?z) \<in> tofl ` permutations_of_set {?x, ?y, ?z}

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have "?TT \<subseteq> {(x,y,z). (triangle_in_graph x y z G)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> {(x, y, z). triangle_in_graph x y z G}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> {(x, y, z). triangle_in_graph x y z G}

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> {(x, y, z). triangle_in_graph x y z G}

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have "\<dots> \<subseteq> (\<Union>t \<in> triangle_set G. tofl ` permutations_of_set t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y, z). triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)
[PROOF STEP]
using edge_vertices_not_equal [OF wf] in_tofl
[PROOF STATE]
proof (prove)
using this:
{?x, ?y} \<in> uedges G \<Longrightarrow> ?x \<noteq> ?y
\<lbrakk>?x \<noteq> ?y; ?y \<noteq> ?z; ?x \<noteq> ?z\<rbrakk> \<Longrightarrow> (?x, ?y, ?z) \<in> tofl ` permutations_of_set {?x, ?y, ?z}

goal (1 subgoal):
 1. {(x, y, z). triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)
[PROOF STEP]
by (clarsimp simp add: triangle_set_def triangle_in_graph_def) metis
[PROOF STATE]
proof (state)
this:
{(x, y, z). triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)
[PROOF STEP]
have "?TT \<subseteq> (\<Union>t \<in> triangle_set G. tofl ` permutations_of_set t)"
[PROOF STATE]
proof (prove)
using this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)

goal (1 subgoal):
 1. {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)
[PROOF STEP]
have "card ?TT \<le> card(\<Union>t \<in> triangle_set G. tofl ` permutations_of_set t)"
[PROOF STATE]
proof (prove)
using this:
{(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<subseteq> (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)

goal (1 subgoal):
 1. card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)
[PROOF STEP]
by (intro card_mono finite_UN_I finite_triangle_set) (auto simp: assms)
[PROOF STATE]
proof (state)
this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>t \<in> triangle_set G. card (tofl ` permutations_of_set t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t) \<le> (\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t))
[PROOF STEP]
using card_UN_le fin finite_triangle_set local.wf
[PROOF STATE]
proof (prove)
using this:
finite ?I \<Longrightarrow> card (\<Union> (?A ` ?I)) \<le> (\<Sum>i\<in>?I. card (?A i))
finite (uverts G)
\<lbrakk>finite (uverts ?G); uwellformed ?G\<rbrakk> \<Longrightarrow> finite (triangle_set ?G)
uwellformed G

goal (1 subgoal):
 1. card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t) \<le> (\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t) \<le> (\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t))

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (\<Union>t\<in>triangle_set G. tofl ` permutations_of_set t) \<le> (\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t))

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>t \<in> triangle_set G. card (permutations_of_set t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t)) \<le> (\<Sum>t\<in>triangle_set G. card (permutations_of_set t))
[PROOF STEP]
by (meson card_image_le finite_permutations_of_set sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t)) \<le> (\<Sum>t\<in>triangle_set G. card (permutations_of_set t))

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>triangle_set G. card (tofl ` permutations_of_set t)) \<le> (\<Sum>t\<in>triangle_set G. card (permutations_of_set t))

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have "\<dots> \<le> (\<Sum>t \<in> triangle_set G. fact 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>triangle_set G. card (permutations_of_set t)) \<le> (\<Sum>t\<in>triangle_set G. fact 3)
[PROOF STEP]
by (rule sum_mono) (metis card.infinite card_permutations_of_set card_triangle_3 eq_refl local.wf nat.case numeral_3_eq_3)
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>triangle_set G. card (permutations_of_set t)) \<le> (\<Sum>t\<in>triangle_set G. fact 3)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>triangle_set G. card (permutations_of_set t)) \<le> (\<Sum>t\<in>triangle_set G. fact 3)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
have "\<dots> = 6 * card (triangle_set G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>triangle_set G. fact 3) = 6 * card (triangle_set G)
[PROOF STEP]
by (simp add: eval_nat_numeral)
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>triangle_set G. fact 3) = 6 * card (triangle_set G)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> 6 * card (triangle_set G)
[PROOF STEP]
have "card ?TT \<le> 6 * card (triangle_set G)"
[PROOF STATE]
proof (prove)
using this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> 6 * card (triangle_set G)

goal (1 subgoal):
 1. card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> 6 * card (triangle_set G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> 6 * card (triangle_set G)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> 6 * card (triangle_set G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G} \<le> 6 * card (triangle_set G)

goal (1 subgoal):
 1. 1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
1 / 6 * real (card {(x, y, z). (x, y, z) \<in> X \<times> Y \<times> Z \<and> triangle_in_graph x y z G}) \<le> real (card (triangle_set G))

goal:
No subgoals!
[PROOF STEP]
qed