|
| 1 | +#+property: header-args :wrap src text |
| 2 | +#+property: header-args:text :eval never |
| 3 | + |
| 4 | +* Direct Product Decompositions |
| 5 | + |
| 6 | +Based on the ~Libkin Decomposition~ formalized by Leonid Libkin, a variety of approaches for decomposing concept lattices were proposed, some of which are implemented in ~conexp-clj~. |
| 7 | + |
| 8 | +For a detailed description of these methods, consult [[https://doi.org/10.17170/kobra-2025021510916][Direct Product Decompositions of Concept Lattices]]: |
| 9 | + |
| 10 | +#+begin_src clojure |
| 11 | +(use 'conexp.fca.decompositions) |
| 12 | +(def ctx (make-context #{"black" "red" "green" "blue" "yellow" "violet" "cyan" "white"}#{"R" "G" "B"} #{["red" "R"] ["green" "G"] ["blue" "B"] ["yellow" "R"] ["yellow" "G"] ["violet" "R"] ["violet" "B"] ["cyan" "G"] ["cyan" "B"] ["white" "R"] ["white" "G"] ["white" "B"]})) |
| 13 | +(def lat (concept-lattice ctx)) |
| 14 | +(draw-lattice lat) |
| 15 | +#+end_src |
| 16 | + |
| 17 | + |
| 18 | +[[./images/rgb-lattice.png]] |
| 19 | + |
| 20 | + |
| 21 | +The decomposition pairs of a lattice can be computed using the method ~libkin-decomposition-pairs~: |
| 22 | + |
| 23 | +#+begin_src clojure :exports both |
| 24 | +(def pairs (libkin-decomposition-pairs lat)) |
| 25 | +#+end_src |
| 26 | + |
| 27 | +#+RESULTS: |
| 28 | +#+begin_src text |
| 29 | +([[#{"cyan" "white"} #{"G" "B"}] |
| 30 | + [#{"white" "violet" "yellow" "red"} #{"R"}]] |
| 31 | + [[#{"white" "violet" "yellow" "red"} #{"R"}] |
| 32 | + [#{"cyan" "white"} #{"G" "B"}]] |
| 33 | + [[#{"white" "violet"} #{"R" "B"}] |
| 34 | + [#{"cyan" "white" "yellow" "green"} #{"G"}]] |
| 35 | + [[#{"blue" "cyan" "white" "violet" "yellow" "green" "red" "black"} |
| 36 | + #{}] |
| 37 | + [#{"white"} #{"G" "R" "B"}]] |
| 38 | + [[#{"white" "yellow"} #{"G" "R"}] |
| 39 | + [#{"blue" "cyan" "white" "violet"} #{"B"}]] |
| 40 | + [[#{"white"} #{"G" "R" "B"}] |
| 41 | + [#{"blue" "cyan" "white" "violet" "yellow" "green" "red" "black"} |
| 42 | + #{}]] |
| 43 | + [[#{"cyan" "white" "yellow" "green"} #{"G"}] |
| 44 | + [#{"white" "violet"} #{"R" "B"}]] |
| 45 | + [[#{"blue" "cyan" "white" "violet"} #{"B"}] |
| 46 | + [#{"white" "yellow"} #{"G" "R"}]]) |
| 47 | +#+end_src |
| 48 | + |
| 49 | +These can now be used to compute either a ~downset decomposition~, which is equivalent to the libkin decomposition, or a ~downset decomposition~. |
| 50 | +We will compute one each using the decomposition pari ~[[#{"cyan" "white"} #{"G" "B"}] [#{"white" "violet" "yellow" "red"} #{"R"}]]~: |
| 51 | + |
| 52 | +#+begin_src clojure :exports both |
| 53 | +(def downsets (downset-decomposition-lattices lat [[#{"cyan" "white"} #{"G" "B"}] [#{"white" "violet" "yellow" "red"} #{"R"}]])) |
| 54 | +(draw-lattice (first downsets)) |
| 55 | +(draw-lattice (second downsets)) |
| 56 | +#+end_src |
| 57 | + |
| 58 | +[[./images/downset-lattices.png]] |
| 59 | + |
| 60 | + |
| 61 | +#+begin_src clojure :exports both |
| 62 | +(def upsets (upset-decomposition-lattices lat [[#{"cyan" "white"} #{"G" "B"}] [#{"white" "violet" "yellow" "red"} #{"R"}]])) |
| 63 | +(draw-lattice (first upsets)) |
| 64 | +(draw-lattice (second upsets)) |
| 65 | +#+end_src |
| 66 | + |
| 67 | +[[./images/upset-lattices.png]] |
| 68 | + |
| 69 | +These pairs of lattices can now be reconstructed into their original lattices by applying the ~downset product~ or ~uzpset product~, respectively: |
| 70 | + |
| 71 | +#+begin_src clojure :exports both |
| 72 | +(downset-product (first downsets) (second downsets)) |
| 73 | +(upset-product (first upsets) (second upsets)) |
| 74 | +#+end_src |
| 75 | + |
| 76 | +Whether a lattice has non-trivial decomposition pairs may be verified using the ~decomposable?~ method. |
| 77 | + |
| 78 | + |
| 79 | +It may be useful to visualize all possible upset decomposition of a single concept lattice. |
| 80 | +To this end, the ~direct decomposition lattice~ of a concept lattice may be computed: |
| 81 | + |
| 82 | +[[./images/decomp-lattice.png]] |
| 83 | + |
| 84 | +#+begin_src clojure :exports both |
| 85 | +(def decomp-lat (direct-decomposition-lattice lat)) |
| 86 | +(draw-lattice decomp-lat) |
| 87 | +#+end_src |
| 88 | + |
| 89 | +It is unfortunately not currently possible to directly visualize the concept lattices that form the elements of the ~direct decomposition lattice~: |
| 90 | + |
| 91 | +[[./images/decomp-lattice-drawing.png]] |
| 92 | + |
| 93 | +This lattice can also be computed in terms of the contexts of its constituent lattices using the ~ctx-decomposition-lattice~ method. |
| 94 | + |
| 95 | +This ~direct decomposition lattice~ can slo be used to determine the ~upset prime factorization~ of a concept lattice; a set of indecomposable concept lattices whose upset product is the original concept lattice: |
| 96 | + |
| 97 | +#+begin_src clojure :exports both |
| 98 | +(def factors (prime-factorization lat)) |
| 99 | +(draw-lattice (first factors)) |
| 100 | +(draw-lattice (second factors)) |
| 101 | +(draw-lattice (last factors)) |
| 102 | +#+end_src |
| 103 | + |
| 104 | +[[./images/prime-factors.png]] |
| 105 | + |
| 106 | + |
| 107 | +In practice, non-trivial direct product decomposition are rare. Therefore it is useful to consider substructures of concept lattices that may be decomposable. |
| 108 | +~conexp-clj~ offers two variants of such an algorithm. |
| 109 | + |
| 110 | +The method ~maximally-decomposable-filters~ returns all inclusion-maximal principal filters of a concept lattice, that have non-trivial upset decompostions. |
| 111 | + |
| 112 | +An example using the ~bodies-of-water~ context: |
| 113 | + |
| 114 | +[[./images/max-decomp-filters.png]] |
| 115 | + |
| 116 | +Alternatively, all maximally decomposable intervals may be computed using the ~maximally-decomposable-intervals~ method: |
| 117 | + |
| 118 | +[[./images/max-decomp-intervals.png]] |
| 119 | + |
| 120 | +#+begin_src clojure :exports both |
| 121 | +(maximally-decomposable-filters lat) |
| 122 | +(maximally-decomposable-intervals lat) |
| 123 | +#+end_src |
0 commit comments