[STATEMENT]
lemma Suc_le:
  assumes less_card: "(to_nat a) + 1 < CARD ('a)"
  shows "a < a + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
have "(to_nat a) < (to_nat a) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat a < mod_type_class.to_nat a + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a < mod_type_class.to_nat a + 1

goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
hence "(to_nat a) < to_nat (a + 1)"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a < mod_type_class.to_nat a + 1

goal (1 subgoal):
 1. mod_type_class.to_nat a < mod_type_class.to_nat (a + (1::'a))
[PROOF STEP]
by (metis less_card to_nat_suc)
[PROOF STATE]
proof (state)
this:
mod_type_class.to_nat a < mod_type_class.to_nat (a + (1::'a))

goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
hence "(from_nat (to_nat a)::'a) < from_nat (to_nat (a + 1))"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat a < mod_type_class.to_nat (a + (1::'a))

goal (1 subgoal):
 1. mod_type_class.from_nat (mod_type_class.to_nat a) < mod_type_class.from_nat (mod_type_class.to_nat (a + (1::'a)))
[PROOF STEP]
by (rule from_nat_mono, metis less_card to_nat_suc)
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat (mod_type_class.to_nat a) < mod_type_class.from_nat (mod_type_class.to_nat (a + (1::'a)))

goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
thus "a < a + 1"
[PROOF STATE]
proof (prove)
using this:
mod_type_class.from_nat (mod_type_class.to_nat a) < mod_type_class.from_nat (mod_type_class.to_nat (a + (1::'a)))

goal (1 subgoal):
 1. a < a + (1::'a)
[PROOF STEP]
by (metis to_nat_from_nat)
[PROOF STATE]
proof (state)
this:
a < a + (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma countable_lfp:
  assumes step: "\<And>Y. countable Y \<Longrightarrow> countable (F Y)"
  and cont: "Order_Continuity.sup_continuous F"
  shows "countable (lfp F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (lfp F)
[PROOF STEP]
by(subst sup_continuous_lfp[OF cont])(simp add: countable_funpow[OF step])


[STATEMENT]
lemma top_neq_numeral[simp]: "top \<noteq> (numeral i::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top \<noteq> numeral i
[PROOF STEP]
using of_nat_less_top[of "numeral i"]
[PROOF STATE]
proof (prove)
using this:
of_nat (numeral i) < top

goal (1 subgoal):
 1. top \<noteq> numeral i
[PROOF STEP]
by simp


[STATEMENT]
lemma Arg_less_0: "0 \<le> Arg z \<longleftrightarrow> 0 \<le> Im z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> Arg z) = (0 \<le> Im z)
[PROOF STEP]
using Im_Ln_le_pi Im_Ln_pos_le
[PROOF STATE]
proof (prove)
using this:
?z \<noteq> 0 \<Longrightarrow> Im (Ln ?z) \<le> pi
?z \<noteq> 0 \<Longrightarrow> (0 \<le> Im (Ln ?z) \<and> Im (Ln ?z) \<le> pi) = (0 \<le> Im ?z)

goal (1 subgoal):
 1. (0 \<le> Arg z) = (0 \<le> Im z)
[PROOF STEP]
by (simp add: Arg_def)


[STATEMENT]
lemma sumhr_const: "\<And>n. sumhr (0, n, \<lambda>i. r) = hypreal_of_hypnat n * hypreal_of_real r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. sumhr (0, n, \<lambda>i. r) = hypreal_of_hypnat n * hypreal_of_real r
[PROOF STEP]
unfolding sumhr_app
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (*f2* (\<lambda>m n. \<Sum>i = m..<n. r)) 0 n = hypreal_of_hypnat n * hypreal_of_real r
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma pre_post_compose_1:
  "(-p\<stileturn>-q)*(-q\<stileturn>-r) \<le> -p\<stileturn>-r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- p \<stileturn> - q) * (- q \<stileturn> - r) \<le> - p \<stileturn> - r
[PROOF STEP]
by (simp add: pre_post_compose)


[STATEMENT]
lemma star_n_abs: "\<bar>star_n X\<bar> = star_n (\<lambda>n. \<bar>X n\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>star_n X\<bar> = star_n (\<lambda>n. \<bar>X n\<bar>)
[PROOF STEP]
by (simp only: star_abs_def starfun_star_n)


[STATEMENT]
lemma zero_in_bigomega_iff [simp]: "(\<lambda>_. 0) \<in> \<Omega>[F](f) \<longleftrightarrow> eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. 0::'b) \<in> \<Omega>[F](f)) = (\<forall>\<^sub>F x in F. f x = (0::'b))
[PROOF STEP]
by (simp add: bigomega_iff_bigo)


[STATEMENT]
lemma fperms: "finite {x::'a list. length x = length init \<and> distinct x \<and> set x = set init}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. length x = length init \<and> distinct x \<and> set x = set init}
[PROOF STEP]
apply(rule finite_subset[where B="{xs. set xs \<subseteq> set init \<and> length xs \<le> length init}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. length x = length init \<and> distinct x \<and> set x = set init} \<subseteq> {xs. set xs \<subseteq> set init \<and> length xs \<le> length init}
 2. finite {xs. set xs \<subseteq> set init \<and> length xs \<le> length init}
[PROOF STEP]
apply(force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> set init \<and> length xs \<le> length init}
[PROOF STEP]
apply(rule finite_lists_length_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set init)
[PROOF STEP]
by auto


[STATEMENT]
lemma group_law_group: "group_law inverse neutral mult"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_law group_class.inverse \<one> (\<otimes>)
[PROOF STEP]
unfolding group_law_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. group_class.inverse x \<otimes> x = \<one>) \<and> monoidl_law \<one> (\<otimes>)
[PROOF STEP]
using group_class.axioms monoidl_law_monoidl
[PROOF STATE]
proof (prove)
using this:
class.group_axioms (\<otimes>) \<one> group_class.inverse
monoidl_law \<one> (\<otimes>)

goal (1 subgoal):
 1. (\<forall>x. group_class.inverse x \<otimes> x = \<one>) \<and> monoidl_law \<one> (\<otimes>)
[PROOF STEP]
unfolding class.group_axioms_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. group_class.inverse x \<otimes> x = \<one>
monoidl_law \<one> (\<otimes>)

goal (1 subgoal):
 1. (\<forall>x. group_class.inverse x \<otimes> x = \<one>) \<and> monoidl_law \<one> (\<otimes>)
[PROOF STEP]
by simp


[STATEMENT]
lemma scaleRat_leq1: "\<lbrakk> a \<le> b; k > 0\<rbrakk> \<Longrightarrow> k *R a \<le> k *R b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; 0 < k\<rbrakk> \<Longrightarrow> k *R a \<le> k *R b
[PROOF STEP]
unfolding le_less
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b \<or> a = b; 0 < k\<rbrakk> \<Longrightarrow> k *R a < k *R b \<or> k *R a = k *R b
[PROOF STEP]
using scaleRat_less1[of a b k]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < b; 0 < k\<rbrakk> \<Longrightarrow> k *R a < k *R b

goal (1 subgoal):
 1. \<lbrakk>a < b \<or> a = b; 0 < k\<rbrakk> \<Longrightarrow> k *R a < k *R b \<or> k *R a = k *R b
[PROOF STEP]
by auto


[STATEMENT]
theorem mono_imp_fp_well_complete:
  assumes comp: "well_complete A (\<sqsubseteq>)"
    and f: "f ` A \<subseteq> A" and mono: "monotone_on A (\<sqsubseteq>) (\<sqsubseteq>) f"
  shows "well_complete {p \<in> A. f p = p} (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. well_complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
interpret fixed_point_proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fixed_point_proof A f
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f ` A \<subseteq> A

goal (1 subgoal):
 1. fixed_point_proof A f
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. well_complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_complete {p \<in> A. f p = p} (\<sqsubseteq>)
[PROOF STEP]
apply (intro antisym_mono_imp_fp_complete mono antisymmetric_axioms comp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>C\<subseteq>A. well_related_set C (\<sqsubseteq>) \<longrightarrow> C \<in> {X. well_related_set X (\<sqsubseteq>)}
 2. \<forall>X\<in>{X. well_related_set X (\<sqsubseteq>)}. \<forall>Y\<in>{X. well_related_set X (\<sqsubseteq>)}. X \<sqsubseteq>\<^sup>s Y \<longrightarrow> X \<union> Y \<in> {X. well_related_set X (\<sqsubseteq>)}
[PROOF STEP]
by (auto intro!: antisym well_related_extend)
[PROOF STATE]
proof (state)
this:
well_complete {p \<in> A. f p = p} (\<sqsubseteq>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma meet_monofun1:
  fixes y :: "'a :: Finite_Meet_cpo"
  shows "monofun (\<lambda>x. (x \<sqinter> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monofun (\<lambda>x. x \<sqinter> y)
[PROOF STEP]
by (rule monofunI)(auto simp add: meet_above_iff)


[STATEMENT]
lemma tendsto_norm_zero: "(f \<longlongrightarrow> 0) F \<Longrightarrow> ((\<lambda>x. norm (f x)) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'b)) F \<Longrightarrow> ((\<lambda>x. norm (f x)) \<longlongrightarrow> 0) F
[PROOF STEP]
by (drule tendsto_norm) simp


[STATEMENT]
lemma convex_closed_interval [simp]:
  fixes a :: "'a::ordered_euclidean_space"
  shows "convex {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {a..b}
[PROOF STEP]
using convex_box[of a b]
[PROOF STATE]
proof (prove)
using this:
convex (cbox a b)
convex (box a b)

goal (1 subgoal):
 1. convex {a..b}
[PROOF STEP]
by (metis interval_cbox)


[STATEMENT]
lemma wordinterval_intersection'_set_eq:
    "wordinterval_to_set (wordinterval_intersection' r1 r2) =
      wordinterval_to_set r1 \<inter> wordinterval_to_set r2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_intersection' r1 r2) = wordinterval_to_set r1 \<inter> wordinterval_to_set r2
[PROOF STEP]
by(induction r1 r2 rule: wordinterval_intersection'.induct) (auto)


[STATEMENT]
lemma isCont_sinh: "isCont sinh (x :: 'a :: {real_normed_field, banach})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont sinh x
[PROOF STEP]
unfolding sinh_def [abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. (exp x - exp (- x)) /\<^sub>R 2) x
[PROOF STEP]
by (auto intro!: continuous_intros)


[STATEMENT]
lemma cos_eq_0:
  fixes z::complex
  shows "cos z = 0 \<longleftrightarrow> (\<exists>n::int. z = complex_of_real(n * pi) + of_real pi/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos z = 0) = (\<exists>x. z = complex_of_real (real_of_int x * pi) + complex_of_real pi / 2)
[PROOF STEP]
using sin_eq_0 [of "z - of_real pi/2"]
[PROOF STATE]
proof (prove)
using this:
(sin (z - complex_of_real pi / 2) = 0) = (\<exists>x. z - complex_of_real pi / 2 = complex_of_real (real_of_int x * pi))

goal (1 subgoal):
 1. (cos z = 0) = (\<exists>x. z = complex_of_real (real_of_int x * pi) + complex_of_real pi / 2)
[PROOF STEP]
by (simp add: sin_diff algebra_simps)


[STATEMENT]
lemma cake_plus_correct:
  assumes "evaluate env s u = (s', Rval (Litv (IntLit y)))"
  assumes "evaluate env s' t = (s'', Rval (Litv (IntLit x)))"
  shows "evaluate env s (cake_plus t u) = (s'', Rval (Litv (IntLit (x + y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Evaluate_Single.evaluate env s (cake_plus t u) = (s'', Rval (Litv (IntLit (x + y))))
[PROOF STEP]
unfolding cake_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Evaluate_Single.evaluate env s (App (Opn Plus) [t, u]) = (s'', Rval (Litv (IntLit (x + y))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Evaluate_Single.evaluate env s u = (s', Rval (Litv (IntLit y)))
Evaluate_Single.evaluate env s' t = (s'', Rval (Litv (IntLit x)))

goal (1 subgoal):
 1. Evaluate_Single.evaluate env s (App (Opn Plus) [t, u]) = (s'', Rval (Litv (IntLit (x + y))))
[PROOF STEP]
by simp


[STATEMENT]
lemma sum_sadd_cong:
  assumes "\<forall>k. k \<le> length p-1 \<and> isadd (p!k) \<and> l = goes_to (p!k) \<longrightarrow> f k = g k"
  shows "\<Sum>S+ p l f = \<Sum>S+ p l g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>S+ p l f  = \<Sum>S+ p l g
[PROOF STEP]
unfolding sum_sadd.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..length p - 1. if isadd (p ! k) \<and> l = goes_to (p ! k) then f k else 0) = (\<Sum>k = 0..length p - 1. if isadd (p ! k) \<and> l = goes_to (p ! k) then g k else 0)
[PROOF STEP]
by (rule sum.cong, simp) (rule if_cong, simp_all add: assms)


[STATEMENT]
lemma gcd_smult_left: assumes "c \<noteq> 0"
  shows "gcd (smult c f) g = gcd f (g :: 'b :: {field_gcd} poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (smult c f) g = gcd f g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd (smult c f) g = gcd f g
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'b)
[PROOF STEP]
have "normalize c = 1"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'b)

goal (1 subgoal):
 1. normalize c = (1::'b)
[PROOF STEP]
by (meson dvd_field_iff is_unit_normalize)
[PROOF STATE]
proof (state)
this:
normalize c = (1::'b)

goal (1 subgoal):
 1. gcd (smult c f) g = gcd f g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
normalize c = (1::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
normalize c = (1::'b)

goal (1 subgoal):
 1. gcd (smult c f) g = gcd f g
[PROOF STEP]
by (metis (no_types) Polynomial.normalize_smult gcd.commute gcd.left_commute gcd_left_idem gcd_self smult_1_left)
[PROOF STATE]
proof (state)
this:
gcd (smult c f) g = gcd f g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fst_set_full_gb:
  "fst ` set (full_gb bs) = (\<lambda>v. monomial 1 (term_of_pair (0, component_of_term v))) ` Keys (fst ` set bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set (full_gb bs) = (\<lambda>v. monomial (1::'b) (term_of_pair (0::'a, component_of_term v))) ` Keys (fst ` set bs)
[PROOF STEP]
by (simp add: full_gb_def set_Keys_to_list image_comp)


[STATEMENT]
lemma  det_0 [simp]: "det (mat 0 :: 'a::comm_ring_1^'n^'n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat (0::'a)) = (0::'a)
[PROOF STEP]
by (simp add: det_def prod_zero power_0_left)


[STATEMENT]
lemma conv_self_conjugate: "x\<^sup>\<smile> \<cdot> y = 0 \<longleftrightarrow> x \<cdot> y\<^sup>\<smile> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>\<smile> \<cdot> y = 0) = (x \<cdot> y\<^sup>\<smile> = 0)
[PROOF STEP]
by (metis conv_invol conv_times conv_zero)


[STATEMENT]
lemma seq_compact_eq_compact:
  fixes U :: "'a :: second_countable_topology set"
  shows "seq_compact U \<longleftrightarrow> compact U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_compact U = compact U
[PROOF STEP]
using seq_compact_eq_countably_compact countably_compact_eq_compact
[PROOF STATE]
proof (prove)
using this:
seq_compact ?U = countably_compact ?U
countably_compact ?U = compact ?U

goal (1 subgoal):
 1. seq_compact U = compact U
[PROOF STEP]
by blast


[STATEMENT]
lemma obj_initialI:
  assumes "a \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>" and "\<And>b. b \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr> \<Longrightarrow> \<exists>!f. f : a \<mapsto>\<^bsub>\<CC>\<^esub> b"
  shows "obj_initial \<CC> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. obj_initial \<CC> a
[PROOF STEP]
unfolding obj_initial_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. obj_terminal (op_smc \<CC>) a
[PROOF STEP]
by (simp add: obj_terminalI[of _ \<open>op_smc \<CC>\<close>, unfolded smc_op_simps, OF assms])


[STATEMENT]
lemma summable_on_Sigma:
  fixes A :: "'a set" and B :: "'a \<Rightarrow> 'b set"
    and f :: \<open>'a \<Rightarrow> 'b \<Rightarrow> 'c::{comm_monoid_add, t2_space, uniform_space}\<close>
  assumes plus_cont: \<open>uniformly_continuous_on UNIV (\<lambda>(x::'c,y). x+y)\<close>
  assumes summableAB: "(\<lambda>(x,y). f x y) summable_on (Sigma A B)"
  assumes summableB: \<open>\<And>x. x\<in>A \<Longrightarrow> (f x) summable_on (B x)\<close>
  shows \<open>(\<lambda>x. infsum (f x) (B x)) summable_on A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. infsum (f x) (B x)) summable_on A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. infsum (f x) (B x)) summable_on A
[PROOF STEP]
from summableAB
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>(x, y). f x y) summable_on Sigma A B
[PROOF STEP]
obtain a where a: \<open>has_sum (\<lambda>(x,y). f x y) (Sigma A B) a\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) summable_on Sigma A B

goal (1 subgoal):
 1. (\<And>a. has_sum (\<lambda>(x, y). f x y) (Sigma A B) a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using has_sum_infsum
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) summable_on Sigma A B
?f summable_on ?S \<Longrightarrow> has_sum ?f ?S (infsum ?f ?S)

goal (1 subgoal):
 1. (\<And>a. has_sum (\<lambda>(x, y). f x y) (Sigma A B) a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
has_sum (\<lambda>(x, y). f x y) (Sigma A B) a

goal (1 subgoal):
 1. (\<lambda>x. infsum (f x) (B x)) summable_on A
[PROOF STEP]
from summableB
[PROOF STATE]
proof (chain)
picking this:
?x \<in> A \<Longrightarrow> f ?x summable_on B ?x
[PROOF STEP]
have b: \<open>\<And>x. x\<in>A \<Longrightarrow> has_sum (f x) (B x) (infsum (f x) (B x))\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> A \<Longrightarrow> f ?x summable_on B ?x

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> has_sum (f x) (B x) (infsum (f x) (B x))
[PROOF STEP]
by (auto intro!: has_sum_infsum)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> has_sum (f ?x) (B ?x) (infsum (f ?x) (B ?x))

goal (1 subgoal):
 1. (\<lambda>x. infsum (f x) (B x)) summable_on A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. infsum (f x) (B x)) summable_on A
[PROOF STEP]
using plus_cont a b
[PROOF STATE]
proof (prove)
using this:
uniformly_continuous_on UNIV (\<lambda>(x, y). x + y)
has_sum (\<lambda>(x, y). f x y) (Sigma A B) a
?x \<in> A \<Longrightarrow> has_sum (f ?x) (B ?x) (infsum (f ?x) (B ?x))

goal (1 subgoal):
 1. (\<lambda>x. infsum (f x) (B x)) summable_on A
[PROOF STEP]
by (auto intro: has_sum_Sigma[where f=\<open>\<lambda>(x,y). f x y\<close>, simplified] simp: summable_on_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. infsum (f x) (B x)) summable_on A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isLub_ubs: "isLub R S x \<Longrightarrow> x <=* ubs R S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isLub R S x \<Longrightarrow> x <=* ubs R S
[PROOF STEP]
unfolding ubs_def isLub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. leastP (isUb R S) x \<Longrightarrow> x <=* Collect (isUb R S)
[PROOF STEP]
by (rule leastPD2)


[STATEMENT]
lemma mat_extension_mult:
  assumes "m1 \<in> carrier_mat d1 d1"
    and "m2 \<in> carrier_mat d1 d1"
  shows "mat_extension (m1 * m2) = mat_extension m1 * mat_extension m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_extension (m1 * m2) = mat_extension m1 * mat_extension m2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d1 d1

goal (1 subgoal):
 1. mat_extension (m1 * m2) = mat_extension m1 * mat_extension m2
[PROOF STEP]
by (simp add: mat_extension_def tensor_mat_mult[symmetric])


[STATEMENT]
lemma path_component_linepath:
    fixes S :: "'a::real_normed_vector set"
    shows "closed_segment a b \<subseteq> S \<Longrightarrow> path_component S a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b \<subseteq> S \<Longrightarrow> path_component S a b
[PROOF STEP]
unfolding path_component_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b \<subseteq> S \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = a \<and> pathfinish g = b
[PROOF STEP]
by (rule_tac x="linepath a b" in exI, auto)


[STATEMENT]
lemma ex1_pole:
  shows "\<exists>! z. is_pole M z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!z. is_pole M z
[PROOF STEP]
using bij_moebius_pt[of M]
[PROOF STATE]
proof (prove)
using this:
bij (moebius_pt M)

goal (1 subgoal):
 1. \<exists>!z. is_pole M z
[PROOF STEP]
unfolding is_pole_def bij_def inj_on_def surj_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. moebius_pt M x = moebius_pt M y \<longrightarrow> x = y) \<and> (\<forall>y. \<exists>x. y = moebius_pt M x)

goal (1 subgoal):
 1. \<exists>!z. moebius_pt M z = \<infinity>\<^sub>h
[PROOF STEP]
unfolding Ex1_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. moebius_pt M x = moebius_pt M y \<longrightarrow> x = y) \<and> (\<forall>y. \<exists>x. y = moebius_pt M x)

goal (1 subgoal):
 1. \<exists>x. moebius_pt M x = \<infinity>\<^sub>h \<and> (\<forall>y. moebius_pt M y = \<infinity>\<^sub>h \<longrightarrow> y = x)
[PROOF STEP]
by (metis UNIV_I)


[STATEMENT]
lemma lookup_update_cases: "Mapping.lookup (Mapping.update k v m) k' = (if k=k' then Some v else Mapping.lookup m k')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (Mapping.update k v m) k' = (if k = k' then Some v else Mapping.lookup m k')
[PROOF STEP]
by (cases "k=k'", simp_all add: Mapping.lookup_update Mapping.lookup_update_neq)


[STATEMENT]
lemma sturm_aux_rat: "sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) =
  map real_of_rat_poly (sturm_aux_rat p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)
[PROOF STEP]
proof (induct p q rule: sturm_aux_rat.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p q. (degree q \<noteq> 0 \<Longrightarrow> sturm_aux (real_of_rat_poly q) (real_of_rat_poly (- (p mod q))) = map real_of_rat_poly (sturm_aux_rat q (- (p mod q)))) \<Longrightarrow> sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)
[PROOF STEP]
case (1 p q)
[PROOF STATE]
proof (state)
this:
degree q \<noteq> 0 \<Longrightarrow> sturm_aux (real_of_rat_poly q) (real_of_rat_poly (- (p mod q))) = map real_of_rat_poly (sturm_aux_rat q (- (p mod q)))

goal (1 subgoal):
 1. \<And>p q. (degree q \<noteq> 0 \<Longrightarrow> sturm_aux (real_of_rat_poly q) (real_of_rat_poly (- (p mod q))) = map real_of_rat_poly (sturm_aux_rat q (- (p mod q)))) \<Longrightarrow> sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)
[PROOF STEP]
interpret map_poly_inj_idom_hom of_rat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_inj_idom_hom of_rat
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p q. (degree q \<noteq> 0 \<Longrightarrow> sturm_aux (real_of_rat_poly q) (real_of_rat_poly (- (p mod q))) = map real_of_rat_poly (sturm_aux_rat q (- (p mod q)))) \<Longrightarrow> sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)
[PROOF STEP]
note deg = of_int_hom.degree_map_poly_hom
[PROOF STATE]
proof (state)
this:
degree (of_int_poly ?p) = degree ?p

goal (1 subgoal):
 1. \<And>p q. (degree q \<noteq> 0 \<Longrightarrow> sturm_aux (real_of_rat_poly q) (real_of_rat_poly (- (p mod q))) = map real_of_rat_poly (sturm_aux_rat q (- (p mod q)))) \<Longrightarrow> sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)
[PROOF STEP]
unfolding sturm_aux.simps[of "real_of_rat_poly p"] sturm_aux_rat.simps[of p]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if degree (real_of_rat_poly q) = 0 then [real_of_rat_poly p, real_of_rat_poly q] else real_of_rat_poly p # sturm_aux (real_of_rat_poly q) (- (real_of_rat_poly p mod real_of_rat_poly q))) = map real_of_rat_poly (if degree q = 0 then [p, q] else p # sturm_aux_rat q (- (p mod q)))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
degree q \<noteq> 0 \<Longrightarrow> sturm_aux (real_of_rat_poly q) (real_of_rat_poly (- (p mod q))) = map real_of_rat_poly (sturm_aux_rat q (- (p mod q)))

goal (1 subgoal):
 1. (if degree (real_of_rat_poly q) = 0 then [real_of_rat_poly p, real_of_rat_poly q] else real_of_rat_poly p # sturm_aux (real_of_rat_poly q) (- (real_of_rat_poly p mod real_of_rat_poly q))) = map real_of_rat_poly (if degree q = 0 then [p, q] else p # sturm_aux_rat q (- (p mod q)))
[PROOF STEP]
by (cases "degree q = 0"; simp add: hom_distribs)
[PROOF STATE]
proof (state)
this:
sturm_aux (real_of_rat_poly p) (real_of_rat_poly q) = map real_of_rat_poly (sturm_aux_rat p q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma seq_suble:
  assumes sf: "strict_mono (f :: nat \<Rightarrow> nat)"
  shows "n \<le> f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> f n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> f 0
 2. \<And>n. n \<le> f n \<Longrightarrow> Suc n \<le> f (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. 0 \<le> f 0
 2. \<And>n. n \<le> f n \<Longrightarrow> Suc n \<le> f (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> f 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> f 0

goal (1 subgoal):
 1. \<And>n. n \<le> f n \<Longrightarrow> Suc n \<le> f (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. n \<le> f n \<Longrightarrow> Suc n \<le> f (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n \<le> f n

goal (1 subgoal):
 1. \<And>n. n \<le> f n \<Longrightarrow> Suc n \<le> f (Suc n)
[PROOF STEP]
with sf [unfolded strict_mono_Suc_iff, rule_format, of n]
[PROOF STATE]
proof (chain)
picking this:
f n < f (Suc n)
n \<le> f n
[PROOF STEP]
have "n < f (Suc n)"
[PROOF STATE]
proof (prove)
using this:
f n < f (Suc n)
n \<le> f n

goal (1 subgoal):
 1. n < f (Suc n)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
n < f (Suc n)

goal (1 subgoal):
 1. \<And>n. n \<le> f n \<Longrightarrow> Suc n \<le> f (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n < f (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
n < f (Suc n)

goal (1 subgoal):
 1. Suc n \<le> f (Suc n)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
Suc n \<le> f (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Hadjicostas_Chapman_formula_real:
  fixes z :: real
  assumes z: "z > -1"
  shows   "Hadjicostas_nn_integral z =
             ennreal (Gamma (z + 2) * (Re (zeta (z + 2)) - 1 / (z + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hadjicostas_nn_integral z = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Hadjicostas_nn_integral z = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
have nonneg: "1 \<le> x - ln x" if "x > 0" "x < 1" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> x - ln x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> x - ln x
[PROOF STEP]
have "ln x + (1 + ln x) \<le> ln x + exp (ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln x + (1 + ln x) \<le> ln x + exp (ln x)
[PROOF STEP]
by (intro add_left_mono exp_ge_add_one_self)
[PROOF STATE]
proof (state)
this:
ln x + (1 + ln x) \<le> ln x + exp (ln x)

goal (1 subgoal):
 1. 1 \<le> x - ln x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ln x + (1 + ln x) \<le> ln x + exp (ln x)

goal (1 subgoal):
 1. 1 \<le> x - ln x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
ln x + (1 + ln x) \<le> ln x + exp (ln x)
0 < x
x < 1

goal (1 subgoal):
 1. 1 \<le> x - ln x
[PROOF STEP]
by (simp add: exp_minus)
[PROOF STATE]
proof (state)
this:
1 \<le> x - ln x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?x; ?x < 1\<rbrakk> \<Longrightarrow> 1 \<le> ?x - ln ?x

goal (1 subgoal):
 1. Hadjicostas_nn_integral z = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hadjicostas_nn_integral z = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
unfolding Hadjicostas_nn_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal ((- ln x) powr z / (1 - x) * (- ln x + x - 1))\<partial>lborel = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
using nonneg Hadjicostas_Chapman_aux[OF z]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?x; ?x < 1\<rbrakk> \<Longrightarrow> 1 \<le> ?x - ln ?x
((\<lambda>u. (- ln u) powr z / (1 - u) * (- ln u + u - 1)) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal ((- ln x) powr z / (1 - x) * (- ln x + x - 1))\<partial>lborel = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
by (intro nn_integral_has_integral_lebesgue' mult_nonneg_nonneg divide_nonneg_nonneg) auto
[PROOF STATE]
proof (state)
this:
Hadjicostas_nn_integral z = ennreal (Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma times_in_float_intervalI: "a * b \<in>\<^sub>r A * B" if "a \<in>\<^sub>r A" "b \<in>\<^sub>r B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b \<in>\<^sub>r A * B
[PROOF STEP]
using times_in_intervalI[OF that]
[PROOF STATE]
proof (prove)
using this:
a * b \<in>\<^sub>i real_interval A * real_interval B

goal (1 subgoal):
 1. a * b \<in>\<^sub>r A * B
[PROOF STEP]
by (auto simp: real_interval_times)


[STATEMENT]
lemma inf_ext: "\<forall>S. \<exists>X. is_infimum X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S. \<exists>X. (\<forall>Xa. S Xa \<longrightarrow> Xa \<^bold>\<succeq> X) \<and> (\<forall>Xa. (\<forall>X. S X \<longrightarrow> X \<^bold>\<succeq> Xa) \<longrightarrow> X \<^bold>\<succeq> Xa)
[PROOF STEP]
by (metis infimum_def)


[STATEMENT]
lemma square__coplanar:
  assumes "Square A B C D"
  shows "Coplanar A B C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
using Square_def assms rectangle__coplanar
[PROOF STATE]
proof (prove)
using this:
Square ?A ?B ?C ?D \<equiv> Rectangle ?A ?B ?C ?D \<and> Cong ?A ?B ?B ?C
Square A B C D
Rectangle ?A ?B ?C ?D \<Longrightarrow> Coplanar ?A ?B ?C ?D

goal (1 subgoal):
 1. Coplanar A B C D
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_norm_zero: "(f \<longlongrightarrow> 0) F \<Longrightarrow> ((\<lambda>x. norm (f x)) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'b)) F \<Longrightarrow> ((\<lambda>x. norm (f x)) \<longlongrightarrow> 0) F
[PROOF STEP]
by (drule tendsto_norm) simp


[STATEMENT]
lemma sqrt_zero [simp]: "sqrt 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sqrt 0 = 0
[PROOF STEP]
using sqrt_inverse_power2 [of 0]
[PROOF STATE]
proof (prove)
using this:
local.sqrt (0\<^sup>2) = 0

goal (1 subgoal):
 1. local.sqrt 0 = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma outer_prod_left_right_mat:
  fixes A B :: "complex mat"
  assumes du: "u \<in> carrier_vec d2" and dv: "v \<in> carrier_vec d3"
    and dA: "A \<in> carrier_mat d1 d2" and dB: "B \<in> carrier_mat d3 d4"
  shows "A * (outer_prod u v) * B = (outer_prod (A *\<^sub>v u) (adjoint B *\<^sub>v v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * outer_prod u v * B = outer_prod (A *\<^sub>v u) (adjoint B *\<^sub>v v)
[PROOF STEP]
unfolding outer_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
have eq1: "A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i)) = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i)
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i)); j < dim_col (mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i))\<rbrakk> \<Longrightarrow> (A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i)) $$ (i, j) = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) $$ (i, j)
 2. dim_row (A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i)) = dim_row (mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i))
 3. dim_col (A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i)) = dim_col (mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i))
[PROOF STEP]
by (auto simp add: dA du scalar_prod_def)
[PROOF STATE]
proof (state)
this:
A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i)

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
have conj: "conjugate a * b = conjugate ((a::complex) * conjugate b) " for a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate a * b = conjugate (a * conjugate b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate ?a * ?b = conjugate (?a * conjugate ?b)

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
have eq2: "mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)); j < dim_col (mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y))\<rbrakk> \<Longrightarrow> (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B) $$ (i, j) = mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y) $$ (i, j)
 2. dim_row (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B) = dim_row (mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y))
 3. dim_col (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B) = dim_col (mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y))
[PROOF STEP]
apply (auto simp add: carrier_matD[OF dB] carrier_vecD[OF dv] scalar_prod_def adjoint_def conjugate_vec_def sum_conjugate )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j < d4 \<Longrightarrow> (\<Sum>i = 0..<d3. cnj (v $ i) * B $$ (i, j)) = (\<Sum>x = 0..<d3. B $$ (x, j) * cnj (v $ x))
[PROOF STEP]
apply (rule sum.cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. j < d4 \<Longrightarrow> {0..<d3} = {0..<d3}
 2. \<And>j x. \<lbrakk>j < d4; x \<in> {0..<d3}\<rbrakk> \<Longrightarrow> cnj (v $ x) * B $$ (x, j) = B $$ (x, j) * cnj (v $ x)
[PROOF STEP]
by (auto simp add: conj)
[PROOF STATE]
proof (state)
this:
mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
have "A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B =
       (A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i))) *(mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B
[PROOF STEP]
using dA du dv dB assoc_mult_mat[OF dA, of "mat (dim_vec u) 1 (\<lambda>(i, j). u $ i)" 1 "mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)"]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat d1 d2
u \<in> carrier_vec d2
v \<in> carrier_vec d3
B \<in> carrier_mat d3 d4
\<lbrakk>mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) \<in> carrier_mat d2 1; mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) \<in> carrier_mat 1 ?n\<^sub>4\<rbrakk> \<Longrightarrow> A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) = A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y))

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
have "\<dots> = (A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i))) *((mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B)
[PROOF STEP]
using dA du dv dB assoc_mult_mat[OF _ _ dB, of "(A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i)))" d1 1]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat d1 d2
u \<in> carrier_vec d2
v \<in> carrier_vec d3
B \<in> carrier_mat d3 d4
\<lbrakk>A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) \<in> carrier_mat d1 1; ?B \<in> carrier_mat 1 d3\<rbrakk> \<Longrightarrow> A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * ?B * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (?B * B)

goal (1 subgoal):
 1. A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B)

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B)
[PROOF STEP]
show "A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B =
    mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)"
[PROOF STATE]
proof (prove)
using this:
A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B)

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
using eq1 eq2
[PROOF STATE]
proof (prove)
using this:
A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * (mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B)
A * mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i)
mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y) * B = mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)

