[STATEMENT]
lemma Nmul_assoc:
  assumes "SORT_CONSTRAINT('a::field_char_0)"
  assumes nx: "isnormNum x"
    and ny: "isnormNum y"
    and nz: "isnormNum z"
  shows "x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)
[PROOF STEP]
from nx ny nz
[PROOF STATE]
proof (chain)
picking this:
isnormNum x
isnormNum y
isnormNum z
[PROOF STEP]
have n: "isnormNum (x *\<^sub>N y *\<^sub>N z)" "isnormNum (x *\<^sub>N (y *\<^sub>N z))"
[PROOF STATE]
proof (prove)
using this:
isnormNum x
isnormNum y
isnormNum z

goal (1 subgoal):
 1. isnormNum (x *\<^sub>N y *\<^sub>N z) &&& isnormNum (x *\<^sub>N (y *\<^sub>N z))
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
isnormNum (x *\<^sub>N y *\<^sub>N z)
isnormNum (x *\<^sub>N (y *\<^sub>N z))

goal (1 subgoal):
 1. x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)
[PROOF STEP]
have "INum (x +\<^sub>N y +\<^sub>N z) = (INum (x +\<^sub>N (y +\<^sub>N z)) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. INum (x +\<^sub>N y +\<^sub>N z) = INum (x +\<^sub>N (y +\<^sub>N z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
INum (x +\<^sub>N y +\<^sub>N z) = INum (x +\<^sub>N (y +\<^sub>N z))

goal (1 subgoal):
 1. x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)
[PROOF STEP]
with isnormNum_unique[OF n]
[PROOF STATE]
proof (chain)
picking this:
(INum (x *\<^sub>N y *\<^sub>N z) = INum (x *\<^sub>N (y *\<^sub>N z))) = (x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z))
INum (x +\<^sub>N y +\<^sub>N z) = INum (x +\<^sub>N (y +\<^sub>N z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(INum (x *\<^sub>N y *\<^sub>N z) = INum (x *\<^sub>N (y *\<^sub>N z))) = (x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z))
INum (x +\<^sub>N y +\<^sub>N z) = INum (x +\<^sub>N (y +\<^sub>N z))

goal (1 subgoal):
 1. x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x *\<^sub>N y *\<^sub>N z = x *\<^sub>N (y *\<^sub>N z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennreal_sqrt2:
  "ennreal (sqrt 2) = ennsqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (sqrt 2) = ennsqrt 2
[PROOF STEP]
using ennsqrt_ennreal_ennreal_sqrt[of 2]
[PROOF STATE]
proof (prove)
using this:
0 \<le> 2 \<Longrightarrow> ennsqrt (ennreal 2) = ennreal (sqrt 2)

goal (1 subgoal):
 1. ennreal (sqrt 2) = ennsqrt 2
[PROOF STEP]
by auto


[STATEMENT]
lemma cot_gt_zero: "0 < x \<Longrightarrow> x < pi/2 \<Longrightarrow> 0 < cot x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x < pi / 2\<rbrakk> \<Longrightarrow> 0 < cot x
[PROOF STEP]
by (simp add: cot_def zero_less_divide_iff sin_gt_zero2 cos_gt_zero_pi)


[STATEMENT]
lemma fls_integral_X_inv_power_char0':
  assumes "n \<ge> 1"
  shows
    "fls_integral (fls_X_inv ^ n :: 'a :: {division_ring,ring_char_0} fls) =
      - inverse (of_nat (n-1)) * fls_X_inv ^ (n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
proof (cases "n=1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 1

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
 2. n \<noteq> 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 \<le> n
n \<noteq> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> n
n \<noteq> 1

goal (1 subgoal):
 1. fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
by (simp add: fls_integral_X_inv_power' fls_inverse_const fls_of_nat)
[PROOF STATE]
proof (state)
this:
fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)

goal (1 subgoal):
 1. n = 1 \<Longrightarrow> fls_integral (fls_X_inv ^ n) = - inverse (of_nat (n - 1)) * fls_X_inv ^ (n - 1)
[PROOF STEP]
qed simp


[STATEMENT]
lemma complex_root_unity_eq:
  fixes j::nat and k::nat
  assumes "1 \<le> n"
    shows "(exp(2 * of_real pi * \<i> * of_nat j / of_nat n) = exp(2 * of_real pi * \<i> * of_nat k / of_nat n)
           \<longleftrightarrow> j mod n = k mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
have "(\<exists>z::int. \<i> * (of_nat j * (of_real pi * 2)) =
               \<i> * (of_nat k * (of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (of_real pi * 2)))) \<longleftrightarrow>
          (\<exists>z::int. of_nat j * (\<i> * (of_real pi * 2)) =
              (of_nat k + of_nat n * of_int z) * (\<i> * (of_real pi * 2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (\<exists>z. of_nat j * (\<i> * (complex_of_real pi * 2)) = (of_nat k + of_nat n * of_int z) * (\<i> * (complex_of_real pi * 2)))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (\<exists>z. of_nat j * (\<i> * (complex_of_real pi * 2)) = (of_nat k + of_nat n * of_int z) * (\<i> * (complex_of_real pi * 2)))

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (\<exists>z. of_nat j * (\<i> * (complex_of_real pi * 2)) = (of_nat k + of_nat n * of_int z) * (\<i> * (complex_of_real pi * 2)))

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists>z::int. of_nat j = of_nat k + of_nat n * (of_int z :: complex))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>z. of_nat j * (\<i> * (complex_of_real pi * 2)) = (of_nat k + of_nat n * of_int z) * (\<i> * (complex_of_real pi * 2))) = (\<exists>z. of_nat j = of_nat k + of_nat n * of_int z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>z. of_nat j * (\<i> * (complex_of_real pi * 2)) = (of_nat k + of_nat n * of_int z) * (\<i> * (complex_of_real pi * 2))) = (\<exists>z. of_nat j = of_nat k + of_nat n * of_int z)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>z. of_nat j * (\<i> * (complex_of_real pi * 2)) = (of_nat k + of_nat n * of_int z) * (\<i> * (complex_of_real pi * 2))) = (\<exists>z. of_nat j = of_nat k + of_nat n * of_int z)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists>z::int. of_nat j = of_nat k + of_nat n * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>z. of_nat j = of_nat k + of_nat n * of_int z) = (\<exists>z. int j = int k + int n * z)
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) of_int_add of_int_eq_iff of_int_mult of_int_of_nat_eq)
[PROOF STATE]
proof (state)
this:
(\<exists>z. of_nat j = of_nat k + of_nat n * of_int z) = (\<exists>z. int j = int k + int n * z)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>z. of_nat j = of_nat k + of_nat n * of_int z) = (\<exists>z. int j = int k + int n * z)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> int j mod int n = int k mod int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>z. int j = int k + int n * z) = (int j mod int n = int k mod int n)
[PROOF STEP]
by (auto simp: mod_eq_dvd_iff dvd_def algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<exists>z. int j = int k + int n * z) = (int j mod int n = int k mod int n)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>z. int j = int k + int n * z) = (int j mod int n = int k mod int n)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> j mod n = k mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int j mod int n = int k mod int n) = (j mod n = k mod n)
[PROOF STEP]
by (metis of_nat_eq_iff zmod_int)
[PROOF STATE]
proof (state)
this:
(int j mod int n = int k mod int n) = (j mod n = k mod n)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (j mod n = k mod n)
[PROOF STEP]
have "(\<exists>z. \<i> * (of_nat j * (of_real pi * 2)) =
             \<i> * (of_nat k * (of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (of_real pi * 2)))) \<longleftrightarrow> j mod n = k mod n"
[PROOF STATE]
proof (prove)
using this:
(\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (j mod n = k mod n)

goal (1 subgoal):
 1. (\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (j mod n = k mod n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (j mod n = k mod n)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
(\<exists>z. \<i> * (of_nat j * (complex_of_real pi * 2)) = \<i> * (of_nat k * (complex_of_real pi * 2)) + \<i> * (of_int z * (of_nat n * (complex_of_real pi * 2)))) = (j mod n = k mod n)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)
[PROOF STEP]
by (simp add: exp_eq field_split_simps *)
[PROOF STATE]
proof (state)
this:
(exp (2 * complex_of_real pi * \<i> * of_nat j / of_nat n) = exp (2 * complex_of_real pi * \<i> * of_nat k / of_nat n)) = (j mod n = k mod n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AbGroup_sum_list :
  "(\<forall>G\<in>set Gs. AbGroup G) \<Longrightarrow> AbGroup (\<Sum>G\<leftarrow>Gs. G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>G\<in>set Gs. AbGroup G \<Longrightarrow> AbGroup (\<Sum>G\<leftarrow>Gs. G)
[PROOF STEP]
using trivial_Group AbGroup.intro AbGroup_set_plus
[PROOF STATE]
proof (prove)
using this:
Group 0
Group ?G \<Longrightarrow> AbGroup ?G
\<lbrakk>AbGroup ?H; AbGroup ?G\<rbrakk> \<Longrightarrow> AbGroup (?H + ?G)

goal (1 subgoal):
 1. \<forall>G\<in>set Gs. AbGroup G \<Longrightarrow> AbGroup (\<Sum>G\<leftarrow>Gs. G)
[PROOF STEP]
by    (induct Gs) auto


[STATEMENT]
lemma dirichlet_prod_assoc_aux2:
  assumes "n > 0"
  shows "dirichlet_prod (dirichlet_prod f g) h n =
           (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
have "dirichlet_prod (dirichlet_prod f g) h n =
          (\<Sum>x\<in>{(a,b). a * b = n}. (\<Sum>(c,d) | c * d = fst x. f c * g d * h (snd x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = fst x}. f c * g d * h (snd x))
[PROOF STEP]
by (auto intro!: sum.cong simp: dirichlet_prod_altdef2 sum_distrib_right mult.assoc)
[PROOF STATE]
proof (state)
this:
dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = fst x}. f c * g d * h (snd x))

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = fst x}. f c * g d * h (snd x))

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = fst x}).
                               case x of (x, c, d) \<Rightarrow> f c * g d * h (snd x))"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = fst x}. f c * g d * h (snd x)) = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = fst x}). case x of (x, c, d) \<Rightarrow> f c * g d * h (snd x))
