[STATEMENT]
lemma card_Suc_ex:
  assumes "card A = Suc (card B)" "B \<subseteq> A"
  shows "\<exists>b. A = insert b B \<and> b\<notin>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. A = insert b B \<and> b \<notin> B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b. A = insert b B \<and> b \<notin> B
[PROOF STEP]
have "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
using assms(1) card_ge_0_finite card.infinite
[PROOF STATE]
proof (prove)
using this:
card A = Suc (card B)
0 < card ?A \<Longrightarrow> finite ?A
infinite ?A \<Longrightarrow> card ?A = 0

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

goal (1 subgoal):
 1. \<exists>b. A = insert b B \<and> b \<notin> B
[PROOF STEP]
obtain b where "b\<in>A-B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. b \<in> A - B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Diff_eq_empty_iff all_not_in_conv assms n_not_Suc_n subset_antisym)
[PROOF STATE]
proof (state)
this:
b \<in> A - B

goal (1 subgoal):
 1. \<exists>b. A = insert b B \<and> b \<notin> B
[PROOF STEP]
show "\<exists>b. A = insert b B \<and> b\<notin>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. A = insert b B \<and> b \<notin> B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A = insert ?b B \<and> ?b \<notin> B
[PROOF STEP]
show "A = insert b B \<and> b\<notin>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = insert b B \<and> b \<notin> B
[PROOF STEP]
using  \<open>b\<in>A-B\<close> \<open>finite A\<close> assms
[PROOF STATE]
proof (prove)
using this:
b \<in> A - B
finite A
card A = Suc (card B)
B \<subseteq> A

goal (1 subgoal):
 1. A = insert b B \<and> b \<notin> B
[PROOF STEP]
by (metis DiffD1 DiffD2 Diff_insert_absorb Diff_single_insert card_insert_disjoint
        card_subset_eq insert_absorb rev_finite_subset)
[PROOF STATE]
proof (state)
this:
A = insert b B \<and> b \<notin> B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>b. A = insert b B \<and> b \<notin> B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_mult_less: "norm x < r \<Longrightarrow> norm y < s \<Longrightarrow> norm (x * y) < r * s"
  for x y :: "'a::real_normed_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>norm x < r; norm y < s\<rbrakk> \<Longrightarrow> norm (x * y) < r * s
[PROOF STEP]
by (rule order_le_less_trans [OF norm_mult_ineq]) (simp add: mult_strict_mono')


[STATEMENT]
lemma powser_continuous_sums:
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
  assumes r: "r < conv_radius a"
      and sm: "\<And>x. x \<in> cball \<xi> r \<Longrightarrow> (\<lambda>n. a n * (x - \<xi>) ^ n) sums (f x)"
  shows "continuous_on (cball \<xi> r) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cball \<xi> r) f
[PROOF STEP]
apply (rule continuous_on_cong [THEN iffD1, OF refl _ powser_continuous_suminf [OF r]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> cball \<xi> r \<Longrightarrow> (\<Sum>i. a i * (x - \<xi>) ^ i) = f x
[PROOF STEP]
using sm sums_unique
[PROOF STATE]
proof (prove)
using this:
?x \<in> cball \<xi> r \<Longrightarrow> (\<lambda>n. a n * (?x - \<xi>) ^ n) sums f ?x
?f sums ?s \<Longrightarrow> ?s = suminf ?f

goal (1 subgoal):
 1. \<And>x. x \<in> cball \<xi> r \<Longrightarrow> (\<Sum>i. a i * (x - \<xi>) ^ i) = f x
[PROOF STEP]
by fastforce


[STATEMENT]
lemma numeral_6_eq_6: "6 = Suc( Suc(Suc( Suc (Suc (Suc 0)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 = Suc (Suc (Suc (Suc (Suc (Suc 0)))))
[PROOF STEP]
by (simp add: eval_nat_numeral)


[STATEMENT]
lemma coeff_mult_0: "coeff (f * g) 0 = coeff f 0 * coeff g 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (f * g) 0 = coeff f 0 * coeff g 0
[PROOF STEP]
by (metis poly_0_coeff_0 poly_mult)


[STATEMENT]
lemma index_add_mat[simp]:
  "i < dim_row B \<Longrightarrow> j < dim_col B \<Longrightarrow> (A + B) $$ (i,j) = A $$ (i,j) + B $$ (i,j)"
  "dim_row (A + B) = dim_row B" "dim_col (A + B) = dim_col B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> (A + B) $$ (i, j) = A $$ (i, j) + B $$ (i, j)) &&& dim_row (A + B) = dim_row B &&& dim_col (A + B) = dim_col B
[PROOF STEP]
unfolding plus_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> mat (dim_row B) (dim_col B) (\<lambda>ij. A $$ ij + B $$ ij) $$ (i, j) = A $$ (i, j) + B $$ (i, j)) &&& dim_row (mat (dim_row B) (dim_col B) (\<lambda>ij. A $$ ij + B $$ ij)) = dim_row B &&& dim_col (mat (dim_row B) (dim_col B) (\<lambda>ij. A $$ ij + B $$ ij)) = dim_col B
[PROOF STEP]
by auto


[STATEMENT]
lemma 88:
  fixes b r p q:: nat
  defines "m \<equiv> int b * int q - int q * int q - 1"
  assumes "int q ^ r < m" and "q > 0"
  shows "int p = int q ^ r \<longleftrightarrow> int p < m  \<and>  (q * \<alpha> b r - (int b * \<alpha> b r -  \<alpha> b (Suc r))) mod m = int p mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int p = int q ^ r) = (int p < m \<and> (int q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = int p mod m)
[PROOF STEP]
using "Exp_Matrices.860" assms(2) m_def
[PROOF STATE]
proof (prove)
using this:
(?q * \<alpha> ?b ?r - (int ?b * \<alpha> ?b ?r - \<alpha> ?b (Suc ?r))) mod (int ?b * ?q - ?q * ?q - 1) = ?q ^ ?r mod (int ?b * ?q - ?q * ?q - 1)
int q ^ r < m
m \<equiv> int b * int q - int q * int q - 1

goal (1 subgoal):
 1. (int p = int q ^ r) = (int p < m \<and> (int q * \<alpha> b r - (int b * \<alpha> b r - \<alpha> b (Suc r))) mod m = int p mod m)
[PROOF STEP]
by auto


[STATEMENT]
lemma sup_0_eq_0 [simp, no_atp]: "sup a (- a) = 0 \<longleftrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sup a (- a) = (0::'a)) = (a = (0::'a))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sup a (- a) = (0::'a) \<Longrightarrow> a = (0::'a)
 2. a = (0::'a) \<Longrightarrow> sup a (- a) = (0::'a)
[PROOF STEP]
apply (erule sup_0_imp_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = (0::'a) \<Longrightarrow> sup a (- a) = (0::'a)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma closure_Union: "closure (\<Union>X) = (\<Union>x\<in>X. closure x)" if "finite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (\<Union> X) = \<Union> (closure ` X)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. closure (\<Union> X) = \<Union> (closure ` X)
[PROOF STEP]
by (induction X) auto


[STATEMENT]
lemma Fourier_sum_0_explicit:
  "(\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0)
    = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f(2*k))) / sqrt pi"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
have "(\<Sum>k=0..n. Fourier_coefficient f k * trigonometric_set k 0)
        = Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n. Fourier_coefficient f k * trigonometric_set k 0) = Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0)
[PROOF STEP]
by (simp add: Fourier_sum_0 sum.atLeast_Suc_atMost)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n. Fourier_coefficient f k * trigonometric_set k 0) = Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0)

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..n. Fourier_coefficient f k * trigonometric_set k 0) = Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0)

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
have "Fourier_coefficient f 0 * trigonometric_set 0 0 = Fourier_coefficient f 0 / (sqrt 2 * sqrt pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 = Fourier_coefficient f 0 / (sqrt 2 * sqrt pi)
[PROOF STEP]
by (simp add: real_sqrt_mult trigonometric_set(1))
[PROOF STATE]
proof (state)
this:
Fourier_coefficient f 0 * trigonometric_set 0 0 = Fourier_coefficient f 0 / (sqrt 2 * sqrt pi)

goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Fourier_coefficient f 0 * trigonometric_set 0 0 = Fourier_coefficient f 0 / (sqrt 2 * sqrt pi)

goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
have "(\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f(2*k)) / sqrt pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>k = Suc 0..0. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..0 div 2. Fourier_coefficient f (2 * k)) / sqrt pi
 2. \<And>n. (\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi \<Longrightarrow> (\<Sum>k = Suc 0..Suc n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..Suc n div 2. Fourier_coefficient f (2 * k)) / sqrt pi
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi

goal (2 subgoals):
 1. (\<Sum>k = Suc 0..0. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..0 div 2. Fourier_coefficient f (2 * k)) / sqrt pi
 2. \<And>n. (\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi \<Longrightarrow> (\<Sum>k = Suc 0..Suc n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..Suc n div 2. Fourier_coefficient f (2 * k)) / sqrt pi
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc 0..Suc n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..Suc n div 2. Fourier_coefficient f (2 * k)) / sqrt pi
[PROOF STEP]
by (simp add: Suc) (auto simp: trigonometric_set_def field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 0..Suc n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..Suc n div 2. Fourier_coefficient f (2 * k)) / sqrt pi

goal (1 subgoal):
 1. (\<Sum>k = Suc 0..0. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..0 div 2. Fourier_coefficient f (2 * k)) / sqrt pi
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi

goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Fourier_coefficient f 0 * trigonometric_set 0 0 = Fourier_coefficient f 0 / (sqrt 2 * sqrt pi)
(\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Fourier_coefficient f 0 * trigonometric_set 0 0 = Fourier_coefficient f 0 / (sqrt 2 * sqrt pi)
(\<Sum>k = Suc 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (\<Sum>k = Suc 0..n div 2. Fourier_coefficient f (2 * k)) / sqrt pi

goal (1 subgoal):
 1. Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
by (simp add: add_divide_distrib)
[PROOF STATE]
proof (state)
this:
Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Fourier_coefficient f 0 * trigonometric_set 0 0 + (\<Sum>k = 1..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi

goal (1 subgoal):
 1. (\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi
[PROOF STEP]
by (simp add: atMost_atLeast0)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>n. Fourier_coefficient f k * trigonometric_set k 0) = (Fourier_coefficient f 0 / sqrt 2 + (\<Sum>k = 1..n div 2. Fourier_coefficient f (2 * k))) / sqrt pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem pythagorean_theorem:
  includes notation_norm
  shows \<open>(x \<bullet>\<^sub>C y) = 0 \<Longrightarrow> \<parallel> x + y \<parallel>^2 = \<parallel> x \<parallel>^2 + \<parallel> y \<parallel>^2\<close>
    \<comment> \<open>Shown in the proof of Theorem 2.2 in @{cite conway2013course}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet>\<^sub>C y = 0 \<Longrightarrow> \<parallel>x + y\<parallel>\<^sup>2 = \<parallel>x\<parallel>\<^sup>2 + \<parallel>y\<parallel>\<^sup>2
[PROOF STEP]
by (simp add: polar_identity)


[STATEMENT]
lemma holomorphic_countable_zeros:
  assumes S: "f holomorphic_on S" "open S" "connected S" and "fsigma S"
      and "\<not> f constant_on S"
    shows "countable {z\<in>S. f z = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {z \<in> S. f z = 0}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable {z \<in> S. f z = 0}
[PROOF STEP]
obtain F::"nat \<Rightarrow> complex set"
      where F: "range F \<subseteq> Collect compact" and Seq: "S = (\<Union>i. F i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F. \<lbrakk>range F \<subseteq> Collect compact; S = \<Union> (range F)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>fsigma S\<close>
[PROOF STATE]
proof (prove)
using this:
fsigma S

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>range F \<subseteq> Collect compact; S = \<Union> (range F)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson fsigma_Union_compact)
[PROOF STATE]
proof (state)
this:
range F \<subseteq> Collect compact
S = \<Union> (range F)

goal (1 subgoal):
 1. countable {z \<in> S. f z = 0}
[PROOF STEP]
have fin: "finite {z \<in> F i. f z = 0}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {z \<in> F i. f z = 0}
[PROOF STEP]
using holomorphic_compact_finite_zeros assms F Seq Union_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f holomorphic_on ?S; open ?S; connected ?S; compact ?K; ?K \<subseteq> ?S; \<not> ?f constant_on ?S\<rbrakk> \<Longrightarrow> finite {z \<in> ?K. ?f z = 0}
f holomorphic_on S
open S
connected S
fsigma S
\<not> f constant_on S
range F \<subseteq> Collect compact
S = \<Union> (range F)
(?A \<in> \<Union> ?C) = (\<exists>X\<in>?C. ?A \<in> X)

goal (1 subgoal):
 1. finite {z \<in> F i. f z = 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {z \<in> F ?i. f z = 0}

goal (1 subgoal):
 1. countable {z \<in> S. f z = 0}
[PROOF STEP]
have "{z \<in> S. f z = 0} = (\<Union>i. {z \<in> F i. f z = 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {z \<in> S. f z = 0} = (\<Union>i. {z \<in> F i. f z = 0})
[PROOF STEP]
using Seq
[PROOF STATE]
proof (prove)
using this:
S = \<Union> (range F)

goal (1 subgoal):
 1. {z \<in> S. f z = 0} = (\<Union>i. {z \<in> F i. f z = 0})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{z \<in> S. f z = 0} = (\<Union>i. {z \<in> F i. f z = 0})

goal (1 subgoal):
 1. countable {z \<in> S. f z = 0}
[PROOF STEP]
with fin
[PROOF STATE]
proof (chain)
picking this:
finite {z \<in> F ?i. f z = 0}
{z \<in> S. f z = 0} = (\<Union>i. {z \<in> F i. f z = 0})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {z \<in> F ?i. f z = 0}
{z \<in> S. f z = 0} = (\<Union>i. {z \<in> F i. f z = 0})

goal (1 subgoal):
 1. countable {z \<in> S. f z = 0}
[PROOF STEP]
by (simp add: countable_finite)
[PROOF STATE]
proof (state)
this:
countable {z \<in> S. f z = 0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma face_of_Inter: "\<lbrakk>A \<noteq> {}; \<And>T. T \<in> A \<Longrightarrow> T face_of S\<rbrakk> \<Longrightarrow> (\<Inter> A) face_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; \<And>T. T \<in> A \<Longrightarrow> T face_of S\<rbrakk> \<Longrightarrow> \<Inter> A face_of S
[PROOF STEP]
unfolding face_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; \<And>T. T \<in> A \<Longrightarrow> T \<subseteq> S \<and> convex T \<and> (\<forall>a\<in>S. \<forall>b\<in>S. \<forall>x\<in>T. x \<in> open_segment a b \<longrightarrow> a \<in> T \<and> b \<in> T)\<rbrakk> \<Longrightarrow> \<Inter> A \<subseteq> S \<and> convex (\<Inter> A) \<and> (\<forall>a\<in>S. \<forall>b\<in>S. \<forall>x\<in>\<Inter> A. x \<in> open_segment a b \<longrightarrow> a \<in> \<Inter> A \<and> b \<in> \<Inter> A)
[PROOF STEP]
by (blast intro: convex_Inter)


[STATEMENT]
lemma (in normal) FactGroup_pow:
  fixes k::nat
  assumes "a \<in> carrier G"
  shows "pow (FactGroup G H) (r_coset G H a) k = r_coset G H (pow G a k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (H #> a) [^]\<^bsub>G Mod H\<^esub> 0 = H #> a [^] 0
 2. \<And>k. (H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k \<Longrightarrow> (H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (H #> a) [^]\<^bsub>G Mod H\<^esub> 0 = H #> a [^] 0
 2. \<And>k. (H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k \<Longrightarrow> (H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (H #> a) [^]\<^bsub>G Mod H\<^esub> 0 = H #> a [^] 0
[PROOF STEP]
by (simp add: r_coset_def)
[PROOF STATE]
proof (state)
this:
(H #> a) [^]\<^bsub>G Mod H\<^esub> 0 = H #> a [^] 0

goal (1 subgoal):
 1. \<And>k. (H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k \<Longrightarrow> (H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. (H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k \<Longrightarrow> (H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
(H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k

goal (1 subgoal):
 1. \<And>k. (H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k \<Longrightarrow> (H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(H #> a) [^]\<^bsub>G Mod H\<^esub> k = H #> a [^] k

goal (1 subgoal):
 1. (H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k
[PROOF STEP]
by (simp add: assms rcos_sum)
[PROOF STATE]
proof (state)
this:
(H #> a) [^]\<^bsub>G Mod H\<^esub> Suc k = H #> a [^] Suc k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bw_diff_plus_pow [simp]:
  "(bw_diff ^^ k) (\<lambda>x. f x + g x) = (\<lambda>x. (bw_diff ^^ k) f x + (bw_diff ^^ k) g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bw_diff ^^ k) (\<lambda>x. f x + g x) = (\<lambda>x. (bw_diff ^^ k) f x + (bw_diff ^^ k) g x)
[PROOF STEP]
by (induct k, simp_all)


[STATEMENT]
lemma ceiling_le_zero [simp]: "\<lceil>x\<rceil> \<le> 0 \<longleftrightarrow> x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> 0) = (x \<le> (0::'a))
[PROOF STEP]
by (simp add: ceiling_le_iff)


[STATEMENT]
lemma simple_match_port_UNIV: "{p. simple_match_port (s,e) p} = UNIV \<longleftrightarrow> (s = 0 \<and> e = - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({p. simple_match_port (s, e) p} = UNIV) = (s = 0 \<and> e = - 1)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({p. s \<le> p \<and> p \<le> e} = UNIV) = (s = 0 \<and> e = - 1)
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {p. s \<le> p \<and> p \<le> e} = UNIV \<Longrightarrow> s = 0 \<and> e = - 1
 2. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
apply(case_tac "s = 0")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>{p. s \<le> p \<and> p \<le> e} = UNIV; s = 0\<rbrakk> \<Longrightarrow> s = 0 \<and> e = - 1
 2. \<lbrakk>{p. s \<le> p \<and> p \<le> e} = UNIV; s \<noteq> 0\<rbrakk> \<Longrightarrow> s = 0 \<and> e = - 1
 3. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
using antisym_conv
[PROOF STATE]
proof (prove)
using this:
?y \<le> ?x \<Longrightarrow> (?x \<le> ?y) = (?x = ?y)

goal (3 subgoals):
 1. \<lbrakk>{p. s \<le> p \<and> p \<le> e} = UNIV; s = 0\<rbrakk> \<Longrightarrow> s = 0 \<and> e = - 1
 2. \<lbrakk>{p. s \<le> p \<and> p \<le> e} = UNIV; s \<noteq> 0\<rbrakk> \<Longrightarrow> s = 0 \<and> e = - 1
 3. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>{p. s \<le> p \<and> p \<le> e} = UNIV; s \<noteq> 0\<rbrakk> \<Longrightarrow> s = 0 \<and> e = - 1
 2. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
using word_le_0_iff
[PROOF STATE]
proof (prove)
using this:
(?x \<le> 0) = (?x = 0)

goal (2 subgoals):
 1. \<lbrakk>{p. s \<le> p \<and> p \<le> e} = UNIV; s \<noteq> 0\<rbrakk> \<Longrightarrow> s = 0 \<and> e = - 1
 2. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
using word_zero_le
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?y

goal (1 subgoal):
 1. s = 0 \<and> e = - 1 \<Longrightarrow> {p. s \<le> p \<and> p \<le> e} = UNIV
[PROOF STEP]
by blast


[STATEMENT]
lemma cos_coeff_Suc: "cos_coeff (Suc n) = - sin_coeff n / real (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos_coeff (Suc n) = - sin_coeff n / real (Suc n)
[PROOF STEP]
unfolding cos_coeff_def sin_coeff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even (Suc n) then (- 1) ^ (Suc n div 2) / fact (Suc n) else 0) = - (if even n then 0 else (- 1) ^ ((n - Suc 0) div 2) / fact n) / real (Suc n)
[PROOF STEP]
by (simp del: mult_Suc) (auto elim: oddE)


[STATEMENT]
lemma ennreal_less_numeral_iff [simp]: "ennreal n < numeral w \<longleftrightarrow> n < numeral w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ennreal n < numeral w) = (n < numeral w)
[PROOF STEP]
by (metis ennreal_less_iff ennreal_numeral less_le not_less zero_less_numeral)


[STATEMENT]
lemma insertion_sort_correct :
  "sorted xs \<Longrightarrow> distinct xs \<Longrightarrow>
   distinct (insertion_sort x xs) \<and>
   sorted (insertion_sort x xs) \<and>
   set (insertion_sort x xs) = set (x # xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted xs; distinct xs\<rbrakk> \<Longrightarrow> distinct (insertion_sort x xs) \<and> sorted (insertion_sort x xs) \<and> set (insertion_sort x xs) = set (x # xs)
[PROOF STEP]
by (induct xs) (auto simp add: Ball_def)


[STATEMENT]
lemma (in group) inv_subgroup_generated [simp]:
  assumes "f \<in> carrier (subgroup_generated G S)"
  shows "inv\<^bsub>subgroup_generated G S\<^esub> f = inv f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>subgroup_generated G S\<^esub> f = inv f
[PROOF STEP]
proof (rule group.inv_equality)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. Group.group (subgroup_generated G S)
 2. inv f \<otimes>\<^bsub>subgroup_generated G S\<^esub> f = \<one>\<^bsub>subgroup_generated G S\<^esub>
 3. f \<in> carrier (subgroup_generated G S)
 4. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
show "Group.group (subgroup_generated G S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (subgroup_generated G S)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Group.group (subgroup_generated G S)

goal (3 subgoals):
 1. inv f \<otimes>\<^bsub>subgroup_generated G S\<^esub> f = \<one>\<^bsub>subgroup_generated G S\<^esub>
 2. f \<in> carrier (subgroup_generated G S)
 3. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
have [simp]: "f \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier G
[PROOF STEP]
by (metis Int_lower1 assms carrier_subgroup_generated generate_in_carrier)
[PROOF STATE]
proof (state)
this:
f \<in> carrier G

goal (3 subgoals):
 1. inv f \<otimes>\<^bsub>subgroup_generated G S\<^esub> f = \<one>\<^bsub>subgroup_generated G S\<^esub>
 2. f \<in> carrier (subgroup_generated G S)
 3. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
show "inv f \<otimes>\<^bsub>subgroup_generated G S\<^esub> f = \<one>\<^bsub>subgroup_generated G S\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f \<otimes>\<^bsub>subgroup_generated G S\<^esub> f = \<one>\<^bsub>subgroup_generated G S\<^esub>
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
inv f \<otimes>\<^bsub>subgroup_generated G S\<^esub> f = \<one>\<^bsub>subgroup_generated G S\<^esub>

goal (2 subgoals):
 1. f \<in> carrier (subgroup_generated G S)
 2. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
show "f \<in> carrier (subgroup_generated G S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (subgroup_generated G S)

goal (1 subgoal):
 1. f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
by (simp add: generate.incl subgroup_generated_def)
[PROOF STATE]
proof (state)
this:
f \<in> carrier (subgroup_generated G S)

goal (1 subgoal):
 1. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
show "inv f \<in> carrier (subgroup_generated G S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (subgroup_generated G S)

goal (1 subgoal):
 1. inv f \<in> carrier (subgroup_generated G S)
[PROOF STEP]
by (simp add: subgroup_generated_def generate_m_inv_closed)
[PROOF STATE]
proof (state)
this:
inv f \<in> carrier (subgroup_generated G S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ffilter_finsert:
  "ffilter f (finsert a s) = (if f a then finsert a (ffilter f s) else (ffilter f s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffilter f (finsert a s) = (if f a then finsert a (ffilter f s) else ffilter f s)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f a \<longrightarrow> ffilter f (finsert a s) = finsert a (ffilter f s)) \<and> (\<not> f a \<longrightarrow> ffilter f (finsert a s) = ffilter f s)
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f a \<longrightarrow> ffilter f (finsert a s) = finsert a (ffilter f s)
 2. \<not> f a \<longrightarrow> ffilter f (finsert a s) = ffilter f s
[PROOF STEP]
apply (simp add: ffilter_def fset_both_sides Abs_fset_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f a \<longrightarrow> Set.filter f (insert a (fset s)) = insert a (Set.filter f (fset s))
 2. \<not> f a \<longrightarrow> ffilter f (finsert a s) = ffilter f s
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f a \<longrightarrow> ffilter f (finsert a s) = ffilter f s
[PROOF STEP]
apply (simp add: ffilter_def fset_both_sides Abs_fset_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> f a \<longrightarrow> Set.filter f (insert a (fset s)) = Set.filter f (fset s)
[PROOF STEP]
by auto


[STATEMENT]
lemma upper_circle_map:
  "{x::complex. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} = upper_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} = upper_circle_01
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<subseteq> upper_circle_01
 2. upper_circle_01 \<subseteq> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
show "{x::complex. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<subseteq> upper_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<subseteq> upper_circle_01
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
assume "x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}"
[PROOF STATE]
proof (state)
this:
x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
obtain y where "1 / x = y + 1" and h: "Im y < sqrt 3 * Re y"
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>1 / x = y + 1; Im y < sqrt 3 * Re y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
1 / x = y + 1
Im y < sqrt 3 * Re y

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
hence hy: "y = 1/x - 1"
[PROOF STATE]
proof (prove)
using this:
1 / x = y + 1
Im y < sqrt 3 * Re y

goal (1 subgoal):
 1. y = 1 / x - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y = 1 / x - 1

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
hence hx: "x = 1/(y+1)"
[PROOF STATE]
proof (prove)
using this:
y = 1 / x - 1

goal (1 subgoal):
 1. x = 1 / (y + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = 1 / (y + 1)

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
from h
[PROOF STATE]
proof (chain)
picking this:
Im y < sqrt 3 * Re y
[PROOF STEP]
have hy1: "y \<noteq> -1"
[PROOF STATE]
proof (prove)
using this:
Im y < sqrt 3 * Re y

goal (1 subgoal):
 1. y \<noteq> - 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
y \<noteq> - 1

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
hence hx0: "x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
y \<noteq> - 1

goal (1 subgoal):
 1. x \<noteq> 0
[PROOF STEP]
using hy
[PROOF STATE]
proof (prove)
using this:
y \<noteq> - 1
y = 1 / x - 1

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

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
from h
[PROOF STATE]
proof (chain)
picking this:
Im y < sqrt 3 * Re y
[PROOF STEP]
have "0 < Re ((\<i> + sqrt 3) * y)"
[PROOF STATE]
proof (prove)
using this:
Im y < sqrt 3 * Re y

goal (1 subgoal):
 1. 0 < Re ((\<i> + complex_of_real (sqrt 3)) * y)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < Re ((\<i> + complex_of_real (sqrt 3)) * y)

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
hence "cmod ((\<i> + sqrt 3) * y - 1) < cmod ((\<i> + sqrt 3) * y + 1)"
[PROOF STATE]
proof (prove)
using this:
0 < Re ((\<i> + complex_of_real (sqrt 3)) * y)

goal (1 subgoal):
 1. cmod ((\<i> + complex_of_real (sqrt 3)) * y - 1) < cmod ((\<i> + complex_of_real (sqrt 3)) * y + 1)
[PROOF STEP]
by (auto simp: cmod_def power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
cmod ((\<i> + complex_of_real (sqrt 3)) * y - 1) < cmod ((\<i> + complex_of_real (sqrt 3)) * y + 1)

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
hence 1: "cmod (((\<i> + sqrt 3) * y - 1)/((\<i> + sqrt 3) * y + 1)) < 1"
[PROOF STATE]
proof (prove)
using this:
cmod ((\<i> + complex_of_real (sqrt 3)) * y - 1) < cmod ((\<i> + complex_of_real (sqrt 3)) * y + 1)

goal (1 subgoal):
 1. cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) / ((\<i> + complex_of_real (sqrt 3)) * y + 1)) < 1
[PROOF STEP]
by (auto simp: norm_divide divide_simps)
[PROOF STATE]
proof (state)
this:
cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) / ((\<i> + complex_of_real (sqrt 3)) * y + 1)) < 1

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) / ((\<i> + complex_of_real (sqrt 3)) * y + 1)) < 1

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
have "cmod (((\<i> + sqrt 3) * y - 1)/((\<i> + sqrt 3) * y + 1)) =
               cmod (((\<i> + sqrt 3) * y * x - x)/((\<i> + sqrt 3) * y * x + x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) / ((\<i> + complex_of_real (sqrt 3)) * y + 1)) = cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x))
[PROOF STEP]
apply (subst mult_divide_mult_cancel_right[symmetric, OF hx0])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) * x / (((\<i> + complex_of_real (sqrt 3)) * y + 1) * x)) = cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x))
[PROOF STEP]
apply (subst ring_distribs(2)[of _ _ x])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) * x / ((\<i> + complex_of_real (sqrt 3)) * y * x + 1 * x)) = cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x))
[PROOF STEP]
apply (subst left_diff_distrib[of _ _ x])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - 1 * x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + 1 * x)) = cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) / ((\<i> + complex_of_real (sqrt 3)) * y + 1)) = cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x))

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (((\<i> + complex_of_real (sqrt 3)) * y - 1) / ((\<i> + complex_of_real (sqrt 3)) * y + 1)) = cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x))

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
have "... = cmod
       (((-1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) /
       (( 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x)) = cmod (((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)))
[PROOF STEP]
by (auto simp: hy algebra_simps hx0)
[PROOF STATE]
proof (state)
this:
cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x)) = cmod (((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)))

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (((\<i> + complex_of_real (sqrt 3)) * y * x - x) / ((\<i> + complex_of_real (sqrt 3)) * y * x + x)) = cmod (((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)))

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
have
      "... = cmod ((-1 - complex_of_real (sqrt 3) - \<i>) * x +
                   (complex_of_real (sqrt 3) + \<i>)) /
             cmod (( 1 - complex_of_real (sqrt 3) - \<i>) * x +
                   (complex_of_real (sqrt 3) + \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))) = cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))
