[STATEMENT]
lemma csqrt_minus [simp]:
  assumes "Im x < 0 \<or> (Im x = 0 \<and> 0 \<le> Re x)"
  shows "csqrt (- x) = \<i> * csqrt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
have "csqrt ((\<i> * csqrt x)^2) = \<i> * csqrt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csqrt ((\<i> * csqrt x)\<^sup>2) = \<i> * csqrt x
[PROOF STEP]
proof (rule csqrt_square)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < Re (\<i> * csqrt x) \<or> Re (\<i> * csqrt x) = 0 \<and> 0 \<le> Im (\<i> * csqrt x)
[PROOF STEP]
have "Im (csqrt x) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (csqrt x) \<le> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Im x < 0 \<or> Im x = 0 \<and> 0 \<le> Re x

goal (1 subgoal):
 1. Im (csqrt x) \<le> 0
[PROOF STEP]
by (auto simp add: cmod_eq_Re mult_le_0_iff field_simps complex_Re_le_cmod)
[PROOF STATE]
proof (state)
this:
Im (csqrt x) \<le> 0

goal (1 subgoal):
 1. 0 < Re (\<i> * csqrt x) \<or> Re (\<i> * csqrt x) = 0 \<and> 0 \<le> Im (\<i> * csqrt x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Im (csqrt x) \<le> 0
[PROOF STEP]
show "0 < Re (\<i> * csqrt x) \<or> Re (\<i> * csqrt x) = 0 \<and> 0 \<le> Im (\<i> * csqrt x)"
[PROOF STATE]
proof (prove)
using this:
Im (csqrt x) \<le> 0

goal (1 subgoal):
 1. 0 < Re (\<i> * csqrt x) \<or> Re (\<i> * csqrt x) = 0 \<and> 0 \<le> Im (\<i> * csqrt x)
[PROOF STEP]
by (auto simp add: Re_csqrt simp del: csqrt.simps)
[PROOF STATE]
proof (state)
this:
0 < Re (\<i> * csqrt x) \<or> Re (\<i> * csqrt x) = 0 \<and> 0 \<le> Im (\<i> * csqrt x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
csqrt ((\<i> * csqrt x)\<^sup>2) = \<i> * csqrt x

goal (1 subgoal):
 1. csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
csqrt ((\<i> * csqrt x)\<^sup>2) = \<i> * csqrt x

goal (1 subgoal):
 1. csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
have "(\<i> * csqrt x)^2 = - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<i> * csqrt x)\<^sup>2 = - x
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(\<i> * csqrt x)\<^sup>2 = - x

goal (1 subgoal):
 1. csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
csqrt (- x) = \<i> * csqrt x

goal (1 subgoal):
 1. csqrt (- x) = \<i> * csqrt x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
csqrt (- x) = \<i> * csqrt x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma binomial_fact':
  assumes "k \<le> n"
  shows "n choose k = fact n div (fact k * fact (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose k = fact n div (fact k * fact (n - k))
[PROOF STEP]
using binomial_fact_lemma [OF assms]
[PROOF STATE]
proof (prove)
using this:
fact k * fact (n - k) * (n choose k) = fact n

goal (1 subgoal):
 1. n choose k = fact n div (fact k * fact (n - k))
[PROOF STEP]
by (metis fact_nonzero mult_eq_0_iff nonzero_mult_div_cancel_left)


[STATEMENT]
lemma Max_the2: "\<lbrakk> A \<noteq> {}; finite A \<rbrakk> \<Longrightarrow>
  Max A = (THE x. x \<in> A \<and> (\<forall>y\<in>A. y \<le> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> Max A = (THE x. x \<in> A \<and> (\<forall>y\<in>A. y \<le> x))
[PROOF STEP]
apply (simp add: Max_the)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)) = (THE x. x \<in> A \<and> (\<forall>y\<in>A. y \<le> x))
[PROOF STEP]
apply (subgoal_tac "\<And>x. (\<forall>y\<in>A. y \<le> x) = (\<forall>y. y \<in> A \<longrightarrow> y \<le> x) ")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>A \<noteq> {}; finite A; \<And>x. (\<forall>y\<in>A. y \<le> x) = (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)) = (THE x. x \<in> A \<and> (\<forall>y\<in>A. y \<le> x))
 2. \<And>x. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> (\<forall>y\<in>A. y \<le> x) = (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> (\<forall>y\<in>A. y \<le> x) = (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)
 2. \<lbrakk>A \<noteq> {}; finite A; \<And>x. (\<forall>y\<in>A. y \<le> x) = (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)) = (THE x. x \<in> A \<and> (\<forall>y\<in>A. y \<le> x))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; finite A; \<And>x. (\<forall>y\<in>A. y \<le> x) = (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)\<rbrakk> \<Longrightarrow> (THE x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> y \<le> x)) = (THE x. x \<in> A \<and> (\<forall>y\<in>A. y \<le> x))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma odd_prime_gt_2_int:
 "2 < p" if "odd p" "prime p" for p :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
using prime_ge_2_int[OF \<open>prime p\<close>] \<open>odd p\<close>
[PROOF STATE]
proof (prove)
using this:
2 \<le> p
odd p

goal (1 subgoal):
 1. 2 < p
[PROOF STEP]
by (cases "p = 2") auto


[STATEMENT]
lemma formulasD:
  assumes "x \<in> formulas S"
  assumes "\<forall>i\<in>S. i \<in> A \<longleftrightarrow> i \<in> B"
  shows "A \<in> Rep_formula x \<longleftrightarrow> B \<in> Rep_formula x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> Rep_formula x) = (B \<in> Rep_formula x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> formulas S
\<forall>i\<in>S. (i \<in> A) = (i \<in> B)

goal (1 subgoal):
 1. (A \<in> Rep_formula x) = (B \<in> Rep_formula x)
[PROOF STEP]
unfolding formulas_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<forall>A B. (\<forall>i\<in>S. (i \<in> A) = (i \<in> B)) \<longrightarrow> (A \<in> Rep_formula x) = (B \<in> Rep_formula x)}
\<forall>i\<in>S. (i \<in> A) = (i \<in> B)

goal (1 subgoal):
 1. (A \<in> Rep_formula x) = (B \<in> Rep_formula x)
[PROOF STEP]
by simp


[STATEMENT]
lemma eventually_nonneg_add2 [eventually_nonzero_simps]:
  assumes "eventually_nonneg F g" "f \<in> o[F](g)"
  shows   "eventually_nonneg F (\<lambda>x. f x + g x :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x + g x)
[PROOF STEP]
using  landau_o.smallD[OF assms(2) zero_less_one] assms(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> 1 * norm (g x)
eventually_nonneg F g

goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x + g x)
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> 1 * norm (g x)
\<forall>\<^sub>F x in F. 0 \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 \<le> f x + g x
[PROOF STEP]
by eventually_elim simp_all


[STATEMENT]
lemma null_space_eq_left_null_space_transpose: "null_space A = left_null_space (transpose A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. null_space A = left_null_space (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
using left_null_space_eq_null_space_transpose[of "transpose A"]
[PROOF STATE]
proof (prove)
using this:
left_null_space (Finite_Cartesian_Product.transpose A) = null_space (Finite_Cartesian_Product.transpose (Finite_Cartesian_Product.transpose A))

