Physlib.Mathematics.DataStructures.FourTree.UniqueMap
13 declarations
Mapping over a
#uniqueMap4Given a function , the function `uniqueMap4` maps a value of type . Specifically, for a leaf containing an element , denoted as , the function returns a new leaf containing the transformed element, .
Mapping over a excluding original values
#uniqueMap4Given a function , the function `uniqueMap4` acts on a `Twig` , which consists of a value and a multiset of leaves containing values . The function returns a new `Twig` , where the new multiset of leaves is constructed by applying to each and retaining the result only if it is not already present in the original set of values . Formally, if , then .
Mapping over a `Branch` excluding original leaf values
#uniqueMap4Given a function , the function `uniqueMap4` transforms a branch , where and is a multiset of twigs of type `Twig α3 α4`. The result is a new branch , where each is obtained by applying the `Twig.uniqueMap4` function with to the corresponding twig . Specifically, for each twig, the function maps over its leaves and retains only those transformed values that were not originally present in that twig's leaf multiset.
Mapping over a `Trunk` excluding original leaf values
#uniqueMap4Given a function , the function `uniqueMap4` transforms a trunk , where is a root value and is a multiset of branches. The resulting trunk is defined as . This operation maps over all the leaf values within the hierarchical structure of the trunk, while retaining only those transformed values that were not already present in the original leaf multiset of their respective twigs.
Mapping over a `FourTree` excluding original leaf values
#uniqueMap4Given a function , the function `uniqueMap4` transforms a `FourTree` (a multiset of trunks) by applying to the leaf values at the bottom of the tree's hierarchy. The transformation is applied recursively through the `Trunk`, `Branch`, and `Twig` levels. For each leaf in the original tree, the transformed value is included in the resulting tree only if it was not already present in the multiset of leaves belonging to the original twig from which the leaf was derived.
Transformed elements of belong to or
#map_mem_uniqueMap4Let be a `FourTree` over types , and . For any quadruple such that , and for any function , the transformed quadruple is either a member of the transformed tree or it is a member of the original tree .
Let be a `FourTree` over types , and . If a quadruple is a member of the transformed tree (the tree obtained by applying to the leaf values while filtering out transformed values that were already present in the original structure), then there exists an original quadruple such that .
Mapping over the data value of a `Twig`
#uniqueMap3Given a function , the function `uniqueMap3` transforms a `Twig` , which consists of a value and a multiset of leaves. The transformation results in a new `Twig` where the function is applied to the value while the leaves remain unchanged, represented as .
Mapping over a Branch while filtering existing elements
#uniqueMap3Given a function and a branch consisting of a value and a multiset of twigs , the function `uniqueMap3` transforms the branch by mapping the data within each twig to . It filters the multiset of leaves associated with each twig such that a leaf is retained in the new structure only if the tuple is not already a member of the original branch .
Mapping over a Trunk while filtering existing elements
#uniqueMap3Given a function and a trunk node , where and is a multiset of branches of type `Branch α2 α3 α4`, the function `uniqueMap3` transforms the trunk by applying the branch-level transformation `uniqueMap3` to each branch in using . Specifically, it preserves the trunk value and maps each branch to a new branch where the underlying data in the twigs (of type ) is transformed by , while any resulting leaf nodes (of type ) that were already present in the original branch are removed.
Mapping over a `FourTree` while filtering existing leaves
#uniqueMap3Given a function , this function transforms a `FourTree` by applying to the values of type stored within its twigs. The operation maps the trunk-level transformation `uniqueMap3` over the multiset of trunks that constitute the root of . This transformation updates the twig values and filters the leaf nodes of type such that a path is retained in the new structure only if it was not already a member of the original branch in .
Let be a `FourTree` over types , representing a hierarchical collection of quadruples. If a quadruple is a member of , then for any function , the transformed quadruple is either a member of the tree (the tree resulting from applying to the third component and filtering duplicates) or was already a member of the original tree .
implies existence of a preimage in
#exists_of_mem_uniqueMap3Let be a `FourTree` defined over types , and , and let be a function. If a quadruple is a member of the tree (the tree resulting from applying to the components and filtering existing entries), then there exists a quadruple in the original tree such that .