[PROOF STEP]
by (auto simp: norm_divide)
[PROOF STATE]
proof (state)
this:
cmod (((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))) = cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1
[PROOF STEP]
have
      "cmod ((-1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))
       < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))"
[PROOF STATE]
proof (prove)
using this:
cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1

goal (1 subgoal):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))
[PROOF STEP]
proof (subst divide_less_eq_1_pos[symmetric], subst zero_less_norm_iff)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1; cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1\<rbrakk> \<Longrightarrow> (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) \<noteq> 0
 2. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1 \<Longrightarrow> cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1
[PROOF STEP]
show "(1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) \<noteq> 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0 \<Longrightarrow> False
[PROOF STEP]
have "-\<i> + 1 \<noteq> complex_of_real (sqrt 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<i> + 1 \<noteq> complex_of_real (sqrt 3)
[PROOF STEP]
by (auto simp: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
- \<i> + 1 \<noteq> complex_of_real (sqrt 3)

goal (1 subgoal):
 1. (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0 \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
- \<i> + 1 \<noteq> complex_of_real (sqrt 3)

goal (1 subgoal):
 1. (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0 \<Longrightarrow> False
[PROOF STEP]
assume
          "(1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0"
[PROOF STATE]
proof (state)
this:
(1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0

goal (1 subgoal):
 1. (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0 \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
- \<i> + 1 \<noteq> complex_of_real (sqrt 3)
(1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0
[PROOF STEP]
have
          "x = (-complex_of_real (sqrt 3) - \<i>)/(1 - complex_of_real (sqrt 3) - \<i>)"
[PROOF STATE]
proof (prove)
using this:
- \<i> + 1 \<noteq> complex_of_real (sqrt 3)
(1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0

goal (1 subgoal):
 1. x = (- complex_of_real (sqrt 3) - \<i>) / (1 - complex_of_real (sqrt 3) - \<i>)
[PROOF STEP]
by (auto simp: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
x = (- complex_of_real (sqrt 3) - \<i>) / (1 - complex_of_real (sqrt 3) - \<i>)

goal (1 subgoal):
 1. (1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) = 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
x = (- complex_of_real (sqrt 3) - \<i>) / (1 - complex_of_real (sqrt 3) - \<i>)

goal (1 subgoal):
 1. False
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
x = (- complex_of_real (sqrt 3) - \<i>) / (1 - complex_of_real (sqrt 3) - \<i>)
Im y < sqrt 3 * Re y

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp: hy field_simps Im_divide Re_divide)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>) \<noteq> 0

goal (1 subgoal):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1 \<Longrightarrow> cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) / cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < 1
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
hence "cmod (x - (1/2 + sqrt(3)/6 * \<i>)) < sqrt 3 / 3"
[PROOF STATE]
proof (prove)
using this:
cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>))

goal (1 subgoal):
 1. cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / 3
[PROOF STEP]
apply (subst(3) abs_of_pos[symmetric, of 3])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> 0 < 3
 2. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / \<bar>3\<bar>
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / \<bar>3\<bar>
[PROOF STEP]
apply (subst real_sqrt_abs2[symmetric], subst real_sqrt_divide[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt (3 / (3 * 3))
[PROOF STEP]
apply (subst cmod_def, subst real_sqrt_less_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> (Re (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)))\<^sup>2 + (Im (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)))\<^sup>2 < 3 / (3 * 3)
[PROOF STEP]
apply (rule mult_right_less_imp_less[of _ "sqrt 3 /3"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> ((Re (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)))\<^sup>2 + (Im (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)))\<^sup>2) * (sqrt 3 / 3) < 3 / (3 * 3) * (sqrt 3 / 3)
 2. cmod ((- 1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) < cmod ((1 - complex_of_real (sqrt 3) - \<i>) * x + (complex_of_real (sqrt 3) + \<i>)) \<Longrightarrow> 0 \<le> sqrt 3 / 3
[PROOF STEP]
by (auto simp: cmod_def power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / 3

goal (1 subgoal):
 1. \<And>x. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<Longrightarrow> x \<in> upper_circle_01
[PROOF STEP]
thus "x \<in> upper_circle_01"
[PROOF STATE]
proof (prove)
using this:
cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / 3

goal (1 subgoal):
 1. x \<in> upper_circle_01
[PROOF STEP]
by (auto simp: upper_circle_01_def)
[PROOF STATE]
proof (state)
this:
x \<in> upper_circle_01

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<subseteq> upper_circle_01

goal (1 subgoal):
 1. upper_circle_01 \<subseteq> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
show "upper_circle_01 \<subseteq> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. sqrt 3 * Re x > Im x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_circle_01 \<subseteq> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
assume "x \<in> upper_circle_01"
[PROOF STATE]
proof (state)
this:
x \<in> upper_circle_01

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
hence "cmod (x - (1/2 + sqrt(3)/6 * \<i>)) < sqrt 3 / 3"
[PROOF STATE]
proof (prove)
using this:
x \<in> upper_circle_01

goal (1 subgoal):
 1. cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / 3
[PROOF STEP]
by (force simp: upper_circle_01_def)
[PROOF STATE]
proof (state)
this:
cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / 3

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
hence "sqrt ((Re x - 1/2)^2 + (Im x - sqrt(3)/6)^2) < sqrt (1/3)"
[PROOF STATE]
proof (prove)
using this:
cmod (x - (1 / 2 + complex_of_real (sqrt 3 / 6) * \<i>)) < sqrt 3 / 3

goal (1 subgoal):
 1. sqrt ((Re x - 1 / 2)\<^sup>2 + (Im x - sqrt 3 / 6)\<^sup>2) < sqrt (1 / 3)
[PROOF STEP]
by (auto simp: cmod_def sqrt_divide_self_eq real_sqrt_inverse[symmetric])
[PROOF STATE]
proof (state)
this:
sqrt ((Re x - 1 / 2)\<^sup>2 + (Im x - sqrt 3 / 6)\<^sup>2) < sqrt (1 / 3)

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
hence 1: "- Im x * sqrt 3 + (Im x * (Im x * 3) + Re x * (Re x * 3)) < Re x * 3"
[PROOF STATE]
proof (prove)
using this:
sqrt ((Re x - 1 / 2)\<^sup>2 + (Im x - sqrt 3 / 6)\<^sup>2) < sqrt (1 / 3)

goal (1 subgoal):
 1. - Im x * sqrt 3 + (Im x * (Im x * 3) + Re x * (Re x * 3)) < Re x * 3
[PROOF STEP]
by (auto simp: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
- Im x * sqrt 3 + (Im x * (Im x * 3) + Re x * (Re x * 3)) < Re x * 3

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
have 2: "- Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) < Re x * sqrt 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) < Re x * sqrt 3
[PROOF STEP]
apply (rule mult_right_less_imp_less[of _ "sqrt 3"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (- Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3))) * sqrt 3 < Re x * sqrt 3 * sqrt 3
 2. 0 \<le> sqrt 3
[PROOF STEP]
apply (subst mult.assoc[of _ "sqrt 3"], subst real_sqrt_mult_self)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (- Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3))) * sqrt 3 < Re x * \<bar>3\<bar>
 2. 0 \<le> sqrt 3
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
- Im x * sqrt 3 + (Im x * (Im x * 3) + Re x * (Re x * 3)) < Re x * 3

goal (2 subgoals):
 1. (- Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3))) * sqrt 3 < Re x * \<bar>3\<bar>
 2. 0 \<le> sqrt 3
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
- Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) < Re x * sqrt 3

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
have "sqrt 3 + (-Im x) / (Im x * Im x + Re x * Re x) <
          Re x * sqrt 3 / (Im x * Im x + Re x * Re x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt 3 + - Im x / (Im x * Im x + Re x * Re x) < Re x * sqrt 3 / (Im x * Im x + Re x * Re x)
[PROOF STEP]
apply (rule mult_right_less_imp_less[of _ "(Im x * Im x + Re x * Re x)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (sqrt 3 + - Im x / (Im x * Im x + Re x * Re x)) * (Im x * Im x + Re x * Re x) < Re x * sqrt 3 / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 2. 0 \<le> Im x * Im x + Re x * Re x
[PROOF STEP]
apply (rule subst, rule arg_cong2[of _ _ _ _ "(<)"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ?a6 = (sqrt 3 + - Im x / (Im x * Im x + Re x * Re x)) * (Im x * Im x + Re x * Re x)
 2. ?c6 = Re x * sqrt 3 / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 3. ?a6 < ?c6
 4. 0 \<le> Im x * Im x + Re x * Re x
[PROOF STEP]
prefer 3
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ?a6 < ?c6
 2. ?a6 = (sqrt 3 + - Im x / (Im x * Im x + Re x * Re x)) * (Im x * Im x + Re x * Re x)
 3. ?c6 = Re x * sqrt 3 / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 4. 0 \<le> Im x * Im x + Re x * Re x
[PROOF STEP]
apply (rule 2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. - Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) = (sqrt 3 + - Im x / (Im x * Im x + Re x * Re x)) * (Im x * Im x + Re x * Re x)
 2. Re x * sqrt 3 = Re x * sqrt 3 / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 3. 0 \<le> Im x * Im x + Re x * Re x
[PROOF STEP]
apply (subst distrib_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. - Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) = sqrt 3 * (Im x * Im x + Re x * Re x) + - Im x / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 2. Re x * sqrt 3 = Re x * sqrt 3 / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 3. 0 \<le> Im x * Im x + Re x * Re x
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
- Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) < Re x * sqrt 3

goal (3 subgoals):
 1. - Im x + (Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3)) = sqrt 3 * (Im x * Im x + Re x * Re x) + - Im x / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 2. Re x * sqrt 3 = Re x * sqrt 3 / (Im x * Im x + Re x * Re x) * (Im x * Im x + Re x * Re x)
 3. 0 \<le> Im x * Im x + Re x * Re x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3) - Im x < Re x * sqrt 3; Im x \<noteq> 0\<rbrakk> \<Longrightarrow> Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3) = sqrt 3 * (Im x * Im x + Re x * Re x)
 2. \<lbrakk>Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3) - Im x < Re x * sqrt 3; Re x \<noteq> 0\<rbrakk> \<Longrightarrow> Im x * (Im x * sqrt 3) + Re x * (Re x * sqrt 3) = sqrt 3 * (Im x * Im x + Re x * Re x)
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
sqrt 3 + - Im x / (Im x * Im x + Re x * Re x) < Re x * sqrt 3 / (Im x * Im x + Re x * Re x)

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
hence "0 < - Im (1/x-1) + sqrt 3 * Re (1/x-1)"
[PROOF STATE]
proof (prove)
using this:
sqrt 3 + - Im x / (Im x * Im x + Re x * Re x) < Re x * sqrt 3 / (Im x * Im x + Re x * Re x)

goal (1 subgoal):
 1. 0 < - Im (1 / x - 1) + sqrt 3 * Re (1 / x - 1)
[PROOF STEP]
by (auto simp: power2_eq_square algebra_simps Re_divide Im_divide)
[PROOF STATE]
proof (state)
this:
0 < - Im (1 / x - 1) + sqrt 3 * Re (1 / x - 1)

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
hence "sqrt 3 * Re (1/x-1) > Im (1/x-1)"
[PROOF STATE]
proof (prove)
using this:
0 < - Im (1 / x - 1) + sqrt 3 * Re (1 / x - 1)

goal (1 subgoal):
 1. Im (1 / x - 1) < sqrt 3 * Re (1 / x - 1)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
Im (1 / x - 1) < sqrt 3 * Re (1 / x - 1)

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
hence "(1/x-1) \<in> {x. sqrt 3 * Re x > Im x}"
[PROOF STATE]
proof (prove)
using this:
Im (1 / x - 1) < sqrt 3 * Re (1 / x - 1)

goal (1 subgoal):
 1. 1 / x - 1 \<in> {x. Im x < sqrt 3 * Re x}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
1 / x - 1 \<in> {x. Im x < sqrt 3 * Re x}

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 / x - 1 \<in> {x. Im x < sqrt 3 * Re x}

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
have "1/x = (1/x-1) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / x = 1 / x - 1 + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / x = 1 / x - 1 + 1

goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle_01 \<Longrightarrow> x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 / x - 1 \<in> {x. Im x < sqrt 3 * Re x}
1 / x = 1 / x - 1 + 1
[PROOF STEP]
show "x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. sqrt 3 * Re x > Im x}}"
[PROOF STATE]
proof (prove)
using this:
1 / x - 1 \<in> {x. Im x < sqrt 3 * Re x}
1 / x = 1 / x - 1 + 1

goal (1 subgoal):
 1. x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
upper_circle_01 \<subseteq> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AE_iff_null_sets:
  "N \<in> sets M \<Longrightarrow> N \<in> null_sets M \<longleftrightarrow> (AE x in M. x \<notin> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<in> sets M \<Longrightarrow> (N \<in> null_sets M) = (AE x in M. x \<notin> N)
[PROOF STEP]
using Int_absorb1[OF sets.sets_into_space, of N M]
[PROOF STATE]
proof (prove)
using this:
N \<in> sets M \<Longrightarrow> space M \<inter> N = N

goal (1 subgoal):
 1. N \<in> sets M \<Longrightarrow> (N \<in> null_sets M) = (AE x in M. x \<notin> N)
[PROOF STEP]
by (subst AE_iff_null) (auto simp: Int_def[symmetric])


[STATEMENT]
lemma fold_max_rev_eq:
  fixes xs :: "('a :: linorder) list"
  assumes "xs \<noteq> []"
  shows "List.fold max (tl xs) (hd xs) = List.fold max (tl (rev xs)) (hd (rev xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold max (tl xs) (hd xs) = fold max (tl (rev xs)) (hd (rev xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. fold max (tl xs) (hd xs) = fold max (tl (rev xs)) (hd (rev xs))
[PROOF STEP]
by (simp add: Max.set_eq_fold [symmetric])


[STATEMENT]
lemma transpose_permutes:
  assumes "i< n"
  assumes "j < n"
  shows "transpose i j permutes {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.transpose i j permutes {..<n}
[PROOF STEP]
unfolding permutes_def transpose_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<notin> {..<n} \<longrightarrow> (id \<circ> Transposition.transpose i j) x = x) \<and> (\<forall>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x. x \<notin> {..<n} \<longrightarrow> (id \<circ> Transposition.transpose i j) x = x
 2. \<forall>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
show "\<forall>x. x \<notin> {..<n} \<longrightarrow> Fun.swap i j id x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<notin> {..<n} \<longrightarrow> (id \<circ> Transposition.transpose i j) x = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < n
j < n

goal (1 subgoal):
 1. \<forall>x. x \<notin> {..<n} \<longrightarrow> (id \<circ> Transposition.transpose i j) x = x
[PROOF STEP]
by (auto simp: Transposition.transpose_def)
[PROOF STATE]
proof (state)
this:
\<forall>x. x \<notin> {..<n} \<longrightarrow> (id \<circ> Transposition.transpose i j) x = x

goal (1 subgoal):
 1. \<forall>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
show "\<forall>y. \<exists>!x. Fun.swap i j id x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
show "\<exists>!x. Fun.swap i j id x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
using swap_id_eq[of i j y]
[PROOF STATE]
proof (prove)
using this:
(id \<circ> Transposition.transpose i j) y = (if y = i then j else if y = j then i else y)

goal (1 subgoal):
 1. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y
[PROOF STEP]
by (metis eq_id_iff swap_apply(1) swap_apply(2) swap_id_eq swap_self)
[PROOF STATE]
proof (state)
this:
\<exists>!x. (id \<circ> Transposition.transpose i j) x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>y. \<exists>!x. (id \<circ> Transposition.transpose i j) x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_mset_respects_domain_permutation:
  shows "(\<lambda>f. image_mset f (mset_set A)) respects (domain_permutation A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. image_mset f (mset_set A)) respects domain_permutation A B
[PROOF STEP]
proof (rule congruentI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y z. (y, z) \<in> domain_permutation A B \<Longrightarrow> image_mset y (mset_set A) = image_mset z (mset_set A)
[PROOF STEP]
fix f f'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y z. (y, z) \<in> domain_permutation A B \<Longrightarrow> image_mset y (mset_set A) = image_mset z (mset_set A)
[PROOF STEP]
assume "(f, f') \<in> domain_permutation A B"
[PROOF STATE]
proof (state)
this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. \<And>y z. (y, z) \<in> domain_permutation A B \<Longrightarrow> image_mset y (mset_set A) = image_mset z (mset_set A)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(f, f') \<in> domain_permutation A B
[PROOF STEP]
obtain p where "p permutes A" and "\<forall>x\<in>A. f x = f' (p x)"
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> domain_permutation A B

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding domain_permutation_def
[PROOF STATE]
proof (prove)
using this:
(f, f') \<in> {(f, f'). (f, f') \<in> (A \<rightarrow>\<^sub>E B) \<times> (A \<rightarrow>\<^sub>E B) \<and> (\<exists>p. p permutes A \<and> (\<forall>x\<in>A. f x = f' (p x)))}

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes A; \<forall>x\<in>A. f x = f' (p x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)

goal (1 subgoal):
 1. \<And>y z. (y, z) \<in> domain_permutation A B \<Longrightarrow> image_mset y (mset_set A) = image_mset z (mset_set A)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
[PROOF STEP]
show "image_mset f (mset_set A) = image_mset f' (mset_set A)"
[PROOF STATE]
proof (prove)
using this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)

goal (1 subgoal):
 1. image_mset f (mset_set A) = image_mset f' (mset_set A)
[PROOF STEP]
using permutes_implies_image_mset_eq
[PROOF STATE]
proof (prove)
using this:
p permutes A
\<forall>x\<in>A. f x = f' (p x)
\<lbrakk>?p permutes ?A; \<And>x. x \<in> ?A \<Longrightarrow> ?f x = ?f' (?p x)\<rbrakk> \<Longrightarrow> image_mset ?f' (mset_set ?A) = image_mset ?f (mset_set ?A)

goal (1 subgoal):
 1. image_mset f (mset_set A) = image_mset f' (mset_set A)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
image_mset f (mset_set A) = image_mset f' (mset_set A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_mult:
  assumes "countable (elts A)" "countable (elts B)"
  shows "countable (elts (A*B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (elts (A * B))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. countable (elts (A * B))
[PROOF STEP]
have "vcard A \<le> \<aleph>0" "vcard B \<le> \<aleph>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard A \<le> \<aleph>0 &&& vcard B \<le> \<aleph>0
[PROOF STEP]
using assms countable_iff_le_Aleph0
[PROOF STATE]
proof (prove)
using this:
countable (elts A)
countable (elts B)
countable (elts ?A) = (vcard ?A \<le> \<aleph>0)

goal (1 subgoal):
 1. vcard A \<le> \<aleph>0 &&& vcard B \<le> \<aleph>0
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
vcard A \<le> \<aleph>0
vcard B \<le> \<aleph>0

goal (1 subgoal):
 1. countable (elts (A * B))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vcard A \<le> \<aleph>0
vcard B \<le> \<aleph>0
[PROOF STEP]
have "vcard (A*B) \<le> \<aleph>0"
[PROOF STATE]
proof (prove)
using this:
vcard A \<le> \<aleph>0
vcard B \<le> \<aleph>0

goal (1 subgoal):
 1. vcard (A * B) \<le> \<aleph>0
[PROOF STEP]
unfolding vcard_mult
[PROOF STATE]
proof (prove)
using this:
vcard A \<le> \<aleph>0
vcard B \<le> \<aleph>0

goal (1 subgoal):
 1. vcard A \<otimes> vcard B \<le> \<aleph>0
[PROOF STEP]
by (metis InfCard_csquare_eq cmult_le_mono Aleph_0 Card_\<omega> InfCard_def order_refl)
[PROOF STATE]
proof (state)
this:
vcard (A * B) \<le> \<aleph>0

goal (1 subgoal):
 1. countable (elts (A * B))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vcard (A * B) \<le> \<aleph>0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vcard (A * B) \<le> \<aleph>0

goal (1 subgoal):
 1. countable (elts (A * B))
[PROOF STEP]
by (simp add: countable_iff_le_Aleph0)
[PROOF STATE]
proof (state)
this:
countable (elts (A * B))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) subgroupE:
  assumes "subgroup H G"
  shows "H \<subseteq> carrier G"
    and "H \<noteq> {}"
    and "\<And>a. a \<in> H \<Longrightarrow> inv a \<in> H"
    and "\<And>a b. \<lbrakk> a \<in> H; b \<in> H \<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (H \<subseteq> carrier G &&& H \<noteq> {}) &&& (\<And>a. a \<in> H \<Longrightarrow> inv a \<in> H) &&& (\<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subgroup H G