goal (1 subgoal):
 1. null_space A = left_null_space (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
unfolding transpose_transpose
[PROOF STATE]
proof (prove)
using this:
left_null_space (Finite_Cartesian_Product.transpose A) = null_space A

goal (1 subgoal):
 1. null_space A = left_null_space (Finite_Cartesian_Product.transpose A)
[PROOF STEP]
..


[STATEMENT]
lemma exp_of_half_pi:
  fixes x:: real
  assumes "x = pi/2"
  shows "exp (\<i> * complex_of_real x) = \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (\<i> * complex_of_real x) = \<i>
[PROOF STEP]
using assms cis_conv_exp cis_pi_half
[PROOF STATE]
proof (prove)
using this:
x = pi / 2
cis ?b = exp (\<i> * complex_of_real ?b)
cis (pi / 2) = \<i>

goal (1 subgoal):
 1. exp (\<i> * complex_of_real x) = \<i>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma poly_reciprocal:
  fixes P::"'a::field poly"
  assumes hp: "degree P \<le> p" and hx: "x \<noteq> 0"
  shows "poly (reciprocal_poly p P) x = x^p * (poly P (inverse x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
have "poly (reciprocal_poly p P) x
      = poly ((Poly ((replicate (p - degree P) 0) @ rev (coeffs P)))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = poly (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) x
[PROOF STEP]
by (auto simp add: hx reflect_poly_def reciprocal_poly_def)
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p P) x = poly (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) x

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p P) x = poly (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) x

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
have "... = poly ((monom 1 (p - degree P)) * (reflect_poly P)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) x = poly (monom (1::'a) (p - degree P) * reflect_poly P) x
[PROOF STEP]
by (auto simp add: reflect_poly_def Poly_append)
[PROOF STATE]
proof (state)
this:
poly (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) x = poly (monom (1::'a) (p - degree P) * reflect_poly P) x

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (Poly (replicate (p - degree P) (0::'a) @ rev (coeffs P))) x = poly (monom (1::'a) (p - degree P) * reflect_poly P) x

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
have "... = x^(p - degree P) *  x ^ degree P * poly P (inverse x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (monom (1::'a) (p - degree P) * reflect_poly P) x = x ^ (p - degree P) * x ^ degree P * poly P (inverse x)
[PROOF STEP]
by (auto simp add: poly_reflect_poly_nz poly_monom hx)
[PROOF STATE]
proof (state)
this:
poly (monom (1::'a) (p - degree P) * reflect_poly P) x = x ^ (p - degree P) * x ^ degree P * poly P (inverse x)

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (monom (1::'a) (p - degree P) * reflect_poly P) x = x ^ (p - degree P) * x ^ degree P * poly P (inverse x)

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
have "... = x^p * poly P (inverse x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ (p - degree P) * x ^ degree P * poly P (inverse x) = x ^ p * poly P (inverse x)
[PROOF STEP]
by (auto simp add: hp power_add[symmetric])
[PROOF STATE]
proof (state)
this:
x ^ (p - degree P) * x ^ degree P * poly P (inverse x) = x ^ p * poly P (inverse x)

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)

goal (1 subgoal):
 1. poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p P) x = x ^ p * poly P (inverse x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma butlastAppend:
  shows "butlast (list1 @ list2) = (if list2 = [] then butlast list1 else (list1 @ butlast list2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (list1 @ list2) = (if list2 = [] then butlast list1 else list1 @ butlast list2)
[PROOF STEP]
by (induct list1) auto


[STATEMENT]
lemma smash_list_list_property_set:
  fixes l1 l2 :: "('a list*'a list) list"
  fixes a b:: "nat"
  shows "\<forall> (elem :: ('a list*'a list)). (elem \<in> (set (smash_list_list l1 l2)) \<longrightarrow>
    (\<exists> (elem1:: ('a list*'a list)). \<exists> (elem2:: ('a list*'a list)).
      (elem1 \<in> set(l1) \<and> elem2 \<in> set(l2) \<and> elem = (fst elem1@ fst elem2, snd elem1 @ snd elem2))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>elem. elem \<in> set (smash_list_list l1 l2) \<longrightarrow> (\<exists>elem1 elem2. elem1 \<in> set l1 \<and> elem2 \<in> set l2 \<and> elem = (fst elem1 @ fst elem2, snd elem1 @ snd elem2))
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (smash_list_list l1 l2) \<Longrightarrow> \<exists>aa ba. (aa, ba) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aa @ ab \<and> b = ba @ bb)
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (smash_list_list l1 l2) \<Longrightarrow> \<exists>aa ba. (aa, ba) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aa @ ab \<and> b = ba @ bb)
[PROOF STEP]
assume assum: "(a, b) \<in> set (smash_list_list l1 l2)"
[PROOF STATE]
proof (state)
this:
(a, b) \<in> set (smash_list_list l1 l2)

goal (1 subgoal):
 1. \<And>a b. (a, b) \<in> set (smash_list_list l1 l2) \<Longrightarrow> \<exists>aa ba. (aa, ba) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aa @ ab \<and> b = ba @ bb)
[PROOF STEP]
show "\<exists>aa ba. (aa, ba) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aa @ ab \<and> b = ba @ bb)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>aaa baa. (aaa, baa) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aaa @ ab \<and> b = baa @ bb)
[PROOF STEP]
using assum
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set (smash_list_list l1 l2)

goal (1 subgoal):
 1. \<exists>aaa baa. (aaa, baa) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aaa @ ab \<and> b = baa @ bb)
[PROOF STEP]
unfolding smash_list_list_def
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> set (concat (map (\<lambda>l1. map (\<lambda>l2. (fst l1 @ fst l2, snd l1 @ snd l2)) l2) l1))

goal (1 subgoal):
 1. \<exists>aaa baa. (aaa, baa) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aaa @ ab \<and> b = baa @ bb)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b aaa baa. \<lbrakk>(a, b) \<in> set l1; (aaa, baa) \<in> set l2; b = b @ baa; a = a @ aaa\<rbrakk> \<Longrightarrow> \<exists>aa ba. (aa, ba) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a @ aaa = aa @ ab \<and> b @ baa = ba @ bb)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>aaa baa. (aaa, baa) \<in> set l1 \<and> (\<exists>ab bb. (ab, bb) \<in> set l2 \<and> a = aaa @ ab \<and> b = baa @ bb)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Plus_Max: "\<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow> Max (I \<oplus> k) = Max I + k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> Max (I \<oplus> k) = Max I + k
[PROOF STEP]
by (simp add: iT_Plus_def Max_mono2 mono_def)


[STATEMENT]
lemma countable_all:
  assumes S: "countable S"
  shows "(\<forall>s\<in>S. P s) \<longleftrightarrow> (\<forall>n::nat. from_nat_into S n \<in> S \<longrightarrow> P (from_nat_into S n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s\<in>S. P s) = (\<forall>n. from_nat_into S n \<in> S \<longrightarrow> P (from_nat_into S n))
[PROOF STEP]
using S[THEN subset_range_from_nat_into]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> range (from_nat_into S)

goal (1 subgoal):
 1. (\<forall>s\<in>S. P s) = (\<forall>n. from_nat_into S n \<in> S \<longrightarrow> P (from_nat_into S n))
[PROOF STEP]
by auto


[STATEMENT]
lemma unlink_computation:
 "rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A))
     (rat_poly_plus
       (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))))
       (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) =
             ((A^4)+(B^4)+2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
have "(rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) = A^4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times A A) (rat_poly_times A A) = A ^ 4
[PROOF STEP]
by (simp add: numeral_Bit0)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A A) (rat_poly_times A A) = A ^ 4

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times A A) (rat_poly_times A A) = A ^ 4

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
have "(rat_poly_times (rat_poly_times B B) (rat_poly_times B B))
             = B^4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times (rat_poly_times B B) (rat_poly_times B B) = B ^ 4
[PROOF STEP]
by (simp add: numeral_Bit0)
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B B) (rat_poly_times B B) = B ^ 4

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly_times (rat_poly_times B B) (rat_poly_times B B) = B ^ 4

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
have "(rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))))
               = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))) = 2
[PROOF STEP]
using inverse1
[PROOF STATE]
proof (prove)
using this:
rat_poly_times A B = 1

goal (1 subgoal):
 1. rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))) = 2
[PROOF STEP]
by (metis mult_2_right one_add_one rat_poly.assoc rat_poly.comm)
[PROOF STATE]
proof (state)
this:
rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))) = 2

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly_times (rat_poly_times A A) (rat_poly_times A A) = A ^ 4
rat_poly_times (rat_poly_times B B) (rat_poly_times B B) = B ^ 4
rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))) = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly_times (rat_poly_times A A) (rat_poly_times A A) = A ^ 4
rat_poly_times (rat_poly_times B B) (rat_poly_times B B) = B ^ 4
rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B))) = 2