[PROOF STEP]
by (intro sum.Sigma finite_divisors_nat' ballI) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = fst x}. f c * g d * h (snd x)) = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = fst x}). case x of (x, c, d) \<Rightarrow> f c * g d * h (snd x))

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = fst x}. f c * g d * h (snd x)) = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = fst x}). case x of (x, c, d) \<Rightarrow> f c * g d * h (snd x))

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
have "\<dots> = (\<Sum>(a,b,c) | a * b * c = n. f a * g b * h c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = fst x}). case x of (x, c, d) \<Rightarrow> f c * g d * h (snd x)) = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
by (rule sum.reindex_bij_witness
               [of _ "\<lambda>(a,b,c). ((a*b, c), (a,b))" "\<lambda>((a,b),(c,d)). (c, d, b)"])
       (auto simp: mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = fst x}). case x of (x, c, d) \<Rightarrow> f c * g d * h (snd x)) = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dirichlet_prod (dirichlet_prod f g) h n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Ring) npMulElmR: "\<And> n. x \<in> carrier R
        \<Longrightarrow> (npow R x n) \<cdot>\<^sub>r x =  npow R x (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. x \<in> carrier R \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x = x^\<^bsup>R Suc n\<^esup>
[PROOF STEP]
apply ( frule_tac n = n in npClose[of "x"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; x^\<^bsup>R n\<^esup> \<in> carrier R\<rbrakk> \<Longrightarrow> x^\<^bsup>R n\<^esup> \<cdot>\<^sub>r x = x^\<^bsup>R Suc n\<^esup>
[PROOF STEP]
apply (simp only:ring_tOp_commute,
          subst npMulElmL, assumption, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(y < x + y) = ((0::real) < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y < x + y) = (0 < x)
[PROOF STEP]
by arith


[STATEMENT]
lemma "\<bar>(-4::int) + 2 * 1\<bar> = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>- 4 + 2 * 1\<bar> = 2
[PROOF STEP]
by normalization


[STATEMENT]
lemma "(-84 + 255*\<i>) + (51 * 255*\<i>) = -84 + 13260 * \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 84 + 255 * \<i> + 51 * 255 * \<i> = - 84 + 13260 * \<i>
[PROOF STEP]
by (simp add: ring_distribs)


[STATEMENT]
lemma invertible_det:
  fixes A:: "'a::field mat"
  assumes "A \<in> carrier_mat n n"
  shows "invertible_mat A \<longleftrightarrow> det A \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat A = (det A \<noteq> (0::'a))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>invertible_mat A; det A = (0::'a)\<rbrakk> \<Longrightarrow> False
 2. det A \<noteq> (0::'a) \<Longrightarrow> invertible_mat A
[PROOF STEP]
using invertible_Units unit_imp_det_non_zero
[PROOF STATE]
proof (prove)
using this:
invertible_mat ?A \<Longrightarrow> ?A \<in> Units (ring_mat TYPE(?'a) (dim_row ?A) ?b)
?A \<in> Units (ring_mat TYPE(?'a) ?n ?b) \<Longrightarrow> det ?A \<noteq> (0::?'a)

goal (2 subgoals):
 1. \<lbrakk>invertible_mat A; det A = (0::'a)\<rbrakk> \<Longrightarrow> False
 2. det A \<noteq> (0::'a) \<Longrightarrow> invertible_mat A
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A \<noteq> (0::'a) \<Longrightarrow> invertible_mat A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. det A \<noteq> (0::'a) \<Longrightarrow> invertible_mat A
[PROOF STEP]
by (auto intro!: Units_invertible det_non_zero_imp_unit)


[STATEMENT]
lemma (in linorder_topology) tendsto_min[tendsto_intros]:
  assumes X: "(X \<longlongrightarrow> x) net"
    and Y: "(Y \<longlongrightarrow> y) net"
  shows "((\<lambda>x. min (X x) (Y x)) \<longlongrightarrow> min x y) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. min (X x) (Y x)) \<longlongrightarrow> min x y) net
[PROOF STEP]
proof (rule order_tendstoI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a < min x y \<Longrightarrow> \<forall>\<^sub>F x in net. a < min (X x) (Y x)
 2. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a < min x y \<Longrightarrow> \<forall>\<^sub>F x in net. a < min (X x) (Y x)
 2. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
assume "a < min x y"
[PROOF STATE]
proof (state)
this:
a < min x y

goal (2 subgoals):
 1. \<And>a. a < min x y \<Longrightarrow> \<forall>\<^sub>F x in net. a < min (X x) (Y x)
 2. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < min x y
[PROOF STEP]
show "eventually (\<lambda>x. a < min (X x) (Y x)) net"
[PROOF STATE]
proof (prove)
using this:
a < min x y

goal (1 subgoal):
 1. \<forall>\<^sub>F x in net. a < min (X x) (Y x)
[PROOF STEP]
using order_tendstoD(1)[OF X, of a] order_tendstoD(1)[OF Y, of a]
[PROOF STATE]
proof (prove)
using this:
a < min x y
a < x \<Longrightarrow> \<forall>\<^sub>F x in net. a < X x
a < y \<Longrightarrow> \<forall>\<^sub>F x in net. a < Y x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in net. a < min (X x) (Y x)
[PROOF STEP]
by (auto simp: eventually_conj_iff)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in net. a < min (X x) (Y x)

goal (1 subgoal):
 1. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
assume "min x y < a"
[PROOF STATE]
proof (state)
this:
min x y < a

goal (1 subgoal):
 1. \<And>a. min x y < a \<Longrightarrow> \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
min x y < a
[PROOF STEP]
show "eventually (\<lambda>x. min (X x) (Y x) < a) net"
[PROOF STATE]
proof (prove)
using this:
min x y < a

goal (1 subgoal):
 1. \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
using order_tendstoD(2)[OF X, of a] order_tendstoD(2)[OF Y, of a]
[PROOF STATE]
proof (prove)
using this:
min x y < a
x < a \<Longrightarrow> \<forall>\<^sub>F x in net. X x < a
y < a \<Longrightarrow> \<forall>\<^sub>F x in net. Y x < a

goal (1 subgoal):
 1. \<forall>\<^sub>F x in net. min (X x) (Y x) < a
[PROOF STEP]
by (auto simp: min_less_iff_disj elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in net. min (X x) (Y x) < a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fin_zfact: "finite (carrier (ZFact (int n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier (ZFact (int n)))
[PROOF STEP]
using card_zfact_carr n_gt_0 card_ge_0_finite
[PROOF STATE]
proof (prove)
using this:
card (carrier (ZFact (int n))) = n
0 < n
0 < card ?A \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (carrier (ZFact (int n)))
[PROOF STEP]
by force


[STATEMENT]
lemma ordinal_exp_mono:
"\<lbrakk>0 < x'; x \<le> x'; y \<le> y'\<rbrakk> \<Longrightarrow> x ** y \<le> x' ** (y'::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x'; x \<le> x'; y \<le> y'\<rbrakk> \<Longrightarrow> x ** y \<le> x' ** y'
[PROOF STEP]
by (rule order_trans[OF ordinal_exp_monoL ordinal_exp_monoR])


[STATEMENT]
lemma powreal_le_anti_mono:
   "\<lbrakk> r \<le> s; 0 < a; a < 1 \<rbrakk> \<Longrightarrow> a pow\<^sub>\<real> r \<ge> a pow\<^sub>\<real> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> s; 0 < a; a < 1\<rbrakk> \<Longrightarrow> a pow\<^sub>\<real> s \<le> a pow\<^sub>\<real> r
[PROOF STEP]
by (simp add: powa_le_mono powreal_def real_inverse_ge_one_lemma)


[STATEMENT]
lemma normFaces_makeFaceFinalFaceList: "(normFaces (makeFaceFinalFaceList f fs)) = (normFaces fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normFaces (makeFaceFinalFaceList f fs) = normFaces fs
[PROOF STEP]
apply (simp add: normFaces_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map normFace (makeFaceFinalFaceList f fs) = map normFace fs
[PROOF STEP]
apply (simp add: makeFaceFinalFaceList_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map normFace (replace f [setFinal f] fs) = map normFace fs
[PROOF STEP]
apply (induct fs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map normFace (replace f [setFinal f] []) = map normFace []
 2. \<And>a fs. map normFace (replace f [setFinal f] fs) = map normFace fs \<Longrightarrow> map normFace (replace f [setFinal f] (a # fs)) = map normFace (a # fs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs. map normFace (replace f [setFinal f] fs) = map normFace fs \<Longrightarrow> map normFace (replace f [setFinal f] (a # fs)) = map normFace (a # fs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs. map normFace (replace f [setFinal f] fs) = map normFace fs \<Longrightarrow> a = f \<longrightarrow> normFace (setFinal f) = normFace f
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs. \<lbrakk>map normFace (replace f [setFinal f] fs) = map normFace fs; a = f\<rbrakk> \<Longrightarrow> normFace (setFinal f) = normFace f
[PROOF STEP]
by (simp add: setFinal_def normFace_def verticesFrom_def minVertex_def)


[STATEMENT]
lemma (in linorder) iterate_sel_no_map_rev_linord_correct :
assumes it_OK: "set_iterator_rev_linord it S0"
shows "iterate_sel_no_map it P = None \<longleftrightarrow> (\<forall>x\<in>S0. \<not>(P x))"
      "iterate_sel_no_map it P = Some x \<Longrightarrow> (x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
 2. iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x)
[PROOF STEP]
note iterate_sel_no_map_genord_correct [OF it_OK[unfolded set_iterator_rev_linord_def], of P]
[PROOF STATE]
proof (state)
this:
(iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
iterate_sel_no_map it P = Some ?x \<Longrightarrow> ?x \<in> S0 \<and> P ?x \<and> (\<forall>x'\<in>S0 - {?x}. P x' \<longrightarrow> x' \<le> ?x)

goal (2 subgoals):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
 2. iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x)
[PROOF STEP]
thus "iterate_sel_no_map it P = None \<longleftrightarrow> (\<forall>x\<in>S0. \<not>(P x))"
       "iterate_sel_no_map it P = Some x \<Longrightarrow> (x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x))"
[PROOF STATE]
proof (prove)
using this:
(iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
iterate_sel_no_map it P = Some ?x \<Longrightarrow> ?x \<in> S0 \<and> P ?x \<and> (\<forall>x'\<in>S0 - {?x}. P x' \<longrightarrow> x' \<le> ?x)

goal (1 subgoal):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x)
iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0. P x' \<longrightarrow> x' \<le> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma elliptic_imp_not_parabolic_loxodromic:
  assumes "elliptic_isometry f"
  shows "\<not>parabolic_isometry f"
        "\<not>loxodromic_isometry f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> parabolic_isometry f &&& \<not> loxodromic_isometry f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
elliptic_isometry f

goal (1 subgoal):
 1. \<not> parabolic_isometry f &&& \<not> loxodromic_isometry f
[PROOF STEP]
unfolding parabolic_isometry_def loxodromic_isometry_def
[PROOF STATE]
proof (prove)
using this:
elliptic_isometry f

goal (1 subgoal):
 1. \<not> (isometry f \<and> \<not> elliptic_isometry f \<and> stable_translation_length f = 0) &&& \<not> (isometry f \<and> \<not> elliptic_isometry f \<and> stable_translation_length f \<noteq> 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma is_Proj_idempotent:
  assumes "is_Proj P"
  shows "P o\<^sub>C\<^sub>L P = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P o\<^sub>C\<^sub>L P = P
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_Proj P

goal (1 subgoal):
 1. P o\<^sub>C\<^sub>L P = P
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. \<lbrakk>bounded_clinear P; Ex (is_projection_on P)\<rbrakk> \<Longrightarrow> P \<circ> P = P
[PROOF STEP]
using is_projection_on_fixes_image is_projection_on_in_image
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_projection_on ?\<pi> ?M; ?x \<in> ?M\<rbrakk> \<Longrightarrow> ?\<pi> ?x = ?x
is_projection_on ?\<pi> ?M \<Longrightarrow> ?\<pi> ?h \<in> ?M

goal (1 subgoal):
 1. \<And>P. \<lbrakk>bounded_clinear P; Ex (is_projection_on P)\<rbrakk> \<Longrightarrow> P \<circ> P = P
[PROOF STEP]
by fastforce


[STATEMENT]
lemma fps_compose_add_distrib: "(a + b) oo c = (a oo c) + (b oo c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + b oo c = (a oo c) + (b oo c)
[PROOF STEP]
by (simp add: fps_eq_iff fps_compose_nth field_simps sum.distrib)


[STATEMENT]
lemma infdist_triangle_abs: "\<bar>infdist x A - infdist y A\<bar> \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>infdist x A - infdist y A\<bar> \<le> dist x y
[PROOF STEP]
by (metis (full_types) abs_diff_le_iff diff_le_eq dist_commute infdist_triangle)


[STATEMENT]
lemma sigma_finite_measure_count_space_countable:
  assumes A: "countable A"
  shows "sigma_finite_measure (count_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure (count_space A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>Aa. countable Aa \<and> Aa \<subseteq> sets (count_space A) \<and> \<Union> Aa = space (count_space A) \<and> (\<forall>a\<in>Aa. emeasure (count_space A) a \<noteq> \<infinity>)
[PROOF STEP]
qed (insert A, auto intro!: exI[of _ "(\<lambda>a. {a}) ` A"])


[STATEMENT]
lemma set_quicksort [simp]: "set (quicksort xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (quicksort xs) = set xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (quicksort xs) = set xs
[PROOF STEP]
have "set_mset (mset (quicksort xs)) = set_mset (mset xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (mset (quicksort xs)) = set_mset (mset xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_mset (mset (quicksort xs)) = set_mset (mset xs)

goal (1 subgoal):
 1. set (quicksort xs) = set xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_mset (mset (quicksort xs)) = set_mset (mset xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_mset (mset (quicksort xs)) = set_mset (mset xs)

goal (1 subgoal):
 1. set (quicksort xs) = set xs
[PROOF STEP]
by (simp only: set_mset_mset)
[PROOF STATE]
proof (state)
this:
set (quicksort xs) = set xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_less_finite_iff: "\<lbrakk> finite A; finite B \<rbrakk> \<Longrightarrow> A \<sqsubset> B \<longleftrightarrow> A \<sqsubset>' B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B\<rbrakk> \<Longrightarrow> (A \<sqsubset> B) = (A \<sqsubset>' B)
[PROOF STEP]
by(simp add: set_less_def set_less_aux_conv_set_less_eq_aux set_less_eq_finite_iff)


[STATEMENT]
lemma set_collapse_aux[simp]: "\<Union>(set (collapse_aux p i)) = \<Union>(set p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (collapse_aux p i)) = \<Union> (set p)
[PROOF STEP]
apply (subst (2) append_take_drop_id[of _ p,symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (collapse_aux p i)) = \<Union> (set (take ?n p @ drop ?n p))
[PROOF STEP]
apply (simp del: append_take_drop_id)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (collapse_aux p i)) = \<Union> (set (take ?n p)) \<union> \<Union> (set (drop ?n p))
[PROOF STEP]
unfolding collapse_aux_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set (take i p @ [\<Union> (set (drop i p))])) = \<Union> (set (take ?n p)) \<union> \<Union> (set (drop ?n p))
[PROOF STEP]
by auto


[STATEMENT]
theorem ce_univ: "UNIV \<in> ce_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
let ?f = "(\<lambda> x a. (0::nat))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
have S1: "?f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x a. 0) \<in> PrimRec2
[PROOF STEP]
by (rule const_is_pr_2)
[PROOF STATE]
proof (state)
this:
(\<lambda>x a. 0) \<in> PrimRec2

goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x a. 0) \<in> PrimRec2
[PROOF STEP]
have "\<forall> x a. ?f x a = 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x a. 0) \<in> PrimRec2

goal (1 subgoal):
 1. \<forall>x a. 0 = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x a. 0 = 0

goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x a. 0 = 0
[PROOF STEP]
have "{x. \<exists> a. ?f x a = 0 }=UNIV"
[PROOF STATE]
proof (prove)
using this:
\<forall>x a. 0 = 0

goal (1 subgoal):
 1. {x. \<exists>a. 0 = 0} = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. \<exists>a. 0 = 0} = UNIV

goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x. \<exists>a. 0 = 0} = UNIV

goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
have "fn_to_set ?f = \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fn_to_set (\<lambda>x a. 0) = UNIV
[PROOF STEP]
by (simp add: fn_to_set_def)
[PROOF STATE]
proof (state)
this:
fn_to_set (\<lambda>x a. 0) = UNIV

goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
with S1
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x a. 0) \<in> PrimRec2
fn_to_set (\<lambda>x a. 0) = UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x a. 0) \<in> PrimRec2
fn_to_set (\<lambda>x a. 0) = UNIV

goal (1 subgoal):
 1. UNIV \<in> ce_sets
[PROOF STEP]
by (auto simp add: ce_sets_def)
[PROOF STATE]
proof (state)
this:
UNIV \<in> ce_sets

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_borel_measurable_vector:
  fixes f :: "'a \<Rightarrow> 'x::real_normed_vector"
  assumes "f \<in> borel_measurable M"
  shows "(\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + b *\<^sub>R f x) \<in> borel_measurable M
[PROOF STEP]
proof (rule borel_measurableI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. open S \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
fix S :: "'x set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. open S \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
assume "open S"
[PROOF STATE]
proof (state)
this:
open S

goal (1 subgoal):
 1. \<And>S. open S \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
show "(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
 2. \<not> ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
assume "b \<noteq> 0"
[PROOF STATE]
proof (state)
this:
b \<noteq> 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
 2. \<not> ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
with \<open>open S\<close>
[PROOF STATE]
proof (chain)
picking this:
open S
b \<noteq> 0
[PROOF STEP]
have "open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)" (is "open ?S")
[PROOF STATE]
proof (prove)
using this:
open S
b \<noteq> 0

goal (1 subgoal):
 1. open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)
[PROOF STEP]
using open_affinity [of S "inverse b" "- a /\<^sub>R b"]
[PROOF STATE]
proof (prove)
using this:
open S
b \<noteq> 0
\<lbrakk>open S; inverse b \<noteq> 0\<rbrakk> \<Longrightarrow> open ((\<lambda>x. - a /\<^sub>R b + x /\<^sub>R b) ` S)

goal (1 subgoal):
 1. open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
 2. \<not> ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
hence "?S \<in> sets borel"
[PROOF STATE]
proof (prove)
using this:
open ((\<lambda>x. (- a + x) /\<^sub>R b) ` S)

goal (1 subgoal):
 1. (\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
 2. \<not> ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
 2. \<not> ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
from \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> 0
[PROOF STEP]
have "(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` ?S"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. a + b *\<^sub>R f x) -` S = f -` (\<lambda>x. (- a + x) /\<^sub>R b) ` S
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>b \<noteq> 0; a + b *\<^sub>R f x \<in> S\<rbrakk> \<Longrightarrow> f x \<in> (\<lambda>x. (x - a) /\<^sub>R b) ` S
[PROOF STEP]
by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` (\<lambda>x. (- a + x) /\<^sub>R b) ` S

goal (2 subgoals):
 1. ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
 2. \<not> ?P \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel
(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` (\<lambda>x. (- a + x) /\<^sub>R b) ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel
(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` (\<lambda>x. (- a + x) /\<^sub>R b) ` S

goal (1 subgoal):
 1. (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel
(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` (\<lambda>x. (- a + x) /\<^sub>R b) ` S
f \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
unfolding in_borel_measurable_borel
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (- a + x) /\<^sub>R b) ` S \<in> sets borel
(\<lambda>x. a + b *\<^sub>R f x) -` S = f -` (\<lambda>x. (- a + x) /\<^sub>R b) ` S
\<forall>S\<in>sets borel. f -` S \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M

goal (1 subgoal):
 1. \<not> b \<noteq> 0 \<Longrightarrow> (\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a + b *\<^sub>R f x) -` S \<inter> space M \<in> sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smult_eigen_value: fixes a :: "'a :: field"
  assumes "eigen_value A x"
  shows "eigen_value (a *k A) (a * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigen_value (a *k A) (a * x)
[PROOF STEP]
using assms smult_eigen_vector[of A _ x a]
[PROOF STATE]
proof (prove)
using this:
eigen_value A x
eigen_vector A ?v x \<Longrightarrow> eigen_vector (a *k A) ?v (a * x)

goal (1 subgoal):
 1. eigen_value (a *k A) (a * x)
[PROOF STEP]
unfolding eigen_value_def
[PROOF STATE]
proof (prove)
using this:
\<exists>v. eigen_vector A v x
eigen_vector A ?v x \<Longrightarrow> eigen_vector (a *k A) ?v (a * x)

goal (1 subgoal):
 1. \<exists>v. eigen_vector (a *k A) v (a * x)
[PROOF STEP]
by blast


[STATEMENT]
lemma map_ugraph_preserves_sub:
  assumes "subgraph G\<^sub>1 G\<^sub>2"
  shows "subgraph (map_ugraph f G\<^sub>1) (map_ugraph f G\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgraph (map_ugraph f G\<^sub>1) (map_ugraph f G\<^sub>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgraph (map_ugraph f G\<^sub>1) (map_ugraph f G\<^sub>2)
[PROOF STEP]
have "f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2" "(\<lambda>e. f ` e) ` uedges G\<^sub>1 \<subseteq> (\<lambda>e. f ` e) ` uedges G\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2 &&& (`) f ` uedges G\<^sub>1 \<subseteq> (`) f ` uedges G\<^sub>2
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
subgraph G\<^sub>1 G\<^sub>2

goal (1 subgoal):
 1. f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2 &&& (`) f ` uedges G\<^sub>1 \<subseteq> (`) f ` uedges G\<^sub>2
[PROOF STEP]
unfolding subgraph_def
[PROOF STATE]
proof (prove)
using this:
uverts G\<^sub>1 \<subseteq> uverts G\<^sub>2 \<and> uedges G\<^sub>1 \<subseteq> uedges G\<^sub>2

goal (1 subgoal):
 1. f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2 &&& (`) f ` uedges G\<^sub>1 \<subseteq> (`) f ` uedges G\<^sub>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2
(`) f ` uedges G\<^sub>1 \<subseteq> (`) f ` uedges G\<^sub>2

goal (1 subgoal):
 1. subgraph (map_ugraph f G\<^sub>1) (map_ugraph f G\<^sub>2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2
(`) f ` uedges G\<^sub>1 \<subseteq> (`) f ` uedges G\<^sub>2

goal (1 subgoal):
 1. subgraph (map_ugraph f G\<^sub>1) (map_ugraph f G\<^sub>2)
[PROOF STEP]
unfolding subgraph_def
[PROOF STATE]
proof (prove)
using this:
f ` uverts G\<^sub>1 \<subseteq> f ` uverts G\<^sub>2
(`) f ` uedges G\<^sub>1 \<subseteq> (`) f ` uedges G\<^sub>2

goal (1 subgoal):
 1. uverts (map_ugraph f G\<^sub>1) \<subseteq> uverts (map_ugraph f G\<^sub>2) \<and> uedges (map_ugraph f G\<^sub>1) \<subseteq> uedges (map_ugraph f G\<^sub>2)
[PROOF STEP]
by (metis map_ugraph.simps fst_conv snd_conv surjective_pairing)
[PROOF STATE]
proof (state)
this:
subgraph (map_ugraph f G\<^sub>1) (map_ugraph f G\<^sub>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma MSB_insert_nth[simp]:
  "MSB (insert_nth n P Is) = max (if P = {||} then 0 else Suc (fMax P)) (MSB Is)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MSB (insert_nth n P Is) = max (if P = {||} then 0 else Suc (fMax P)) (MSB Is)
[PROOF STEP]
by (subst (2) append_take_drop_id[of n Is, symmetric])
    (simp only: insert_nth_take_drop MSB_append MSB_Cons MSB_Nil)


[STATEMENT]
lemma countableE_bij:
  assumes S: "countable S" obtains f :: "nat \<Rightarrow> 'a" and C :: "nat set" where "bij_betw f C S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f C. bij_betw f C S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
countable S

goal (1 subgoal):
 1. (\<And>f C. bij_betw f C S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast elim: countableE dest: inj_on_imp_bij_betw bij_betw_inv)


[STATEMENT]
lemma at_append:
  fixes pi1 :: "'x prm"
  and   pi2 :: "'x prm"
  and   c   :: "'x"
  assumes at: "at TYPE('x)"
  shows "(pi1@pi2)\<bullet>c = pi1\<bullet>(pi2\<bullet>c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c
[PROOF STEP]
proof (induct pi1)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ([] @ pi2) \<bullet> c = [] \<bullet> pi2 \<bullet> c
 2. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. ([] @ pi2) \<bullet> c = [] \<bullet> pi2 \<bullet> c
 2. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([] @ pi2) \<bullet> c = [] \<bullet> pi2 \<bullet> c
[PROOF STEP]
by (simp add: at1[OF at])
[PROOF STATE]
proof (state)
this:
([] @ pi2) \<bullet> c = [] \<bullet> pi2 \<bullet> c

goal (1 subgoal):
 1. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
(xs @ pi2) \<bullet> c = xs \<bullet> pi2 \<bullet> c

goal (1 subgoal):
 1. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
have "(xs@pi2)\<bullet>c  =  xs\<bullet>(pi2\<bullet>c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ pi2) \<bullet> c = xs \<bullet> pi2 \<bullet> c
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
(xs @ pi2) \<bullet> c = xs \<bullet> pi2 \<bullet> c

goal (1 subgoal):
 1. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(xs @ pi2) \<bullet> c = xs \<bullet> pi2 \<bullet> c

goal (1 subgoal):
 1. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
have "(x#xs)@pi2 = x#(xs@pi2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs) @ pi2 = x # xs @ pi2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x # xs) @ pi2 = x # xs @ pi2

goal (1 subgoal):
 1. \<And>a pi1. (pi1 @ pi2) \<bullet> c = pi1 \<bullet> pi2 \<bullet> c \<Longrightarrow> ((a # pi1) @ pi2) \<bullet> c = (a # pi1) \<bullet> pi2 \<bullet> c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(xs @ pi2) \<bullet> c = xs \<bullet> pi2 \<bullet> c
(x # xs) @ pi2 = x # xs @ pi2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(xs @ pi2) \<bullet> c = xs \<bullet> pi2 \<bullet> c
(x # xs) @ pi2 = x # xs @ pi2

goal (1 subgoal):
 1. ((x # xs) @ pi2) \<bullet> c = (x # xs) \<bullet> pi2 \<bullet> c
[PROOF STEP]
by (cases "x", simp add:  at2[OF at])
[PROOF STATE]
proof (state)
this:
((x # xs) @ pi2) \<bullet> c = (x # xs) \<bullet> pi2 \<bullet> c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux2_digit_wise_equiv: "(\<forall>r<k. nth_bit a r = 0) \<longrightarrow> (a mod 2^k = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0
[PROOF STEP]
proof(induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<forall>r<0. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ 0 = 0
 2. \<And>k. (\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0 \<Longrightarrow> (\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<forall>r<0. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ 0 = 0
 2. \<And>k. (\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0 \<Longrightarrow> (\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>r<0. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ 0 = 0
[PROOF STEP]
by (auto simp add: nth_bit_def)
[PROOF STATE]
proof (state)
this:
(\<forall>r<0. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ 0 = 0

goal (1 subgoal):
 1. \<And>k. (\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0 \<Longrightarrow> (\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. (\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0 \<Longrightarrow> (\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
(\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0

goal (1 subgoal):
 1. \<And>k. (\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0 \<Longrightarrow> (\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<forall>r<k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ k = 0

goal (1 subgoal):
 1. (\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0
[PROOF STEP]
by (auto simp add: nth_bit_def)
       (metis dvd_imp_mod_0 dvd_mult_div_cancel dvd_refl even_iff_mod_2_eq_zero
        lessI minus_mod_eq_div_mult minus_mod_eq_mult_div mult_dvd_mono)
[PROOF STATE]
proof (state)
this:
(\<forall>r<Suc k. a \<exclamdown> r = 0) \<longrightarrow> a mod 2 ^ Suc k = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma squarefree_imp_prod_prime_factors_eq:
  fixes x :: "'a :: factorial_semiring_multiplicative"
  assumes "squarefree x"
  shows   "\<Prod>(prime_factors x) = normalize x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>(prime_factors x) = normalize x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Prod>(prime_factors x) = normalize x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
squarefree x
[PROOF STEP]
have [simp]: "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
squarefree x

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

goal (1 subgoal):
 1. \<Prod>(prime_factors x) = normalize x
[PROOF STEP]
have "(\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = normalize x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = normalize x
[PROOF STEP]
by (intro prod_prime_factors) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = normalize x

goal (1 subgoal):
 1. \<Prod>(prime_factors x) = normalize x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = normalize x

goal (1 subgoal):
 1. \<Prod>(prime_factors x) = normalize x
[PROOF STEP]
have "(\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = (\<Prod>p\<in>prime_factors x. p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = \<Prod>(prime_factors x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
squarefree x

goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = \<Prod>(prime_factors x)
[PROOF STEP]
by (intro prod.cong refl) (auto simp: squarefree_factorial_semiring')
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors x. p ^ multiplicity p x) = \<Prod>(prime_factors x)

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

goal (1 subgoal):
 1. \<Prod>(prime_factors x) = normalize x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Prod>(prime_factors x) = normalize x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pderiv_char_poly_mat_erase: fixes A :: "'a :: idom mat"
  assumes A: "A \<in> carrier_mat n n"
  shows "monom 1 1 * pderiv (char_poly A) = (\<Sum>i < n. char_poly (mat_erase A i i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (char_poly A) = (\<Sum>i<n. char_poly (mat_erase A i i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (char_poly A) = (\<Sum>i<n. char_poly (mat_erase A i i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) 1 * pderiv (char_poly A) = (\<Sum>i<n. char_poly (mat_erase A i i))
[PROOF STEP]
unfolding pderiv_char_poly[OF A] sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<n. monom (1::'a) 1 * char_poly (mat_delete A n n)) = (\<Sum>i<n. char_poly (mat_erase A i i))
[PROOF STEP]
proof (rule sum.cong[OF refl])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> monom (1::'a) 1 * char_poly (mat_delete A x x) = char_poly (mat_erase A x x)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> monom (1::'a) 1 * char_poly (mat_delete A x x) = char_poly (mat_erase A x x)
[PROOF STEP]
assume "i \<in> {..<n}"
[PROOF STATE]
proof (state)
this:
i \<in> {..<n}

goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> monom (1::'a) 1 * char_poly (mat_delete A x x) = char_poly (mat_erase A x x)
[PROOF STEP]
hence i: "i < n"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<n}

goal (1 subgoal):
 1. i < n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> monom (1::'a) 1 * char_poly (mat_delete A x x) = char_poly (mat_erase A x x)
[PROOF STEP]
have mA: "mat_erase A i i \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_erase A i i \<in> carrier_mat n n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. mat_erase A i i \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_erase A i i \<in> carrier_mat n n

goal (1 subgoal):
 1. \<And>x. x \<in> {..<n} \<Longrightarrow> monom (1::'a) 1 * char_poly (mat_delete A x x) = char_poly (mat_erase A x x)
[PROOF STEP]
show "monom 1 1 * char_poly (mat_delete A i i) = char_poly (mat_erase A i i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) 1 * char_poly (mat_delete A i i) = char_poly (mat_erase A i i)
[PROOF STEP]
by (subst char_poly_0_column[OF _ mA i], (insert i A, force simp: mat_erase_def),
      rule arg_cong[of _ _ "\<lambda> x. f * char_poly x" for f],
      auto simp: mat_delete_def mat_erase_def)
[PROOF STATE]
proof (state)
this:
monom (1::'a) 1 * char_poly (mat_delete A i i) = char_poly (mat_erase A i i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
monom (1::'a) 1 * pderiv (char_poly A) = (\<Sum>i<n. char_poly (mat_erase A i i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Henstock_lemma_part2:
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
  assumes fed: "f integrable_on cbox a b" "e > 0" "gauge d"
    and less_e: "\<And>\<D>. \<lbrakk>\<D> tagged_division_of (cbox a b); d fine \<D>\<rbrakk> \<Longrightarrow>
                     norm (sum (\<lambda>(x,k). content k *\<^sub>R f x) \<D> - integral (cbox a b) f) < e"
    and tag: "p tagged_partial_division_of (cbox a b)"
    and "d fine p"
  shows "sum (\<lambda>(x,k). norm (content k *\<^sub>R f x - integral k f)) p \<le> 2 * real (DIM('n)) * e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
have "finite p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite p
[PROOF STEP]
using tag tagged_partial_division_ofD
[PROOF STATE]
proof (prove)
using this:
p tagged_partial_division_of cbox a b
?s tagged_partial_division_of ?i \<Longrightarrow> finite ?s
\<lbrakk>?s tagged_partial_division_of ?i; (?x, ?K) \<in> ?s\<rbrakk> \<Longrightarrow> ?x \<in> ?K
\<lbrakk>?s tagged_partial_division_of ?i; (?x, ?K) \<in> ?s\<rbrakk> \<Longrightarrow> ?K \<subseteq> ?i
\<lbrakk>?s tagged_partial_division_of ?i; (?x, ?K) \<in> ?s\<rbrakk> \<Longrightarrow> \<exists>a b. ?K = cbox a b
\<lbrakk>?s tagged_partial_division_of ?i; (?x1.0, ?K1.0) \<in> ?s; (?x2.0, ?K2.0) \<in> ?s; (?x1.0, ?K1.0) \<noteq> (?x2.0, ?K2.0)\<rbrakk> \<Longrightarrow> interior ?K1.0 \<inter> interior ?K2.0 = {}

goal (1 subgoal):
 1. finite p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite p

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite p

goal (1 subgoal):
 1. (\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
unfolding split_def
[PROOF STATE]
proof (prove)
using this:
finite p

goal (1 subgoal):
 1. (\<Sum>p\<in>p. norm (content (snd p) *\<^sub>R f (fst p) - integral (snd p) f)) \<le> 2 * real DIM('n) * e
[PROOF STEP]
proof (rule sum_norm_allsubsets_bound)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Q. Q \<subseteq> p \<Longrightarrow> norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e
[PROOF STEP]
fix Q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Q. Q \<subseteq> p \<Longrightarrow> norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e
[PROOF STEP]
assume Q: "Q \<subseteq> p"
[PROOF STATE]
proof (state)
this:
Q \<subseteq> p

goal (1 subgoal):
 1. \<And>Q. Q \<subseteq> p \<Longrightarrow> norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Q \<subseteq> p
[PROOF STEP]
have fine: "d fine Q"
[PROOF STATE]
proof (prove)
using this:
Q \<subseteq> p

goal (1 subgoal):
 1. d fine Q
[PROOF STEP]
by (simp add: \<open>d fine p\<close> fine_subset)
[PROOF STATE]
proof (state)
this:
d fine Q

goal (1 subgoal):
 1. \<And>Q. Q \<subseteq> p \<Longrightarrow> norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e
[PROOF STEP]
show "norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e
[PROOF STEP]
apply (rule Henstock_lemma_part1[OF fed less_e, unfolded split_def])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>x tagged_division_of cbox a b; d fine x\<rbrakk> \<Longrightarrow> x tagged_division_of cbox a b
 2. \<And>x. \<lbrakk>x tagged_division_of cbox a b; d fine x\<rbrakk> \<Longrightarrow> d fine x
 3. Q tagged_partial_division_of cbox a b
 4. d fine Q
[PROOF STEP]
using Q tag tagged_partial_division_subset
[PROOF STATE]
proof (prove)
using this:
Q \<subseteq> p
p tagged_partial_division_of cbox a b
\<lbrakk>?s tagged_partial_division_of ?i; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> ?t tagged_partial_division_of ?i

goal (4 subgoals):
 1. \<And>x. \<lbrakk>x tagged_division_of cbox a b; d fine x\<rbrakk> \<Longrightarrow> x tagged_division_of cbox a b
 2. \<And>x. \<lbrakk>x tagged_division_of cbox a b; d fine x\<rbrakk> \<Longrightarrow> d fine x
 3. Q tagged_partial_division_of cbox a b
 4. d fine Q
[PROOF STEP]
by (force simp add: fine)+
[PROOF STATE]
proof (state)
this:
norm (\<Sum>x\<in>Q. content (snd x) *\<^sub>R f (fst x) - integral (snd x) f) \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>(x, k)\<in>p. norm (content k *\<^sub>R f x - integral k f)) \<le> 2 * real DIM('n) * e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ord_cases:
  fixes a b :: int obtains
  "ord a b = LESS" and "a < b" |
  "ord a b = EQUAL" and "a = b" |
  "ord a b = GREATER" and "a > b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>ord a b = LESS; a < b\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>ord a b = EQUAL; a = b\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>ord a b = GREATER; b < a\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
unfolding ord_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>(if a < b then LESS else if a = b then EQUAL else GREATER) = LESS; a < b\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>(if a < b then LESS else if a = b then EQUAL else GREATER) = EQUAL; a = b\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>(if a < b then LESS else if a = b then EQUAL else GREATER) = GREATER; b < a\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (rule linorder_cases [of a b]) auto


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


[STATEMENT]
lemma plus_inverse_ge_2:
  fixes x :: real
  assumes "x > 0"
  shows   "x + inverse x \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
have "0 \<le> (x - 1) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (x - 1)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> (x - 1)\<^sup>2

goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> (x - 1)\<^sup>2

goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
have "\<dots> = x^2 - 2*x + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - 1)\<^sup>2 = x\<^sup>2 - 2 * x + 1
[PROOF STEP]
by (simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
(x - 1)\<^sup>2 = x\<^sup>2 - 2 * x + 1

goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x\<^sup>2 - 2 * x + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> x\<^sup>2 - 2 * x + 1

goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x\<^sup>2 - 2 * x + 1
0 < x

goal (1 subgoal):
 1. 2 \<le> x + inverse x
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
2 \<le> x + inverse x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in dcharacter) sum_dcharacter_totatives:
  "(\<Sum>x\<in>totatives n. \<chi> x) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "(\<Sum>x\<in>totatives n. \<chi> x) = (\<Sum>x\<in>carrier G. dc2c \<chi> x)"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. sum \<chi> (totatives n) = sum (dc2c \<chi>) (carrier G)
[PROOF STEP]
by (intro sum.cong) (auto simp: totatives_def dc2c_def G_def residue_mult_group_def)
[PROOF STATE]
proof (state)
this:
sum \<chi> (totatives n) = sum (dc2c \<chi>) (carrier G)

goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum \<chi> (totatives n) = sum (dc2c \<chi>) (carrier G)

goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
have "\<dots> = (if dc2c \<chi> = principal_char G then of_nat (order G) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (dc2c \<chi>) (carrier G) = (if dc2c \<chi> = principal_char G then of_nat (order G) else 0)
[PROOF STEP]
by (rule dc2c.sum_character)
[PROOF STATE]
proof (state)
this:
sum (dc2c \<chi>) (carrier G) = (if dc2c \<chi> = principal_char G then of_nat (order G) else 0)

goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (dc2c \<chi>) (carrier G) = (if dc2c \<chi> = principal_char G then of_nat (order G) else 0)

goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
have "dc2c \<chi> = principal_char G \<longleftrightarrow> \<chi> = principal_dchar n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dc2c \<chi> = principal_char G) = (\<chi> = principal_dchar n)
[PROOF STEP]
by (metis c2dc_dc2c dc2c_principal principal_dchar_altdef)
[PROOF STATE]
proof (state)
this:
(dc2c \<chi> = principal_char G) = (\<chi> = principal_dchar n)

goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (order G) else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (order G) else 0)

goal (1 subgoal):
 1. sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum \<chi> (totatives n) = (if \<chi> = principal_dchar n then of_nat (totient n) else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma T_insert3_def2: "T_insert3 x (t,n) = T_ins3 n 0 x t + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T_insert3 x (t, n) = T_ins3 n 0 x t + 1
[PROOF STEP]
by(simp add: T_insert3_def ins3_def T_ins3_def tm_simps split: tm.split up2.split)


[STATEMENT]
lemma content_uminus[simp]:
  fixes f::"int poly"
  shows "content (-f) = content f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
have "-f = - (smult 1 f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - f = - smult 1 f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- f = - smult 1 f

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- f = - smult 1 f

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
have "... = smult (-1) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - smult 1 f = smult (- 1) f
[PROOF STEP]
using smult_minus_left
[PROOF STATE]
proof (prove)
using this:
smult (- ?a) ?p = - smult ?a ?p

goal (1 subgoal):
 1. - smult 1 f = smult (- 1) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- smult 1 f = smult (- 1) f

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- f = smult (- 1) f
[PROOF STEP]
have "content (-f) = content (smult (-1) f)"
[PROOF STATE]
proof (prove)
using this:
- f = smult (- 1) f

goal (1 subgoal):
 1. content (- f) = content (smult (- 1) f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
content (- f) = content (smult (- 1) f)

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
content (- f) = content (smult (- 1) f)

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
have "... = normalize (- 1) * content f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (smult (- 1) f) = normalize (- 1) * content f
[PROOF STEP]
unfolding content_smult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (- 1) * content f = normalize (- 1) * content f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
content (smult (- 1) f) = normalize (- 1) * content f

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
content (- f) = normalize (- 1) * content f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
content (- f) = normalize (- 1) * content f

goal (1 subgoal):
 1. content (- f) = content f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
content (- f) = content f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in first_countable_topology) eventually_nhds_within_iff_sequentially:
  "eventually P (inf (nhds a) (principal s)) \<longleftrightarrow>
    (\<forall>f. (\<forall>n. f n \<in> s) \<and> f \<longlonglongrightarrow> a \<longrightarrow> eventually (\<lambda>n. P (f n)) sequentially)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (inf (nhds a) (principal s)) = (\<forall>f. (\<forall>n. f n \<in> s) \<and> f \<longlonglongrightarrow> a \<longrightarrow> (\<forall>\<^sub>F n in sequentially. P (f n)))
[PROOF STEP]
proof (safe intro!: sequentially_imp_eventually_nhds_within)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>eventually P (inf (nhds a) (principal s)); \<forall>n. f n \<in> s; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
assume "eventually P (inf (nhds a) (principal s))"
[PROOF STATE]
proof (state)
this:
eventually P (inf (nhds a) (principal s))

goal (1 subgoal):
 1. \<And>f. \<lbrakk>eventually P (inf (nhds a) (principal s)); \<forall>n. f n \<in> s; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eventually P (inf (nhds a) (principal s))
[PROOF STEP]
obtain S where "open S" "a \<in> S" "\<forall>x\<in>S. x \<in> s \<longrightarrow> P x"
[PROOF STATE]
proof (prove)
using this:
eventually P (inf (nhds a) (principal s))

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>open S; a \<in> S; \<forall>x\<in>S. x \<in> s \<longrightarrow> P x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_inf_principal eventually_nhds)
[PROOF STATE]
proof (state)
this:
open S
a \<in> S
\<forall>x\<in>S. x \<in> s \<longrightarrow> P x

goal (1 subgoal):
 1. \<And>f. \<lbrakk>eventually P (inf (nhds a) (principal s)); \<forall>n. f n \<in> s; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
open S
a \<in> S
\<forall>x\<in>S. x \<in> s \<longrightarrow> P x

goal (1 subgoal):
 1. \<And>f. \<lbrakk>eventually P (inf (nhds a) (principal s)); \<forall>n. f n \<in> s; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>eventually P (inf (nhds a) (principal s)); \<forall>n. f n \<in> s; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
assume "\<forall>n. f n \<in> s" "f \<longlonglongrightarrow> a"
[PROOF STATE]
proof (state)
this:
\<forall>n. f n \<in> s
f \<longlonglongrightarrow> a

goal (1 subgoal):
 1. \<And>f. \<lbrakk>eventually P (inf (nhds a) (principal s)); \<forall>n. f n \<in> s; f \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
open S
a \<in> S
\<forall>x\<in>S. x \<in> s \<longrightarrow> P x
\<forall>n. f n \<in> s
f \<longlonglongrightarrow> a
[PROOF STEP]
show "eventually (\<lambda>n. P (f n)) sequentially"
[PROOF STATE]
proof (prove)
using this:
open S
a \<in> S
\<forall>x\<in>S. x \<in> s \<longrightarrow> P x
\<forall>n. f n \<in> s
f \<longlonglongrightarrow> a

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. P (f n)
[PROOF STEP]
by (auto dest!: topological_tendstoD elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. P (f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_LBINT:
  fixes f :: "real \<Rightarrow> real"
  assumes f: "\<And>b. a \<le> b \<Longrightarrow> set_integrable lborel {a..b} f"
  shows "continuous_on UNIV (\<lambda>b. LBINT x:{a..b}. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>b. set_lebesgue_integral lborel {a..b} f)
[PROOF STEP]
proof (subst set_borel_integral_eq_integral)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
fix b :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
assume "a \<le> b"
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
from f[OF this]
[PROOF STATE]
proof (chain)
picking this:
set_integrable lborel {a..b} f
[PROOF STEP]
have "continuous_on {a..b} (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {a..b} f

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by (intro indefinite_integral_continuous_1 set_borel_integral_eq_integral)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a \<le> ?b2 \<Longrightarrow> continuous_on {a..?b2} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
a \<le> ?b2 \<Longrightarrow> continuous_on {a..?b2} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "continuous_on (\<Union>b\<in>{a..}. {a <..< b}) (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (\<Union> (greaterThanLessThan a ` {a..})) (\<lambda>b. integral {a..b} f)
[PROOF STEP]
proof (intro continuous_on_open_UN)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. b \<in> {a..} \<Longrightarrow> open {a<..<b}
 2. \<And>b. b \<in> {a..} \<Longrightarrow> continuous_on {a<..<b} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
