*****************************************************************************
*       www.FindStat.org - The Combinatorial Statistic Finder               *
*                                                                           *
*       Copyright (C) 2019 The FindStatCrew <info@findstat.org>             *
*                                                                           *
*    This information is distributed in the hope that it will be useful,    *
*    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                   *
*****************************************************************************

-----------------------------------------------------------------------------
Statistic identifier: St000551

-----------------------------------------------------------------------------
Collection: Lattices

-----------------------------------------------------------------------------
Description: The number of left modular elements of a lattice.

A pair $(x, y)$ of elements of a lattice $L$ is a modular pair if for every $z\geq y$ we have that $(y\vee x) \wedge z = y \vee (x \wedge z)$.  An element $x$ is left-modular if $(x, y)$ is a modular pair for every $y\in L$.

-----------------------------------------------------------------------------
References: [1]   Liu, S.-C., Sagan, B. Left-modular elements [[arXiv:math/0001055]]

-----------------------------------------------------------------------------
Code:
def is_left_modular(L, x):
    for z in L:
        for y in L.principal_order_ideal(z):
            if L.meet(L.join(x,y),z) != L.join(L.meet(x,z),y):
                return False
    return True

def statistic(L):
    return len([x for x in L if is_left_modular(L, x)])

-----------------------------------------------------------------------------
Statistic values:

