[STATEMENT]
lemma quotient_of_inject:
  assumes "quotient_of a = quotient_of b"
  shows "a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
obtain p q r s where a: "a = Fract p q" and b: "b = Fract r s" and "q > 0" and "s > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q r s. \<lbrakk>a = Fract p q; b = Fract r s; 0 < q; 0 < s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases a, cases b)
[PROOF STATE]
proof (state)
this:
a = Fract p q
b = Fract r s
0 < q
0 < s

goal (1 subgoal):
 1. a = b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
quotient_of a = quotient_of b
a = Fract p q
b = Fract r s
0 < q
0 < s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
quotient_of a = quotient_of b
a = Fract p q
b = Fract r s
0 < q
0 < s

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (simp add: eq_rat quotient_of_Fract normalize_crossproduct)
[PROOF STATE]
proof (state)
this:
a = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iso_fInf:
  fixes F :: "('a::order \<Rightarrow> 'b::complete_lattice) set"
  shows "\<forall>f \<in> F. mono f \<Longrightarrow> mono (\<Sqinter>F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball F mono \<Longrightarrow> mono (\<Sqinter> F)
[PROOF STEP]
by (simp add: mono_def, safe, rule Inf_greatest, auto simp: INF_lower2)


[STATEMENT]
lemma card_UNIV_char:
  "card (UNIV :: char set) = 256"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = 256
[PROOF STEP]
by (auto simp add: UNIV_char_of_nat card_image)


[STATEMENT]
lemma pmf_of_set_impl_code [code]:
  "pmf_of_set_impl (set xs) =
    (if xs = [] then
         Code.abort (STR ''pmf_of_set of empty set'') (\<lambda>_. mapping_of_pmf (pmf_of_set (set xs)))
      else let xs' = remdups xs; p = 1 / real (length xs') in
         Mapping.tabulate xs' (\<lambda>_. p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf_of_set_impl (set xs) = (if xs = [] then Code.abort STR ''pmf_of_set of empty set'' (\<lambda>_. mapping_of_pmf (pmf_of_set (set xs))) else let xs' = remdups xs; p = 1 / real (length xs') in Mapping.tabulate xs' (\<lambda>_. p))
