Incidence Algebras

class sage.combinat.posets.incidence_algebras.IncidenceAlgebra(R, P, prefix='I')[source]

Bases: CombinatorialFreeModule

The incidence algebra of a poset.

Let \(P\) be a poset and \(R\) be a commutative unital associative ring. The incidence algebra \(I_P\) is the algebra of functions \(\alpha \colon P \times P \to R\) such that \(\alpha(x, y) = 0\) if \(x \not\leq y\) where multiplication is given by convolution:

\[(\alpha \ast \beta)(x, y) = \sum_{x \leq k \leq y} \alpha(x, k) \beta(k, y).\]

This has a natural basis given by indicator functions for the interval \([a, b]\), i.e. \(X_{a,b}(x,y) = \delta_{ax} \delta_{by}\). The incidence algebra is a unital algebra with the identity given by the Kronecker delta \(\delta(x, y) = \delta_{xy}\). The Möbius function of \(P\) is another element of \(I_p\) whose inverse is the \(\zeta\) function of the poset (so \(\zeta(x, y) = 1\) for every interval \([x, y]\)).

Todo

Implement the incidence coalgebra.

REFERENCES:

class Element[source]

Bases: IndexedFreeModuleElement

An element of an incidence algebra.

is_unit()[source]

Return if self is a unit.

EXAMPLES:

sage: P = posets.BooleanLattice(2)
sage: I = P.incidence_algebra(QQ)
sage: mu = I.moebius()
sage: mu.is_unit()
True
sage: zeta = I.zeta()
sage: zeta.is_unit()
True
sage: x = mu - I.zeta() + I[2,2]
sage: x.is_unit()
False
sage: y = I.moebius() + I.zeta()
sage: y.is_unit()
True
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(2))
>>> I = P.incidence_algebra(QQ)
>>> mu = I.moebius()
>>> mu.is_unit()
True
>>> zeta = I.zeta()
>>> zeta.is_unit()
True
>>> x = mu - I.zeta() + I[Integer(2),Integer(2)]
>>> x.is_unit()
False
>>> y = I.moebius() + I.zeta()
>>> y.is_unit()
True
P = posets.BooleanLattice(2)
I = P.incidence_algebra(QQ)
mu = I.moebius()
mu.is_unit()
zeta = I.zeta()
zeta.is_unit()
x = mu - I.zeta() + I[2,2]
x.is_unit()
y = I.moebius() + I.zeta()
y.is_unit()

This depends on the base ring:

sage: I = P.incidence_algebra(ZZ)
sage: y = I.moebius() + I.zeta()
sage: y.is_unit()
False
>>> from sage.all import *
>>> I = P.incidence_algebra(ZZ)
>>> y = I.moebius() + I.zeta()
>>> y.is_unit()
False
I = P.incidence_algebra(ZZ)
y = I.moebius() + I.zeta()
y.is_unit()
to_matrix()[source]

Return self as a matrix.

We define a matrix \(M_{xy} = \alpha(x, y)\) for some element \(\alpha \in I_P\) in the incidence algebra \(I_P\) and we order the elements \(x,y \in P\) by some linear extension of \(P\). This defines an algebra (iso)morphism; in particular, multiplication in the incidence algebra goes to matrix multiplication.

EXAMPLES:

sage: P = posets.BooleanLattice(2)
sage: I = P.incidence_algebra(QQ)
sage: I.moebius().to_matrix()
[ 1 -1 -1  1]
[ 0  1  0 -1]
[ 0  0  1 -1]
[ 0  0  0  1]
sage: I.zeta().to_matrix()
[1 1 1 1]
[0 1 0 1]
[0 0 1 1]
[0 0 0 1]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(2))
>>> I = P.incidence_algebra(QQ)
>>> I.moebius().to_matrix()
[ 1 -1 -1  1]
[ 0  1  0 -1]
[ 0  0  1 -1]
[ 0  0  0  1]
>>> I.zeta().to_matrix()
[1 1 1 1]
[0 1 0 1]
[0 0 1 1]
[0 0 0 1]
P = posets.BooleanLattice(2)
I = P.incidence_algebra(QQ)
I.moebius().to_matrix()
I.zeta().to_matrix()
delta()[source]

