# Euler calculus

For numerical analysis of ordinary differential equations, see Euler's method.

Euler calculus is a methodology from applied algebraic topology and integral geometry that integrates constructible functions and more recently definable functions[1] by integrating with respect to the Euler characteristic as a finitely-additive measure. In the presence of a metric, it can be extended to continuous integrands via the Gauss–Bonnet theorem.[2] It was introduced independently by Pierre Schapira[3][4][5] and Oleg Viro[6] in 1988, and is useful for enumeration problems in computational geometry and sensor networks.[7]

## Euler integration for constructible functions

Euler calculus begins from the observation that the Euler characteristic obeys one of the main properties of a measure: ${\displaystyle \chi (A\cup B)=\chi (A)+\chi (B)-\chi (A\cap B)}$. As a result, for a suitably restricted class of functions, it is possible to define an integral with respect to this measure. One begins by selecting an o-minimal structure of definable sets in the topology, for instance, semialgebraic or subanalytic sets. The class of constructible functions consists of those functions ${\displaystyle f:X\to \mathbb {Z} }$ such that ${\displaystyle f^{-1}(n)}$ is definable for all ${\displaystyle n}$. A definition of the Euler integral follows:

${\displaystyle \int _{X}fd\chi =\sum _{n=-\infty }^{\infty }n\chi (f^{-1}(n)).}$
Due to the properties of the o-minimal structure, the integral may also be computed by decomposing ${\displaystyle f}$ as a sum of indicator functions defined on a disjoint union of cells ${\displaystyle \sigma _{\alpha }}$ (giving ${\displaystyle X}$ a cell structure). If ${\displaystyle f=\sum _{\alpha }n_{\alpha }\mathbf {1} _{\sigma _{\alpha }}}$, then
${\displaystyle \int _{X}fd\chi =\sum _{\alpha }n_{\alpha }\chi (\sigma _{\alpha }).}$