goal (1 subgoal):
 1. A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * (mat (dim_vec u) 1 (\<lambda>(i, j). u $ i) * mat 1 (dim_vec v) (\<lambda>(i, y). conjugate v $ y)) * B = mat (dim_vec (A *\<^sub>v u)) 1 (\<lambda>(i, j). (A *\<^sub>v u) $ i) * mat 1 (dim_vec (adjoint B *\<^sub>v v)) (\<lambda>(i, y). conjugate (adjoint B *\<^sub>v v) $ y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma signed_take_bit_diff:
  \<open>signed_take_bit n (signed_take_bit n k - signed_take_bit n l) = signed_take_bit n (k - l)\<close>
  for k l :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k - signed_take_bit n l) = signed_take_bit n (k - l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k - signed_take_bit n l) = signed_take_bit n (k - l)
[PROOF STEP]
have \<open>take_bit (Suc n)
     (take_bit (Suc n) (signed_take_bit n k) -
      take_bit (Suc n) (signed_take_bit n l)) =
    take_bit (Suc n) (k - l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (Suc n) (take_bit (Suc n) (signed_take_bit n k) - take_bit (Suc n) (signed_take_bit n l)) = take_bit (Suc n) (k - l)
[PROOF STEP]
by (simp add: take_bit_signed_take_bit take_bit_diff)
[PROOF STATE]
proof (state)
this:
take_bit (Suc n) (take_bit (Suc n) (signed_take_bit n k) - take_bit (Suc n) (signed_take_bit n l)) = take_bit (Suc n) (k - l)

goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k - signed_take_bit n l) = signed_take_bit n (k - l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take_bit (Suc n) (take_bit (Suc n) (signed_take_bit n k) - take_bit (Suc n) (signed_take_bit n l)) = take_bit (Suc n) (k - l)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
take_bit (Suc n) (take_bit (Suc n) (signed_take_bit n k) - take_bit (Suc n) (signed_take_bit n l)) = take_bit (Suc n) (k - l)

goal (1 subgoal):
 1. signed_take_bit n (signed_take_bit n k - signed_take_bit n l) = signed_take_bit n (k - l)
[PROOF STEP]
by (simp only: signed_take_bit_eq_iff_take_bit_eq take_bit_diff)
[PROOF STATE]
proof (state)
this:
signed_take_bit n (signed_take_bit n k - signed_take_bit n l) = signed_take_bit n (k - l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjoint_mono: "\<lbrakk> a\<subseteq>a'; b\<subseteq>b'; a'\<inter>b'={} \<rbrakk> \<Longrightarrow> a\<inter>b={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<subseteq> a'; b \<subseteq> b'; a' \<inter> b' = {}\<rbrakk> \<Longrightarrow> a \<inter> b = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma eventually_not_equal_at_infinity:
  "eventually (\<lambda>x. x \<noteq> (a :: 'a :: {real_normed_vector})) at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_infinity. x \<noteq> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_infinity. x \<noteq> a
[PROOF STEP]
from filterlim_norm_at_top[where 'a = 'a]
[PROOF STATE]
proof (chain)
picking this:
filterlim norm at_top at_infinity
[PROOF STEP]
have "\<forall>\<^sub>F x in at_infinity. norm a < norm (x::'a)"
[PROOF STATE]
proof (prove)
using this:
filterlim norm at_top at_infinity

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_infinity. norm a < norm x
[PROOF STEP]
by (auto simp: filterlim_at_top_dense)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_infinity. norm a < norm x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_infinity. x \<noteq> a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_infinity. norm a < norm x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_infinity. x \<noteq> a
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_infinity. x \<noteq> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polynomial_product_nat:
  fixes x :: nat
  assumes m: "\<And>i. i > m \<Longrightarrow> a i = 0"
    and n: "\<And>j. j > n \<Longrightarrow> b j = 0"
  shows "(\<Sum>i\<le>m. (a i) * x ^ i) * (\<Sum>j\<le>n. (b j) * x ^ j) =
         (\<Sum>r\<le>m + n. (\<Sum>k\<le>r. (a k) * (b (r - k))) * x ^ r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>m. a i * x ^ i) * (\<Sum>j\<le>n. b j * x ^ j) = (\<Sum>r\<le>m + n. (\<Sum>k\<le>r. a k * b (r - k)) * x ^ r)
[PROOF STEP]
using polynomial_product [of m a n b x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. m < i \<Longrightarrow> int (a i) = 0; \<And>j. n < j \<Longrightarrow> int (b j) = 0\<rbrakk> \<Longrightarrow> (\<Sum>i\<le>m. int (a i) * int x ^ i) * (\<Sum>j\<le>n. int (b j) * int x ^ j) = (\<Sum>r\<le>m + n. (\<Sum>k\<le>r. int (a k) * int (b (r - k))) * int x ^ r)
m < ?i \<Longrightarrow> a ?i = 0
n < ?j \<Longrightarrow> b ?j = 0

goal (1 subgoal):
 1. (\<Sum>i\<le>m. a i * x ^ i) * (\<Sum>j\<le>n. b j * x ^ j) = (\<Sum>r\<le>m + n. (\<Sum>k\<le>r. a k * b (r - k)) * x ^ r)
[PROOF STEP]
by (simp only: of_nat_mult [symmetric] of_nat_power [symmetric]
      of_nat_eq_iff Int.int_sum [symmetric])


[STATEMENT]
lemma top_injective_inf_complement:
  assumes "injective x"
  shows "top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> -y) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> - y) = bot
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> - y) = bot
[PROOF STEP]
have "(x \<sqinter> -y) * (x\<^sup>T \<sqinter> y\<^sup>T) \<le> -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreflexive ((x \<sqinter> - y) * (x\<^sup>T \<sqinter> y\<^sup>T))
[PROOF STEP]
by (metis conv_dist_inf inf.cobounded2 inf_left_idem mult_left_one p_shunting_swap schroeder_4_p)
[PROOF STATE]
proof (state)
this:
irreflexive ((x \<sqinter> - y) * (x\<^sup>T \<sqinter> y\<^sup>T))

goal (1 subgoal):
 1. top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> - y) = bot
[PROOF STEP]
hence "(x \<sqinter> -y) * (x\<^sup>T \<sqinter> y\<^sup>T) = bot"
[PROOF STATE]
proof (prove)
using this:
irreflexive ((x \<sqinter> - y) * (x\<^sup>T \<sqinter> y\<^sup>T))

goal (1 subgoal):
 1. (x \<sqinter> - y) * (x\<^sup>T \<sqinter> y\<^sup>T) = bot
[PROOF STEP]
by (smt assms comp_isotone coreflexive_comp_inf coreflexive_idempotent coreflexive_symmetric dual_order.trans inf.cobounded1 strict_order_var)
[PROOF STATE]
proof (state)
this:
(x \<sqinter> - y) * (x\<^sup>T \<sqinter> y\<^sup>T) = bot

goal (1 subgoal):
 1. top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> - y) = bot
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<sqinter> - y) * (x\<^sup>T \<sqinter> y\<^sup>T) = bot

