Compute Meet in Dominance Order



I need to compute the meet of two partitions λ=(λ1,,λr)\lambda=(\lambda_1,\ldots,\lambda_r) and μ=(μ1,,μs)\mu=(\mu_1,\ldots,\mu_s) with respect to the dominance order. It's not a difficult thing to do and might be considered an oddity by most of you, but that doesn't bother me.

Let ϱ:=λμ\varrho:=\lambda\vartriangle\mu be the meet of λ\lambda and μ\mu. We Compute a partition α\alpha by setting α1:=min(λ1,μ1)\alpha_1:=\min(\lambda_1,\mu_1) and recursively setting αi+1:=min{(λ1++λi+1)(α1++αi),(μ1++μi+1)(α1++αi),αi}. \alpha_{i+1} := \min\left{\scriptstyle\begin{array}{l} (\lambda_1+\cdots+\lambda_{i+1})-(\alpha_1+\cdots+\alpha_i),\ (\mu_1+\cdots+\mu_{i+1})-(\alpha_1+\cdots+\alpha_i), \ \alpha_i \end{array}\right}.

Fundamental Theorem of computing the Meet in the Dominance Order. α=ϱ\alpha=\varrho.

Proof. First, αλ\alpha \trianglelefteq \lambda and αμ\alpha\trianglelefteq\mu holds for obvious reasons: To show e.g. that for all ii, we have α1++αiλ1++λi, \alpha_1+\cdots+\alpha_i \le \lambda_1+\cdots+\lambda_i, we induct on ii with i=1i=1 being trivial and the induction step also follows immediately from the definition. Therefore, to show that α=ϱ,\alpha=\varrho, we simply need to show that ϱα.\varrho\trianglelefteq\alpha. If this is the case, then we must have ϱ=α\varrho=\alpha by definition of the meet. Again, we induct on ii. For i=1i=1, we have ϱ1λ1\varrho_1\le\lambda_1 and ϱ1μ1,\varrho_1\le\mu_1, so we also have ϱ1min(λ1,μ1)=α1.\varrho_1\le\min(\lambda_1,\mu_1)=\alpha_1. In the induction step, we assume α1++αi+di=ϱ1++ϱi \alpha_1+\cdots+\alpha_i + d_i = \varrho_1+\cdots+\varrho_i for some di0d_i \ge 0. Hence, α1++αi+ϱi+1+di=ϱ1++ϱi+1λ1++λi+1 \alpha_1 + \cdots + \alpha_i + \varrho_{i+1} + d_i = \varrho_1 + \cdots + \varrho_{i+1} \le \lambda_1 + \cdots + \lambda_{i+1} and it follows that ϱi+1+di(λ1++λi+1)(α1++αi)=αi+1, \varrho_{i+1} + d_i \le (\lambda_1+\cdots+\lambda_{i+1})-(\alpha_1+\cdots+\alpha_i) = \alpha_{i+1}, in other words ϱi+1αi+1\varrho_{i+1} \le \alpha_{i+1} which implies ϱi++ϱi+1α1++αi+1 \varrho_i + \cdots + \varrho_{i+1} \le \alpha_1 + \cdots + \alpha_{i+1} by again using the induction hypothesis. This concludes the proof. QED.

Python Implementation

>>> def dominanceMeet(p,q):
...     n = max( sum(p), sum(q) )
...     a = []
...     sp, sq, sa, prev, i = 0, 0, 0, n, 0
...     while prev:
...         sp += p[i] if i < len(p) else 0
...         sq += q[i] if i < len(q) else 0
...         prev, i = min(sp-sa, sq-sa, prev), i+1
...         sa += prev
...         if prev: a.append(prev)
...     return a
...
>>>
>>>
>>> dominanceMeet([3,1,1,1],[2,2,2])
[2, 2, 1, 1]
>>>

The code is written in a quite imperative style. That's because it's going to be C code rather soon.

Leave a Reply

Your email address will not be published. Required fields are marked *