Sunday, August 29, 2021

Multiset representations of partial orders

Every partial order can be embedded in a boolean algebra, by representing each element of the poset as sets. A natural generalisation of this is to represent each element of the poset as a multiset. In order to do this, we need to determine when an element is a multiple of another. This occurs when it has at most one irreducible predecessor. This is implemented below.
(defn irreducible-representation
  [family elem]

  (let [predecessors (direct-subdimembers family elem)]
    (if (= (count predecessors) 1)
      (let [predecessor (first predecessors)]
        (let [dipredecessors (direct-subdimembers 
                                family 
                                predecessor)]
          (if (= (count dipredecessors) 1)
            (let [next-coll (frequencies
                             (irreducible-representation 
                               family 
                               predecessor))]
              (Multiset. {(first (keys next-coll)) 
                          (inc (first (vals next-coll)))}))
            (Multiset. {elem 1}))))
      (Multiset. {}))))

(defn clan-representations
  [family]

  (set
   (map
    (fn [i]
      (let [coll (subdimembers family i)]
        (apply
         join
         (map
          (fn [i]
            (irreducible-representation family i))
          coll))))
    (apply union family))))

No comments:

Post a Comment