[STATEMENT]
lemma bitAND_single_digit:
  fixes x c :: nat
assumes "2 ^ c \<le> x"
assumes "x < 2 ^ Suc c"

shows "nth_bit x c = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
obtain b where b: "x = 2^c + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. x = 2 ^ c + b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1) le_Suc_ex
[PROOF STATE]
proof (prove)
using this:
2 ^ c \<le> x
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

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

goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
have bb: "b < 2^c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < 2 ^ c
[PROOF STEP]
using assms(2) b
[PROOF STATE]
proof (prove)
using this:
x < 2 ^ Suc c
x = 2 ^ c + b

goal (1 subgoal):
 1. b < 2 ^ c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b < 2 ^ c

goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
have "(2 ^ c + b) div 2 ^ c mod 2 = (1 + b div 2 ^ c) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ c + b) div 2 ^ c mod 2 = (1 + b div 2 ^ c) mod 2
[PROOF STEP]
by (auto simp: div_add_self1)
[PROOF STATE]
proof (state)
this:
(2 ^ c + b) div 2 ^ c mod 2 = (1 + b div 2 ^ c) mod 2

goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ c + b) div 2 ^ c mod 2 = (1 + b div 2 ^ c) mod 2

goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + b div 2 ^ c) mod 2 = 1
[PROOF STEP]
by (auto simp: bb)
[PROOF STATE]
proof (state)
this:
(1 + b div 2 ^ c) mod 2 = 1

goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2 ^ c + b) div 2 ^ c mod 2 = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(2 ^ c + b) div 2 ^ c mod 2 = 1

goal (1 subgoal):
 1. x \<exclamdown> c = 1
[PROOF STEP]
by (simp only: nth_bit_def b)
[PROOF STATE]
proof (state)
this:
x \<exclamdown> c = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_sgn_power:
  assumes "0 < n"
  shows "inj (\<lambda>y. sgn y * \<bar>y\<bar>^n :: real)"
    (is "inj ?f")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>y. sgn y * \<bar>y\<bar> ^ n)
[PROOF STEP]
proof (rule injI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n \<Longrightarrow> x = y
[PROOF STEP]
have x: "(0 < a \<and> b < 0) \<or> (a < 0 \<and> 0 < b) \<Longrightarrow> a \<noteq> b" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<and> b < 0 \<or> a < 0 \<and> 0 < b \<Longrightarrow> a \<noteq> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < ?a \<and> ?b < 0 \<or> ?a < 0 \<and> 0 < ?b \<Longrightarrow> ?a \<noteq> ?b

goal (1 subgoal):
 1. \<And>x y. sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n \<Longrightarrow> x = y
[PROOF STEP]
assume "?f x = ?f y"
[PROOF STATE]
proof (state)
this:
sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n

goal (1 subgoal):
 1. \<And>x y. sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n \<Longrightarrow> x = y
[PROOF STEP]
with power_eq_iff_eq_base[of n "\<bar>x\<bar>" "\<bar>y\<bar>"] \<open>0 < n\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < n; 0 \<le> \<bar>x\<bar>; 0 \<le> \<bar>y\<bar>\<rbrakk> \<Longrightarrow> (\<bar>x\<bar> ^ n = \<bar>y\<bar> ^ n) = (\<bar>x\<bar> = \<bar>y\<bar>)
0 < n
sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < n; 0 \<le> \<bar>x\<bar>; 0 \<le> \<bar>y\<bar>\<rbrakk> \<Longrightarrow> (\<bar>x\<bar> ^ n = \<bar>y\<bar> ^ n) = (\<bar>x\<bar> = \<bar>y\<bar>)
0 < n
sgn x * \<bar>x\<bar> ^ n = sgn y * \<bar>y\<bar> ^ n

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by (cases rule: linorder_cases[of 0 x, case_product linorder_cases[of 0 y]])
       (simp_all add: x)
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma artanh_minus_real [simp]:
  assumes "abs x < 1"
  shows   "artanh (-x::real) = -artanh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. artanh (- x) = - artanh x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < 1

goal (1 subgoal):
 1. artanh (- x) = - artanh x
[PROOF STEP]
by (simp add: artanh_def ln_div field_simps)


[STATEMENT]
lemma eval_psi_ineq_aux_mono:
  assumes "psi n = x" "psi m = x" "psi n \<le> 3 / 2 * ln 2 * n" "n \<le> m"
  shows   "psi m \<le> 3 / 2 * ln 2 * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
psi n = x
psi m = x
psi n \<le> 3 / 2 * ln 2 * real n
n \<le> m
[PROOF STEP]
have "psi m = psi n"
[PROOF STATE]
proof (prove)
using this:
psi n = x
psi m = x
psi n \<le> 3 / 2 * ln 2 * real n
n \<le> m

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

goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psi m = psi n

goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
have "\<dots> \<le> 3 / 2 * ln 2 * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n \<le> 3 / 2 * ln 2 * real n
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
psi n \<le> 3 / 2 * ln 2 * real n

goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psi n \<le> 3 / 2 * ln 2 * real n

goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
from \<open>n \<le> m\<close>
[PROOF STATE]
proof (chain)
picking this:
n \<le> m
[PROOF STEP]
have "\<dots> \<le> 3 / 2 * ln 2 * m"
[PROOF STATE]
proof (prove)
using this:
n \<le> m

goal (1 subgoal):
 1. 3 / 2 * ln 2 * real n \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 / 2 * ln 2 * real n \<le> 3 / 2 * ln 2 * real m

goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
psi m \<le> 3 / 2 * ln 2 * real m

goal (1 subgoal):
 1. psi m \<le> 3 / 2 * ln 2 * real m
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
psi m \<le> 3 / 2 * ln 2 * real m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) set_mult_card_eq_impl_empty_inter':
  assumes "finite H" "finite J" "H \<subseteq> carrier G" "J \<subseteq> carrier G" "card (H <#> J) = card H * card J"
  shows "\<And>a b. \<lbrakk>a \<in> H; b \<in> H; a \<noteq> b\<rbrakk> \<Longrightarrow> (l_coset G a J) \<inter> (l_coset G b J) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> H; b \<in> H; a \<noteq> b\<rbrakk> \<Longrightarrow> (a <# J) \<inter> (b <# J) = {}
