Data structure for updates on intervals and querying number of zeros I am looking for a data structure that would maintain an integer table $t$ of size $n$, and allowing the following operations in time $O(\log n)$.


$\text{increase}(a,b)$, which increases $t[a],t[a+1],\ldots,t[b]$.
$\text{decrease}(a,b)$, which decreases $t[a],t[a+1],\ldots,t[b]$.
$\text{support}()$, which returns the number of indices $i$ such that $t[i]\neq 0$.


You have the promise that every call to decrease can be matched to a previous call to increase with the same parameters $a,b$. The application I have in mind is a sweepline algorithm to compute in time $O(n\log n)$ the area of the union of n given rectilinear rectangles. 

A quad-tree would have size $\Theta(n^2)$, so it is not a solution. Fenwick or Interval trees have the right flavor, but I don't see how to extend them to support the operations above.
Use a segment tree — a recursive partition of the range $[1,n]$ into smaller ranges. Each interval $[a,b]$ of your update operations can be partitioned into $O(\log n)$ of the ranges in this recursive partition. For each range $[x,y]$ store:


The number $c(x,y)$ of intervals $[a,b]$ that have been increased and not decreased such that $[x,y]$ is one of the ranges into which $[a,b]$ is partitioned
The number $u(x,y)$ of cells that are not covered by partitioned subsets of intervals that are at $[x,y]$ or lower in the recursion


Then if $[x,y]$ is recursively split into $[x,z]$ and $[z+1,w]$ we have
$$u(x,y)=\begin{cases}
0&amp;\text{if }c(x,y)&gt;0\\
u(x,z)+u(z+1,y)&amp;\text{otherwise}
\end{cases}$$
so we can update each $u(x,y)$ value in constant time when the other data for a range changes. Each support query can be answered by looking at $u(1,n)$.

To perform an increase$(a,b)$ operation, partition $[a,b]$ into $O(\log n)$ ranges, increment $c(x,y)$ for each of these ranges, and use the formula above to recalculate $u(x,y)$ for each of these ranges and each of their ancestors. The decrease operation is the same with a decrement instead of an increment.