[STATEMENT]
lemma Quadratic_Reciprocity_Jacobi':
  fixes p q :: int
  assumes "coprime p q"
      and "2 < p" "2 < q"
      and "odd p" "odd q"
    shows "Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then -1 else 1) * Jacobi p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
have aux: "a \<in> {1, -1, 0} \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> a*b = c \<Longrightarrow> b = c * a" for b c a :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> {1, - 1, 0}; c \<noteq> 0; a * b = c\<rbrakk> \<Longrightarrow> b = c * a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> {1, - 1, 0}; ?c \<noteq> 0; ?a * ?b = ?c\<rbrakk> \<Longrightarrow> ?b = ?c * ?a

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
from Quadratic_Reciprocity_Jacobi[OF assms]
[PROOF STATE]
proof (chain)
picking this:
Jacobi p q * Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2))
[PROOF STEP]
have "Jacobi q p = (-1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) * Jacobi p q"
[PROOF STATE]
proof (prove)
using this:
Jacobi p q * Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2))

goal (1 subgoal):
 1. Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) * Jacobi p q
[PROOF STEP]
using Jacobi_values
[PROOF STATE]
proof (prove)
using this:
Jacobi p q * Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2))
Jacobi ?p ?q \<in> {1, - 1, 0}

goal (1 subgoal):
 1. Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) * Jacobi p q
[PROOF STEP]
by (fastforce intro!: aux)
[PROOF STATE]
proof (state)
this:
Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) * Jacobi p q

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Jacobi q p = (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) * Jacobi p q

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
have "(-1 :: int) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) = (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) = (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1)
[PROOF STEP]
unfolding minus_one_power_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even (nat ((p - 1) div 2 * ((q - 1) div 2))) then 1 else - 1) = (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1)
[PROOF STEP]
using \<open>2 < p\<close> \<open>2 < q\<close>
[PROOF STATE]
proof (prove)
using this:
2 < p
2 < q

goal (1 subgoal):
 1. (if even (nat ((p - 1) div 2 * ((q - 1) div 2))) then 1 else - 1) = (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1)
[PROOF STEP]
by (auto simp: even_nat_iff)
[PROOF STATE]
proof (state)
this:
(- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) = (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1)

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- 1) ^ nat ((p - 1) div 2 * ((q - 1) div 2)) = (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1)

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
have "... = (if p mod 4 = 3 \<and> q mod 4 = 3 then -1 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1) = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1)
[PROOF STEP]
using \<open>odd p\<close> \<open>odd q\<close>
[PROOF STATE]
proof (prove)
using this:
odd p
odd q

goal (1 subgoal):
 1. (if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1) = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(if even ((p - 1) div 2) \<or> even ((q - 1) div 2) then 1 else - 1) = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1)

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q

goal (1 subgoal):
 1. Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Jacobi q p = (if p mod 4 = 3 \<and> q mod 4 = 3 then - 1 else 1) * Jacobi p q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indecomposableD:
  "\<lbrakk>indecomposable \<alpha>; \<beta> < \<alpha>; \<gamma> < \<alpha>; Ord \<beta>; Ord \<gamma>\<rbrakk> \<Longrightarrow> \<beta>+\<gamma> < \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>indecomposable \<alpha>; \<beta> < \<alpha>; \<gamma> < \<alpha>; Ord \<beta>; Ord \<gamma>\<rbrakk> \<Longrightarrow> \<beta> + \<gamma> < \<alpha>
[PROOF STEP]
by (meson Ord_mem_iff_lt OrdmemD indecomposable_def)


