A module is a generalization of the concept of a vector space in which scalars do not form a field but a ring.
Let \(R\) be a ring and \(M\) be an abelian group. The most common definition of a left \(R\)-module posits the existence of a scalar multiplication operation \(R\times M\rightarrow M\) satisfying certain four properties. Here we take a bit more concise and abstract approach defining a module as a ring action on an abelian group.
We know that endomorphisms of an abelian group \(\cal{M}\) form a ring with pointwise addition as the additive operation and composition as the ring multiplication. This asssertion is a bit imprecise though as the domain of pointwise addition is a binary operation on the space of functions \(\cal{M}\rightarrow \cal{M}\) (i.e. its domain is \((\cal{M}\rightarrow \cal{M})\times \cal{M}\rightarrow \cal{M}\)) while we need the space of endomorphisms to be the domain of the ring addition and multiplication. Therefore, to get the actual additive operation we need to restrict the pointwise addition of functions \(\cal{M}\rightarrow \cal{M}\) to the set of endomorphisms of \(\cal{M}\). Recall from the Group_ZF_5 that the InEnd operator restricts an operation to the set of endomorphisms and see the func_ZF theory for definitions of lifting an operation on a set to a function space over that set.
definition
\( \text{EndAdd}(\mathcal{M} ,A) \equiv \text{InEnd}(A \text{ lifted to function space over } \mathcal{M} ,\mathcal{M} ,A) \)
Similarly we define the multiplication in the ring of endomorphisms as the restriction of compositions to the endomorphisms of \(\cal{M}\). See the func_ZF theory for the definition of the Composition operator.
definition
\( \text{EndMult}(\mathcal{M} ,A) \equiv \text{InEnd}( \text{Composition}(\mathcal{M} ),\mathcal{M} ,A) \)
We can now reformulate the theorem end_is_ring from the Group_ZF_5 theory in terms of the addition and multiplication of endomorphisms defined above.
lemma (in abelian_group) end_is_ring1:
shows \( \text{IsAring}( \text{End}(G,P), \text{EndAdd}(G,P), \text{EndMult}(G,P)) \) using end_is_ring unfolding EndAdd_def, EndMult_defWe define an action as a homomorphism into a space of endomorphisms (typically of some abelian group). In the definition below \(S\) is the set of scalars, \(A\) is the addition operation on this set, \(M\) is multiplication on the set, \(V\) is the group, \(A_V\) is the group operation, and \(H\) is the ring homomorphism that of the ring of scalars to the ring of endomorphisms of the group. On the right hand side of the definition \( \text{End}(V,A_V) \) is the set of endomorphisms, This definition is only ever used as part of the definition of a module and vector space, it's just convenient to split it off to shorten the main definitions.
definition
\( \text{IsAction}(S,A,M,\mathcal{M} ,A_M,H) \equiv \text{ringHomomor}(H,S,A,M, \text{End}(\mathcal{M} ,A_M), \text{EndAdd}(\mathcal{M} ,A_M), \text{EndMult}(\mathcal{M} ,A_M)) \)
A module is a ring action on an abelian group.
definition
\( \text{IsLeftModule}(S,A,M,\mathcal{M} ,A_M,H) \equiv \) \( \text{IsAring}(S,A,M) \wedge \text{IsAgroup}(\mathcal{M} ,A_M) \wedge (A_M \text{ is commutative on } \mathcal{M} ) \wedge \text{IsAction}(S,A,M,\mathcal{M} ,A_M,H) \)
The next locale defines context (i.e. common assumptions and notation) when considering modules. We reuse notation from the ring0 locale and add notation specific to modules. The addition and multiplication in the ring of scalars is denoted \(+\) and \(\cdot\), resp. The addition of module elements will be denoted \(+_V\). The multiplication (scaling) of scalars by module elemenst will be denoted \(\cdot_S\). \(\Theta\) is the zero module element, i.e. the neutral element of the abelian group of the module elements.
locale module0 = ring0 +
assumes mAbGr: \( \text{IsAgroup}(\mathcal{M} ,A_M) \wedge (A_M \text{ is commutative on } \mathcal{M} ) \)
assumes mAction: \( \text{IsAction}(R,A,M,\mathcal{M} ,A_M,H) \)
defines \( \Theta \equiv \text{ TheNeutralElement}(\mathcal{M} ,A_M) \)
defines \( v_1 +_V v_2 \equiv A_M\langle v_1,v_2\rangle \)
defines \( s \cdot _S v \equiv (H(s))(v) \)
defines \( - v \equiv \text{GroupInv}(\mathcal{M} ,A_M)(v) \)
defines \( v_1 -_V v_2 \equiv v_1 +_V ( - v_2) \)
We indeed talk about modules in the module0 context.
lemma (in module0) module_in_module0:
shows \( \text{IsLeftModule}(R,A,M,\mathcal{M} ,A_M,H) \) using ringAssum, mAbGr, mAction unfolding IsLeftModule_defTheorems proven in the abelian_group context are valid as applied to the module0 context as applied to the abelian group of module elements.
lemma (in module0) abelian_group_valid_module0:
shows \( abelian\_group(\mathcal{M} ,A_M) \) using mAbGr, group0_def, abelian_group_def, abelian_group_axioms_defAnother way to state that theorems proven in the abelian_group context can be used in the module0 context:
using abelian_group_valid_module0
Theorems proven in the ring_homo context are valid in the module0 context, as applied to ring \(R\) and the ring of endomorphisms of the group of module elements.
lemma (in module0) ring_homo_valid_module0:
shows \( ring\_homo(R,A,M, \text{End}(\mathcal{M} ,A_M), \text{EndAdd}(\mathcal{M} ,A_M), \text{EndMult}(\mathcal{M} ,A_M),H) \) using ringAssum, mAction, abelian_group_valid_module0, end_is_ring1 unfolding IsAction_def, ring_homo_defAnother way to make theorems proven in the ring_homo context available in the module0 context:
using ring_homo_valid_module0
In the ring of endomorphisms of the module the neutral element of the the multiplicative operation is the identity function. The neutral element of the additive operation is the zero valued constant function, which is also the value of the homomorphism that defines the module at zero.
lemma (in module0) add_mult_neut_elems:
shows \( \text{ TheNeutralElement}( \text{End}(\mathcal{M} , A_M), \text{EndMult}(\mathcal{M} ,A_M)) = id(\mathcal{M} ) \) and \( \text{ TheNeutralElement}( \text{End}(\mathcal{M} ,A_M), \text{EndAdd}(\mathcal{M} ,A_M)) = \text{ConstantFunction}(\mathcal{M} ,\Theta ) \), \( H( 0 ) = \text{ConstantFunction}(\mathcal{M} ,\Theta ) \)proofThe value of the homomorphism defining the module is an endomorphism of the group of module elements and hence a function that maps the module into itself.
lemma (in module0) H_val_type:
assumes \( r\in R \)
shows \( H(r) \in \text{End}(\mathcal{M} ,A_M) \) and \( H(r):\mathcal{M} \rightarrow \mathcal{M} \) using mAction, assms, apply_funtype unfolding IsAction_def, ringHomomor_def, End_defIn the module0 context the neutral element of addition of module elements is denoted \(\Theta\). Of course \(\Theta\) is an element of the module.
lemma (in module0) zero_in_mod:
shows \( \Theta \in \mathcal{M} \) using group0_2_L2\(\Theta\) is indeed the neutral element of addition of module elements.
lemma (in module0) zero_neutral:
assumes \( x\in \mathcal{M} \)
shows \( x +_V \Theta = x \) and \( \Theta +_V x = x \) using assms, group0_2_L2A more common definition of a module assumes that \(R\) is a ring, \(V\) is an abelian group and lists a couple of properties that the multiplications of scalars (elements of \(R\)) by the elements of the module \(V\) should have. In this section we show that the definition of a module as a ring action on an abelian group \(V\) implies these properties.
\(\Theta\) is fixed by scalar multiplication.
lemma (in module0) zero_fixed:
assumes \( r\in R \)
shows \( r \cdot _S \Theta = \Theta \)proofThe scalar multiplication is distributive with respect to the module addition.
lemma (in module0) module_ax1:
assumes \( r\in R \), \( x\in \mathcal{M} \), \( y\in \mathcal{M} \)
shows \( r\cdot _S(x+_Vy) = r\cdot _Sx +_V r\cdot _Sy \) using assms, H_val_type(1), endomor_eqThe scalar addition is distributive with respect to scalar multiplication.
lemma (in module0) module_ax2:
assumes \( r\in R \), \( s\in R \), \( x\in \mathcal{M} \)
shows \( (r + s)\cdot _Sx = r\cdot _Sx +_V s\cdot _Sx \) using assms, homomor_dest_add, H_val_type(1), end_pointwise_add_val unfolding EndAdd_defMultiplication by scalars is associative with multiplication of scalars.
lemma (in module0) module_ax3:
assumes \( r\in R \), \( s\in R \), \( x\in \mathcal{M} \)
shows \( (r\cdot s)\cdot _Sx = r\cdot _S(s\cdot _Sx) \)proofScaling a module element by one gives the same module element.
lemma (in module0) module_ax4:
assumes \( x\in \mathcal{M} \)
shows \( 1 \cdot _Sx = x \)proofMultiplying by zero is zero.
lemma (in module0) mult_zero:
assumes \( g\in \mathcal{M} \)
shows \( 0 \cdot _Sg = \Theta \) using assms, add_mult_neut_elems(3), func1_3_L2Taking inverses in a module is just multiplying by \(-1\)
lemma (in module0) inv_module:
assumes \( g\in \mathcal{M} \)
shows \( ( - 1 )\cdot _Sg = - g \)proofassumes \( F = P \text{ lifted to function space over } G \)
shows \( \text{IsAring}( \text{End}(G,P),\text{InEnd}(F,G,P),\text{InEnd}( \text{Composition}(G),G,P)) \)assumes \( F = P \text{ lifted to function space over } G \)
shows \( \text{ TheNeutralElement}( \text{End}(G,P),\text{InEnd}(F,G,P)) = \text{ConstantFunction}(G,1 ) \)assumes \( r\in R \)
shows \( H(r) \in \text{End}(\mathcal{M} ,A_M) \) and \( H(r):\mathcal{M} \rightarrow \mathcal{M} \)assumes \( f \in \text{End}(G,P) \), \( g_1\in G \), \( g_2\in G \)
shows \( f(g_1\cdot g_2) = f(g_1)\cdot f(g_2) \)assumes \( x\in R \), \( y\in R \)
shows \( f(x + _Ry) = (f(x)) + _S(f(y)) \)assumes \( f\in \text{End}(G,P) \), \( g\in \text{End}(G,P) \), \( x\in G \), \( F = P \text{ lifted to function space over } G \)
shows \( (\text{InEnd}(F,G,P)\langle f,g\rangle )(x) = (f(x))\cdot (g(x)) \)assumes \( x\in R \), \( y\in R \)
shows \( f(x\cdot _Ry) = (f(x))\cdot _S(f(y)) \)assumes \( x=y \)
shows \( P(x) = P(y) \)assumes \( r\in R \)
shows \( H(r) \in \text{End}(\mathcal{M} ,A_M) \) and \( H(r):\mathcal{M} \rightarrow \mathcal{M} \)assumes \( f:X\rightarrow X \) and \( g:X\rightarrow X \) and \( x\in X \)
shows \( ( \text{Composition}(X)\langle f,g\rangle )(x) = f(g(x)) \)assumes \( x\in X \)
shows \( \text{ConstantFunction}(X,c)(x) = c \)assumes \( a\in R \)
shows \( ( - a) \in R \), \( ( - ( - a)) = a \), \( a + 0 = a \), \( 0 + a = a \), \( a\cdot 1 = a \), \( 1 \cdot a = a \), \( a - a = 0 \), \( a - 0 = a \), \( 2 \cdot a = a + a \), \( ( - a) + a = 0 \)assumes \( x\in \mathcal{M} \)
shows \( 1 \cdot _Sx = x \)assumes \( r\in R \), \( s\in R \), \( x\in \mathcal{M} \)
shows \( (r + s)\cdot _Sx = r\cdot _Sx +_V s\cdot _Sx \)assumes \( a\in R \)
shows \( ( - a) \in R \), \( ( - ( - a)) = a \), \( a + 0 = a \), \( 0 + a = a \), \( a\cdot 1 = a \), \( 1 \cdot a = a \), \( a - a = 0 \), \( a - 0 = a \), \( 2 \cdot a = a + a \), \( ( - a) + a = 0 \)assumes \( g\in \mathcal{M} \)
shows \( 0 \cdot _Sg = \Theta \)assumes \( a\in G \) and \( b\in G \) and \( a\cdot b = 1 \)
shows \( a = b^{-1} \) and \( b = a^{-1} \)