Theory Algebra9
theory Algebra9 imports Algebra8 begin
section "Exact sequence"
definition
Zm :: "[('r, 'm) Ring_scheme, 'a] ⇒ ('a, 'r) Module" where
"Zm R e = ⦇ carrier = {e}, pop = λx∈{e}. λy∈{e}. e, mop =
λx∈{e}. e, zero = e, sprod = λr∈carrier R. λx∈{e}. e⦈"
lemma (in Ring) Zm_Module:"R module (Zm R e)"
apply (simp add:Module_def aGroup_def Zm_def Module_axioms_def)
apply (simp add:ring_one, cut_tac Ring, simp)
apply (rule conjI)
apply (rule allI, rule impI, rule allI, rule impI, rule impI)
apply (cut_tac ring_is_ag,
frule_tac x = a and y = b in aGroup.ag_pOp_closed, assumption+, simp)
apply (rule allI, rule impI, rule allI, rule impI, rule impI,
frule_tac x = a and y = b in ring_tOp_closed, assumption+, simp)
done
lemma (in Ring) Zm_carrier:"carrier (Zm R e) = {e}"
apply (simp add:Zm_def)
done
lemma (in Ring) Zm_to_M_0:"⟦R module M; f ∈ mHom R (Zm R e) M⟧ ⟹
f e = 𝟬⇘M⇙"
apply (cut_tac Zm_Module [of e])
apply (frule Module.mHom_add [of "Zm R e" R M f e e], assumption+,
(simp add:Zm_carrier)+,
frule_tac R = R and M = "Zm R e" in Module.module_is_ag,
frule_tac x = e and y = e in aGroup.ag_pOp_closed[of "Zm R e"],
(simp add:Zm_carrier)+)
apply (frule_tac R = R and M = "Zm R e" and N = M and f = f and m = e in
Module.mHom_mem, assumption+, simp add:Zm_carrier,
frule sym, thin_tac "f e = f e ±⇘M⇙ (f e)",
frule_tac R = R and M = M in Module.module_is_ag,
frule aGroup.ag_eq_sol2 [of M "f e" "f e" "f e"], assumption+)
apply (simp add:aGroup.ag_r_inv1)
done
lemma (in Ring) Z_to_M:"⟦R module M; f ∈ mHom R (Zm R e) M;
g ∈ mHom R (Zm R e) M ⟧ ⟹ f = g"
apply (rule_tac R = R and M = "Zm R e" and N = M in Module.mHom_eq)
apply (simp add:Zm_Module)
apply assumption+
apply (rule ballI)
apply (simp add:Zm_carrier)
apply (simp add:Zm_to_M_0 [of _ _ e])
done
lemma (in Ring) mzeromap_mHom:"⟦R module M; R module N⟧ ⟹
mzeromap M N ∈ mHom R M N"
apply (simp add:mHom_def aHom_def)
apply (rule conjI)
apply (simp add:mzeromap_def, simp add:Module_def aGroup_def)
apply (rule conjI)
apply (simp add:mzeromap_def extensional_def)
apply (rule conjI)
apply ((rule ballI)+,
frule_tac R = R and M = M in Module.module_is_ag,
frule_tac x = a and y = b in aGroup.ag_pOp_closed [of "M"],
assumption+,
simp add:mzeromap_def,
frule_tac R = R and M = N in Module.module_is_ag,
rule aGroup.ag_l_zero[THEN sym, of "N"], assumption+,
simp add:aGroup.ag_inc_zero)
apply (rule ballI)+
apply (frule_tac a = a and m = m in Module.sc_mem [of M R], assumption+,
simp add:mzeromap_def,
rule Module.sc_a_0 [THEN sym], assumption+)
done
lemma (in Ring) HOM_carrier:"carrier (HOM⇘R⇙ M N) = mHom R M N"
apply (simp add:HOM_def)
done
lemma (in Ring) mHom_Z_M:"R module M ⟹
mHom R (Zm R e) M = {mzeromap (Zm R e) M}"
apply (rule equalityI)
apply (rule subsetI)
apply simp
apply (cut_tac Zm_Module [of e])
apply (frule mzeromap_mHom [of "Zm R e" M], assumption+)
apply (simp add:Z_to_M)
apply (rule subsetI) apply simp
apply (cut_tac Zm_Module[of e],
simp add:mzeromap_mHom)
done
lemma (in Module) Modules_single_carrier_isom:"⟦R module N; carrier M = {𝟬};
carrier N = {𝟬⇘N⇙}⟧ ⟹ M ≅⇘R⇙ N"
apply (subgoal_tac "bijec⇘M, N⇙ (λx∈{𝟬}. 𝟬⇘N⇙) ∧
(λx∈{𝟬}. 𝟬⇘N⇙) ∈ mHom R M N")
apply (simp add:misomorphic_def, blast,
subgoal_tac "(λx∈{𝟬}. 𝟬⇘N⇙) ∈ mHom R M N", simp)
apply (simp add:bijec_def injec_def surjec_def mHom_def,
simp add:ker_def surj_to_def)
apply (simp add:mHom_def aHom_def)
apply (cut_tac ag_inc_zero, simp add:ag_l_zero)
apply (frule_tac R = R and M = N in Module.module_is_ag,
frule aGroup.ag_inc_zero[of N],
simp add:aGroup.ag_l_zero[of N])
apply (simp add:sc_a_0 Module.sc_a_0)
done
lemma (in Ring) Zm_isom:"(Zm R (e::'a)) ≅⇘R⇙ (Zm R (u::'b))"
apply (cut_tac Zm_Module[of e], cut_tac Zm_Module[of u])
apply (rule_tac R = R and M = "Zm R e" and N = "Zm R u" in
Module.Modules_single_carrier_isom, assumption+)
apply (simp add:Zm_def)+
done
lemma (in Ring) HOM_Z_M_0:"R module M ⟹ HOM⇘R⇙ (Zm R e) M ≅⇘R⇙ (Zm R e)"
apply (cut_tac Zm_Module[of e],
frule_tac M = "Zm R e" and N = M in Module.HOM_is_module,
assumption+)
apply (cut_tac M = "Zm R e" and N = M in HOM_carrier)
apply (simp add: mHom_Z_M)
apply (simp add:Module.zero_HOM)
apply (rule_tac R = R and M = "HOM⇘R⇙ (Zm R e) M" and N = "Zm R e" in
Module.Modules_single_carrier_isom, assumption+)
apply (simp add:Zm_def)
done
lemma (in Ring) M_to_Z:"⟦R module M; f ∈ mHom R M (Zm R e);
g ∈ mHom R M (Zm R e)⟧ ⟹ f = g"
apply (rule Module.mHom_eq [of M _ "Zm R e"], assumption+)
apply (simp add:Zm_Module, assumption+)
apply (rule ballI)
apply (frule_tac m = m in Module.mHom_mem [of M _ "Zm R e" f],
simp add:Zm_Module, assumption+)
apply (frule_tac m = m in Module.mHom_mem [of M _ "Zm R e" g],
simp add:Zm_Module, assumption+)
apply (simp add:Zm_carrier)
done
lemma (in Ring) mHom_to_zero:"R module M ⟹ mHom R M (Zm R e) =
{mzeromap M (Zm R e)}"
apply (frule mzeromap_mHom [of M "Zm R e"])
apply (simp add:Zm_Module)
apply (rule equalityI)
apply (rule subsetI)
apply (frule_tac f = "mzeromap M (Zm R e)" and g = x in M_to_Z [of M],
assumption+)
apply simp
apply (rule subsetI)
apply simp
done
lemma (in Ring) carrier_HOM_M_Z:"R module M ⟹
carrier (HOM⇘R⇙ M (Zm R e)) = {mzeromap M (Zm R e)}"
apply (subst HOM_carrier)
apply (simp add:mHom_to_zero)
done
lemma (in Ring) HOM_M_Z_0:"R module M ⟹ HOM⇘R⇙ M (Zm R e) ≅⇘R⇙ (Zm R e)"
apply (cut_tac Zm_Module[of e],
frule_tac M = M and N = "Zm R e" in Module.HOM_is_module,
assumption+)
apply (frule_tac M = M and e = e in carrier_HOM_M_Z)
apply (simp add:Module.zero_HOM)
apply (rule Module.Modules_single_carrier_isom, assumption+)
apply (simp add:Zm_def)
done
lemma (in Ring) M_to_Z_0:"⟦R module M; f ∈ mHom R M (Zm R e)⟧ ⟹
ker⇘M,(Zm R e)⇙ f = carrier M"
apply (simp add:ker_def)
apply (simp add:Zm_def) apply (fold Zm_def)
apply (rule equalityI)
apply (rule subsetI)
apply (simp add:CollectI)
apply (rule subsetI, simp)
apply (cut_tac Zm_Module[of e])
apply (frule_tac R = R and M = M and N = "Zm R e" and f = f and m = x in
Module.mHom_mem, assumption+)
apply (simp add:Zm_carrier)
done
definition
exact3 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme, 'a ⇒ 'b,
('b, 'r, 'm1) Module_scheme, 'b ⇒ 'c, ('c, 'r, 'm1) Module_scheme] ⇒ bool" where
"exact3 R L0 h0 L1 h1 L2 == h0 ` (carrier L0) = ker⇘(L1),(L2)⇙ h1"
definition
exact4 :: "[('r, 'm) Ring_scheme, ('a0, 'r, 'm1) Module_scheme, 'a0 ⇒ 'a1,
('a1, 'r, 'm1) Module_scheme, 'a1 ⇒ 'a2, ('a2, 'r, 'm1) Module_scheme,
'a2 ⇒ 'a3, ('a3, 'r, 'm1) Module_scheme] ⇒ bool" where
"exact4 R L0 h0 L1 h1 L2 h2 L3 ⟷ h0 ` (carrier L0) = ker⇘(L1),(L2)⇙ h1 ∧
h1 ` (carrier L1) = ker⇘(L2),(L3)⇙ h2 "
definition
exact5 :: "[('r, 'm) Ring_scheme, ('a0, 'r, 'm1) Module_scheme, 'a0 ⇒ 'a1,
('a1, 'r, 'm1) Module_scheme, 'a1 ⇒ 'a2, ('a2, 'r, 'm1) Module_scheme,
'a2 ⇒ 'a3, ('a3, 'r, 'm1) Module_scheme, 'a3 ⇒ 'a4,
('a4, 'r, 'm1) Module_scheme] ⇒ bool" where
"exact5 R L0 h0 L1 h1 L2 h2 L3 h3 L4 == h0 ` (carrier L0) = ker⇘(L1),(L2)⇙ h1 ∧
h1 ` (carrier L1) = ker⇘(L2),(L3)⇙ h2 ∧ h2 `(carrier L2) = ker⇘(L3),(L4)⇙ h3 "
definition
exact8 :: "[('r, 'm) Ring_scheme, ('a0, 'r, 'm1) Module_scheme, 'a0 ⇒ 'a1,
('a1, 'r, 'm1) Module_scheme, 'a1 ⇒ 'a2, ('a2, 'r, 'm1) Module_scheme,
'a2 ⇒ 'a3, ('a3, 'r, 'm1) Module_scheme, 'a3 ⇒ 'a4,
('a4, 'r, 'm1) Module_scheme, 'a4 ⇒ 'a5, ('a5, 'r, 'm1) Module_scheme,
'a5 ⇒ 'a6, ('a6, 'r, 'm1) Module_scheme, 'a6 ⇒ 'a7,
('a7, 'r, 'm1) Module_scheme] ⇒ bool" where
"exact8 R L0 h0 L1 h1 L2 h2 L3 h3 L4 h4 L5 h5 L6 h6 L7 ⟷
h0 ` (carrier L0) = ker⇘(L1),(L2)⇙ h1 ∧ h1 ` (carrier L1) = ker⇘(L2),(L3)⇙ h2 ∧
h2 ` (carrier L2) = ker⇘(L3),(L4)⇙ h3 ∧ h3 ` (carrier L3) = ker⇘(L4),(L5)⇙ h4 ∧
h4 ` (carrier L4) = ker⇘(L5),(L6)⇙ h5 ∧ h5 ` (carrier L5) = ker⇘(L6),(L7)⇙ h6"
lemma (in Ring) exact3_comp_0:"⟦R module L; R module M; R module N;
f ∈ mHom R L M; g ∈ mHom R M N; exact3 R L f M g N⟧ ⟹
compos L g f = mzeromap L N"
apply (frule Module.mHom_compos [of M R L N f g], assumption+,
frule mzeromap_mHom [of L N], assumption,
rule Module.mHom_eq [of L R N], assumption+)
apply (rule ballI)
apply (subst compos_def)+
apply (simp add:exact3_def)
apply (cut_tac mHom_func[of f L M])
apply (frule_tac a = m in mem_in_image [of f "carrier L" "carrier M"],
assumption+)
apply simp
apply (simp add:ker_def mzeromap_def compose_def, assumption)
done
lemma (in Ring) exact_im_sub_kern:"⟦R module L; R module M; R module N;
f ∈ mHom R L M; g ∈ mHom R M N; exact3 R L f M g N⟧ ⟹
f ` (carrier L) ⊆ ker⇘M,N⇙ g"
apply (simp add:exact3_def)
done
lemma (in Ring) mzero_im_sub_ker:"⟦R module L; R module M; R module N;
f ∈ mHom R L M; g ∈ mHom R M N; compos L g f = mzeromap L N⟧ ⟹
f ` (carrier L) ⊆ ker⇘M,N⇙ g"
apply (rule subsetI)
apply (simp add:image_def)
apply auto
apply (simp add:ker_def)
apply (simp add:Module.mHom_mem)
apply (simp add:compos_def compose_def)
apply (subgoal_tac "(λx∈carrier L. g (f x)) xa = mzeromap L N xa")
prefer 2 apply simp
apply (thin_tac "(λx∈carrier L. g (f x)) = mzeromap L N")
apply simp
apply (simp add:mzeromap_def)
done
lemma (in Ring) left_exact_injec:"⟦R module M; R module N;
z ∈ mHom R (Zm R e) M; f ∈ mHom R M N; exact3 R (Zm R e) z M f N⟧ ⟹
injec⇘M,N⇙ f"
apply (simp add:injec_def)
apply (rule conjI)
apply (simp add:mHom_def)
apply (simp add:exact3_def)
apply (simp add:Zm_def, fold Zm_def)
apply (simp add: Zm_to_M_0 [of M z e])
done
lemma (in Ring) injec_left_exact:"⟦R module M; R module N;
z ∈ mHom R (Zm R e) M; f ∈ mHom R M N; injec⇘M,N⇙ f⟧ ⟹
exact3 R (Zm R e) z M f N"
apply (simp add:exact3_def)
apply (simp add:Zm_def, fold Zm_def)
apply (simp add:Zm_to_M_0 [of "M" "z" "e"])
apply (simp add:injec_def)
done
lemma (in Ring) injec_mHom_image:"⟦R module N; R module M1; R module M2;
x ∈ mHom R N M2; f ∈ mHom R M1 M2; x ` (carrier N) ⊆ f ` (carrier M1);
injec⇘M1,M2⇙ f⟧⟹
(λn ∈(carrier N). (SOME m. (m ∈ carrier M1 ∧ x n = f m))) ∈ mHom R N M1 ∧
compos N f (λn ∈ (carrier N). (SOME m. m ∈ carrier M1 ∧ x n = f m)) = x"
apply (subgoal_tac "(λn∈carrier N. SOME m. m ∈ carrier M1 ∧ x n = f m) ∈
mHom R N M1", simp)
apply (rule Module.mHom_eq, assumption+)
apply (simp add:Module.mHom_compos, assumption)
apply (rule ballI)
apply (simp add:compos_def compose_def)
apply (thin_tac "(λn∈carrier N. SOME m. m ∈ carrier M1 ∧ x n = f m) ∈
mHom R N M1")
apply (frule_tac m = m in Module.mHom_mem [of N R M2 x], assumption+)
apply (cut_tac mHom_func[of x N M2],
frule_tac a = m in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x m" in subsetD [of "x ` carrier N" "f ` carrier M1"],
assumption+)
apply (simp add:image_def)
apply (rule someI2_ex, blast)
apply (thin_tac "∃xa∈carrier M1. x m = f xa", erule conjE)
apply (rotate_tac -1, rule sym, assumption+)
apply (simp add:mHom_def[of R N M1] aHom_def)
apply (rule conjI)
apply (rule Pi_I)
apply (cut_tac mHom_func[of x N M2],
frule_tac a = xa in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x xa" in subsetD [of "x ` carrier N" "f ` carrier M1"],
assumption+)
apply (simp add:image_def)
apply (rule someI2_ex, blast, simp, assumption)
apply (frule_tac R = R and M = N in Module.module_is_ag,
simp add:aGroup.ag_pOp_closed,
simp add:Module.sc_mem)
apply (rule conjI)
apply (rule ballI)+
apply (frule_tac x = a and y = b in aGroup.ag_pOp_closed [of "N"],
assumption+)
apply (cut_tac mHom_func[of x N M2],
frule_tac a = "a ±⇘N⇙ b" in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x (a ±⇘N⇙ b)" in subsetD[of "x ` carrier N"
"f ` carrier M1"], assumption+)
apply (frule_tac a = a in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x a" in subsetD[of "x ` carrier N"
"f ` carrier M1"], assumption+,
frule_tac a = b in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x b" in subsetD[of "x ` carrier N"
"f ` carrier M1"], assumption+)
apply (simp add:image_def)
apply (rule someI2_ex, blast)
apply (rule someI2_ex, blast)
apply (rule someI2_ex, blast)
apply (thin_tac "∃xa∈carrier N. x ( a ±⇘N⇙ b) = x xa",
thin_tac "∃xa∈carrier M1. x ( a ±⇘N⇙ b) = f xa",
thin_tac "∃xa∈carrier N. x a = x xa",
thin_tac "∃xa∈carrier M1. x a = f xa",
thin_tac "∃xa∈carrier N. x b = x xa",
thin_tac "∃xa∈carrier M1. x b = f xa")
apply ((erule conjE)+, fold image_def)
apply (frule_tac R = R and M = N and N = M2 and f = x and m = a and n = b in
Module.mHom_add, assumption+, simp)
apply (simp add:Module.mHom_add[THEN sym, of _ _ _ f])
apply (frule_tac R = R and M = M1 and N = M2 and f = f in Module.minjec_inj,
assumption+)
apply (frule_tac R = R and M = M1 in Module.module_is_ag,
frule_tac x = xaa and y = xa in aGroup.ag_pOp_closed[of M1],
assumption+)
apply (simp add:inj_on_def, assumption)
apply (rule ballI)+
apply (frule_tac a = a and m = m in Module.sc_mem [of N R], assumption+)
apply (cut_tac mHom_func[of x N M2],
frule_tac a = "a ⋅⇩s⇘N⇙ m" in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x (a ⋅⇩s⇘N⇙ m)" in subsetD[of "x ` carrier N"
"f ` carrier M1"], assumption+)
apply (frule_tac a = m in mem_in_image[of x "carrier N" "carrier M2"],
assumption+,
frule_tac c = "x m" in subsetD[of "x ` carrier N"
"f ` carrier M1"], assumption+)
apply (thin_tac "x (a ⋅⇩s⇘N⇙ m) ∈ x ` carrier N",
thin_tac "x m ∈ x ` carrier N")
apply (simp add:image_def)
apply (rule someI2_ex, blast)
apply (rule someI2_ex, blast)
apply (thin_tac "∃xa∈carrier M1. x m = f xa",
thin_tac "∃xa∈carrier M1. x (a ⋅⇩s⇘N⇙ m) = f xa")
apply (erule conjE)+
apply (simp add:Module.mHom_lin)
apply (simp add:Module.mHom_lin[THEN sym])
apply (rule sym)
apply (frule_tac R = R and M = M1 and N = M2 and f = f in Module.minjec_inj,
assumption+,
frule_tac R = R and M = M1 and a = a and m = xa in Module.sc_mem,
assumption+)
apply (simp add:inj_on_def, assumption)
done
lemma (in Ring) right_exact_surjec:"⟦R module M; R module N; f ∈ mHom R M N;
p ∈ mHom R N (Zm R e); exact3 R M f N p (Zm R e)⟧ ⟹ surjec⇘M,N⇙ f"
apply (simp add:surjec_def)
apply (rule conjI)
apply (simp add:mHom_def)
apply (simp add:surj_to_def)
apply (simp add:exact3_def)
apply (simp add:M_to_Z_0)
done
lemma (in Ring) surjec_right_exact:"⟦R module M; R module N; f ∈ mHom R M N;
p ∈ mHom R N (Zm R e); surjec⇘M,N⇙ f⟧ ⟹ exact3 R M f N p (Zm R e)"
apply (simp add:exact3_def)
apply (simp add:ker_def)
apply (frule_tac f = p and M = N and N = "Zm R e" in mHom_func,
simp add:Zm_carrier)
apply (simp add:surjec_def surj_to_def,
thin_tac "f ∈ aHom M N ∧ f ` carrier M = carrier N")
apply (subst Zm_def, simp)
apply (rule equalityI, rule subsetI, simp,
frule funcset_mem[of p "carrier N" "{e}"], assumption, simp)
apply (rule subsetI, simp)
done
lemma (in Ring) exact4_exact3:"⟦R module M; R module N; z ∈ mHom R (Zm R e) M;
f ∈ mHom R M N; z1 ∈ mHom R N (Zm R e);
exact4 R (Zm R e) z M f N z1 (Zm R e) ⟧ ⟹
exact3 R (Zm R e) z M f N ∧ exact3 R M f N z1 (Zm R e)"
apply (simp add:exact4_def exact3_def)
done
lemma (in Ring) exact4_bijec:"⟦R module M; R module N; z ∈ mHom R (Zm R e) M;
f ∈ mHom R M N; z1 ∈ mHom R N (Zm R e);
exact4 R (Zm R e) z M f N z1 (Zm R e)⟧ ⟹ bijec⇘M,N⇙ f"
apply (frule exact4_exact3 [of M N z e f z1], assumption+)
apply (erule conjE)
apply (simp add:bijec_def)
apply (simp add:left_exact_injec)
apply (simp add:right_exact_surjec)
done
lemma (in Ring) exact_im_sub_ker:"⟦R module L; R module M; R module N;
f ∈ mHom R L M; g ∈ mHom R M N; z1 ∈ mHom R N (Zm R e); R module Z;
exact4 R L f M g N z1 (Zm R e); x ∈ mHom R M Z; compos L x f = mzeromap L Z⟧
⟹ (λz∈(carrier N). x (SOME y. y ∈ carrier M ∧ g y = z)) ∈ mHom R N Z"
apply (subst mHom_def, simp)
apply (rule conjI)
apply (simp add:aHom_def)
apply (rule conjI)
apply (rule Pi_I)
apply simp
apply (subgoal_tac "exact3 R M g N z1 (Zm R e)")
prefer 2 apply (simp add:exact4_def exact3_def)
apply (frule right_exact_surjec [of M N g z1], assumption+)
apply (simp add:surjec_def, frule conjunct2)
apply (simp add:surj_to_def, erule conjE)
apply (rotate_tac -1, frule sym, thin_tac "g ` carrier M = carrier N",
simp, thin_tac "carrier N = g ` carrier M")
apply (simp add:image_def)
apply (rule someI2_ex, blast)
apply (erule conjE, simp add:Module.mHom_mem)
apply (frule_tac R = R and M = N in Module.module_is_ag,
simp add:aGroup.ag_pOp_closed)
apply (rule ballI)+
apply (frule_tac x = a and y = b in aGroup.ag_pOp_closed [of "N"],
assumption+)
apply (subgoal_tac "exact3 R M g N z1 (Zm R e)")
prefer 2 apply (simp add:exact4_def exact3_def,
frule right_exact_surjec[of M N g z1], assumption+)
apply (simp add:surjec_def surj_to_def, erule conjE)
apply (rotate_tac -1, frule sym, thin_tac "g ` carrier M = carrier N",
simp)
apply (simp add:image_def)
apply (rule someI2_ex, blast)
apply (rule someI2_ex, blast)
apply (rule someI2_ex)
apply (thin_tac "∃x∈carrier M. a = g x", thin_tac "∃x∈carrier M. b = g x",
thin_tac "xa ∈ carrier M ∧ g xa = b",
thin_tac "xaa ∈ carrier M ∧ g xaa = a")
apply (erule bexE, rotate_tac -1, frule sym, thin_tac "a ±⇘N⇙ b = g xb")
apply blast
apply (thin_tac "∃x∈carrier M. a = g x", thin_tac "∃x∈carrier M. b = g x",
thin_tac "∃x∈carrier M. a ±⇘N⇙ b = g x")
apply (erule conjE)+
apply (rotate_tac -5)
apply (frule sym, thin_tac "g xa = b", frule sym, thin_tac "g xaa = a",
frule sym, thin_tac "g xb = a ±⇘N⇙ b", simp)
apply (simp add:Module.mHom_add[THEN sym])
apply (frule mzero_im_sub_ker [of L M Z f x], assumption+)
apply (simp add:exact4_def, fold image_def,
thin_tac "f ` carrier L = ker⇘M,N⇙ g ∧ g ` carrier M = ker⇘N,Zm R e⇙ z1")
apply (frule_tac R = R and M = M in Module.module_is_ag,
frule_tac x = xaa and y = xa in aGroup.ag_pOp_closed[of M], assumption+,
frule_tac R = R and M = M and N = N and f = g and a = "xaa ±⇘M⇙ xa"
and b = xb in Module.mHom_ker_eq, assumption+)
apply (frule_tac c = "xaa ±⇘M⇙ xa ±⇘M⇙ -⇩a⇘M⇙ xb" in subsetD[of "ker⇘M,N⇙ g"
"ker⇘M,Z⇙ x"], assumption+)
apply (frule_tac a = "xaa ±⇘M⇙ xa" and b = xb in
Module.mHom_eq_ker[of M R Z x], assumption+)
apply (rule sym, assumption)
apply (simp add:Module.sc_mem)
apply (rule ballI)+
apply (frule right_exact_surjec[of M N g z1], assumption+,
simp add:exact4_def exact3_def)
apply (frule_tac a = a and m = m in Module.sc_mem[of N], assumption+)
apply (simp add:surjec_def surj_to_def, erule conjE,
rotate_tac -1, frule sym, thin_tac "g ` carrier M = carrier N",
simp, thin_tac "carrier N = g ` carrier M")
apply (simp add:image_def)
apply (rule someI2_ex, blast,
thin_tac "∃x∈carrier M. m = g x")
apply (rule someI2_ex)
apply (erule bexE, rotate_tac -1, frule sym, thin_tac "a ⋅⇩s⇘N⇙ m = g xaa")
apply blast
apply (thin_tac "∃x∈carrier M. a ⋅⇩s⇘N⇙ m = g x")
apply (erule conjE)+
apply (rotate_tac -3, frule sym, thin_tac "g xa = m", simp)
apply (simp add:Module.mHom_lin[THEN sym])
apply (frule_tac a = a and m = xa in Module.sc_mem, assumption+)
apply (frule_tac R = R and M = M and N = N and f = g and a = xaa and
b = "a ⋅⇩s⇘M⇙ xa" in Module.mHom_ker_eq, assumption+)
apply (frule mzero_im_sub_ker [of L M Z f x], assumption+,
simp add:exact4_def,
thin_tac "f ` carrier L = ker⇘M,N⇙ g ∧ g ` carrier M = ker⇘N,Zm R e⇙ z1")
apply (frule_tac c = "xaa ±⇘M⇙ -⇩a⇘M⇙ (a ⋅⇩s⇘M⇙ xa)" in
subsetD[of "ker⇘M,N⇙ g " "ker⇘M,Z⇙ x"], assumption+)
apply (rule_tac a = xaa and b = "a ⋅⇩s⇘M⇙ xa" in
Module.mHom_eq_ker[of M R Z x], assumption+)
done
lemma (in Ring) exact_im_sub_ker1:"⟦R module L; R module M; R module N;
f ∈ mHom R L M; g ∈ mHom R M N; z1 ∈ mHom R N (Zm R e); R module Z;
exact4 R L f M g N z1 (Zm R e); x ∈ mHom R M Z;
compos L x f = mzeromap L Z ⟧ ⟹
compos M (λz∈(carrier N). x (SOME y. y ∈ carrier M ∧ g y = z)) g = x"
apply (frule exact_im_sub_ker [of L M N f g z1 e Z x], assumption+)
apply (frule_tac g = "(λz∈carrier N. x (SOME y. y ∈ carrier M ∧ g y = z))" in
Module.mHom_compos [of N R M Z g], assumption+)
apply (rule Module.mHom_eq [of M R Z _ x], assumption+)
apply (rule ballI)
apply (subst compos_def, subst compose_def, simp)
apply (simp add:Module.mHom_mem)
apply (thin_tac "compos M (λz∈carrier N. x
(SOME y. y ∈ carrier M ∧ g y = z)) g ∈ mHom R M Z")
apply (thin_tac "(λz∈carrier N. x (SOME y. y ∈ carrier M ∧ g y = z)) ∈
mHom R N Z")
apply (frule right_exact_surjec [of M N g z1 e], assumption+)
apply (simp add:exact4_def exact3_def)
apply (frule mHom_func[of g M N],
frule_tac a = m in mem_in_image[of g "carrier M" "carrier N"],
assumption+)
apply (simp add:image_def)
apply (rule someI2_ex) apply blast
apply (thin_tac "∃x∈carrier M. g m = g x") apply (erule conjE)
apply (frule mzero_im_sub_ker [of L M Z f x], assumption+)
apply (simp add:surjec_def surj_to_def exact4_def)
apply (frule_tac a = xa and b = m in Module.mHom_ker_eq[of M R N g],
assumption+)
apply (frule_tac c = "xa ±⇘M⇙ -⇩a⇘M⇙ m" in subsetD[of "ker⇘M,N⇙ g" "ker⇘M,Z⇙ x"],
assumption+)
apply (rule_tac a = xa and b = m in Module.mHom_eq_ker[of M R Z x],
assumption+)
done
definition
module_iota :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme] ⇒
'a ⇒ 'a" ("(mι⇘_⇙ _)" [92, 93]92) where
"mι⇘R⇙ M = (λx∈carrier M. x)"
lemma (in Ring) short_exact_sequence:"⟦R module M; submodule R M N;
z ∈ mHom R (Zm R e) (mdl M N); z1 ∈ mHom R (M /⇩m N) (Zm R e)⟧ ⟹
exact5 R (Zm R e) z (mdl M N)(mι⇘R⇙ (mdl M N)) M (mpj M N) (M /⇩m N) z1 (Zm R e)"
apply (simp add:exact5_def)
apply (rule conjI)
apply (simp add:Zm_def, fold Zm_def)
apply (frule Module.mdl_is_module [of M R N], assumption+)
apply (simp add:ker_def, simp add:module_iota_def)
apply (simp add:Zm_to_M_0 [of "mdl M N" "z"])
apply (simp add:mdl_def, fold mdl_def)
apply (rule equalityI)
apply simp
apply (simp add:Module.submodule_inc_0)
apply (rule subsetI)
apply (simp add:CollectI)
apply (rule conjI)
apply (simp add:module_iota_def)
apply (simp add:mdl_def, fold mdl_def)
apply (simp add:Module.mker_of_mpj[THEN sym])
apply (frule Module.qmodule_module [of M R N], assumption)
apply (subst M_to_Z_0 [of "M /⇩m N" z1 e], assumption+)
apply (frule Module.mpj_surjec [of M R N], assumption+)
apply (simp add:surjec_def surj_to_def)
done
lemma (in Ring) rexact4_lexact4_HOM:"⟦R module M1; R module M2; R module M3;
f ∈ mHom R M1 M2; g ∈ mHom R M2 M3; z1 ∈ mHom R M3 (Zm R e);
exact4 R M1 f M2 g M3 z1 (Zm R e)⟧ ⟹
∀N. R module N ⟶
exact4 R (HOM⇘R⇙ (Zm R e) N) (sup_sharp R M3 (Zm R e) N z1) (HOM⇘R⇙ M3 N)
(sup_sharp R M2 M3 N g) (HOM⇘R⇙ M2 N) (sup_sharp R M1 M2 N f) (HOM⇘R⇙ M1 N)"
apply (rule allI) apply (rule impI)
apply (subst exact4_def)
apply (rule conjI)
apply (cut_tac Zm_Module [of e])
apply (subst HOM_carrier [of "Zm R e"])
apply (simp add:mHom_Z_M)
apply (simp add:sup_sharp_def)
apply (simp add:mzeromap_mHom)
apply (simp add:ker_def)
apply (simp add:HOM_def)
apply (rule equalityI)
apply (rule subsetI)
apply simp
apply (frule_tac N = N in mzeromap_mHom [of "Zm R e"], assumption+)
thm Module.mHom_compos[of "Zm R e" R M3 _ z1]
apply (frule_tac N = N and g = "mzeromap (Zm R e) N" in
Module.mHom_compos[of "Zm R e" R M3 _ z1], assumption+,
simp)
apply (frule_tac N = N in mzeromap_mHom [of M2], assumption+)
apply (rule_tac N = N and f = "compos M2 (compos M3 (mzeromap (Zm R e) N) z1) g" and g = "mzeromap M2 N" in Module.mHom_eq [of M2 _ ], assumption+)
apply (rule Module.mHom_compos, assumption+)
apply (rule ballI)
apply (simp add:compos_def mzeromap_def compose_def)
apply (simp add:Module.mHom_mem)+
apply (rule subsetI, simp, erule conjE, simp)
apply (frule_tac N = N in mzeromap_mHom [of "Zm R e"], assumption+)
apply (frule_tac N = N and g = "mzeromap (Zm R e) N" in
Module.mHom_compos [of "Zm R e" R M3 _ z1], assumption+)
apply (rule_tac N = N and f = x and
g = "compos M3 (mzeromap (Zm R e) N) z1" in Module.mHom_eq[of M3 _],
assumption+)
apply (rule ballI)
apply (subst compos_def, subst compose_def)
apply (subst mzeromap_def) apply (simp add:Module.mHom_mem)
apply (simp add:exact4_def)
apply (subgoal_tac "exact3 R M2 g M3 z1 (Zm R e)")
prefer 2 apply (simp add:exact3_def)
apply (frule right_exact_surjec [of M2 M3 g z1], assumption+)
apply (simp add:surjec_def surj_to_def, erule conjE)
apply (thin_tac "f ` carrier M1 = ker⇘M2,M3⇙ g",
thin_tac "g ∈ aHom M2 M3 ∧ ker⇘M3,Zm R e⇙ z1 = carrier M3",
rotate_tac -1, frule sym, thin_tac "g ` carrier M2 = carrier M3",
simp add:image_def, fold image_def)
apply (erule bexE, simp) apply (simp add:compos_def compose_def mzeromap_def)
apply (frule_tac f = "λxa∈carrier M2. x (g xa)" and g = "λx∈carrier M2. 𝟬⇘N⇙"
and x = xa in eq_fun_eq_val,
thin_tac "(λxa∈carrier M2. x (g xa)) = (λx∈carrier M2. 𝟬⇘N⇙)",
simp)
apply (rule equalityI)
apply (rule subsetI)
apply (simp add:image_def)
apply (simp add:ker_def)
apply (simp add:HOM_carrier)
apply (erule bexE)
apply (frule_tac L = N and f = xa in Module.sup_sharp_homTr[of M2 R M3 _ g],
assumption+, simp)
thm Module.sup_sharp_homTr[of M1 R M2 _ f]
apply (frule_tac L = N and f = "sup_sharp R M2 M3 N g xa" in
Module.sup_sharp_homTr[of M1 R M2 _ f], assumption+)
apply (simp add:HOM_def)
apply (frule_tac N = N in mzeromap_mHom[of M1], assumption)
apply (rule Module.mHom_eq, assumption+)
apply (rule ballI)
apply (subst sup_sharp_def)
apply simp
apply (subst compos_def, subst compose_def)
apply (subst sup_sharp_def, simp)
apply (subst compos_def, subst compose_def, simp)
apply (simp add:Module.mHom_mem)
apply (subgoal_tac "exact3 R M1 f M2 g M3")
prefer 2 apply (simp add:exact4_def exact3_def)
apply (frule_tac exact3_comp_0 [of M1 M2 M3 f g], assumption+)
apply (frule_tac f = "compos M1 g f" and g = "mzeromap M1 M3"
and x = m in eq_fun_eq_val,
thin_tac "compos M1 g f = mzeromap M1 M3",
simp add:compos_def compose_def mzeromap_def)
apply (simp add:Module.mHom_0)
apply (rule subsetI)
apply (simp add:ker_def)
apply (erule conjE)
apply (simp add:HOM_carrier)
apply (simp add:HOM_def)
apply (simp add:sup_sharp_def)
apply (simp add:image_def)
apply (frule_tac Z = N and x = x in exact_im_sub_ker1 [of M1 M2 M3 f g z1 e],
assumption+)
apply (rotate_tac -1) apply (frule sym)
apply (thin_tac "compos M2 (λz∈carrier M3. x
(SOME y. y ∈ carrier M2 ∧ g y = z)) g = x")
apply (frule_tac Z = N and x = x in exact_im_sub_ker [of M1 M2 M3 f g z1 e],
assumption+)
apply blast
done
lemma exact_HOM_exactTr:"⟦Ring (R::('r, 'm1) Ring_scheme); f ∈ mHom R M1 M2;
g ∈ mHom R M2 M3; z1 ∈ mHom R M3 (Zm R e); R module NV;
∀(N::('a, 'r, 'm) Module_scheme). R module N ⟶
exact4 R (HOM⇘R⇙ (Zm R e) N)(sup_sharp R M3 (Zm R e) N z1)
(HOM⇘R⇙ M3 N) (sup_sharp R M2 M3 N g) (HOM⇘R⇙ M2 N) (sup_sharp R M1 M2 N f)
(HOM⇘R⇙ M1 N); R module (L::('a, 'r, 'm) Module_scheme)⟧ ⟹
exact4 R (HOM⇘R⇙ (Zm R e) L) (sup_sharp R M3 (Zm R e) L z1)
(HOM⇘R⇙ M3 L) (sup_sharp R M2 M3 L g) (HOM⇘R⇙ M2 L) (sup_sharp R M1 M2 L f)
(HOM⇘R⇙ M1 L)"
apply simp
done
lemma lexact4_rexact4_HOM:"⟦Ring R; R module M1; R module M2; R module M3;
f ∈ mHom R M1 M2; g ∈ mHom R M2 M3; z ∈ mHom R (Zm R e) M1;
exact4 R (Zm R e) z M1 f M2 g M3 ⟧ ⟹
∀N. R module N ⟶ exact4 R (HOM⇘R⇙ N (Zm R e)) (sub_sharp R N (Zm R e) M1 z)
(HOM⇘R⇙ N M1) (sub_sharp R N M1 M2 f) (HOM⇘R⇙ N M2) (sub_sharp R N M2 M3 g)
(HOM⇘R⇙ N M3)"
apply (rule allI) apply (rule impI)
apply (subst exact4_def)
apply (rule conjI)
apply (rule equalityI)
apply (rule subsetI)
apply (simp add:image_def)
apply (simp add:HOM_def) apply (fold HOM_def)
apply (erule bexE)
apply (simp add:ker_def) apply (simp add:HOM_def)
apply (simp add:sub_sharp_def)
apply (cut_tac Ring.Zm_Module [of R e])
apply (simp add:Module.mHom_compos)
apply (frule_tac L = N and f = xa in
Module.mHom_compos[of "Zm R e" R _ M1 _ z], assumption+)
apply (frule_tac L = N and f = "compos N z xa" in
Module.mHom_compos[of M1 R _ M2 _ f], assumption+)
apply (frule_tac M = N in Ring.mzeromap_mHom [of R _ M2], assumption+)
apply (rule Module.mHom_eq, assumption+)
apply (rule ballI)
apply (simp add:mzeromap_def) apply (simp add:compos_def compose_def)
apply (frule_tac M = N and f = xa and m = m in Module.mHom_mem [of _ R
"Zm R e"], assumption+)
apply (simp add:exact4_def)
apply (frule conjunct1)
apply (thin_tac "z ` carrier (Zm R e) = ker⇘M1,M2⇙ f")
apply (erule conjE, thin_tac "f ` carrier M1 = ker⇘M2,M3⇙ g")
apply (frule Ring.mHom_func[of R z "(Zm R e)" M1], assumption)
apply (frule_tac a = "xa m" in mem_in_image
[of z "carrier (Zm R e)" "carrier M1"], assumption+, simp)
apply (simp add:ker_def, assumption)
apply (rule subsetI)
apply (simp add:ker_def) apply (simp add:HOM_def)
apply (erule conjE)
apply (frule_tac M = N in Ring.mHom_to_zero [of "R" _ "e"], assumption+)
apply simp apply (simp add:sub_sharp_def)
apply (simp add:exact4_def) apply (frule conjunct1)
apply (thin_tac "z ` carrier (Zm R e) = ker⇘M1,M2⇙ f ∧
f ` carrier M1 = ker⇘M2,M3⇙ g")
apply (simp add:Zm_def, fold Zm_def)
apply (frule_tac L = N and f = x in Ring.mzero_im_sub_ker [of R _ M1 M2 _ f], assumption+) apply (rotate_tac -2) apply (frule sym)
apply (thin_tac "{z e} = ker⇘M1,M2⇙ f", simp)
apply (subgoal_tac "mzeromap N (Zm R e) ∈ mHom R N (Zm R e)")
prefer 2 apply simp
apply (frule Ring.Zm_Module[of R e])
apply (frule_tac L = N and f = "mzeromap N (Zm R e)" in
Module.mHom_compos [of "Zm R e" R _ M1 _ z], assumption+)
apply (rule Module.mHom_eq, assumption+) apply (rule ballI)
apply (simp add:compos_def compose_def mzeromap_def)
apply (simp add:Zm_def, fold Zm_def)
apply (frule_tac M = N and f = x in Ring.mHom_func[of R _ _ M1], assumption+)
apply (frule_tac f = x and A = "carrier N" and B = "carrier M1" and a = m in
mem_in_image, assumption+)
apply (frule_tac c = "x m" and A = "x ` carrier N" and B = "{z e}" in
subsetD, assumption+) apply simp
apply (simp add:image_def ker_def HOM_def)
apply (rule equalityI)
apply (rule subsetI)
apply (simp, erule bexE)
apply (simp add:sub_sharp_def)
apply (frule_tac L = N and f = xa in Module.mHom_compos [of M1 R _ M2 _ "f"],
assumption+) apply simp
apply (frule_tac L = N and f = "compos N f xa" in Module.mHom_compos [of M2 R
_ M3 _ g], assumption+)
apply (rule Module.mHom_eq, assumption+)
apply (simp add:Ring.mzeromap_mHom)
apply (rule ballI)
apply (simp add:compos_def compose_def mzeromap_def)
apply (thin_tac " x = (λx∈carrier N. f (xa x))")
apply (thin_tac "(λx∈carrier N. f (xa x)) ∈ mHom R N M2")
apply (thin_tac "(λx∈carrier N. g (if x ∈ carrier N then f (xa x) else undefined)) ∈ mHom R N M3")
apply (frule_tac M = N and f = xa and m = m in Module.mHom_mem [of _ R M1],
assumption+)
apply (simp add:exact4_def) apply (frule conjunct2)
apply (thin_tac "z ` carrier (Zm R e) = ker⇘M1,M2⇙ f ∧
f ` carrier M1 = ker⇘M2,M3⇙ g")
apply (frule Ring.mHom_func[of R f M1 M2], assumption+,
frule_tac f = f and A = "carrier M1" and B = "carrier M2" and
a = "xa m" in mem_in_image, assumption+, simp)
apply (simp add:ker_def)
apply (rule subsetI)
apply simp apply (erule conjE)
apply (simp add:sub_sharp_def)
apply (frule_tac L = N and f = x in Ring.mzero_im_sub_ker [of R _ M2 M3 _ g],
assumption+)
apply (simp add:exact4_def)
apply (frule conjunct2) apply (rotate_tac -1) apply (frule sym)
apply (thin_tac "f ` carrier M1 = ker⇘M2,M3⇙ g")
apply simp apply (thin_tac "ker⇘M2,M3⇙ g = f ` carrier M1")
apply (frule Ring.left_exact_injec[of "R" "M1" "M2" "z" "e" "f"], assumption+)
apply (simp add:exact3_def exact4_def)
apply (frule_tac N = N and x = x in Ring.injec_mHom_image[of R _ M1 M2 _ f],
assumption+)
apply (erule conjE) apply (rotate_tac -1) apply (frule sym)
apply (thin_tac "compos N f (λn∈carrier N. SOME m. m ∈ carrier M1 ∧
x n = f m) = x")
apply blast
done
section "Tensor product"
definition
prod_carr :: "[('a, 'r, 'm) Module_scheme, ('b, 'r, 'm) Module_scheme]
⇒ ('a * 'b) set" (infixl "×⇩c" 100) where
"M ×⇩c N = carrier M × carrier N"
definition
bilinear_map :: "['a * 'b ⇒ 'c, ('r, 'm) Ring_scheme,
('a, 'r, 'm1) Module_scheme, ('b, 'r, 'm1) Module_scheme,
('c, 'r, 'm1) Module_scheme] ⇒ bool" where
"bilinear_map f R M1 M2 N ⟷ f ∈ M1 ×⇩c M2 → carrier N ∧
f ∈ extensional (M1 ×⇩c M2) ∧
(∀x1 ∈ carrier M1. ∀x2 ∈ carrier M1.
∀y∈carrier M2.(f (x1 ±⇘M1⇙ x2, y) = f (x1, y) ±⇘N⇙ (f (x2, y)))) ∧
(∀x∈carrier M1. ∀y1∈carrier M2.
∀y2∈carrier M2. f (x, y1 ±⇘M2⇙ y2) = f (x, y1) ±⇘N⇙ (f (x, y2))) ∧
(∀x∈carrier M1. ∀y∈carrier M2.
∀r∈carrier R. f (r ⋅⇩s⇘M1⇙ x, y) = r ⋅⇩s⇘N⇙ (f (x, y)) ∧
f (x, r ⋅⇩s⇘M2⇙ y) = r ⋅⇩s⇘N⇙ (f (x, y)))"
lemma (in Ring) prod_carr_mem:"⟦R module M; R module N; m ∈ carrier M;
n ∈ carrier N⟧ ⟹ (m, n) ∈ M ×⇩c N"
by (simp add:prod_carr_def)
lemma (in Ring) bilinear_func:"bilinear_map f R M N Z ⟹
f ∈ M ×⇩c N → carrier Z"
by (simp add:bilinear_map_def)
lemma (in Ring) bilinear_mem:"⟦R module M1; R module M2; R module N;
m1 ∈ carrier M1; m2 ∈ carrier M2; bilinear_map f R M1 M2 N⟧ ⟹
f (m1, m2) ∈ carrier N"
apply (simp add:bilinear_map_def) apply (erule conjE)+
apply (rule funcset_mem [of "f" "M1 ×⇩c M2" "carrier N"], assumption+)
apply (simp add:prod_carr_def)
done
lemma (in Ring) bilinear_l_add:"⟦R module M1; R module M2; R module N;
m11 ∈ carrier M1; m12 ∈ carrier M1; m2 ∈ carrier M2;
bilinear_map f R M1 M2 N⟧ ⟹
f (m11 ±⇘M1⇙ m12, m2) = f (m11, m2) ±⇘N⇙ (f (m12, m2))"
apply (simp add:bilinear_map_def)
done
lemma (in Ring) bilinear_l_add1:"⟦R module M1; R module M2; R module N;
m11 ∈ carrier M1; m12 ∈ carrier M1; m2 ∈ carrier M2;
bilinear_map f R M1 M2 N⟧ ⟹
f (m11 ±⇘M1⇙ m12, m2) ±⇘N⇙ -⇩a⇘N⇙ (f (m11, m2) ±⇘N⇙ (f (m12, m2))) = 𝟬⇘N⇙"
apply (frule Module.module_is_ag[of N],
frule Module.module_is_ag[of M1],
subst aGroup.ag_eq_diffzero[of N, THEN sym], assumption+,
frule_tac x = m11 and y = m12 in aGroup.ag_pOp_closed, assumption+)
apply (simp add:bilinear_mem,
rule aGroup.ag_pOp_closed, assumption+)
apply ((simp add:bilinear_mem)+, simp add:bilinear_l_add)
done
lemma (in Ring) bilinear_r_add:"⟦R module M1; R module M2; R module N;
m ∈ carrier M1; m21 ∈ carrier M2; m22 ∈ carrier M2;
bilinear_map f R M1 M2 N⟧ ⟹
f (m, m21 ±⇘M2⇙ m22) = f (m, m21) ±⇘N⇙ (f (m, m22))"
apply (simp add:bilinear_map_def)
done
lemma (in Ring) bilinear_r_add1:"⟦R module M1; R module M2; R module N;
m ∈ carrier M1; m21 ∈ carrier M2; m22 ∈ carrier M2;
bilinear_map f R M1 M2 N⟧ ⟹
f (m, m21 ±⇘M2⇙ m22) ±⇘N⇙ -⇩a⇘N⇙ (f (m, m21) ±⇘N⇙ (f (m, m22))) = 𝟬⇘N⇙"
apply (frule Module.module_is_ag[of N],
frule Module.module_is_ag[of M2],
subst aGroup.ag_eq_diffzero[of N, THEN sym], assumption+,
frule_tac x = m21 and y = m22 in aGroup.ag_pOp_closed, assumption+)
apply (simp add:bilinear_mem,
rule aGroup.ag_pOp_closed, assumption+)
apply ((simp add:bilinear_mem)+, simp add:bilinear_r_add)
done
lemma (in Ring) bilinear_l_lin:"⟦R module M1; R module M2; R module N;
m1 ∈ carrier M1; m2 ∈ carrier M2; r ∈ carrier R;
bilinear_map f R M1 M2 N⟧ ⟹ f (r ⋅⇩s⇘M1⇙ m1, m2) = r ⋅⇩s⇘N⇙ (f (m1, m2))"
by (simp add:bilinear_map_def)
lemma (in Ring) bilinear_l_lin1:"⟦R module M1; R module M2; R module N;
m1 ∈ carrier M1; m2 ∈ carrier M2; r ∈ carrier R;
bilinear_map f R M1 M2 N⟧ ⟹
f (r ⋅⇩s⇘M1⇙ m1, m2) ±⇘N⇙ -⇩a⇘N⇙ (r ⋅⇩s⇘N⇙ (f (m1, m2))) = 𝟬⇘N⇙"
apply (frule Module.module_is_ag[of N],
subst aGroup.ag_eq_diffzero[of N, THEN sym], assumption+,
frule_tac a = r and m = m1 in Module.sc_mem[of M1 R], assumption+,
simp add:bilinear_mem)
apply (rule Module.sc_mem, assumption+, simp add:bilinear_mem,
simp add:bilinear_l_lin)
done
lemma (in Ring) bilinear_r_lin:"⟦R module M1; R module M2; R module N;
m1 ∈ carrier M1; m2 ∈ carrier M2; r ∈ carrier R;
bilinear_map f R M1 M2 N⟧ ⟹ f (m1, r ⋅⇩s⇘M2⇙ m2) = r ⋅⇩s⇘N⇙ (f (m1, m2))"
apply (simp add:bilinear_map_def)
done
lemma (in Ring) bilinear_r_lin1:"⟦R module M1; R module M2; R module N;
m1 ∈ carrier M1; m2 ∈ carrier M2; r ∈ carrier R;
bilinear_map f R M1 M2 N⟧ ⟹
f (m1, r ⋅⇩s⇘M2⇙ m2) ±⇘N⇙ -⇩a⇘N⇙ (r ⋅⇩s⇘N⇙ (f (m1, m2))) = 𝟬⇘N⇙ "
apply (frule Module.module_is_ag[of N],
subst aGroup.ag_eq_diffzero[of N, THEN sym], assumption+,
frule_tac a = r and m = m2 in Module.sc_mem[of M2 R], assumption+,
simp add:bilinear_mem)
apply (rule Module.sc_mem, assumption+, simp add:bilinear_mem,
simp add:bilinear_r_lin)
done
lemma (in Ring) bilinear_l_0:"⟦R module M1; R module M2; R module N;
m2 ∈ carrier M2; bilinear_map f R M1 M2 N⟧ ⟹ f (𝟬⇘M1⇙, m2) = 𝟬⇘N⇙"
apply (frule Module.module_inc_zero [of M1 R])
apply (frule bilinear_l_add [of M1 M2 N "𝟬⇘M1⇙" "𝟬⇘M1⇙" "m2" "f"], assumption+)
apply (frule Module.module_is_ag [of M1 R], simp add:aGroup.ag_l_zero)
apply (frule bilinear_mem [of M1 M2 N "𝟬⇘M1⇙" m2 f], assumption+)
apply (frule Module.module_is_ag [of N R])
apply (frule aGroup.ag_eq_sol1 [of "N" "f (𝟬⇘M1⇙, m2)" "f (𝟬⇘M1⇙, m2)"
"f (𝟬⇘M1⇙, m2)"], assumption+)
apply (rule sym, assumption+)
apply (simp add:aGroup.ag_l_inv1)
done
lemma (in Ring) bilinear_r_0:"⟦R module M1; R module M2; R module N;
m1 ∈ carrier M1; bilinear_map f R M1 M2 N⟧ ⟹ f (m1, 𝟬⇘M2⇙) = 𝟬⇘N⇙"
apply (frule Module.module_inc_zero [of M2 R])
apply (frule bilinear_r_add [of M1 M2 N m1 "𝟬⇘M2⇙" "𝟬⇘M2⇙" "f"], assumption+)
apply (frule Module.module_is_ag [of M2 R])
apply (simp add:aGroup.ag_l_zero)
apply (frule bilinear_mem [of M1 M2 N m1 "𝟬⇘M2⇙" "f"], assumption+)
apply (frule Module.module_is_ag [of N R])
apply (frule aGroup.ag_eq_sol1 [of N "f (m1, 𝟬⇘M2⇙)" "f (m1, 𝟬⇘M2⇙)"
"f (m1, 𝟬⇘M2⇙)"], assumption+)
apply (rule sym, assumption+)
apply (simp add:aGroup.ag_l_inv1)
done
definition
universal_property :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, ('c, 'r, 'm1) Module_scheme,
'a * 'b ⇒'c] ⇒ bool" where
"universal_property (R::('r, 'm) Ring_scheme) (M::('a, 'r, 'm1) Module_scheme)
(N:: ('b, 'r, 'm1) Module_scheme) (MN::('c, 'r, 'm1) Module_scheme)
(f:: 'a * 'b ⇒ 'c) ⟷ (bilinear_map f R M N MN) ∧
(∀(Z :: ('c, 'r, 'm1) Module_scheme). ∀(g :: 'a * 'b ⇒ 'c). (R module Z) ∧
(bilinear_map g R M N Z) ⟶ ((∃!h. (h ∈ mHom R MN Z) ∧
(compose (M ×⇩c N) h f = g))))"
lemma tensor_prod_uniqueTr:"⟦Ring R; R module (M::('a, 'r, 'm1) Module_scheme);
R module (N:: ('b, 'r, 'm1) Module_scheme);
R module (MN:: ('c, 'r, 'm1) Module_scheme);
R module (MN1::('c, 'r, 'm1) Module_scheme);
universal_property R M N MN f; universal_property R M N MN1 g⟧ ⟹
∃!k. k ∈ mHom R MN1 MN ∧ compose (M ×⇩c N) k g = f"
apply (simp add: universal_property_def [of _ _ _ _ "f"])
apply (frule conjunct1) apply (fold universal_property_def)
apply (simp add:universal_property_def [of _ _ _ _ "g"])
done
lemma tensor_prod_unique:"⟦Ring (R:: ('r, 'm) Ring_scheme);
R module (M :: ('a, 'r, 'm1) Module_scheme);
R module (N:: ('b, 'r, 'm1) Module_scheme);
R module (MN:: ('c, 'r, 'm1) Module_scheme);
R module (MN1::('c, 'r, 'm1) Module_scheme);
universal_property R M N MN f; universal_property R M N MN1 g⟧ ⟹
MN ≅⇘R⇙ MN1"
apply (frule tensor_prod_uniqueTr[of R M N MN MN1 f g], assumption+,
erule ex1E,
thin_tac "∀y. y ∈ mHom R MN1 MN ∧ compose (M ×⇩c N) y g = f ⟶ y = k",
frule tensor_prod_uniqueTr [of R M N MN1 MN g f], assumption+)
apply (erule ex1E,
thin_tac "∀y. y ∈ mHom R MN MN1 ∧ compose (M ×⇩c N) y f = g ⟶ y = ka",
(erule conjE)+,
rename_tac k h,
frule_tac f = k in Ring.mHom_func[of R _ MN1 MN], assumption)
apply (subgoal_tac "f ∈ (M ×⇩c N) → (carrier MN)")
prefer 2 apply (simp add:universal_property_def bilinear_map_def)
apply (frule_tac f = h in Ring.mHom_func[of R _ MN MN1], assumption,
frule_tac g = h and h = k in compose_assoc [of "f" "M ×⇩c N" "carrier MN"], simp)
apply (subgoal_tac "g ∈ (M ×⇩c N) → (carrier MN1)")
prefer 2 apply (simp add:universal_property_def bilinear_map_def)
apply (frule_tac g = k and h = h in compose_assoc [of "g" "M ×⇩c N" "carrier MN1"], simp)
apply (subgoal_tac "compose (M ×⇩c N) (mId⇘MN⇙) f = f")
prefer 2
apply (frule Module.mId_mHom [of MN R],
frule_tac f = "mId⇘MN⇙" in Ring.mHom_func[of R _ MN MN], assumption,
frule composition [of f "M ×⇩c N" "carrier MN" "mId⇘MN⇙" "carrier MN"],
assumption+,
rule funcset_eq [of _ "M ×⇩c N"] )
apply (simp add:compose_def restrict_def extensional_def,
simp add:universal_property_def bilinear_map_def)
apply (simp add:compose_def mId_def funcset_mem del:Pi_I')
apply (rotate_tac -4)
apply (frule sym,
thin_tac "f = compose (M ×⇩c N) (compose (carrier MN) k h) f")
apply (subgoal_tac "(compose (carrier MN) k h) = mId⇘MN⇙")
apply (subgoal_tac "(compose (carrier MN1) h k) = (mId⇘MN1⇙)")
apply (simp add:misomorphic_def)
apply (frule_tac f = h and g = k in Module.mHom_mId_bijec [of MN R MN1],
assumption+)
apply blast
apply (subgoal_tac "compose (M ×⇩c N) (mId⇘MN1⇙) g = g")
prefer 2
apply (frule Module.mId_mHom [of MN1 R])
apply (subgoal_tac "mId⇘MN1⇙ ∈ carrier MN1 → carrier MN1")
prefer 2 apply (simp add:mHom_def aHom_def)
apply (frule composition [of "g" "M ×⇩c N" "carrier MN1" "mId⇘MN1⇙"
"carrier MN1"], assumption+,
rule funcset_eq [of _ "M ×⇩c N"],
simp add:compose_def restrict_def extensional_def,
simp add:universal_property_def bilinear_map_def)
apply (simp add:compose_def mId_def,
simp add:funcset_mem del:Pi_I',
frule sym,
thin_tac "g = compose (M ×⇩c N) (compose (carrier MN1) h k) g",
frule tensor_prod_uniqueTr [of R M N MN1 MN1 g g], assumption+)
apply (erule ex1E,
frule Module.mId_mHom [of MN1 R])
apply (subgoal_tac "mId⇘MN1⇙ = ka") prefer 2
apply (thin_tac "compose (M ×⇩c N) k g = f",
thin_tac "compose (M ×⇩c N) h f = g",
thin_tac "compose (M ×⇩c N) (compose (carrier MN) k h) f = f",
thin_tac "compose (carrier MN) k h = mId⇘MN⇙",
thin_tac "ka ∈ mHom R MN1 MN1 ∧ compose (M ×⇩c N) ka g = g",
thin_tac "compose (M ×⇩c N) (compose (carrier MN1) h k) g = g",
blast)
apply (subgoal_tac "compose (carrier MN1) h k = ka",
thin_tac "k ∈ mHom R MN1 MN",
thin_tac "compose (M ×⇩c N) k g = f",
thin_tac "compose (M ×⇩c N) h f = g",
thin_tac "k ∈ carrier MN1 → carrier MN",
thin_tac "f ∈ M ×⇩c N → carrier MN",
thin_tac "h ∈ carrier MN → carrier MN1",
thin_tac "compose (M ×⇩c N) (compose (carrier MN) k h) f = f",
thin_tac "compose (carrier MN) k h = mId⇘MN⇙",
thin_tac "compose (M ×⇩c N) (mId⇘MN1⇙ ) g = g",
thin_tac "compose (M ×⇩c N) (compose (carrier MN1) h k) g = g",
thin_tac "ka ∈ mHom R MN1 MN1 ∧ compose (M ×⇩c N) ka g = g",
thin_tac "∀y. y ∈ mHom R MN1 MN1 ∧
compose (M ×⇩c N) y g = g ⟶ y = ka")
apply simp
apply (thin_tac "mId⇘MN1⇙ ∈ mHom R MN1 MN1",
thin_tac "compose (M ×⇩c N) (mId⇘MN1⇙ ) g = g",
thin_tac "ka ∈ mHom R MN1 MN1 ∧ compose (M ×⇩c N) ka g = g",
thin_tac "mId⇘MN1⇙ = ka")
apply (subgoal_tac "(compose (carrier MN1) h k) ∈ mHom R MN1 MN1")
apply simp
apply (thin_tac "∀y. y ∈ mHom R MN1 MN1 ∧
compose (M ×⇩c N) y g = g ⟶ y = ka")
apply (frule_tac f = k and g = h in Module.mHom_compos[of MN R MN1 MN1],
assumption+)
apply (simp add:compos_def)
apply (frule Module.mId_mHom [of MN R])
apply (subgoal_tac "compose (M ×⇩c N) (mId⇘MN⇙) f = f")
prefer 2
apply (frule_tac f = "mId⇘MN⇙" in Ring.mHom_func[of R _ MN MN], assumption)
apply (frule composition [of "f" "M ×⇩c N" "carrier MN" "mId⇘MN⇙" "carrier MN"],
assumption+)
apply (frule tensor_prod_uniqueTr [of "R" "M" "N" "MN" "MN" "f" "f"],
assumption+)
apply (erule ex1E)
apply (subgoal_tac "mId⇘MN⇙ = ka") prefer 2
apply (thin_tac "compose (M ×⇩c N) k g = f",
thin_tac "compose (M ×⇩c N) h f = g",
thin_tac "ka ∈ mHom R MN MN ∧ compose (M ×⇩c N) ka f = f")
apply blast
apply (rotate_tac -1) apply (frule sym, thin_tac "mId⇘MN⇙ = ka")
apply (thin_tac "compose (M ×⇩c N) k g = f",
thin_tac "compose (M ×⇩c N) h f = g",
thin_tac "k ∈ carrier MN1 → carrier MN",
thin_tac "f ∈ M ×⇩c N → carrier MN",
thin_tac "h ∈ carrier MN → carrier MN1",
thin_tac "compose (M ×⇩c N) (mId⇘MN⇙) f = f")
apply (subgoal_tac "(compose (carrier MN) k h) ∈ mHom R MN MN")
apply simp
apply (frule_tac f = h and g = k in Module.mHom_compos[of MN1 R MN "MN"],
assumption+)
apply (metis compos_def)
done
chapter "Construction of an abelian group"
section "Free generated abelian group I, direct sum and direct product 2"
definition
bpp :: "['a ⇒ 'a ⇒ 'a, 'a, 'a] ⇒ 'a" where
"bpp f a b = f a b"
definition
ipp :: "['a ⇒ 'a, 'a] ⇒ 'a" ("(⇩_-/ _)" [64,65]64) where
"⇩i- a == i a"
definition
sop :: "['r ⇒ 'a ⇒ 'a, 'r, 'a] ⇒ 'a" where
"sop s r a = s r a"
abbreviation
BOP :: "['a, 'a ⇒ 'a ⇒ 'a, 'a] ⇒ 'a"
("(3_/ ⇩_+/ _)" [62,62,63]62) where
"a ⇩f+ b == bpp f a b"
abbreviation
SOP :: "['r, 'r ⇒ 'a ⇒ 'a, 'a] ⇒ 'a"
("(3_/ ⇩_⋅ _)" [68,68,69]68) where
"r ⇩s⋅ a == sop s r a"
definition
minus_set :: "['a ⇒ 'a, 'a set] ⇒ 'a set" where
"minus_set i A = {x. ∃y∈A. x = ⇩i- y}"
definition
pm_set :: "['a ⇒ 'a, 'a set] ⇒ 'a set" where
"pm_set i A = A ∪ (minus_set i A)"
definition
s_set :: "[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a set] ⇒ 'a set" where
"s_set R s A = {x. ∃r∈carrier R. ∃a∈A. x = r ⇩s⋅ a} ∪ A"
primrec add_set :: "['a ⇒ 'a ⇒ 'a, 'a set] ⇒ nat ⇒ 'a set"
where
add_set_0 : "add_set f A 0 = A"
| add_set_Suc: "add_set f A (Suc n) =
{x. ∃s∈ (add_set f A n). ∃t∈ A. x = s ⇩f+ t}"
definition
aug_pm_set :: "['a, 'a ⇒ 'a, 'a set] ⇒ 'a set" where
"aug_pm_set z i A = {z} ∪ A ∪ (minus_set i A)"
definition
addition_set :: "['a ⇒ 'a ⇒ 'a, 'a set] ⇒ 'a set" where
"addition_set f A = ⋃{add_set f A n | n. (0::nat)≤ n}"
definition
assoc_bpp :: "['a set, 'a ⇒ 'a ⇒ 'a] ⇒ bool" where
"assoc_bpp A f ⟷
(∀a∈(addition_set f A). ∀b∈(addition_set f A). ∀c∈(addition_set f A). (a ⇩f+ b) ⇩f+ c = a ⇩f+ (b ⇩f+ c))"
definition
commute_bpp :: "['a ⇒ 'a ⇒ 'a, 'a set] ⇒ bool" where
"commute_bpp f A ⟷ (∀x∈addition_set f A. ∀y∈addition_set f A. x ⇩f+ y = y ⇩f+ x)"
definition
zeroA :: "['a, 'a ⇒ 'a, 'a ⇒ 'a ⇒ 'a, 'a set] ⇒ 'a ⇒ bool" where
"zeroA z i f A z1 ⟷ (∀x ∈ addition_set f (aug_pm_set z i A). z1 ⇩f+ x = x)"
definition
inv_ipp :: "['a, 'a ⇒ 'a, 'a ⇒ 'a ⇒ 'a, 'a set] ⇒ bool" where
"inv_ipp z i f A ⟷ (∀a∈addition_set f (aug_pm_set z i A). zeroA z i f A ((⇩i- a) ⇩f+ a))"
definition
ipp_cond1 :: "['a set, 'a ⇒ 'a] ⇒ bool" where
"ipp_cond1 A i ⟷ (∀x∈A. ⇩i- (⇩i- x) = x)"
definition
ipp_cond2 :: "['a, 'a set, 'a ⇒ 'a, 'a ⇒ 'a ⇒ 'a] ⇒ bool" where
"ipp_cond2 z A i f == ∀x∈(addition_set f (aug_pm_set z i A)).
∀y∈ (addition_set f (aug_pm_set z i A)). ⇩i-(x ⇩f+ y) = ⇩i- y ⇩f+ (⇩i- x)"
definition
ipp_cond3 :: "['a, 'a ⇒ 'a] ⇒ bool" where
"ipp_cond3 z i ⟷ ⇩i- z = z"
lemma add_set_mono:"A ⊆ B ⟹ add_set f A n ⊆ add_set f B n"
apply (induct_tac n)
apply simp
apply (rule subsetI, simp)
apply (erule bexE)+
apply (frule_tac A = "add_set f A n" and B = "add_set f B n" and c = s in
subsetD, assumption+)
apply (frule_tac A = A and B = B and c = t in subsetD, assumption+)
apply blast
done
lemma addition_inc_add:"add_set f A n ⊆ addition_set f A"
apply (rule subsetI)
apply (simp add:addition_set_def)
apply blast
done
lemma addition_inc_add0:" A ⊆ addition_set f A"
apply (rule subsetI)
apply (insert addition_inc_add [of "f" "A" "0"])
apply simp
apply (simp add:subsetD)
done
lemma addition_set_mono:"A ⊆ B ⟹ addition_set f A ⊆ addition_set f B"
apply (rule subsetI)
apply (simp add:addition_set_def [of "f" "A"])
apply (erule exE, erule conjE, erule exE, simp)
apply (frule_tac n = n in add_set_mono [of "A" "B" "f"],
frule_tac A = "add_set f A n" and B = "add_set f B n" and c = x in
subsetD, assumption+)
apply (cut_tac n = n in addition_inc_add[of f B])
apply (simp add:subsetD)
done
lemma a_in_aug_pm_set:"a ∈ A ⟹ a ∈ aug_pm_set z i A"
apply (simp add:aug_pm_set_def)
done
lemma A_sub_aug_pm_set:"A ⊆ aug_pm_set z i A"
by (rule subsetI, simp add:aug_pm_set_def)
lemma addition_sub_aug_pm_addition:"
addition_set f A ⊆ addition_set f (aug_pm_set z i A)"
apply (cut_tac A_sub_aug_pm_set[of A z i])
apply (simp add:addition_set_mono)
done
lemma assoc_bpp_restrict:"⟦ A ⊆ B; assoc_bpp B f⟧ ⟹ assoc_bpp A f"
apply (simp add:assoc_bpp_def)
apply (rule ballI)+
apply (frule addition_set_mono[of A B f])
apply blast
done
lemma addition_assoc:"⟦assoc_bpp A f; x ∈ addition_set f A;
y ∈ addition_set f A; z ∈ addition_set f A⟧ ⟹
(x ⇩f+ y) ⇩f+ z = x ⇩f+ (y ⇩f+ z)"
apply (simp add:assoc_bpp_def)
done
lemma bpp_closedTr:"assoc_bpp A f ⟹
∀x y. x ∈ add_set f A n ∧ y ∈ add_set f A m ⟶
x ⇩f+ y ∈ add_set f A (n + m + Suc 0)"
apply (induct_tac m, simp, blast)
apply ((rule allI)+, rule impI, erule conjE)
apply (simp, (erule bexE)+)
apply (cut_tac addition_inc_add[of f A n],
cut_tac n = na in addition_inc_add[of f A],
cut_tac addition_inc_add0[of A f])
apply (drule_tac x = x in spec,
drule_tac a = s in forall_spec, simp)
apply ((erule bexE)+, simp)
apply (cut_tac n = "n + na" in addition_inc_add[of f A],
frule_tac c = sa and A = "add_set f A (n + na)" in subsetD[of _
"addition_set f A"], assumption+,
frule_tac c = x in subsetD[of "add_set f A n" "addition_set f A"],
assumption+,
frule_tac c = s and A = "add_set f A na" in
subsetD[of _ "addition_set f A"], assumption+,
frule_tac c = t in subsetD[of A "addition_set f A"], assumption+,
frule_tac c = ta in subsetD[of A "addition_set f A"], assumption+)
apply (frule_tac x1 = x and y1 = s and z1 = t in addition_assoc[THEN sym,
of A f], assumption+) apply simp apply blast
done
lemma bpp_closed1:"⟦assoc_bpp A f; x ∈ add_set f A n; y ∈ add_set f A m⟧ ⟹
x ⇩f+ y ∈ add_set f A (n + m + Suc 0)"
apply (insert bpp_closedTr[of "A" "f"])
apply blast
done
lemma bpp_closed:"⟦assoc_bpp A f; x ∈ addition_set f A; y ∈ addition_set f A⟧
⟹ x ⇩f+ y ∈ addition_set f A"
apply (simp add:addition_set_def)
apply ((erule exE)+, (erule conjE)+, (erule exE)+, simp)
apply (frule_tac x = x and n = n and y = y and m = na in bpp_closed1,
assumption+)
apply blast
done
lemma aug_addition_inc_z:" z ∈ addition_set f (aug_pm_set z i A)"
apply (subgoal_tac "z ∈ aug_pm_set z i A")
apply (subgoal_tac "aug_pm_set z i A ⊆ addition_set f (aug_pm_set z i A)")
apply (simp add:subsetD)
apply (simp add:addition_inc_add0)
apply (simp add:aug_pm_set_def)
done
lemma aug_bpp_closed:"⟦assoc_bpp (aug_pm_set z i A) f;
x ∈ addition_set f (aug_pm_set z i A);
y ∈ addition_set f (aug_pm_set z i A)⟧ ⟹
x ⇩f+ y ∈ addition_set f (aug_pm_set z i A)"
apply (simp add:bpp_closed [of "aug_pm_set z i A" "f"])
done
lemma aug_commute:"⟦commute_bpp f (aug_pm_set z i A);
x ∈ addition_set f (aug_pm_set z i A);
y ∈ addition_set f (aug_pm_set z i A)⟧ ⟹ x ⇩f+ y = y ⇩f+ x"
apply (simp add: commute_bpp_def)
done
lemma addition_set_inc_z:"z ∈ addition_set f (aug_pm_set z i A)"
apply (simp add:addition_set_def)
apply (subgoal_tac "z ∈ add_set f (aug_pm_set z i A) 0")
apply blast
apply (simp add:aug_pm_set_def)
done
lemma aug_ipp_closed0:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; x ∈ add_set f (aug_pm_set z i A) 0⟧ ⟹
⇩i- x ∈ add_set f (aug_pm_set z i A) 0"
apply (simp add:aug_pm_set_def)
apply (case_tac "x ∈ A", simp add:minus_set_def, blast)
apply simp
apply (simp add:minus_set_def)
apply (case_tac "x = z", simp, simp add:ipp_cond3_def)
apply simp
apply (erule bexE)
apply (simp add:ipp_cond1_def)
done
lemma aug_ipp_closedTr:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i⟧ ⟹
∀x. x ∈ add_set f (aug_pm_set z i A) n ⟶
⇩i- x ∈ add_set f (aug_pm_set z i A) n"
apply (induct_tac n, rule allI, rule impI)
apply (simp add:aug_pm_set_def)
apply (case_tac "x = z", simp add:ipp_cond3_def)
apply simp
apply (case_tac "x ∈ A", simp add:minus_set_def, blast)
apply simp
apply (simp add:minus_set_def)
apply (erule bexE, simp add:ipp_cond1_def)
apply (rule allI, rule impI, simp)
apply (erule bexE)+
apply (drule_tac a = s in forall_spec, assumption)
apply (cut_tac ipp_cond2_def[of z A i f], simp)
apply (cut_tac n = n in addition_inc_add[of f "aug_pm_set z i A"],
frule_tac c = s and A = "add_set f (aug_pm_set z i A) n" in
subsetD[of _ "addition_set f (aug_pm_set z i A)"], assumption+,
cut_tac addition_inc_add0[of "aug_pm_set z i A" f],
frule_tac c = t in subsetD[of "aug_pm_set z i A"
"addition_set f (aug_pm_set z i A)"], assumption+)
apply (drule_tac x = s in bspec, assumption,
drule_tac x = t in bspec, assumption)
apply (frule_tac x = t in aug_ipp_closed0[of f z i A], assumption+,
simp, assumption+, simp, simp,
frule_tac c = "⇩i- t" in subsetD[of "aug_pm_set z i A"
"addition_set f (aug_pm_set z i A)"], assumption+)
apply (frule_tac c = "⇩i- s" and A = "add_set f (aug_pm_set z i A) n" in
subsetD[of _ "addition_set f (aug_pm_set z i A)"], assumption+,
frule_tac x = "⇩i- t" and y = "⇩i- s" in aug_commute[of f z i A],
assumption+, simp)
apply blast
done
lemma aug_ipp_closedTr2:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; x ∈ add_set f (aug_pm_set z i A) n⟧ ⟹
⇩i- x ∈ add_set f (aug_pm_set z i A) n"
apply (simp add:aug_ipp_closedTr)
done
lemma aug_ipp_closed:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; x ∈ addition_set f (aug_pm_set z i A)⟧ ⟹
⇩i- x ∈ addition_set f (aug_pm_set z i A)"
apply (simp add:addition_set_def, erule exE, erule conjE, erule exE, simp)
apply (frule_tac n = n in aug_ipp_closedTr2[of f z i A x], assumption+)
apply blast
done
lemma aug_zero_unique:"⟦commute_bpp f (aug_pm_set z i A);
z1 ∈ addition_set f (aug_pm_set z i A); zeroA z i f A z;
zeroA z i f A z1⟧ ⟹ z = z1"
apply (simp add:zeroA_def[of "z" _ _ _ "z"])
apply (drule_tac x = z1 in bspec, assumption)
apply (cut_tac addition_set_inc_z [of z f i A])
apply (frule aug_commute [of f z i A z z1], assumption+)
apply simp
apply (simp add:zeroA_def[of _ _ _ _ "z1"])
done
lemma inv_aug_addition:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; inv_ipp z i f A; commute_bpp f (aug_pm_set z i A);
zeroA z i f A z⟧ ⟹
∀a∈addition_set f (aug_pm_set z i A). (⇩i-a) ⇩f+ a = z"
apply (simp add:inv_ipp_def)
apply (rule ballI)
apply (drule_tac x = a in bspec, assumption)
apply (frule_tac ?z1.0 = "(⇩i- a ⇩f+ a)" in aug_zero_unique [of f z i A])
apply (frule_tac x = a in aug_ipp_closed [of f z i A], assumption+)
apply (rule_tac x = "⇩i- a" and y = a in aug_bpp_closed [of z i A f],
assumption+)
apply (simp add:zeroA_def)
done
definition
fag_gen_by :: "['a set, 'a ⇒ 'a ⇒ 'a, 'a ⇒ 'a, 'a] ⇒ 'a aGroup" where
"fag_gen_by A f i z = ⦇carrier = addition_set f (aug_pm_set z i A),
pop = λx∈(addition_set f (aug_pm_set z i A)).
λy∈(addition_set f (aug_pm_set z i A)). x ⇩f+ y,
mop = λx∈(addition_set f (aug_pm_set z i A)). ⇩i- x, zero = z⦈"
lemma fag_gen_carrier:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; inv_ipp z i f A; commute_bpp f (aug_pm_set z i A);
zeroA z i f A z⟧ ⟹
carrier (fag_gen_by A f i z) = addition_set f (aug_pm_set z i A)"
by (simp add:fag_gen_by_def)
lemma addition_set_sub_fag_gen_carrier:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; inv_ipp z i f A; commute_bpp f (aug_pm_set z i A);
zeroA z i f A z⟧ ⟹ addition_set f A ⊆ carrier (fag_gen_by A f i z)"
apply (simp add:fag_gen_carrier)
apply (simp add:addition_sub_aug_pm_addition)
done
lemma fag_aGroup:"⟦commute_bpp f (aug_pm_set z i A);
assoc_bpp (aug_pm_set z i A) f; ipp_cond1 A i; ipp_cond2 z A i f;
ipp_cond3 z i; inv_ipp z i f A; commute_bpp f (aug_pm_set z i A);
zeroA z i f A z⟧ ⟹ aGroup (fag_gen_by A f i z)"
apply (rule aGroup.intro)
apply (simp add:fag_gen_by_def aug_bpp_closed)
apply (simp add:fag_gen_by_def)
apply (simp add:aug_bpp_closed)
apply (simp add:assoc_bpp_def)
apply (simp add:fag_gen_by_def)
apply (simp add:aug_commute)
apply (simp add:fag_gen_by_def aug_ipp_closed)
apply (simp add:fag_gen_by_def inv_aug_addition aug_ipp_closed)
apply (simp add:fag_gen_by_def addition_set_inc_z)
apply (simp add:fag_gen_by_def addition_set_inc_z zeroA_def)
done
section "Abelian group generated by a singleton (constructive)"
definition
fag_single :: "['a, 'a ⇒ 'a ⇒ 'a, 'a ⇒ 'a, 'a] ⇒ 'a aGroup" where
"fag_single a f i z = fag_gen_by {a} f i z"
lemma aug_pm_aug_pm_minus:"ipp_cond1 {a} i ⟹
aug_pm_set z i {a} = aug_pm_set z i {⇩i- a}"
apply (simp add:aug_pm_set_def minus_set_def)
apply (simp add:ipp_cond1_def)
apply (rule equalityI, rule subsetI, simp, blast)
apply (rule subsetI, simp, blast)
done
lemma ipp_cond1_minus:"ipp_cond1 {a} i ⟹ ipp_cond1 {⇩i- a} i"
by (simp add:ipp_cond1_def)
lemma ipp_cond2_minus:"⟦ipp_cond1 {a} i; ipp_cond2 z {a} i f⟧ ⟹
ipp_cond2 z {⇩i- a} i f"
by (simp add:ipp_cond2_def, simp add:aug_pm_aug_pm_minus)
lemma zeroA_minus:"⟦ipp_cond1 {a} i; zeroA z i f {a} z1⟧ ⟹
zeroA z i f {⇩i- a} z1"
apply (simp add:zeroA_def)
apply (simp add:aug_pm_aug_pm_minus)
done
lemma inv_ipp_minus:"⟦ipp_cond1 {a} i; inv_ipp z i f {a}⟧ ⟹
inv_ipp z i f {⇩i- a}"
apply (simp add:inv_ipp_def [of _ _ _ "{a}"])
apply (simp add:aug_pm_aug_pm_minus)
apply (simp add:inv_ipp_def)
apply (simp add:zeroA_minus)
done
lemma fag_single_additionTr1:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹
∀s. s∈ add_set f {a} (Suc n) ⟶ s ⇩f+ ⇩i- a ∈ add_set f {a} n"
apply (cut_tac addition_inc_add0[of "aug_pm_set z i {a}" f])
apply (cut_tac a_in_aug_pm_set[of a "{a}" z i], simp)
apply (frule subsetD[of "aug_pm_set z i {a}"
"addition_set f (aug_pm_set z i {a})" "a"], assumption+)
apply (induct_tac n)
apply (rule allI, rule impI, simp)
apply (frule aug_ipp_closed [of f z i "{a}" a], assumption+)
apply (simp add:addition_assoc)
apply (frule aug_commute [of f z i "{a}" a "⇩i- a"], assumption+)
apply simp apply (thin_tac "a ⇩f+ ⇩i- a = ⇩i- a ⇩f+ a")
apply (simp add:inv_aug_addition)
apply (cut_tac addition_set_inc_z[of z f i "{a}"])
apply (frule aug_commute [of "f" "z" "i" "{a}" "a" "z"], assumption+)
apply simp apply (thin_tac "a ⇩f+ z = z ⇩f+ a")
apply (simp add:zeroA_def)
apply (rule allI) apply (rule impI)
apply (erule bexE)
apply (thin_tac "∀s. (∃sa∈add_set f {a} n. s = sa ⇩f+ a) ⟶
s ⇩f+ ⇩i- a ∈ add_set f {a} n")
apply (simp del:add_set_Suc)
apply (frule fag_aGroup[of f z i "{a}"], assumption+)
apply (cut_tac n = "Suc n" in addition_inc_add[of f "{a}"],
cut_tac addition_sub_aug_pm_addition[of f "{a}" z i],
frule_tac c = sa and A = "add_set f {a} (Suc n)" in subsetD[of _
"addition_set f {a}"], assumption+,
frule_tac c = sa in subsetD[of "addition_set f {a}"
"addition_set f (aug_pm_set z i {a})"], assumption+)
apply (cut_tac x = sa and y = a and z = " ⇩i- a" in
aGroup.ag_pOp_assoc[of "fag_gen_by {a} f i z"], assumption,
simp del:add_set_Suc add:fag_gen_carrier)
apply (simp add:fag_gen_carrier,
cut_tac addition_inc_add0[of "aug_pm_set z i {a}"],
simp add:subsetD)
apply (subst fag_gen_carrier, assumption+)
apply (rule aug_ipp_closed[of f z i "{a}" a], assumption+)
apply (simp add:subsetD)
apply (simp del:add_set_Suc add:fag_gen_by_def, fold fag_gen_by_def,
frule aug_ipp_closed[of f z i "{a}" a], assumption+,
simp del:add_set_Suc add:aug_bpp_closed,
simp del:add_set_Suc add:aug_commute[of f z i "{a}" a "⇩i- a"],
thin_tac "sa ⇩f+ a ⇩f+ ⇩i- a = sa ⇩f+ (⇩i- a ⇩f+ a)",
simp del:add_set_Suc add:inv_aug_addition,
cut_tac addition_set_inc_z[of z f i "{a}"])
apply (subst aug_commute[of f z i "{a}" _ z], assumption+)
apply (simp del:add_set_Suc add:zeroA_def[of z i f "{a}" z])
apply simp
done
lemma fag_single_additionTr2:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; s ∈ add_set f {a} 0⟧ ⟹ s ⇩f+ ⇩i- a = z"
apply simp
apply (cut_tac a_in_aug_pm_set[of a "{a}" z i],
cut_tac addition_inc_add0[of "aug_pm_set z i {a}" f],
frule subsetD[of "aug_pm_set z i {a}"
"addition_set f (aug_pm_set z i {a})" a], assumption+)
apply (frule aug_ipp_closed [of "f" "z" "i" "{a}" "a"], assumption+)
apply (frule aug_commute [of "f" "z" "i" "{a}" "a" "⇩i- a"], assumption+)
apply simp apply (thin_tac "a ⇩f+ ⇩i- a = ⇩i- a ⇩f+ a")
apply (simp add:inv_aug_addition)
apply simp
done
lemma ipp_conditions:"⟦assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i;
ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a};
commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z⟧ ⟹
assoc_bpp (aug_pm_set z i { ⇩i- a}) f ∧ ipp_cond1 { ⇩i- a} i ∧
ipp_cond2 z { ⇩i- a} i f ∧ inv_ipp z i f { ⇩i- a} ∧
commute_bpp f (aug_pm_set z i { ⇩i- a}) ∧ zeroA z i f { ⇩i- a} z"
apply (simp add:aug_pm_aug_pm_minus[THEN sym])
apply (rule conjI)
apply (subst ipp_cond1_def, rule ballI, simp, simp add:ipp_cond1_def)
apply (rule conjI)
apply (subst ipp_cond2_def,
simp add:aug_pm_aug_pm_minus[THEN sym] ipp_cond2_def)
apply (simp add:zeroA_def inv_ipp_def,
simp add:aug_pm_aug_pm_minus)
done
lemma fag_single_additionTr3:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; s∈ add_set f {⇩i- a} n⟧ ⟹
s ⇩f+ ⇩i- a ∈ add_set f {⇩i- a} (Suc n)"
apply simp apply blast
done
lemma fag_single_elemTr:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹
∀x. x ∈ add_set f (aug_pm_set z i {a}) n ⟶
(∃n1. x ∈ add_set f {a} n1) ∨ (∃m1. x ∈ add_set f {⇩i- a} m1) ∨ x = z"
apply (cut_tac a_in_aug_pm_set[of a "{a}" z i],
cut_tac addition_inc_add0[of "aug_pm_set z i {a}" f],
frule subsetD[of "aug_pm_set z i {a}"
"addition_set f (aug_pm_set z i {a})" a], assumption+)
apply (cut_tac addition_set_inc_z[of z f i "{a}"])
prefer 2 apply simp
apply (cut_tac assoc_bpp_restrict[of "{a}" "aug_pm_set z i {a}" f])
apply (induct_tac n)
apply (rule allI, rule impI, simp add:aug_pm_set_def)
apply (erule disjE, simp)
apply (subgoal_tac "a ∈ add_set f {a} 0", blast)
apply simp
apply (erule disjE, simp)
apply (simp add:minus_set_def)
apply (subgoal_tac " ⇩i- a ∈ add_set f {⇩i- a} 0", blast, simp)
apply (rule allI, rule impI)
apply (simp, (erule bexE)+)
apply (drule_tac a = s in forall_spec, assumption)
apply (subgoal_tac "t = a ∨ t = z ∨ t = ⇩i- a")
prefer 2 apply (simp add:aug_pm_set_def minus_set_def, blast)
apply (erule disjE, erule exE)
apply (case_tac "n1 = 0", simp)
apply (case_tac "t = a", simp)
apply (cut_tac A_sub_aug_pm_set[of "{a}" z i])
apply (cut_tac addition_inc_add0[of "{a}"f])
apply (frule bpp_closed1[of "{a}" f a 0 a 0],
simp, simp, blast)
apply simp
apply (case_tac "t = z", simp)
apply (simp add:aug_commute[of f z i "{a}" a z])
apply (simp add:zeroA_def,
subgoal_tac "a ∈ add_set f {a} 0", blast, simp)
apply simp
apply (simp add:fag_single_additionTr2[of f z i a a])
apply simp
apply (case_tac "t = a", simp,
frule_tac x = s and n = n1 and y = a in bpp_closed1[of "{a}" f
_ _ _ 0], assumption, simp, blast)
apply (case_tac "t = z", simp)
apply (cut_tac n = n in addition_inc_add[of f "aug_pm_set z i {a}"],
frule_tac c = s and A = "add_set f (aug_pm_set z i {a}) n" in
subsetD[of _ "addition_set f (aug_pm_set z i {a})"], assumption+)
apply (simp add:aug_commute[of f z i "{a}" _ z])
apply (simp add:zeroA_def, blast)
apply simp
apply (frule_tac n = "n1 - Suc 0" in fag_single_additionTr1[of f z i a],
assumption+, simp)
apply (drule_tac a = s in forall_spec, assumption, blast)
apply (rotate_tac -1, erule disjE)
apply (erule exE)
apply (frule ipp_conditions[of z i a f], assumption+, (erule conjE)+)
apply (case_tac "m1 = 0", simp)
apply (case_tac "t = a", simp)
apply (cut_tac aug_pm_aug_pm_minus[of a i z])
apply (cut_tac addition_inc_add0[of "{⇩i- a}" f])
apply (cut_tac A = "{⇩i- a}" and B = "aug_pm_set z i {a}" in
addition_set_mono[of _ _ f], simp add:aug_pm_set_def)
apply (frule subsetD[of "{⇩i- a}" "addition_set f {⇩i- a}" "⇩i- a"], simp,
frule subsetD[of "addition_set f {⇩i- a}"
"addition_set f (aug_pm_set z i {a})"], assumption+)
apply (frule inv_aug_addition[of f z i "{a}"], assumption+)
apply (drule_tac x = a in bspec, assumption,
simp, assumption+)
apply (case_tac "t = z", simp,
cut_tac n = n in addition_inc_add[of f "aug_pm_set z i {a}"],
frule_tac c = "⇩i- a" and A = "add_set f (aug_pm_set z i {a}) n" in
subsetD[of _ "addition_set f (aug_pm_set z i {a})"], assumption+)
apply (simp add:aug_commute)
apply (simp add:zeroA_def)
apply (subgoal_tac " ⇩i- a ∈ add_set f {⇩i- a} 0", blast, simp)
apply simp
apply (cut_tac assoc_bpp_restrict[of "{⇩i- a}" "aug_pm_set z i {a}"],
frule bpp_closed1[of "{⇩i- a}" f "⇩i- a" 0 "⇩i- a" 0], simp, simp, blast)
apply (simp add:aug_pm_set_def, assumption+)
apply simp
apply (case_tac "t = a", simp)
apply (frule_tac n = "m1 - Suc 0" in fag_single_additionTr1[of f z i "⇩i- a"],
assumption+, simp)
apply (thin_tac "s ∈ add_set f (aug_pm_set z i {a}) n",
drule_tac a = s in forall_spec, assumption,
simp add:ipp_cond1_def, blast)
apply (case_tac "t = z", simp,
cut_tac n = n in addition_inc_add[of f "aug_pm_set z i {a}"],
frule_tac c = s and A = "add_set f (aug_pm_set z i {a}) n" in
subsetD[of _ "addition_set f (aug_pm_set z i {a})"], assumption+)
apply (frule_tac x = s and y = z in aug_commute[of f z i "{a}"], assumption+,
simp)
apply (simp add:zeroA_def, blast)
apply simp
apply (cut_tac assoc_bpp_restrict[of "{⇩i- a}" "aug_pm_set z i {⇩i- a}" f],
frule_tac x = s and n = m1 and y = "⇩i- a" in
bpp_closed1[of "{⇩i- a}" f _ _ _ 0], assumption, simp, blast,
simp add:aug_pm_set_def, assumption)
apply simp
apply (case_tac "t = a", simp)
apply (simp add:zeroA_def)
apply (subgoal_tac "a ∈ add_set f {a} 0", blast, simp)
apply (case_tac "t = z", simp, simp add:zeroA_def)
apply simp
apply (frule subsetD[of "aug_pm_set z i {a}"
"addition_set f (aug_pm_set z i {a})" " ⇩i- a"], assumption+,
simp add:zeroA_def,
subgoal_tac " ⇩i- a ∈ add_set f {⇩i- a} 0", blast, simp)
apply (simp add:aug_pm_set_def)
apply assumption
done
lemma fag_single_elem:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; x ∈ addition_set f (aug_pm_set z i {a})⟧ ⟹
(∃n1. x ∈ add_set f {a} n1) ∨ (∃m1. x ∈ add_set f {⇩i- a} m1) ∨ x = z"
apply (simp add:addition_set_def)
apply (erule exE, erule conjE, erule exE, simp)
apply (simp add:fag_single_elemTr)
done
lemma add_set_single1Tr:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹
∀x y. x ∈ add_set f {a} n ∧ y ∈ add_set f {a} n ⟶ x = y"
apply (induct_tac n)
apply ((rule allI)+, rule impI, erule conjE)
apply simp
apply ((rule allI)+, rule impI, erule conjE, simp, (erule bexE)+)
apply (drule_tac x = s in spec,
drule_tac a = sa in forall_spec, simp)
apply simp
done
lemma add_set_single_nonempty1:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹ ∃x. x∈add_set f {a} n"
apply (induct_tac n)
apply simp
apply (erule exE)
apply simp apply blast
done
lemma add_set_single_nonempty2:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹ ∃x. x∈add_set f {⇩i- a} n"
apply (simp add:aug_pm_aug_pm_minus,
frule ipp_cond1_minus[of "a" "i"],
frule ipp_cond2_minus[of "a" "i" "z" "f"], assumption+,
frule inv_ipp_minus[of "a" "i" "z" "f"], assumption+,
frule zeroA_minus[of "a" "i" "z" "f" "z"], assumption+)
apply (simp add:add_set_single_nonempty1 [of "f" "z" "i" "⇩i- a" "n"])
done
lemma add_set_single1:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; x ∈ add_set f {a} n; y ∈ add_set f {a} n⟧ ⟹ x = y"
apply (frule add_set_single1Tr [of f z i a n], assumption+)
apply blast
done
lemma add_set_single2:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; x ∈ add_set f {⇩i- a} n; y ∈ add_set f {⇩i- a} n⟧ ⟹
x = y"
apply (simp add:aug_pm_aug_pm_minus)
apply (frule ipp_cond1_minus[of "a" "i"])
apply (frule ipp_cond2_minus[of "a" "i" "z" "f"], assumption+)
apply (frule inv_ipp_minus[of "a" "i" "z" "f"], assumption+)
apply (frule zeroA_minus[of "a" "i" "z" "f" "z"], assumption+)
apply (rule add_set_single1 [of "f" "z" "i" "⇩i- a" _ "n" _], assumption+)
done
lemma fag_single_additionTr4:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z ⟧ ⟹
∀s t. s ∈ add_set f {a} n ∧ t ∈ add_set f {⇩i- a} n⟶ s ⇩f+ t = z"
apply (cut_tac a_in_aug_pm_set[of a "{a}" z i], simp,
cut_tac addition_inc_add0[of "aug_pm_set z i {a}" f],
frule subsetD[of "aug_pm_set z i {a}"
"addition_set f (aug_pm_set z i {a})" a], assumption+)
apply (induct_tac n)
apply simp
apply (frule inv_aug_addition [of "f" "z" "i" "{a}"], assumption+)
apply (frule aug_ipp_closed [of "f" "z" "i" "{a}" "a"], assumption+)
apply (frule fag_single_additionTr2 [of "f" "z" "i" "a" "a"], assumption+)
apply (simp, assumption)
apply ((rule allI)+, rule impI, erule conjE)
apply simp
apply (erule bexE)+
apply (frule aug_ipp_closed [of "f" "z" "i" "{a}" "a"], assumption+)
apply simp
apply (drule_tac x = sa in spec,
drule_tac a = sb in forall_spec, simp)
apply (cut_tac n = n in addition_inc_add[of f "{a}"],
cut_tac addition_set_mono[of "{a}" "aug_pm_set z i {a}" f],
frule_tac c = sa and A = "add_set f {a} n" in subsetD[of _
"addition_set f {a}"], assumption+,
frule_tac c = sa in subsetD[of "addition_set f {a}"
"addition_set f (aug_pm_set z i {a})"], assumption+)
apply (cut_tac n = n in addition_inc_add[of f "{⇩i- a}"],
cut_tac addition_set_mono[of "{⇩i- a}" "aug_pm_set z i {⇩i- a}" f],
frule_tac c = sb and A = "add_set f {⇩i- a} n" in subsetD[of _
"addition_set f {⇩i- a}"], assumption+,
frule_tac c = sb in subsetD[of "addition_set f {⇩i- a}"
"addition_set f (aug_pm_set z i {⇩i- a})"], assumption+)
apply (simp add:aug_pm_aug_pm_minus[THEN sym])
apply (frule_tac x = sb in aug_bpp_closed [of z i "{a}" f _ " ⇩i- a"],
assumption+)
apply (frule_tac x = sa and y = a and z = "sb ⇩f+ ⇩i- a" in
addition_assoc [of "aug_pm_set z i {a}" "f"], assumption+)
apply simp apply (thin_tac "sa ⇩f+ a ⇩f+ (sb ⇩f+ ⇩i- a) = sa ⇩f+ (a ⇩f+ (sb ⇩f+ ⇩i- a))")
apply (frule_tac x1 = a and y1 = sb and z1 = "⇩i- a" in
addition_assoc [THEN sym, of "aug_pm_set z i {a}" "f"], assumption+)
apply simp
apply (frule_tac y = sb in aug_commute [of "f" "z" "i" "{a}" "a"],
assumption+, simp)
apply (frule_tac x = sb and y = a and z = "⇩i- a" in
addition_assoc [of "aug_pm_set z i {a}" "f"], assumption+)
apply simp apply (thin_tac "a ⇩f+ (sb ⇩f+ ⇩i- a) = sb ⇩f+ (a ⇩f+ ⇩i- a)")
apply (thin_tac "a ⇩f+ sb = sb ⇩f+ a",
thin_tac "sb ⇩f+ a ⇩f+ ⇩i- a = sb ⇩f+ (a ⇩f+ ⇩i- a)",
thin_tac "sb ⇩f+ ⇩i- a ∈ addition_set f (aug_pm_set z i {a})")
apply (frule_tac y = " ⇩i- a" in aug_commute [of "f" "z" "i" "{a}" "a"],
assumption+, simp)
apply (frule_tac x = sa and y = a and z = "sb ⇩f+ ⇩i- a" in
addition_assoc [of "aug_pm_set z i {a}" "f"], assumption+)
apply (frule_tac x = sb in aug_bpp_closed [of "z" "i" "{a}" "f" _ " ⇩i- a"],
assumption+)
apply (thin_tac "sa ⇩f+ a ⇩f+ (sb ⇩f+ ⇩i- a) = sa ⇩f+ (a ⇩f+ (sb ⇩f+ ⇩i- a))")
apply (thin_tac "a ⇩f+ ⇩i- a = ⇩i- a ⇩f+ a")
apply (frule inv_aug_addition [of "f" "z" "i" "{a}" ], assumption+)
apply (drule_tac x = a in bspec, assumption, simp)
apply (frule_tac x = sb and y = z in aug_commute [of "f" "z" "i" "{a}"],
assumption+)
apply (simp add:addition_set_inc_z)
apply (frule_tac x = sb and y = z in aug_commute [of "f" "z" "i" "{a}"],
assumption+, simp add:addition_set_inc_z, simp)
apply (simp add:zeroA_def)
apply (rule subsetI, simp add:aug_pm_set_def minus_set_def)
apply (simp add:aug_pm_set_def)
apply simp
done
lemma fag_single_additionTr4_1:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z;s ∈ add_set f {a} n; t ∈ add_set f {⇩i- a} n ⟧ ⟹
s ⇩f+ t = z"
apply (frule fag_single_additionTr4[of "f" "z" "i" "a" "n"], assumption+)
apply blast
done
lemma fag_single_additionTr5:"⟦assoc_bpp (aug_pm_set z i {a}) f;
ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a};
commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z⟧ ⟹
∀m. m < Suc n ⟶ (THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))"
apply (cut_tac a_in_aug_pm_set[of a "{a}" z i],
cut_tac addition_inc_add0[of "aug_pm_set z i {a}" f],
frule subsetD[of "aug_pm_set z i {a}"
"addition_set f (aug_pm_set z i {a})" a], assumption+)
prefer 2 apply simp
apply (cut_tac aug_addition_inc_z[of z f i "{a}"])
apply (frule aug_ipp_closed [of "f" "z" "i" "{a}" "a"], assumption+)
apply (induct_tac n)
apply (rule allI, rule impI, simp)
apply (simp add: addition_assoc [of "aug_pm_set z i {a}" "f" "a" "a" "⇩i- a"])
apply (frule fag_single_additionTr2 [of "f" "z" "i" "a" "a"], assumption+)
apply simp apply simp
apply (thin_tac "a ⇩f+ ⇩i- a = z")
apply (simp add:aug_commute [of "f" "z" "i" "{a}" "a" "z"])
apply (simp add:zeroA_def)
apply (rule allI, rule impI)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc (Suc n))) =
(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+ a")
apply (simp del:add_set_Suc)
apply (frule_tac m = m and n = "Suc (Suc n)" in Suc_leI,
thin_tac "Suc m ≤ Suc (Suc n)")
apply (case_tac "Suc m = Suc (Suc n)")
apply (frule_tac x = m and y = "Suc n" in Suc_inject,
thin_tac "Suc m = Suc (Suc n)")
apply (rotate_tac -1, frule sym, thin_tac "m = Suc n",
thin_tac "∀m. m < Suc n ⟶ (THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))",
thin_tac "(THE x. x ∈ add_set f {a} (Suc (Suc n))) =
(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+ a")
apply simp
apply (subgoal_tac "(THE x. x ∈ add_set f {a} m) ∈
addition_set f (aug_pm_set z i {a})")
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈
addition_set f (aug_pm_set z i {a})")
apply (frule_tac x = "THE x. x ∈ add_set f {a} m" and y = a and
z = "THE x. x ∈ add_set f {⇩i- a} m" in
addition_assoc [of "aug_pm_set z i {a}" "f"], assumption+)
apply simp
apply (thin_tac "(THE x. x ∈ add_set f {a} m) ⇩f+ a ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) =
(THE x. x ∈ add_set f {a} m) ⇩f+ (a ⇩f+ (THE x. x ∈ add_set f {⇩i- a} m))")
apply (frule_tac x = a and y = "THE x. x ∈ add_set f {⇩i- a} m" in
aug_commute [of "f" "z" "i" "{a}"], assumption+) apply simp
apply (thin_tac "a ⇩f+ (THE x. x ∈ add_set f {⇩i- a} m) =
(THE x. x ∈ add_set f {⇩i- a} m) ⇩f+ a")
apply (frule_tac x1 = "THE x. x ∈ add_set f {a} m" and
y1 = "THE x. x ∈ add_set f {⇩i- a} m" and z1 = a in
addition_assoc[THEN sym, of "aug_pm_set z i {a}" "f"], assumption+)
apply simp
apply (frule_tac n = m in fag_single_additionTr4 [of "f" "z" "i" "a"],
assumption+)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} m) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = z")
prefer 2
apply (thin_tac "(THE x. x ∈ add_set f {a} m)
∈ addition_set f (aug_pm_set z i {a})",
thin_tac "(THE x. x ∈ add_set f {⇩i- a} m)
∈ addition_set f (aug_pm_set z i {a})",
thin_tac "(THE x. x ∈ add_set f {a} m) ⇩f+
((THE x. x ∈ add_set f {⇩i- a} m) ⇩f+ a) =
(THE x. x ∈ add_set f {a} m) ⇩f+ (THE x. x ∈ add_set f {⇩i- a} m) ⇩f+ a")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} m) ∈ add_set f {a} m")
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m")
apply simp
apply (thin_tac "∀s t. s ∈ add_set f {a} m ∧ t ∈ add_set f {⇩i- a} m ⟶
s ⇩f+ t = z",
thin_tac "(THE x. x ∈ add_set f {a} m) ∈ add_set f {a} m")
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
apply (thin_tac "∀s t. s ∈ add_set f {a} m ∧ t ∈ add_set f {⇩i- a} m ⟶
s ⇩f+ t = z")
apply simp apply (simp add:zeroA_def)
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m")
apply (subgoal_tac "{⇩i- a} ⊆ (aug_pm_set z i {a})")
apply (frule_tac n = m in add_set_mono[of "{⇩i- a}" "aug_pm_set z i {a}" "f"])
apply (frule_tac A = "add_set f {⇩i- a} m" and
B = "add_set f (aug_pm_set z i {a}) m" and
c = "THE x. x ∈ add_set f {⇩i- a} m" in subsetD, assumption+)
apply (subgoal_tac "add_set f (aug_pm_set z i {a}) m ⊆
addition_set f (aug_pm_set z i {a})")
apply (simp add:subsetD) apply (simp add:addition_inc_add)
apply (rule subsetI) apply (simp add:aug_pm_set_def minus_set_def)
apply (thin_tac "(THE x. x ∈ add_set f {a} m)
∈ addition_set f (aug_pm_set z i {a})")
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} m) ∈ add_set f {a} m")
apply (subgoal_tac "{a} ⊆ (aug_pm_set z i {a})")
apply (frule_tac n = m in add_set_mono[of "{a}" "aug_pm_set z i {a}" "f"])
apply (frule_tac A = "add_set f {a} m" and
B = "add_set f (aug_pm_set z i {a}) m" and
c = "THE x. x ∈ add_set f {a} m" in subsetD, assumption+)
apply (subgoal_tac "add_set f (aug_pm_set z i {a}) m ⊆
addition_set f (aug_pm_set z i {a})")
apply (simp add:subsetD) apply (simp add:addition_inc_add)
apply (rule subsetI) apply (simp add:aug_pm_set_def minus_set_def)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1) apply (simp del:add_set_Suc)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))")
prefer 2 apply simp
apply (thin_tac "∀m. m < Suc n ⟶ (THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))")
apply (thin_tac "(THE x. x ∈ add_set f {a} (Suc (Suc n))) =
(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+ a")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc n)) ∈ add_set f {a} (Suc n)")
prefer 2
apply (rule theI') apply (rule ex_ex1I)
apply (simp del:add_set_Suc add:add_set_single_nonempty1)
apply (simp del:add_set_Suc add:add_set_single1)
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc n)) ∈ addition_set f (aug_pm_set z i {a})")
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ addition_set f (aug_pm_set z i {a})")
apply (frule_tac x = "THE x. x ∈ add_set f {a} (Suc n)" and y = a and z = "THE x. x ∈ add_set f {⇩i- a} m" in addition_assoc [of "aug_pm_set z i {a}" "f"], assumption+) apply (simp del:add_set_Suc)
apply (frule_tac x = a and y = "THE x. x ∈ add_set f {⇩i- a} m" in aug_commute [of "f" "z" "i" "{a}"], assumption+) apply (simp del:add_set_Suc)
apply (frule_tac x1 = "THE x. x ∈ add_set f {a} (Suc n)" and y1 = "THE x. x ∈ add_set f {⇩i- a} m" and z1 = a in addition_assoc[THEN sym, of "aug_pm_set z i {a}" "f"], assumption+) apply (simp del:add_set_Suc)
apply (thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))",
thin_tac " (THE x. x ∈ add_set f {a} (Suc n)) ⇩f+ a ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m)) ⇩f+ a",
thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
((THE x. x ∈ add_set f {⇩i- a} m) ⇩f+ a) = (THE x. x ∈
add_set f {a} (n - m)) ⇩f+ a",
thin_tac "a ⇩f+ (THE x. x ∈ add_set f {⇩i- a} m) =
(THE x. x ∈ add_set f {⇩i- a} m) ⇩f+ a")
apply (subgoal_tac "Suc n - m = Suc (n - m)", simp del:add_set_Suc)
apply (thin_tac "Suc n - m = Suc (n - m)")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc (n - m))) ∈ add_set f {a}
(Suc (n - m))")
apply (subgoal_tac "∃s∈add_set f {a} (n - m). (THE x. x ∈add_set f {a} (Suc (n - m))) = s ⇩f+ a") prefer 2 apply simp
apply (subgoal_tac "∀s∈add_set f {a} (n - m). (THE x. x∈add_set f {a} (Suc (n - m))) = s ⇩f+ a ⟶ (THE x. x ∈ add_set f {a} (n - m)) ⇩f+ a =
(THE x. x ∈ add_set f {a} (Suc (n - m)))")
apply blast apply (thin_tac "∃s∈add_set f {a} (n - m).
(THE x. x ∈ add_set f {a} (Suc (n - m))) = s ⇩f+ a")
apply (rule ballI) apply (rule impI) apply (simp del:add_set_Suc)
apply (thin_tac "s ⇩f+ a ∈ add_set f {a} (Suc (n - m))")
apply (thin_tac "(THE x. x ∈ add_set f {a} (Suc (n - m))) = s ⇩f+ a")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (n - m)) = s ")
apply simp
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (n - m)) ∈
add_set f {a} (n - m)")
apply (simp add:add_set_single1)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
apply (thin_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈
addition_set f (aug_pm_set z i {a})",
thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ∈ add_set f {a} (Suc n)",
thin_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m",
thin_tac "(THE x. x ∈ add_set f {a} (Suc n))
∈ addition_set f (aug_pm_set z i {a})")
apply (rule theI') apply (rule ex_ex1I)
apply (simp del:add_set_Suc add:add_set_single_nonempty1)
apply (simp del:add_set_Suc add:add_set_single1)
apply (simp add:Suc_diff_le)
apply(thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))",
thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ∈ add_set f {a} (Suc n)",
thin_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m",
thin_tac "(THE x. x ∈ add_set f {a} (Suc n))
∈ addition_set f (aug_pm_set z i {a})")
apply (subgoal_tac "{⇩i- a} ⊆ (aug_pm_set z i {a})")
apply (frule_tac A = "{⇩i- a}" and B = "(aug_pm_set z i {a})" and
n = m and f = f in add_set_mono)
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m")
apply (cut_tac n = m in addition_inc_add[of f "aug_pm_set z i {a}"])
apply (simp add:subsetD)+
apply (thin_tac "add_set f {⇩i- a} m ⊆ add_set f (aug_pm_set z i {a}) m")
apply (rule theI', rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply (rule subsetI, simp add:aug_pm_set_def minus_set_def)
apply (thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))",
thin_tac "(THE x. x ∈ add_set f {⇩i- a} m) ∈ add_set f {⇩i- a} m")
apply (subgoal_tac "{a} ⊆ (aug_pm_set z i {a})")
apply (frule_tac A = "{a}" and B = "aug_pm_set z i {a}" and
n = "Suc n" and f = f in add_set_mono)
apply (cut_tac n = "Suc n" in addition_inc_add[of f "aug_pm_set z i {a}"])
apply (simp del:add_set_Suc add:subsetD)+
apply (thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))",
thin_tac "(THE x. x ∈ add_set f {a} (Suc n)) ∈ add_set f {a} (Suc n)")
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply (thin_tac "∀m. m < Suc n ⟶ (THE x. x ∈ add_set f {a} (Suc n)) ⇩f+
(THE x. x ∈ add_set f {⇩i- a} m) = (THE x. x ∈ add_set f {a} (n - m))")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc (Suc n))) ∈
add_set f {a} (Suc (Suc n))")
apply (subgoal_tac "∃s∈add_set f {a} (Suc n).
(THE x. x ∈ add_set f {a} (Suc (Suc n))) = s ⇩f+ a")
prefer 2 apply simp
apply (erule bexE)
apply (simp del:add_set_Suc)
apply (thin_tac "(THE x. x ∈ add_set f {a} (Suc (Suc n))) = s ⇩f+ a")
apply (subgoal_tac "s = (THE x. x ∈ add_set f {a} (Suc n))")
apply (simp del:add_set_Suc)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (Suc n)) ∈
add_set f {a} (Suc n)")
apply (simp del:add_set_Suc add:add_set_single1)
apply (rule theI') apply (rule ex_ex1I)
apply (simp del:add_set_Suc add:add_set_single_nonempty1)
apply (simp del:add_set_Suc add:add_set_single1)
apply (rule theI') apply (rule ex_ex1I)
apply (simp del:add_set_Suc add:add_set_single_nonempty1)
apply (simp del:add_set_Suc add:add_set_single1)
done
lemma fag_single_additionTr5_1:"⟦assoc_bpp (aug_pm_set z i {a}) f;
ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a};
commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z; m < Suc n⟧ ⟹
(THE x. x ∈ add_set f {a} (Suc n)) ⇩f+ (THE x. x ∈ add_set f {⇩i- a} m) =
(THE x. x ∈ add_set f {a} (n - m))"
apply (frule_tac n = n in fag_single_additionTr5 [of "z" "i" "a" "f"],
assumption+) apply simp
done
lemma fag_single_additionTr5_2:"⟦assoc_bpp (aug_pm_set z i {a}) f;
ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a};
commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z; n < Suc m⟧ ⟹
(THE x. x ∈ add_set f {⇩i- a} (Suc m)) ⇩f+ (THE x. x ∈ add_set f {a} n) =
(THE x. x ∈ add_set f {⇩i- a} (m - n))"
apply (simp del:add_set_Suc add:aug_pm_aug_pm_minus)
apply (frule ipp_cond1_minus[of "a" "i"])
apply (frule ipp_cond2_minus[of "a" "i" "z" "f"], assumption+)
apply (frule inv_ipp_minus[of "a" "i" "z" "f"], assumption+)
apply (frule zeroA_minus[of "a" "i" "z" "f" "z"], assumption+)
apply (subgoal_tac "⇩i- (⇩i- a) = a")
apply (frule fag_single_additionTr5_1 [of z i "⇩i- a" f n m], assumption+)
apply (simp del:add_set_Suc)
apply (simp add:ipp_cond1_def)
done
definition
free_gen_condition :: "['a ⇒ 'a ⇒ 'a, 'a ⇒ 'a, 'a, 'a] ⇒ bool" where
"free_gen_condition f i a z ⟷ (∀n. z ∉ add_set f {a} n)"
definition
fg_elem_single :: "['a ⇒ 'a ⇒ 'a, 'a ⇒ 'a, 'a, 'a] ⇒ int ⇒ 'a" where
"fg_elem_single f i a z n = (if 0 = n then z else
(if 0 < n then (THE x. x ∈ (add_set f {a} (nat (n - 1))))
else (THE x. x ∈ (add_set f {⇩i- a} (nat (- n - 1))))))"
abbreviation
FGELEMSNGLE ("(5_⨀_⇘_,_,_⇙)" [99,98,98,98,98]99) where
"n⨀a⇘f,i,z⇙ == fg_elem_single f i a z n"
lemma single_addition_pm_mem:"⟦assoc_bpp (aug_pm_set z i {a}) f;
ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a};
commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z⟧ ⟹
(n⨀a⇘f,i,z⇙) ∈ addition_set f (aug_pm_set z i {a})"
apply (case_tac "n = 0")
apply (simp add:fg_elem_single_def) apply (simp add:aug_addition_inc_z)
apply (frule_tac non_zero_int [of "n"])
apply (case_tac "0 < n")
apply (simp add:fg_elem_single_def)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (n - 1))) ∈
add_set f {a} (nat (n - 1))")
apply (subgoal_tac "add_set f {a} (nat (n - 1)) ⊆ addition_set f {a}")
apply (subgoal_tac "addition_set f {a}
⊆ addition_set f (aug_pm_set z i {a})")
apply (simp add:subsetD)+
apply (rule addition_set_mono)
apply (rule subsetI) apply (simp add:aug_pm_set_def minus_set_def)
apply (simp add:addition_inc_add)
apply (rule theI')
apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1) apply (thin_tac "n ≠ 0")
apply simp
apply (simp add:fg_elem_single_def)
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} (nat (- n - 1))) ∈
add_set f {⇩i- a} (nat (- n - 1))")
apply (subgoal_tac "add_set f {⇩i- a} (nat (- n - 1)) ⊆
addition_set f {⇩i- a}")
apply (subgoal_tac "addition_set f {⇩i- a} ⊆
addition_set f (aug_pm_set z i {a})")
apply (simp add:subsetD)+
apply (rule addition_set_mono)
apply (rule subsetI) apply (simp add:aug_pm_set_def minus_set_def)
apply (simp add:addition_inc_add)
apply (rule theI')
apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
done
lemma assoc_aug_assoc:"assoc_bpp (aug_pm_set z i {a}) f ⟹ assoc_bpp {a} f"
apply (simp add:assoc_bpp_def)
apply (rule ballI)+
apply (subgoal_tac "{a} ⊆ aug_pm_set z i {a}")
apply (frule addition_set_mono[of "{a}" "aug_pm_set z i {a}" "f"])
apply (frule_tac c = aa in subsetD[of "addition_set f {a}"
"addition_set f (aug_pm_set z i {a})"], assumption+)
apply (frule_tac c = b in subsetD[of "addition_set f {a}"
"addition_set f (aug_pm_set z i {a})"], assumption+)
apply (frule_tac c = c in subsetD[of "addition_set f {a}"
"addition_set f (aug_pm_set z i {a})"], assumption+)
apply simp
apply (rule subsetI)
apply (simp add:aug_pm_set_def minus_set_def)
done
lemma single_addition_posTr:"⟦commute_bpp f (aug_pm_set z i {(a::'a)});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; 0 < (n::int); 0 < (m::int)⟧ ⟹
(THE x. x ∈ add_set f {a} (nat (n - 1))) ⇩f+
(THE x. x ∈ add_set f {a} (nat (m - 1))) =
(THE x. x ∈ add_set f {a} (nat (n + m - 1)))"
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (n - 1))) ∈
add_set f {a} (nat (n - 1))")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (m - 1)))
∈
add_set f {a} (nat (m - 1))")
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (n + m - 1)))
∈ add_set f {a} (nat (n + m - 1))")
apply (frule assoc_aug_assoc [of "z" "i" "a" "f"])
apply (frule_tac x = "THE x. x ∈ add_set f {a} (nat (n - 1))" and
y = "THE x. x ∈ add_set f {a} (nat (m - 1))" in
bpp_closed1 [of "{a}" "f" _ "nat (n - 1)" _ "nat (m - 1)"], assumption+)
apply (subgoal_tac "nat (n - 1) + nat (m - 1) + Suc 0 = nat (n + m - 1)")
apply (simp del:add_set_Suc)
apply (simp add:add_set_single1)
prefer 2
apply (thin_tac "(THE x. x ∈ add_set f {a} (nat (n - 1)))
∈ add_set f {a} (nat (n - 1))")
apply (thin_tac "(THE x. x ∈ add_set f {a} (nat (m - 1)))
∈ add_set f {a} (nat (m - 1))")
apply (rule theI')
apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
prefer 2
apply (rule theI')
apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
prefer 2
apply (rule theI')
apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
apply (rule int_nat_add, assumption+)
done
lemma single_addition_pos:"⟦commute_bpp f (aug_pm_set z i {(a::'a)});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; 0 < (n::int); 0 < (m::int)⟧ ⟹
(n⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) = (n + m)⨀a⇘f,i,z⇙"
apply (frule_tac single_addition_posTr [of f z i a n m], assumption+)
apply (simp add:fg_elem_single_def)
done
lemma single_addition_neg:"⟦commute_bpp f (aug_pm_set z i {(a::'a)});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; (n::int) < 0; (m::int) < 0 ⟧ ⟹
(n⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) = (n + m)⨀a⇘f,i,z⇙"
apply (simp add:fg_elem_single_def)
apply (simp del:add_set_Suc add:aug_pm_aug_pm_minus)
apply (frule ipp_cond1_minus[of "a" "i"])
apply (frule ipp_cond2_minus[of "a" "i" "z" "f"], assumption+)
apply (frule inv_ipp_minus[of "a" "i" "z" "f"], assumption+)
apply (frule zeroA_minus[of "a" "i" "z" "f" "z"], assumption+)
apply (frule single_addition_posTr [of f z i "⇩i- a" "- n" "- m"], assumption+)
apply simp+
done
lemma single_addition_zero:"⟦commute_bpp f (aug_pm_set z i {(a::'a)});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹ 0⨀a⇘f,i,z⇙ = z"
apply (simp add:fg_elem_single_def)
done
lemma s_a_p_1:"⟦assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i;
ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a};
commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z;
m < 0; 0 < n⟧ ⟹ (n⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) = (n + m)⨀a⇘f,i,z⇙"
apply (case_tac "- m < n")
apply (subst zminus_zadd_cancel [THEN sym, of "n" "m"])
apply (subgoal_tac "0 < -m") apply (subgoal_tac "0 < m + n")
apply (subst single_addition_pos[THEN sym, of "f" "z" "i" "a" "-m" "m + n"],
assumption+)
apply (simp add:zminus_zadd_cancel [of "m" "m + n"])
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "-m"], assumption+)
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "m + n"], assumption+)
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "m"], assumption+)
apply (subst addition_assoc, assumption+)
apply (simp add:aug_commute[of "f" "z" "i" "{a}" "(m + n)⨀a⇘f,i,z⇙" "m⨀a⇘f,i,z⇙"])
apply (subst addition_assoc[THEN sym], assumption+)
apply (subgoal_tac "((- m)⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) = z") apply simp
apply (simp add:zeroA_def) apply (simp add:add.commute)
apply (simp add:fg_elem_single_def)
apply (rule fag_single_additionTr4_1[of "f" "z" "i" "a"_ "nat (- m - 1)"], assumption+)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply simp+ apply (subgoal_tac "n ≤ - m") prefer 2 apply simp
apply (thin_tac "¬ - m < n")
apply (frule zle_imp_zless_or_eq) apply (thin_tac "n ≤ - m")
apply (case_tac "n = -m")
apply (thin_tac "n < - m ∨ n = - m") apply simp
apply (subgoal_tac "0 < -m") apply (thin_tac "n = - m")
apply (simp add:fg_elem_single_def)
apply (rule fag_single_additionTr4_1 [of "f" "z" "i" "a" _ "nat (-m - 1)"], assumption+)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply simp
apply simp
apply (subst zminus_zadd_cancel [THEN sym, of "m" "n"])
apply (subst single_addition_neg[THEN sym, of "f" "z" "i" "a" "-n" "n + m"], assumption+) apply simp apply simp
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "-n"], assumption+)
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "n + m"], assumption+) apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "n"], assumption+)
apply (simp add:addition_assoc[THEN sym])
apply (subgoal_tac "(n⨀a⇘f,i,z⇙) ⇩f+ ((- n)⨀a⇘f,i,z⇙) = z") apply (simp add:zeroA_def)
apply (thin_tac "(- n)⨀a⇘f,i,z⇙ ∈ addition_set f (aug_pm_set z i {a})")
apply (thin_tac "(n + m)⨀a⇘f,i,z⇙ ∈ addition_set f (aug_pm_set z i {a})")
apply (thin_tac "n⨀a⇘f,i,z⇙ ∈ addition_set f (aug_pm_set z i {a})")
apply (simp add:fg_elem_single_def)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (n - 1))) ∈
add_set f {a} (nat (n - 1))")
apply (subgoal_tac "(THE x. x ∈ add_set f {⇩i- a} (nat (n - 1))) ∈
add_set f {⇩i- a} (nat (n - 1))")
apply (simp add:fag_single_additionTr4_1)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty2)
apply (simp add:add_set_single2)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
done
lemma single_addition_pm:"⟦commute_bpp f (aug_pm_set z i {(a::'a)});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹ (n⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) = (n + m)⨀a⇘f,i,z⇙"
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "n"], assumption+)
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "m"], assumption+)
apply (case_tac "n = 0")
apply (subgoal_tac "(n⨀a⇘f,i,z⇙) = z", simp)
apply (simp add:zeroA_def, subst fg_elem_single_def, simp)
apply (case_tac "m = 0")
apply (simp add:aug_commute)
apply (subgoal_tac " (0⨀a⇘f,i,z⇙) = z", simp)
apply (simp add:zeroA_def, subst fg_elem_single_def, simp)
apply (frule_tac non_zero_int [of "n"], thin_tac "n ≠ 0")
apply (frule_tac non_zero_int [of "m"], thin_tac "m ≠ 0")
apply (case_tac "0 < n", thin_tac "0 < n ∨ n < 0")
apply (case_tac "0 < m", thin_tac "0 < m ∨ m < 0")
apply (simp add:single_addition_pos)
apply (simp, thin_tac "m⨀a⇘f,i,z⇙ ∈ addition_set f (aug_pm_set z i {a})")
apply (simp add:s_a_p_1)
apply simp
apply (subst aug_commute, assumption+)
apply (case_tac "0 < m", thin_tac "0 < m ∨ m < 0")
apply (simp add:s_a_p_1, simp add:add.commute)
apply simp
apply (simp add:single_addition_neg, simp add:add.commute)
done
lemma single_inv:"⟦commute_bpp f (aug_pm_set z i {(a::'a)});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z⟧ ⟹ ⇩i- (m⨀a⇘f,i,z⇙) = (-m)⨀a⇘f,i,z⇙"
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "m"], assumption+,
frule single_addition_pm_mem[of "z" "i" "a" "f" "- m"], assumption+,
frule single_addition_pm[THEN sym, of "f" "z" "i" "a" "-m" "m"],
assumption+, simp)
apply (simp add:single_addition_zero)
apply (subgoal_tac "z ⇩f+ (⇩i- (m⨀a⇘f,i,z⇙)) =
((- m)⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) ⇩f+ (⇩i- (m⨀a⇘f,i,z⇙))") prefer 2 apply simp
apply (frule aug_ipp_closed [of "f" "z" "i" "{a}" "m⨀a⇘f,i,z⇙"], assumption+)
apply (thin_tac "z = ((- m)⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙)")
apply (simp add:addition_assoc)
apply (simp add:aug_commute [of "f" "z" "i" "{a}" "(m⨀a⇘f,i,z⇙)" "⇩i- (m⨀a⇘f,i,z⇙)"])
apply (subgoal_tac "⇩i- (m⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙) = z") apply simp
apply (subgoal_tac "z ∈ addition_set f (aug_pm_set z i {a})")
prefer 2 apply (simp add:addition_set_inc_z)
apply (simp add:aug_commute[of "f" "z" "i" "{a}" "(- m)⨀a⇘f,i,z⇙" "z"])
apply (simp add:zeroA_def)
apply (simp add:inv_ipp_def)
apply (subgoal_tac "zeroA z i f {a} (⇩i- (m⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙))")
prefer 2 apply simp
apply (frule aug_zero_unique[of "f" "z" "i" "{a}" "⇩i- (m⨀a⇘f,i,z⇙) ⇩f+ (m⨀a⇘f,i,z⇙)"])
apply (rule aug_bpp_closed, assumption+)
apply (rule sym) apply assumption
done
lemma free_ag_single:"⟦commute_bpp f (aug_pm_set z i {a});
assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
zeroA z i f {a} z; free_gen_condition f i a z; n ≠ m⟧ ⟹
(n⨀a⇘f,i,z⇙) ≠ (m⨀a⇘f,i,z⇙)"
apply (rule contrapos_pp, simp+)
apply (frule single_addition_pm[THEN sym, of f z i a n "-m"], assumption+)
apply simp
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "m"], assumption+)
apply (frule single_addition_pm_mem[of "z" "i" "a" "f" "- m"], assumption+)
apply (simp add:aug_commute [of "f" "z" "i" "{a}" "(m⨀a⇘f,i,z⇙)" "(- m)⨀a⇘f,i,z⇙"])
apply (simp add:single_inv[THEN sym, of "f" "z" "i" "a" "m"])
apply (simp add:inv_aug_addition)
apply (thin_tac "n⨀a⇘f,i,z⇙ = m⨀a⇘f,i,z⇙")
apply (thin_tac " ⇩i- (m⨀a⇘f,i,z⇙) ∈ addition_set f (aug_pm_set z i {a})")
apply (thin_tac " m⨀a⇘f,i,z⇙ ∈ addition_set f (aug_pm_set z i {a})")
apply (insert int_neq_iff[of "n" "m"]) apply simp
apply (case_tac "n < m") apply (thin_tac "n < m ∨ m < n")
apply (frule single_inv [THEN sym, of "f" "z" "i" "a" "n - m"], assumption+)
apply simp apply (subgoal_tac "⇩i- z = z") apply simp
apply (thin_tac " ⇩i- z = z") prefer 2 apply (simp add:ipp_cond3_def)
apply (subgoal_tac "0 < m - n") prefer 2 apply simp
apply (thin_tac "(n - m)⨀a⇘f,i,z⇙ = z")
apply (simp add:fg_elem_single_def)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (m - n - 1))) ∈ add_set f {a} (nat (m - n - 1))") apply simp
apply (thin_tac "(THE x. x ∈ add_set f {a} (nat (m - n - 1))) = z")
apply (simp add:free_gen_condition_def)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1) apply simp
apply (subgoal_tac "0 < n - m") prefer 2 apply simp
apply (simp add:fg_elem_single_def)
apply (subgoal_tac "(THE x. x ∈ add_set f {a} (nat (n - m - 1))) ∈ add_set f {a} (nat (n - m - 1))") apply simp
apply (thin_tac "(THE x. x ∈ add_set f {a} (nat (n - m - 1))) = z")
apply (simp add:free_gen_condition_def)
apply (rule theI') apply (rule ex_ex1I)
apply (simp add:add_set_single_nonempty1)
apply (simp add:add_set_single1)
done
definition
fags_cond :: "['a ⇒ 'a ⇒ 'a, 'a, 'a ⇒ 'a, 'a] ⇒ bool" where
"fags_cond f z i a ⟷ commute_bpp f (aug_pm_set z i {a}) ∧
assoc_bpp (aug_pm_set z i {a}) f ∧ ipp_cond1 {a} i ∧
ipp_cond2 z {a} i f ∧ ipp_cond3 z i ∧ inv_ipp z i f {a} ∧
commute_bpp f (aug_pm_set z i {a}) ∧ zeroA z i f {a} z ∧
free_gen_condition f i a z"
lemma fag_single_free:"⟦fags_cond f z i a; n ≠ m⟧ ⟹ (n⨀a⇘f,i,z⇙) ≠ (m⨀a⇘f,i,z⇙)"
apply (simp add:fags_cond_def) apply (erule conjE)+
apply (simp add:free_ag_single)
done
lemma fag_single_free1:"⟦fags_cond f z i a;(n⨀a⇘f,i,z⇙) = (m⨀a⇘f,i,z⇙)⟧ ⟹ n = m"
apply (rule contrapos_pp, simp+)
apply (frule fag_single_free [of "f" "z" "i" "a" "n" "m"], assumption+)
apply simp
done
definition
fags_carr :: "['a ⇒ 'a ⇒ 'a, 'a, 'a ⇒ 'a, 'a] ⇒ 'a set" where
"fags_carr f z i a = {x. ∃n. x = n⨀a⇘f,i,z⇙}"
definition
fags_bpp :: "['a ⇒ 'a ⇒ 'a, 'a, 'a ⇒ 'a, 'a] ⇒ 'a ⇒ 'a ⇒ 'a" where
"fags_bpp f z i a = (λx∈(fags_carr f z i a). λy∈(fags_carr f z i a).
((THE n. x = n⨀a⇘f,i,z⇙) + (THE m. y = m⨀a⇘f,i,z⇙))⨀a⇘f,i,z⇙)"
definition
fags_ipp :: "['a ⇒ 'a ⇒ 'a, 'a, 'a ⇒ 'a, 'a] ⇒ 'a ⇒ 'a" where
"fags_ipp f z i a = (λx∈(fags_carr f z i a).
(- (THE n. x = n⨀a⇘f,i,z⇙))⨀a⇘f,i,z⇙)"
lemma fags_mem:"fags_cond f z i a ⟹ (n⨀a⇘f,i,z⇙) ∈ fags_carr f z i a"
apply (simp add:fags_carr_def)
apply blast
done
lemma fags_ippTr:"fags_cond f z i a ⟹
fags_ipp f z i a (n⨀a⇘f,i,z⇙) = (- n)⨀a⇘f,i,z⇙"
apply (subgoal_tac "(n⨀a⇘f,i,z⇙) ∈ fags_carr f z i a")
apply (simp add:fags_ipp_def)
apply (subgoal_tac "n⨀a⇘f,i,z⇙ = (THE na. n⨀a⇘f,i,z⇙ = na⨀a⇘f,i,z⇙)⨀a⇘f,i,z⇙")
apply (frule_tac m = "THE na. n⨀a⇘f,i,z⇙ = na⨀a⇘f,i,z⇙" in
fag_single_free1[of "f" "z" "i" "a" "n"], assumption+, simp)
apply (rule theI', rule ex_ex1I, blast)
apply (simp add:fag_single_free1 [of f z i a])
apply (simp add:fags_mem)
done
lemma fags_bppTr:"fags_cond f z i a ⟹
fags_bpp f z i a (n⨀a⇘f,i,z⇙) (m⨀a⇘f,i,z⇙) = (n + m)⨀a⇘f,i,z⇙"
apply (subgoal_tac "(n⨀a⇘f,i,z⇙) ∈ fags_carr f z i a")
apply (subgoal_tac "(m⨀a⇘f,i,z⇙) ∈ fags_carr f z i a")
apply (simp add:fags_bpp_def)
apply (subgoal_tac "n⨀a⇘f,i,z⇙ = (THE na. n⨀a⇘f,i,z⇙ = na⨀a⇘f,i,z⇙)⨀a⇘f,i,z⇙")
apply (frule_tac m = "THE na. n⨀a⇘f,i,z⇙ = na⨀a⇘f,i,z⇙" in
fag_single_free1 [of "f" "z" "i" "a" "n"], assumption+)
apply (subgoal_tac "m⨀a⇘f,i,z⇙ = (THE ma. m⨀a⇘f,i,z⇙ = ma⨀a⇘f,i,z⇙)⨀a⇘f,i,z⇙")
apply (frule_tac m = "THE ma. m⨀a⇘f,i,z⇙ = ma⨀a⇘f,i,z⇙" in
fag_single_free1 [of f z i a m], assumption+)
apply simp
apply (rule theI', rule ex_ex1I, blast)
apply (simp add:fag_single_free1 [of f z i a])
apply (rule theI', rule ex_ex1I, blast)
apply (simp add:fag_single_free1 [of f z i a])
apply (simp add:fags_carr_def, blast)
apply (simp add:fags_carr_def, blast)
done
definition
fags :: "['a ⇒ 'a ⇒ 'a, 'a, 'a ⇒ 'a, 'a] ⇒ 'a aGroup" where
"fags f z i a = ⦇carrier = fags_carr f z i a,
pop = fags_bpp f z i a,
mop = fags_ipp f z i a, zero = z⦈"
lemma fags_ag:"fags_cond f z i a ⟹ aGroup (fags f z i a)"
apply (rule aGroup.intro)
apply (rule Pi_I)+
apply (simp add:fags_def fags_carr_def)
apply ((erule exE)+, simp)
apply (simp add:fags_bppTr)
apply blast
apply (simp add:fags_def, simp add:fags_carr_def,
(erule exE)+, simp)
apply (simp add:fags_bppTr, simp add:add.assoc)
apply (simp add:fags_def, simp add:fags_carr_def,
(erule exE)+, simp)
apply (simp add:fags_bppTr, simp add:add.commute)
apply (rule Pi_I)
apply (simp add:fags_def, simp add:fags_carr_def, erule exE, simp)
apply (simp add:fags_ippTr, blast)
apply (simp add:fags_def, simp add:fags_carr_def, erule exE, simp)
apply (simp add:fags_ippTr fags_bppTr,
simp add:fags_cond_def single_addition_zero[of f z i a])
apply (simp add:fags_def fags_carr_def,
simp add:fags_cond_def, (erule conjE)+,
frule single_addition_zero, assumption+, rotate_tac -1, frule sym,
blast)
apply (simp add:fags_def fags_carr_def, erule exE)
apply (subgoal_tac "fags_bpp f z i a z aa = fags_bpp f z i a (0⨀a⇘f,i,z⇙) aa",
simp add:fags_bppTr,
thin_tac "aa = n⨀a⇘f,i,z⇙")
apply (cut_tac single_addition_zero[of f z i a], simp)
apply (simp add:fags_cond_def)+
done
section "Abelian Group generated by one element II (nonconstructive)"
definition
ag_single_gen :: "[('a, 'm) aGroup_scheme, 'a] ⇒ bool" where
"ag_single_gen A a ⟷ aGroup A ∧ carrier A = ⋂ {H. asubGroup A H ∧ a ∈ H}"
primrec aSum :: "[('a, 'm) aGroup_scheme, nat,'a] ⇒ 'a" where
aSum_0: "aSum A 0 a = 𝟬⇘A⇙"
| aSum_Suc: "aSum A (Suc n) a = aSum A n a ±⇘A⇙ a"
definition
sprod_n_a ::"[('a, 'm) aGroup_scheme, int, 'a] ⇒ 'a" where
"sprod_n_a A n x = (if 0 ≤ n then (aSum A (nat n) x)
else (aSum A (nat (- n)) (-⇩a⇘A⇙ x)))"
abbreviation
SPRODNA ("(3_▹_⇘_⇙)" [95,95,96]95) where
"n▹a⇘A⇙ == sprod_n_a A n a"
lemma (in aGroup) asum_mem:"a ∈ carrier A ⟹ aSum A n a ∈ carrier A"
apply (induct_tac n)
apply simp apply (simp add:ag_inc_zero)
apply simp
apply (rule ag_pOp_closed, assumption+)
done
lemma (in aGroup) nt_mem0:"a ∈ carrier A ⟹ n▹a⇘A⇙ ∈ carrier A"
apply (case_tac "n = 0", simp add:sprod_n_a_def)
apply (simp add:ag_inc_zero)
apply (frule non_zero_int[of "n"])
apply (case_tac "0 < n")
apply (simp add:sprod_n_a_def)
apply (simp add:asum_mem, thin_tac "n ≠ 0", simp)
apply (simp add:sprod_n_a_def)
apply (rule asum_mem)
apply (simp add:ag_mOp_closed)
done
lemma (in aGroup) nt_zero0:"a ∈ carrier A ⟹ 0▹a⇘A⇙ = 𝟬"
apply (simp add:sprod_n_a_def)
done
lemma (in aGroup) nt_1:"a ∈ carrier A ⟹ 1▹a⇘A⇙ = a"
apply (simp add:sprod_n_a_def)
apply (simp add:ag_l_zero)
done
lemma (in aGroup) asumTr:"a ∈ carrier A ⟹
aSum A (n + m) a = aSum A n a ± (aSum A m a)"
apply (induct_tac m)
apply simp
apply (frule asum_mem[of a n])
apply (rule ag_r_zero [THEN sym, of "aSum A n a"], assumption+)
apply (subgoal_tac "n + Suc na = Suc (n + na)", simp)
apply (rule ag_pOp_assoc)
apply (simp add:asum_mem)+
done
lemma (in aGroup) aSum_zero:"a ∈ carrier A ⟹ aSum A n 𝟬 = 𝟬"
apply (induct_tac n)
apply (simp, simp, rule ag_r_zero)
apply (simp add:ag_inc_zero)
done
lemma (in aGroup) agsum_add1p:"⟦ a ∈ carrier A; 0 ≤ n; 0 ≤ m⟧ ⟹
(n + m)▹a⇘A⇙ = n▹a⇘A⇙ ± (m▹a⇘A⇙)"
apply (simp add:sprod_n_a_def)
apply (subst nat_add_distrib[of "n" "m"], assumption+)
apply (simp add:asumTr)
done
lemma (in aGroup) agsum_add1m:"⟦ a ∈ carrier A; n < 0; m < 0⟧ ⟹
(n + m)▹a⇘A⇙ = n▹a⇘A⇙ ± (m▹a⇘A⇙)"
apply (simp add:sprod_n_a_def)
apply (subst zdiff)
apply (subgoal_tac "0 ≤ -n") apply (thin_tac "n < 0")
apply (subgoal_tac "0 ≤ -m") apply (thin_tac "m < 0")
apply (subst nat_add_distrib [of "-n" "-m"], assumption+)
apply (rule asumTr)
apply (simp add:ag_mOp_closed) apply simp+
done
lemma (in aGroup) agsum_add2Tr:"a ∈ carrier A ⟹
𝟬 = aSum A n a ± (aSum A n (-⇩a a))"
apply (induct_tac n)
apply simp
apply (cut_tac ag_inc_zero)
apply (simp add:ag_r_zero[THEN sym])
apply simp
apply (frule ag_mOp_closed[of a])
apply (frule_tac n = n in asum_mem [of "-⇩a a"])
apply (frule_tac x = "aSum A n (-⇩a a)" in ag_pOp_closed [of _ "-⇩a a"],
assumption)
apply (frule_tac n = n in asum_mem [of a])
apply (subst ag_pOp_assoc[of _ "a"], assumption+)
apply (subst ag_pOp_assoc[THEN sym, of a _ "-⇩a a"], assumption+)
apply (subst ag_pOp_commute[of a], assumption+)
apply (subst ag_pOp_assoc[of _ a "-⇩a a"], assumption+)
apply (frule sym) apply (thin_tac "𝟬 = aSum A n a ± (aSum A n (-⇩a a))")
apply (simp add:ag_r_inv1[of a])
apply (subst ag_r_zero, assumption+) apply simp
done
lemma (in aGroup) agsum_add2p:"⟦a ∈ carrier A; 0 ≤ n⟧ ⟹
𝟬 = n▹a⇘A⇙ ± ((-n)▹a⇘A⇙)"
apply (case_tac "n = 0")
apply (simp add:sprod_n_a_def)
apply (cut_tac ag_inc_zero)
apply (simp add:ag_r_zero[THEN sym])
apply (frule non_zero_int[of "n"], thin_tac "n ≠ 0", simp)
apply (subgoal_tac "-n < 0") prefer 2 apply simp
apply (simp add:sprod_n_a_def)
apply (simp add:agsum_add2Tr)
done
lemma (in aGroup) agsum_add2m:"⟦a ∈ carrier A; n < 0⟧ ⟹
𝟬 = n▹a⇘A⇙ ± ((-n)▹a⇘A⇙)"
apply (simp add:sprod_n_a_def)
apply (subst ag_pOp_commute)
apply (rule asum_mem)
apply (simp add:ag_mOp_closed)
apply (rule asum_mem, assumption+)
apply (simp add:agsum_add2Tr)
done
lemma (in aGroup) agsum_add3pm:"⟦a ∈ carrier A; 0 < n; m < 0⟧ ⟹
(n + m)▹a⇘A⇙ = n▹a⇘A⇙ ± (m▹a⇘A⇙)"
apply (cut_tac less_linear[of n "- m"])
apply (case_tac "n = -m")
apply simp
apply (subst ag_pOp_commute)
apply (simp add:nt_mem0)+
apply (subgoal_tac "0▹a⇘A⇙ = 𝟬") apply (simp add:agsum_add2m)
apply (simp add:sprod_n_a_def) apply simp
apply (case_tac "n < -m")
apply (subst zminus_zadd_cancel[THEN sym, of "m" "n"])
apply (subgoal_tac "-n < 0") prefer 2 apply simp
apply (subgoal_tac "n + m < 0") prefer 2 apply simp
apply simp
apply (cut_tac agsum_add1m [of "a" "-n" "n + m"])
apply simp
apply (subst ag_pOp_assoc [THEN sym])
apply (simp add:nt_mem0)+
apply (subst agsum_add2p [THEN sym, of a n], assumption+)
apply simp
apply (rule ag_l_zero[THEN sym, of "(n + m)▹a⇘A⇙"])
apply (simp add:nt_mem0, assumption) apply arith apply assumption
apply (thin_tac "n ≠ - m") apply simp
apply (subst zminus_zadd_cancel[THEN sym, of "n" "m"])
apply (frule zminus_minus_pos[of m], frule zless_imp_zle[of 0 "- m"])
apply (subgoal_tac "0 ≤ n + m") prefer 2 apply simp
apply (frule agsum_add1p [of "a" "-m" "n + m"], assumption+)
apply simp apply (thin_tac "n▹a⇘A⇙ = (- m)▹a⇘A⇙ ± (n + m)▹a⇘A⇙")
apply (subst ag_pOp_commute[of "(- m)▹a⇘A⇙" "(n + m)▹a⇘A⇙"])
apply (simp add:nt_mem0)+
apply (subst ag_pOp_assoc)
apply (simp add:nt_mem0)+
apply (subst ag_pOp_commute [of "(- m)▹a⇘A⇙" "m▹a⇘A⇙"])
apply (simp add:nt_mem0)+
apply (simp add:agsum_add2m[THEN sym])
apply (rule ag_r_zero[THEN sym])
apply (simp add:nt_mem0)
done
lemma (in aGroup) agsum_add3mp:"⟦ a ∈ carrier A; n < 0; 0 < m⟧ ⟹
(n + m)▹a⇘A⇙ = n▹a⇘A⇙ ± (m▹a⇘A⇙)"
apply (simp add:add.commute)
apply (subst ag_pOp_commute, (simp add:nt_mem0)+)
apply (simp add:agsum_add3pm)
done
lemma (in aGroup) nt_sum0:"⟦ a ∈ carrier A⟧ ⟹ (n + m)▹a⇘A⇙ = n▹a⇘A⇙ ± (m▹a⇘A⇙)"
apply (cut_tac less_linear[of n 0])
apply (case_tac "n < 0")
apply (cut_tac less_linear[of m 0])
apply (case_tac "m < 0", simp add:agsum_add1m, simp)
apply (thin_tac "¬ m < 0")
apply (case_tac "m = 0", simp)
apply (simp add:nt_zero0)
apply (rule ag_r_zero[THEN sym], simp add:nt_mem0)
apply (simp, simp add:agsum_add3mp, simp)
apply (thin_tac "¬ n < 0")
apply (case_tac "n = 0", simp, simp add:nt_zero0)
apply (rule ag_l_zero[THEN sym], simp add:nt_mem0)
apply simp
apply (cut_tac less_linear[of m 0])
apply (case_tac "m < 0")
apply (simp add:agsum_add3pm, simp, thin_tac "¬ m < 0")
apply (case_tac "m = 0", simp, simp add:nt_zero0)
apply (rule ag_r_zero[THEN sym], simp add:nt_mem0)
apply simp
apply (simp add:agsum_add1p)
done
lemma (in aGroup) nt_inv0:"a ∈ carrier A ⟹ -⇩a (n▹a⇘A⇙) = (- n)▹a⇘A⇙"
apply (subgoal_tac "(n + -n)▹a⇘A⇙ = n▹a⇘A⇙ ± ((-n)▹a⇘A⇙)")
prefer 2 apply (rule nt_sum0, assumption+) apply (simp add:nt_zero0)
apply (subgoal_tac "-⇩a (n▹a⇘A⇙) ± 𝟬 = -⇩a (n▹a⇘A⇙) ± (n▹a⇘A⇙ ± (- n)▹a⇘A⇙)")
apply (subgoal_tac "n▹a⇘A⇙ ∈ carrier A")
apply (frule ag_mOp_closed [of "n▹a⇘A⇙"])
apply (thin_tac "𝟬 = n▹a⇘A⇙ ± (- n)▹a⇘A⇙")
apply (simp add:ag_r_zero)
apply (subgoal_tac "(- n)▹a⇘A⇙ ∈ carrier A")
apply (simp add:ag_pOp_assoc[THEN sym])
apply (simp add:ag_l_inv1) apply (simp add:ag_l_zero)
apply (simp add:nt_mem0)+
done
lemma (in aGroup) m_x_asum:"⟦ a ∈ carrier A; b ∈ carrier A⟧
⟹ aSum A m (a ± b) = (aSum A m a) ± (aSum A m b)"
apply (induct_tac m) apply simp
apply (rule ag_r_zero[THEN sym])
apply (simp add:ag_inc_zero)
apply simp
apply (frule_tac n = n in asum_mem[of "a"])
apply (frule_tac n = n in asum_mem[of "b"])
apply (frule_tac a = "aSum A n a" and c = "aSum A n b" in
pOp_assocTr43 [of _ "a" _ "b"], assumption+) apply simp
apply (frule_tac x = a and y = "aSum A n b" in ag_pOp_commute, assumption+)
apply simp
apply (simp add:pOp_assocTr43[THEN sym])
done
lemma (in aGroup) asum_multTr_pp:"a ∈ carrier A ⟹
aSum A m (aSum A n a) = aSum A (m * n) a"
apply (induct_tac n)
apply simp
apply (induct_tac m, simp)
apply (simp, rule ag_r_zero, simp add:ag_inc_zero)
apply simp
apply (frule_tac n = n in asum_mem[of a])
apply (frule_tac a = "aSum A n a" and b = a and m= m in m_x_asum,
assumption+, simp)
apply (frule_tac n = m and m = "m * n" in asumTr [of a])
apply simp
apply (frule_tac n = "m * n" in asum_mem[of a])
apply (frule_tac n = m in asum_mem[of "a"])
apply (simp add:ag_pOp_commute)
done
lemma (in aGroup) nt_mult_pp:"⟦ a ∈ carrier A; 0 ≤ m; 0 ≤ n⟧
⟹ m▹(n▹a⇘A⇙)⇘A⇙ = (m * n)▹a⇘A⇙"
apply (simp add:sprod_n_a_def)
apply (subgoal_tac "0 ≤ m * n", simp)
apply (simp add:asum_multTr_pp)
apply (simp add:nat_mult_distrib)
apply (frule int_mult_le [of "0" "m" "n"], assumption+)
apply (simp add:mult.commute)
done
lemma (in aGroup) asum_multTr_pm:"⟦a ∈ carrier A; 0 ≤ m; n < 0⟧ ⟹
aSum A (nat m) (aSum A (nat (- n)) (-⇩a a)) =
aSum A (nat (m * (- n))) (-⇩a a)"
apply (frule ag_mOp_closed [of a])
apply (simp add:asum_multTr_pp)
apply (subgoal_tac "nat m * nat (- n) = nat (- (m * n))", simp)
apply (subgoal_tac "(nat m) * (nat (- n)) = nat (m * (- n))", simp)
apply simp
apply (subst zmult_zminus_right[THEN sym, of "m" "n"])
apply (rule nat_mult_distrib [THEN sym, of "m"], assumption+)
done
lemma (in aGroup) nt_mult_pm:"⟦a ∈ carrier A; 0 ≤ m; n < 0⟧ ⟹
m▹(n▹a⇘A⇙)⇘A⇙ = (m * n)▹a⇘A⇙"
apply (frule zmult_zle_mono1_neg [of "0" "m" "n"])
apply (simp add:zless_imp_zle, simp)
apply (simp add:sprod_n_a_def)
apply (rule impI)
apply (simp add: asum_multTr_pm)
done
lemma (in aGroup) asum_multTr_mp:"⟦a ∈ carrier A; m < 0; 0 ≤ n⟧ ⟹
aSum A (nat (-m))(-⇩a (aSum A (nat n) a)) = aSum A (nat ((- m) * n)) (-⇩a a)"
apply (frule asum_mem [of "a" "nat n"])
apply (frule ag_mOp_closed [of "aSum A (nat n) a"])
apply (simp add:sprod_n_a_def)
apply (subgoal_tac "-⇩a (aSum A (nat n) a) = aSum A (nat n) (-⇩a a)")
apply simp
apply (subst asum_multTr_pp)
apply (simp add:ag_mOp_closed)
apply (subgoal_tac "(nat (- m)) * (nat n) = nat ((- m) * n)", simp)
apply (subst nat_mult_distrib, simp, simp)
apply (frule nt_inv0 [of "a" "n"])
apply (simp add:sprod_n_a_def)
done
lemma (in aGroup) nt_mult_mp:"⟦a ∈ carrier A; m < 0; 0 ≤ n⟧ ⟹
m▹(n▹a⇘A⇙)⇘A⇙ = (m * n)▹a⇘A⇙"
apply (simp add:sprod_n_a_def)
apply (cut_tac zless_imp_zle[of m 0])
apply (frule int_mult_le [of "m" "0" "n"], assumption, simp)
apply (case_tac "0 ≤ m * n", simp)
apply (frule zle_imp_zless_or_eq [of "0" "m * n"])
apply (thin_tac "0 ≤ m * n", simp add:zle mult.commute)
apply (simp add:ag_inv_zero, simp add:aSum_zero)
apply simp
apply (simp add:asum_multTr_mp)
apply (simp add:zle_imp_zless_or_eq)
done
lemma (in aGroup) asum_multTr_mm:"⟦a ∈ carrier A; m < 0; n < 0⟧ ⟹
aSum A (nat (-m))(-⇩a (aSum A (nat (- n)) (-⇩a a))) =
aSum A (nat ((- m) * (- n))) a"
apply (simp add:sprod_n_a_def)
apply (subgoal_tac "-⇩a (aSum A (nat (- n)) (-⇩a a)) = aSum A (nat (- n)) a")
apply simp
apply (simp add:asum_multTr_pp)
apply (subst nat_mult_distrib[THEN sym]) apply simp
apply simp
apply (frule ag_mOp_closed [of "a"])
apply (frule nt_inv0 [of "-⇩a a" "- n"])
apply (simp add:sprod_n_a_def)
apply (simp add:ag_inv_inv)
done
lemma (in aGroup) nt_mult_mm:"⟦ a ∈ carrier A; m < 0; n < 0⟧ ⟹
m▹(n▹a⇘A⇙)⇘A⇙ = (m * n)▹a⇘A⇙"
apply (simp add:sprod_n_a_def)
apply (subgoal_tac "0 ≤ m * n") apply simp
apply (simp add:asum_multTr_mm)
apply (frule zmult_neg_neg[of "m" "n"], assumption+)
apply (simp add:zle_imp_zless_or_eq)
done
lemma (in aGroup) nt_mult_assoc0:"a ∈ carrier A ⟹ m▹n▹a⇘A⇙⇘A⇙ = (m * n)▹a⇘A⇙"
apply (case_tac "0 ≤ n")
apply (case_tac "0 ≤ m")
apply (simp add:nt_mult_pp, simp add:zle)
apply (frule nt_mult_mp[of a m n], assumption, simp, simp)
apply (cut_tac less_linear[of 0 m])
apply (case_tac "0 ≤ m")
apply (simp add:nt_mult_pm)
apply (simp add:zle)
apply (simp add:nt_mult_mm)
done
lemma (in aGroup) single_gen_carrTr:"a ∈ carrier A ⟹
asubGroup A {x. ∃n. x = (n▹a⇘A⇙)}"
apply (rule asubg_test)
apply (rule subsetI, simp)
apply (erule exE, simp add:nt_mem0)
apply (simp, blast)
apply ((rule ballI)+, simp)
apply (erule exE)+
apply (simp add:nt_inv0)
apply (subst nt_sum0[THEN sym], assumption+)
apply blast
done
lemma (in aGroup) ag_single_inc_a:"ag_single_gen A a ⟹ a ∈ carrier A"
apply (simp add:ag_single_gen_def)
done
lemma (in aGroup) single_gen:"ag_single_gen A a ⟹
carrier A = {g. ∃n. g = (n▹a⇘A⇙)}"
apply (rule equalityI)
apply (frule ag_single_inc_a [of "a"])
apply (rule subsetI, simp)
apply (unfold ag_single_gen_def, erule conjE)
apply (frule single_gen_carrTr [of "a"])
apply (subgoal_tac "a ∈ {x. ∃n. x = n▹a⇘A⇙}")
apply (subgoal_tac "⋂{H. A +> H ∧ a ∈ H} ⊆ {x. ∃n. x = n▹a⇘A⇙}")
apply (frule_tac A = "⋂{H. A +> H ∧ a ∈ H}" and B = "{x. ∃n. x = n▹a⇘A⇙}" and
c = x in subsetD)
apply (frule sym, thin_tac "carrier A = ⋂{H. A +> H ∧ a ∈ H}")
apply (simp, simp)
apply (thin_tac "carrier A = ⋂{H. A +> H ∧ a ∈ H}")
apply (rule subsetI, blast)
apply (thin_tac "carrier A = ⋂{H. A +> H ∧ a ∈ H}",
thin_tac "A +> {x. ∃n. x = n▹a⇘A⇙}")
apply (subgoal_tac "a = 1▹a⇘A⇙", blast)
apply (simp add:sprod_n_a_def, simp add:ag_l_zero[THEN sym])
apply (fold ag_single_gen_def)
apply (frule ag_single_inc_a [of "a"])
apply (unfold ag_single_gen_def)
apply (erule conjE)
apply (thin_tac "carrier A = ⋂{H. A +> H ∧ a ∈ H}")
apply (rule subsetI, simp)
apply (erule exE)
apply (simp, simp add:nt_mem0)
done
definition
single_gen_free :: "[('a, 'm) aGroup_scheme, 'a] ⇒ bool" where
"single_gen_free A a == ∀n. n ≠ 0 ⟶ 𝟬⇘A⇙ ≠ n▹a⇘A⇙"
definition
sfg :: "[('a, 'm) aGroup_scheme, 'a] ⇒ bool" where
"sfg A a ⟷ ag_single_gen A a ∧ single_gen_free A a"
lemma (in aGroup) single_gen_free_neg:"⟦sfg A a; n▹a⇘A⇙ = 𝟬⟧ ⟹ n = 0"
apply (simp add:sfg_def, erule conjE)
apply (rule contrapos_pp, simp+)
apply (simp add:single_gen_free_def)
apply (drule_tac a = n in forall_spec, simp)
apply simp
done
lemma (in aGroup) sfg_G_inc_a:"sfg A a ⟹ a ∈ carrier A"
apply (simp add:sfg_def ag_single_inc_a)
done
lemma sfg_agroup:"sfg A a ⟹ aGroup A"
apply (simp add:sfg_def ag_single_gen_def)
done
lemma (in aGroup) mem_G_nt:"⟦sfg A a; x ∈ carrier A⟧ ⟹ ∃n. x = n▹a⇘A⇙"
apply (simp add:sfg_def) apply (erule conjE)
apply (frule single_gen [of "a"]) apply simp
done
lemma (in aGroup) nt_mem:"sfg A a ⟹ n▹a⇘A⇙ ∈ carrier A"
apply (frule sfg_G_inc_a)
apply (frule sfg_agroup)
apply (simp add:nt_mem0)
done
lemma (in aGroup) nt_zero:"sfg A a ⟹ 0▹a⇘A⇙ = 𝟬"
apply (frule sfg_G_inc_a)
apply (frule sfg_agroup)
apply (simp add:nt_zero0)
done
lemma (in aGroup) nt_sum:"sfg A a ⟹ (n + m)▹a⇘A⇙ = n▹a⇘A⇙ ± (m▹a⇘A⇙)"
apply (frule sfg_G_inc_a)
apply (frule sfg_agroup)
apply (simp add:nt_sum0)
done
lemma (in aGroup) nt_inv:"sfg A a ⟹ -⇩a(n▹a⇘A⇙) = (- n)▹a⇘A⇙"
apply (frule sfg_G_inc_a)
apply (frule sfg_agroup)
apply (simp add:nt_inv0)
done
lemma (in aGroup) nt_mult_assoc:"sfg A a ⟹ m▹n▹a⇘A⇙⇘A⇙ = (m * n)▹a⇘A⇙"
apply (frule sfg_G_inc_a)
apply (frule sfg_agroup )
apply (simp add:nt_mult_assoc0)
done
lemma (in aGroup) sfg_free:"⟦sfg A a; n ≠ m ⟧ ⟹ n▹a⇘A⇙ ≠ (m▹a⇘A⇙)"
apply (rule contrapos_pp, simp+)
apply (frule sfg_G_inc_a)
apply (frule sfg_agroup )
apply (frule nt_mem [of "a" "m"])
apply (frule nt_mem [of "a" "n"])
apply (subgoal_tac "n▹a⇘A⇙ ± (-⇩a (m▹a⇘A⇙)) = 𝟬")
apply (thin_tac "n▹a⇘A⇙ = m▹a⇘A⇙")
apply (simp add:nt_inv)
apply (simp add:nt_sum[THEN sym])
apply (frule single_gen_free_neg[of "a" "n - m"], assumption+)
apply simp
apply (simp add:ag_r_inv1)
done
lemma (in aGroup) sfg_free_inj:"⟦sfg A a; n▹a⇘A⇙ = (m▹a⇘A⇙) ⟧ ⟹ n = m"
apply (rule contrapos_pp, simp+)
apply (simp add:sfg_free)
done
section "Free Generated Modules (constructive)"
definition
sop_one::"[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a set] ⇒ bool" where
"sop_one R s A ⟷ (∀x∈A. (1⇩r⇘R⇙) ⇩s⋅ x = x)"
definition
sop_assoc :: "[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a set] ⇒ bool" where
"sop_assoc R s A ⟷ (∀a∈carrier R. ∀b∈carrier R. ∀x∈A.
(a ⋅⇩r⇘R⇙ b) ⇩s⋅ x = a ⇩s⋅ (b ⇩s⋅ x))"
definition
sop_inv :: "[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a ⇒ 'a, 'a set]
⇒ bool" where
"sop_inv R s i A ⟷ (∀r∈carrier R. ∀x∈A. r ⇩s⋅ (⇩i- x) = (-⇩a⇘R⇙ r) ⇩s⋅ x)"
definition
sop_distr1 :: "[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a ⇒ 'a ⇒ 'a,
'a ⇒ 'a, 'a set, 'a] ⇒ bool" where
"sop_distr1 R s f i A z ⟷ (∀a∈carrier R. ∀b∈carrier R.
∀x∈(aug_pm_set z i A). (a ±⇘R⇙ b) ⇩s⋅ x = (a ⇩s⋅ x) ⇩f+ (b ⇩s⋅ x))"
definition
sop_distr2 :: "[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a ⇒ 'a ⇒ 'a,
'a ⇒ 'a, 'a set, 'a] ⇒ bool" where
"sop_distr2 R s f i A z ⟷ (∀a∈carrier R.
∀x∈addition_set f (aug_pm_set z i A).
∀y∈addition_set f (aug_pm_set z i A).
a ⇩s⋅ (x ⇩f+ y) = (a ⇩s⋅ x) ⇩f+ (a ⇩s⋅ y))"
definition
sop_z :: "[('r, 'm) Ring_scheme, 'r ⇒ 'a ⇒ 'a, 'a] ⇒ bool" where
"sop_z R s z ⟷ (∀r∈carrier R. r ⇩s⋅ z = z)"
definition
fgmodule :: "[('r, 'm) Ring_scheme, 'a set, 'a, 'a ⇒ 'a, 'a ⇒ 'a ⇒ 'a,
'r ⇒ 'a ⇒ 'a] ⇒ ('a, 'r) Module" where
"fgmodule R A z i f s =
⦇carrier = addition_set f (aug_pm_set z i (s_set R s A)),
pop = λx∈addition_set f (aug_pm_set z i (s_set R s A)).
λy∈addition_set f (aug_pm_set z i (s_set R s A)). x ⇩f+ y,
mop = λx∈addition_set f (aug_pm_set z i (s_set R s A)). ⇩i- x,
zero = z,
sprod = λr∈carrier R.
λx∈addition_set f (aug_pm_set z i (s_set R s A)). r ⇩s⋅ x ⦈"
lemma fgmodule_carr:"carrier (fgmodule R A z i f s) =
addition_set f (aug_pm_set z i (s_set R s A))"
by (simp add:fgmodule_def)
lemma a_in_s_set:"a ∈ A ⟹ a ∈ s_set R s A"
by (simp add:s_set_def)
lemma (in Ring) ra_in_s_set:"⟦r ∈ carrier R; a ∈ A⟧ ⟹ r ⇩s⋅ a ∈ s_set R s A"
by (simp add:s_set_def, blast)
lemma in_aug_pm_set:
"x ∈ aug_pm_set z i A = (x = z ∨ x ∈ A ∨ x ∈ minus_set i A)"
by (simp add:aug_pm_set_def)
lemma (in Ring) in_s_set:"x ∈ s_set R s A ⟹ (∃r ∈ carrier R. ∃a ∈ A.
x = r ⇩s⋅ a ) ∨ x ∈ A"
by (simp add:s_set_def)
lemma (in Ring) sop_closedTr0:"⟦ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A);
sop_one R s (aug_pm_set z i (s_set R s A)); sop_z R s z;
r ∈ carrier R; x ∈ aug_pm_set z i (s_set R s A)⟧ ⟹
r ⇩s⋅ x ∈ aug_pm_set z i (s_set R s A)"
apply (simp add:in_aug_pm_set)
apply (case_tac "x = z", simp, simp add:sop_z_def)
apply (case_tac "x ∈ s_set R s A", simp add:s_set_def, fold s_set_def)
apply (case_tac "x ∈ A", simp, blast)
apply simp
apply ((erule bexE)+, simp)
apply (simp add:sop_assoc_def)
apply (drule_tac x = r in bspec, assumption,
drule_tac x = ra in bspec, assumption,
frule_tac x = a in bspec,
subst in_aug_pm_set, simp add:a_in_s_set)
apply (rotate_tac -1, frule sym, thin_tac "r ⋅⇩r ra ⇩s⋅ a = r ⇩s⋅ (ra ⇩s⋅ a)",
simp)
apply (frule_tac x = r and y = ra in ring_tOp_closed, assumption+, blast)
apply simp apply (thin_tac "x ≠ z", thin_tac "x ∉ s_set R s A")
apply (simp add:minus_set_def, erule bexE, simp)
apply (simp add:sop_inv_def[of R s i "s_set R s A"])
apply (cut_tac ring_is_ag,
frule_tac x = r in aGroup.ag_mOp_closed[of R], assumption)
apply (frule_tac a = y in ra_in_s_set[of "-⇩a r" _ "s_set R s A" s],
assumption+)
apply (frule_tac x = y in in_s_set[of _ s "A"])
apply (case_tac "y ∈ A", simp, simp add:ra_in_s_set)
apply simp apply ((erule bexE)+, simp)
apply (simp add:sop_assoc_def)
apply (drule_tac x = "-⇩a r" in bspec, assumption,
thin_tac "∀r∈carrier R. ∀x∈s_set R s A. r ⇩s⋅ (⇩i- x) = (-⇩a r) ⇩s⋅ x",
drule_tac x = ra in bspec, assumption,
drule_tac x = a in bspec,
simp add:aug_pm_set_def, simp add:a_in_s_set)
apply (rotate_tac -1, frule sym,
thin_tac "(-⇩a r) ⋅⇩r ra ⇩s⋅ a = (-⇩a r) ⇩s⋅ (ra ⇩s⋅ a)", simp,
frule_tac x = "-⇩a r" and y = ra in ring_tOp_closed, assumption,
simp add:ra_in_s_set)
done
lemma (in Ring) sop_closedTr:"⟦ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A);
sop_one R s (aug_pm_set z i (s_set R s A)); sop_z R s z⟧ ⟹
∀r∈carrier R. ∀x∈add_set f (aug_pm_set z i (s_set R s A)) n.
r ⇩s⋅ x ∈ add_set f (aug_pm_set z i (s_set R s A)) n"
apply (induct_tac n)
apply (simp, (rule ballI)+, simp add:sop_closedTr0)
apply (rule ballI)+ apply simp
apply (erule bexE)+
apply (frule_tac r = r and x = t in sop_closedTr0 [of s A i z f],
assumption+)
apply (subgoal_tac "sa ∈ addition_set f (aug_pm_set z i (s_set R s A))")
apply (subgoal_tac "t ∈ addition_set f (aug_pm_set z i (s_set R s A))")
apply (simp add:sop_distr2_def) apply blast
apply (cut_tac addition_inc_add0[of "aug_pm_set z i (s_set R s A)" f])
apply (simp add:subsetD)
apply (cut_tac n = n in addition_inc_add[of f
"aug_pm_set z i (s_set R s A)"])
apply (simp add:subsetD)
done
lemma (in Ring) sop_closed:"⟦ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A);
sop_one R s (aug_pm_set z i (s_set R s A)); sop_z R s z⟧ ⟹
∀r∈carrier R. ∀x∈addition_set f (aug_pm_set z i (s_set R s A)).
r ⇩s⋅ x ∈ addition_set f (aug_pm_set z i (s_set R s A))"
apply (subst addition_set_def)
apply simp
apply (rule ballI) apply (rule allI) apply (rule impI)
apply (erule exE)
apply (rule ballI) apply simp
apply (thin_tac "y = add_set f (aug_pm_set z i (s_set R s A)) n")
apply (frule_tac n = n in sop_closedTr[of s A i z f], assumption+)
apply (drule_tac x = r in bspec, assumption,
drule_tac x = x in bspec, assumption)
apply (cut_tac n = n in addition_inc_add [of f
"aug_pm_set z i (s_set R s A)"],
simp add:subsetD)
done
lemma (in Ring) sop_oneTr:"⟦commute_bpp f (aug_pm_set z i (s_set R s A));
assoc_bpp (aug_pm_set z i (s_set R s A)) f;
ipp_cond1 (s_set R s A) i; ipp_cond2 z (s_set R s A) i f;
ipp_cond3 z i; inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_one R s (aug_pm_set z i (s_set R s A))⟧ ⟹
∀x∈add_set f (aug_pm_set z i (s_set R s A)) n. (1⇩r) ⇩s⋅ x = x"
apply (induct_tac n)
apply (rule ballI, simp, simp add:sop_one_def)
apply (rule ballI)
apply (simp, (erule bexE)+, simp)
apply (subgoal_tac "t ∈ addition_set f (aug_pm_set z i (s_set R s A))")
apply (subgoal_tac "sa ∈ addition_set f (aug_pm_set z i (s_set R s A))")
apply (cut_tac ring_one)
apply (simp add:sop_distr2_def)
apply (thin_tac "∀x∈add_set f (aug_pm_set z i (s_set R s A)) n. (1⇩r) ⇩s⋅ x
= x") apply (simp add:sop_one_def)
apply (cut_tac n = n in addition_inc_add[of f
"aug_pm_set z i (s_set R s A)"], simp add:subsetD,
cut_tac addition_inc_add0[of "aug_pm_set z i (s_set R s A)" f],
simp add:subsetD)
done
lemma (in Ring) sop_one:"⟦commute_bpp f (aug_pm_set z i (s_set R s A));
assoc_bpp (aug_pm_set z i (s_set R s A)) f; ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_one R s (aug_pm_set z i (s_set R s A))⟧ ⟹
∀x∈addition_set f (aug_pm_set z i (s_set R s A)). (1⇩r) ⇩s⋅ x = x"
apply (rule ballI) apply (simp add:addition_set_def)
apply (erule exE, erule conjE, erule exE, simp,
thin_tac "xa = add_set f (aug_pm_set z i (s_set R s A)) n")
apply (simp add:sop_oneTr)
done
lemma (in Ring) sop_assocTr:"⟦ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A);
sop_one R s (aug_pm_set z i (s_set R s A)); sop_z R s z⟧ ⟹
∀a∈carrier R. ∀b∈carrier R.
∀x∈add_set f (aug_pm_set z i (s_set R s A)) n.
a ⇩s⋅ ( b ⇩s⋅ x) = (a ⋅⇩r b) ⇩s⋅ x"
apply (induct_tac n)
apply (rule ballI)+
apply (simp add:sop_assoc_def)
apply (rule ballI)+ apply simp
apply (erule bexE)+
apply (drule_tac x = a in bspec, assumption,
drule_tac x = b in bspec, assumption,
drule_tac x = sa in bspec, assumption)
apply simp
apply (cut_tac n = n in addition_inc_add[of f
"aug_pm_set z i (s_set R s A)"],
cut_tac addition_inc_add0[of "aug_pm_set z i (s_set R s A)" f])
apply (frule_tac c = sa and A = "add_set f (aug_pm_set z i (s_set R s A)) n"
in subsetD[of _ "addition_set f (aug_pm_set z i (s_set R s A))"],
assumption+,
frule_tac c = t in subsetD[of "aug_pm_set z i (s_set R s A)"
"addition_set f (aug_pm_set z i (s_set R s A))"], assumption+,
frule_tac x = a and y = b in ring_tOp_closed, assumption+)
apply (simp add:sop_distr2_def[of R s f i "s_set R s A" z])
apply (frule sop_closed[of s A i z f], assumption+, simp add:sop_distr2_def,
assumption+, rotate_tac -1)
apply (drule_tac x = b in bspec, assumption,
rotate_tac -1,
frule_tac x = sa in bspec, assumption,
drule_tac x = t in bspec, assumption)
apply (simp,
thin_tac "∀a∈carrier R.
∀x∈addition_set f (aug_pm_set z i (s_set R s A)).
∀y∈addition_set f (aug_pm_set z i (s_set R s A)).
a ⇩s⋅ (x ⇩f+ y) = a ⇩s⋅ x ⇩f+ a ⇩s⋅ y")
apply (simp add:sop_assoc_def)
done
lemma (in Ring) sop_assoc:"⟦ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A); sop_z R s z;
sop_one R s (aug_pm_set z i (s_set R s A))⟧ ⟹
∀a∈carrier R. ∀b∈carrier R.
∀x∈addition_set f (aug_pm_set z i (s_set R s A)).
a ⇩s⋅ (b ⇩s⋅ x) = ( a ⋅⇩r b) ⇩s⋅ x"
apply (rule ballI)+ apply (simp add:addition_set_def)
apply (erule exE, erule conjE, erule exE, simp)
apply (simp add:sop_assocTr)
done
lemma (in Ring) s_set_commute:"⟦commute_bpp f (aug_pm_set z i (s_set R s A));
x ∈ addition_set f (aug_pm_set z i (s_set R s A));
y ∈ addition_set f (aug_pm_set z i (s_set R s A))⟧ ⟹
x ⇩f+ y = y ⇩f+ x"
apply (simp add:commute_bpp_def)
done
lemma (in Ring) add_s_set_inc_add_set:"
add_set f (aug_pm_set z i A) n ⊆
add_set f (aug_pm_set z i (s_set R s A)) n"
apply (rule add_set_mono[of "aug_pm_set z i A"
"aug_pm_set z i (s_set R s A)" f n])
apply (rule subsetI, simp add:aug_pm_set_def s_set_def)
apply (case_tac "x = z", simp)
apply (case_tac "x ∈ A", simp)
apply simp
apply (simp add:minus_set_def, erule bexE)
apply blast
done
lemma (in Ring) sop_distr1Tr:"⟦commute_bpp f (aug_pm_set z i (s_set R s A));
assoc_bpp (aug_pm_set z i (s_set R s A)) f; ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr1 R s f i (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A);
sop_one R s (aug_pm_set z i (s_set R s A)); sop_z R s z⟧ ⟹
∀a∈carrier R. ∀b∈carrier R. ∀x∈ add_set f (aug_pm_set z i (s_set R s A)) n.
(a ± b) ⇩s⋅ x = a ⇩s⋅ x ⇩f+ (b ⇩s⋅ x)"
apply (induct_tac n)
apply ((rule ballI)+, simp add:sop_distr1_def)
apply (rule ballI)+ apply simp
apply (erule bexE)+
apply (cut_tac ring_is_ag,
frule_tac x = a and y = b in aGroup.ag_pOp_closed [of "R"],
assumption+)
apply (cut_tac n = n in addition_inc_add[of f
"aug_pm_set z i (s_set R s A)"],
cut_tac addition_inc_add0[of "aug_pm_set z i (s_set R s A)" f])
apply (frule_tac c = sa and A = "add_set f (aug_pm_set z i (s_set R s A)) n"
in subsetD[of _ "addition_set f (aug_pm_set z i (s_set R s A))"],
assumption+,
frule_tac c = t in subsetD[of "aug_pm_set z i (s_set R s A)"
"addition_set f (aug_pm_set z i (s_set R s A))"], assumption+,
frule_tac x = a and y = b in ring_tOp_closed, assumption+)
apply simp
apply (simp add:sop_distr2_def sop_distr1_def)
apply (frule sop_closed[of s A i z f], assumption+,
simp add:sop_distr2_def, simp add:sop_assoc_def, assumption+)
apply (rotate_tac -1,
frule_tac x = a in bspec, assumption,
rotate_tac -1,
frule_tac x = sa in bspec, assumption,
drule_tac x = t in bspec, assumption)
apply (frule_tac x = b in bspec, assumption,
rotate_tac -1,
frule_tac x = sa in bspec, assumption,
drule_tac x = t in bspec, assumption,
thin_tac "∀r∈carrier R.
∀x∈addition_set f (aug_pm_set z i (s_set R s A)).
r ⇩s⋅ x ∈ addition_set f (aug_pm_set z i (s_set R s A))")
apply (frule_tac x = "a ⇩s⋅ t" and y = "b ⇩s⋅ t" in
bpp_closed [of "(aug_pm_set z i (s_set R s A))" "f"], assumption+)
apply (subst addition_assoc, assumption+)
apply (frule_tac ?x1 = "b ⇩s⋅ sa" and ?y1 = "a ⇩s⋅ t" and ?z1 = "b ⇩s⋅ t" in
addition_assoc[THEN sym, of "aug_pm_set z i (s_set R s A)" f],
assumption+, simp,
thin_tac "b ⇩s⋅ sa ⇩f+ (a ⇩s⋅ t ⇩f+ b ⇩s⋅ t) = b ⇩s⋅ sa ⇩f+ a ⇩s⋅ t ⇩f+ b ⇩s⋅ t")
apply (frule_tac x = "b ⇩s⋅ sa" and y = "a ⇩s⋅ t" in
s_set_commute[of f z i s A], assumption+, simp)
apply (frule_tac x = "a ⇩s⋅ t" and y = "b ⇩s⋅ sa" and z = "b ⇩s⋅ t" in
addition_assoc[of "aug_pm_set z i (s_set R s A)" f],
assumption+, simp,
thin_tac "a ⇩s⋅ t ⇩f+ b ⇩s⋅ sa ⇩f+ b ⇩s⋅ t = a ⇩s⋅ t ⇩f+ (b ⇩s⋅ sa ⇩f+ b ⇩s⋅ t)",
frule_tac x = "b ⇩s⋅ sa" and y = "b ⇩s⋅ t" in
bpp_closed [of "(aug_pm_set z i (s_set R s A))" "f"], assumption+,
subst addition_assoc, assumption+, simp)
done
lemma (in Ring) sop_distr1:"⟦commute_bpp f (aug_pm_set z i (s_set R s A));
assoc_bpp (aug_pm_set z i (s_set R s A)) f; ipp_cond1 (s_set R s A) i;
ipp_cond2 z (s_set R s A) i f; ipp_cond3 z i;
inv_ipp z i f (s_set R s A); zeroA z i f (s_set R s A) z;
sop_distr1 R s f i (s_set R s A) z;
sop_distr2 R s f i (s_set R s A) z;
sop_assoc R s (aug_pm_set z i (s_set R s A));
sop_inv R s i (s_set R s A);
sop_one R s (aug_pm_set z i (s_set R s A)); sop_z R s z⟧ ⟹
∀a∈carrier R. ∀b∈carrier R.
∀x∈ addition_set f (aug_pm_set z i (s_set R s A)).
(a ± b) ⇩s⋅ x = a ⇩s⋅ x ⇩f+ (b ⇩s⋅ x)"
apply (rule ballI)+
apply (simp add:addition_set_def)
apply (erule exE, erule conjE, erule exE, simp,
thin_tac "xa = add_set f (aug_pm_set z i (s_set R s A)) n")
apply (simp add:sop_distr1Tr)
done
definition
fgmodule_condition ::"[('r, 'm) Ring_scheme, 'a ⇒ 'a ⇒ 'a, 'a ⇒ 'a,
'r ⇒ 'a ⇒ 'a, 'a set, 'a] ⇒ bool" where
"fgmodule_condition R f i s A z ⟷
commute_bpp f (aug_pm_set z i (s_set R s A)) ∧
assoc_bpp (aug_pm_set z i (s_set R s A)) f ∧
ipp_cond1 (s_set R s A) i ∧ ipp_cond2 z (s_set R s A) i f ∧
ipp_cond3 z i ∧ inv_ipp z i f (s_set R s A) ∧
zeroA z i f (s_set R s A) z ∧ sop_distr1 R s f i (s_set R s A) z ∧
sop_distr2 R s f i (s_set R s A) z ∧
sop_assoc R s (aug_pm_set z i (s_set R s A)) ∧
sop_inv R s i (s_set R s A) ∧
sop_one R s (aug_pm_set z i (s_set R s A)) ∧ sop_z R s z"
lemma (in Ring) sop_closed1:"⟦fgmodule_condition R f i s A z; r ∈ carrier R;
x ∈ addition_set f (aug_pm_set z i (s_set R s A))⟧ ⟹
r ⇩s⋅ x ∈ addition_set f (aug_pm_set z i (s_set R s A))"
apply(simp add:fgmodule_condition_def, (erule conjE)+)
apply (simp add:sop_closed)
done
lemma (in Ring) fgmodule_is_module:"fgmodule_condition R f i s A z
⟹ R module (fgmodule R A z i f s)"
apply (simp add:fgmodule_condition_def, (erule conjE)+)
apply (rule Module.intro)
apply (frule fag_aGroup [of f z i "s_set R s A"], assumption+)
apply (simp add:fag_gen_by_def fgmodule_def, simp add:aGroup_def)
apply (rule allI, rule impI)
apply (simp add:zeroA_def)
apply (rule Module_axioms.intro)
apply (rule Ring_axioms)
apply (simp add:fgmodule_carr, subst fgmodule_def, simp,
simp add:sop_closed)
apply (simp add:fgmodule_carr, (subst fgmodule_def)+, simp,
simp add:sop_closed,
cut_tac ring_is_ag,
frule_tac x = a and y = b in aGroup.ag_pOp_closed, assumption+, simp)
apply (simp add:sop_distr1)
apply (simp add:fgmodule_carr, (subst fgmodule_def)+, simp,
simp add:sop_closed bpp_closed)
apply (simp add:sop_distr2_def)
apply (frule_tac x = a and y = b in ring_tOp_closed, assumption+,
simp add:fgmodule_carr, (subst fgmodule_def)+, simp,
simp add:sop_closed bpp_closed)
apply (simp add:sop_assoc)
apply (cut_tac ring_one)
apply (simp add:fgmodule_carr, (subst fgmodule_def)+, simp)
apply (simp add:sop_one)
done
lemma (in Ring) a_in_carr_fgmodule:"a ∈ A
⟹ a ∈ carrier (fgmodule R A z i f s)"
apply (simp add:fgmodule_carr)
apply (cut_tac addition_inc_add0[of "aug_pm_set z i (s_set R s A)"],
rule subsetD[of "aug_pm_set z i (s_set R s A)"
"addition_set f (aug_pm_set z i (s_set R s A))" a], assumption)
apply (simp add:aug_pm_set_def s_set_def)
done
section "A fgmodule and a free module"
lemma (in Ring) fg_zeroTr:"⟦fgmodule_condition R f i s A z; a ∈ A⟧ ⟹
𝟬 ⇩s⋅ a = z"
apply (frule fgmodule_is_module [of f i s A z])
apply (frule a_in_carr_fgmodule[of a A z i f s])
apply (frule Module.sc_0_m [of "fgmodule R A z i f s" R "a"],
simp add:a_in_carr_fgmodule)
apply (cut_tac ring_zero,
simp add:fgmodule_def)
done
lemma (in Ring) fg_genTr0:"⟦fgmodule_condition R f i s A z;
x ∈ aug_pm_set z i (s_set R s A)⟧ ⟹
x ∈ linear_span R (fgmodule R A z i f s) (carrier R) A"
apply (simp add:aug_pm_set_def s_set_def)
apply (case_tac "x = z")
apply simp
apply (simp add:linear_span_def)
apply (case_tac "A = {}", simp, simp add:fgmodule_def)
apply simp
apply (frule nonempty_ex[of "A"], thin_tac "A ≠ {}")
apply (erule exE)
apply (subgoal_tac "(λj∈{j. j ≤ (0::nat)}. xa) ∈ {j. j ≤ (0::nat)} → A")
apply (subgoal_tac "(λk∈{j. j ≤ (0::nat)}. 𝟬) ∈ {j. j ≤ (0::nat)} →
carrier R")
apply (subgoal_tac "z = l_comb R (fgmodule R A z i f s) 0
(λk∈{j. j ≤ (0::nat)}. 𝟬) (λj∈{j. j ≤ (0::nat)}. xa)") apply blast
apply (simp add:l_comb_def)
apply (frule_tac a1 = xa in fg_zeroTr [THEN sym, of f i s A z],
assumption+)
apply (frule_tac a = xa in a_in_carr_fgmodule [of _ A z i f s])
apply (frule fgmodule_is_module [of f i s A z])
apply (cut_tac ring_zero, simp add:fgmodule_def)
apply (simp add:ring_zero)
apply (simp)
apply (case_tac "x ∈ A",
frule_tac x = x and A = A in nonempty,
simp add:linear_span_def)
apply (subgoal_tac "(λj∈{j. j ≤ (0::nat)}. x) ∈ {j. j ≤ (0::nat)} → A")
apply (subgoal_tac "(λk∈{j. j ≤ (0::nat)}. 1⇩r) ∈ {j. j ≤ (0::nat)} →
carrier R")
apply (subgoal_tac "x = l_comb R (fgmodule R A z i f s) 0
(λk∈{j. j ≤ (0::nat)}. 1⇩r) (λj∈{j. j ≤ (0::nat)}. x)")
apply blast
apply (simp add:l_comb_def)
apply (frule fgmodule_is_module [of f i s A z])
apply (frule_tac a = x in a_in_carr_fgmodule[of _ A z i f s])
apply (simp add:fgmodule_def, fold fgmodule_def,
simp add:ring_one, simp add:fgmodule_condition_def,
(erule conjE)+, simp add:sop_one)
apply (simp add:ring_one)
apply (simp)
apply (case_tac "∃r∈carrier R. ∃a∈A. x = r ⇩s⋅ a")
apply ((erule bexE)+, simp)
apply (frule_tac x = a and A = A in nonempty, simp add:linear_span_def)
apply (subgoal_tac "(λj∈{j. j ≤ (0::nat)}. a) ∈ {j. j ≤ (0::nat)} → A")
apply (subgoal_tac "(λk∈{j. j ≤ (0::nat)}. r) ∈ {j. j ≤ (0::nat)} →
carrier R")
apply (subgoal_tac "r ⇩s⋅ a = l_comb R (fgmodule R A z i f s) 0
(λk∈{j. j ≤ (0::nat)}. r) (λj∈{j. j ≤ (0::nat)}. a)")
apply blast
apply (frule_tac a = a in a_in_carr_fgmodule[of _ A z i f s])
apply (simp add:l_comb_def fgmodule_def)
apply (simp)
apply (simp)
apply (simp add:minus_set_def,
thin_tac "x ≠ z", thin_tac "x ∉ A",
thin_tac "∀r∈carrier R. ∀a∈A. x ≠ r ⇩s⋅ a")
apply (erule bexE)
apply simp
apply (erule disjE)
apply ((erule bexE)+, simp)
apply (frule fgmodule_is_module [of f i s A z])
apply (frule_tac a = r and m = a in
Module.sc_minus_am1[of "fgmodule R A z i f s" R], assumption+)
apply (frule_tac a = a in a_in_carr_fgmodule[of _ A z i f s], assumption)
apply (cut_tac ring_is_ag,
frule_tac x = r in aGroup.ag_mOp_closed, assumption+)
apply (frule_tac a = a in a_in_carr_fgmodule[of _ A z i f s])
apply (simp add:fgmodule_def, fold fgmodule_def,
simp add:sop_closed1)
apply (frule_tac x = a and A = A in nonempty, simp add:linear_span_def)
apply (subgoal_tac "(λj∈{j. j ≤ (0::nat)}. a) ∈ {j. j ≤ (0::nat)} → A")
apply (subgoal_tac "(λk∈{j. j ≤ (0::nat)}. (-⇩a r)) ∈ {j. j ≤ (0::nat)} →
carrier R")
apply (subgoal_tac "(-⇩a r) ⇩s⋅ a = l_comb R (fgmodule R A z i f s) 0
(λk∈{j. j ≤ (0::nat)}. (-⇩a r)) (λj∈{j. j ≤ (0::nat)}. a)")
apply blast
apply (simp add:l_comb_def fgmodule_def)
apply (simp)
apply (simp)
apply (frule_tac x = y and A = A in nonempty, simp add:linear_span_def)
apply (subgoal_tac "(λj∈{j. j ≤ (0::nat)}. y) ∈ {j. j ≤ (0::nat)} → A")
apply (subgoal_tac "(λk∈{j. j ≤ (0::nat)}. (-⇩a 1⇩r)) ∈ {j. j ≤ (0::nat)} →
carrier R")
apply (subgoal_tac "⇩i- y = l_comb R (fgmodule R A z i f s) 0
(λk∈{j. j ≤ (0::nat)}. (-⇩a 1⇩r)) (λj∈{j. j ≤ (0::nat)}. y)")
apply blast
apply (simp add:l_comb_def)
apply (frule fgmodule_is_module [of "f" "i" "s" "A" "z"])
apply (frule_tac a = y in a_in_carr_fgmodule [of _ A z i f s])
apply (cut_tac ring_one , cut_tac ring_is_ag,
frule aGroup.ag_mOp_closed [of R "1⇩r"], assumption)
apply (simp add:Module.sc_minus_am1[THEN sym, of "fgmodule R A z i f s" R])
apply (simp add:Module.sprod_one)
apply (simp add:fgmodule_def)
apply (rule Pi_I, simp,
cut_tac ring_one, cut_tac ring_is_ag,
simp add:aGroup.ag_mOp_closed[of R])
apply (simp)
done
lemma (in Ring) fg_genTr:"fgmodule_condition R f i s A z ⟹
∀x. x ∈ (add_set f (aug_pm_set z i (s_set R s A)) n) ⟶
x ∈ linear_span R (fgmodule R A z i f s) (carrier R) A"
apply (induct_tac n)
apply (rule allI, rule impI, simp)
apply (simp add:fg_genTr0)
apply (rule allI, rule impI, simp)
apply (erule bexE)+
apply (drule_tac x = sa in spec)
apply simp
apply (frule_tac x = t in fg_genTr0[of f i s A z], assumption+)
apply (cut_tac whole_ideal)
apply (frule fgmodule_is_module[of f i s A z])
apply (frule_tac a = sa and b = t in Module.linear_span_pOp_closed[of
"fgmodule R A z i f s" R "carrier R" A], assumption+,
rule subsetI, simp add:a_in_carr_fgmodule, assumption+)
apply (cut_tac n = n in addition_inc_add[of f "aug_pm_set z i (s_set R s A)"],
cut_tac addition_inc_add0[of "aug_pm_set z i (s_set R s A)" f],
frule_tac c = sa and A = "add_set f (aug_pm_set z i (s_set R s A)) n"
in subsetD[of _ "addition_set f (aug_pm_set z i (s_set R s A))"],
assumption+,
frule_tac c = t and A = "aug_pm_set z i (s_set R s A)"
in subsetD[of _ "addition_set f (aug_pm_set z i (s_set R s A))"],
assumption+)
apply (simp add:fgmodule_def)
done
lemma (in Ring) generator_of_fgm:"fgmodule_condition R f i s A z ⟹
generator R (fgmodule R A z i f s) A"
apply (cut_tac whole_ideal)
apply (simp add:generator_def)
apply (frule fgmodule_is_module [of f i s A z])
apply (rule conjI)
apply (rule subsetI, simp add:a_in_carr_fgmodule)
apply (frule Module.linear_span_sub[of "fgmodule R A z i f s" R
"carrier R" A], assumption+)
apply (rule subsetI,
simp add:a_in_carr_fgmodule)
apply (rule equalityI, assumption,
thin_tac "linear_span R (fgmodule R A z i f s) (carrier R) A
⊆ carrier (fgmodule R A z i f s)")
apply (rule subsetI)
apply (simp add:fgmodule_carr, simp add:addition_set_def)
apply (erule exE, erule conjE, erule exE, simp)
apply (simp add: fg_genTr)
done
lemma (in Ring) fg_freeTr1:"⟦R module M; free_generator R M A;
R module fgmodule R A z i f s; free_generator R (fgmodule R A z i f s) A;
g ∈ mHom R M (fgmodule R A z i f s); ∀x∈A. g x = x⟧ ⟹
∀fa sa. fa ∈ {j. j ≤ (n::nat)} → A ∧ sa ∈ {j. j ≤ n} → carrier R ⟶
l_comb R (fgmodule R A z i f s) n sa (cmp g fa) =
l_comb R (fgmodule R A z i f s) n sa fa"
apply (induct_tac n, (rule allI)+, rule impI, erule conjE)
apply (simp add:l_comb_def)
apply (simp add:cmp_def)
apply ((rule allI)+, rule impI, erule conjE)
apply (frule_tac f = fa and n = n and A = A in func_pre,
frule_tac f = sa and n = n and A = "carrier R" in func_pre)
apply (drule_tac x = fa in spec,
drule_tac x = sa in spec, simp)
apply (frule_tac s = sa and f = fa and n = n in Module.l_comb_Suc[of
"fgmodule R A z i f s" R A "carrier R"],
rule subsetI,simp add:a_in_carr_fgmodule,
cut_tac whole_ideal, simp, assumption+, simp)
apply (frule_tac s = sa and f = "cmp g fa" and n = n in Module.l_comb_Suc[of
"fgmodule R A z i f s" R A "carrier R"],
rule subsetI,simp add:a_in_carr_fgmodule,
cut_tac whole_ideal, simp, simp,
rule Pi_I, simp add:cmp_def,
frule_tac x = x and f = fa and A = "{j. j ≤ Suc n}" and B = A
in funcset_mem, simp+)
apply (frule_tac x = "Suc n" and f = fa and A = "{j. j ≤ Suc n}" and B = A
in funcset_mem, simp+, simp add:cmp_def)
done
lemma (in Ring) fg_freeTr:"⟦R module M; free_generator R M A;
R module fgmodule R A z i f s;
free_generator R (fgmodule R A z i f s) A;
g ∈ mHom R M (fgmodule R A z i f s); ∀x∈A. g x = x;
fa ∈ {j. j ≤ (n::nat)} → A; sa ∈ {j. j ≤ n} → carrier R⟧ ⟹
l_comb R (fgmodule R A z i f s) n sa (cmp g fa) =
l_comb R (fgmodule R A z i f s) n sa fa"
apply (simp add:fg_freeTr1)
done
lemma (in Ring) fg_free1:"⟦ A ≠ {}; fgmodule_condition R f i s A z;
free_generator R (fgmodule R A z i f s) A; R module M;
free_generator R M A⟧ ⟹ M ≅⇘R⇙ (fgmodule R A z i f s)"
apply (subgoal_tac "(λx∈A. x) ∈ A → carrier (fgmodule R A z i f s)")
prefer 2
apply (rule Pi_I, simp, simp add:a_in_carr_fgmodule)
apply (frule fgmodule_is_module [of f i s A z])
apply (frule Module.exist_extension_mhom[of M R "fgmodule R A z i f s" A
"λx∈A. x"], assumption+)
apply (erule bexE)
apply (thin_tac "(λx∈A. x) ∈ A → carrier (fgmodule R A z i f s)")
apply (simp add:misomorphic_def)
apply (subgoal_tac "bijec⇘M,(fgmodule R A z i f s)⇙ g", blast)
apply (simp add:bijec_def)
apply (rule conjI)
apply (simp add:injec_def)
apply (rule conjI, simp add:mHom_def)
apply (rule equalityI)
apply (rule subsetI)
apply (simp add:ker_def, erule conjE)
apply (frule Module.free_generator_generator[of M R A], assumption)
apply (simp add:generator_def, erule conjE)
apply (rotate_tac -1, frule sym,
thin_tac "linear_span R M (carrier R) A = carrier M",
frule_tac a = x and A = "carrier M" and
B = "linear_span R M (carrier R) A" in eq_set_inc, assumption+,
thin_tac "carrier M = linear_span R M (carrier R) A",
simp add:linear_span_def)
apply (erule exE, (erule bexE)+)
apply (cut_tac whole_ideal)
apply (frule_tac s = sa and n = n and f = fa and H = A in
Module.same_together[of M R "carrier R"], assumption+)
apply ((erule bexE)+, erule conjE)
apply (fold l_comb_def[of R M], simp)
apply (frule_tac f = g and s = t and n = "card (fa ` {j. j ≤ n}) - Suc 0"
and g = ga in Module.linmap_im_lincomb[of M R "carrier R"
"fgmodule R A z i f s" _ A], assumption+)
apply (frule_tac f = fa and A = "{j. j ≤ n}" in img_subset[of _ _ A],
frule_tac f = ga and A = "{j. j ≤ card (fa ` {j. j ≤ n}) - Suc 0}"
and B = "fa ` {j. j ≤ n}" and ?B1.0 = A in extend_fun, assumption+)
apply (rotate_tac -1, frule sym,
thin_tac "g (l_comb R M (card (fa ` {j. j ≤ n}) - Suc 0) t ga) =
l_comb R (fgmodule R A z i f s) (card (fa ` {j. j ≤ n}) - Suc 0) t
(cmp g ga)", simp)
apply (frule_tac g = g and fa = ga and sa = t and
n = "card (fa ` {j. j ≤ n}) - Suc 0" in fg_freeTr[of M A z i f s],
assumption+)
apply (frule_tac f = fa and A = "{j. j ≤ n}" in img_subset[of _ _ A],
frule_tac f = ga and A = "{j. j ≤ card (fa ` {j. j ≤ n}) - Suc 0}"
and B = "fa ` {j. j ≤ n}" and ?B1.0 = A in extend_fun, assumption+)
apply simp
apply (cut_tac k = n in finite_Collect_le_nat,
cut_tac k = "card (fa ` {j. j ≤ n}) - Suc 0" in finite_Collect_le_nat,
cut_tac F = "{j. j ≤ n}" and h = fa in finite_imageI,
assumption)
apply (frule_tac f = fa and A = "{j. j ≤ n}" and B = A and a = 0 in
mem_in_image, simp,
frule_tac x = "fa 0" and A = "fa ` {j. j ≤ n}" in nonempty,
frule_tac A = "fa ` {j. j ≤ n}" in nonempty_card_pos, assumption)
apply (frule_tac A = "fa ` {j. j ≤ n}" and
n = "card (fa ` {j. j ≤ n}) - Suc 0" and f = ga in Nset2finite_inj,
simp, assumption)
apply (frule Module.free_generator_sub[of "fgmodule R A z i f s" R A],
assumption)
apply (frule_tac s = t and m = ga and n = "card (fa ` {j. j ≤ n}) - Suc 0"
in Module.unique_expression1[of "fgmodule R A z i f s" R A],
assumption+)
apply (frule_tac f = fa and A = "{j. j ≤ n}" in img_subset[of _ _ A],
rule_tac f = ga and A = "{j. j ≤ card (fa ` {j. j ≤ n}) - Suc 0}"
and B = "fa ` {j. j ≤ n}" and ?B1.0 = A in extend_fun, assumption+)
apply (rule_tac s = t and n = "card (fa ` {j. j ≤ n}) - Suc 0" and
m = ga in Module.linear_comb0_1[of M R A], assumption+,
simp)
apply (frule_tac f = fa and A = "{j. j ≤ n}" in img_subset[of _ _ A],
rule_tac f = ga and A = "{j. j ≤ card (fa ` {j. j ≤ n}) - Suc 0}"
and B = "fa ` {j. j ≤ n}" and ?B1.0 = A in extend_fun, assumption+)
apply (simp add:ker_def,
frule Module.module_is_ag[of M],
simp add: aGroup.ag_inc_zero[of M],
simp add:Module.mHom_0)
apply (simp add:surjec_def,
rule conjI, simp add:mHom_def)
apply (rule surj_to_test, simp add:mHom_def aHom_def)
apply (rule ballI)
apply (frule Module.free_generator_generator[of "fgmodule R A z i f s" R A],
assumption+)
apply (cut_tac generator_def[of R "fgmodule R A z i f s" A], simp,
erule conjE, rotate_tac -1, frule sym,
thin_tac "linear_span R (fgmodule R A z i f s) (carrier R) A =
carrier (fgmodule R A z i f s)", simp,
thin_tac "carrier (fgmodule R A z i f s) =
linear_span R (fgmodule R A z i f s) (carrier R) A",
thin_tac "A ⊆ linear_span R (fgmodule R A z i f s) (carrier R) A",
thin_tac "generator R (fgmodule R A z i f s) A ≡ True")
apply (simp add:linear_span_def, erule exE, (erule bexE)+)
apply (frule_tac g1 = g and fa1 = fa and n1 = n and sa1 = sa in
fg_freeTr[THEN sym, of M A z i f s], assumption+, simp,
thin_tac "l_comb R (fgmodule R A z i f s) n sa fa =
l_comb R (fgmodule R A z i f s) n sa (cmp g fa)")
apply (frule_tac f1 = g and s1 = sa and g1 = fa and n1 = n in
Module.linmap_im_lincomb[THEN sym, of M R "carrier R"
"fgmodule R A z i f s" _ A],
simp add:whole_ideal, assumption+,
simp add:Module.free_generator_sub, assumption+, simp)
apply (cut_tac whole_ideal,
frule_tac s = sa and n = n and m = fa in
Module.l_comb_mem[of M R "carrier R" A], assumption+,
simp add:Module.free_generator_sub, assumption+)
apply blast
done
lemma (in Ring) fg_free:"⟦fgmodule_condition R f i s A z;
free_generator R (fgmodule R A z i f s) A; R module M;
free_generator R M A⟧ ⟹ M ≅⇘R⇙ (fgmodule R A z i f s)"
apply (case_tac "A = {}")
apply (simp add:free_generator_def generator_def linear_span_def)
apply (erule conjE)+
apply (cut_tac fgmodule_is_module[of f i s A z])
apply (rule Module.Modules_single_carrier_isom[of M R "fgmodule R {} z i f s"],
assumption+, simp, rule sym, assumption, rule sym, assumption, simp)
apply (simp add: fg_free1)
done
section "Direct sum, again"
definition
miota :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme] ⇒ 'a ⇒ 'a" where
"miota R M1 M = (λx∈carrier M1. x)"
definition
msubmodule ::"[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme] ⇒ bool" where
"msubmodule R M M1 ⟷ miota R M1 M ∈ mHom R M1 M ∧
(carrier M1) ⊆ (carrier M)"
definition
ds2 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme, ('a, 'r, 'm1) Module_scheme] ⇒ bool" where
"ds2 R M M1 M2 ⟷ R module M ∧ msubmodule R M M1 ∧ msubmodule R M M2 ∧
(∀x∈carrier M. ∃m1∈carrier M1. ∃m2∈carrier M2. x = m1 ±⇘M⇙ m2) ∧
(carrier M1) ∩ (carrier M2) = {𝟬⇘M⇙}"
abbreviation
DS2 ("(4_/ ⨁⇘_,_⇙ _)" [92,93,92,92]92) where
"M1 ⨁⇘R,M⇙ M2 == ds2 R M M1 M2"
lemma (in Ring) ds2_commute:"⟦R module M1; R module M2; R module M;
M1 ⨁⇘R,M⇙ M2⟧ ⟹ M2 ⨁⇘R,M⇙ M1"
apply (simp add:ds2_def)
apply (erule conjE)+
apply (subst Int_commute, simp)
apply (rule ballI,
drule_tac x = x in bspec, assumption,
(erule bexE)+)
apply (simp add:msubmodule_def, (erule conjE)+,
frule_tac c = m1 in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac c = m2 in subsetD[of "carrier M2" "carrier M"], assumption+)
apply (frule Module.module_is_ag[of M R],
frule_tac x = m1 and y = m2 in aGroup.ag_pOp_commute, assumption+,
simp)
apply blast
done
lemma (in Ring) msub_addition:"⟦R module M; R module M1; msubmodule R M M1;
x ∈ carrier M1; y ∈ carrier M1⟧ ⟹ x ±⇘M1⇙ y = x ±⇘M⇙ y"
apply (simp add:msubmodule_def, (erule conjE)+)
apply (frule Module.mHom_add[of M1 R M "miota R M1 M" x y], assumption+)
apply (frule Module.module_is_ag[of M1],
frule aGroup.ag_pOp_closed[of M1 x y], assumption+,
simp add:miota_def)
done
lemma (in Ring) msub_mOp:"⟦R module M; R module M1; msubmodule R M M1;
x ∈ carrier M1⟧ ⟹ -⇩a⇘M1⇙ x = -⇩a⇘M⇙ x"
apply (simp add:msubmodule_def, (erule conjE)+)
apply (frule Module.module_is_ag[of M1],
frule_tac x = x in aGroup.ag_mOp_closed[of M1], assumption+)
apply (frule Module.mHom_inv[of M1 R M x "miota R M1 M"], assumption+,
simp add:miota_def)
done
lemma (in Ring) msub_sprod:"⟦R module M; R module M1; msubmodule R M M1;
a ∈ carrier R; x ∈ carrier M1⟧ ⟹ a ⋅⇩s⇘M1⇙ x = a ⋅⇩s⇘M⇙ x"
apply (simp add:msubmodule_def, (erule conjE)+)
apply (frule Module.mHom_lin[of M1 R M x "miota R M1 M" a], assumption+)
apply (frule Module.sc_mem[of M1 R a x], assumption+)
apply (simp add:miota_def)
done
lemma (in Ring) msub_submodule:"⟦R module M; R module M1; msubmodule R M M1⟧
⟹ submodule R M (carrier M1)"
apply (simp add:submodule_def msubmodule_def, erule conjE)
apply (rule conjI)
apply (frule Module.module_is_ag[of M R],
frule Module.module_is_ag[of M1 R])
apply (rule aGroup.asubg_test, assumption+,
frule Module.module_inc_zero[of M1 R], blast)
apply ((rule ballI)+,
frule_tac x = b in aGroup.ag_mOp_closed[of M1], assumption+)
apply (frule_tac m = a and n = "-⇩a⇘M1⇙ b" in Module.mHom_add[of M1 R M
"miota R M1 M"], assumption+,
frule_tac x = a and y = "-⇩a⇘M1⇙ b" in aGroup.ag_pOp_closed,
assumption+, simp add:miota_def)
apply (frule_tac m = b in Module.mHom_inv[of M1 R M _ "miota R M1 M"],
assumption+, simp add:miota_def, simp add:miota_def)
apply ((rule allI)+, rule impI, erule conjE)
apply (frule_tac m = m and a = a in Module.mHom_lin [of M1 R M _
"miota R M1 M" _], assumption+)
apply (frule_tac a = a and m = m in Module.sc_mem[of M1 R], assumption+)
apply (simp add:miota_def)
done
lemma (in Ring) ds2_unique:"⟦R module M; R module M1; R module M2;
ds2 R M M1 M2; m1 ∈ carrier M1; m1' ∈ carrier M1;
m2 ∈ carrier M2; m2' ∈ carrier M2;
m1 ±⇘M⇙ m2 = m1' ±⇘M⇙ m2'⟧ ⟹ m1 = m1' ∧ m2 = m2'"
apply (frule msub_submodule [of M M1], assumption+,
simp add:ds2_def)
apply (frule msub_submodule [of M M2], assumption+,
simp add:ds2_def)
apply (frule Module.submodule_subset[of M R "carrier M1"], assumption,
frule Module.submodule_subset[of M R "carrier M2"], assumption)
apply (frule subsetD [of "carrier M1" "carrier M" m1], assumption+,
frule subsetD [of "carrier M1" "carrier M" m1'], assumption+,
frule subsetD [of "carrier M2" "carrier M" "m2"], assumption+,
frule subsetD [of "carrier M2" "carrier M" "m2'"], assumption+)
apply (frule_tac Module.module_is_ag[of M R],
frule_tac x = m1 and y = m2 in aGroup.ag_pOp_closed, assumption+,
frule_tac x = m1' and y = m2' in aGroup.ag_pOp_closed, assumption+,
frule_tac x = m2' in aGroup.ag_mOp_closed, assumption+,
frule_tac x = m2 in aGroup.ag_mOp_closed, assumption+)
apply (frule_tac a = "m1 ±⇘M⇙ m2" and b = "m1' ±⇘M⇙ m2'" and c = "-⇩a⇘M⇙ m2" in
aGroup.ag_pOp_add_r, assumption+,
thin_tac "m1 ±⇘M⇙ m2 = m1' ±⇘M⇙ m2'",
simp add:aGroup.ag_pOp_assoc[of M m1 m2 "-⇩a⇘M⇙ m2"]
aGroup.ag_r_inv1 aGroup.ag_r_zero,
simp add:aGroup.ag_pOp_assoc[of M m1' m2' "-⇩a⇘M⇙ m2"],
frule_tac x = m2' and y = "-⇩a⇘M⇙ m2" in aGroup.ag_pOp_closed,
assumption+,
frule_tac x = m1' in aGroup.ag_mOp_closed, assumption+,
frule_tac x = m1' and y = "m2' ±⇘M⇙ -⇩a⇘M⇙ m2" in
aGroup.ag_pOp_closed, assumption+,
frule_tac a = m1 and b = "m1' ±⇘M⇙ (m2' ±⇘M⇙ -⇩a⇘M⇙ m2)" and
c = "-⇩a⇘M⇙ m1'" in aGroup.ag_pOp_add_l[of M], simp, assumption+)
apply (frule aGroup.ag_pOp_assoc[THEN sym, of M "-⇩a⇘M⇙ m1'" "m1'"
"(m2' ±⇘M⇙ -⇩a⇘M⇙ m2)"],
assumption+)
apply (rotate_tac -6, frule sym, thin_tac "m1 = m1' ±⇘M⇙ (m2' ±⇘M⇙ -⇩a⇘M⇙ m2)",
thin_tac "-⇩a⇘M⇙ m1' ±⇘M⇙ m1 = -⇩a⇘M⇙ m1' ±⇘M⇙ (m1' ±⇘M⇙ (m2' ±⇘M⇙ -⇩a⇘M⇙ m2))",
simp, simp add:aGroup.ag_l_inv1 aGroup.ag_l_zero)
apply (frule Module.submodule_mOp_closed [of M R "carrier M1" m1'],
assumption+,
frule Module.submodule_pOp_closed [of M R "carrier M1" "-⇩a⇘M⇙ m1'"
m1], assumption+,
frule Module.submodule_pOp_closed [of M R "carrier M2" m2' "-⇩a⇘M⇙ m2"],
assumption+,
rule Module.submodule_mOp_closed [of M R "carrier M2" m2], assumption+)
apply (subgoal_tac "(-⇩a⇘M⇙ m1' ±⇘M⇙ m1) ∈ carrier M1 ∩ carrier M2")
prefer 2 apply simp
apply (subgoal_tac "carrier M1 ∩ carrier M2 = {𝟬⇘M⇙}")
apply (frule sym, thin_tac "-⇩a⇘M⇙ m1' ±⇘M⇙ m1 = m2' ±⇘M⇙ -⇩a⇘M⇙ m2")
apply simp
apply (simp add:aGroup.ag_eq_diffzero[THEN sym, of M m2' m2] aGroup.ag_r_zero)
apply (simp add:ds2_def)
done
lemma (in Ring) miota_injec:"⟦R module M; R module M1; R module M2;
ds2 R M M1 M2; msubmodule R M M1⟧ ⟹
miota R M1 M ∈ mHom R M1 M ∧ injec⇘M1,M⇙ (miota R M1 M)"
apply (rule conjI)
apply (simp add:msubmodule_def)
apply (simp add:injec_def)
apply (rule conjI)
apply (simp add:msubmodule_def mHom_def)
apply (rule equalityI)
prefer 2
apply (rule subsetI, simp, simp add:ker_def)
apply (simp add:Module.module_inc_zero, simp add:msubmodule_def)
apply (erule conjE)
apply (simp add:Module.mHom_0)
apply (rule subsetI)
apply (simp add:ker_def, erule conjE)
apply (simp add:miota_def, simp add:msubmodule_def)
apply (erule conjE)
apply (frule Module.mHom_0 [of M1 R M "miota R M1 M"], assumption+)
apply (frule Module.module_inc_zero [of M1 R])
apply (simp add:miota_def)
done
definition
mproj1 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme, ('a, 'r, 'm1) Module_scheme] ⇒ 'a ⇒ 'a" where
"mproj1 R M1 M2 M = (λx∈carrier M. THE x1. x1 ∈ carrier M1 ∧
(x ±⇘M⇙ (-⇩a⇘M⇙ x1)) ∈ carrier M2)"
definition
mproj2 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme, ('a, 'r, 'm1) Module_scheme] ⇒ 'a ⇒ 'a" where
"mproj2 R M1 M2 M = mproj1 R M2 M1 M"
lemma (in Ring) ds2_components:"⟦R module M1; R module M2; R module M;
M1 ⨁⇘R,M⇙ M2; a ∈ carrier M⟧ ⟹
∃a1∈carrier M1. ∃a2∈carrier M2. a = a1 ±⇘M⇙ a2"
by (simp add:ds2_def)
lemma (in Ring) ds2_components1:"⟦R module M1; R module M2; R module M;
M1 ⨁⇘R,M⇙ M2; a ∈ carrier M⟧ ⟹
∃a1∈carrier M1. a ±⇘M⇙ -⇩a⇘M⇙ a1 ∈ carrier M2"
apply (frule ds2_components[of M1 M2 M a], assumption+, (erule bexE)+,
frule Module.module_is_ag[of M R],
unfold ds2_def, frule conjunct2[THEN conjunct1],
frule conjunct2[THEN conjunct2[THEN conjunct1]], fold ds2_def)
apply (simp add:msubmodule_def, (erule conjE)+)
apply (frule_tac c = a1 in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac c = a2 in subsetD[of "carrier M2" "carrier M"], assumption+)
apply (frule Module.module_is_ag[of M],
frule_tac x = a1 and y = a2 in aGroup.ag_pOp_commute, assumption+,
simp)
apply (frule_tac x = a1 and y = a2 in aGroup.ag_pOp_closed[of M], assumption+,
frule_tac x = a1 in aGroup.ag_mOp_closed[of M], assumption+,
frule_tac a = "a1 ±⇘M⇙ a2" and b = "a2 ±⇘M⇙ a1" and c = "-⇩a⇘M⇙ a1" in
aGroup.ag_pOp_add_r[of M], assumption+,
frule_tac x = a2 and y = a1 and z = "-⇩a⇘M⇙ a1" in
aGroup.ag_pOp_assoc[of M], assumption+,
simp add:aGroup.ag_r_inv1 aGroup.ag_r_zero)
apply (thin_tac "a2 ±⇘M⇙ a1 ∈ carrier M",
thin_tac "a = a2 ±⇘M⇙ a1",
thin_tac "a2 ∈ carrier M",
thin_tac "a1 ±⇘M⇙ a2 = a2 ±⇘M⇙ a1",
frule sym, thin_tac "a2 ±⇘M⇙ a1 ±⇘M⇙ -⇩a⇘M⇙ a1 = a2")
apply (frule_tac a = a2 and b = "a2 ±⇘M⇙ a1 ±⇘M⇙ -⇩a⇘M⇙ a1" in
eq_elem_in[of _ "carrier M2"], assumption, blast)
done
lemma (in Ring) mprojTr1:"⟦R module M1; R module M2; R module M; ds2 R M M1 M2;
x ∈ carrier M ⟧ ⟹ ∃!x1. x1 ∈ carrier M1 ∧ (x ±⇘M⇙ -⇩a⇘M⇙ x1) ∈ carrier M2"
apply (frule Module.module_is_ag[of M R])
apply (rule ex_ex1I)
apply (frule ds2_components1 [of M1 M2 M x], assumption+, erule bexE, blast)
apply (simp add:ds2_def, (erule conjE)+, simp add:msubmodule_def,
(erule conjE)+,
frule_tac c = x1 in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac x = x1 in aGroup.ag_mOp_closed, assumption+,
frule_tac c = y in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac x = y in aGroup.ag_mOp_closed, assumption+,
frule_tac ?m1.0 = x1 and ?m1' = y and ?m2.0 = "x ±⇘M⇙ -⇩a⇘M⇙ x1" and
?m2' = "x ±⇘M⇙ -⇩a⇘M⇙ y" in ds2_unique[of M M1 M2], assumption+)
apply (simp add:ds2_def msubmodule_def, assumption+)
apply (simp add:aGroup.ag_pOp_commute[of M x])
apply (simp add:aGroup.ag_pOp_assoc[THEN sym, of M _ _ x])
apply ((subst aGroup.ag_r_inv1, assumption+)+, simp, simp)
done
lemma (in Ring) mprojTr2:"⟦R module M1; R module M2; R module M; ds2 R M M1 M2;
x ∈ carrier M; x1 ∈ carrier M1; (x ±⇘M⇙ (-⇩a⇘M⇙ x1)) ∈ carrier M2;
y1 ∈ carrier M1;(x ±⇘M⇙ (-⇩a⇘M⇙ y1)) ∈ carrier M2 ⟧ ⟹ x1 = y1"
apply (frule_tac x = x in mprojTr1[of M1 M2 M], assumption+)
apply blast
done
lemma (in Ring) mprojTr3:"⟦R module M1; R module M2; R module M; ds2 R M M1 M2;
a ∈ carrier M; a1 ∈ carrier M1; (a ±⇘M⇙ (-⇩a⇘M⇙ a1)) ∈ carrier M2⟧ ⟹
(THE x1. x1 ∈ carrier M1 ∧ a ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) = a1"
apply (subgoal_tac "(THE x1. x1 ∈ carrier M1 ∧ a ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) ∈
carrier M1 ∧ a ±⇘M⇙ -⇩a⇘M⇙ (THE x1. x1 ∈ carrier M1 ∧
a ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) ∈ carrier M2",
rule mprojTr2[of M1 M2 M a
"THE x1. x1 ∈ carrier M1 ∧ a ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2" a1], assumption+,
simp, simp, assumption+)
apply (rule theI')
apply (simp add:mprojTr1)
done
lemma (in Ring) mproj:"⟦R module M1; R module M2; R module M; ds2 R M M1 M2⟧
⟹ mproj1 R M1 M2 M ∈ mHom R M M1"
apply (simp add:mHom_def)
apply (rule conjI)
apply (simp add:aHom_def)
apply (rule conjI)
apply (rule Pi_I)
apply (simp add:mproj1_def)
apply (frule_tac a = x in ds2_components1[of M1 M2 M], assumption+,
erule bexE,
frule_tac a = x and ?a1.0 = a1 in mprojTr3[of M1 M2 M], assumption+,
simp)
apply (simp add:restrict_def mproj1_def extensional_def)
apply ((rule ballI)+,
frule Module.module_is_ag[of M R], simp add:aGroup.ag_pOp_closed,
frule_tac x = a and y = b in aGroup.ag_pOp_closed, assumption+,
frule_tac a = a in ds2_components1[of M1 M2 M], assumption+,
frule_tac a = b in ds2_components1[of M1 M2 M], assumption+,
frule_tac a = "a ±⇘M⇙ b" in ds2_components1[of M1 M2 M], assumption+,
(erule bexE)+, rename_tac b1 ab,
frule_tac a = "a ±⇘M⇙ b" and ?a1.0 = ab in mprojTr3[of M1 M2 M],
assumption+,
frule_tac a = a and ?a1.0 = a1 in mprojTr3[of M1 M2 M], assumption+,
frule_tac a = b and ?a1.0 = b1 in mprojTr3[of M1 M2 M], assumption+,
simp,
thin_tac "(THE x1. x1 ∈ carrier M1 ∧
a ±⇘M⇙ b ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) = ab",
thin_tac "(THE x1. x1 ∈ carrier M1 ∧ a ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) = a1",
thin_tac "(THE x1. x1 ∈ carrier M1 ∧ b ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) = b1")
apply (frule Module.module_is_ag[of M2],
frule_tac x = "a ±⇘M⇙ -⇩a⇘M⇙ a1" and y = "b ±⇘M⇙ -⇩a⇘M⇙ b1" in
aGroup.ag_pOp_closed[of M2], assumption+,
frule_tac x = "a ±⇘M⇙ -⇩a⇘M⇙ a1" and y = "b ±⇘M⇙ -⇩a⇘M⇙ b1" in
msub_addition[of M M2], assumption+,
simp add:ds2_def, assumption+, simp,
thin_tac "a ±⇘M⇙ -⇩a⇘M⇙ a1 ±⇘M2⇙ (b ±⇘M⇙ -⇩a⇘M⇙ b1) =
a ±⇘M⇙ -⇩a⇘M⇙ a1 ±⇘M⇙ (b ±⇘M⇙ -⇩a⇘M⇙ b1)",
unfold ds2_def, frule conjunct2[THEN conjunct1], fold ds2_def,
simp add:msubmodule_def, (erule conjE)+,
frule_tac c = a1 in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac c = b1 in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac x = a1 in aGroup.ag_mOp_closed, assumption+,
frule_tac x = b1 in aGroup.ag_mOp_closed, assumption+,
frule_tac a = a and b = "-⇩a⇘M⇙ a1" and c = b and d = "-⇩a⇘M⇙ b1" in
aGroup.pOp_assocTr43[of M], assumption+, simp,
thin_tac "a ±⇘M⇙ -⇩a⇘M⇙ a1 ±⇘M⇙ (b ±⇘M⇙ -⇩a⇘M⇙ b1) =
a ±⇘M⇙ (-⇩a⇘M⇙ a1 ±⇘M⇙ b) ±⇘M⇙ -⇩a⇘M⇙ b1",
frule_tac x = "-⇩a⇘M⇙ a1" and y = b in aGroup.ag_pOp_commute,
assumption+, simp,
frule_tac a1 = a and b1 = b and c1 = "-⇩a⇘M⇙ a1" and d1 = "-⇩a⇘M⇙ b1" in
aGroup.pOp_assocTr43[THEN sym], assumption+, simp,
thin_tac "a ±⇘M⇙ (b ±⇘M⇙ -⇩a⇘M⇙ a1) ±⇘M⇙ -⇩a⇘M⇙ b1 =
a ±⇘M⇙ b ±⇘M⇙ (-⇩a⇘M⇙ a1 ±⇘M⇙ -⇩a⇘M⇙ b1)",
frule_tac x1 = a1 and y1 = b1 in aGroup.ag_p_inv[THEN sym, of M],
assumption+, simp,
thin_tac "-⇩a⇘M⇙ a1 ±⇘M⇙ -⇩a⇘M⇙ b1 = -⇩a⇘M⇙ (a1 ±⇘M⇙ b1)")
apply (rule_tac x = "a ±⇘M⇙ b" and ?x1.0 = ab and ?y1.0 = "a1 ±⇘M1⇙ b1" in
mprojTr2[of M1 M2 M], assumption+,
frule Module.module_is_ag[of M1],
simp add:aGroup.ag_pOp_closed[of M1], unfold ds2_def,
frule conjunct2[THEN conjunct1], fold ds2_def,
subst msub_addition[of M M1], assumption+)
apply (rule ballI)+
apply (simp add:mproj1_def, simp add:Module.sc_mem)
apply (frule_tac a = m in ds2_components1[of M1 M2 M], assumption+,
erule bexE,
unfold ds2_def, frule conjunct2[THEN conjunct1], fold ds2_def,
simp add:msubmodule_def, (erule conjE)+,
frule_tac c = a1 in subsetD[of "carrier M1" "carrier M"], assumption+,
frule_tac a = a and m = "m ±⇘M⇙ -⇩a⇘M⇙ a1" in Module.sc_mem[of M2 R],
assumption+,
unfold ds2_def, frule conjunct2[THEN conjunct1],
frule conjunct2[THEN conjunct2[THEN conjunct1]], fold ds2_def,
simp add:msub_sprod[of M M2],
frule Module.module_is_ag[of M],
frule_tac x = a1 in aGroup.ag_mOp_closed[of M], assumption+,
simp add:Module.sc_r_distr,
frule Module.module_is_ag[of M1],
frule_tac x = a1 in aGroup.ag_mOp_closed[of M1], assumption+,
frule_tac a1 = a and x1 = "-⇩a⇘M⇙ a1" in msub_sprod[THEN sym, of M M1],
assumption+)
apply (simp add:msub_mOp,
frule_tac x1 = a1 in msub_mOp[THEN sym, of M M1], assumption+, simp)
apply (
thin_tac "a ⋅⇩s⇘M⇙ (-⇩a⇘M1⇙ a1) = a ⋅⇩s⇘M1⇙ (-⇩a⇘M1⇙ a1)",
thin_tac "-⇩a⇘M⇙ a1 = -⇩a⇘M1⇙ a1",
thin_tac "-⇩a⇘M1⇙ a1 ∈ carrier M",
frule_tac a = a and m = a1 in Module.sc_mem[of M1 R],
assumption+,
frule_tac a = m and ?a1.0 = a1 in mprojTr3[of M1 M2 M],
assumption+, simp add:msub_mOp, simp,
thin_tac "(THE x1. x1 ∈ carrier M1 ∧ m ±⇘M⇙ -⇩a⇘M⇙ x1 ∈ carrier M2) = a1",
frule_tac a = "a ⋅⇩s⇘M⇙ m" and ?a1.0 = "a ⋅⇩s⇘M1⇙ a1" in
mprojTr3[of M1 M2 M], assumption+,
simp add:Module.sc_mem, assumption)
apply (simp add:msub_mOp msub_sprod,
simp add:Module.sc_minus_am[of M R])
apply simp
done
lemma (in Ring) mproj2:"⟦R module M1; R module M2; R module M; M1 ⨁⇘R,M⇙ M2⟧
⟹ mproj2 R M1 M2 M ∈ mHom R M M2"
apply (frule ds2_commute[of M1 M2 M], assumption+)
apply (simp add:mproj2_def)
apply (simp add:mproj)
done
subsection "Existence of the tensor product"
definition
fm_gen_by_prod :: "[('r, 'm) Ring_scheme, (('a * 'b), 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme, ('b, 'r, 'm1) Module_scheme] ⇒ bool"
("(4FM⇘_⇙/ _ _ _)" [100,100,101]100) where
"FM⇘R⇙ P M N ⟷ R module P ∧ free_generator R P (M ×⇩c N)"
lemma (in Ring) free_gen_gen:"FM⇘R⇙ P M N ⟹ generator R P (M ×⇩c N)"
apply (simp add:fm_gen_by_prod_def)
apply (erule conjE)
apply (simp add:free_generator_def)
done
lemma (in Ring) free_gen_mem:"⟦FM⇘R⇙ P M N; a ∈ (M ×⇩c N)⟧ ⟹ a ∈ carrier P"
apply (simp add:fm_gen_by_prod_def)
apply (erule conjE)
apply (simp add:free_generator_def, (erule conjE)+)
apply (simp add:generator_def)
apply (erule conjE)+
apply (simp add:subsetD)
done
lemma (in Ring) mHom_lin_nsumTr:"⟦R module M; R module N; t ∈ mHom R M N⟧ ⟹
f ∈ {j. j ≤ (n::nat)} → carrier M ⟶ t (nsum M f n) = nsum N (cmp t f) n"
apply (induct_tac n)
apply (rule impI, simp add:cmp_def)
apply (rule impI)
apply simp
apply (frule_tac func_pre, simp)
apply (frule Module.module_is_ag [of M R])
apply (frule_tac n = n in aGroup.nsum_mem [of M _ f],
rule allI, simp add:Pi_def,
frule_tac x = "Suc n" and A = "{j. j ≤ Suc n}" and f = f and
B = "carrier M" in funcset_mem, simp)
apply (simp add:Module.mHom_add cmp_def)
done
lemma (in Ring) mHom_lin_nsum:"⟦R module M; R module N; t ∈ mHom R M N;
f ∈ {j. j ≤ (n::nat)} → carrier M⟧ ⟹
t (nsum M f n) = nsum N (cmp t f) n"
apply (simp add:mHom_lin_nsumTr)
done
lemma (in Ring) module_over_zeroring:"⟦zeroring R; R module M⟧ ⟹
carrier M = {𝟬⇘M⇙}"
apply (simp add:zeroring_def, erule conjE)
apply (rule equalityI)
apply (rule subsetI)
apply (frule_tac m = x in Module.sprod_one [of M R], assumption)
apply (cut_tac ring_one, simp)
apply (simp add:Module.sc_0_m[of M R])
apply (frule Module.module_is_ag [of M R])
apply (simp add:aGroup.ag_inc_zero)
done
lemma (in Ring) submodule_over_zeroring:"⟦zeroring R; R module M;
submodule R M N⟧ ⟹ N = {𝟬⇘M⇙}"
apply (rule equalityI)
apply (rule subsetI)
apply (simp add:submodule_def, (erule conjE)+)
apply (thin_tac "∀a m. a ∈ carrier R ∧ m ∈ N ⟶ a ⋅⇩s⇘M⇙ m ∈ N")
apply (cut_tac module_over_zeroring [of M])
apply simp
apply (frule_tac A = N and B = "{𝟬⇘M⇙}" and c = x in subsetD, assumption+)
apply (simp, assumption+)
apply (frule Module.submodule_inc_0 [of M R N], assumption+)
apply simp
done
definition
Least_submodule :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
'a set] ⇒ 'a set"
("(3LSM⇘_⇙/ _/ _)" [100,100,101]100) where
"LSM⇘R⇙ M T = ⋂{N. submodule R M N ∧ T ⊆ N}"
lemma (in Ring) LSM_mem:"⟦R module M; T ⊆ carrier M; t ∈ T⟧ ⟹
t ∈ (LSM⇘R⇙ M T)"
apply (simp add:Least_submodule_def, rule allI, rule impI)
apply (erule conjE)
apply (simp add:subsetD)
done
lemma (in Ring) LSM_sub_M:"⟦R module M; T ⊆ carrier M⟧ ⟹
(LSM⇘R⇙ M T) ⊆ carrier M"
apply (rule subsetI, simp add:Least_submodule_def)
apply (frule Module.submodule_whole[of M R])
apply (drule_tac x = "carrier M" in spec,
simp)
done
lemma (in Ring) LSM_sub_submodule:"⟦R module M; T ⊆ carrier M;
submodule R M N; T ⊆ N ⟧ ⟹ (LSM⇘R⇙ M T) ⊆ N"
by (rule subsetI, simp add:Least_submodule_def)
lemma (in Ring) LSM_inc_T:"⟦R module M; T ⊆ carrier M⟧ ⟹ T ⊆ (LSM⇘R⇙ M T)"
apply (rule subsetI)
apply (simp add:LSM_mem)
done
lemma (in Ring) LSM_submodule:"⟦R module M; T ⊆ carrier M⟧ ⟹
submodule R M (LSM⇘R⇙ M T)"
apply (frule LSM_sub_M[of M T], assumption+)
apply (subst Least_submodule_def)
apply (simp add:submodule_def)
apply (rule conjI)
apply (rule subsetI, simp,
drule_tac a = "carrier M" in forall_spec)
apply simp
apply (frule Module.submodule_whole[of M R])
apply (simp add:submodule_def[of R M "carrier M"], assumption)
apply (frule Module.module_is_ag [of M R])
apply (rule aGroup.asubg_test, assumption+)
apply (rule subsetI, simp,
drule_tac a = "carrier M" in forall_spec, simp,
frule Module.submodule_whole[of M R],
simp add:submodule_def[of R M "carrier M"], assumption)
apply (cut_tac x = "𝟬⇘M⇙" and A = "⋂{N. N ⊆ carrier M ∧
M +> N ∧ (∀a m. a ∈ carrier R ∧ m ∈ N ⟶ a ⋅⇩s⇘M⇙ m ∈ N) ∧ T ⊆ N}"
in nonempty)
apply simp
apply (rule allI, rule impI, (erule conjE)+,
frule_tac H = x in aGroup.asubg_inc_zero[of M], assumption+)
apply ((rule ballI)+, simp, rule allI, rule impI)
apply (drule_tac x = x in spec,
drule_tac x = x in spec)
apply simp
apply (frule_tac H = x and x = b in aGroup.asubg_mOp_closed[of M], simp+)
apply (rule_tac H = x and x = a and y = "-⇩a⇘M⇙ b" in
aGroup.asubg_pOp_closed[of M], assumption+, simp+)
done
lemma (in Ring) linear_comb_memTr:"⟦R module M; submodule R M N; T ⊆ N⟧ ⟹
∀f s. f ∈ {j. j ≤ (n::nat)} → T ∧ s ∈ {j. j ≤ n} → carrier R ⟶
l_comb R M n s f ∈ N"
apply (induct_tac n)
apply ((rule allI)+, rule impI, (erule conjE)+)
apply (simp add:l_comb_def del: Pi_split_insert_domain)
apply (rule Module.submodule_sc_closed, assumption+)
apply (simp add:Pi_def, simp add:Pi_def subsetD)
apply ((rule allI)+, rule impI, erule conjE)
apply (frule_tac f = f and n = n and A = T in func_pre)
apply (frule_tac f = s and n = n and A = "carrier R" in func_pre)
apply (drule_tac x = f in spec,
drule_tac x = s in spec, simp)
apply (cut_tac whole_ideal,
frule_tac s = s and n = n and f = f in
Module.l_comb_Suc[of M R T "carrier R"],
frule Module.submodule_subset[of M R N], assumption+,
rule subset_trans[of T N "carrier M"], assumption+, simp,
thin_tac "l_comb R M (Suc n) s f =
l_comb R M n s f ±⇘M⇙ s (Suc n) ⋅⇩s⇘M⇙ f (Suc n)")
apply (rule Module.submodule_pOp_closed[of M R N], assumption+,
rule_tac a = "s (Suc n)" and h = "f (Suc n)" in
Module.submodule_sc_closed[of M R N], assumption+,
simp add:Pi_def, simp add:Pi_def subsetD)
done
lemma (in Ring) linear_comb_mem:"⟦R module M; submodule R M N; T ⊆ N;
f ∈ {j. j ≤ (n::nat)} → T; s ∈ {j. j ≤ n} → carrier R⟧ ⟹
l_comb R M n s f ∈ N"
apply (simp add:linear_comb_memTr)
done
lemma (in Ring) LSM_eq_linear_span:"⟦R module M; T ⊆ carrier M⟧ ⟹
(LSM⇘R⇙ M T) = linear_span R M (carrier R) T"
apply (cut_tac whole_ideal)
apply (rule equalityI)
apply (frule Module.linear_span_subModule[of M R "carrier R" T], assumption+)
apply (rule LSM_sub_submodule[of M T "linear_span R M (carrier R) T"],
assumption+, simp add:Module.l_span_cont_H[of M R T])
apply (frule LSM_submodule[of M T], assumption)
apply (frule LSM_inc_T[of M T], assumption)
apply (rule Module.l_span_sub_submodule[of M R "carrier R" "LSM⇘R⇙ M T" T],
assumption+)
done
lemma (in Ring) LSM_sub_ker:"⟦R module M; R module N; T ⊆ carrier M;
f ∈ mHom R M N; T ⊆ ker⇘M,N⇙ f⟧ ⟹ LSM⇘R⇙ M T ⊆ ker⇘M,N⇙ f"
apply (frule Module.mker_submodule[of M R N f], assumption+)
apply (rule LSM_sub_submodule[of M T "ker⇘M,N⇙ f"], assumption+)
done
definition
tensor_relations1 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
('a * 'b) set"
("(4TR1/ _/ _/ _/ _)" [100,100,100,101]100) where
"TR1 R M N MN = {x. ∃m1∈carrier M. ∃m2∈carrier M. ∃n∈carrier N.
x = (m1 ±⇘M⇙ m2, n) ±⇘MN⇙ (-⇩a⇘MN⇙ ((m1, n) ±⇘MN⇙ (m2, n)))}"
definition
tensor_relations2 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
('a * 'b) set"
("(4TR2/ _/ _/ _/ _)" [100,100,100, 101]100) where
"TR2 R M N MN = {x. ∃m∈carrier M. ∃n1∈carrier N. ∃n2∈carrier N.
x = (m, n1 ±⇘N⇙ n2) ±⇘MN⇙ (-⇩a⇘MN⇙ ((m, n1) ±⇘MN⇙ (m, n2)))}"
definition
tensor_relations3 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
('a * 'b ) set"
("(4TR3/ _/ _/ _/ _)" [100,100,100,101]100) where
"TR3 R M N P = {x. ∃m∈carrier M. ∃n∈carrier N. ∃ a∈carrier R.
x = (a ⋅⇩s⇘M⇙ m, n) ±⇘P⇙ (-⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n)))}"
definition
tensor_relations4 :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
('a * 'b) set"
("(4TR4/ _/ _/ _/ _)" [100,100,100,101]100) where
"TR4 R M N MN = {x. ∃m∈carrier M. ∃n∈carrier N. ∃ a∈carrier R.
x = (m, a ⋅⇩s⇘N⇙ n) ±⇘MN⇙ (-⇩a⇘MN⇙ (a ⋅⇩s⇘ MN⇙ (m, n)))}"
definition
tensor_relations :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
('a * 'b) set"
("(4TR⇘_⇙ _/ _/ _)" [100,100,101]100) where
"TR⇘R⇙ M N MN = LSM⇘R⇙ MN ((TR1 R M N MN) ∪ (TR2 R M N MN) ∪
(TR3 R M N MN) ∪ (TR4 R M N MN))"
definition
tensor_product :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
(('a * 'b) set, 'r) Module" where
"tensor_product R M N MN = MN /⇩m (TR⇘R⇙ M N MN)"
abbreviation
TENSORPROD ("(4_/ ⇘_⇙⨂⇘_⇙/ _)" [92,92,92,93]92) where
"M ⇘P⇙⨂⇘R⇙ N == tensor_product R M N P"
lemma (in Ring) mem_cartesian:"⟦R module M; R module N; m ∈ carrier M;
n ∈ carrier N ⟧ ⟹ (m, n) ∈ M ×⇩c N"
by (simp add:prod_carr_def)
lemma (in Ring) cartesianTr:"⟦R module M; R module N; x ∈ M ×⇩c N⟧ ⟹
∃m n. m∈carrier M ∧ n ∈ carrier N ∧ x = (m, n)"
by (cases x) (simp add: prod_carr_def)
lemma (in Ring) free_module_mem:"⟦R module M; R module N; m ∈ carrier M;
n ∈ carrier N; FM⇘R⇙ P M N⟧ ⟹ (m, n) ∈ carrier P"
apply (rule free_gen_mem [of P M N], assumption+)
apply (simp add:prod_carr_def)
done
lemma (in Ring) FM_P_module:"⟦R module M; R module N; FM⇘R⇙ P M N⟧
⟹ R module P"
by (simp add:fm_gen_by_prod_def)
lemma (in Ring) TR1_sub_carr:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
(TR1 R M N P) ⊆ carrier P"
apply (simp add:fm_gen_by_prod_def)
apply (erule conjE)
apply (rule subsetI, simp add:tensor_relations1_def)
apply ((erule bexE)+,
frule Module.module_is_ag [of P], simp)
apply (rule aGroup.ag_pOp_closed, assumption,
rule free_module_mem, assumption+)
apply (frule Module.module_is_ag[of M R],
rule aGroup.ag_pOp_closed [of "M"], assumption+,
simp add:fm_gen_by_prod_def)
apply (rule aGroup.ag_mOp_closed[of P], assumption,
rule aGroup.ag_pOp_closed [of "P"], assumption+,
rule free_module_mem, assumption+,
simp add:fm_gen_by_prod_def)
apply (rule free_module_mem, assumption+, simp add:fm_gen_by_prod_def)
done
lemma (in Ring) TR2_sub_carr:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
(TR2 R M N P) ⊆ carrier P"
apply (simp add:fm_gen_by_prod_def, erule conjE)
apply (rule subsetI)
apply (simp add:tensor_relations2_def, (erule bexE)+, simp)
apply (frule Module.module_is_ag[of P R])
apply (rule aGroup.ag_pOp_closed, assumption)
apply (rule free_module_mem, assumption+)
apply (frule Module.module_is_ag [of N R])
apply (rule aGroup.ag_pOp_closed [of "N"], assumption+,
simp add:fm_gen_by_prod_def)
apply (rule aGroup.ag_mOp_closed [of "P"], assumption+,
rule aGroup.ag_pOp_closed [of "P"], assumption+,
rule free_module_mem, assumption+, simp add:fm_gen_by_prod_def)
apply (rule free_module_mem, assumption+,
simp add:fm_gen_by_prod_def)
done
lemma (in Ring) TR3_sub_carr:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
(TR3 R M N P) ⊆ carrier P"
apply (simp add:fm_gen_by_prod_def)
apply (erule conjE)
apply (rule subsetI)
apply (simp add:tensor_relations3_def)
apply ((erule bexE)+, simp,
thin_tac "x = (a ⋅⇩s⇘M⇙ m, n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n))")
apply (frule Module.module_is_ag [of P R])
apply (rule aGroup.ag_pOp_closed, assumption)
apply (rule free_module_mem, assumption+)
apply (simp add:Module.sc_mem, assumption,
simp add:fm_gen_by_prod_def)
apply (rule aGroup.ag_mOp_closed[of "P"], assumption+)
apply (rule Module.sc_mem, assumption+)
apply (rule free_module_mem, assumption+,
simp add:fm_gen_by_prod_def)
done
lemma (in Ring) TR4_sub_carr:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
(TR4 R M N P) ⊆ carrier P"
apply (simp add:fm_gen_by_prod_def)
apply (erule conjE)
apply (rule subsetI)
apply (simp add:tensor_relations4_def)
apply ((erule bexE)+, simp)
apply (frule Module.module_is_ag [of P R])
apply (rule aGroup.ag_pOp_closed, assumption)
apply (rule free_module_mem, assumption+,
simp add:Module.sc_mem, simp add:fm_gen_by_prod_def)
apply (rule aGroup.ag_mOp_closed[of P], assumption+)
apply (rule Module.sc_mem, assumption+)
apply (rule free_module_mem, assumption+,
simp add:fm_gen_by_prod_def)
done
lemma (in Ring) TR_sub_carr:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
(TR1 R M N P) ∪ (TR2 R M N P) ∪ (TR3 R M N P) ∪ (TR4 R M N P) ⊆ carrier P"
apply (rule subsetI)
apply (case_tac "x ∈ TR1 R M N P", simp)
apply (frule TR1_sub_carr [of M N P], assumption+, simp add:subsetD)
apply (case_tac "x ∈ TR2 R M N P", simp,
frule TR2_sub_carr [of M N P], assumption+, simp add:subsetD)
apply (case_tac "x ∈ TR3 R M N P", simp,
frule TR3_sub_carr [of M N P], assumption+, simp add:subsetD)
apply simp
apply (frule TR4_sub_carr [of M N P], assumption+, simp add:subsetD)
done
lemma (in Ring) TR_submodule:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
submodule R P (TR⇘R⇙ M N P)"
apply (simp add:tensor_relations_def)
apply (rule LSM_submodule[of P _])
apply (simp add:fm_gen_by_prod_def)
apply (rule TR_sub_carr, assumption+)
done
lemma (in Ring) TR_cont_TR1234:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
TR1 R M N P ∪ TR2 R M N P ∪ TR3 R M N P ∪ TR4 R M N P ⊆ TR⇘R⇙ M N P"
apply (simp add:tensor_relations_def)
apply (cut_tac LSM_inc_T [of P "TR1 R M N P ∪ TR2 R M N P ∪ TR3 R M N P ∪
TR4 R M N P"], simp)
apply (simp add:fm_gen_by_prod_def)
apply (rule TR_sub_carr, assumption+)
done
lemma (in Ring) TR1_mem:"⟦R module M; R module N; FM⇘R⇙ P M N; m1 ∈ carrier M;
m2 ∈ carrier M; n ∈ carrier N⟧ ⟹ (m1 ±⇘M⇙ m2, n) ±⇘P⇙ -⇩a⇘P⇙ ((m1, n) ±⇘P⇙ (m2, n))
∈ TR⇘R⇙ M N P"
apply (rule subsetD[of "TR1 R M N P" "TR⇘R⇙ M N P"
"(m1 ±⇘M⇙ m2, n) ±⇘P⇙ -⇩a⇘P⇙ ((m1, n) ±⇘P⇙ (m2, n))"])
apply (rule subset_trans[of "TR1 R M N P" "TR1 R M N P ∪ TR2 R M N P ∪
TR3 R M N P ∪ TR4 R M N P" "TR⇘R⇙ M N P"],
rule subsetI, simp,
cut_tac TR_cont_TR1234[of M N P], assumption+)
apply (simp add:tensor_relations1_def)
apply blast
done
lemma (in Ring) TR2_mem:"⟦R module M; R module N; FM⇘R⇙ P M N; m ∈ carrier M;
n1 ∈ carrier N; n2 ∈ carrier N ⟧ ⟹
(m, n1 ±⇘N⇙ n2) ±⇘P⇙ -⇩a⇘P⇙ ((m, n1) ±⇘P⇙ (m, n2)) ∈ TR⇘R⇙ M N P"
apply (rule subsetD[of "TR2 R M N P" "TR⇘R⇙ M N P"
"(m, n1 ±⇘N⇙ n2) ±⇘P⇙ -⇩a⇘P⇙ ((m, n1) ±⇘P⇙ (m, n2))"])
apply (rule subset_trans[of "TR2 R M N P" "TR1 R M N P ∪ TR2 R M N P ∪
TR3 R M N P ∪ TR4 R M N P" "TR⇘R⇙ M N P"],
rule subsetI, simp,
cut_tac TR_cont_TR1234[of M N P], assumption+)
apply (simp add:tensor_relations2_def)
apply blast
done
lemma (in Ring) TR3_mem:"⟦R module M; R module N; FM⇘R⇙ P M N; m ∈ carrier M;
n ∈ carrier N; a ∈ carrier R⟧ ⟹
(a ⋅⇩s⇘M⇙ m, n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n)) ∈ TR⇘R⇙ M N P"
apply (rule subsetD[of "TR3 R M N P" "TR⇘R⇙ M N P"
"(a ⋅⇩s⇘M⇙ m, n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n))"])
apply (rule subset_trans[of "TR3 R M N P" "TR1 R M N P ∪ TR2 R M N P ∪
TR3 R M N P ∪ TR4 R M N P" "TR⇘R⇙ M N P"],
rule subsetI, simp,
cut_tac TR_cont_TR1234[of M N P], assumption+)
apply (simp add:tensor_relations3_def)
apply blast
done
lemma (in Ring) TR4_mem:"⟦R module M; R module N; FM⇘R⇙ P M N; m ∈ carrier M;
n ∈ carrier N; a ∈ carrier R⟧ ⟹
(m, a ⋅⇩s⇘N⇙ n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n)) ∈ TR⇘R⇙ M N P"
apply (rule subsetD[of "TR4 R M N P" "TR⇘R⇙ M N P"
"(m, a ⋅⇩s⇘N⇙ n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n))"])
apply (rule subset_trans[of "TR4 R M N P" "TR1 R M N P ∪ TR2 R M N P ∪
TR3 R M N P ∪ TR4 R M N P" "TR⇘R⇙ M N P"],
rule subsetI, simp,
cut_tac TR_cont_TR1234[of M N P], assumption+)
apply (simp add:tensor_relations4_def)
apply blast
done
lemma (in Ring) tensor_product_module:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
R module (tensor_product R M N P)"
apply (simp add:fm_gen_by_prod_def, erule conjE)
apply (frule TR_submodule [of M N P], assumption+)
apply (simp add:fm_gen_by_prod_def)
apply (simp add:tensor_product_def)
apply (simp add:Module.qmodule_module [of P R "TR⇘R⇙ M N P"])
done
lemma (in Ring) tau_mpj_bilin1:"⟦ R module M; R module N; FM⇘R⇙ P M N;
x1 ∈ carrier M; x2 ∈ carrier M; y ∈ carrier N⟧ ⟹
(mpj P (TR⇘R⇙ M N P)) ( x1 ±⇘M⇙ x2, y) =
(mpj P (TR⇘R⇙ M N P)) (x1, y) ±⇘(M ⇘P⇙⨂⇘R⇙ N)⇙ (mpj P (TR⇘R⇙ M N P) (x2, y))"
apply (frule FM_P_module[of M N P], assumption+)
apply (subgoal_tac "(x1 ±⇘M⇙ x2, y) ±⇘P⇙ (-⇩a⇘P⇙ ((x1, y) ±⇘P⇙ (x2, y))) ∈
ker⇘P,(P /⇩m (TR⇘R⇙ M N P))⇙ (mpj P (TR⇘R⇙ M N P))")
apply (frule TR_submodule [of M N P], assumption+,
frule Module.qmodule_module [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mpj_mHom [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mHom_eq_ker[of P R "P /⇩m (TR⇘R⇙ M N P)" "mpj P (TR⇘R⇙ M N P)"
"( x1 ±⇘M⇙ x2, y)" "(x1, y) ±⇘P⇙ (x2, y)"], assumption+,
rule free_module_mem, assumption+)
apply (frule Module.module_is_ag [of M R],
simp add:aGroup.ag_pOp_closed, assumption+,
frule Module.module_is_ag [of P R],
rule aGroup.ag_pOp_closed, assumption+,
rule free_module_mem, assumption+,
rule free_module_mem, assumption+)
apply (frule_tac m = x1 and n = y in free_module_mem[of M N _ _ P],
assumption+,
frule_tac m = x2 and n = y in free_module_mem[of M N _ _ P],
assumption+,
simp add:Module.mHom_add[of P R "P /⇩m (TR⇘R⇙ M N P)" "mpj P (TR⇘R⇙ M N P)"
"(x1, y)" "(x2, y)"],
simp add:tensor_product_def)
apply (frule TR_submodule [of M N P], assumption+,
simp add:Module.mker_of_mpj, thin_tac "submodule R P (TR⇘R⇙ M N P)",
simp add:TR1_mem)
done
lemma (in Ring) tau_mpj_bilin2:"⟦R module M; R module N; FM⇘R⇙ P M N;
m ∈ carrier M; n1 ∈ carrier N; n2 ∈ carrier N⟧ ⟹
(mpj P (TR⇘R⇙ M N P)) (m, n1 ±⇘N⇙ n2) =
(mpj P (TR⇘R⇙ M N P)) (m, n1) ±⇘(M ⇘P⇙⨂⇘R⇙ N)⇙ (mpj P (TR⇘R⇙ M N P) (m, n2))"
apply (frule FM_P_module[of M N P], assumption+)
apply (subgoal_tac "(m, n1 ±⇘N⇙ n2) ±⇘P⇙ (-⇩a⇘P⇙ ((m, n1) ±⇘P⇙ (m, n2))) ∈
ker⇘P,(P /⇩m (TR⇘R⇙ M N P))⇙ (mpj P (TR⇘R⇙ M N P))")
apply (frule TR_submodule [of M N P], assumption+,
frule Module.qmodule_module [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mpj_mHom [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mHom_eq_ker[of P R "P /⇩m (TR⇘R⇙ M N P)" "mpj P (TR⇘R⇙ M N P)"
"(m, n1 ±⇘N⇙ n2)" "(m, n1) ±⇘P⇙ (m, n2)"], assumption+,
rule free_module_mem, assumption+)
apply (frule Module.module_is_ag [of N R],
simp add:aGroup.ag_pOp_closed, assumption+,
frule Module.module_is_ag [of P R],
rule aGroup.ag_pOp_closed, assumption+,
rule free_module_mem, assumption+,
rule free_module_mem, assumption+)
apply (frule_tac m = m and n = n1 in free_module_mem[of M N _ _ P],
assumption+,
frule_tac m = m and n = n2 in free_module_mem[of M N _ _ P],
assumption+, simp add:tensor_product_def)
apply (rule Module.mHom_add[of P R "P /⇩m (TR⇘R⇙ M N P)" "mpj P (TR⇘R⇙ M N P)"
"(m, n1)" "(m, n2)"], assumption+)
apply (frule TR_submodule [of M N P], assumption+,
simp add:Module.mker_of_mpj, thin_tac "submodule R P (TR⇘R⇙ M N P)",
simp add:TR2_mem)
done
lemma (in Ring) tau_mpj_bilin3:"⟦R module M; R module N; FM⇘R⇙ P M N;
m ∈ carrier M; n ∈ carrier N; a ∈ carrier R⟧ ⟹
(mpj P (TR⇘R⇙ M N P)) (a ⋅⇩s⇘M⇙ m, n) = a ⋅⇩s⇘(M ⇘P⇙⨂⇘R⇙ N)⇙
(mpj P (TR⇘R⇙ M N P) (m, n))"
apply (frule FM_P_module[of M N P], assumption+)
apply (subgoal_tac "(a ⋅⇩s⇘M⇙ m, n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n)) ∈
ker⇘P,(P /⇩m (TR⇘R⇙ M N P))⇙ (mpj P (TR⇘R⇙ M N P))")
apply (frule TR_submodule [of M N P], assumption+,
frule Module.qmodule_module [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mpj_mHom [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mHom_eq_ker[of P R "P /⇩m (TR⇘R⇙ M N P)" "mpj P (TR⇘R⇙ M N P)"
"(a ⋅⇩s⇘M⇙ m, n)" "a ⋅⇩s⇘P⇙ (m, n)"], assumption+,
rule free_module_mem, assumption+)
apply (simp add:Module.sc_mem, assumption+)
apply (frule_tac m = m and n = n in free_module_mem[of M N _ _ P],
assumption+,
simp add:Module.sc_mem,
assumption+, simp add:tensor_product_def)
apply (rule Module.mHom_lin[of P R "P /⇩m (TR⇘R⇙ M N P)" "(m, n)"
"mpj P (TR⇘R⇙ M N P)" a], assumption+, simp add:free_module_mem,
assumption+)
apply (frule TR_submodule [of M N P], assumption+,
simp add:Module.mker_of_mpj, thin_tac "submodule R P (TR⇘R⇙ M N P)",
simp add:TR3_mem)
done
lemma (in Ring) tau_mpj_bilin4:"⟦R module M; R module N; FM⇘R⇙ P M N;
m ∈ carrier M; n ∈ carrier N; a ∈ carrier R⟧ ⟹
(mpj P (TR⇘R⇙ M N P)) (m, a ⋅⇩s⇘N⇙ n) = a ⋅⇩s⇘(M ⇘P⇙⨂⇘R⇙ N)⇙
(mpj P (TR⇘R⇙ M N P) (m, n))"
apply (frule FM_P_module[of M N P], assumption+)
apply (subgoal_tac "(m, a ⋅⇩s⇘N⇙ n) ±⇘P⇙ -⇩a⇘P⇙ (a ⋅⇩s⇘P⇙ (m, n)) ∈
ker⇘P,(P /⇩m (TR⇘R⇙ M N P))⇙ (mpj P (TR⇘R⇙ M N P))")
apply (frule TR_submodule [of M N P], assumption+,
frule Module.qmodule_module [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mpj_mHom [of P R "TR⇘R⇙ M N P"], assumption+,
frule Module.mHom_eq_ker[of P R "P /⇩m (TR⇘R⇙ M N P)" "mpj P (TR⇘R⇙ M N P)"
"(m, a ⋅⇩s⇘N⇙ n)" "a ⋅⇩s⇘P⇙ (m, n)"], assumption+,
rule free_module_mem, assumption+)
apply (simp add:Module.sc_mem, assumption+)
apply (frule_tac m = m and n = n in free_module_mem[of M N _ _ P],
assumption+,
simp add:Module.sc_mem,
assumption+, simp add:tensor_product_def)
apply (rule Module.mHom_lin[of P R "P /⇩m (TR⇘R⇙ M N P)" "(m, n)"
"mpj P (TR⇘R⇙ M N P)" a], assumption+, simp add:free_module_mem,
assumption+)
apply (frule TR_submodule [of M N P], assumption+,
simp add:Module.mker_of_mpj, thin_tac "submodule R P (TR⇘R⇙ M N P)",
simp add:TR4_mem)
done
definition
tau :: "[('r, 'm) Ring_scheme, ('a, 'r, 'm1) Module_scheme,
('b, 'r, 'm1) Module_scheme, (('a * 'b), 'r, 'm1) Module_scheme] ⇒
('a * 'b) ⇒ ('a * 'b)" where
"tau R M N P = (λx∈(M ×⇩c N). x)"
lemma (in Ring) tau_func:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
tau R M N P ∈ M ×⇩c N → carrier P"
apply (rule Pi_I)
apply (frule_tac x = x in cartesianTr [of M N], assumption+)
apply ((erule exE)+, (erule conjE)+, simp add:tau_def)
apply (simp add:free_module_mem)
done
lemma (in Ring) tau_mem:"⟦R module M; R module N; m ∈ carrier M;
n ∈ carrier N; FM⇘R⇙ P M N⟧ ⟹ tau R M N P (m, n) ∈ carrier P"
apply (frule tau_func [of M N P], assumption+)
apply (rule funcset_mem, assumption+)
apply (simp add:prod_carr_mem)
done
lemma (in Ring) tau_inj0:"⟦¬ zeroring R; R module M; R module N; FM⇘R⇙ P M N⟧
⟹ inj_on (tau R M N P) (M ×⇩c N)"
apply (simp add:inj_on_def, (rule ballI)+)
apply (rule impI)
apply (simp add:tau_def)
done
lemma (in Ring) tau_inj1:"⟦zeroring R; R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
inj_on (tau R M N P) (M ×⇩c N)"
apply (simp add:inj_on_def)
apply ((rule ballI)+, rule impI)
apply (frule module_over_zeroring[of M], assumption+)
apply (frule module_over_zeroring[of N], assumption+)
apply (simp add:zeroring_def, erule conjE)
apply (frule_tac x = x in cartesianTr[of M N], assumption+)
apply ((erule exE)+, (erule conjE)+, simp add:tau_def)
done
lemma (in Ring) tau_inj:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
inj_on (tau R M N P) (M ×⇩c N)"
apply (case_tac "zeroring R")
apply (simp add:tau_inj1)
apply (simp add:tau_inj0)
done
lemma (in Ring) tau_mpj_bilinear:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
bilinear_map (compose (M ×⇩c N) (mpj P (TR⇘R⇙ M N P)) (tau R M N P))
R M N (M ⇘P⇙⨂⇘R⇙ N)"
apply (simp add:bilinear_map_def)
apply (rule conjI)
apply (rule Pi_I)
apply (simp add:compose_def tau_def tensor_product_def)
apply (frule TR_submodule [of M N P], assumption+)
apply (frule FM_P_module[of M N P], assumption+,
frule Module.mpj_mHom[of P R "TR⇘R⇙ M N P"], assumption+)
apply (frule Module.qmodule_module [of P R "TR⇘R⇙ M N P"], assumption+,
rule Module.mHom_mem [of P R "P /⇩m (TR⇘R⇙ M N P)" "(mpj P (TR⇘R⇙ M N P))"],
assumption+, simp add:free_gen_mem)
apply (rule conjI)
apply (rule ballI)+
apply (simp add:compose_def tau_def mem_cartesian)
apply (frule Module.module_is_ag[of M R],
frule_tac x = x1 and y = x2 in aGroup.ag_pOp_closed, assumption+,
simp add:mem_cartesian, simp add:tau_mpj_bilin1)
apply (rule conjI)
apply (rule ballI)+
apply (simp add:compose_def tau_def mem_cartesian)
apply (frule Module.module_is_ag[of N R],
frule_tac x = y1 and y = y2 in aGroup.ag_pOp_closed, assumption+,
simp add:mem_cartesian, simp add:tau_mpj_bilin2)
apply (rule ballI)+
apply (rule conjI)
apply (simp add:compose_def tau_def mem_cartesian)
apply (frule_tac a = r and m = x in Module.sc_mem[of M R], assumption+,
simp add:mem_cartesian, simp add:tau_mpj_bilin3)
apply (simp add:compose_def tau_def mem_cartesian)
apply (frule_tac a = r and m = y in Module.sc_mem[of N R], assumption+,
simp add:mem_cartesian, simp add:tau_mpj_bilin4)
done
definition
tnm :: "[('r, 'm) Ring_scheme, (('a * 'b), 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme, ('b, 'r, 'm1) Module_scheme] ⇒
('a * 'b) ⇒ ('a * 'b) set" where
"tnm R P M N = compose (M ×⇩c N) (mpj P (TR⇘R⇙ M N P)) (tau R M N P)"
lemma (in Ring) tnm_bilinear:"⟦R module M; R module N; FM⇘R⇙ P M N⟧ ⟹
bilinear_map (tnm R P M N) R M N (M ⇘P⇙⨂⇘R⇙ N)"
apply (simp add:tnm_def)
apply (simp add:tau_mpj_bilinear)
done
lemma (in Ring) tnm_mem:"⟦ R module M; R module N; FM⇘R⇙ P M N; m ∈ carrier M;
n ∈ carrier N⟧ ⟹ tnm R P M N (m, n) ∈ carrier (M ⇘P⇙⨂⇘R⇙ N)"
apply (simp add:tnm_def)
apply (frule tau_mem [of M N m n], assumption+)
apply (simp add:compose_def, simp add:prod_carr_def)
apply (simp add:tensor_product_def)
apply (frule TR_submodule [of M N P], assumption+)
apply (rule Module.mpj_mem[of P R "TR⇘R⇙ M N P" "tau R M N P (m, n)"],
rule FM_P_module[of M N P], assumption+)
done
definition
tensor_elem :: "[('r, 'm) Ring_scheme, (('a * 'b), 'r, 'm1) Module_scheme,
('a, 'r, 'm1) Module_scheme, ('b, 'r, 'm1) Module_scheme] ⇒ 'a ⇒ 'b
⇒ ('a * 'b) set" where
"tensor_elem R P M N m n = tnm R P M N (m, n)"
abbreviation
TNSELEM ("(6_ ⇘_,_⇙⊗⇘_,_⇙/ _)" [100,100,100,100,100,101]101) where
"m ⇘R,P⇙⊗⇘M,N⇙ n == tensor_elem R P M N m n"
lemma (in Ring) tensor_univ_propTr:"⟦R module M; R module N; FM⇘R⇙ P M N;
R module Z; bilinear_map f R M N Z⟧ ⟹
∃g. g ∈ mHom R P Z ∧ (compose (M ×⇩c N) g (tau R M N P)) = f"
apply (unfold fm_gen_by_prod_def)
apply (frule conjunct1, frule conjunct2)
apply (fold fm_gen_by_prod_def)
apply (frule bilinear_func[of f M N Z])
apply (frule Module.exist_extension_mhom [of P R Z "M ×⇩c N" "f"], assumption+)
apply (erule bexE, rename_tac h)
apply (subgoal_tac "compose (M ×⇩c N) h (tau R M N P) = f")
apply blast
apply (rule funcset_eq [of _ "M ×⇩c N"])
apply (simp add:compose_def, simp add:bilinear_map_def)
apply (rule ballI)
apply (simp add:compose_def tau_def)
done
lemma (in Ring) tensor_univ_propTr1:"⟦R module M; R module N; FM⇘R⇙ P M N;
R module Z; bilinear_map f R M N Z⟧ ⟹
∃!g. g∈(mHom R (M ⇘P⇙⨂⇘R⇙ N) Z) ∧ (compose (M ×⇩c N) g (tnm R P M N)) = f"
apply (frule Module.module_is_ag[of M],
frule Module.module_is_ag[of N],
frule FM_P_module[of M N P], assumption+,
frule Module.module_is_ag[of P])
apply (simp add:tnm_def)
apply (frule tensor_univ_propTr[of M N P Z f], assumption+)
apply (erule exE, erule conjE,
frule TR_submodule[of M N P], assumption+,
frule_tac Module.indmhom1[of P R "TR⇘R⇙ M N P" Z], assumption+,
frule Module.submodule_subset[of P R "TR⇘R⇙ M N P"], assumption+,
simp add:tensor_relations_def)
apply (rule_tac f = g in LSM_sub_ker[of P Z "(TR1 R M N P ∪ TR2 R M N P
∪ TR3 R M N P ∪ TR4 R M N P)"], assumption+,
rule TR_sub_carr, assumption+,
thin_tac "submodule R P
(LSM⇘R⇙ P (TR1 R M N P ∪ TR2 R M N P ∪ TR3 R M N P ∪ TR4 R M N P))",
thin_tac "LSM⇘R⇙ P (TR1 R M N P ∪ TR2 R M N P ∪ TR3 R M N P ∪
TR4 R M N P) ⊆ carrier P")
apply (rule subsetI, simp, erule disjE,
frule TR1_sub_carr[of M N P], assumption+,
frule_tac c = x in subsetD[of "TR1 R M N P" "carrier P"], assumption+,
thin_tac "TR1 R M N P ⊆ carrier P",
simp add:tensor_relations1_def, (erule bexE)+, simp add:ker_def)
apply (frule_tac x = m1 and y = m2 in aGroup.ag_pOp_closed, assumption+,
frule_tac m = "m1 ±⇘M⇙ m2" and n = n in free_module_mem[of M N],
assumption+,
frule_tac m = m1 and n = n in free_module_mem[of M N], assumption+,
frule_tac m = m2 and n = n in free_module_mem[of M N], assumption+)
apply (subst Module.mHom_add[of P R Z], assumption+,
rule aGroup.ag_mOp_closed, assumption+,
rule aGroup.ag_pOp_closed, assumption+,
frule_tac x = "(m1, n)" and y = "(m2, n)" in aGroup.ag_pOp_closed,
assumption+,
simp add:Module.mHom_inv[of P R Z] Module.mHom_add)
apply (frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m1 ±⇘M⇙ m2, n)" in eq_fun_eq_val,
frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m1, n)" in eq_fun_eq_val,
frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m2, n)" in eq_fun_eq_val,
thin_tac "compose (M ×⇩c N) g (tau R M N P) = f",
simp add:compose_def cmp_def, simp add:mem_cartesian tau_def,
simp add:bilinear_l_add1)
apply (erule disjE,
frule TR2_sub_carr[of M N P], assumption+,
frule_tac c = x in subsetD[of "TR2 R M N P" "carrier P"], assumption+,
thin_tac "TR2 R M N P ⊆ carrier P",
simp add:tensor_relations2_def, (erule bexE)+, simp add:ker_def)
apply (frule_tac x = n1 and y = n2 in aGroup.ag_pOp_closed, assumption+,
frule_tac m = m and n = "n1 ±⇘N⇙ n2" in free_module_mem[of M N],
assumption+,
frule_tac m = m and n = n1 in free_module_mem[of M N], assumption+,
frule_tac m = m and n = n2 in free_module_mem[of M N], assumption+)
apply (subst Module.mHom_add[of P R Z], assumption+,
rule aGroup.ag_mOp_closed, assumption+,
rule aGroup.ag_pOp_closed, assumption+,
frule_tac x = "(m, n1)" and y = "(m, n2)" in aGroup.ag_pOp_closed,
assumption+,
simp add:Module.mHom_inv[of P R Z] Module.mHom_add)
apply (frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m, n1 ±⇘N⇙ n2)" in eq_fun_eq_val,
frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m, n1)" in eq_fun_eq_val,
frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m, n2)" in eq_fun_eq_val,
thin_tac "compose (M ×⇩c N) g (tau R M N P) = f",
simp add:compose_def cmp_def, simp add:mem_cartesian tau_def,
simp add:bilinear_r_add1)
apply (erule disjE,
frule TR3_sub_carr[of M N P], assumption+,
frule_tac c = x in subsetD[of "TR3 R M N P" "carrier P"], assumption+,
thin_tac "TR3 R M N P ⊆ carrier P",
simp add:tensor_relations3_def, (erule bexE)+, simp add:ker_def)
apply (frule_tac a = a and m = m in Module.sc_mem, assumption+,
frule_tac m = "a ⋅⇩s⇘M⇙ m" and n = n in free_module_mem[of M N],
assumption+,
frule_tac m = m and n = n in free_module_mem[of M N], assumption+,
frule_tac a = a and m = "(m, n)" in Module.sc_mem, assumption+,
frule_tac x = "(a ⋅⇩s⇘P⇙ (m, n))" in aGroup.ag_mOp_closed, assumption+)
apply (subst Module.mHom_add[of P R Z], assumption+,
simp add:Module.mHom_inv[of P R Z],
simp add:Module.mHom_lin)
apply (frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(a ⋅⇩s⇘M⇙ m, n)" in eq_fun_eq_val,
frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m, n)" in eq_fun_eq_val)
apply (thin_tac "compose (M ×⇩c N) g (tau R M N P) = f",
simp add:compose_def cmp_def, simp add:mem_cartesian tau_def,
simp add:bilinear_l_lin1)
apply (frule TR4_sub_carr[of M N P], assumption+,
frule_tac c = x in subsetD[of "TR4 R M N P" "carrier P"], assumption+,
thin_tac "TR4 R M N P ⊆ carrier P",
simp add:tensor_relations4_def, (erule bexE)+, simp add:ker_def)
apply (frule_tac a = a and m = n in Module.sc_mem, assumption+,
frule_tac m = m and n = "a ⋅⇩s⇘N⇙ n" in free_module_mem[of M N],
assumption+,
frule_tac m = m and n = n in free_module_mem[of M N], assumption+,
frule_tac a = a and m = "(m, n)" in Module.sc_mem, assumption+,
frule_tac x = "(a ⋅⇩s⇘P⇙ (m, n))" in aGroup.ag_mOp_closed, assumption+)
apply (subst Module.mHom_add[of P R Z], assumption+,
simp add:Module.mHom_inv[of P R Z],
simp add:Module.mHom_lin)
apply (frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m, a ⋅⇩s⇘N⇙ n)" in eq_fun_eq_val,
frule_tac f = "compose (M ×⇩c N) g (tau R M N P)" and g = f and
x = "(m, n)" in eq_fun_eq_val)
apply (thin_tac "compose (M ×⇩c N) g (tau R M N P) = f",
simp add:compose_def cmp_def, simp add:mem_cartesian tau_def)
apply (simp add:bilinear_r_lin1)
apply (frule Module.qmodule_module [of P R "TR⇘R⇙ M N P"], assumption+)
apply (rule ex_ex1I)
apply (erule ex1E, erule conjE,
thin_tac "∀y. y ∈ mHom R (P /⇩m (TR⇘R⇙ M N P)) Z ∧
compos P y (mpj P (TR⇘R⇙ M N P)) = g ⟶ y = ga")
apply (simp add:tensor_product_def)
apply (cut_tac g = "mpj P (TR⇘R⇙ M N P)" and h = ga
in compose_assoc[of "tau R M N P" "M ×⇩c N" "carrier P"],
simp add:tau_func,
simp add:compos_def, blast)
apply (simp add:tensor_product_def,
thin_tac "∃!ga. ga ∈ mHom R (P /⇩m (TR⇘R⇙ M N P)) Z ∧
compos P ga (mpj P (TR⇘R⇙ M N P)) = g")
apply (frule free_gen_gen[of P M N],
frule Module.surjec_generator[of P R "P /⇩m (TR⇘R⇙ M N P)"
"mpj P (TR⇘R⇙ M N P)" "M ×⇩c N"],
simp add:Module.qmodule_module,
simp add:Module.mpj_mHom,
simp add:Module.mpj_surjec, assumption)
apply (rule_tac f = ga and g = y in Module.gen_mHom_eq[of "P /⇩m (TR⇘R⇙ M N P)"
R Z "mpj P (TR⇘R⇙ M N P) ` M ×⇩c N"], assumption+, simp, simp)
apply (erule conjE)+
apply (rule ballI,
thin_tac "generator R (P /⇩m (TR⇘R⇙ M N P)) (mpj P (TR⇘R⇙ M N P) ` M ×⇩c N)",
simp add:image_def, erule bexE)
apply (frule_tac f = "compose (M ×⇩c N) ga
(compose (M ×⇩c N) (mpj P (TR⇘R⇙ M N P)) (tau R M N P))" and g = f and
x = x in eq_fun_eq_val,
thin_tac "compose (M ×⇩c N) ga (compose (M ×⇩c N) (mpj P (TR⇘R⇙ M N P))
(tau R M N P)) = f",
frule_tac f = "compose (M ×⇩c N) y
(compose (M ×⇩c N) (mpj P (TR⇘R⇙ M N P)) (tau R M N P))" and g = f and
x = x in eq_fun_eq_val,
thin_tac "compose (M ×⇩c N) y (compose (M ×⇩c N) (mpj P (TR⇘R⇙ M N P))
(tau R M N P)) = f")
apply (simp add:compose_def tau_def)
done
lemma (in Ring) tensor_universal_property:"⟦R module M; R module N; FM⇘R⇙ P M N ⟧
⟹ universal_property R M N (M ⇘P⇙⨂⇘R⇙ N) (tnm R P M N)"
apply (simp add:universal_property_def)
apply (frule tau_mpj_bilinear [of M N], assumption+)
apply (rule conjI, simp add:tnm_def)
apply ((rule allI)+, rule impI, erule conjE)
apply (rule_tac Z = Z and f = g in tensor_univ_propTr1 [of M N],
assumption+)
done
end