Checking whether a poset is thin with Sage
Following the definition in https://arxiv.org/pdf/1508.05446.pdf after theorem 7.7 a finite graded poset (we can assume it is connected) is called thin if each interval [x,y] of rank 2 has cardinality 4.
Is there a quick way to check with Sage whether a given graded poset is thin?
thin?
edit: Thanks to John Palmieri, who suggests to look at the code for is_slender() and modify it.
Here is the code:
def is_slender(self, certificate=False):
for x in self:
d = {}
for y in self.upper_covers(x):
for c in self.upper_covers(y):
d[c] = d.get(c, 0) + 1
for c, y in d.items():
if y >= 3:
if certificate:
return (False, (x, c))
return False
if certificate:
return (True, None)
return True
I do not fully understand it yet as Im not experienced with programming in SAGE but I will try to modify it a bit and see if Im succesful.