Rearrangement inequality #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file proves the rearrangement inequality and deduces the conditions for equality and strict inequality.
The rearrangement inequality tells you that for two functions f g : ι → α
, the sum
∑ i, f i * g (σ i)
is maximized over all σ : perm ι
when g ∘ σ
monovaries with f
and
minimized when g ∘ σ
antivaries with f
.
The inequality also tells you that ∑ i, f i * g (σ i) = ∑ i, f i * g i
if and only if g ∘ σ
monovaries with f
when g
monovaries with f
. The above equality also holds if and only if
g ∘ σ
antivaries with f
when g
antivaries with f
.
From the above two statements, we deduce that the inequality is strict if and only if g ∘ σ
does
not monovary with f
when g
monovaries with f
. Analogously, the inequality is strict if and
only if g ∘ σ
does not antivary with f
when g
antivaries with f
.
Implementation notes #
In fact, we don't need much compatibility between the addition and multiplication of α
, so we can
actually decouple them by replacing multiplication with scalar multiplication and making f
and g
land in different types.
As a bonus, this makes the dual statement trivial. The multiplication versions are provided for
convenience.
The case for monotone
/antitone
pairs of functions over a linear_order
is not deduced in this
file because it is easily deducible from the monovary
API.
Scalar multiplication versions #
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is maximized when
f
and g
monovary together. Stated by permuting the entries of g
.
Equality case of Rearrangement Inequality: Pointwise scalar multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f
and g ∘ σ
monovary
together. Stated by permuting the entries of g
.
Strict inequality case of Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not monovary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is maximized when
f
and g
monovary together. Stated by permuting the entries of f
.
Equality case of Rearrangement Inequality: Pointwise scalar multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f ∘ σ
and g
monovary
together. Stated by permuting the entries of f
.
Strict inequality case of Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f ∘ σ
and g
do not monovary together. Stated by permuting the entries of f
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is minimized when
f
and g
antivary together. Stated by permuting the entries of g
.
Equality case of the Rearrangement Inequality: Pointwise scalar multiplication of f
and
g
, which antivary together, is unchanged by a permutation if and only if f
and g ∘ σ
antivary
together. Stated by permuting the entries of g
.
Strict inequality case of the Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not antivary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is minimized when
f
and g
antivary together. Stated by permuting the entries of f
.
Equality case of the Rearrangement Inequality: Pointwise scalar multiplication of f
and
g
, which antivary together, is unchanged by a permutation if and only if f ∘ σ
and g
antivary
together. Stated by permuting the entries of f
.
Strict inequality case of the Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f ∘ σ
and g
do not antivary together. Stated by permuting the entries of f
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is maximized when
f
and g
monovary together. Stated by permuting the entries of g
.
Equality case of Rearrangement Inequality: Pointwise scalar multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f
and g ∘ σ
monovary
together. Stated by permuting the entries of g
.
Strict inequality case of Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not monovary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is maximized when
f
and g
monovary together. Stated by permuting the entries of f
.
Equality case of Rearrangement Inequality: Pointwise scalar multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f ∘ σ
and g
monovary
together. Stated by permuting the entries of g
.
Strict inequality case of Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not monovary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is minimized when
f
and g
antivary together. Stated by permuting the entries of g
.
Equality case of the Rearrangement Inequality: Pointwise scalar multiplication of f
and
g
, which antivary together, is unchanged by a permutation if and only if f
and g ∘ σ
antivary
together. Stated by permuting the entries of g
.
Strict inequality case of the Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not antivary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise scalar multiplication of f
and g
is minimized when
f
and g
antivary together. Stated by permuting the entries of f
.
Equality case of the Rearrangement Inequality: Pointwise scalar multiplication of f
and
g
, which antivary together, is unchanged by a permutation if and only if f ∘ σ
and g
antivary
together. Stated by permuting the entries of f
.
Strict inequality case of the Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f ∘ σ
and g
do not antivary together. Stated by permuting the entries of f
.
Multiplication versions #
Special cases of the above when scalar multiplication is actually multiplication.
Rearrangement Inequality: Pointwise multiplication of f
and g
is maximized when f
and
g
monovary together. Stated by permuting the entries of g
.
Equality case of Rearrangement Inequality: Pointwise multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f
and g ∘ σ
monovary
together. Stated by permuting the entries of g
.
Strict inequality case of Rearrangement Inequality: Pointwise scalar multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not monovary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is maximized when f
and
g
monovary together. Stated by permuting the entries of f
.
Equality case of Rearrangement Inequality: Pointwise multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f ∘ σ
and g
monovary
together. Stated by permuting the entries of f
.
Strict inequality case of Rearrangement Inequality: Pointwise multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f ∘ σ
and g
do not monovary together. Stated by permuting the entries of f
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is minimized when f
and
g
antivary together. Stated by permuting the entries of g
.
Equality case of the Rearrangement Inequality: Pointwise multiplication of f
and g
,
which antivary together, is unchanged by a permutation if and only if f
and g ∘ σ
antivary
together. Stated by permuting the entries of g
.
Strict inequality case of the Rearrangement Inequality: Pointwise multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not antivary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is minimized when f
and
g
antivary together. Stated by permuting the entries of f
.
Equality case of the Rearrangement Inequality: Pointwise multiplication of f
and g
,
which antivary together, is unchanged by a permutation if and only if f ∘ σ
and g
antivary
together. Stated by permuting the entries of f
.
Strict inequality case of the Rearrangement Inequality: Pointwise multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f ∘ σ
and g
do not antivary together. Stated by permuting the entries of f
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is maximized when f
and
g
monovary together. Stated by permuting the entries of g
.
Equality case of Rearrangement Inequality: Pointwise multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f
and g ∘ σ
monovary
together. Stated by permuting the entries of g
.
Strict inequality case of Rearrangement Inequality: Pointwise multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not monovary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is maximized when f
and
g
monovary together. Stated by permuting the entries of f
.
Equality case of Rearrangement Inequality: Pointwise multiplication of f
and g
,
which monovary together, is unchanged by a permutation if and only if f ∘ σ
and g
monovary
together. Stated by permuting the entries of g
.
Strict inequality case of Rearrangement Inequality: Pointwise multiplication of
f
and g
, which monovary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not monovary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is minimized when f
and
g
antivary together. Stated by permuting the entries of g
.
Equality case of the Rearrangement Inequality: Pointwise multiplication of f
and g
,
which antivary together, is unchanged by a permutation if and only if f
and g ∘ σ
antivary
together. Stated by permuting the entries of g
.
Strict inequality case of the Rearrangement Inequality: Pointwise multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f
and g ∘ σ
do not antivary together. Stated by permuting the entries of g
.
Rearrangement Inequality: Pointwise multiplication of f
and g
is minimized when f
and
g
antivary together. Stated by permuting the entries of f
.
Equality case of the Rearrangement Inequality: Pointwise multiplication of f
and g
,
which antivary together, is unchanged by a permutation if and only if f ∘ σ
and g
antivary
together. Stated by permuting the entries of f
.
Strict inequality case of the Rearrangement Inequality: Pointwise multiplication of
f
and g
, which antivary together, is strictly decreased by a permutation if and only if
f ∘ σ
and g
do not antivary together. Stated by permuting the entries of f
.