[STATEMENT]
lemma totient_divisor_sum: "(\<Sum>d | d dvd n. totient d) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
hence "n > 0"
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

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

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
define A where "A = (\<lambda>d. {k\<in>{0<..n}. gcd k n = d})"
[PROOF STATE]
proof (state)
this:
A = (\<lambda>d. {k \<in> {0<..n}. gcd k n = d})

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
have *: "card (A d) = totient (n div d)" if d: "d dvd n" for d
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A d) = totient (n div d)
[PROOF STEP]
using \<open>n > 0\<close> and d
[PROOF STATE]
proof (prove)
using this:
0 < n
d dvd n

goal (1 subgoal):
 1. card (A d) = totient (n div d)
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
0 < n
d dvd n

goal (1 subgoal):
 1. card {k \<in> {0<..n}. gcd k n = d} = totient (n div d)
[PROOF STEP]
by (rule card_gcd_eq_totient)
[PROOF STATE]
proof (state)
this:
?d dvd n \<Longrightarrow> card (A ?d) = totient (n div ?d)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
have "n = card {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = card {1..n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n = card {1..n}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n = card {1..n}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
have "{1..n} = (\<Union>d\<in>{d. d dvd n}. A d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..n} = \<Union> (A ` {d. d dvd n})
[PROOF STEP]
by safe (auto simp: A_def)
[PROOF STATE]
proof (state)
this:
{1..n} = \<Union> (A ` {d. d dvd n})

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{1..n} = \<Union> (A ` {d. d dvd n})

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
have "card \<dots> = (\<Sum>d | d dvd n. card (A d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> (A ` {d. d dvd n})) = (\<Sum>d | d dvd n. card (A d))
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. card (\<Union> (A ` {d. d dvd n})) = (\<Sum>d | d dvd n. card (A d))
[PROOF STEP]
by (intro card_UN_disjoint) (auto simp: A_def)
[PROOF STATE]
proof (state)
this:
card (\<Union> (A ` {d. d dvd n})) = (\<Sum>d | d dvd n. card (A d))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (\<Union> (A ` {d. d dvd n})) = (\<Sum>d | d dvd n. card (A d))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
have "\<dots> = (\<Sum>d | d dvd n. totient (n div d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. card (A d)) = (\<Sum>d | d dvd n. totient (n div d))
[PROOF STEP]
by (intro sum.cong refl *) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. card (A d)) = (\<Sum>d | d dvd n. totient (n div d))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. card (A d)) = (\<Sum>d | d dvd n. totient (n div d))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
have "\<dots> = (\<Sum>d | d dvd n. totient d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. totient (n div d)) = (\<Sum>d | d dvd n. totient d)
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. totient (n div d)) = (\<Sum>d | d dvd n. totient d)
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "(div) n" "(div) n"]) (auto elim: dvdE)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. totient (n div d)) = (\<Sum>d | d dvd n. totient d)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
 2. n \<noteq> 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n = (\<Sum>d | d dvd n. totient d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = (\<Sum>d | d dvd n. totient d)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. totient d) = n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> (\<Sum>d | d dvd n. totient d) = n
[PROOF STEP]
qed auto


[STATEMENT]
lemma in_monomials_iff: "x \<in> monomials m \<longleftrightarrow> MPoly_Type.coeff m x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> monomials m) = (MPoly_Type.coeff m x \<noteq> (0::'a))
[PROOF STEP]
using coeff_eq_zero_iff[of m x]
[PROOF STATE]
proof (prove)
using this:
(MPoly_Type.coeff m x = (0::'a)) = (x \<notin> monomials m)

goal (1 subgoal):
 1. (x \<in> monomials m) = (MPoly_Type.coeff m x \<noteq> (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma All_surj_conv' [reversal_rule]: assumes "surj f" shows "All (P o f) = All P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. All (P \<circ> f) = All P
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P (f x)) = All P
[PROOF STEP]
using All_surj_conv[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<forall>x. ?P (f x)) = (\<forall>y. ?P y)

goal (1 subgoal):
 1. (\<forall>x. P (f x)) = All P
[PROOF STEP]
.

  \<comment> \<open>\<^const>\<open>Ex\<close>\<close>


[STATEMENT]
lemma linord_of_list_trans:
  assumes "distinct xs"
  shows "trans (linord_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (linord_of_list xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. trans (linord_of_list xs)
[PROOF STEP]
unfolding linord_of_list_def
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. trans {(x, y). linord_of_listP x y xs}
[PROOF STEP]
by (induct xs) (auto intro!: transI dest: linord_of_listP_domain elim: transE)


[STATEMENT]
lemma matchers_set_zip [simp]:
  assumes "length ss = length ts"
  shows "matchers (set (zip ss ts)) = {\<sigma>. map (\<lambda>t. t \<cdot> \<sigma>) ss = ts}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matchers (set (zip ss ts)) = {\<sigma>. map (\<lambda>t. t \<cdot> \<sigma>) ss = ts}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length ss = length ts

goal (1 subgoal):
 1. matchers (set (zip ss ts)) = {\<sigma>. map (\<lambda>t. t \<cdot> \<sigma>) ss = ts}
[PROOF STEP]
by (induct ss ts rule: list_induct2) auto


[STATEMENT]
lemma hyp_inverse_unique:
  fixes a b :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  assumes "a * b = 1"
  shows "b = inverse a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = inverse a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b = inverse a
[PROOF STEP]
have "Base a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Base a \<noteq> (0::'a)
[PROOF STEP]
using assms one_hyperdual_def of_comp_simps zero_neq_one hyp_base_mult_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
a * b = 1
1 = of_comp (1::?'a)
Base (of_comp ?a) = ?a
Eps1 (of_comp ?a) = (0::?'a)
Eps2 (of_comp ?a) = (0::?'a)
Eps12 (of_comp ?a) = (0::?'a)
(0::?'a) \<noteq> (1::?'a)
(Base (?a * ?b) = (0::?'a)) = (Base ?a = (0::?'a) \<or> Base ?b = (0::?'a))

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

goal (1 subgoal):
 1. b = inverse a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Base a \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Base a \<noteq> (0::'a)

goal (1 subgoal):
 1. b = inverse a
[PROOF STEP]
by (metis assms hyp_right_inverse mult.left_commute mult.right_neutral)
[PROOF STATE]
proof (state)
this:
b = inverse a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_norm_le_sq_norm:
  fixes f ::  "'a :: conjugatable_ring_1_abs_real_line poly"
shows "\<parallel>f\<parallel>\<^sub>\<infinity>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sub>\<infinity>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sub>\<infinity>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
from max_norm_witness[of f]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i. \<parallel>f\<parallel>\<^sub>\<infinity> = \<bar>coeff f i\<bar>
[PROOF STEP]
obtain i where id: "\<parallel>f\<parallel>\<^sub>\<infinity> = \<bar>coeff f i\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<exists>i. \<parallel>f\<parallel>\<^sub>\<infinity> = \<bar>coeff f i\<bar>

goal (1 subgoal):
 1. (\<And>i. \<parallel>f\<parallel>\<^sub>\<infinity> = \<bar>coeff f i\<bar> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<^sub>\<infinity> = \<bar>coeff f i\<bar>

goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sub>\<infinity>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>f\<parallel>\<^sub>\<infinity>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>coeff f i\<bar>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
using coeff_le_sq_norm[of f i]
[PROOF STATE]
proof (prove)
using this:
\<bar>coeff f i\<bar>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2

goal (1 subgoal):
 1. \<bar>coeff f i\<bar>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<parallel>f\<parallel>\<^sub>\<infinity>\<^sup>2 \<le> \<parallel>f\<parallel>\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_monoid_set) permute:
  assumes "p permutes S"
  shows "F g S = F (g \<circ> p) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
from \<open>p permutes S\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes S
[PROOF STEP]
have "inj p"
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. inj p
[PROOF STEP]
by (rule permutes_inj)
[PROOF STATE]
proof (state)
this:
inj p

goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj p
[PROOF STEP]
have "inj_on p S"
[PROOF STATE]
proof (prove)
using this:
inj p

goal (1 subgoal):
 1. inj_on p S
[PROOF STEP]
by (auto intro: subset_inj_on)
[PROOF STATE]
proof (state)
this:
inj_on p S

goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on p S
[PROOF STEP]
have "F g (p ` S) = F (g \<circ> p) S"
[PROOF STATE]
proof (prove)
using this:
inj_on p S

goal (1 subgoal):
 1. F g (p ` S) = F (g \<circ> p) S
[PROOF STEP]
by (rule reindex)
[PROOF STATE]
proof (state)
this:
F g (p ` S) = F (g \<circ> p) S

goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
F g (p ` S) = F (g \<circ> p) S

goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
from \<open>p permutes S\<close>
[PROOF STATE]
proof (chain)
picking this:
p permutes S
[PROOF STEP]
have "p ` S = S"
[PROOF STATE]
proof (prove)
using this:
p permutes S

goal (1 subgoal):
 1. p ` S = S
[PROOF STEP]
by (rule permutes_image)
[PROOF STATE]
proof (state)
this:
p ` S = S

goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
F g (p ` S) = F (g \<circ> p) S
p ` S = S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
F g (p ` S) = F (g \<circ> p) S
p ` S = S

goal (1 subgoal):
 1. F g S = F (g \<circ> p) S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
F g S = F (g \<circ> p) S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem app_eq1: "\<And>ys zs. zs = xs @ ys \<Longrightarrow> app xs ys zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys zs. zs = xs @ ys \<Longrightarrow> app xs ys zs
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys zs. zs = [] @ ys \<Longrightarrow> app [] ys zs
 2. \<And>a xs ys zs. \<lbrakk>\<And>ys zs. zs = xs @ ys \<Longrightarrow> app xs ys zs; zs = (a # xs) @ ys\<rbrakk> \<Longrightarrow> app (a # xs) ys zs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys. app [] ys ys
 2. \<And>a xs ys zs. \<lbrakk>\<And>ys zs. zs = xs @ ys \<Longrightarrow> app xs ys zs; zs = (a # xs) @ ys\<rbrakk> \<Longrightarrow> app (a # xs) ys zs
[PROOF STEP]
apply (rule app.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs ys zs. \<lbrakk>\<And>ys zs. zs = xs @ ys \<Longrightarrow> app xs ys zs; zs = (a # xs) @ ys\<rbrakk> \<Longrightarrow> app (a # xs) ys zs
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs ys zs. \<lbrakk>\<And>ys. app xs ys (xs @ ys); zs = a # xs @ ys\<rbrakk> \<Longrightarrow> app (a # xs) ys (a # xs @ ys)
[PROOF STEP]
apply (iprover intro: app.intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma H_values:
  fixes i j:: nat
  assumes "i < dim_row H" and "j < dim_col H" and "i \<noteq> 1 \<or> j \<noteq> 1"
  shows "H $$ (i,j) = 1/sqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
have "i < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < 2
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
i < dim_row H

goal (1 subgoal):
 1. i < 2
[PROOF STEP]
by (simp add: H_without_scalar_prod less_2_cases)
[PROOF STATE]
proof (state)
this:
i < 2

goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < 2

goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
have "j < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j < 2
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
j < dim_col H

goal (1 subgoal):
 1. j < 2
[PROOF STEP]
by (simp add: H_without_scalar_prod less_2_cases)
[PROOF STATE]
proof (state)
this:
j < 2

goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i < 2
j < 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < 2
j < 2

goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
using assms(3) H_without_scalar_prod
[PROOF STATE]
proof (prove)
using this:
i < 2
j < 2
i \<noteq> 1 \<or> j \<noteq> 1
H = mat 2 2 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if i \<noteq> j then 1 / sqrt 2 else if i = 0 then 1 / sqrt 2 else - (1 / sqrt 2)))

goal (1 subgoal):
 1. H $$ (i, j) = complex_of_real (1 / sqrt 2)
[PROOF STEP]
by(smt One_nat_def index_mat(1) less_2_cases old.prod.case)
[PROOF STATE]
proof (state)
this:
H $$ (i, j) = complex_of_real (1 / sqrt 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma at_map_compl_pres: "at_map \<circ> uminus = uminus \<circ> at_map"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_map \<circ> uminus = uminus \<circ> at_map
[PROOF STEP]
unfolding fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (at_map \<circ> uminus) x = (uminus \<circ> at_map) x
[PROOF STEP]
by (simp add: Abs_atoms_inverse at_map_def atom_map_compl_pres uminus_atoms.abs_eq)


[STATEMENT]
lemma dvd_dvd_imp_smult:
  fixes p q :: "'a :: idom poly"
  assumes pq: "p dvd q" and qp: "q dvd p" shows "\<exists>c. p = smult c q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. p = smult c q
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> \<exists>c. p = smult c q
 2. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> \<exists>c. p = smult c q
 2. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. \<exists>c. p = smult c q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c. p = smult c q

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
from qp
[PROOF STATE]
proof (chain)
picking this:
q dvd p
[PROOF STEP]
obtain r where r: "p = q * r"
[PROOF STATE]
proof (prove)
using this:
q dvd p

goal (1 subgoal):
 1. (\<And>r. p = q * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim dvdE, auto)
[PROOF STATE]
proof (state)
this:
p = q * r

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
with False qp
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
q dvd p
p = q * r
[PROOF STEP]
have r0: "r \<noteq> 0" and q0: "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
q dvd p
p = q * r

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

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
with divides_degree[OF pq] divides_degree[OF qp] False
[PROOF STATE]
proof (chain)
picking this:
degree p \<le> degree q \<or> q = 0
degree q \<le> degree p \<or> p = 0
p \<noteq> 0
r \<noteq> 0
q \<noteq> 0
[PROOF STEP]
have "degree p = degree q"
[PROOF STATE]
proof (prove)
using this:
degree p \<le> degree q \<or> q = 0
degree q \<le> degree p \<or> p = 0
p \<noteq> 0
r \<noteq> 0
q \<noteq> 0

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

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
with r degree_mult_eq[OF q0 r0]
[PROOF STATE]
proof (chain)
picking this:
p = q * r
degree (q * r) = degree q + degree r
degree p = degree q
[PROOF STEP]
have "degree r = 0"
[PROOF STATE]
proof (prove)
using this:
p = q * r
degree (q * r) = degree q + degree r
degree p = degree q

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

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
from degree_0_id[OF this]
[PROOF STATE]
proof (chain)
picking this:
[:coeff r 0:] = r
[PROOF STEP]
obtain c where "r = [:c:]"
[PROOF STATE]
proof (prove)
using this:
[:coeff r 0:] = r

goal (1 subgoal):
 1. (\<And>c. r = [:c:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
r = [:c:]

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> \<exists>c. p = smult c q
[PROOF STEP]
from r[unfolded this]
[PROOF STATE]
proof (chain)
picking this:
p = q * [:c:]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = q * [:c:]

goal (1 subgoal):
 1. \<exists>c. p = smult c q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>c. p = smult c q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_insort_key: assumes [simp]: "\<And> x y. g1 x \<le> g1 y \<longleftrightarrow> g2 (f x) \<le> g2 (f y)"
  shows "map f (insort_key g1 a xs) = insort_key g2 (f a) (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (insort_key g1 a xs) = insort_key g2 (f a) (map f xs)
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma QR_lemma_14: "(-1::int) ^ (m + n) = (-1) ^ r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ (m + n) = (- 1) ^ r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- 1) ^ (m + n) = (- 1) ^ r
[PROOF STEP]
have "m + n + 2 * d = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m + n + 2 * d = r
[PROOF STEP]
using QR_lemma_06 QR_lemma_10 QR_lemma_12 QR_lemma_13
[PROOF STATE]
proof (prove)
using this:
b + c = r
a = c
b + d + m = r
a + d + n = r

goal (1 subgoal):
 1. m + n + 2 * d = r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m + n + 2 * d = r

goal (1 subgoal):
 1. (- 1) ^ (m + n) = (- 1) ^ r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m + n + 2 * d = r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m + n + 2 * d = r

goal (1 subgoal):
 1. (- 1) ^ (m + n) = (- 1) ^ r
[PROOF STEP]
using power_add[of "-1::int" "m + n" "2 * d"]
[PROOF STATE]
proof (prove)
using this:
m + n + 2 * d = r
(- 1) ^ (m + n + 2 * d) = (- 1) ^ (m + n) * (- 1) ^ (2 * d)

goal (1 subgoal):
 1. (- 1) ^ (m + n) = (- 1) ^ r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(- 1) ^ (m + n) = (- 1) ^ r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem initial_objs_isomorphic:
    assumes "initial a" and "initial b"
    shows "isomorphic a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
initial a
initial b
[PROOF STEP]
obtain f where f: "\<guillemotleft>f : a \<rightarrow> b\<guillemotright>"
[PROOF STATE]
proof (prove)
using this:
initial a
initial b

goal (1 subgoal):
 1. (\<And>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using initial_def
[PROOF STATE]
proof (prove)
using this:
initial a
initial b
initial ?a \<equiv> ide ?a \<and> (\<forall>b. ide b \<longrightarrow> (\<exists>!f. \<guillemotleft>f : ?a \<rightarrow> b\<guillemotright>))

goal (1 subgoal):
 1. (\<And>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<guillemotleft>f : a \<rightarrow> b\<guillemotright>

goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
initial a
initial b
[PROOF STEP]
obtain g where g: "\<guillemotleft>g : b \<rightarrow> a\<guillemotright>"
[PROOF STATE]
proof (prove)
using this:
initial a
initial b

goal (1 subgoal):
 1. (\<And>g. \<guillemotleft>g : b \<rightarrow> a\<guillemotright> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using initial_def
[PROOF STATE]
proof (prove)
using this:
initial a
initial b
initial ?a \<equiv> ide ?a \<and> (\<forall>b. ide b \<longrightarrow> (\<exists>!f. \<guillemotleft>f : ?a \<rightarrow> b\<guillemotright>))

goal (1 subgoal):
 1. (\<And>g. \<guillemotleft>g : b \<rightarrow> a\<guillemotright> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<guillemotleft>g : b \<rightarrow> a\<guillemotright>

goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
have "iso f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.iso f
[PROOF STEP]
using assms f g
[PROOF STATE]
proof (prove)
using this:
initial a
initial b
\<guillemotleft>f : a \<rightarrow> b\<guillemotright>
\<guillemotleft>g : b \<rightarrow> a\<guillemotright>

goal (1 subgoal):
 1. local.iso f
[PROOF STEP]
by (metis (no_types, lifting) arr_iff_in_hom cod_comp in_homE initial_def
            retractionI sectionI dom_comp iso_iff_section_and_retraction ide_in_hom seqI')
[PROOF STATE]
proof (state)
this:
local.iso f

goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
local.iso f

goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
local.iso f
\<guillemotleft>f : a \<rightarrow> b\<guillemotright>

goal (1 subgoal):
 1. isomorphic a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isomorphic a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_Max:
  "l \<noteq> [] \<Longrightarrow>
   sorted l \<Longrightarrow>
   Max (set l) = hd (rev l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l)
[PROOF STEP]
proof(induct l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []\<rbrakk> \<Longrightarrow> Max (set []) = hd (rev [])
 2. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l); a # l \<noteq> []; sorted (a # l)\<rbrakk> \<Longrightarrow> Max (set (a # l)) = hd (rev (a # l))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
[] \<noteq> []
sorted []

goal (2 subgoals):
 1. \<lbrakk>[] \<noteq> []; sorted []\<rbrakk> \<Longrightarrow> Max (set []) = hd (rev [])
 2. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l); a # l \<noteq> []; sorted (a # l)\<rbrakk> \<Longrightarrow> Max (set (a # l)) = hd (rev (a # l))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[] \<noteq> []
sorted []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
[] \<noteq> []
sorted []

goal (1 subgoal):
 1. Max (set []) = hd (rev [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Max (set []) = hd (rev [])

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l); a # l \<noteq> []; sorted (a # l)\<rbrakk> \<Longrightarrow> Max (set (a # l)) = hd (rev (a # l))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l); a # l \<noteq> []; sorted (a # l)\<rbrakk> \<Longrightarrow> Max (set (a # l)) = hd (rev (a # l))
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l)
a # l \<noteq> []
sorted (a # l)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l); a # l \<noteq> []; sorted (a # l)\<rbrakk> \<Longrightarrow> Max (set (a # l)) = hd (rev (a # l))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l)
a # l \<noteq> []
sorted (a # l)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l \<noteq> []; sorted l\<rbrakk> \<Longrightarrow> Max (set l) = hd (rev l)
a # l \<noteq> []
sorted (a # l)

goal (1 subgoal):
 1. Max (set (a # l)) = hd (rev (a # l))
[PROOF STEP]
by (metis sorted_Max_Cons Max_singleton hd_rev last.simps list.set(1) list.simps(15) sorted_simps(2))
[PROOF STATE]
proof (state)
this:
Max (set (a # l)) = hd (rev (a # l))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_joinR:
  "inorder(joinR l x r) = inorder l @ x # inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (joinR l x r) = Tree2.inorder l @ x # Tree2.inorder r
[PROOF STEP]
proof(induction l x r rule: joinR.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>l x r. \<lbrakk>\<And>x21 x22 x23 xa y. \<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>x21, x22, x23\<rangle>; (xa, y) = x22; y = Red\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR x23 x r) = Tree2.inorder x23 @ x # Tree2.inorder r; \<And>x21 x22 x23 xa y. \<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>x21, x22, x23\<rangle>; (xa, y) = x22; y = Black\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR x23 x r) = Tree2.inorder x23 @ x # Tree2.inorder r\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR l x r) = Tree2.inorder l @ x # Tree2.inorder r
[PROOF STEP]
case (1 l x r)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>?x21.0, ?x22.0, ?x23.0\<rangle>; (?xa, ?y) = ?x22.0; ?y = Red\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR ?x23.0 x r) = Tree2.inorder ?x23.0 @ x # Tree2.inorder r
\<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>?x21.0, ?x22.0, ?x23.0\<rangle>; (?xa, ?y) = ?x22.0; ?y = Black\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR ?x23.0 x r) = Tree2.inorder ?x23.0 @ x # Tree2.inorder r

goal (1 subgoal):
 1. \<And>l x r. \<lbrakk>\<And>x21 x22 x23 xa y. \<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>x21, x22, x23\<rangle>; (xa, y) = x22; y = Red\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR x23 x r) = Tree2.inorder x23 @ x # Tree2.inorder r; \<And>x21 x22 x23 xa y. \<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>x21, x22, x23\<rangle>; (xa, y) = x22; y = Black\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR x23 x r) = Tree2.inorder x23 @ x # Tree2.inorder r\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR l x r) = Tree2.inorder l @ x # Tree2.inorder r
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>?x21.0, ?x22.0, ?x23.0\<rangle>; (?xa, ?y) = ?x22.0; ?y = Red\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR ?x23.0 x r) = Tree2.inorder ?x23.0 @ x # Tree2.inorder r
\<lbrakk>\<not> bheight l \<le> bheight r; l = \<langle>?x21.0, ?x22.0, ?x23.0\<rangle>; (?xa, ?y) = ?x22.0; ?y = Black\<rbrakk> \<Longrightarrow> Tree2.inorder (joinR ?x23.0 x r) = Tree2.inorder ?x23.0 @ x # Tree2.inorder r

goal (1 subgoal):
 1. Tree2.inorder (joinR l x r) = Tree2.inorder l @ x # Tree2.inorder r
[PROOF STEP]
by (force simp: inorder_baliR joinR.simps[of l x r] split!: tree.splits color.splits)
[PROOF STATE]
proof (state)
this:
Tree2.inorder (joinR l x r) = Tree2.inorder l @ x # Tree2.inorder r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hermitian_smult:
  fixes a::real
  fixes A::"complex Matrix.mat"
  assumes "A \<in> carrier_mat n n"
and "hermitian A"
shows "hermitian (a \<cdot>\<^sub>m  A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
have dim: "Complex_Matrix.adjoint A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint A \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
hermitian A

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

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint A \<in> carrier_mat n n

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
assume "i < n" and "j < n"
[PROOF STATE]
proof (state)
this:
i < n
j < n

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
hence "Complex_Matrix.adjoint (a \<cdot>\<^sub>m A) $$ (i,j) = a * (Complex_Matrix.adjoint A $$ (i,j))"
[PROOF STATE]
proof (prove)
using this:
i < n
j < n

goal (1 subgoal):
 1. Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = complex_of_real a * Complex_Matrix.adjoint A $$ (i, j)
[PROOF STEP]
using adjoint_scale[of a A] assms
[PROOF STATE]
proof (prove)
using this:
i < n
j < n
Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) = conjugate (complex_of_real a) \<cdot>\<^sub>m Complex_Matrix.adjoint A
A \<in> carrier_mat n n
hermitian A

goal (1 subgoal):
 1. Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = complex_of_real a * Complex_Matrix.adjoint A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = complex_of_real a * Complex_Matrix.adjoint A $$ (i, j)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = complex_of_real a * Complex_Matrix.adjoint A $$ (i, j)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
have "... = a * (A $$ (i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real a * Complex_Matrix.adjoint A $$ (i, j) = complex_of_real a * A $$ (i, j)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
hermitian A

goal (1 subgoal):
 1. complex_of_real a * Complex_Matrix.adjoint A $$ (i, j) = complex_of_real a * A $$ (i, j)
[PROOF STEP]
unfolding hermitian_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
Complex_Matrix.adjoint A = A

goal (1 subgoal):
 1. complex_of_real a * Complex_Matrix.adjoint A $$ (i, j) = complex_of_real a * A $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real a * Complex_Matrix.adjoint A $$ (i, j) = complex_of_real a * A $$ (i, j)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real a * Complex_Matrix.adjoint A $$ (i, j) = complex_of_real a * A $$ (i, j)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
have "... = (a \<cdot>\<^sub>m A) $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real a * A $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
using \<open>i < n\<close> \<open>j < n\<close> assms
[PROOF STATE]
proof (prove)
using this:
i < n
j < n
A \<in> carrier_mat n n
hermitian A

goal (1 subgoal):
 1. complex_of_real a * A $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real a * A $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
have "Complex_Matrix.adjoint (a \<cdot>\<^sub>m A) $$ (i,j) = (a \<cdot>\<^sub>m A) $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j) = (complex_of_real a \<cdot>\<^sub>m A) $$ (i, j)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2) = (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2) = (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2)

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
using dim assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2) = (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2)
Complex_Matrix.adjoint A \<in> carrier_mat n n
A \<in> carrier_mat n n
hermitian A

goal (1 subgoal):
 1. hermitian (complex_of_real a \<cdot>\<^sub>m A)
[PROOF STEP]
unfolding hermitian_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2) = (complex_of_real a \<cdot>\<^sub>m A) $$ (?i2, ?j2)
Complex_Matrix.adjoint A \<in> carrier_mat n n
A \<in> carrier_mat n n
Complex_Matrix.adjoint A = A

goal (1 subgoal):
 1. Complex_Matrix.adjoint (complex_of_real a \<cdot>\<^sub>m A) = complex_of_real a \<cdot>\<^sub>m A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hermitian (complex_of_real a \<cdot>\<^sub>m A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_direct_decomp:
  assumes "direct_decomp A ss" and "finite B" and "A \<subseteq> span B" and "\<And>s. s \<in> set ss \<Longrightarrow> subspace s"
  shows "dim A = (\<Sum>s\<in>set ss. dim s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
from assms(1, 4)
[PROOF STATE]
proof (chain)
picking this:
direct_decomp A ss
?s \<in> set ss \<Longrightarrow> local.subspace ?s
[PROOF STEP]
have "is_basis A (\<Union>(some_basis ` set ss))"
    (is "is_basis A ?B")
[PROOF STATE]
proof (prove)
using this:
direct_decomp A ss
?s \<in> set ss \<Longrightarrow> local.subspace ?s

goal (1 subgoal):
 1. is_basis A (\<Union> (some_basis ` set ss))
[PROOF STEP]
by (rule direct_decomp_is_basis)
[PROOF STATE]
proof (state)
this:
is_basis A (\<Union> (some_basis ` set ss))

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
hence "dim A = card ?B" and "independent ?B" and "?B \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
is_basis A (\<Union> (some_basis ` set ss))

goal (1 subgoal):
 1. local.dim A = card (\<Union> (some_basis ` set ss)) &&& local.independent (\<Union> (some_basis ` set ss)) &&& \<Union> (some_basis ` set ss) \<subseteq> A
[PROOF STEP]
by (simp_all add: is_basis_def)
[PROOF STATE]
proof (state)
this:
local.dim A = card (\<Union> (some_basis ` set ss))
local.independent (\<Union> (some_basis ` set ss))
\<Union> (some_basis ` set ss) \<subseteq> A

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
from this(3) assms(3)
[PROOF STATE]
proof (chain)
picking this:
\<Union> (some_basis ` set ss) \<subseteq> A
A \<subseteq> local.span B
[PROOF STEP]
have "?B \<subseteq> span B"
[PROOF STATE]
proof (prove)
using this:
\<Union> (some_basis ` set ss) \<subseteq> A
A \<subseteq> local.span B

goal (1 subgoal):
 1. \<Union> (some_basis ` set ss) \<subseteq> local.span B
[PROOF STEP]
by (rule subset_trans)
[PROOF STATE]
proof (state)
this:
\<Union> (some_basis ` set ss) \<subseteq> local.span B

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
with assms(2) \<open>independent ?B\<close>
[PROOF STATE]
proof (chain)
picking this:
finite B
local.independent (\<Union> (some_basis ` set ss))
\<Union> (some_basis ` set ss) \<subseteq> local.span B
[PROOF STEP]
have "finite ?B"
[PROOF STATE]
proof (prove)
using this:
finite B
local.independent (\<Union> (some_basis ` set ss))
\<Union> (some_basis ` set ss) \<subseteq> local.span B

goal (1 subgoal):
 1. finite (\<Union> (some_basis ` set ss))
[PROOF STEP]
using independent_span_bound
[PROOF STATE]
proof (prove)
using this:
finite B
local.independent (\<Union> (some_basis ` set ss))
\<Union> (some_basis ` set ss) \<subseteq> local.span B
\<lbrakk>finite ?T; local.independent ?S; ?S \<subseteq> local.span ?T\<rbrakk> \<Longrightarrow> finite ?S \<and> card ?S \<le> card ?T

goal (1 subgoal):
 1. finite (\<Union> (some_basis ` set ss))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (\<Union> (some_basis ` set ss))

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
note \<open>dim A = card ?B\<close>
[PROOF STATE]
proof (state)
this:
local.dim A = card (\<Union> (some_basis ` set ss))

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.dim A = card (\<Union> (some_basis ` set ss))

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
from finite_set
[PROOF STATE]
proof (chain)
picking this:
finite (set ?xs)
[PROOF STEP]
have "card ?B = (\<Sum>s\<in>set ss. card (some_basis s))"
[PROOF STATE]
proof (prove)
using this:
finite (set ?xs)

goal (1 subgoal):
 1. card (\<Union> (some_basis ` set ss)) = (\<Sum>s\<in>set ss. card (some_basis s))
[PROOF STEP]
proof (intro card_UN_disjoint ballI impI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss\<rbrakk> \<Longrightarrow> finite (some_basis s)
 3. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss\<rbrakk> \<Longrightarrow> finite (some_basis s)
 3. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
assume "s \<in> set ss"
[PROOF STATE]
proof (state)
this:
s \<in> set ss

goal (3 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss\<rbrakk> \<Longrightarrow> finite (some_basis s)
 3. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
with \<open>finite ?B\<close>
[PROOF STATE]
proof (chain)
picking this:
finite (\<Union> (some_basis ` set ss))
s \<in> set ss
[PROOF STEP]
show "finite (some_basis s)"
[PROOF STATE]
proof (prove)
using this:
finite (\<Union> (some_basis ` set ss))
s \<in> set ss

goal (1 subgoal):
 1. finite (some_basis s)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (some_basis s)

goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
fix s1 s2
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
have "pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)
[PROOF STEP]
using assms(1, 4)
[PROOF STATE]
proof (prove)
using this:
direct_decomp A ss
?s \<in> set ss \<Longrightarrow> local.subspace ?s

goal (1 subgoal):
 1. pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)
[PROOF STEP]
by (rule direct_decomp_some_basis_pairwise_disjnt)
[PROOF STATE]
proof (state)
this:
pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)

goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)

goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
assume "s1 \<in> set ss" and "s2 \<in> set ss" and "s1 \<noteq> s2"
[PROOF STATE]
proof (state)
this:
s1 \<in> set ss
s2 \<in> set ss
s1 \<noteq> s2

goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
thm pairwiseD
[PROOF STATE]
proof (state)
this:
s1 \<in> set ss
s2 \<in> set ss
s1 \<noteq> s2

goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)
s1 \<in> set ss
s2 \<in> set ss
s1 \<noteq> s2
[PROOF STEP]
have "disjnt (some_basis s1) (some_basis s2)"
[PROOF STATE]
proof (prove)
using this:
pairwise (\<lambda>s t. disjnt (some_basis s) (some_basis t)) (set ss)
s1 \<in> set ss
s2 \<in> set ss
s1 \<noteq> s2

goal (1 subgoal):
 1. disjnt (some_basis s1) (some_basis s2)
[PROOF STEP]
by (rule pairwiseD)
[PROOF STATE]
proof (state)
this:
disjnt (some_basis s1) (some_basis s2)

goal (2 subgoals):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
 2. \<And>s j. \<lbrakk>\<And>xs. finite (set xs); s \<in> set ss; j \<in> set ss; s \<noteq> j\<rbrakk> \<Longrightarrow> some_basis s \<inter> some_basis j = {}
[PROOF STEP]
thus "some_basis s1 \<inter> some_basis s2 = {}"
[PROOF STATE]
proof (prove)
using this:
disjnt (some_basis s1) (some_basis s2)

goal (1 subgoal):
 1. some_basis s1 \<inter> some_basis s2 = {}
[PROOF STEP]
by (simp only: disjnt_def)
[PROOF STATE]
proof (state)
this:
some_basis s1 \<inter> some_basis s2 = {}

goal (1 subgoal):
 1. (\<And>xs. finite (set xs)) \<Longrightarrow> finite (set ss)
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (\<Union> (some_basis ` set ss)) = (\<Sum>s\<in>set ss. card (some_basis s))

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (\<Union> (some_basis ` set ss)) = (\<Sum>s\<in>set ss. card (some_basis s))

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
from refl card_some_basis
[PROOF STATE]
proof (chain)
picking this:
?t = ?t
card (some_basis ?V) = local.dim ?V
[PROOF STEP]
have "\<dots> = (\<Sum>s\<in>set ss. dim s)"
[PROOF STATE]
proof (prove)
using this:
?t = ?t
card (some_basis ?V) = local.dim ?V

goal (1 subgoal):
 1. (\<Sum>s\<in>set ss. card (some_basis s)) = sum local.dim (set ss)
[PROOF STEP]
by (rule sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>s\<in>set ss. card (some_basis s)) = sum local.dim (set ss)

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.dim A = sum local.dim (set ss)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.dim A = sum local.dim (set ss)

goal (1 subgoal):
 1. local.dim A = sum local.dim (set ss)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.dim A = sum local.dim (set ss)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dlo_qe_noub[no_atp]:
  assumes ne: "L \<noteq> {}"
    and fL: "finite L"
  shows "(\<exists>x. (\<forall>y \<in> L. y < x) \<and> (\<forall>y \<in> {}. x < y)) \<equiv> True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (\<forall>y\<in>L. y < x) \<and> (\<forall>y\<in>{}. x < y) \<equiv> True
[PROOF STEP]
proof (simp add: atomize_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. \<forall>y\<in>L. y < x
[PROOF STEP]
from gt_ex[of "Max L"]
[PROOF STATE]
proof (chain)
picking this:
\<exists>y. Max L < y
[PROOF STEP]
obtain M where M: "Max L < M"
[PROOF STATE]
proof (prove)
using this:
\<exists>y. Max L < y

goal (1 subgoal):
 1. (\<And>M. Max L < M \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Max L < M

goal (1 subgoal):
 1. \<exists>x. \<forall>y\<in>L. y < x
[PROOF STEP]
from ne fL
[PROOF STATE]
proof (chain)
picking this:
L \<noteq> {}
finite L
[PROOF STEP]
have "\<forall>x \<in> L. x \<le> Max L"
[PROOF STATE]
proof (prove)
using this:
L \<noteq> {}
finite L

goal (1 subgoal):
 1. \<forall>x\<in>L. x \<le> Max L
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>L. x \<le> Max L

goal (1 subgoal):
 1. \<exists>x. \<forall>y\<in>L. y < x
[PROOF STEP]
with M
[PROOF STATE]
proof (chain)
picking this:
Max L < M
\<forall>x\<in>L. x \<le> Max L
[PROOF STEP]
have "\<forall>x\<in>L. x < M"
[PROOF STATE]
proof (prove)
using this:
Max L < M
\<forall>x\<in>L. x \<le> Max L

goal (1 subgoal):
 1. \<forall>x\<in>L. x < M
[PROOF STEP]
by (auto intro: le_less_trans)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>L. x < M

goal (1 subgoal):
 1. \<exists>x. \<forall>y\<in>L. y < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>L. x < M
[PROOF STEP]
show "\<exists>x. \<forall>y\<in>L. y < x"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>L. x < M

goal (1 subgoal):
 1. \<exists>x. \<forall>y\<in>L. y < x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x. \<forall>y\<in>L. y < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_symmetry: "\<not> O x y \<Longrightarrow> \<not> O y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> O x y \<Longrightarrow> \<not> O y x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> O x y \<Longrightarrow> \<not> O y x
[PROOF STEP]
assume "\<not> O x y"
[PROOF STATE]
proof (state)
this:
\<not> O x y

goal (1 subgoal):
 1. \<not> O x y \<Longrightarrow> \<not> O y x
[PROOF STEP]
show "\<not> O y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> O y x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. O y x \<Longrightarrow> False
[PROOF STEP]
assume "O y x"
[PROOF STATE]
proof (state)
this:
O y x

goal (1 subgoal):
 1. O y x \<Longrightarrow> False
[PROOF STEP]
hence "O x y"
[PROOF STATE]
proof (prove)
using this:
O y x

goal (1 subgoal):
 1. O x y
[PROOF STEP]
by (rule overlap_symmetry)
[PROOF STATE]
proof (state)
this:
O x y

goal (1 subgoal):
 1. O y x \<Longrightarrow> False
[PROOF STEP]
with \<open>\<not> O x y\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> O x y
O x y
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
\<not> O x y
O x y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> O y x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_exp_minus_to_infinity:
  assumes a: "a > 0"
  shows   "((\<lambda>x::real. exp (-a*x)) has_integral exp (-a*c)/a) {c..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
define f where "f = (\<lambda>k x. if x \<in> {c..real k} then exp (-a*x) else 0)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>k x. if x \<in> {c..real k} then exp (- a * x) else 0)

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f = (\<lambda>k x. if x \<in> {c..real k} then exp (- a * x) else 0)

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
fix k :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
assume k: "of_nat k \<ge> c"
[PROOF STATE]
proof (state)
this:
c \<le> real k

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
from k a
[PROOF STATE]
proof (chain)
picking this:
c \<le> real k
0 < a
[PROOF STEP]
have "((\<lambda>x. exp (-a*x)) has_integral (-exp (-a*real k)/a - (-exp (-a*c)/a))) {c..real k}"
[PROOF STATE]
proof (prove)
using this:
c \<le> real k
0 < a

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral - exp (- a * real k) / a - - exp (- a * c) / a) {c..real k}
[PROOF STEP]
by (intro fundamental_theorem_of_calculus)
         (auto intro!: derivative_eq_intros
               simp: has_real_derivative_iff_has_vector_derivative [symmetric])
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (- a * x)) has_integral - exp (- a * real k) / a - - exp (- a * c) / a) {c..real k}

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
hence "(f k has_integral (exp (-a*c)/a - exp (-a*real k)/a)) {c..}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. exp (- a * x)) has_integral - exp (- a * real k) / a - - exp (- a * c) / a) {c..real k}

goal (1 subgoal):
 1. (f k has_integral exp (- a * c) / a - exp (- a * real k) / a) {c..}
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. exp (- a * x)) has_integral - exp (- a * real k) / a - - exp (- a * c) / a) {c..real k}

goal (1 subgoal):
 1. ((\<lambda>x. if x \<in> {c..real k} then exp (- a * x) else 0) has_integral exp (- a * c) / a - exp (- a * real k) / a) {c..}
[PROOF STEP]
by (subst has_integral_restrict) simp_all
[PROOF STATE]
proof (state)
this:
(f k has_integral exp (- a * c) / a - exp (- a * real k) / a) {c..}

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
c \<le> real ?k2 \<Longrightarrow> (f ?k2 has_integral exp (- a * c) / a - exp (- a * real ?k2) / a) {c..}

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
note has_integral_f = this
[PROOF STATE]
proof (state)
this:
c \<le> real ?k2 \<Longrightarrow> (f ?k2 has_integral exp (- a * c) / a - exp (- a * real ?k2) / a) {c..}

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
have [simp]: "f k = (\<lambda>_. 0)" if "of_nat k < c" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f k = (\<lambda>_. 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
real k < c

goal (1 subgoal):
 1. f k = (\<lambda>_. 0)
[PROOF STEP]
by (auto simp: fun_eq_iff f_def)
[PROOF STATE]
proof (state)
this:
real ?k < c \<Longrightarrow> f ?k = (\<lambda>_. 0)

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
have integral_f: "integral {c..} (f k) =
                      (if real k \<ge> c then exp (-a*c)/a - exp (-a*real k)/a else 0)"
    for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {c..} (f k) = (if c \<le> real k then exp (- a * c) / a - exp (- a * real k) / a else 0)
[PROOF STEP]
using integral_unique[OF has_integral_f[of k]]
[PROOF STATE]
proof (prove)
using this:
c \<le> real k \<Longrightarrow> integral {c..} (f k) = exp (- a * c) / a - exp (- a * real k) / a

goal (1 subgoal):
 1. integral {c..} (f k) = (if c \<le> real k then exp (- a * c) / a - exp (- a * real k) / a else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral {c..} (f ?k) = (if c \<le> real ?k then exp (- a * c) / a - exp (- a * real ?k) / a else 0)

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
have A: "(\<lambda>x. exp (-a*x)) integrable_on {c..} \<and>
             (\<lambda>k. integral {c..} (f k)) \<longlonglongrightarrow> integral {c..} (\<lambda>x. exp (-a*x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (- a * x)) integrable_on {c..} \<and> (\<lambda>k. integral {c..} (f k)) \<longlonglongrightarrow> integral {c..} (\<lambda>x. exp (- a * x))
[PROOF STEP]
proof (intro monotone_convergence_increasing allI ballI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>k. f k integrable_on {c..}
 2. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 3. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 4. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
fix k ::nat
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>k. f k integrable_on {c..}
 2. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 3. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 4. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
have "(\<lambda>x. exp (-a*x)) integrable_on {c..of_real k}" (is ?P)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (- a * x)) integrable_on {c..of_real (real k)}
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (- a * x)) integrable_on {c..of_real (real k)}
[PROOF STEP]
by (auto intro!: continuous_intros integrable_continuous_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. exp (- a * x)) integrable_on {c..of_real (real k)}

goal (4 subgoals):
 1. \<And>k. f k integrable_on {c..}
 2. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 3. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 4. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
hence  "(f k) integrable_on {c..of_real k}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. exp (- a * x)) integrable_on {c..of_real (real k)}

goal (1 subgoal):
 1. f k integrable_on {c..of_real (real k)}
[PROOF STEP]
by (rule integrable_eq) (simp add: f_def)
[PROOF STATE]
proof (state)
this:
f k integrable_on {c..of_real (real k)}

goal (4 subgoals):
 1. \<And>k. f k integrable_on {c..}
 2. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 3. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 4. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f k integrable_on {c..of_real (real k)}
[PROOF STEP]
show "f k integrable_on {c..}"
[PROOF STATE]
proof (prove)
using this:
f k integrable_on {c..of_real (real k)}

goal (1 subgoal):
 1. f k integrable_on {c..}
[PROOF STEP]
by (rule integrable_on_superset) (auto simp: f_def)
[PROOF STATE]
proof (state)
this:
f k integrable_on {c..}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
assume x: "x \<in> {c..}"
[PROOF STATE]
proof (state)
this:
x \<in> {c..}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
have "sequentially \<le> principal {nat \<lceil>x\<rceil>..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequentially \<le> principal {nat \<lceil>x\<rceil>..}
[PROOF STEP]
unfolding at_top_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF k. principal {k..}) \<le> principal {nat \<lceil>x\<rceil>..}
[PROOF STEP]
by (simp add: Inf_lower)
[PROOF STATE]
proof (state)
this:
sequentially \<le> principal {nat \<lceil>x\<rceil>..}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sequentially \<le> principal {nat \<lceil>x\<rceil>..}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
have "{nat \<lceil>x\<rceil>..} \<subseteq> {k. x \<le> real k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {nat \<lceil>x\<rceil>..} \<subseteq> {k. x \<le> real k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{nat \<lceil>x\<rceil>..} \<subseteq> {k. x \<le> real k}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{nat \<lceil>x\<rceil>..} \<subseteq> {k. x \<le> real k}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
have "inf (principal \<dots>) (principal {k. \<not>x \<le> real k}) =
                 principal ({k. x \<le> real k} \<inter> {k. \<not>x \<le> real k})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf (principal {k. x \<le> real k}) (principal {k. \<not> x \<le> real k}) = principal ({k. x \<le> real k} \<inter> {k. \<not> x \<le> real k})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inf (principal {k. x \<le> real k}) (principal {k. \<not> x \<le> real k}) = principal ({k. x \<le> real k} \<inter> {k. \<not> x \<le> real k})

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inf (principal {k. x \<le> real k}) (principal {k. \<not> x \<le> real k}) = principal ({k. x \<le> real k} \<inter> {k. \<not> x \<le> real k})

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
have "{k. x \<le> real k} \<inter> {k. \<not>x \<le> real k} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k. x \<le> real k} \<inter> {k. \<not> x \<le> real k} = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{k. x \<le> real k} \<inter> {k. \<not> x \<le> real k} = {}

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<subseteq> y \<Longrightarrow> principal x \<le> principal y; \<And>xa y. xa \<le> y \<Longrightarrow> inf xa (principal {k. \<not> x \<le> real k}) \<le> inf y (principal {k. \<not> x \<le> real k})\<rbrakk> \<Longrightarrow> inf sequentially (principal {k. \<not> x \<le> real k}) \<le> principal {}
[PROOF STEP]
have "inf sequentially (principal {k. \<not>x \<le> real k}) = bot"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<subseteq> y \<Longrightarrow> principal x \<le> principal y; \<And>xa y. xa \<le> y \<Longrightarrow> inf xa (principal {k. \<not> x \<le> real k}) \<le> inf y (principal {k. \<not> x \<le> real k})\<rbrakk> \<Longrightarrow> inf sequentially (principal {k. \<not> x \<le> real k}) \<le> principal {}

goal (1 subgoal):
 1. inf sequentially (principal {k. \<not> x \<le> real k}) = bot
[PROOF STEP]
by (simp add: inf.coboundedI1 bot_unique)
[PROOF STATE]
proof (state)
this:
inf sequentially (principal {k. \<not> x \<le> real k}) = bot

goal (3 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. \<And>x. x \<in> {c..} \<Longrightarrow> (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
 3. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {c..}
inf sequentially (principal {k. \<not> x \<le> real k}) = bot
[PROOF STEP]
show "(\<lambda>k. f k x) \<longlonglongrightarrow> exp (-a*x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {c..}
inf sequentially (principal {k. \<not> x \<le> real k}) = bot

goal (1 subgoal):
 1. (\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {c..}
inf sequentially (principal {k. \<not> x \<le> real k}) = bot

goal (1 subgoal):
 1. (\<lambda>k. if x \<in> {c..real k} then exp (- a * x) else 0) \<longlonglongrightarrow> exp (- a * x)
[PROOF STEP]
by (intro filterlim_If) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. f k x) \<longlonglongrightarrow> exp (- a * x)

goal (2 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
have "\<bar>integral {c..} (f k)\<bar> \<le> exp (-a*c)/a" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
proof (cases "c > of_nat k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> real k < c

goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
hence "abs (integral {c..} (f k)) = abs (exp (- (a * c)) / a - exp (- (a * real k)) / a)"
[PROOF STATE]
proof (prove)
using this:
\<not> real k < c

goal (1 subgoal):
 1. \<bar>integral {c..} (f k)\<bar> = \<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar>
[PROOF STEP]
by (simp add: integral_f)
[PROOF STATE]
proof (state)
this:
\<bar>integral {c..} (f k)\<bar> = \<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar>

goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>integral {c..} (f k)\<bar> = \<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar>

goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
have "abs (exp (- (a * c)) / a - exp (- (a * real k)) / a) =
                   exp (- (a * c)) / a - exp (- (a * real k)) / a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar> = exp (- (a * c)) / a - exp (- (a * real k)) / a
[PROOF STEP]
using False a
[PROOF STATE]
proof (prove)
using this:
\<not> real k < c
0 < a

goal (1 subgoal):
 1. \<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar> = exp (- (a * c)) / a - exp (- (a * real k)) / a
[PROOF STEP]
by (intro abs_of_nonneg) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
\<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar> = exp (- (a * c)) / a - exp (- (a * real k)) / a

goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>exp (- (a * c)) / a - exp (- (a * real k)) / a\<bar> = exp (- (a * c)) / a - exp (- (a * real k)) / a

goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
have "\<dots> \<le> exp (- a * c) / a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- (a * c)) / a - exp (- (a * real k)) / a \<le> exp (- a * c) / a
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. exp (- (a * c)) / a - exp (- (a * real k)) / a \<le> exp (- a * c) / a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (- (a * c)) / a - exp (- (a * real k)) / a \<le> exp (- a * c) / a

goal (2 subgoals):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
 2. \<not> real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a

goal (1 subgoal):
 1. \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a

goal (1 subgoal):
 1. real k < c \<Longrightarrow> \<bar>integral {c..} (f k)\<bar> \<le> exp (- a * c) / a
[PROOF STEP]
qed (insert a, simp_all add: integral_f)
[PROOF STATE]
proof (state)
this:
\<bar>integral {c..} (f ?k)\<bar> \<le> exp (- a * c) / a

goal (2 subgoals):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
 2. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
thus "bounded (range(\<lambda>k. integral {c..} (f k)))"
[PROOF STATE]
proof (prove)
using this:
\<bar>integral {c..} (f ?k)\<bar> \<le> exp (- a * c) / a

goal (1 subgoal):
 1. bounded (range (\<lambda>k. integral {c..} (f k)))
[PROOF STEP]
by (intro boundedI[of _ "exp (-a*c)/a"]) auto
[PROOF STATE]
proof (state)
this:
bounded (range (\<lambda>k. integral {c..} (f k)))

goal (1 subgoal):
 1. \<And>k x. x \<in> {c..} \<Longrightarrow> f k x \<le> f (Suc k) x
[PROOF STEP]
qed (auto simp: f_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. exp (- a * x)) integrable_on {c..} \<and> (\<lambda>k. integral {c..} (f k)) \<longlonglongrightarrow> integral {c..} (\<lambda>x. exp (- a * x))

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
have "(\<lambda>k. exp (-a*c)/a - exp (-a * of_nat k)/a) \<longlonglongrightarrow> exp (-a*c)/a - 0/a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. exp (- a * c) / a - exp (- a * real k) / a) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a
[PROOF STEP]
by (intro tendsto_intros filterlim_compose[OF exp_at_bot]
        filterlim_tendsto_neg_mult_at_bot[OF tendsto_const] filterlim_real_sequentially)+
      (insert a, simp_all)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. exp (- a * c) / a - exp (- a * real k) / a) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>k. exp (- a * c) / a - exp (- a * real k) / a) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
from eventually_gt_at_top[of "nat \<lceil>c\<rceil>"]
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) (nat \<lceil>c\<rceil>)) sequentially
[PROOF STEP]
have "eventually (\<lambda>k. of_nat k > c) sequentially"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (nat \<lceil>c\<rceil>)) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F k in sequentially. c < real k
[PROOF STEP]
by eventually_elim linarith
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F k in sequentially. c < real k

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
hence "eventually (\<lambda>k. exp (-a*c)/a - exp (-a * of_nat k)/a = integral {c..} (f k)) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F k in sequentially. c < real k

goal (1 subgoal):
 1. \<forall>\<^sub>F k in sequentially. exp (- a * c) / a - exp (- a * real k) / a = integral {c..} (f k)
[PROOF STEP]
by eventually_elim (simp add: integral_f)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F k in sequentially. exp (- a * c) / a - exp (- a * real k) / a = integral {c..} (f k)

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. exp (- a * c) / a - exp (- a * real k) / a) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a
\<forall>\<^sub>F k in sequentially. exp (- a * c) / a - exp (- a * real k) / a = integral {c..} (f k)
[PROOF STEP]
have "(\<lambda>k. integral {c..} (f k)) \<longlonglongrightarrow> exp (-a*c)/a - 0/a"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. exp (- a * c) / a - exp (- a * real k) / a) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a
\<forall>\<^sub>F k in sequentially. exp (- a * c) / a - exp (- a * real k) / a = integral {c..} (f k)

goal (1 subgoal):
 1. (\<lambda>k. integral {c..} (f k)) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a
[PROOF STEP]
by (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. integral {c..} (f k)) \<longlonglongrightarrow> exp (- a * c) / a - 0 / a

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
from LIMSEQ_unique[OF conjunct2[OF A] this]
[PROOF STATE]
proof (chain)
picking this:
integral {c..} (\<lambda>x. exp (- a * x)) = exp (- a * c) / a - 0 / a
[PROOF STEP]
have "integral {c..} (\<lambda>x. exp (-a*x)) = exp (-a*c)/a"
[PROOF STATE]
proof (prove)
using this:
integral {c..} (\<lambda>x. exp (- a * x)) = exp (- a * c) / a - 0 / a

goal (1 subgoal):
 1. integral {c..} (\<lambda>x. exp (- a * x)) = exp (- a * c) / a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral {c..} (\<lambda>x. exp (- a * x)) = exp (- a * c) / a

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
with conjunct1[OF A]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. exp (- a * x)) integrable_on {c..}
integral {c..} (\<lambda>x. exp (- a * x)) = exp (- a * c) / a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. exp (- a * x)) integrable_on {c..}
integral {c..} (\<lambda>x. exp (- a * x)) = exp (- a * c) / a

goal (1 subgoal):
 1. ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}
[PROOF STEP]
by (simp add: has_integral_integral)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Finite_V:
  fixes X :: "V set"
  assumes "finite X" shows "small X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small X
[PROOF STEP]
using ex_bij_betw_nat_finite [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>h. bij_betw h {0..<card X} X

goal (1 subgoal):
 1. small X
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
\<exists>h. inj_on h {0..<card X} \<and> h ` {0..<card X} = X

goal (1 subgoal):
 1. small X
[PROOF STEP]
by (metis small_image_nat_V)


[STATEMENT]
lemma transcendental_Arctan:
  assumes "algebraic z" "z \<notin> {0, \<i>, -\<i>}"
  shows   "\<not>algebraic (Arctan z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> algebraic (Arctan z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> algebraic (Arctan z)
[PROOF STEP]
have "\<i> * z \<noteq> 1" "1 + \<i> * z \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> * z \<noteq> 1 &&& 1 + \<i> * z \<noteq> 0
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
z \<notin> {0, \<i>, - \<i>}

goal (1 subgoal):
 1. \<i> * z \<noteq> 1 &&& 1 + \<i> * z \<noteq> 0
[PROOF STEP]
by (auto simp: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
\<i> * z \<noteq> 1
1 + \<i> * z \<noteq> 0

goal (1 subgoal):
 1. \<not> algebraic (Arctan z)
[PROOF STEP]
hence "\<not> algebraic (Ln ((1 - \<i> * z) / (1 + \<i> * z)))"
[PROOF STATE]
proof (prove)
using this:
\<i> * z \<noteq> 1
1 + \<i> * z \<noteq> 0

goal (1 subgoal):
 1. \<not> algebraic (Ln ((1 - \<i> * z) / (1 + \<i> * z)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<i> * z \<noteq> 1
1 + \<i> * z \<noteq> 0
algebraic z
z \<notin> {0, \<i>, - \<i>}

goal (1 subgoal):
 1. \<not> algebraic (Ln ((1 - \<i> * z) / (1 + \<i> * z)))
[PROOF STEP]
by (intro transcendental_Ln) auto
[PROOF STATE]
proof (state)
this:
\<not> algebraic (Ln ((1 - \<i> * z) / (1 + \<i> * z)))

goal (1 subgoal):
 1. \<not> algebraic (Arctan z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> algebraic (Ln ((1 - \<i> * z) / (1 + \<i> * z)))

goal (1 subgoal):
 1. \<not> algebraic (Arctan z)
[PROOF STEP]
by (simp add: Arctan_def)
[PROOF STATE]
proof (state)
this:
\<not> algebraic (Arctan z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma psubst_same_Var[simp]:
  assumes "\<phi> \<in> fmla" "set xs \<subseteq> var" and "distinct xs"
  shows "psubst \<phi> (map (\<lambda>x. (Var x,x)) xs) = \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = \<phi>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = \<phi>
[PROOF STEP]
have "psubst \<phi> (map (\<lambda>x. (Var x,x)) xs) = rawpsubst \<phi> (map (\<lambda>x. (Var x,x)) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = rawpsubst \<phi> (map (\<lambda>x. (Var x, x)) xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> fmla
set xs \<subseteq> var
distinct xs

goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = rawpsubst \<phi> (map (\<lambda>x. (Var x, x)) xs)
[PROOF STEP]
by (intro psubst_eq_rawpsubst) (auto simp: nth_eq_iff_index_eq subsetD)
[PROOF STATE]
proof (state)
this:
psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = rawpsubst \<phi> (map (\<lambda>x. (Var x, x)) xs)

goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = \<phi>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = rawpsubst \<phi> (map (\<lambda>x. (Var x, x)) xs)

goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = \<phi>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = rawpsubst \<phi> (map (\<lambda>x. (Var x, x)) xs)
\<phi> \<in> fmla
set xs \<subseteq> var
distinct xs

goal (1 subgoal):
 1. psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = \<phi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
psubst \<phi> (map (\<lambda>x. (Var x, x)) xs) = \<phi>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder) set_iterator_linord_union_correct :
  assumes it_a: "set_iterator_linord it_a S_a"
  assumes it_b: "set_iterator_linord it_b S_b"
  assumes ord_Sab: "\<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b\<rbrakk> \<Longrightarrow> a < b"
  shows "set_iterator_linord (set_iterator_union it_a it_b) (S_a \<union> S_b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_linord (set_iterator_union it_a it_b) (S_a \<union> S_b)
[PROOF STEP]
unfolding set_iterator_linord_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_genord (set_iterator_union it_a it_b) (S_a \<union> S_b) (\<le>)
[PROOF STEP]
apply (rule_tac set_iterator_genord_union_correct[
   OF it_a[unfolded set_iterator_linord_def] it_b[unfolded set_iterator_linord_def]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. S_a \<inter> S_b = {}
 2. \<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
apply (insert ord_Sab)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b\<rbrakk> \<Longrightarrow> a < b) \<Longrightarrow> S_a \<inter> S_b = {}
 2. \<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b; \<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b\<rbrakk> \<Longrightarrow> a < b\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b; \<And>a b. \<lbrakk>a \<in> S_a; b \<in> S_b\<rbrakk> \<Longrightarrow> a < b\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
apply (metis less_le_not_le ord_Sab)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma abelian_subgroupI3:
  fixes G (structure)
  assumes "additive_subgroup H G"
    and "abelian_group G"
  shows "abelian_subgroup H G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_subgroup H G
[PROOF STEP]
using assms abelian_subgroupI2 abelian_group.a_comm_group additive_subgroup_def
[PROOF STATE]
proof (prove)
using this:
additive_subgroup H G
abelian_group G
\<lbrakk>comm_group (add_monoid ?G); subgroup ?H (add_monoid ?G)\<rbrakk> \<Longrightarrow> abelian_subgroup ?H ?G
abelian_group ?G \<Longrightarrow> comm_group (add_monoid ?G)
additive_subgroup ?H ?G \<equiv> subgroup ?H (add_monoid ?G)

goal (1 subgoal):
 1. abelian_subgroup H G
[PROOF STEP]
by blast


[STATEMENT]
lemma expands_to_ln_eventually_1:
  assumes "basis_wf basis" "length basis = expansion_level TYPE('a)"
  assumes "eventually (\<lambda>x. f x - 1 = 0) at_top"
  shows   "((\<lambda>x. ln (f x)) expands_to (zero_expansion :: 'a :: multiseries)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ln (f x)) expands_to zero_expansion) basis
[PROOF STEP]
by (rule expands_to_cong [OF expands_to_zero]) (insert assms, auto elim: eventually_mono)


[STATEMENT]
lemma congruence_inverse2:
  fixes n b :: nat
  assumes "b>2"
  shows "mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
proof(induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mat_mul (mat_pow 0 (B b)) (mat_pow 0 (B_inv b)) = mat 1 0 0 1
 2. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. mat_mul (mat_pow 0 (B b)) (mat_pow 0 (B_inv b)) = mat 1 0 0 1
 2. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_mul (mat_pow 0 (B b)) (mat_pow 0 (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_mul (mat_pow 0 (B b)) (mat_pow 0 (B_inv b)) = mat 1 0 0 1

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
have S1: "mat_pow (Suc(n)) (B b) = mat_mul (B b) (mat_pow n (B b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_pow (Suc n) (B b) = mat_mul (B b) (mat_pow n (B b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_pow (Suc n) (B b) = mat_mul (B b) (mat_pow n (B b))

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
have S2: "mat_pow (Suc(n)) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
[PROOF STEP]
have "\<forall>i ia ib ic. mat_pow 1 (mat ic ib ia i) = mat ic ib ia i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia ib ic. mat_pow 1 (mat ic ib ia i) = mat ic ib ia i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i ia ib ic. mat_pow 1 (mat ic ib ia i) = mat ic ib ia i

goal (1 subgoal):
 1. mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
[PROOF STEP]
hence "\<forall>m ma mb. mat_pow 1 m = m \<or> mat_mul mb m \<noteq> ma"
[PROOF STATE]
proof (prove)
using this:
\<forall>i ia ib ic. mat_pow 1 (mat ic ib ia i) = mat ic ib ia i

goal (1 subgoal):
 1. \<forall>m ma mb. mat_pow 1 m = m \<or> mat_mul mb m \<noteq> ma
[PROOF STEP]
by (metis mat2.exhaust)
[PROOF STATE]
proof (state)
this:
\<forall>m ma mb. mat_pow 1 m = m \<or> mat_mul mb m \<noteq> ma

goal (1 subgoal):
 1. mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>m ma mb. mat_pow 1 m = m \<or> mat_mul mb m \<noteq> ma

goal (1 subgoal):
 1. mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
[PROOF STEP]
by (metis (no_types) One_nat_def add_Suc_right diff_Suc_Suc diff_zero mat_exp_law mat_pow.simps(1) mat_pow.simps(2))
[PROOF STATE]
proof (state)
this:
mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
define "C" where "C= (B b)"
[PROOF STATE]
proof (state)
this:
C = B b

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
define "D" where "D = mat_pow n C"
[PROOF STATE]
proof (state)
this:
D = mat_pow n C

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
define "E" where "E = B_inv b"
[PROOF STATE]
proof (state)
this:
E = B_inv b

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
define "F" where "F = mat_pow n E"
[PROOF STATE]
proof (state)
this:
F = mat_pow n E

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
from S1 S2 C_def D_def E_def F_def
[PROOF STATE]
proof (chain)
picking this:
mat_pow (Suc n) (B b) = mat_mul (B b) (mat_pow n (B b))
mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
C = B b
D = mat_pow n C
E = B_inv b
F = mat_pow n E
[PROOF STEP]
have S3: "mat_mul (mat_pow (Suc(n)) C) (mat_pow (Suc(n)) E) = mat_mul (mat_mul C D) (mat_mul F E)"
[PROOF STATE]
proof (prove)
using this:
mat_pow (Suc n) (B b) = mat_mul (B b) (mat_pow n (B b))
mat_pow (Suc n) (B_inv b) = mat_mul (mat_pow n (B_inv b)) (B_inv b)
C = B b
D = mat_pow n C
E = B_inv b
F = mat_pow n E

goal (1 subgoal):
 1. mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul (mat_mul C D) (mat_mul F E)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul (mat_mul C D) (mat_mul F E)

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
from S3 mat_associativity mat2.exhaust C_def D_def E_def F_def
[PROOF STATE]
proof (chain)
picking this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul (mat_mul C D) (mat_mul F E)
mat_mul (mat_mul ?D ?B) ?C = mat_mul ?D (mat_mul ?B ?C)
(\<And>x1 x2 x3 x4. ?y = mat x1 x2 x3 x4 \<Longrightarrow> ?P) \<Longrightarrow> ?P
C = B b
D = mat_pow n C
E = B_inv b
F = mat_pow n E
[PROOF STEP]
have S4: "mat_mul (mat_pow (Suc(n)) C) (mat_pow (Suc(n)) E)
    = mat_mul C (mat_mul (mat_mul D F) E)"
[PROOF STATE]
proof (prove)
using this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul (mat_mul C D) (mat_mul F E)
mat_mul (mat_mul ?D ?B) ?C = mat_mul ?D (mat_mul ?B ?C)
(\<And>x1 x2 x3 x4. ?y = mat x1 x2 x3 x4 \<Longrightarrow> ?P) \<Longrightarrow> ?P
C = B b
D = mat_pow n C
E = B_inv b
F = mat_pow n E

goal (1 subgoal):
 1. mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C (mat_mul (mat_mul D F) E)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C (mat_mul (mat_mul D F) E)

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
from S4 Suc.hyps mat_neutral_element C_def D_def E_def F_def
[PROOF STATE]
proof (chain)
picking this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C (mat_mul (mat_mul D F) E)
mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1
mat_mul ID ?N = ?N
C = B b
D = mat_pow n C
E = B_inv b
F = mat_pow n E
[PROOF STEP]
have S5: "mat_mul (mat_pow (Suc(n)) C) (mat_pow (Suc(n)) E) = mat_mul C E"
[PROOF STATE]
proof (prove)
using this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C (mat_mul (mat_mul D F) E)
mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1
mat_mul ID ?N = ?N
C = B b
D = mat_pow n C
E = B_inv b
F = mat_pow n E

goal (1 subgoal):
 1. mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C E
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C E

goal (1 subgoal):
 1. \<And>n. mat_mul (mat_pow n (B b)) (mat_pow n (B_inv b)) = mat 1 0 0 1 \<Longrightarrow> mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
from S5 C_def E_def
[PROOF STATE]
proof (chain)
picking this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C E
C = B b
E = B_inv b
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C E
C = B b
E = B_inv b

goal (1 subgoal):
 1. mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
using B_inverse ID_def
[PROOF STATE]
proof (prove)
using this:
mat_mul (mat_pow (Suc n) C) (mat_pow (Suc n) E) = mat_mul C E
C = B b
E = B_inv b
mat_mul (B ?b) (B_inv ?b) = ID
ID = mat 1 0 0 1

goal (1 subgoal):
 1. mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_mul (mat_pow (Suc n) (B b)) (mat_pow (Suc n) (B_inv b)) = mat 1 0 0 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma xor_distr_L [simp]:"A \<oplus> (B \<oplus> C) = (A\<and>\<not>B\<and>\<not>C)\<or>(A\<and>B\<and>C)\<or>(\<not>A\<and>B\<and>\<not>C)\<or>(\<not>A\<and>\<not>B\<and>C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<oplus> (B \<oplus> C) = (A \<and> \<not> B \<and> \<not> C) \<or> A \<and> B \<and> C \<or> \<not> A \<and> B \<and> \<not> C \<or> \<not> A \<and> \<not> B \<and> C
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_of_2_squares_nat_power [intro]:
  assumes "sum_of_2_squares_nat m"
  shows   "sum_of_2_squares_nat (m ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_of_2_squares_nat (m ^ n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum_of_2_squares_nat m

goal (1 subgoal):
 1. sum_of_2_squares_nat (m ^ n)
[PROOF STEP]
by (induction n) auto


[STATEMENT]
lemma length_list_of_vec[simp]: "length (list_of_vec A) = dim_vec A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_of_vec A) = dim_vec A
[PROOF STEP]
by (transfer', auto)


[STATEMENT]
lemma (in Height_Bounded_Labeling) gap_measure:
  assumes "gap_precond l k"
  shows "sum_heights_measure (gap_effect l k) \<le> sum_heights_measure l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_heights_measure (gap_effect l k) \<le> sum_heights_measure l
[PROOF STEP]
unfolding gap_effect_def sum_heights_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>V. 2 * card V - (if k < l v \<and> l v < card V then card V + 1 else l v)) \<le> (\<Sum>v\<in>V. 2 * card V - l v)
[PROOF STEP]
by (auto intro!: sum_mono)


[STATEMENT]
lemma sum_list_replicate [simp]:
  "sum_list (replicate n x) = of_nat n * (x :: 'a :: semiring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (replicate n x) = of_nat n * x
[PROOF STEP]
by (induction n) (auto simp: algebra_simps)


[STATEMENT]
lemma val_ord[simp]:
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "val a = ord a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val a = eint (ord a)
[PROOF STEP]
using assms nonzero_def val_def
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
nonzero ?R = {a \<in> carrier ?R. a \<noteq> \<zero>\<^bsub>?R\<^esub>}
val ?x = (if ?x = \<zero> then \<infinity> else eint (ord ?x))

goal (1 subgoal):
 1. val a = eint (ord a)
[PROOF STEP]
by force


[STATEMENT]
lemma zero_less_norm_iff [simp]: "norm x > 0 \<longleftrightarrow> x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < norm x) = (x \<noteq> (0::'a))
[PROOF STEP]
by (simp add: order_less_le)


[STATEMENT]
lemma RSpan_contains_RSpans_Cons_left :
  "set ms \<subseteq> M \<Longrightarrow> RSpan [m] \<subseteq> RSpan (m#ms)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ms \<subseteq> M \<Longrightarrow> RSpan [m] \<subseteq> RSpan (m # ms)
[PROOF STEP]
using RSpan_Cons Group_RSpan AbGroup.intro AbGroup.subset_plus_left
[PROOF STATE]
proof (prove)
using this:
RSpan (?m # ?ms) = RSpan [?m] + RSpan ?ms
set ?ms \<subseteq> M \<Longrightarrow> Group (RSpan ?ms)
Group ?G \<Longrightarrow> AbGroup ?G
AbGroup ?G \<Longrightarrow> ?A \<subseteq> ?A + ?G

goal (1 subgoal):
 1. set ms \<subseteq> M \<Longrightarrow> RSpan [m] \<subseteq> RSpan (m # ms)
[PROOF STEP]
by fast


[STATEMENT]
lemma scaleR_norm_sgn_eq: "(\<parallel>x\<parallel>) *\<^sub>R sgn x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>x\<parallel> *\<^sub>R sgn x = x
[PROOF STEP]
by (metis divideR_right norm_eq_zero scale_eq_0_iff sgn_div_norm)


[STATEMENT]
lemma euler_criterion_aux: "[(Legendre a p) = a ^ ((p - 1) div 2)] (mod p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [Legendre a (int p) = a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
using p_a_relprime
[PROOF STATE]
proof (prove)
using this:
[a \<noteq> 0] (mod int p)

goal (1 subgoal):
 1. [Legendre a (int p) = a ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
by (auto simp add: Legendre_def
    intro!: cong_sym [of _ 1] cong_sym [of _ "- 1"]
    dest: E_1 E_2)