Harmonic means on finite types #
The harmonic mean of a nonnegative function on a finite type (Cslib.harmonicMean), zero as soon
as a value is zero, has a variational formula: it is the least energy 𝔼 (f w ^ 2) of a
nonnegative weight w of mean one Korten, Lemma 11
(Cslib.harmonicMean_variational). Completing the square gives the lower bound
(Cslib.harmonicMean_le_energy), and an explicit weight attains it, including when a value
vanishes (Cslib.harmonicMean_exists_weight). Hence the harmonic mean is monotone
(Cslib.harmonicMean_mono) and concave (Cslib.concaveOn_harmonicMean), and at most the
arithmetic mean (Cslib.harmonicMean_le_expect).
Main definitions #
Cslib.harmonicMean: the uniform harmonic mean on a finite type, zero whenever an entry is zero.
Main results #
Cslib.harmonicMean_le_energy,Cslib.harmonicMean_exists_weight,Cslib.harmonicMean_variational: the variational formula for the harmonic mean.Cslib.harmonicMean_mono,Cslib.concaveOn_harmonicMean,Cslib.harmonicMean_le_expect,Cslib.expect_harmonicMean_le: monotonicity, concavity, comparison with the arithmetic mean, and Jensen's inequality.Cslib.harmonicMean_light_fraction_le: reciprocal-density Markov bound for small entries.Cslib.harmonicMean_pair: two-point harmonic mean decomposition onBool × α.
References #
A zero entry makes the harmonic mean zero: inside the average, 0⁻¹ counts as ∞ rather than
as Lean's 0⁻¹ = 0.
The harmonic mean of positive entries is the reciprocal of the mean of their reciprocals.
Harmonic means of nonnegative entries are nonnegative.
Every weight with mean one bounds the harmonic mean by its quadratic energy. The weight need not be nonnegative for this direction.
A nonnegative weight of mean one attains the variational minimum,
including when an entry of f is zero.
The variational formula for the harmonic mean Korten, Lemma 11, on every
nonempty finite type: the harmonic mean is the least energy 𝔼 (f w ^ 2) of a nonnegative weight
w of mean one.
The harmonic mean is concave on nonnegative functions.
Jensen's inequality for the harmonic mean: the average of harmonic means is at most the harmonic mean of the average.
The harmonic mean of a constant on a nonempty finite set is that constant.
A positive harmonic-mean lower bound controls the fraction of small entries. This is the reciprocal-density Markov step used for light patterns.
The harmonic mean of a function on Bool × α is the two-point harmonic mean
2 h₀ h₁ / (h₀ + h₁) of the harmonic means h₀, h₁ of its two halves.