goal (1 subgoal):
 1. rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly_plus (rat_poly_times (rat_poly_times A A) (rat_poly_times A A)) (rat_poly_plus (rat_poly_times 2 (rat_poly_times A (rat_poly_times A (rat_poly_times B B)))) (rat_poly_times (rat_poly_times B B) (rat_poly_times B B))) = rat_poly_plus (rat_poly_plus (A ^ 4) (B ^ 4)) 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  matrix_invertible:
  "linear f \<Longrightarrow> invertible (matrix f) \<longleftrightarrow> (\<exists>g. linear g \<and> f \<circ> g = id \<and> g \<circ> f = id)"
  for f::"real^'m \<Rightarrow> real^'n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f \<Longrightarrow> invertible (matrix f) = (\<exists>g. linear g \<and> f \<circ> g = id \<and> g \<circ> f = id)
[PROOF STEP]
using matrix_invertible_gen[of f]
[PROOF STATE]
proof (prove)
using this:
Vector_Spaces.linear (*s) (*s) f \<Longrightarrow> invertible (matrix f) = (\<exists>g. Vector_Spaces.linear (*s) (*s) g \<and> f \<circ> g = id \<and> g \<circ> f = id)

goal (1 subgoal):
 1. linear f \<Longrightarrow> invertible (matrix f) = (\<exists>g. linear g \<and> f \<circ> g = id \<and> g \<circ> f = id)
[PROOF STEP]
by (auto simp: linear_matrix_vector_mul_eq)


[STATEMENT]
lemma fps_of_poly_mult: "fps_of_poly (p * q) = fps_of_poly p * fps_of_poly q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (p * q) = fps_of_poly p * fps_of_poly q
[PROOF STEP]
by (simp add: fps_of_poly_def fps_times_def fps_eq_iff coeff_mult atLeast0AtMost)


[STATEMENT]
lemma arcsin_le_mono: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>y\<bar> \<le> 1 \<Longrightarrow> arcsin x \<le> arcsin y \<longleftrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<bar>x\<bar> \<le> 1; \<bar>y\<bar> \<le> 1\<rbrakk> \<Longrightarrow> (arcsin x \<le> arcsin y) = (x \<le> y)
[PROOF STEP]
using arcsin_less_mono not_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<bar>?x\<bar> \<le> 1; \<bar>?y\<bar> \<le> 1\<rbrakk> \<Longrightarrow> (arcsin ?x < arcsin ?y) = (?x < ?y)
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. \<lbrakk>\<bar>x\<bar> \<le> 1; \<bar>y\<bar> \<le> 1\<rbrakk> \<Longrightarrow> (arcsin x \<le> arcsin y) = (x \<le> y)
[PROOF STEP]
by blast


[STATEMENT]
lemma (in group) iso_cyclic_groups_generate:
  assumes "a \<in> carrier G" "b \<in> carrier H" "group.ord G a = group.ord H b" "group H"
  shows "{f. \<forall>k \<in> (UNIV::int set). f (a [^] k) = b [^]\<^bsub>H\<^esub> k}
         \<subseteq> iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<subseteq> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
interpret H: group H
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group H
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
let ?A = "G\<lparr>carrier := generate G {a}\<rparr>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
let ?B = "H\<lparr>carrier := generate H {b}\<rparr>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
interpret A: cyclic_group ?A a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_And_Cyclic_Groups.cyclic_group (G\<lparr>carrier := generate G {a}\<rparr>) a
[PROOF STEP]
by (intro group.cyclic_groupI2; use assms(1) in simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
interpret B: cyclic_group ?B b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_And_Cyclic_Groups.cyclic_group (H\<lparr>carrier := generate H {b}\<rparr>) b
[PROOF STEP]
by (intro group.cyclic_groupI2; use assms(2) in simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
have sA: "subgroup (generate G {a}) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (generate G {a}) G
[PROOF STEP]
by (intro generate_is_subgroup, use assms(1) in simp)
[PROOF STATE]
proof (state)
this:
subgroup (generate G {a}) G

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
have sB: "subgroup (generate H {b}) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (generate H {b}) H
[PROOF STEP]
by (intro H.generate_is_subgroup, use assms(2) in simp)
[PROOF STATE]
proof (state)
this:
subgroup (generate H {b}) H

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
assume x: "x \<in> {f. \<forall>k\<in>(UNIV::int set). f (a [^] k) = b [^]\<^bsub>H\<^esub> k}"
[PROOF STATE]
proof (state)
this:
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
have hom: "x \<in> hom ?A ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
proof (intro homI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<Longrightarrow> x xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
 2. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xa. xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<Longrightarrow> x xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
 2. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
assume c: "c \<in> carrier ?A"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (2 subgoals):
 1. \<And>xa. xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<Longrightarrow> x xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
 2. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
from A.elem_is_gen_pow[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. c = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n
[PROOF STEP]
obtain k::int where k: "c = a [^] k"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. c = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n

goal (1 subgoal):
 1. (\<And>k. c = a [^] k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using int_pow_consistent[OF sA generate.incl[of a]]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. c = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n
a \<in> {a} \<Longrightarrow> a [^] ?n = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> ?n

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

goal (2 subgoals):
 1. \<And>xa. xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<Longrightarrow> x xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
 2. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}
c = a [^] k
[PROOF STEP]
have "x c = b [^]\<^bsub>H\<^esub> k"
[PROOF STATE]
proof (prove)
using this:
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}
c = a [^] k

goal (1 subgoal):
 1. x c = b [^]\<^bsub>H\<^esub> k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x c = b [^]\<^bsub>H\<^esub> k

goal (2 subgoals):
 1. \<And>xa. xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<Longrightarrow> x xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
 2. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
thus "x c \<in> carrier ?B"
[PROOF STATE]
proof (prove)
using this:
x c = b [^]\<^bsub>H\<^esub> k

goal (1 subgoal):
 1. x c \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
using B.int_pow_closed H.int_pow_consistent[OF sB] generate.incl[of b "{b}" H]
[PROOF STATE]
proof (prove)
using this:
x c = b [^]\<^bsub>H\<^esub> k
?x \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> ?x [^]\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> ?i \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
?x \<in> generate H {b} \<Longrightarrow> ?x [^]\<^bsub>H\<^esub> ?n = ?x [^]\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> ?n
b \<in> {b} \<Longrightarrow> b \<in> generate H {b}

goal (1 subgoal):
 1. x c \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x c \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
assume d: "d \<in> carrier ?A"
[PROOF STATE]
proof (state)
this:
d \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
from A.elem_is_gen_pow[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. d = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n
[PROOF STEP]
obtain l::int where l: "d = a [^] l"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. d = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n

goal (1 subgoal):
 1. (\<And>l. d = a [^] l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using int_pow_consistent[OF sA generate.incl[of a]]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. d = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n
a \<in> {a} \<Longrightarrow> a [^] ?n = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> ?n

goal (1 subgoal):
 1. (\<And>l. d = a [^] l \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d = a [^] l

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
with k
[PROOF STATE]
proof (chain)
picking this:
c = a [^] k
d = a [^] l
[PROOF STEP]
have "c \<otimes> d = a [^] (k + l)"
[PROOF STATE]
proof (prove)
using this:
c = a [^] k
d = a [^] l

goal (1 subgoal):
 1. c \<otimes> d = a [^] (k + l)
[PROOF STEP]
by (simp add: int_pow_mult assms(1))
[PROOF STATE]
proof (state)
this:
c \<otimes> d = a [^] (k + l)

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}
c \<otimes> d = a [^] (k + l)
[PROOF STEP]
have "x (c \<otimes>\<^bsub>?A\<^esub> d) = b [^]\<^bsub>H\<^esub> (k + l)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}
c \<otimes> d = a [^] (k + l)

goal (1 subgoal):
 1. x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = b [^]\<^bsub>H\<^esub> (k + l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = b [^]\<^bsub>H\<^esub> (k + l)

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = b [^]\<^bsub>H\<^esub> (k + l)

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
have "\<dots> = b [^]\<^bsub>H\<^esub> k \<otimes>\<^bsub>H\<^esub> b [^]\<^bsub>H\<^esub> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b [^]\<^bsub>H\<^esub> (k + l) = b [^]\<^bsub>H\<^esub> k \<otimes>\<^bsub>H\<^esub> b [^]\<^bsub>H\<^esub> l
[PROOF STEP]
by (simp add: H.int_pow_mult assms(2))
[PROOF STATE]
proof (state)
this:
b [^]\<^bsub>H\<^esub> (k + l) = b [^]\<^bsub>H\<^esub> k \<otimes>\<^bsub>H\<^esub> b [^]\<^bsub>H\<^esub> l

goal (1 subgoal):
 1. \<And>xa y. \<lbrakk>xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>); y \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)\<rbrakk> \<Longrightarrow> x (xa \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> y) = x xa \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = b [^]\<^bsub>H\<^esub> k \<otimes>\<^bsub>H\<^esub> b [^]\<^bsub>H\<^esub> l
[PROOF STEP]
show "x (c \<otimes>\<^bsub>?A\<^esub> d) = x c \<otimes>\<^bsub>?B\<^esub> x d"
[PROOF STATE]
proof (prove)
using this:
x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = b [^]\<^bsub>H\<^esub> k \<otimes>\<^bsub>H\<^esub> b [^]\<^bsub>H\<^esub> l

goal (1 subgoal):
 1. x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = x c \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x d
[PROOF STEP]
using x k l
[PROOF STATE]
proof (prove)
using this:
x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = b [^]\<^bsub>H\<^esub> k \<otimes>\<^bsub>H\<^esub> b [^]\<^bsub>H\<^esub> l
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}
c = a [^] k
d = a [^] l

goal (1 subgoal):
 1. x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = x c \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x (c \<otimes>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> d) = x c \<otimes>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> x d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
interpret xgh: group_hom ?A ?B x
[PROOF STATE]
proof (prove)
using this:
x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)

goal (1 subgoal):
 1. group_hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x
[PROOF STEP]
unfolding group_hom_def group_hom_axioms_def
[PROOF STATE]
proof (prove)
using this:
x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := generate G {a}\<rparr>) \<and> Group.group (H\<lparr>carrier := generate H {b}\<rparr>) \<and> x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
have "kernel ?A ?B x = {\<one>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x = {\<one>}
[PROOF STEP]
proof(intro equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<subseteq> {\<one>}
 2. {\<one>} \<subseteq> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x
[PROOF STEP]
show "{\<one>} \<subseteq> kernel ?A ?B x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {\<one>} \<subseteq> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x
[PROOF STEP]
using xgh.one_in_kernel
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> \<in> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x

goal (1 subgoal):
 1. {\<one>} \<subseteq> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{\<one>} \<subseteq> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x

goal (1 subgoal):
 1. kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<subseteq> {\<one>}
[PROOF STEP]
have "c = \<one>" if "c \<in> kernel ?A ?B x" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
c \<in> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x
[PROOF STEP]
have c: "c \<in> carrier ?A"
[PROOF STATE]
proof (prove)
using this:
c \<in> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x

goal (1 subgoal):
 1. c \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
unfolding kernel_def
[PROOF STATE]
proof (prove)
using this:
c \<in> {xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>). x xa = \<one>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub>}

goal (1 subgoal):
 1. c \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
from A.elem_is_gen_pow[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. c = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n
[PROOF STEP]
obtain k::int where k: "c = a [^] k"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. c = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n

goal (1 subgoal):
 1. (\<And>k. c = a [^] k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using int_pow_consistent[OF sA generate.incl[of a]]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. c = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> n
a \<in> {a} \<Longrightarrow> a [^] ?n = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> ?n

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

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c = a [^] k

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
have "x c = \<one>\<^bsub>H\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x c = \<one>\<^bsub>H\<^esub>
[PROOF STEP]
using that x
[PROOF STATE]
proof (prove)
using this:
c \<in> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}

goal (1 subgoal):
 1. x c = \<one>\<^bsub>H\<^esub>
[PROOF STEP]
unfolding kernel_def
[PROOF STATE]
proof (prove)
using this:
c \<in> {xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>). x xa = \<one>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub>}
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}

