CurrentModule = AbstractAlgebra
DocTestSetup = quote
using AbstractAlgebra
end
Abstract Algebra provides homomorphisms of finitely presented modules.
AbstractAlgebra defines two module homomorphism types, namely
Generic.ModuleHomomorphism
and Generic.ModuleIsomorphism
. Functionality
for these is implemented in src/generic/ModuleHomomorphism.jl
.
The Generic.ModuleHomomorphism
and Generic.ModuleIsomorphism
types inherit
from Map(FPModuleHomomorphism)
.
The following generic functionality is provided for module homomorphisms.
Homomorphisms of AbstractAlgebra modules,
ModuleHomomorphism(M1::FPModule{T}, M2::FPModule{T}, m::MatElem{T}) where T <: RingElement
ModuleIsomorphism(M1::FPModule{T}, M2::FPModule{T}, m::MatElem{T}) where T <: RingElement
Examples
julia> M = free_module(ZZ, 2)
Free module of rank 2 over integers
julia> f = ModuleHomomorphism(M, M, matrix(ZZ, 2, 2, [1, 2, 3, 4]))
Module homomorphism
from free module of rank 2 over integers
to free module of rank 2 over integers
julia> m = M([ZZ(1), ZZ(2)])
(1, 2)
julia> f(m)
(7, 10)
They can also be created by giving images (in the codomain) of the generators of the domain:
ModuleHomomorphism(M1::FPModule{T}, M2::FPModule{T}, v::Vector{<:FPModuleElem{T}}) where T <: RingElement
kernel(f::Map(FPModuleHomomorphism))
Examples
julia> M = free_module(ZZ, 3)
Free module of rank 3 over integers
julia> m = M([ZZ(1), ZZ(2), ZZ(3)])
(1, 2, 3)
julia> S, f = sub(M, [m])
(Submodule over integers with 1 generator and no relations, Hom: submodule over integers with 1 generator and no relations -> free module of rank 3 over integers)
julia> Q, g = quo(M, S)
(Quotient module over integers with 2 generators and no relations, Hom: free module of rank 3 over integers -> quotient module over integers with 2 generators and no relations)
julia> kernel(g)
(Submodule over integers with 1 generator and no relations, Hom: submodule over integers with 1 generator and no relations -> free module of rank 3 over integers)
image(::Map(FPModuleHomomorphism))
M = free_module(ZZ, 3)
m = M([ZZ(1), ZZ(2), ZZ(3)])
S, f = sub(M, [m])
Q, g = quo(M, S)
K, k = kernel(g)
image(compose(k, g))
preimage(::Map(FPModuleHomomorphism), ::FPModuleElem{T}) where T <: RingElement
M = free_module(ZZ, 3)
m = M([ZZ(1), ZZ(2), ZZ(3)])
S, f = sub(M, [m])
Q, g = quo(M, S)
m = rand(M, -10:10)
n = g(m)
p = preimage(g, n)
Module isomorphisms can be cheaply inverted.
Base.inv(::Map(Generic.ModuleIsomorphism))
M = free_module(ZZ, 2)
N = matrix(ZZ, 2, 2, BigInt[1, 0, 0, 1])
f = ModuleIsomorphism(M, M, N)
g = inv(f)