[STATEMENT]
lemma lower_upper_asymptotic_density_complement:
  "lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
assume "n>(0::nat)"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
have "{..<n} \<inter> UNIV - (UNIV - ({..<n} - (UNIV - A))) = {..<n} \<inter> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<n} \<inter> UNIV - (UNIV - ({..<n} - (UNIV - A))) = {..<n} \<inter> A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{..<n} \<inter> UNIV - (UNIV - ({..<n} - (UNIV - A))) = {..<n} \<inter> A

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{..<n} \<inter> UNIV - (UNIV - ({..<n} - (UNIV - A))) = {..<n} \<inter> A

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
have "{..<n} \<inter> UNIV \<inter> (UNIV - ({..<n} - (UNIV - A))) = (UNIV - A) \<inter> {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<n} \<inter> UNIV \<inter> (UNIV - ({..<n} - (UNIV - A))) = (UNIV - A) \<inter> {..<n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{..<n} \<inter> UNIV \<inter> (UNIV - ({..<n} - (UNIV - A))) = (UNIV - A) \<inter> {..<n}

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{..<n} \<inter> UNIV - (UNIV - ({..<n} - (UNIV - A))) = {..<n} \<inter> A
{..<n} \<inter> UNIV \<inter> (UNIV - ({..<n} - (UNIV - A))) = (UNIV - A) \<inter> {..<n}
[PROOF STEP]
have "card (A \<inter> {..<n}) = n - card((UNIV-A) \<inter> {..<n})"
[PROOF STATE]
proof (prove)
using this:
{..<n} \<inter> UNIV - (UNIV - ({..<n} - (UNIV - A))) = {..<n} \<inter> A
{..<n} \<inter> UNIV \<inter> (UNIV - ({..<n} - (UNIV - A))) = (UNIV - A) \<inter> {..<n}

goal (1 subgoal):
 1. card (A \<inter> {..<n}) = n - card ((UNIV - A) \<inter> {..<n})
[PROOF STEP]
by (metis (no_types) Int_commute card_Diff_subset_Int card_lessThan finite_Int finite_lessThan inf_top_right)
[PROOF STATE]
proof (state)
this:
card (A \<inter> {..<n}) = n - card ((UNIV - A) \<inter> {..<n})

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (A \<inter> {..<n}) = n - card ((UNIV - A) \<inter> {..<n})
[PROOF STEP]
have "card (A \<inter> {..<n})/n = (real n - card((UNIV-A) \<inter> {..<n})) / n"
[PROOF STATE]
proof (prove)
using this:
card (A \<inter> {..<n}) = n - card ((UNIV - A) \<inter> {..<n})

goal (1 subgoal):
 1. real (card (A \<inter> {..<n})) / real n = (real n - real (card ((UNIV - A) \<inter> {..<n}))) / real n
[PROOF STEP]
by (metis Int_lower2 card_lessThan card_mono finite_lessThan of_nat_diff)
[PROOF STATE]
proof (state)
this:
real (card (A \<inter> {..<n})) / real n = (real n - real (card ((UNIV - A) \<inter> {..<n}))) / real n

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (card (A \<inter> {..<n})) / real n = (real n - real (card ((UNIV - A) \<inter> {..<n}))) / real n
[PROOF STEP]
have "card (A \<inter> {..<n})/n = ereal 1 - card((UNIV-A) \<inter> {..<n})/n"
[PROOF STATE]
proof (prove)
using this:
real (card (A \<inter> {..<n})) / real n = (real n - real (card ((UNIV - A) \<inter> {..<n}))) / real n

goal (1 subgoal):
 1. ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)
[PROOF STEP]
using \<open>n>0\<close>
[PROOF STATE]
proof (prove)
using this:
real (card (A \<inter> {..<n})) / real n = (real n - real (card ((UNIV - A) \<inter> {..<n}))) / real n
0 < n

goal (1 subgoal):
 1. ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)
[PROOF STEP]
by (simp add: diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?n2 \<Longrightarrow> ereal (real (card (A \<inter> {..<?n2})) / real ?n2) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<?n2})) / real ?n2)

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?n2 \<Longrightarrow> ereal (real (card (A \<inter> {..<?n2})) / real ?n2) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<?n2})) / real ?n2)
[PROOF STEP]
have "eventually (\<lambda>n. card (A \<inter> {..<n})/n = ereal 1 - card((UNIV-A) \<inter> {..<n})/n) sequentially"
[PROOF STATE]
proof (prove)
using this:
0 < ?n2 \<Longrightarrow> ereal (real (card (A \<inter> {..<?n2})) / real ?n2) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<?n2})) / real ?n2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)
[PROOF STEP]
by (simp add: eventually_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)
[PROOF STEP]
have "liminf (\<lambda>n. card (A \<inter> {..<n})/n) = liminf (\<lambda>n. ereal 1 - card((UNIV-A) \<inter> {..<n})/n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal (real (card (A \<inter> {..<n})) / real n) = ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = liminf (\<lambda>n. ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n))
[PROOF STEP]
by (rule Liminf_eq)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = liminf (\<lambda>n. ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n))

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = liminf (\<lambda>n. ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n))

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
have "... = ereal 1 - limsup (\<lambda>n. card((UNIV-A) \<inter> {..<n})/n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)) = ereal 1 - limsup (\<lambda>x. ereal (real (card ((UNIV - A) \<inter> {..<x})) / real x))
[PROOF STEP]
by (rule liminf_ereal_cminus, simp)
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>n. ereal 1 - ereal (real (card ((UNIV - A) \<inter> {..<n})) / real n)) = ereal 1 - limsup (\<lambda>x. ereal (real (card ((UNIV - A) \<inter> {..<x})) / real x))

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal 1 - limsup (\<lambda>x. ereal (real (card ((UNIV - A) \<inter> {..<x})) / real x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal 1 - limsup (\<lambda>x. ereal (real (card ((UNIV - A) \<inter> {..<x})) / real x))

goal (1 subgoal):
 1. lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
unfolding lower_asymptotic_density_def
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x)) = ereal 1 - limsup (\<lambda>x. ereal (real (card ((UNIV - A) \<inter> {..<x})) / real x))

goal (1 subgoal):
 1. real_of_ereal (liminf (\<lambda>x. ereal (real (card (A \<inter> {..<x})) / real x))) = 1 - upper_asymptotic_density (UNIV - A)
