Chain homotopies and chain contractions¶
Chain homotopies are standard constructions in homological algebra:
given chain complexes and
and chain maps
, say
with differential of degree
, a chain homotopy
between
and
is a collection of maps
satisfying
The presence of a chain homotopy defines an equivalence relation
(chain homotopic) on chain maps. If and
are chain homotopic,
then one can show that
and
induce the same map on homology.
Chain contractions are not as well known. The papers [M-AR], [RM-A],
and [PR] provide some references. Given two chain complexes and
, a chain contraction is a chain homotopy
for which
there are chain maps
(“projection”) and
(“inclusion”) such that
is a chain homotopy between
and
,
,
,
,
.
Such a chain homotopy provides a strong relation between the chain
complexes and
; for example, their homology groups are
isomorphic.
REFERENCES:
[M-AR] | (1, 2, 3) H. Molina-Abril and P. Réal, Homology computation using spanning trees in Progress in Pattern Recognition, Image Analysis, Computer Vision, and Applications, Lecture Notes in Computer Science, volume 5856, pp 272-278, Springer, Berlin (2009). |
[PR] | P. Pilarczyk and P. Réal, Computation of cubical homology, cohomology, and (co)homological operations via chain contraction, Adv. Comput. Math. 41 (2015), pp 253–275. |
[RM-A] | (1, 2, 3) P. Réal and H. Molina-Abril, Cell AT-models for digital volumes in Torsello, Escolano, Brun (eds.), Graph-Based Representations in Pattern Recognition, Lecture Notes in Computer Science, volume 5534, pp. 314-3232, Springer, Berlin (2009). |
-
class
sage.homology.chain_homotopy.
ChainContraction
(matrices, pi, iota)¶ Bases:
sage.homology.chain_homotopy.ChainHomotopy
A chain contraction.
An algebraic gradient vector field
(that is a chain homotopy satisfying
) for which there are chain maps
(“projection”) and
(“inclusion”) such that
is a chain homotopy between
and
,
,
,
.
H
is defined by a dictionarymatrices
of matrices.INPUT:
matrices
– dictionary of matrices, keyed by dimensionpi
– a chain mapiota
– a chain map
EXAMPLES:
sage: from sage.homology.chain_homotopy import ChainContraction sage: C = ChainComplex({0: zero_matrix(ZZ, 1), 1: identity_matrix(ZZ, 1)}) sage: D = ChainComplex({0: matrix(ZZ, 0, 1)})
The chain complex
is chain homotopy equivalent to
, which is just a copy of
in degree 0, and we construct a chain contraction:
sage: pi = Hom(C,D)({0: identity_matrix(ZZ, 1)}) sage: iota = Hom(D,C)({0: identity_matrix(ZZ, 1)}) sage: H = ChainContraction({0: zero_matrix(ZZ, 0, 1), 1: zero_matrix(ZZ, 1), 2: identity_matrix(ZZ, 1)}, pi, iota)
-
dual
()¶ The chain contraction dual to this one.
This is useful when switching from homology to cohomology.
EXAMPLES:
sage: S2 = simplicial_complexes.Sphere(2) sage: phi, M = S2.algebraic_topological_model(QQ) sage: phi.iota() Chain complex morphism: From: Chain complex with at most 3 nonzero terms over Rational Field To: Chain complex with at most 3 nonzero terms over Rational Field
Lifting the degree zero homology class gives a single vertex, but the degree zero cohomology class needs to be detected on every vertex, and vice versa for degree 2:
sage: phi.iota().in_degree(0) [0] [0] [0] [1] sage: phi.dual().iota().in_degree(0) [1] [1] [1] [1] sage: phi.iota().in_degree(2) [-1] [ 1] [-1] [ 1] sage: phi.dual().iota().in_degree(2) [0] [0] [0] [1]
-
iota
()¶ The chain map
associated to this chain contraction.
EXAMPLES:
sage: S2 = simplicial_complexes.Sphere(2) sage: phi, M = S2.algebraic_topological_model(QQ) sage: phi.iota() Chain complex morphism: From: Chain complex with at most 3 nonzero terms over Rational Field To: Chain complex with at most 3 nonzero terms over Rational Field
Lifting the degree zero homology class gives a single vertex:
sage: phi.iota().in_degree(0) [0] [0] [0] [1]
Lifting the degree two homology class gives the signed sum of all of the 2-simplices:
sage: phi.iota().in_degree(2) [-1] [ 1] [-1] [ 1]
-
pi
()¶ The chain map
associated to this chain contraction.
EXAMPLES:
sage: S2 = simplicial_complexes.Sphere(2) sage: phi, M = S2.algebraic_topological_model(QQ) sage: phi.pi() Chain complex morphism: From: Chain complex with at most 3 nonzero terms over Rational Field To: Chain complex with at most 3 nonzero terms over Rational Field sage: phi.pi().in_degree(0) # Every vertex represents a homology class. [1 1 1 1] sage: phi.pi().in_degree(1) # No homology in degree 1. []
The degree 2 homology generator is detected on a single simplex:
sage: phi.pi().in_degree(2) [0 0 0 1]
-
class
sage.homology.chain_homotopy.
ChainHomotopy
(matrices, f, g=None)¶ Bases:
sage.categories.morphism.Morphism
A chain homotopy.
A chain homotopy
between chain maps
is a sequence of maps
(if the chain complexes are graded homologically) satisfying
INPUT:
matrices
– dictionary of matrices, keyed by dimensionf
– chain mapg
(optional) – chain map
The dictionary
matrices
definesH
by specifying the matrix defining it in each degree: the entrycorresponding to key
gives the linear transformation
.
If
is specified but not
, then
can be recovered from the defining formula. That is, if
is not specified, then it is defined to be
.
Note that the degree of the differential on the chain complex
must agree with that for
, and those degrees determine the “degree” of the chain homotopy map: if the degree of the differential is
, then the chain homotopy consists of a sequence of maps
. The keys in the dictionary
matrices
specify the starting degrees.EXAMPLES:
sage: from sage.homology.chain_homotopy import ChainHomotopy sage: C = ChainComplex({0: identity_matrix(ZZ, 1)}) sage: D = ChainComplex({0: zero_matrix(ZZ, 1)}) sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: g = Hom(C,D)({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: H = ChainHomotopy({0: zero_matrix(ZZ, 0, 1), 1: identity_matrix(ZZ, 1)}, f, g)
Note that the maps
and
are stored in the attributes
H._f
andH._g
:sage: H._f Chain complex morphism: From: Chain complex with at most 2 nonzero terms over Integer Ring To: Chain complex with at most 2 nonzero terms over Integer Ring sage: H._f.in_degree(0) [1] sage: H._g.in_degree(0) [0]
A non-example:
sage: H = ChainHomotopy({0: zero_matrix(ZZ, 0, 1), 1: zero_matrix(ZZ, 1)}, f, g) Traceback (most recent call last): ... ValueError: the data do not define a valid chain homotopy
-
dual
()¶ Dual chain homotopy to this one.
That is, if this one is a chain homotopy between chain maps
, then its dual is a chain homotopy between the dual of
and the dual of
, from
to
. It is represented in each degree by the transpose of the corresponding matrix.
EXAMPLES:
sage: from sage.homology.chain_homotopy import ChainHomotopy sage: C = ChainComplex({1: matrix(ZZ, 0, 2)}) # one nonzero term in degree 1 sage: D = ChainComplex({0: matrix(ZZ, 0, 1)}) # one nonzero term in degree 0 sage: f = Hom(C, D)({}) sage: H = ChainHomotopy({1: matrix(ZZ, 1, 2, (3,1))}, f, f) sage: H.in_degree(1) [3 1] sage: H.dual().in_degree(0) [3] [1]
-
in_degree
(n)¶ The matrix representing this chain homotopy in degree
n
.INPUT:
n
– degree
EXAMPLES:
sage: from sage.homology.chain_homotopy import ChainHomotopy sage: C = ChainComplex({1: matrix(ZZ, 0, 2)}) # one nonzero term in degree 1 sage: D = ChainComplex({0: matrix(ZZ, 0, 1)}) # one nonzero term in degree 0 sage: f = Hom(C, D)({}) sage: H = ChainHomotopy({1: matrix(ZZ, 1, 2, (3,1))}, f, f) sage: H.in_degree(1) [3 1]
This returns an appropriately sized zero matrix if the chain homotopy is not defined in degree n:
sage: H.in_degree(-3) []
-
is_algebraic_gradient_vector_field
()¶ An algebraic gradient vector field is a linear map
such that
.
(Some authors also require that
, whereas some make this part of the definition of “homology gradient vector field. We have made the second choice.) See Molina-Abril and Réal [M-AR] and Réal and Molina-Abril [RM-A] for this and related terminology.
See also
is_homology_gradient_vector_field()
.EXAMPLES:
sage: from sage.homology.chain_homotopy import ChainHomotopy sage: C = ChainComplex({0: zero_matrix(ZZ, 1), 1: identity_matrix(ZZ, 1)})
The chain complex
is chain homotopy equivalent to a copy of
in degree 0. Two chain maps
will be chain homotopic as long as they agree in degree 0.
sage: f = Hom(C,C)({0: identity_matrix(ZZ, 1), 1: matrix(ZZ, 1, 1, [3]), 2: matrix(ZZ, 1, 1, [3])}) sage: g = Hom(C,C)({0: identity_matrix(ZZ, 1), 1: matrix(ZZ, 1, 1, [2]), 2: matrix(ZZ, 1, 1, [2])}) sage: H = ChainHomotopy({0: zero_matrix(ZZ, 0, 1), 1: zero_matrix(ZZ, 1), 2: identity_matrix(ZZ, 1)}, f, g) sage: H.is_algebraic_gradient_vector_field() True
A chain homotopy which is not an algebraic gradient vector field:
sage: H = ChainHomotopy({0: zero_matrix(ZZ, 0, 1), 1: identity_matrix(ZZ, 1), 2: identity_matrix(ZZ, 1)}, f, g) sage: H.is_algebraic_gradient_vector_field() False
-
is_homology_gradient_vector_field
()¶ A homology gradient vector field is an algebraic gradient vector field
(i.e., a chain homotopy satisfying
) such that
and
.
See Molina-Abril and Réal [M-AR] and Réal and Molina-Abril [RM-A] for this and related terminology.
See also
is_algebraic_gradient_vector_field()
.EXAMPLES:
sage: from sage.homology.chain_homotopy import ChainHomotopy sage: C = ChainComplex({0: zero_matrix(ZZ, 1), 1: identity_matrix(ZZ, 1)}) sage: f = Hom(C,C)({0: identity_matrix(ZZ, 1), 1: matrix(ZZ, 1, 1, [3]), 2: matrix(ZZ, 1, 1, [3])}) sage: g = Hom(C,C)({0: identity_matrix(ZZ, 1), 1: matrix(ZZ, 1, 1, [2]), 2: matrix(ZZ, 1, 1, [2])}) sage: H = ChainHomotopy({0: zero_matrix(ZZ, 0, 1), 1: zero_matrix(ZZ, 1), 2: identity_matrix(ZZ, 1)}, f, g) sage: H.is_homology_gradient_vector_field() True