goal (1 subgoal):
 1. top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> - y) = bot
[PROOF STEP]
by (simp add: conv_dist_inf schroeder_2 mult_assoc)
[PROOF STATE]
proof (state)
this:
top * (x \<sqinter> y) \<sqinter> top * (x \<sqinter> - y) = bot

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quotient_of_denom_diff_dvd:
  "snd (quotient_of (x - y)) dvd snd (quotient_of x) * snd (quotient_of y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (quotient_of (x - y)) dvd snd (quotient_of x) * snd (quotient_of y)
[PROOF STEP]
using quotient_of_denom_add_dvd[of x "-y"]
[PROOF STATE]
proof (prove)
using this:
snd (quotient_of (x + - y)) dvd snd (quotient_of x) * snd (quotient_of (- y))

goal (1 subgoal):
 1. snd (quotient_of (x - y)) dvd snd (quotient_of x) * snd (quotient_of y)
[PROOF STEP]
by (simp add: rat_uminus_code Let_def case_prod_unfold)


[STATEMENT]
lemma [code abstract]:
    "Rep_FingerTree (rcons t a) = (FingerTreeStruc.rcons (Rep_FingerTree t) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_FingerTree (rcons t a) = FingerTreeStruc.rcons (Rep_FingerTree t) a
[PROOF STEP]
by (simp add: rcons_def FingerTreeStruc.rcons_correct)


