Macaulay2 » Documentation
Packages » Posets :: dropElements
next | previous | forward | backward | up | index | toc

# dropElements -- computes the induced subposet of a poset given a list of elements to remove

- Usage:
    `Q = dropElements(P, f)`
    `Q = dropElements(P, L)`
    `Q = P - L`
- Inputs:
  - P, an instance of the type Poset,
  - L, a list, containing elements of $P$ to remove
  - f, a function, which returns true for elements to remove and false otherwise
- Outputs:
  - Q, an instance of the type Poset,

## Description

This method computes the induced subposet $Q$ of $P$ with the elements of $L$ removed from the poset.

    i1 : P = chain 5;

    i2 : dropElements(P, {3})

    o2 = Relation Matrix: | 1 1 1 1 |
                          | 0 1 1 1 |
                          | 0 0 1 1 |
                          | 0 0 0 1 |

    o2 : Poset

    i3 : P - {4, 5}

    o3 = Relation Matrix: | 1 1 1 |
                          | 0 1 1 |
                          | 0 0 1 |

    o3 : Poset

Alternatively, this method computes the induced subposet $Q$ of $P$ with the elements removed which return true when $f$ is applied.

    i4 : P = divisorPoset (2*3*5*7);

    i5 : Q = dropElements(P, e -> e % 3 == 0)

    o5 = Q

    o5 : Poset

    i6 : Q == divisorPoset(2*5*7)

    o6 = true

## See also

- subposet -- computes the induced subposet of a poset given a list of elements

## Ways to use dropElements:

- `dropElements(Poset,Function)`
- `dropElements(Poset,List)`

## For the programmer

The object dropElements is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Posets.m2:3165:0.