goal (1 subgoal):
 1. (H \<subseteq> carrier G &&& H \<noteq> {}) &&& (\<And>a. a \<in> H \<Longrightarrow> inv a \<in> H) &&& (\<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H)
[PROOF STEP]
unfolding subgroup_def[of H G]
[PROOF STATE]
proof (prove)
using this:
(H \<subseteq> carrier G \<and> (\<forall>x y. x \<in> H \<longrightarrow> y \<in> H \<longrightarrow> x \<otimes> y \<in> H)) \<and> \<one> \<in> H \<and> (\<forall>x. x \<in> H \<longrightarrow> inv x \<in> H)

goal (1 subgoal):
 1. (H \<subseteq> carrier G &&& H \<noteq> {}) &&& (\<And>a. a \<in> H \<Longrightarrow> inv a \<in> H) &&& (\<And>a b. \<lbrakk>a \<in> H; b \<in> H\<rbrakk> \<Longrightarrow> a \<otimes> b \<in> H)
[PROOF STEP]
by auto


[STATEMENT]
lemma mat_inc_seq_positive_transform:
  assumes dfn: "\<And>n. f n \<in> carrier_mat d d"
    and inc: "\<And>n. f n \<le>\<^sub>L f (Suc n)"
  shows "\<And>n. f n - f 0 \<in> carrier_mat d d" and "\<And>n. (f n - f 0) \<le>\<^sub>L (f (Suc n) - f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. f n - f 0 \<in> carrier_mat d d) &&& (\<And>n. f n - f 0 \<le>\<^sub>L f (Suc n) - f 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. f n - f 0 \<in> carrier_mat d d
 2. \<And>n. f n - f 0 \<le>\<^sub>L f (Suc n) - f 0