show "b \<in> {a..} \<Longrightarrow> continuous_on {a<..<b} (\<lambda>b. integral {a..b} f)" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> {a..} \<Longrightarrow> continuous_on {a<..<b} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
using *[of b]
[PROOF STATE]
proof (prove)
using this:
a \<le> b \<Longrightarrow> continuous_on {a..b} (\<lambda>b. integral {a..b} f)

goal (1 subgoal):
 1. b \<in> {a..} \<Longrightarrow> continuous_on {a<..<b} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by (rule continuous_on_subset) auto
[PROOF STATE]
proof (state)
this:
?b \<in> {a..} \<Longrightarrow> continuous_on {a<..<?b} (\<lambda>b. integral {a..b} f)

goal (1 subgoal):
 1. \<And>b. b \<in> {a..} \<Longrightarrow> open {a<..<b}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
continuous_on (\<Union> (greaterThanLessThan a ` {a..})) (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
continuous_on (\<Union> (greaterThanLessThan a ` {a..})) (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "(\<Union>b\<in>{a..}. {a <..< b}) = {a <..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (greaterThanLessThan a ` {a..}) = {a<..}
[PROOF STEP]
by (auto simp: lt_ex gt_ex less_imp_le) (simp add: Bex_def less_imp_le gt_ex cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
\<Union> (greaterThanLessThan a ` {a..}) = {a<..}

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a<..} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "continuous_on {a+1 ..} (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
using this:
continuous_on {a<..} (\<lambda>b. integral {a..b} f)

goal (1 subgoal):
 1. continuous_on {a + 1..} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by (rule continuous_on_subset) auto
[PROOF STATE]
proof (state)
this:
continuous_on {a + 1..} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on {a + 1..} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "continuous_on {a..a+1} (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..a + 1} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by (rule *) simp
[PROOF STATE]
proof (state)
this:
continuous_on {a..a + 1} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on {a..a + 1} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "x \<le> a \<Longrightarrow> {a..x} = (if a = x then {a} else {})" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> a \<Longrightarrow> {a..x} = (if a = x then {a} else {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<le> a \<Longrightarrow> {a..?x} = (if a = ?x then {a} else {})

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<le> a \<Longrightarrow> {a..?x} = (if a = ?x then {a} else {})
[PROOF STEP]
have "continuous_on {..a} (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
using this:
?x \<le> a \<Longrightarrow> {a..?x} = (if a = ?x then {a} else {})

goal (1 subgoal):
 1. continuous_on {..a} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by (subst continuous_on_cong[OF refl, where g="\<lambda>x. 0"]) (auto intro!: continuous_on_const)
[PROOF STATE]
proof (state)
this:
continuous_on {..a} (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a + 1..} (\<lambda>b. integral {a..b} f)
continuous_on {a..a + 1} (\<lambda>b. integral {a..b} f)
continuous_on {..a} (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "continuous_on ({..a} \<union> {a..a+1} \<union> {a+1 ..}) (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
using this:
continuous_on {a + 1..} (\<lambda>b. integral {a..b} f)
continuous_on {a..a + 1} (\<lambda>b. integral {a..b} f)
continuous_on {..a} (\<lambda>b. integral {a..b} f)

goal (1 subgoal):
 1. continuous_on ({..a} \<union> {a..a + 1} \<union> {a + 1..}) (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by (intro continuous_on_closed_Un) auto
[PROOF STATE]
proof (state)
this:
continuous_on ({..a} \<union> {a..a + 1} \<union> {a + 1..}) (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
continuous_on ({..a} \<union> {a..a + 1} \<union> {a + 1..}) (\<lambda>b. integral {a..b} f)

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
have "{..a} \<union> {a..a+1} \<union> {a+1 ..} = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..a} \<union> {a..a + 1} \<union> {a + 1..} = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..a} \<union> {a..a + 1} \<union> {a + 1..} = UNIV

goal (2 subgoals):
 1. \<And>b. set_integrable lborel {a..b} f
 2. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
show "continuous_on UNIV (\<lambda>b. integral {a..b} f)"
[PROOF STATE]
proof (prove)
using this:
continuous_on UNIV (\<lambda>b. integral {a..b} f)

goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>b. integral {a..b} f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on UNIV (\<lambda>b. integral {a..b} f)

goal (1 subgoal):
 1. \<And>b. set_integrable lborel {a..b} f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. set_integrable lborel {a..b} f
[PROOF STEP]
show "set_integrable lborel {a..b} f" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable lborel {a..b} f
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
a \<le> ?b \<Longrightarrow> set_integrable lborel {a..?b} f

goal (1 subgoal):
 1. set_integrable lborel {a..b} f
[PROOF STEP]
by (cases "a \<le> b") auto
[PROOF STATE]
proof (state)
this:
set_integrable lborel {a..?b} f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sp_append :
  "subpath g v1 (es1 @ es2) v2 subs \<longleftrightarrow>
   (\<exists> v. subpath g v1 es1 v subs \<and> subpath g v es2 v2 subs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SubRel.subpath g v1 (es1 @ es2) v2 subs = (\<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs)
[PROOF STEP]
proof (intro iffI, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. SubRel.subpath g v1 (es1 @ es2) v2 subs \<Longrightarrow> \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs
 2. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs \<Longrightarrow> SubRel.subpath g v1 (es1 @ es2) v2 subs
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
SubRel.subpath g v1 (es1 @ es2) v2 subs

goal (2 subgoals):
 1. SubRel.subpath g v1 (es1 @ es2) v2 subs \<Longrightarrow> \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs
 2. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs \<Longrightarrow> SubRel.subpath g v1 (es1 @ es2) v2 subs
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
SubRel.subpath g v1 (es1 @ es2) v2 subs

goal (1 subgoal):
 1. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs
[PROOF STEP]
using sub_rel_of.ces_imp_ends_vertices
[PROOF STATE]
proof (prove)
using this:
SubRel.subpath g v1 (es1 @ es2) v2 subs
\<lbrakk>sub_rel_of ?g ?subs; SubRel.ces ?v1.0 ?es ?v2.0 ?subs; set ?es \<subseteq> edges ?g; ?v1.0 \<in> Graph.vertices ?g\<rbrakk> \<Longrightarrow> ?v2.0 \<in> Graph.vertices ?g

goal (1 subgoal):
 1. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs
[PROOF STEP]
by (simp add : subpath_def ces_append) blast
[PROOF STATE]
proof (state)
this:
\<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs

goal (1 subgoal):
 1. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs \<Longrightarrow> SubRel.subpath g v1 (es1 @ es2) v2 subs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs \<Longrightarrow> SubRel.subpath g v1 (es1 @ es2) v2 subs
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
\<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs

goal (1 subgoal):
 1. \<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs \<Longrightarrow> SubRel.subpath g v1 (es1 @ es2) v2 subs
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<exists>v. SubRel.subpath g v1 es1 v subs \<and> SubRel.subpath g v es2 v2 subs

goal (1 subgoal):
 1. SubRel.subpath g v1 (es1 @ es2) v2 subs
[PROOF STEP]
unfolding subpath_def
[PROOF STATE]
proof (prove)
using this:
\<exists>v. (sub_rel_of g subs \<and> v1 \<in> Graph.vertices g \<and> SubRel.ces v1 es1 v subs \<and> set es1 \<subseteq> edges g) \<and> sub_rel_of g subs \<and> v \<in> Graph.vertices g \<and> SubRel.ces v es2 v2 subs \<and> set es2 \<subseteq> edges g

goal (1 subgoal):
 1. sub_rel_of g subs \<and> v1 \<in> Graph.vertices g \<and> SubRel.ces v1 (es1 @ es2) v2 subs \<and> set (es1 @ es2) \<subseteq> edges g
[PROOF STEP]
by (simp only : ces_append) fastforce
[PROOF STATE]
proof (state)
this:
SubRel.subpath g v1 (es1 @ es2) v2 subs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fiter_mono: "c \<sqsubseteq> d \<Longrightarrow> c\<^sup>\<star> \<sqsubseteq> d\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<sqsubseteq> d \<Longrightarrow> c\<^sup>\<star> \<sqsubseteq> d\<^sup>\<star>
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, nil :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<sqsubseteq> d \<Longrightarrow> c\<^sup>\<star> \<sqsubseteq> d\<^sup>\<star>
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, nil :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
assume "c \<sqsubseteq> d"
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice) \<sqsubseteq> (d::'a::refinement_lattice)

goal (1 subgoal):
 1. c \<sqsubseteq> d \<Longrightarrow> c\<^sup>\<star> \<sqsubseteq> d\<^sup>\<star>
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, nil :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(c::'a::refinement_lattice) \<sqsubseteq> (d::'a::refinement_lattice)
[PROOF STEP]
have "c\<^sup>\<star> \<sqsubseteq> nil \<sqinter> d;c\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice) \<sqsubseteq> (d::'a::refinement_lattice)

goal (1 subgoal):
 1. c\<^sup>\<star> \<sqsubseteq> nil \<sqinter> d ; c\<^sup>\<star>
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis fiter0 fiter1 fiter2 inf.bounded_iff refine_trans seq_mono_left)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> (d::'a::refinement_lattice) ; c\<^sup>\<star>

goal (1 subgoal):
 1. c \<sqsubseteq> d \<Longrightarrow> c\<^sup>\<star> \<sqsubseteq> d\<^sup>\<star>
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, nil :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(c::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> nil \<sqinter> (d::'a::refinement_lattice) ; c\<^sup>\<star>

goal (1 subgoal):
 1. c\<^sup>\<star> \<sqsubseteq> d\<^sup>\<star>
variables:
c, d, nil :: 'a
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis seq_nil_right fiter_induct)
[PROOF STATE]
proof (state)
this:
(c::'a::refinement_lattice)\<^sup>\<star> \<sqsubseteq> (d::'a::refinement_lattice)\<^sup>\<star>

goal:
No subgoals!
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, nil :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
theorem meet_commute: "x \<sqinter> y = y \<sqinter> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y = y \<sqinter> x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. y \<sqinter> x \<sqsubseteq> x
 2. y \<sqinter> x \<sqsubseteq> y
 3. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> y \<sqinter> x
[PROOF STEP]
show "y \<sqinter> x \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> x \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> x \<sqsubseteq> x

goal (2 subgoals):
 1. y \<sqinter> x \<sqsubseteq> y
 2. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> y \<sqinter> x
[PROOF STEP]
show "y \<sqinter> x \<sqsubseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqinter> x \<sqsubseteq> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> x \<sqsubseteq> y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> y \<sqinter> x
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> y \<sqinter> x
[PROOF STEP]
assume "z \<sqsubseteq> y" and "z \<sqsubseteq> x"
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> y
z \<sqsubseteq> x

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> y \<sqinter> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<sqsubseteq> y
z \<sqsubseteq> x
[PROOF STEP]
show "z \<sqsubseteq> y \<sqinter> x"
[PROOF STATE]
proof (prove)
using this:
z \<sqsubseteq> y
z \<sqsubseteq> x

goal (1 subgoal):
 1. z \<sqsubseteq> y \<sqinter> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> y \<sqinter> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma starfun2_star_n: "( *f2* f) (star_n X) (star_n Y) = star_n (\<lambda>n. f (X n) (Y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*f2* f) (star_n X) (star_n Y) = star_n (\<lambda>n. f (X n) (Y n))
[PROOF STEP]
by (simp only: starfun2_def star_of_def Ifun_star_n)


[STATEMENT]
lemma Cons_Suc_distinct_concat_map_function:
  "\<lbrakk>\<forall> x \<in> set xs. distinct (g x) ; distinct xs\<rbrakk> \<Longrightarrow> distinct [Suc x # y. x \<leftarrow> xs, y \<leftarrow> g x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. distinct (g x); distinct xs\<rbrakk> \<Longrightarrow> distinct (concat (map (\<lambda>x. map ((#) (Suc x)) (g x)) xs))
[PROOF STEP]
using inj2_distinct_concat_map_function Cons_Suc_inj2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>inj2 ?f; \<forall>x\<in>set ?xs. distinct (?g x); distinct ?xs\<rbrakk> \<Longrightarrow> distinct (concat (map (\<lambda>x. map (?f x) (?g x)) ?xs))
inj2 (\<lambda>x. (#) (Suc x))

goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>set xs. distinct (g x); distinct xs\<rbrakk> \<Longrightarrow> distinct (concat (map (\<lambda>x. map ((#) (Suc x)) (g x)) xs))
[PROOF STEP]
by auto


[STATEMENT]
lemma fmrel_tranclp_induct:
  "fmrel r\<^sup>+\<^sup>+ a b \<Longrightarrow>
   reflp r \<Longrightarrow>
   (\<And>y. fmrel r a y \<Longrightarrow> P y) \<Longrightarrow>
   (\<And>y z. (fmrel r)\<^sup>+\<^sup>+ a y \<Longrightarrow> fmrel r y z \<Longrightarrow> P y \<Longrightarrow> P z) \<Longrightarrow> P b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmrel r\<^sup>+\<^sup>+ a b; reflp r; \<And>y. fmrel r a y \<Longrightarrow> P y; \<And>y z. \<lbrakk>(fmrel r)\<^sup>+\<^sup>+ a y; fmrel r y z; P y\<rbrakk> \<Longrightarrow> P z\<rbrakk> \<Longrightarrow> P b
[PROOF STEP]
apply (drule fmrel_to_trancl, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fmrel r\<^sup>+\<^sup>+ a b; \<And>y. fmrel r a y \<Longrightarrow> P y; \<And>y z. \<lbrakk>(fmrel r)\<^sup>+\<^sup>+ a y; fmrel r y z; P y\<rbrakk> \<Longrightarrow> P z; (fmrel r)\<^sup>+\<^sup>+ a b\<rbrakk> \<Longrightarrow> P b
[PROOF STEP]
by (erule tranclp_induct; simp)


[STATEMENT]
lemma lhopital_at_top:
  "LIM x at x. (g::real \<Rightarrow> real) x :> at_top \<Longrightarrow>
    eventually (\<lambda>x. g' x \<noteq> 0) (at x) \<Longrightarrow>
    eventually (\<lambda>x. DERIV f x :> f' x) (at x) \<Longrightarrow>
    eventually (\<lambda>x. DERIV g x :> g' x) (at x) \<Longrightarrow>
    ((\<lambda> x. (f' x / g' x)) \<longlongrightarrow> y) (at x) \<Longrightarrow>
    ((\<lambda> x. f x / g x) \<longlongrightarrow> y) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>filterlim g at_top (at x); \<forall>\<^sub>F x in at x. g' x \<noteq> 0; \<forall>\<^sub>F x in at x. (f has_real_derivative f' x) (at x); \<forall>\<^sub>F x in at x. (g has_real_derivative g' x) (at x); (\<lambda>x. f' x / g' x) \<midarrow>x\<rightarrow> y\<rbrakk> \<Longrightarrow> (\<lambda>x. f x / g x) \<midarrow>x\<rightarrow> y
[PROOF STEP]
unfolding eventually_at_split filterlim_at_split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>filterlim g at_top (at_left x) \<and> filterlim g at_top (at_right x); (\<forall>\<^sub>F x in at_left x. g' x \<noteq> 0) \<and> (\<forall>\<^sub>F x in at_right x. g' x \<noteq> 0); (\<forall>\<^sub>F x in at_left x. (f has_real_derivative f' x) (at x)) \<and> (\<forall>\<^sub>F x in at_right x. (f has_real_derivative f' x) (at x)); (\<forall>\<^sub>F x in at_left x. (g has_real_derivative g' x) (at x)) \<and> (\<forall>\<^sub>F x in at_right x. (g has_real_derivative g' x) (at x)); ((\<lambda>x. f' x / g' x) \<longlongrightarrow> y) (at_left x) \<and> ((\<lambda>x. f' x / g' x) \<longlongrightarrow> y) (at_right x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x / g x) \<longlongrightarrow> y) (at_left x) \<and> ((\<lambda>x. f x / g x) \<longlongrightarrow> y) (at_right x)
[PROOF STEP]
by (auto intro!: lhopital_right_at_top[of g x g' f f'] lhopital_left_at_top[of g x g' f f'])


[STATEMENT]
lemma vec_of_basis_enum_scaleC:
  "vec_of_basis_enum (c *\<^sub>C b) = c \<cdot>\<^sub>v (vec_of_basis_enum b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (c *\<^sub>C b) = c \<cdot>\<^sub>v vec_of_basis_enum b
[PROOF STEP]
by (auto simp: vec_of_basis_enum_def complex_vector.representation_scale)


[STATEMENT]
lemma tendsto_cos [tendsto_intros]: "(f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. cos (f x)) \<longlongrightarrow> cos a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. cos (f x)) \<longlongrightarrow> cos a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_cos])


[STATEMENT]
lemma is_interval_simply_connected_1:
  fixes S :: "real set"
  shows "is_interval S \<longleftrightarrow> simply_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interval S = simply_connected S
[PROOF STEP]
using convex_imp_simply_connected is_interval_convex_1 is_interval_path_connected_1 simply_connected_imp_path_connected
[PROOF STATE]
proof (prove)
using this:
convex ?S \<Longrightarrow> simply_connected ?S
is_interval ?S = convex ?S
is_interval ?s = path_connected ?s
simply_connected ?S \<Longrightarrow> path_connected ?S

goal (1 subgoal):
 1. is_interval S = simply_connected S
[PROOF STEP]
by auto


[STATEMENT]
lemma abs_summable_comparison_test_ev:
  assumes "g abs_summable_on I"
  assumes "eventually (\<lambda>x. x \<in> I \<longrightarrow> norm (f x) \<le> g x) sequentially"
  shows   "f abs_summable_on I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on I
[PROOF STEP]
by (metis (no_types, lifting) nat_abs_summable_on_comparison_test eventually_at_top_linorder assms)


[STATEMENT]
lemma bigo_alt_def: "O(f) = {h. \<exists>c. (0 < c \<and> (\<forall>x. \<bar>h x\<bar> <= c * \<bar>f x\<bar>))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. O(f) = {h. \<exists>c>0::'b. \<forall>x. \<bar>h x\<bar> \<le> c * \<bar>f x\<bar>}
[PROOF STEP]
by (auto simp add: bigo_def bigo_pos_const)