[STATEMENT]
lemma foldl_funion_fempty : "foldl (|\<union>|) fempty xs = ffUnion (fset_of_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (|\<union>|) {||} xs = ffUnion (fset_of_list xs)
[PROOF STEP]
by (induction xs rule: rev_induct; auto)


[STATEMENT]
lemma is_balanced_sum_mod_2:
  assumes "is_balanced"
  shows "(f 0 + f 1) mod 2 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f 0 + f 1) mod 2 = 1
[PROOF STEP]
using assms is_balanced_def id_sum_mod_2 is_swap_sum_mod_2
[PROOF STATE]
proof (prove)
using this:
is_balanced
is_balanced \<equiv> (\<forall>x\<in>{0, 1}. f x = x) \<or> is_swap
f = id \<Longrightarrow> (f 0 + f 1) mod 2 = 1
is_swap \<Longrightarrow> (f 0 + f 1) mod 2 = 1

goal (1 subgoal):
 1. (f 0 + f 1) mod 2 = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma rbl_word_or: "rev (to_bl (x OR y)) = map2 (\<or>) (rev (to_bl x)) (rev (to_bl y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (to_bl (x OR y)) = map2 (\<or>) (rev (to_bl x)) (rev (to_bl y))
[PROOF STEP]
by (simp add: zip_rev bl_word_or rev_map)


