Changes between Version 10 and Version 11 of Ticket #31725


Ignore:
Timestamp:
Apr 25, 2021, 6:16:54 AM (17 months ago)
Author:
Yuan Zhou
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31725 – Description

    v10 v11  
    77Similar for `FinitePoset.join(x, y)`.
    88
    9 
    109Currently, `FinitePoset._hasse_diagram` has `@lazy_attribute _meet` (resp. `_join`) and method `meet_matrix` (resp. `join_matrix`). However, they don't compute the matrix but raise an Error if the poset is not a meet/join-semilattice.
    1110
    12 We propose to change `HasseDiagram._meet` (resp. `_join`), so that it is a dictionary, indexed by `(x,y)`, with value = the meet of `x` and `y` (not necessarily unique, so consider as a list, and `[]` if not exist). `HasseDiagram._meet` does not raise an Error when the poset is not a meet-semilattice. This check is now deferred to `HasseDiagram.meet_matrix()` (resp. `join_matrix`). Then, we make the method `FinitePoset.meet(x, y)` (resp. `join(x, y)`) by applying the `_element_to_vertex` and `_vertex_to_element` conversions on `poset._hasse_diagram._meet[x, y]`.
     11{{{
     12sage: from sage.combinat.posets.hasse_diagram import HasseDiagram                     
     13sage: h = HasseDiagram({0:[2], 1:[2,3], 2:[4], 3:[4], 4:[]})               
     14sage: h._meet   
     15Traceback (most recent call last)
     16...
     17ValueError: not a meet-semilattice: no bottom element
     18}}}
     19
     20
     21We propose to change `HasseDiagram._meet` (resp. `_join`) and `HasseDiagram.meet_matrix()` (resp. `join_matrix`), so that the `(x,y)`-entry of the matrix is `-1` if the meet of `x` and `y` doesn't exist, instead of raising an Error.  Defer the checks to where it needs.
     22Then, we make the method `FinitePoset.meet(x, y)` (resp. `join(x, y)`) by applying the `_element_to_vertex` and `_vertex_to_element` conversions on `poset._hasse_diagram._meet`,
     23{{{
     24h._meet[2,3]
     251
     26}}}
    1327
    1428In addition, `FinitePoset` has the method `common_upper_covers`. We propose to implement the method `common_lower_covers` as well, for symmetry and completeness.