Changes between Version 11 and Version 13 of Ticket #31725


Ignore:
Timestamp:
Apr 25, 2021, 9:31:50 AM (17 months ago)
Author:
Yuan Zhou
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31725

    • Property Commit changed from 287ec785acd6a520beae4f2f61523cc2e40ce9fa to a155f416e944ef7bc45e6e2751d2a0aaf07e5a8d
  • Ticket #31725 – Description

    v11 v13  
    1 `FinitePoset.meet(x, y)` takes:
     1`FinitePoset.meet(x, y=None)` takes input:
    22
    3 Input: two elements `x` and `y` of the `poset` (type: `FinitePoset`).
     3-  ``x, y`` -- two elements of the poset OR
     4-  ``x`` -- a list or tuple of elements
    45
    5 Output: an element of `poset` which is the meet of `x` and `y`, if the meet exists; `None` otherwise.
     6Return the meet of given elements in the poset if the meet exists; `None` otherwise.
    67
    7 Similar for `FinitePoset.join(x, y)`.
     8Similar for `FinitePoset.join(x, y=None)`.
    89
    910Currently, `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.
     
    1920
    2021
    21 We 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.
    22 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`,
     22We propose to change `HasseDiagram._meet` (resp. `_join`), 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 `HasseDiagram.meet_matrix()` (resp. `join_matrix`). We expect to have
    2323{{{
    2424h._meet[2,3]
    25251
     26h._meet[0,1]
     27-1
     28sage: h.meet_martrix()   
     29Traceback (most recent call last)
     30...
     31ValueError: not a meet-semilattice: no bottom element
     32}}}
     33
     34Then, 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`.
     35
     36This extends the `meet` method current defined on `FiniteMeetSemilattice.meet` to non-semilattice finite poset.
     37{{{
     38sage: P = Poset({"a":["b", "c", "d"], "b":["e", "f"], "c":["f"], "d":["f", "g"]}
     39....: )                                                                         
     40sage: M = MeetSemilattice(P)                                                   
     41sage: M.meet("f","g")                                                           
     42'd'
     43sage: P2 = Poset({"b":["e", "f"], "c":["f"], "d":["f", "g"]})                   
     44sage: M2 = MeetSemilattice(P) 
     45Traceback (most recent call last)
     46...
     47ValueError: not a meet-semilattice: no bottom element
     48}}}
     49We expect to have
     50{{{
     51sage: P.meet("f","g")                                                           
     52'd'
     53sage: P2.meet("f","g")
     54'd'
    2655}}}
    2756