How this calculation works
Construct the Mayer–Vietoris long exact sequence over a small prime field, including explicit connecting maps and representative chain lifts.
... -> H_k(A∩B) -> H_k(A)⊕H_k(B) -> H_k(A∪B) ->δ H_(k-1)(A∩B) -> ...; i(c)=(c,-c), j(a,b)=a+b.A worked example
A has edges 01,12 and B has edges 03,23. Their union is a four-edge circle, their intersection consists of vertices 0 and 2, and the connecting map H1(union) to H0(intersection) has rank one.
Good to know
Two finite subcomplexes A,B of dimension at most 2, at most 80 total expanded faces; GF(p), p=2,3,5,7. Their union is the ambient complex by construction. Construct chain splittings for cycles in the union and connecting cycles in the intersection. Return matrices and representative lifts in deterministic bases and verify image=kernel at every returned degree. Unreduced sequence with proper terminal H0 map; no arbitrary geometric open covers inferred.
Reference: Hatcher, Chapter 2 Mayer Vietoris (opens in a new tab) ↗
Specify a combinatorial cover
Enter maximal simplices for each of two subcomplexes using shared vertex labels. An edge contributes its endpoints, and a triangle contributes its three edges and vertices. The calculator expands these faces before taking the intersection and union. Shared labels identify the same vertex; geometrically coincident points with different labels remain different vertices unless the input explicitly identifies them.
The ambient complex is the union of the two entered subcomplexes. There is no additional geometric space hidden behind that construction. A drawing of overlapping regions does not establish a suitable cover unless the finite complexes encode the intended identifications. Keeping this data explicit lets every inclusion map be built directly on chain coordinates and makes missing faces and inconsistent labels detectable.
Compare this with the Relative simplicial homology calculator for a complex and subcomplex. Existing relative homology has quotient boundaries but explicitly no long exact sequence maps. Compute homology of A, B, A intersection B and their union together with inclusion/sum maps and the dimension-lowering connecting map, checking exactness.
Choose coefficients and orientations
Coefficients lie in GF(p) for p equal to 2, 3, 5 or 7. Every arithmetic operation, including division during row reduction, takes place in that field. A nonzero pivot therefore has a unique multiplicative inverse. Results can differ between fields, so the chosen prime belongs in any saved calculation or comparison with another homology implementation.
Sort vertex labels consistently to orient simplices, then use the alternating boundary formula. Over GF(2), a negative coefficient equals its positive counterpart, which hides some sign mistakes. An odd-prime example is useful because the inclusion into the direct sum must use opposite signs on its two copies of an intersection chain. The convention must remain consistent through connecting-map representatives.
Construct the connecting homomorphism
A homology class in the union is represented by a cycle z. Split that chain into z=a+b with a supported in A and b supported in B. Because the boundary of z vanishes, the boundaries of a and b are opposites and are supported in the intersection. The connecting class is represented by the boundary of a under the stated sign convention.
Different legal splittings can produce different chains but the same homology class after quotienting by intersection boundaries. The implementation must therefore report a deterministic representative and reduce its image in a deterministic homology basis. Returning only a dimension count would omit the actual homomorphism. The lift, boundary chain and reduced coordinate vector provide complementary checks on how the class was mapped.
Follow a circle through the sequence
In the default example each arc has three vertices and two edges, so each is connected and has no one-dimensional cycle. The intersection has the two endpoints 0 and 2 with no joining edge. Its zeroth homology has dimension two. The union has four vertices and four edges arranged as a circle, giving Betti numbers one in degrees zero and one.
Orient the circle cycle as [01]+[12]+[23]-[03], using ascending edge orientations. Its A-supported portion is [01]+[12], whose boundary is [2]-[0]. The connecting class is nonzero and spans the one-dimensional kernel of the next map. Over GF(3) the coordinate vector on intersection vertices ordered 0,2 is (2,1), which makes the sign convention visible.
Verify exactness rather than dimensions alone
For each consecutive pair of returned maps, multiply their matrices and check that the product is zero over the chosen field. This verifies that the image is contained in the next kernel. Also compare the rank of the incoming map with the nullity of the outgoing map. The two checks together establish equality of the relevant subspaces in the finite calculation.
For the circle cover, the map from intersection H0 to H0(A) plus H0(B) sends both vertex classes to the same vector (1,-1). Its rank is one and its kernel consists of differences of the two intersection components. The following map adds the two component coordinates into the connected union. Its one-dimensional kernel is exactly that preceding rank-one image.
Read the cover diagram
The square boundary in the illustration is a circle model, not a filled square. One arc follows its upper route and the other follows its lower route, with the left and right endpoints belonging to both. The two isolated intersection points explain why a new loop appears in the union even though neither arc itself contains a loop.
The arrow from the loop to an endpoint difference is a map between homology classes, not a physical projection of every point in the square. In particular, the result does not choose one endpoint as the image of the entire circle. It records the boundary exposed when the cycle is separated into its two covered chain pieces, with field coefficients retaining orientation information.
Respect the scope of finite-field homology
The accepted complexes have dimension at most two and at most eighty expanded faces across the cover. This supports explicit matrices and readable representatives without implying that larger or higher-dimensional complexes are invalid mathematical objects. Hitting a resource limit is a computational status and must not be interpreted as vanishing homology or a failed exact sequence.
The sequence is unreduced, so the terminal map to H0 of the union and then zero must be included correctly. An empty intersection has zero ordinary chain groups and needs explicit handling. Finite-field results do not recover integral torsion orders, and this calculator does not infer open covers, deformation retractions or a triangulation of a geometric region from an informal drawing.
A few questions, answered
Are faces entered separately?
No. Enter maximal simplices; all nonempty faces are added automatically.
Why does the prime matter?
Homology is computed over the selected finite field, and some spaces have field-dependent Betti numbers.
Is the connecting map only a rank?
No. It includes matrix coordinates and chain representatives under a stated sign convention.
Why keep ordinary H0?
This page returns the unreduced sequence, whose terminal component map is part of the exactness check.