Return the element \(1\) in self (which is the Kronecker delta \(\delta(x, y)\)).

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: I = P.incidence_algebra(QQ)
sage: I.one()
I[0, 0] + I[1, 1] + I[2, 2] + I[3, 3] + I[4, 4] + I[5, 5]
 + I[6, 6] + I[7, 7] + I[8, 8] + I[9, 9] + I[10, 10]
 + I[11, 11] + I[12, 12] + I[13, 13] + I[14, 14] + I[15, 15]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> I = P.incidence_algebra(QQ)
>>> I.one()
I[0, 0] + I[1, 1] + I[2, 2] + I[3, 3] + I[4, 4] + I[5, 5]
 + I[6, 6] + I[7, 7] + I[8, 8] + I[9, 9] + I[10, 10]
 + I[11, 11] + I[12, 12] + I[13, 13] + I[14, 14] + I[15, 15]
P = posets.BooleanLattice(4)
I = P.incidence_algebra(QQ)
I.one()
moebius()[source]

Return the Möbius function of self.

EXAMPLES:

sage: P = posets.BooleanLattice(2)
sage: I = P.incidence_algebra(QQ)
sage: I.moebius()
I[0, 0] - I[0, 1] - I[0, 2] + I[0, 3] + I[1, 1]
 - I[1, 3] + I[2, 2] - I[2, 3] + I[3, 3]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(2))
>>> I = P.incidence_algebra(QQ)
>>> I.moebius()
I[0, 0] - I[0, 1] - I[0, 2] + I[0, 3] + I[1, 1]
 - I[1, 3] + I[2, 2] - I[2, 3] + I[3, 3]
P = posets.BooleanLattice(2)
I = P.incidence_algebra(QQ)
I.moebius()
one()[source]

Return the element \(1\) in self (which is the Kronecker delta \(\delta(x, y)\)).

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: I = P.incidence_algebra(QQ)
sage: I.one()
I[0, 0] + I[1, 1] + I[2, 2] + I[3, 3] + I[4, 4] + I[5, 5]
 + I[6, 6] + I[7, 7] + I[8, 8] + I[9, 9] + I[10, 10]
 + I[11, 11] + I[12, 12] + I[13, 13] + I[14, 14] + I[15, 15]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> I = P.incidence_algebra(QQ)
>>> I.one()
I[0, 0] + I[1, 1] + I[2, 2] + I[3, 3] + I[4, 4] + I[5, 5]
 + I[6, 6] + I[7, 7] + I[8, 8] + I[9, 9] + I[10, 10]
 + I[11, 11] + I[12, 12] + I[13, 13] + I[14, 14] + I[15, 15]
P = posets.BooleanLattice(4)
I = P.incidence_algebra(QQ)
I.one()
poset()[source]

Return the defining poset of self.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: I = P.incidence_algebra(QQ)
sage: I.poset()
Finite lattice containing 16 elements
sage: I.poset() == P
True
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> I = P.incidence_algebra(QQ)
>>> I.poset()
Finite lattice containing 16 elements
>>> I.poset() == P
True
P = posets.BooleanLattice(4)
I = P.incidence_algebra(QQ)
I.poset()
I.poset() == P
product_on_basis(A, B)[source]

Return the product of basis elements indexed by A and B.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: I = P.incidence_algebra(QQ)
sage: I.product_on_basis((1, 3), (3, 11))
I[1, 11]
sage: I.product_on_basis((1, 3), (2, 2))
0
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> I = P.incidence_algebra(QQ)
>>> I.product_on_basis((Integer(1), Integer(3)), (Integer(3), Integer(11)))
I[1, 11]
>>> I.product_on_basis((Integer(1), Integer(3)), (Integer(2), Integer(2)))
0
P = posets.BooleanLattice(4)
I = P.incidence_algebra(QQ)
I.product_on_basis((1, 3), (3, 11))
I.product_on_basis((1, 3), (2, 2))
reduced_subalgebra(prefix='R')[source]

Return the reduced incidence subalgebra.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: I = P.incidence_algebra(QQ)
sage: I.reduced_subalgebra()
Reduced incidence algebra of Finite lattice containing 16 elements
 over Rational Field
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> I = P.incidence_algebra(QQ)
>>> I.reduced_subalgebra()
Reduced incidence algebra of Finite lattice containing 16 elements
 over Rational Field
P = posets.BooleanLattice(4)
I = P.incidence_algebra(QQ)
I.reduced_subalgebra()
some_elements()[source]

