Consider all possible n! permutations of a n-dimensional vector x. This gives us n! permutation vectors in and n! permutation matrices in . Each of these vectors is equal to for each permutation matrix :
Picture two spaces side by side: the on the left lives in -dimensional space where , and its six vertices are the six permutation matrices .
The polytope on the right lives in -dimensional space, and its six vertices are the corresponding permutation vectors .
Inside each polytope sits an amber point:
import torch
# Permutation matrices (vertices of Birkhoff polytope)
P1 = torch.eye(3)
P2 = torch.Tensor([[0,1,0],[1,0,0],[0,0,1]])
P3 = torch.Tensor([[0,0,1],[0,1,0],[1,0,0]])
P4 = torch.Tensor([[1,0,0],[0,0,1],[0,1,0]])
P5 = torch.Tensor([[0,0,1],[1,0,0],[0,1,0]])
P6 = torch.Tensor([[0,1,0],[0,0,1],[1,0,0]])
P_full = torch.stack([P1, P2, P3, P4, P5, P6], dim=-1) # (3,3,6)
to_permute = torch.Tensor([1,2,3])
vertices = torch.stack([P_full[...,i] @ to_permute for i in range(6)])
print(vertices)
### Output ###:
tensor([[1., 2., 3.],
[2., 1., 3.],
[3., 2., 1.],
[1., 3., 2.],
[3., 1., 2.],
[2., 3., 1.]])
We saw that any point inside the Birkhoff polytope is a doubly stochastic matrix D which can be seen as a convex sum of permutation matrices. The corresponding convex sum of permutations of x is given by :
x = torch.randn(6).softmax(dim=-1) # (,6)
# point is a doubly stochastic matrix
point = (P_full * x).sum(dim=-1) # (3,3,6) => (3,3)
# (1,6) @ (6,3) -> (1,3) -> 3
print(x @ vertices) # convex sum of permutations of "to_permute"
# (3,3) @ (3,1) -> (3,1) -> 3
print(point @ to_permute) # same as (x @ vertices)
### Output ###:
tensor([2.2665, 1.8233, 1.9102])
tensor([2.2665, 1.8233, 1.9102])
This leads to the following property:
Each point
yin the convex hull of all permutations of vectorxis the productDxfor some doubly stochastic matrixD:y = Dx.
To appreciate its significance, we need to understand a few properties of doubly stochastic matrices.
For a doubly stochastic matrix D, if y = Dx, we have . It is easy to see that:
Given two arrays a and b of equal length n, we say that a majorizes b if:
In other words if and then the graph of cumulative sums of is above the graph of cumulative sums of and they intersect at the -th point.
Given a doubly stochastic matrix
Dand a vectorx, the input vectorxmajorizes the output vectory = Dx.
An example is shown below for permutation matrices and doubly stochastic matrices for n=3:
# refer to the code above for P_full
doubly_stochastic_matrix = (P_full * x).sum(dim=-1)
# pick a random vector which sums to 1
vector_in = torch.randn(3).softmax(dim=-1)
vector_out = doubly_stochastic_matrix @ vector_in
vector_in_sorted_cumsum = vector_in.sort(descending=True).values.cumsum(dim=-1)
vector_out_sorted_cumsum = vector_out.sort(descending=True).values.cumsum(dim=-1)
# condition for majorization
assert torch.all(vector_in_sorted_cumsum >= vector_out_sorted_cumsum)
print(vector_in_sorted_cumsum)
print(vector_out_sorted_cumsum)
### Output ###:
tensor([0.7674, 0.9329, 1.0000])
tensor([0.4229, 0.7315, 1.0000])
This property can be interpreted as "spreading out" the values of the input vector while keeping its sum the same. The limit of this "spreading out" is the vector with all equal values. In the example below, we use a different doubly stochastic matrix to show this property:
# start with a vector with all weight concentrated in one dimension
y = torch.Tensor([1,0,0])
for _ in range(10):
# create a new doubly stochastic matrix
x = torch.randn(6).softmax(dim=-1)
doubly_stochastic_matrix = (P_full * x).sum(dim=-1)
y = doubly_stochastic_matrix @ y
print(y)
### Output ###:
tensor([0.2121, 0.3339, 0.4540])
tensor([0.3614, 0.3435, 0.2951])
tensor([0.3218, 0.3403, 0.3379])
tensor([0.3346, 0.3360, 0.3294])
tensor([0.3325, 0.3334, 0.3342])
tensor([0.3333, 0.3330, 0.3337])
tensor([0.3333, 0.3333, 0.3334])
tensor([0.3333, 0.3333, 0.3333])
tensor([0.3333, 0.3333, 0.3333])
tensor([0.3333, 0.3333, 0.3333])
Muirhead's inequality concerns two vectors of the same length. It involves the mean of terms of the form , averaged over all permutations of the base . It can be seen as a function of two vectors a and x of equal length n.
The picture below lays out all six terms at once. The exponents stay pinned to slots 1, 2, 3; only the bases shuffle, one term per permutation. All six start dim, and we light them up one at a time.
Click each term to spotlight it:
Averaging these terms gives . In general, for vectors a and x of length n:
for all permutations .
Muirhead's inequality states that if majorizes , then for all . Writing this majorization relation as , the inequality gives us the following chain of implications:
The converse also holds: since input majorizes output for a doubly stochastic matrix, the mere existence of a doubly stochastic matrix with is already enough to conclude the same relation:
The below example has been taken from here. For example, majorizes . This means:
How are these two points linked? The link becomes clear once you write the doubly stochastic matrix as a convex sum of permutation matrices. The coefficients of the convex sum are the link to the first expression:
These are exactly the same coefficients that appear when the weighted AM-GM inequality is applied to the terms (the terms of ), one weighted sum per row of the doubly stochastic matrix:
Each row's right-hand side is one of the three terms of . Summing the left-hand sides recovers , since each of appears across the three rows with total weight ; summing the right-hand sides recovers . Together they give us the first expression. Given a doubly stochastic matrix, how can one express it as a convex sum of permutation matrices? This is what we explore next.