# asymptotics: sign error in cohomology decomposition

Reported by: Owned by: gh-mwageringel major sage-9.1 asymptotic expansions dkrenn, araichev, cheuberg, behackl, arojas Markus Wageringel Dima Pasechnik N/A 5692f8b 5692f8bd8a45a4abfd71216b34a4b3d65f469469

### Description

This ticket fixes a sign error in the method `cohomology_decomposition` in `asymptotics_multivariate_generating_functions.py`. This problem currently blocks the upgrade of Singular 25993#comment:62.

The method `cohomology_decomposition` of `FractionWithFactoredDenominator` computes a cohomologous form in which each factor in the denominator appears to the power of at most one. The implementation very closely follows the proof of AY1983, Theorem 17.4.

The sign error arises as follows. In equation (17.11), the form is written in coordinates

```dz_{j_1} ∧ … ∧ dz_{j_m} ∧ dz_1 ∧ … [j_1,…,j_m] … ∧ dz_n
```

so that the indices `j_1,…,j_m` appear before the other indices, and therefore the parity sign `ε[J]` of the permutation that sorts the `j_1,…,j_m` to the front appears in this equation.

The computation in Sage however represents the form as `dz_1 ∧ … ∧ dz_n` without permuting – after all, it takes the sum of multiple such terms – and therefore the parity sign should not be used in this computation, but currently it is. (In the implemetation, `[z_1,…,z_n]` is called `X`.)

An example that fails:

```sage: from sage.rings.asymptotic.asymptotics_multivariate_generating_functions import FractionWithFactoredDenominatorRing
sage: R.<x,y> = PolynomialRing(QQ)
sage: FFPD = FractionWithFactoredDenominatorRing(R)
sage: p = 1
sage: qs = [(x*y - 1, 1), (x**2 + y**2 - 1, 2)]
sage: f = FFPD(p, qs)
sage: f.cohomology_decomposition()
(0, []) + (4/3*x*y + 4/3, [(x^2 + y^2 - 1, 1)]) + (1/3, [(x*y - 1, 1), (x^2 + y^2 - 1, 1)])
```

One can check using pen and paper that the correct result in this case would be:

```(0, []) + (-4/3*x*y, [(x^2 + y^2 - 1, 1)]) + (1/3, [(x*y - 1, 1), (x^2 + y^2 - 1, 1)])
```

(Though note that the result depends on the concrete choice of Nullstellensatz representatives in the call to `lift()`.)

In particular this ticket solves the problem mentioned in 25993#comment:62 that the `relative_error` does not become small when Singular 4.1.2p4 chooses different representatives in the call to `lift()`.

The internally used function `permutation_sign` is not needed anymore and therefore deprecated.

### comment:1 Changed 13 months ago by gh-mwageringel

• Authors set to Markus Wageringel
• Branch set to u/gh-mwageringel/29465
• Commit set to 5692f8bd8a45a4abfd71216b34a4b3d65f469469
• Status changed from new to needs_review

New commits:

 ​5692f8b `29465: fix sign error in cohomology_decomposition of asymptotics`

### comment:2 follow-up: ↓ 3 Changed 13 months ago by dimpase

• Reviewers set to Dima Pasechnik
• Status changed from needs_review to positive_review

Wow, you have been digging deep! Do you by any chance have an e-copy of [AY1983]?

By the way, is there a meausure-theoretic meaning to these differential forms, in the sense that they might be approximating integration over a semialgebraic (?) set determined by the demoninator w.r.t. to the density specified by the numerator?

At least this is that case if the denominator is a product of linear functions. (there, the linear functions correspond to vertices of a polyhedron, and the integration is over this polyhedron, with piecewise-polynomial denisties).

### comment:3 in reply to: ↑ 2 Changed 13 months ago by gh-mwageringel

Thank you for the review.

Do you by any chance have an e-copy of [AY1983]?

Sorry, I don't.

By the way, is there a meausure-theoretic meaning to these differential forms, in the sense that they might be approximating integration over a semialgebraic (?) set determined by the demoninator w.r.t. to the density specified by the numerator?

At least this is that case if the denominator is a product of linear functions. (there, the linear functions correspond to vertices of a polyhedron, and the integration is over this polyhedron, with piecewise-polynomial denisties).

I wish I could answer this question. It is something I would be interested in myself as well.

### comment:4 Changed 13 months ago by vbraun

• Branch changed from u/gh-mwageringel/29465 to 5692f8bd8a45a4abfd71216b34a4b3d65f469469
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.