[STATEMENT]
lemma isGlb_cInf:
  "(S::'a :: conditionally_complete_lattice set) \<noteq> {} \<Longrightarrow> (\<exists>b. b <=* S) \<Longrightarrow> isGlb UNIV S (Inf S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; \<exists>b. b <=* S\<rbrakk> \<Longrightarrow> isGlb UNIV S (Inf S)
[PROOF STEP]
by  (auto simp add: isGlb_def setge_def greatestP_def isLb_def
            intro!: setleI cInf_lower cInf_greatest)


[STATEMENT]
lemma bij_image_singleton:
  shows "\<lbrakk>f ` A = {b}; f a = b; bij f\<rbrakk> \<Longrightarrow> A = {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f ` A = {b}; f a = b; bij f\<rbrakk> \<Longrightarrow> A = {a}
[PROOF STEP]
by (metis bij_betw_def image_empty image_insert inj_image_eq_iff)


[STATEMENT]
lemma count_mset_split_image_filter_not:
  assumes "\<And> x. x \<in>#A \<Longrightarrow> b \<noteq> f x"
  shows "count (image_mset (\<lambda>x. if P x then f x else b) A ) b = size (filter_mset (\<lambda> x. \<not> P x) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count {#if P x then f x else b. x \<in># A#} b = size {#x \<in># A. \<not> P x#}
