[STATEMENT]
lemma bounded_linear_add:
  assumes "bounded_linear f"
    and "bounded_linear g"
  shows "bounded_linear (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f x + g x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f x + g x)
[PROOF STEP]
interpret f: bounded_linear f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f x + g x)
[PROOF STEP]
interpret g: bounded_linear g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear g
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f x + g x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f x + g x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>b1 b2. f (b1 + b2) + g (b1 + b2) = f b1 + g b1 + (f b2 + g b2)
 2. \<And>r b. f (r *\<^sub>R b) + g (r *\<^sub>R b) = r *\<^sub>R (f b + g b)
 3. \<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K
[PROOF STEP]
from f.bounded
[PROOF STATE]
proof (chain)
picking this:
\<exists>K. \<forall>x. norm (f x) \<le> norm x * K
[PROOF STEP]
obtain Kf where Kf: "norm (f x) \<le> norm x * Kf" for x
[PROOF STATE]
proof (prove)
using this:
\<exists>K. \<forall>x. norm (f x) \<le> norm x * K

goal (1 subgoal):
 1. (\<And>Kf. (\<And>x. norm (f x) \<le> norm x * Kf) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (f ?x) \<le> norm ?x * Kf

goal (3 subgoals):
 1. \<And>b1 b2. f (b1 + b2) + g (b1 + b2) = f b1 + g b1 + (f b2 + g b2)
 2. \<And>r b. f (r *\<^sub>R b) + g (r *\<^sub>R b) = r *\<^sub>R (f b + g b)
 3. \<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K
[PROOF STEP]
from g.bounded
[PROOF STATE]
proof (chain)
picking this:
\<exists>K. \<forall>x. norm (g x) \<le> norm x * K
[PROOF STEP]
obtain Kg where Kg: "norm (g x) \<le> norm x * Kg" for x
[PROOF STATE]
proof (prove)
using this:
\<exists>K. \<forall>x. norm (g x) \<le> norm x * K

goal (1 subgoal):
 1. (\<And>Kg. (\<And>x. norm (g x) \<le> norm x * Kg) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
norm (g ?x) \<le> norm ?x * Kg

goal (3 subgoals):
 1. \<And>b1 b2. f (b1 + b2) + g (b1 + b2) = f b1 + g b1 + (f b2 + g b2)
 2. \<And>r b. f (r *\<^sub>R b) + g (r *\<^sub>R b) = r *\<^sub>R (f b + g b)
 3. \<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K
[PROOF STEP]
show "\<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K
[PROOF STEP]
using add_mono[OF Kf Kg]
[PROOF STATE]
proof (prove)
using this:
norm (f ?x2) + norm (g ?x1) \<le> norm ?x2 * Kf + norm ?x1 * Kg

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K
[PROOF STEP]
by (intro exI[of _ "Kf + Kg"]) (auto simp: field_simps intro: norm_triangle_ineq order_trans)
[PROOF STATE]
proof (state)
this:
\<exists>K. \<forall>x. norm (f x + g x) \<le> norm x * K

goal (2 subgoals):
 1. \<And>b1 b2. f (b1 + b2) + g (b1 + b2) = f b1 + g b1 + (f b2 + g b2)
 2. \<And>r b. f (r *\<^sub>R b) + g (r *\<^sub>R b) = r *\<^sub>R (f b + g b)
[PROOF STEP]
qed (simp_all add: f.add g.add f.scaleR g.scaleR scaleR_right_distrib)
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>x. f x + g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_gcd_monic:
  fixes p :: "'a :: {field,factorial_ring_gcd,semiring_gcd_mult_normalize} poly"
  assumes "p \<noteq> 0 \<or> q \<noteq> 0"
  shows   "monic (gcd p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (gcd p q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monic (gcd p q)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0 \<or> q \<noteq> 0
[PROOF STEP]
have "1 = unit_factor (gcd p q)"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0 \<or> q \<noteq> 0

goal (1 subgoal):
 1. 1 = unit_factor (gcd p q)
[PROOF STEP]
by (auto simp: unit_factor_gcd)
[PROOF STATE]
proof (state)
this:
1 = unit_factor (gcd p q)

goal (1 subgoal):
 1. monic (gcd p q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = unit_factor (gcd p q)

goal (1 subgoal):
 1. monic (gcd p q)
[PROOF STEP]
have "\<dots> = [:lead_coeff (gcd p q):]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (gcd p q) = [:lead_coeff (gcd p q):]
[PROOF STEP]
unfolding unit_factor_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:unit_factor (lead_coeff (gcd p q)):] = [:lead_coeff (gcd p q):]
[PROOF STEP]
by (simp add: monom_0)
[PROOF STATE]
proof (state)
this:
unit_factor (gcd p q) = [:lead_coeff (gcd p q):]

goal (1 subgoal):
 1. monic (gcd p q)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 = [:lead_coeff (gcd p q):]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 = [:lead_coeff (gcd p q):]

goal (1 subgoal):
 1. monic (gcd p q)
[PROOF STEP]
by (metis coeff_pCons_0 degree_1 lead_coeff_1)
[PROOF STATE]
proof (state)
this:
monic (gcd p q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max2_iff:
assumes "a \<in> Field r" and "b \<in> Field r"
shows "((max2 a b, c) \<in> r) = ((a,c) \<in> r \<and> (b,c) \<in> r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((max2 a b, c) \<in> r) = ((a, c) \<in> r \<and> (b, c) \<in> r)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (max2 a b, c) \<in> r \<Longrightarrow> (a, c) \<in> r \<and> (b, c) \<in> r
 2. (a, c) \<in> r \<and> (b, c) \<in> r \<Longrightarrow> (max2 a b, c) \<in> r
[PROOF STEP]
assume "(max2 a b, c) \<in> r"
[PROOF STATE]
proof (state)
this:
(max2 a b, c) \<in> r

goal (2 subgoals):
 1. (max2 a b, c) \<in> r \<Longrightarrow> (a, c) \<in> r \<and> (b, c) \<in> r
 2. (a, c) \<in> r \<and> (b, c) \<in> r \<Longrightarrow> (max2 a b, c) \<in> r
[PROOF STEP]
thus "(a,c) \<in> r \<and> (b,c) \<in> r"
[PROOF STATE]
proof (prove)
using this:
(max2 a b, c) \<in> r

goal (1 subgoal):
 1. (a, c) \<in> r \<and> (b, c) \<in> r
[PROOF STEP]
using assms max2_greater[of a b] TRANS trans_def[of r]
[PROOF STATE]
proof (prove)
using this:
(max2 a b, c) \<in> r
a \<in> Field r
b \<in> Field r
\<lbrakk>a \<in> Field r; b \<in> Field r\<rbrakk> \<Longrightarrow> (a, max2 a b) \<in> r \<and> (b, max2 a 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. (a, c) \<in> r \<and> (b, c) \<in> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a, c) \<in> r \<and> (b, c) \<in> r

goal (1 subgoal):
 1. (a, c) \<in> r \<and> (b, c) \<in> r \<Longrightarrow> (max2 a b, c) \<in> r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a, c) \<in> r \<and> (b, c) \<in> r \<Longrightarrow> (max2 a b, c) \<in> r
[PROOF STEP]
assume "(a,c) \<in> r \<and> (b,c) \<in> r"
[PROOF STATE]
proof (state)
this:
(a, c) \<in> r \<and> (b, c) \<in> r

goal (1 subgoal):
 1. (a, c) \<in> r \<and> (b, c) \<in> r \<Longrightarrow> (max2 a b, c) \<in> r
[PROOF STEP]
thus "(max2 a b, c) \<in> r"
[PROOF STATE]
proof (prove)
using this:
(a, c) \<in> r \<and> (b, c) \<in> r

goal (1 subgoal):
 1. (max2 a b, c) \<in> r
[PROOF STEP]
using assms max2_among[of a b]
[PROOF STATE]
proof (prove)
using this:
(a, c) \<in> r \<and> (b, c) \<in> r
a \<in> Field r
b \<in> Field r
\<lbrakk>a \<in> Field r; b \<in> Field r\<rbrakk> \<Longrightarrow> max2 a b \<in> {a, b}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_cong_rev_iff[simp]:
  "(rev xs \<cong> rev ys) = (xs \<cong> ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev xs \<cong> rev ys = xs \<cong> ys
[PROOF STEP]
apply(simp add:congs_def rotate_rev)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>n. ys = rotate (length xs - n mod length xs) xs) = (\<exists>n. ys = rotate n xs)
[PROOF STEP]
apply(rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>n. ys = rotate (length xs - n mod length xs) xs \<Longrightarrow> \<exists>n. ys = rotate n xs
 2. \<exists>n. ys = rotate n xs \<Longrightarrow> \<exists>n. ys = rotate (length xs - n mod length xs) xs
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. ys = rotate n xs \<Longrightarrow> \<exists>n. ys = rotate (length xs - n mod length xs) xs
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. ys = rotate n xs \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply(cases "length xs = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs = 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
 2. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply(case_tac "n mod length xs = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs = 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
 2. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply(rule_tac x = "n" in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs = 0\<rbrakk> \<Longrightarrow> rotate n xs = rotate (length xs - n mod length xs) xs
 2. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate n xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply(subst rotate_conv_mod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>na. rotate (n mod length xs) xs = rotate (length xs - na mod length xs) xs
[PROOF STEP]
apply(rule_tac x = "length xs - n mod length xs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ys = rotate n xs; length xs \<noteq> 0; n mod length xs \<noteq> 0\<rbrakk> \<Longrightarrow> rotate (n mod length xs) xs = rotate (length xs - (length xs - n mod length xs) mod length xs) xs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bits_1_div_2 [simp]:
  \<open>1 div 2 = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) div (2::'a) = (0::'a)
[PROOF STEP]
using even_succ_div_2 [of 0]
[PROOF STATE]
proof (prove)
using this:
even (0::'a) \<Longrightarrow> ((1::'a) + (0::'a)) div (2::'a) = (0::'a) div (2::'a)

goal (1 subgoal):
 1. (1::'a) div (2::'a) = (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma prod_prime_subset:
  assumes "finite A" "finite B"
  assumes "\<And>x. x \<in> A \<Longrightarrow> prime (x::nat)"
  assumes "\<And>x. x \<in> B \<Longrightarrow> prime x"
  assumes "\<Prod>A dvd \<Prod>B"
  shows   "A \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
assume x: "x \<in> A"
[PROOF STATE]
proof (state)
this:
x \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
from assms(4)[of 0]
[PROOF STATE]
proof (chain)
picking this:
0 \<in> B \<Longrightarrow> prime 0
[PROOF STEP]
have "0 \<notin> B"
[PROOF STATE]
proof (prove)
using this:
0 \<in> B \<Longrightarrow> prime 0

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

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
0 \<notin> B
[PROOF STEP]
have nonzero: "\<forall>z\<in>B. z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
0 \<notin> B

goal (1 subgoal):
 1. \<forall>z\<in>B. z \<noteq> 0
[PROOF STEP]
by (intro ballI notI) auto
[PROOF STATE]
proof (state)
this:
\<forall>z\<in>B. z \<noteq> 0

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
from x assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
[PROOF STEP]
have "1 = multiplicity x (\<Prod>A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B

goal (1 subgoal):
 1. 1 = multiplicity x (\<Prod>A)
[PROOF STEP]
by (subst multiplicity_prod_prime_powers_nat') simp_all
[PROOF STATE]
proof (state)
this:
1 = multiplicity x (\<Prod>A)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = multiplicity x (\<Prod>A)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
from assms nonzero
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
\<forall>z\<in>B. z \<noteq> 0
[PROOF STEP]
have "\<dots> \<le> multiplicity x (\<Prod>B)"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
\<forall>z\<in>B. z \<noteq> 0

goal (1 subgoal):
 1. multiplicity x (\<Prod>A) \<le> multiplicity x (\<Prod>B)
[PROOF STEP]
by (intro dvd_imp_multiplicity_le) auto
[PROOF STATE]
proof (state)
this:
multiplicity x (\<Prod>A) \<le> multiplicity x (\<Prod>B)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 \<le> multiplicity x (\<Prod>B)
[PROOF STEP]
have "multiplicity x (\<Prod>B) > 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> multiplicity x (\<Prod>B)

goal (1 subgoal):
 1. 0 < multiplicity x (\<Prod>B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < multiplicity x (\<Prod>B)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < multiplicity x (\<Prod>B)

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
from assms x
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
x \<in> A
[PROOF STEP]
have "prime x"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A dvd \<Prod>B
x \<in> A

goal (1 subgoal):
 1. prime x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prime x

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < multiplicity x (\<Prod>B)
prime x
[PROOF STEP]
show "x \<in> B"
[PROOF STATE]
proof (prove)
using this:
0 < multiplicity x (\<Prod>B)
prime x

goal (1 subgoal):
 1. x \<in> B
[PROOF STEP]
using assms(2,4)
[PROOF STATE]
proof (prove)
using this:
0 < multiplicity x (\<Prod>B)
prime x
finite B
?x \<in> B \<Longrightarrow> prime ?x

goal (1 subgoal):
 1. x \<in> B
[PROOF STEP]
by (subst (asm) multiplicity_prod_prime_powers_nat') (simp_all split: if_split_asm)
[PROOF STATE]
proof (state)
this:
x \<in> B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adjacent_edges_not_on_path:
  assumes PATH: "isPath s p t"
  assumes VNV: "v\<notin>set (pathVertices_fwd s p)"
  shows "adjacent v \<inter> set p = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjacent v \<inter> set p = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. adjacent v \<inter> set p = {}
[PROOF STEP]
from VNV
[PROOF STATE]
proof (chain)
picking this:
v \<notin> set (pathVertices_fwd s p)
[PROOF STEP]
have "\<forall>u. (u,v)\<notin>set p \<and> (v,u)\<notin>set p"
[PROOF STATE]
proof (prove)
using this:
v \<notin> set (pathVertices_fwd s p)

goal (1 subgoal):
 1. \<forall>u. (u, v) \<notin> set p \<and> (v, u) \<notin> set p
[PROOF STEP]
by (auto dest: pathVertices_edge[OF PATH])
[PROOF STATE]
proof (state)
this:
\<forall>u. (u, v) \<notin> set p \<and> (v, u) \<notin> set p

goal (1 subgoal):
 1. adjacent v \<inter> set p = {}
[PROOF STEP]
thus "adjacent v \<inter> set p = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>u. (u, v) \<notin> set p \<and> (v, u) \<notin> set p

goal (1 subgoal):
 1. adjacent v \<inter> set p = {}
[PROOF STEP]
by (auto simp: incoming_def outgoing_def adjacent_def)
[PROOF STATE]
proof (state)
this:
adjacent v \<inter> set p = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Diff1_foldSetD:
  "\<lbrakk>(A - {x}, y) \<in> foldSetD D f e; x \<in> A; f x y \<in> D\<rbrakk> \<Longrightarrow>
   (A, f x y) \<in> foldSetD D f e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(A\<setminus>{x}, y) \<in> foldSetD D f e; x \<in> A; f x y \<in> D\<rbrakk> \<Longrightarrow> (A, f x y) \<in> foldSetD D f e
[PROOF STEP]
by (metis Diff_insert_absorb foldSetD.insertI mk_disjoint_insert)


[STATEMENT]
lemma fmmerge_commut:
  assumes "\<And>x y. x \<in> fmran' xm \<Longrightarrow> f x y = f y x"
  shows "fmmerge f xm ym = fmmerge f ym xm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmmerge f xm ym = fmmerge f ym xm
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fmmerge f xm ym = fmmerge f ym xm
[PROOF STEP]
obtain zm where zm: "zm = sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>zm. zm = sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zm = sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym)

goal (1 subgoal):
 1. fmmerge f xm ym = fmmerge f ym xm
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?x \<in> fmran' xm \<Longrightarrow> f ?x ?y = f ?y ?x
zm = sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym)
[PROOF STEP]
have
    "map (\<lambda>k. (k, f (the (fmlookup xm k)) (the (fmlookup ym k)))) zm =
     map (\<lambda>k. (k, f (the (fmlookup ym k)) (the (fmlookup xm k)))) zm"
[PROOF STATE]
proof (prove)
using this:
?x \<in> fmran' xm \<Longrightarrow> f ?x ?y = f ?y ?x
zm = sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym)

goal (1 subgoal):
 1. map (\<lambda>k. (k, f (the (fmlookup xm k)) (the (fmlookup ym k)))) zm = map (\<lambda>k. (k, f (the (fmlookup ym k)) (the (fmlookup xm k)))) zm
[PROOF STEP]
by (auto) (metis fmdom_notI fmran'I notin_fset option.collapse)
[PROOF STATE]
proof (state)
this:
map (\<lambda>k. (k, f (the (fmlookup xm k)) (the (fmlookup ym k)))) zm = map (\<lambda>k. (k, f (the (fmlookup ym k)) (the (fmlookup xm k)))) zm

goal (1 subgoal):
 1. fmmerge f xm ym = fmmerge f ym xm
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
map (\<lambda>k. (k, f (the (fmlookup xm k)) (the (fmlookup ym k)))) zm = map (\<lambda>k. (k, f (the (fmlookup ym k)) (the (fmlookup xm k)))) zm

goal (1 subgoal):
 1. fmmerge f xm ym = fmmerge f ym xm
[PROOF STEP]
unfolding fmmerge_def zm
[PROOF STATE]
proof (prove)
using this:
map (\<lambda>k. (k, f (the (fmlookup xm k)) (the (fmlookup ym k)))) (sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym)) = map (\<lambda>k. (k, f (the (fmlookup ym k)) (the (fmlookup xm k)))) (sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym))

goal (1 subgoal):
 1. fmap_of_list (map (\<lambda>k. (k, f (the (fmlookup xm k)) (the (fmlookup ym k)))) (sorted_list_of_fset (fmdom xm |\<inter>| fmdom ym))) = fmap_of_list (map (\<lambda>k. (k, f (the (fmlookup ym k)) (the (fmlookup xm k)))) (sorted_list_of_fset (fmdom ym |\<inter>| fmdom xm)))
[PROOF STEP]
by (metis (no_types, lifting) inf_commute)
[PROOF STATE]
proof (state)
this:
fmmerge f xm ym = fmmerge f ym xm

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_\<Delta>_trancl_set [simp]: "finite (\<Delta>_trancl_set \ \)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Delta>_trancl_set \ \)
[PROOF STEP]
using finite_subset[OF \<Delta>_trancl_set_states]
[PROOF STATE]
proof (prove)
using this:
finite (fset (\<Q> ?\1 |\<times>| \<Q> ?\1)) \<Longrightarrow> finite (\<Delta>_trancl_set ?\1 ?\1)

goal (1 subgoal):
 1. finite (\<Delta>_trancl_set \ \)
[PROOF STEP]
by simp


[STATEMENT]
lemma dim_le_card: assumes "V \<subseteq> span W" "finite W" shows "dim V \<le> card W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
obtain A where "independent A" "A \<subseteq> V" "V \<subseteq> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>independent A; A \<subseteq> V; V \<subseteq> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using maximal_independent_subset[of V]
[PROOF STATE]
proof (prove)
using this:
(\<And>B. \<lbrakk>B \<subseteq> V; independent B; V \<subseteq> span B\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>independent A; A \<subseteq> V; V \<subseteq> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
independent A
A \<subseteq> V
V \<subseteq> span A

goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
with assms independent_span_bound[of W A] basis_card_eq_dim[of A V]
[PROOF STATE]
proof (chain)
picking this:
V \<subseteq> span W
finite W
\<lbrakk>finite W; independent A; A \<subseteq> span W\<rbrakk> \<Longrightarrow> finite A \<and> card A \<le> card W
\<lbrakk>A \<subseteq> V; V \<subseteq> span A; independent A\<rbrakk> \<Longrightarrow> card A = dim V
independent A
A \<subseteq> V
V \<subseteq> span A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
V \<subseteq> span W
finite W
\<lbrakk>finite W; independent A; A \<subseteq> span W\<rbrakk> \<Longrightarrow> finite A \<and> card A \<le> card W
\<lbrakk>A \<subseteq> V; V \<subseteq> span A; independent A\<rbrakk> \<Longrightarrow> card A = dim V
independent A
A \<subseteq> V
V \<subseteq> span A

goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim V \<le> card W

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fset_card_induct:
  assumes empty_fset_case: "P {||}"
  and     card_fset_Suc_case: "\<And>S T. Suc (fcard S) = (fcard T) \<Longrightarrow> P S \<Longrightarrow> P T"
  shows "P S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P S
[PROOF STEP]
proof (induct S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P {||}
 2. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. P {||}
 2. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
show "P {||}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P {||}
[PROOF STEP]
by (rule empty_fset_case)
[PROOF STATE]
proof (state)
this:
P {||}

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
case (insert x S)
[PROOF STATE]
proof (state)
this:
x |\<notin>| S
P S

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
have h: "P S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P S
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
P S

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
have "x |\<notin>| S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<notin>| S
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
x |\<notin>| S

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x |\<notin>| S
[PROOF STEP]
have "Suc (fcard S) = fcard (finsert x S)"
[PROOF STATE]
proof (prove)
using this:
x |\<notin>| S

goal (1 subgoal):
 1. Suc (fcard S) = fcard (finsert x S)
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (state)
this:
Suc (fcard S) = fcard (finsert x S)

goal (1 subgoal):
 1. \<And>x S. \<lbrakk>x |\<notin>| S; P S\<rbrakk> \<Longrightarrow> P (finsert x S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc (fcard S) = fcard (finsert x S)
[PROOF STEP]
show "P (finsert x S)"
[PROOF STATE]
proof (prove)
using this:
Suc (fcard S) = fcard (finsert x S)

goal (1 subgoal):
 1. P (finsert x S)
[PROOF STEP]
using h card_fset_Suc_case
[PROOF STATE]
proof (prove)
using this:
Suc (fcard S) = fcard (finsert x S)
P S
\<lbrakk>Suc (fcard ?S) = fcard ?T; P ?S\<rbrakk> \<Longrightarrow> P ?T

goal (1 subgoal):
 1. P (finsert x S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P (finsert x S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma acc_lengths_merge1:
  assumes "merge as bs us vs"
  shows "list.set (acc_lengths k us) \<subseteq> list.set (acc_lengths k as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list.set (acc_lengths k us) \<subseteq> list.set (acc_lengths k as)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
merge as bs us vs

goal (1 subgoal):
 1. list.set (acc_lengths k us) \<subseteq> list.set (acc_lengths k as)
[PROOF STEP]
proof (induction arbitrary: k)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>k. list.set (acc_lengths k []) \<subseteq> list.set (acc_lengths k [])
 2. \<And>as k. as \<noteq> [] \<Longrightarrow> list.set (acc_lengths k [concat as]) \<subseteq> list.set (acc_lengths k as)
 3. \<And>as1 bs1 as2 bs2 as bs k. \<lbrakk>as1 \<noteq> []; bs1 \<noteq> []; concat as1 < concat bs1; concat bs1 < concat as2; merge as2 bs2 as bs; \<And>k. list.set (acc_lengths k as) \<subseteq> list.set (acc_lengths k as2)\<rbrakk> \<Longrightarrow> list.set (acc_lengths k (concat as1 # as)) \<subseteq> list.set (acc_lengths k (as1 @ as2))
[PROOF STEP]
case (App as1 bs1 as2 bs2 as bs)
[PROOF STATE]
proof (state)
this:
as1 \<noteq> []
bs1 \<noteq> []
concat as1 < concat bs1
concat bs1 < concat as2
merge as2 bs2 as bs
list.set (acc_lengths ?k as) \<subseteq> list.set (acc_lengths ?k as2)

goal (3 subgoals):
 1. \<And>k. list.set (acc_lengths k []) \<subseteq> list.set (acc_lengths k [])
 2. \<And>as k. as \<noteq> [] \<Longrightarrow> list.set (acc_lengths k [concat as]) \<subseteq> list.set (acc_lengths k as)
 3. \<And>as1 bs1 as2 bs2 as bs k. \<lbrakk>as1 \<noteq> []; bs1 \<noteq> []; concat as1 < concat bs1; concat bs1 < concat as2; merge as2 bs2 as bs; \<And>k. list.set (acc_lengths k as) \<subseteq> list.set (acc_lengths k as2)\<rbrakk> \<Longrightarrow> list.set (acc_lengths k (concat as1 # as)) \<subseteq> list.set (acc_lengths k (as1 @ as2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
as1 \<noteq> []
bs1 \<noteq> []
concat as1 < concat bs1
concat bs1 < concat as2
merge as2 bs2 as bs
list.set (acc_lengths ?k as) \<subseteq> list.set (acc_lengths ?k as2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
as1 \<noteq> []
bs1 \<noteq> []
concat as1 < concat bs1
concat bs1 < concat as2
merge as2 bs2 as bs
list.set (acc_lengths ?k as) \<subseteq> list.set (acc_lengths ?k as2)

goal (1 subgoal):
 1. list.set (acc_lengths k (concat as1 # as)) \<subseteq> list.set (acc_lengths k (as1 @ as2))
[PROOF STEP]
apply (simp add: acc_lengths_append strict_sorted_append_iff length_concat_acc_lengths)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>as1 \<noteq> []; bs1 \<noteq> []; concat as1 < concat bs1; concat bs1 < concat as2; merge as2 bs2 as bs; \<And>k. list.set (acc_lengths k as) \<subseteq> list.set (acc_lengths k as2)\<rbrakk> \<Longrightarrow> list.set (acc_lengths (k + length (concat as1)) as) \<subseteq> list.set (acc_lengths k as1) \<union> list.set (acc_lengths (k + sum_list (map length as1)) as2)
[PROOF STEP]
by (simp add: le_supI2 length_concat)
[PROOF STATE]
proof (state)
this:
list.set (acc_lengths k (concat as1 # as)) \<subseteq> list.set (acc_lengths k (as1 @ as2))

goal (2 subgoals):
 1. \<And>k. list.set (acc_lengths k []) \<subseteq> list.set (acc_lengths k [])
 2. \<And>as k. as \<noteq> [] \<Longrightarrow> list.set (acc_lengths k [concat as]) \<subseteq> list.set (acc_lengths k as)
[PROOF STEP]
qed (auto simp: length_concat_acc_lengths)


[STATEMENT]
lemma equiv_inject:
  assumes "equiv A R" "equiv B R"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
equiv A R
equiv B R
[PROOF STEP]
have "R \<subseteq> A \<times> A" "R \<subseteq> B \<times> B"
[PROOF STATE]
proof (prove)
using this:
equiv A R
equiv B R

goal (1 subgoal):
 1. R \<subseteq> A \<times> A &&& R \<subseteq> B \<times> B
[PROOF STEP]
by (simp add: equiv_type)+
[PROOF STATE]
proof (state)
this:
R \<subseteq> A \<times> A
R \<subseteq> B \<times> B

goal (1 subgoal):
 1. A = B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
R \<subseteq> A \<times> A
R \<subseteq> B \<times> B

goal (1 subgoal):
 1. A = B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
equiv A R
equiv B R
[PROOF STEP]
have "\<forall>x\<in>A. (x, x) \<in> R" "\<forall>x\<in>B. (x, x) \<in> R"
[PROOF STATE]
proof (prove)
using this:
equiv A R
equiv B R

goal (1 subgoal):
 1. \<forall>x\<in>A. (x, x) \<in> R &&& \<forall>x\<in>B. (x, x) \<in> R
[PROOF STEP]
by (simp add: eq_equiv_class)+
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>A. (x, x) \<in> R
\<forall>x\<in>B. (x, x) \<in> R

goal (1 subgoal):
 1. A = B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
R \<subseteq> A \<times> A
R \<subseteq> B \<times> B
\<forall>x\<in>A. (x, x) \<in> R
\<forall>x\<in>B. (x, x) \<in> R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> A \<times> A
R \<subseteq> B \<times> B
\<forall>x\<in>A. (x, x) \<in> R
\<forall>x\<in>B. (x, x) \<in> R

goal (1 subgoal):
 1. A = B
[PROOF STEP]
using mem_Sigma_iff subset_antisym subset_eq
[PROOF STATE]
proof (prove)
using this:
R \<subseteq> A \<times> A
R \<subseteq> B \<times> B
\<forall>x\<in>A. (x, x) \<in> R
\<forall>x\<in>B. (x, x) \<in> R
((?a, ?b) \<in> Sigma ?A ?B) = (?a \<in> ?A \<and> ?b \<in> ?B ?a)
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> ?A = ?B
(?A \<subseteq> ?B) = (\<forall>x\<in>?A. x \<in> ?B)

goal (1 subgoal):
 1. A = B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A = B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sq_mtx_one_ith_simps[simp]: "1 $$ i $ i = 1" "i \<noteq> j \<Longrightarrow> 1 $$ i $ j = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 $$ i $ i = 1 &&& (i \<noteq> j \<Longrightarrow> 1 $$ i $ j = 0)
[PROOF STEP]
unfolding one_sq_mtx_def mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id (to_mtx (\<chi>i j. if i = j then 1 else 0)) $$ i $ i = 1 &&& (i \<noteq> j \<Longrightarrow> id (to_mtx (\<chi>i j. if i = j then 1 else 0)) $$ i $ j = 0)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma VUnion_mono:
  assumes "A \<subseteq>\<^sub>\<circ> B"
  shows "\<Union>\<^sub>\<circ>A \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq>\<^sub>\<circ> B

goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> B
[PROOF STEP]
by auto


[STATEMENT]
lemma has_real_derivative_pos_inc_right:
  fixes f :: "real \<Rightarrow> real"
  assumes der: "(f has_real_derivative l) (at x within S)"
    and l: "0 < l"
  shows "\<exists>d > 0. \<forall>h > 0. x + h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x + h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x + h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x + h)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_real_derivative l) (at x within S)
0 < l

goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x + h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x + h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
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 < f (x + h)
[PROOF STEP]
from der [THEN has_field_derivativeD, THEN tendstoD, OF l, unfolded eventually_at]
[PROOF STATE]
proof (chain)
picking this:
\<exists>d>0. \<forall>xa\<in>S. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> dist ((f xa - f x) / (xa - x)) l < l
[PROOF STEP]
obtain s where s: "0 < s"
    and all: "\<And>xa. xa\<in>S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l"
[PROOF STATE]
proof (prove)
using this:
\<exists>d>0. \<forall>xa\<in>S. xa \<noteq> x \<and> dist xa x < d \<longrightarrow> dist ((f xa - f x) / (xa - x)) l < l

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: dist_real_def)
[PROOF STATE]
proof (state)
this:
0 < s
?xa \<in> S \<Longrightarrow> ?xa \<noteq> x \<and> dist ?xa x < s \<longrightarrow> \<bar>(f ?xa - f x) / (?xa - x) - l\<bar> < l

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 < f (x + h)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < s
?xa \<in> S \<Longrightarrow> ?xa \<noteq> x \<and> dist ?xa x < s \<longrightarrow> \<bar>(f ?xa - f x) / (?xa - x) - l\<bar> < l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < s
?xa \<in> S \<Longrightarrow> ?xa \<noteq> x \<and> dist ?xa x < s \<longrightarrow> \<bar>(f ?xa - f x) / (?xa - x) - l\<bar> < l

goal (1 subgoal):
 1. \<exists>d>0. \<forall>h>0. x + h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x + h)
[PROOF STEP]
proof (intro exI conjI strip)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l\<rbrakk> \<Longrightarrow> 0 < ?d3
 2. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l; 0 < h; x + h \<in> S; h < ?d3\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
show "0 < s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < s
[PROOF STEP]
by (rule s)
[PROOF STATE]
proof (state)
this:
0 < s

goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l; 0 < h; x + h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l; 0 < h; x + h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
fix h :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l; 0 < h; x + h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
assume "0 < h" "h < s" "x + h \<in> S"
[PROOF STATE]
proof (state)
this:
0 < h
h < s
x + h \<in> S

goal (1 subgoal):
 1. \<And>h. \<lbrakk>0 < s; \<And>xa. xa \<in> S \<Longrightarrow> xa \<noteq> x \<and> dist xa x < s \<longrightarrow> \<bar>(f xa - f x) / (xa - x) - l\<bar> < l; 0 < h; x + h \<in> S; h < s\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
with all [of "x + h"]
[PROOF STATE]
proof (chain)
picking this:
x + h \<in> S \<Longrightarrow> x + h \<noteq> x \<and> dist (x + h) x < s \<longrightarrow> \<bar>(f (x + h) - f x) / (x + h - x) - l\<bar> < l
0 < h
h < s
x + h \<in> S
[PROOF STEP]
show "f x < f (x+h)"
[PROOF STATE]
proof (prove)
using this:
x + h \<in> S \<Longrightarrow> x + h \<noteq> x \<and> dist (x + h) x < s \<longrightarrow> \<bar>(f (x + h) - f x) / (x + h - x) - l\<bar> < l
0 < h
h < s
x + h \<in> S

goal (1 subgoal):
 1. f x < f (x + h)
[PROOF STEP]
proof (simp add: abs_if dist_real_def pos_less_divide_eq split: if_split_asm)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>0 < h; h < s; x + h \<in> S; \<not> (f (x + h) - f x) / h < l; (f (x + h) - f x) / h < 2 * l\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
assume "\<not> (f (x + h) - f x) / h < l" and h: "0 < h"
[PROOF STATE]
proof (state)
this:
\<not> (f (x + h) - f x) / h < l
0 < h

goal (1 subgoal):
 1. \<lbrakk>0 < h; h < s; x + h \<in> S; \<not> (f (x + h) - f x) / h < l; (f (x + h) - f x) / h < 2 * l\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
with l
[PROOF STATE]
proof (chain)
picking this:
0 < l
\<not> (f (x + h) - f x) / h < l
0 < h
[PROOF STEP]
have "0 < (f (x + h) - f x) / h"
[PROOF STATE]
proof (prove)
using this:
0 < l
\<not> (f (x + h) - f x) / h < l
0 < h

goal (1 subgoal):
 1. 0 < (f (x + h) - f x) / h
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
0 < (f (x + h) - f x) / h

goal (1 subgoal):
 1. \<lbrakk>0 < h; h < s; x + h \<in> S; \<not> (f (x + h) - f x) / h < l; (f (x + h) - f x) / h < 2 * l\<rbrakk> \<Longrightarrow> f x < f (x + h)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < (f (x + h) - f x) / h
[PROOF STEP]
show "f x < f (x + h)"
[PROOF STATE]
proof (prove)
using this:
0 < (f (x + h) - f x) / h

goal (1 subgoal):
 1. f x < f (x + h)
[PROOF STEP]
by (simp add: pos_less_divide_eq h)
[PROOF STATE]
proof (state)
this:
f x < f (x + h)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f x < f (x + h)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>h>0. x + h \<in> S \<longrightarrow> h < d \<longrightarrow> f x < f (x + h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_injective_linear_image:
    fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
    assumes S: "closed S" and f: "linear f" "inj f"
    shows "closed (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
obtain g where g: "linear g" "g \<circ> f = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>linear g; g \<circ> f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using linear_injective_left_inverse [OF f]
[PROOF STATE]
proof (prove)
using this:
\<exists>g. linear g \<and> g \<circ> f = id

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>linear g; g \<circ> f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
linear g
g \<circ> f = id

goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
linear g
g \<circ> f = id
[PROOF STEP]
have confg: "continuous_on (range f) g"
[PROOF STATE]
proof (prove)
using this:
linear g
g \<circ> f = id

goal (1 subgoal):
 1. continuous_on (range f) g
[PROOF STEP]
using linear_continuous_on linear_conv_bounded_linear
[PROOF STATE]
proof (prove)
using this:
linear g
g \<circ> f = id
bounded_linear ?f \<Longrightarrow> continuous_on ?s ?f
linear ?f = bounded_linear ?f

goal (1 subgoal):
 1. continuous_on (range f) g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on (range f) g

goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
have [simp]: "g ` f ` S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` f ` S = S
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
linear g
g \<circ> f = id

goal (1 subgoal):
 1. g ` f ` S = S
[PROOF STEP]
by (simp add: image_comp)
[PROOF STATE]
proof (state)
this:
g ` f ` S = S

goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
have cgf: "closed (g ` f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (g ` f ` S)
[PROOF STEP]
by (simp add: \<open>g \<circ> f = id\<close> S image_comp)
[PROOF STATE]
proof (state)
this:
closed (g ` f ` S)

goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
have [simp]: "(range f \<inter> g -` S) = f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f \<inter> g -` S = f ` S
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
linear g
g \<circ> f = id

goal (1 subgoal):
 1. range f \<inter> g -` S = f ` S
[PROOF STEP]
unfolding o_def id_def image_def
[PROOF STATE]
proof (prove)
using this:
linear g
(\<lambda>x. g (f x)) = (\<lambda>x. x)

goal (1 subgoal):
 1. {y. \<exists>x\<in>UNIV. y = f x} \<inter> g -` S = {y. \<exists>x\<in>S. y = f x}
[PROOF STEP]
by auto metis+
[PROOF STATE]
proof (state)
this:
range f \<inter> g -` S = f ` S

goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (f ` S)
[PROOF STEP]
proof (rule closedin_closed_trans [of "range f"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. closedin (top_of_set (range f)) (f ` S)
 2. closed (range f)
[PROOF STEP]
show "closedin (top_of_set (range f)) (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set (range f)) (f ` S)
[PROOF STEP]
using continuous_closedin_preimage [OF confg cgf]
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set (range f)) (range f \<inter> g -` g ` f ` S)

goal (1 subgoal):
 1. closedin (top_of_set (range f)) (f ` S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closedin (top_of_set (range f)) (f ` S)

goal (1 subgoal):
 1. closed (range f)
[PROOF STEP]
show "closed (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (range f)
[PROOF STEP]
apply (rule closed_injective_image_subspace)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. subspace UNIV
 2. bounded_linear f
 3. \<forall>x\<in>UNIV. f x = (0::'b) \<longrightarrow> x = (0::'a)
 4. closed UNIV
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
linear f
inj f

goal (4 subgoals):
 1. subspace UNIV
 2. bounded_linear f
 3. \<forall>x\<in>UNIV. f x = (0::'b) \<longrightarrow> x = (0::'a)
 4. closed UNIV
[PROOF STEP]
apply (auto simp: linear_linear linear_injective_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
closed (range f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closed (f ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_le_antisym: "\<lbrakk> f \<subseteq>\<^sub>m g; g \<subseteq>\<^sub>m f \<rbrakk> \<Longrightarrow> f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<subseteq>\<^sub>m g; g \<subseteq>\<^sub>m f\<rbrakk> \<Longrightarrow> f = g
[PROOF STEP]
unfolding map_le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a\<in>dom f. f a = g a; \<forall>a\<in>dom g. g a = f a\<rbrakk> \<Longrightarrow> f = g
[PROOF STEP]
by (metis ext domIff)


[STATEMENT]
lemma semiconnex_irreflexive_cong:
  assumes r: "\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> r a b \<longleftrightarrow> r' a b"
  shows "semiconnex_irreflexive A r \<longleftrightarrow> semiconnex_irreflexive A r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semiconnex_irreflexive A r = semiconnex_irreflexive A r'
[PROOF STEP]
by (simp add: semiconnex_irreflexive_def r cong: semiconnex_cong irreflexive_cong)


[STATEMENT]
lemma [simp, nitpick_simp]:
  shows tlength_TNil: "tlength (TNil b) = 0"
  and tlength_TCons: "tlength (TCons x xs) = eSuc (tlength xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tlength (TNil b) = 0 &&& tlength (TCons x xs) = eSuc (tlength xs)
[PROOF STEP]
apply(transfer, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tlength (TCons x xs) = eSuc (tlength xs)
[PROOF STEP]
apply(transfer, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma elem_permutation_of_mset_empty_iff: "xs \<in> permutations_of_multiset A \<Longrightarrow> xs = [] \<longleftrightarrow> A = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> permutations_of_multiset A \<Longrightarrow> (xs = []) = (A = {#})
[PROOF STEP]
using permutations_of_multisetD
[PROOF STATE]
proof (prove)
using this:
?xs \<in> permutations_of_multiset ?A \<Longrightarrow> mset ?xs = ?A

goal (1 subgoal):
 1. xs \<in> permutations_of_multiset A \<Longrightarrow> (xs = []) = (A = {#})
[PROOF STEP]
by fastforce


[STATEMENT]
lemma two:  "2 \<times> x = x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
have       "2 = Suc(Suc(0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 = Suc (Suc 0)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
2 = Suc (Suc 0)

goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
hence      "2 \<times> x = Suc(Suc(0)) \<times> x"
[PROOF STATE]
proof (prove)
using this:
2 = Suc (Suc 0)

goal (1 subgoal):
 1. 2 \<times> x = Suc (Suc 0) \<times> x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
2 \<times> x = Suc (Suc 0) \<times> x

goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 \<times> x = Suc (Suc 0) \<times> x

goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
have  "\<dots> = x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (Suc 0) \<times> x = x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (Suc 0) \<times> x = x \<squnion> x

goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 \<times> x = x \<squnion> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 \<times> x = x \<squnion> x

goal (1 subgoal):
 1. 2 \<times> x = x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 \<times> x = x \<squnion> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma similar_matrix_simm: "A \<sim> B \<Longrightarrow> B \<sim> A" for A B :: "('a::semiring_1)^'n^'n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<sim> B \<Longrightarrow> B \<sim> A
[PROOF STEP]
apply(unfold similar_matrix_def, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. \<lbrakk>invertible P; A = P\<^sup>-\<^sup>1 ** B ** P\<rbrakk> \<Longrightarrow> \<exists>Pa. invertible Pa \<and> B = Pa\<^sup>-\<^sup>1 ** (P\<^sup>-\<^sup>1 ** B ** P) ** Pa
[PROOF STEP]
apply(rule_tac x="P\<^sup>-\<^sup>1" in exI, simp add: invertible_matrix_inv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. \<lbrakk>invertible P; A = P\<^sup>-\<^sup>1 ** B ** P\<rbrakk> \<Longrightarrow> B = P ** (P\<^sup>-\<^sup>1 ** B ** P) ** P\<^sup>-\<^sup>1
[PROOF STEP]
by (metis invertible_def matrix_inv_unique matrix_mul_assoc matrix_mul_lid matrix_mul_rid)


[STATEMENT]
lemma cyclic_group_commute:
  assumes "a \<in> carrier G" "b \<in> carrier G"
  shows "a \<otimes> b = b \<otimes> a"
(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
obtain n :: nat where n: "a = \<^bold>g [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. a = \<^bold>g [^] n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using generatorE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. (\<And>n. a = \<^bold>g [^] n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = \<^bold>g [^] n

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a = \<^bold>g [^] n

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
obtain k :: nat where k: "b = \<^bold>g [^] k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. b = \<^bold>g [^] k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using generatorE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. (\<And>k. b = \<^bold>g [^] k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = \<^bold>g [^] k

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = \<^bold>g [^] n
b = \<^bold>g [^] k
[PROOF STEP]
have "?lhs =  \<^bold>g [^] n \<otimes> \<^bold>g [^] k"
[PROOF STATE]
proof (prove)
using this:
a = \<^bold>g [^] n
b = \<^bold>g [^] k

goal (1 subgoal):
 1. a \<otimes> b = \<^bold>g [^] n \<otimes> \<^bold>g [^] k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<otimes> b = \<^bold>g [^] n \<otimes> \<^bold>g [^] k

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes> b = \<^bold>g [^] n \<otimes> \<^bold>g [^] k
[PROOF STEP]
have "... = \<^bold>g [^] (n + k)"
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b = \<^bold>g [^] n \<otimes> \<^bold>g [^] k

goal (1 subgoal):
 1. \<^bold>g [^] n \<otimes> \<^bold>g [^] k = \<^bold>g [^] (n + k)
[PROOF STEP]
by(simp add: nat_pow_mult)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] n \<otimes> \<^bold>g [^] k = \<^bold>g [^] (n + k)

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] n \<otimes> \<^bold>g [^] k = \<^bold>g [^] (n + k)
[PROOF STEP]
have "... = \<^bold>g [^] (k + n)"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] n \<otimes> \<^bold>g [^] k = \<^bold>g [^] (n + k)

goal (1 subgoal):
 1. \<^bold>g [^] (n + k) = \<^bold>g [^] (k + n)
[PROOF STEP]
by(simp add: add.commute)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (n + k) = \<^bold>g [^] (k + n)

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] (n + k) = \<^bold>g [^] (k + n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (n + k) = \<^bold>g [^] (k + n)

goal (1 subgoal):
 1. a \<otimes> b = b \<otimes> a
[PROOF STEP]
by(simp add: nat_pow_mult n k)
[PROOF STATE]
proof (state)
this:
a \<otimes> b = b \<otimes> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_one_mat_div_mod:
  assumes "i < 2^(m+n)" and "j < 2^(m+n)"
  shows "((1\<^sub>m(2^m) $$ (i div 2^n, j div 2^n))::complex) * 1\<^sub>m(2^n) $$ (i mod 2^n, j mod 2^n) = 1\<^sub>m(2^(m+n)) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
proof (cases "i = j")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
 2. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = j

goal (2 subgoals):
 1. i = j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
 2. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = j

goal (1 subgoal):
 1. 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
by(simp add: assms)
[PROOF STATE]
proof (state)
this:
1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
case c1:False
[PROOF STATE]
proof (state)
this:
i \<noteq> j

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
have "i div 2^n \<noteq> j div 2^n \<or> i mod 2^n \<noteq> j mod 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div 2 ^ n \<noteq> j div 2 ^ n \<or> i mod 2 ^ n \<noteq> j mod 2 ^ n
[PROOF STEP]
using c1 neq_imp_neq_div_or_mod
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j
?i \<noteq> ?j \<Longrightarrow> ?i div 2 ^ ?n \<noteq> ?j div 2 ^ ?n \<or> ?i mod 2 ^ ?n \<noteq> ?j mod 2 ^ ?n

goal (1 subgoal):
 1. i div 2 ^ n \<noteq> j div 2 ^ n \<or> i mod 2 ^ n \<noteq> j mod 2 ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i div 2 ^ n \<noteq> j div 2 ^ n \<or> i mod 2 ^ n \<noteq> j mod 2 ^ n

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i div 2 ^ n \<noteq> j div 2 ^ n \<or> i mod 2 ^ n \<noteq> j mod 2 ^ n
[PROOF STEP]
have "1\<^sub>m (2^m) $$ (i div 2^n, j div 2^n) = 0 \<or> 1\<^sub>m (2^n) $$ (i mod 2^n, j mod 2^n) = 0"
[PROOF STATE]
proof (prove)
using this:
i div 2 ^ n \<noteq> j div 2 ^ n \<or> i mod 2 ^ n \<noteq> j mod 2 ^ n

goal (1 subgoal):
 1. 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) = (0::'a) \<or> 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = (0::'b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i div 2 ^ n \<noteq> j div 2 ^ n \<or> i mod 2 ^ n \<noteq> j mod 2 ^ n
i < 2 ^ (m + n)
j < 2 ^ (m + n)

goal (1 subgoal):
 1. 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) = (0::'a) \<or> 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) = (0::?'a1) \<or> 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = (0::?'b1)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) = (0::?'a1) \<or> 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = (0::?'b1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) = (0::?'a1) \<or> 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = (0::?'b1)

goal (1 subgoal):
 1. 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) = (0::?'a1) \<or> 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = (0::?'b1)
i < 2 ^ (m + n)
j < 2 ^ (m + n)

goal (1 subgoal):
 1. 1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)
[PROOF STEP]
by (simp add: c1)
[PROOF STATE]
proof (state)
this:
1\<^sub>m (2 ^ m) $$ (i div 2 ^ n, j div 2 ^ n) * 1\<^sub>m (2 ^ n) $$ (i mod 2 ^ n, j mod 2 ^ n) = 1\<^sub>m (2 ^ (m + n)) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smcf_cn_comp_ObjMap_app[smc_cn_cs_simps]:
  assumes "\<GG> : \<BB> \<^sub>S\<^sub>M\<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<CC>" and "\<FF> : \<AA> \<^sub>S\<^sub>M\<^sub>C\<mapsto>\<mapsto>\<^bsub>\<alpha>\<^esub> \<BB>" and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>"
  shows "(\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret L: is_semifunctor \<alpha> \<open>op_smc \<BB>\<close> \<CC> \<GG>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<GG> : op_smc \<BB> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
interpret R: is_semifunctor \<alpha> \<open>op_smc \<AA>\<close> \<BB> \<FF>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<FF> : op_smc \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>
[PROOF STEP]
by (rule assms(2))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>
[PROOF STEP]
by
      (
        rule dghm_cn_comp_ObjMap_app
          [
            OF
              L.smcf_is_dghm[unfolded slicing_commute[symmetric]]
              R.smcf_is_dghm[unfolded slicing_commute[symmetric]],
            unfolded slicing_commute slicing_simps,
            OF assms(3)
          ]
      )
[PROOF STATE]
proof (state)
this:
(\<GG> \<^sub>S\<^sub>M\<^sub>C\<^sub>F\<circ> \<FF>)\<lparr>ObjMap\<rparr>\<lparr>a\<rparr> = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>a\<rparr>\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_induct[case_names Var Op Abs]:
assumes
Var: "\<And> xs x. phi (asSort xs) (Var xs x)" and
Op:
"\<And> delta inp binp.
   \<lbrakk>wlsInp delta inp; wlsBinp delta binp;
    liftAll2 phi (arOf delta) inp; liftAll2 phiAbs (barOf delta) binp\<rbrakk>
   \<Longrightarrow> phi (stOf delta) (Op delta inp binp)" and
Abs:
"\<And> s xs x X.
   \<lbrakk>isInBar (xs,s); wls s X;
    \<And> Y. (X,Y) \<in> swapped \<Longrightarrow> phi s Y;
    \<And> ys y1 y2. phi s (X #[y1 // y2]_ys);
    \<And> Y. \<lbrakk>wls s Y; skel Y = skel X\<rbrakk> \<Longrightarrow> phi s Y\<rbrakk>
   \<Longrightarrow> phiAbs (xs,s) (Abs xs x X)"
shows
"(wls s X \<longrightarrow> phi s X) \<and>
 (wlsAbs (xs,s') A \<longrightarrow> phiAbs (xs,s') A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (wls s X \<longrightarrow> phi s X) \<and> (wlsAbs (xs, s') A \<longrightarrow> phiAbs (xs, s') A)
[PROOF STEP]
apply(induction rule: wls_templateInduct
[of "\<lambda>s. swapped \<union> {(X, X #[y1 // y2]_ys)| X ys y1 y2. True}
         \<union> {(X,Y). wls s Y \<and> skel Y = skel X}"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>s X Y. \<lbrakk>wls s X; (X, Y) \<in> swapped \<union> {(X, X #[y1 // y2]_ys) |X ys y1 y2. True} \<union> {(X, Y). wls s Y \<and> skel Y = skel X}\<rbrakk> \<Longrightarrow> wls s Y \<and> skel Y = skel X
 2. \<And>xs x. phi (asSort xs) (Var xs x)
 3. \<And>delta inp binp. \<lbrakk>wlsInp delta inp; wlsBinp delta binp; liftAll2 phi (arOf delta) inp; liftAll2 phiAbs (barOf delta) binp\<rbrakk> \<Longrightarrow> phi (stOf delta) (Op delta inp binp)
 4. \<And>s xs x X. \<lbrakk>isInBar (xs, s); wls s X; \<And>Y. (X, Y) \<in> swapped \<union> {(X, X #[y1 // y2]_ys) |X ys y1 y2. True} \<union> {(X, Y). wls s Y \<and> skel Y = skel X} \<Longrightarrow> phi s Y\<rbrakk> \<Longrightarrow> phiAbs (xs, s) (Abs xs x X)
[PROOF STEP]
by (auto simp add: assms swapped_preserves_wls swapped_skel wls_skel_vsubst
   intro!: Abs)


[STATEMENT]
lemma complement_rep_number:
  assumes "x \<in> \<V>" and "\<B> rep x = r"
  shows  "\<B>\<^sup>C rep x = \<b> - r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
have r: "size {#b \<in># \<B> . x \<in> b#} = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset ((\<in>) x) \<B>) = r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> \<V>
\<B> rep x = r

goal (1 subgoal):
 1. size (filter_mset ((\<in>) x) \<B>) = r
[PROOF STEP]
by (simp add: point_replication_number_def)
[PROOF STATE]
proof (state)
this:
size (filter_mset ((\<in>) x) \<B>) = r

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
size (filter_mset ((\<in>) x) \<B>) = r
[PROOF STEP]
have a: "\<And> b . b \<in># \<B> \<Longrightarrow> x \<in> b \<Longrightarrow> x \<notin> b\<^sup>c"
[PROOF STATE]
proof (prove)
using this:
size (filter_mset ((\<in>) x) \<B>) = r

goal (1 subgoal):
 1. \<And>b. \<lbrakk>b \<in># \<B>; x \<in> b\<rbrakk> \<Longrightarrow> x \<notin> b\<^sup>c
[PROOF STEP]
by (simp add: block_complement_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<in># \<B>; x \<in> ?b\<rbrakk> \<Longrightarrow> x \<notin> ?b\<^sup>c

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
have "\<And> b . b \<in># \<B> \<Longrightarrow> x \<notin> b \<Longrightarrow> x \<in> b\<^sup>c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>b \<in># \<B>; x \<notin> b\<rbrakk> \<Longrightarrow> x \<in> b\<^sup>c
[PROOF STEP]
by (simp add: assms(1) block_complement_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b\<rbrakk> \<Longrightarrow> x \<in> ?b\<^sup>c

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b\<rbrakk> \<Longrightarrow> x \<in> ?b\<^sup>c
[PROOF STEP]
have alt: "(image_mset block_complement \<B>) rep x = size {#b \<in># \<B> . x \<notin> b#}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b\<rbrakk> \<Longrightarrow> x \<in> ?b\<^sup>c

goal (1 subgoal):
 1. image_mset block_complement \<B> rep x = size (filter_mset ((\<notin>) x) \<B>)
[PROOF STEP]
using a filter_mset_cong image_mset_filter_swap2 point_replication_number_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?b \<in># \<B>; x \<notin> ?b\<rbrakk> \<Longrightarrow> x \<in> ?b\<^sup>c
\<lbrakk>?b \<in># \<B>; x \<in> ?b\<rbrakk> \<Longrightarrow> x \<notin> ?b\<^sup>c
\<lbrakk>?M = ?M'; \<And>a. a \<in># ?M \<Longrightarrow> ?P a = ?Q a\<rbrakk> \<Longrightarrow> filter_mset ?P ?M = filter_mset ?Q ?M
filter_mset ?Q (image_mset ?P ?D) = image_mset ?P {#C. C \<in># {#C \<in># ?D. ?Q (?P C)#}#}
?B rep ?x \<equiv> size (filter_mset ((\<in>) ?x) ?B)

goal (1 subgoal):
 1. image_mset block_complement \<B> rep x = size (filter_mset ((\<notin>) x) \<B>)
[PROOF STEP]
by (smt (verit, ccfv_SIG) size_image_mset)
[PROOF STATE]
proof (state)
this:
image_mset block_complement \<B> rep x = size (filter_mset ((\<notin>) x) \<B>)

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
have "\<b> = size {#b \<in># \<B> . x \<in> b#} + size {#b \<in># \<B> . x \<notin> b#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<b> = size (filter_mset ((\<in>) x) \<B>) + size (filter_mset ((\<notin>) x) \<B>)
[PROOF STEP]
by (metis multiset_partition size_union)
[PROOF STATE]
proof (state)
this:
\<b> = size (filter_mset ((\<in>) x) \<B>) + size (filter_mset ((\<notin>) x) \<B>)

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<b> = size (filter_mset ((\<in>) x) \<B>) + size (filter_mset ((\<notin>) x) \<B>)

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
using alt
[PROOF STATE]
proof (prove)
using this:
\<b> = size (filter_mset ((\<in>) x) \<B>) + size (filter_mset ((\<notin>) x) \<B>)
image_mset block_complement \<B> rep x = size (filter_mset ((\<notin>) x) \<B>)

goal (1 subgoal):
 1. \<B>\<^sup>C rep x = \<b> - r
[PROOF STEP]
by (simp add: r complement_blocks_def)
[PROOF STATE]
proof (state)
this:
\<B>\<^sup>C rep x = \<b> - r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vfinite_vlesspoll_trans:
  assumes "vfinite A" and "B \<prec>\<^sub>\<circ> A"
  shows "vfinite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfinite B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vfinite A
B \<prec>\<^sub>\<circ> A

goal (1 subgoal):
 1. vfinite B
[PROOF STEP]
by (auto simp: vlesspoll_def vfinite_vlepoll_trans)


[STATEMENT]
lemma add_order_add_eq1: "add_order (s+t) = 1 \<Longrightarrow> t = -s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_order (s + t) = 1 \<Longrightarrow> t = - s
[PROOF STEP]
using add_order[of "s+t"]
[PROOF STATE]
proof (prove)
using this:
(s + t) +^ add_order (s + t) = (0::'a)

goal (1 subgoal):
 1. add_order (s + t) = 1 \<Longrightarrow> t = - s
[PROOF STEP]
by (simp add: minus_unique)


[STATEMENT]
lemma repeat_mset_iterate_add: \<open>repeat_mset n M = iterate_add n M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_mset n M = iterate_add n M
[PROOF STEP]
unfolding iterate_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_mset n M = ((+) M ^^ n) {#}
[PROOF STEP]
by (induction n) auto


[STATEMENT]
lemma dgrad_sig_set_closed_monom_mult:
  assumes "dickson_grading d" and "d t \<le> dgrad_max d"
  shows "p \<in> dgrad_sig_set' j d \<Longrightarrow> monom_mult c t p \<in> dgrad_sig_set' j d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> dgrad_sig_set' j d \<Longrightarrow> monom_mult c t p \<in> dgrad_sig_set' j d
[PROOF STEP]
unfolding dgrad_sig_set'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> dgrad_max_set d \<inter> sig_inv_set' j \<Longrightarrow> monom_mult c t p \<in> dgrad_max_set d \<inter> sig_inv_set' j
[PROOF STEP]
by (auto intro: assms dgrad_p_set_closed_monom_mult sig_inv_set_closed_monom_mult)


[STATEMENT]
lemma map2_snoc: "\<And>ys.
  length xs < length ys \<Longrightarrow>
  map2 f (xs @ [x]) ys =
  map2 f xs ys @
  [f x (ys ! (length xs))]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. length xs < length ys \<Longrightarrow> List2.map2 f (xs @ [x]) ys = List2.map2 f xs ys @ [f x (ys ! length xs)]
[PROOF STEP]
by (simp add: map2_map_list_conv map_list_snoc)


[STATEMENT]
lemma convolution_transfer :
  assumes "f \<in> aezfun_set" "g \<in> aezfun_set"
  shows   "Abs_aezfun (convolution f g) = Abs_aezfun f * Abs_aezfun g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_aezfun (convolution f g) = Abs_aezfun f * Abs_aezfun g
[PROOF STEP]
proof (rule aezfun_transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = aezfun (Abs_aezfun f * Abs_aezfun g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<in> aezfun_set
g \<in> aezfun_set
[PROOF STEP]
have "aezfun (Abs_aezfun (convolution f g)) = convolution f g"
[PROOF STATE]
proof (prove)
using this:
f \<in> aezfun_set
g \<in> aezfun_set

goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = convolution f g
[PROOF STEP]
using convolution_of_aezfun_is_aezfun Abs_aezfun_inverse
[PROOF STATE]
proof (prove)
using this:
f \<in> aezfun_set
g \<in> aezfun_set
\<lbrakk>?f \<in> aezfun_set; ?g \<in> aezfun_set\<rbrakk> \<Longrightarrow> convolution ?f ?g \<in> aezfun_set
?y \<in> aezfun_set \<Longrightarrow> aezfun (Abs_aezfun ?y) = ?y

goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = convolution f g
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
aezfun (Abs_aezfun (convolution f g)) = convolution f g

goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = aezfun (Abs_aezfun f * Abs_aezfun g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
aezfun (Abs_aezfun (convolution f g)) = convolution f g

goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = aezfun (Abs_aezfun f * Abs_aezfun g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<in> aezfun_set
g \<in> aezfun_set
[PROOF STEP]
have  "aezfun (Abs_aezfun f * Abs_aezfun g) = convolution f g"
[PROOF STATE]
proof (prove)
using this:
f \<in> aezfun_set
g \<in> aezfun_set

goal (1 subgoal):
 1. aezfun (Abs_aezfun f * Abs_aezfun g) = convolution f g
[PROOF STEP]
using times_aezfun.rep_eq[of "Abs_aezfun f"] Abs_aezfun_inverse[of f]
          Abs_aezfun_inverse[of g]
[PROOF STATE]
proof (prove)
using this:
f \<in> aezfun_set
g \<in> aezfun_set
aezfun (Abs_aezfun f * ?xa) = convolution (aezfun (Abs_aezfun f)) (aezfun ?xa)
f \<in> aezfun_set \<Longrightarrow> aezfun (Abs_aezfun f) = f
g \<in> aezfun_set \<Longrightarrow> aezfun (Abs_aezfun g) = g

goal (1 subgoal):
 1. aezfun (Abs_aezfun f * Abs_aezfun g) = convolution f g
[PROOF STEP]
by    simp
[PROOF STATE]
proof (state)
this:
aezfun (Abs_aezfun f * Abs_aezfun g) = convolution f g

goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = aezfun (Abs_aezfun f * Abs_aezfun g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
aezfun (Abs_aezfun (convolution f g)) = convolution f g
aezfun (Abs_aezfun f * Abs_aezfun g) = convolution f g
[PROOF STEP]
show "aezfun (Abs_aezfun (convolution f g))
                        = aezfun (Abs_aezfun f * Abs_aezfun g)"
[PROOF STATE]
proof (prove)
using this:
aezfun (Abs_aezfun (convolution f g)) = convolution f g
aezfun (Abs_aezfun f * Abs_aezfun g) = convolution f g

goal (1 subgoal):
 1. aezfun (Abs_aezfun (convolution f g)) = aezfun (Abs_aezfun f * Abs_aezfun g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aezfun (Abs_aezfun (convolution f g)) = aezfun (Abs_aezfun f * Abs_aezfun g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_closure [simp]: "closure (closure S) = closure S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (closure S) = closure S
[PROOF STEP]
unfolding closure_hull
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed hull (closed hull S) = closed hull S
[PROOF STEP]
by (rule hull_hull)


[STATEMENT]
lemma lspace_bounded_measurable:
  fixes p::real
  assumes f: "f \<in> borel_measurable (lebesgue_on S)" and g: "g \<in> lspace (lebesgue_on S) p" and "p > 0"
    and le: " AE x in lebesgue_on S. norm (\<bar>f x\<bar> powr p) \<le> norm (\<bar>g x\<bar> powr p)"
  shows "f \<in> lspace (lebesgue_on S) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) (ennreal p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable (lebesgue_on S)
g \<in> lspace (lebesgue_on S) (ennreal p)
0 < p
AE x in lebesgue_on S. norm (\<bar>f x\<bar> powr p) \<le> norm (\<bar>g x\<bar> powr p)

goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) (ennreal p)
[PROOF STEP]
by (auto simp: lspace_ennreal_iff intro: Bochner_Integration.integrable_bound)


[STATEMENT]
lemma ex_unit_disc_fix_to_zero_positive_x_axis:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc" and "u \<noteq> v"
  shows "\<exists> M. unit_disc_fix M \<and>
              moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> v
[PROOF STEP]
obtain B where
    *: "unit_disc_fix B" "moebius_pt B u = 0\<^sub>h"
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> v

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>unit_disc_fix B; moebius_pt B u = 0\<^sub>h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_unit_disc_fix_mapping_u_to_zero
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> v
?u \<in> unit_disc \<Longrightarrow> \<exists>M. unit_disc_fix M \<and> moebius_pt M ?u = 0\<^sub>h

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>unit_disc_fix B; moebius_pt B u = 0\<^sub>h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
unit_disc_fix B
moebius_pt B u = 0\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
let ?v = "moebius_pt B v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
have "?v \<in> unit_disc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt B v \<in> unit_disc
[PROOF STEP]
using \<open>v \<in> unit_disc\<close> *
[PROOF STATE]
proof (prove)
using this:
v \<in> unit_disc
unit_disc_fix B
moebius_pt B u = 0\<^sub>h

goal (1 subgoal):
 1. moebius_pt B v \<in> unit_disc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt B v \<in> unit_disc

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
hence "?v \<noteq> \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
using this:
moebius_pt B v \<in> unit_disc

goal (1 subgoal):
 1. moebius_pt B v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using inf_notin_unit_disc
[PROOF STATE]
proof (prove)
using this:
moebius_pt B v \<in> unit_disc
\<infinity>\<^sub>h \<notin> unit_disc

goal (1 subgoal):
 1. moebius_pt B v \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
moebius_pt B v \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
have "?v \<noteq> 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt B v \<noteq> 0\<^sub>h
[PROOF STEP]
using \<open>u \<noteq> v\<close> *
[PROOF STATE]
proof (prove)
using this:
u \<noteq> v
unit_disc_fix B
moebius_pt B u = 0\<^sub>h

goal (1 subgoal):
 1. moebius_pt B v \<noteq> 0\<^sub>h
[PROOF STEP]
by (metis moebius_pt_invert)
[PROOF STATE]
proof (state)
this:
moebius_pt B v \<noteq> 0\<^sub>h

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
obtain R where
    "unit_disc_fix R"
    "moebius_pt R 0\<^sub>h = 0\<^sub>h" "moebius_pt R ?v \<in> positive_x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>R. \<lbrakk>unit_disc_fix R; moebius_pt R 0\<^sub>h = 0\<^sub>h; moebius_pt R (moebius_pt B v) \<in> positive_x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_rotation_mapping_u_to_positive_x_axis[of ?v] \<open>?v \<noteq> 0\<^sub>h\<close> \<open>?v \<noteq> \<infinity>\<^sub>h\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>moebius_pt B v \<noteq> 0\<^sub>h; moebius_pt B v \<noteq> \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) (moebius_pt B v) \<in> positive_x_axis
moebius_pt B v \<noteq> 0\<^sub>h
moebius_pt B v \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. (\<And>R. \<lbrakk>unit_disc_fix R; moebius_pt R 0\<^sub>h = 0\<^sub>h; moebius_pt R (moebius_pt B v) \<in> positive_x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using moebius_pt_rotation_inf_iff moebius_pt_moebius_rotation_zero unit_disc_fix_rotation
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>moebius_pt B v \<noteq> 0\<^sub>h; moebius_pt B v \<noteq> \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> \<exists>\<phi>. moebius_pt (moebius_rotation \<phi>) (moebius_pt B v) \<in> positive_x_axis
moebius_pt B v \<noteq> 0\<^sub>h
moebius_pt B v \<noteq> \<infinity>\<^sub>h
(moebius_pt (moebius_rotation ?v) ?x = \<infinity>\<^sub>h) = (?x = \<infinity>\<^sub>h)
moebius_pt (moebius_rotation ?\<phi>) 0\<^sub>h = 0\<^sub>h
unit_disc_fix (moebius_rotation ?\<phi>)

goal (1 subgoal):
 1. (\<And>R. \<lbrakk>unit_disc_fix R; moebius_pt R 0\<^sub>h = 0\<^sub>h; moebius_pt R (moebius_pt B v) \<in> positive_x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
unit_disc_fix R
moebius_pt R 0\<^sub>h = 0\<^sub>h
moebius_pt R (moebius_pt B v) \<in> positive_x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix R
moebius_pt R 0\<^sub>h = 0\<^sub>h
moebius_pt R (moebius_pt B v) \<in> positive_x_axis

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
using * moebius_comp[of R B, symmetric]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix R
moebius_pt R 0\<^sub>h = 0\<^sub>h
moebius_pt R (moebius_pt B v) \<in> positive_x_axis
unit_disc_fix B
moebius_pt B u = 0\<^sub>h
moebius_pt R \<circ> moebius_pt B = moebius_pt (moebius_comp R B)

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
using unit_disc_fix_moebius_comp
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix R
moebius_pt R 0\<^sub>h = 0\<^sub>h
moebius_pt R (moebius_pt B v) \<in> positive_x_axis
unit_disc_fix B
moebius_pt B u = 0\<^sub>h
moebius_pt R \<circ> moebius_pt B = moebius_pt (moebius_comp R B)
\<lbrakk>unit_disc_fix ?M1.0; unit_disc_fix ?M2.0\<rbrakk> \<Longrightarrow> unit_disc_fix (moebius_comp ?M1.0 ?M2.0)

goal (1 subgoal):
 1. \<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis
[PROOF STEP]
by (rule_tac x="R + B" in exI) (simp add: comp_def)
[PROOF STATE]
proof (state)
this:
\<exists>M. unit_disc_fix M \<and> moebius_pt M u = 0\<^sub>h \<and> moebius_pt M v \<in> positive_x_axis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_list_updates[simp]: "length (list_updates xs ys vs) = length vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_updates xs ys vs) = length vs
[PROOF STEP]
by (induction xs ys vs rule: list_updates.induct) simp_all


[STATEMENT]
lemma to_struct_map_closed:
  assumes "f \<in> (carrier T) \<rightarrow> (carrier S)"
  shows "to_struct_map T f \<in> (struct_maps T S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_struct_map T f \<in> struct_maps T S
[PROOF STEP]
by (smt PiE_restrict Pi_iff assms mem_Collect_eq restrict_PiE struct_maps_def to_struct_map_def)


[STATEMENT]
lemma inj_enumerate:
  fixes S :: "'a::wellorder set"
  assumes S: "infinite S"
  shows "inj (enumerate S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (wellorder_class.enumerate S)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>y\<in>UNIV. wellorder_class.enumerate S x = wellorder_class.enumerate S y \<longrightarrow> x = y
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. wellorder_class.enumerate S x = wellorder_class.enumerate S y \<Longrightarrow> x = y
[PROOF STEP]
show "\<And>x y. enumerate S x = enumerate S y \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. wellorder_class.enumerate S x = wellorder_class.enumerate S y \<Longrightarrow> x = y
[PROOF STEP]
by (metis neq_iff enumerate_mono[OF _ \<open>infinite S\<close>])
[PROOF STATE]
proof (state)
this:
wellorder_class.enumerate S ?x = wellorder_class.enumerate S ?y \<Longrightarrow> ?x = ?y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_pmf_bind_spmf: "set_pmf (bind_spmf M f) = set_pmf M \<bind> map_option_set (set_pmf \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_pmf (M \<bind> f) = set_pmf M \<bind> map_option_set (set_pmf \<circ> f)
[PROOF STEP]
by(auto 4 3 simp add: bind_spmf_def split: option.splits intro: rev_bexI)


[STATEMENT]
lemma deg_nzero_nzero:
  assumes deg_p_nzero: "deg R p \<noteq> 0"
  shows "p \<noteq> \<zero>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
using deg_zero deg_p_nzero
[PROOF STATE]
proof (prove)
using this:
deg R \<zero>\<^bsub>P\<^esub> = 0
deg R p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
by auto


[STATEMENT]
lemma in_arcs_root: "in_arcs T root = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. in_arcs T root = {}
[PROOF STEP]
using in_degree_root_zero
[PROOF STATE]
proof (prove)
using this:
in_degree T root = 0

goal (1 subgoal):
 1. in_arcs T root = {}
[PROOF STEP]
by (auto simp: in_degree_def in_arcs_finite root_in_T)


[STATEMENT]
lemma inv1_rbt_app: "inv1 l \<Longrightarrow> inv1 r \<Longrightarrow> (color_of l = RBT_Impl.B \<and>
  color_of r = RBT_Impl.B \<longrightarrow> inv1 (rbt_app l r)) \<and> inv1l (rbt_app l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inv1 l; inv1 r\<rbrakk> \<Longrightarrow> (color_of l = B \<and> color_of r = B \<longrightarrow> inv1 (rbt_app l r)) \<and> inv1l (rbt_app l r)
[PROOF STEP]
by (induct l r rule: rbt_app.induct)
     (auto simp: inv1_rbt_baldL split: RBT_Impl.rbt.splits RBT_Impl.color.splits)


[STATEMENT]
lemma col_smult[simp]: assumes i: "i < dim_col A"
  shows "col (k \<cdot>\<^sub>m A) i = k \<cdot>\<^sub>v (col A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col (k \<cdot>\<^sub>m A) i = k \<cdot>\<^sub>v col A i
[PROOF STEP]
by (rule eq_vecI, insert i, auto)


[STATEMENT]
lemma col2__eq:
  assumes "Col A X Y" and
    "Col B X Y" and
    "\<not> Col A X B"
  shows  "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
using assms(1) assms(2) assms(3) l6_16_1
[PROOF STATE]
proof (prove)
using this:
Col A X Y
Col B X Y
\<not> Col A X B
\<lbrakk>?P \<noteq> ?Q; Col ?S ?P ?Q; Col ?X ?P ?Q\<rbrakk> \<Longrightarrow> Col ?X ?P ?S

goal (1 subgoal):
 1. X = Y
[PROOF STEP]
by blast


[STATEMENT]
lemma val_type_eq_PRODUCT: "val_type x = PRODUCT t1 t2 \<longleftrightarrow>
  (\<exists>a b. val_type a = t1 \<and> val_type b = t2 \<and> x = <| a, b |>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (val_type x = PRODUCT t1 t2) = (\<exists>a b. val_type a = t1 \<and> val_type b = t2 \<and> x = <|a, b|>)
[PROOF STEP]
by (cases x) auto


[STATEMENT]
lemma append_iff_take_drop1: "u \<noteq> [] \<Longrightarrow> v \<noteq> [] \<Longrightarrow>
  w = u@v \<longleftrightarrow> (\<exists>k \<in> {1..length w - 1}. u = take k w \<and> v = drop k w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<noteq> []; v \<noteq> []\<rbrakk> \<Longrightarrow> (w = u @ v) = (\<exists>k\<in>{1..length w - 1}. u = take k w \<and> v = drop k w)
[PROOF STEP]
by(auto simp: append_iff_take_drop)


[STATEMENT]
lemma strengthen_pre: "\<lbrakk> \<forall>s. P' s \<longrightarrow> P s; \<turnstile>\<^sub>t {P}c{Q}  \<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>t {P'}c{Q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>s. P' s \<longrightarrow> P s; \<turnstile>\<^sub>t {P} c {Q}\<rbrakk> \<Longrightarrow> \<turnstile>\<^sub>t {P'} c {Q}
[PROOF STEP]
by(erule thoare.Conseq, assumption, blast)


[STATEMENT]
lemma eucl_truncate_down: "eucl_truncate_down e (x::'a::executable_euclidean_space) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_truncate_down e x \<le> x
[PROOF STEP]
by (auto simp add: eucl_le[where 'a='a] truncate_down)


[STATEMENT]
lemma pre_to_univ_poly_inv_hom_const:
  assumes "i < Suc n"
  assumes "k \<in> carrier R"
  shows "(pre_to_univ_poly_inv_hom (Suc n) i) (R.indexed_const k) = R.indexed_const k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_to_univ_poly_inv_hom (Suc n) i (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pre_to_univ_poly_inv_hom (Suc n) i (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
have 0: "(R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1)) (R.indexed_const k) = R.indexed_const k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
unfolding coord_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
apply(rule R.relabel_vars_is_morphism)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>j. if j < i then j else j + 1) \<in> {..<n} \<rightarrow> {..<Suc n}
 2. k \<in> carrier R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < Suc n
k \<in> carrier R

goal (2 subgoals):
 1. (\<lambda>j. if j < i then j else j + 1) \<in> {..<n} \<rightarrow> {..<Suc n}
 2. k \<in> carrier R
[PROOF STEP]
apply (smt Pi_I Suc_eq_plus1 add_less_cancel_right lessThan_iff less_Suc_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> carrier R
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
k \<in> carrier R

goal (1 subgoal):
 1. k \<in> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k

goal (1 subgoal):
 1. pre_to_univ_poly_inv_hom (Suc n) i (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k

goal (1 subgoal):
 1. pre_to_univ_poly_inv_hom (Suc n) i (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
unfolding pre_to_univ_poly_inv_hom_def
[PROOF STATE]
proof (prove)
using this:
R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k

goal (1 subgoal):
 1. R.relabel_vars {..<Suc n - 1} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
using diff_Suc_1
[PROOF STATE]
proof (prove)
using this:
R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k
Suc ?n - 1 = ?n

goal (1 subgoal):
 1. R.relabel_vars {..<Suc n - 1} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (R.indexed_const k) = R.indexed_const k
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
pre_to_univ_poly_inv_hom (Suc n) i (R.indexed_const k) = R.indexed_const k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cf_cn_cov_rcomp_ArrMap_vrange:
  assumes "category \<alpha> \<BB>"
    and "\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
    and "\<SS> : op_cat \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
"
  shows "\<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<SS> : op_cat \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding cf_cn_cov_rcomp_def cat_op_simps
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<BB>
\<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
\<SS> : op_cat \<BB> \<times>\<^sub>C \<CC> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cf_cn_cov_bcomp \<SS> (dghm_id \<BB>) \<GG>\<lparr>ArrMap\<rparr>) \<subseteq>\<^sub>\<circ> \
\<lparr>Arr\<rparr>
[PROOF STEP]
by (intro cf_cn_cov_bcomp_ArrMap_vrange)
    (cs_concl cs_intro: cat_cs_intros)+


[STATEMENT]
lemma resl_distr: "z \<leftarrow> (x \<squnion> y) = (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<leftarrow> x \<squnion> y = (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y)
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z \<leftarrow> x \<squnion> y \<le> (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y)
 2. (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y) \<le> z \<leftarrow> x \<squnion> y
[PROOF STEP]
show "z \<leftarrow> x \<squnion> y \<le> (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<leftarrow> x \<squnion> y \<le> (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y)
[PROOF STEP]
by (metis local.inf.bounded_iff local.resl_superdist_var local.sup_commute)
[PROOF STATE]
proof (state)
this:
z \<leftarrow> x \<squnion> y \<le> (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y)

goal (1 subgoal):
 1. (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y) \<le> z \<leftarrow> x \<squnion> y
[PROOF STEP]
show "(z \<leftarrow> x) \<sqinter> (z \<leftarrow> y) \<le> z \<leftarrow> x \<squnion> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<leftarrow> x) \<sqinter> (z \<leftarrow> y) \<le> z \<leftarrow> x \<squnion> y
[PROOF STEP]
by (metis local.inf.cobounded1 local.inf.cobounded2 local.resl_galois local.resr_galois local.sup.bounded_iff)
[PROOF STATE]
proof (state)
this:
(z \<leftarrow> x) \<sqinter> (z \<leftarrow> y) \<le> z \<leftarrow> x \<squnion> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subcocycle_AE_in_context:
  "\<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
have "subcocycle v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle v
[PROOF STEP]
using subcocycle_v integrable_v
[PROOF STATE]
proof (prove)
using this:
v (?n + ?m) ?x \<le> v ?n ?x + v ?m ((T ^^ ?n) ?x)
integrable M (v ?n)

goal (1 subgoal):
 1. subcocycle v
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
v (?n + ?m) ?x \<le> v ?n ?x + v ?m ((T ^^ ?n) ?x)
integrable M (v ?n)

goal (1 subgoal):
 1. (\<forall>n. integrable M (v n)) \<and> (\<forall>n m x. v (n + m) x \<le> v n x + v m ((T ^^ n) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcocycle v

goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subcocycle v

goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
have "AE x in M. \<forall>n. v n x = u n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. \<forall>n. v n x = u n x
[PROOF STEP]
by (subst AE_all_countable, intro allI, rule u_eq_v_AE)
[PROOF STATE]
proof (state)
this:
AE x in M. \<forall>n. v n x = u n x

goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subcocycle v
AE x in M. \<forall>n. v n x = u n x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subcocycle v
AE x in M. \<forall>n. v n x = u n x

goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qo_on_predecessor_subset_conv':
  assumes "qo_on P A" and "B \<subseteq> A" and "C \<subseteq> A"
  shows "{x\<in>A. \<exists>y\<in>B. P x y} \<subseteq> {x\<in>A. \<exists>y\<in>C. P x y} \<longleftrightarrow> (\<forall>x\<in>B. \<exists>y\<in>C. P x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x \<in> A. \<exists>y\<in>B. P x y} \<subseteq> {x \<in> A. \<exists>y\<in>C. P x y}) = (\<forall>x\<in>B. \<exists>y\<in>C. P x y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
qo_on P A
B \<subseteq> A
C \<subseteq> A

goal (1 subgoal):
 1. ({x \<in> A. \<exists>y\<in>B. P x y} \<subseteq> {x \<in> A. \<exists>y\<in>C. P x y}) = (\<forall>x\<in>B. \<exists>y\<in>C. P x y)
[PROOF STEP]
by (auto simp: subset_eq qo_on_def reflp_on_def, unfold transp_on_def) metis+


[STATEMENT]
lemma obtain_digit_rep:
  fixes x c :: nat
  shows "x && 2^c = (\<Sum>t<Suc c. 2^t * (nth_bit x t) * (nth_bit (2^c) t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
have "x && 2^c \<preceq> 2^c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x && 2 ^ c \<preceq> 2 ^ c
[PROOF STEP]
by (simp add: lm0245)
[PROOF STATE]
proof (state)
this:
x && 2 ^ c \<preceq> 2 ^ c

goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
hence "x && 2^c \<le> 2^c"
[PROOF STATE]
proof (prove)
using this:
x && 2 ^ c \<preceq> 2 ^ c

goal (1 subgoal):
 1. x && 2 ^ c \<le> 2 ^ c
[PROOF STEP]
by (simp add: masks_leq)
[PROOF STATE]
proof (state)
this:
x && 2 ^ c \<le> 2 ^ c

goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
hence h: "x && 2^c < 2^Suc c"
[PROOF STATE]
proof (prove)
using this:
x && 2 ^ c \<le> 2 ^ c

goal (1 subgoal):
 1. x && 2 ^ c < 2 ^ Suc c
[PROOF STEP]
by (smt Suc_lessD le_neq_implies_less lessI less_trans_Suc n_less_m_mult_n numeral_2_eq_2
        power_Suc zero_less_power)
[PROOF STATE]
proof (state)
this:
x && 2 ^ c < 2 ^ Suc c

goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
have "\<forall>t. (x && 2^c) \<exclamdown> t = (nth_bit x t) * (nth_bit (2^c) t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t. (x && 2 ^ c) \<exclamdown> t = x \<exclamdown> t * (2 ^ c) \<exclamdown> t
[PROOF STEP]
using bitAND_digit_mult
[PROOF STATE]
proof (prove)
using this:
(?a && ?b) \<exclamdown> ?k = ?a \<exclamdown> ?k * ?b \<exclamdown> ?k

goal (1 subgoal):
 1. \<forall>t. (x && 2 ^ c) \<exclamdown> t = x \<exclamdown> t * (2 ^ c) \<exclamdown> t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>t. (x && 2 ^ c) \<exclamdown> t = x \<exclamdown> t * (2 ^ c) \<exclamdown> t

goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t. (x && 2 ^ c) \<exclamdown> t = x \<exclamdown> t * (2 ^ c) \<exclamdown> t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>t. (x && 2 ^ c) \<exclamdown> t = x \<exclamdown> t * (2 ^ c) \<exclamdown> t

goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
using h digit_sum_repr[of "(x && 2^c)" "Suc c"]
[PROOF STATE]
proof (prove)
using this:
\<forall>t. (x && 2 ^ c) \<exclamdown> t = x \<exclamdown> t * (2 ^ c) \<exclamdown> t
x && 2 ^ c < 2 ^ Suc c
x && 2 ^ c < 2 ^ Suc c \<Longrightarrow> x && 2 ^ c = (\<Sum>k<Suc c. (x && 2 ^ c) \<exclamdown> k * 2 ^ k)

goal (1 subgoal):
 1. x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)
[PROOF STEP]
by (auto) (simp add: mult.commute semiring_normalization_rules(19))
[PROOF STATE]
proof (state)
this:
x && 2 ^ c = (\<Sum>t<Suc c. 2 ^ t * x \<exclamdown> t * (2 ^ c) \<exclamdown> t)

goal:
No subgoals!
[PROOF STEP]
qed