[STATEMENT]
lemma completely_multiplicative_iff_inverse_moebius_mu:
  fixes f :: "nat \<Rightarrow> 'a :: {comm_ring_1, ring_no_zero_divisors}"
  assumes "multiplicative_function f"
  defines "g \<equiv> dirichlet_inverse f 1"
  shows   "completely_multiplicative_function f \<longleftrightarrow>
             (\<forall>n. g n = moebius_mu n * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
interpret multiplicative_function f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
assume "completely_multiplicative_function f"
[PROOF STATE]
proof (state)
this:
completely_multiplicative_function f

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
completely_multiplicative_function f
[PROOF STEP]
interpret completely_multiplicative_function f
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function f

goal (1 subgoal):
 1. completely_multiplicative_function f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
have [simp]: "fds f \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds f \<noteq> 0
[PROOF STEP]
by (auto simp: fds_eq_iff)
[PROOF STATE]
proof (state)
this:
fds f \<noteq> 0

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
have "fds (\<lambda>n. moebius_mu n * f n) * fds f = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (\<lambda>n. moebius_mu n * f n) * fds f = 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n =
              (\<Sum>(r, d) | r * d = n. moebius_mu r * f (r * d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d))
[PROOF STEP]
by (simp add: fds_eq_iff fds_nth_mult fds_nth_fds dirichlet_prod_altdef2 mult mult.assoc)
[PROOF STATE]
proof (state)
this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "\<dots> = (\<Sum>(r, d) | r * d = n. moebius_mu r * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d)) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n)
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d)) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d)) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "\<dots> = dirichlet_prod moebius_mu (\<lambda>_. 1) n * f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n) = dirichlet_prod moebius_mu (\<lambda>_. 1::'a) n * f n
[PROOF STEP]
by (simp add: dirichlet_prod_altdef2 sum_distrib_right case_prod_unfold mult)
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n) = dirichlet_prod moebius_mu (\<lambda>_. 1::'a) n * f n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n) = dirichlet_prod moebius_mu (\<lambda>_. 1::'a) n * f n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "dirichlet_prod moebius_mu (\<lambda>_. 1) n = fds_nth (fds moebius_mu * fds_zeta) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod moebius_mu (\<lambda>_. 1::'b) n = fds_nth (fds moebius_mu * fds_zeta) n
[PROOF STEP]
by (simp add: fds_nth_mult)
[PROOF STATE]
proof (state)
this:
dirichlet_prod moebius_mu (\<lambda>_. 1::?'b1) n = fds_nth (fds moebius_mu * fds_zeta) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod moebius_mu (\<lambda>_. 1::?'b1) n = fds_nth (fds moebius_mu * fds_zeta) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "fds moebius_mu * fds_zeta = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds moebius_mu * fds_zeta = 1
[PROOF STEP]
by (simp add: mult_ac fds_zeta_times_moebius_mu)
[PROOF STATE]
proof (state)
this:
fds moebius_mu * fds_zeta = 1

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds moebius_mu * fds_zeta = 1

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "fds_nth 1 n * f n = fds_nth 1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth 1 n * f n = fds_nth 1 n
[PROOF STEP]
by (auto simp: fds_eq_iff fds_nth_one)
[PROOF STATE]
proof (state)
this:
fds_nth 1 n * f n = fds_nth 1 n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
show "fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n"
[PROOF STATE]
proof (prove)
using this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n