Return a list of elements of self.

EXAMPLES:

sage: P = posets.BooleanLattice(1)
sage: I = P.incidence_algebra(QQ)
sage: Ielts = I.some_elements(); Ielts # random
[2*I[0, 0] + 2*I[0, 1] + 3*I[1, 1],
 I[0, 0] - I[0, 1] + I[1, 1],
 I[0, 0] + I[0, 1] + I[1, 1]]
sage: [a in I for a in Ielts]
[True, True, True]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(1))
>>> I = P.incidence_algebra(QQ)
>>> Ielts = I.some_elements(); Ielts # random
[2*I[0, 0] + 2*I[0, 1] + 3*I[1, 1],
 I[0, 0] - I[0, 1] + I[1, 1],
 I[0, 0] + I[0, 1] + I[1, 1]]
>>> [a in I for a in Ielts]
[True, True, True]
P = posets.BooleanLattice(1)
I = P.incidence_algebra(QQ)
Ielts = I.some_elements(); Ielts # random
[a in I for a in Ielts]
zeta()[source]

Return the \(\zeta\) function in self.

The \(\zeta\) function on a poset \(P\) is given by

\[\begin{split}\zeta(x, y) = \begin{cases} 1 & x \leq y, \\ 0 & x \not\leq y. \end{cases}\end{split}\]

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: I = P.incidence_algebra(QQ)
sage: I.zeta() * I.moebius() == I.one()
True
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> I = P.incidence_algebra(QQ)
>>> I.zeta() * I.moebius() == I.one()
True
P = posets.BooleanLattice(4)
I = P.incidence_algebra(QQ)
I.zeta() * I.moebius() == I.one()
class sage.combinat.posets.incidence_algebras.ReducedIncidenceAlgebra(I, prefix='R')[source]

Bases: CombinatorialFreeModule

The reduced incidence algebra of a poset.

The reduced incidence algebra \(R_P\) is a subalgebra of the incidence algebra \(I_P\) where \(\alpha(x, y) = \alpha(x', y')\) when \([x, y]\) is isomorphic to \([x', y']\) as posets. Thus the delta, Möbius, and zeta functions are all elements of \(R_P\).

class Element[source]

Bases: IndexedFreeModuleElement

An element of a reduced incidence algebra.

is_unit()[source]

Return if self is a unit.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: x = R.an_element()
sage: x.is_unit()
True
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> x = R.an_element()
>>> x.is_unit()
True
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
x = R.an_element()
x.is_unit()
lift()[source]

Return the lift of self to the ambient space.

EXAMPLES:

sage: P = posets.BooleanLattice(2)
sage: I = P.incidence_algebra(QQ)
sage: R = I.reduced_subalgebra()
sage: x = R.an_element(); x
2*R[(0, 0)] + 2*R[(0, 1)] + 3*R[(0, 3)]
sage: x.lift()
2*I[0, 0] + 2*I[0, 1] + 2*I[0, 2] + 3*I[0, 3] + 2*I[1, 1]
 + 2*I[1, 3] + 2*I[2, 2] + 2*I[2, 3] + 2*I[3, 3]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(2))
>>> I = P.incidence_algebra(QQ)
>>> R = I.reduced_subalgebra()
>>> x = R.an_element(); x
2*R[(0, 0)] + 2*R[(0, 1)] + 3*R[(0, 3)]
>>> x.lift()
2*I[0, 0] + 2*I[0, 1] + 2*I[0, 2] + 3*I[0, 3] + 2*I[1, 1]
 + 2*I[1, 3] + 2*I[2, 2] + 2*I[2, 3] + 2*I[3, 3]
P = posets.BooleanLattice(2)
I = P.incidence_algebra(QQ)
R = I.reduced_subalgebra()
x = R.an_element(); x
x.lift()
to_matrix()[source]

Return self as a matrix.

EXAMPLES:

sage: P = posets.BooleanLattice(2)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: mu = R.moebius()
sage: mu.to_matrix()
[ 1 -1 -1  1]
[ 0  1  0 -1]
[ 0  0  1 -1]
[ 0  0  0  1]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(2))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> mu = R.moebius()
>>> mu.to_matrix()
[ 1 -1 -1  1]
[ 0  1  0 -1]
[ 0  0  1 -1]
[ 0  0  0  1]
P = posets.BooleanLattice(2)
R = P.incidence_algebra(QQ).reduced_subalgebra()
mu = R.moebius()
mu.to_matrix()
delta()[source]