[PROOF STEP]
by (metis ereal_minus(1) real_of_ereal.simps(1) upper_asymptotic_density_in_01(1))
[PROOF STATE]
proof (state)
this:
lower_asymptotic_density A = 1 - upper_asymptotic_density (UNIV - A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma above_Above_trans:
assumes TRANS: "trans r" and
        IN1: "a \<in> above r b" and IN2: "b \<in> Above r C"
shows "a \<in> Above r C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
have "(b,a) \<in> r \<and> (\<forall>c \<in> C. (c,b) \<in> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b, a) \<in> r \<and> (\<forall>c\<in>C. (c, b) \<in> r)
[PROOF STEP]
using IN1[unfolded above_def] IN2[unfolded Above_def]
[PROOF STATE]
proof (prove)
using this:
a \<in> {ba. (b, ba) \<in> r}
b \<in> {b \<in> Field r. \<forall>a\<in>C. (a, b) \<in> r}

goal (1 subgoal):
 1. (b, a) \<in> r \<and> (\<forall>c\<in>C. (c, b) \<in> r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(b, a) \<in> r \<and> (\<forall>c\<in>C. (c, b) \<in> r)

goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
hence "\<forall>c \<in> C. (c,a) \<in> r"
[PROOF STATE]
proof (prove)
using this:
(b, a) \<in> r \<and> (\<forall>c\<in>C. (c, b) \<in> r)

goal (1 subgoal):
 1. \<forall>c\<in>C. (c, a) \<in> r
[PROOF STEP]
using TRANS trans_def[of r]
[PROOF STATE]
proof (prove)
using this:
(b, a) \<in> r \<and> (\<forall>c\<in>C. (c, b) \<in> r)
trans r
trans r = (\<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r)

goal (1 subgoal):
 1. \<forall>c\<in>C. (c, a) \<in> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>c\<in>C. (c, a) \<in> r

goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>c\<in>C. (c, a) \<in> r

goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
have "a \<in> Field r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> Field r
[PROOF STEP]
using IN1[unfolded above_def] Field_def
[PROOF STATE]
proof (prove)
using this:
a \<in> {ba. (b, ba) \<in> r}
Field ?r = Domain ?r \<union> Range ?r

goal (1 subgoal):
 1. a \<in> Field r
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
a \<in> Field r

goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>c\<in>C. (c, a) \<in> r
a \<in> Field r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>c\<in>C. (c, a) \<in> r
a \<in> Field r

goal (1 subgoal):
 1. a \<in> Above r C
[PROOF STEP]
unfolding Above_def
[PROOF STATE]
proof (prove)
using this:
\<forall>c\<in>C. (c, a) \<in> r
a \<in> Field r

goal (1 subgoal):
 1. a \<in> {b \<in> Field r. \<forall>a\<in>C. (a, b) \<in> r}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> Above r C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_inverse\<^sub>L_ex1: "is_inverse\<^sub>L f g \<Longrightarrow> \<exists>!h. is_inverse\<^sub>L f h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_inverse\<^sub>L f g \<Longrightarrow> \<exists>!h. is_inverse\<^sub>L f h
[PROOF STEP]
using is_inverse\<^sub>L_unique
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_inverse\<^sub>L ?f ?g; is_inverse\<^sub>L ?f ?h\<rbrakk> \<Longrightarrow> ?g = ?h

goal (1 subgoal):
 1. is_inverse\<^sub>L f g \<Longrightarrow> \<exists>!h. is_inverse\<^sub>L f h
[PROOF STEP]
by auto


[STATEMENT]
lemma rule_pow_combine_fixfst_Union: "\<Union> B \<subseteq> \<Union> C \<Longrightarrow> \<Union> (pow_combine A B) \<subseteq> \<Union> (pow_combine A C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> B \<subseteq> \<Union> C \<Longrightarrow> \<Union> (pow_combine A B) \<subseteq> \<Union> (pow_combine A C)
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<Union> B \<subseteq> \<Union> C; x \<in> \<Union> (pow_combine A B)\<rbrakk> \<Longrightarrow> x \<in> \<Union> (pow_combine A C)
[PROOF STEP]
apply(fastforce simp: pow_combine_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma size_image_mset [simp]: "size (image_mset f M) = size M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (image_mset f M) = size M
[PROOF STEP]
by (induct M) simp_all


[STATEMENT]
lemma finite_img_if_fsubst: "s \<in> fsubst \<Longrightarrow> finite (subst_range s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> fsubst \<Longrightarrow> finite (subst_range s)
[PROOF STEP]
using finite_dom_iff_fsubst finite_subst_img_if_finite_dom'
[PROOF STATE]
proof (prove)
using this:
finite (subst_domain ?\<theta>) = (?\<theta> \<in> fsubst)
finite (subst_domain ?\<sigma>) \<Longrightarrow> finite (subst_range ?\<sigma>)

goal (1 subgoal):
 1. s \<in> fsubst \<Longrightarrow> finite (subst_range s)
[PROOF STEP]
by blast


[STATEMENT]
lemma interval_tendstoI[intro]:
  assumes "(interval.upper \<circ> X) \<longlonglongrightarrow> x" and "(interval.lower \<circ> X) \<longlonglongrightarrow> x"
  shows "X \<longlonglongrightarrow>\<^sub>i x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<longlonglongrightarrow>\<^sub>i x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(interval.upper \<circ> X) \<longlonglongrightarrow> x
(interval.lower \<circ> X) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. X \<longlonglongrightarrow>\<^sub>i x
[PROOF STEP]
by (auto simp:interval_tendsto_def)


[STATEMENT]
lemma algebraic_int_power_iff:
  "algebraic_int (x ^ n :: 'a :: field_char_0) \<longleftrightarrow> n = 0 \<or> algebraic_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_int (x ^ n) = (n = 0 \<or> algebraic_int x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. algebraic_int (x ^ n) = (n = 0 \<or> algebraic_int x)
[PROOF STEP]
have "algebraic_int x" if "algebraic_int (x ^ n)" "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_int x
[PROOF STEP]
proof (rule algebraic_int_root)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. algebraic_int ?y
 2. poly ?p x = ?y
 3. \<forall>i. coeff ?p i \<in> \<int>
 4. monic ?p
 5. 0 < degree ?p
[PROOF STEP]
show "poly (monom 1 n) x = x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (monom (1::'a) n) x = x ^ n
[PROOF STEP]
by (auto simp: poly_monom)
[PROOF STATE]
proof (state)
this:
poly (monom (1::'a) n) x = x ^ n

goal (4 subgoals):
 1. algebraic_int (x ^ n)
 2. \<forall>i. coeff (monom (1::'a) n) i \<in> \<int>
 3. monic (monom (1::'a) n)
 4. 0 < degree (monom (1::'a) n)
[PROOF STEP]
qed (use that in \<open>auto simp: degree_monom_eq\<close>)
[PROOF STATE]
proof (state)
this:
\<lbrakk>algebraic_int (x ^ n); 0 < n\<rbrakk> \<Longrightarrow> algebraic_int x

goal (1 subgoal):
 1. algebraic_int (x ^ n) = (n = 0 \<or> algebraic_int x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>algebraic_int (x ^ n); 0 < n\<rbrakk> \<Longrightarrow> algebraic_int x

goal (1 subgoal):
 1. algebraic_int (x ^ n) = (n = 0 \<or> algebraic_int x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
algebraic_int (x ^ n) = (n = 0 \<or> algebraic_int x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in wf_digraph) app_iso_iso_inv_subgraph[simp]:
  assumes "digraph_isomorphism hom"
  assumes subg: "subgraph H (app_iso hom G)"
  shows "app_iso hom (app_iso (inv_iso hom) H) = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. app_iso hom (app_iso (inv_iso hom) H) = H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. app_iso hom (app_iso (inv_iso hom) H) = H
[PROOF STEP]
have "\<And>u. u \<in> verts H \<Longrightarrow> u \<in> iso_verts hom ` verts G" "\<And>a. a \<in> arcs H \<Longrightarrow> a \<in> iso_arcs hom ` arcs G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u. u \<in> verts H \<Longrightarrow> u \<in> iso_verts hom ` verts G) &&& (\<And>a. a \<in> arcs H \<Longrightarrow> a \<in> iso_arcs hom ` arcs G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
subgraph H (app_iso hom G)

goal (1 subgoal):
 1. (\<And>u. u \<in> verts H \<Longrightarrow> u \<in> iso_verts hom ` verts G) &&& (\<And>a. a \<in> arcs H \<Longrightarrow> a \<in> iso_arcs hom ` arcs G)
[PROOF STEP]
by (auto simp: subgraph_def)
[PROOF STATE]
proof (state)
this:
?u2 \<in> verts H \<Longrightarrow> ?u2 \<in> iso_verts hom ` verts G
?a2 \<in> arcs H \<Longrightarrow> ?a2 \<in> iso_arcs hom ` arcs G

goal (1 subgoal):
 1. app_iso hom (app_iso (inv_iso hom) H) = H
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
digraph_isomorphism hom
subgraph H (app_iso hom G)
?u2 \<in> verts H \<Longrightarrow> ?u2 \<in> iso_verts hom ` verts G
?a2 \<in> arcs H \<Longrightarrow> ?a2 \<in> iso_arcs hom ` arcs G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
subgraph H (app_iso hom G)
?u2 \<in> verts H \<Longrightarrow> ?u2 \<in> iso_verts hom ` verts G
?a2 \<in> arcs H \<Longrightarrow> ?a2 \<in> iso_arcs hom ` arcs G

goal (1 subgoal):
 1. app_iso hom (app_iso (inv_iso hom) H) = H
[PROOF STEP]
by (intro pre_digraph.equality) (auto simp: compatible_def image_image cong: image_cong)
[PROOF STATE]
proof (state)
this:
app_iso hom (app_iso (inv_iso hom) H) = H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_atMost_enat[simp]: "card {.. enat k} = card {.. k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
have 1: "{.. enat k} = enat ` {.. k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..enat k} = enat ` {..k}
[PROOF STEP]
unfolding atMost_def image_Collect
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. x \<le> enat k} = {enat x |x. x \<le> k}
[PROOF STEP]
using enat_ile
[PROOF STATE]
proof (prove)
using this:
?n \<le> enat ?m \<Longrightarrow> \<exists>k. ?n = enat k

goal (1 subgoal):
 1. {x. x \<le> enat k} = {enat x |x. x \<le> k}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{..enat k} = enat ` {..k}

goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
have "card {.. enat k} = card (enat ` {.. k})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {..enat k} = card (enat ` {..k})
[PROOF STEP]
unfolding 1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (enat ` {..k}) = card (enat ` {..k})
[PROOF STEP]
by rule
[PROOF STATE]
proof (state)
this:
card {..enat k} = card (enat ` {..k})

goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {..enat k} = card (enat ` {..k})

goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
have "\<dots> = card {.. k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (enat ` {..k}) = card {..k}
[PROOF STEP]
using card_image inj_enat
[PROOF STATE]
proof (prove)
using this:
inj_on ?f ?A \<Longrightarrow> card (?f ` ?A) = card ?A
inj_on enat ?A

goal (1 subgoal):
 1. card (enat ` {..k}) = card {..k}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card (enat ` {..k}) = card {..k}

goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {..enat k} = card {..k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {..enat k} = card {..k}

goal (1 subgoal):
 1. card {..enat k} = card {..k}
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
card {..enat k} = card {..k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cl_in_mono:
  assumes "X \<subseteq> Y"
  assumes "Y \<subseteq> \<E>"
  shows "cl_in \<E> X \<subseteq> cl_in \<E> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cl_in \<E> X \<subseteq> cl_in \<E> Y
[PROOF STEP]
using \<E>.cl_mono[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<E>.cl X \<subseteq> \<E>.cl Y

goal (1 subgoal):
 1. cl_in \<E> X \<subseteq> cl_in \<E> Y
[PROOF STEP]
unfolding cl_in_def
[PROOF STATE]
proof (prove)
using this:
\<E>.cl X \<subseteq> \<E>.cl Y

goal (1 subgoal):
 1. \<E>.cl X \<subseteq> \<E>.cl Y
[PROOF STEP]
.


[STATEMENT]
lemma map_of_filter_distinct:  (* TODO: move? *)
  assumes "distinct (map fst xs)"
  shows "map_of (filter P xs) x =
    (case map_of xs x of
      None \<Rightarrow> None
    | Some y \<Rightarrow> if P (x,y) then Some y else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (filter P xs) x = (case map_of xs x of None \<Rightarrow> None | Some y \<Rightarrow> if P (x, y) then Some y else None)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct (map fst xs)

goal (1 subgoal):
 1. map_of (filter P xs) x = (case map_of xs x of None \<Rightarrow> None | Some y \<Rightarrow> if P (x, y) then Some y else None)
[PROOF STEP]
by (auto simp: map_of_eq_None_iff filter_map distinct_map_filter dest: map_of_SomeD
      simp del: map_of_eq_Some_iff intro!: map_of_is_SomeI split: option.splits)


[STATEMENT]
lemma ZN_mod [transfer_rule]: "(ZN ===> ZN ===> ZN) (mod) (mod)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ZN ===> ZN ===> ZN) (mod) (mod)
[PROOF STEP]
unfolding rel_fun_def ZN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x = int y \<longrightarrow> (\<forall>xa ya. xa = int ya \<longrightarrow> x mod xa = int (y mod ya))
[PROOF STEP]
by (simp add: zmod_int)


[STATEMENT]
lemma infdist_closed:
  shows "closed ({z. infdist z S \<ge> e})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {z. e \<le> infdist z S}
[PROOF STEP]
by (auto intro!:closed_Collect_le simp add:continuous_on_infdist)


[STATEMENT]
lemma factorization_lattice: fixes M assumes
  deg_u: "degree u \<noteq> 0"  and M: "M \<noteq> 0"
shows "degree u \<le> n \<Longrightarrow> n \<noteq> 0 \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M) \<Longrightarrow>
  degree f < n \<and> poly_mod.dvdm M u f"
  "monic u \<Longrightarrow> degree u < n \<Longrightarrow>
  degree f < n \<Longrightarrow> poly_mod.dvdm M u f \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f) &&& (\<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
from deg_u
[PROOF STATE]
proof (chain)
picking this:
degree u \<noteq> 0
[PROOF STEP]
have deg_u: "degree u > 0"
[PROOF STATE]
proof (prove)
using this:
degree u \<noteq> 0

goal (1 subgoal):
 1. 0 < degree u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < degree u

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
let ?L = "factorization_lattice u (n - degree u) M"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
assume deg: "degree f < n" and dvd: "poly_mod.dvdm M u f" and mon: "monic u"
      and deg_u_lt: "degree u < n"
[PROOF STATE]
proof (state)
this:
degree f < n
poly_mod.dvdm M u f
monic u
degree u < n

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
define fv where "fv = vec n (\<lambda> i. (coeff f (n - Suc i)))"
[PROOF STATE]
proof (state)
this:
fv = vec n (\<lambda>i. coeff f (n - Suc i))

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
have f: "f = poly_of_vec fv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = poly_of_vec fv
[PROOF STEP]
unfolding fv_def poly_of_vec_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<Sum>i<dim_vec (vec n (\<lambda>i. coeff f (n - Suc i))). monom (vec n (\<lambda>i. coeff f (n - Suc i)) $ (dim_vec (vec n (\<lambda>i. coeff f (n - Suc i))) - Suc i)) i)
[PROOF STEP]
using deg
[PROOF STATE]
proof (prove)
using this:
degree f < n

goal (1 subgoal):
 1. f = (\<Sum>i<dim_vec (vec n (\<lambda>i. coeff f (n - Suc i))). monom (vec n (\<lambda>i. coeff f (n - Suc i)) $ (dim_vec (vec n (\<lambda>i. coeff f (n - Suc i))) - Suc i)) i)
[PROOF STEP]
by (auto intro!: poly_eqI coeff_eq_0 simp: coeff_sum)
[PROOF STATE]
proof (state)
this:
f = poly_of_vec fv

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
have dim_fv: "dim_vec fv = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec fv = n
[PROOF STEP]
unfolding fv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec n (\<lambda>i. coeff f (n - Suc i))) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec fv = n

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
from dvd_modulo_to_lincomb[OF deg_u_lt _ M mon _ deg_u(1), of fv, folded f, OF dvd dim_fv]
[PROOF STATE]
proof (chain)
picking this:
\<exists>c. lincomb_list c (factorization_lattice u (n - degree u) M) = fv
[PROOF STEP]
obtain c where gv: "fv = lincomb_list c ?L"
[PROOF STATE]
proof (prove)
using this:
\<exists>c. lincomb_list c (factorization_lattice u (n - degree u) M) = fv

goal (1 subgoal):
 1. (\<And>c. fv = lincomb_list c (factorization_lattice u (n - degree u) M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fv = lincomb_list c (factorization_lattice u (n - degree u) M)

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
have "fv \<in> lattice_of ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv \<in> lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
unfolding gv lattice_is_span
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list c (factorization_lattice u (n - degree u) M) \<in> span_list (factorization_lattice u (n - degree u) M)
[PROOF STEP]
by (auto simp: in_span_listI)
[PROOF STATE]
proof (state)
this:
fv \<in> lattice_of (factorization_lattice u (n - degree u) M)

goal (2 subgoals):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
 2. \<lbrakk>monic u; degree u < n; degree f < n; poly_mod.dvdm M u f\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
thus "f \<in> poly_of_vec ` lattice_of ?L"
[PROOF STATE]
proof (prove)
using this:
fv \<in> lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
using this:
fv \<in> lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. poly_of_vec fv \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree f < n; poly_mod.dvdm M u f; monic u; degree u < n\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree f < n; poly_mod.dvdm M u f; monic u; degree u < n\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree f < n; poly_mod.dvdm M u f; monic u; degree u < n\<rbrakk> \<Longrightarrow> f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
assume "f \<in> poly_of_vec ` lattice_of ?L" and deg_u: "degree u \<le> n" and n: "n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
degree u \<le> n
n \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
degree u \<le> n
n \<noteq> 0
[PROOF STEP]
obtain fv where f: "f = poly_of_vec fv" and fv: "fv \<in> lattice_of ?L"
[PROOF STATE]
proof (prove)
using this:
f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)
degree u \<le> n
n \<noteq> 0

goal (1 subgoal):
 1. (\<And>fv. \<lbrakk>f = poly_of_vec fv; fv \<in> lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = poly_of_vec fv
fv \<in> lattice_of (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
from in_span_listE[OF fv[unfolded lattice_is_span]]
[PROOF STATE]
proof (chain)
picking this:
(\<And>c. \<lbrakk>True; fv = lincomb_list c (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain c where fv: "fv = lincomb_list c ?L"
[PROOF STATE]
proof (prove)
using this:
(\<And>c. \<lbrakk>True; fv = lincomb_list c (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>c. fv = lincomb_list c (factorization_lattice u (n - degree u) M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fv = lincomb_list c (factorization_lattice u (n - degree u) M)

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
from lincomb_to_dvd_modulo[OF _ fv[symmetric]] deg_u f
[PROOF STATE]
proof (chain)
picking this:
degree u \<le> n \<Longrightarrow> poly_mod.dvdm M u (poly_of_vec fv)
degree u \<le> n
f = poly_of_vec fv
[PROOF STEP]
have dvd: "poly_mod.dvdm M u f"
[PROOF STATE]
proof (prove)
using this:
degree u \<le> n \<Longrightarrow> poly_mod.dvdm M u (poly_of_vec fv)
degree u \<le> n
f = poly_of_vec fv

goal (1 subgoal):
 1. poly_mod.dvdm M u f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_mod.dvdm M u f

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
have "set ?L \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (factorization_lattice u (n - degree u) M) \<subseteq> carrier_vec n
[PROOF STEP]
unfolding factorization_lattice_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. vec_of_poly_n (u * monom 1 i) (degree u + (n - degree u))) [n - degree u>..0] @ map (\<lambda>i. vec_of_poly_n (monom M i) (degree u + (n - degree u))) [degree u>..0]) \<subseteq> carrier_vec n
[PROOF STEP]
using deg_u
[PROOF STATE]
proof (prove)
using this:
degree u \<le> n

goal (1 subgoal):
 1. set (map (\<lambda>i. vec_of_poly_n (u * monom 1 i) (degree u + (n - degree u))) [n - degree u>..0] @ map (\<lambda>i. vec_of_poly_n (monom M i) (degree u + (n - degree u))) [degree u>..0]) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (factorization_lattice u (n - degree u) M) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
hence "fv \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set (factorization_lattice u (n - degree u) M) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. fv \<in> carrier_vec n
[PROOF STEP]
unfolding fv
[PROOF STATE]
proof (prove)
using this:
set (factorization_lattice u (n - degree u) M) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb_list c (factorization_lattice u (n - degree u) M) \<in> carrier_vec n
[PROOF STEP]
by (metis lincomb_list_carrier)
[PROOF STATE]
proof (state)
this:
fv \<in> carrier_vec n

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
hence "degree f < n"
[PROOF STATE]
proof (prove)
using this:
fv \<in> carrier_vec n

goal (1 subgoal):
 1. degree f < n
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
using this:
fv \<in> carrier_vec n

goal (1 subgoal):
 1. degree (poly_of_vec fv) < n
[PROOF STEP]
using degree_poly_of_vec_less[of fv n]
[PROOF STATE]
proof (prove)
using this:
fv \<in> carrier_vec n
\<lbrakk>0 < dim_vec fv; dim_vec fv \<le> n\<rbrakk> \<Longrightarrow> degree (poly_of_vec fv) < n

goal (1 subgoal):
 1. degree (poly_of_vec fv) < n
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
fv \<in> carrier_vec n
\<lbrakk>0 < dim_vec fv; dim_vec fv \<le> n\<rbrakk> \<Longrightarrow> degree (poly_of_vec fv) < n
n \<noteq> 0

goal (1 subgoal):
 1. degree (poly_of_vec fv) < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree f < n

goal (1 subgoal):
 1. \<lbrakk>degree u \<le> n; n \<noteq> 0; f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M)\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
with dvd
[PROOF STATE]
proof (chain)
picking this:
poly_mod.dvdm M u f
degree f < n
[PROOF STEP]
show "degree f < n \<and> poly_mod.dvdm M u f"
[PROOF STATE]
proof (prove)
using this:
poly_mod.dvdm M u f
degree f < n

goal (1 subgoal):
 1. degree f < n \<and> poly_mod.dvdm M u f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree f < n \<and> poly_mod.dvdm M u f

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>f \<in> poly_of_vec ` lattice_of (factorization_lattice u (n - degree u) M); degree u \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> degree f < n \<and> poly_mod.dvdm M u f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma replication_number_value:
  assumes "x \<in> \<V>"
  shows "(\<B> rep x) = \<Lambda> * (\<v> - 1) div (\<k> - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B> rep x = \<Lambda> * (\<v> - 1) div (\<k> - 1)
[PROOF STEP]
using min_block_size_2 r_constant assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> \<k>
?x \<in> \<V> \<Longrightarrow> \<B> rep ?x * (\<k> - 1) = \<Lambda> * (\<v> - 1)
x \<in> \<V>

goal (1 subgoal):
 1. \<B> rep x = \<Lambda> * (\<v> - 1) div (\<k> - 1)
[PROOF STEP]
by (metis diff_is_0_eq diffs0_imp_equal div_by_1 k_non_zero nonzero_mult_div_cancel_right
      one_div_two_eq_zero one_le_numeral zero_neq_one)


[STATEMENT]
lemma not_pgte_charact:
  "\<not> pgte a b \<longleftrightarrow> pgt b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> pgte a b) = pgt b a
[PROOF STEP]
by (meson not_less pgt.rep_eq pgte.rep_eq)


[STATEMENT]
lemma ANR_path_component_ANR:
  fixes S :: "'a::euclidean_space set"
  shows "ANR S \<Longrightarrow> ANR(path_component_set S x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ANR S \<Longrightarrow> ANR (path_component_set S x)
[PROOF STEP]
using ANR_imp_locally_path_connected ANR_openin openin_path_component_locally_path_connected
[PROOF STATE]
proof (prove)
using this:
ANR ?S \<Longrightarrow> locally path_connected ?S
\<lbrakk>ANR ?T; openin (top_of_set ?T) ?S\<rbrakk> \<Longrightarrow> ANR ?S
locally path_connected ?S \<Longrightarrow> openin (top_of_set ?S) (path_component_set ?S ?x)

goal (1 subgoal):
 1. ANR S \<Longrightarrow> ANR (path_component_set S x)
[PROOF STEP]
by blast


[STATEMENT]
lemma reduce_basis: assumes "LLL_Impl.reduce_basis \<alpha> fs_init = fs"
  shows "lattice_of fs = L"
  "reduced fs m"
  "lin_indep fs"
  "length fs = m"
  "LLL_invariant True m fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lattice_of fs = L &&& gram_schmidt_fs.reduced n (map of_int_hom.vec_hom fs) \<alpha> m) &&& gs.lin_indpt_list (map of_int_hom.vec_hom fs) &&& length fs = m &&& LLL_invariant True m fs
[PROOF STEP]
using reduce_basis_impl assms reduce_basis reduce_basis_inv
[PROOF STATE]
proof (prove)
using this:
LLL_Impl.reduce_basis \<alpha> fs_init = local.reduce_basis
LLL_Impl.reduce_basis \<alpha> fs_init = fs
local.reduce_basis = ?fs \<Longrightarrow> lattice_of ?fs = L
local.reduce_basis = ?fs \<Longrightarrow> gram_schmidt_fs.reduced n (map of_int_hom.vec_hom ?fs) \<alpha> m
local.reduce_basis = ?fs \<Longrightarrow> gs.lin_indpt_list (map of_int_hom.vec_hom ?fs)
local.reduce_basis = ?fs \<Longrightarrow> length ?fs = m
local.reduce_basis = ?fs \<Longrightarrow> LLL_invariant True m ?fs

goal (1 subgoal):
 1. (lattice_of fs = L &&& gram_schmidt_fs.reduced n (map of_int_hom.vec_hom fs) \<alpha> m) &&& gs.lin_indpt_list (map of_int_hom.vec_hom fs) &&& length fs = m &&& LLL_invariant True m fs
[PROOF STEP]
by metis+


[STATEMENT]
lemma size_pf_formula16: "sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
have "sum_list (map size_pf (pf_formula16 cs cns n m)) = sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) = sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2)
[PROOF STEP]
unfolding pf_encoder.formula16_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map size_pf (Neg (Conj (map Prop (map Epsilon [0..<n]))) # pf_formula15 cs cns n m)) = sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2)
[PROOF STEP]
by (simp add: o_def size_list_conv_sum_list sum_list_triv)
[PROOF STATE]
proof (state)
this:
sum_list (map size_pf (pf_formula16 cs cns n m)) = sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2)

goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map size_pf (pf_formula16 cs cns n m)) = sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2)

goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
have "\<dots> \<le> (m + 3 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n) + (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2) \<le> m + 3 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n + (n + 2)
[PROOF STEP]
by (rule add_right_mono[OF size_pf_formula15])
[PROOF STATE]
proof (state)
this:
sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2) \<le> m + 3 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n + (n + 2)

goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map size_pf (pf_formula15 cs cns n m)) + (n + 2) \<le> m + 3 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n + (n + 2)

goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
have "\<dots> = 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m + 3 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n + (n + 2) = 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m + 3 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n + (n + 2) = 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n

goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n

goal (1 subgoal):
 1. sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_list (map size_pf (pf_formula16 cs cns n m)) \<le> 2 + m + 4 * n + m * (n * 16 - 21) + n * (m * 16 - 21) + 4 * m * n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma FOREACHoci_by_LIST_FOREACH:
  "FOREACHoci R \<Phi> S c f \<sigma>0 = do {
    ASSERT (finite S);
    LIST_FOREACH \<Phi> (it_to_sorted_list R S) c f \<sigma>0
  }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FOREACH\<^sub>O\<^sub>C\<^bsup>R,\<Phi>\<^esup> S c f \<sigma>0 = ASSERT (finite S) \<bind> (\<lambda>_. LIST_FOREACH \<Phi> (it_to_sorted_list R S) c f \<sigma>0)
[PROOF STEP]
unfolding OP_def FOREACHoci_def LIST_FOREACH_def it_to_sorted_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ASSERT (finite S) \<bind> (\<lambda>_. SPEC (\<lambda>xs. distinct xs \<and> S = set xs \<and> sorted_wrt R xs) \<bind> (\<lambda>xs. WHILE\<^sub>T\<^bsup>\<lambda>(it, \<sigma>). \<exists>xs'. xs = xs' @ it \<and> \<Phi> (set it) \<sigma>\<^esup> (FOREACH_cond c) (FOREACH_body f) (xs, \<sigma>0) \<bind> (\<lambda>(uu_, \<sigma>). RETURN \<sigma>))) = ASSERT (finite S) \<bind> (\<lambda>_. SPEC (\<lambda>l. distinct l \<and> S = set l \<and> sorted_wrt R l) \<bind> (\<lambda>xs. WHILE\<^sub>T\<^bsup>\<lambda>(it, \<sigma>). \<exists>xs'. xs = xs' @ it \<and> \<Phi> (set it) \<sigma>\<^esup> (FOREACH_cond c) (FOREACH_body f) (xs, \<sigma>0) \<bind> (\<lambda>(uu_, \<sigma>). RETURN \<sigma>)))
[PROOF STEP]
by simp


[STATEMENT]
lemma protocol_inverse:
  assumes "m0 \<in> carrier \<G>" "m1 \<in> carrier \<G>"
  shows" ((\<^bold>g [^] ((a*b) mod (order \<G>))) [^] (s1 :: nat)) \<otimes> ((\<^bold>g [^] b) [^] (r1::nat)) \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b)
        = (if v then m0 else m1)"
(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
have  1: "(a*b)*(s1) + b*r1 =((a::nat)*(s1) + r1)*b "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b * s1 + b * r1 = (a * s1 + r1) * b
[PROOF STEP]
using mult.commute mult.assoc  add_mult_distrib
[PROOF STATE]
proof (prove)
using this:
?a * ?b = ?b * ?a
?a * ?b * ?c = ?a * (?b * ?c)
(?m + ?n) * ?k = ?m * ?k + ?n * ?k

goal (1 subgoal):
 1. a * b * s1 + b * r1 = (a * s1 + r1) * b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * b * s1 + b * r1 = (a * s1 + r1) * b

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
have "?lhs =
 ((\<^bold>g [^] (a*b)) [^] s1) \<otimes> ((\<^bold>g [^] b) [^] r1) \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (\<^bold>g [^] (a * b)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b)
[PROOF STEP]
by(simp add: pow_generator_mod)
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (\<^bold>g [^] (a * b)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b)

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (\<^bold>g [^] (a * b)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b)

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
have "... = (\<^bold>g [^] ((a*b)*(s1))) \<otimes> ((\<^bold>g [^] (b*r1))) \<otimes> ((if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] ((a*(s1) + r1)*b)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] (a * b)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> ((if v then m0 else m1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)))
[PROOF STEP]
by(auto simp add: nat_pow_pow nat_pow_mult assms cyclic_group_assoc)
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] (a * b)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> ((if v then m0 else m1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)))

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] (a * b)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> ((if v then m0 else m1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)))

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
have "... = \<^bold>g [^] ((a*b)*(s1)) \<otimes> \<^bold>g [^] (b*r1) \<otimes> ((inv (((\<^bold>g [^] ((a*(s1) + r1)*b))))) \<otimes> (if v then m0 else m1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> ((if v then m0 else m1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b))) = \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> (inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1))
[PROOF STEP]
by(simp add: nat_pow_mult cyclic_group_commute assms)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> ((if v then m0 else m1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b))) = \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> (inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1))

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> ((if v then m0 else m1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b))) = \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> (inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1))

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
have "... = (\<^bold>g [^] ((a*b)*(s1) + b*r1) \<otimes> inv (((\<^bold>g [^] ((a*(s1) + r1)*b))))) \<otimes> (if v then m0 else m1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> (inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)
[PROOF STEP]
by(simp add: nat_pow_mult cyclic_group_assoc assms)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> (inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (a * b * s1) \<otimes> \<^bold>g [^] (b * r1) \<otimes> (inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
have "... = (\<^bold>g [^] ((a*b)*(s1) + b*r1) \<otimes> inv (((\<^bold>g [^] (((a*b)*(s1) + r1*b)))))) \<otimes> (if v then m0 else m1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] (a * b * s1 + r1 * b)) \<otimes> (if v then m0 else m1)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
a * b * s1 + b * r1 = (a * s1 + r1) * b

goal (1 subgoal):
 1. \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] (a * b * s1 + r1 * b)) \<otimes> (if v then m0 else m1)
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] (a * b * s1 + r1 * b)) \<otimes> (if v then m0 else m1)

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)
\<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] (a * b * s1 + r1 * b)) \<otimes> (if v then m0 else m1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)
\<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] (a * b * s1 + r1 * b)) \<otimes> (if v then m0 else m1)

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
using l_cancel_inv assms
[PROOF STATE]
proof (prove)
using this:
(\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1)
\<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] ((a * s1 + r1) * b)) \<otimes> (if v then m0 else m1) = \<^bold>g [^] (a * b * s1 + b * r1) \<otimes> inv (\<^bold>g [^] (a * b * s1 + r1 * b)) \<otimes> (if v then m0 else m1)
?h \<in> carrier \<G> \<Longrightarrow> \<^bold>g [^] ?a \<otimes> inv (\<^bold>g [^] ?a) \<otimes> ?h = ?h
m0 \<in> carrier \<G>
m1 \<in> carrier \<G>

goal (1 subgoal):
 1. (\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] (a * b mod order \<G>)) [^] s1 \<otimes> (\<^bold>g [^] b) [^] r1 \<otimes> (if v then m0 else m1) \<otimes> inv (((\<^bold>g [^] a) [^] s1 \<otimes> \<^bold>g [^] r1) [^] b) = (if v then m0 else m1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_splay: "inorder(splay x t) = inorder t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder (splay x t) = inorder t
[PROOF STEP]
by(induction x t rule: splay.induct)
  (auto simp: neq_Leaf_iff split: tree.split)


[STATEMENT]
lemma qbs_bernoulli_expectation:
  "(\<integral>\<^sub>Q x. f x \<partial>qbs_bernoulli p) = f True * p + f False * (1 - p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_prob_integral (qbs_bernoulli p) f = f True * p + f False * (1 - p)
[PROOF STEP]
by(simp add: qbs_prob_integral_def2 qbs_bernoulli_measure)


[STATEMENT]
lemma filterlim_sup1: "(LIM x F. f x :> G1) \<Longrightarrow> (LIM x F. f x :> (sup G1 G2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f G1 F \<Longrightarrow> filterlim f (sup G1 G2) F
[PROOF STEP]
unfolding filterlim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap f F \<le> G1 \<Longrightarrow> filtermap f F \<le> sup G1 G2
[PROOF STEP]
by (auto intro: le_supI1)


[STATEMENT]
lemma vifunion_vinsert_is:
  "(\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>vinsert j I. f i) = f j \<union>\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (VLambda (vinsert j I) f `\<^sub>\<circ> vinsert j I) = f j \<union>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)
[PROOF STEP]
by (force simp: vimage_VLambda_vrange_rep)


[STATEMENT]
theorem rivest_binding_asym:
  assumes "negligible (\<lambda>n. 1 / (q n))"
  shows "negligible (\<lambda>n. rivest_commit.bind_advantage n (\<A> n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Negligible.negligible (\<lambda>n. rivest_commit.bind_advantage n (\<A> n))
[PROOF STEP]
using negligible_le rivest_bind assms rivest_commit.bind_advantage_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Negligible.negligible ?g; \<And>\<eta>. \<bar>?f \<eta>\<bar> \<le> ?g \<eta>\<rbrakk> \<Longrightarrow> Negligible.negligible ?f
rivest_commit.bind_advantage ?\<eta> ?\<A> \<le> 1 / real (q ?\<eta>)
Negligible.negligible (\<lambda>n. 1 / real (q n))
rivest_commit.bind_advantage ?\<eta> ?\<A> \<equiv> spmf (rivest_commit.bind_game ?\<eta> ?\<A>) True

goal (1 subgoal):
 1. Negligible.negligible (\<lambda>n. rivest_commit.bind_advantage n (\<A> n))
[PROOF STEP]
by auto


[STATEMENT]
lemma has_real_derivative_pos_inc_left:
  fixes f :: "real \<Rightarrow> real"
  shows "(f has_real_derivative l) (at x within S) \<Longrightarrow> 0 < l \<Longrightarrow>
    \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f (x - h) < f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_real_derivative l) (at x within S); 0 < l\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>h>0. x - h \<in> S \<longrightarrow> h < d \<longrightarrow> f (x - h) < f x
[PROOF STEP]
by (rule has_real_derivative_neg_dec_left [of "\<lambda>x. - f x" "-l" x S, simplified])
      (auto simp add: DERIV_minus)


[STATEMENT]
lemma univalent_mult_closed:
  assumes "univalent x"
      and "univalent y"
    shows "univalent (x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univalent (x * y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. univalent (x * y)
[PROOF STEP]
have "(x * y)\<^sup>T * x \<le> y\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x * y)\<^sup>T * x \<le> y\<^sup>T
[PROOF STEP]
by (metis assms(1) comp_left_isotone comp_right_one conv_one conv_order comp_associative conv_dist_comp conv_involutive)
[PROOF STATE]
proof (state)
this:
(x * y)\<^sup>T * x \<le> y\<^sup>T

goal (1 subgoal):
 1. univalent (x * y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x * y)\<^sup>T * x \<le> y\<^sup>T

goal (1 subgoal):
 1. univalent (x * y)
[PROOF STEP]
by (metis assms(2) comp_left_isotone comp_associative dual_order.trans)
[PROOF STATE]
proof (state)
this:
univalent (x * y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irfb_irbd_dual: "Inf_pres \<phi> \<Longrightarrow> fb\<^sup>-\<^sub>\<R> \<phi> = ((\<smile>) \<circ> bd\<^sup>-\<^sub>\<R>  \<circ> \<partial>\<^sub>F) \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres \<phi> \<Longrightarrow> fb\<^sup>-\<^sub>\<R> \<phi> = (\<smile> \<circ> bd\<^sup>-\<^sub>\<R> \<circ> \<partial>\<^sub>F) \<phi>
[PROOF STEP]
by (simp add: irfb_def irbd_def iffb_ifbd_dual kop_def r2f_f2r_galois)


[STATEMENT]
lemma FnCall:
     "FnCall F (Abs_ExpList Us) = Abs_Exp (exprel``{FNCALL F Us})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FnCall F (Abs_ExpList Us) = Abs_Exp (exprel `` {FNCALL F Us})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. FnCall F (Abs_ExpList Us) = Abs_Exp (exprel `` {FNCALL F Us})
[PROOF STEP]
have "(\<lambda>Us. exprel``{FNCALL F Us}) respects (listrel exprel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>Us. exprel `` {FNCALL F Us}) respects listrel exprel
[PROOF STEP]
by (auto simp add: congruent_def exprel.FNCALL)
[PROOF STATE]
proof (state)
this:
(\<lambda>Us. exprel `` {FNCALL F Us}) respects listrel exprel

goal (1 subgoal):
 1. FnCall F (Abs_ExpList Us) = Abs_Exp (exprel `` {FNCALL F Us})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>Us. exprel `` {FNCALL F Us}) respects listrel exprel

goal (1 subgoal):
 1. FnCall F (Abs_ExpList Us) = Abs_Exp (exprel `` {FNCALL F Us})
[PROOF STEP]
by (simp add: FnCall_def UN_equiv_class [OF equiv_list_exprel]
                  listset_Rep_Exp_Abs_Exp)
[PROOF STATE]
proof (state)
this:
FnCall F (Abs_ExpList Us) = Abs_Exp (exprel `` {FNCALL F Us})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma leads_to_trans:
  assumes "(P \<^bold>\<leadsto> Q) \<sigma>"
  assumes "(Q \<^bold>\<leadsto> R) \<sigma>"
  shows "(P \<^bold>\<leadsto> R) \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<box>(\<lambda>s. P s \<longrightarrow> (\<diamond>R) s)) \<sigma>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<box>(\<lambda>s. P s \<longrightarrow> (\<diamond>Q) s)) \<sigma>
(\<box>(\<lambda>s. Q s \<longrightarrow> (\<diamond>R) s)) \<sigma>

goal (1 subgoal):
 1. (\<box>(\<lambda>s. P s \<longrightarrow> (\<diamond>R) s)) \<sigma>
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
using this:
\<forall>i. P (\<sigma> |\<^sub>s i) \<longrightarrow> (\<exists>ia. Q (\<sigma> |\<^sub>s i |\<^sub>s ia) \<and> (\<forall>k<ia. True))
\<forall>i. Q (\<sigma> |\<^sub>s i) \<longrightarrow> (\<exists>ia. R (\<sigma> |\<^sub>s i |\<^sub>s ia) \<and> (\<forall>k<ia. True))

goal (1 subgoal):
 1. \<forall>i. P (\<sigma> |\<^sub>s i) \<longrightarrow> (\<exists>ia. R (\<sigma> |\<^sub>s i |\<^sub>s ia) \<and> (\<forall>k<ia. True))
[PROOF STEP]
by clarsimp (metis semiring_normalization_rules(25))


[STATEMENT]
lemma Union_supports_set:
  shows "(\<Union>x \<in> S. supp x) supports S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
have "\<forall>x \<in> S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S
[PROOF STEP]
unfolding permute_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> {(a \<rightleftharpoons> b) \<bullet> x |x. x \<in> S} = S
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S

goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. (?a2 \<rightleftharpoons> ?b2) \<bullet> x = x \<Longrightarrow> (?a2 \<rightleftharpoons> ?b2) \<bullet> S = S

goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. (?a2 \<rightleftharpoons> ?b2) \<bullet> x = x \<Longrightarrow> (?a2 \<rightleftharpoons> ?b2) \<bullet> S = S
[PROOF STEP]
show "(\<Union>x \<in> S. supp x) supports S"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. (?a2 \<rightleftharpoons> ?b2) \<bullet> x = x \<Longrightarrow> (?a2 \<rightleftharpoons> ?b2) \<bullet> S = S

goal (1 subgoal):
 1. \<Union> (supp ` S) supports S
[PROOF STEP]
unfolding supports_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. (?a2 \<rightleftharpoons> ?b2) \<bullet> x = x \<Longrightarrow> (?a2 \<rightleftharpoons> ?b2) \<bullet> S = S

goal (1 subgoal):
 1. \<forall>a b. a \<notin> \<Union> (supp ` S) \<and> b \<notin> \<Union> (supp ` S) \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S
[PROOF STEP]
by (simp add: fresh_def[symmetric] swap_fresh_fresh)
[PROOF STATE]
proof (state)
this:
\<Union> (supp ` S) supports S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rename_leadsTo:
     "bij h ==> (rename h F \<in> (h`A) leadsTo (h`B)) = (F \<in> A leadsTo B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (rename h F \<in> h ` A \<longmapsto> h ` B) = (F \<in> A \<longmapsto> B)
[PROOF STEP]
apply (unfold rename_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (extend (\<lambda>(x, u). h x) F \<in> h ` A \<longmapsto> h ` B) = (F \<in> A \<longmapsto> B)
[PROOF STEP]
apply (subst extend_set_eq_image [symmetric])+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> (extend (\<lambda>(x, u). h x) F \<in> extend_set (\<lambda>(x, u). h x) A \<longmapsto> extend_set (\<lambda>(x, u). h x) B) = (F \<in> A \<longmapsto> B)
[PROOF STEP]
apply (erule good_map_bij [THEN Extend.intro, THEN Extend.extend_leadsTo])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rel_witness_pmf2:
  assumes "rel_pmf A p q"
  shows "rel_pmf (\<lambda>(a, b') b. b = b' \<and> A a b') (rel_witness_pmf A (p, q)) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_pmf (\<lambda>(a, b') b. b = b' \<and> A a b') (rel_witness_pmf A (p, q)) q
[PROOF STEP]
using map2_rel_witness_pmf[OF assms]
[PROOF STATE]
proof (prove)
using this:
map_pmf snd (rel_witness_pmf A (p, q)) = q

goal (1 subgoal):
 1. rel_pmf (\<lambda>(a, b') b. b = b' \<and> A a b') (rel_witness_pmf A (p, q)) q
[PROOF STEP]
unfolding pmf.rel_eq[symmetric] pmf.rel_map
[PROOF STATE]
proof (prove)
using this:
rel_pmf (\<lambda>x. (=) (snd x)) (rel_witness_pmf A (p, q)) q

goal (1 subgoal):
 1. rel_pmf (\<lambda>(a, b') b. b = b' \<and> A a b') (rel_witness_pmf A (p, q)) q
[PROOF STEP]
by(rule pmf.rel_mono_strong)(auto dest: set_rel_witness_pmf[OF assms, THEN subsetD])


[STATEMENT]
lemma state_measure_integral_split:
  assumes "x \<in> A" "finite A"
  assumes "f \<in> borel_measurable (state_measure A \<Gamma>)"
  shows "(\<integral>\<^sup>+\<sigma>. f \<sigma> \<partial>state_measure A \<Gamma>) =
             (\<integral>\<^sup>+y. \<integral>\<^sup>+\<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A-{x}) \<Gamma> \<partial>stock_measure (\<Gamma> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
interpret product_sigma_finite "\<lambda>y. stock_measure (\<Gamma> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>y. stock_measure (\<Gamma> y))
[PROOF STEP]
unfolding product_sigma_finite_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. sigma_finite_measure (stock_measure (\<Gamma> i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
finite A
f \<in> borel_measurable (state_measure A \<Gamma>)
[PROOF STEP]
have [simp]: "insert x A = A"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
finite A
f \<in> borel_measurable (state_measure A \<Gamma>)

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

goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
have "(\<integral>\<^sup>+\<sigma>. f \<sigma> \<partial>state_measure A \<Gamma>) = (\<integral>\<^sup>+\<sigma>. f \<sigma> \<partial>\<Pi>\<^sub>M v\<in>insert x (A-{x}). stock_measure (\<Gamma> v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f
[PROOF STEP]
unfolding state_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M A (\<lambda>x. stock_measure (\<Gamma> x))) f = integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (state_measure A \<Gamma>) f = integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f

goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (state_measure A \<Gamma>) f = integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f

goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
have "... = \<integral>\<^sup>+y. \<integral>\<^sup>+\<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A-{x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> A
finite A
f \<in> borel_measurable (state_measure A \<Gamma>)

goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
unfolding state_measure_def
[PROOF STATE]
proof (prove)
using this:
x \<in> A
finite A
f \<in> borel_measurable (Pi\<^sub>M A (\<lambda>x. stock_measure (\<Gamma> x)))

goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>Pi\<^sub>M (A - {x}) (\<lambda>x. stock_measure (\<Gamma> x)) \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
by (subst product_nn_integral_insert_rev) simp_all
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (Pi\<^sub>M (insert x (A - {x})) (\<lambda>v. stock_measure (\<Gamma> v))) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)

goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)

goal (1 subgoal):
 1. integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (state_measure A \<Gamma>) f = \<integral>\<^sup>+ y. \<integral>\<^sup>+ \<sigma>. f (\<sigma>(x := y)) \<partial>state_measure (A - {x}) \<Gamma> \<partial>stock_measure (\<Gamma> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conj_PL: \<open>A \<turnstile> p .\<and>. q \<longleftrightarrow> (A \<turnstile> p \<and> A \<turnstile> q)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<turnstile> p .\<and>. q) = (A \<turnstile> p \<and> A \<turnstile> q)
[PROOF STEP]
using conjE1_PL conjE2_PL conjI_PL
[PROOF STATE]
proof (prove)
using this:
?A \<turnstile> ?p .\<and>. ?q \<Longrightarrow> ?A \<turnstile> ?p
?A \<turnstile> ?p .\<and>. ?q \<Longrightarrow> ?A \<turnstile> ?q
\<lbrakk>?A \<turnstile> ?p; ?A \<turnstile> ?q\<rbrakk> \<Longrightarrow> ?A \<turnstile> ?p .\<and>. ?q

goal (1 subgoal):
 1. (A \<turnstile> p .\<and>. q) = (A \<turnstile> p \<and> A \<turnstile> q)
[PROOF STEP]
by blast


[STATEMENT]
lemma tfl_imp_trans: "(A \<longrightarrow> B) \<Longrightarrow> (B \<longrightarrow> C) \<Longrightarrow> (A \<longrightarrow> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<longrightarrow> B; B \<longrightarrow> C\<rbrakk> \<Longrightarrow> A \<longrightarrow> C
[PROOF STEP]
by blast


[STATEMENT]
lemma poly_mono:
  fixes x :: "'a::linordered_idom"
  shows "\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly [] x\<bar> \<le> poly (map abs []) k
 2. \<And>a p. \<lbrakk>\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> k

goal (2 subgoals):
 1. \<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly [] x\<bar> \<le> poly (map abs []) k
 2. \<And>a p. \<lbrakk>\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> \<le> k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> \<le> k

goal (1 subgoal):
 1. \<bar>poly [] x\<bar> \<le> poly (map abs []) k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>poly [] x\<bar> \<le> poly (map abs []) k

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k
[PROOF STEP]
case (Cons a p)
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k
\<bar>x\<bar> \<le> k

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k
\<bar>x\<bar> \<le> k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> \<le> k \<Longrightarrow> \<bar>poly p x\<bar> \<le> poly (map abs p) k
\<bar>x\<bar> \<le> k

goal (1 subgoal):
 1. \<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>a + x * poly p x\<bar> \<le> \<bar>a\<bar> + k * poly (map abs p) k
[PROOF STEP]
apply (rule_tac y = "\<bar>a\<bar> + \<bar>x * poly p x\<bar>" in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>a + x * poly p x\<bar> \<le> \<bar>a\<bar> + \<bar>x * poly p x\<bar>
 2. \<lbrakk>\<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>a\<bar> + \<bar>x * poly p x\<bar> \<le> \<bar>a\<bar> + k * poly (map abs p) k
[PROOF STEP]
apply (rule abs_triangle_ineq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>poly p x\<bar> \<le> poly (map abs p) k; \<bar>x\<bar> \<le> k\<rbrakk> \<Longrightarrow> \<bar>a\<bar> + \<bar>x * poly p x\<bar> \<le> \<bar>a\<bar> + k * poly (map abs p) k
[PROOF STEP]
apply (auto intro!: mult_mono simp add: abs_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<bar>poly (a # p) x\<bar> \<le> poly (map abs (a # p)) k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_fun_eq_OO: "((=) ===> A) OO ((=) ===> B) = ((=) ===> A OO B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((=) ===> A) OO ((=) ===> B) = (=) ===> A OO B
[PROOF STEP]
by(clarsimp simp add: rel_fun_def fun_eq_iff relcompp.simps) metis


[STATEMENT]
lemma bin_UNIV_swap: "{a, 1-a} = binUNIV" (is "?P a")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a, 1 - a} = binUNIV
[PROOF STEP]
using bin_swap_induct[of ?P bin0, unfolded binsimp]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{bin0, bin1} = binUNIV; {bin1, bin0} = binUNIV\<rbrakk> \<Longrightarrow> {?c, 1 - ?c} = binUNIV

goal (1 subgoal):
 1. {a, 1 - a} = binUNIV
[PROOF STEP]
by fastforce


[STATEMENT]
lemma linorder_le_of_nat_term_order: "class.linorder (le_of_nat_term_order to) (lt_of_nat_term_order to)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.linorder (le_of_nat_term_order to) (lt_of_nat_term_order to)
[PROOF STEP]
unfolding le_of_nat_term_order_alt lt_of_nat_term_order_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.linorder (\<lambda>u v. ko.le (key_order_of_nat_term_order_inv to) v u) (\<lambda>u v. ko.lt (key_order_of_nat_term_order_inv to) v u)
[PROOF STEP]
using ko.linorder
[PROOF STATE]
proof (prove)
using this:
class.linorder (ko.le ?ko) (ko.lt ?ko)

goal (1 subgoal):
 1. class.linorder (\<lambda>u v. ko.le (key_order_of_nat_term_order_inv to) v u) (\<lambda>u v. ko.lt (key_order_of_nat_term_order_inv to) v u)
[PROOF STEP]
by (rule linorder.dual_linorder)


[STATEMENT]
lemma analytically_valid_x:
  assumes "analytically_valid s F j"
  shows "(\<lambda>x. integral UNIV (\<lambda>y. ((partial_vector_derivative F j) (x, y)) * (indicator s (x, y)))) \<in> borel_measurable lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. partial_vector_derivative F j (x, y) * indicator s (x, y))) \<in> borel_measurable lborel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. partial_vector_derivative F j (x, y) * indicator s (x, y))) \<in> borel_measurable lborel
[PROOF STEP]
have "{(1::real, 0::real), (0, 1)} - {(0, 1)} = {(1::real, 0::real)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(1, 0), (0, 1)} - {(0, 1)} = {(1, 0)}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{(1, 0), (0, 1)} - {(0, 1)} = {(1, 0)}

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. partial_vector_derivative F j (x, y) * indicator s (x, y))) \<in> borel_measurable lborel
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
analytically_valid s F j
{(1, 0), (0, 1)} - {(0, 1)} = {(1, 0)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
analytically_valid s F j
{(1, 0), (0, 1)} - {(0, 1)} = {(1, 0)}

goal (1 subgoal):
 1. (\<lambda>x. integral UNIV (\<lambda>y. partial_vector_derivative F j (x, y) * indicator s (x, y))) \<in> borel_measurable lborel
[PROOF STEP]
by(simp add: real_pair_basis analytically_valid_def i_is_x_axis j_is_y_axis)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. integral UNIV (\<lambda>y. partial_vector_derivative F j (x, y) * indicator s (x, y))) \<in> borel_measurable lborel

goal:
No subgoals!
[PROOF STEP]
qed