[PROOF STEP]
using image_mset_If image_mset_filter_swap size_image_mset
[PROOF STATE]
proof (prove)
using this:
{#if ?P x then ?f x else ?g x. x \<in># ?A#} = image_mset ?f (filter_mset ?P ?A) + image_mset ?g {#x \<in># ?A. \<not> ?P x#}
image_mset ?f {#x \<in># ?M. ?P (?f x)#} = filter_mset ?P (image_mset ?f ?M)
size (image_mset ?f ?M) = size ?M

goal (1 subgoal):
 1. count {#if P x then f x else b. x \<in># A#} b = size {#x \<in># A. \<not> P x#}
[PROOF STEP]
by (smt (verit) assms count_size_set_repr filter_mset_cong)


[STATEMENT]
lemma ah_update_mono: "\<lbrakk>h \<le> h'; F=F'; M\<subseteq>M'\<rbrakk>
  \<Longrightarrow> ah_update h F M \<le> ah_update h' F' M'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<le> h'; F = F'; M \<subseteq> M'\<rbrakk> \<Longrightarrow> ah_update h F M \<le> ah_update h' F' M'
[PROOF STEP]
by (auto simp add: ah_update_def le_fun_def [where 'b="'a set"])


[STATEMENT]
lemma norm_sum: "norm (sum f A) \<le> (\<Sum>i\<in>A. norm (f i))"
  for f::"'b \<Rightarrow> 'a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (sum f A) \<le> (\<Sum>i\<in>A. norm (f i))
[PROOF STEP]
by (induct A rule: infinite_finite_induct) (auto intro: norm_triangle_mono)


[STATEMENT]
lemma isLub_cSup:
  "(S::'a :: conditionally_complete_lattice set) \<noteq> {} \<Longrightarrow> (\<exists>b. S *<= b) \<Longrightarrow> isLub UNIV S (Sup S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; \<exists>b. S *<= b\<rbrakk> \<Longrightarrow> isLub UNIV S (Sup S)
[PROOF STEP]
by  (auto simp add: isLub_def setle_def leastP_def isUb_def
            intro!: setgeI cSup_upper cSup_least)


[STATEMENT]
lemma Suc_minus2: "2 \<le> k \<Longrightarrow> Suc (Suc(k - 2)) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> k \<Longrightarrow> Suc (Suc (k - 2)) = k
[PROOF STEP]
by auto


[STATEMENT]
lemma le_list_trans:
  "\<lbrakk> order r; xs <=[r] ys; ys <=[r] zs \<rbrakk> \<Longrightarrow> xs <=[r] zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r; xs <=[r] ys; ys <=[r] zs\<rbrakk> \<Longrightarrow> xs <=[r] zs
[PROOF STEP]
apply (unfold unfold_lesub_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r; Listn.le r xs ys; Listn.le r ys zs\<rbrakk> \<Longrightarrow> Listn.le r xs zs
[PROOF STEP]
apply (simp add: Listn.le_def list_all2_conv_all_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>order r; length xs = length zs \<and> (\<forall>i<length xs. xs ! i \<sqsubseteq>\<^bsub>r\<^esub> ys ! i); length ys = length zs \<and> (\<forall>i<length ys. ys ! i \<sqsubseteq>\<^bsub>r\<^esub> zs ! i)\<rbrakk> \<Longrightarrow> \<forall>i<length zs. xs ! i \<sqsubseteq>\<^bsub>r\<^esub> zs ! i
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>order r; length xs = length zs; \<forall>i<length xs. xs ! i \<sqsubseteq>\<^bsub>r\<^esub> ys ! i; length ys = length zs; \<forall>i<length ys. ys ! i \<sqsubseteq>\<^bsub>r\<^esub> zs ! i; i < length zs\<rbrakk> \<Longrightarrow> xs ! i \<sqsubseteq>\<^bsub>r\<^esub> zs ! i
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>order r; length xs = length zs; \<forall>i<length zs. xs ! i \<sqsubseteq>\<^bsub>r\<^esub> ys ! i; length ys = length zs; \<forall>i<length zs. ys ! i \<sqsubseteq>\<^bsub>r\<^esub> zs ! i; i < length zs\<rbrakk> \<Longrightarrow> xs ! i \<sqsubseteq>\<^bsub>r\<^esub> zs ! i
[PROOF STEP]
apply (blast intro: order_trans)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma parallel_subspace:
  assumes "subspace A"
    and "subspace B"
    and "affine_parallel A B"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<subseteq> B
 2. B \<subseteq> A
[PROOF STEP]
show "A \<supseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
using assms parallel_subspace_aux
[PROOF STATE]
proof (prove)
using this:
subspace A
subspace B
affine_parallel A B
\<lbrakk>subspace ?A; subspace ?B; affine_parallel ?A ?B\<rbrakk> \<Longrightarrow> ?B \<subseteq> ?A

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<subseteq> A

goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
show "A \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
using assms parallel_subspace_aux[of B A] affine_parallel_commut
[PROOF STATE]
proof (prove)
using this:
subspace A
subspace B
affine_parallel A B
\<lbrakk>subspace B; subspace A; affine_parallel B A\<rbrakk> \<Longrightarrow> A \<subseteq> B
affine_parallel ?A ?B \<Longrightarrow> affine_parallel ?B ?A

goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<subseteq> B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_map_connectedness:
  assumes f: "homeomorphic_map X Y f" and U: "U \<subseteq> topspace X"
  shows "connectedin Y (f ` U) \<longleftrightarrow> connectedin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connectedin Y (f ` U) = connectedin X U
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connectedin Y (f ` U) = connectedin X U
[PROOF STEP]
have 1: "f ` U \<subseteq> topspace Y \<longleftrightarrow> U \<subseteq> topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ` U \<subseteq> topspace Y) = (U \<subseteq> topspace X)
[PROOF STEP]
using U f homeomorphic_imp_surjective_map
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> topspace X
homeomorphic_map X Y f
homeomorphic_map ?X ?Y ?f \<Longrightarrow> ?f ` topspace ?X = topspace ?Y

goal (1 subgoal):
 1. (f ` U \<subseteq> topspace Y) = (U \<subseteq> topspace X)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f ` U \<subseteq> topspace Y) = (U \<subseteq> topspace X)

goal (1 subgoal):
 1. connectedin Y (f ` U) = connectedin X U
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(f ` U \<subseteq> topspace Y) = (U \<subseteq> topspace X)

goal (1 subgoal):
 1. connectedin Y (f ` U) = connectedin X U
[PROOF STEP]
have "connected_space (subtopology Y (f ` U)) \<longleftrightarrow> connected_space (subtopology X U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space (subtopology Y (f ` U)) = connected_space (subtopology X U)
[PROOF STEP]
proof (rule homeomorphic_connected_space)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subtopology Y (f ` U) homeomorphic_space subtopology X U
[PROOF STEP]
have "f ` U \<subseteq> topspace Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` U \<subseteq> topspace Y
[PROOF STEP]
by (simp add: U 1)
[PROOF STATE]
proof (state)
this:
f ` U \<subseteq> topspace Y

goal (1 subgoal):
 1. subtopology Y (f ` U) homeomorphic_space subtopology X U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` U \<subseteq> topspace Y
[PROOF STEP]
have "topspace Y \<inter> f ` U = f ` U"
[PROOF STATE]
proof (prove)
using this:
f ` U \<subseteq> topspace Y

goal (1 subgoal):
 1. topspace Y \<inter> f ` U = f ` U
[PROOF STEP]
by (simp add: subset_antisym)
[PROOF STATE]
proof (state)
this:
topspace Y \<inter> f ` U = f ` U

goal (1 subgoal):
 1. subtopology Y (f ` U) homeomorphic_space subtopology X U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
topspace Y \<inter> f ` U = f ` U
[PROOF STEP]
show "subtopology Y (f ` U) homeomorphic_space subtopology X U"
[PROOF STATE]
proof (prove)
using this:
topspace Y \<inter> f ` U = f ` U

goal (1 subgoal):
 1. subtopology Y (f ` U) homeomorphic_space subtopology X U
[PROOF STEP]
by (metis (no_types) Int_subset_iff U f homeomorphic_map_imp_homeomorphic_space homeomorphic_map_subtopologies homeomorphic_space_sym subset_antisym subset_refl)
[PROOF STATE]
proof (state)
this:
subtopology Y (f ` U) homeomorphic_space subtopology X U

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
connected_space (subtopology Y (f ` U)) = connected_space (subtopology X U)

goal (1 subgoal):
 1. connectedin Y (f ` U) = connectedin X U
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(f ` U \<subseteq> topspace Y) = (U \<subseteq> topspace X)
connected_space (subtopology Y (f ` U)) = connected_space (subtopology X U)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f ` U \<subseteq> topspace Y) = (U \<subseteq> topspace X)
connected_space (subtopology Y (f ` U)) = connected_space (subtopology X U)

goal (1 subgoal):
 1. connectedin Y (f ` U) = connectedin X U
[PROOF STEP]
by (auto simp: connectedin_def)
[PROOF STATE]
proof (state)
this:
connectedin Y (f ` U) = connectedin X U

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniform_discrete_tan_eq:
  "uniform_discrete {x::real. tan x = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_discrete {x. tan x = y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uniform_discrete {x. tan x = y}
[PROOF STEP]
have "x1=x2" when dist:"dist x1 x2<pi/2" and "tan x1=y" "tan x2=y" for x1 x2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
obtain k1::int where x1:"x1 = arctan y + k1*pi \<or> (x1 = pi/2 + k1*pi \<and> y=0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1. x1 = arctan y + real_of_int k1 * pi \<or> x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using tan_eq_arctan_Ex \<open>tan x1=y\<close>
[PROOF STATE]
proof (prove)
using this:
(tan ?x = ?y) = (\<exists>x. ?x = arctan ?y + real_of_int x * pi \<or> ?x = pi / 2 + real_of_int x * pi \<and> ?y = 0)
tan x1 = y

goal (1 subgoal):
 1. (\<And>k1. x1 = arctan y + real_of_int k1 * pi \<or> x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = arctan y + real_of_int k1 * pi \<or> x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
obtain k2::int where x2:"x2 = arctan y + k2*pi \<or> (x2 = pi/2 + k2*pi \<and> y=0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k2. x2 = arctan y + real_of_int k2 * pi \<or> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using tan_eq_arctan_Ex \<open>tan x2=y\<close>
[PROOF STATE]
proof (prove)
using this:
(tan ?x = ?y) = (\<exists>x. ?x = arctan ?y + real_of_int x * pi \<or> ?x = pi / 2 + real_of_int x * pi \<and> ?y = 0)
tan x2 = y

goal (1 subgoal):
 1. (\<And>k2. x2 = arctan y + real_of_int k2 * pi \<or> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x2 = arctan y + real_of_int k2 * pi \<or> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
let ?xk1="x1 = arctan y + k1*pi" and ?xk1'="x1 = pi/2 + k1*pi \<and> y=0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
let ?xk2="x2 = arctan y + k2*pi" and ?xk2'="x2 = pi/2 + k2*pi \<and> y=0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have ?thesis when "(?xk1 \<and> ?xk2) \<or> (?xk1' \<and> ?xk2')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have "x1-x2= (k1 - k2) *pi" when ?xk1 ?xk2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
using arg_cong2[where f=minus,OF \<open>?xk1\<close> \<open>?xk2\<close>]
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = arctan y + real_of_int k1 * pi - (arctan y + real_of_int k2 * pi)

goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have "x1-x2= (k1 - k2) *pi" when ?xk1' ?xk2'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
using arg_cong2[where f=minus,OF conjunct1[OF \<open>?xk1'\<close>] conjunct1[OF \<open>?xk2'\<close>]]
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = pi / 2 + real_of_int k1 * pi - (pi / 2 + real_of_int k2 * pi)

goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
have "x1-x2= (k1 - k2) *pi"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi

goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 - x2 = real_of_int (k1 - k2) * pi
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0

goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 - x2 = real_of_int (k1 - k2) * pi

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x1 - x2 = real_of_int (k1 - k2) * pi
[PROOF STEP]
have "\<bar>k1 - k2\<bar> < 1/2"
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int (k1 - k2) * pi

goal (1 subgoal):
 1. real_of_int \<bar>k1 - k2\<bar> < 1 / 2
[PROOF STEP]
using dist[unfolded dist_real_def]
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int (k1 - k2) * pi
\<bar>x1 - x2\<bar> < pi / 2

goal (1 subgoal):
 1. real_of_int \<bar>k1 - k2\<bar> < 1 / 2
[PROOF STEP]
by (auto simp add:abs_mult)
[PROOF STATE]
proof (state)
this:
real_of_int \<bar>k1 - k2\<bar> < 1 / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_int \<bar>k1 - k2\<bar> < 1 / 2
[PROOF STEP]
have "k1=k2"
[PROOF STATE]
proof (prove)
using this:
real_of_int \<bar>k1 - k2\<bar> < 1 / 2

goal (1 subgoal):
 1. k1 = k2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
k1 = k2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k1 = k2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k1 = k2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
k1 = k2
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> x1 = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> x1 = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have ?thesis when ?xk1 ?xk2'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have "x1 = k1*pi" "x2 = pi / 2 + k2 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = real_of_int k1 * pi &&& x2 = pi / 2 + real_of_int k2 * pi
[PROOF STEP]
using \<open>?xk2'\<close> \<open>?xk1\<close>
[PROOF STATE]
proof (prove)
using this:
x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0
x1 = arctan y + real_of_int k1 * pi

goal (1 subgoal):
 1. x1 = real_of_int k1 * pi &&& x2 = pi / 2 + real_of_int k2 * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = real_of_int k1 * pi
x2 = pi / 2 + real_of_int k2 * pi

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
from arg_cong2[where f=minus,OF this]
[PROOF STATE]
proof (chain)
picking this:
x1 - x2 = real_of_int k1 * pi - (pi / 2 + real_of_int k2 * pi)
[PROOF STEP]
have "x1 - x2 = (k1 - k2) * pi -pi/2"
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int k1 * pi - (pi / 2 + real_of_int k2 * pi)

goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi - pi / 2
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
x1 - x2 = real_of_int (k1 - k2) * pi - pi / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x1 - x2 = real_of_int (k1 - k2) * pi - pi / 2
[PROOF STEP]
have "\<bar>(k1 - k2) * pi -pi/2\<bar> < pi/2"
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int (k1 - k2) * pi - pi / 2

goal (1 subgoal):
 1. \<bar>real_of_int (k1 - k2) * pi - pi / 2\<bar> < pi / 2
[PROOF STEP]
using dist[unfolded dist_real_def]
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int (k1 - k2) * pi - pi / 2
\<bar>x1 - x2\<bar> < pi / 2

goal (1 subgoal):
 1. \<bar>real_of_int (k1 - k2) * pi - pi / 2\<bar> < pi / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int (k1 - k2) * pi - pi / 2\<bar> < pi / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>real_of_int (k1 - k2) * pi - pi / 2\<bar> < pi / 2
[PROOF STEP]
have "0<k1-k2" "k1-k2<1"
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (k1 - k2) * pi - pi / 2\<bar> < pi / 2

goal (1 subgoal):
 1. 0 < k1 - k2 &&& k1 - k2 < 1
[PROOF STEP]
unfolding abs_less_iff
[PROOF STATE]
proof (prove)
using this:
real_of_int (k1 - k2) * pi - pi / 2 < pi / 2 \<and> - (real_of_int (k1 - k2) * pi - pi / 2) < pi / 2

goal (1 subgoal):
 1. 0 < k1 - k2 &&& k1 - k2 < 1
[PROOF STEP]
by (auto simp add: zero_less_mult_iff)
[PROOF STATE]
proof (state)
this:
0 < k1 - k2
k1 - k2 < 1

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < k1 - k2
k1 - k2 < 1
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
0 < k1 - k2
k1 - k2 < 1

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

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have ?thesis when ?xk1' ?xk2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
have "x1 = pi / 2 + k1*pi" "x2 = k2 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = pi / 2 + real_of_int k1 * pi &&& x2 = real_of_int k2 * pi
[PROOF STEP]
using \<open>?xk2\<close> \<open>?xk1'\<close>
[PROOF STATE]
proof (prove)
using this:
x2 = arctan y + real_of_int k2 * pi
x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0

goal (1 subgoal):
 1. x1 = pi / 2 + real_of_int k1 * pi &&& x2 = real_of_int k2 * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = pi / 2 + real_of_int k1 * pi
x2 = real_of_int k2 * pi

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
from arg_cong2[where f=minus,OF this]
[PROOF STATE]
proof (chain)
picking this:
x1 - x2 = pi / 2 + real_of_int k1 * pi - real_of_int k2 * pi
[PROOF STEP]
have "x1 - x2 = (k1 - k2) * pi + pi/2"
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = pi / 2 + real_of_int k1 * pi - real_of_int k2 * pi

goal (1 subgoal):
 1. x1 - x2 = real_of_int (k1 - k2) * pi + pi / 2
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
x1 - x2 = real_of_int (k1 - k2) * pi + pi / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x1 - x2 = real_of_int (k1 - k2) * pi + pi / 2
[PROOF STEP]
have "\<bar>(k1 - k2) * pi + pi/2\<bar> < pi/2"
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int (k1 - k2) * pi + pi / 2

goal (1 subgoal):
 1. \<bar>real_of_int (k1 - k2) * pi + pi / 2\<bar> < pi / 2
[PROOF STEP]
using dist[unfolded dist_real_def]
[PROOF STATE]
proof (prove)
using this:
x1 - x2 = real_of_int (k1 - k2) * pi + pi / 2
\<bar>x1 - x2\<bar> < pi / 2

goal (1 subgoal):
 1. \<bar>real_of_int (k1 - k2) * pi + pi / 2\<bar> < pi / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int (k1 - k2) * pi + pi / 2\<bar> < pi / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>real_of_int (k1 - k2) * pi + pi / 2\<bar> < pi / 2
[PROOF STEP]
have "\<bar>(k1 - k2 + 1/2)*pi\<bar> < pi/2"
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (k1 - k2) * pi + pi / 2\<bar> < pi / 2

goal (1 subgoal):
 1. \<bar>(real_of_int (k1 - k2) + 1 / 2) * pi\<bar> < pi / 2
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<bar>(real_of_int (k1 - k2) + 1 / 2) * pi\<bar> < pi / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>(real_of_int (k1 - k2) + 1 / 2) * pi\<bar> < pi / 2
[PROOF STEP]
have "\<bar>(k1 - k2 + 1/2)\<bar> < 1/2"
[PROOF STATE]
proof (prove)
using this:
\<bar>(real_of_int (k1 - k2) + 1 / 2) * pi\<bar> < pi / 2

goal (1 subgoal):
 1. \<bar>real_of_int (k1 - k2) + 1 / 2\<bar> < 1 / 2
[PROOF STEP]
by (auto simp add:abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int (k1 - k2) + 1 / 2\<bar> < 1 / 2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>real_of_int (k1 - k2) + 1 / 2\<bar> < 1 / 2
[PROOF STEP]
have "-1<k1-k2 \<and> k1-k2<0"
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (k1 - k2) + 1 / 2\<bar> < 1 / 2

goal (1 subgoal):
 1. - 1 < k1 - k2 \<and> k1 - k2 < 0
[PROOF STEP]
unfolding abs_less_iff
[PROOF STATE]
proof (prove)
using this:
real_of_int (k1 - k2) + 1 / 2 < 1 / 2 \<and> - (real_of_int (k1 - k2) + 1 / 2) < 1 / 2

goal (1 subgoal):
 1. - 1 < k1 - k2 \<and> k1 - k2 < 0
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
- 1 < k1 - k2 \<and> k1 - k2 < 0

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- 1 < k1 - k2 \<and> k1 - k2 < 0
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
- 1 < k1 - k2 \<and> k1 - k2 < 0

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

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> x1 = x2
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 = x2
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 = x2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> x1 = x2
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 = x2
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
using x1 x2
[PROOF STATE]
proof (prove)
using this:
x1 = arctan y + real_of_int k1 * pi \<and> x2 = arctan y + real_of_int k2 * pi \<or> (x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0) \<and> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0 \<Longrightarrow> x1 = x2
\<lbrakk>x1 = arctan y + real_of_int k1 * pi; x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0\<rbrakk> \<Longrightarrow> x1 = x2
\<lbrakk>x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0; x2 = arctan y + real_of_int k2 * pi\<rbrakk> \<Longrightarrow> x1 = x2
x1 = arctan y + real_of_int k1 * pi \<or> x1 = pi / 2 + real_of_int k1 * pi \<and> y = 0
x2 = arctan y + real_of_int k2 * pi \<or> x2 = pi / 2 + real_of_int k2 * pi \<and> y = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>dist ?x1.0 ?x2.0 < pi / 2; tan ?x1.0 = y; tan ?x2.0 = y\<rbrakk> \<Longrightarrow> ?x1.0 = ?x2.0

goal (1 subgoal):
 1. uniform_discrete {x. tan x = y}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>dist ?x1.0 ?x2.0 < pi / 2; tan ?x1.0 = y; tan ?x2.0 = y\<rbrakk> \<Longrightarrow> ?x1.0 = ?x2.0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dist ?x1.0 ?x2.0 < pi / 2; tan ?x1.0 = y; tan ?x2.0 = y\<rbrakk> \<Longrightarrow> ?x1.0 = ?x2.0

goal (1 subgoal):
 1. uniform_discrete {x. tan x = y}
[PROOF STEP]
unfolding uniform_discrete_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dist ?x1.0 ?x2.0 < pi / 2; tan ?x1.0 = y; tan ?x2.0 = y\<rbrakk> \<Longrightarrow> ?x1.0 = ?x2.0

goal (1 subgoal):
 1. \<exists>e>0. \<forall>x\<in>{x. tan x = y}. \<forall>y\<in>{x. tan x = y}. dist x y < e \<longrightarrow> x = y
[PROOF STEP]
apply (intro exI[where x="pi/2"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x1 x2. \<lbrakk>dist x1 x2 < pi / 2; tan x1 = y; tan x2 = y\<rbrakk> \<Longrightarrow> x1 = x2) \<Longrightarrow> 0 < pi / 2 \<and> (\<forall>x\<in>{x. tan x = y}. \<forall>y\<in>{x. tan x = y}. dist x y < pi / 2 \<longrightarrow> x = y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
uniform_discrete {x. tan x = y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_del: "\<lbrakk> complete t ; sorted(inorder t) \<rbrakk> \<Longrightarrow>
  inorder(treeD (del x t)) = del_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>complete t; Sorted_Less.sorted (inorder t)\<rbrakk> \<Longrightarrow> inorder (treeD (del x t)) = del_list x (inorder t)
[PROOF STEP]
by(induction t rule: del.induct)
  (auto simp: del_list_simps inorder_nodes split_minD split!: if_split prod.splits)


[STATEMENT]
lemma restrictfun_im:"\<lbrakk> (restrict f A) \<in> A \<rightarrow> B; A1 \<subseteq> A \<rbrakk> \<Longrightarrow>
       (restrict f A) ` A1 = f ` A1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>restrict f A \<in> A \<rightarrow> B; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> restrict f A ` A1 = f ` A1
[PROOF STEP]
apply (subgoal_tac "\<forall>x\<in>A1. x \<in> A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>restrict f A \<in> A \<rightarrow> B; A1 \<subseteq> A; \<forall>x\<in>A1. x \<in> A\<rbrakk> \<Longrightarrow> restrict f A ` A1 = f ` A1
 2. \<lbrakk>restrict f A \<in> A \<rightarrow> B; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> \<forall>x\<in>A1. x \<in> A
[PROOF STEP]
apply (simp add:image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>restrict f A \<in> A \<rightarrow> B; A1 \<subseteq> A\<rbrakk> \<Longrightarrow> \<forall>x\<in>A1. x \<in> A
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>restrict f A \<in> A \<rightarrow> B; A1 \<subseteq> A; x \<in> A1\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cyclic_group_assoc:
  assumes "a \<in> carrier G" "b \<in> carrier G" "c \<in> carrier G"
  shows "(a \<otimes> b) \<otimes> c = a \<otimes> (b \<otimes> c)"
(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
obtain n :: nat where n: "a = \<^bold>g [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. a = \<^bold>g [^] n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using generatorE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
a \<in> carrier G
b \<in> carrier G
c \<in> carrier G

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

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
obtain k :: nat where k: "b = \<^bold>g [^] k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. b = \<^bold>g [^] k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using generatorE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
a \<in> carrier G
b \<in> carrier G
c \<in> carrier G

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

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
obtain j :: nat where j: "c = \<^bold>g [^] j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j. c = \<^bold>g [^] j \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using generatorE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier G; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
a \<in> carrier G
b \<in> carrier G
c \<in> carrier G

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

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
have "?lhs = (\<^bold>g [^] n \<otimes> \<^bold>g [^] k) \<otimes> \<^bold>g [^] j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = \<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j
[PROOF STEP]
using n k j
[PROOF STATE]
proof (prove)
using this:
a = \<^bold>g [^] n
b = \<^bold>g [^] k
c = \<^bold>g [^] j

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = \<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<otimes> b \<otimes> c = \<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes> b \<otimes> c = \<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j
[PROOF STEP]
have "... = \<^bold>g [^] (n + (k + j))"
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<otimes> c = \<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j

goal (1 subgoal):
 1. \<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j = \<^bold>g [^] (n + (k + j))
[PROOF STEP]
by(simp add: nat_pow_mult add.assoc)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j = \<^bold>g [^] (n + (k + j))

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j = \<^bold>g [^] (n + (k + j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] n \<otimes> \<^bold>g [^] k \<otimes> \<^bold>g [^] j = \<^bold>g [^] (n + (k + j))

goal (1 subgoal):
 1. a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)
[PROOF STEP]
by(simp add: nat_pow_mult n k j)
[PROOF STATE]
proof (state)
this:
a \<otimes> b \<otimes> c = a \<otimes> (b \<otimes> c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ramanujan_sum_dvd_eq_totient:
  assumes "k dvd n"
    shows "c k n = totient k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c k n = of_nat (totient k)
[PROOF STEP]
unfolding ramanujan_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
have "unity_root k (m*n) = 1" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root k (int (m * n)) = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k dvd n

goal (1 subgoal):
 1. unity_root k (int (m * n)) = 1
[PROOF STEP]
by (cases "k = 0") (auto simp: unity_root_eq_1_iff_int)
[PROOF STATE]
proof (state)
this:
unity_root k (int (?m * n)) = 1

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unity_root k (int (?m * n)) = 1
[PROOF STEP]
have "(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (m * n)) =
               (\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1)"
[PROOF STATE]
proof (prove)
using this:
unity_root k (int (?m * n)) = 1

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = (\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = (\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1)

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = (\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1)

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
have "\<dots> = card {m. m \<in> {1..k} \<and> coprime m k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1) = of_nat (card {m \<in> {1..k}. coprime m k})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1) = of_nat (card {m \<in> {1..k}. coprime m k})

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. 1) = of_nat (card {m \<in> {1..k}. coprime m k})

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
have "\<dots> = totient k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (totient k)
[PROOF STEP]
unfolding totient_def totatives_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (card {ka \<in> {0<..k}. coprime ka k})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (card {ka \<in> {0<..k}. coprime ka k})
[PROOF STEP]
have "{1..k} = {0<..k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..k} = {0<..k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1..k} = {0<..k}

goal (1 subgoal):
 1. of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (card {ka \<in> {0<..k}. coprime ka k})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{1..k} = {0<..k}
[PROOF STEP]
show " of_nat (card {m \<in> {1..k}. coprime m k}) =
              of_nat (card {ka \<in> {0<..k}. coprime ka k})"
[PROOF STATE]
proof (prove)
using this:
{1..k} = {0<..k}

goal (1 subgoal):
 1. of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (card {ka \<in> {0<..k}. coprime ka k})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (card {ka \<in> {0<..k}. coprime ka k})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
of_nat (card {m \<in> {1..k}. coprime m k}) = of_nat (totient k)

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
show "(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (m * n)) = totient k"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)

goal (1 subgoal):
 1. (\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>m | m \<in> {1..k} \<and> coprime m k. unity_root k (int (m * n))) = of_nat (totient k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_zeta_real:
  assumes "x > 1"
  shows   "summable (\<lambda>n. real (Suc n) powr -x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. real (Suc n) powr - x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. real (Suc n) powr - x)
[PROOF STEP]
have "summable (\<lambda>n. of_nat (Suc n) powr -complex_of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. of_nat (Suc n) powr - complex_of_real x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < x

goal (1 subgoal):
 1. summable (\<lambda>n. of_nat (Suc n) powr - complex_of_real x)
[PROOF STEP]
by (intro summable_zeta) simp_all
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. of_nat (Suc n) powr - complex_of_real x)

goal (1 subgoal):
 1. summable (\<lambda>n. real (Suc n) powr - x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. of_nat (Suc n) powr - complex_of_real x)

goal (1 subgoal):
 1. summable (\<lambda>n. real (Suc n) powr - x)
[PROOF STEP]
have "(\<lambda>n. of_nat (Suc n) powr -complex_of_real x) = (\<lambda>n. of_real (real (Suc n) powr -x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. of_nat (Suc n) powr - complex_of_real x) = (\<lambda>n. complex_of_real (real (Suc n) powr - x))
[PROOF STEP]
by (subst powr_Reals_eq) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. of_nat (Suc n) powr - complex_of_real x) = (\<lambda>n. complex_of_real (real (Suc n) powr - x))

goal (1 subgoal):
 1. summable (\<lambda>n. real (Suc n) powr - x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. complex_of_real (real (Suc n) powr - x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. complex_of_real (real (Suc n) powr - x))

goal (1 subgoal):
 1. summable (\<lambda>n. real (Suc n) powr - x)
[PROOF STEP]
by (subst (asm) summable_complex_of_real)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. real (Suc n) powr - x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma single_valued_lfp: fixes f :: "com_den \<Rightarrow> com_den"
assumes "cont f" "\<And>r. single_valued r \<Longrightarrow> single_valued (f r)"
shows "single_valued(lfp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued (lfp f)
[PROOF STEP]
unfolding lfp_if_cont[OF assms(1)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued (\<Union>n. (f ^^ n) {})
[PROOF STEP]
proof(rule single_valued_UN_chain[OF chain_iterates[OF mono_if_cont[OF assms(1)]]])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. single_valued ((f ^^ n) {})
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. single_valued ((f ^^ n) {})
[PROOF STEP]
show "single_valued ((f ^^ n) {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued ((f ^^ n) {})
[PROOF STEP]
by(induction n)(auto simp: assms(2))
[PROOF STATE]
proof (state)
this:
single_valued ((f ^^ n) {})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_split_min_rbt_sorted: "rbt_split_min t = (a,b,t') \<Longrightarrow> rbt_sorted t \<Longrightarrow> t \<noteq> RBT_Impl.Empty \<Longrightarrow>
  rbt_sorted t' \<and> (\<forall>x \<in> set (RBT_Impl.keys t'). a < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbt_split_min t = (a, b, t'); rbt_sorted t; t \<noteq> Empty\<rbrakk> \<Longrightarrow> rbt_sorted t' \<and> (\<forall>x\<in>set (keys t'). a < x)
[PROOF STEP]
by (induction t arbitrary: t')
     (fastforce simp: rbt_split_min_set rbt_sorted_rbt_join set_rbt_join rbt_less_prop rbt_greater_prop
      split: if_splits prod.splits)+


[STATEMENT]
lemma eval_primfuns_pos: "eventually (\<lambda>x. eval_primfuns fs x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < eval_primfuns fs x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < eval_primfuns fs x
[PROOF STEP]
have prod_list_pos: "(\<And>x::_::linordered_semidom. x \<in> set xs \<Longrightarrow> x > 0) \<Longrightarrow> prod_list xs > 0"
    for xs :: "real list"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> 0 < x) \<Longrightarrow> 0 < prod_list xs
[PROOF STEP]
by (induction xs) auto
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> set ?xs \<Longrightarrow> 0 < x) \<Longrightarrow> 0 < prod_list ?xs

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < eval_primfuns fs x
[PROOF STEP]
have "eventually (\<lambda>x. \<forall>f\<in>set fs. eval_primfun f x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<forall>f\<in>set fs. 0 < eval_primfun f x
[PROOF STEP]
by (intro eventually_ball_finite ballI eval_primfun_pos finite_set)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. \<forall>f\<in>set fs. 0 < eval_primfun f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < eval_primfuns fs x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. \<forall>f\<in>set fs. 0 < eval_primfun f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < eval_primfuns fs x
[PROOF STEP]
unfolding eval_primfuns_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. \<forall>f\<in>set fs. 0 < eval_primfun f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < (\<Prod>f\<leftarrow>fs. eval_primfun f x)
[PROOF STEP]
by eventually_elim (rule prod_list_pos, auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < eval_primfuns fs x

goal:
No subgoals!
[PROOF STEP]
qed