Theory Types_To_Sets_Extension.VS_Modules
section‹Modules›
theory VS_Modules
imports
VS_Groups
Complex_Main
begin
subsection‹\<^text>‹module_with››
locale module_with = ab_group_add plus⇩M zero⇩M minus⇩M uminus⇩M
for plus⇩M :: "['m, 'm] ⇒ 'm" (infixl ‹+⇩M› 65)
and zero⇩M (‹0⇩M›)
and minus⇩M (infixl ‹-⇩M› 65)
and uminus⇩M (‹-⇩M _› [81] 80) +
fixes scale :: "['cr1::comm_ring_1, 'm] ⇒ 'm" (infixr "*s⇩w⇩i⇩t⇩h" 75)
assumes scale_right_distrib[algebra_simps]:
"a *s⇩w⇩i⇩t⇩h (x +⇩M y) = a *s⇩w⇩i⇩t⇩h x +⇩M a *s⇩w⇩i⇩t⇩h y"
and scale_left_distrib[algebra_simps]:
"(a + b) *s⇩w⇩i⇩t⇩h x = a *s⇩w⇩i⇩t⇩h x +⇩M b *s⇩w⇩i⇩t⇩h x"
and scale_scale[simp]: "a *s⇩w⇩i⇩t⇩h (b *s⇩w⇩i⇩t⇩h x) = (a * b) *s⇩w⇩i⇩t⇩h x"
and scale_one[simp]: "1 *s⇩w⇩i⇩t⇩h x = x"
lemma module_with_overloaded[ud_with]: "module = module_with (+) 0 (-) uminus"
unfolding module_def module_with_def module_with_axioms_def
by (simp add: comm_ring_1_axioms ab_group_add_axioms)
locale module_pair_with =
M⇩1: module_with plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1 +
M⇩2: module_with plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
for plus⇩M⇩_⇩1 :: "['m_1, 'm_1] ⇒ 'm_1" (infixl ‹+⇩M⇩'_⇩1› 65)
and zero⇩M⇩_⇩1 (‹0⇩M⇩'_⇩1›)
and minus⇩M⇩_⇩1 (infixl ‹-⇩M⇩'_⇩1› 65)
and uminus⇩M⇩_⇩1 (‹-⇩M⇩'_⇩1 _› [81] 80)
and scale⇩1 (infixr ‹*s⇩w⇩i⇩t⇩h⇩'_⇩1› 75)
and plus⇩M⇩_⇩2 :: "['m_2, 'm_2] ⇒ 'm_2" (infixl ‹+⇩M⇩'_⇩2› 65)
and zero⇩M⇩_⇩2 (‹0⇩M⇩'_⇩2›)
and minus⇩M⇩_⇩2 (infixl ‹-⇩M⇩'_⇩2› 65)
and uminus⇩M⇩_⇩2 (‹-⇩M⇩'_⇩2 _› [81] 80)
and scale⇩2 (infixr ‹*s⇩w⇩i⇩t⇩h⇩'_⇩2› 75)
lemma module_pair_with_overloaded[ud_with]:
"module_pair =
(
λscale⇩1 scale⇩2.
module_pair_with (+) 0 (-) uminus scale⇩1 (+) 0 (-) uminus scale⇩2
)"
unfolding module_pair_def module_pair_with_def
unfolding module_with_overloaded
..
locale module_hom_with =
M⇩1: module_with plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1 +
M⇩2: module_with plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
for plus⇩M⇩_⇩1 :: "['m_1, 'm_1] ⇒ 'm_1" (infixl ‹+⇩M⇩'_⇩1› 65)
and zero⇩M⇩_⇩1 (‹0⇩M⇩'_⇩1›)
and minus⇩M⇩_⇩1 (infixl ‹-⇩M⇩'_⇩1› 65)
and uminus⇩M⇩_⇩1 (‹-⇩M⇩'_⇩1 _› [81] 80)
and scale⇩1 (infixr ‹*s⇩w⇩i⇩t⇩h⇩'_⇩1› 75)
and plus⇩M⇩_⇩2 :: "['m_2, 'm_2] ⇒ 'm_2" (infixl ‹+⇩M⇩'_⇩2› 65)
and zero⇩M⇩_⇩2 (‹0⇩M⇩'_⇩2›)
and minus⇩M⇩_⇩2 (infixl ‹-⇩M⇩'_⇩2› 65)
and uminus⇩M⇩_⇩2 (‹-⇩M⇩'_⇩2 _› [81] 80)
and scale⇩2 (infixr ‹*s⇩w⇩i⇩t⇩h⇩'_⇩2› 75) +
fixes f :: "'m_1 ⇒ 'm_2"
assumes add: "f (b1 +⇩M⇩_⇩1 b2) = f b1 +⇩M⇩_⇩2 f b2"
and scale: "f (r *s⇩w⇩i⇩t⇩h⇩_⇩1 b) = r *s⇩w⇩i⇩t⇩h⇩_⇩2 f b"
begin
sublocale module_pair_with ..
end
lemma module_hom_with_overloaded[ud_with]:
"module_hom =
(
λscale⇩1 scale⇩2.
module_hom_with (+) 0 (-) uminus scale⇩1 (+) 0 (-) uminus scale⇩2
)"
unfolding
module_hom_def module_hom_axioms_def
module_hom_with_def module_hom_with_axioms_def
unfolding module_with_overloaded
..
ud ‹module.subspace› (‹(with _ _ _ : «subspace» _)› [1000, 999, 998, 1000] 10)
ud ‹module.span› (‹(with _ _ _ : «span» _)› [1000, 999, 998, 1000] 10)
ud ‹module.dependent›
(‹(with _ _ _ _ : «dependent» _)› [1000, 999, 998, 997, 1000] 10)
ud ‹module.representation›
(
‹(with _ _ _ _ : «representation» _ _)›
[1000, 999, 998, 997, 1000, 999] 10
)
abbreviation independent_with
(‹(with _ _ _ _ : «independent» _)› [1000, 999, 998, 997, 1000] 10)
where
"(with zero⇩C⇩R⇩1 zero⇩M scale⇩M plus⇩M : «independent» s) ≡
¬(with zero⇩C⇩R⇩1 zero⇩M scale⇩M plus⇩M : «dependent» s)"
lemma span_with_transfer[transfer_rule]:
includes lifting_syntax
assumes [transfer_rule]: "right_total A" "bi_unique A"
shows
"(
A ===>
(A ===> A ===> A) ===>
((=) ===> A ===> A) ===>
rel_set A ===>
rel_set A
) span.with span.with"
unfolding span.with_def
proof(intro rel_funI)
fix p p' z z' X X' and s s'::"'c ⇒ _"
assume transfer_rules[transfer_rule]:
"(A ===> A ===> A) p p'"
"A z z'"
"((=) ===> A ===> A) s s'"
"rel_set A X X'"
have "Domainp A z" using ‹A z z'› by force
have *: "t ⊆ X ⟹ (∀x∈t. Domainp A x)" for t
by (meson Domainp.DomainI ‹rel_set A X X'› rel_setD1 subsetD)
note swt = sum_with_transfer
[
OF assms(1,2,2),
THEN rel_funD,
THEN rel_funD,
THEN rel_funD,
THEN rel_funD,
OF transfer_rules(1,2)
]
have DsI: "Domainp A (sum_with p z r t)"
if "⋀x. x ∈ t ⟹ Domainp A (r x)" "t ⊆ Collect (Domainp A)" for r t
by (metis that Domainp_sum_with transfer_rules(1,2))
from Domainp_apply2I[OF transfer_rules(3)]
have Domainp_sI: "Domainp A x ⟹ Domainp A (s y x)" for x y by auto
show "rel_set A
{sum_with p z (λa. s (r a) a) t |t r. finite t ∧ t ⊆ X}
{sum_with p' z' (λa. s' (r a) a) t |t r. finite t ∧ t ⊆ X'}"
apply transfer_prover_start
apply transfer_step+
by (insert *) (auto intro!: DsI Domainp_sI)
qed
lemma dependent_with_transfer[transfer_rule]:
includes lifting_syntax
assumes [transfer_rule]: "right_total A" "bi_unique A"
shows
"(
(=) ===>
A ===>
(A ===> A ===> A) ===>
((=) ===> A ===> A) ===>
rel_set A ===>
(=)
) dependent.with dependent.with"
unfolding dependent.with_def
proof(intro rel_funI)
fix p p' z z' X X' and zb zb' ::'c and s s'::"'c ⇒ _"
assume [transfer_rule]:
"(A ===> A ===> A) p p'"
"A z z'"
"zb = zb'"
"((=) ===> A ===> A) s s'"
"rel_set A X X'"
have *: "t ⊆ X ⟹ (∀x∈t. Domainp A x)" for t
by (meson Domainp.DomainI ‹rel_set A X X'› rel_setD1 subsetD)
show
"(
∃t u.
finite t ∧
t ⊆ X ∧
sum_with p z (λv. s (u v) v) t = z ∧
(∃v∈t. u v ≠ zb)
) =
(
∃t u.
finite t ∧
t ⊆ X' ∧
sum_with p' z' (λv. s' (u v) v) t = z' ∧
(∃v∈t. u v ≠ zb')
)"
apply transfer_prover_start
apply transfer_step+
by (insert *) (auto intro!: comm_monoid_add_ow.sum_with_closed)
qed
ctr relativization
synthesis ctr_simps
assumes [transfer_rule]: "is_equality A" "bi_unique B"
trp (?'a A) and (?'b B)
in subspace_with: subspace.with_def
subsection‹‹module_ow››
subsubsection‹Definitions and common properties›
text‹Single module.›
locale module_ow = ab_group_add_ow U⇩M plus⇩M zero⇩M minus⇩M uminus⇩M
for U⇩M :: "'m set"
and plus⇩M (infixl ‹+⇩M› 65)
and zero⇩M (‹0⇩M›)
and minus⇩M (infixl ‹-⇩M› 65)
and uminus⇩M (‹-⇩M _› [81] 80) +
fixes scale :: "['cr1::comm_ring_1, 'm] ⇒ 'm" (infixr "*s⇩M" 75)
assumes scale_closed[simp, intro]: "x ∈ U⇩M ⟹ a *s⇩M x ∈ U⇩M"
and scale_right_distrib[algebra_simps]:
"⟦ x ∈ U⇩M; y ∈ U⇩M ⟧ ⟹ a *s⇩M (x +⇩M y) = a *s⇩M x +⇩M a *s⇩M y"
and scale_left_distrib[algebra_simps]:
"x ∈ U⇩M ⟹ (a + b) *s⇩M x = a *s⇩M x +⇩M b *s⇩M x"
and scale_scale[simp]:
"x ∈ U⇩M ⟹ a *s⇩M (b *s⇩M x) = (a * b) *s⇩M x"
and scale_one[simp]: "x ∈ U⇩M ⟹ 1 *s⇩M x = x"
begin
lemma scale_closed'[simp]: "∀a. ∀x∈U⇩M. a *s⇩M x ∈ U⇩M" by simp
lemma minus_closed'[simp]: "∀x∈U⇩M. ∀y∈U⇩M. x -⇩M y ∈ U⇩M"
by (simp add: ab_diff_conv_add_uminus add_closed' uminus_closed)
lemma uminus_closed'[simp]: "∀x∈U⇩M. -⇩M x ∈ U⇩M" by (simp add: uminus_closed)
tts_register_sbts ‹(*s⇩M)› | U⇩M
by (rule tts_AB_C_transfer[OF scale_closed])
(auto simp: bi_unique_eq right_total_eq)
tts_register_sbts plus⇩M | U⇩M
by (rule tts_AB_C_transfer[OF add_closed])
(auto simp: bi_unique_eq right_total_eq)
tts_register_sbts zero⇩M | U⇩M
by (meson Domainp.cases zero_closed)
end
text‹Pair of modules.›
locale module_pair_ow =
M⇩1: module_ow U⇩M⇩_⇩1 plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1 +
M⇩2: module_ow U⇩M⇩_⇩2 plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
for U⇩M⇩_⇩1 :: "'m_1 set"
and plus⇩M⇩_⇩1 (infixl ‹+⇩M⇩'_⇩1› 65)
and zero⇩M⇩_⇩1 (‹0⇩M⇩'_⇩1›)
and minus⇩M⇩_⇩1 (infixl ‹-⇩M⇩'_⇩1› 65)
and uminus⇩M⇩_⇩1 (‹-⇩M⇩'_⇩1 _› [81] 80)
and scale⇩1 :: "['cr1::comm_ring_1, 'm_1] ⇒ 'm_1" (infixr ‹*s⇩M⇩'_⇩1› 75)
and U⇩M⇩_⇩2 :: "'m_2 set"
and plus⇩M⇩_⇩2 (infixl ‹+⇩M⇩'_⇩2› 65)
and zero⇩M⇩_⇩2 (‹0⇩M⇩'_⇩2›)
and minus⇩M⇩_⇩2 (infixl ‹-⇩M⇩'_⇩2› 65)
and uminus⇩M⇩_⇩2 (‹-⇩M⇩'_⇩2 _› [81] 80)
and scale⇩2 :: "['cr1::comm_ring_1, 'm_2] ⇒ 'm_2" (infixr ‹*s⇩M⇩'_⇩2› 75)
text‹Module homomorphisms.›
locale module_hom_ow =
M⇩1: module_ow U⇩M⇩_⇩1 plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1 +
M⇩2: module_ow U⇩M⇩_⇩2 plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
for U⇩M⇩_⇩1 :: "'m_1 set"
and plus⇩M⇩_⇩1 (infixl ‹+⇩M⇩'_⇩1› 65)
and zero⇩M⇩_⇩1 (‹0⇩M⇩'_⇩1›)
and minus⇩M⇩_⇩1 (infixl ‹-⇩M⇩'_⇩1› 65)
and uminus⇩M⇩_⇩1 (‹-⇩M⇩'_⇩1 _› [81] 80)
and scale⇩1 :: "['cr1::comm_ring_1, 'm_1] ⇒ 'm_1" (infixr ‹*s⇩M⇩'_⇩1› 75)
and U⇩M⇩_⇩2 :: "'m_2 set"
and plus⇩M⇩_⇩2 (infixl ‹+⇩M⇩'_⇩2› 65)
and zero⇩M⇩_⇩2 (‹0⇩M⇩'_⇩2›)
and minus⇩M⇩_⇩2 (infixl ‹-⇩M⇩'_⇩2› 65)
and uminus⇩M⇩_⇩2 (‹-⇩M⇩'_⇩2 _› [81] 80)
and scale⇩2 :: "['cr1::comm_ring_1, 'm_2] ⇒ 'm_2" (infixr ‹*s⇩M⇩'_⇩2› 75) +
fixes f :: "'m_1 ⇒ 'm_2"
assumes f_closed[simp]: "f ` U⇩M⇩_⇩1 ⊆ U⇩M⇩_⇩2"
and add: "⟦ b1 ∈ U⇩M⇩_⇩1; b2 ∈ U⇩M⇩_⇩1 ⟧ ⟹ f (b1 +⇩M⇩_⇩1 b2) = f b1 +⇩M⇩_⇩2 f b2"
and scale: "⟦ r ∈ U⇩C⇩R⇩1; b ∈ U⇩M⇩_⇩1 ⟧ ⟹ f (r *s⇩M⇩_⇩1 b) = r *s⇩M⇩_⇩2 f b"
begin
tts_register_sbts f | ‹U⇩M⇩_⇩1› and ‹U⇩M⇩_⇩2› by (rule tts_AB_transfer[OF f_closed])
lemma f_closed'[simp]: "∀x∈U⇩M⇩_⇩1. f x ∈ U⇩M⇩_⇩2" using f_closed by blast
sublocale module_pair_ow ..
end
subsubsection‹Transfer.›
lemma module_with_transfer[transfer_rule]:
includes lifting_syntax
assumes [transfer_rule]: "bi_unique B" "right_total B"
fixes PP lhs
defines
"PP ≡
(
(B ===> B ===> B) ===>
B ===>
(B ===> B ===> B) ===>
(B ===> B) ===>
((=) ===> B ===> B) ===>
(=)
)"
and
"lhs ≡
(
λ plus⇩M zero⇩M minus⇩M uminus⇩M scale.
module_ow (Collect (Domainp B)) plus⇩M zero⇩M minus⇩M uminus⇩M scale
)"
shows "PP lhs (module_with)"
proof-
let ?rhs =
"(
λplus⇩M zero⇩M minus⇩M uminus⇩M scale.
(∀a ∈ UNIV. ∀x ∈ UNIV. scale a x ∈ UNIV) ∧
module_with plus⇩M zero⇩M minus⇩M uminus⇩M scale
)"
have "PP lhs ?rhs"
unfolding
PP_def lhs_def
module_ow_def module_with_def
module_ow_axioms_def module_with_axioms_def
apply transfer_prover_start
apply transfer_step+
by (intro ext) blast
then show ?thesis by simp
qed
lemma module_pair_with_transfer[transfer_rule]:
includes lifting_syntax
assumes [transfer_rule]:
"bi_unique B⇩1" "right_total B⇩1" "bi_unique B⇩2" "right_total B⇩2"
fixes PP lhs
defines
"PP ≡
(
(B⇩1 ===> B⇩1 ===> B⇩1) ===>
B⇩1 ===>
(B⇩1 ===> B⇩1 ===> B⇩1) ===>
(B⇩1 ===> B⇩1) ===>
((=) ===> B⇩1 ===> B⇩1) ===>
(B⇩2 ===> B⇩2 ===> B⇩2) ===>
B⇩2 ===>
(B⇩2 ===> B⇩2 ===> B⇩2) ===>
(B⇩2 ===> B⇩2) ===>
((=) ===> B⇩2 ===> B⇩2) ===>
(=)
)"
and
"lhs ≡
(
λ
plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2.
module_pair_ow
(Collect (Domainp B⇩1)) plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
(Collect (Domainp B⇩2)) plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
)"
shows "PP lhs module_pair_with"
unfolding PP_def lhs_def
proof(intro rel_funI)
let ?rhs =
"(
λ
plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2.
(∀a ∈ UNIV. ∀x ∈ UNIV. scale⇩1 a x ∈ UNIV) ∧
(∀a ∈ UNIV. ∀x ∈ UNIV. scale⇩2 a x ∈ UNIV) ∧
module_pair_with
plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
)"
fix
plus⇩M⇩_⇩1 plus⇩M⇩_⇩1'
zero⇩M⇩_⇩1 zero⇩M⇩_⇩1'
minus⇩M⇩_⇩1 minus⇩M⇩_⇩1'
uminus⇩M⇩_⇩1 uminus⇩M⇩_⇩1'
plus⇩M⇩_⇩2 plus⇩M⇩_⇩2'
zero⇩M⇩_⇩2 zero⇩M⇩_⇩2'
minus⇩M⇩_⇩2 minus⇩M⇩_⇩2'
uminus⇩M⇩_⇩2 uminus⇩M⇩_⇩2'
and scale⇩1 :: "'f::comm_ring_1 ⇒ 'a ⇒ 'a" and scale⇩1'
and scale⇩2 :: "'f::comm_ring_1 ⇒ 'c ⇒ 'c" and scale⇩2'
assume [transfer_rule]:
"(B⇩1 ===> B⇩1 ===> B⇩1) plus⇩M⇩_⇩1 plus⇩M⇩_⇩1'"
"B⇩1 zero⇩M⇩_⇩1 zero⇩M⇩_⇩1'"
"(B⇩1 ===> B⇩1 ===> B⇩1) minus⇩M⇩_⇩1 minus⇩M⇩_⇩1'"
"(B⇩1 ===> B⇩1) uminus⇩M⇩_⇩1 uminus⇩M⇩_⇩1'"
"(B⇩2 ===> B⇩2 ===> B⇩2) plus⇩M⇩_⇩2 plus⇩M⇩_⇩2'"
"B⇩2 zero⇩M⇩_⇩2 zero⇩M⇩_⇩2'"
"(B⇩2 ===> B⇩2 ===> B⇩2) minus⇩M⇩_⇩2 minus⇩M⇩_⇩2'"
"(B⇩2 ===> B⇩2) uminus⇩M⇩_⇩2 uminus⇩M⇩_⇩2'"
"((=) ===> B⇩1 ===> B⇩1) scale⇩1 scale⇩1'"
"((=) ===> B⇩2 ===> B⇩2) scale⇩2 scale⇩2'"
show
"module_pair_ow
(Collect (Domainp B⇩1)) plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
(Collect (Domainp B⇩2)) plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
=
module_pair_with
plus⇩M⇩_⇩1' zero⇩M⇩_⇩1' minus⇩M⇩_⇩1' uminus⇩M⇩_⇩1' scale⇩1'
plus⇩M⇩_⇩2' zero⇩M⇩_⇩2' minus⇩M⇩_⇩2' uminus⇩M⇩_⇩2' scale⇩2'"
unfolding module_pair_ow_def module_pair_with_def
apply transfer_prover_start
apply transfer_step+
by simp
qed
lemma module_hom_with_transfer[transfer_rule]:
includes lifting_syntax
assumes [transfer_rule]:
"bi_unique B⇩1" "right_total B⇩1" "bi_unique B⇩2" "right_total B⇩2"
fixes PP lhs
defines
"PP ≡
(
(B⇩1 ===> B⇩1 ===> B⇩1) ===>
B⇩1 ===>
(B⇩1 ===> B⇩1 ===> B⇩1) ===>
(B⇩1 ===> B⇩1) ===>
((=) ===> B⇩1 ===> B⇩1) ===>
(B⇩2 ===> B⇩2 ===> B⇩2) ===>
B⇩2 ===>
(B⇩2 ===> B⇩2 ===> B⇩2) ===>
(B⇩2 ===> B⇩2) ===>
((=) ===> B⇩2 ===> B⇩2) ===>
(B⇩1 ===> B⇩2) ===>
(=)
)"
and
"lhs ≡
(
λ
plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
f.
module_hom_ow
(Collect (Domainp B⇩1)) plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
(Collect (Domainp B⇩2)) plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
f
)"
shows "PP lhs module_hom_with"
proof-
let ?rhs =
"(
λ
plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
f.
(∀x ∈ UNIV. f x ∈ UNIV) ∧
module_hom_with
plus⇩M⇩_⇩1 zero⇩M⇩_⇩1 minus⇩M⇩_⇩1 uminus⇩M⇩_⇩1 scale⇩1
plus⇩M⇩_⇩2 zero⇩M⇩_⇩2 minus⇩M⇩_⇩2 uminus⇩M⇩_⇩2 scale⇩2
f
)"
have "PP lhs ?rhs"
unfolding
PP_def lhs_def
module_hom_ow_def module_hom_with_def
module_hom_ow_axioms_def module_hom_with_axioms_def
apply transfer_prover_start
apply transfer_step+
by (intro ext) blast
then show ?thesis by simp
qed
subsection‹‹module_on››
subsubsection‹Definitions and common properties›
locale module_on =
fixes U⇩M
and scale :: "'a::comm_ring_1 ⇒ 'b::ab_group_add ⇒ 'b" (infixr "*s" 75)
assumes scale_right_distrib_on[algebra_simps]:
"⟦ x ∈ U⇩M; y ∈ U⇩M ⟧ ⟹ a *s (x + y) = a *s x + a *s y"
and scale_left_distrib_on[algebra_simps]:
"x ∈ U⇩M ⟹ (a + b) *s x = a *s x + b *s x"
and scale_scale_on[simp]: "x ∈ U⇩M ⟹ a *s (b *s x) = (a * b) *s x"
and scale_one_on[simp]: "x ∈ U⇩M ⟹ 1 *s x = x"
and closed_add: "⟦ x ∈ U⇩M; y ∈ U⇩M ⟧ ⟹ x + y ∈ U⇩M"
and closed_zero: "0 ∈ U⇩M"
and closed_scale: "x ∈ U⇩M ⟹ a *s x ∈ U⇩M"
begin
lemma S_ne: "U⇩M ≠ {}" using closed_zero by auto
lemma scale_minus_left_on:
assumes "x ∈ U⇩M"
shows "scale (- a) x = - scale a x"
by
(
metis
add_cancel_right_right scale_left_distrib_on neg_eq_iff_add_eq_0 assms
)
lemma closed_uminus:
assumes "x ∈ U⇩M"
shows "-x ∈ U⇩M"
by (metis assms closed_scale scale_minus_left_on scale_one_on)
sublocale implicit⇩M: ab_group_add_ow U⇩M ‹(+)› 0 ‹(-)› uminus
by unfold_locales (simp_all add: closed_add closed_zero closed_uminus)
sublocale implicit⇩M: module_ow U⇩M ‹(+)› 0 ‹(-)› uminus ‹(*s)›
by unfold_locales
(simp_all add: closed_scale scale_right_distrib_on scale_left_distrib_on)
definition subspace :: "'b set ⇒ bool"
where subspace_on_def: "subspace T ⟷
0 ∈ T ∧ (∀x∈T. ∀y∈T. x + y ∈ T) ∧ (∀c. ∀x∈T. c *s x ∈ T)"
definition span :: "'b set ⇒ 'b set"
where span_on_def: "span b = {sum (λa. r a *s a) t | t r. finite t ∧ t ⊆ b}"
definition dependent :: "'b set ⇒ bool"
where dependent_on_def: "dependent s ⟷
(∃t u. finite t ∧ t ⊆ s ∧ (sum (λv. u v *s v) t = 0 ∧ (∃v∈t. u v ≠ 0)))"
lemma implicit_subspace_with[tts_implicit]: "subspace.with (+) 0 (*s) = subspace"
unfolding subspace_on_def subspace.with_def ..
lemma implicit_dependent_with[tts_implicit]:
"dependent.with 0 0 (+) (*s) = dependent"
unfolding dependent_on_def dependent.with_def sum_with ..
lemma implicit_span_with[tts_implicit]: "span.with 0 (+) (*s) = span"
unfolding span_on_def span.with_def sum_with ..
end
lemma implicit_module_ow[tts_implicit]:
"module_ow U⇩M (+) 0 (-) uminus = module_on U⇩M"
proof (intro ext iffI)
fix s::"'a⇒'b⇒'b" assume "module_on U⇩M s"
then interpret module_on U⇩M s .
show "module_ow U⇩M (+) 0 (-) uminus s"
by (simp add: implicit⇩M.module_ow_axioms)
next
fix s::"'a⇒'b⇒'b" assume "module_ow U⇩M (+) 0 (-) uminus s"
then interpret module_ow U⇩M ‹(+)› 0 ‹(-)› uminus s .
show "module_on U⇩M s"
by (simp add: scale_left_distrib scale_right_distrib module_on.intro)
qed
locale module_pair_on =
M⇩1: module_on U⇩M⇩_⇩1 scale⇩1 + M⇩2: module_on U⇩M⇩_⇩2 scale⇩2
for U⇩M⇩_⇩1:: "'b::ab_group_add set"
and U⇩M⇩_⇩2::"'c::ab_group_add set"
and scale⇩1::"'a::comm_ring_1 ⇒ _ ⇒ _" (infixr ‹*s⇩1› 75)
and scale⇩2::"'a::comm_ring_1 ⇒ _ ⇒ _" (infixr ‹*s⇩2› 75)
begin
sublocale implicit⇩M: module_pair_ow
U⇩M⇩_⇩1 ‹(+)› 0 ‹(-)› uminus scale⇩1 U⇩M⇩_⇩2 ‹(+)› 0 ‹(-)› uminus scale⇩2
by unfold_locales
end
lemma implicit_module_pair_ow[tts_implicit]:
"module_pair_ow U⇩M⇩_⇩1 (+) 0 (-) uminus scale⇩1 U⇩M⇩_⇩2 (+) 0 (-) uminus scale⇩2 =
module_pair_on U⇩M⇩_⇩1 U⇩M⇩_⇩2 scale⇩1 scale⇩2"
unfolding module_pair_ow_def implicit_module_ow module_pair_on_def ..
locale module_hom_on = M⇩1: module_on U⇩M⇩_⇩1 scale⇩1 + M⇩2: module_on U⇩M⇩_⇩2 scale⇩2
for U⇩M⇩_⇩1 :: "'b::ab_group_add set" and U⇩M⇩_⇩2 :: "'c::ab_group_add set"
and scale⇩1 :: "'a::comm_ring_1 ⇒ 'b ⇒ 'b" (infixr ‹*s⇩1› 75)
and scale⇩2 :: "'a::comm_ring_1 ⇒ 'c ⇒ 'c" (infixr ‹*s⇩2› 75) +
fixes f :: "'b ⇒ 'c"
assumes hom_closed: "f ` U⇩M⇩_⇩1 ⊆ U⇩M⇩_⇩2"
and add: "⋀b1 b2. ⟦ b1 ∈ U⇩M⇩_⇩1; b2 ∈ U⇩M⇩_⇩1 ⟧ ⟹ f (b1 + b2) = f b1 + f b2"
and scale: "⋀b. b ∈ U⇩M⇩_⇩1 ⟹ f (r *s⇩1 b) = r *s⇩2 f b"
begin
sublocale module_pair_on U⇩M⇩_⇩1 U⇩M⇩_⇩2 scale⇩1 scale⇩2 by unfold_locales
sublocale implicit⇩M: module_hom_ow
U⇩M⇩_⇩1 ‹(+)› 0 ‹(-)› uminus scale⇩1 U⇩M⇩_⇩2 ‹(+)› 0 ‹(-)› uminus scale⇩2
by unfold_locales (simp_all add: hom_closed add scale)
end
lemma implicit_module_hom_ow[tts_implicit]:
"module_hom_ow U⇩M⇩_⇩1 (+) 0 (-) uminus scale⇩1 U⇩M⇩_⇩2 (+) 0 (-) uminus scale⇩2 =
module_hom_on U⇩M⇩_⇩1 U⇩M⇩_⇩2 scale⇩1 scale⇩2"
unfolding
module_hom_ow_def
module_hom_on_def
module_hom_ow_axioms_def
module_hom_on_axioms_def
tts_implicit
by (intro ext) auto
subsection‹Relativization.›
context module_on
begin
tts_context
tts: (?'b to ‹U⇩M::'b set›)
rewriting ctr_simps
substituting implicit⇩M.module_ow_axioms
and implicit⇩M.ab_group_add_ow_axioms
eliminating ‹?a ∈ U⇩M› and ‹?B ⊆ U⇩M› through