goal (1 subgoal):
 1. x c = \<one>\<^bsub>H\<^esub>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x c = \<one>\<^bsub>H\<^esub>

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c = a [^] k
x c = \<one>\<^bsub>H\<^esub>
[PROOF STEP]
have "\<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k"
[PROOF STATE]
proof (prove)
using this:
c = a [^] k
x c = \<one>\<^bsub>H\<^esub>

goal (1 subgoal):
 1. \<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
c = a [^] k
x c = \<one>\<^bsub>H\<^esub>
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}

goal (1 subgoal):
 1. \<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
with assms(3)
[PROOF STATE]
proof (chain)
picking this:
ord a = H.ord b
\<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k
[PROOF STEP]
have "a [^] k = \<one>"
[PROOF STATE]
proof (prove)
using this:
ord a = H.ord b
\<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k

goal (1 subgoal):
 1. a [^] k = \<one>
[PROOF STEP]
using int_pow_eq_id[OF assms(1), of k] H.int_pow_eq_id[OF assms(2), of k]
[PROOF STATE]
proof (prove)
using this:
ord a = H.ord b
\<one>\<^bsub>H\<^esub> = b [^]\<^bsub>H\<^esub> k
(a [^] k = \<one>) = (int (ord a) dvd k)
(b [^]\<^bsub>H\<^esub> k = \<one>\<^bsub>H\<^esub>) = (int (H.ord b) dvd k)

goal (1 subgoal):
 1. a [^] k = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a [^] k = \<one>

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
thus "c = \<one>"
[PROOF STATE]
proof (prove)
using this:
a [^] k = \<one>

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
a [^] k = \<one>
c = a [^] k

goal (1 subgoal):
 1. c = \<one>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c = \<one>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?c \<in> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<Longrightarrow> ?c = \<one>

goal (1 subgoal):
 1. kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<subseteq> {\<one>}
[PROOF STEP]
thus "kernel ?A ?B x \<subseteq> {\<one>}"
[PROOF STATE]
proof (prove)
using this:
?c \<in> kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<Longrightarrow> ?c = \<one>

goal (1 subgoal):
 1. kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<subseteq> {\<one>}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x \<subseteq> {\<one>}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x = {\<one>}

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x = {\<one>}

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
have "carrier ?B \<subseteq> x ` carrier ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
assume c: "c \<in> carrier ?B"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>)

goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
from B.elem_is_gen_pow[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. c = b [^]\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> n
[PROOF STEP]
obtain k::int where k: "c = b [^]\<^bsub>H\<^esub> k"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. c = b [^]\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> n

goal (1 subgoal):
 1. (\<And>k. c = b [^]\<^bsub>H\<^esub> k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using H.int_pow_consistent[OF sB generate.incl[of b]]
[PROOF STATE]
proof (prove)
using this:
\<exists>n. c = b [^]\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> n
b \<in> {b} \<Longrightarrow> b [^]\<^bsub>H\<^esub> ?n = b [^]\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> ?n

goal (1 subgoal):
 1. (\<And>k. c = b [^]\<^bsub>H\<^esub> k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c = b [^]\<^bsub>H\<^esub> k

goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = b [^]\<^bsub>H\<^esub> k
[PROOF STEP]
have "x (a [^] k) = c"
[PROOF STATE]
proof (prove)
using this:
c = b [^]\<^bsub>H\<^esub> k

goal (1 subgoal):
 1. x (a [^] k) = c
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
c = b [^]\<^bsub>H\<^esub> k
x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k}

goal (1 subgoal):
 1. x (a [^] k) = c
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x (a [^] k) = c

goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x (a [^] k) = c

goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
have "a [^] k \<in> carrier ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] k \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
using int_pow_consistent[OF sA generate.incl[of a]] A.int_pow_closed generate.incl[of a]
[PROOF STATE]
proof (prove)
using this:
a \<in> {a} \<Longrightarrow> a [^] ?n = a [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> ?n
?x \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<Longrightarrow> ?x [^]\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub> ?i \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)
a \<in> ?H \<Longrightarrow> a \<in> generate ?G ?H

goal (1 subgoal):
 1. a [^] k \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a [^] k \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (1 subgoal):
 1. \<And>xa. xa \<in> carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<Longrightarrow> xa \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x (a [^] k) = c
a [^] k \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
show "c \<in> x ` carrier ?A"
[PROOF STATE]
proof (prove)
using this:
x (a [^] k) = c
a [^] k \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (1 subgoal):
 1. c \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c \<in> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (1 subgoal):
 1. \<And>x. x \<in> {f. \<forall>k\<in>UNIV. f (a [^] k) = b [^]\<^bsub>H\<^esub> k} \<Longrightarrow> x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x = {\<one>}
carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
[PROOF STEP]
show "x \<in> iso ?A ?B"
[PROOF STATE]
proof (prove)
using this:
kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x = {\<one>}
carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)

goal (1 subgoal):
 1. x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
using hom xgh.iso_iff
[PROOF STATE]
proof (prove)
using this:
kernel (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>) x = {\<one>}
carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
(x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)) = (carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<and> (\<forall>xa\<in>carrier (G\<lparr>carrier := generate G {a}\<rparr>). x xa = \<one>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> \<longrightarrow> xa = \<one>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub>))