Return the Kronecker delta function in self.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.delta()
R[(0, 0)]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.delta()
R[(0, 0)]
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.delta()
lift()[source]

Return the lift morphism from self to the ambient space.

EXAMPLES:

sage: P = posets.BooleanLattice(2)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.lift
Generic morphism:
  From: Reduced incidence algebra of Finite lattice containing 4 elements over Rational Field
  To:   Incidence algebra of Finite lattice containing 4 elements over Rational Field
sage: R.an_element() - R.one()
R[(0, 0)] + 2*R[(0, 1)] + 3*R[(0, 3)]
sage: R.lift(R.an_element() - R.one())
I[0, 0] + 2*I[0, 1] + 2*I[0, 2] + 3*I[0, 3] + I[1, 1]
 + 2*I[1, 3] + I[2, 2] + 2*I[2, 3] + I[3, 3]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(2))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.lift
Generic morphism:
  From: Reduced incidence algebra of Finite lattice containing 4 elements over Rational Field
  To:   Incidence algebra of Finite lattice containing 4 elements over Rational Field
>>> R.an_element() - R.one()
R[(0, 0)] + 2*R[(0, 1)] + 3*R[(0, 3)]
>>> R.lift(R.an_element() - R.one())
I[0, 0] + 2*I[0, 1] + 2*I[0, 2] + 3*I[0, 3] + I[1, 1]
 + 2*I[1, 3] + I[2, 2] + 2*I[2, 3] + I[3, 3]
P = posets.BooleanLattice(2)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.lift
R.an_element() - R.one()
R.lift(R.an_element() - R.one())
moebius()[source]

Return the Möbius function of self.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.moebius()
R[(0, 0)] - R[(0, 1)] + R[(0, 3)] - R[(0, 7)] + R[(0, 15)]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.moebius()
R[(0, 0)] - R[(0, 1)] + R[(0, 3)] - R[(0, 7)] + R[(0, 15)]
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.moebius()
one_basis()[source]

Return the index of the element \(1\) in self.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.one_basis()
(0, 0)
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.one_basis()
(0, 0)
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.one_basis()
poset()[source]

Return the defining poset of self.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.poset()
Finite lattice containing 16 elements
sage: R.poset() == P
True
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.poset()
Finite lattice containing 16 elements
>>> R.poset() == P
True
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.poset()
R.poset() == P
some_elements()[source]

Return a list of elements of self.

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.some_elements()
[2*R[(0, 0)] + 2*R[(0, 1)] + 3*R[(0, 3)],
 R[(0, 0)] - R[(0, 1)] + R[(0, 3)] - R[(0, 7)] + R[(0, 15)],
 R[(0, 0)] + R[(0, 1)] + R[(0, 3)] + R[(0, 7)] + R[(0, 15)]]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.some_elements()
[2*R[(0, 0)] + 2*R[(0, 1)] + 3*R[(0, 3)],
 R[(0, 0)] - R[(0, 1)] + R[(0, 3)] - R[(0, 7)] + R[(0, 15)],
 R[(0, 0)] + R[(0, 1)] + R[(0, 3)] + R[(0, 7)] + R[(0, 15)]]
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.some_elements()
zeta()[source]

Return the \(\zeta\) function in self.

The \(\zeta\) function on a poset \(P\) is given by

\[\begin{split}\zeta(x, y) = \begin{cases} 1 & x \leq y, \\ 0 & x \not\leq y. \end{cases}\end{split}\]

EXAMPLES:

sage: P = posets.BooleanLattice(4)
sage: R = P.incidence_algebra(QQ).reduced_subalgebra()
sage: R.zeta()
R[(0, 0)] + R[(0, 1)] + R[(0, 3)] + R[(0, 7)] + R[(0, 15)]
>>> from sage.all import *
>>> P = posets.BooleanLattice(Integer(4))
>>> R = P.incidence_algebra(QQ).reduced_subalgebra()
>>> R.zeta()
R[(0, 0)] + R[(0, 1)] + R[(0, 3)] + R[(0, 7)] + R[(0, 15)]
P = posets.BooleanLattice(4)
R = P.incidence_algebra(QQ).reduced_subalgebra()
R.zeta()