[STATEMENT]
lemma comp_red_monic_basis_is_monic_set: "is_monic_set (set (comp_red_monic_basis xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_monic_set (set (comp_red_monic_basis xs))
[PROOF STEP]
unfolding set_comp_red_monic_basis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_monic_set (monic ` set (comp_red_basis xs))
[PROOF STEP]
by (rule image_monic_is_monic_set)


[STATEMENT]
lemma has_vector_derivative_real_field:
  "(f has_field_derivative f') (at (of_real a)) \<Longrightarrow> ((\<lambda>x. f (of_real x)) has_vector_derivative f') (at a within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative f') (at (of_real a)) \<Longrightarrow> ((\<lambda>x. f (of_real x)) has_vector_derivative f') (at a within s)
[PROOF STEP]
using has_derivative_compose[of of_real of_real a _ f "(*) f'"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(of_real has_derivative of_real) (at a within ?s); (f has_derivative (*) f') (at (of_real a))\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (of_real x)) has_derivative (\<lambda>x. f' * of_real x)) (at a within ?s)

goal (1 subgoal):
 1. (f has_field_derivative f') (at (of_real a)) \<Longrightarrow> ((\<lambda>x. f (of_real x)) has_vector_derivative f') (at a within s)
[PROOF STEP]
by (simp add: scaleR_conv_of_real ac_simps has_vector_derivative_def has_field_derivative_def)


[STATEMENT]
lemma OrdLeast_le: "Ord k \<Longrightarrow> P k \<Longrightarrow> (LEAST n. Ord n \<and> P n) \<le> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord k; P k\<rbrakk> \<Longrightarrow> (LEAST n. Ord n \<and> P n) \<le> k
[PROOF STEP]
by (metis (lifting, no_types) Least_equality Ord_minimal)


[STATEMENT]
theorem  "DA.accepts (nae2da(rexp2nae r)) w = (w : lang r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DA.accepts (nae2da (rexp2nae r)) w = (w \<in> lang r)
[PROOF STEP]
by (simp add: NAe_DA_equiv accepts_rexp2nae)


[STATEMENT]
lemma edge_as_set_inj_on_Mi:
  assumes "matching V E M"
  shows "inj_on edge_as_set (matching_i i V E M L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on edge_as_set (matching_i i V E M L)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
matching V E M

goal (1 subgoal):
 1. inj_on edge_as_set (matching_i i V E M L)
[PROOF STEP]
unfolding inj_on_def edge_as_set_def matching_def
    disjoint_edges_def matching_i_def
[PROOF STATE]
proof (prove)
using this:
M \<subseteq> E \<and> finite_graph V E \<and> (\<forall>e1\<in>M. \<forall>e2\<in>M. e1 \<noteq> e2 \<longrightarrow> fst e1 \<noteq> fst e2 \<and> fst e1 \<noteq> snd e2 \<and> snd e1 \<noteq> fst e2 \<and> snd e1 \<noteq> snd e2)

goal (1 subgoal):
 1. \<forall>x\<in>{e \<in> M. i = 1 \<and> (L (fst e) = i \<or> L (snd e) = i) \<or> 1 < i \<and> L (fst e) = i \<and> L (snd e) = i}. \<forall>y\<in>{e \<in> M. i = 1 \<and> (L (fst e) = i \<or> L (snd e) = i) \<or> 1 < i \<and> L (fst e) = i \<and> L (snd e) = i}. {fst x, snd x} = {fst y, snd y} \<longrightarrow> x = y
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ceuclidean_space) bchoice_CBasis_iff:
  fixes P :: "'a \<Rightarrow> complex \<Rightarrow> bool"
  shows "(\<forall>i\<in>CBasis. \<exists>x\<in>A. P i x) \<longleftrightarrow> (\<exists>x. \<forall>i\<in>CBasis. cinner x i \<in> A \<and> P i (cinner x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>CBasis. \<exists>x\<in>A. P i x) = (\<exists>x. \<forall>i\<in>CBasis. x \<bullet>\<^sub>C i \<in> A \<and> P i (x \<bullet>\<^sub>C i))
[PROOF STEP]
by (simp add: choice_CBasis_iff Bex_def)


[STATEMENT]
lemma fact_expand_psi:
  "ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d=1..n. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "ln (fact n) - 2 * ln (fact (n div 2)) =
    (\<Sum>d=1..n. mangoldt d * \<lfloor>n / d\<rfloor>) - 2 * (\<Sum>d=1..n div 2. mangoldt d * \<lfloor>(n div 2) / d\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor>) - 2 * (\<Sum>d = 1..n div 2. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)
[PROOF STEP]
by (simp add:  ln_fact_conv_mangoldt)
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor>) - 2 * (\<Sum>d = 1..n div 2. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor>) - 2 * (\<Sum>d = 1..n div 2. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "(\<Sum>d=1..n div 2. mangoldt d * \<lfloor>real (n div 2) / d\<rfloor>) =
               (\<Sum>d=1..n. mangoldt d * \<lfloor>real (n div 2) / d\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n div 2. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)
[PROOF STEP]
by (rule sum.mono_neutral_left) (auto simp: floor_unique[of 0])
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n div 2. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n div 2. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "2 * \<dots> = (\<Sum>d=1..n. mangoldt d * 2 * \<lfloor>real (n div 2) / d\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)
[PROOF STEP]
by (simp add: sum_distrib_left mult_ac)
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "(\<Sum>d=1..n. mangoldt d * \<lfloor>n / d\<rfloor>) - \<dots> =
               (\<Sum>d=1..n. (mangoldt d * \<lfloor>n / d\<rfloor> - mangoldt d * 2 * \<lfloor>real (n div 2) / d\<rfloor>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor>) - (\<Sum>d = 1..n. mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor> - mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)
[PROOF STEP]
by (simp add: sum_subtractf)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor>) - (\<Sum>d = 1..n. mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor> - mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor>) - (\<Sum>d = 1..n. mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor> - mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "\<dots> = (\<Sum>d=1..n. mangoldt d * (\<lfloor>n / d\<rfloor> - 2 * \<lfloor>real (n div 2) / d\<rfloor>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor> - mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int (\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor> - mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int (\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * real_of_int \<lfloor>real n / real d\<rfloor> - mangoldt d * 2 * real_of_int \<lfloor>real (n div 2) / real d\<rfloor>) = (\<Sum>d = 1..n. mangoldt d * real_of_int (\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "\<dots> = (\<Sum>d=1..n. mangoldt d * (if odd(n div d) then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. mangoldt d * real_of_int (\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>)) = (\<Sum>d = 1..n. mangoldt d * (if odd (n div d) then 1 else 0))
[PROOF STEP]
by (intro sum.cong refl)
       (simp_all add: floor_conv_div_nat [symmetric] floor_half_interval [symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * real_of_int (\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>)) = (\<Sum>d = 1..n. mangoldt d * (if odd (n div d) then 1 else 0))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * real_of_int (\<lfloor>real n / real d\<rfloor> - 2 * \<lfloor>real (n div 2) / real d\<rfloor>)) = (\<Sum>d = 1..n. mangoldt d * (if odd (n div d) then 1 else 0))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
have "\<dots> = (\<Sum>d=1..n. (if odd(n div d) then 1 else 0) * mangoldt d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. mangoldt d * (if odd (n div d) then 1 else 0)) = (\<Sum>d = 1..n. (if odd (n div d) then 1 else 0) * mangoldt d)
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * (if odd (n div d) then 1 else 0)) = (\<Sum>d = 1..n. (if odd (n div d) then 1 else 0) * mangoldt d)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. mangoldt d * (if odd (n div d) then 1 else 0)) = (\<Sum>d = 1..n. (if odd (n div d) then 1 else 0) * mangoldt d)

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
from sum_expand_lemma[symmetric]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>d = 1..?n. (if odd (?n div d) then 1 else 0) * mangoldt d) = (\<Sum>d = 1..?n. (- 1) ^ (d + 1) * psi (?n div d))
[PROOF STEP]
have "\<dots> = (\<Sum>d=1..n. (-1)^(d+1) * psi (n div d))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>d = 1..?n. (if odd (?n div d) then 1 else 0) * mangoldt d) = (\<Sum>d = 1..?n. (- 1) ^ (d + 1) * psi (?n div d))

goal (1 subgoal):
 1. (\<Sum>d = 1..n. (if odd (n div d) then 1 else 0) * mangoldt d) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. (if odd (n div d) then 1 else 0) * mangoldt d) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))

goal (1 subgoal):
 1. ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln (fact n) - 2 * ln (fact (n div 2)) = (\<Sum>d = 1..n. (- 1) ^ (d + 1) * psi (n div d))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_square_smaller_0 [simp]:
  fixes x :: "'a :: {conjugatable_ordered_ring,ring_no_zero_divisors}"
  shows "\<not> x * conjugate x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> x * conjugate x < (0::'a)
[PROOF STEP]
using conjugate_square_positive[of x]
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> x * conjugate x

goal (1 subgoal):
 1. \<not> x * conjugate x < (0::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma s_s'': "$s^{m}_n = $v.^(1/m) * $s''^{m}_n" if "m \<noteq> 0" for m::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $s^{m}_n = $v .^ (1 / real m) * $s''^{m}_n
[PROOF STEP]
unfolding acc_def acc_due_def v_pres_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 + i) .^ (real k / real m) / real m) = (1 / (1 + i)) .^ (1 / real m) * (\<Sum>k<n * m. (1 + i) .^ (real (k + 1) / real m) / real m)
[PROOF STEP]
using v_futr_pos
[PROOF STATE]
proof (prove)
using this:
0 < 1 + i

goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 + i) .^ (real k / real m) / real m) = (1 / (1 + i)) .^ (1 / real m) * (\<Sum>k<n * m. (1 + i) .^ (real (k + 1) / real m) / real m)
[PROOF STEP]
apply (simp add: sum_distrib_left inverse_powr add_divide_distrib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + i \<Longrightarrow> (\<Sum>k<n * m. (1 + i) .^ (real k / real m) / real m) = (\<Sum>n<n * m. (1 + i) .^ - (1 / real m) * (1 + i) .^ (1 / real m + real n / real m) / real m)
[PROOF STEP]
by (metis (no_types) add_diff_cancel_left' powr_add uminus_add_conv_diff)


[STATEMENT]
lemma octonion_identity1_cross7 :
  "Hv (x \<times>\<^sub>7 y) = (1/2) *\<^sub>R (Hv x * Hv y - Hv y * Hv x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv (x \<times>\<^sub>7 y) = (1 / 2) *\<^sub>R (Hv x * Hv y - Hv y * Hv x)
[PROOF STEP]
by (simp add: octo_eq_iff octo_mult_components cross7_components)


[STATEMENT]
lemma DDDC: assumes "NatTrans f" shows "CatDom (NTDom f) = CatDom (NTCod f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CatDom (NTDom f) = CatDom (NTCod f)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. CatDom (NTDom f) = CatDom (NTCod f)
[PROOF STEP]
have "CatDom (NTDom f) = NTCatDom f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CatDom (NTDom f) = NTCatDom f
[PROOF STEP]
by (simp add: NTCatDom_def)
[PROOF STATE]
proof (state)
this:
CatDom (NTDom f) = NTCatDom f

goal (1 subgoal):
 1. CatDom (NTDom f) = CatDom (NTCod f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
CatDom (NTDom f) = NTCatDom f

goal (1 subgoal):
 1. CatDom (NTDom f) = CatDom (NTCod f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
CatDom (NTDom f) = NTCatDom f
NatTrans f

goal (1 subgoal):
 1. CatDom (NTDom f) = CatDom (NTCod f)
[PROOF STEP]
by (simp add: NatTransP.NatTransFtorDom)
[PROOF STATE]
proof (state)
this:
CatDom (NTDom f) = CatDom (NTCod f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lset_lzip:
  "lset (lzip xs ys) =
   {(lnth xs n, lnth ys n)|n. enat n < min (llength xs) (llength ys)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (lzip xs ys) = {(lnth xs n, lnth ys n) |n. enat n < min (llength xs) (llength ys)}
[PROOF STEP]
by(auto simp add: lset_conv_lnth lnth_lzip)(auto intro!: exI simp add: lnth_lzip)


[STATEMENT]
lemma pi_approx2:
  fixes n :: nat assumes n: "even n" and "n > 0"
  shows   "\<bar>pi - pi_approx2 n\<bar> \<le> inverse (2^(46*n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
even n
[PROOF STEP]
have n': "even (6*n)" "even (4*n)" "even (3*n)"
[PROOF STATE]
proof (prove)
using this:
even n

goal (1 subgoal):
 1. even (6 * n) &&& even (4 * n) &&& even (3 * n)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
even (6 * n)
even (4 * n)
even (3 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from machin'
[PROOF STATE]
proof (chain)
picking this:
pi / 4 = 12 * arctan (1 / 18) + 8 * arctan (1 / 57) - 5 * arctan (1 / 239)
[PROOF STEP]
have "pi = 48 * arctan (1/18) + 32 * arctan (1/57) - 20 * arctan (1/239::real)"
[PROOF STATE]
proof (prove)
using this:
pi / 4 = 12 * arctan (1 / 18) + 8 * arctan (1 / 57) - 5 * arctan (1 / 239)

goal (1 subgoal):
 1. pi = 48 * arctan (1 / 18) + 32 * arctan (1 / 57) - 20 * arctan (1 / 239)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pi = 48 * arctan (1 / 18) + 32 * arctan (1 / 57) - 20 * arctan (1 / 239)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
hence "pi - pi_approx2 n = 48 * (arctan (1/18) - arctan_approx (6*n) (1/18)) +
                                 32 * (arctan (1/57) - arctan_approx (4*n) (1/57)) -
                                 20 * (arctan (1/239) - arctan_approx (3*n) (1/239))"
[PROOF STATE]
proof (prove)
using this:
pi = 48 * arctan (1 / 18) + 32 * arctan (1 / 57) - 20 * arctan (1 / 239)

goal (1 subgoal):
 1. pi - pi_approx2 n = 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239))
[PROOF STEP]
by (simp add: pi_approx2_def)
[PROOF STATE]
proof (state)
this:
pi - pi_approx2 n = 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239))

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pi - pi_approx2 n = 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239))

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "\<dots> \<in> {-((20/239/(1-(1/239)^4)) * (1/239)^(6*n))..
              (48/18 / (1-(1/18)^4))*(1/18)^(12*n) + (32/57/(1-(1/57)^4)) * (1/57)^(8*n)}"
    (is "_ \<in> {-?l..?u1 + ?u2}")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}
[PROOF STEP]
apply ((rule combine_bounds(1,2))+; (rule combine_bounds(3); (rule arctan_approx)?)?)
[PROOF STATE]
proof (prove)
goal (16 subgoals):
 1. 0 \<le> 48
 2. 0 \<le> 1 / 18
 3. 1 / 18 < 1
 4. even (6 * n)
 5. 0 \<le> 32
 6. 0 \<le> 1 / 57
 7. 1 / 57 < 1
 8. even (4 * n)
 9. ?a1.1 = 48 * 0 + 32 * 0
 10. ?b1.1 = 48 * ((1 / 18) ^ (2 * (6 * n) + 1) / (1 - (1 / 18) ^ 4)) + 32 * ((1 / 57) ^ (2 * (4 * n) + 1) / (1 - (1 / 57) ^ 4))
A total of 16 subgoals...
[PROOF STEP]
apply (simp_all add: n)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 8 * (1 / 18) ^ (12 * n) / (3 - 3 * (1 / 18) ^ 4) = 48 * (1 / 18) ^ (12 * n) / (18 - 18 * (1 / 18) ^ 4)
[PROOF STEP]
apply (simp_all add: field_split_simps)?
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "?l \<le> (1/8) * (1/2)^(46*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> 1 / 8 * (1 / 2) ^ (46 * n)
[PROOF STEP]
unfolding power_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 20 / 239 / (1 - (1 / 239) ^ 4) * ((1 / 239) ^ 6) ^ n \<le> 1 / 8 * ((1 / 2) ^ 46) ^ n
[PROOF STEP]
by (intro mult_mono power_mono) (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> 1 / 8 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> 1 / 8 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "\<dots> \<le> (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 8 * (1 / 2) ^ (46 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by (cases n; simp_all add: power_add field_split_simps)
[PROOF STATE]
proof (state)
this:
1 / 8 * (1 / 2) ^ (46 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
have "?l \<le> (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
using this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. 20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "?u1 + ?u2 \<le> 4 * (1/2)^(48*n) + 1 * (1/2)^(46*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> 4 * (1 / 2) ^ (48 * n) + 1 * (1 / 2) ^ (46 * n)
[PROOF STEP]
unfolding power_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 48 / 18 / (1 - (1 / 18) ^ 4) * ((1 / 18) ^ 12) ^ n + 32 / 57 / (1 - (1 / 57) ^ 4) * ((1 / 57) ^ 8) ^ n \<le> 4 * ((1 / 2) ^ 48) ^ n + 1 * ((1 / 2) ^ 46) ^ n
[PROOF STEP]
by (intro add_mono mult_mono power_mono) (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> 4 * (1 / 2) ^ (48 * n) + 1 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> 4 * (1 / 2) ^ (48 * n) + 1 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from \<open>n > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "4 * (1/2::real)^(48*n) \<le> (1/2)^(46*n)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 4 * (1 / 2) ^ (48 * n) \<le> (1 / 2) ^ (46 * n)
[PROOF STEP]
by (cases n) (simp_all add: field_simps power_add)
[PROOF STATE]
proof (state)
this:
4 * (1 / 2) ^ (48 * n) \<le> (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
4 * (1 / 2) ^ (48 * n) \<le> (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from \<open>n > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "(1/2::real) ^ (46 * n) + 1 * (1 / 2) ^ (46 * n) = (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (1 / 2) ^ (46 * n) + 1 * (1 / 2) ^ (46 * n) = (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by (cases n; simp_all add: power_add power_divide)
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ (46 * n) + 1 * (1 / 2) ^ (46 * n) = (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> x + 1 * (1 / 2) ^ (46 * n) \<le> y + 1 * (1 / 2) ^ (46 * n)) \<Longrightarrow> 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
have "?u1 + ?u2 \<le> (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x + 1 * (1 / 2) ^ (46 * n) \<le> y + 1 * (1 / 2) ^ (46 * n)) \<Longrightarrow> 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by - simp
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
have "{-?l..?u1 + ?u2} \<subseteq> {-((1/2)^(46*n-1))..(1/2)^(46*n-1)}"
[PROOF STATE]
proof (prove)
using this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)} \<subseteq> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}
[PROOF STEP]
by (subst atLeastatMost_subset_iff) simp_all
[PROOF STATE]
proof (state)
this:
{- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)} \<subseteq> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
{- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)} \<subseteq> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pi - pi_approx2 n \<in> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}
[PROOF STEP]
have "\<bar>pi - pi_approx2 n\<bar> \<le> ((1/2) ^ (46 * n - 1))"
[PROOF STATE]
proof (prove)
using this:
pi - pi_approx2 n \<in> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx2 n\<bar> \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>pi - pi_approx2 n\<bar> \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma1: "[| P A n ; !A n. P A n --> P A (Suc n) |]
   ==> P A (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P A n; \<forall>A n. P A n \<longrightarrow> P A (Suc n)\<rbrakk> \<Longrightarrow> P A (n + m)
[PROOF STEP]
apply (induct m, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sumlist_vec_index: assumes "\<And> x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n"
  and "i < n"
shows "sumlist xs $ i = sum_list (map (\<lambda> x. x $ i) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.sumlist xs $ i = (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
unfolding M.sumlist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> set xs \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (1 subgoal):
 1. foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
proof(induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i); \<And>x. x \<in> set (a # xs) \<Longrightarrow> x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)
?x1 \<in> set (a # xs) \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i); \<And>x. x \<in> set (a # xs) \<Longrightarrow> x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)
[PROOF STEP]
hence cond:"\<And> x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)
?x1 \<in> set (a # xs) \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x1 \<in> set xs \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i); \<And>x. x \<in> set (a # xs) \<Longrightarrow> x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)
[PROOF STEP]
from Cons(1)[OF cond]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> set xs) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
have IH:"foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> set xs) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)

goal (1 subgoal):
 1. foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i)

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i); \<And>x. x \<in> set (a # xs) \<Longrightarrow> x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)
[PROOF STEP]
have "(a + foldr (+) xs (0\<^sub>v n)) $ i = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + foldr (+) xs (0\<^sub>v n)) $ i = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
apply(subst index_add_vec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < dim_vec (foldr (+) xs (0\<^sub>v n))
 2. a $ i + foldr (+) xs (0\<^sub>v n) $ i = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
unfolding IH
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i < dim_vec (foldr (+) xs (0\<^sub>v n))
 2. a $ i + (\<Sum>x\<leftarrow>xs. x $ i) = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
using sumlist_dim[OF cond,unfolded M.sumlist_def] assms
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set ?xs \<Longrightarrow> x \<in> set xs) \<Longrightarrow> dim_vec (foldr (+) ?xs (0\<^sub>v n)) = n
?x1 \<in> set xs \<Longrightarrow> ?x1 \<in> carrier_vec n
i < n

goal (2 subgoals):
 1. i < dim_vec (foldr (+) xs (0\<^sub>v n))
 2. a $ i + (\<Sum>x\<leftarrow>xs. x $ i) = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a + foldr (+) xs (0\<^sub>v n)) $ i = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) xs (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>xs. x $ i); \<And>x. x \<in> set (a # xs) \<Longrightarrow> x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a + foldr (+) xs (0\<^sub>v n)) $ i = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(a + foldr (+) xs (0\<^sub>v n)) $ i = a $ i + (\<Sum>x\<leftarrow>xs. x $ i)

goal (1 subgoal):
 1. foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
foldr (+) (a # xs) (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>a # xs. x $ i)

goal (1 subgoal):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
?x1 \<in> set [] \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (1 subgoal):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> x \<in> carrier_vec n) \<Longrightarrow> foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> set [] \<Longrightarrow> ?x1 \<in> carrier_vec n

goal (1 subgoal):
 1. foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> set [] \<Longrightarrow> ?x1 \<in> carrier_vec n
?x1 \<in> set xs \<Longrightarrow> ?x1 \<in> carrier_vec n
i < n

goal (1 subgoal):
 1. foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
foldr (+) [] (0\<^sub>v n) $ i = (\<Sum>x\<leftarrow>[]. x $ i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma onorm_scaleR_left_lemma:
  assumes r: "bounded_linear r"
  shows "onorm (\<lambda>x. r x *\<^sub>R f) \<le> onorm r * norm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. r x *\<^sub>R f) \<le> onorm r * norm f
[PROOF STEP]
proof (rule onorm_bound)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x
[PROOF STEP]
have "norm (r x *\<^sub>R f) = norm (r x) * norm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (r x *\<^sub>R f) = norm (r x) * norm f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (r x *\<^sub>R f) = norm (r x) * norm f

goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (r x *\<^sub>R f) = norm (r x) * norm f

goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x
[PROOF STEP]
have "\<dots> \<le> onorm r * norm x * norm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (r x) * norm f \<le> onorm r * norm x * norm f
[PROOF STEP]
by (intro mult_right_mono onorm r norm_ge_zero)
[PROOF STATE]
proof (state)
this:
norm (r x) * norm f \<le> onorm r * norm x * norm f

goal (2 subgoals):
 1. 0 \<le> onorm r * norm f
 2. \<And>x. norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (r x *\<^sub>R f) \<le> onorm r * norm x * norm f
[PROOF STEP]
show "norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x"
[PROOF STATE]
proof (prove)
using this:
norm (r x *\<^sub>R f) \<le> onorm r * norm x * norm f

goal (1 subgoal):
 1. norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
norm (r x *\<^sub>R f) \<le> onorm r * norm f * norm x

goal (1 subgoal):
 1. 0 \<le> onorm r * norm f
[PROOF STEP]
qed (intro mult_nonneg_nonneg norm_ge_zero onorm_pos_le r)


[STATEMENT]
lemma bijective_linorder_matrix:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.bijective f \<longleftrightarrow> (\<forall>j . \<exists>i . f (i,j) = top \<and> (\<forall>k . i \<noteq> k \<longrightarrow> f (k,j) = bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.bijective f = (\<forall>j. \<exists>i. f (i, j) = top \<and> (\<forall>k. i \<noteq> k \<longrightarrow> f (k, j) = bot))
[PROOF STEP]
by (unfold matrix_stone_relation_algebra.bijective_conv_mapping mapping_linorder_matrix) (simp add: conv_matrix_def)


[STATEMENT]
lemma add_delete_edge: "wf_graph (G::'a graph) \<Longrightarrow> (a,b) \<in> edges G \<Longrightarrow> add_edge a b (delete_edge a b G) = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph G; (a, b) \<in> edges G\<rbrakk> \<Longrightarrow> add_edge a b (delete_edge a b G) = G
[PROOF STEP]
apply(simp add: delete_edge_def add_edge_def wf_graph_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fst ` edges G \<subseteq> nodes G \<and> snd ` edges G \<subseteq> nodes G \<and> finite (edges G) \<and> finite (nodes G); (a, b) \<in> edges G\<rbrakk> \<Longrightarrow> \<lparr>nodes = insert a (insert b (nodes G)), edges = insert (a, b) {(e1, e2). (e1, e2) \<in> edges G \<and> (e1 = a \<longrightarrow> e2 \<noteq> b)}\<rparr> = G
[PROOF STEP]
apply(intro graph_eq_intro)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>fst ` edges G \<subseteq> nodes G \<and> snd ` edges G \<subseteq> nodes G \<and> finite (edges G) \<and> finite (nodes G); (a, b) \<in> edges G\<rbrakk> \<Longrightarrow> nodes \<lparr>nodes = insert a (insert b (nodes G)), edges = insert (a, b) {(e1, e2). (e1, e2) \<in> edges G \<and> (e1 = a \<longrightarrow> e2 \<noteq> b)}\<rparr> = nodes G
 2. \<lbrakk>fst ` edges G \<subseteq> nodes G \<and> snd ` edges G \<subseteq> nodes G \<and> finite (edges G) \<and> finite (nodes G); (a, b) \<in> edges G\<rbrakk> \<Longrightarrow> edges \<lparr>nodes = insert a (insert b (nodes G)), edges = insert (a, b) {(e1, e2). (e1, e2) \<in> edges G \<and> (e1 = a \<longrightarrow> e2 \<noteq> b)}\<rparr> = edges G
[PROOF STEP]
by auto


[STATEMENT]
lemma inverse_fps_numeral:
  "inverse (numeral n :: ('a :: field_char_0) fps) = fps_const (inverse (numeral n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (numeral n) = fps_const (inverse (numeral n))
[PROOF STEP]
by (intro fps_inverse_unique fps_ext) (simp_all add: fps_numeral_nth)


[STATEMENT]
lemma cartesian_power_decomp:
  assumes "a \<in> carrier (R\<^bsup>n+k\<^esup>)"
  obtains a0 a1 where "a0 \<in> carrier (R\<^bsup>n\<^esup>) \<and> a1 \<in> carrier (R\<^bsup>k\<^esup>) \<and> a0@a1 = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a0 a1. a0 \<in> carrier (R\<^bsup>n\<^esup>) \<and> a1 \<in> carrier (R\<^bsup>k\<^esup>) \<and> a0 @ a1 = a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (R\<^bsup>n + k\<^esup>)

goal (1 subgoal):
 1. (\<And>a0 a1. a0 \<in> carrier (R\<^bsup>n\<^esup>) \<and> a1 \<in> carrier (R\<^bsup>k\<^esup>) \<and> a0 @ a1 = a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) add_diff_cancel_left' append.assoc append_eq_append_conv
      append_take_drop_id cartesian_power_car_memE drop_closed le_add1
      le_neq_implies_less length_append take_closed)


[STATEMENT]
lemma ennreal_mult_eq_top_iff:
  fixes a b :: ennreal
  shows "a * b = top \<longleftrightarrow> (a = top \<and> b \<noteq> 0) \<or> (b = top \<and> a \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b = top) = (a = top \<and> b \<noteq> 0 \<or> b = top \<and> a \<noteq> 0)
[PROOF STEP]
by transfer (auto simp: top_ereal_def)


[STATEMENT]
lemma pdevs_val_scaleR_pdevs[simp]:
  fixes x::real and Y::"'a::real_normed_vector pdevs"
  shows "pdevs_val e (scaleR_pdevs x Y) = x *\<^sub>R pdevs_val e Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (scaleR_pdevs x Y) = x *\<^sub>R pdevs_val e Y
[PROOF STEP]
by (auto simp: pdevs_val_sum scaleR_sum_right ac_simps)


[STATEMENT]
theorem residue_fps_expansion_over_power_at_0:
  assumes "f has_fps_expansion F"
  shows   "residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
from has_fps_expansion_imp_holomorphic[OF assms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>s. \<lbrakk>open s; 0 \<in> s; f holomorphic_on s; \<And>z. z \<in> s \<Longrightarrow> f z = eval_fps F z\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain s
    where "open s" "0 \<in> s" "f holomorphic_on s" "\<And>z. z \<in> s \<Longrightarrow> f z = eval_fps F z"
[PROOF STATE]
proof (prove)
using this:
(\<And>s. \<lbrakk>open s; 0 \<in> s; f holomorphic_on s; \<And>z. z \<in> s \<Longrightarrow> f z = eval_fps F z\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>open s; 0 \<in> s; f holomorphic_on s; \<And>z. z \<in> s \<Longrightarrow> f z = eval_fps F z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open s
0 \<in> s
f holomorphic_on s
?z \<in> s \<Longrightarrow> f ?z = eval_fps F ?z

goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
open s
0 \<in> s
f holomorphic_on s
?z \<in> s \<Longrightarrow> f ?z = eval_fps F ?z
[PROOF STEP]
have "residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = (deriv ^^ n) f 0 / fact n"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
open s
0 \<in> s
f holomorphic_on s
?z \<in> s \<Longrightarrow> f ?z = eval_fps F ?z

goal (1 subgoal):
 1. residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = (deriv ^^ n) f 0 / fact n
[PROOF STEP]
unfolding has_fps_expansion_def
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius F \<and> (\<forall>\<^sub>F z in nhds 0. eval_fps F z = f z)
open s
0 \<in> s
f holomorphic_on s
?z \<in> s \<Longrightarrow> f ?z = eval_fps F ?z

goal (1 subgoal):
 1. residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = (deriv ^^ n) f 0 / fact n
[PROOF STEP]
by (intro residue_holomorphic_over_power[of s]) (auto simp: zero_ereal_def)
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = (deriv ^^ n) f 0 / fact n

goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = (deriv ^^ n) f 0 / fact n

goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
[PROOF STEP]
have "\<dots> = fps_nth F n"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F

goal (1 subgoal):
 1. (deriv ^^ n) f 0 / fact n = fps_nth F n
[PROOF STEP]
by (subst fps_nth_fps_expansion) auto
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) f 0 / fact n = fps_nth F n

goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
residue (\<lambda>z. f z / (z - 0) ^ Suc n) 0 = fps_nth F n

goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. f z / z ^ Suc n) 0 = fps_nth F n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma find_min_p_min:
  assumes "is_binqueue l xs"
  and "xs \<noteq> []"
  and "normalized xs"
  and "distinct (vals xs)"
  and "distinct (prios xs)"
  shows "priority (the (find_min xs)) =
    the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. priority (the (find_min xs)) = the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. priority (the (find_min xs)) = the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_binqueue l xs
xs \<noteq> []
normalized xs
distinct (vals xs)
distinct (prios xs)
[PROOF STEP]
have "min xs \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
is_binqueue l xs
xs \<noteq> []
normalized xs
distinct (vals xs)
distinct (prios xs)

goal (1 subgoal):
 1. Binomial_Queue.min xs \<noteq> None
[PROOF STEP]
by (simp add: normalized_min_not_None)
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min xs \<noteq> None

goal (1 subgoal):
 1. priority (the (find_min xs)) = the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_binqueue l xs
xs \<noteq> []
normalized xs
distinct (vals xs)
distinct (prios xs)
[PROOF STEP]
have "min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))"
[PROOF STATE]
proof (prove)
using this:
is_binqueue l xs
xs \<noteq> []
normalized xs
distinct (vals xs)
distinct (prios xs)

goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
by (simp add: min_p_min)
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))

goal (1 subgoal):
 1. priority (the (find_min xs)) = the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))
[PROOF STEP]
with \<open>min xs \<noteq> None\<close>
[PROOF STATE]
proof (chain)
picking this:
Binomial_Queue.min xs \<noteq> None
Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Binomial_Queue.min xs \<noteq> None
Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))

goal (1 subgoal):
 1. priority (the (find_min xs)) = the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))
[PROOF STEP]
by (auto simp add: min_eq_find_min_Some)
[PROOF STATE]
proof (state)
this:
priority (the (find_min xs)) = the (PQ.priority (pqueue xs) (PQ.min (pqueue xs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zip_eq_conv:
  "length xs = length ys \<Longrightarrow> zip xs ys = zs \<longleftrightarrow> map fst zs = xs \<and> map snd zs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> (zip xs ys = zs) = (map fst zs = xs \<and> map snd zs = ys)
[PROOF STEP]
by (auto simp add: zip_map_fst_snd)


[STATEMENT]
lemma limsup_root_limit:
  assumes "(\<lambda>n. ereal (root n (norm (f n)))) \<longlonglongrightarrow> l" (is "?g \<longlonglongrightarrow> _")
  shows   "limsup (\<lambda>n. ereal (root n (norm (f n)))) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ereal (root n (norm (f n)))) \<longlonglongrightarrow> l
[PROOF STEP]
have "convergent ?g" "lim ?g = l"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (root n (norm (f n)))) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. convergent (\<lambda>n. ereal (root n (norm (f n)))) &&& lim (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
unfolding convergent_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ereal (root n (norm (f n)))) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. \<exists>L. (\<lambda>n. ereal (root n (norm (f n)))) \<longlonglongrightarrow> L &&& lim (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
by (blast intro: limI)+
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. ereal (root n (norm (f n))))
lim (\<lambda>n. ereal (root n (norm (f n)))) = l

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
with convergent_limsup_cl
[PROOF STATE]
proof (chain)
picking this:
convergent ?X \<Longrightarrow> limsup ?X = lim ?X
convergent (\<lambda>n. ereal (root n (norm (f n))))
lim (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
convergent ?X \<Longrightarrow> limsup ?X = lim ?X
convergent (\<lambda>n. ereal (root n (norm (f n))))
lim (\<lambda>n. ereal (root n (norm (f n)))) = l

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (f n)))) = l
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. ereal (root n (norm (f n)))) = l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_ran:
  assumes "countable (dom f)"
  shows "countable (ran f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (ran f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (ran f)
[PROOF STEP]
have "countable (map_graph f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (map_graph f)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
countable (map_graph f)

goal (1 subgoal):
 1. countable (ran f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
countable (map_graph f)
[PROOF STEP]
have "countable (Range(map_graph f))"
[PROOF STATE]
proof (prove)
using this:
countable (map_graph f)

goal (1 subgoal):
 1. countable (Range (map_graph f))
[PROOF STEP]
by (simp add: Range_snd)
[PROOF STATE]
proof (state)
this:
countable (Range (map_graph f))

goal (1 subgoal):
 1. countable (ran f)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
countable (Range (map_graph f))

goal (1 subgoal):
 1. countable (ran f)
[PROOF STEP]
by (simp add: ran_map_graph)
[PROOF STATE]
proof (state)
this:
countable (ran f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma non_distinct_duplicate_indices :
  assumes "\<not> distinct xs"
shows "\<exists> i1 i2 . i1 \<noteq> i2 \<and> xs ! i1 = xs ! i2 \<and> i1 \<le> length xs \<and> i2 \<le> length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i1 i2. i1 \<noteq> i2 \<and> xs ! i1 = xs ! i2 \<and> i1 \<le> length xs \<and> i2 \<le> length xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> distinct xs

goal (1 subgoal):
 1. \<exists>i1 i2. i1 \<noteq> i2 \<and> xs ! i1 = xs ! i2 \<and> i1 \<le> length xs \<and> i2 \<le> length xs
[PROOF STEP]
by (meson distinct_conv_nth less_imp_le)


[STATEMENT]
lemma size_Un_disjoint: "A \<inter># B = {#} \<Longrightarrow> size (A \<union># B) = size A + size B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter># B = {#} \<Longrightarrow> size (A \<union># B) = size A + size B
[PROOF STEP]
using size_Un_Int[of A B]
[PROOF STATE]
proof (prove)
using this:
size A + size B = size (A \<union># B) + size (A \<inter># B)

goal (1 subgoal):
 1. A \<inter># B = {#} \<Longrightarrow> size (A \<union># B) = size A + size B
[PROOF STEP]
by simp


[STATEMENT]
lemma bl_xor_bin: "map2 (\<noteq>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v XOR w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<noteq>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v XOR w)
[PROOF STEP]
using bl_xor_aux_bin
[PROOF STATE]
proof (prove)
using this:
map2 (\<noteq>) (bin_to_bl_aux ?n ?v ?bs) (bin_to_bl_aux ?n ?w ?cs) = bin_to_bl_aux ?n (?v XOR ?w) (map2 (\<noteq>) ?bs ?cs)

goal (1 subgoal):
 1. map2 (\<noteq>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v XOR w)
[PROOF STEP]
by (simp add: bin_to_bl_def)


[STATEMENT]
lemma abs_linorder_cases[case_names less eq greater]:
  assumes "\<bar>a\<bar> < \<bar>b\<bar> \<Longrightarrow> thesis" and "\<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> thesis" and "\<bar>b\<bar> < \<bar>a\<bar> \<Longrightarrow> thesis"
  shows thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (cases rule: nonneg_linorder_cases[of "\<bar>a\<bar>" "\<bar>b\<bar>"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (0::'a) \<le> \<bar>a\<bar>
 2. (0::'a) \<le> \<bar>b\<bar>
 3. \<bar>a\<bar> < \<bar>b\<bar> \<Longrightarrow> thesis
 4. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> thesis
 5. \<bar>b\<bar> < \<bar>a\<bar> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> < \<bar>b\<bar> \<Longrightarrow> thesis
\<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> thesis
\<bar>b\<bar> < \<bar>a\<bar> \<Longrightarrow> thesis

goal (5 subgoals):
 1. (0::'a) \<le> \<bar>a\<bar>
 2. (0::'a) \<le> \<bar>b\<bar>
 3. \<bar>a\<bar> < \<bar>b\<bar> \<Longrightarrow> thesis
 4. \<bar>a\<bar> = \<bar>b\<bar> \<Longrightarrow> thesis
 5. \<bar>b\<bar> < \<bar>a\<bar> \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma dvd_associated1:
  fixes a::"'a::comm_ring_1"
  assumes "\<exists>u. u dvd 1 \<and> a = u*b"
  shows "a dvd b \<and> b dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd b \<and> b dvd a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>u. u dvd (1::'a) \<and> a = u * b

goal (1 subgoal):
 1. a dvd b \<and> b dvd a
[PROOF STEP]
by auto


[STATEMENT]
lemma in_spanI[intro]:
  assumes "v = lincomb a A" "finite A" "A \<subseteq> W"
  shows "v \<in> span W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> local.span W
[PROOF STEP]
unfolding span_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> {lincomb a A |a A. finite A \<and> A \<subseteq> W}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v = lincomb a A
finite A
A \<subseteq> W

goal (1 subgoal):
 1. v \<in> {lincomb a A |a A. finite A \<and> A \<subseteq> W}
[PROOF STEP]
by auto


[STATEMENT]
lemma hermitian_mat_conj:
  assumes "A\<in> carrier_mat n n"
  and "U \<in> carrier_mat n n"
  and "hermitian A"
shows "hermitian (mat_conj U A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
have "Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) =
    U * Complex_Matrix.adjoint (U * A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * Complex_Matrix.adjoint (U * A)
[PROOF STEP]
by (metis (no_types, lifting) Complex_Matrix.adjoint_adjoint adjoint_dim'
        adjoint_mult assms(1) assms(2) mult_carrier_mat)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * Complex_Matrix.adjoint (U * A)

goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * Complex_Matrix.adjoint (U * A)

goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
have "... = U * ((Complex_Matrix.adjoint A) *  Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * Complex_Matrix.adjoint (U * A) = U * (Complex_Matrix.adjoint A * Complex_Matrix.adjoint U)
[PROOF STEP]
by (metis adjoint_mult assms(1) assms(2))
[PROOF STATE]
proof (state)
this:
U * Complex_Matrix.adjoint (U * A) = U * (Complex_Matrix.adjoint A * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
U * Complex_Matrix.adjoint (U * A) = U * (Complex_Matrix.adjoint A * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
have "... = U * A * Complex_Matrix.adjoint U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * (Complex_Matrix.adjoint A * Complex_Matrix.adjoint U) = U * A * Complex_Matrix.adjoint U
[PROOF STEP]
by (metis adjoint_dim' assms assoc_mult_mat hermitian_def)
[PROOF STATE]
proof (state)
this:
U * (Complex_Matrix.adjoint A * Complex_Matrix.adjoint U) = U * A * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * A * Complex_Matrix.adjoint U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * A * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. hermitian (mat_conj U A)
[PROOF STEP]
unfolding hermitian_def mat_conj_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * A * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. Complex_Matrix.adjoint (U * A * Complex_Matrix.adjoint U) = U * A * Complex_Matrix.adjoint U
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
hermitian (mat_conj U A)

goal:
No subgoals!
[PROOF STEP]
qed