goal (1 subgoal):
 1. x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
unfolding kernel_def
[PROOF STATE]
proof (prove)
using this:
{xa \<in> carrier (G\<lparr>carrier := generate G {a}\<rparr>). x xa = \<one>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub>} = {\<one>}
carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>)
x \<in> hom (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
(x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)) = (carrier (H\<lparr>carrier := generate H {b}\<rparr>) \<subseteq> x ` carrier (G\<lparr>carrier := generate G {a}\<rparr>) \<and> (\<forall>xa\<in>carrier (G\<lparr>carrier := generate G {a}\<rparr>). x xa = \<one>\<^bsub>H\<lparr>carrier := generate H {b}\<rparr>\<^esub> \<longrightarrow> xa = \<one>\<^bsub>G\<lparr>carrier := generate G {a}\<rparr>\<^esub>))

goal (1 subgoal):
 1. x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> Group.iso (G\<lparr>carrier := generate G {a}\<rparr>) (H\<lparr>carrier := generate H {b}\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_bit_numeral_bit0:
  \<open>take_bit (numeral l) (numeral (Num.Bit0 k)) = take_bit (pred_numeral l) (numeral k) * 2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (numeral l) (numeral (num.Bit0 k)) = take_bit (pred_numeral l) (numeral k) * (2::'a)
[PROOF STEP]
by (simp add: take_bit_rec numeral_Bit0_div_2)


[STATEMENT]
lemma infsum_nonneg_complex:
  fixes f :: "'a \<Rightarrow> complex"
  assumes "f summable_on M"
    and "\<And>x. x \<in> M \<Longrightarrow> 0 \<le> f x"
  shows "infsum f M \<ge> 0" (is "?lhs \<ge> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> infsum f M
[PROOF STEP]
by (metis assms(1) assms(2) infsum_0_simp summable_on_0_simp infsum_mono_complex)


[STATEMENT]
lemma solution_fixed_pointI:
  fixes x:: "real \<Rightarrow> 'a::banach"
  assumes cont_f: "continuous_on (T \<times> X) (\<lambda>(t, x). f t x)"
  assumes cont_x: "continuous_on T x"
  assumes defined: "\<And>t. t \<in> T \<Longrightarrow> x t \<in> X"
  assumes fp: "\<And>t. t \<in> T \<Longrightarrow> x t = x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))"
  shows "(x solves_ode f) T X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x solves_ode f) T X
[PROOF STEP]
proof (rule solves_odeI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x has_vderiv_on (\<lambda>t. f t (x t))) T
 2. \<And>t. t \<in> T \<Longrightarrow> x t \<in> X
[PROOF STEP]
note [continuous_intros] = continuous_on_compose_Pair[OF cont_f]
[PROOF STATE]
proof (state)
this:
\<lbrakk>continuous_on ?C ?g; continuous_on ?C ?h; \<And>c. c \<in> ?C \<Longrightarrow> ?g c \<in> T; \<And>c. c \<in> ?C \<Longrightarrow> ?h c \<in> X\<rbrakk> \<Longrightarrow> continuous_on ?C (\<lambda>c. f (?g c) (?h c))

goal (2 subgoals):
 1. (x has_vderiv_on (\<lambda>t. f t (x t))) T
 2. \<And>t. t \<in> T \<Longrightarrow> x t \<in> X
[PROOF STEP]
have "((\<lambda>t. x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))) has_vderiv_on (\<lambda>t. f t (x t))) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))) has_vderiv_on (\<lambda>t. f t (x t))) T
[PROOF STEP]
using cont_x defined
[PROOF STATE]
proof (prove)
using this:
continuous_on T x
?t \<in> T \<Longrightarrow> x ?t \<in> X

goal (1 subgoal):
 1. ((\<lambda>t. x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))) has_vderiv_on (\<lambda>t. f t (x t))) T
[PROOF STEP]
by (auto intro!: derivative_eq_intros ivl_integral_has_vector_derivative
      continuous_intros
      simp: has_vderiv_on_def T_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))) has_vderiv_on (\<lambda>t. f t (x t))) T

goal (2 subgoals):
 1. (x has_vderiv_on (\<lambda>t. f t (x t))) T
 2. \<And>t. t \<in> T \<Longrightarrow> x t \<in> X
[PROOF STEP]
with fp
[PROOF STATE]
proof (chain)
picking this:
?t \<in> T \<Longrightarrow> x ?t = x t0 + ivl_integral t0 ?t (\<lambda>t. f t (x t))
((\<lambda>t. x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))) has_vderiv_on (\<lambda>t. f t (x t))) T
[PROOF STEP]
show "(x has_vderiv_on (\<lambda>t. f t (x t))) T"
[PROOF STATE]
proof (prove)
using this:
?t \<in> T \<Longrightarrow> x ?t = x t0 + ivl_integral t0 ?t (\<lambda>t. f t (x t))
((\<lambda>t. x t0 + ivl_integral t0 t (\<lambda>t. f t (x t))) has_vderiv_on (\<lambda>t. f t (x t))) T

goal (1 subgoal):
 1. (x has_vderiv_on (\<lambda>t. f t (x t))) T
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x has_vderiv_on (\<lambda>t. f t (x t))) T

goal (1 subgoal):
 1. \<And>t. t \<in> T \<Longrightarrow> x t \<in> X
[PROOF STEP]
qed (simp add: defined)


[STATEMENT]
lemma det_row_add: "det (upd_row M i (a + b)) = det (upd_row M i a) + det (upd_row M i b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_row M i (a + b)) = Square_Matrix.det (upd_row M i a) + Square_Matrix.det (upd_row M i b)
[PROOF STEP]
by transfer (simp add: prod.If_cases sum.distrib[symmetric] field_simps)


[STATEMENT]
lemma K: "a \<le> b \<Longrightarrow> a * c \<le> b * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> a * c \<le> b * c
[PROOF STEP]
apply (unfold less_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. a = c * b \<Longrightarrow> \<exists>ca. a * c = ca * (b * c)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ca. a = ca * b \<Longrightarrow> \<exists>cb. ca * b * c = cb * (b * c)
[PROOF STEP]
apply (rule_tac x = "ca" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ca. a = ca * b \<Longrightarrow> ca * b * c = ca * (b * c)
[PROOF STEP]
by (simp add: associativity)


[STATEMENT]
lemma less_diff:
assumes "l1<l2"
shows "{..<l2} - {..l1} = {l1<..<l2::nat}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<l2} - {..l1} = {l1<..<l2}
[PROOF STEP]
by (metis atLeastSucLessThan_greaterThanLessThan lessThan_Suc_atMost lessThan_minus_lessThan)


[STATEMENT]
lemma alpha_det2:
  assumes "b>2" "n>0"
  shows "(\<alpha> b (n-1))^2 - (int b) * (\<alpha> b (n-1) * (\<alpha> b n)) + (\<alpha> b n)^2 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<alpha> b (n - 1))\<^sup>2 - int b * (\<alpha> b (n - 1) * \<alpha> b n) + (\<alpha> b n)\<^sup>2 = 1
[PROOF STEP]
using alpha_det1 assms
[PROOF STATE]
proof (prove)
using this:
2 < ?b \<Longrightarrow> (\<alpha> ?b (Suc ?n))\<^sup>2 - int ?b * \<alpha> ?b (Suc ?n) * \<alpha> ?b ?n + (\<alpha> ?b ?n)\<^sup>2 = 1
2 < b
0 < n

goal (1 subgoal):
 1. (\<alpha> b (n - 1))\<^sup>2 - int b * (\<alpha> b (n - 1) * \<alpha> b n) + (\<alpha> b n)\<^sup>2 = 1
[PROOF STEP]
by (smt One_nat_def Suc_diff_Suc diff_zero mult.commute mult.left_commute)


[STATEMENT]
lemma infinity:
  assumes inj: "\<forall>n :: nat. undiago (diago n) = n"
  assumes all_tree: "\<forall>n :: nat. (diago n) \<in> S"
  shows "\<not>finite S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite S
[PROOF STEP]
from inj all_tree
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. undiago (diago n) = n
\<forall>n. diago n \<in> S
[PROOF STEP]
have "\<forall>n. n = undiago (diago n) \<and> (diago n) \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. undiago (diago n) = n
\<forall>n. diago n \<in> S

goal (1 subgoal):
 1. \<forall>n. n = undiago (diago n) \<and> diago n \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. n = undiago (diago n) \<and> diago n \<in> S

goal (1 subgoal):
 1. infinite S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. n = undiago (diago n) \<and> diago n \<in> S
[PROOF STEP]
have "\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. n = undiago (diago n) \<and> diago n \<in> S

goal (1 subgoal):
 1. \<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> S

goal (1 subgoal):
 1. infinite S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> S
[PROOF STEP]
have "undiago ` S = (UNIV :: nat set)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>ds. n = undiago ds \<and> ds \<in> S

goal (1 subgoal):
 1. undiago ` S = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
undiago ` S = UNIV

goal (1 subgoal):
 1. infinite S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
undiago ` S = UNIV
[PROOF STEP]
show "\<not>finite S"
[PROOF STATE]
proof (prove)
using this:
undiago ` S = UNIV

goal (1 subgoal):
 1. infinite S
[PROOF STEP]
by (metis finite_imageI infinite_UNIV_nat)
[PROOF STATE]
proof (state)
this:
infinite S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_div_le:
  fixes a b :: int
  assumes "b > 0"
  shows "a \<ge> b * (a div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * (a div b) \<le> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b * (a div b) \<le> a
[PROOF STEP]
from minus_div_mult_eq_mod [symmetric, of a b]
[PROOF STATE]
proof (chain)
picking this:
a mod b = a - a div b * b
[PROOF STEP]
have "a = b * (a div b) + a mod b"
[PROOF STATE]
proof (prove)
using this:
a mod b = a - a div b * b

goal (1 subgoal):
 1. a = b * (a div b) + a mod b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = b * (a div b) + a mod b

goal (1 subgoal):
 1. b * (a div b) \<le> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a = b * (a div b) + a mod b

goal (1 subgoal):
 1. b * (a div b) \<le> a
[PROOF STEP]
have "\<dots> \<ge> b * (a div b) + 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * (a div b) + 0 \<le> b * (a div b) + a mod b
[PROOF STEP]
apply (rule add_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> a mod b
[PROOF STEP]
apply (rule pos_mod_sign)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < b

goal (1 subgoal):
 1. 0 < b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
b * (a div b) + 0 \<le> b * (a div b) + a mod b

goal (1 subgoal):
 1. b * (a div b) \<le> a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b * (a div b) + 0 \<le> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b * (a div b) + 0 \<le> a

goal (1 subgoal):
 1. b * (a div b) \<le> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b * (a div b) \<le> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_in_nonpos_Ints_iff: "(of_nat n :: 'a :: {ring_1,ring_char_0}) \<in> \<int>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
assume "(of_nat n :: 'a) \<in> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (state)
this:
of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0

goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
obtain m where "of_nat n = (of_int m :: 'a)" "m \<le> 0"
[PROOF STATE]
proof (prove)
using this:
of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>of_nat n = of_int m; m \<le> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: nonpos_Ints_def)
[PROOF STATE]
proof (state)
this:
of_nat n = of_int m
m \<le> 0

goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
hence "(of_int m :: 'a) = of_nat n"
[PROOF STATE]
proof (prove)
using this:
of_nat n = of_int m
m \<le> 0

goal (1 subgoal):
 1. of_int m = of_nat n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int m = of_nat n

goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int m = of_nat n

goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have "... = of_int (int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n = of_int (int n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat n = of_int (int n)

goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_int m = of_int (int n)
[PROOF STEP]
have "m = int n"
[PROOF STATE]
proof (prove)
using this:
of_int m = of_int (int n)

goal (1 subgoal):
 1. m = int n
[PROOF STEP]
by (subst (asm) of_int_eq_iff)
[PROOF STATE]
proof (state)
this:
m = int n

goal (2 subgoals):
 1. of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
with \<open>m \<le> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
m \<le> 0
m = int n
[PROOF STEP]
show "n = 0"
[PROOF STATE]
proof (prove)
using this:
m \<le> 0
m = int n

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

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> of_nat n \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
qed simp


[STATEMENT]
lemma fls_right_inverse:
  fixes   f :: "'a::ring_1 fls"
  assumes "f $$ fls_subdegree f * y = 1"
  shows   "f * fls_right_inverse f y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * fls_right_inverse f y = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f * fls_right_inverse f y = 1
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f $$ fls_subdegree f * y = (1::'a)
[PROOF STEP]
have "y \<noteq> 0" "(fls_base_factor_to_fps f$0) * y = 1"
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * y = (1::'a)

goal (1 subgoal):
 1. y \<noteq> (0::'a) &&& fls_base_factor_to_fps f $ 0 * y = (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'a)
fls_base_factor_to_fps f $ 0 * y = (1::'a)

goal (1 subgoal):
 1. f * fls_right_inverse f y = 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<noteq> (0::'a)
fls_base_factor_to_fps f $ 0 * y = (1::'a)

goal (1 subgoal):
 1. f * fls_right_inverse f y = 1
[PROOF STEP]
using fls_base_factor_to_fps_right_inverse[of f y]
          fls_lr_inverse_subdegree(2)[of y] fps_right_inverse
[PROOF STATE]
proof (prove)
using this:
y \<noteq> (0::'a)
fls_base_factor_to_fps f $ 0 * y = (1::'a)
fls_base_factor_to_fps (fls_right_inverse f y) = fps_right_inverse (fls_base_factor_to_fps f) y
y \<noteq> (0::'a) \<Longrightarrow> fls_subdegree (fls_right_inverse ?f y) = - fls_subdegree ?f
?f $ 0 * ?y = (1::?'a) \<Longrightarrow> ?f * fps_right_inverse ?f ?y = 1

goal (1 subgoal):
 1. f * fls_right_inverse f y = 1
[PROOF STEP]
by    (fastforce simp: fls_times_def)
[PROOF STATE]
proof (state)
this:
f * fls_right_inverse f y = 1

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>
  It is possible in a ring for an element to have a left inverse but not a right inverse, or
  vice versa. But when an element has both, they must be the same.
\<close>


[STATEMENT]
theorem rtrancl_on_converseD:
  assumes "(y, x) \<in> rtrancl_on F (r\<inverse>)" shows "(x, y) \<in> rtrancl_on F r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> rtrancl_on F r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(y, x) \<in> rtrancl_on F (r\<inverse>)

goal (1 subgoal):
 1. (x, y) \<in> rtrancl_on F r
[PROOF STEP]
by - (drule rtrancl_on_converseI, simp)


[STATEMENT]
theorem Meet_singleton: "\<Sqinter>{x} = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter>{x} = x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> {x} \<Longrightarrow> x \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. a \<in> {x} \<Longrightarrow> x \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
assume "a \<in> {x}"
[PROOF STATE]
proof (state)
this:
a \<in> {x}

goal (2 subgoals):
 1. \<And>a. a \<in> {x} \<Longrightarrow> x \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> {x}
[PROOF STEP]
have "a = x"
[PROOF STATE]
proof (prove)
using this:
a \<in> {x}

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

goal (2 subgoals):
 1. \<And>a. a \<in> {x} \<Longrightarrow> x \<sqsubseteq> a
 2. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = x
[PROOF STEP]
show "x \<sqsubseteq> a"
[PROOF STATE]
proof (prove)
using this:
a = x

goal (1 subgoal):
 1. x \<sqsubseteq> a
[PROOF STEP]
by (simp only: leq_refl)
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> a

goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
assume "\<forall>a \<in> {x}. b \<sqsubseteq> a"
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>{x}. b \<sqsubseteq> a

goal (1 subgoal):
 1. \<And>b. \<forall>a\<in>{x}. b \<sqsubseteq> a \<Longrightarrow> b \<sqsubseteq> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>{x}. b \<sqsubseteq> a
[PROOF STEP]
show "b \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>{x}. b \<sqsubseteq> a

goal (1 subgoal):
 1. b \<sqsubseteq> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b \<sqsubseteq> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "bool_fun_threshold_2_3 (vec 4 (\<lambda>i. if i = 3 then True else False)) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bool_fun_threshold_2_3 (vec 4 (\<lambda>i. if i = 3 then True else False)) = False
[PROOF STEP]
unfolding bool_fun_threshold_2_3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 2 \<le> count_true (vec 4 (\<lambda>i. if i = 3 then True else False)) then True else False) = False
[PROOF STEP]
unfolding count_true_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 2 \<le> (\<Sum>i = 0..<dim_vec (vec 4 (\<lambda>i. if i = 3 then True else False)). if vec 4 (\<lambda>i. if i = 3 then True else False) $ i then 1 else 0) then True else False) = False
[PROOF STEP]
unfolding dim_vec
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 2 \<le> (\<Sum>i = 0..<4. if vec 4 (\<lambda>i. if i = 3 then True else False) $ i then 1 else 0) then True else False) = False
[PROOF STEP]
unfolding sum.eq_fold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 2 \<le> Finite_Set.fold ((+) \<circ> (\<lambda>i. if vec 4 (\<lambda>i. if i = 3 then True else False) $ i then 1 else 0)) 0 {0..<4} then True else False) = False
[PROOF STEP]
using index_vec [of _ 4]
[PROOF STATE]
proof (prove)
using this:
?i < 4 \<Longrightarrow> vec 4 ?f $ ?i = ?f ?i

goal (1 subgoal):
 1. (if 2 \<le> Finite_Set.fold ((+) \<circ> (\<lambda>i. if vec 4 (\<lambda>i. if i = 3 then True else False) $ i then 1 else 0)) 0 {0..<4} then True else False) = False
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> Finite_Set.fold ((+) \<circ> (\<lambda>i. if vec 4 (\<lambda>i. i = 3) $ i then 1 else 0)) 0 {0..<4} \<Longrightarrow> False
[PROOF STEP]
unfolding set_list_four
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> Finite_Set.fold ((+) \<circ> (\<lambda>i. if vec 4 (\<lambda>i. i = 3) $ i then 1 else 0)) 0 (set [0, 1, 2, 3]) \<Longrightarrow> False
[PROOF STEP]
unfolding comp_fun_commute_on.fold_set_fold_remdups [OF comp_fun_commute_lambda, simplified]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> fold ((+) \<circ> (\<lambda>i. if vec 4 (\<lambda>i. i = 3) $ i then 1 else 0)) (remdups [0, 1, 2, 3]) 0 \<Longrightarrow> False
[PROOF STEP]
by simp


[STATEMENT]
lemma countable_infinite_gcard: "countable X \<and> infinite X \<longleftrightarrow> gcard X = \<aleph>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
have "gcard X = \<omega>"
    if "countable X" and "infinite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcard X = \<omega>
[PROOF STEP]
using that countable countable_imp_g_le_Aleph0 finite_iff_g_le_Aleph0 less_V_def
[PROOF STATE]
proof (prove)
using this:
countable X
infinite X
countable ?X \<Longrightarrow> small ?X
countable ?X \<Longrightarrow> gcard ?X \<le> \<aleph>0
small ?X \<Longrightarrow> finite ?X = (gcard ?X < \<aleph>0)
?x < ?y \<equiv> ?x \<le> ?y \<and> ?x \<noteq> ?y

goal (1 subgoal):
 1. gcard X = \<omega>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>countable X; infinite X\<rbrakk> \<Longrightarrow> gcard X = \<omega>

goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>countable X; infinite X\<rbrakk> \<Longrightarrow> gcard X = \<omega>

goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
have "countable X" if "gcard X = \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable X
[PROOF STEP]
by (metis Aleph_0 countable_iff_g_le_Aleph0 dual_order.refl gcard_big_0 omega_nonzero that)
[PROOF STATE]
proof (state)
this:
gcard X = \<omega> \<Longrightarrow> countable X

goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
gcard X = \<omega> \<Longrightarrow> countable X

goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
have False if "gcard X = \<omega>" and "finite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis Aleph_0 dual_order.irrefl finite_iff_g_le_Aleph0 finite_imp_small that)
[PROOF STATE]
proof (state)
this:
\<lbrakk>gcard X = \<omega>; finite X\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>countable X; infinite X\<rbrakk> \<Longrightarrow> gcard X = \<omega>
gcard X = \<omega> \<Longrightarrow> countable X
\<lbrakk>gcard X = \<omega>; finite X\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable X; infinite X\<rbrakk> \<Longrightarrow> gcard X = \<omega>
gcard X = \<omega> \<Longrightarrow> countable X
\<lbrakk>gcard X = \<omega>; finite X\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. (countable X \<and> infinite X) = (gcard X = \<aleph>0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(countable X \<and> infinite X) = (gcard X = \<aleph>0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_or_minus_sqrt:
  fixes x y :: real
  assumes "y \<ge> 0"
  shows "x\<^sup>2 = y \<longleftrightarrow> x = sqrt y \<or> x = - sqrt y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>2 = y) = (x = sqrt y \<or> x = - sqrt y)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x\<^sup>2 = y \<Longrightarrow> x = sqrt y \<or> x = - sqrt y
 2. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
assume "x\<^sup>2 = y"
[PROOF STATE]
proof (state)
this:
x\<^sup>2 = y

goal (2 subgoals):
 1. x\<^sup>2 = y \<Longrightarrow> x = sqrt y \<or> x = - sqrt y
 2. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x\<^sup>2 = y
[PROOF STEP]
have "sqrt (x\<^sup>2) = sqrt y"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>2 = y

goal (1 subgoal):
 1. sqrt (x\<^sup>2) = sqrt y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (x\<^sup>2) = sqrt y

goal (2 subgoals):
 1. x\<^sup>2 = y \<Longrightarrow> x = sqrt y \<or> x = - sqrt y
 2. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sqrt (x\<^sup>2) = sqrt y
[PROOF STEP]
have "sqrt y = \<bar>x\<bar>"
[PROOF STATE]
proof (prove)
using this:
sqrt (x\<^sup>2) = sqrt y

goal (1 subgoal):
 1. sqrt y = \<bar>x\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt y = \<bar>x\<bar>

goal (2 subgoals):
 1. x\<^sup>2 = y \<Longrightarrow> x = sqrt y \<or> x = - sqrt y
 2. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sqrt y = \<bar>x\<bar>
[PROOF STEP]
show "x = sqrt y \<or> x = - sqrt y"
[PROOF STATE]
proof (prove)
using this:
sqrt y = \<bar>x\<bar>

goal (1 subgoal):
 1. x = sqrt y \<or> x = - sqrt y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = sqrt y \<or> x = - sqrt y

goal (1 subgoal):
 1. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
assume "x = sqrt y \<or> x = - sqrt y"
[PROOF STATE]
proof (state)
this:
x = sqrt y \<or> x = - sqrt y

goal (1 subgoal):
 1. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = sqrt y \<or> x = - sqrt y
[PROOF STEP]
have "x\<^sup>2 = (sqrt y)\<^sup>2 \<or> x\<^sup>2 = (- sqrt y)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
x = sqrt y \<or> x = - sqrt y

goal (1 subgoal):
 1. x\<^sup>2 = (sqrt y)\<^sup>2 \<or> x\<^sup>2 = (- sqrt y)\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x\<^sup>2 = (sqrt y)\<^sup>2 \<or> x\<^sup>2 = (- sqrt y)\<^sup>2

goal (1 subgoal):
 1. x = sqrt y \<or> x = - sqrt y \<Longrightarrow> x\<^sup>2 = y
[PROOF STEP]
with \<open>y \<ge> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> y
x\<^sup>2 = (sqrt y)\<^sup>2 \<or> x\<^sup>2 = (- sqrt y)\<^sup>2
[PROOF STEP]
show "x\<^sup>2 = y"
[PROOF STATE]
proof (prove)
using this:
0 \<le> y
x\<^sup>2 = (sqrt y)\<^sup>2 \<or> x\<^sup>2 = (- sqrt y)\<^sup>2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_of_complex_eq_of_complex_iff [simp]: "-of_complex x = of_complex y \<longleftrightarrow> -x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- of_complex x = of_complex y) = (- x = y)
[PROOF STEP]
using of_complex_eq_iff[of "-x" y]
[PROOF STATE]
proof (prove)
using this:
(of_complex (- x) = of_complex y) = (- x = y)

goal (1 subgoal):
 1. (- of_complex x = of_complex y) = (- x = y)
[PROOF STEP]
by (simp only: of_complex_minus)


[STATEMENT]
lemma (in prob_space) simple_distributed_sum_space:
  assumes X: "simple_distributed M X f"
  shows "sum f (X`space M) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
from X
[PROOF STATE]
proof (chain)
picking this:
simple_distributed M X f
[PROOF STEP]
have "sum f (X`space M) = prob (\<Union>i\<in>X`space M. X -` {i} \<inter> space M)"
[PROOF STATE]
proof (prove)
using this:
simple_distributed M X f

goal (1 subgoal):
 1. sum f (X ` space M) = prob (\<Union>i\<in>X ` space M. X -` {i} \<inter> space M)
[PROOF STEP]
by (subst finite_measure_finite_Union)
       (auto simp add: disjoint_family_on_def simple_distributed_measure simple_distributed_simple_function simple_functionD
             intro!: sum.cong arg_cong[where f="prob"])
[PROOF STATE]
proof (state)
this:
sum f (X ` space M) = prob (\<Union>i\<in>X ` space M. X -` {i} \<inter> space M)

goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f (X ` space M) = prob (\<Union>i\<in>X ` space M. X -` {i} \<inter> space M)

goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
have "\<dots> = prob (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (\<Union>i\<in>X ` space M. X -` {i} \<inter> space M) = prob (space M)
[PROOF STEP]
by (auto intro!: arg_cong[where f=prob])
[PROOF STATE]
proof (state)
this:
prob (\<Union>i\<in>X ` space M. X -` {i} \<inter> space M) = prob (space M)

goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f (X ` space M) = prob (space M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f (X ` space M) = prob (space M)

goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
using emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
sum f (X ` space M) = prob (space M)
emeasure M (space M) = 1

goal (1 subgoal):
 1. sum f (X ` space M) = 1
[PROOF STEP]
by (simp add: emeasure_eq_measure)
[PROOF STATE]
proof (state)
this:
sum f (X ` space M) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lcoeff_monic_mult: assumes monic: "monic (p :: 'a :: comm_semiring_1 poly)"
  shows "coeff (p * q) (degree p + degree q) = coeff q (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
let ?pqi = "\<lambda> i. coeff p i * coeff q (degree p + degree q - i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
have "coeff (p * q) (degree p + degree q) =
    (\<Sum>i\<le>degree p + degree q. ?pqi i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = (\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i))
[PROOF STEP]
unfolding coeff_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i)) = (\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff (p * q) (degree p + degree q) = (\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i))

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff (p * q) (degree p + degree q) = (\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i))

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
have "\<dots> = ?pqi (degree p) + (sum ?pqi ({.. degree p + degree q} - {degree p}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i)) = lead_coeff p * coeff q (degree p + degree q - degree p) + (\<Sum>i\<in>{..degree p + degree q} - {degree p}. coeff p i * coeff q (degree p + degree q - i))
[PROOF STEP]
by (subst sum.remove[of _ "degree p"], auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i)) = lead_coeff p * coeff q (degree p + degree q - degree p) + (\<Sum>i\<in>{..degree p + degree q} - {degree p}. coeff p i * coeff q (degree p + degree q - i))

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>degree p + degree q. coeff p i * coeff q (degree p + degree q - i)) = lead_coeff p * coeff q (degree p + degree q - degree p) + (\<Sum>i\<in>{..degree p + degree q} - {degree p}. coeff p i * coeff q (degree p + degree q - i))

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
have "?pqi (degree p) = coeff q (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff p * coeff q (degree p + degree q - degree p) = lead_coeff q
[PROOF STEP]
unfolding monic
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) * coeff q (degree p + degree q - degree p) = lead_coeff q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lead_coeff p * coeff q (degree p + degree q - degree p) = lead_coeff q

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lead_coeff p * coeff q (degree p + degree q - degree p) = lead_coeff q

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
have "(sum ?pqi ({.. degree p + degree q} - {degree p})) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{..degree p + degree q} - {degree p}. coeff p i * coeff q (degree p + degree q - i)) = (0::'a)
[PROOF STEP]
proof (rule sum.neutral, intro ballI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..degree p + degree q} - {degree p} \<Longrightarrow> coeff p x * coeff q (degree p + degree q - x) = (0::'a)
[PROOF STEP]
fix d
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {..degree p + degree q} - {degree p} \<Longrightarrow> coeff p x * coeff q (degree p + degree q - x) = (0::'a)
[PROOF STEP]
assume d: "d \<in> {.. degree p + degree q} - {degree p}"
[PROOF STATE]
proof (state)
this:
d \<in> {..degree p + degree q} - {degree p}

goal (1 subgoal):
 1. \<And>x. x \<in> {..degree p + degree q} - {degree p} \<Longrightarrow> coeff p x * coeff q (degree p + degree q - x) = (0::'a)
[PROOF STEP]
show "?pqi d = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
proof (cases "d < degree p")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
 2. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
d < degree p

goal (2 subgoals):
 1. d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
 2. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
hence "degree p + degree q - d > degree q"
[PROOF STATE]
proof (prove)
using this:
d < degree p

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

goal (2 subgoals):
 1. d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
 2. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
hence "coeff q (degree p + degree q - d) = 0"
[PROOF STATE]
proof (prove)
using this:
degree q < degree p + degree q - d

goal (1 subgoal):
 1. coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
by (rule coeff_eq_0)
[PROOF STATE]
proof (state)
this:
coeff q (degree p + degree q - d) = (0::'a)

goal (2 subgoals):
 1. d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
 2. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff q (degree p + degree q - d) = (0::'a)

goal (1 subgoal):
 1. coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff p d * coeff q (degree p + degree q - d) = (0::'a)

goal (1 subgoal):
 1. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> d < degree p

goal (1 subgoal):
 1. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
with d
[PROOF STATE]
proof (chain)
picking this:
d \<in> {..degree p + degree q} - {degree p}
\<not> d < degree p
[PROOF STEP]
have "d > degree p"
[PROOF STATE]
proof (prove)
using this:
d \<in> {..degree p + degree q} - {degree p}
\<not> d < degree p

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

goal (1 subgoal):
 1. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
hence "coeff p d = 0"
[PROOF STATE]
proof (prove)
using this:
degree p < d

goal (1 subgoal):
 1. coeff p d = (0::'a)
[PROOF STEP]
by (rule coeff_eq_0)
[PROOF STATE]
proof (state)
this:
coeff p d = (0::'a)

goal (1 subgoal):
 1. \<not> d < degree p \<Longrightarrow> coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff p d = (0::'a)

goal (1 subgoal):
 1. coeff p d * coeff q (degree p + degree q - d) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff p d * coeff q (degree p + degree q - d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coeff p d * coeff q (degree p + degree q - d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{..degree p + degree q} - {degree p}. coeff p i * coeff q (degree p + degree q - i)) = (0::'a)

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coeff (p * q) (degree p + degree q) = lead_coeff q + (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff (p * q) (degree p + degree q) = lead_coeff q + (0::'a)

goal (1 subgoal):
 1. coeff (p * q) (degree p + degree q) = lead_coeff q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coeff (p * q) (degree p + degree q) = lead_coeff q

goal:
No subgoals!
[PROOF STEP]
qed