[PROOF STEP]
show "\<And>n. f n - f 0 \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. f n - f 0 \<in> carrier_mat d d
[PROOF STEP]
using dfn
[PROOF STATE]
proof (prove)
using this:
f ?n \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. f n - f 0 \<in> carrier_mat d d
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f ?n - f 0 \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. f n - f 0 \<le>\<^sub>L f (Suc n) - f 0
[PROOF STEP]
have "f 0 \<le>\<^sub>L f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f 0 \<le>\<^sub>L f 0
[PROOF STEP]
using lowner_le_refl[of "f 0" d] dfn
[PROOF STATE]
proof (prove)
using this:
f 0 \<in> carrier_mat d d \<Longrightarrow> f 0 \<le>\<^sub>L f 0
f ?n \<in> carrier_mat d d

goal (1 subgoal):
 1. f 0 \<le>\<^sub>L f 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f 0 \<le>\<^sub>L f 0

goal (1 subgoal):
 1. \<And>n. f n - f 0 \<le>\<^sub>L f (Suc n) - f 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f 0 \<le>\<^sub>L f 0
[PROOF STEP]
show "(f n - f 0) \<le>\<^sub>L (f (Suc n) - f 0)" for n
[PROOF STATE]
proof (prove)
using this:
f 0 \<le>\<^sub>L f 0

