@@ -916,7 +916,7 @@ def neutral_elements(self):
916
916
t = sorted (self ._hasse_diagram .neutral_elements ())
917
917
return [self ._vertex_to_element (v ) for v in t ]
918
918
919
- def is_join_distributive (self , certificate = False ):
919
+ def is_join_distributive (self , certificate = False ) -> bool | tuple :
920
920
"""
921
921
Return ``True`` if the lattice is join-distributive and ``False``
922
922
otherwise.
@@ -1005,7 +1005,7 @@ def is_join_distributive(self, certificate=False):
1005
1005
diamond = next (self ._hasse_diagram .subgraph_search_iterator (M3 , return_graphs = False ))
1006
1006
return (False , self [diamond [0 ]])
1007
1007
1008
- def is_meet_distributive (self , certificate = False ):
1008
+ def is_meet_distributive (self , certificate = False ) -> bool | tuple :
1009
1009
"""
1010
1010
Return ``True`` if the lattice is meet-distributive and ``False``
1011
1011
otherwise.
@@ -1093,7 +1093,7 @@ def is_meet_distributive(self, certificate=False):
1093
1093
diamond = next (self ._hasse_diagram .subgraph_search_iterator (M3 , return_graphs = False ))
1094
1094
return (False , self [diamond [4 ]])
1095
1095
1096
- def is_stone (self , certificate = False ):
1096
+ def is_stone (self , certificate = False ) -> bool | tuple :
1097
1097
r"""
1098
1098
Return ``True`` if the lattice is a Stone lattice, and ``False``
1099
1099
otherwise.
@@ -1188,7 +1188,7 @@ def is_stone(self, certificate=False):
1188
1188
1189
1189
return ok
1190
1190
1191
- def is_distributive (self , certificate = False ):
1191
+ def is_distributive (self , certificate = False ) -> bool | tuple :
1192
1192
r"""
1193
1193
Return ``True`` if the lattice is distributive, and ``False``
1194
1194
otherwise.
@@ -1228,7 +1228,7 @@ def is_distributive(self, certificate=False):
1228
1228
:meth:`is_semidistributive`, :meth:`is_join_distributive`,
1229
1229
:meth:`is_meet_distributive`, :meth:`is_subdirectly_reducible`,
1230
1230
:meth:`is_trim`,
1231
- :meth:`is_constructible_by_doublings` (by interval doubling) ,
1231
+ :meth:`is_congruence_uniform` ,
1232
1232
:meth:`is_extremal`
1233
1233
1234
1234
- Stronger properties: :meth:`is_stone`
@@ -1262,7 +1262,7 @@ def is_distributive(self, certificate=False):
1262
1262
self ._vertex_to_element (diamond [2 ]),
1263
1263
self ._vertex_to_element (diamond [3 ])))
1264
1264
1265
- def is_semidistributive (self ):
1265
+ def is_semidistributive (self ) -> bool :
1266
1266
"""
1267
1267
Return ``True`` if the lattice is both join- and meet-semidistributive,
1268
1268
and ``False`` otherwise.
@@ -1308,7 +1308,7 @@ def is_semidistributive(self):
1308
1308
H .out_degree_sequence ().count (1 )) and
1309
1309
self .is_meet_semidistributive ())
1310
1310
1311
- def is_meet_semidistributive (self , certificate = False ):
1311
+ def is_meet_semidistributive (self , certificate = False ) -> bool | tuple :
1312
1312
r"""
1313
1313
Return ``True`` if the lattice is meet-semidistributive, and ``False``
1314
1314
otherwise.
@@ -1400,7 +1400,7 @@ def is_meet_semidistributive(self, certificate=False):
1400
1400
return (True , None )
1401
1401
return True
1402
1402
1403
- def is_join_semidistributive (self , certificate = False ):
1403
+ def is_join_semidistributive (self , certificate = False ) -> bool | tuple :
1404
1404
r"""
1405
1405
Return ``True`` if the lattice is join-semidistributive, and ``False``
1406
1406
otherwise.
@@ -1496,7 +1496,7 @@ def is_join_semidistributive(self, certificate=False):
1496
1496
return all (H .kappa_dual (v ) is not None
1497
1497
for v in H if H .out_degree (v ) == 1 )
1498
1498
1499
- def is_extremal (self ):
1499
+ def is_extremal (self ) -> bool :
1500
1500
"""
1501
1501
Return ``True`` if the lattice is extremal, and ``False``
1502
1502
otherwise.
@@ -1526,7 +1526,7 @@ def is_extremal(self):
1526
1526
mi = len (self .meet_irreducibles ())
1527
1527
return ji == mi == self .height () - 1
1528
1528
1529
- def is_trim (self , certificate = False ):
1529
+ def is_trim (self , certificate = False ) -> bool | tuple :
1530
1530
"""
1531
1531
Return whether a lattice is trim.
1532
1532
@@ -1575,7 +1575,7 @@ def is_trim(self, certificate=False):
1575
1575
else :
1576
1576
return (False , None ) if certificate else False
1577
1577
1578
- def is_complemented (self , certificate = False ):
1578
+ def is_complemented (self , certificate = False ) -> bool | tuple :
1579
1579
r"""
1580
1580
Return ``True`` if the lattice is complemented, and
1581
1581
``False`` otherwise.
@@ -1626,7 +1626,7 @@ def is_complemented(self, certificate=False):
1626
1626
return (True , None )
1627
1627
return (False , self ._vertex_to_element (e ))
1628
1628
1629
- def is_cosectionally_complemented (self , certificate = False ):
1629
+ def is_cosectionally_complemented (self , certificate = False ) -> bool | tuple :
1630
1630
"""
1631
1631
Return ``True`` if the lattice is cosectionally complemented, and
1632
1632
``False`` otherwise.
@@ -1702,7 +1702,7 @@ def is_cosectionally_complemented(self, certificate=False):
1702
1702
return False
1703
1703
return (True , None ) if certificate else True
1704
1704
1705
- def is_relatively_complemented (self , certificate = False ):
1705
+ def is_relatively_complemented (self , certificate = False ) -> bool | tuple :
1706
1706
"""
1707
1707
Return ``True`` if the lattice is relatively complemented, and
1708
1708
``False`` otherwise.
@@ -1815,7 +1815,7 @@ def is_relatively_complemented(self, certificate=False):
1815
1815
self ._vertex_to_element (e3 )))
1816
1816
return (True , None ) if certificate else True
1817
1817
1818
- def is_sectionally_complemented (self , certificate = False ):
1818
+ def is_sectionally_complemented (self , certificate = False ) -> bool | tuple :
1819
1819
"""
1820
1820
Return ``True`` if the lattice is sectionally complemented, and
1821
1821
``False`` otherwise.
@@ -2086,7 +2086,7 @@ def complements(self, element=None):
2086
2086
if self .meet (x , element ) == self .bottom () and
2087
2087
self .join (x , element ) == self .top ()]
2088
2088
2089
- def is_pseudocomplemented (self , certificate = False ):
2089
+ def is_pseudocomplemented (self , certificate = False ) -> bool | tuple :
2090
2090
r"""
2091
2091
Return ``True`` if the lattice is pseudocomplemented, and ``False``
2092
2092
otherwise.
@@ -2153,7 +2153,7 @@ def is_pseudocomplemented(self, certificate=False):
2153
2153
return (True , None )
2154
2154
return True
2155
2155
2156
- def is_join_pseudocomplemented (self , certificate = False ):
2156
+ def is_join_pseudocomplemented (self , certificate = False ) -> bool | tuple :
2157
2157
"""
2158
2158
Return ``True`` if the lattice is join-pseudocomplemented, and
2159
2159
``False`` otherwise.
@@ -2323,7 +2323,7 @@ def is_orthocomplemented(self, unique=False):
2323
2323
return True
2324
2324
raise AssertionError ("bug in is_orthocomplemented()" )
2325
2325
2326
- def is_atomic (self , certificate = False ):
2326
+ def is_atomic (self , certificate = False ) -> bool | tuple :
2327
2327
r"""
2328
2328
Return ``True`` if the lattice is atomic, and ``False`` otherwise.
2329
2329
@@ -2381,7 +2381,7 @@ def is_atomic(self, certificate=False):
2381
2381
return (False , self ._vertex_to_element (v ))
2382
2382
return (True , None )
2383
2383
2384
- def is_coatomic (self , certificate = False ):
2384
+ def is_coatomic (self , certificate = False ) -> bool | tuple :
2385
2385
r"""
2386
2386
Return ``True`` if the lattice is coatomic, and ``False`` otherwise.
2387
2387
@@ -2439,7 +2439,7 @@ def is_coatomic(self, certificate=False):
2439
2439
return (False , self ._vertex_to_element (v ))
2440
2440
return (True , None )
2441
2441
2442
- def is_geometric (self ):
2442
+ def is_geometric (self ) -> bool :
2443
2443
"""
2444
2444
Return ``True`` if the lattice is geometric, and ``False`` otherwise.
2445
2445
@@ -2484,7 +2484,7 @@ def is_geometric(self):
2484
2484
"""
2485
2485
return self .is_atomic () and self .is_upper_semimodular ()
2486
2486
2487
- def is_planar (self ):
2487
+ def is_planar (self ) -> bool :
2488
2488
r"""
2489
2489
Return ``True`` if the lattice is *upward* planar, and ``False``
2490
2490
otherwise.
@@ -2549,7 +2549,7 @@ def is_planar(self):
2549
2549
g .add_edge (0 , self .cardinality () - 1 )
2550
2550
return g .is_planar ()
2551
2551
2552
- def is_modular (self , L = None , certificate = False ):
2552
+ def is_modular (self , L = None , certificate = False ) -> bool | tuple :
2553
2553
r"""
2554
2554
Return ``True`` if the lattice is modular and ``False`` otherwise.
2555
2555
@@ -2654,7 +2654,7 @@ def is_modular(self, L=None, certificate=False):
2654
2654
return (True , None )
2655
2655
return True
2656
2656
2657
- def is_modular_element (self , x ):
2657
+ def is_modular_element (self , x ) -> bool :
2658
2658
r"""
2659
2659
Return ``True`` if ``x`` is a modular element and ``False`` otherwise.
2660
2660
@@ -2686,7 +2686,7 @@ def is_modular_element(self, x):
2686
2686
"""
2687
2687
return self .is_modular ([x ])
2688
2688
2689
- def is_left_modular_element (self , x ):
2689
+ def is_left_modular_element (self , x ) -> bool :
2690
2690
r"""
2691
2691
Return ``True`` if ``x`` is a left modular element
2692
2692
and ``False`` otherwise.
@@ -2719,7 +2719,7 @@ def is_left_modular_element(self, x):
2719
2719
self .join (y , self .meet (x , z ))
2720
2720
for y , z in self .cover_relations_iterator ())
2721
2721
2722
- def is_upper_semimodular (self , certificate = False ):
2722
+ def is_upper_semimodular (self , certificate = False ) -> bool | tuple :
2723
2723
r"""
2724
2724
Return ``True`` if the lattice is upper semimodular and
2725
2725
``False`` otherwise.
@@ -2779,7 +2779,7 @@ def is_upper_semimodular(self, certificate=False):
2779
2779
self ._vertex_to_element (nonmodular [1 ])))
2780
2780
return False
2781
2781
2782
- def is_lower_semimodular (self , certificate = False ):
2782
+ def is_lower_semimodular (self , certificate = False ) -> bool | tuple :
2783
2783
r"""
2784
2784
Return ``True`` if the lattice is lower semimodular and
2785
2785
``False`` otherwise.
@@ -2834,7 +2834,7 @@ def is_lower_semimodular(self, certificate=False):
2834
2834
self ._vertex_to_element (nonmodular [1 ])))
2835
2835
return False
2836
2836
2837
- def is_supersolvable (self , certificate = False ):
2837
+ def is_supersolvable (self , certificate = False ) -> bool | tuple :
2838
2838
r"""
2839
2839
Return ``True`` if the lattice is supersolvable, and
2840
2840
``False`` otherwise.
@@ -3091,7 +3091,7 @@ def vertical_decomposition(self, elements_only=False):
3091
3091
elms [i + 1 ] + 1 )]))
3092
3092
for i in range (n - 1 )]
3093
3093
3094
- def is_vertically_decomposable (self , certificate = False ):
3094
+ def is_vertically_decomposable (self , certificate = False ) -> bool | tuple :
3095
3095
r"""
3096
3096
Return ``True`` if the lattice is vertically decomposable, and
3097
3097
``False`` otherwise.
@@ -3185,7 +3185,7 @@ def sublattice(self, elms):
3185
3185
3186
3186
return LatticePoset (self .subposet (current_set ))
3187
3187
3188
- def is_sublattice (self , other ):
3188
+ def is_sublattice (self , other ) -> bool :
3189
3189
"""
3190
3190
Return ``True`` if the lattice is a sublattice of ``other``,
3191
3191
and ``False`` otherwise.
@@ -3683,7 +3683,7 @@ def center(self):
3683
3683
comps = self .complements ()
3684
3684
return self .sublattice ([e for e in neutrals if e in comps ])
3685
3685
3686
- def is_dismantlable (self , certificate = False ):
3686
+ def is_dismantlable (self , certificate = False ) -> bool | tuple :
3687
3687
r"""
3688
3688
Return ``True`` if the lattice is dismantlable, and ``False``
3689
3689
otherwise.
@@ -3798,7 +3798,7 @@ def is_dismantlable(self, certificate=False):
3798
3798
return True
3799
3799
return (True , [self [e ] for e in cert ])
3800
3800
3801
- def is_interval_dismantlable (self , certificate = False ):
3801
+ def is_interval_dismantlable (self , certificate = False ) -> bool | tuple :
3802
3802
"""
3803
3803
Return ``True`` if the lattice is interval dismantlable, and
3804
3804
``False`` otherwise.
@@ -3911,7 +3911,7 @@ def recursive_is_interval_dismantlable(self):
3911
3911
return result if certificate else True
3912
3912
return (False , minimal_non_int_dismant (self )) if certificate else False
3913
3913
3914
- def is_sublattice_dismantlable (self ):
3914
+ def is_sublattice_dismantlable (self ) -> bool :
3915
3915
"""
3916
3916
Return ``True`` if the lattice is sublattice dismantlable, and
3917
3917
``False`` otherwise.
@@ -3984,7 +3984,7 @@ def is_sublattice_dismantlable(self):
3984
3984
3985
3985
return False
3986
3986
3987
- def is_subdirectly_reducible (self , certificate = False ):
3987
+ def is_subdirectly_reducible (self , certificate = False ) -> bool | tuple :
3988
3988
r"""
3989
3989
Return ``True`` if the lattice is subdirectly reducible.
3990
3990
@@ -4367,7 +4367,7 @@ def is_congruence_uniform(self) -> bool:
4367
4367
"""
4368
4368
return self .is_constructible_by_doublings (type = "interval" )
4369
4369
4370
- def is_isoform (self , certificate = False ):
4370
+ def is_isoform (self , certificate = False ) -> bool | tuple :
4371
4371
"""
4372
4372
Return ``True`` if the lattice is isoform and ``False`` otherwise.
4373
4373
@@ -4442,7 +4442,7 @@ def is_isoform(self, certificate=False):
4442
4442
return False
4443
4443
return ok
4444
4444
4445
- def is_uniform (self , certificate = False ):
4445
+ def is_uniform (self , certificate = False ) -> bool | tuple :
4446
4446
"""
4447
4447
Return ``True`` if the lattice is uniform and ``False`` otherwise.
4448
4448
@@ -4522,7 +4522,7 @@ def is_uniform(self, certificate=False):
4522
4522
return False
4523
4523
return ok
4524
4524
4525
- def is_regular (self , certificate = False ):
4525
+ def is_regular (self , certificate = False ) -> bool | tuple :
4526
4526
"""
4527
4527
Return ``True`` if the lattice is regular and ``False`` otherwise.
4528
4528
@@ -4590,7 +4590,7 @@ def is_regular(self, certificate=False):
4590
4590
return False
4591
4591
return ok
4592
4592
4593
- def is_simple (self , certificate = False ):
4593
+ def is_simple (self , certificate = False ) -> bool | tuple :
4594
4594
"""
4595
4595
Return ``True`` if the lattice is simple and ``False`` otherwise.
4596
4596
0 commit comments