The (Unadulterated) Mathematics of Incidence: Attribute Logic
As promised in the previous MOI post on Incidence Algebra, I’m going to switch back to the concept analysis view of things before continuing with other perspectives. This post deals with attribute logics, which will look familiar for those who know about association rules in data mining.
If you read Ganter and Wille, the motivation for attribute logics is to provide a way to build a concept lattice when we don’t know the formal context: first forming the implications of the logic, and then using those to construct the concept lattice. However, even if we start from a formal context, an attribute logic is interesting because it describes relationships among attributes in a different way than the corresponding concept lattice: as implications between sets of attributes. The subject also naturally motivates the idea of a basis — in this case, a subset of the attribute logic sufficient to construct the whole logic — because, as we’ll see, we will want to be lazy.
Once again, I’m adhering to the informal tag-line of Most of the Math, with none of the motivation. Unfortunately, this topic has no general resources other than Ganter and Wille, but it does overlap heavily with the topic of association rules in data mining, for which you should be able to find plenty of resources. If you haven’t already gone through the first post on Formal Concept Analysis, start there. And, in case you haven’t gotten the idea yet, don’t expect any proofs.
Implications of attribute logic
Assume a formal context that consists of a set of objects, a set of attributes, and the incidence relation . As we have seen before, the relation gives us the functions for , and for .
An implication in the context is for .
Of course, not all of these possible implications represent relationships among attributes in the context. If we think of the sets and as conjunctions of propositions, then we want the implication to represent a statement of the form “if A is true for an object , then B is true for the object ”, which would hold in context if .
With some hand-waving, we can see that we can guarantee this conceptual relationship when . So, we say that holds whenever . When the context needs to be clear, I’ll write this using the notation .
To understand this definition, remember that is the closure of relative to the incidence relation . It is also the extent of the concept .
The collection of implications that hold in is the attribute logic of . Since we are just interested in the implications in this logic, I’ll just drop the qualifier on implications for the rest of this post.
Let’s look at the implications that hold for the context with the incidence relation
x | x | ||||
x | x | x | x | ||
x | x | x | x | x | |
x | x | x |
This is the context from the first post except with object names changed to protect the innocent from notational conflict.
We can construct the implications of the attribute logic by selecting a set , and then writing down the implications for subsets of . For instance, let be for which . Writing a set as , this pair of sets gives us the implications
Next, consider the set as . Here , and so the implications are
We could keep going this way: selecting a set of attributes, then constructing the implications for that set. But enumerating all the implications that hold for the context is going to take a while.
The reason? There are many sets , and implications for each set , giving a total count of
The attribute logic of the example context has 596 implications, which is enough that I don’t want to enumerate them. (Be sure to check my math.)
However, it turns out that many of these implications are uninteresting; including some that we have already seen such as , , and . These are implications that hold regardless of the context, and that we don’t need to construct.
One way we could avoid having to build these implications is to identify rules that tell us when an implication holds. For instance, here is a rule that we can derive from the definition of an implication of the logic:
If and both hold, then holds.
This rule allows us to only consider implications where the consequence (the right hand side) is a singleton that is not part of the premise. Clearly this allows us to build fewer implications, the count being
For our example, this is 42 implications, which is still more than I want to write down, so we either need more rules or a different approach.
Implications and the lattice
Before we get further into reducing our set of implications, let’s pause and look at how the implications relate to the attribute powerset. The lattice diagram of the powerset lattice of the attribute set is shown below. (The lattice is drawn as the dual – meaning it is drawn upside down – because of the Galois connection derived from the context.)
Remember that the Galois connection with the object sets partitions this lattice into the intents of the formal concepts of . Each blue blob in the diagram corresponds to one of these partitions. Each partition is an equivalence class of sets . And, for each class , is the largest element, shown as the bottom element of each blob in the diagram.
The definition of tells us that the implications for are determined by the subsets of , which is just the powerset . For our example, when , , the powerset corresponds to the larger (yellow) blob of the following sub-diagram of the full lattice.
The implications listed above for correspond to the arrows shown here
As our first computation above suggests, the fact that the implications involve all elements of the powerset is why there are so many of them. Restricting the implications to those with singleton consequences halves the number of implications for this particular set, but obviously reduces the number even further for each with larger . But even this set of 42 implications makes for a messy diagram as shown here.
Closed sets and bases
What we had done to get to this smaller set is to find a rule that allowed us to construct implications from a smaller set, and then decide what the elements of that smaller set were. We want to do this again, but in a way that gives us even fewer implications.
I really want is to find a small subset of implications that tell me the remaining implications of through some simple constructions.
A set of implications is closed whenever
- is an element
- if is an element, then is an element
- if is an element, and is an element, then
The closure of an arbitrary set of implications is the minimal closed set containing . The set is a basis for if there is no such that . There are several ways to define a basis for , so let’s consider a basis called the stem-basis.
Let , then is an pseudo-intent if and only if and for all pseudo-intents . (Depending on the context, the empty set is a pseudo-intent if .) The stem-basis is the set of implications for pseudo-intent . For our example, this set is
as shown here
When you check my answer for this example, be sure to include the empty set as a pseudo-intent since .
Implications and lattice intervals
Remember that is the concept whose extent is , the closure of under . Also, means that , which, since , translates directly to .
On the other hand, say that holds. Then and so , yielding the interval .
So, if I have the lattice , then I can build the attribute logic , and vice versa. This means that we can switch between these representations as needed without losing any information. (You will need to peek at section 2.3 of Ganter and Wille if you are looking for more details.)
Epilogue
The equivalence of the attribute logic and the concept lattice is a critical point in this post. However, from an algebraic perspective, the important concept here is a basis, and, going further than the discussion here, the closed set generated by a set of implications. These concepts are completely under developed here, and so, as long as I don’t take another two years between posts, perhaps we’ll get there.