goal (1 subgoal):
 1. f n - f 0 \<le>\<^sub>L f (Suc n) - f 0
[PROOF STEP]
using lowner_le_minus[of "f n" d "f (Suc n)" "f 0" "f 0"] dfn inc
[PROOF STATE]
proof (prove)
using this:
f 0 \<le>\<^sub>L f 0
\<lbrakk>f n \<in> carrier_mat d d; f (Suc n) \<in> carrier_mat d d; f 0 \<in> carrier_mat d d; f 0 \<in> carrier_mat d d; f n \<le>\<^sub>L f (Suc n); f 0 \<le>\<^sub>L f 0\<rbrakk> \<Longrightarrow> f n - f 0 \<le>\<^sub>L f (Suc n) - f 0
f ?n \<in> carrier_mat d d
f ?n \<le>\<^sub>L f (Suc ?n)

goal (1 subgoal):
 1. f n - f 0 \<le>\<^sub>L f (Suc n) - f 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f ?n - f 0 \<le>\<^sub>L f (Suc ?n) - f 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_mat_hermitian:
  assumes "A \<in> carrier_mat n n"
  and "B \<in> carrier_mat n' n'"
  and "0 < n"
  and "0 < n'"
  and "hermitian A"
  and "hermitian B"
  shows "hermitian (tensor_mat A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (A \<Otimes> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n' n'