[PROOF STEP]
unfolding pmf_of_set_impl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mapping_of_pmf (pmf_of_set (set xs)) = (if xs = [] then Code.abort STR ''pmf_of_set of empty set'' (\<lambda>_. mapping_of_pmf (pmf_of_set (set xs))) else let xs' = remdups xs; p = 1 / real (length xs') in Mapping.tabulate xs' (\<lambda>_. p))
[PROOF STEP]
using pmf_of_set_code_aux[of "set xs" "remdups xs"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set xs \<noteq> {}; set (remdups xs) = set xs; distinct (remdups xs)\<rbrakk> \<Longrightarrow> mapping_of_pmf (pmf_of_set (set xs)) = Mapping.tabulate (remdups xs) (\<lambda>_. 1 / real (length (remdups xs)))

goal (1 subgoal):
 1. mapping_of_pmf (pmf_of_set (set xs)) = (if xs = [] then Code.abort STR ''pmf_of_set of empty set'' (\<lambda>_. mapping_of_pmf (pmf_of_set (set xs))) else let xs' = remdups xs; p = 1 / real (length xs') in Mapping.tabulate xs' (\<lambda>_. p))
[PROOF STEP]
by (simp add: Let_def)


[STATEMENT]
lemma stc_divide [simp]:
  "\<lbrakk>x \<in> HFinite; y \<in> HFinite; stc y \<noteq> 0\<rbrakk>
      \<Longrightarrow> stc(x/y) = (stc x) / (stc y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> HFinite; y \<in> HFinite; stc y \<noteq> 0\<rbrakk> \<Longrightarrow> stc (x / y) = stc x / stc y
[PROOF STEP]
by (simp add: divide_inverse stc_mult stc_not_Infinitesimal HFinite_inverse stc_inverse)


[STATEMENT]
lemma scaleR_image_atLeastAtMost: "c > 0 \<Longrightarrow> scaleR c ` {x..y} = {c *\<^sub>R x..c *\<^sub>R y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c \<Longrightarrow> (*\<^sub>R) c ` {x..y} = {c *\<^sub>R x..c *\<^sub>R y}
[PROOF STEP]
apply (auto intro!: scaleR_left_mono simp: image_iff Bex_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>0 < c; c *\<^sub>R x \<le> xa; xa \<le> c *\<^sub>R y\<rbrakk> \<Longrightarrow> \<exists>xb\<ge>x. xb \<le> y \<and> xa = c *\<^sub>R xb
[PROOF STEP]
using pos_divideR_le_eq [of c] pos_le_divideR_eq [of c]
[PROOF STATE]
proof (prove)
using this:
0 < c \<Longrightarrow> (?b /\<^sub>R c \<le> ?a) = (?b \<le> c *\<^sub>R ?a)
0 < c \<Longrightarrow> (?a \<le> ?b /\<^sub>R c) = (c *\<^sub>R ?a \<le> ?b)

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>0 < c; c *\<^sub>R x \<le> xa; xa \<le> c *\<^sub>R y\<rbrakk> \<Longrightarrow> \<exists>xb\<ge>x. xb \<le> y \<and> xa = c *\<^sub>R xb
[PROOF STEP]
apply (meson local.order_eq_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hyperdual_bases_norm [simp]:
  "(ba :: ('a :: {real_inner,real_normed_algebra_1}) hyperdual) \<bullet> ba = 1"
  "(e1 :: ('a :: {real_inner,real_normed_algebra_1}) hyperdual) \<bullet> e1 = 1"
  "(e2 :: ('a :: {real_inner,real_normed_algebra_1}) hyperdual) \<bullet> e2 = 1"
  "(e12 :: ('a :: {real_inner,real_normed_algebra_1}) hyperdual) \<bullet> e12 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ba \<bullet> ba = 1 &&& e1 \<bullet> e1 = 1) &&& e2 \<bullet> e2 = 1 &&& e12 \<bullet> e12 = 1
[PROOF STEP]
by (simp_all add: hyperdual_bases inner_hyperdual_def norm_eq_1[symmetric])


[STATEMENT]
lemma Union_plus:
  "(\<Union> x \<in> A <+> B. f x) = (\<Union> a \<in> A. f (Inl a)) \<union> (\<Union>b \<in> B. f (Inr b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (f ` (A <+> B)) = (\<Union>a\<in>A. f (Inl a)) \<union> (\<Union>b\<in>B. f (Inr b))
[PROOF STEP]
by auto


[STATEMENT]
lemma "dom (Nb\<^sub>e l) = {..<l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom (Nb\<^sub>e l) = {..<l}
[PROOF STEP]
by (simp add:Nb\<^sub>e_def dom_def lessThan_def)


[STATEMENT]
lemma alt_group_one: "one (alt_group n) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>alt_group n\<^esub> = id
[PROOF STEP]
unfolding alt_group_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>sym_group n\<lparr>carrier := {p. p permutes {1..n} \<and> evenperm p}\<rparr>\<^esub> = id
[PROOF STEP]
using sym_group_one
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>sym_group ?n\<^esub> = id

goal (1 subgoal):
 1. \<one>\<^bsub>sym_group n\<lparr>carrier := {p. p permutes {1..n} \<and> evenperm p}\<rparr>\<^esub> = id
[PROOF STEP]
by simp


[STATEMENT]
lemma residue_one_dvd: "a mod n = 1 \<Longrightarrow> n dvd a - 1" for a n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod n = 1 \<Longrightarrow> n dvd a - 1
[PROOF STEP]
by (fastforce intro!: cong_to_1_nat simp: cong_def)


[STATEMENT]
lemma cSup_le: "(S::'a::conditionally_complete_lattice set) \<noteq> {} \<Longrightarrow> S *<= b \<Longrightarrow> Sup S \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; S *<= b\<rbrakk> \<Longrightarrow> Sup S \<le> b
[PROOF STEP]
by (metis cSup_least setle_def)


[STATEMENT]
lemma shortest_path_least:
  "path s p u \<Longrightarrow> \<delta> s u \<le> sum_list p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path s p u \<Longrightarrow> \<delta> s u \<le> sum_list p
[PROOF STEP]
unfolding \<delta>_def paths_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path s p u \<Longrightarrow> (LEAST w. w \<in> sum_list ` {p. path s p u}) \<le> sum_list p
[PROOF STEP]
by (simp add: Least_le)


[STATEMENT]
lemma homeomorphic_space_iff_homeomorphic [simp]:
   "(top_of_set S) homeomorphic_space (top_of_set T) \<longleftrightarrow> S homeomorphic T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (top_of_set S homeomorphic_space top_of_set T) = S homeomorphic T
[PROOF STEP]
by (simp add: homeomorphic_def homeomorphic_space_def)


[STATEMENT]
lemma pathVertices_edgeset: "\<lbrakk>u\<in>V; isPath u p v\<rbrakk> \<Longrightarrow> set (pathVertices u p) \<subseteq> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> V; isPath u p v\<rbrakk> \<Longrightarrow> set (pathVertices u p) \<subseteq> V
[PROOF STEP]
apply (cases p rule: rev_cases; simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys y. \<lbrakk>u \<in> V; isPath u (ys @ [y]) v; p = ys @ [y]\<rbrakk> \<Longrightarrow> set (pathVertices u (ys @ [y])) \<subseteq> V
[PROOF STEP]
using isPath_edgeset[of u p v]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>isPath u p v; ?e \<in> set p\<rbrakk> \<Longrightarrow> ?e \<in> E

goal (1 subgoal):
 1. \<And>ys y. \<lbrakk>u \<in> V; isPath u (ys @ [y]) v; p = ys @ [y]\<rbrakk> \<Longrightarrow> set (pathVertices u (ys @ [y])) \<subseteq> V
[PROOF STEP]
apply (fastforce simp: pathVertices_alt V_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bounded_antilinear_o_bounded_antilinear:
  assumes "bounded_antilinear f"
    and "bounded_antilinear g"
  shows "bounded_clinear (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_clinear (\<lambda>x. f (g x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>b1 b2. f (g (b1 + b2)) = f (g b1) + f (g b2)
 2. \<And>r b. f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
interpret f: bounded_antilinear f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_antilinear f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>b1 b2. f (g (b1 + b2)) = f (g b1) + f (g b2)
 2. \<And>r b. f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
interpret g: bounded_antilinear g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_antilinear g
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>b1 b2. f (g (b1 + b2)) = f (g b1) + f (g b2)
 2. \<And>r b. f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
fix b1 b2 b r
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>b1 b2. f (g (b1 + b2)) = f (g b1) + f (g b2)
 2. \<And>r b. f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)
 3. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
show "f (g (b1 + b2)) = f (g b1) + f (g b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g (b1 + b2)) = f (g b1) + f (g b2)
[PROOF STEP]
by (simp add: f.add g.add)
[PROOF STATE]
proof (state)
this:
f (g (b1 + b2)) = f (g b1) + f (g b2)

goal (2 subgoals):
 1. \<And>r b. f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)
 2. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
show "f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)
[PROOF STEP]
by (simp add: f.scaleC g.scaleC)
[PROOF STATE]
proof (state)
this:
f (g (r *\<^sub>C b)) = r *\<^sub>C f (g b)

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
have "bounded_linear (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f (g x))
[PROOF STEP]
using f.bounded_linear g.bounded_linear
[PROOF STATE]
proof (prove)
using this:
bounded_linear f
bounded_linear g

goal (1 subgoal):
 1. bounded_linear (\<lambda>x. f (g x))
[PROOF STEP]
by (rule bounded_linear_compose)
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>x. f (g x))

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear (\<lambda>x. f (g x))
[PROOF STEP]
show "\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K"
[PROOF STATE]
proof (prove)
using this:
bounded_linear (\<lambda>x. f (g x))

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K
[PROOF STEP]
by (rule bounded_linear.bounded)
[PROOF STATE]
proof (state)
this:
\<exists>K. \<forall>x. norm (f (g x)) \<le> norm x * K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma omega_complete_INTER:
"omega_complete (\<lambda>x y. y \<subseteq> x) (\<lambda>f. \<Inter> (range f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. omega_complete (\<lambda>x y. y \<subseteq> x) (\<lambda>f. \<Inter> (range f))
[PROOF STEP]
apply (rule omega_complete.intro)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. porder (\<lambda>x y. y \<subseteq> x)
 2. omega_complete_axioms (\<lambda>x y. y \<subseteq> x) (\<lambda>f. \<Inter> (range f))
[PROOF STEP]
apply (rule porder.flip)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. porder (\<subseteq>)
 2. omega_complete_axioms (\<lambda>x y. y \<subseteq> x) (\<lambda>f. \<Inter> (range f))
[PROOF STEP]
apply (rule porder_order)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. omega_complete_axioms (\<lambda>x y. y \<subseteq> x) (\<lambda>f. \<Inter> (range f))
[PROOF STEP]
apply (rule omega_complete_axioms.intro)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f n. \<Inter> (range f) \<subseteq> f n
 2. \<And>f x. \<forall>n. x \<subseteq> f n \<Longrightarrow> x \<subseteq> \<Inter> (range f)
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x. \<forall>n. x \<subseteq> f n \<Longrightarrow> x \<subseteq> \<Inter> (range f)
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma connected_ivt_component_cart:
  fixes x :: "real^'n"
  shows "connected s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x$k \<le> a \<Longrightarrow> a \<le> y$k \<Longrightarrow> (\<exists>z\<in>s.  z$k = a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected s; x \<in> s; y \<in> s; x $ k \<le> a; a \<le> y $ k\<rbrakk> \<Longrightarrow> \<exists>z\<in>s. z $ k = a
[PROOF STEP]
using connected_ivt_hyperplane[of s x y "axis k 1" a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>connected s; x \<in> s; y \<in> s; axis k 1 \<bullet> x \<le> a; a \<le> axis k 1 \<bullet> y\<rbrakk> \<Longrightarrow> \<exists>z\<in>s. axis k 1 \<bullet> z = a

goal (1 subgoal):
 1. \<lbrakk>connected s; x \<in> s; y \<in> s; x $ k \<le> a; a \<le> y $ k\<rbrakk> \<Longrightarrow> \<exists>z\<in>s. z $ k = a
[PROOF STEP]
by (auto simp add: inner_axis inner_commute)


[STATEMENT]
lemma dm_subset: assumes i:"irrefl r" and t: "trans r"  shows "dm r M \<subseteq> dm r (M -s dm r M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<down>m M \<subseteq> r \<down>m (M -s r \<down>m M)
[PROOF STEP]
using assms dm_max_elt
[PROOF STATE]
proof (prove)
using this:
irrefl r
trans r
\<lbrakk>irrefl ?r; trans ?r; ?x \<in> ?r \<down>m ?M\<rbrakk> \<Longrightarrow> \<exists>y\<in>#?M -s ?r \<down>m ?M. (?x, y) \<in> ?r

goal (1 subgoal):
 1. r \<down>m M \<subseteq> r \<down>m (M -s r \<down>m M)
[PROOF STEP]
unfolding dm_def ds_def
[PROOF STATE]
proof (prove)
using this:
irrefl r
trans r
\<lbrakk>irrefl ?r; trans ?r; ?x \<in> {y. \<exists>x\<in>#?M. (y, x) \<in> ?r}\<rbrakk> \<Longrightarrow> \<exists>y\<in>#?M -s {y. \<exists>x\<in>#?M. (y, x) \<in> ?r}. (?x, y) \<in> ?r

goal (1 subgoal):
 1. {y. \<exists>x\<in>#M. (y, x) \<in> r} \<subseteq> {y. \<exists>x\<in>#M -s {y. \<exists>x\<in>#M. (y, x) \<in> r}. (y, x) \<in> r}
[PROOF STEP]
by fast


[STATEMENT]
lemma prod_list_pos: "(\<And>x::_::linordered_semidom. x \<in> set xs \<Longrightarrow> x > 0) \<Longrightarrow> prod_list xs > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> (0::'a) < x) \<Longrightarrow> (0::'a) < prod_list xs
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma real_of_preal_less_iff [simp]:
  "(real_of_preal m1 < real_of_preal m2) = (m1 < m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_preal m1 < real_of_preal m2) = (m1 < m2)
[PROOF STEP]
by (metis not_less preal_add_less_cancel_right real_le real_of_preal_def)


[STATEMENT]
lemma add_assocD_var2: " D x y \<and> D (x \<cdot> y) z \<Longrightarrow> D y z \<and> D x (y \<cdot> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D x y \<and> D (x \<oplus> y) z \<Longrightarrow> D y z \<and> D x (y \<oplus> z)
[PROOF STEP]
by (simp add: add_assocD)


[STATEMENT]
lemma pfixLe_trans: "[| x pfixLe y; y pfixLe z |] ==> x pfixLe z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x pfixLe y; y pfixLe z\<rbrakk> \<Longrightarrow> x pfixLe z
[PROOF STEP]
by (blast intro: genPrefix_trans)


[STATEMENT]
lemma z_append:
  assumes "\<And>i. i \<in> set xs \<Longrightarrow> i < length as"
  shows "z (xs @ (map ((+) (length as)) ys)) (as @ bs) = z xs as * z ys bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z (xs @ map ((+) (length as)) ys) (as @ bs) = z xs as * z ys bs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z (xs @ map ((+) (length as)) ys) (as @ bs) = z xs as * z ys bs
[PROOF STEP]
have 1: "map ((!) (as @ bs)) xs = map ((!) as) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((!) (as @ bs)) xs = map ((!) as) xs
[PROOF STEP]
unfolding list_eq_iff_nth_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map ((!) (as @ bs)) xs) = length (map ((!) as) xs) \<and> (\<forall>i<length (map ((!) (as @ bs)) xs). map ((!) (as @ bs)) xs ! i = map ((!) as) xs ! i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> set xs \<Longrightarrow> ?i < length as

goal (1 subgoal):
 1. length (map ((!) (as @ bs)) xs) = length (map ((!) as) xs) \<and> (\<forall>i<length (map ((!) (as @ bs)) xs). map ((!) (as @ bs)) xs ! i = map ((!) as) xs ! i)
[PROOF STEP]
by (auto simp add:nth_append)
[PROOF STATE]
proof (state)
this:
map ((!) (as @ bs)) xs = map ((!) as) xs

goal (1 subgoal):
 1. z (xs @ map ((+) (length as)) ys) (as @ bs) = z xs as * z ys bs
[PROOF STEP]
have 2: "map ((!) (as @ bs) \<circ> (+) (length as)) ys = map ((!) bs) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((!) (as @ bs) \<circ> (+) (length as)) ys = map ((!) bs) ys
[PROOF STEP]
unfolding list_eq_iff_nth_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map ((!) (as @ bs) \<circ> (+) (length as)) ys) = length (map ((!) bs) ys) \<and> (\<forall>i<length (map ((!) (as @ bs) \<circ> (+) (length as)) ys). map ((!) (as @ bs) \<circ> (+) (length as)) ys ! i = map ((!) bs) ys ! i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in> set xs \<Longrightarrow> ?i < length as

goal (1 subgoal):
 1. length (map ((!) (as @ bs) \<circ> (+) (length as)) ys) = length (map ((!) bs) ys) \<and> (\<forall>i<length (map ((!) (as @ bs) \<circ> (+) (length as)) ys). map ((!) (as @ bs) \<circ> (+) (length as)) ys ! i = map ((!) bs) ys ! i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map ((!) (as @ bs) \<circ> (+) (length as)) ys = map ((!) bs) ys

goal (1 subgoal):
 1. z (xs @ map ((+) (length as)) ys) (as @ bs) = z xs as * z ys bs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z (xs @ map ((+) (length as)) ys) (as @ bs) = z xs as * z ys bs
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map ((!) (as @ bs)) (xs @ map ((+) (length as)) ys)) = prod_list (map ((!) as) xs) * prod_list (map ((!) bs) ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map ((!) (as @ bs)) xs) * prod_list (map ((!) (as @ bs) \<circ> (+) (length as)) ys) = prod_list (map ((!) as) xs) * prod_list (map ((!) bs) ys)
[PROOF STEP]
unfolding 1 2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map ((!) as) xs) * prod_list (map ((!) bs) ys) = prod_list (map ((!) as) xs) * prod_list (map ((!) bs) ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z (xs @ map ((+) (length as)) ys) (as @ bs) = z xs as * z ys bs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_space_BoolVal_prod[simp]: "BOOL \<Otimes>\<^sub>M BOOL = count_space (range BoolVal \<times> range BoolVal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stock_measure BOOL \<Otimes>\<^sub>M stock_measure BOOL = count_space (range BoolVal \<times> range BoolVal)
[PROOF STEP]
by (auto intro!: pair_measure_countable)


[STATEMENT]
lemma list_update_append:
  "(xs @ ys) [n:= x] =
  (if n < length xs then xs[n:= x] @ ys else xs @ (ys [n-length xs:= x]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ ys)[n := x] = (if n < length xs then xs[n := x] @ ys else xs @ ys[n - length xs := x])
[PROOF STEP]
by (induct xs arbitrary: n) (auto split:nat.splits)


[STATEMENT]
lemma continuous_at_setdist [continuous_intros]: "continuous (at x) (\<lambda>y. (setdist {y} S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>y. setdist {y} S) x
[PROOF STEP]
by (force simp: continuous_at_eps_delta dist_real_def intro: le_less_trans [OF setdist_Lipschitz])


[STATEMENT]
lemma quotient_of_inject:
  assumes "quotient_of a = quotient_of b"
  shows "a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
obtain p q r s where a: "a = Fract p q" and b: "b = Fract r s" and "q > 0" and "s > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q r s. \<lbrakk>a = Fract p q; b = Fract r s; 0 < q; 0 < s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases a, cases b)
[PROOF STATE]
proof (state)
this:
a = Fract p q
b = Fract r s
0 < q
0 < s

goal (1 subgoal):
 1. a = b
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
quotient_of a = quotient_of b
a = Fract p q
b = Fract r s
0 < q
0 < s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
quotient_of a = quotient_of b
a = Fract p q
b = Fract r s
0 < q
0 < s

goal (1 subgoal):
 1. a = b
[PROOF STEP]
by (simp add: eq_rat quotient_of_Fract normalize_crossproduct)
[PROOF STATE]
proof (state)
this:
a = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma e_def: "e = (\<Sum>t = 0..q. b^t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e = sum ((^) b) {0..q}
[PROOF STEP]
using c_eq
[PROOF STATE]
proof (prove)
using this:
rm_constants q c b d e f a

goal (1 subgoal):
 1. e = sum ((^) b) {0..q}
[PROOF STEP]
by (simp add: rm_constants_def E_def)


[STATEMENT]
lemma In0_mono: "M<=N ==> In0(M) <= In0(N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> N \<Longrightarrow> In0 M \<subseteq> In0 N
[PROOF STEP]
by (simp add: In0_def Scons_mono)


[STATEMENT]
lemma "fst x = (case x of (a,b) \<Rightarrow> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst x = (case x of (a, b) \<Rightarrow> a)
[PROOF STEP]
by (fact fst_conv_simps)


[STATEMENT]
lemma "rec_nat zero suc 0 = zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_nat zero suc 0 = zero
[PROOF STEP]
nitpick [expect = none]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_nat zero suc 0 = zero
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cdim_UNIV_ell2[simp]: \<open>cdim (UNIV::'a::finite ell2 set) = CARD('a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cdim UNIV = CARD('a)
[PROOF STEP]
apply (subst cspan_range_ket_finite[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cdim (cspan (range ket)) = CARD('a)
[PROOF STEP]
by (metis card_image cindependent_ket complex_vector.dim_span_eq_card_independent inj_ket)


[STATEMENT]
lemma index_mult_mat_vec[simp]: "i < dim_row A \<Longrightarrow> (A *\<^sub>v v) $ i = row A i \<bullet> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_row A \<Longrightarrow> (A *\<^sub>v v) $ i = row A i \<bullet> v
[PROOF STEP]
by (auto simp: mult_mat_vec_def)


[STATEMENT]
lemma fps_nth_Lambert_W_0 [simp]: "fps_nth fps_Lambert_W 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_Lambert_W $ 0 = 0
[PROOF STEP]
by (simp add: fps_Lambert_W_def fps_inv_def)


[STATEMENT]
lemma remove_max_max_lemma:
  shows "fst (foldl f (m, t) l) =  Max (set (m # l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (foldl f (m, t) l) = Max (SelectionSort_Functional.set (m # l))
[PROOF STEP]
proof (induct l arbitrary: m t rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m t. fst (foldl f (m, t) []) = Max (SelectionSort_Functional.set [m])
 2. \<And>x xs m t. (\<And>m t. fst (foldl f (m, t) xs) = Max (SelectionSort_Functional.set (m # xs))) \<Longrightarrow> fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
fst (foldl f (?m, ?t) xs) = Max (SelectionSort_Functional.set (?m # xs))

goal (2 subgoals):
 1. \<And>m t. fst (foldl f (m, t) []) = Max (SelectionSort_Functional.set [m])
 2. \<And>x xs m t. (\<And>m t. fst (foldl f (m, t) xs) = Max (SelectionSort_Functional.set (m # xs))) \<Longrightarrow> fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
let ?a = "foldl f (m, t) xs"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m t. fst (foldl f (m, t) []) = Max (SelectionSort_Functional.set [m])
 2. \<And>x xs m t. (\<And>m t. fst (foldl f (m, t) xs) = Max (SelectionSort_Functional.set (m # xs))) \<Longrightarrow> fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
let ?m' = "fst ?a" and ?t' = "snd ?a"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m t. fst (foldl f (m, t) []) = Max (SelectionSort_Functional.set [m])
 2. \<And>x xs m t. (\<And>m t. fst (foldl f (m, t) xs) = Max (SelectionSort_Functional.set (m # xs))) \<Longrightarrow> fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
have "fst (foldl f (m, t) (xs @ [x])) = max ?m' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (foldl f (m, t) (xs @ [x])) = max (fst (foldl f (m, t) xs)) x
[PROOF STEP]
by (cases ?a) (auto simp add: max_def)
[PROOF STATE]
proof (state)
this:
fst (foldl f (m, t) (xs @ [x])) = max (fst (foldl f (m, t) xs)) x

goal (2 subgoals):
 1. \<And>m t. fst (foldl f (m, t) []) = Max (SelectionSort_Functional.set [m])
 2. \<And>x xs m t. (\<And>m t. fst (foldl f (m, t) xs) = Max (SelectionSort_Functional.set (m # xs))) \<Longrightarrow> fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
fst (foldl f (m, t) (xs @ [x])) = max (fst (foldl f (m, t) xs)) x

goal (1 subgoal):
 1. fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
using snoc
[PROOF STATE]
proof (prove)
using this:
fst (foldl f (m, t) (xs @ [x])) = max (fst (foldl f (m, t) xs)) x
fst (foldl f (?m, ?t) xs) = Max (SelectionSort_Functional.set (?m # xs))

goal (1 subgoal):
 1. fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))
[PROOF STEP]
by (simp add: max_Max_commute)
[PROOF STATE]
proof (state)
this:
fst (foldl f (m, t) (xs @ [x])) = Max (SelectionSort_Functional.set (m # xs @ [x]))

goal (1 subgoal):
 1. \<And>m t. fst (foldl f (m, t) []) = Max (SelectionSort_Functional.set [m])
[PROOF STEP]
qed simp


[STATEMENT]
lemma orthogonal_complement_orthoI':
  \<open>x \<in> M \<Longrightarrow> y \<in> orthogonal_complement M \<Longrightarrow> x \<bullet>\<^sub>C y = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> M; y \<in> orthogonal_complement M\<rbrakk> \<Longrightarrow> x \<bullet>\<^sub>C y = 0
[PROOF STEP]
by (metis cinner_commute' complex_cnj_zero orthogonal_complement_orthoI)


[STATEMENT]
lemma add_point_blocks_blocks_alt: "add_point_to_blocks p bs =
    image_mset (insert p) (filter_mset (\<lambda> b . b \<in> bs) \<B>) + (filter_mset (\<lambda> b . b \<notin> bs) \<B>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_point_to_blocks p bs = image_mset (insert p) {#b \<in># \<B>. b \<in> bs#} + {#b \<in># \<B>. b \<notin> bs#}
[PROOF STEP]
using add_point_to_blocks_def
[PROOF STATE]
proof (prove)
using this:
add_point_to_blocks ?p ?bs \<equiv> image_mset (insert ?p) {#b \<in># \<B>. b \<in> ?bs#} + {#b \<in># \<B>. b \<notin> ?bs#}

goal (1 subgoal):
 1. add_point_to_blocks p bs = image_mset (insert p) {#b \<in># \<B>. b \<in> bs#} + {#b \<in># \<B>. b \<notin> bs#}
[PROOF STEP]
by simp


[STATEMENT]
lemma e'_0 [simp]: "e' 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e' 0 = 1
[PROOF STEP]
by (simp add: e'.simps)


[STATEMENT]
lemma one_divide_one_divide_ennreal[simp]: "1 / (1 / c) = (c::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (1 / c) = c
[PROOF STEP]
including ennreal.lifting
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (1 / c) = c
[PROOF STEP]
unfolding divide_ennreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * inverse (1 * inverse c) = c
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma card_S_fundchamber: "card S = card C0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>(f, g)\<in>fundfoldpairs. {Abs_induced_automorph f g}) = card C0
[PROOF STEP]
using bij_betw_same_card[OF fundantivertex_bij_betw]
[PROOF STATE]
proof (prove)
using this:
card (\<Union>(f, g)\<in>fundfoldpairs. {Abs_induced_automorph f g}) = card C0

goal (1 subgoal):
 1. card (\<Union>(f, g)\<in>fundfoldpairs. {Abs_induced_automorph f g}) = card C0
[PROOF STEP]
by fast


[STATEMENT]
theorem sb_compose1:
"((z @zs[y1 / x]_xs) @zs[y2 / x]_xs) = (z @zs[(y1 @xs[y2 / x]_xs) / x]_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z @zs[y1 / x]_xs @zs[y2 / x]_xs = z @zs[y1 @xs[y2 / x]_xs / x]_xs
[PROOF STEP]
by(unfold sb_def, auto)


[STATEMENT]
lemma seq_compact_eq_countably_compact:
  fixes U :: "'a :: first_countable_topology set"
  shows "seq_compact U \<longleftrightarrow> countably_compact U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seq_compact U = countably_compact U
[PROOF STEP]
using
    countable_acc_point_imp_seq_compact
    countably_compact_imp_acc_point
    seq_compact_imp_countably_compact
[PROOF STATE]
proof (prove)
using this:
\<forall>t. infinite t \<and> countable t \<and> t \<subseteq> ?s \<longrightarrow> (\<exists>x\<in>?s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> t)) \<Longrightarrow> seq_compact ?s
\<lbrakk>countably_compact ?s; countable ?t; infinite ?t; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> \<exists>x\<in>?s. \<forall>U. x \<in> U \<and> open U \<longrightarrow> infinite (U \<inter> ?t)
seq_compact ?U \<Longrightarrow> countably_compact ?U

goal (1 subgoal):
 1. seq_compact U = countably_compact U
[PROOF STEP]
by metis


[STATEMENT]
lemma det_Gauss_Jordan_in_ij_1:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}" and i j::"'n"
defines A': "A'== mult_row (interchange_rows A i (LEAST n. A $ n $ j \<noteq> 0 \<and> i \<le> n)) i (1 / (interchange_rows A i (LEAST n. A $ n $ j \<noteq> 0 \<and> i \<le> n)) $ i $ j)"
assumes i: "(LEAST n. A $ n $ j \<noteq> 0 \<and> i \<le> n) = i"
shows "det (Gauss_Jordan_in_ij A i j) = 1/(A$i$j) * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
have "det (Gauss_Jordan_in_ij A i j) = det A' "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = det A'
[PROOF STEP]
using det_Gauss_Jordan_in_ij
[PROOF STATE]
proof (prove)
using this:
det (Gauss_Jordan_in_ij ?A ?i ?j) = det (mult_row (interchange_rows ?A ?i (LEAST n. ?A $ n $ ?j \<noteq> (0::?'a) \<and> ?i \<le> n)) ?i ((1::?'a) / interchange_rows ?A ?i (LEAST n. ?A $ n $ ?j \<noteq> (0::?'a) \<and> ?i \<le> n) $ ?i $ ?j))

goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = det A'
[PROOF STEP]
unfolding A'
[PROOF STATE]
proof (prove)
using this:
det (Gauss_Jordan_in_ij ?A ?i ?j) = det (mult_row (interchange_rows ?A ?i (LEAST n. ?A $ n $ ?j \<noteq> (0::?'a) \<and> ?i \<le> n)) ?i ((1::?'a) / interchange_rows ?A ?i (LEAST n. ?A $ n $ ?j \<noteq> (0::?'a) \<and> ?i \<le> n) $ ?i $ ?j))

goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = det (mult_row (interchange_rows A i (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n)) i ((1::'a) / interchange_rows A i (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) $ i $ j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det (Gauss_Jordan_in_ij A i j) = det A'

goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (Gauss_Jordan_in_ij A i j) = det A'

goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
have "... = 1/(A$i$j) * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A' = (1::'a) / A $ i $ j * det A
[PROOF STEP]
unfolding A' det_mult_row
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) / interchange_rows A i (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n) $ i $ j * det (interchange_rows A i (LEAST n. A $ n $ j \<noteq> (0::'a) \<and> i \<le> n)) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
unfolding i det_interchange_rows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) / interchange_rows A i i $ i $ j * (of_int (if i = i then 1 else - 1) * det A) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det A' = (1::'a) / A $ i $ j * det A

goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A

goal (1 subgoal):
 1. det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (Gauss_Jordan_in_ij A i j) = (1::'a) / A $ i $ j * det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in aGroup) ag_pOp_assoc:"\<lbrakk>x \<in> carrier A; y \<in> carrier A; z \<in> carrier A\<rbrakk>
                \<Longrightarrow> (x \<plusminus> y) \<plusminus> z = x \<plusminus> (y \<plusminus> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier A; y \<in> carrier A; z \<in> carrier A\<rbrakk> \<Longrightarrow> x \<plusminus> y \<plusminus> z = x \<plusminus> (y \<plusminus> z)
[PROOF STEP]
by (simp add:aassoc)


[STATEMENT]
lemma SA_poly_to_Qp_poly_minus:
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> carrier (UP (SA n))"
  assumes "g \<in> carrier (UP (SA n))"
   shows "SA_poly_to_Qp_poly n a (f \<ominus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<ominus>\<^bsub>Q\<^sub>p_x\<^esub> SA_poly_to_Qp_poly n a g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (f \<ominus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
[PROOF STEP]
using SA_poly_to_Qp_poly_is_hom[of a] assms SA_is_ring[of n]
        ring.ring_hom_minus[of "UP (SA n)" Q\<^sub>p_x "SA_poly_to_Qp_poly n a" f g] UP_SA_n_is_ring
        UPQ.UP_ring
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> SA_poly_to_Qp_poly ?n a \<in> ring_hom (UP (SA ?n)) (UP Q\<^sub>p)
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (UP (SA n))
g \<in> carrier (UP (SA n))
ring (SA n)
\<lbrakk>ring (UP (SA n)); ring (UP Q\<^sub>p); SA_poly_to_Qp_poly n a \<in> ring_hom (UP (SA n)) (UP Q\<^sub>p); f \<in> carrier (UP (SA n)); g \<in> carrier (UP (SA n))\<rbrakk> \<Longrightarrow> SA_poly_to_Qp_poly n a (f \<ominus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
ring (UP (SA ?n))
ring (UP Q\<^sub>p)

goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (f \<ominus>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<ominus>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
[PROOF STEP]
by blast


[STATEMENT]
lemma vrat_distributive_law:
  assumes "x \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>" and "z \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>"
  shows "x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = (x *\<^sub>\<rat> y) +\<^sub>\<rat> (x *\<^sub>\<rat> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)
[PROOF STEP]
have "x' * (y' + z') = (x' * y') + (x' * z')" for x' y' z' :: rat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * (y' + z') = x' * y' + x' * z'
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
?x' * (?y' + ?z') = ?x' * ?y' + ?x' * ?z'

goal (1 subgoal):
 1. x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)

goal (1 subgoal):
 1. x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x *\<^sub>\<rat> (y +\<^sub>\<rat> z) = x *\<^sub>\<rat> y +\<^sub>\<rat> (x *\<^sub>\<rat> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_enum_nxt: "infinite N \<Longrightarrow> inj_on (enum (nxt N a)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite N \<Longrightarrow> inj_on (enum (nxt N a)) A
[PROOF STEP]
by (simp add: infinite_nxtN strict_mono_enum strict_mono_imp_inj_on)


[STATEMENT]
lemma cbox_Pair_eq_0: "cbox (a, c) (b, d) = {} \<longleftrightarrow> cbox a b = {} \<or> cbox c d = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cbox (a, c) (b, d) = {}) = (cbox a b = {} \<or> cbox c d = {})
[PROOF STEP]
by (force simp: cbox_Pair_eq)


[STATEMENT]
lemma (in idom_char_0) order_unique:
  "poly p \<noteq> poly [] \<Longrightarrow> ([-a, 1] %^ n) divides p \<Longrightarrow> \<not> ([-a, 1] %^ (Suc n)) divides p \<Longrightarrow>
    n = order a p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>poly p \<noteq> poly []; [- a, 1::'a] %^ n divides p; \<not> [- a, 1::'a] %^ Suc n divides p\<rbrakk> \<Longrightarrow> n = order a p
[PROOF STEP]
using order [of a n p]
[PROOF STATE]
proof (prove)
using this:
([- a, 1::'a] %^ n divides p \<and> \<not> [- a, 1::'a] %^ Suc n divides p) = (n = order a p \<and> poly p \<noteq> poly [])

goal (1 subgoal):
 1. \<lbrakk>poly p \<noteq> poly []; [- a, 1::'a] %^ n divides p; \<not> [- a, 1::'a] %^ Suc n divides p\<rbrakk> \<Longrightarrow> n = order a p
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Ring) sum_ideals_commute:"\<lbrakk>ideal R A; ideal R B\<rbrakk> \<Longrightarrow>
                       A \<minusplus> B = B \<minusplus> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; ideal R B\<rbrakk> \<Longrightarrow> A \<minusplus> B = B \<minusplus> A
[PROOF STEP]
apply (frule ideal_sumTr1 [of "B"], assumption+,
       frule ideal_sumTr1 [of "A" "B"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; ideal R B; B \<minusplus> A = \<Inter> {J. ideal R J \<and> B \<union> A \<subseteq> J}; A \<minusplus> B = \<Inter> {J. ideal R J \<and> A \<union> B \<subseteq> J}\<rbrakk> \<Longrightarrow> A \<minusplus> B = B \<minusplus> A
[PROOF STEP]
apply (simp add:Un_commute[of "B" "A"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma double_dual_iso_mult [simp]:
  assumes "x \<in> carrier G" "y \<in> carrier G"
  shows   "double_dual_iso (x \<otimes> y) =
             double_dual_iso x \<otimes>\<^bsub>Characters (Characters G)\<^esub> double_dual_iso y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. double_dual_iso (x \<otimes> y) = double_dual_iso x \<otimes>\<^bsub>Characters (Characters G)\<^esub> double_dual_iso y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. double_dual_iso (x \<otimes> y) = double_dual_iso x \<otimes>\<^bsub>Characters (Characters G)\<^esub> double_dual_iso y
[PROOF STEP]
by (auto simp: double_dual_iso_def Characters_def fun_eq_iff character.char_mult)


[STATEMENT]
lemma bij_betw_partitions_of:
  assumes "finite A" "finite B"
  shows "bij_betw (partitions_of A B) ((A \<rightarrow>\<^sub>E B) // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (partitions_of A B) ((A \<rightarrow>\<^sub>E B) // range_permutation A B) {P. partition_on A P \<and> card P \<le> card B}
[PROOF STEP]
proof (rule bij_betw_byWitness[where f'="\<lambda>P. functions_of P A B"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>a\<in>(A \<rightarrow>\<^sub>E B) // range_permutation A B. functions_of (partitions_of A B a) A B = a
 2. \<forall>a'\<in>{P. partition_on A P \<and> card P \<le> card B}. partitions_of A B (functions_of a' A B) = a'
 3. partitions_of A B ` (A \<rightarrow>\<^sub>E B) // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B}
 4. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
show "\<forall>F\<in>(A \<rightarrow>\<^sub>E B) // range_permutation A B. functions_of (partitions_of A B F) A B = F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>F\<in>(A \<rightarrow>\<^sub>E B) // range_permutation A B. functions_of (partitions_of A B F) A B = F
[PROOF STEP]
using \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite B

goal (1 subgoal):
 1. \<forall>F\<in>(A \<rightarrow>\<^sub>E B) // range_permutation A B. functions_of (partitions_of A B F) A B = F
[PROOF STEP]
by (simp add: functions_of_partitions_of)
[PROOF STATE]
proof (state)
this:
\<forall>F\<in>(A \<rightarrow>\<^sub>E B) // range_permutation A B. functions_of (partitions_of A B F) A B = F

goal (3 subgoals):
 1. \<forall>a'\<in>{P. partition_on A P \<and> card P \<le> card B}. partitions_of A B (functions_of a' A B) = a'
 2. partitions_of A B ` (A \<rightarrow>\<^sub>E B) // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B}
 3. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
show "\<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B}. partitions_of A B (functions_of P A B) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B}. partitions_of A B (functions_of P A B) = P
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B

goal (1 subgoal):
 1. \<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B}. partitions_of A B (functions_of P A B) = P
[PROOF STEP]
by (auto simp add: partitions_of_functions_of)
[PROOF STATE]
proof (state)
this:
\<forall>P\<in>{P. partition_on A P \<and> card P \<le> card B}. partitions_of A B (functions_of P A B) = P

goal (2 subgoals):
 1. partitions_of A B ` (A \<rightarrow>\<^sub>E B) // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B}
 2. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
show "partitions_of A B ` ((A \<rightarrow>\<^sub>E B) // range_permutation A B) \<subseteq> {P. partition_on A P \<and> card P \<le> card B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partitions_of A B ` (A \<rightarrow>\<^sub>E B) // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B}
[PROOF STEP]
using \<open>finite B\<close> partitions_of
[PROOF STATE]
proof (prove)
using this:
finite B
\<lbrakk>finite ?B; ?F \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B\<rbrakk> \<Longrightarrow> card (partitions_of ?A ?B ?F) \<le> card ?B
\<lbrakk>finite ?B; ?F \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B\<rbrakk> \<Longrightarrow> partition_on ?A (partitions_of ?A ?B ?F)

goal (1 subgoal):
 1. partitions_of A B ` (A \<rightarrow>\<^sub>E B) // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
partitions_of A B ` (A \<rightarrow>\<^sub>E B) // range_permutation A B \<subseteq> {P. partition_on A P \<and> card P \<le> card B}

goal (1 subgoal):
 1. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
show "(\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
using functions_of \<open>finite A\<close> \<open>finite B\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; finite ?B; partition_on ?A ?P; card ?P \<le> card ?B\<rbrakk> \<Longrightarrow> functions_of ?P ?A ?B \<in> (?A \<rightarrow>\<^sub>E ?B) // range_permutation ?A ?B
finite A
finite B

goal (1 subgoal):
 1. (\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>P. functions_of P A B) ` {P. partition_on A P \<and> card P \<le> card B} \<subseteq> (A \<rightarrow>\<^sub>E B) // range_permutation A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma solve_depressed_cubic_Cardano_real:
  assumes "solve_depressed_cubic_Cardano_real e f = Some y"
  shows "{y. y^3 + e * y + f = 0} = {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
proof (cases "e = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
e = 0

goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
have "{y. y^3 + e * y + f = 0} = {y. y^3 = -f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y ^ 3 + e * y + f = 0} = {y. y ^ 3 = - f}
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y ^ 3 + 0 * y + f = 0} = {y. y ^ 3 = - f}
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
{y. y ^ 3 + e * y + f = 0} = {y. y ^ 3 = - f}

goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{y. y ^ 3 + e * y + f = 0} = {y. y ^ 3 = - f}

goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
have "\<dots> = {root 3 (-f)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y ^ 3 = - f} = {root 3 (- f)}
[PROOF STEP]
using odd_real_root_unique[of 3 _ "-f"] odd_real_root_pow[of 3]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>odd 3; ?y ^ 3 = - f\<rbrakk> \<Longrightarrow> root 3 (- f) = ?y
odd 3 \<Longrightarrow> root 3 ?x ^ 3 = ?x

goal (1 subgoal):
 1. {y. y ^ 3 = - f} = {root 3 (- f)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{y. y ^ 3 = - f} = {root 3 (- f)}

goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{y. y ^ 3 = - f} = {root 3 (- f)}

goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
have "root 3 (-f) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root 3 (- f) = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
solve_depressed_cubic_Cardano_real e f = Some y

goal (1 subgoal):
 1. root 3 (- f) = y
[PROOF STEP]
unfolding True solve_depressed_cubic_Cardano_real_def
[PROOF STATE]
proof (prove)
using this:
(if 0 = 0 then Some (root 3 (- f)) else let v = - (0 ^ 3 / 27) in case rroots2 [:v, f, 1:] of [] \<Rightarrow> None | [u] \<Rightarrow> None | [u, xa] \<Rightarrow> let rt = root 3 u in Some (rt - 0 / (3 * rt)) | u # xa # ab # x \<Rightarrow> Map.empty x) = Some y

goal (1 subgoal):
 1. root 3 (- f) = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
root 3 (- f) = y

goal (2 subgoals):
 1. e = 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
 2. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{y. y ^ 3 + e * y + f = 0} = {y}

goal (1 subgoal):
 1. {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{y. y ^ 3 + e * y + f = 0} = {y}

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
e \<noteq> 0

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
define v where "v = - (e ^ 3 / 27)"
[PROOF STATE]
proof (state)
this:
v = - (e ^ 3 / 27)

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
note * = assms[unfolded solve_depressed_cubic_Cardano_real_def Let_def, folded v_def]
[PROOF STATE]
proof (state)
this:
(if e = 0 then Some (root 3 (- f)) else case rroots2 [:v, f, 1:] of [] \<Rightarrow> None | [u] \<Rightarrow> None | [u, xa] \<Rightarrow> Some (root 3 u - e / (3 * root 3 u)) | u # xa # ab # x \<Rightarrow> Map.empty x) = Some y

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
let ?rr = "rroots2 [:v,f,1:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
from * False
[PROOF STATE]
proof (chain)
picking this:
(if e = 0 then Some (root 3 (- f)) else case rroots2 [:v, f, 1:] of [] \<Rightarrow> None | [u] \<Rightarrow> None | [u, xa] \<Rightarrow> Some (root 3 u - e / (3 * root 3 u)) | u # xa # ab # x \<Rightarrow> Map.empty x) = Some y
e \<noteq> 0
[PROOF STEP]
obtain u u' where rr: "?rr = [u,u']"
[PROOF STATE]
proof (prove)
using this:
(if e = 0 then Some (root 3 (- f)) else case rroots2 [:v, f, 1:] of [] \<Rightarrow> None | [u] \<Rightarrow> None | [u, xa] \<Rightarrow> Some (root 3 u - e / (3 * root 3 u)) | u # xa # ab # x \<Rightarrow> Map.empty x) = Some y
e \<noteq> 0

goal (1 subgoal):
 1. (\<And>u u'. rroots2 [:v, f, 1:] = [u, u'] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases ?rr; cases "tl ?rr"; cases "tl (tl ?rr)"; auto split: if_splits)
[PROOF STATE]
proof (state)
this:
rroots2 [:v, f, 1:] = [u, u']

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
from *[unfolded rr list.simps] False
[PROOF STATE]
proof (chain)
picking this:
(if e = 0 then Some (root 3 (- f)) else Some (root 3 u - e / (3 * root 3 u))) = Some y
e \<noteq> 0
[PROOF STEP]
have y: "y = root 3 u - e / (3 * root 3 u)"
[PROOF STATE]
proof (prove)
using this:
(if e = 0 then Some (root 3 (- f)) else Some (root 3 u - e / (3 * root 3 u))) = Some y
e \<noteq> 0

goal (1 subgoal):
 1. y = root 3 u - e / (3 * root 3 u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = root 3 u - e / (3 * root 3 u)

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
have "u \<in> set (rroots2 [:v,f,1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> set (rroots2 [:v, f, 1:])
[PROOF STEP]
unfolding rr
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> set [u, u']
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> set (rroots2 [:v, f, 1:])

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u \<in> set (rroots2 [:v, f, 1:])

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
have "set (rroots2 [:v,f,1:]) = {u. poly [:v,f,1:] u = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (rroots2 [:v, f, 1:]) = {u. poly [:v, f, 1:] u = 0}
[PROOF STEP]
by (subst rroots2, auto)
[PROOF STATE]
proof (state)
this:
set (rroots2 [:v, f, 1:]) = {u. poly [:v, f, 1:] u = 0}

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u \<in> {u. poly [:v, f, 1:] u = 0}
[PROOF STEP]
have u: "u^2 + f * u + v = 0"
[PROOF STATE]
proof (prove)
using this:
u \<in> {u. poly [:v, f, 1:] u = 0}

goal (1 subgoal):
 1. u\<^sup>2 + f * u + v = 0
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
u\<^sup>2 + f * u + v = 0

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
note Cardano = solve_cubic_depressed_Cardano_real[OF False v_def u]
[PROOF STATE]
proof (state)
this:
(root 3 u - e / (3 * root 3 u)) ^ 3 + e * (root 3 u - e / (3 * root 3 u)) + f = 0
\<lbrakk>discriminant_cubic_depressed e f \<noteq> 0; ?y ^ 3 + e * ?y + f = 0\<rbrakk> \<Longrightarrow> ?y = root 3 u - e / (3 * root 3 u)

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
have 2: "2 = Suc (Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 = Suc (Suc 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 = Suc (Suc 0)

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
from rr
[PROOF STATE]
proof (chain)
picking this:
rroots2 [:v, f, 1:] = [u, u']
[PROOF STEP]
have 0: "f\<^sup>2 - 4 * v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
rroots2 [:v, f, 1:] = [u, u']

goal (1 subgoal):
 1. f\<^sup>2 - 4 * v \<noteq> 0
[PROOF STEP]
unfolding rroots2_def Let_def
[PROOF STATE]
proof (prove)
using this:
(if (coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2))\<^sup>2 - coeff [:v, f, 1:] 0 / coeff [:v, f, 1:] 2 = 0 then [- (coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2))] else if (coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2))\<^sup>2 - coeff [:v, f, 1:] 0 / coeff [:v, f, 1:] 2 < 0 then [] else [- (coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2)) + sqrt ((coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2))\<^sup>2 - coeff [:v, f, 1:] 0 / coeff [:v, f, 1:] 2), - (coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2)) - sqrt ((coeff [:v, f, 1:] 1 / (2 * coeff [:v, f, 1:] 2))\<^sup>2 - coeff [:v, f, 1:] 0 / coeff [:v, f, 1:] 2)]) = [u, u']

goal (1 subgoal):
 1. f\<^sup>2 - 4 * v \<noteq> 0
[PROOF STEP]
by (auto split: if_splits simp: 2)
[PROOF STATE]
proof (state)
this:
f\<^sup>2 - 4 * v \<noteq> 0

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
hence 0: "discriminant_cubic_depressed e f \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f\<^sup>2 - 4 * v \<noteq> 0

goal (1 subgoal):
 1. discriminant_cubic_depressed e f \<noteq> 0
[PROOF STEP]
unfolding discriminant_cubic_depressed_def v_def
[PROOF STATE]
proof (prove)
using this:
f\<^sup>2 - 4 * - (e ^ 3 / 27) \<noteq> 0

goal (1 subgoal):
 1. - (4 * e ^ 3 + 27 * f\<^sup>2) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
discriminant_cubic_depressed e f \<noteq> 0

goal (1 subgoal):
 1. e \<noteq> 0 \<Longrightarrow> {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
using Cardano(1) Cardano(2)[OF 0]
[PROOF STATE]
proof (prove)
using this:
(root 3 u - e / (3 * root 3 u)) ^ 3 + e * (root 3 u - e / (3 * root 3 u)) + f = 0
?y ^ 3 + e * ?y + f = 0 \<Longrightarrow> ?y = root 3 u - e / (3 * root 3 u)

goal (1 subgoal):
 1. {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
unfolding y[symmetric]
[PROOF STATE]
proof (prove)
using this:
y ^ 3 + e * y + f = 0
?y ^ 3 + e * ?y + f = 0 \<Longrightarrow> ?y = y

goal (1 subgoal):
 1. {y. y ^ 3 + e * y + f = 0} = {y}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{y. y ^ 3 + e * y + f = 0} = {y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_substAbs_vsubstAbs_compose2:
assumes "wlsAbs (us,s) A" and "wls (asSort zs) Z"
and "ys \<noteq> zs \<or> y \<noteq> z" and fresh: "fresh ys y Z"
shows "((A $[y1 // y]_ys) $[Z / z]_zs) = ((A $[Z / z]_zs) $[((Var ys y1) #[Z / z]_zs) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[y1 // y]_ys $[Z / z]_zs = A $[Z / z]_zs $[Var ys y1 #[Z / z]_zs / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort zs) Z
ys \<noteq> zs \<or> y \<noteq> z
fresh ys y Z

goal (1 subgoal):
 1. A $[y1 // y]_ys $[Z / z]_zs = A $[Z / z]_zs $[Var ys y1 #[Z / z]_zs / y]_ys
[PROOF STEP]
by(simp add: substAbs_vsubstAbs_compose2)


[STATEMENT]
lemma (in category) ntcf_lcomp_Hom_NTMap_vrange:
  assumes "\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
interpret \<phi>: is_ntcf \<alpha> \<AA> \<CC> \<FF> \<GG> \<phi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule assms(1))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding ntcf_lcomp_Hom_def ntcf_lcomp_Hom_component_def \<phi>.ntcf_NTDGCod
[PROOF STATE]
proof (prove)
using this:
\<phi> : \<FF> \<mapsto>\<^sub>C\<^sub>F \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,ntcf_id (dghm_id \<CC>)-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>
[PROOF STEP]
by (intro ntcf_Hom_NTMap_vrange) (cs_concl cs_intro: cat_cs_intros)+
[PROOF STATE]
proof (state)
this:
\<R>\<^sub>\<circ> (Hom\<^sub>A\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>(\<phi>-,-)\<lparr>NTMap\<rparr>) \<subseteq>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Arr\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zcount_update_zmultiset: "zcount (update_zmultiset M t n) t' = zcount M t' + (if t = t' then n else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zcount (update_zmultiset M t n) t' = zcount M t' + (if t = t' then n else 0)
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma similarity_scale_2:
  shows "similarity I (k *\<^sub>s\<^sub>m M) = k *\<^sub>s\<^sub>m (similarity I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similarity I (k *\<^sub>s\<^sub>m M) = k *\<^sub>s\<^sub>m similarity I M
[PROOF STEP]
unfolding similarity_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_inv I *\<^sub>m\<^sub>m (k *\<^sub>s\<^sub>m M) *\<^sub>m\<^sub>m I = k *\<^sub>s\<^sub>m (mat_inv I *\<^sub>m\<^sub>m M *\<^sub>m\<^sub>m I)
[PROOF STEP]
by auto


[STATEMENT]
lemma sigma_finite_measure_distr:
  assumes "sigma_finite_measure (distr M N f)" and f: "f \<in> measurable M N"
  shows "sigma_finite_measure M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_finite_measure M
[PROOF STEP]
interpret sigma_finite_measure "distr M N f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure (distr M N f)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_finite_measure M
[PROOF STEP]
obtain A where A: "countable A" "A \<subseteq> sets (distr M N f)"
      "\<Union> A = space (distr M N f)" "\<forall>a\<in>A. emeasure (distr M N f) a \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>countable A; A \<subseteq> sets (distr M N f); \<Union> A = space (distr M N f); \<forall>a\<in>A. emeasure (distr M N f) a \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using sigma_finite_countable
[PROOF STATE]
proof (prove)
using this:
\<exists>A. countable A \<and> A \<subseteq> sets (distr M N f) \<and> \<Union> A = space (distr M N f) \<and> (\<forall>a\<in>A. emeasure (distr M N f) a \<noteq> \<infinity>)

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>countable A; A \<subseteq> sets (distr M N f); \<Union> A = space (distr M N f); \<forall>a\<in>A. emeasure (distr M N f) a \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable A
A \<subseteq> sets (distr M N f)
\<Union> A = space (distr M N f)
\<forall>a\<in>A. emeasure (distr M N f) a \<noteq> \<infinity>

goal (1 subgoal):
 1. sigma_finite_measure M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure M
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union> A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)
[PROOF STEP]
show "\<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union>A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union> A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)
[PROOF STEP]
using A f
[PROOF STATE]
proof (prove)
using this:
countable A
A \<subseteq> sets (distr M N f)
\<Union> A = space (distr M N f)
\<forall>a\<in>A. emeasure (distr M N f) a \<noteq> \<infinity>
f \<in> M \<rightarrow>\<^sub>M N

goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union> A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)
[PROOF STEP]
by (intro exI[of _ "(\<lambda>a. f -` a \<inter> space M) ` A"])
         (auto simp: emeasure_distr set_eq_iff subset_eq intro: measurable_space)
[PROOF STATE]
proof (state)
this:
\<exists>A. countable A \<and> A \<subseteq> sets M \<and> \<Union> A = space M \<and> (\<forall>a\<in>A. emeasure M a \<noteq> \<infinity>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sigma_finite_measure M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_empty [simp]: "size empty = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.size Mapping.empty = 0
[PROOF STEP]
unfolding size_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if finite (keys Mapping.empty) then card (keys Mapping.empty) else 0) = 0
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma all_in_argmax_equal:
  fixes f :: "'a \<Rightarrow> ('b :: linorder)"
  assumes "x \<in> arg_max_set f S"
  shows "\<forall>y \<in> arg_max_set f S. f x = f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>arg_max_set f S. f x = f y
[PROOF STEP]
by (meson all_leq argmax_sol_in_s assms le_less no_better_in_s)


[STATEMENT]
lemma chinese_remainder_aux_poly:
  fixes A :: "'a set"
    and m :: "'a \<Rightarrow> 'b::{field_gcd} poly"
  assumes fin: "finite A"
    and cop: "\<forall>i \<in> A. (\<forall>j \<in> A. i \<noteq> j \<longrightarrow> coprime (m i) (m j))"
  shows "\<exists>b. (\<forall>i \<in> A. [b i = 1] (mod m i) \<and> [b i = 0] (mod (\<Prod>j \<in> A - {i}. m j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. \<forall>i\<in>A. [b i = 1] (mod m i) \<and> [b i = 0] (mod prod m (A - {i}))
[PROOF STEP]
proof (rule finite_set_choice, rule fin, rule ballI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
assume "i : A"
[PROOF STATE]
proof (state)
this:
i \<in> A

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
with cop
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>A. \<forall>j\<in>A. i \<noteq> j \<longrightarrow> coprime (m i) (m j)
i \<in> A
[PROOF STEP]
have "coprime (\<Prod>j \<in> A - {i}. m j) (m i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>A. \<forall>j\<in>A. i \<noteq> j \<longrightarrow> coprime (m i) (m j)
i \<in> A

goal (1 subgoal):
 1. coprime (prod m (A - {i})) (m i)
[PROOF STEP]
by (auto intro: prod_coprime_left)
[PROOF STATE]
proof (state)
this:
coprime (prod m (A - {i})) (m i)

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (prod m (A - {i})) (m i)
[PROOF STEP]
have "\<exists>x. [(\<Prod>j \<in> A - {i}. m j) * x = 1] (mod m i)"
[PROOF STATE]
proof (prove)
using this:
coprime (prod m (A - {i})) (m i)

goal (1 subgoal):
 1. \<exists>x. [prod m (A - {i}) * x = 1] (mod m i)
[PROOF STEP]
by (elim cong_solve_coprime_poly)
[PROOF STATE]
proof (state)
this:
\<exists>x. [prod m (A - {i}) * x = 1] (mod m i)

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. [prod m (A - {i}) * x = 1] (mod m i)
[PROOF STEP]
obtain x where "[(\<Prod>j \<in> A - {i}. m j) * x = 1] (mod m i)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. [prod m (A - {i}) * x = 1] (mod m i)

goal (1 subgoal):
 1. (\<And>x. [prod m (A - {i}) * x = 1] (mod m i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[prod m (A - {i}) * x = 1] (mod m i)

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[prod m (A - {i}) * x = 1] (mod m i)

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
have "[(\<Prod>j \<in> A - {i}. m j) * x = 0]
    (mod (\<Prod>j \<in> A - {i}. m j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [prod m (A - {i}) * x = 0] (mod prod m (A - {i}))
[PROOF STEP]
by (subst mult.commute, rule cong_mult_self_poly)
[PROOF STATE]
proof (state)
this:
[prod m (A - {i}) * x = 0] (mod prod m (A - {i}))

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> \<exists>y. [y = 1] (mod m i) \<and> [y = 0] (mod prod m (A - {i}))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[prod m (A - {i}) * x = 1] (mod m i)
[prod m (A - {i}) * x = 0] (mod prod m (A - {i}))
[PROOF STEP]
show "\<exists>a. [a = 1] (mod m i) \<and> [a = 0]
      (mod prod m (A - {i}))"
[PROOF STATE]
proof (prove)
using this:
[prod m (A - {i}) * x = 1] (mod m i)
[prod m (A - {i}) * x = 0] (mod prod m (A - {i}))

goal (1 subgoal):
 1. \<exists>a. [a = 1] (mod m i) \<and> [a = 0] (mod prod m (A - {i}))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. [a = 1] (mod m i) \<and> [a = 0] (mod prod m (A - {i}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SUP_PInfty:
  "(\<And>n::nat. \<exists>i\<in>A. ereal (real n) \<le> f i) \<Longrightarrow> (SUP i\<in>A. f i :: ereal) = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<exists>i\<in>A. ereal (real n) \<le> f i) \<Longrightarrow> Sup (f ` A) = \<infinity>
[PROOF STEP]
unfolding top_ereal_def[symmetric] SUP_eq_top_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<exists>i\<in>A. ereal (real n) \<le> f i) \<Longrightarrow> \<forall>x<top. \<exists>i\<in>A. x < f i
[PROOF STEP]
by (metis MInfty_neq_PInfty(2) PInfty_neq_ereal(2) less_PInf_Ex_of_nat less_ereal.elims(2) less_le_trans)


[STATEMENT]
theorem F1map_comp: "F1map (f1 o g1) (f2 o g2) = F1map f1 f2 o F1map g1 g2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map (f1 \<circ> g1) (f2 \<circ> g2) = F1map f1 f2 \<circ> F1map g1 g2
[PROOF STEP]
by (unfold F.map_comp0[symmetric] o_id) (rule refl)