We generalize the Szemerédi–Trotter incidence theorem, to bound the number of complete flags in higher dimensions. Specifically, for each i=0,1,…,d−1, we are given a finite set S[subscript i] of i-flats in ℝ[superscript d] or in ℂ[superscript d], and a (complete) flag is a tuple (f[subscript 0],f[subscript 1],…,f[subscript d−1]), where f[subscript i]∈S[subscript i] for each i and f[subscript i]⊂f[subscript i+1] for each i=0,1,…,d−2. Our main result is an upper bound on the number of flags which is tight in the worst case. We also study several other kinds of incidence problems, including (i) incidences between points and lines in ℝ[superscript 3] such that among the lines incident to a point, at most O(1) of them can be coplanar, (ii) incid...