0 < n
0 < n'
hermitian A
hermitian B

goal (1 subgoal):
 1. hermitian (A \<Otimes> B)
[PROOF STEP]
by (metis hermitian_def tensor_mat_adjoint)


[STATEMENT]
lemma inj_on_imp_infinite_image: "\<lbrakk> infinite A; inj_on f A \<rbrakk> \<Longrightarrow> infinite (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite A; inj_on f A\<rbrakk> \<Longrightarrow> infinite (f ` A)
[PROOF STEP]
apply (frule card_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite A; inj_on f A; card (f ` A) = card A\<rbrakk> \<Longrightarrow> infinite (f ` A)
[PROOF STEP]
apply (fastforce simp: card_eq_0_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma omap_list_all2_conv: "omap f xs = Some ys \<longleftrightarrow> (list_all2 (\<lambda>x y. f x = Some y)) xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys
[PROOF STEP]
apply (induction xs arbitrary: ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys. (omap f [] = Some ys) = list_all2 (\<lambda>x y. f x = Some y) [] ys
 2. \<And>a xs ys. (\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys) \<Longrightarrow> (omap f (a # xs) = Some ys) = list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys
[PROOF STEP]
apply (auto split: Option.bind_splits simp: )
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys; f a = None; list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys\<rbrakk> \<Longrightarrow> False
 2. \<And>a xs ys v. \<lbrakk>\<And>ys. \<not> list_all2 (\<lambda>x y. f x = Some y) xs ys; omap f xs = None; f a = Some v; list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys\<rbrakk> \<Longrightarrow> False
 3. \<And>a xs ys v va. \<lbrakk>\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys; list_all2 (\<lambda>x y. f x = Some y) xs va; f a = Some v; list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys\<rbrakk> \<Longrightarrow> v # va = ys
[PROOF STEP]
apply (simp add: list_all2_Cons1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs ys v. \<lbrakk>\<And>ys. \<not> list_all2 (\<lambda>x y. f x = Some y) xs ys; omap f xs = None; f a = Some v; list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys\<rbrakk> \<Longrightarrow> False
 2. \<And>a xs ys v va. \<lbrakk>\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys; list_all2 (\<lambda>x y. f x = Some y) xs va; f a = Some v; list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys\<rbrakk> \<Longrightarrow> v # va = ys
[PROOF STEP]
apply (simp add: list_all2_Cons1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs ys v va. \<lbrakk>\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys; list_all2 (\<lambda>x y. f x = Some y) xs va; f a = Some v; list_all2 (\<lambda>x y. f x = Some y) (a # xs) ys\<rbrakk> \<Longrightarrow> v # va = ys
[PROOF STEP]
apply (simp add: list_all2_Cons1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs ys v va. \<lbrakk>\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys; list_all2 (\<lambda>x y. f x = Some y) xs va; f a = Some v; \<exists>zs. ys = v # zs \<and> list_all2 (\<lambda>x y. f x = Some y) xs zs\<rbrakk> \<Longrightarrow> v # va = ys
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs v va zs. \<lbrakk>\<And>ys. (omap f xs = Some ys) = list_all2 (\<lambda>x y. f x = Some y) xs ys; list_all2 (\<lambda>x y. f x = Some y) xs va; f a = Some v; list_all2 (\<lambda>x y. f x = Some y) xs zs\<rbrakk> \<Longrightarrow> va = zs
[PROOF STEP]
by (metis option.inject)


[STATEMENT]
lemma real_diag_decomp_hermitian:
  fixes A::"complex Matrix.mat"
  assumes "real_diag_decomp A B U"
  shows "hermitian A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
have ud: "unitary_diag A B U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary_diag A B U
[PROOF STEP]
using assms real_diag_decompD
[PROOF STATE]
proof (prove)
using this:
real_diag_decomp A B U
real_diag_decomp ?A ?B ?U \<Longrightarrow> unitary_diag ?A ?B ?U
real_diag_decomp ?A ?B ?U \<Longrightarrow> \<forall>i<dim_row ?B. ?B $$ (i, i) \<in> \<real>

goal (1 subgoal):
 1. unitary_diag A B U
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unitary_diag A B U

goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
hence "A = U * B * (Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
using this:
unitary_diag A B U

goal (1 subgoal):
 1. A = U * B * Complex_Matrix.adjoint U
[PROOF STEP]
by (simp add: unitarily_equiv_eq)
[PROOF STATE]
proof (state)
this:
A = U * B * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
have "Complex_Matrix.adjoint A =
    Complex_Matrix.adjoint (U * B * (Complex_Matrix.adjoint U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint A = Complex_Matrix.adjoint (U * B * Complex_Matrix.adjoint U)
[PROOF STEP]
using ud assms unitarily_equiv_eq unitary_diag_imp_unitarily_equiv
[PROOF STATE]
proof (prove)
using this:
unitary_diag A B U
real_diag_decomp A B U
unitarily_equiv ?A ?B ?U \<Longrightarrow> ?A = ?U * ?B * Complex_Matrix.adjoint ?U
unitary_diag ?A ?B ?U \<Longrightarrow> unitarily_equiv ?A ?B ?U

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

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

goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
have "... = Complex_Matrix.adjoint (Complex_Matrix.adjoint U) *
    Complex_Matrix.adjoint B * Complex_Matrix.adjoint U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint (U * B * Complex_Matrix.adjoint U) = Complex_Matrix.adjoint (Complex_Matrix.adjoint U) * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U
[PROOF STEP]
by (smt (z3) ud Complex_Matrix.adjoint_adjoint Complex_Matrix.unitary_def
        adjoint_dim_col adjoint_mult assms assoc_mult_mat calculation
        carrier_matD(2) carrier_mat_triv index_mult_mat(2) index_mult_mat(3)
        similar_mat_witD2(5) similar_mat_wit_dim_row unitary_diagD(1)
        unitary_diagD(3))
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (U * B * Complex_Matrix.adjoint U) = Complex_Matrix.adjoint (Complex_Matrix.adjoint U) * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U

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

goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
have "... = U * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint (Complex_Matrix.adjoint U) * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U = U * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U
[PROOF STEP]
by (simp add: Complex_Matrix.adjoint_adjoint)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (Complex_Matrix.adjoint U) * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U = U * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U

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

goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
have "... = U * B * Complex_Matrix.adjoint U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U = U * B * Complex_Matrix.adjoint U
[PROOF STEP]
using real_diagonal_hermitian
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat ?n ?n; diagonal_mat ?B; \<forall>i<dim_row ?B. ?B $$ (i, i) \<in> \<real>\<rbrakk> \<Longrightarrow> hermitian ?B

goal (1 subgoal):
 1. U * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U = U * B * Complex_Matrix.adjoint U
[PROOF STEP]
by (metis assms hermitian_def real_diag_decomp_def similar_mat_witD(5)
        unitary_diagD(1) unitary_diagD(2))
[PROOF STATE]
proof (state)
this:
U * Complex_Matrix.adjoint B * Complex_Matrix.adjoint U = U * B * Complex_Matrix.adjoint U

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

goal (1 subgoal):
 1. hermitian A
[PROOF STEP]
have "... = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * B * Complex_Matrix.adjoint U = A
[PROOF STEP]
using \<open>A = U * B * (Complex_Matrix.adjoint U)\<close>
[PROOF STATE]
proof (prove)
using this:
A = U * B * Complex_Matrix.adjoint U

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_strict_subset_eq:
  fixes a::"'a::linorder"
  assumes non_empty: "a \<le> b"
  shows "({a..b} \<subset> {c..d}) = (c \<le> a \<and> b \<le> d \<and> (a = c \<longrightarrow> b \<noteq> d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a..b} \<subset> {c..d}) = (c \<le> a \<and> b \<le> d \<and> (a = c \<longrightarrow> b \<noteq> d))
[PROOF STEP]
apply (insert non_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> ({a..b} \<subset> {c..d}) = (c \<le> a \<and> b \<le> d \<and> (a = c \<longrightarrow> b \<noteq> d))
[PROOF STEP]
apply (subst psubset_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> ({a..b} \<subseteq> {c..d} \<and> {a..b} \<noteq> {c..d}) = (c \<le> a \<and> b \<le> d \<and> (a = c \<longrightarrow> b \<noteq> d))
[PROOF STEP]
apply (subst range_subset_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> ((c \<le> a \<and> b \<le> d) \<and> {a..b} \<noteq> {c..d}) = (c \<le> a \<and> b \<le> d \<and> (a = c \<longrightarrow> b \<noteq> d))
[PROOF STEP]
apply (subst range_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> ((c \<le> a \<and> b \<le> d) \<and> \<not> (a = c \<and> b = d)) = (c \<le> a \<and> b \<le> d \<and> (a = c \<longrightarrow> b \<noteq> d))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mUnionM_add [simp]: "mUnionM (A + B) = munionM (mUnionM A) (mUnionM B)" for A B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mUnionM (A + B) = munionM (mUnionM A) (mUnionM B)
[PROOF STEP]
by(subst munionM_mUnionM2)(simp add: mUnionM_def)


[STATEMENT]
lemma matrix_to_lpolies_valuate_scalarP:
  assumes "i < dim_row A"
assumes "dim_col A = dim_vec x"
shows "(matrix_to_lpolies A!i) \<lbrace> ($)x \<rbrace> = (row A i) \<bullet> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_lpolies A ! i \<lbrace> ($) x \<rbrace> = row A i \<bullet> x
[PROOF STEP]
using vec_to_lpoly_valuate_equiv_dot_prod[of "row A i" x]
[PROOF STATE]
proof (prove)
using this:
dim_vec (row A i) = dim_vec x \<Longrightarrow> vec_to_lpoly (row A i) \<lbrace> ($) x \<rbrace> = row A i \<bullet> x

goal (1 subgoal):
 1. matrix_to_lpolies A ! i \<lbrace> ($) x \<rbrace> = row A i \<bullet> x
[PROOF STEP]
by (simp add: assms(1) assms(2))


[STATEMENT]
lemma scalar_prod_uminus_right[simp]: assumes dim: "dim_vec v = dim_vec (w :: 'a :: ring vec)"
  shows "v \<bullet> - w = - (v \<bullet> w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<bullet> - w = - (v \<bullet> w)
[PROOF STEP]
unfolding scalar_prod_def dim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (- w). v $ i * (- w) $ i) = - (\<Sum>i = 0..<dim_vec w. v $ i * w $ i)
[PROOF STEP]
by (subst sum_negf[symmetric], rule sum.cong, auto)


[STATEMENT]
lemma filter_mset_empty_if_finite_and_filter_set_empty:
  assumes
    "{x \<in> X. P x} = {}" and
    "finite X"
  shows "{#x \<in># mset_set X. P x#} = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P (mset_set X) = {#}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filter_mset P (mset_set X) = {#}
[PROOF STEP]
have empty_empty: "\<And>Y. set_mset Y = {} \<Longrightarrow> Y = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Y. set_mset Y = {} \<Longrightarrow> Y = {#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_mset ?Y = {} \<Longrightarrow> ?Y = {#}

goal (1 subgoal):
 1. filter_mset P (mset_set X) = {#}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
{x \<in> X. P x} = {}
finite X
[PROOF STEP]
have "set_mset {#x \<in># mset_set X. P x#} = {}"
[PROOF STATE]
proof (prove)
using this:
{x \<in> X. P x} = {}
finite X

goal (1 subgoal):
 1. set_mset (filter_mset P (mset_set X)) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_mset (filter_mset P (mset_set X)) = {}

goal (1 subgoal):
 1. filter_mset P (mset_set X) = {#}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_mset (filter_mset P (mset_set X)) = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_mset (filter_mset P (mset_set X)) = {}

goal (1 subgoal):
 1. filter_mset P (mset_set X) = {#}
[PROOF STEP]
by (rule empty_empty)
[PROOF STATE]
proof (state)
this:
filter_mset P (mset_set X) = {#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_span_insert_eq:
  assumes "(x - y) \<in> span S"
    shows "span(insert x S) = span(insert y S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert x S) = span (insert y S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (insert x S) = span (insert y S)
[PROOF STEP]
have *: "span(insert x S) \<subseteq> span(insert y S)" if "(x - y) \<in> span S" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert x S) \<subseteq> span (insert y S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (insert x S) \<subseteq> span (insert y S)
[PROOF STEP]
have 1: "(r *s x - r *s y) \<in> span S" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r *s x - r *s y \<in> span S
[PROOF STEP]
by (metis scale_right_diff_distrib span_scale that)
[PROOF STATE]
proof (state)
this:
?r *s x - ?r *s y \<in> span S

goal (1 subgoal):
 1. span (insert x S) \<subseteq> span (insert y S)
[PROOF STEP]
have 2: "(z - k *s y) - k *s (x - y) = z - k *s x" for  z k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z - k *s y - k *s (x - y) = z - k *s x
[PROOF STEP]
by (simp add: scale_right_diff_distrib)
[PROOF STATE]
proof (state)
this:
?z - ?k *s y - ?k *s (x - y) = ?z - ?k *s x

goal (1 subgoal):
 1. span (insert x S) \<subseteq> span (insert y S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert x S) \<subseteq> span (insert y S)
[PROOF STEP]
apply (clarsimp simp add: span_breakdown_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x k. x - k *s x \<in> span S \<Longrightarrow> \<exists>k. x - k *s y \<in> span S
[PROOF STEP]
by (metis 1 2 diff_add_cancel scale_right_diff_distrib span_add_eq)
[PROOF STATE]
proof (state)
this:
span (insert x S) \<subseteq> span (insert y S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x - ?y \<in> span S \<Longrightarrow> span (insert ?x S) \<subseteq> span (insert ?y S)

goal (1 subgoal):
 1. span (insert x S) = span (insert y S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (insert x S) = span (insert y S)
[PROOF STEP]
apply (intro subset_antisym * assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y - x \<in> span S
[PROOF STEP]
using assms subspace_neg subspace_span minus_diff_eq
[PROOF STATE]
proof (prove)
using this:
x - y \<in> span S
\<lbrakk>subspace ?S; ?x \<in> ?S\<rbrakk> \<Longrightarrow> - ?x \<in> ?S
subspace (span ?S)
- (?a - ?b) = ?b - ?a

goal (1 subgoal):
 1. y - x \<in> span S
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
span (insert x S) = span (insert y S)

goal:
No subgoals!
[PROOF STEP]
qed