[PROOF STEP]
unfolding l_coset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> H; b \<in> H; a \<noteq> b\<rbrakk> \<Longrightarrow> (\<Union>h\<in>J. {a \<otimes> h}) \<inter> (\<Union>h\<in>J. {b \<otimes> h}) = {}
[PROOF STEP]
using set_mult_card_eq_impl_empty_inter image_def[of "(\<otimes>) _" J] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?H; finite ?J; ?H \<subseteq> carrier G; ?J \<subseteq> carrier G; card (?H <#> ?J) = card ?H * card ?J; ?a \<in> ?H; ?b \<in> ?H; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> (\<otimes>) ?a ` ?J \<inter> (\<otimes>) ?b ` ?J = {}
(\<otimes>) ?uu3 ` J = {y. \<exists>x\<in>J. y = ?uu3 \<otimes> x}
finite H
finite J
H \<subseteq> carrier G
J \<subseteq> carrier G
card (H <#> J) = card H * card J

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<in> H; b \<in> H; a \<noteq> b\<rbrakk> \<Longrightarrow> (\<Union>h\<in>J. {a \<otimes> h}) \<inter> (\<Union>h\<in>J. {b \<otimes> h}) = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma list_sel_eq_foldr2: "list_sel f x y = foldr (\<lambda>x a. a * foldr (\<lambda>b a. a * f x b) y 1) x 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_sel f x y = foldr (\<lambda>x a. a * foldr (\<lambda>b a. a * f x b) y 1) x 1
[PROOF STEP]
by (simp add: list_sel_aux_eq_foldr list_sel_eq_foldr)


[STATEMENT]
lemma convex_imp_locally_path_connected:
  fixes S :: "'a:: real_normed_vector set"
  assumes "convex S"
  shows "locally path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally path_connected S
[PROOF STEP]
proof (clarsimp simp add: locally_path_connected)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>V x. \<lbrakk>openin (top_of_set S) V; x \<in> V\<rbrakk> \<Longrightarrow> \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
fix V x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>V x. \<lbrakk>openin (top_of_set S) V; x \<in> V\<rbrakk> \<Longrightarrow> \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
assume "openin (top_of_set S) V" and "x \<in> V"
[PROOF STATE]
proof (state)
this:
openin (top_of_set S) V
x \<in> V

goal (1 subgoal):
 1. \<And>V x. \<lbrakk>openin (top_of_set S) V; x \<in> V\<rbrakk> \<Longrightarrow> \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set S) V
x \<in> V
[PROOF STEP]
obtain T e where  "V = S \<inter> T" "x \<in> S" "0 < e" "ball x e \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set S) V
x \<in> V

goal (1 subgoal):
 1. (\<And>T e. \<lbrakk>V = S \<inter> T; x \<in> S; 0 < e; ball x e \<subseteq> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Int_iff openE openin_open)
[PROOF STATE]
proof (state)
this:
V = S \<inter> T
x \<in> S
0 < e
ball x e \<subseteq> T

goal (1 subgoal):
 1. \<And>V x. \<lbrakk>openin (top_of_set S) V; x \<in> V\<rbrakk> \<Longrightarrow> \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V = S \<inter> T
x \<in> S
0 < e
ball x e \<subseteq> T
[PROOF STEP]
have "openin (top_of_set S) (S \<inter> ball x e)" "path_connected (S \<inter> ball x e)"
[PROOF STATE]
proof (prove)
using this:
V = S \<inter> T
x \<in> S
0 < e
ball x e \<subseteq> T

goal (1 subgoal):
 1. openin (top_of_set S) (S \<inter> ball x e) &&& path_connected (S \<inter> ball x e)
[PROOF STEP]
by (simp_all add: assms convex_Int convex_imp_path_connected openin_open_Int)
[PROOF STATE]
proof (state)
this:
openin (top_of_set S) (S \<inter> ball x e)
path_connected (S \<inter> ball x e)

goal (1 subgoal):
 1. \<And>V x. \<lbrakk>openin (top_of_set S) V; x \<in> V\<rbrakk> \<Longrightarrow> \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set S) (S \<inter> ball x e)
path_connected (S \<inter> ball x e)
[PROOF STEP]
show "\<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set S) (S \<inter> ball x e)
path_connected (S \<inter> ball x e)

goal (1 subgoal):
 1. \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
using \<open>0 < e\<close> \<open>V = S \<inter> T\<close> \<open>ball x e \<subseteq> T\<close> \<open>x \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set S) (S \<inter> ball x e)
path_connected (S \<inter> ball x e)
0 < e
V = S \<inter> T
ball x e \<subseteq> T
x \<in> S

goal (1 subgoal):
 1. \<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>U. openin (top_of_set S) U \<and> path_connected U \<and> x \<in> U \<and> U \<subseteq> V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_baldL[simp]: "size (rbt_baldL t1 a b t2) = Suc (size t1 + size t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (rbt_baldL t1 a b t2) = Suc (size t1 + size t2)
[PROOF STEP]
by (induction t1 a b t2 rule: rbt_baldL.induct) auto


[STATEMENT]
lemma [simp]: "`!p + p = 1`"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ! (\<iota> p) + \<iota> p = (1::'b)
[PROOF STEP]
by kat_hom (metis compl_sup_top)


[STATEMENT]
lemma (in Corps) mprod_Suc:"\<lbrakk> \<forall>j\<le>(Suc n). e j \<in> Zset;
                \<forall>j \<le> (Suc n). f j \<in> (carrier K - {\<zero>})\<rbrakk> \<Longrightarrow>
 mprod_exp K e f (Suc n) = (mprod_exp K e f n) \<cdot>\<^sub>r ((f (Suc n))\<^bsub>K\<^esub>\<^bsup>(e (Suc n))\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>Suc n. e j \<in> Zset; \<forall>j\<le>Suc n. f j \<in> carrier K - {\<zero>}\<rbrakk> \<Longrightarrow> mprod_exp K e f (Suc n) = mprod_exp K e f n \<cdot>\<^sub>r f (Suc n)\<^bsub>K\<^esub>\<^bsup>e (Suc n)\<^esup>
[PROOF STEP]
apply (simp add:mprod_exp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_cons_eq:
  "(map ((\<lambda>a. rec_exec a (m # xs)) \<circ>
    (\<lambda>i. recf.id (Suc (length xs)) (i)))
          [Suc 0..<Suc (length xs)])
        = map (\<lambda> i. xs ! (i - 1)) [Suc 0..<Suc (length xs)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((\<lambda>a. rec_exec a (m # xs)) \<circ> recf.id (Suc (length xs))) [Suc 0..<Suc (length xs)] = map (\<lambda>i. xs ! (i - 1)) [Suc 0..<Suc (length xs)]
[PROOF STEP]
apply(rule map_ext, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Suc 0 \<le> length xs \<Longrightarrow> rec_exec (recf.id (Suc (length xs)) (length xs)) (m # xs) = xs ! (length xs - Suc 0)
 2. \<And>x. \<lbrakk>Suc 0 \<le> x; x < length xs\<rbrakk> \<Longrightarrow> rec_exec (recf.id (Suc (length xs)) x) (m # xs) = xs ! (x - Suc 0)
[PROOF STEP]
apply(auto simp: rec_exec.simps nth_append nth_Cons split: nat.split)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma A_to_prodag_aHom:"\<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. (S k) \<in>
 aHom A (B k) \<rbrakk>  \<Longrightarrow> A_to_prodag A I S B \<in> aHom A (a\<Pi>\<^bsub>I\<^esub> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B \<in> aHom A (a\<Pi>\<^bsub>I\<^esub> B)
[PROOF STEP]
apply (simp add:aHom_def [of "A" "a\<Pi>\<^bsub>I\<^esub> B"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B \<in> carrier A \<rightarrow> carrier (a\<Pi>\<^bsub>I\<^esub> B) \<and> A_to_prodag A I S B \<in> extensional (carrier A) \<and> (\<forall>a\<in>carrier A. \<forall>b\<in>carrier A. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B \<in> carrier A \<rightarrow> carrier (a\<Pi>\<^bsub>I\<^esub> B)
 2. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B \<in> extensional (carrier A) \<and> (\<forall>a\<in>carrier A. \<forall>b\<in>carrier A. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b)
[PROOF STEP]
apply (simp add:prodag_def A_to_prodag_mem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B \<in> extensional (carrier A) \<and> (\<forall>a\<in>carrier A. \<forall>b\<in>carrier A. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B \<in> extensional (carrier A)
 2. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier A. \<forall>b\<in>carrier A. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (simp add:A_to_prodag_def restrict_def extensional_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k)\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier A. \<forall>b\<in>carrier A. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (rule ballI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule_tac x = a and y = b in aGroup.ag_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule_tac x = "a \<plusminus>\<^bsub>A\<^esub> b" in A_to_prodag_mem [of "A" "I" "B" "S"],
                                                       assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule_tac x = a in A_to_prodag_mem [of "A" "I" "B" "S"],
                                                       assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule_tac x = b in A_to_prodag_mem [of "A" "I" "B" "S"],
                                                       assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule prodag_aGroup [of "I" "B"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule_tac x = a in A_to_prodag_mem[of "A" "I" "B" "S"], assumption+,
        frule_tac x = b in A_to_prodag_mem[of "A" "I" "B" "S"], assumption+,
        frule_tac x = "a \<plusminus>\<^bsub>A\<^esub> b" in A_to_prodag_mem[of "A" "I" "B" "S"],
                                                 assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (frule prodag_aGroup[of "I" "B"],
        frule_tac x = "A_to_prodag A I S B a" and
 y = "A_to_prodag A I S B b" in aGroup.ag_pOp_closed [of "a\<Pi>\<^bsub>I\<^esub> B"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B a \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)
 2. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)
 3. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (simp add:prodag_carrier)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)
 2. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (simp add:prodag_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) = A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b
[PROOF STEP]
apply (rule carr_prodag_mem_eq, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carr_prodag I B
 2. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> \<forall>l\<in>I. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) l = (A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b) l
[PROOF STEP]
apply (simp add:prodag_carrier)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B)\<rbrakk> \<Longrightarrow> \<forall>l\<in>I. A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) l = (A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b) l
[PROOF STEP]
apply (rule ballI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<in> carr_prodag I B; A_to_prodag A I S B b \<in> carr_prodag I B; A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B); l \<in> I\<rbrakk> \<Longrightarrow> A_to_prodag A I S B (a \<plusminus>\<^bsub>A\<^esub> b) l = (A_to_prodag A I S B a \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> A_to_prodag A I S B b) l
[PROOF STEP]
apply (simp add:A_to_prodag_def prod_pOp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l. \<lbrakk>aGroup A; \<forall>k\<in>I. aGroup (B k); \<forall>k\<in>I. S k \<in> aHom A (B k); a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; (\<lambda>k\<in>I. S k (a \<plusminus>\<^bsub>A\<^esub> b)) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k a) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); (\<lambda>k\<in>I. S k a) \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> (\<lambda>k\<in>I. S k b) \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B); l \<in> I\<rbrakk> \<Longrightarrow> S l (a \<plusminus>\<^bsub>A\<^esub> b) = ((\<lambda>k\<in>I. S k a) \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> (\<lambda>k\<in>I. S k b)) l
[PROOF STEP]
apply (rotate_tac 2,
        frule_tac x = l in bspec, assumption,
        thin_tac "\<forall>k\<in>I. S k \<in> aHom A (B k)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; (\<lambda>k\<in>I. S k (a \<plusminus>\<^bsub>A\<^esub> b)) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k a) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k b) \<in> carr_prodag I B; aGroup (a\<Pi>\<^bsub>I\<^esub> B); (\<lambda>k\<in>I. S k a) \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> (\<lambda>k\<in>I. S k b) \<in> carrier (a\<Pi>\<^bsub>I\<^esub> B); l \<in> I; aGroup A; \<forall>k\<in>I. aGroup (B k); S l \<in> aHom A (B l)\<rbrakk> \<Longrightarrow> S l (a \<plusminus>\<^bsub>A\<^esub> b) = ((\<lambda>k\<in>I. S k a) \<plusminus>\<^bsub>a\<Pi>\<^bsub>I\<^esub> B\<^esub> (\<lambda>k\<in>I. S k b)) l
[PROOF STEP]
apply (simp add:prodag_def prod_pOp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; (\<lambda>k\<in>I. S k (a \<plusminus>\<^bsub>A\<^esub> b)) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k a) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k b) \<in> carr_prodag I B; aGroup \<lparr>carrier = carr_prodag I B, pop = \<lambda>f\<in>carr_prodag I B. \<lambda>g\<in>carr_prodag I B. \<lambda>x\<in>I. f x \<plusminus>\<^bsub>B x\<^esub> g x, mop = prod_mOp I B, zero = prod_zero I B\<rparr>; (\<lambda>x\<in>I. (if x \<in> I then S x a else undefined) \<plusminus>\<^bsub>B x\<^esub> (if x \<in> I then S x b else undefined)) \<in> carr_prodag I B; l \<in> I; aGroup A; \<forall>k\<in>I. aGroup (B k); S l \<in> aHom A (B l)\<rbrakk> \<Longrightarrow> S l (a \<plusminus>\<^bsub>A\<^esub> b) = S l a \<plusminus>\<^bsub>B l\<^esub> S l b
[PROOF STEP]
apply (frule_tac x = l in bspec, assumption,
        thin_tac "\<forall>k\<in>I. aGroup (B k)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l. \<lbrakk>a \<in> carrier A; b \<in> carrier A; a \<plusminus>\<^bsub>A\<^esub> b \<in> carrier A; (\<lambda>k\<in>I. S k (a \<plusminus>\<^bsub>A\<^esub> b)) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k a) \<in> carr_prodag I B; (\<lambda>k\<in>I. S k b) \<in> carr_prodag I B; aGroup \<lparr>carrier = carr_prodag I B, pop = \<lambda>f\<in>carr_prodag I B. \<lambda>g\<in>carr_prodag I B. \<lambda>x\<in>I. f x \<plusminus>\<^bsub>B x\<^esub> g x, mop = prod_mOp I B, zero = prod_zero I B\<rparr>; (\<lambda>x\<in>I. (if x \<in> I then S x a else undefined) \<plusminus>\<^bsub>B x\<^esub> (if x \<in> I then S x b else undefined)) \<in> carr_prodag I B; l \<in> I; aGroup A; S l \<in> aHom A (B l); aGroup (B l)\<rbrakk> \<Longrightarrow> S l (a \<plusminus>\<^bsub>A\<^esub> b) = S l a \<plusminus>\<^bsub>B l\<^esub> S l b
[PROOF STEP]
apply (simp add: aHom_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ma :
 assumes wf1: "mat nr n m1"
     and wf2: "mat n nc m2"
        and i: "i < nr"
        and j: "j < nc"
 shows "mat_multI zer g f nr m1 m2 ! j ! i
                  = scalar_prodI zer g f (row m1 i) (col m2 j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_multI zer (+) (*) nr m1 m2 ! j ! i = scalar_prodI zer (+) (*) (row m1 i) (col m2 j)
[PROOF STEP]
using mat_mult_index i j wf1 wf2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>mat ?nr ?n ?m1.0; mat ?n ?nc ?m2.0; ?i < ?nr; ?j < ?nc\<rbrakk> \<Longrightarrow> mat_multI ?ze ?pl ?ti ?nr ?m1.0 ?m2.0 ! ?j ! ?i = scalar_prodI ?ze ?pl ?ti (row ?m1.0 ?i) (col ?m2.0 ?j)
i < nr
j < nc
mat nr n m1
mat n nc m2

goal (1 subgoal):
 1. mat_multI zer (+) (*) nr m1 m2 ! j ! i = scalar_prodI zer (+) (*) (row m1 i) (col m2 j)
[PROOF STEP]
by metis