# expansion.complement¶

An expansion which denotes the complement of this expansion.

See also:

References:

## Examples¶

In [1]:
import vcsn
e = vcsn.B.expression('a*b')
e.expansion()

Out[1]:
$a \odot \left[{a}^{*} \, b\right] \oplus b \odot \left[\varepsilon\right]$
In [2]:
e.expansion().complement()

Out[2]:
$\left\langle \top\right\rangle \oplus a \odot \left[\left({a}^{*} \, b\right)^{c}\right] \oplus b \odot \left[{\varepsilon}^{c}\right]$
In [3]:
e.complement().expansion()

Out[3]:
$\left\langle \top\right\rangle \oplus a \odot \left[\left({a}^{*} \, b\right)^{c}\right] \oplus b \odot \left[{\varepsilon}^{c}\right]$
In [4]:
e.complement().derived_term()

Out[4]:

Note that complementing an expansion "determinizes" it: each first is mapped to a monomial. Note in the following example that the label $a$ maps to a two-term polynomial ($a$ and $b$), but in the complement, it has a single-term polynomial ($a+b$, observe $\oplus$ vs. $+$).

In [5]:
e = vcsn.B.expression('aa+ab')
x = e.expansion()
x

Out[5]:
$a \odot \left[a \oplus b\right]$
In [6]:
x.complement()

Out[6]:
$\left\langle \top\right\rangle \oplus a \odot \left[\left(a + b\right)^{c}\right] \oplus b \odot \left[{\emptyset}^{c}\right]$
In [7]:
e.derived_term()

Out[7]:
In [8]:
e.complement().derived_term()

Out[8]: