CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual use to large groups and classes! Also, H100 GPUs starting at $2/hour.

| Download
Views: 8
Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2204
%md # New Posets from Old and Lattices ## Math 737 - Lab 2

New Posets from Old and Lattices

Math 737 - Lab 2

We can use Sage to construct new posets from old

Copy your code for our examples posets P,Q,R,S,T,N from Lab 1 into the block below.

%md ## Exercise 1: (If you did not complete this in the prior lab) Using our example posets P,Q,R,S,T,N, construct new posets as examples of the disjoint sum, ordinal sum, and direct (cartesian) product. Plot the new posets you create.

Exercise 1: (If you did not complete this in the prior lab) Using our example posets P,Q,R,S,T,N, construct new posets as examples of the disjoint sum, ordinal sum, and direct (cartesian) product. Plot the new posets you create.

P = posets.BooleanLattice(3) P.plot() f = P.rank_function() rk = P.rank() list_of_ranks = [f(i) for i in P] list_of_ranks R.<x> = PolynomialRing(QQ) rgf = 0 for elem in list_of_ranks: rgf += x^elem rgf
[0, 1, 1, 2, 1, 2, 2, 3] x^3 + 3*x^2 + 3*x + 1

Sage includes many common combinatorial objects. Let's use Sage to make natural posets on combinatorial objects.

Until now, we have defined posets by inputting elements and covering relations. Now let's define a poset by specifying a set of combinatorial objects and the partial order as a function which returns 'True' if x < y and 'False' otherwise.

Exercise 2: Evaluate the blocks and follow the directions below to define the poset on Dyck paths for n=3,4,5n=3,4,5 with partial order of containment.

D = DyckWords(3) D
Dyck words with 3 opening parentheses and 3 closing parentheses
for d in D: print(d) d.plot() d.to_partition() print("------------------------------------------------------------------------------------------")
()()()
[2, 1] ------------------------------------------------------------------------------------------ ()(())
[1, 1] ------------------------------------------------------------------------------------------ (())()
[2] ------------------------------------------------------------------------------------------ (()())
[1] ------------------------------------------------------------------------------------------ ((()))
[] ------------------------------------------------------------------------------------------

Below we define a function for the partial order by diagram containment.

Note how functions are structured in Python.

A function starts with 'def' and then has the name of the function followed by the inputs inside ( ) and a colon : at the end of the first line.

Then the next lines are indented and contain commands for the function to do. The last line includes 'return' to indicate what the function returns.

def dyck_path_containment(x,y): xpartition = x.to_partition() ypartition = y.to_partition() return xpartition.contains(ypartition)

Evaluate the block below to see the Dyck path poset for n=3.

dyck_path_poset = Poset((DyckWords(3),dyck_path_containment)) dyck_path_poset.plot()

Copy the above commands to plot the Dyck path posets for n=4 and n=5. Give each poset a new name.

Exercise 3: Evaluate the blocks and follow the directions below to explore lattice properties of the Dyck path poset.

We can ask Sage if the Dyck path poset is a lattice

dyck_path_poset.is_lattice()
True

Sage has a different class for lattices. We can change our poset to that class and then ask whether it is distributive.

#type something dyck_path_lattice = LatticePoset(dyck_path_poset)

Put your cursor in the block below and press tab to find a function to help you tell if this lattice is distributive. Use this function.

dyck_path_lattice.is

Now use the command 'join_irreducibles_poset' on dyck_path_lattice. Plot the resulting poset.

Do the above sequence of commands for n=4n=4 and n=5n=5 to plot the posets of join irreducibles in those cases. What do you conclude?

Exercise 4: Explore functions on Permutations (by typing . and tab after the function in the block below) to find and plot the strong and weak Bruhat order for n=3,4,5n=3,4,5. Then check whether they are lattices, and if so, whether they are distributive.

Hint: these posets are built-in, so you do not need to define the partial order function yourself.

Permutations(3) ︠22380931-cd3a-40c7-a075-dbadf4f3ee1a︠ ︠86a6f438-e22a-47b9-a955-66fe54864075︠ ︠a28147ca-27ab-4e2a-b8cb-55b0b7b15586︠