([],1)                                                            => 1
([(0,1)],2)                                                       => 2
([(0,2),(2,1)],3)                                                 => 3
([(0,1),(0,2),(1,3),(2,3)],4)                                     => 4
([(0,3),(2,1),(3,2)],4)                                           => 4
([(0,1),(0,2),(0,3),(1,4),(2,4),(3,4)],5)                         => 5
([(0,2),(0,3),(1,4),(2,4),(3,1)],5)                               => 4
([(0,3),(1,4),(2,4),(3,1),(3,2)],5)                               => 5
([(0,4),(2,3),(3,1),(4,2)],5)                                     => 5
([(0,2),(0,3),(2,4),(3,4),(4,1)],5)                               => 5
([(0,1),(0,2),(0,3),(0,4),(1,5),(2,5),(3,5),(4,5)],6)             => 6
([(0,2),(0,3),(0,4),(1,5),(2,5),(3,5),(4,1)],6)                   => 4
([(0,3),(0,4),(1,5),(2,5),(3,5),(4,1),(4,2)],6)                   => 5
([(0,4),(1,5),(2,5),(3,5),(4,1),(4,2),(4,3)],6)                   => 6
([(0,4),(1,5),(2,5),(3,2),(4,1),(4,3)],6)                         => 5
([(0,4),(1,5),(2,5),(4,1),(4,2),(5,3)],6)                         => 6
([(0,2),(0,4),(1,5),(2,5),(3,1),(4,3)],6)                         => 5
([(0,3),(1,5),(2,5),(3,4),(4,1),(4,2)],6)                         => 6
([(0,1),(0,2),(0,3),(1,5),(2,4),(3,4),(4,5)],6)                   => 5
([(0,2),(0,3),(2,5),(3,5),(4,1),(5,4)],6)                         => 6
([(0,2),(0,3),(0,4),(2,5),(3,5),(4,5),(5,1)],6)                   => 6
([(0,3),(0,4),(1,5),(2,5),(3,2),(4,1)],6)                         => 2
([(0,2),(0,3),(1,5),(2,4),(3,1),(3,4),(4,5)],6)                   => 6
([(0,5),(2,4),(3,2),(4,1),(5,3)],6)                               => 6
([(0,3),(0,4),(1,5),(3,5),(4,1),(5,2)],6)                         => 5
([(0,1),(0,2),(0,3),(0,4),(0,5),(1,6),(2,6),(3,6),(4,6),(5,6)],7) => 7
([(0,2),(0,3),(0,4),(0,5),(1,6),(2,6),(3,6),(4,6),(5,1)],7)       => 4
([(0,3),(0,4),(0,5),(1,6),(2,6),(3,6),(4,6),(5,1),(5,2)],7)       => 5
([(0,4),(0,5),(1,6),(2,6),(3,6),(4,6),(5,1),(5,2),(5,3)],7)       => 6
([(0,5),(1,6),(2,6),(3,6),(4,6),(5,1),(5,2),(5,3),(5,4)],7)       => 7
([(0,5),(1,6),(2,6),(3,6),(4,3),(5,1),(5,2),(5,4)],7)             => 5
([(0,4),(1,6),(2,5),(3,5),(4,1),(4,2),(4,3),(5,6)],7)             => 6
([(0,5),(1,6),(2,6),(3,6),(5,1),(5,2),(5,3),(6,4)],7)             => 7
([(0,3),(0,5),(1,6),(2,6),(3,6),(4,2),(5,1),(5,4)],7)             => 5
([(0,5),(1,6),(2,6),(3,6),(4,2),(4,3),(5,1),(5,4)],7)             => 6
([(0,3),(0,4),(1,5),(2,5),(3,6),(4,1),(4,2),(5,6)],7)             => 6
([(0,5),(2,6),(3,6),(4,1),(5,2),(5,3),(6,4)],7)                   => 7
([(0,5),(1,6),(2,6),(3,2),(4,1),(5,3),(5,4)],7)                   => 3
([(0,4),(1,6),(2,5),(3,1),(3,5),(4,2),(4,3),(5,6)],7)             => 7
([(0,2),(0,3),(0,5),(1,6),(2,6),(3,6),(4,1),(5,4)],7)             => 5
([(0,3),(0,4),(1,6),(2,6),(3,6),(4,5),(5,1),(5,2)],7)             => 6
([(0,4),(1,6),(2,6),(3,6),(4,5),(5,1),(5,2),(5,3)],7)             => 7
([(0,1),(0,2),(0,3),(0,4),(1,6),(2,6),(3,5),(4,5),(5,6)],7)       => 5
([(0,2),(0,3),(0,4),(1,5),(2,6),(3,6),(4,5),(6,1)],7)             => 6
([(0,3),(0,4),(1,5),(2,5),(3,6),(4,6),(6,1),(6,2)],7)             => 7
([(0,1),(0,2),(0,3),(0,4),(1,6),(2,6),(3,6),(4,5),(6,5)],7)       => 6
([(0,2),(0,3),(0,4),(2,6),(3,6),(4,6),(5,1),(6,5)],7)             => 7
([(0,2),(0,3),(0,4),(0,5),(2,6),(3,6),(4,6),(5,6),(6,1)],7)       => 7
([(0,2),(0,3),(0,4),(1,6),(2,5),(3,5),(4,1),(5,6)],7)             => 2
([(0,1),(0,2),(0,3),(1,5),(2,4),(3,4),(3,5),(4,6),(5,6)],7)       => 5
([(0,2),(0,3),(2,6),(3,6),(4,1),(5,4),(6,5)],7)                   => 7
([(0,2),(0,3),(0,4),(2,6),(3,5),(4,5),(5,6),(6,1)],7)             => 6
([(0,2),(0,3),(0,4),(1,5),(2,6),(3,6),(4,1),(4,6),(6,5)],7)       => 7
([(0,3),(0,4),(0,5),(1,6),(3,6),(4,6),(5,1),(6,2)],7)             => 5
([(0,3),(0,4),(0,5),(1,6),(2,6),(3,6),(4,2),(5,1)],7)             => 2
([(0,2),(0,3),(0,4),(1,6),(2,6),(3,5),(4,1),(4,5),(5,6)],7)       => 6
([(0,2),(0,4),(1,6),(2,5),(3,1),(4,3),(4,5),(5,6)],7)             => 5
([(0,3),(0,4),(2,6),(3,5),(4,2),(4,5),(5,6),(6,1)],7)             => 7
([(0,3),(0,4),(1,5),(2,5),(3,6),(4,2),(4,6),(6,1)],7)             => 6
([(0,4),(0,5),(1,6),(2,6),(3,6),(4,3),(5,1),(5,2)],7)             => 2
([(0,3),(0,4),(1,6),(2,6),(3,5),(4,1),(4,2),(4,5),(5,6)],7)       => 7
([(0,5),(1,6),(2,6),(3,4),(4,2),(5,1),(5,3)],7)                   => 6
([(0,3),(0,4),(1,6),(2,5),(3,5),(4,1),(4,2),(5,6)],7)             => 5
([(0,5),(1,6),(2,6),(4,2),(5,1),(5,4),(6,3)],7)                   => 6
([(0,4),(0,5),(1,6),(2,6),(4,6),(5,1),(5,2),(6,3)],7)             => 6
([(0,3),(0,4),(1,6),(2,6),(3,2),(3,5),(4,1),(4,5),(5,6)],7)       => 5
([(0,3),(0,4),(1,6),(2,5),(3,2),(4,1),(4,5),(5,6)],7)             => 5
([(0,2),(0,5),(1,6),(2,6),(3,4),(4,1),(5,3)],7)                   => 6
([(0,4),(1,6),(2,6),(3,5),(4,3),(5,1),(5,2)],7)                   => 7
([(0,2),(0,3),(0,4),(1,5),(2,6),(3,5),(4,1),(5,6)],7)             => 5
([(0,3),(0,5),(2,6),(3,6),(4,1),(5,2),(6,4)],7)                   => 6
([(0,4),(0,5),(1,6),(2,6),(3,2),(4,3),(5,1)],7)                   => 2
([(0,4),(1,6),(2,6),(3,2),(4,5),(5,1),(5,3)],7)                   => 6
([(0,2),(0,4),(1,6),(2,5),(3,1),(3,5),(4,3),(5,6)],7)             => 6
([(0,6),(2,3),(3,5),(4,2),(5,1),(6,4)],7)                         => 7
([(0,4),(0,5),(1,6),(2,6),(4,2),(5,1),(6,3)],7)                   => 3
([(0,3),(0,5),(1,6),(3,6),(4,1),(5,4),(6,2)],7)                   => 6
([(0,4),(1,6),(2,6),(4,5),(5,1),(5,2),(6,3)],7)                   => 7

-----------------------------------------------------------------------------
Created: Jul 19, 2016 at 23:49 by Martin Rubey

-----------------------------------------------------------------------------
Last Updated: Jul 21, 2016 at 10:49 by Martin Rubey