How this calculation works
Invert cumulative rational values on a finite partial order and return its exact interval Möbius matrix.
g(y)=Σ_(x≤y)f(x), μ(x,x)=1, μ(x,y)=−Σ_(x≤z<y)μ(x,z); f(y)=Σ_(x≤y)μ(x,y)g(x).A worked example
For the default diamond and cumulative values 2,5,7,14, Möbius inversion recovers 2,3,5,4.
Good to know
1–30 elements, strict acyclic relations, one exact rational cumulative value per label, at most 12 digits per numerator/denominator. Complete incidence-algebra inversion with exact zeta recovery.
Reference: SageMath incidence algebras: convolution, zeta and Möbius inverse (opens in a new tab) ↗
Undo cumulative sums on a partial order
Suppose each observed value g(y) includes contributions from every x at or below y in a finite partial order. Möbius inversion recovers the original contributions f(x) by compensating for how lower sets overlap. This is a general inclusion–exclusion principle determined by the relation, not just subtraction of consecutive list entries.
On a chain, inversion reduces to first differences. On the subset lattice it becomes ordinary subset inclusion–exclusion. On more complicated posets the coefficients can be zero or integers with magnitude greater than one, so assuming that all signs simply alternate by a diagram level can produce an incorrect recovery.
Compare this with the Möbius function calculator. Invert cumulative sums on an arbitrary finite partial order using its incidence algebra. The existing number-theoretic Möbius function factors one integer and does not accept a poset or recover a function on its elements.
Define the order and the cumulative convention
Enter a count of labeled elements and strict precedence pairs. The calculator completes transitive relations and adds reflexivity internally. Your cumulative values must follow label order and use the convention g(y)=sum of f(x) over x≤y; changing to upper sums would transpose the relevant incidence matrix.
Rational inputs such as 7/3 are handled exactly. They are not treated as rounded decimal estimates, and a cyclic relation is rejected before inversion. Labels need not be topologically ordered, so the program constructs a compatible processing order rather than interpreting the numerical labels as the mathematical order.
Build the interval Möbius coefficients
The diagonal coefficient μ(x,x) is one. For a strict comparable pair x<y, the recurrence chooses μ(x,y) so that the sum of μ(x,z) over the interval x≤z≤y vanishes. Incomparable pairs receive zero because there is no interval relating them in this direction.
Processing upper endpoints in topological order makes the recurrence triangular. It is equivalent to inverting the zeta matrix, whose entry is one when x≤y and zero otherwise. The integer Möbius matrix depends only on the poset, so it can be reused conceptually for any new set of cumulative values on the same relation.
Work through the diamond recovery
The default has bottom 0, incomparable middle elements 1 and 2, and top 3. The first value gives f(0)=2. Subtracting that bottom contribution yields f(1)=5−2=3 and f(2)=7−2=5, after which the top contribution is 14−2−3−5=4.
In the direct Möbius formula for the top, the coefficients are (1,−1,−1,1) across labels 0,1,2,3. Thus f(3)=2−5−7+14=4. The positive bottom coefficient repairs the double subtraction introduced by the two overlapping middle lower sets, which is the inclusion–exclusion step visible in this example.
Verify by applying the zeta transform again
After recovery, the calculator resums the recovered f values over every lower set and compares the resulting vector with the entered g values. This exact recovery check catches direction, indexing and recurrence mistakes that could otherwise leave a plausible-looking list of signed coefficients.
You can repeat the same verification manually on a small example. In the diamond, the top lower set contains all four elements, and 2+3+5+4 returns 14. The lower set of middle element 1 contains only 0 and 1, giving 2+3=5; the other middle element similarly returns 7.
Distinguish poset Möbius from the integer function
The number-theoretic Möbius function μ(n) appears as a special case on a divisibility poset. A general finite-poset calculator accepts an arbitrary relation and produces μ(x,y) for intervals, so its inputs and outputs are richer than factoring one integer and checking whether it is square-free.
The same notation does not make the two interfaces interchangeable. A subset lattice, a hierarchy of cumulative categories and a finite divisibility diagram can all use this page after their relations are specified. The actual mathematical meaning of each label and each cumulative total still comes from your application.
Keep mathematical recovery separate from data quality
Inversion is exact for the entered rational values and finite relation. It does not estimate missing totals, remove measurement noise or enforce nonnegative recovered contributions. Negative f values may be mathematically correct for the supplied g, even if they reveal an inconsistency with an application that expects nonnegative counts.
Large cancellation can amplify uncertainty in measured cumulative data, although exact rational arithmetic avoids numerical rounding during the calculation itself. If your totals are approximate observations, inspect their precision and whether the assumed lower-set aggregation is justified. An exact algebraic inverse cannot repair a mistaken aggregation model.
A few questions, answered
Which direction are the sums taken?
The convention is lower sums: g(y) includes f(x) for every x≤y, including x=y.
Can recovered values be negative?
Yes. Algebraic inversion permits signed rational contributions; nonnegativity is not automatically imposed.
Is this the usual integer Möbius function?
That is a special case associated with divisibility. This page handles arbitrary finite partial orders.
How can I check the result?
Resum the recovered values over each lower set; the calculator performs this exact zeta recovery automatically.