  We introduce two new complexity measures for Boolean functions, or more
generally for functions of the form f:S->T. We call these measures sumPI and
maxPI. The quantity sumPI has been emerging through a line of research on
quantum query complexity lower bounds via the so-called quantum adversary
method [Amb02, Amb03, BSS03, Zha04, LM04], culminating in [SS04] with the
realization that these many different formulations are in fact equivalent.
Given that sumPI turns out to be such a robust invariant of a function, we
begin to investigate this quantity in its own right and see that it also has
applications to classical complexity theory.
  As a surprising application we show that sumPI^2(f) is a lower bound on the
formula size, and even, up to a constant multiplicative factor, the
probabilistic formula size of f. We show that several formula size lower bounds
in the literature, specifically Khrapchenko and its extensions [Khr71, Kou93],
including a key lemma of [Has98], are in fact special cases of our method.
  The second quantity we introduce, maxPI(f), is always at least as large as
sumPI(f), and is derived from sumPI in such a way that maxPI^2(f) remains a
lower bound on formula size. While sumPI(f) is always a lower bound on the
quantum query complexity of f, this is not the case in general for maxPI(f). A
strong advantage of sumPI(f) is that it has both primal and dual
characterizations, and thus it is relatively easy to give both upper and lower
bounds on the sumPI complexity of functions. To demonstrate this, we look at a
few concrete examples, for three functions: recursive majority of three, a
function defined by Ambainis, and the collision problem.