goal (1 subgoal):
 1. fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = 1

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = 1

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
have "1 = fds g * fds f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = fds g * fds f
[PROOF STEP]
by (auto simp: fds_eq_iff g_def fds_nth_mult dirichlet_prod_inverse')
[PROOF STATE]
proof (state)
this:
1 = fds g * fds f

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = fds g * fds f
[PROOF STEP]
have "fds g = fds (\<lambda>n. moebius_mu n * f n)"
[PROOF STATE]
proof (prove)
using this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = fds g * fds f

goal (1 subgoal):
 1. fds g = fds (\<lambda>n. moebius_mu n * f n)
[PROOF STEP]
by (subst (asm) mult_cancel_right) auto
[PROOF STATE]
proof (state)
this:
fds g = fds (\<lambda>n. moebius_mu n * f n)

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
thus "g n = moebius_mu n * f n" for n
[PROOF STATE]
proof (prove)
using this:
fds g = fds (\<lambda>n. moebius_mu n * f n)

goal (1 subgoal):
 1. g n = moebius_mu n * f n
[PROOF STEP]
by (cases "n = 0") (auto simp: fds_eq_iff g_def)
[PROOF STATE]
proof (state)
this:
g ?n = moebius_mu ?n * f ?n

goal (1 subgoal):
 1. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
assume g: "\<forall>n. g n = moebius_mu n * f n"
[PROOF STATE]
proof (state)
this:
\<forall>n. g n = moebius_mu n * f n

goal (1 subgoal):
 1. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
show "completely_multiplicative_function f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f
[PROOF STEP]
proof (rule completely_multiplicativeI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p k. \<lbrakk>prime p; 0 < k\<rbrakk> \<Longrightarrow> f (p ^ k) = f p ^ k
[PROOF STEP]
fix p k :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p k. \<lbrakk>prime p; 0 < k\<rbrakk> \<Longrightarrow> f (p ^ k) = f p ^ k
[PROOF STEP]
assume pk: "prime p" "k > 0"
[PROOF STATE]
proof (state)
this:
prime p
0 < k

goal (1 subgoal):
 1. \<And>p k. \<lbrakk>prime p; 0 < k\<rbrakk> \<Longrightarrow> f (p ^ k) = f p ^ k
[PROOF STEP]
show "f (p ^ k) = f p ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (p ^ k) = f p ^ k
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
f (p ^ k) = f p ^ k

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have eq: "dirichlet_prod g f n = 0" if "n \<noteq> 1" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod g f n = (0::'a)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (dirichlet_inverse f (1::'a)) f n = (0::'a)
[PROOF STEP]
using dirichlet_prod_inverse'[of f 1] that
[PROOF STATE]
proof (prove)
using this:
f 1 * (1::'a) = (1::'a) \<Longrightarrow> dirichlet_prod (dirichlet_inverse f (1::'a)) f = (\<lambda>n. if n = 1 then 1::'a else (0::'a))
n \<noteq> 1

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_inverse f (1::'a)) f n = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?n \<noteq> 1 \<Longrightarrow> dirichlet_prod g f ?n = (0::'a)

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "dirichlet_prod g f (p ^ Suc k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod g f (p ^ Suc k) = (0::'a)
[PROOF STEP]
using pk
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k__

goal (1 subgoal):
 1. dirichlet_prod g f (p ^ Suc k) = (0::'a)
[PROOF STEP]
by (intro eq) auto
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (0::'a)

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (0::'a)

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
by (intro dirichlet_prod_prime_power) fact+
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
by (intro sum.cong refl, subst g) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
using pk
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k__

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp: moebius_mu_power')
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "\<dots> = f (p ^ Suc k) - f p ^ Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = f (p ^ Suc k) - f p ^ Suc k
[PROOF STEP]
using pk Suc.IH
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k__
f (p ^ k) = f p ^ k

goal (1 subgoal):
 1. (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = f (p ^ Suc k) - f p ^ Suc k
[PROOF STEP]
by (auto simp: moebius_mu.prime)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = f (p ^ Suc k) - f p ^ Suc k

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (p ^ Suc k) - f p ^ Suc k = (0::'a)
[PROOF STEP]
show "f (p ^ Suc k) = f p ^ Suc k"
[PROOF STATE]
proof (prove)
using this:
f (p ^ Suc k) - f p ^ Suc k = (0::'a)

goal (1 subgoal):
 1. f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (p ^ Suc k) = f p ^ Suc k

goal (1 subgoal):
 1. f (p ^ 0) = f p ^ 0
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
f (p ^ k) = f p ^ k

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_UNIV_vec:
  assumes "infinite (UNIV :: 'a set)"
  shows   "infinite (UNIV :: ('a^'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
proof (subst bij_betw_finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bij_betw ?f UNIV ?B
 2. infinite ?B
[PROOF STEP]
show "bij_betw vec_nth UNIV (Pi (UNIV :: 'b set) (\<lambda>_. UNIV :: 'a set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw ($) UNIV (UNIV \<rightarrow> UNIV)
[PROOF STEP]
by (intro bij_betwI[of _ _ _ vec_lambda]) (auto simp: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
bij_betw ($) UNIV (UNIV \<rightarrow> UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
have "infinite (PiE (UNIV :: 'b set) (\<lambda>_. UNIV :: 'a set))" (is "infinite ?A")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (UNIV \<rightarrow>\<^sub>E UNIV)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
assume "finite ?A"
[PROOF STATE]
proof (state)
this:
finite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
hence "finite ((\<lambda>f. f undefined) ` ?A)"
[PROOF STATE]
proof (prove)
using this:
finite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. finite ((\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV))
[PROOF STEP]
by (rule finite_imageI)
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV))

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV))

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
have "(\<lambda>f. f undefined) ` ?A = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV) = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV) = UNIV

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finite UNIV
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
finite UNIV

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>infinite (UNIV :: 'a set)\<close>
[PROOF STATE]
proof (prove)
using this:
finite UNIV
infinite UNIV

goal (1 subgoal):
 1. False
[PROOF STEP]
by contradiction
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
infinite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infinite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
have "?A = Pi UNIV (\<lambda>_. UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<rightarrow>\<^sub>E UNIV = UNIV \<rightarrow> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<rightarrow>\<^sub>E UNIV = UNIV \<rightarrow> UNIV

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
show "infinite (Pi (UNIV :: 'b set) (\<lambda>_. UNIV :: 'a set))"
[PROOF STATE]
proof (prove)
using this:
infinite (UNIV \<rightarrow> UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
infinite (UNIV \<rightarrow> UNIV)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Field_symcl[simp]: "Field (symcl r) = Field r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field (symcl r) = Field r
[PROOF STEP]
unfolding symcl_def Field_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domain {(x, y). (x, y) \<in> r \<or> (y, x) \<in> r} \<union> Range {(x, y). (x, y) \<in> r \<or> (y, x) \<in> r} = Domain r \<union> Range r
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_one_mult: "poly_mult one_poly p =p p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult one_poly p =p p
[PROOF STEP]
unfolding eq_poly_def one_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<alpha>. eval_poly \<alpha> (poly_mult [(1, 1::'b)] p) = eval_poly \<alpha> p
[PROOF STEP]
by simp


[STATEMENT]
lemma monom_of_set_eq_iff [simp]: "finite X \<Longrightarrow> finite Y \<Longrightarrow> monom_of_set X = monom_of_set Y \<longleftrightarrow> X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; finite Y\<rbrakk> \<Longrightarrow> (monom_of_set X = monom_of_set Y) = (X = Y)
[PROOF STEP]
by transfer (auto simp: fun_eq_iff)


[STATEMENT]
lemma bigtheta_inverse [simp]:
  shows "(\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x)) \<longleftrightarrow> f \<in> \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
have "(\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))"
    if A: "f \<in> \<Theta>[F](g)"
    for f g :: "'a \<Rightarrow> 'b" and F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
f \<in> \<Theta>[F](g)
[PROOF STEP]
obtain c1 c2 :: real where *: "c1 > 0" "c2 > 0"
      and **: "\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)"
              "\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)"
[PROOF STATE]
proof (prove)
using this:
f \<in> \<Theta>[F](g)

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>0 < c1; 0 < c2; \<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x); \<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
using this:
f \<in> O[F](g) \<inter> \<Omega>[F](g)

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>0 < c1; 0 < c2; \<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x); \<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim landau_o.bigE landau_omega.bigE IntE)
[PROOF STATE]
proof (state)
this:
0 < c1
0 < c2
\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)
\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
from \<open>c2 > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < c2
[PROOF STEP]
have c2: "inverse c2 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c2

goal (1 subgoal):
 1. 0 < inverse c2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < inverse c2

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
from **
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)
\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)
[PROOF STEP]
have "eventually (\<lambda>x. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)
\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
assume A: "norm (f x) \<le> c1 * norm (g x)" "c2 * norm (g x) \<le> norm (f x)"
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
from A *
[PROOF STATE]
proof (chain)
picking this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2
[PROOF STEP]
have "f x = 0 \<longleftrightarrow> g x = 0"
[PROOF STATE]
proof (prove)
using this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2

goal (1 subgoal):
 1. (f x = (0::'b)) = (g x = (0::'b))
[PROOF STEP]
by (auto simp: field_simps mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
(f x = (0::'b)) = (g x = (0::'b))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
with A *
[PROOF STATE]
proof (chain)
picking this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2
(f x = (0::'b)) = (g x = (0::'b))
[PROOF STEP]
show "norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))"
[PROOF STATE]
proof (prove)
using this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2
(f x = (0::'b)) = (g x = (0::'b))

goal (1 subgoal):
 1. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
by (force simp: field_simps norm_inverse norm_divide)
[PROOF STATE]
proof (state)
this:
norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
with c2
[PROOF STATE]
proof (chain)
picking this:
0 < inverse c2
\<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < inverse c2
\<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
by (rule landau_o.bigI)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?f \<in> \<Theta>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?f \<in> \<Theta>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?f \<in> \<Theta>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
using this:
?f \<in> O[?F](?g) \<inter> \<Omega>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x)) \<inter> \<Omega>[F](\<lambda>x. inverse (g x))) = (f \<in> O[F](g) \<inter> \<Omega>[F](g))
[PROOF STEP]
by (force simp: bigomega_iff_bigo bigtheta_sym)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reflexivity: "refl_on carrier relation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on carrier relation
[PROOF STEP]
using preorder_on_def trans_refl
[PROOF STATE]
proof (prove)
using this:
preorder_on ?A ?r \<equiv> refl_on ?A ?r \<and> trans ?r
preorder_on carrier relation

goal (1 subgoal):
 1. refl_on carrier relation
[PROOF STEP]
by blast


[STATEMENT]
lemma add_left_zero: "0 + a = (a::'a::comm_monoid_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) + a = a
[PROOF STEP]
by simp


[STATEMENT]
theorem max_flow_min_cut_bounded:
  "\<exists>f S. flow \<Delta> f \<and> cut \<Delta> S \<and> orthogonal \<Delta> f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
interpret \<Delta>': bounded_countable_network \<Delta>'''
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_countable_network \<Delta>'''
[PROOF STEP]
by(rule \<Delta>'''_bounded_countable_network)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
have "\<exists>f S. flow \<Delta>''' f \<and> cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S
[PROOF STEP]
by(rule \<Delta>'.max_flow_min_cut'''_bounded) auto
[PROOF STATE]
proof (state)
this:
\<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S

goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S
[PROOF STEP]
obtain f S where f: "flow \<Delta>''' f" and cut: "cut \<Delta>''' S" and ortho: "orthogonal \<Delta>''' f S"
[PROOF STATE]
proof (prove)
using this:
\<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S

goal (1 subgoal):
 1. (\<And>f S. \<lbrakk>flow \<Delta>''' f; MFMC_Network.cut \<Delta>''' S; orthogonal \<Delta>''' f S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
flow \<Delta>''' f
MFMC_Network.cut \<Delta>''' S
orthogonal \<Delta>''' f S

goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
from flow_\<Delta>'''[OF this]
[PROOF STATE]
proof (chain)
picking this:
flow \<Delta> f
MFMC_Network.cut \<Delta> S
orthogonal \<Delta> f S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
flow \<Delta> f
MFMC_Network.cut \<Delta> S
orthogonal \<Delta> f S

goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_igba_impl_rel_sv[relator_props]:
  "\<lbrakk>single_valued Rl; single_valued Rm\<rbrakk>
  \<Longrightarrow> single_valued (\<langle>Rm,Rl\<rangle>gen_igba_impl_rel_eext)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rl; single_valued Rm\<rbrakk> \<Longrightarrow> single_valued (\<langle>Rm, Rl\<rangle>gen_igba_impl_rel_eext)
[PROOF STEP]
unfolding gen_igba_impl_rel_eext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rl; single_valued Rm\<rbrakk> \<Longrightarrow> single_valued {(\<lparr>igbai_L = Li, \<dots> = mi\<rparr>, \<lparr>igba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}
[PROOF STEP]
apply (rule single_valuedI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>single_valued Rl; single_valued Rm; (x, y) \<in> {(\<lparr>igbai_L = Li, \<dots> = mi\<rparr>, \<lparr>igba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}; (x, z) \<in> {(\<lparr>igbai_L = Li, \<dots> = mi\<rparr>, \<lparr>igba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> L = La \<and> m = ma
[PROOF STEP]
apply (intro conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> L = La
 2. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> m = ma
[PROOF STEP]
apply (rule single_valuedD[rotated], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> m = ma
[PROOF STEP]
apply (rule single_valuedD[rotated], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma append_Cons_nth_not_middle:
  assumes "i \<noteq> length xs"
  shows "(xs @ u # ys) ! i = (xs @ z # ys) ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
proof (cases "i < length xs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
 2. \<not> i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < length xs

goal (2 subgoals):
 1. i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
 2. \<not> i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i < length xs

goal (1 subgoal):
 1. (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
by (simp add: append_Cons_nth_left)
[PROOF STATE]
proof (state)
this:
(xs @ u # ys) ! i = (xs @ z # ys) ! i

goal (1 subgoal):
 1. \<not> i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < length xs

goal (1 subgoal):
 1. \<not> i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> length xs
\<not> i < length xs
[PROOF STEP]
have "i > length xs"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> length xs
\<not> i < length xs

goal (1 subgoal):
 1. length xs < i
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
length xs < i

goal (1 subgoal):
 1. \<not> i < length xs \<Longrightarrow> (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length xs < i

goal (1 subgoal):
 1. (xs @ u # ys) ! i = (xs @ z # ys) ! i
[PROOF STEP]
by (rule append_Cons_nth_right)
[PROOF STATE]
proof (state)
this:
(xs @ u # ys) ! i = (xs @ z # ys) ! i

goal:
No subgoals!
[PROOF STEP]
qed


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

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

goal (1 subgoal):
 1. x \<sqsubseteq> c ; x \<sqinter> d
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, x :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using inf_commute
[PROOF STATE]
proof (prove)
using this:
(x::'a::refinement_lattice) \<sqsubseteq> (d::'a::refinement_lattice) \<sqinter> (c::'a::refinement_lattice) ; x
(?x::?'a::semilattice_inf) \<sqinter> (?y::?'a::semilattice_inf) = ?y \<sqinter> ?x

goal (1 subgoal):
 1. x \<sqsubseteq> c ; x \<sqinter> d
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, x :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x::'a::refinement_lattice) \<sqsubseteq> (c::'a::refinement_lattice) ; x \<sqinter> (d::'a::refinement_lattice)

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

goal (1 subgoal):
 1. x \<sqsubseteq> gfp (\<lambda>x::'a. c ; x \<sqinter> d)
variables:
(;) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c, d, x :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: gfp_upperbound)
[PROOF STATE]
proof (state)
this:
(x::'a::refinement_lattice) \<sqsubseteq> gfp (\<lambda>x::'a::refinement_lattice. (c::'a::refinement_lattice) ; x \<sqinter> (d::'a::refinement_lattice))

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

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

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


[STATEMENT]
lemma ltake_lappend:
  "ltake n (lappend xs ys) = lappend (ltake n xs) (ltake (n - llength xs) ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ltake n (lappend xs ys) = lappend (ltake n xs) (ltake (n - llength xs) ys)
[PROOF STEP]
by(coinduction arbitrary: n xs ys rule: llist.coinduct_strong)(auto intro!: exI simp add: llength_ltl ltl_ltake)


[STATEMENT]
lemma apply_bfun_one [simp]: "apply_bfun (1 :: _ \<Rightarrow>\<^sub>b real) x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. apply_bfun 1 x = 1
[PROOF STEP]
using one_bfun.rep_eq
[PROOF STATE]
proof (prove)
using this:
apply_bfun 1 = (\<lambda>x. 1)

goal (1 subgoal):
 1. apply_bfun 1 x = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma closed_Collect_disj:
  assumes "closed {x. P x}" "closed {x. Q x}"
  shows "closed {x. P x \<or> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x \<or> Q x}
[PROOF STEP]
using closed_Un[OF assms]
[PROOF STATE]
proof (prove)
using this:
closed ({x. P x} \<union> {x. Q x})

goal (1 subgoal):
 1. closed {x. P x \<or> Q x}
[PROOF STEP]
by (simp add: Un_def)


[STATEMENT]
lemma fold_min_triv:
  fixes k :: "_ :: linorder"
  shows "(\<forall>x\<in>set xs. k \<le> x) \<Longrightarrow> List.fold min xs k = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. k \<le> x \<Longrightarrow> fold min xs k = k
[PROOF STEP]
by (induct xs) (auto simp add: min_def)


[STATEMENT]
lemma set_integral_at_point:
  fixes a :: real
  assumes "set_integrable M {a} f"
  and [simp]: "{a} \<in> sets M" and "(emeasure M) {a} \<noteq> \<infinity>"
  shows "(LINT x:{a} | M. f x) = f a * measure M {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral M {a} f = f a * Sigma_Algebra.measure M {a}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_lebesgue_integral M {a} f = f a * Sigma_Algebra.measure M {a}
[PROOF STEP]
have "set_lebesgue_integral M {a} f = set_lebesgue_integral M {a} (%x. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_lebesgue_integral M {a} f = LINT x:{a}|M. f a
[PROOF STEP]
by (intro set_lebesgue_integral_cong) simp_all
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral M {a} f = LINT x:{a}|M. f a

goal (1 subgoal):
 1. set_lebesgue_integral M {a} f = f a * Sigma_Algebra.measure M {a}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_lebesgue_integral M {a} f = LINT x:{a}|M. f a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_lebesgue_integral M {a} f = LINT x:{a}|M. f a

goal (1 subgoal):
 1. set_lebesgue_integral M {a} f = f a * Sigma_Algebra.measure M {a}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_lebesgue_integral M {a} f = LINT x:{a}|M. f a
set_integrable M {a} f
{a} \<in> sets M
emeasure M {a} \<noteq> \<infinity>

goal (1 subgoal):
 1. set_lebesgue_integral M {a} f = f a * Sigma_Algebra.measure M {a}
[PROOF STEP]
unfolding set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
using this:
LINT x|M. indicat_real {a} x *\<^sub>R f x = LINT x|M. indicat_real {a} x *\<^sub>R f a
set_integrable M {a} f
{a} \<in> sets M
emeasure M {a} \<noteq> \<infinity>

goal (1 subgoal):
 1. LINT x|M. indicat_real {a} x *\<^sub>R f x = f a * Sigma_Algebra.measure M {a}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_lebesgue_integral M {a} f = f a * Sigma_Algebra.measure M {a}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in idom) poly_mult_not_eq_poly_Nil[simp]:
  "poly (p *** q) x \<noteq> poly [] x \<longleftrightarrow> poly p x \<noteq> poly [] x \<and> poly q x \<noteq> poly [] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (p *** q) x \<noteq> poly [] x) = (poly p x \<noteq> poly [] x \<and> poly q x \<noteq> poly [] x)
[PROOF STEP]
by (auto simp add: poly_mult)


[STATEMENT]
lemma ZFfunComp:
  assumes "\<forall> x . x |\<in>| A \<longrightarrow> f x |\<in>| B"
  shows   "(ZFfun A B f) |o| (ZFfun B C g) = ZFfun A C (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFfun A B f |o| ZFfun B C g = ZFfun A C (g \<circ> f)
[PROOF STEP]
proof (simp add: ZFfunComp_def ZFfunDom ZFfunCod)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
assume a: "x |\<in>| A"
[PROOF STATE]
proof (state)
this:
x |\<in>| A

goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
have "ZFfun B C g  |@| (ZFfun A B f |@| x) = (g o f) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x
[PROOF STEP]
have "(ZFfun A B f |@| x) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFfun A B f |@| x = f x
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
x |\<in>| A

goal (1 subgoal):
 1. ZFfun A B f |@| x = f x
[PROOF STEP]
by (simp add: ZFfunApp)
[PROOF STATE]
proof (state)
this:
ZFfun A B f |@| x = f x

goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x
[PROOF STEP]
hence "ZFfun B C g  |@| (ZFfun A B f |@| x) = g (f x)"
[PROOF STATE]
proof (prove)
using this:
ZFfun A B f |@| x = f x

goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = g (f x)
[PROOF STEP]
using assms a
[PROOF STATE]
proof (prove)
using this:
ZFfun A B f |@| x = f x
\<forall>x. x |\<in>| A \<longrightarrow> f x |\<in>| B
x |\<in>| A

goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = g (f x)
[PROOF STEP]
by (simp add: ZFfunApp)
[PROOF STATE]
proof (state)
this:
ZFfun B C g |@| (ZFfun A B f |@| x) = g (f x)

goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ZFfun B C g |@| (ZFfun A B f |@| x) = g (f x)

goal (1 subgoal):
 1. ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ZFfun B C g |@| (ZFfun A B f |@| x) = (g \<circ> f) x

goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 |\<in>| A \<Longrightarrow> ZFfun B C g |@| (ZFfun A B f |@| ?x2) = (g \<circ> f) ?x2

goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
thus "ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)"
[PROOF STATE]
proof (prove)
using this:
?x2 |\<in>| A \<Longrightarrow> ZFfun B C g |@| (ZFfun A B f |@| ?x2) = (g \<circ> f) ?x2

goal (1 subgoal):
 1. ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)
[PROOF STEP]
by (simp add: ZFfun_ext)
[PROOF STATE]
proof (state)
this:
ZFfun A C (\<lambda>x. ZFfun B C g |@| (ZFfun A B f |@| x)) = ZFfun A C (g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ctermsl_ex_stermsl: "q \<in> ctermsl p \<Longrightarrow> \<exists>ps\<in>stermsl p. q \<in> ctermsl ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> ctermsl p \<Longrightarrow> \<exists>ps\<in>stermsl p. q \<in> ctermsl ps
[PROOF STEP]
by (induct p) auto


[STATEMENT]
theorem psubst_eval:
  \<open>eval e f g (psubst h p) = eval e (\<lambda>p. f (h p)) g p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval e f g (psubst h p) = eval e (\<lambda>p. f (h p)) g p
[PROOF STEP]
by (induct p arbitrary: e) simp_all


[STATEMENT]
lemma continuous_on_pochhammer [continuous_intros]: "continuous_on A (\<lambda>z. pochhammer z n)"
  for A :: "'a::real_normed_field set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A (\<lambda>z. pochhammer z n)
[PROOF STEP]
by (intro continuous_at_imp_continuous_on ballI isCont_pochhammer)


[STATEMENT]
lemma length_shuffles: "zs \<in> shuffles xs ys \<Longrightarrow> length zs = length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zs \<in> shuffles xs ys \<Longrightarrow> length zs = length xs + length ys
[PROOF STEP]
by (induction xs ys arbitrary: zs rule: shuffles.induct) auto


[STATEMENT]
lemma sq_mtx_minus_diag_diag[simp]: "sq_mtx_diag f - sq_mtx_diag g = (\<d>\<i>\<a>\<g> i. f i - g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sq_mtx_diag f - sq_mtx_diag g = (\<d>\<i>\<a>\<g> i. f i - g i)
[PROOF STEP]
by (subst sq_mtx_eq_iff) (simp add: axis_def)


[STATEMENT]
lemma LIMSEQ_Suc: "f \<longlonglongrightarrow> l \<Longrightarrow> (\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> l \<Longrightarrow> (\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l
[PROOF STEP]
by (drule LIMSEQ_ignore_initial_segment [where k="Suc 0"]) simp


[STATEMENT]
theorem "t \<in> B h \<Longrightarrow> fib (h + 2) \<le> size t + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> B h \<Longrightarrow> fib (h + 2) \<le> size t + 1
[PROOF STEP]
using size_bounded
[PROOF STATE]
proof (prove)
using this:
?t \<in> B ?h \<Longrightarrow> size (fib_tree ?h) \<le> size ?t

goal (1 subgoal):
 1. t \<in> B h \<Longrightarrow> fib (h + 2) \<le> size t + 1
[PROOF STEP]
by (simp add: size_fib' fibfib[symmetric] del: fib.simps)


[STATEMENT]
lemma cos_lt_zero_on_pi2_pi [simp]:
  assumes "x > pi/2" and "x \<le> pi"
  shows "cos x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x < 0
[PROOF STEP]
using cos_gt_zero_pi[of "pi - x"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- (pi / 2) < pi - x; pi - x < pi / 2\<rbrakk> \<Longrightarrow> 0 < cos (pi - x)
pi / 2 < x
x \<le> pi

goal (1 subgoal):
 1. cos x < 0
[PROOF STEP]
by simp


[STATEMENT]
lemma rtranclp_transp_reflp: "R\<^sup>*\<^sup>* = R" if "transp R" "reflp R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R\<^sup>*\<^sup>* = R
[PROOF STEP]
apply(rule ext iffI)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. R\<^sup>*\<^sup>* x xa \<Longrightarrow> R x xa
 2. \<And>x xa. R x xa \<Longrightarrow> R\<^sup>*\<^sup>* x xa
[PROOF STEP]
subgoal premises prems for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R x y
[PROOF STEP]
using prems
[PROOF STATE]
proof (prove)
using this:
R\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. R x y
[PROOF STEP]
by(induction)(use that in \<open>auto intro: reflpD transpD\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. R x xa \<Longrightarrow> R\<^sup>*\<^sup>* x xa
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R x_ xa_ \<Longrightarrow> R\<^sup>*\<^sup>* x_ xa_
[PROOF STEP]
by(rule r_into_rtranclp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem sturm_tarski_interval:
  assumes "a<b" "poly p a\<noteq>0" "poly p b\<noteq>0"
  shows "taq {x. poly p x=0 \<and> a<x \<and> x<b} q = changes_itv_smods a b p (pderiv p * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. taq {x. poly p x = 0 \<and> a < x \<and> x < b} q = changes_itv_smods a b p (pderiv p * q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. taq {x. poly p x = 0 \<and> a < x \<and> x < b} q = changes_itv_smods a b p (pderiv p * q)
[PROOF STEP]
have "p\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
using \<open>poly p a\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
poly p a \<noteq> 0

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

goal (1 subgoal):
 1. taq {x. poly p x = 0 \<and> a < x \<and> x < b} q = changes_itv_smods a b p (pderiv p * q)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. taq {x. poly p x = 0 \<and> a < x \<and> x < b} q = changes_itv_smods a b p (pderiv p * q)
[PROOF STEP]
using cindex_poly_taq cindex_poly_changes_itv_mods[OF assms]
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
taq {x. poly ?p x = 0 \<and> ?a < x \<and> x < ?b} ?q = cindex_poly ?a ?b (pderiv ?p * ?q) ?p
cindex_poly a b ?q p = changes_itv_smods a b p ?q

goal (1 subgoal):
 1. taq {x. poly p x = 0 \<and> a < x \<and> x < b} q = changes_itv_smods a b p (pderiv p * q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
taq {x. poly p x = 0 \<and> a < x \<and> x < b} q = changes_itv_smods a b p (pderiv p * q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem (in group_hom) solvable_imp_solvable_img:
  assumes "solvable_seq G K" shows "solvable_seq H (h ` K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solvable_seq H (h ` K)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. solvable_seq H (h ` K)
[PROOF STEP]
obtain n where "(derived G ^^ n) K = { \<one> }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. (derived G ^^ n) K = {\<one>} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using G.solvable_imp_trivial_derived_seq[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. (derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. (\<And>n. (derived G ^^ n) K = {\<one>} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. solvable_seq H (h ` K)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(derived G ^^ n) K = {\<one>}

goal (1 subgoal):
 1. solvable_seq H (h ` K)
[PROOF STEP]
using trivial_derived_seq_imp_solvable[OF subgroup_img_is_subgroup, of _ n]
          exp_of_derived_img[OF subgroup.subset, of _ n] G.solvable_imp_subgroup[OF assms]
[PROOF STATE]
proof (prove)
using this:
(derived G ^^ n) K = {\<one>}
\<lbrakk>subgroup ?I1 G; (derived H ^^ n) (h ` ?I1) = {\<one>\<^bsub>H\<^esub>}\<rbrakk> \<Longrightarrow> solvable_seq H (h ` ?I1)
subgroup ?K G \<Longrightarrow> (derived H ^^ n) (h ` ?K) = h ` (derived G ^^ n) ?K
subgroup K G

goal (1 subgoal):
 1. solvable_seq H (h ` K)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
solvable_seq H (h ` K)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "finite (A:: nat set) \<Longrightarrow> A \<noteq> {}\<Longrightarrow> Min A \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> Min A \<in> A
[PROOF STEP]
by(induction A rule: finite.induct)(blast | meson Min_in finite_insert)+


[STATEMENT]
lemma space'_bound: assumes "invar_vebt t n" "u = 2^n"
  shows "space' t \<le> 12 * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space' t \<le> 12 * u
[PROOF STEP]
using  space_2_pow_bound[of t n]
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n \<Longrightarrow> real (space' t) \<le> 12 * (2 ^ n - 1)

goal (1 subgoal):
 1. space' t \<le> 12 * u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (invar_vebt t n \<Longrightarrow> real (space' t) \<le> 12 * (2 ^ n - 1)) \<Longrightarrow> space' t \<le> 12 * u
[PROOF STEP]
have "real u - 1 = real (u - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real u - 1 = real (u - 1)
[PROOF STEP]
by (simp add: assms(2) of_nat_diff)
[PROOF STATE]
proof (state)
this:
real u - 1 = real (u - 1)

goal (1 subgoal):
 1. (invar_vebt t n \<Longrightarrow> real (space' t) \<le> 12 * (2 ^ n - 1)) \<Longrightarrow> space' t \<le> 12 * u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real u - 1 = real (u - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real u - 1 = real (u - 1)

goal (1 subgoal):
 1. space' t \<le> 12 * u
[PROOF STEP]
using \<open>invar_vebt t n \<Longrightarrow> real (space' t) \<le> 12 * (2 ^ n - 1)\<close> assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
real u - 1 = real (u - 1)
invar_vebt t n \<Longrightarrow> real (space' t) \<le> 12 * (2 ^ n - 1)
invar_vebt t n
u = 2 ^ n

goal (1 subgoal):
 1. space' t \<le> 12 * u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
space' t \<le> 12 * u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Norm_zero [simp]:
  "Norm N 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Norm N (0::'a) = 0
[PROOF STEP]
unfolding Norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (eNorm N (0::'a)) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma scale_ms_aux_MSLCons:
  "scale_ms_aux c (MSLCons (c', e) xs) = MSLCons (scale_ms c c', e) (scale_ms_aux c xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scale_ms_aux c (MSLCons (c', e) xs) = MSLCons (scale_ms c c', e) (scale_ms_aux c xs)
[PROOF STEP]
by (simp add: scale_ms_aux_def scale_shift_ms_aux_MSLCons scale_ms_def)


[STATEMENT]
lemma rel_option_option_rel_eq[pred_set_conv]:
    "rel_option (\<lambda> x y. (x, y) \<in> A) = (\<lambda> f g. (f, g) \<in> \<langle>A\<rangle> option_rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_option (\<lambda>x y. (x, y) \<in> A) = (\<lambda>f g. (f, g) \<in> \<langle>A\<rangle>option_rel)
[PROOF STEP]
by (force simp: option_rel_def elim: option.rel_cases)


[STATEMENT]
lemma contractible_imp_holomorphic_sqrt:
  assumes holf: "f holomorphic_on S"
      and S: "contractible S"
      and fnz: "\<And>z. z \<in> S \<Longrightarrow> f z \<noteq> 0"
  obtains g where "g holomorphic_on S" "\<And>z. z \<in> S \<Longrightarrow> f z = g z ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g holomorphic_on S; \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g holomorphic_on S; \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g where holg: "g holomorphic_on S" and feq: "\<And>z. z \<in> S \<Longrightarrow> f z = exp(g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g holomorphic_on S; \<And>z. z \<in> S \<Longrightarrow> f z = exp (g z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contractible_imp_holomorphic_log [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>z. z \<in> S \<Longrightarrow> z \<in> S; \<And>g. \<lbrakk>g holomorphic_on S; \<And>z. z \<in> S \<Longrightarrow> f z = exp (g z)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g holomorphic_on S; \<And>z. z \<in> S \<Longrightarrow> f z = exp (g z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g holomorphic_on S
?z \<in> S \<Longrightarrow> f ?z = exp (g ?z)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g holomorphic_on S; \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?g holomorphic_on S
 2. \<And>z. z \<in> S \<Longrightarrow> f z = (?g z)\<^sup>2
[PROOF STEP]
show "exp \<circ> (\<lambda>z. z / 2) \<circ> g holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp \<circ> (\<lambda>z. z / 2) \<circ> g holomorphic_on S
[PROOF STEP]
by (intro holomorphic_on_compose holg holomorphic_intros) auto
[PROOF STATE]
proof (state)
this:
exp \<circ> (\<lambda>z. z / 2) \<circ> g holomorphic_on S

goal (1 subgoal):
 1. \<And>z. z \<in> S \<Longrightarrow> f z = ((exp \<circ> (\<lambda>z. z / 2) \<circ> g) z)\<^sup>2
[PROOF STEP]
show "\<And>z. z \<in> S \<Longrightarrow> f z = ((exp \<circ> (\<lambda>z. z / 2) \<circ> g) z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. z \<in> S \<Longrightarrow> f z = ((exp \<circ> (\<lambda>z. z / 2) \<circ> g) z)\<^sup>2
[PROOF STEP]
by (simp add: feq flip: exp_double)
[PROOF STATE]
proof (state)
this:
?z \<in> S \<Longrightarrow> f ?z = ((exp \<circ> (\<lambda>z. z / 2) \<circ> g) ?z)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma permutation_of_list_id: "x \<notin> set (map fst xs) \<Longrightarrow> permutation_of_list xs x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> set (map fst xs) \<Longrightarrow> permutation_of_list xs x = x
[PROOF STEP]
by (induct xs) (auto simp: permutation_of_list_Cons)


[STATEMENT]
lemma inj_on_image_lepoll_2 [simp]:
  assumes "inj_on f B" shows "A \<lesssim> f ` B \<longleftrightarrow> A \<lesssim> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<lesssim> f ` B) = (A \<lesssim> B)
[PROOF STEP]
by (meson assms eq_iff image_lepoll lepoll_def lepoll_trans)


[STATEMENT]
lemma monotone_case_prod_iff [simp]:
  "monotone (rel_prod orda ordb) ordc (case_prod f) \<longleftrightarrow>
   (\<forall>a. monotone ordb ordc (f a)) \<and> (\<forall>b. monotone orda ordc (\<lambda>a. f a b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone (rel_prod orda ordb) ordc (\<lambda>(x, y). f x y) = ((\<forall>a. monotone ordb ordc (f a)) \<and> (\<forall>b. monotone orda ordc (\<lambda>a. f a b)))
[PROOF STEP]
by(simp add: monotone_rel_prod_iff)


[STATEMENT]
lemma phi_inverse_right:
  assumes "g \<in> G"
  shows "quot_comp_alt g (\<phi> (inverse g \<cdot>| K)) = \<phi> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K
[PROOF STEP]
have "g \<cdot> (\<phi> (inverse g \<cdot>| K)) \<in> (g \<cdot> (inverse g) \<cdot>| K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<in> g \<cdot> local.inverse g \<cdot>| K
[PROOF STEP]
using phi_coset_mem assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> G \<Longrightarrow> \<phi> (?a \<cdot>| K) \<in> ?a \<cdot>| K
g \<in> G

goal (1 subgoal):
 1. g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<in> g \<cdot> local.inverse g \<cdot>| K
[PROOF STEP]
by (smt (z3) Left_Coset_memE factor_unit invertible invertible_right_inverse
    invertible_inverse_closed invertible_inverse_inverse sub invertible_left_inverse2)
[PROOF STATE]
proof (state)
this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<in> g \<cdot> local.inverse g \<cdot>| K

goal (1 subgoal):
 1. quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<in> g \<cdot> local.inverse g \<cdot>| K
[PROOF STEP]
have "g \<cdot> (\<phi> (inverse g \<cdot>| K)) \<cdot>| K = K"
[PROOF STATE]
proof (prove)
using this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<in> g \<cdot> local.inverse g \<cdot>| K

goal (1 subgoal):
 1. g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<cdot>| K = K
[PROOF STEP]
using Block_self Left_Coset_Class_unit Normal_def quotient.unit_closed sub
[PROOF STATE]
proof (prove)
using this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<in> g \<cdot> local.inverse g \<cdot>| K
\<lbrakk>?a \<in> ?A; ?A \<in> Partition\<rbrakk> \<Longrightarrow> Class ?a = ?A
?g \<in> G \<Longrightarrow> ?g \<cdot>| K = Class ?g
K = Class \<one>
Class \<one> \<in> Partition
?a \<in> K \<Longrightarrow> ?a \<in> G

goal (1 subgoal):
 1. g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<cdot>| K = K
[PROOF STEP]
by (metis assms composition_closed invertible invertible_inverse_closed invertible_right_inverse)
[PROOF STATE]
proof (state)
this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<cdot>| K = K

goal (1 subgoal):
 1. quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<cdot>| K = K
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<cdot>| K = K

goal (1 subgoal):
 1. quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K
[PROOF STEP]
using quot_comp_alt_def
[PROOF STATE]
proof (prove)
using this:
g \<cdot> \<phi> (local.inverse g \<cdot>| K) \<cdot>| K = K
quot_comp_alt ?a ?b = \<phi> (?a \<cdot> ?b \<cdot>| K)

goal (1 subgoal):
 1. quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
quot_comp_alt g (\<phi> (local.inverse g \<cdot>| K)) = \<phi> K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_image_subset_rel_interior:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f ` S \<subseteq> T"
      and TS: "aff_dim T \<le> aff_dim S"
  shows "f ` (rel_interior S) \<subseteq> rel_interior(f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` rel_interior S \<subseteq> rel_interior (f ` S)
[PROOF STEP]
proof (rule rel_interior_maximal)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` rel_interior S \<subseteq> f ` S
 2. openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)
[PROOF STEP]
show "f ` rel_interior S \<subseteq> f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` rel_interior S \<subseteq> f ` S
[PROOF STEP]
by(simp add: image_mono rel_interior_subset)
[PROOF STATE]
proof (state)
this:
f ` rel_interior S \<subseteq> f ` S

goal (1 subgoal):
 1. openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)
[PROOF STEP]
show "openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)
[PROOF STEP]
proof (rule invariance_of_domain_affine_sets)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. openin (top_of_set ?U) (rel_interior S)
 2. affine ?U
 3. affine (affine hull f ` S)
 4. aff_dim (affine hull f ` S) \<le> aff_dim ?U
 5. continuous_on (rel_interior S) f
 6. f ` rel_interior S \<subseteq> affine hull f ` S
 7. inj_on f (rel_interior S)
[PROOF STEP]
show "openin (top_of_set (affine hull S)) (rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (affine hull S)) (rel_interior S)
[PROOF STEP]
by (simp add: openin_rel_interior)
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull S)) (rel_interior S)

goal (6 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)
 4. continuous_on (rel_interior S) f
 5. f ` rel_interior S \<subseteq> affine hull f ` S
 6. inj_on f (rel_interior S)
[PROOF STEP]
show "aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)
[PROOF STEP]
by (metis aff_dim_affine_hull aff_dim_subset fim TS order_trans)
[PROOF STATE]
proof (state)
this:
aff_dim (affine hull f ` S) \<le> aff_dim (affine hull S)

goal (5 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. continuous_on (rel_interior S) f
 4. f ` rel_interior S \<subseteq> affine hull f ` S
 5. inj_on f (rel_interior S)
[PROOF STEP]
show "f ` rel_interior S \<subseteq> affine hull f ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` rel_interior S \<subseteq> affine hull f ` S
[PROOF STEP]
by (meson \<open>f ` rel_interior S \<subseteq> f ` S\<close> hull_subset order_trans)
[PROOF STATE]
proof (state)
this:
f ` rel_interior S \<subseteq> affine hull f ` S

goal (4 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. continuous_on (rel_interior S) f
 4. inj_on f (rel_interior S)
[PROOF STEP]
show "continuous_on (rel_interior S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (rel_interior S) f
[PROOF STEP]
using contf continuous_on_subset rel_interior_subset
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f
rel_interior ?S \<subseteq> ?S

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

goal (3 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
 3. inj_on f (rel_interior S)
[PROOF STEP]
show "inj_on f (rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (rel_interior S)
[PROOF STEP]
using inj_on_subset injf rel_interior_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>inj_on ?f ?A; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> inj_on ?f ?B
inj_on f S
rel_interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. inj_on f (rel_interior S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on f (rel_interior S)

goal (2 subgoals):
 1. affine (affine hull S)
 2. affine (affine hull f ` S)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull f ` S)) (f ` rel_interior S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_Collect_disj:
  assumes "closed {x. P x}" "closed {x. Q x}"
  shows "closed {x. P x \<or> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x \<or> Q x}
[PROOF STEP]
using closed_Un[OF assms]
[PROOF STATE]
proof (prove)
using this:
closed ({x. P x} \<union> {x. Q x})

goal (1 subgoal):
 1. closed {x. P x \<or> Q x}
[PROOF STEP]
by (simp add: Un_def)


[STATEMENT]
lemma position_augment:
  assumes "position ((augment_list f ^^ n) p)"
  shows "position p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. position p
[PROOF STEP]
using assms length_augment_list[of n f p]
[PROOF STATE]
proof (prove)
using this:
position ((augment_list f ^^ n) p)
length ((augment_list f ^^ n) p) = n + length p

goal (1 subgoal):
 1. position p
[PROOF STEP]
unfolding position_def
[PROOF STATE]
proof (prove)
using this:
enat (length ((augment_list f ^^ n) p)) \<le> 2 * N
length ((augment_list f ^^ n) p) = n + length p

goal (1 subgoal):
 1. enat (length p) \<le> 2 * N
[PROOF STEP]
by fastforce


[STATEMENT]
lemma [code]: "sorted_list_of_fset (fset_of_list l) = nativeSort (remdups l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_fset (fset_of_list l) = nativeSort (remdups l)
[PROOF STEP]
by (simp add: nativeSort_def sorted_list_of_fset_sort)


[STATEMENT]
lemma coeffs_uminus [code abstract]:
  "coeffs (- p) = map uminus (coeffs p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs (- p) = map uminus (coeffs p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeffs (- p) = map uminus (coeffs p)
[PROOF STEP]
have eq_0: "HOL.eq 0 \<circ> uminus = HOL.eq (0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (=) (0::'a) \<circ> uminus = (=) (0::'a)
[PROOF STEP]
by (simp add: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(=) (0::'a) \<circ> uminus = (=) (0::'a)

goal (1 subgoal):
 1. coeffs (- p) = map uminus (coeffs p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs (- p) = map uminus (coeffs p)
[PROOF STEP]
by (rule coeffs_eqI) (simp_all add: nth_default_map_eq nth_default_coeffs_eq no_trailing_map eq_0)
[PROOF STATE]
proof (state)
this:
coeffs (- p) = map uminus (coeffs p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_distr_prob_space2[measurable (raw)]:
  assumes f: "g \<in> L \<rightarrow>\<^sub>M prob_algebra M" "(\<lambda>(x, y). f x y) \<in> L \<Otimes>\<^sub>M M \<rightarrow>\<^sub>M N"
  shows "(\<lambda>x. distr (g x) N (f x)) \<in> L \<rightarrow>\<^sub>M prob_algebra N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. distr (g x) N (f x)) \<in> L \<rightarrow>\<^sub>M prob_algebra N
[PROOF STEP]
unfolding prob_algebra_def measurable_restrict_space2_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. distr (g x) N (f x)) \<in> L \<rightarrow>\<^sub>M subprob_algebra N \<and> (\<lambda>x. distr (g x) N (f x)) \<in> space L \<rightarrow> Collect prob_space
[PROOF STEP]
proof (intro conjI measurable_restrict_space1 measurable_distr2[where M=M] f measurable_prob_algebraD)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. distr (g x) N (f x)) \<in> space L \<rightarrow> Collect prob_space
[PROOF STEP]
show "(\<lambda>x. distr (g x) N (f x)) \<in> space L \<rightarrow> Collect prob_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. distr (g x) N (f x)) \<in> space L \<rightarrow> Collect prob_space
[PROOF STEP]
using f subprob_measurableD[OF measurable_prob_algebraD[OF f(1)]]
[PROOF STATE]
proof (prove)
using this:
g \<in> L \<rightarrow>\<^sub>M prob_algebra M
(\<lambda>(x, y). f x y) \<in> L \<Otimes>\<^sub>M M \<rightarrow>\<^sub>M N
?x \<in> space L \<Longrightarrow> space (g ?x) = space M
?x \<in> space L \<Longrightarrow> sets (g ?x) = sets M
?x \<in> space L \<Longrightarrow> g ?x \<rightarrow>\<^sub>M ?K = M \<rightarrow>\<^sub>M ?K
?x \<in> space L \<Longrightarrow> ?K \<rightarrow>\<^sub>M g ?x = ?K \<rightarrow>\<^sub>M M

goal (1 subgoal):
 1. (\<lambda>x. distr (g x) N (f x)) \<in> space L \<rightarrow> Collect prob_space
[PROOF STEP]
by (auto simp: measurable_restrict_space2_iff prob_algebra_def
             intro!: prob_space.prob_space_distr)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. distr (g x) N (f x)) \<in> space L \<rightarrow> Collect prob_space

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_darcs_img:
  assumes "disjoint_darcs xs" and "\<forall>(t,e) \<in> fset xs. darcs (f t) \<subseteq> darcs t"
  shows "disjoint_darcs ((\<lambda>(t,e). (f t,e)) |`| xs)" (is "disjoint_darcs ?xs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> disjoint_darcs ?xs"
[PROOF STATE]
proof (state)
this:
\<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs)

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs)
[PROOF STEP]
obtain x1 e1 y1 e2 where asm: "(x1,e1) \<in> fset ?xs" "(y1,e2) \<in> fset ?xs"
      "e1 \<in> darcs x1 \<or> (darcs x1 \<union> {e1}) \<inter> (darcs y1 \<union> {e2}) \<noteq> {} \<and> (x1,e1)\<noteq>(y1,e2)"
[PROOF STATE]
proof (prove)
using this:
\<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs)

goal (1 subgoal):
 1. (\<And>x1 e1 y1 e2. \<lbrakk>(x1, e1) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs); (y1, e2) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs); e1 \<in> darcs x1 \<or> (darcs x1 \<union> {e1}) \<inter> (darcs y1 \<union> {e2}) \<noteq> {} \<and> (x1, e1) \<noteq> (y1, e2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x1, e1) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)
(y1, e2) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)
e1 \<in> darcs x1 \<or> (darcs x1 \<union> {e1}) \<inter> (darcs y1 \<union> {e2}) \<noteq> {} \<and> (x1, e1) \<noteq> (y1, e2)

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x1, e1) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)
(y1, e2) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)
e1 \<in> darcs x1 \<or> (darcs x1 \<union> {e1}) \<inter> (darcs y1 \<union> {e2}) \<noteq> {} \<and> (x1, e1) \<noteq> (y1, e2)
[PROOF STEP]
obtain x2 where x2_def: "f x2 = x1" "(x2,e1) \<in> fset xs"
[PROOF STATE]
proof (prove)
using this:
(x1, e1) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)
(y1, e2) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)
e1 \<in> darcs x1 \<or> (darcs x1 \<union> {e1}) \<inter> (darcs y1 \<union> {e2}) \<noteq> {} \<and> (x1, e1) \<noteq> (y1, e2)

goal (1 subgoal):
 1. (\<And>x2. \<lbrakk>f x2 = x1; (x2, e1) \<in> fset xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x2 = x1
(x2, e1) \<in> fset xs

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
obtain y2 where y2_def: "f y2 = y1" "(y2,e2) \<in> fset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y2. \<lbrakk>f y2 = y1; (y2, e2) \<in> fset xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using asm(2)
[PROOF STATE]
proof (prove)
using this:
(y1, e2) \<in> fset ((\<lambda>(t, e). (f t, e)) |`| xs)

goal (1 subgoal):
 1. (\<And>y2. \<lbrakk>f y2 = y1; (y2, e2) \<in> fset xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f y2 = y1
(y2, e2) \<in> fset xs

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
have "darcs x1 \<subseteq> darcs x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. darcs x1 \<subseteq> darcs x2
[PROOF STEP]
using assms(2) x2_def
[PROOF STATE]
proof (prove)
using this:
\<forall>(t, e)\<in>fset xs. darcs (f t) \<subseteq> darcs t
f x2 = x1
(x2, e1) \<in> fset xs

goal (1 subgoal):
 1. darcs x1 \<subseteq> darcs x2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
darcs x1 \<subseteq> darcs x2

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
darcs x1 \<subseteq> darcs x2

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
have "darcs y1 \<subseteq> darcs y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. darcs y1 \<subseteq> darcs y2
[PROOF STEP]
using assms(2) y2_def
[PROOF STATE]
proof (prove)
using this:
\<forall>(t, e)\<in>fset xs. darcs (f t) \<subseteq> darcs t
f y2 = y1
(y2, e2) \<in> fset xs

goal (1 subgoal):
 1. darcs y1 \<subseteq> darcs y2
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
darcs y1 \<subseteq> darcs y2

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
darcs x1 \<subseteq> darcs x2
darcs y1 \<subseteq> darcs y2
[PROOF STEP]
have "\<not> disjoint_darcs xs"
[PROOF STATE]
proof (prove)
using this:
darcs x1 \<subseteq> darcs x2
darcs y1 \<subseteq> darcs y2

goal (1 subgoal):
 1. \<not> disjoint_darcs xs
[PROOF STEP]
using asm(3) x2_def y2_def
[PROOF STATE]
proof (prove)
using this:
darcs x1 \<subseteq> darcs x2
darcs y1 \<subseteq> darcs y2
e1 \<in> darcs x1 \<or> (darcs x1 \<union> {e1}) \<inter> (darcs y1 \<union> {e2}) \<noteq> {} \<and> (x1, e1) \<noteq> (y1, e2)
f x2 = x1
(x2, e1) \<in> fset xs
f y2 = y1
(y2, e2) \<in> fset xs

goal (1 subgoal):
 1. \<not> disjoint_darcs xs
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<not> disjoint_darcs xs

goal (1 subgoal):
 1. \<not> disjoint_darcs ((\<lambda>(t, e). (f t, e)) |`| xs) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> disjoint_darcs xs
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> disjoint_darcs xs

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
\<not> disjoint_darcs xs
disjoint_darcs xs

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_sum_uminus:
  fixes f :: \<open>'a \<Rightarrow> 'b::topological_ab_group_add\<close>
  shows \<open>has_sum (\<lambda>x. - f x) A a \<longleftrightarrow> has_sum f A (- a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum (\<lambda>x. - f x) A a = has_sum f A (- a)
[PROOF STEP]
by (auto simp add: sum_negf[abs_def] tendsto_minus_cancel_left has_sum_def)


[STATEMENT]
lemma not_cong_4312:
  assumes "\<not> Cong A B C D"
  shows "\<not> Cong D C A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Cong D C A B
[PROOF STEP]
using assms cong_3421
[PROOF STATE]
proof (prove)
using this:
\<not> Cong A B C D
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?C ?D ?B ?A

goal (1 subgoal):
 1. \<not> Cong D C A B
[PROOF STEP]
by blast


[STATEMENT]
lemma poly_hash_familyI:
  assumes "ring R"
  assumes "finite (carrier R)"
  assumes "0 < k"
  shows "poly_hash_family R k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_hash_family R k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ring R
finite (carrier R)
0 < k

goal (1 subgoal):
 1. poly_hash_family R k
[PROOF STEP]
by (simp add:poly_hash_family_def poly_hash_family_axioms_def)


[STATEMENT]
lemma finite_FV: "finite S \<Longrightarrow> finite (FV S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> finite (FV S)
[PROOF STEP]
by (induction S rule: finite_induct) auto


[STATEMENT]
lemma open_Collect_conj:
  assumes "open {x. P x}" "open {x. Q x}"
  shows "open {x. P x \<and> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {x. P x \<and> Q x}
[PROOF STEP]
using open_Int[OF assms]
[PROOF STATE]
proof (prove)
using this:
open ({x. P x} \<inter> {x. Q x})

goal (1 subgoal):
 1. open {x. P x \<and> Q x}
[PROOF STEP]
by (simp add: Int_def)


[STATEMENT]
lemma norm_fds_nth_newman:
  "norm (fds_nth fds_newman n) = \<MM> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (fds_nth fds_newman n) = \<MM> (real n)
[PROOF STEP]
unfolding fds_nth_newman norm_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<MM> (real n)\<bar> = \<MM> (real n)
[PROOF STEP]
by (intro abs_of_nonneg sum_nonneg divide_nonneg_pos) (auto dest: prime_ge_1_nat)


[STATEMENT]
lemma gcd_diff_r: "m\<le>n \<Longrightarrow> gcd m n = gcd m (n-m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> Arith2.gcd m n = Arith2.gcd m (n - m)
[PROOF STEP]
apply (unfold gcd_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> (SOME x. cd x m n \<and> (\<forall>y. cd y m n \<longrightarrow> y \<le> x)) = (SOME x. cd x m (n - m) \<and> (\<forall>y. cd y m (n - m) \<longrightarrow> y \<le> x))
[PROOF STEP]
apply (subgoal_tac "m\<le>n \<Longrightarrow> \<forall>x. cd x m n = cd x m (n-m) ")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>m \<le> n; m \<le> n \<Longrightarrow> \<forall>x. cd x m n = cd x m (n - m)\<rbrakk> \<Longrightarrow> (SOME x. cd x m n \<and> (\<forall>y. cd y m n \<longrightarrow> y \<le> x)) = (SOME x. cd x m (n - m) \<and> (\<forall>y. cd y m (n - m) \<longrightarrow> y \<le> x))
 2. \<lbrakk>m \<le> n; m \<le> n\<rbrakk> \<Longrightarrow> \<forall>x. cd x m n = cd x m (n - m)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m \<le> n; m \<le> n\<rbrakk> \<Longrightarrow> \<forall>x. cd x m n = cd x m (n - m)
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>m \<le> n; m \<le> n\<rbrakk> \<Longrightarrow> cd x m n = cd x m (n - m)
[PROOF STEP]
apply (erule cd_diff_r)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lub_belowI[intro, simp]:
  fixes x :: "'a :: Join_cpo"
  shows  "(\<And> y. y \<in> S \<Longrightarrow> y \<sqsubseteq> x) \<Longrightarrow> lub S \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> S \<Longrightarrow> y \<sqsubseteq> x) \<Longrightarrow> lub S \<sqsubseteq> x
[PROOF STEP]
by (metis exists_lub is_lub_thelub_ex is_ub_def)


[STATEMENT]
lemma of_complex_sub_one [simp]:
  shows "of_complex x -\<^sub>h 1\<^sub>h = of_complex (x - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_complex x -\<^sub>h 1\<^sub>h = of_complex (x - 1)
[PROOF STEP]
by (metis of_complex_one of_complex_sub_of_complex)


[STATEMENT]
lemma fds_nth_mult_const_left [simp]: "fds_nth (fds_const c * f) n = c * fds_nth f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_const c * f) n = c * fds_nth f n
[PROOF STEP]
by (cases "n = 0") (simp_all add: fds_nth_mult fds_const_def)


[STATEMENT]
lemma finite_identity_rules[intro]:
  assumes "finite L"
  shows "finite (identity_rules L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (identity_rules L)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite L

goal (1 subgoal):
 1. finite (identity_rules L)
[PROOF STEP]
unfolding identity_rules_def
[PROOF STATE]
proof (prove)
using this:
finite L

goal (1 subgoal):
 1. finite ({reflexivity_rule S_Idt, transitive_rule S_Idt, symmetry_rule S_Idt} \<union> congruence_rules S_Idt L)
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_two_chain_vertical_boundary:
  assumes "finite two_chain"
  shows "finite (two_chain_vertical_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (two_chain_vertical_boundary two_chain)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite two_chain

goal (1 subgoal):
 1. finite (two_chain_vertical_boundary two_chain)
[PROOF STEP]
by (simp add: two_chain_vertical_boundary_def vertical_boundary_def)


[STATEMENT]
lemma lift_sup_distrib: "lift x (a \<squnion> b) = lift x a \<squnion> lift x b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift x (a \<squnion> b) = lift x a \<squnion> lift x b
[PROOF STEP]
by (simp add: image_Un lift_def sup_V_def)


[STATEMENT]
lemma nodes_of_component[simp]: "nodes (component_of g r) = reachable_nodes g r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (component_of g r) = reachable_nodes g r
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. nodes (component_of g r) \<subseteq> reachable_nodes g r
 2. reachable_nodes g r \<subseteq> nodes (component_of g r)
[PROOF STEP]
unfolding component_of_def reachable_nodes_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. nodes (ins_node r (restrict_nodes g ((edges g)\<^sup>* `` {r}))) \<subseteq> (edges g)\<^sup>* `` {r}
 2. (edges g)\<^sup>* `` {r} \<subseteq> nodes (ins_node r (restrict_nodes g ((edges g)\<^sup>* `` {r})))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (ins_node r (restrict_nodes g ((edges g)\<^sup>* `` {r}))) \<subseteq> (edges g)\<^sup>* `` {r}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edges g)\<^sup>* `` {r} \<subseteq> nodes (ins_node r (restrict_nodes g ((edges g)\<^sup>* `` {r})))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edges g)\<^sup>* `` {r} \<subseteq> nodes (ins_node r (restrict_nodes g ((edges g)\<^sup>* `` {r})))
[PROOF STEP]
by clarsimp (metis nodesI(2) rtranclE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sym_mod_code[code]: "sym_mod x y = (let m = x mod y
   in if m + m \<le> y then m else m - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x symmod y = (let m = x mod y in if m + m \<le> y then m else m - y)
[PROOF STEP]
unfolding sym_mod_def poly_mod.inv_M_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x mod y + x mod y \<le> y then x mod y else x mod y - y) = (if x mod y + x mod y \<le> y then x mod y else x mod y - y)
[PROOF STEP]
..


[STATEMENT]
lemma f_flow_continuous_on: "continuous_on (Sigma X existence_ivl0) (\<lambda>(x0, t). f (flow0 x0 t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (Sigma X existence_ivl0) (\<lambda>(x0, t). f (flow0 x0 t))
[PROOF STEP]
using flow_continuous_on_state_space
[PROOF STATE]
proof (prove)
using this:
continuous_on (Sigma X existence_ivl0) (\<lambda>(x, y). flow0 x y)

goal (1 subgoal):
 1. continuous_on (Sigma X existence_ivl0) (\<lambda>(x0, t). f (flow0 x0 t))
[PROOF STEP]
by (auto intro!: continuous_on_f flow_in_domain simp: split_beta')


[STATEMENT]
lemma trg_join_of:
    assumes "join_of t u v"
    shows "trg (t \\ u) = trg v" and "trg (u \\ t) = trg v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trg (t \ u) = trg v &&& trg (u \ t) = trg v
[PROOF STEP]
by (metis assms join_of_def trg_composite_of)+


[STATEMENT]
lemma squarefree_minus [simp]: "squarefree (-n :: 'a :: comm_ring_1) \<longleftrightarrow> squarefree n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squarefree (- n) = squarefree n
[PROOF STEP]
by (simp add: squarefree_def)


[STATEMENT]
lemma head_minus_poly_rev_list:
  "length d \<le> length r \<Longrightarrow> d \<noteq> [] \<Longrightarrow>
    hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = 0"
  for d r :: "'a::comm_ring list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length d \<le> length r; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = (0::'a)
[PROOF STEP]
proof (induct r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>length d \<le> length []; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) []) (map ((*) (hd [])) (rev d))) = (0::'a)
 2. \<And>a r. \<lbrakk>\<lbrakk>length d \<le> length r; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = (0::'a); length d \<le> length (a # r); d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) (a # r)) (map ((*) (hd (a # r))) (rev d))) = (0::'a)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
length d \<le> length []
d \<noteq> []

goal (2 subgoals):
 1. \<lbrakk>length d \<le> length []; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) []) (map ((*) (hd [])) (rev d))) = (0::'a)
 2. \<And>a r. \<lbrakk>\<lbrakk>length d \<le> length r; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = (0::'a); length d \<le> length (a # r); d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) (a # r)) (map ((*) (hd (a # r))) (rev d))) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length d \<le> length []
d \<noteq> []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length d \<le> length []
d \<noteq> []

goal (1 subgoal):
 1. hd (minus_poly_rev_list (map ((*) (last d)) []) (map ((*) (hd [])) (rev d))) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hd (minus_poly_rev_list (map ((*) (last d)) []) (map ((*) (hd [])) (rev d))) = (0::'a)

goal (1 subgoal):
 1. \<And>a r. \<lbrakk>\<lbrakk>length d \<le> length r; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = (0::'a); length d \<le> length (a # r); d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) (a # r)) (map ((*) (hd (a # r))) (rev d))) = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a r. \<lbrakk>\<lbrakk>length d \<le> length r; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = (0::'a); length d \<le> length (a # r); d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) (a # r)) (map ((*) (hd (a # r))) (rev d))) = (0::'a)
[PROOF STEP]
case (Cons a rs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length d \<le> length rs; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) rs) (map ((*) (hd rs)) (rev d))) = (0::'a)
length d \<le> length (a # rs)
d \<noteq> []

goal (1 subgoal):
 1. \<And>a r. \<lbrakk>\<lbrakk>length d \<le> length r; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) r) (map ((*) (hd r)) (rev d))) = (0::'a); length d \<le> length (a # r); d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) (a # r)) (map ((*) (hd (a # r))) (rev d))) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length d \<le> length rs; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) rs) (map ((*) (hd rs)) (rev d))) = (0::'a)
length d \<le> length (a # rs)
d \<noteq> []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length d \<le> length rs; d \<noteq> []\<rbrakk> \<Longrightarrow> hd (minus_poly_rev_list (map ((*) (last d)) rs) (map ((*) (hd rs)) (rev d))) = (0::'a)
length d \<le> length (a # rs)
d \<noteq> []

goal (1 subgoal):
 1. hd (minus_poly_rev_list (map ((*) (last d)) (a # rs)) (map ((*) (hd (a # rs))) (rev d))) = (0::'a)
[PROOF STEP]
by (cases "rev d") (simp_all add: ac_simps)
[PROOF STATE]
proof (state)
this:
hd (minus_poly_rev_list (map ((*) (last d)) (a # rs)) (map ((*) (hd (a # rs))) (rev d))) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indexI: "\<lbrakk> x\<in>s; f x = i \<rbrakk> \<Longrightarrow> x\<in>index f s i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> s; f x = i\<rbrakk> \<Longrightarrow> x \<in> index f s i
[PROOF STEP]
by (unfold index_def) auto


[STATEMENT]
lemma "NOT (0xF0 :: 16 word) = 0xFF0F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NOT 240 = 65295
[PROOF STEP]
by smt


[STATEMENT]
lemma two: "(2::nat) = Suc 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 = Suc 1
[PROOF STEP]
by simp