4.2 Well-extensible indexing
4.5.2 ComputeDiscreteGradient and Matching are equivalent
4.5.3 Proposition. For any input pX, f q for ComputeDiscreteGradient, there exists a suitable input indexing J : X ´Ñ R for Matching such that the output of MatchingpX , ˜f, Jq equals that of ComputeDiscreteGradientpX , f q.
Proof. By Lemma 4.5.2 along with Proposition 3.3.1, the two algorithms run the auxiliary function HomotopyExpansion over the level sets Lset under the function ˜f. For ComputeDis- creteGradient, the global output is independently given by the outputs of each call of Homotopy- ExpansionpX , Lset, iq. From input pX , f q for ComputeDiscreteGradient, we want to construct a suitable indexing J over all the cells in X for the input of Matching such that each call of HomotopyExpansionpX , Lset, Jq gives the same output. Let I be the well-extensible indexing on vertexes returned by ComputeDiscreteGradient(X , f ). We know from Proposition3.3.1that, any level set Lset under ˜f satisfies Lset “ Lowfpaq for some unique a P Lset. Let P be as in
Lemma 4.5.2. By Lemma 4.5.2, we know that a P P. For each a P P, we indicate by Ja the
inclusion-compatible indexing ipďLexq over Lset providing the order in the ordered lists Ord0,
Ord1 in HomotopyExpansion(X , Lowfpaq, ipďLexq) Let g be any injective function P g
´Ñ R which is compatible with ˜f, i.e., ˜f paq ĺ ˜fpbq implies gpaq ď gpbq (obtained, for example, by topological sorting). Clearly, the level sets under ˜f form a partition of X . Thus, by Lemma4.5.2, it follows
that for every cell b P X there exists a unique cell abP P such that b P Lowfpabq. This implies that
we can extend g to a map G : X ´Ñ R still compatible to ˜f by setting Gpbq :“ gpabq. Thus, for any
simplex b, we get associated a pair of real numbers GJpbq “ pGpbq, Jabpbqq. Choose J : X ´Ñ R
to be an injective map imposing a total order equivalent to the lexicographic order over pairs of the form GJpbq.
GJpaq ďLexGJpbq ô Jpaq ď Jpbq.
We need to show that J satisfies the input requirements for algorithm Matching. In other words, J has to satisfy:
@a ‰ b P X , a ! b or ˜f paq ň ˜fpbq ñ Jpaq ă Jpbq. (4.11) By definition of ˜f, the relation a ! b with a ‰ b implies ˜fpaq ĺ ˜fpbq. By compatibility of G with
˜
f, it follows that ˜f paq ĺ ˜fpbq implies Gpaq ď Gpbq. In the case Gpaq ă Gpbq, by equivalence of J with the lexicographic order over GJ, we get Jpaq ă Jpbq. In the case Gpaq “ Gpbq, by injectivity of g, it follows that a, b belong to the same lower star Lowfp ¯aq, where ¯a P P. Being Ja¯compatible
with the incidence relation !, we get Jpaq ă Jpbq. Otherwise, suppose that ˜fpaq ň ˜fpbq. This implies necessarily Gpaq ď Gpbq and, thus, Jpaq ă Jpbq. By Lemma4.5.2, the two algorithms call HomotopyExpansion with the same input. Hence, they produce the same output.
As a corollary, we get the correctness of ComputeDiscreteGradient.
4.5.4 Corollary. Algorithm ComputeDiscreteGradient with input pX, f q returns a discrete gra- dient V compatible with the filtered complex Xf˜.
Proof. Each input pX , f q determines the filtered complex Xf˜. By Proposition4.5.3, the discrete gradient V is the same as the one retrieved by Matching with a suitable input representing the same filtered complex Xf˜. By Proposition 3.6 in [3], Algorithm Matching returns a discrete gradient V with its relative Morse set M which is compatible with the filtered complex Xf˜. The following proposition completes the equivalence between the algorithms ComputeDiscrete- Gradient and Matching. In particular, it states that all possible gradients retrieved by Matching can be obtained by the divide-and-conquer strategy of ComputeDiscreteGradient.
4.5.5 Proposition. Let pX, ˜f, Jq be a suitable input for Matching. Let f : X0´Ñ Rnbe the restric-
tion of ˜f to the vertexes. Then, the output of Matching(X , ˜f, J) equals that of ComputeDiscrete- Gradient(X , f ), provided that, for each level set Lset under ˜f, the function HomotopyExpansion is given pX , Lset, Jq as input.
Proof. Analogously to the proof of Proposition 4.5.3, by Lemma 4.5.2 along with Proposi- tion3.3.1, the two algorithms run the auxiliary function HomotopyExpansion on the level sets Lset of the function ˜f. The global output is independently given by the output of each call
of HomotopyExpansionpX , Lset, iq, with i a general indexing over X compatible with the co- face relations among cells. The output depends on i in assigning the order to the ordered lists Ord0, Ord1. In general, ComputeDiscreteGradient sets i “ ipďLexq where ďLexfollows from the
well-extensible indexing returned by ComputeIndexing. Instead, Matching sets i “ J. Hence, ComputeDiscreteGradient finds exactly the same discrete gradient as Matching, provided that pX , Lset, Jq is given to HomotopyExpansion as input.
This last statement provides not simply correctness, but it also states that ComputeDiscreteGra- dient is as general as Matching. This means that the introduction of the well-extensible indexing over the vertexes which is needed in algorithm ComputeDiscreteGradient can be performed for every possible input.