Introduction
In this paper, we present a framework of concepts, terminology and notation for geometric pattern matching, centred around the idea of a transformation class . After defining some preliminary ideas, notation and terminology in Section 2, we provide a formal definition of the concept of a transformation class in Section 3. We then provide detailed definitions of a number of specific transformation classes that are particularly relevant to pattern matching and pattern discovery in music, as this has been the primary application domain within which the framework has been developed. In Section 4, we provide formal definitions of the notions of match , occurrence , maximal match and maximal occurrence and prove some results relating to these concepts. In Section 5, we define and explore in detail the notion of an occurrence set and the more general idea of a heterogeneous occurrence set . Finally, in Section 6, we explore in detail the concept of transformational equivalence , including a consideration of transformation groups , along with the group-theoretic and transformational equivalence properties of selected transformation classes.
Although the framework described in this paper has been developed primarily with music in mind, it is actually quite general and could, in principle, be applied in any domain where data takes the form of multi-dimensional point sets and meaningful relationships between sets of data points can be modelled by geometric transformations. The framework presented here generalizes and develops further that proposed by Meredith [7 , 8 , 9 ] . The transformation classes discussed in this paper were applied in [10 ] to the analysis of the relationships between occurrences of the so-called “HAYDN” theme in Maurice Ravel’s Menuet sur le nom d’Haydn .
Preliminary definitions of concepts, terminology and notation
In this section we define some basic concepts, terminology and notation that will be used throughout the remainder of this paper.
Sets and ordered sets
A set, S = { s 1 , s 2 , … s n } S = \{s_1, s_2, \ldots s_n\} S = { s 1 , s 2 , … s n } , is a collection of distinct objects. If S S S is a set, then the cardinality of S S S , denoted by ∣ S ∣ |S| ∣ S ∣ , is the number of elements that it contains. Thus, if S = { s 1 , s 2 , … s n } S = \{s_1, s_2, \ldots s_n\} S = { s 1 , s 2 , … s n } , then ∣ S ∣ = n |S| = n ∣ S ∣ = n . If Ψ = { S 1 , S 2 , … S m } \Psi= \{S_1, S_2, \ldots S_m\} Ψ = { S 1 , S 2 , … S m } , where each S i S_i S i is a set, then we define the following shorthand notations: ⋃ S ∈ Ψ S = S 1 ∪ S 2 ∪ … ∪ S m \bigcup_{S \in\Psi} S = S_1 \cup S_2 \cup\ldots\cup S_m ⋃ S ∈ Ψ S = S 1 ∪ S 2 ∪ … ∪ S m and ⋂ S ∈ Ψ S = S 1 ∩ S 2 ∩ … ∩ S m \bigcap_{S \in\Psi} S = S_1 \cap S_2 \cap\ldots\cap S_m ⋂ S ∈ Ψ S = S 1 ∩ S 2 ∩ … ∩ S m . Note that we will use braces, { ⋅ } \{\cdot\} { ⋅ } , to denote sets and name them with capital italic letters. We will reserve the operators, ⊂ \subset ⊂ and ⊃ \supset ⊃ , to mean proper subset and superset , respectively. That is, A ⊂ B ⇒ A ≠ B A \subset B \Rightarrow A \ne B A ⊂ B ⇒ A = B and A ⊃ B ⇒ A ≠ B A \supset B \Rightarrow A \ne B A ⊃ B ⇒ A = B . If we want to express that a set, A A A , is either a proper subset of B B B or is equal to B B B , then we write A ⊆ B A \subseteq B A ⊆ B .
An ordered set , A = ⟨ a 1 , a 2 , … a k ⟩ \mathbf{A} = \langle a_1, a_2, \ldots a_k\rangle A = ⟨ a 1 , a 2 , … a k ⟩ , is a collection of (not necessarily distinct) objects where the order in which the objects appear in the collection matters. Examples of ordered sets include sequences, vectors, lists, arrays and tuples. Thus, the ordered sets, A = ⟨ 1 , 2 , 3 ⟩ \mathbf{A} = \langle1,2,3\rangle A = ⟨ 1 , 2 , 3 ⟩ and B = ⟨ 2 , 1 , 3 ⟩ \mathbf{B} = \langle2,1,3\rangle B = ⟨ 2 , 1 , 3 ⟩ , are distinct, whereas the sets, X = { 1 , 2 , 3 } X = \{1,2,3\} X = { 1 , 2 , 3 } and Y = { 2 , 1 , 3 } Y = \{2,1,3\} Y = { 2 , 1 , 3 } , are equal. Note that we use angle brackets, ⟨ ⋅ ⟩ \langle\cdot\rangle ⟨ ⋅ ⟩ , to denote ordered sets and name them with bold letters. When an ordered set represents a vector or a tuple, we typically name it with a lower-case letter, whereas when it represents a sequence, array or list, we typically name it with a capital letter. We denote the set of distinct elements in an ordered set, A \mathbf{A} A , by Set ( A ) \operatorname{Set}(\mathbf{A}) Set ( A ) and define it as follows: Set ( A ) = ⋃ a ∈ A { a } \operatorname{Set}(\mathbf{A}) = \bigcup_{a \in\mathbf{A}}\{a\} Set ( A ) = ⋃ a ∈ A { a } .
Given an ordered set, A = ⟨ a 1 , a 2 , … a k ⟩ \mathbf{A} = \langle a_1, a_2, \ldots a_k\rangle A = ⟨ a 1 , a 2 , … a k ⟩ , then A [ i ] \mathbf{A}[i] A [ i ] denotes the ( i + 1 ) (i+1) ( i + 1 ) th element in A \mathbf{A} A (i.e., we use zero-based indexing). For example, if B = ⟨ 2 , 1 , 3 ⟩ \mathbf{B} = \langle2,1,3\rangle B = ⟨ 2 , 1 , 3 ⟩ , then B [ 0 ] = 2 \mathbf{B}[0] = 2 B [ 0 ] = 2 , B [ 1 ] = 1 \mathbf{B}[1] = 1 B [ 1 ] = 1 and B [ 2 ] = 3 \mathbf{B}[2] = 3 B [ 2 ] = 3 . We define the length or size of A \mathbf{A} A , denoted by Len ( A ) \operatorname{Len}(\mathbf{A}) Len ( A ) , to be the number of elements in A \mathbf{A} A —for example, if A = ⟨ a 1 , a 2 , … a k ⟩ \mathbf{A} = \langle a_1, a_2, \ldots a_k\rangle A = ⟨ a 1 , a 2 , … a k ⟩ , then Len ( A ) = k \operatorname{Len}(\mathbf{A}) = k Len ( A ) = k and A [ Len ( A ) − 1 ] \mathbf{A}[\operatorname{Len}(\mathbf{A}) - 1] A [ Len ( A ) − 1 ] is the last element in A \mathbf{A} A . We define the cardinality of A \mathbf{A} A , denoted by ∣ A ∣ |\mathbf{A}| ∣ A ∣ , to be the number of distinct elements in A \mathbf{A} A . Thus ∣ A ∣ = ∣ ⋃ i = 0 Len ( A ) − 1 { A [ i ] } ∣ |\mathbf{A}| = \left|\bigcup_{i=0}^{\operatorname{Len}(\mathbf{A})-1}\{\mathbf{A}[i]\}\right| ∣ A ∣ = ⋃ i = 0 Len ( A ) − 1 { A [ i ]} . An ordered set, A \mathbf{A} A can be represented as a set of ordered pairs, ⋃ i = 0 Len ( A ) − 1 { ⟨ i , A [ i ] ⟩ } \bigcup_{i=0}^{\operatorname{Len}(\mathbf{A})-1}\{\langle i,\mathbf{A}[i]\rangle\} ⋃ i = 0 Len ( A ) − 1 {⟨ i , A [ i ]⟩} .
We define that, if A \mathbf{A} A is an ordered set, and i i i and j j j are integers such that 0 ≤ i ≤ j ≤ Len ( A ) 0 \leq i \leq j \leq\operatorname{Len}(\mathbf{A}) 0 ≤ i ≤ j ≤ Len ( A ) , then A [ i , j ] = A [ i , j − 1 ] , … , A [ j − 1 ] \mathbf{A}[i,j] = \mathbf{A}[i,j-1],\ldots,\mathbf{A}[j-1] A [ i , j ] = A [ i , j − 1 ] , … , A [ j − 1 ] . Note that Len ( A [ i , j ] ) = j − i \operatorname{Len}(\mathbf{A}[i,j]) = j-i Len ( A [ i , j ]) = j − i . For example, if B = ⟨ 5 , 6 , 7 ⟩ \mathbf{B} = \langle5,6,7\rangle B = ⟨ 5 , 6 , 7 ⟩ , then B [ 0 , 2 ] = ⟨ 5 , 6 ⟩ \mathbf{B}[0,2] = \langle5,6\rangle B [ 0 , 2 ] = ⟨ 5 , 6 ⟩ , B [ 1 , 3 ] = ⟨ 6 , 7 ⟩ \mathbf{B}[1,3] = \langle6,7\rangle B [ 1 , 3 ] = ⟨ 6 , 7 ⟩ and B [ 0 , 3 ] = B \mathbf{B}[0,3] = \mathbf{B} B [ 0 , 3 ] = B .
If A = ⟨ a 1 , a 2 , … a k ⟩ \mathbf{A} = \langle a_1,a_2,\ldots a_k\rangle A = ⟨ a 1 , a 2 , … a k ⟩ and B = ⟨ b 1 , b 2 , … b ℓ ⟩ \mathbf{B} = \langle b_1,b_2,\ldots b_\ell\rangle B = ⟨ b 1 , b 2 , … b ℓ ⟩ then the concatenation of B \mathbf{B} B onto A \mathbf{A} A is the ordered set, A ⊕ B = ⟨ a 1 , a 2 , … a k , b 1 , b 2 , … b ℓ ⟩ \mathbf{A} \oplus\mathbf{B} = \langle a_1,a_2,\ldots a_k,b_1,b_2,\ldots b_\ell\rangle A ⊕ B = ⟨ a 1 , a 2 , … a k , b 1 , b 2 , … b ℓ ⟩ . It follows that, for any ordered set, A = A [ 0 , k ] ⊕ A [ k , Len ( A ) ] \mathbf{A} = \mathbf{A}[0,k] \oplus\mathbf{A}[k,\operatorname{Len}(\mathbf{A})] A = A [ 0 , k ] ⊕ A [ k , Len ( A )] (note that A [ i , j ] \mathbf{A}[i,j] A [ i , j ] is only defined for i , j ∈ Z i,j \in\mathbb{Z} i , j ∈ Z and $0 \leq i \leq j \leq \operatorname{Len}(\mathbf{A})).
If we want to express that a sequence is the result of concatenating some sequence of other sequences together, then we can use the ⨁ \bigoplus ⨁ operator. For example, ⨁ i = 1 5 ⟨ 0 ⟩ = \bigoplus_{i=1}^{5}\langle0\rangle= ⨁ i = 1 5 ⟨ 0 ⟩ = ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ = ⟨ 0 , 0 , 0 , 0 , 0 ⟩ \langle0\rangle\oplus\langle0\rangle\oplus\langle0\rangle\oplus\langle0\rangle\oplus\langle0\rangle= \langle0,0,0,0,0\rangle ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ ⊕ ⟨ 0 ⟩ = ⟨ 0 , 0 , 0 , 0 , 0 ⟩ and ⨁ i = 1 5 ⟨ i ⟩ = ⟨ 1 , 2 , 3 , 4 , 5 ⟩ \bigoplus_{i=1}^{5}\langle i\rangle= \langle1,2,3,4,5\rangle ⨁ i = 1 5 ⟨ i ⟩ = ⟨ 1 , 2 , 3 , 4 , 5 ⟩ . Note that the argument expression of ⨁ i = j k \bigoplus_{i=j}^{k} ⨁ i = j k must be an ordered set. If Φ = ⟨ A 1 , A 2 , … A n ⟩ \Phi= \langle A_1,A_2,\ldots A_n\rangle Φ = ⟨ A 1 , A 2 , … A n ⟩ , where each A i A_i A i is an ordered set, then we define the following shorthand notation: ⨁ i = 1 n A i = ⨁ A ∈ Φ A = A 1 ⊕ A 2 ⊕ … ⊕ A n \bigoplus_{i=1}^{n} A_i = \bigoplus_{A\in\Phi} A = A_1 \oplus A_2 \oplus\ldots\oplus A_n ⨁ i = 1 n A i = ⨁ A ∈ Φ A = A 1 ⊕ A 2 ⊕ … ⊕ A n .
If S S S is a set of numbers, then we define that min ( S ) \min(S) min ( S ) and max ( S ) \max(S) max ( S ) return the minimum and maximum values in S S S , respectively.
If A and B are two ordered sets, then we define that A < B if and only if A is lexicographically less than B . That is, A < B if and only if
there exists an integer, 0 ≤ i < min ( { Len ( A ) , Len ( B ) } ) 0 \leq i < \min(\{\operatorname{Len}(\mathbf{A}),\operatorname{Len}(\mathbf{B})\}) 0 ≤ i < min ({ Len ( A ) , Len ( B )}) such that A [ i ] < B [ i ] \mathbf{A}[i] < \mathbf{B}[i] A [ i ] < B [ i ] and A [ j ] = B [ j ] \mathbf{A}[j] = \mathbf{B}[j] A [ j ] = B [ j ] for all 0 ≤ j < i 0 \leq j < i 0 ≤ j < i ; or
Len ( A ) < Len ( B ) \operatorname{Len}(\mathbf{A}) < \operatorname{Len}(\mathbf{B}) Len ( A ) < Len ( B ) and A = B [ 0 , Len ( A ) ] \mathbf{A} = \mathbf{B}[0,\operatorname{Len}(\mathbf{A})] A = B [ 0 , Len ( A )] .
Pseudocode
Algorithms are described in this paper using a form of pseudocode that we have used in several previous publications [e.g., 3–6, 11]. This pseudocode closely resembles that used by Cormen et al. [1 ] in terms of the assumptions that it makes about, for example, the machine model and data structures. In this pseudocode, data-structures are typically represented as sets and ordered sets. It is generally assumed that ordered sets will be implemented as arrays or some other array-like data structures that support constant-time random access. Sets are assumed to be implemented by data structures that allow for dictionary operations (add, delete and test for membership) to be carried out in O ( log n ) O(\log n) O ( log n ) time in the worst case (e.g., by using a binary tree) or O ( 1 ) O(1) O ( 1 ) time on average (e.g., by using a hash table), where n n n is the number of elements in the set. If a specific data structure implementation is intended, then this will be explicitly stated.
As an example, Figure 1 shows pseudocode for the well-known insertion-sort algorithm. As can be seen in this example, an algorithm is expressed as a function which begins with a header line (unnumbered) in which the name of the function is printed flush-left in CapitalizedSmallCaps. The name of the function is followed on the same line by a list of parameters enclosed in parentheses (in this example, simply A ). The numbered lines following the header line form the body of the function and describe the steps carried out by the algorithm on its parameters.
Figure 1. Pseudocode for the insertion-sort algorithm (based on Cormen et al. [1 p. 18] ).
As exemplified in Figure 1 , each line starts with a number and then the line itself is printed, indented by at least one tab stop. The looping constructs, for and while , and the conditional constructs, if and else , have the same meaning as they do in languages like C, C++, Java and C#. Block structure is indicated solely by indentation, which reduces clutter and dispenses with the need for reserved keywords such as do , begin , end and then . It also removes the need for punctuation such as semicolons to mark the ends of statements. Note that comments are written in grey italics and start with a grey, right-pointing arrowhead (e.g., ▸ A comment. ). Anything to the right of such an arrowhead on a line does not form part of the algorithm. Lines that only contain comments are not numbered.
In this pseudocode, the assignment operator is ← \leftarrow ← and the equality operator is = = = . Variables and parameters in a function should generally be considered local to the function, unless otherwise stated, and variables are not declared or typed before they
InsertionSort(A)
▶ A is an ordered set of elements in an arbitrary order.
1 for j ← 1 to Len(A) − 1
2 k ← A[j]
▶ Following inserts A[j] into the sorted sequence A[0, j]
3 i ← j − 1
4 while i ≥ 0 ∧ A[i] > k
5 A[i + 1] ← A[i]
6 i ← i − 1
7 A[i + 1] ← k
are used. Typically, as in languages like Java and C#, we assume that, when provided as the argument of a function, a primitive type value (e.g., a basic integer or floating-point value) is passed by value, while more complex structures and objects (e.g., sets and ordered sets) are passed by reference. If this distinction is significant in any specific case, then it will be noted in the text. As an example, the parameter A in Figure 1 is assumed to be passed by reference. This means that there is no need for the algorithm to return a new ordered set of values, as the elements in the ordered set passed to the algorithm in the parameter A will be in sorted order after the algorithm has completed. Other features of the pseudocode will be introduced at the points in the paper where they are first required.
As a concrete example of how such pseudocode might be implemented, Figure 2 shows a straightforward Java implementation of the insertion sort algorithm shown in Figure 1 .
Figure 2. A straightforward implementation in Java of the insertion-sort pseudocode shown in Fig. 1.
Datasets and patterns
In this paper, we suppose that we are provided with a set of points, D ⊂ R k D \subset\mathbb{R}^{k} D ⊂ R k , that we call a dataset . If D ⊂ R k D \subset\mathbb{R}^{k} D ⊂ R k , then the dimensionality of D D D is k k k , so we can call it a k k k -dimensional dataset . We denote the cardinality or size of D D D by ∣ D ∣ |D| ∣ D ∣ . Typically, in the context of an application in computational music analysis or music information retrieval, a dataset represents a piece of music, part of a piece of music, or a collection of pieces of music, with each point representing a tone, in the sense defined in footnote 2 on page 7 of [10 ] —that is, either an untied note in a score or a sequence of tied notes. Most commonly in the literature, the datasets considered are two-dimensional, with pitch represented on the y y y -axis and time represented on the x x x -axis. The eight types of two-dimensional representation introduced in [10 ] —that is, CPO, CPM, MPO, MPM, CO, CM, MO, and MM—are examples of this type of dataset. Figure 8 to Figure 15 in [10 ] are therefore examples of datasets.
Figure 8. In this example, the value of σ [ 0 ] \sigma[0] σ [ 0 ] , computed using (18), is 0 0 \frac{0}{0} 0 0 , so it is set to 1. ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ can therefore be mapped onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ by the transformation in F 2 S T F_{2ST} F 2 S T whose parameter vector is ⟨ 1 , 4 , 1 ⟩ \langle1,4,1\rangle ⟨ 1 , 4 , 1 ⟩ .
Figure 15. Two point sets.
We use the term pattern to refer to any finite point set, P ⊂ R k P \subset\mathbb{R}^{k} P ⊂ R k , usually (but not always) under consideration in the context of some specified dataset. For example, if we are interested in knowing if a point set, A A A , occurs within a dataset, then we might refer
package com.chromamorph.patternsbook;
import java.util.ArrayList;
public class InsertionSort {
public static void sort(int[] A) {
for (int j = 1; j < A.length; j++) {
int k = A[j];
int i = j - 1;
while (i >= 0 && A[i] > k) {
A[i+1] = A[i];
i = i - 1;
}
A[i + 1] = k;
}
}
public static void main(String[] args) {
int[] A = new int[args.length];
for(int i = 0; i < args.length; i++)
A[i] = Integer.parseInt(args[i]);
sort(A);
ArrayList<Integer> AList = new ArrayList<Integer>();
for(int a : A) AList.add(a);
System.out.println(AList);
}
}
to A A A as a “query pattern” or just a “pattern”, even if it does not actually occur within the dataset.
Transformations
In the context of a dataset, D ⊂ R k D \subset\mathbb{R}^{k} D ⊂ R k , we define a transformation to be a function, f : R k → R k f : \mathbb{R}^{k} \to\mathbb{R}^{k} f : R k → R k . If a transformation, f f f , maps a point p p p onto a point q q q , then we can write q = f ( p ) q = f(p) q = f ( p ) . If f f f has a unique inverse, then we denote this inverse by f − 1 f^{-1} f − 1 and f − 1 ( p ) = q f^{-1}(p) = q f − 1 ( p ) = q if and only if f ( q ) = p f(q) = p f ( q ) = p for all p , q ∈ R k p,q \in\mathbb{R}^{k} p , q ∈ R k . If we have a k k k -dimensional point set, S ⊂ R k S \subset\mathbb{R}^{k} S ⊂ R k , and a transformation, f : R k → R k f : \mathbb{R}^{k} \to\mathbb{R}^{k} f : R k → R k , then, for notational convenience, we define that f ( S ) = ⋃ p ∈ S { f ( p ) } f(S) = \bigcup_{p \in S}\{f(p)\} f ( S ) = ⋃ p ∈ S { f ( p )} . Similarly, if S S S is an ordered set of k k k -dimensional points, then we define that f ( S ) = ⨁ i = 0 Len ( S ) − 1 ⟨ f ( S [ i ] ) ⟩ f(S) = \bigoplus_{i=0}^{\operatorname{Len}(S)-1}\langle f(S[i])\rangle f ( S ) = ⨁ i = 0 Len ( S ) − 1 ⟨ f ( S [ i ])⟩ .
A transformation, f f f , is thus a binary relation, f ⊂ R k × R k f \subset\mathbb{R}^{k} \times\mathbb{R}^{k} f ⊂ R k × R k , such that for every point, p ∈ R k p \in\mathbb{R}^{k} p ∈ R k , there exists precisely one point, q ∈ R k q \in\mathbb{R}^{k} q ∈ R k , such that ( p , q ) ∈ f (p,q) \in f ( p , q ) ∈ f . If ( p , q ) ∈ f (p,q) \in f ( p , q ) ∈ f , then we can write q = f ( p ) q = f(p) q = f ( p ) and we call p p p the argument of f f f and q q q the value of f f f for p p p . We can also say that q q q is the image or image point of p p p (which is the object point ) under the transformation f f f .1 For example, if k = 2 k = 2 k = 2 and f f f is the transformation consisting of a translation by the vector, ⟨ 1 , 2 ⟩ \langle1,2\rangle ⟨ 1 , 2 ⟩ , then f = { ( p , q ) : p , q ∈ R 2 and q = p + ⟨ 1 , 2 ⟩ } f = \{(p,q) : p,q \in\mathbb{R}^{2} \text{ and } q = p + \langle1,2\rangle\} f = {( p , q ) : p , q ∈ R 2 and q = p + ⟨ 1 , 2 ⟩} , where, if p p p is a k k k -dimensional point and v v v is a k k k -dimensional vector, then p + v = ⨁ i = 0 k − 1 ⟨ p [ i ] + v [ i ] ⟩ p + v = \bigoplus_{i=0}^{k-1}\langle p[i] + v[i]\rangle p + v = ⨁ i = 0 k − 1 ⟨ p [ i ] + v [ i ]⟩ .
Note that, notwithstanding the notational shortcut just defined above, a transformation is defined to be a function that maps a point onto a point , not a point set onto a point set. This means that a mapping of a pattern that, for example, removes points from the pattern or that scales the pattern but applies different scale factors to different points in the pattern cannot be modelled (directly) within the framework presented in this paper, since it would involve applying different transformations to different points within the pattern.
Note also that the definition of transformation used in this paper is more general than the definitions given by Meredith [7 , 8 , 9 ] , where transformations were restricted to being bijections.
Modular arithmetic
We define the mod operator as follows.
Definition 1 (mod). We define that a mod μ = a − μ ⌊ a μ ⌋ a \operatorname{mod} \mu= a-\mu\left\lfloor\frac{a}{\mu}\right\rfloor a mod μ = a − μ ⌊ μ a ⌋ where a , b , μ ∈ R a,b,\mu\in\mathbb{R} a , b , μ ∈ R , and ⌊ x ⌋ \lfloor x \rfloor ⌊ x ⌋ is the largest integer less than or equal to x x x .
We also need the following lemma.
Lemma 1. If a , b , μ ∈ R a,b,\mu\in\mathbb{R} a , b , μ ∈ R , then
a mod μ = b mod μ ⟺ ( − a ) mod μ = ( − b ) mod μ . a \operatorname{mod} \mu= b \operatorname{mod} \mu\Longleftrightarrow(-a) \operatorname{mod} \mu= (-b) \operatorname{mod} \mu. a mod μ = b mod μ ⟺ ( − a ) mod μ = ( − b ) mod μ . Proof. We first prove that the left-hand side implies the right-hand side. From Def. 1, it follows that
a mod μ = b mod μ ⇒ a − μ ⌊ a μ ⌋ = b − μ ⌊ b μ ⌋ ⇒ a − b = μ ( ⌊ a μ ⌋ − ⌊ b μ ⌋ ) . (1) \begin{aligned}
a \operatorname{mod} \mu= b \operatorname{mod} \mu&\Rightarrow a-\mu\left\lfloor\frac{a}{\mu}\right\rfloor=b-\mu\left\lfloor\frac{b}{\mu}\right\rfloor\\
&\Rightarrow a-b=\mu\left(\left\lfloor\frac{a}{\mu}\right\rfloor-\left\lfloor\frac{b}{\mu}\right\rfloor\right). \tag*{(1)}
\end{aligned} a mod μ = b mod μ ⇒ a − μ ⌊ μ a ⌋ = b − μ ⌊ μ b ⌋ ⇒ a − b = μ ( ⌊ μ a ⌋ − ⌊ μ b ⌋ ) . (1) ⌊ a μ ⌋ , ⌊ b μ ⌋ ∈ Z ⇒ ( ⌊ a μ ⌋ − ⌊ b μ ⌋ ) ∈ Z . (2) \left\lfloor\frac{a}{\mu}\right\rfloor,\left\lfloor\frac{b}{\mu}\right\rfloor\in\mathbb{Z}\Rightarrow\left(\left\lfloor\frac{a}{\mu}\right\rfloor-\left\lfloor\frac{b}{\mu}\right\rfloor\right)\in\mathbb{Z}. \tag*{(2)} ⌊ μ a ⌋ , ⌊ μ b ⌋ ∈ Z ⇒ ( ⌊ μ a ⌋ − ⌊ μ b ⌋ ) ∈ Z . (2) ( 1 ) and ( 2 ) ⇒ ∃ i ∈ Z : a − b = i μ ⇒ − a − ( − b ) = − i μ . (3) (1)\ \text{and}\ (2)\Rightarrow\exists i\in\mathbb{Z}:a-b=i\mu\Rightarrow-a-(-b)=-i\mu. \tag*{(3)} ( 1 ) and ( 2 ) ⇒ ∃ i ∈ Z : a − b = i μ ⇒ − a − ( − b ) = − i μ . (3) Therefore the difference between − a -a − a and − b -b − b is an integer multiple of μ \mu μ . Therefore, ( − a ) mod μ = ( − b ) mod μ (-a) \operatorname{mod} \mu= (-b) \operatorname{mod} \mu ( − a ) mod μ = ( − b ) mod μ , which proves that
a mod μ = b mod μ ⇒ ( − a ) mod μ = ( − b ) mod μ . (4) a \operatorname{mod} \mu= b \operatorname{mod} \mu\Rightarrow(-a) \operatorname{mod} \mu= (-b) \operatorname{mod} \mu. \tag*{(4)} a mod μ = b mod μ ⇒ ( − a ) mod μ = ( − b ) mod μ . (4) From (4), it follows directly that
( − a ) mod μ = ( − b ) mod μ ⇒ ( − ( − a ) ) mod μ = ( − ( − b ) ) mod μ ⇒ a mod μ = b mod μ . (5) \begin{aligned}
(-a) \operatorname{mod} \mu= (-b) \operatorname{mod} \mu&\Rightarrow(-( -a)) \operatorname{mod} \mu= (-( -b)) \operatorname{mod} \mu\\
&\Rightarrow a \operatorname{mod} \mu= b \operatorname{mod} \mu. \tag*{(5)}
\end{aligned} ( − a ) mod μ = ( − b ) mod μ ⇒ ( − ( − a )) mod μ = ( − ( − b )) mod μ ⇒ a mod μ = b mod μ . (5) Equations (4) and (5) prove the lemma.
Transformation classes
In [10 ] , we informally presented the concept of a transformation class , as well as the specific classes, F 2 S T R F_{2\mathrm{STR}} F 2 STR , F 2 S T R m o d 7 F_{2\mathrm{STRmod7}} F 2 STRmod7 and F 2 S T R m o d 12 F_{2\mathrm{STRmod12}} F 2 STRmod12 . In this section, we begin by formally defining the concept of a transformation class. We then provide formal definitions of a number of specific transformation classes that are particularly relevant to pattern matching and pattern discovery in music.
Definition of transformation class
Figure 3 shows a geometric representation of Ravel’s Menuet sur le nom d’Haydn as a set of 2-dimensional points in which each point, ⟨ t , p ⟩ \langle t,p\rangle ⟨ t , p ⟩ , represents a tone in the score, where t t t is the onset time of the tone in tatums (in this case, quavers) and p p p is the chromatic pitch of the note (reproduced from [10 Fig. 8 on p. 11] ). We call such a geometric, point-set representation a chromatic-pitch–onset (or CPO) representation. The figure shows 31 transformed occurrences of the so-called “HAYDN” theme, B-A-D-D-G (see [10 ] for details).
Table 1 (reproduced from [10 p. 17] ) shows the inter-pattern transformation graph for the transformation class, F 2 S T R F_{2\mathrm{STR}} F 2 STR , and the patterns shown in Fig. 3. F 2 S T R F_{2\mathrm{STR}} F 2 STR is the class of 2-dimensional transformations that consist of a scaling parallel to the x x x -axis by a real-valued scale factor, f f f , denoted by S f S_f S f , followed by a translation by a vector, v v v , denoted by T v T_v T v , optionally followed by a reflection in the x x x -axis, denoted by R x R_x R x . An entry in this table in the row labelled A A A and the column labelled B B B gives the transformations within F 2 S T R F_{2\mathrm{STR}} F 2 STR that map pattern A A A onto pattern B B B .2 This inter-pattern transformation graph was generated using an algorithm that, when given two patterns, A A A and B B B , and a transformation class, F F F , can determine the transformations in F F F (if any) that map A A A onto B B B . In order to achieve this, a transformation class, F F F , must be defined in such a way that, given two patterns, A A A and B B B , both of which are of some minimum size, β ( F ) \beta(F) β ( F ) , there must exist a finite upper limit on the number of transformations in F F F that map A A A onto B B B .
Suppose we have a transformation class, F F F , and two ordered sets of points, b 1 \mathbf{b}_1 b 1 and b 2 \mathbf{b}_2 b 2 , such that ∣ b 1 ∣ = ∣ b 2 ∣ = Len ( b 1 ) = Len ( b 2 ) = β ( F ) |\mathbf{b}_1|=|\mathbf{b}_2|=\operatorname{Len}(\mathbf{b}_1)=\operatorname{Len}(\mathbf{b}_2)=\beta(F) ∣ b 1 ∣ = ∣ b 2 ∣ = Len ( b 1 ) = Len ( b 2 ) = β ( F ) , and there exists at least one transformation, f ∈ F f\in F f ∈ F , such that b 2 [ i ] = f ( b 1 [ i ] ) \mathbf{b}_2[i]=f(\mathbf{b}_1[i]) b 2 [ i ] = f ( b 1 [ i ]) for all 0 ≤ i < β ( F ) 0\le i<\beta(F) 0 ≤ i < β ( F ) . In addition, we require that all the points in b 1 \mathbf{b}_1 b 1 are distinct and that all the points in b 2 \mathbf{b}_2 b 2 are distinct. For a given F F F , β ( F ) \beta(F) β ( F ) is the minimum value for which there is a finite maximum number, τ ( F ) \tau(F) τ ( F ) , of distinct transformations, f ∈ F f\in F f ∈ F , for which this is true. For example, for the transformation class, F 2 T F_{2\mathrm{T}} F 2 T , which consists of the set of all 2-dimensional translations, β ( F 2 T ) = 1 \beta(F_{2\mathrm{T}})=1 β ( F 2 T ) = 1 and τ ( F 2 T ) = 1 \tau(F_{2\mathrm{T}})=1 τ ( F 2 T ) = 1 , since there is only one translation vector that maps any given single point onto any other single point.
On the other hand, if we define that F 2 T R F_{2\mathrm{TR}} F 2 TR is the class of 2-dimensional transformations that consist of a translation, optionally followed by a reflection in the x x x -axis, then, given two distinct points, p p p and q q q , there are at most two transformations, g g g , in F 2 T R F_{2\mathrm{TR}} F 2 TR , such that q = g ( p ) q=g(p) q = g ( p ) —one that simply translates p p p by the vector q − p q-p q − p , and a second that translates p p p by ⟨ q [ 0 ] − p [ 0 ] , − p [ 1 ] − q [ 1 ] ⟩ \langle q[0]-p[0],-p[1]-q[1]\rangle ⟨ q [ 0 ] − p [ 0 ] , − p [ 1 ] − q [ 1 ]⟩ and then reflects in the x x x -axis (see Fig. 4). Therefore, β ( F 2 T R ) = 1 \beta(F_{2\mathrm{TR}})=1 β ( F 2 TR ) = 1 and τ ( F 2 T R ) = 2 \tau(F_{2\mathrm{TR}})=2 τ ( F 2 TR ) = 2 .
Table 1. Inter-pattern transformation graph for the set of patterns in the CPO representation in Figure 3 and the transformation class, F 2 S T R F_{2STR} F 2 S T R .
However, given p , q ∈ R 2 p,q \in\mathbb{R}^{2} p , q ∈ R 2 , the number of transformations in F 2 S T R F_{2STR} F 2 S T R that map p p p onto q q q is infinite; whereas, if we define that b 1 = ⟨ p , q ⟩ \mathbf{b}_{1}=\langle p,q\rangle b 1 = ⟨ p , q ⟩ and b 2 = ⟨ p ′ , q ′ ⟩ \mathbf{b}_{2}=\langle p',q'\rangle b 2 = ⟨ p ′ , q ′ ⟩ , then there are at most two transformations that map b 1 \mathbf{b}_{1} b 1 onto b 2 \mathbf{b}_{2} b 2 , so β ( F 2 S T R ) = 2 \beta(F_{2STR})=2 β ( F 2 S T R ) = 2 and τ ( F 2 S T R ) = 2 \tau(F_{2STR})=2 τ ( F 2 S T R ) = 2 .
We now present a formal definition of the concept of a transformation class.
Definition 2 (Transformation Class). A set of functions, F ⊂ { f : ( f : R k → R k ) } F \subset\{f:(f:\mathbb{R}^{k}\rightarrow\mathbb{R}^{k})\} F ⊂ { f : ( f : R k → R k )} , is a transformation class, if and only if the following constraints are satisfied:
it is possible to define a finite integer, λ ( F ) > 0 \lambda(F)>0 λ ( F ) > 0 , such that each function, f ∈ F f\in F f ∈ F , can be uniquely identified by a transformation parameter vector, σ F ( f ) ∈ R λ ( F ) \sigma_{F}(f)\in\mathbb{R}^{\lambda(F)} σ F ( f ) ∈ R λ ( F ) ;
it is possible to define a transformation class function, ϕ F : R λ ( F ) × R k → R k \phi_{F}:\mathbb{R}^{\lambda(F)}\times\mathbb{R}^{k}\rightarrow\mathbb{R}^{k} ϕ F : R λ ( F ) × R k → R k , such that ϕ F ( σ F ( f ) , p ) = f ( p ) \phi_{F}(\sigma_{F}(f),p)=f(p) ϕ F ( σ F ( f ) , p ) = f ( p ) for all p ∈ R k p\in\mathbb{R}^{k} p ∈ R k and all f ∈ F f\in F f ∈ F ;
it is possible to define finite integers, β ( F ) > 0 \beta(F)>0 β ( F ) > 0 and τ ( F ) > 0 \tau(F)>0 τ ( F ) > 0 , along with a basis-pair transformation set function,
T F : ( ( R k ) β ( F ) ) 2 → 2 R λ ( F ) , \mathcal{T}_{F}:\left(\left(\mathbb{R}^{k}\right)^{\beta(F)}\right)^{2}\rightarrow2^{\mathbb{R}^{\lambda(F)}}, T F : ( ( R k ) β ( F ) ) 2 → 2 R λ ( F ) , such that, given ⟨ b 1 , b 2 ⟩ ∈ ( ( R k ) β ( F ) ) 2 \langle\mathbf{b}_{1},\mathbf{b}_{2}\rangle\in\left(\left(\mathbb{R}^{k}\right)^{\beta(F)}\right)^{2} ⟨ b 1 , b 2 ⟩ ∈ ( ( R k ) β ( F ) ) 2 ,
T F ( b 1 , b 2 ) = { σ : b 2 [ i ] = ϕ F ( σ , b 1 [ i ] ) for all 0 ≤ i < β ( F ) } \mathcal{T}_{F}(\mathbf{b}_{1},\mathbf{b}_{2})=\{\sigma:\mathbf{b}_{2}[i]=\phi_{F}(\sigma,\mathbf{b}_{1}[i])\text{ for all }0\leq i<\beta(F)\} T F ( b 1 , b 2 ) = { σ : b 2 [ i ] = ϕ F ( σ , b 1 [ i ]) for all 0 ≤ i < β ( F )} and β ( F ) \beta(F) β ( F ) is the minimum value for which there exists a finite integer, τ ( F ) \tau(F) τ ( F ) , such that
∣ T F ( b 1 , b 2 ) ∣ ≤ τ ( F ) for all ( b 1 , b 2 ) \lvert\mathcal{T}_{F}(\mathbf{b}_{1},\mathbf{b}_{2})\rvert\leq\tau(F)\text{ for all }(\mathbf{b}_{1},\mathbf{b}_{2}) ∣ T F ( b 1 , b 2 )∣ ≤ τ ( F ) for all ( b 1 , b 2 ) and
∣ T F ( b 1 , b 2 ) ∣ = τ ( F ) for at least one pair, ( b 1 , b 2 ) . \lvert\mathcal{T}_{F}(\mathbf{b}_{1},\mathbf{b}_{2})\rvert=\tau(F)\text{ for at least one pair, }(\mathbf{b}_{1},\mathbf{b}_{2}). ∣ T F ( b 1 , b 2 )∣ = τ ( F ) for at least one pair, ( b 1 , b 2 ) .
In this definition, λ ( F ) \lambda(F) λ ( F ) is called the parameter vector length of F F F . b 1 \mathbf{b}_1 b 1 and b 2 \mathbf{b}_2 b 2 are ordered sets of distinct points of length and cardinality β ( F ) \beta(F) β ( F ) called the object basis and the image basis , respectively. β ( F ) \beta(F) β ( F ) is therefore called the basis size of F F F . Given a pair of bases, ⟨ b 1 , b 2 ⟩ \langle\mathbf{b}_1,\mathbf{b}_2\rangle ⟨ b 1 , b 2 ⟩ , for a transformation class, F F F , τ ( F ) \tau(F) τ ( F ) is the maximum number of transformations within F F F that map b 1 \mathbf{b}_1 b 1 onto b 2 \mathbf{b}_2 b 2 . k k k is the dimensionality of the transformation class, F F F , and F F F can thus be referred to as a k k k -dimensional transformation class . For convenience, we define that,
if S S S is a set of points, then ϕ F ( σ , S ) = ⋃ p ∈ S { ϕ F ( σ , p ) } \phi_F(\sigma,S)=\bigcup_{p\in S}\{\phi_F(\sigma,p)\} ϕ F ( σ , S ) = ⋃ p ∈ S { ϕ F ( σ , p )} ; and
if A A A is an ordered set of points, then ϕ F ( σ , A ) = ⋃ i = 0 Len ( A ) − 1 ⟨ ϕ F ( σ , A [ i ] ) ⟩ \phi_F(\sigma,A)=\bigcup_{i=0}^{\operatorname{Len}(A)-1}\langle\phi_F(\sigma,A[i])\rangle ϕ F ( σ , A ) = ⋃ i = 0 Len ( A ) − 1 ⟨ ϕ F ( σ , A [ i ])⟩ .
We also define the universe of transformation parameter vectors for a transformation class, F F F , denoted by U σ ( F ) \mathcal{U}_{\sigma}(F) U σ ( F ) , as follows:
U σ ( F ) = { σ : ( ∃ f ∈ F : σ F ( f ) = σ ) } . (6) \mathcal{U}_{\sigma}(F)=\{\sigma:(\exists f\in F:\sigma_F(f)=\sigma)\}. \tag*{(6)} U σ ( F ) = { σ : ( ∃ f ∈ F : σ F ( f ) = σ )} . (6)
Examples of transformation classes
We will now define a number of transformation classes that are of particular relevance to pattern matching and pattern discovery in music.
The transformation class F 2 T F_{2\mathrm{T}} F 2 T . Let F 2 T F_{2\mathrm{T}} F 2 T be the set of 2-dimensional translations. A translation in a geometric, pitch–time representation such as those identified in [10 ] , corresponds to the musical transformation of a time-shift combined with a transposition. Each transformation, f ∈ F 2 T f\in F_{2\mathrm{T}} f ∈ F 2 T , is a function, f : R 2 → R 2 f:\mathbb{R}^{2}\to\mathbb{R}^{2} f : R 2 → R 2 , that translates a point, p ∈ R 2 p\in\mathbb{R}^{2} p ∈ R 2 , by a vector, v ∈ R 2 v\in\mathbb{R}^{2} v ∈ R 2 . That is, f ( p ) = p + v f(p)=p+v f ( p ) = p + v where p + v p+v p + v is the point that results from translating the point, p p p , by the vector, v v v . The vector v v v thus uniquely determines f f f within the transformation class, F 2 T F_{2\mathrm{T}} F 2 T . We can therefore define that λ ( F 2 T ) = 2 \lambda(F_{2\mathrm{T}})=2 λ ( F 2 T ) = 2 and σ F 2 T ( f ) = v \sigma_{F_{2\mathrm{T}}}(f)=v σ F 2 T ( f ) = v where f ( p ) = p + v f(p)=p+v f ( p ) = p + v . This satisfies the first constraint in Definition 2.
We can define the transformation class function for F 2 T F_{2\mathrm{T}} F 2 T as follows:
ϕ F 2 T ( σ F 2 T ( f ) , p ) = p + σ F 2 T ( f ) , (7) \phi_{F_{2\mathrm{T}}}\left(\sigma_{F_{2\mathrm{T}}}(f),p\right)=p+\sigma_{F_{2\mathrm{T}}}(f), \tag*{(7)} ϕ F 2 T ( σ F 2 T ( f ) , p ) = p + σ F 2 T ( f ) , (7)
where σ F 2 T ( f ) ∈ R 2 \sigma_{F_{2\mathrm{T}}}(f)\in\mathbb{R}^{2} σ F 2 T ( f ) ∈ R 2 for all f ∈ F 2 T f\in F_{2\mathrm{T}} f ∈ F 2 T . This satisfies the second constraint in Definition 2. We can define that β ( F 2 T ) = 1 \beta(F_{2\mathrm{T}})=1 β ( F 2 T ) = 1 and that τ ( F 2 T ) = 1 \tau(F_{2\mathrm{T}})=1 τ ( F 2 T ) = 1 . The basis-pair transformation set function for F 2 T F_{2\mathrm{T}} F 2 T can then be defined as follows:
T F 2 T ( b 1 , b 2 ) = { b 2 [ 0 ] − b 1 [ 0 ] } . \mathcal{T}_{F_{2\mathrm{T}}}(\mathbf{b}_1,\mathbf{b}_2)=\{\mathbf{b}_2[0]-\mathbf{b}_1[0]\}. T F 2 T ( b 1 , b 2 ) = { b 2 [ 0 ] − b 1 [ 0 ]} .
That is, b 1 \mathbf{b}_1 b 1 and b 2 \mathbf{b}_2 b 2 each contain just one 2-dimensional point, and T F 2 T ( b 1 , b 2 ) \mathcal{T}_{F_{2\mathrm{T}}}(\mathbf{b}_1,\mathbf{b}_2) T F 2 T ( b 1 , b 2 ) simply contains the vector from b 1 [ 0 ] \mathbf{b}_1[0] b 1 [ 0 ] to b 2 [ 0 ] \mathbf{b}_2[0] b 2 [ 0 ] . This satisfies the third constraint in Definition 2 and F 2 T F_{2\mathrm{T}} F 2 T is therefore a transformation class.
The transformation class F 2 T R F_{2\mathrm{TR}} F 2 TR . Let F 2 T R F_{2\mathrm{TR}} F 2 TR be the set containing those transformations that consist of a 2-dimensional translation, optionally followed by a reflection in the x x x -axis. If we use one of the geometric, pitch–time representations introduced in [10 ] , then F 2 T R F_{2\mathrm{TR}} F 2 TR contains the geometric representations that correspond to combinations of the musical transformations of transposition and inversion. Each transformation, f ∈ F 2 T R f \in F_{2\mathrm{TR}} f ∈ F 2 TR , first translates a point, p p p , by a vector, v v v to give a new point, p ′ = p + v p^{\prime}=p+v p ′ = p + v . It then may or may not reflect p ′ p^{\prime} p ′ in the x x x -axis to get the final resulting point q q q . Reflecting the point, p ′ p^{\prime} p ′ , in the x x x -axis is equivalent to multiplying its y y y -coordinate by − 1 -1 − 1 . If f f f does not reflect p ′ p^{\prime} p ′ , then we can simply multiply the y y y -coordinate by 1 1 1 .
We can define that λ ( F 2 T R ) = 3 \lambda(F_{2\mathrm{TR}})=3 λ ( F 2 TR ) = 3 , so that each transformation, f ∈ F 2 T R f \in F_{2\mathrm{TR}} f ∈ F 2 TR , is uniquely identified by a transformation parameter vector, σ F 2 T R ( f ) ∈ R 3 \sigma_{F_{2\mathrm{TR}}}(f) \in\mathbb{R}^{3} σ F 2 TR ( f ) ∈ R 3 , where ⟨ σ F 2 T R ( f ) [ 0 ] , σ F 2 T R ( f ) [ 1 ] ⟩ \langle\sigma_{F_{2\mathrm{TR}}}(f)[0],\sigma_{F_{2\mathrm{TR}}}(f)[1]\rangle ⟨ σ F 2 TR ( f ) [ 0 ] , σ F 2 TR ( f ) [ 1 ]⟩ is equal to the vector, v v v , by which f f f translates its argument point, p p p , to obtain p ′ p^{\prime} p ′ . We can then specify that σ F 2 T R ( f ) [ 2 ] ∈ { 1 , − 1 } \sigma_{F_{2\mathrm{TR}}}(f)[2] \in\{1,-1\} σ F 2 TR ( f ) [ 2 ] ∈ { 1 , − 1 } is the factor by which the y y y -coordinate of p ′ p^{\prime} p ′ is multiplied to give the final resulting point, q q q , with σ F 2 T R ( f ) [ 2 ] = − 1 \sigma_{F_{2\mathrm{TR}}}(f)[2]=-1 σ F 2 TR ( f ) [ 2 ] = − 1 if p ′ p^{\prime} p ′ is reflected in the x x x -axis and σ F 2 T R ( f ) [ 2 ] = 1 \sigma_{F_{2\mathrm{TR}}}(f)[2]=1 σ F 2 TR ( f ) [ 2 ] = 1 if it is not. This satisfies the first constraint in Definition 2.
We can define the transformation class function for F 2 T R F_{2\mathrm{TR}} F 2 TR as follows:
ϕ F 2 T R ( σ , p ) = ⟨ p [ 0 ] + σ [ 0 ] , σ [ 2 ] ( p [ 1 ] + σ [ 1 ] ) ⟩ (8) \phi_{F_{2\mathrm{TR}}}(\sigma,p)=\langle p[0]+\sigma[0],\sigma[2](p[1]+\sigma[1])\rangle \tag*{(8)} ϕ F 2 TR ( σ , p ) = ⟨ p [ 0 ] + σ [ 0 ] , σ [ 2 ] ( p [ 1 ] + σ [ 1 ])⟩ (8)
where p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 and there exists an f ∈ F 2 T R f \in F_{2\mathrm{TR}} f ∈ F 2 TR such that σ = σ F 2 T R ( f ) \sigma=\sigma_{F_{2\mathrm{TR}}}(f) σ = σ F 2 TR ( f ) . That is, ϕ F 2 T R ( σ , p ) \phi_{F_{2\mathrm{TR}}}(\sigma,p) ϕ F 2 TR ( σ , p ) is only defined when ⟨ σ [ 0 ] , σ [ 1 ] ⟩ ∈ R 2 \langle\sigma[0],\sigma[1]\rangle\in\mathbb{R}^{2} ⟨ σ [ 0 ] , σ [ 1 ]⟩ ∈ R 2 and σ [ 2 ] ∈ { 1 , − 1 } \sigma[2] \in\{1,-1\} σ [ 2 ] ∈ { 1 , − 1 } . This satisfies the second constraint in Definition 2.
For F 2 T R F_{2\mathrm{TR}} F 2 TR , we can set β ( F 2 T R ) = 1 \beta(F_{2\mathrm{TR}})=1 β ( F 2 TR ) = 1 and τ ( F 2 T R ) = 2 \tau(F_{2\mathrm{TR}})=2 τ ( F 2 TR ) = 2 and then define the basis-pair transformation set function as follows:
T F 2 T R ( ⟨ p ⟩ , ⟨ q ⟩ ) = { ⟨ q [ 0 ] − p [ 0 ] , q [ 1 ] − p [ 1 ] , 1 ⟩ , ⟨ q [ 0 ] − p [ 0 ] , − q [ 1 ] − p [ 1 ] , − 1 ⟩ } . (9) \mathcal{T}_{F_{2\mathrm{TR}}}(\langle p\rangle,\langle q\rangle)=\{\langle q[0]-p[0],q[1]-p[1],1\rangle,\langle q[0]-p[0],-q[1]-p[1],-1\rangle\}. \tag*{(9)} T F 2 TR (⟨ p ⟩ , ⟨ q ⟩) = {⟨ q [ 0 ] − p [ 0 ] , q [ 1 ] − p [ 1 ] , 1 ⟩ , ⟨ q [ 0 ] − p [ 0 ] , − q [ 1 ] − p [ 1 ] , − 1 ⟩} . (9)
It follows that F 2 T R F_{2\mathrm{TR}} F 2 TR is a transformation class.
As an example, let us compute the transformations in F 2 T R F_{2\mathrm{TR}} F 2 TR that map point a a a onto point b b b in Figure 4 . In this example, a = ⟨ 1 , 1 ⟩ a=\langle1,1\rangle a = ⟨ 1 , 1 ⟩ and b = ⟨ 7 , 3 ⟩ b=\langle7,3\rangle b = ⟨ 7 , 3 ⟩ . Applying Eq. (9) , we therefore obtain
Figure 4. There is only one transformation in F 2 T F_{2T} F 2 T that maps point a a a onto point b b b —a translation by ⟨ 6 , 2 ⟩ \langle6,2\rangle ⟨ 6 , 2 ⟩ . However, there are two transformations in F 2 T R F_{2TR} F 2 T R that map point a a a onto point b b b —a translation by ⟨ 6 , 2 ⟩ \langle6,2\rangle ⟨ 6 , 2 ⟩ , or a translation by ⟨ 6 , − 4 ⟩ \langle6,-4\rangle ⟨ 6 , − 4 ⟩ , which takes a a a to c c c , followed by a reflection in the x x x -axis. The number of transformations in F 2 S T R F_{2STR} F 2 S T R that map point a a a onto point b b b is infinite, as there are two transformations for every possible x x x -axis scale factor.
T F 2 T R ( ⟨ a ⟩ , ⟨ b ⟩ ) = { ⟨ b [ 0 ] − a [ 0 ] , b [ 1 ] − a [ 1 ] , 1 ⟩ , ⟨ b [ 0 ] − a [ 0 ] , − b [ 1 ] − a [ 1 ] , − 1 ⟩ } = { ⟨ 7 − 1 , 3 − 1 , 1 ⟩ , ⟨ 7 − 1 , − 3 − 1 , − 1 ⟩ } = { ⟨ 6 , 2 , 1 ⟩ , ⟨ 6 , − 4 , − 1 ⟩ } \begin{aligned}
\mathcal{T}_{F_{2\mathrm{TR}}}(\langle a\rangle,\langle b\rangle)&=\{\langle b[0]-a[0],b[1]-a[1],1\rangle,\langle b[0]-a[0],-b[1]-a[1],-1\rangle\}\\
&=\{\langle7-1,3-1,1\rangle,\langle7-1,-3-1,-1\rangle\}\\
&=\{\langle6,2,1\rangle,\langle6,-4,-1\rangle\}
\end{aligned} T F 2 TR (⟨ a ⟩ , ⟨ b ⟩) = {⟨ b [ 0 ] − a [ 0 ] , b [ 1 ] − a [ 1 ] , 1 ⟩ , ⟨ b [ 0 ] − a [ 0 ] , − b [ 1 ] − a [ 1 ] , − 1 ⟩} = {⟨ 7 − 1 , 3 − 1 , 1 ⟩ , ⟨ 7 − 1 , − 3 − 1 , − 1 ⟩} = {⟨ 6 , 2 , 1 ⟩ , ⟨ 6 , − 4 , − 1 ⟩}
This tells us that the transformations in F 2 T R F_{2\mathrm{TR}} F 2 TR that map point a a a onto point b b b in Figure 4 are those whose transformation parameter vectors are ⟨ 6 , 2 , 1 ⟩ \langle6,2,1\rangle ⟨ 6 , 2 , 1 ⟩ and ⟨ 6 , − 4 , − 1 ⟩ \langle6,-4,-1\rangle ⟨ 6 , − 4 , − 1 ⟩ . If we set σ = ⟨ 6 , 2 , 1 ⟩ \sigma=\langle6,2,1\rangle σ = ⟨ 6 , 2 , 1 ⟩ , then with Eq. (8) we can confirm that
ϕ F 2 T R ( σ , a ) = ⟨ a [ 0 ] + σ [ 0 ] , σ [ 2 ] ( a [ 1 ] + σ [ 1 ] ) ⟩ = ⟨ 1 + 6 , 1 × ( 1 + 2 ) ⟩ = ⟨ 7 , 3 ⟩ = b \begin{aligned}
\phi_{F_{2\mathrm{TR}}}(\sigma,a)&=\langle a[0]+\sigma[0],\sigma[2](a[1]+\sigma[1])\rangle\\
&=\langle1+6,1\times(1+2)\rangle\\
&=\langle7,3\rangle=b
\end{aligned} ϕ F 2 TR ( σ , a ) = ⟨ a [ 0 ] + σ [ 0 ] , σ [ 2 ] ( a [ 1 ] + σ [ 1 ])⟩ = ⟨ 1 + 6 , 1 × ( 1 + 2 )⟩ = ⟨ 7 , 3 ⟩ = b
We can then set σ = ⟨ 6 , − 4 , − 1 ⟩ \sigma=\langle6,-4,-1\rangle σ = ⟨ 6 , − 4 , − 1 ⟩ and confirm that
ϕ F 2 T R ( σ , a ) = ⟨ a [ 0 ] + σ [ 0 ] , σ [ 2 ] ( a [ 1 ] + σ [ 1 ] ) ⟩ = ⟨ 1 + 6 , − 1 × ( 1 − 4 ) ⟩ = ⟨ 7 , 3 ⟩ = b \begin{aligned}
\phi_{F_{2\mathrm{TR}}}(\sigma,a)&=\langle a[0]+\sigma[0],\sigma[2](a[1]+\sigma[1])\rangle\\
&=\langle1+6,-1\times(1-4)\rangle\\
&=\langle7,3\rangle=b
\end{aligned} ϕ F 2 TR ( σ , a ) = ⟨ a [ 0 ] + σ [ 0 ] , σ [ 2 ] ( a [ 1 ] + σ [ 1 ])⟩ = ⟨ 1 + 6 , − 1 × ( 1 − 4 )⟩ = ⟨ 7 , 3 ⟩ = b
The transformation class F 2 S T F_{2\mathrm{ST}} F 2 ST . Let F 2 S T F_{2\mathrm{ST}} F 2 ST be the set containing those 2-dimensional transformations that consist of a scaling parallel to the x x x -axis by a real-valued scale factor, followed by a translation. If we use one of the geometric, pitch–time representations introduced in [10 ] , then F 2 S T F_{2\mathrm{ST}} F 2 ST includes those geometric transformations that correspond to combinations of the musical transformations of transposition, diminution, augmentation and retrograde. Each transformation, f ∈ F 2 S T f \in F_{2\mathrm{ST}} f ∈ F 2 ST , therefore takes a point, p = ⟨ x p , y p ⟩ p = \langle x_p,y_p\rangle p = ⟨ x p , y p ⟩ , and multiplies the x x x -coordinate of p p p by a scale factor, s s s , to get a new point, p ′ = ⟨ s x p , y p ⟩ p' = \langle sx_p,y_p\rangle p ′ = ⟨ s x p , y p ⟩ . p ′ p' p ′ is then translated by a 2-dimensional vector, v = ⟨ x v , y v ⟩ v = \langle x_v,y_v\rangle v = ⟨ x v , y v ⟩ , to give a new point, q = p ′ + v = ⟨ s x p + x v , y p + y v ⟩ q = p' + v = \langle sx_p+x_v,y_p+y_v\rangle q = p ′ + v = ⟨ s x p + x v , y p + y v ⟩ .
We can therefore define that λ ( F 2 S T ) = 3 \lambda(F_{2\mathrm{ST}}) = 3 λ ( F 2 ST ) = 3 and that each transformation, f ∈ F 2 S T f \in F_{2\mathrm{ST}} f ∈ F 2 ST , can be uniquely identified by a 3-vector, ⟨ s , v x , v y ⟩ ∈ R 3 \langle s,v_x,v_y\rangle\in\mathbb{R}^3 ⟨ s , v x , v y ⟩ ∈ R 3 , where s s s , v x v_x v x and v y v_y v y can take any real values. In other words, if σ F 2 S T ( f ) = ⟨ s , v x , v y ⟩ \sigma_{F_{2\mathrm{ST}}}(f) = \langle s,v_x,v_y\rangle σ F 2 ST ( f ) = ⟨ s , v x , v y ⟩ , then f f f is the transformation that scales parallel to the x x x -axis by a scale factor of s s s , then translates by the vector, ⟨ v x , v y ⟩ \langle v_x,v_y\rangle ⟨ v x , v y ⟩ . This satisfies the first constraint in Definition 2. As an example, the points, p 1 p_1 p 1 and p 2 p_2 p 2 , in Figure 5 are mapped onto points, q 1 q_1 q 1 and q 2 q_2 q 2 , respectively, by the transformation in F 2 S T F_{2\mathrm{ST}} F 2 ST whose parameter vector is ⟨ 2 , 2 , 1 ⟩ \langle2,2,1\rangle ⟨ 2 , 2 , 1 ⟩ .
Figure 5. The only transformation in F 2 S T F_{2\mathrm{ST}} F 2 ST that maps the ordered pair of points, ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ , onto the ordered pair of points, ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ , is the one with the parameter vector, ⟨ 2 , 2 , 1 ⟩ \langle2,2,1\rangle ⟨ 2 , 2 , 1 ⟩ .
We can define the transformation class function for F 2 S T F_{2\mathrm{ST}} F 2 ST as follows,
ϕ F 2 S T ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , p [ 1 ] + σ [ 2 ] ⟩ , (10) \phi_{F_{2\mathrm{ST}}}(\sigma,p)=\langle p[0]\sigma[0]+\sigma[1],p[1]+\sigma[2]\rangle, \tag*{(10)} ϕ F 2 ST ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , p [ 1 ] + σ [ 2 ]⟩ , (10)
where p ∈ R 2 p \in\mathbb{R}^2 p ∈ R 2 and there must exist a transformation, f ∈ F 2 S T f \in F_{2\mathrm{ST}} f ∈ F 2 ST , such that σ = σ F 2 S T ( f ) \sigma= \sigma_{F_{2\mathrm{ST}}}(f) σ = σ F 2 ST ( f ) . This satisfies the second constraint in Definition 2.
For F 2 S T F_{2\mathrm{ST}} F 2 ST , we can define that β ( F 2 S T ) = 2 \beta(F_{2\mathrm{ST}}) = 2 β ( F 2 ST ) = 2 and that τ ( F 2 S T ) = 1 \tau(F_{2\mathrm{ST}}) = 1 τ ( F 2 ST ) = 1 . The basis-pair transformation set function, T F 2 S T T_{F_{2\mathrm{ST}}} T F 2 ST , therefore takes any two ordered pairs of distinct points, b o b j \mathbf{b}_{\mathrm{obj}} b obj and b i m g \mathbf{b}_{\mathrm{img}} b img , and computes the transformation parameter vectors of the transformations in F 2 S T F_{2\mathrm{ST}} F 2 ST that map b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img . In the case of F 2 S T F_{2\mathrm{ST}} F 2 ST , there is only ever at most one such transformation for any given basis pair. Note that, given any two points, p , q ∈ R 2 p,q \in\mathbb{R}^2 p , q ∈ R 2 , there is an infinite number of transformations, f ∈ F 2 S T f \in F_{2\mathrm{ST}} f ∈ F 2 ST , that map p p p onto q q q , since, for every possible value of the x x x -axis scale factor, σ F 2 S T ( f ) [ 0 ] \sigma_{F_{2\mathrm{ST}}}(f)[0] σ F 2 ST ( f ) [ 0 ] , it is possible to find a vector, ⟨ σ F 2 S T ( f ) [ 1 ] , σ F 2 S T ( f ) [ 2 ] ⟩ \langle\sigma_{F_{2\mathrm{ST}}}(f)[1],\sigma_{F_{2\mathrm{ST}}}(f)[2]\rangle ⟨ σ F 2 ST ( f ) [ 1 ] , σ F 2 ST ( f ) [ 2 ]⟩ , that results in p p p mapping onto q q q . We therefore need to set β ( F 2 S T ) \beta(F_{2\mathrm{ST}}) β ( F 2 ST ) to 2, which results in τ ( F 2 S T ) \tau(F_{2\mathrm{ST}}) τ ( F 2 ST ) being 1.
Let us suppose that b o b j = ⟨ p 1 , p 2 ⟩ \mathbf{b}_{\mathrm{obj}}=\langle p_1,p_2\rangle b obj = ⟨ p 1 , p 2 ⟩ and that b i m g = ⟨ q 1 , q 2 ⟩ \mathbf{b}_{\mathrm{img}}=\langle q_1,q_2\rangle b img = ⟨ q 1 , q 2 ⟩ . If σ ∈ T F 2 S T ( b o b j , b i m g ) \sigma\in T_{F_{2ST}}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}}) σ ∈ T F 2 S T ( b obj , b img ) , then we know from (10) that
q 1 [ 0 ] = p 1 [ 0 ] σ [ 0 ] + σ [ 1 ] , q 1 [ 1 ] = p 1 [ 1 ] + σ [ 2 ] , q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] , and q 2 [ 1 ] = p 2 [ 1 ] + σ [ 2 ] . (11) \begin{aligned}
q_1[0] &= p_1[0]\sigma[0]+\sigma[1], \\
q_1[1] &= p_1[1]+\sigma[2], \\
q_2[0] &= p_2[0]\sigma[0]+\sigma[1],\ \text{and} \\
q_2[1] &= p_2[1]+\sigma[2]. \tag*{(11)}
\end{aligned} q 1 [ 0 ] q 1 [ 1 ] q 2 [ 0 ] q 2 [ 1 ] = p 1 [ 0 ] σ [ 0 ] + σ [ 1 ] , = p 1 [ 1 ] + σ [ 2 ] , = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] , and = p 2 [ 1 ] + σ [ 2 ] . (11)
We can immediately make the following inferences:
( 12 ) ⇒ σ [ 2 ] = q 1 [ 1 ] − p 1 [ 1 ] , and (12) (12)\Rightarrow\sigma[2]=q_1[1]-p_1[1],\ \text{and} \tag*{(12)} ( 12 ) ⇒ σ [ 2 ] = q 1 [ 1 ] − p 1 [ 1 ] , and (12)
( 14 ) ⇒ σ [ 2 ] = q 2 [ 1 ] − p 2 [ 1 ] . (13) (14)\Rightarrow\sigma[2]=q_2[1]-p_2[1]. \tag*{(13)} ( 14 ) ⇒ σ [ 2 ] = q 2 [ 1 ] − p 2 [ 1 ] . (13)
Equations (15) and (16) together imply that, in order for there to be a transformation in F 2 S T F_{2ST} F 2 S T that maps b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img , it must be true that
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] . (14) q_1[1]-p_1[1]=q_2[1]-p_2[1]. \tag*{(14)} q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] . (14)
Thus, for example, there is no transformation in F 2 S T F_{2ST} F 2 S T that maps ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ in Figure 6 because the condition in (17) does not hold in this case. Equations (11) and (13) together imply that
Figure 6. There is no transformation in F 2 S T F_{2ST} F 2 S T that maps the ordered pair of points, ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ , onto the ordered pair of points, ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ because q 2 [ 1 ] − q 1 [ 1 ] ≠ p 2 [ 1 ] − p 1 [ 1 ] q_2[1]-q_1[1] \ne p_2[1]-p_1[1] q 2 [ 1 ] − q 1 [ 1 ] = p 2 [ 1 ] − p 1 [ 1 ] .
q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] + q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = σ [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] ) + q 1 [ 0 ] ⇒ σ [ 0 ] = q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] . (15) \begin{aligned}
q_2[0] &= p_2[0]\sigma[0]+\sigma[1]+q_1[0]-p_1[0]\sigma[0] \\
&= \sigma[0]\left(p_2[0]-p_1[0]\right)+q_1[0] \\
\Rightarrow\sigma[0] &= \frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}. \tag*{(15)}
\end{aligned} q 2 [ 0 ] ⇒ σ [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] + q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = σ [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] ) + q 1 [ 0 ] = p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] . (15)
Equation (18) implies that σ [ 0 ] = 0 \sigma[0]=0 σ [ 0 ] = 0 when q 2 [ 0 ] = q 1 [ 0 ] q_2[0]=q_1[0] q 2 [ 0 ] = q 1 [ 0 ] , unless p 2 [ 0 ] = p 1 [ 0 ] p_2[0]=p_1[0] p 2 [ 0 ] = p 1 [ 0 ] , in which case the right-hand side of (18) evaluates to 0 0 \frac{0}{0} 0 0 , which is undefined. However, we define that, in this case, σ [ 0 ] \sigma[0] σ [ 0 ] should be set to 1, as this allows us to intuitively discover that, if q 2 [ 0 ] = q 1 [ 0 ] q_2[0]=q_1[0] q 2 [ 0 ] = q 1 [ 0 ] and p 2 [ 0 ] = p 1 [ 0 ] p_2[0]=p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and condition (17) holds, then b o b j \mathbf{b}_{\mathrm{obj}} b obj can be mapped onto b i m g \mathbf{b}_{\mathrm{img}} b img by a simple translation (i.e., no scaling required). Clearly, if $p_2[0]=p_1[0]】【。 and q 2 [ 0 ] ≠ q 1 [ 0 ] q_2[0] \ne q_1[0] q 2 [ 0 ] = q 1 [ 0 ] , then σ [ 0 ] \sigma[0] σ [ 0 ] is undefined and there is no transformation in F 2 S T F_{2ST} F 2 S T that maps b o b j \mathrm{b}_{\mathrm{obj}} b obj onto b i m g \mathrm{b}_{\mathrm{img}} b img .
This is illustrated by the examples in Figure 7 and Figure 8 . In Figure 7 , ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ is mapped onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ by the transformation in F 2 S T F_{2ST} F 2 S T whose parameter vector is ⟨ 0 , 5 , 1 ⟩ \langle0,5,1\rangle ⟨ 0 , 5 , 1 ⟩ —that is, an x x x -axis scaling with a scale factor of zero, which maps ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ to ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ , followed by a translation of ⟨ 5 , 1 ⟩ \langle5,1\rangle ⟨ 5 , 1 ⟩ . In Figure 8 , σ [ 0 ] = 0 0 \sigma[0] = \frac{0}{0} σ [ 0 ] = 0 0 , so we define that σ [ 0 ] = 1 \sigma[0] = 1 σ [ 0 ] = 1 , implying that ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ is mapped onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ in this case by the transformation whose parameter vector is ⟨ 1 , 4 , 1 ⟩ \langle1,4,1\rangle ⟨ 1 , 4 , 1 ⟩ .
Figure 7. ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ can be mapped onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ by a transformation in F 2 S T F_{2ST} F 2 S T by first scaling parallel to the x x x -axis with a scale factor of zero, to give ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ , and then translating ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ by ⟨ 5 , 1 ⟩ \langle5,1\rangle ⟨ 5 , 1 ⟩ . This transformation has the parameter vector, ⟨ 0 , 5 , 1 ⟩ \langle0,5,1\rangle ⟨ 0 , 5 , 1 ⟩ .
From (13), it follows that
σ [ 1 ] = q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , (16) \sigma[1] = q_2[0] - p_2[0]\sigma[0], \tag*{(16)} σ [ 1 ] = q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , (16)
and (11) implies that
σ [ 1 ] = q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] . (17) \sigma[1] = q_1[0] - p_1[0]\sigma[0]. \tag*{(17)} σ [ 1 ] = q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] . (17)
From (18) and (19), we can infer that
q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] = q 2 [ 0 ] − p 2 [ 0 ] ( q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] ) = q 2 [ 0 ] p 2 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] − p 2 [ 0 ] q 2 [ 0 ] + p 2 [ 0 ] q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] = p 2 [ 0 ] q 1 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] . (18) q_2[0]-p_2[0]\sigma[0]=q_2[0]-p_2[0]\left(\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}\right)
=\frac{q_2[0]p_2[0]-q_2[0]p_1[0]-p_2[0]q_2[0]+p_2[0]q_1[0]}{p_2[0]-p_1[0]}
=\frac{p_2[0]q_1[0]-q_2[0]p_1[0]}{p_2[0]-p_1[0]}. \tag*{(18)} q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] = q 2 [ 0 ] − p 2 [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] ) = p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] p 2 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] − p 2 [ 0 ] q 2 [ 0 ] + p 2 [ 0 ] q 1 [ 0 ] = p 2 [ 0 ] − p 1 [ 0 ] p 2 [ 0 ] q 1 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] . (18)
Similarly, from (18) and (20), we can infer that
q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = q 1 [ 0 ] − p 1 [ 0 ] ( q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] ) = p 2 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] + p 1 [ 0 ] q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] = p 2 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] . (19) q_1[0]-p_1[0]\sigma[0]=q_1[0]-p_1[0]\left(\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}\right)
=\frac{p_2[0]q_1[0]-p_1[0]q_1[0]-p_1[0]q_2[0]+p_1[0]q_1[0]}{p_2[0]-p_1[0]}
=\frac{p_2[0]q_1[0]-p_1[0]q_2[0]}{p_2[0]-p_1[0]}. \tag*{(19)} q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = q 1 [ 0 ] − p 1 [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] ) = p 2 [ 0 ] − p 1 [ 0 ] p 2 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] + p 1 [ 0 ] q 1 [ 0 ] = p 2 [ 0 ] − p 1 [ 0 ] p 2 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] . (19)
Equations (21) and (22) together imply that the right-hand sides of (19) and (20) are always equal. It follows that, when σ [ 0 ] \sigma[0] σ [ 0 ] is undefined (i.e., when p 2 [ 0 ] = p 1 [ 0 ] p_2[0]=p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] q_2[0]\ne q_1[0] q 2 [ 0 ] = q 1 [ 0 ] ), σ [ 1 ] \sigma[1] σ [ 1 ] is also undefined.
The basis-pair transformation set function for F 2 S T F_{2\mathrm{ST}} F 2 ST can therefore be defined as follows:
T F 2 S T ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] ⟩ } . (20) \mathcal{T}_{F_{2\mathrm{ST}}}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle)=\{\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],q_1[1]-p_1[1]\rangle\}. \tag*{(20)} T F 2 ST (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) = {⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ]⟩} . (20)
where
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] q_1[1]-p_1[1]=q_2[1]-p_2[1] q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ]
and where
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] . (21) \sigma[0]=
\begin{cases}
1, & \text{if }p_2[0]=p_1[0]\text{ and }q_2[0]=q_1[0];\text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that }p_2[0]\ne p_1[0].
\end{cases} \tag*{(21)} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] . (21)
F 2 S T F_{2\mathrm{ST}} F 2 ST is therefore a transformation class. The basis-pair transformation set function, T F 2 S T \mathcal{T}_{F_{2\mathrm{ST}}} T F 2 ST , can be computed using the algorithm shown in Figure 9 .
$\mathcal{T}_{F_{2\mathrm{ST}}}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}})$
1 if $\mathbf{b}_{\mathrm{img}}=\mathbf{b}_{\mathrm{obj}}$
2 return $\{\langle 1,0,0\rangle\}$ ▶ *Identity transformation*
3 $p_1\leftarrow \mathbf{b}_{\mathrm{obj}}[0], p_2\leftarrow \mathbf{b}_{\mathrm{obj}}[1], q_1\leftarrow \mathbf{b}_{\mathrm{img}}[0], q_2\leftarrow \mathbf{b}_{\mathrm{img}}[1]$
4 if $q_2[0]\ne q_1[0]\land p_2[0]=p_1[0]$ ▶ $\sigma[0]$ is undefined.
5 return $\{\}$
6 if $p_2[0]=p_1[0]\land q_2[0]=q_1[0]$ ▶ $\sigma[0]=0/0$
7 $\sigma_0\leftarrow 1$
8 else
9 $\sigma_0\leftarrow (q_2[0]-q_1[0])/(p_2[0]-p_1[0])$ ▶ *From (18)*
10 $\sigma_1\leftarrow q_2[0]-p_2[0]\sigma_0$ ▶ *From (19)*
11 if $q_1[1]-p_1[1]=q_2[1]-p_2[1]$ ▶ *From (17)*
12 $\sigma_2\leftarrow q_1[1]-p_1[1]$ ▶ *From (15)*
13 return $\{\langle\sigma_0,\sigma_1,\sigma_2\rangle\}$
14 return $\{\}$Figure 9. Algorithm for computing the basis-pair transformation set function for F 2 S T F_{2\mathrm{ST}} F 2 ST .
The transformation class F 2 S T R F_{2\mathrm{STR}} F 2 STR Let F 2 S T R F_{2\mathrm{STR}} F 2 STR be the set of 2-dimensional transformations that consist of a scaling parallel to the x x x -axis by a real-valued scale factor, followed by a translation, optionally followed by a reflection in the x x x -axis. If we represent a piece of music as a set of points in pitch–time space, where the y y y -axis is a number representing pitch and the x x x -axis represents time, then this set of transformations corresponds to the class of traditional contrapuntal transformations in music, where a pattern can be transformed by any combination of transposition (corresponding to translating in the y y y -direction), time-shifting (translation in the x x x -direction), augmentation (scaling parallel to the x x x -axis by a scale factor whose absolute value is greater than 1), diminution (scaling parallel to the x x x -axis by a non-zero scale factor whose absolute value is less than 1), inversion (reflection in the x x x -axis) and retrograde (scaling parallel to the x x x -axis by a negative scale factor).
Each transformation, f ∈ F 2 S T R f \in F_{2\mathrm{STR}} f ∈ F 2 STR , therefore takes a point, p = ⟨ x p , y p ⟩ p=\langle x_p,y_p\rangle p = ⟨ x p , y p ⟩ , and multiplies the x x x -coordinate of p p p by a scale factor, s s s , to get a new point, p ′ = ⟨ s x p , y p ⟩ p'=\langle sx_p,y_p\rangle p ′ = ⟨ s x p , y p ⟩ . p ′ p' p ′ is then translated by a 2-dimensional vector, v = ⟨ x v , y v ⟩ v=\langle x_v,y_v\rangle v = ⟨ x v , y v ⟩ , to give a new point, p ′ ′ = p ′ + v = ⟨ s x p + x v , y p + y v ⟩ p''=p'+v=\langle sx_p+x_v,y_p+y_v\rangle p ′′ = p ′ + v = ⟨ s x p + x v , y p + y v ⟩ . Finally, p ′ ′ p'' p ′′ may be reflected in the x x x -axis to give a point, q = ⟨ s x p + x v , b ( y p + y v ) ⟩ q=\langle sx_p+x_v,b(y_p+y_v)\rangle q = ⟨ s x p + x v , b ( y p + y v )⟩ , where b = − 1 b=-1 b = − 1 if p ′ ′ p'' p ′′ is reflected and b = 1 b=1 b = 1 if it is not.
We can therefore define that λ ( F 2 S T R ) = 4 \lambda(F_{2\mathrm{STR}})=4 λ ( F 2 STR ) = 4 and that each transformation f ∈ F 2 S T R f\in F_{2\mathrm{STR}} f ∈ F 2 STR , can be uniquely identified by a 4-vector, ⟨ s , v x , v y , b ⟩ ∈ R 4 \langle s,v_x,v_y,b\rangle\in\mathbb{R}^4 ⟨ s , v x , v y , b ⟩ ∈ R 4 , where s s s , v x v_x v x and v y v_y v y can take any real values and b ∈ { − 1 , 1 } b\in\{-1,1\} b ∈ { − 1 , 1 } . In other words, if σ F 2 S T R ( f ) = ⟨ s , v x , v y , b ⟩ \sigma_{F_{2\mathrm{STR}}}(f)=\langle s,v_x,v_y,b\rangle σ F 2 STR ( f ) = ⟨ s , v x , v y , b ⟩ , then f f f is the transformation that scales parallel to the x x x -axis by a scale factor of s s s , then translates by the vector, ⟨ v x , v y ⟩ \langle v_x,v_y\rangle ⟨ v x , v y ⟩ and then multiplies the y y y -coordinate of the resulting point by b b b (which is either − 1 -1 − 1 or 1 1 1 ). This satisfies the first constraint in Definition 2.
We can define the transformation class function for F 2 S T R F_{2\mathrm{STR}} F 2 STR as follows,
ϕ F 2 S T R ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , σ [ 3 ] ( p [ 1 ] + σ [ 2 ] ) ⟩ , (22) \phi_{F_{2\mathrm{STR}}}(\sigma,p)=\langle p[0]\sigma[0]+\sigma[1],\sigma[3](p[1]+\sigma[2])\rangle, \tag*{(22)} ϕ F 2 STR ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , σ [ 3 ] ( p [ 1 ] + σ [ 2 ])⟩ , (22)
where p ∈ R 2 p\in\mathbb{R}^2 p ∈ R 2 and there must exist a transformation, f ∈ F 2 S T R f\in F_{2\mathrm{STR}} f ∈ F 2 STR , such that σ = σ F 2 S T R ( f ) \sigma=\sigma_{F_{2\mathrm{STR}}}(f) σ = σ F 2 STR ( f ) . This satisfies the second constraint in Definition 2.
For F 2 S T R F_{2\mathrm{STR}} F 2 STR , we can define that β ( F 2 S T R ) = 2 \beta(F_{2\mathrm{STR}})=2 β ( F 2 STR ) = 2 and that τ ( F 2 S T R ) = 2 \tau(F_{2\mathrm{STR}})=2 τ ( F 2 STR ) = 2 . The basis-pair transformation set function, T F 2 S T R \mathcal{T}_{F_{2\mathrm{STR}}} T F 2 STR , thus takes any two ordered pairs of distinct points, b o b j \mathbf{b}_{\mathrm{obj}} b obj and b i m g \mathbf{b}_{\mathrm{img}} b img , and computes the transformation parameter vectors of the transformations in F 2 S T R F_{2\mathrm{STR}} F 2 STR that map b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img . Let us suppose that b o b j = ⟨ p 1 , p 2 ⟩ \mathbf{b}_{\mathrm{obj}}=\langle p_1,p_2\rangle b obj = ⟨ p 1 , p 2 ⟩ and that b i m g = ⟨ q 1 , q 2 ⟩ \mathbf{b}_{\mathrm{img}}=\langle q_1,q_2\rangle b img = ⟨ q 1 , q 2 ⟩ . If σ ∈ T F 2 S T R ( b o b j , b i m g ) \sigma\in\mathcal{T}_{F_{2\mathrm{STR}}}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}}) σ ∈ T F 2 STR ( b obj , b img ) , then we know from (22) that
q 1 [ 0 ] = p 1 [ 0 ] σ [ 0 ] + σ [ 1 ] , (23) q_1[0] = p_1[0]\sigma[0] + \sigma[1], \tag*{(23)} q 1 [ 0 ] = p 1 [ 0 ] σ [ 0 ] + σ [ 1 ] , (23)
q 1 [ 1 ] = σ [ 3 ] ( p 1 [ 1 ] + σ [ 2 ] ) , (24) q_1[1] = \sigma[3](p_1[1] + \sigma[2]), \tag*{(24)} q 1 [ 1 ] = σ [ 3 ] ( p 1 [ 1 ] + σ [ 2 ]) , (24)
q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] , (25) q_2[0] = p_2[0]\sigma[0] + \sigma[1], \tag*{(25)} q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] , (25)
and
q 2 [ 1 ] = σ [ 3 ] ( p 2 [ 1 ] + σ [ 2 ] ) . (26) q_2[1] = \sigma[3](p_2[1] + \sigma[2]). \tag*{(26)} q 2 [ 1 ] = σ [ 3 ] ( p 2 [ 1 ] + σ [ 2 ]) . (26)
We know that σ [ 3 ] \sigma[3] σ [ 3 ] is equal to either 1 or − 1 -1 − 1 . Let us first consider the case where σ [ 3 ] = 1 \sigma[3] = 1 σ [ 3 ] = 1 . In this case,
( 27 ) ⇒ σ [ 2 ] = q 1 [ 1 ] − p 1 [ 1 ] , (27) (27) \Rightarrow\sigma[2] = q_1[1] - p_1[1], \tag*{(27)} ( 27 ) ⇒ σ [ 2 ] = q 1 [ 1 ] − p 1 [ 1 ] , (27)
and
( 29 ) ⇒ σ [ 2 ] = q 2 [ 1 ] − p 2 [ 1 ] . (28) (29) \Rightarrow\sigma[2] = q_2[1] - p_2[1]. \tag*{(28)} ( 29 ) ⇒ σ [ 2 ] = q 2 [ 1 ] − p 2 [ 1 ] . (28)
Equations (30) and (31) together imply that, in order for there to be a transformation in F 2 S T R F_{2\mathrm{STR}} F 2 STR that maps b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img when σ [ 3 ] = 1 \sigma[3] = 1 σ [ 3 ] = 1 , it must be true that
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] . (29) q_1[1] - p_1[1] = q_2[1] - p_2[1]. \tag*{(29)} q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] . (29)
This implies, for example, that, when σ [ 3 ] = 1 \sigma[3] = 1 σ [ 3 ] = 1 , there is no transformation in F 2 S T R F_{2\mathrm{STR}} F 2 STR that maps ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ in Figure 6 , because condition (32) does not hold in this case. Equations (26) and (28) together imply that
q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = σ [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] ) + q 1 [ 0 ] ⇒ σ [ 0 ] = q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] . (30) \begin{aligned}
q_2[0] &= p_2[0]\sigma[0] + q_1[0] - p_1[0]\sigma[0] \\
&= \sigma[0](p_2[0] - p_1[0]) + q_1[0] \\
\Rightarrow\sigma[0] &= \frac{q_2[0] - q_1[0]}{p_2[0] - p_1[0]}. \tag*{(30)}
\end{aligned} q 2 [ 0 ] ⇒ σ [ 0 ] = p 2 [ 0 ] σ [ 0 ] + q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = σ [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ]) + q 1 [ 0 ] = p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] . (30)
Equation (33) implies that σ [ 0 ] = 0 \sigma[0] = 0 σ [ 0 ] = 0 when q 2 [ 0 ] = q 1 [ 0 ] q_2[0] = q_1[0] q 2 [ 0 ] = q 1 [ 0 ] , unless p 2 [ 0 ] = p 1 [ 0 ] p_2[0] = p_1[0] p 2 [ 0 ] = p 1 [ 0 ] , in which case the right-hand side of (33) evaluates to 0 0 \frac{0}{0} 0 0 , which is undefined. However, as with F 2 S T F_{2\mathrm{ST}} F 2 ST , we define that, in this case, σ [ 0 ] \sigma[0] σ [ 0 ] should be set to 1, as this allows us to intuitively discover that, if q 2 [ 0 ] = q 1 [ 0 ] q_2[0] = q_1[0] q 2 [ 0 ] = q 1 [ 0 ] and p 2 [ 0 ] = p 1 [ 0 ] p_2[0] = p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and condition (32) holds, then b o b j \mathbf{b}_{\mathrm{obj}} b obj can be mapped onto b i m g \mathbf{b}_{\mathrm{img}} b img by a simple translation (i.e., neither scaling nor reflection required). Clearly, if p 2 [ 0 ] = p 1 [ 0 ] p_2[0] = p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] q_2[0] \ne q_1[0] q 2 [ 0 ] = q 1 [ 0 ] , then σ [ 0 ] \sigma[0] σ [ 0 ] is undefined and there is consequently no transformation in F 2 S T R F_{2\mathrm{STR}} F 2 STR that maps b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img .
From (28), it follows that
σ [ 1 ] = q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , (31) \sigma[1] = q_2[0] - p_2[0]\sigma[0], \tag*{(31)} σ [ 1 ] = q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , (31)
and (26) implies that
σ [ 1 ] = q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] . (32) \sigma[1] = q_1[0] - p_1[0]\sigma[0]. \tag*{(32)} σ [ 1 ] = q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] . (32)
From (33) and (34), we can infer that
q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] = q 2 [ 0 ] − p 2 [ 0 ] ( q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] ) = q 2 [ 0 ] p 2 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] − p 2 [ 0 ] q 2 [ 0 ] + p 2 [ 0 ] q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] = p 2 [ 0 ] q 1 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] . (33) \begin{aligned}
q_2[0] - p_2[0]\sigma[0]
&= q_2[0] - p_2[0]\left(\frac{q_2[0] - q_1[0]}{p_2[0] - p_1[0]}\right) \\
&= \frac{q_2[0]p_2[0] - q_2[0]p_1[0] - p_2[0]q_2[0] + p_2[0]q_1[0]}{p_2[0] - p_1[0]} \\
&= \frac{p_2[0]q_1[0] - q_2[0]p_1[0]}{p_2[0] - p_1[0]}. \tag*{(33)}
\end{aligned} q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] = q 2 [ 0 ] − p 2 [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] ) = p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] p 2 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] − p 2 [ 0 ] q 2 [ 0 ] + p 2 [ 0 ] q 1 [ 0 ] = p 2 [ 0 ] − p 1 [ 0 ] p 2 [ 0 ] q 1 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] . (33)
Similarly, from (30) and (32) , we can infer that
q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = q 1 [ 0 ] − p 1 [ 0 ] ( q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] ) = q 1 [ 0 ] p 2 [ 0 ] − q 1 [ 0 ] p 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] + p 1 [ 0 ] q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] = p 2 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] . (34) \begin{aligned}
q_1[0]-p_1[0]\sigma[0] &= q_1[0]-p_1[0]\left(\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}\right) \\
&= \frac{q_1[0]p_2[0]-q_1[0]p_1[0]-p_1[0]q_2[0]+p_1[0]q_1[0]}{p_2[0]-p_1[0]} \\
&= \frac{p_2[0]q_1[0]-p_1[0]q_2[0]}{p_2[0]-p_1[0]}. \tag*{(34)}
\end{aligned} q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] = q 1 [ 0 ] − p 1 [ 0 ] ( p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] ) = p 2 [ 0 ] − p 1 [ 0 ] q 1 [ 0 ] p 2 [ 0 ] − q 1 [ 0 ] p 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] + p 1 [ 0 ] q 1 [ 0 ] = p 2 [ 0 ] − p 1 [ 0 ] p 2 [ 0 ] q 1 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] . (34)
Equations (33) and (34) together imply that the right-hand sides of (31) and (32) are always equal. It follows that, when σ [ 0 ] \sigma[0] σ [ 0 ] is undefined (i.e., when p 2 [ 0 ] = p 1 [ 0 ] p_2[0]=p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] q_2[0]\ne q_1[0] q 2 [ 0 ] = q 1 [ 0 ] ), σ [ 1 ] \sigma[1] σ [ 1 ] is also undefined.
To summarise the result so far, if σ [ 3 ] = 1 \sigma[3]=1 σ [ 3 ] = 1 , then
σ = ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] , 1 ⟩ , (35) \sigma=\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],q_1[1]-p_1[1],1\rangle, \tag*{(35)} σ = ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] , 1 ⟩ , (35)
where
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] , q_1[1]-p_1[1]=q_2[1]-p_2[1], q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] ,
and where
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] . \sigma[0]=
\begin{cases}
1, & \text{if }p_2[0]=p_1[0]\text{ and }q_2[0]=q_1[0];\text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that }p_2[0]\ne p_1[0].
\end{cases} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] .
Let us now consider the case where σ [ 3 ] = − 1 \sigma[3]=-1 σ [ 3 ] = − 1 . In this case, σ [ 0 ] \sigma[0] σ [ 0 ] and σ [ 1 ] \sigma[1] σ [ 1 ] are still given by (30) and (31) , respectively, since they do not depend on σ [ 3 ] \sigma[3] σ [ 3 ] . From (24) and (26) we conclude that
(27) ⇒ σ [ 2 ] = − p 1 [ 1 ] − q 1 [ 1 ] , and (36) \begin{aligned}
\text{(27)} &\Rightarrow\sigma[2]= -p_1[1]-q_1[1],\text{ and} \tag*{(36)}
\end{aligned} (27) ⇒ σ [ 2 ] = − p 1 [ 1 ] − q 1 [ 1 ] , and (36)
(29) ⇒ σ [ 2 ] = − p 2 [ 1 ] − q 2 [ 1 ] . (37) \text{(29)}\Rightarrow\sigma[2]=-p_2[1]-q_2[1]. \tag*{(37)} (29) ⇒ σ [ 2 ] = − p 2 [ 1 ] − q 2 [ 1 ] . (37)
Therefore, in order for there to be a transformation that maps b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img when σ [ 3 ] = − 1 \sigma[3]=-1 σ [ 3 ] = − 1 , it must be true that
p 1 [ 1 ] + q 1 [ 1 ] = p 2 [ 1 ] + q 2 [ 1 ] . (38) p_1[1]+q_1[1]=p_2[1]+q_2[1]. \tag*{(38)} p 1 [ 1 ] + q 1 [ 1 ] = p 2 [ 1 ] + q 2 [ 1 ] . (38)
To summarise, we can define the basis-pair transformation set function, T F 2 S T R \mathcal{T}_{F2STR} T F 2 S T R , as follows:
T F 2 S T R ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , − p 1 [ 1 ] − q 1 [ 1 ] , − 1 ⟩ (39) \mathcal{T}_{F2STR}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle)=
\left\{
\begin{aligned}
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],q_1[1]-p_1[1],1\rangle,\\
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],-p_1[1]-q_1[1],-1\rangle
\end{aligned}
\right. \tag*{(39)} T F 2 S T R (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , − p 1 [ 1 ] − q 1 [ 1 ] , − 1 ⟩ (39)
where
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] when σ [ 3 ] = 1 , q_1[1]-p_1[1]=q_2[1]-p_2[1]\text{ when }\sigma[3]=1, q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] when σ [ 3 ] = 1 ,
and
p 1 [ 1 ] + q 1 [ 1 ] = p 2 [ 1 ] + q 2 [ 1 ] when σ [ 3 ] = − 1 , p_1[1]+q_1[1]=p_2[1]+q_2[1]\text{ when }\sigma[3]=-1, p 1 [ 1 ] + q 1 [ 1 ] = p 2 [ 1 ] + q 2 [ 1 ] when σ [ 3 ] = − 1 ,
and where
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] . (40) \sigma[0] =
\begin{cases}
1, & \text{if } p_2[0] = p_1[0] \text{ and } q_2[0] = q_1[0]; \text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that } p_2[0] \ne p_1[0].
\end{cases} \tag*{(40)} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] . (40)
Note that, for a given pair of bases, ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ and ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ , (32) and (41) are both true only when p 1 [ 1 ] = p 2 [ 1 ] p_1[1] = p_2[1] p 1 [ 1 ] = p 2 [ 1 ] . This implies that ∣ T F 2 S T R ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) ∣ = τ ( F 2 S T R ) = 2 |\mathcal{T}_{F_{2\mathrm{STR}}}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle)| = \tau(F_{2\mathrm{STR}}) = 2 ∣ T F 2 STR (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) ∣ = τ ( F 2 STR ) = 2 when p 1 [ 1 ] = p 2 [ 1 ] p_1[1] = p_2[1] p 1 [ 1 ] = p 2 [ 1 ] and the other conditions above are satisfied. Figure 11 shows an example of a basis pair for which the basis-pair transformation set function returns a set containing two transformations.
Figure 11. There are two transformations in F 2 S T R F_{2\mathrm{STR}} F 2 STR that map ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ —those whose parameter vectors are ⟨ 2 , 1 , 1 , 1 ⟩ \langle2,1,1,1\rangle ⟨ 2 , 1 , 1 , 1 ⟩ and ⟨ 2 , 1 , − 5 , − 1 ⟩ \langle2,1,-5,-1\rangle ⟨ 2 , 1 , − 5 , − 1 ⟩ . The transformation with parameter vector ⟨ 2 , 1 , 1 , 1 ⟩ \langle2,1,1,1\rangle ⟨ 2 , 1 , 1 , 1 ⟩ first x x x -scales ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ by a scale factor of 2 to give ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ ; it then translates ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ by ⟨ 1 , 1 ⟩ \langle1,1\rangle ⟨ 1 , 1 ⟩ to give ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ . The transformation with parameter vector ⟨ 2 , 1 , − 5 , − 1 ⟩ \langle2,1,-5,-1\rangle ⟨ 2 , 1 , − 5 , − 1 ⟩ again first x x x -scales ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ by a scale factor of 2 to give ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ , but then translates ⟨ p 1 ′ , p 2 ′ ⟩ \langle p'_1,p'_2\rangle ⟨ p 1 ′ , p 2 ′ ⟩ by ⟨ 1 , − 5 ⟩ \langle1,-5\rangle ⟨ 1 , − 5 ⟩ to give ⟨ p 1 ′ ′ , p 2 ′ ′ ⟩ \langle p''_1,p''_2\rangle ⟨ p 1 ′′ , p 2 ′′ ⟩ , which is then reflected in the x x x -axis to give ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ .
F 2 S T R F_{2\mathrm{STR}} F 2 STR , as defined here, is therefore a transformation class. The basis-pair transformation set function, T F 2 S T R \mathcal{T}_{F_{2\mathrm{STR}}} T F 2 STR , can be computed using the algorithm shown in Figure 10 .
\mathcal{T}_{F_{2\mathrm{STR}}}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}})
1 if \mathbf{b}_{\mathrm{img}} = \mathbf{b}_{\mathrm{obj}}
2 return \{\langle 1,0,0,1\rangle\} ▸ Identity transformation
3 \mathbf{p}_1 \leftarrow \mathbf{b}_{\mathrm{obj}}[0], \mathbf{p}_2 \leftarrow \mathbf{b}_{\mathrm{obj}}[1], \mathbf{q}_1 \leftarrow \mathbf{b}_{\mathrm{img}}[0], \mathbf{q}_2 \leftarrow \mathbf{b}_{\mathrm{img}}[1]
4 if $q_2[0] \ne q_1[0] \land p_2[0] = p_1[0]$ ▸ $\sigma[0]$ is undefined.
5 return $\{\}$
6 if $p_2[0] = p_1[0] \land q_2[0] = q_1[0]$ ▸ $\sigma[0] = 0/0$
7 $\sigma_0 \leftarrow 1$
8 else
9 $\sigma_0 \leftarrow (q_2[0]-q_1[0])/(p_2[0]-p_1[0])$ ▸ From (33)
10 $S \leftarrow \{\}$
11 $\sigma_1 \leftarrow q_2[0]-p_2[0]\sigma_0$ ▸ From (34)
12 if $q_1[1]-p_1[1] = q_2[1]-p_2[1]$ ▸ From (32)
13 $\sigma_3 \leftarrow 1$
14 $\sigma_2 \leftarrow q_1[1]-p_1[1]$ ▸ From (30)
15 $S \leftarrow \{\langle \sigma_0,\sigma_1,\sigma_2,\sigma_3\rangle\}$
16 if $p_1[1]+q_1[1] = p_2[1]+q_2[1]$ ▸ From (41)
17 $\sigma_3 \leftarrow -1$
18 $\sigma_2 \leftarrow -p_1[1]-q_1[1]$ ▸ From (39)
19 $S \leftarrow S \cup \{\langle \sigma_0,\sigma_1,\sigma_2,\sigma_3\rangle\}$
20 return $S$Figure 10. Algorithm for computing the basis-pair transformation set function for F 2 S T R F_{2\mathrm{STR}} F 2 STR .
The set of transformation classes F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ . For some specified value of μ \mu μ , F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ is the set of 2-dimensional transformations, such that each transformation, f ∈ F 2 S T R m o d μ f \in F_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ , takes a point, p = ⟨ x , y ⟩ p = \langle x,y\rangle p = ⟨ x , y ⟩ , multiplies x x x by a real-valued scale factor, s s s , to get a new point, p ′ = ⟨ s x , y ⟩ p' = \langle sx,y\rangle p ′ = ⟨ s x , y ⟩ , then translates p ′ p' p ′ by the vector, v = ⟨ v x , v y ⟩ v = \langle v_x,v_y\rangle v = ⟨ v x , v y ⟩ , with the y y y -component of p ′ p' p ′ being added modulo μ \mu μ to the y y y -component of v v v , to give a new point, p ′ ′ = ⟨ s x + v x , ( y + v y ) m o d μ ⟩ p'' = \langle sx+v_x,(y+v_y)\bmod\mu\rangle p ′′ = ⟨ s x + v x , ( y + v y ) mod μ ⟩ . Finally, p ′ ′ p'' p ′′ may be reflected in the x x x -axis, modulo μ \mu μ , to give a point, q = ⟨ s x + v x , ( b ( y + v y ) ) m o d μ ⟩ q = \langle sx+v_x,(b(y+v_y))\bmod\mu\rangle q = ⟨ s x + v x , ( b ( y + v y )) mod μ ⟩ , where b = − 1 b=-1 b = − 1 if p ′ ′ p'' p ′′ is reflected and b = 1 b=1 b = 1 if it is not. Note that we define that a m o d b = a − b ⌊ a b ⌋ a\bmod b = a-b\left\lfloor\frac{a}{b}\right\rfloor a mod b = a − b ⌊ b a ⌋ , where a , b ∈ R a,b \in\mathbb{R} a , b ∈ R .
We can therefore define that λ ( F 2 S T R m o d μ ) = 4 \lambda(F_{2\mathrm{STRmod}\mu})=4 λ ( F 2 STRmod μ ) = 4 and that each transformation f ∈ F 2 S T R m o d μ f\in F_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ can be uniquely identified by a 4-vector, ⟨ s , v x , v y , b ⟩ ∈ R 2 × R μ × { − 1 , 1 } \langle s,v_x,v_y,b\rangle\in\mathbb{R}^2\times\mathbb{R}_\mu\times\{-1,1\} ⟨ s , v x , v y , b ⟩ ∈ R 2 × R μ × { − 1 , 1 } , where we define that R μ = { x : x ∈ R ∧ 0 ≤ x < μ } \mathbb{R}_\mu=\{x:x\in\mathbb{R}\land0\le x<\mu\} R μ = { x : x ∈ R ∧ 0 ≤ x < μ } . If σ F 2 S T R m o d μ ( f ) = ⟨ s , v x , v y , b ⟩ \sigma_{F_{2\mathrm{STRmod}\mu}}(f)=\langle s,v_x,v_y,b\rangle σ F 2 STRmod μ ( f ) = ⟨ s , v x , v y , b ⟩ and p = ⟨ x , y ⟩ p=\langle x,y\rangle p = ⟨ x , y ⟩ , then f ( p ) = ⟨ s x + v x , ( b ( y + v y ) ) m o d μ ⟩ f(p)=\langle sx+v_x,(b(y+v_y))\bmod\mu\rangle f ( p ) = ⟨ s x + v x , ( b ( y + v y )) mod μ ⟩ . This satisfies the first constraint in Definition 2.
We can define the transformation class function for F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ as follows:
ϕ F 2 S T R m o d μ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , ( σ [ 3 ] ( p [ 1 ] + σ [ 2 ] ) ) m o d μ ⟩ (41) \phi_{F_{2\mathrm{STRmod}\mu}}(\sigma,p)=\langle p[0]\sigma[0]+\sigma[1],(\sigma[3](p[1]+\sigma[2]))\bmod\mu\rangle \tag*{(41)} ϕ F 2 STRmod μ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , ( σ [ 3 ] ( p [ 1 ] + σ [ 2 ])) mod μ ⟩ (41)
where p ∈ R × R μ p\in\mathbb{R}\times\mathbb{R}_\mu p ∈ R × R μ and there must exist a transformation, f ∈ F 2 S T R m o d μ f\in F_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ , such that σ = σ F 2 S T R m o d μ ( f ) \sigma=\sigma_{F_{2\mathrm{STRmod}\mu}}(f) σ = σ F 2 STRmod μ ( f ) . This satisfies the second constraint in Definition 2.
For F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ , we can define that β ( F 2 S T R m o d μ ) = 2 \beta(F_{2\mathrm{STRmod}\mu})=2 β ( F 2 STRmod μ ) = 2 and that τ ( F 2 S T R m o d μ ) = 2 \tau(F_{2\mathrm{STRmod}\mu})=2 τ ( F 2 STRmod μ ) = 2 . The basis-pair transformation set function, T F 2 S T R m o d μ \mathcal{T}_{F_{2\mathrm{STRmod}\mu}} T F 2 STRmod μ , takes any two ordered pairs of distinct points, b o b j \mathbf{b}_{\mathrm{obj}} b obj and b i m g \mathbf{b}_{\mathrm{img}} b img , and computes the transformation parameter vectors of the transformations in F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that map b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img . Let us suppose that b o b j = ⟨ p 1 , p 2 ⟩ \mathbf{b}_{\mathrm{obj}}=\langle p_1,p_2\rangle b obj = ⟨ p 1 , p 2 ⟩ and that b i m g = ⟨ q 1 , q 2 ⟩ \mathbf{b}_{\mathrm{img}}=\langle q_1,q_2\rangle b img = ⟨ q 1 , q 2 ⟩ . If σ ∈ T F 2 S T R m o d μ ( b o b j , b i m g ) \sigma\in\mathcal{T}_{F_{2\mathrm{STRmod}\mu}}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}}) σ ∈ T F 2 STRmod μ ( b obj , b img ) , then we know from (41) that
q 1 [ 0 ] = p 1 [ 0 ] σ [ 0 ] + σ [ 1 ] , (42) q_1[0]=p_1[0]\sigma[0]+\sigma[1], \tag*{(42)} q 1 [ 0 ] = p 1 [ 0 ] σ [ 0 ] + σ [ 1 ] , (42)
q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] , (43) q_2[0]=p_2[0]\sigma[0]+\sigma[1], \tag*{(43)} q 2 [ 0 ] = p 2 [ 0 ] σ [ 0 ] + σ [ 1 ] , (43)
q 1 [ 1 ] = ( σ [ 3 ] ( p 1 [ 1 ] + σ [ 2 ] ) ) m o d μ , (44) q_1[1]=(\sigma[3](p_1[1]+\sigma[2]))\bmod\mu, \tag*{(44)} q 1 [ 1 ] = ( σ [ 3 ] ( p 1 [ 1 ] + σ [ 2 ])) mod μ , (44)
q 2 [ 1 ] = ( σ [ 3 ] ( p 2 [ 1 ] + σ [ 2 ] ) ) m o d μ . (45) q_2[1]=(\sigma[3](p_2[1]+\sigma[2]))\bmod\mu. \tag*{(45)} q 2 [ 1 ] = ( σ [ 3 ] ( p 2 [ 1 ] + σ [ 2 ])) mod μ . (45)
We know that σ [ 3 ] \sigma[3] σ [ 3 ] is equal to either 1 1 1 or − 1 -1 − 1 . Let us first consider the case where σ [ 3 ] = 1 \sigma[3]=1 σ [ 3 ] = 1 . In this case,
( 47 ) ⇒ σ [ 2 ] = ( q 1 [ 1 ] − p 1 [ 1 ] ) m o d μ , and (46) (47)\Rightarrow\sigma[2]=(q_1[1]-p_1[1])\bmod\mu,\text{ and} \tag*{(46)} ( 47 ) ⇒ σ [ 2 ] = ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ , and (46)
( 48 ) ⇒ σ [ 2 ] = ( q 2 [ 1 ] − p 2 [ 1 ] ) m o d μ . (47) (48)\Rightarrow\sigma[2]=(q_2[1]-p_2[1])\bmod\mu. \tag*{(47)} ( 48 ) ⇒ σ [ 2 ] = ( q 2 [ 1 ] − p 2 [ 1 ]) mod μ . (47)
Equations (49) and (50) together imply that, in order for there to be a transformation in F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that maps b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img when σ [ 3 ] = 1 \sigma[3]=1 σ [ 3 ] = 1 , it must be true that
( q 1 [ 1 ] − p 1 [ 1 ] ) m o d μ = ( q 2 [ 1 ] − p 2 [ 1 ] ) m o d μ . (48) (q_1[1]-p_1[1])\bmod\mu=(q_2[1]-p_2[1])\bmod\mu. \tag*{(48)} ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ = ( q 2 [ 1 ] − p 2 [ 1 ]) mod μ . (48)
Figure 12 shows an example of two ordered pairs of points that do not satisfy (51) when μ = 7 \mu=7 μ = 7 . There is therefore no transformation in F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that maps ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ in this figure.
Figure 12. There is no transformation in F 2 S T R m o d 7 F_{2\mathrm{STRmod}7} F 2 STRmod 7 that maps ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ because condition (51) is not satisfied.
Equations (45) and (46) together imply that
q 1 [ 0 ] = p 1 [ 0 ] σ [ 0 ] + q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] = σ [ 0 ] ( p 1 [ 0 ] − p 2 [ 0 ] ) + q 2 [ 0 ] ⇒ σ [ 0 ] = q 1 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] − p 2 [ 0 ] . (49) \begin{aligned}
q_1[0]&=p_1[0]\sigma[0]+q_2[0]-p_2[0]\sigma[0]\\
&=\sigma[0](p_1[0]-p_2[0])+q_2[0]\\
\Rightarrow\sigma[0]&=\frac{q_1[0]-q_2[0]}{p_1[0]-p_2[0]}. \tag*{(49)}
\end{aligned} q 1 [ 0 ] ⇒ σ [ 0 ] = p 1 [ 0 ] σ [ 0 ] + q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] = σ [ 0 ] ( p 1 [ 0 ] − p 2 [ 0 ]) + q 2 [ 0 ] = p 1 [ 0 ] − p 2 [ 0 ] q 1 [ 0 ] − q 2 [ 0 ] . (49)
Equation (52) implies that σ [ 0 ] = 0 \sigma[0]=0 σ [ 0 ] = 0 when q 1 [ 0 ] = q 2 [ 0 ] q_1[0]=q_2[0] q 1 [ 0 ] = q 2 [ 0 ] , unless p 1 [ 0 ] = p 2 [ 0 ] p_1[0]=p_2[0] p 1 [ 0 ] = p 2 [ 0 ] , in which case the right-hand side of (52) evaluates to 0 0 \frac{0}{0} 0 0 , which is undefined. However, as with F 2 S T F_{2\mathrm{ST}} F 2 ST and F 2 S T R F_{2\mathrm{STR}} F 2 STR , we define that, in this case, σ [ 0 ] \sigma[0] σ [ 0 ] should be set to 1, as this allows us to intuitively discover that, if q 2 [ 0 ] = q 1 [ 0 ] q_2[0]=q_1[0] q 2 [ 0 ] = q 1 [ 0 ] and p 2 [ 0 ] = p 1 [ 0 ] p_2[0]=p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and condition (51) holds, then b o b j \mathbf{b}_{\mathrm{obj}} b obj can be mapped onto b i m g \mathbf{b}_{\mathrm{img}} b img by a simple translation (i.e., no scaling or reflection required). Figure 13 shows an example of where σ [ 0 ] \sigma[0] σ [ 0 ] is set to 1 because the right-hand side of (52) evaluates to 0 0 \frac{0}{0} 0 0 . Clearly, if p 2 [ 0 ] = p 1 [ 0 ] p_2[0]=p_1[0] p 2 [ 0 ] = p 1 [ 0 ] when q 2 [ 0 ] ≠ q 1 [ 0 ] q_2[0]\ne q_1[0] q 2 [ 0 ] = q 1 [ 0 ] , then σ [ 0 ] \sigma[0] σ [ 0 ] is undefined.
Figure 13. In this case, q 1 [ 0 ] − q 2 [ 0 ] p 1 [ 0 ] − p 2 [ 0 ] \frac{q_1[0]-q_2[0]}{p_1[0]-p_2[0]} p 1 [ 0 ] − p 2 [ 0 ] q 1 [ 0 ] − q 2 [ 0 ] evaluates to 0 0 \frac{0}{0} 0 0 , so σ [ 0 ] \sigma[0] σ [ 0 ] is set to 1. The only transformation in F 2 S T R m o d 7 F_{2\mathrm{STRmod7}} F 2 STRmod7 that maps ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ onto ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ is that with the transformation parameter vector, ⟨ 1 , 4 , 2 , 1 ⟩ \langle1,4,2,1\rangle ⟨ 1 , 4 , 2 , 1 ⟩ .
Equation (45) implies that
σ [ 1 ] = q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] , (50) \sigma[1] = q_1[0] - p_1[0]\sigma[0], \tag*{(50)} σ [ 1 ] = q 1 [ 0 ] − p 1 [ 0 ] σ [ 0 ] , (50)
and from (46), it follows that
σ [ 1 ] = q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] . (51) \sigma[1] = q_2[0] - p_2[0]\sigma[0]. \tag*{(51)} σ [ 1 ] = q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] . (51)
It was shown above (see (33) and (34) on page 18) that the right-hand side of (53) is always equal to the right-hand side of (54). Thus, when σ [ 0 ] \sigma[0] σ [ 0 ] is undefined (i.e., when p 2 [ 0 ] = p 1 [ 0 ] p_2[0] = p_1[0] p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] q_2[0] \ne q_1[0] q 2 [ 0 ] = q 1 [ 0 ] ), σ [ 1 ] \sigma[1] σ [ 1 ] is also undefined.
To summarise the results so far, if σ [ 3 ] = 1 \sigma[3] = 1 σ [ 3 ] = 1 , then
σ = ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( q 1 [ 1 ] − p 1 [ 1 ] ) mod μ , 1 ⟩ , (52) \sigma= \langle\sigma[0],q_2[0]-p_2[0]\sigma[0],(q_1[1]-p_1[1]) \mathbin{\operatorname{mod}} \mu,1\rangle, \tag*{(52)} σ = ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ , 1 ⟩ , (52)
where
( q 1 [ 1 ] − p 1 [ 1 ] ) mod μ = ( q 2 [ 1 ] − p 2 [ 1 ] ) mod μ , (q_1[1]-p_1[1]) \mathbin{\operatorname{mod}} \mu= (q_2[1]-p_2[1]) \mathbin{\operatorname{mod}} \mu, ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ = ( q 2 [ 1 ] − p 2 [ 1 ]) mod μ ,
and where
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] . \sigma[0] =
\begin{cases}
1, & \text{if } p_2[0] = p_1[0] \text{ and } q_2[0] = q_1[0]; \text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that } p_2[0] \ne p_1[0].
\end{cases} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] .
Let us now consider the case where σ [ 3 ] = − 1 \sigma[3] = -1 σ [ 3 ] = − 1 . In this case, σ [ 0 ] \sigma[0] σ [ 0 ] and σ [ 1 ] \sigma[1] σ [ 1 ] are still given by (52) and (53), respectively, since they do not depend on σ [ 3 ] \sigma[3] σ [ 3 ] .
From (47) and (48) we conclude that
( 47 ) ⇒ σ [ 2 ] = ( − p 1 [ 1 ] − q 1 [ 1 ] ) mod μ (53) (47) \Rightarrow\sigma[2] = (-p_1[1]-q_1[1]) \mathbin{\operatorname{mod}} \mu \tag*{(53)} ( 47 ) ⇒ σ [ 2 ] = ( − p 1 [ 1 ] − q 1 [ 1 ]) mod μ (53)
( 48 ) ⇒ σ [ 2 ] = ( − p 2 [ 1 ] − q 2 [ 1 ] ) mod μ (54) (48) \Rightarrow\sigma[2] = (-p_2[1]-q_2[1]) \mathbin{\operatorname{mod}} \mu \tag*{(54)} ( 48 ) ⇒ σ [ 2 ] = ( − p 2 [ 1 ] − q 2 [ 1 ]) mod μ (54)
and that, therefore, in order for there to be a transformation that maps b o b j \mathbf{b}_{\mathrm{obj}} b obj onto b i m g \mathbf{b}_{\mathrm{img}} b img when σ [ 3 ] = − 1 \sigma[3] = -1 σ [ 3 ] = − 1 , it must be true (from Lemma 1) that
( p 1 [ 1 ] + q 1 [ 1 ] ) mod μ = ( p 2 [ 1 ] + q 2 [ 1 ] ) mod μ . (55) (p_1[1] + q_1[1]) \mathbin{\operatorname{mod}} \mu= (p_2[1] + q_2[1]) \mathbin{\operatorname{mod}} \mu. \tag*{(55)} ( p 1 [ 1 ] + q 1 [ 1 ]) mod μ = ( p 2 [ 1 ] + q 2 [ 1 ]) mod μ . (55)
To summarise, we can define the basis-pair transformation set function, T F 2 S T R m o d μ \mathcal{T}_{F_{2\mathrm{STRmod}\mu}} T F 2 STRmod μ , as follows:
T F 2 S T R m o d μ ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( q 1 [ 1 ] − p 1 [ 1 ] ) mod μ , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( − p 1 [ 1 ] − q 1 [ 1 ] ) mod μ , − 1 ⟩ } (56) \mathcal{T}_{F_{2\mathrm{STRmod}\mu}}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle) =
\left\{
\begin{aligned}
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],(q_1[1]-p_1[1])\mathbin{\operatorname{mod}}\mu,1\rangle,\\
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],(-p_1[1]-q_1[1])\mathbin{\operatorname{mod}}\mu,-1\rangle
\end{aligned}
\right\} \tag*{(56)} T F 2 STRmod μ (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( − p 1 [ 1 ] − q 1 [ 1 ]) mod μ , − 1 ⟩ } (56)
where
( q 1 [ 1 ] − p 1 [ 1 ] ) mod μ = ( q 2 [ 1 ] − p 2 [ 1 ] ) mod μ when σ [ 3 ] = 1 , (57) (q_1[1]-p_1[1])\mathbin{\operatorname{mod}}\mu=(q_2[1]-p_2[1])\mathbin{\operatorname{mod}}\mu\ \text{when }\sigma[3]=1, \tag*{(57)} ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ = ( q 2 [ 1 ] − p 2 [ 1 ]) mod μ when σ [ 3 ] = 1 , (57)
and
( p 1 [ 1 ] + q 1 [ 1 ] ) mod μ = ( p 2 [ 1 ] + q 2 [ 1 ] ) mod μ when σ [ 3 ] = − 1 , (58) (p_1[1]+q_1[1])\mathbin{\operatorname{mod}}\mu=(p_2[1]+q_2[1])\mathbin{\operatorname{mod}}\mu\ \text{when }\sigma[3]=-1, \tag*{(58)} ( p 1 [ 1 ] + q 1 [ 1 ]) mod μ = ( p 2 [ 1 ] + q 2 [ 1 ]) mod μ when σ [ 3 ] = − 1 , (58)
and
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] . (59) \sigma[0]=
\begin{cases}
1, & \text{if }p_2[0]=p_1[0]\text{ and }q_2[0]=q_1[0];\text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that }p_2[0]\ne p_1[0].
\end{cases} \tag*{(59)} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] . (59)
Conditions (60) and (61) are true if and only if p 1 [ 1 ] = p 2 [ 1 ] p_1[1]=p_2[1] p 1 [ 1 ] = p 2 [ 1 ] —recall that, in the context of F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ we assume that all points are in R × R μ \mathbb{R}\times\mathbb{R}_\mu R × R μ . Therefore
∣ T F 2 S T R m o d μ ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) ∣ = τ ( F 2 S T R m o d μ ) = 2 \left|T_{F_{2\mathrm{STRmod}\mu}}\left(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle\right)\right|=\tau\left(F_{2\mathrm{STRmod}\mu}\right)=2 T F 2 STRmod μ ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = τ ( F 2 STRmod μ ) = 2
if and only if p 1 [ 1 ] = p 2 [ 1 ] p_1[1]=p_2[1] p 1 [ 1 ] = p 2 [ 1 ] and the other conditions above are satisfied.
F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ is therefore a transformation class. The basis-pair transformation set function, T F 2 S T R m o d μ T_{F_{2\mathrm{STRmod}\mu}} T F 2 STRmod μ , can be computed using the algorithm shown in Figure 14 .
Figure 14. Algorithm for computing the basis-pair transformation set function for F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ .
Matches and occurrences
In this section, we begin by defining the concepts of a complete match and a complete occurrence. We then introduce the notions of maximal match and maximal pattern. We then prove some results relating to the important case where maximal matches and patterns are for transformations that are bijections. Finally, we note the relationship between maximal patterns and partial symmetries.
Complete matches and occurrences
We define the terms, match and occurrence as follows.
Definition 3 (Match). Given two, non-empty, finite point sets, P , Q ⊂ R k P,Q\subset\mathbb{R}^k P , Q ⊂ R k , and a k k k -dimensional transformation, f f f , we define that Q Q Q is a match or complete exact match of P P P under the transformation, f f f , if and only if Q = f ( P ) Q=f(P) Q = f ( P ) . Furthermore, if F F F is a k k k -dimensional transformation class, then we can say that Q Q Q is a match or complete exact match of P P P with respect to F F F , if and only if there exists a transformation, f ∈ F f\in F f ∈ F , such that Q = f ( P ) Q=f(P) Q = f ( P ) .
Definition 4 (Occurrence). Given two, non-empty, finite point sets, P , Q ⊂ R k P,Q\subset\mathbb{R}^k P , Q ⊂ R k , and a k k k -dimensional transformation, f f f , we say that P P P occurs in or occurs completely and exactly in Q Q Q under the transformation, f f f , if and only if f ( P ) ⊆ Q f(P)\subseteq Q f ( P ) ⊆ Q . In this case, f ( P ) f(P) f ( P ) is an occurrence or a complete exact occurrence of P P P in Q Q Q under the transformation, f f f . Furthermore, if F F F is a k k k -dimensional transformation class, then we say that P P P occurs in or occurs completely and exactly in Q Q Q with respect to F F F , if and only if there exists a transformation, g ∈ F g\in F g ∈ F , such that g ( P ) ⊆ Q g(P)\subseteq Q g ( P ) ⊆ Q . In this case, g ( P ) g(P) g ( P ) is an occurrence or a complete exact occurrence of P P P in Q Q Q with respect to F F F .
Note that, in Definition 4, P P P does not necessarily need to be a subset of Q Q Q in order for P P P to occur in Q Q Q . For example, the point set in Figure 15 (a) occurs twice in the point set in Figure 15 (b) under translations, but it is not a subset of the point set in Figure 15 (b).
Note that we use the term “match” when we compare two whole point sets (typically called “patterns”) with each other, whereas we use the term “occurrence” when we are interested in whether one point set (which we would typically call a “pattern”) appears within (i.e., as part of) some other point set (typically called a “dataset”) under some transformation. For example, if we refer to the point set in Figure 15 (a) as P P P and the point set in Figure 15 (b) as Q Q Q , then we might say that the red pattern in Q Q Q is a match of P P P under the transformation, T ⟨ 1 , 1 ⟩ T_{\langle1,1\rangle} T ⟨ 1 , 1 ⟩ , and that it is an occurrence of P P P in Q Q Q , with respect to the transformation class, F 2 T F_{2\mathrm{T}} F 2 T .
Maximal matches and maximal patterns
In Definitions 3 and 4, we consider only complete, exact matches and occurrences of a pattern. We may also be interested in cases where only part of a pattern occurs in a dataset under some transformation. We therefore define the concepts of a maximal match and a maximal pattern as follows.
Definition 5 (Maximal match for a transformation). Given two point sets, P , Q ⊂ R k P,Q \subset\mathbb{R}^{k} P , Q ⊂ R k , and a k k k -dimensional transformation, f f f , we define the maximal match of P P P in Q Q Q for f f f to be f ( P ) ∩ Q f(P) \cap Q f ( P ) ∩ Q , and we denote it by M max ( P , Q , f ) M_{\max}(P,Q,f) M m a x ( P , Q , f ) . In the case where the two point sets, P P P and Q Q Q , are the same, so that P = Q = D P = Q = D P = Q = D , then we define that M max ( D , D , f ) = M max ( D , f ) = f ( D ) ∩ D M_{\max}(D,D,f) = M_{\max}(D,f) = f(D) \cap D M m a x ( D , D , f ) = M m a x ( D , f ) = f ( D ) ∩ D . In this case, we can say that M max ( D , f ) M_{\max}(D,f) M m a x ( D , f ) is the maximal match in D D D for the transformation, f f f .
Definition 6 (Maximal pattern for a transformation). Given two point sets, P , Q ⊂ R k P,Q \subset\mathbb{R}^{k} P , Q ⊂ R k , and a k k k -dimensional transformation, f f f , we define the maximal pattern in P P P for Q Q Q and f f f to be the set of points, { p ∈ P : f ( p ) ∈ Q } \{p \in P : f(p) \in Q\} { p ∈ P : f ( p ) ∈ Q } , and we denote it by P max ( P , Q , f ) P_{\max}(P,Q,f) P m a x ( P , Q , f ) . In the case where the two point sets, P P P and Q Q Q , are the same, so that P = Q = D P = Q = D P = Q = D , we define that P max ( D , D , f ) = P max ( D , f ) = { p ∈ D : f ( p ) ∈ D } P_{\max}(D,D,f) = P_{\max}(D,f) = \{p \in D : f(p) \in D\} P m a x ( D , D , f ) = P m a x ( D , f ) = { p ∈ D : f ( p ) ∈ D } . In this case, we say that P max ( D , f ) P_{\max}(D,f) P m a x ( D , f ) is the maximal pattern in D D D for the transformation f f f . We also say that the transformation, f f f , occurs in D D D if and only if P max ( D , f ) ≠ ∅ P_{\max}(D,f) \ne\emptyset P m a x ( D , f ) = ∅ .
Definition 5 therefore defines the maximal match of a pattern, P P P , in another pattern, Q Q Q , for a transformation, f f f , to be the set of points in Q Q Q that are images of points in P P P under the transformation, f f f . It also defines that the maximal match in a dataset, D D D , for a transformation, f f f , is the image of the set of points in D D D that are mapped onto points in D D D by the transformation, f f f .
Definition 6 defines that the maximal pattern in a pattern, P P P , for another pattern, Q Q Q , and a transformation, f f f , is the set of points in P P P that are mapped by f f f onto points in Q Q Q .
It also defines that the maximal pattern in a dataset, D D D , for a transformation, f f f , is the set of points in D D D that are mapped by f f f onto points in D D D .
For example, if we set P P P to equal the point set in Figure 15 (a) and we set Q Q Q to be the point set in Figure 15 (b), then M max ( P , Q , T ⟨ − 1 , − 9 ⟩ R x ) M_{\max}(P,Q,T_{\langle-1,-9\rangle}R_x) M m a x ( P , Q , T ⟨ − 1 , − 9 ⟩ R x ) is equal to the set of green points (●) in Figure 15 (b), and P max ( P , Q , T ⟨ − 1 , − 9 ⟩ R x ) P_{\max}(P,Q,T_{\langle-1,-9\rangle}R_x) P m a x ( P , Q , T ⟨ − 1 , − 9 ⟩ R x ) is equal to the set of green points in Figure 15 (a). As examples of cases where the two point sets are the same, M max ( Q , T ⟨ 3 , 3 ⟩ ) M_{\max}(Q,T_{\langle3,3\rangle}) M m a x ( Q , T ⟨ 3 , 3 ⟩ ) is equal to the set of blue points in Figure 15 (b), whereas P max ( Q , T ⟨ 3 , 3 ⟩ ) P_{\max}(Q,T_{\langle3,3\rangle}) P m a x ( Q , T ⟨ 3 , 3 ⟩ ) is equal to the set of red points in Figure 15 (b). As another example, M max ( Q , T ⟨ − 2 , − 10 ⟩ R x ) M_{\max}(Q,T_{\langle-2,-10\rangle}R_x) M m a x ( Q , T ⟨ − 2 , − 10 ⟩ R x ) is equal to the set containing the green points in Figure 15 (b) together with the red point, ⟨ 3 , 5 ⟩ \langle3,5\rangle ⟨ 3 , 5 ⟩ ; whereas P max ( Q , T ⟨ − 2 , − 10 ⟩ R x ) = { ⟨ 2 , 2 ⟩ , ⟨ 2 , 4 ⟩ , ⟨ 3 , 5 ⟩ , ⟨ 5 , 4 ⟩ , ⟨ 5 , 5 ⟩ } P_{\max}(Q,T_{\langle-2,-10\rangle}R_x)=\{\langle2,2\rangle,\langle2,4\rangle,\langle3,5\rangle,\langle5,4\rangle,\langle5,5\rangle\} P m a x ( Q , T ⟨ − 2 , − 10 ⟩ R x ) = {⟨ 2 , 2 ⟩ , ⟨ 2 , 4 ⟩ , ⟨ 3 , 5 ⟩ , ⟨ 5 , 4 ⟩ , ⟨ 5 , 5 ⟩} .
We now present a lemma that characterises the relationship between a maximal pattern and a maximal match.
Lemma 2. If P , Q , D ⊂ R k P,Q,D\subset\mathbb{R}^{k} P , Q , D ⊂ R k , and f f f is a k k k -dimensional transformation, then
f ( P max ( P , Q , f ) ) = M max ( P , Q , f ) (60) f(P_{\max}(P,Q,f))=M_{\max}(P,Q,f) \tag*{(60)} f ( P m a x ( P , Q , f )) = M m a x ( P , Q , f ) (60) and
f ( P max ( D , f ) ) = M max ( D , f ) . (61) f(P_{\max}(D,f))=M_{\max}(D,f). \tag*{(61)} f ( P m a x ( D , f )) = M m a x ( D , f ) . (61)
Proof. P max ( P , Q , f ) P_{\max}(P,Q,f) P m a x ( P , Q , f ) is defined in Definition 6 to be equal to { p ∈ P : f ( p ) ∈ Q } \{p\in P:f(p)\in Q\} { p ∈ P : f ( p ) ∈ Q } . That is, P max ( P , Q , f ) P_{\max}(P,Q,f) P m a x ( P , Q , f ) contains all the points in P P P that are mapped onto points in Q Q Q by f f f . Therefore, if we transform P max ( P , Q , f ) P_{\max}(P,Q,f) P m a x ( P , Q , f ) by f f f , we obtain the set of all points in Q Q Q that are images of points in P P P under f f f —that is, the set f ( P ) ∩ Q f(P)\cap Q f ( P ) ∩ Q . By Definition 5, f ( P ) ∩ Q = M max ( P , Q , f ) f(P)\cap Q=M_{\max}(P,Q,f) f ( P ) ∩ Q = M m a x ( P , Q , f ) , from which (63) follows directly. If we set P = Q = D P=Q=D P = Q = D , then (64) follows directly from (63) and Definitions 5 and 6. ◻
Note that Lemma 2 holds for any k k k -dimensional transformation, f f f , even one that is not a bijection (i.e., does not have a unique inverse). For example, if we set P P P to be the point set in Figure 16 (a), Q Q Q to be the point set in Figure 16 (b), and f f f to be the transformation, S 0 T ⟨ 3 , 0 ⟩ S_{0}T_{\langle3,0\rangle} S 0 T ⟨ 3 , 0 ⟩ , then P max ( P , Q , f ) P_{\max}(P,Q,f) P m a x ( P , Q , f ) is equal to the set of points in Figure 16 (a) indicated by open circles (○). When this set of points is transformed by S 0 , T ⟨ 3 , 0 ⟩ S_{0},T_{\langle3,0\rangle} S 0 , T ⟨ 3 , 0 ⟩ , we obtain the set of points marked with crosses in Figure 16 (b), which is equal to M max ( P , Q , f ) M_{\max}(P,Q,f) M m a x ( P , Q , f ) .
Figure 16. Illustration that Lemma 2 holds even for transformations that are not bijections. The set of points marked with crosses in (b) form the maximal match of the pattern in (a) under the transformation S 0 T ⟨ 3 , 0 ⟩ S_{0}T_{\langle3,0\rangle} S 0 T ⟨ 3 , 0 ⟩ which has no unique inverse and is therefore not a bijection. The set of points marked with open circles in (a) are mapped onto the set of crosses in (b) by S 0 T ⟨ 3 , 0 ⟩ S_{0}T_{\langle3,0\rangle} S 0 T ⟨ 3 , 0 ⟩ and form the maximal pattern in (a) for (b) and this non-bijective transformation.
Definitions 5 and 6 define the concepts of a maximal match and a maximal pattern, respectively, for a specific transformation. We now define the concepts of a maximal match and a maximal pattern with respect to a transformation class.
Definition 7 (Maximal match with respect to a transformation class). Let P , Q ⊂ R k P,Q\subset\mathbb{R}^{k} P , Q ⊂ R k and let F F F be a k k k -dimensional transformation class. We define that S S S is a maximal match of P P P in Q Q Q with respect to F F F , if and only if there exists a transformation, f ∈ F f\in F f ∈ F , such that S = f ( P ) ∩ Q S=f(P)\cap Q S = f ( P ) ∩ Q . If P = Q = D P=Q=D P = Q = D , then we can say that S S S is a maximal match in D D D with respect to F F F , if and only if there exists a transformation, f ∈ F f\in F f ∈ F , such that S = f ( D ) ∩ D S=f(D)\cap D S = f ( D ) ∩ D . If ∣ S ∣ ≥ β ( F ) \lvert S\rvert\ge\beta(F) ∣ S ∣ ≥ β ( F ) , then we say that S S S is a non-trivial maximal match with respect to F F F ; otherwise, S S S is a trivial maximal match with respect to F F F .
Definition 8 (Maximal pattern with respect to a transformation class). Let P , Q ⊂ R k P,Q \subset\mathbb{R}^{k} P , Q ⊂ R k and let F F F be a k k k -dimensional transformation class. We define that S S S is a maximal pattern in P P P for Q Q Q with respect to F F F , if and only if there exists a transformation, f ∈ F f \in F f ∈ F , such that f ( S ) = f ( P ) ∩ Q f(S)=f(P)\cap Q f ( S ) = f ( P ) ∩ Q . If P = Q = D P=Q=D P = Q = D , then we can say that S S S is a maximal pattern in D D D with respect to F F F , if and only if there exists a transformation, f ∈ F f \in F f ∈ F , such that f ( S ) = f ( D ) ∩ D f(S)=f(D)\cap D f ( S ) = f ( D ) ∩ D . If ∣ S ∣ ≥ β ( F ) |S|\geq\beta(F) ∣ S ∣ ≥ β ( F ) , then we say that S S S is a non-trivial maximal pattern with respect to F F F ; otherwise, S S S is a trivial maximal pattern with respect to F F F .
Note that we define that a maximal match or pattern is “trivial” if and only if its size is less than the basis size for the transformation class. This is because, by definition (see Def. 2), for any transformation class, there may be an infinite number of transformations that map any ordered set of m m m points onto another ordered set of m m m points, where m m m is less than the basis size of the transformation class.
Maximal matches and maximal patterns for bijections
If a transformation, f f f , is a bijection then we define its inverse , f − 1 f^{-1} f − 1 , as
f − 1 ( q ) = p ⟺ f ( p ) = q (62) f^{-1}(q)=p \Longleftrightarrow f(p)=q \tag*{(62)} f − 1 ( q ) = p ⟺ f ( p ) = q (62)
where p , q ∈ R k p,q\in\mathbb{R}^{k} p , q ∈ R k . It follows directly that
f ( f − 1 ( p ) ) = f − 1 ( f ( p ) ) = p . (63) f\left(f^{-1}(p)\right)=f^{-1}\left(f(p)\right)=p. \tag*{(63)} f ( f − 1 ( p ) ) = f − 1 ( f ( p ) ) = p . (63)
We now present a number of results pertaining to the relationship between maximal matches and maximal patterns, that hold for transformations that are bijections.
Lemma 3. If P , Q , D ⊂ R k P,Q,D \subset\mathbb{R}^{k} P , Q , D ⊂ R k , and f f f is a bijective k k k -dimensional transformation, then
P max ( P , Q , f ) = P ∩ f − 1 ( Q ) (64) \mathrm{P}_{\max}(P,Q,f)=P\cap f^{-1}(Q) \tag*{(64)} P m a x ( P , Q , f ) = P ∩ f − 1 ( Q ) (64) and
P max ( D , f ) = D ∩ f − 1 ( D ) . (65) \mathrm{P}_{\max}(D,f)=D\cap f^{-1}(D). \tag*{(65)} P m a x ( D , f ) = D ∩ f − 1 ( D ) . (65) Proof. From Lemma 2, we know that f ( P max ( P , Q , f ) ) = M max ( P , Q , f ) f(\mathrm{P}_{\max}(P,Q,f))=\mathrm{M}_{\max}(P,Q,f) f ( P m a x ( P , Q , f )) = M m a x ( P , Q , f ) and from Definition 5, we know that M max ( P , Q , f ) = f ( P ) ∩ Q \mathrm{M}_{\max}(P,Q,f)=f(P)\cap Q M m a x ( P , Q , f ) = f ( P ) ∩ Q . Therefore.
f ( P max ( P , Q , f ) ) = f ( P ) ∩ Q . (66) f(\mathrm{P}_{\max}(P,Q,f))=f(P)\cap Q. \tag*{(66)} f ( P m a x ( P , Q , f )) = f ( P ) ∩ Q . (66) Since f f f is a bijection, it follows that
P max ( P , Q , f ) = f − 1 ( f ( P max ( P , Q , f ) ) ) (from (66)) = f − 1 ( f ( P ) ∩ Q ) (from (69)) = P ∩ f − 1 ( Q ) . \begin{aligned}
\mathrm{P}_{\max}(P,Q,f)&=f^{-1}(f(\mathrm{P}_{\max}(P,Q,f))) &&\text{(from (66))}\\
&=f^{-1}(f(P)\cap Q) &&\text{(from (69))}\\
&=P\cap f^{-1}(Q).
\end{aligned} P m a x ( P , Q , f ) = f − 1 ( f ( P m a x ( P , Q , f ))) = f − 1 ( f ( P ) ∩ Q ) = P ∩ f − 1 ( Q ) . (from (66)) (from (69)) This proves (67). It follows directly that, if P = Q = D P=Q=D P = Q = D , then P max ( D , f ) = D ∩ f − 1 ( D ) \mathrm{P}_{\max}(D,f)=D\cap f^{-1}(D) P m a x ( D , f ) = D ∩ f − 1 ( D ) , which proves (68). □ \square □
Theorem 1. If P , Q , D ⊂ R k P,Q,D \subset\mathbb{R}^{k} P , Q , D ⊂ R k , and f f f is a bijective k k k -dimensional transformation, then
M max ( P , Q , f ) = f ( P max ( P , Q , f ) ) = f ( M max ( Q , P , f − 1 ) ) = P max ( Q , P , f − 1 ) (67) \mathrm{M}_{\max}(P,Q,f)=f(\mathrm{P}_{\max}(P,Q,f))=f(\mathrm{M}_{\max}(Q,P,f^{-1}))=\mathrm{P}_{\max}(Q,P,f^{-1}) \tag*{(67)} M m a x ( P , Q , f ) = f ( P m a x ( P , Q , f )) = f ( M m a x ( Q , P , f − 1 )) = P m a x ( Q , P , f − 1 ) (67) and
M max ( D , f ) = f ( P max ( D , f ) ) = f ( M max ( D , f − 1 ) ) = P max ( D , f − 1 ) . (68) \mathrm{M}_{\max}(D,f)=f(\mathrm{P}_{\max}(D,f))=f(\mathrm{M}_{\max}(D,f^{-1}))=\mathrm{P}_{\max}(D,f^{-1}). \tag*{(68)} M m a x ( D , f ) = f ( P m a x ( D , f )) = f ( M m a x ( D , f − 1 )) = P m a x ( D , f − 1 ) . (68) Proof. From Lemma 2, we know that
M max ( P , Q , f ) = f ( P max ( P , Q , f ) ) . \mathrm{M}_{\max}(P,Q,f)=f(\mathrm{P}_{\max}(P,Q,f)). M m a x ( P , Q , f ) = f ( P m a x ( P , Q , f )) . From Lemma 3, we know that
P max ( P , Q , f ) = P ∩ f − 1 ( Q ) , \mathrm{P}_{\max}(P,Q,f)=P\cap f^{-1}(Q), P m a x ( P , Q , f ) = P ∩ f − 1 ( Q ) , which implies, from Definition 5, that
P max ( P , Q , f ) = M max ( Q , P , f − 1 ) . \mathrm{P}_{\max}(P,Q,f)=\mathrm{M}_{\max}(Q,P,f^{-1}). P m a x ( P , Q , f ) = M m a x ( Q , P , f − 1 ) . It follows that
f ( P max ( P , Q , f ) ) = f ( M max ( Q , P , f − 1 ) ) . f(\mathrm{P}_{\max}(P,Q,f))=f(\mathrm{M}_{\max}(Q,P,f^{-1})). f ( P m a x ( P , Q , f )) = f ( M m a x ( Q , P , f − 1 )) .
From Lemma 2 we know that
f − 1 ( P max ( Q , P , f − 1 ) ) = M max ( Q , P , f − 1 ) . f^{-1}\left(P_{\max}(Q,P,f^{-1})\right)=M_{\max}(Q,P,f^{-1}). f − 1 ( P m a x ( Q , P , f − 1 ) ) = M m a x ( Q , P , f − 1 ) .
Therefore
f ( f − 1 ( P max ( Q , P , f − 1 ) ) ) = f ( M max ( Q , P , f − 1 ) ) , f\left(f^{-1}\left(P_{\max}(Q,P,f^{-1})\right)\right)=f\left(M_{\max}(Q,P,f^{-1})\right), f ( f − 1 ( P m a x ( Q , P , f − 1 ) ) ) = f ( M m a x ( Q , P , f − 1 ) ) ,
which implies, by (63) , that
P max ( Q , P , f − 1 ) = f ( M max ( Q , P , f − 1 ) ) . P_{\max}(Q,P,f^{-1})=f\left(M_{\max}(Q,P,f^{-1})\right). P m a x ( Q , P , f − 1 ) = f ( M m a x ( Q , P , f − 1 ) ) .
Therefore,
M max ( P , Q , f ) = f ( P max ( P , Q , f ) ) = f ( M max ( Q , P , f − 1 ) ) = P max ( Q , P , f − 1 ) . M_{\max}(P,Q,f)=f\left(P_{\max}(P,Q,f)\right)=f\left(M_{\max}(Q,P,f^{-1})\right)=P_{\max}(Q,P,f^{-1}). M m a x ( P , Q , f ) = f ( P m a x ( P , Q , f ) ) = f ( M m a x ( Q , P , f − 1 ) ) = P m a x ( Q , P , f − 1 ) .
If P = Q = D P=Q=D P = Q = D , it follows directly that
M max ( D , f ) = f ( P max ( D , f ) ) = f ( M max ( D , f − 1 ) ) = P max ( D , f − 1 ) . M_{\max}(D,f)=f\left(P_{\max}(D,f)\right)=f\left(M_{\max}(D,f^{-1})\right)=P_{\max}(D,f^{-1}). M m a x ( D , f ) = f ( P m a x ( D , f ) ) = f ( M m a x ( D , f − 1 ) ) = P m a x ( D , f − 1 ) .
□ \square □
For example, suppose P P P is the set of points in Figure 17 (a) and Q Q Q is the set of points in Figure 17 (b). Let f f f be a translation by the vector, ⟨ 0 , 1 ⟩ \langle0,1\rangle ⟨ 0 , 1 ⟩ , so that f − 1 f^{-1} f − 1 is a translation by the vector, ⟨ 0 , − 1 ⟩ \langle0,-1\rangle ⟨ 0 , − 1 ⟩ . The maximal match of P P P in Q Q Q for f f f , M max ( P , Q , f ) M_{\max}(P,Q,f) M m a x ( P , Q , f ) , is the set of points indicated by open circles in Figure 17 (b), which is also equal to the maximal pattern in Q Q Q for P P P and f − 1 f^{-1} f − 1 . Also, the set of points indicated by crosses in Figure 17 (a) is the maximal pattern in P P P for Q Q Q and f f f , P max ( P , Q , f ) P_{\max}(P,Q,f) P m a x ( P , Q , f ) , which is equal to the maximal match of Q Q Q in P P P for f − 1 f^{-1} f − 1 . Note that, if we transform the set of points indicated by crosses in Figure 17 (a) by f f f , we obtain the set of points indicated by open circles in Figure 17 (b).
Figure 17. Two points sets illustrating Theorem 1. See main text for details.
Maximal patterns and partial symmetries
Maximal patterns correspond to partial symmetries. A geometric object is said to have a particular type of symmetry if there exists a transformation of the corresponding type (e.g., a reflection or a rotation) that maps the object onto itself. More generally, we can say that an object or set of k k k -dimensional points, D D D , is symmetrical (or invariant) with respect to some class of transformations, F F F , if there exists a transformation, f ∈ F f \in F f ∈ F , such that f ( D ) = D f(D) = D f ( D ) = D . In this case, we can say that f f f defines a total symmetry on D D D . More generally, a transformation, g ∈ F g \in F g ∈ F , defines a partial symmetry on D D D if and only if g ( D ) ∩ D ≠ ∅ g(D) \cap D \ne\varnothing g ( D ) ∩ D = ∅ and g ( D ) ≠ D g(D) \ne D g ( D ) = D . From Definition 6, it follows that a transformation f f f defines a partial symmetry on a point set, D D D , if and only if P max ( D , f ) ≠ ∅ P_{\max}(D,f) \ne\varnothing P m a x ( D , f ) = ∅ and P max ( D , f ) ≠ D P_{\max}(D,f) \ne D P m a x ( D , f ) = D . In other words, f f f defines a partial symmetry on D D D if and only if f f f occurs in D D D but f ( D ) f(D) f ( D ) is not equal to D D D . If P max ( D , f ) = D P_{\max}(D,f) = D P m a x ( D , f ) = D , then f f f defines a total symmetry on D D D .
Occurrence sets
Figure 3 shows 31 “occurrences” of the HAYDN theme in Ravel’s Menuet sur le nom d’Haydn , where the term, “occurrence” here is to be interpreted in its colloquial sense rather than in the precise sense of Definition 4. Each of the “occurrences” in Figure 3 is to be understood to be a “transformation” (again, in the colloquial sense) of the theme provided by Jules Écorcheville, editor of the Revue musicale mensuelle de la Société Internationale de Musique (RSIM), in which the piece was first published in 1910 [2 ] . Écorcheville’s theme is shown in Figure 18 . However, as discussed in [10 ] , it is not always easy to decide whether or not a given set of notes should be considered an “occurrence” of some given musical pattern.
Figure 3. A chromatic-pitch–onset (or CPO) representation of Ravel’s Menuet sur le nom d’Haydn . Each point represents a distinct untied note or sequence of tied notes in the score. The x x x -coordinate of a point gives the onset time of the corresponding note in tatums (in this case, quavers) and the y y y -coordinate gives the chromatic pitch of the note. The occurrences of the HAYDN theme identified in Figure 5 and Figure 7 of [10 ] are shown, labelled with the same numbers and letters and coloured using the same colours as in those figures. When a point occurs in two patterns, it is drawn twice with different diameters and colours so that its presence in both patterns is visible. Reproduced from [10 Fig. 8 on p. 11] .
Figure 18. Explanatory note on page 2 of the 15 January 1910 issue of the Revue musicale mensuelle de la Société Internationale de Musique , preceding the collection of six pieces constituting the “Hommage à Joseph Haydn”. Translated into English, the note reads as follows: “These pieces have been composed on the following theme ... in which the notes B, A, D have been supplied by German musical nomenclature, and the notes D and G have been obtained by applying the sequence of letters in the alphabet to the diatonic series of the musical scale.”
In this section, we continue our explication of the notions of a match and an occurrence by formalising the concept of an occurrence set and generalizing this concept to a heterogeneous occurrence set .
Occurrence sets
We define the concept of an occurrence set as follows.
Definition 9 (Occurrence set). Given a pattern, P ⊂ R k P \subset\mathbb{R}^{k} P ⊂ R k , a dataset, D ⊂ R k D \subset\mathbb{R}^{k} D ⊂ R k and a k k k -dimensional transformation class, F F F , we define the occurrence set of P P P in D D D with respect to F F F to be
OS ( P , D , F ) = { f ( P ) : f ( P ) ⊆ D ∧ f ∈ F } . (69) \operatorname{OS}(P,D,F) = \{f(P) : f(P) \subseteq D \land f \in F\}. \tag*{(69)} OS ( P , D , F ) = { f ( P ) : f ( P ) ⊆ D ∧ f ∈ F } . (69)
That is, the occurrence set of a pattern, P P P , in a dataset, D D D , with respect to a transformation class, F F F , contains all and only the occurrences (in the strict sense of Definition 4) of P P P in D D D with respect to F F F . Note that, in general, there may be more than one transformation in F F F that maps P P P onto a given occurrence of P P P in D D D . The cardinality of the occurrence set of P P P in D D D with respect to F F F will therefore always be less than or equal to the cardinality of the set of transformations in F F F that map P P P onto occurrences of P P P in D D D . Note also that P P P is not necessarily a subset of D D D .
Figure 19 shows a set of twenty, 2-dimensional points with four pentagonal shapes indicated in different colours. The red, green and blue shapes are occurrences of the black shape with respect to the transformation class F 2 S T R F_{2\mathrm{STR}} F 2 STR . The set of four shapes collectively form the occurrence set of the black shape in this point set with respect to F 2 S T R F_{2\mathrm{STR}} F 2 STR —i.e., there are no other occurrences of the black shape in this dataset with respect to F 2 S T R F_{2\mathrm{STR}} F 2 STR apart from the four indicated.
Figure 19. An example of an occurrence set. See main text for details.
An occurrence set, OS ( P , D , F ) \operatorname{OS}(P,D,F) OS ( P , D , F ) , can be precisely specified by providing an explicit listing of the points in P P P , along with a set, Ψ \Psi Ψ , of transformation parameter vectors, specifying, for each occurrence of P P P , a transformation in F F F that maps P P P onto that occurrence. We call such an encoding an ordered-pair encoding of an occurrence set, and we define it as follows.
Definition 10 (Ordered-pair encoding of an occurrence set). Given a pattern, P ⊂ R k P \subset\mathbb{R}^{k} P ⊂ R k , a dataset, D ⊂ R k D \subset\mathbb{R}^{k} D ⊂ R k , and a k k k -dimensional transformation class, F F F , then the ordered-pair encoding of the occurrence set, OS ( P , D , F ) \operatorname{OS}(P,D,F) OS ( P , D , F ) , is defined to be the unique ordered pair, ⟨ P , Ψ ⟩ \langle P,\Psi\rangle ⟨ P , Ψ ⟩ , that satisfies the following conditions:
Ψ ⊆ { σ : ϕ F ( σ , P ) ⊆ D } \Psi\subseteq\{\sigma: \phi_F(\sigma,P) \subseteq D\} Ψ ⊆ { σ : ϕ F ( σ , P ) ⊆ D } ,
∣ Ψ ∣ = ∣ OS ( P , D , F ) ∣ |\Psi| = |\operatorname{OS}(P,D,F)| ∣Ψ∣ = ∣ OS ( P , D , F ) ∣ ,
OS ( P , D , F ) = ⋃ σ ∈ Ψ { ϕ F ( σ , P ) } \operatorname{OS}(P,D,F) = \bigcup_{\sigma\in\Psi}\{\phi_F(\sigma,P)\} OS ( P , D , F ) = ⋃ σ ∈ Ψ { ϕ F ( σ , P )} , and
for each σ ∈ Ψ \sigma\in\Psi σ ∈ Ψ , there must not exist any transformation, f ∈ F f \in F f ∈ F , such that σ F ( f ) < σ \sigma_F(f) < \sigma σ F ( f ) < σ and f ( P ) = ϕ F ( σ , P ) f(P) = \phi_F(\sigma,P) f ( P ) = ϕ F ( σ , P ) .
Note that there can be more than one ordered pair, ⟨ P , Ψ ⟩ \langle P,\Psi\rangle ⟨ P , Ψ ⟩ , that satisfies the first three of the four conditions in Def. 10, since there can, in general, be more than one transformation in F F F that maps a given pattern onto a particular occurrence of that pattern. The fourth condition ensures that each transformation parameter vector in an ordered-pair encoding is the lexicographically least vector whose corresponding transformation maps P P P onto that particular occurrence. For example, the ordered-pair encoding of the occurrence set in Figure 19 would be
⟨ { ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩ } , { ⟨ − 2 , 13 , 0 , 1 ⟩ , ⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩ } ⟩ . (70) \left\langle
\{\langle1,1\rangle,\langle1,2\rangle,\langle2,3\rangle,\langle4,1\rangle,\langle4,2\rangle\},
\{\langle-2,13,0,1\rangle,\langle-1,5,-7,-1\rangle,\langle1,0,0,1\rangle,\langle2,3,-8,-1\rangle\}
\right\rangle. \tag*{(70)} ⟨ {⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩} , {⟨ − 2 , 13 , 0 , 1 ⟩ , ⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩} ⟩ . (70)
Typically, an ordered-pair encoding gives us a shorter description of the occurrence set than one would obtain by using an extensional encoding where each point in each occurrence is explicitly recorded. For example, such an extensional encoding of the occurrence set in Figure 19 would look like this:
{ { ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩ } , { ⟨ 1 , 5 ⟩ , ⟨ 1 , 6 ⟩ , ⟨ 3 , 4 ⟩ , ⟨ 4 , 5 ⟩ , ⟨ 4 , 6 ⟩ } , { ⟨ 5 , 1 ⟩ , ⟨ 5 , 2 ⟩ , ⟨ 9 , 3 ⟩ , ⟨ 11 , 1 ⟩ , ⟨ 11 , 2 ⟩ } , { ⟨ 5 , 6 ⟩ , ⟨ 5 , 7 ⟩ , ⟨ 7 , 5 ⟩ , ⟨ 11 , 6 ⟩ , ⟨ 11 , 7 ⟩ } } . (71) \begin{aligned}
\{\{&\langle1,1\rangle,\langle1,2\rangle,\langle2,3\rangle,\langle4,1\rangle,\langle4,2\rangle\},\\
&\{\langle1,5\rangle,\langle1,6\rangle,\langle3,4\rangle,\langle4,5\rangle,\langle4,6\rangle\},\\
&\{\langle5,1\rangle,\langle5,2\rangle,\langle9,3\rangle,\langle11,1\rangle,\langle11,2\rangle\},\\
&\{\langle5,6\rangle,\langle5,7\rangle,\langle7,5\rangle,\langle11,6\rangle,\langle11,7\rangle\}\}. \tag*{(71)}
\end{aligned} {{ ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩} , {⟨ 1 , 5 ⟩ , ⟨ 1 , 6 ⟩ , ⟨ 3 , 4 ⟩ , ⟨ 4 , 5 ⟩ , ⟨ 4 , 6 ⟩} , {⟨ 5 , 1 ⟩ , ⟨ 5 , 2 ⟩ , ⟨ 9 , 3 ⟩ , ⟨ 11 , 1 ⟩ , ⟨ 11 , 2 ⟩} , {⟨ 5 , 6 ⟩ , ⟨ 5 , 7 ⟩ , ⟨ 7 , 5 ⟩ , ⟨ 11 , 6 ⟩ , ⟨ 11 , 7 ⟩}} . (71)
More specifically, such an extensional description, in which each point in each occurrence is explicitly listed, requires k ∣ OS ( P , D , F ) ∣ × ∣ P ∣ k\lvert\operatorname{OS}(P,D,F)\rvert\times\lvert P\rvert k ∣ OS ( P , D , F )∣ × ∣ P ∣ real values to be recorded, where k k k is the dimensionality of the points in P P P and D D D —that is, P , D ⊂ R k P,D\subset\mathbb{R}^{k} P , D ⊂ R k . For example, the encoding in (74) requires 40 independent numerical values to be recorded. On the other hand, the ordered-pair encoding, ⟨ P , Ψ ⟩ \langle P,\Psi\rangle ⟨ P , Ψ ⟩ , only requires k ∣ P ∣ + λ ( F ) ∣ OS ( P , D , F ) ∣ k\lvert P\rvert+\lambda(F)\lvert\operatorname{OS}(P,D,F)\rvert k ∣ P ∣ + λ ( F ) ∣ OS ( P , D , F )∣ values to be recorded, where λ ( F ) \lambda(F) λ ( F ) is the parameter vector length of F F F . Thus, in (73) there are only 26 independent values. Typically, for the transformation classes considered in this paper, the ordered-pair encoding of an occurrence set is much shorter than its extensional description.
We define the covered set of an occurrence set as follows.
Definition 11 (Covered set of an occurrence set). If S S S is an occurrence set, then we define the covered set of S S S to be the point set,
COV ( S ) = ⋃ Q ∈ S Q . (72) \operatorname{COV}(S)=\bigcup_{Q\in S}Q. \tag*{(72)} COV ( S ) = Q ∈ S ⋃ Q . (72)
We also define the coverage of S S S to be the cardinality of its covered set, ∣ COV ( S ) ∣ \lvert\operatorname{COV}(S)\rvert ∣ COV ( S )∣ .
The covered set of an occurrence set, OS ( P , D , F ) \operatorname{OS}(P,D,F) OS ( P , D , F ) , can therefore be recovered from its ordered-pair encoding, ⟨ P , Ψ ⟩ \langle P,\Psi\rangle ⟨ P , Ψ ⟩ , by using the following equation:
COV ( ⟨ P , Ψ ⟩ ) = ⋃ σ ∈ Ψ ϕ F ( σ , P ) . (73) \operatorname{COV}(\langle P,\Psi\rangle)=\bigcup_{\sigma\in\Psi}\phi_F(\sigma,P). \tag*{(73)} COV (⟨ P , Ψ ⟩) = σ ∈ Ψ ⋃ ϕ F ( σ , P ) . (73)
The covered set of the occurrence set in Figure 19 is therefore the entire set of 20 points shown in the figure, since every point occurs within an occurrence of the black pattern. The coverage of this occurrence set is therefore 20.
As pointed out above, the number of independent numerical values that need to be recorded when using an ordered-pair encoding of an occurrence set is typically much less than the number of values required to provide an extensional description of the occurrence set in which each point in each occurrence is explicitly listed. In fact, the ordered-pair encoding also often turns out to be much shorter than an extensional description of the covered set of an occurrence set—that is, a simple listing of the points in the covered set. This provides the basis of a compression-based approach to music analysis (introduced in [7 , 8 ] ) in which we try to find the shortest description of a point set representing music (such as the one in Figure 3 ) that takes the form of a set of occurrence sets that collectively cover the point set, where each occurrence set is represented by its ordered-pair encoding. In order to do this, we therefore need a way of characterising how much compression can be obtained by representing an occurrence set by its ordered-pair encoding as opposed to extensionally listing the points that it covers. We therefore define the compression factor of an occurrence set as follows.
Definition 12 (Compression factor of an occurrence set). Given a pattern, P ⊂ R k P \subset\mathbb{R}^{k} P ⊂ R k , a dataset, D ⊂ R k D \subset\mathbb{R}^{k} D ⊂ R k and a k k k -dimensional transformation class, F F F , we define the compression factor of the occurrence set, OS ( P , D , F ) \operatorname{OS}(P,D,F) OS ( P , D , F ) , as follows:
CF ( OS ( P , D , F ) ) = k ∣ COV ( OS ( P , D , F ) ) ∣ k ∣ P ∣ + λ ( F ) ∣ OS ( P , D , F ) ∣ . (74) \operatorname{CF}(\operatorname{OS}(P,D,F)) = \frac{k\left|\operatorname{COV}(\operatorname{OS}(P,D,F))\right|}{k|P|+\lambda(F)|\operatorname{OS}(P,D,F)|}. \tag*{(74)} CF ( OS ( P , D , F )) = k ∣ P ∣ + λ ( F ) ∣ OS ( P , D , F ) ∣ k ∣ COV ( OS ( P , D , F )) ∣ . (74)
For example, the compression factor of the occurrence set in Figure 19 is 40 26 ≈ 1.54 \frac{40}{26} \approx1.54 26 40 ≈ 1.54 .
Given our interest in achieving short encodings of occurrence sets, it may seem inefficient to require that the set of transformation parameter vectors, Ψ \Psi Ψ , in an ordered-pair encoding must contain a transformation parameter vector for every occurrence of P P P in the occurrence set. Why do we not instead choose P P P to be one of the occurrences in the set, and then only provide parameter vectors for transformations that map this occurrence onto the other occurrences? This would reduce the number of real values in the encoding by λ ( F ) \lambda(F) λ ( F ) .
There are at least two reasons for this design choice. The first is that, in a pattern-matching setting, where we are interested in the occurrences of a query pattern, Q Q Q , in a dataset, D D D , it may be that Q Q Q itself is not a subset of D D D . In this case, if we required that the reference pattern in the ordered-pair encoding must be an occurrence in the occurrence set, then we would have to use one of the occurrences of Q Q Q in D D D rather than Q Q Q itself, which would result in Ψ \Psi Ψ failing to provide us with the transformations required to map the query pattern onto its occurrences—which is typically what we are most interested in. The second reason will be given in the next section, where we generalize the notion of an occurrence set to heterogeneous occurrence sets that are defined with respect to sets of transformation classes.
Heterogeneous occurrence sets
So far in this paper, we have assumed that we are only interested in matches and occurrences that are with respect to a single transformation class. But what if, in a particular context, it is more convenient to define the class of transformations that we are interested in as being the union of two or more transformation classes? In this case, we might want to find matches, occurrences and occurrence sets with respect to a set of transformation classes, F = { F 1 , F 2 , … , F ∣ F ∣ } \mathcal{F} = \{F_1,F_2,\ldots,F_{|\mathcal{F}|}\} F = { F 1 , F 2 , … , F ∣ F ∣ } .
We therefore define the concept of a heterogeneous occurrence set as follows.
Definition 13 (Heterogeneous occurrence set). Given a pattern , P ⊂ R k P \subset\mathbb{R}^k P ⊂ R k , a dataset , D ⊂ R k D \subset\mathbb{R}^k D ⊂ R k , and a set of k k k -dimensional transformation classes , F = { F 1 , F 2 , … , F ∣ F ∣ } \mathcal{F} = \{F_1,F_2,\ldots,F_{|\mathcal{F}|}\} F = { F 1 , F 2 , … , F ∣ F ∣ } , we define the heterogeneous occurrence set of P P P in $D with respect to F \mathcal{F} F to be
OS ( P , D , F ) = { f ( P ) : f ( P ) ⊆ D ∧ ( ∃ F ∈ F : f ∈ F ) } . (75) \operatorname{OS}(P,D,\mathcal{F}) = \{f(P) : f(P) \subseteq D \land(\exists F \in\mathcal{F} : f \in F)\}. \tag*{(75)} OS ( P , D , F ) = { f ( P ) : f ( P ) ⊆ D ∧ ( ∃ F ∈ F : f ∈ F )} . (75)
We allow ourselves to also use the term homogeneous occurrence set for an ordinary occurrence set that is defined with respect to a single transformation class (i.e., as defined in Def. 9), because, in this case, the transformations that transform the pattern onto its occurrences are “homogeneous” in the sense that they all come from the same transformation class. However, we only use the term “homogeneous occurrence set” when we want to contrast it with a heterogeneous occurrence set.
As explained in Section 5.1 above, an occurrence set with respect to a single transformation class, OS ( P , D , F ) \operatorname{OS}(P,D,F) OS ( P , D , F ) , can be encoded in a compact manner as an ordered pair, ⟨ P , Ψ ⟩ \langle P,\Psi\rangle ⟨ P , Ψ ⟩ , where Ψ \Psi Ψ is a set of transformation parameter vectors for a set of transformations in F F F that map P P P onto its occurrences in D D D . Generalizing this scheme to heterogeneous occurrence sets requires us to be able to handle a set of transformation classes, F = { F 1 , F 2 , … , F ∣ F ∣ } \mathcal{F} = \{F_1,F_2,\ldots,F_{|\mathcal{F}|}\} F = { F 1 , F 2 , … , F ∣ F ∣ } . We can do this by replacing Ψ \Psi Ψ in the ordered-pair encoding of a homogeneous occurrence set with a sequence of sets of transformation parameter vectors, ⟨ Ψ 1 , Ψ 2 , … , Ψ ∣ F ∣ ⟩ \langle\Psi_1,\Psi_2,\ldots,\Psi_{|\mathcal{F}|}\rangle ⟨ Ψ 1 , Ψ 2 , … , Ψ ∣ F ∣ ⟩ , one set for each of the transformation classes in F \mathcal{F} F . The first step in doing this is to construct a partially ordered set, Φ \Phi Φ , obtained by sorting F \mathcal{F} F so that the parameter vector length of a transformation class in Φ \mathbf{\Phi} Φ is greater than or equal to the parameter vector lengths of all the classes occurring earlier in Φ \mathbf{\Phi} Φ . Note that, in general, there may be more than one ordering of the transformation classes in F \mathcal{F} F that satisfies this partial order. The ordering used in any particular case must therefore be specified, and we denote the zero-based index of F F F in Φ \mathbf{\Phi} Φ by γ ( F , Φ ) \gamma(F,\mathbf{\Phi}) γ ( F , Φ ) . That is, Φ [ γ ( F , Φ ) ] = F \mathbf{\Phi}[\gamma(F,\mathbf{\Phi})] = F Φ [ γ ( F , Φ )] = F .
Suppose we have a set of transformation classes, F = { F 1 , F 2 , F 3 } \mathcal{F} = \{F_1,F_2,F_3\} F = { F 1 , F 2 , F 3 } , and suppose that Φ = ⟨ F 1 , F 2 , F 3 ⟩ \mathbf{\Phi} = \langle F_1,F_2,F_3\rangle Φ = ⟨ F 1 , F 2 , F 3 ⟩ , so that we know that λ ( F 3 ) ≥ λ ( F 2 ) ≥ λ ( F 1 ) \lambda(F_3) \ge\lambda(F_2) \ge\lambda(F_1) λ ( F 3 ) ≥ λ ( F 2 ) ≥ λ ( F 1 ) . Suppose further that we have a set of four occurrences, { Q 1 , Q 2 , Q 3 , Q 4 } \{Q_1,Q_2,Q_3,Q_4\} { Q 1 , Q 2 , Q 3 , Q 4 } , of a pattern, P P P , in a dataset, D D D , where Q i = f i ( P ) Q_i = f_i(P) Q i = f i ( P ) and where f 1 , f 2 ∈ F 1 f_1,f_2 \in F_1 f 1 , f 2 ∈ F 1 , f 3 ∈ F 2 f_3 \in F_2 f 3 ∈ F 2 and f 4 ∈ F 3 f_4 \in F_3 f 4 ∈ F 3 . We can encode the set of occurrences { Q 1 , Q 2 , Q 3 , Q 4 } \{Q_1,Q_2,Q_3,Q_4\} { Q 1 , Q 2 , Q 3 , Q 4 } as the ordered triple,
⟨ P , Φ , ⟨ { σ F 1 ( f 1 ) , σ F 1 ( f 2 ) } , { σ F 2 ( f 3 ) } , { σ F 3 ( f 4 ) } ⟩ ⟩ , (76) \left\langle P,\mathbf{\Phi},\left\langle\{\sigma_{F_1}(f_1),\sigma_{F_1}(f_2)\},\{\sigma_{F_2}(f_3)\},\{\sigma_{F_3}(f_4)\}\right\rangle\right\rangle, \tag*{(76)} ⟨ P , Φ , ⟨ { σ F 1 ( f 1 ) , σ F 1 ( f 2 )} , { σ F 2 ( f 3 )} , { σ F 3 ( f 4 )} ⟩ ⟩ , (76)
where the n n n th element of the sequence that forms the third element in this triple is the set of transformation parameter vectors for the occurrences of P P P onto which P P P is mapped by transformations in the n n n th element of Φ \mathbf{\Phi} Φ . Note that, in general, there may exist one or more pairs of patterns, Q x , Q y Q_x,Q_y Q x , Q y , in OS ( P , D , F ) \operatorname{OS}(P,D,\mathcal{F}) OS ( P , D , F ) for which there exists no transformation in any of the transformation classes in F \mathcal{F} F that map Q x Q_x Q x onto Q y Q_y Q y . This is one reason why we choose to use the query pattern, P P P , itself rather than an occurrence of P P P in D D D as the first element in the ordered-pair encoding of an occurrence set, regardless of whether P P P is a subset of D D D .
As illustrated in (76) , a heterogeneous occurrence set, OS ( P , D , F ) \operatorname{OS}(P,D,\mathcal{F}) OS ( P , D , F ) , can be encoded in a compact manner as an ordered triple, ⟨ P , Φ , Z ⟩ \langle P,\mathbf{\Phi},Z\rangle ⟨ P , Φ , Z ⟩ , where Z = ⟨ Ψ 1 , Ψ 2 , … , Ψ Len ( Φ ) ⟩ Z = \langle\Psi_1,\Psi_2,\ldots,\Psi_{\operatorname{Len}(\mathbf{\Phi})}\rangle Z = ⟨ Ψ 1 , Ψ 2 , … , Ψ Len ( Φ ) ⟩ , and where Z [ i ] Z[i] Z [ i ] contains the transformation parameter vectors for transformations in Φ [ i ] \mathbf{\Phi}[i] Φ [ i ] that map P P P onto some of its occurrences. Recall that Φ \mathbf{\Phi} Φ contains all and only the transformation classes in F \mathcal{F} F , ordered so that λ ( F 1 ) < λ ( F 2 ) ⇒ γ ( F 1 , Φ ) < γ ( F 2 , Φ ) \lambda(F_1) < \lambda(F_2) \Rightarrow\gamma(F_1,\mathbf{\Phi}) < \gamma(F_2,\mathbf{\Phi}) λ ( F 1 ) < λ ( F 2 ) ⇒ γ ( F 1 , Φ ) < γ ( F 2 , Φ ) for all F 1 , F 2 ∈ F F_1,F_2 \in\mathcal{F} F 1 , F 2 ∈ F . We call such an encoding simply an ordered-triple encoding of a heterogeneous occurrence set . For each occurrence, Q Q Q , of P P P in OS ( P , D , F ) \operatorname{OS}(P,D,\mathcal{F}) OS ( P , D , F ) there exists exactly one transformation parameter vector, σ F ( f ) \sigma_F(f) σ F ( f ) in Z [ γ ( F , Φ ) ] Z[\gamma(F,\mathbf{\Phi})] Z [ γ ( F , Φ )] , such that Q = f ( P ) Q = f(P) Q = f ( P ) . A heterogeneous occurrence set can therefore be recovered from its ordered-triple encoding, ⟨ P , Φ , Z ⟩ \langle P,\mathbf{\Phi},Z\rangle ⟨ P , Φ , Z ⟩ , using the formula,
⋃ i = 0 Len ( Φ ) − 1 ( ⋃ σ ∈ Z [ i ] { ϕ Φ [ i ] ( σ , P ) } ) . \bigcup_{i=0}^{\operatorname{Len}(\mathbf{\Phi})-1}\left(\bigcup_{\sigma\in Z[i]}\{\phi_{\mathbf{\Phi}[i]}(\sigma,P)\}\right). i = 0 ⋃ Len ( Φ ) − 1 σ ∈ Z [ i ] ⋃ { ϕ Φ [ i ] ( σ , P )} .
Since specifying a sequence, Φ \mathbf{\Phi} Φ , of the transformation classes in F \mathcal{F} F is essential in order to do anything useful with a heterogeneous occurrence set, we sometimes write OS ( P , D , Φ ) \operatorname{OS}(P,D,\mathbf{\Phi}) OS ( P , D , Φ ) instead of OS ( P , D , F ) \operatorname{OS}(P,D,\mathcal{F}) OS ( P , D , F ) . On an analogy with the concept of the covered set of an occurrence set (see Def. 11), we define the covered set of a heterogeneous occurrence set as follows.
Definition 14 (Covered set of a heterogeneous occurrence set). If S S S is a heterogeneous occurrence set, then we define the covered set of S S S to be the point set,
COV ( S ) = ⋃ Q ∈ S Q . (77) \operatorname{COV}(S)=\bigcup_{Q\in S}Q. \tag*{(77)} COV ( S ) = Q ∈ S ⋃ Q . (77)
We also define the coverage of S S S to be the cardinality of its covered set, ∣ COV ( S ) ∣ \lvert\operatorname{COV}(S)\rvert ∣ COV ( S )∣ .
Note that the definition of the covered set of a heterogeneous occurrence set is essentially identical to that of an occurrence set.
The covered set of a heterogeneous occurrence set, OS ( P , D , Φ ) \operatorname{OS}(P,D,\Phi) OS ( P , D , Φ ) , can be recovered from its ordered-triple encoding, ⟨ P , Φ , Z ⟩ \langle P,\Phi,Z\rangle ⟨ P , Φ , Z ⟩ , using the following equation:
COV ( ⟨ P , Φ , Z ⟩ ) = ⋃ i = 0 Len ( Φ ) − 1 ( ⋃ σ ∈ Z [ i ] ϕ Φ [ i ] ( σ , P ) ) . (78) \operatorname{COV}(\langle P,\Phi,Z\rangle)=\bigcup_{i=0}^{\operatorname{Len}(\Phi)-1}\left(\bigcup_{\sigma\in Z[i]}\phi_{\Phi[i]}(\sigma,P)\right). \tag*{(78)} COV (⟨ P , Φ , Z ⟩) = i = 0 ⋃ Len ( Φ ) − 1 σ ∈ Z [ i ] ⋃ ϕ Φ [ i ] ( σ , P ) . (78)
On an analogy with the compression factor of an occurrence set, as defined in Def. 12 , we define the compression factor of a heterogeneous occurrence set as follows.
Definition 15 (Compression factor of a heterogeneous occurrence set). Given a pattern, P ⊂ R k P\subset\mathbb{R}^k P ⊂ R k , a dataset, D ⊂ R k D\subset\mathbb{R}^k D ⊂ R k and a set of k k k -dimensional transformation classes, F \mathcal{F} F , we define an ordered set of transformation classes, Φ \Phi Φ , satisfying the following constraints:
F ∈ F ⇔ F ∈ Φ F\in\mathcal{F}\Leftrightarrow F\in\Phi F ∈ F ⇔ F ∈ Φ ,
Len ( Φ ) = ∣ F ∣ \operatorname{Len}(\Phi)=|\mathcal{F}| Len ( Φ ) = ∣ F ∣ , and
∀ F 1 , F 2 ∈ F , λ ( F 1 ) < λ ( F 2 ) ⇒ γ ( F 1 , Φ ) < γ ( F 2 , Φ ) \forall F_1,F_2\in\mathcal{F},\lambda(F_1)<\lambda(F_2)\Rightarrow\gamma(F_1,\Phi)<\gamma(F_2,\Phi) ∀ F 1 , F 2 ∈ F , λ ( F 1 ) < λ ( F 2 ) ⇒ γ ( F 1 , Φ ) < γ ( F 2 , Φ ) , where γ ( F , Φ ) \gamma(F,\Phi) γ ( F , Φ ) is the zero-based index of F F F in Φ \Phi Φ .
We then derive an ordered-triple encoding of OS ( P , D , Φ ) \operatorname{OS}(P,D,\Phi) OS ( P , D , Φ ) that we denote by ⟨ P , Φ , Z ⟩ \langle P,\Phi,Z\rangle ⟨ P , Φ , Z ⟩ . We then define the compression factor of the heterogeneous occurrence set, OS ( P , D , Φ ) \operatorname{OS}(P,D,\Phi) OS ( P , D , Φ ) , as follows:
CF ( OS ( P , D , Φ ) ) = k ∣ COV ( OS ( P , D , Φ ) ) ∣ k ∣ P ∣ + Len ( Φ ) + ∑ i = 0 Len ( Φ ) − 1 Len ( Z [ i ] ) λ ( Φ [ i ] ) . (79) \operatorname{CF}(\operatorname{OS}(P,D,\Phi))=\frac{k|\operatorname{COV}(\operatorname{OS}(P,D,\Phi))|}{k|P|+\operatorname{Len}(\Phi)+\sum_{i=0}^{\operatorname{Len}(\Phi)-1}\operatorname{Len}(Z[i])\lambda(\Phi[i])}. \tag*{(79)} CF ( OS ( P , D , Φ )) = k ∣ P ∣ + Len ( Φ ) + ∑ i = 0 Len ( Φ ) − 1 Len ( Z [ i ]) λ ( Φ [ i ]) k ∣ COV ( OS ( P , D , Φ )) ∣ . (79)
It is sometimes (but not always) possible to obtain a more compact encoding of an occurrence set using a heterogeneous occurrence set than it is by using an ordinary, homogeneous occurrence set. This can happen if there are a sufficient number of occurrences of the query pattern where two transformations from different transformation classes with different parameter vector lengths map the query pattern onto the same occurrence. In such cases, we can choose to encode the occurrence using the least complex transformation—i.e., the one with the shortest parameter vector length.
In the following, we first consider a case where encoding a set of occurrences as a heterogeneous occurrence set does not lead to more compression. Then we show that if the occurrence set is augmented with further occurrences that are related to the query pattern by simple transformations, then encoding as a heterogeneous occurrence set can lead to better compression.
Suppose we encode the occurrence set in Figure 19 as an ordered-triple encoding of a heterogeneous occurrence set, ⟨ P , Φ , Z ⟩ \langle P,\Phi,Z\rangle ⟨ P , Φ , Z ⟩ , as follows. We first define that F = { F 2 T , F 2 S T , F 2 S T R } \mathcal{F}=\{F_{2T},F_{2ST},F_{2STR}\} F = { F 2 T , F 2 S T , F 2 S T R } and that Φ = ⟨ F 2 T , F 2 S T , F 2 S T R ⟩ \Phi=\langle F_{2T},F_{2ST},F_{2STR}\rangle Φ = ⟨ F 2 T , F 2 S T , F 2 S T R ⟩ . In this case, P P P is the black pattern, { ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩ } \{\langle1,1\rangle,\langle1,2\rangle,\langle2,3\rangle,\langle4,1\rangle,\langle4,2\rangle\} {⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩} . The black pattern, P P P , is mapped onto itself by a simple translation by ⟨ 0 , 0 ⟩ \langle0,0\rangle ⟨ 0 , 0 ⟩ . This occurrence can therefore be represented by the transformation parameter vector, ⟨ 0 , 0 ⟩ \langle0,0\rangle ⟨ 0 , 0 ⟩ , in Z [ 0 ] \mathbb{Z}[0] Z [ 0 ] . The blue pattern in Figure 19 can be obtained from the black pattern by first scaling by a factor of − 2 -2 − 2 and then translating by ⟨ 13 , 0 ⟩ \langle13,0\rangle ⟨ 13 , 0 ⟩ . There is no need for any inversion in this case, so we can represent the blue pattern as being the result of a transformation in F 2 S T F_{2\mathrm{ST}} F 2 ST , whose parameter vector length is 3. We can therefore represent the blue pattern by the transformation parameter vector, ⟨ − 2 , 13 , 0 ⟩ \langle-2,13,0\rangle ⟨ − 2 , 13 , 0 ⟩ , in Z [ 1 ] \mathbb{Z}[1] Z [ 1 ] . To obtain the red pattern from the black pattern, we need to scale by a factor of − 1 -1 − 1 , then translate by ⟨ 5 , − 7 ⟩ \langle5,-7\rangle ⟨ 5 , − 7 ⟩ and then reflect in the x x x -axis. This transformation is in F 2 S T R = Φ [ 2 ] F_{2\mathrm{STR}}=\Phi[2] F 2 STR = Φ [ 2 ] . We can therefore represent this occurrence by the transformation parameter vector, ⟨ − 1 , 5 , − 7 , − 1 ⟩ \langle-1,5,-7,-1\rangle ⟨ − 1 , 5 , − 7 , − 1 ⟩ , in Z [ 2 ] \mathbb{Z}[2] Z [ 2 ] . Finally, P P P can be mapped onto the green pattern by the transformation in F 2 S T R = Φ [ 2 ] F_{2\mathrm{STR}}=\Phi[2] F 2 STR = Φ [ 2 ] that has the transformation parameter vector, ⟨ 2 , 3 , − 8 , − 1 ⟩ \langle2,3,-8,-1\rangle ⟨ 2 , 3 , − 8 , − 1 ⟩ . This gives the following ordered-triple encoding for this heterogeneous occurrence set:
⟨ { ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩ } , ⟨ F 2 T , F 2 S T , F 2 S T R ⟩ , { { ⟨ 0 , 0 ⟩ } , { ⟨ − 2 , 13 , 0 ⟩ } , { ⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩ } } ⟩ . (80) \begin{aligned}
\langle&\{\langle1,1\rangle,\langle1,2\rangle,\langle2,3\rangle,\langle4,1\rangle,\langle4,2\rangle\},\\
&\langle F_{2\mathrm{T}},F_{2\mathrm{ST}},F_{2\mathrm{STR}}\rangle,\\
&\{\{\langle0,0\rangle\},\{\langle-2,13,0\rangle\},\{\langle-1,5,-7,-1\rangle,\langle2,3,-8,-1\rangle\}\}\rangle. \tag*{(80)}
\end{aligned} ⟨ {⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩} , ⟨ F 2 T , F 2 ST , F 2 STR ⟩ , {{⟨ 0 , 0 ⟩} , {⟨ − 2 , 13 , 0 ⟩} , {⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩}}⟩ . (80)
Using (79) , we can compute the compression factor of this heterogeneous occurrence set to be 40 10 + 3 + 13 = 40 26 ≈ 1.538 \frac{40}{10+3+13}=\frac{40}{26}\approx1.538 10 + 3 + 13 40 = 26 40 ≈ 1.538 . In this case, therefore, using the ordered-triple encoding of the heterogeneous occurrence set does not result in any more compression than one can achieve by using the ordered-pair encoding of the homogeneous occurrence set given in (70) . However, if there were more occurrences of the pattern and these occurrences were related to the pattern by transformations in transformation classes with parameter vector lengths less than that of F 2 S T R F_{2\mathrm{STR}} F 2 STR , then we may achieve better compression using a heterogeneous occurrence set than by using F 2 S T R F_{2\mathrm{STR}} F 2 STR alone.
For example, in Figure 20 we have added two extra occurrences of the black pattern that are related to the black pattern by simple translations (i.e., transformations in F 2 T F_{2\mathrm{T}} F 2 T ). If we represent the six occurrences in Figure 20 as an ordinary occurrence set with respect to F 2 S T R F_{2\mathrm{STR}} F 2 STR , then we get the ordered pair encoding,
Figure 20. Another example of an occurrence set.
⟨ { ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩ } , { ⟨ − 2 , 13 , 0 , 1 ⟩ , ⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ 1 , 0 , 7 , 1 ⟩ , ⟨ 1 , 4 , 8 , 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩ } ⟩ . (81) \begin{aligned}
\langle&\{\langle1,1\rangle,\langle1,2\rangle,\langle2,3\rangle,\langle4,1\rangle,\langle4,2\rangle\},\\
&\{\langle-2,13,0,1\rangle,\langle-1,5,-7,-1\rangle,\langle1,0,0,1\rangle,\langle1,0,7,1\rangle,\langle1,4,8,1\rangle,\langle2,3,-8,-1\rangle\}\rangle. \tag*{(81)}
\end{aligned} ⟨ {⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩} , {⟨ − 2 , 13 , 0 , 1 ⟩ , ⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ 1 , 0 , 7 , 1 ⟩ , ⟨ 1 , 4 , 8 , 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩}⟩ . (81)
This encoding gives a compression factor of 60 34 ≈ 1.76 \frac{60}{34}\approx1.76 34 60 ≈ 1.76 . However, if we set Φ \Phi Φ to be ⟨ F 2 T , F 2 S T , F 2 S T R ⟩ \langle F_{2\mathrm{T}},F_{2\mathrm{ST}},F_{2\mathrm{STR}}\rangle ⟨ F 2 T , F 2 ST , F 2 STR ⟩ , as above, then we can encode the six occurrences in Figure 20 as a heterogeneous occurrence set as follows:
⟨ { ⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩ } , ⟨ F 2 T , F 2 S T , F 2 S T R ⟩ , { { ⟨ 0 , 0 ⟩ , ⟨ 0 , 7 ⟩ , ⟨ 4 , 8 ⟩ } , { ⟨ − 2 , 13 , 0 ⟩ } , { ⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩ } } ⟩ . (82) \begin{aligned}
\langle&\{\langle1,1\rangle,\langle1,2\rangle,\langle2,3\rangle,\langle4,1\rangle,\langle4,2\rangle\},\\
&\langle F_{2\mathrm{T}},F_{2\mathrm{ST}},F_{2\mathrm{STR}}\rangle,\\
&\{\{\langle0,0\rangle,\langle0,7\rangle,\langle4,8\rangle\},\{\langle-2,13,0\rangle\},\{\langle-1,5,-7,-1\rangle,\langle2,3,-8,-1\rangle\}\}\rangle. \tag*{(82)}
\end{aligned} ⟨ {⟨ 1 , 1 ⟩ , ⟨ 1 , 2 ⟩ , ⟨ 2 , 3 ⟩ , ⟨ 4 , 1 ⟩ , ⟨ 4 , 2 ⟩} , ⟨ F 2 T , F 2 ST , F 2 STR ⟩ , {{⟨ 0 , 0 ⟩ , ⟨ 0 , 7 ⟩ , ⟨ 4 , 8 ⟩} , {⟨ − 2 , 13 , 0 ⟩} , {⟨ − 1 , 5 , − 7 , − 1 ⟩ , ⟨ 2 , 3 , − 8 , − 1 ⟩}}⟩ . (82)
This ordered-triple encoding gives a compression factor of 60 10 + 3 + 17 = 60 30 = 2 \frac{60}{10+3+17}=\frac{60}{30}=2 10 + 3 + 17 60 = 30 60 = 2 . In this case, we can therefore achieve a higher compression factor by representing the set of occurrences as a heterogeneous occurrence set.
Transformational equivalence
In [10 ] , inter-pattern transformation graphs were used to discover sets of occurrences of the HAYDN theme in Ravel’s Menuet that are transformationally equivalent . For example, occurrences 3, 4, 8 and 9 form a set of transformationally equivalent patterns with respect to F 2 S T R F_{2\mathrm{STR}} F 2 STR in the CPO representation of the Menuet , shown in Figure 3 .
In this section, we begin by defining a number of concepts relating to transformational equivalence. We then consider the relationship between the group-theoretic properties of a transformation class and transformational equivalence. Finally, we identify which of the transformation classes defined in § 3 form groups under transformation composition and determine for which of these classes the occurrence sets form sets of transformationally equivalent patterns.3
Definitions of concepts relating to transformational equivalence
We begin by defining the match relation of a transformation class or set of transformation classes.
Definition 16 (Match relation of a transformation class). Let F F F be a k k k -dimensional transformation class and let P , Q ⊂ R k P,Q \subset\mathbb{R}^{k} P , Q ⊂ R k . We define the binary relation, M F M_{F} M F , which we call the match relation of F F F , as follows:
( P , Q ) ∈ M F ⇔ ( ∃ f ∈ F : Q = f ( P ) ) . (83) (P,Q) \in M_{F} \Leftrightarrow(\exists f \in F : Q = f(P)). \tag*{(83)} ( P , Q ) ∈ M F ⇔ ( ∃ f ∈ F : Q = f ( P )) . (83) If ( P , Q ) ∈ M F (P,Q) \in M_{F} ( P , Q ) ∈ M F , then we may write P → F Q P \to_{F} Q P → F Q and P M F Q P\,M_{F}\,Q P M F Q and we can say that Q Q Q is a match of P P P with respect to F F F .
Note that, if F F F is a k k k -dimensional transformation class, then M F ⊂ ( 2 R k × 2 R k ) M_{F} \subset\left(2^{\mathbb{R}^{k}} \times2^{\mathbb{R}^{k}}\right) M F ⊂ ( 2 R k × 2 R k ) , where 2 R k 2^{\mathbb{R}^{k}} 2 R k is the universe of all possible sets of k k k -dimensional points (i.e., 2 R k 2^{\mathbb{R}^{k}} 2 R k is the powerset of R k \mathbb{R}^{k} R k ).
Definition 17 (Match relation of a set of transformation classes). Let F \mathcal{F} F be a set of k k k -dimensional transformation classes, and let P , Q ⊂ R k P,Q \subset\mathbb{R}^{k} P , Q ⊂ R k . We define the binary relation, M F M_{\mathcal{F}} M F , which we call the match relation of F \mathcal{F} F , as follows:
( P , Q ) ∈ M F ⇔ ( ∃ F ∈ F : P → F Q ) . (84) (P,Q) \in M_{\mathcal{F}} \Leftrightarrow(\exists F \in\mathcal{F} : P \to_{F} Q). \tag*{(84)} ( P , Q ) ∈ M F ⇔ ( ∃ F ∈ F : P → F Q ) . (84) If ( P , Q ) ∈ M F (P,Q) \in M_{\mathcal{F}} ( P , Q ) ∈ M F , then we may write P → F Q P \to_{\mathcal{F}} Q P → F Q or P M F Q P\,M_{\mathcal{F}}\,Q P M F Q and we can say that Q Q Q is a match of P P P with respect to F \mathcal{F} F .
Definition 18 (Transformational equivalence). Suppose we have a match relation, M X M_{X} M X , where X X X is either a k k k -dimensional transformation class or a set of k k k -dimensional transformation classes. We say that two patterns, P , Q ⊂ R k P,Q \subset\mathbb{R}^{k} P , Q ⊂ R k , are transformationally equivalent with respect to X X X , denoted by P ≡ X Q P \equiv_{X} Q P ≡ X Q , if and only if P → X Q P \to_{X} Q P → X Q and Q → X P Q \to_{X} P Q → X P .
Definition 19 (Set of transformationally equivalent patterns). Suppose we have a match relation, M X M_{X} M X , where X X X is either a k k k -dimensional transformation class or a set of k k k -dimensional transformation classes. We say that a set of patterns, P = { P 1 , P 2 , … P ℓ } \mathcal{P} = \{P_{1},P_{2},\ldots P_{\ell}\} P = { P 1 , P 2 , … P ℓ } , where P i ⊂ R k P_{i} \subset\mathbb{R}^{k} P i ⊂ R k for all P i ∈ P P_{i} \in\mathcal{P} P i ∈ P , is a set of patterns that are transformationally equivalent with respect to X X X , if and only if P i ≡ X P j P_{i} \equiv_{X} P_{j} P i ≡ X P j for all P i , P j ∈ P P_{i},P_{j} \in\mathcal{P} P i , P j ∈ P .
Definition 20 (Transformational equivalence relation). Suppose we have a match relation, M X M_{X} M X , where X X X is either a k k k -dimensional transformation class or a set of k k k -dimensional transformation classes. If M X M_{X} M X is reflexive, symmetric and transitive, then it is, by definition, an equivalence relation in the general mathematical sense and we say that M X M_{X} M X is a transformational equivalence relation.
Definition 21 (Transformational equivalence class). Suppose that M X M_{X} M X is a transformational equivalence relation, where X X X is either a k k k -dimensional transformation class or a set of k k k -dimensional transformation classes. If P ⊂ R k P \subset\mathbb{R}^{k} P ⊂ R k , then we define the transformational equivalence class of P P P with respect to X X X , denoted by [ P ] X [P]_{X} [ P ] X , to be the set,
[ P ] X = { Q ⊂ R k : P ≡ X Q } . (85) [P]_{X} = \{Q \subset\mathbb{R}^{k} : P \equiv_{X} Q\}. \tag*{(85)} [ P ] X = { Q ⊂ R k : P ≡ X Q } . (85) Note that, because M X M_{X} M X is an equivalence relation in the general mathematical sense, it follows that [ P ] X [P]_{X} [ P ] X is also an equivalence class in the general mathematical sense.
It is well known [see, e.g., 1, p. 1164] that an equivalence relation is the same as a partition. We can therefore simply state the following lemma.
Lemma 4. A transformational equivalence relation, M X M_X M X , where X X X is either a k k k -dimensional transformation class or a set of k k k -dimensional transformation classes, partitions the set 2 R k 2^{\mathbb{R}^k} 2 R k exhaustively and exclusively into transformational equivalence classes.
Transformation groups
Let us now consider the case where a k k k -dimensional transformation class, F F F , forms a group under the operation of transformation composition, ∘ \circ ∘ , where we define that, for any pair of transformations, f f f , g g g , ( f ∘ g ) ( p ) = f ( g ( p ) ) (f \circ g)(p) = f(g(p)) ( f ∘ g ) ( p ) = f ( g ( p )) for any point, p ∈ R k p \in\mathbb{R}^k p ∈ R k . That is, we now consider the case where the following constraints on a transformation class, F F F , are satisfied:
Closure: for all f , g ∈ F f,g \in F f , g ∈ F , f ∘ g ∈ F f \circ g \in F f ∘ g ∈ F .
Associativity: for all f , g , h ∈ F f,g,h \in F f , g , h ∈ F , ( f ∘ g ) ∘ h = f ∘ ( g ∘ h ) (f \circ g) \circ h = f \circ(g \circ h) ( f ∘ g ) ∘ h = f ∘ ( g ∘ h ) .
Presence of a unique, universal identity element: there exists a unique identity element, e ∈ F e \in F e ∈ F , such that, for all f ∈ F f \in F f ∈ F , e ∘ f = f ∘ e = f e \circ f = f \circ e = f e ∘ f = f ∘ e = f holds.
Invertibility: for every transformation, f ∈ F f \in F f ∈ F , there exists a unique inverse transformation, f − 1 ∈ F f^{-1} \in F f − 1 ∈ F , such that f ∘ f − 1 = f − 1 ∘ f = e f \circ f^{-1} = f^{-1} \circ f = e f ∘ f − 1 = f − 1 ∘ f = e .
We are now in a position to define the concept of a transformation group :
Definition 22 (Transformation group). A set of transformations is defined to be a transformation group, if and only if it forms a group under transformation composition.
We now consider the following well-known theorem that relates transformation groups to equivalence relations.
Theorem 2. If S S S is a set of functions over a set, A A A (i.e., S ⊆ { f : ( f : A → A ) } S \subseteq\{f : (f : A \to A)\} S ⊆ { f : ( f : A → A )} ), and S S S forms a group under the operation of function composition, denoted by ∘ \circ ∘ , then the binary relation, R R R , defined as a R b ⇔ ( ∃ f ∈ S : b = f ( a ) ) aRb \Leftrightarrow(\exists f \in S : b = f(a)) a R b ⇔ ( ∃ f ∈ S : b = f ( a )) where a , b ∈ A a,b \in A a , b ∈ A , is an equivalence relation over the set A A A .
Proof. In order to be an equivalence relation, R R R must be reflexive, symmetric and transitive.
Reflexivity: If S S S forms a group under the function composition operation, ∘ \circ ∘ , then, by definition, S S S contains a unique identity element, e ∈ S e \in S e ∈ S , such that e ( a ) = a e(a) = a e ( a ) = a for all a ∈ A a \in A a ∈ A . Therefore a R a aRa a R a for all a ∈ A a \in A a ∈ A and therefore R R R is reflexive.
Symmetry: If a , b ∈ A a,b \in A a , b ∈ A and a R b aRb a R b , then there must exist a function, f ∈ S f \in S f ∈ S , such that b = f ( a ) b = f(a) b = f ( a ) . If S S S forms a group under function composition, then, for every function, f ∈ S f \in S f ∈ S , the inverse of f f f , f − 1 f^{-1} f − 1 , is also an element in S S S . Thus, since a = f − 1 ( b ) a = f^{-1}(b) a = f − 1 ( b ) , b R a bRa b R a and therefore R R R is symmetric.
Transitivity: Suppose that g , h ∈ S g,h \in S g , h ∈ S , that a , b , c ∈ A a,b,c \in A a , b , c ∈ A , that b = g ( a ) b = g(a) b = g ( a ) and that c = h ( b ) c = h(b) c = h ( b ) . Therefore a R b aRb a R b and b R c bRc b R c . But c = h ( g ( a ) ) = ( h ∘ g ) ( a ) c = h(g(a)) = (h \circ g)(a) c = h ( g ( a )) = ( h ∘ g ) ( a ) and, if S S S forms a group under function composition, then h ∘ g ∈ S h \circ g \in S h ∘ g ∈ S and therefore a R c aRc a R c and R R R is transitive.
R R R is therefore an equivalence relation over A A A . □ \square □
The following corollary follows directly from Theorem 2.
Corollary 1. If F F F is a k k k -dimensional transformation class, and F F F forms a group under the operation of transformation composition, then M F \mathcal{M}_F M F is a transformational equivalence relation.
Proof. The result follows directly from Theorem 2, together with the definitions of a transformation class (Def. 2) and a transformational equivalence relation (Def. 20). □ \square □
However, the converse of Theorem 2 is not generally true. This can be shown by finding a single counter-example. For example, suppose that A = Z A = \mathbb{Z} A = Z , that S = { f i : f i ( n ) = i S = \{f_i : f_i(n) = i S = { f i : f i ( n ) = i for all n ∈ Z n \in\mathbb{Z} n ∈ Z , where i ∈ Z } i \in\mathbb{Z}\} i ∈ Z } and that R R R is the binary relation, a R b ⇔ ( ∃ f ∈ S : b = f ( a ) ) aRb \Leftrightarrow(\exists f \in S : b = f(a)) a R b ⇔ ( ∃ f ∈ S : b = f ( a )) where a , b ∈ A a,b \in A a , b ∈ A . We first prove that R R R is an equivalence relation by showing that it is reflexive, symmetric and transitive:
Reflexivity: For any a ∈ A a \in A a ∈ A , f a ( a ) = a f_a(a) = a f a ( a ) = a and f a ∈ S f_a \in S f a ∈ S . Therefore a R a aRa a R a for all a ∈ A a \in A a ∈ A and R R R is reflexive.
Symmetry: If a , b ∈ A a,b \in A a , b ∈ A , then f b ( a ) = b f_b(a) = b f b ( a ) = b and therefore a R b aRb a R b . Also, f a ( b ) = a f_a(b) = a f a ( b ) = a and therefore b R a bRa b R a . So R R R is symmetric.
Transitivity: If a , b , c ∈ A a,b,c \in A a , b , c ∈ A , then f b ( a ) = b f_b(a) = b f b ( a ) = b , f c ( b ) = c f_c(b) = c f c ( b ) = c and f c ( a ) = c f_c(a) = c f c ( a ) = c and f a , f b , f c ∈ S f_a,f_b,f_c \in S f a , f b , f c ∈ S . Therefore, if a R b aRb a R b and a R c aRc a R c , then a R c aRc a R c for all a , b , c ∈ A a,b,c \in A a , b , c ∈ A and R R R is transitive.
R R R is therefore reflexive, symmetric and transitive and R R R is therefore an equivalence relation over A A A . However, S S S does not form a group under function composition, as it does not contain a unique universal identity element and the functions in S S S do not have inverses:
Presence of a unique, universal identity element: For any given value of n ∈ A n \in A n ∈ A , there is only one function, f n ∈ S f_n \in S f n ∈ S such that f n ( n ) = n f_n(n) = n f n ( n ) = n . However, f n ( x ) ≠ x f_n(x) \ne x f n ( x ) = x for all x ≠ n x \ne n x = n . There therefore does not exist any unique, universal identity element, e e e in S S S such that e ( k ) = k e(k) = k e ( k ) = k for all k ∈ A k \in A k ∈ A . S S S therefore does not satisfy this condition and is therefore not a group.
Invertibility: Each of the functions, f i f_i f i , in S S S is a many-to-one function and therefore does not have a unique inverse function. S S S therefore does not satisfy the invertibility condition and is therefore not a group.
Therefore, if R R R is an equivalence relation, and a R b ⇔ ( ∃ f ∈ S : b = f ( a ) ) aRb \Leftrightarrow(\exists f \in S : b = f(a)) a R b ⇔ ( ∃ f ∈ S : b = f ( a )) where a , b ∈ A a,b \in A a , b ∈ A , and each element in S S S is a function, f : A → A f : A \to A f : A → A , then we cannot guarantee that S S S will form a group under function composition.
Group-theoretic and transformational equivalence properties of selected transformation classes
In this section, we identify which of the transformation classes considered in Section 3 form transformation groups. We also identify for which of these classes occurrence sets always form sets of transformationally equivalent patterns.
F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T We begin by considering the set of all 2-dimensional translations, F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T .
Lemma 5. F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T is a transformation group .
Proof. In order to prove that F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T is a transformation group, we need to prove that it satisfies the conditions of closure, associativity, presence of a universal identity element, and invertibility.
Closure: Let f , g ∈ F 2 T f,g \in\mathbf{F}_{2\mathrm{T}} f , g ∈ F 2 T , let p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 and let h ( p ) = f ( g ( p ) ) h(p)=f(g(p)) h ( p ) = f ( g ( p )) . This implies that h ( p ) = ( f ∘ g ) ( p ) h(p)=(f\circ g)(p) h ( p ) = ( f ∘ g ) ( p ) . From (7), it follows that
f ( g ( p ) ) = ( f ∘ g ) ( p ) = ϕ F 2 T ( σ F 2 T ( f ) , ϕ F 2 T ( σ F 2 T ( g ) , p ) ) = p + σ F 2 T ( g ) + σ F 2 T ( f ) = ϕ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , p ) . (86) \begin{aligned}
f(g(p)) &= (f\circ g)(p)=\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(g),p\right)\right)\\
&=p+\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f)\\
&=\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),p\right). \tag*{(86)}
\end{aligned} f ( g ( p )) = ( f ∘ g ) ( p ) = ϕ F 2 T ( σ F 2 T ( f ) , ϕ F 2 T ( σ F 2 T ( g ) , p ) ) = p + σ F 2 T ( g ) + σ F 2 T ( f ) = ϕ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , p ) . (86) Therefore, σ F 2 T ( h ) = σ F 2 T ( g ) + σ F 2 T ( f ) \sigma_{\mathbf{F}_{2\mathrm{T}}}(h)=\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f) σ F 2 T ( h ) = σ F 2 T ( g ) + σ F 2 T ( f ) and so h ∈ F 2 T h\in\mathbf{F}_{2\mathrm{T}} h ∈ F 2 T . F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T is therefore closed under transformation composition.
Associativity: Let f , g , h ∈ F 2 T f,g,h\in\mathbf{F}_{2\mathrm{T}} f , g , h ∈ F 2 T and let p ∈ R 2 p\in\mathbb{R}^{2} p ∈ R 2 . From (89),
( f ∘ g ) ( p ) = ϕ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , p ) (f\circ g)(p)=\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),p\right) ( f ∘ g ) ( p ) = ϕ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , p ) and
( g ∘ h ) ( p ) = ϕ F 2 T ( σ F 2 T ( h ) + σ F 2 T ( g ) , p ) (g\circ h)(p)=\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(h)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(g),p\right) ( g ∘ h ) ( p ) = ϕ F 2 T ( σ F 2 T ( h ) + σ F 2 T ( g ) , p ) .
Therefore, from (7),
( f ∘ g ) ( h ( p ) ) = ϕ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , ϕ F 2 T ( σ F 2 T ( h ) , p ) ) = p + σ F 2 T ( h ) + σ F 2 T ( g ) + σ F 2 T ( f ) (87) \begin{aligned}
(f\circ g)(h(p))&=\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(h),p\right)\right)\\
&=p+\sigma_{\mathbf{F}_{2\mathrm{T}}}(h)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f) \tag*{(87)}
\end{aligned} ( f ∘ g ) ( h ( p )) = ϕ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , ϕ F 2 T ( σ F 2 T ( h ) , p ) ) = p + σ F 2 T ( h ) + σ F 2 T ( g ) + σ F 2 T ( f ) (87) and
f ( ( g ∘ h ) ( p ) ) = ϕ F 2 T ( σ F 2 T ( f ) , ϕ F 2 T ( σ F 2 T ( h ) + σ F 2 T ( g ) , p ) ) = p + σ F 2 T ( h ) + σ F 2 T ( g ) + σ F 2 T ( f ) (88) \begin{aligned}
f((g\circ h)(p))&=\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),\phi_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(h)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(g),p\right)\right)\\
&=p+\sigma_{\mathbf{F}_{2\mathrm{T}}}(h)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f) \tag*{(88)}
\end{aligned} f (( g ∘ h ) ( p )) = ϕ F 2 T ( σ F 2 T ( f ) , ϕ F 2 T ( σ F 2 T ( h ) + σ F 2 T ( g ) , p ) ) = p + σ F 2 T ( h ) + σ F 2 T ( g ) + σ F 2 T ( f ) (88) From (90) and (91) it follows that ( f ∘ g ) ( h ( p ) ) = f ( ( g ∘ h ) ( p ) ) (f\circ g)(h(p))=f((g\circ h)(p)) ( f ∘ g ) ( h ( p )) = f (( g ∘ h ) ( p )) and that therefore transformation composition is associative over F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T .
Identity element If σ F 2 T ( e ) = ⟨ 0 , 0 ⟩ \sigma_{\mathbf{F}_{2\mathrm{T}}}(e)=\langle0,0\rangle σ F 2 T ( e ) = ⟨ 0 , 0 ⟩ and p ∈ R 2 p\in\mathbb{R}^{2} p ∈ R 2 , then, from (7), e ( p ) = p e(p)=p e ( p ) = p , and e e e is a universal identity element within F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T .
Invertibility Let σ F 2 T ( g ) = − σ F 2 T ( f ) \sigma_{\mathbf{F}_{2\mathrm{T}}}(g)=-\sigma_{\mathbf{F}_{2\mathrm{T}}}(f) σ F 2 T ( g ) = − σ F 2 T ( f ) . From (7) and (89) it follows that
( f ∘ g ) ( p ) = ( g ∘ f ) ( p ) = σ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , p ) = σ F 2 T ( − σ F 2 T ( f ) + σ F 2 T ( f ) , p ) = σ F 2 T ( ⟨ 0 , 0 ⟩ , p ) = p . \begin{aligned}
(f\circ g)(p)=(g\circ f)(p)&=\sigma_{\mathbf{F}_{2\mathrm{T}}}\left(\sigma_{\mathbf{F}_{2\mathrm{T}}}(g)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),p\right)\\
&=\sigma_{\mathbf{F}_{2\mathrm{T}}}\left(-\sigma_{\mathbf{F}_{2\mathrm{T}}}(f)+\sigma_{\mathbf{F}_{2\mathrm{T}}}(f),p\right)\\
&=\sigma_{\mathbf{F}_{2\mathrm{T}}}\left(\langle0,0\rangle,p\right)=p.
\end{aligned} ( f ∘ g ) ( p ) = ( g ∘ f ) ( p ) = σ F 2 T ( σ F 2 T ( g ) + σ F 2 T ( f ) , p ) = σ F 2 T ( − σ F 2 T ( f ) + σ F 2 T ( f ) , p ) = σ F 2 T ( ⟨ 0 , 0 ⟩ , p ) = p . Therefore, in general, σ F 2 T ( f − 1 ) = − σ F 2 T ( f ) \sigma_{\mathbf{F}_{2\mathrm{T}}}(f^{-1})=-\sigma_{\mathbf{F}_{2\mathrm{T}}}(f) σ F 2 T ( f − 1 ) = − σ F 2 T ( f ) . Every transformation, f ∈ F 2 T f\in\mathbf{F}_{2\mathrm{T}} f ∈ F 2 T , therefore has a unique inverse.
F 2 T \mathbf{F}_{2\mathrm{T}} F 2 T therefore satisfies the necessary conditions for it to be a transformation group. □ \square □
Corollary 2. M F 2 T \mathcal{M}_{\mathbf{F}_{2\mathrm{T}}} M F 2 T is a transformational equivalence relation.
Proof. This follows directly from Lemma 5 and Corollary 1. ☐
Corollary 3. If P , D ⊂ R 2 P,D \subset\mathbb{R}^{2} P , D ⊂ R 2 , then OS ( P , D , F 2 T ) \operatorname{OS}(P,D,F_{2T}) OS ( P , D , F 2 T ) is a set of transformationally equivalent patterns.
Proof. From Corollary 2, we know that M F 2 T \mathcal{M}_{F_{2T}} M F 2 T is a transformational equivalence relation, and therefore an equivalence relation over 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 . From Lemma 4, it follows that M F 2 T \mathcal{M}_{F_{2T}} M F 2 T partitions 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 exhaustively and exclusively into transformational equivalence classes. It follows that OS ( P , D , F 2 T ) ⊂ [ P ] F 2 T \operatorname{OS}(P,D,F_{2T}) \subset[P]_{F_{2T}} OS ( P , D , F 2 T ) ⊂ [ P ] F 2 T and that therefore OS ( P , D , F 2 T ) \operatorname{OS}(P,D,F_{2T}) OS ( P , D , F 2 T ) is a set of transformationally equivalent patterns. ☐
F 2 T R F_{2\mathrm{TR}} F 2 TR We now consider, F 2 T R F_{2\mathrm{TR}} F 2 TR , the set of 2-dimensional transformations consisting of a translation, optionally followed by a reflection in the x x x -axis.
Lemma 6. F 2 T R F_{2\mathrm{TR}} F 2 TR is a transformation group.
Proof. In order to prove that F 2 T R F_{2\mathrm{TR}} F 2 TR is a transformation group, we need to prove that it satisfies the conditions of closure, associativity, presence of a universal identity element, and invertibility.
Closure: Let f , g ∈ F 2 T R f,g \in F_{2\mathrm{TR}} f , g ∈ F 2 TR , p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 , p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ and h ( p ) = f ( g ( p ) ) h(p)=f(g(p)) h ( p ) = f ( g ( p )) . This implies that h ( p ) = ( f ∘ g ) ( p ) h(p)=(f\circ g)(p) h ( p ) = ( f ∘ g ) ( p ) . Let σ f = σ F 2 T R ( f ) \sigma^{f}=\sigma_{F_{2\mathrm{TR}}}(f) σ f = σ F 2 TR ( f ) and let σ g = σ F 2 T R ( g ) \sigma^{g}=\sigma_{F_{2\mathrm{TR}}}(g) σ g = σ F 2 TR ( g ) . Let σ i x = σ x [ i ] \sigma_i^x=\sigma^x[i] σ i x = σ x [ i ] . From (8), it follows that
f ( g ( p ) ) = ( f ∘ g ) ( p ) = ϕ F 2 T R ( σ f , ϕ F 2 T R ( σ g , p ) ) = ϕ F 2 T R ( σ f , ⟨ p x + σ 0 g , σ 2 g ( p y + σ 1 g ) ⟩ ) = ⟨ p x + σ 0 g + σ 0 f , σ 2 f ( σ 2 g ( p y + σ 1 g ) + σ 1 f ) ⟩ = ⟨ p x + σ 0 g + σ 0 f , σ 2 f σ 2 g p y + σ 2 f σ 2 g σ 1 g + σ 2 f σ 1 f ⟩ = ⟨ p x + ( σ 0 g + σ 0 f ) , σ 2 f σ 2 g ( p y + ( σ 1 g + σ 1 f σ 2 g ) ) ⟩ = ϕ F 2 T R ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 1 f σ 2 g , σ 2 f σ 2 g ⟩ , p ) (89) \begin{aligned}
f(g(p))&=(f\circ g)(p)=\phi_{F_{2\mathrm{TR}}}\left(\sigma^{f},\phi_{F_{2\mathrm{TR}}}(\sigma^{g},p)\right)\\
&=\phi_{F_{2\mathrm{TR}}}\left(\sigma^{f},\left\langle p_x+\sigma_0^g,\sigma_2^g(p_y+\sigma_1^g)\right\rangle\right)\\
&=\left\langle p_x+\sigma_0^g+\sigma_0^f,\sigma_2^f\left(\sigma_2^g(p_y+\sigma_1^g)+\sigma_1^f\right)\right\rangle\\
&=\left\langle p_x+\sigma_0^g+\sigma_0^f,\sigma_2^f\sigma_2^g p_y+\sigma_2^f\sigma_2^g\sigma_1^g+\sigma_2^f\sigma_1^f\right\rangle\\
&=\left\langle p_x+(\sigma_0^g+\sigma_0^f),\sigma_2^f\sigma_2^g\left(p_y+\left(\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g}\right)\right)\right\rangle\\
&=\phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^g+\sigma_0^f,\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g},\sigma_2^f\sigma_2^g\right\rangle,p\right) \tag*{(89)}
\end{aligned} f ( g ( p )) = ( f ∘ g ) ( p ) = ϕ F 2 TR ( σ f , ϕ F 2 TR ( σ g , p ) ) = ϕ F 2 TR ( σ f , ⟨ p x + σ 0 g , σ 2 g ( p y + σ 1 g ) ⟩ ) = ⟨ p x + σ 0 g + σ 0 f , σ 2 f ( σ 2 g ( p y + σ 1 g ) + σ 1 f ) ⟩ = ⟨ p x + σ 0 g + σ 0 f , σ 2 f σ 2 g p y + σ 2 f σ 2 g σ 1 g + σ 2 f σ 1 f ⟩ = ⟨ p x + ( σ 0 g + σ 0 f ) , σ 2 f σ 2 g ( p y + ( σ 1 g + σ 2 g σ 1 f ) ) ⟩ = ϕ F 2 TR ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 2 g σ 1 f , σ 2 f σ 2 g ⟩ , p ) (89)
Therefore,
σ F 2 T R ( h ) = ⟨ σ 0 g + σ 0 f , σ 1 g + σ 1 f σ 2 g , σ 2 f σ 2 g ⟩ \sigma_{F_{2\mathrm{TR}}}(h)=\left\langle\sigma_0^g+\sigma_0^f,\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g},\sigma_2^f\sigma_2^g\right\rangle σ F 2 TR ( h ) = ⟨ σ 0 g + σ 0 f , σ 1 g + σ 2 g σ 1 f , σ 2 f σ 2 g ⟩
and so h ∈ F 2 T R h\in F_{2\mathrm{TR}} h ∈ F 2 TR . F 2 T R F_{2\mathrm{TR}} F 2 TR is therefore closed under transformation composition.
Associativity: Let f , g , h ∈ F 2 T R f,g,h\in F_{2\mathrm{TR}} f , g , h ∈ F 2 TR , p ∈ R 2 p\in\mathbb{R}^{2} p ∈ R 2 and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Let σ f = σ F 2 T R ( f ) \sigma^f=\sigma_{F_{2\mathrm{TR}}}(f) σ f = σ F 2 TR ( f ) , σ g = σ F 2 T R ( g ) \sigma^g=\sigma_{F_{2\mathrm{TR}}}(g) σ g = σ F 2 TR ( g ) and σ h = σ F 2 T R ( h ) \sigma^h=\sigma_{F_{2\mathrm{TR}}}(h) σ h = σ F 2 TR ( h ) . Let σ i x = σ x [ i ] \sigma_i^x=\sigma^x[i] σ i x = σ x [ i ] . From (92),
( f ∘ g ) ( p ) = ϕ F 2 T R ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 1 f σ 2 g , σ 2 f σ 2 g ⟩ , p ) (90) (f\circ g)(p)=\phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^g+\sigma_0^f,\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g},\sigma_2^f\sigma_2^g\right\rangle,p\right) \tag*{(90)} ( f ∘ g ) ( p ) = ϕ F 2 TR ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 2 g σ 1 f , σ 2 f σ 2 g ⟩ , p ) (90)
( g ∘ h ) ( p ) = ϕ F 2 T R ( ⟨ σ 0 h + σ 0 g , σ 1 h + σ 1 g σ 2 h , σ 2 g σ 2 h ⟩ , p ) (91) (g\circ h)(p)=\phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^h+\sigma_0^g,\sigma_1^h+\frac{\sigma_1^g}{\sigma_2^h},\sigma_2^g\sigma_2^h\right\rangle,p\right) \tag*{(91)} ( g ∘ h ) ( p ) = ϕ F 2 TR ( ⟨ σ 0 h + σ 0 g , σ 1 h + σ 2 h σ 1 g , σ 2 g σ 2 h ⟩ , p ) (91)
Therefore, from (8),
( f ∘ g ) ( h ( p ) ) = ϕ F 2 T R ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 1 f σ 2 g , σ 2 f σ 2 g ⟩ , ϕ F 2 T R ( σ F 2 T R ( h ) , p ) ) = ϕ F 2 T R ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 1 f σ 2 g , σ 2 f σ 2 g ⟩ , ⟨ p x + σ 0 h , σ 2 h ( p y + σ 1 h ) ⟩ ) = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h ) + σ 1 g + σ 1 f σ 2 g ⟩ = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h + σ 1 g σ 2 h + σ 1 f σ 2 g σ 2 h ) ⟩ (92) \begin{aligned}
(f \circ g)(h(p))
&= \phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^g+\sigma_0^f,\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g},\sigma_2^f\sigma_2^g\right\rangle,\phi_{F_{2\mathrm{TR}}}(\sigma_{F_{2\mathrm{TR}}}(h),p)\right)\\
&= \phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^g+\sigma_0^f,\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g},\sigma_2^f\sigma_2^g\right\rangle,\left\langle p_x+\sigma_0^h,\sigma_2^h(p_y+\sigma_1^h)\right\rangle\right)\\
&= \left\langle p_x+\sigma_0^h+\sigma_0^g+\sigma_0^f,\sigma_2^f\sigma_2^g\sigma_2^h\left(p_y+\sigma_1^h\right)+\sigma_1^g+\frac{\sigma_1^f}{\sigma_2^g}\right\rangle\\
&= \left\langle p_x+\sigma_0^h+\sigma_0^g+\sigma_0^f,\sigma_2^f\sigma_2^g\sigma_2^h\left(p_y+\sigma_1^h+\frac{\sigma_1^g}{\sigma_2^h}+\frac{\sigma_1^f}{\sigma_2^g\sigma_2^h}\right)\right\rangle \tag*{(92)}
\end{aligned} ( f ∘ g ) ( h ( p )) = ϕ F 2 TR ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 2 g σ 1 f , σ 2 f σ 2 g ⟩ , ϕ F 2 TR ( σ F 2 TR ( h ) , p ) ) = ϕ F 2 TR ( ⟨ σ 0 g + σ 0 f , σ 1 g + σ 2 g σ 1 f , σ 2 f σ 2 g ⟩ , ⟨ p x + σ 0 h , σ 2 h ( p y + σ 1 h ) ⟩ ) = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h ) + σ 1 g + σ 2 g σ 1 f ⟩ = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h + σ 2 h σ 1 g + σ 2 g σ 2 h σ 1 f ) ⟩ (92)
and
f ( ( g ∘ h ) ( p ) ) = ϕ F 2 T R ( σ F 2 T R ( f ) , ( g ∘ h ) ( p ) ) = ϕ F 2 T R ( ⟨ σ 0 f , σ 1 f , σ 2 f ⟩ , ϕ F 2 T R ( ⟨ σ 0 h + σ 0 g , σ 1 h + σ 1 g σ 2 h , σ 2 g σ 2 h ⟩ , p ) ) = ϕ F 2 T R ( ⟨ σ 0 f , σ 1 f , σ 2 f ⟩ , ⟨ p x + σ 0 h + σ 0 g , σ 2 g σ 2 h ( p y + σ 1 h + σ 1 g σ 2 h ) ⟩ ) = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h + σ 1 g σ 2 h ) + σ 1 f ⟩ = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h + σ 1 g σ 2 h + σ 1 f σ 2 g σ 2 h ) ⟩ (93) \begin{aligned}
f((g\circ h)(p))
&= \phi_{F_{2\mathrm{TR}}}(\sigma_{F_{2\mathrm{TR}}}(f),(g\circ h)(p))\\
&= \phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^f,\sigma_1^f,\sigma_2^f\right\rangle,\phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^h+\sigma_0^g,\sigma_1^h+\frac{\sigma_1^g}{\sigma_2^h},\sigma_2^g\sigma_2^h\right\rangle,p\right)\right)\\
&= \phi_{F_{2\mathrm{TR}}}\left(\left\langle\sigma_0^f,\sigma_1^f,\sigma_2^f\right\rangle,\left\langle p_x+\sigma_0^h+\sigma_0^g,\sigma_2^g\sigma_2^h\left(p_y+\sigma_1^h+\frac{\sigma_1^g}{\sigma_2^h}\right)\right\rangle\right)\\
&= \left\langle p_x+\sigma_0^h+\sigma_0^g+\sigma_0^f,\sigma_2^f\sigma_2^g\sigma_2^h\left(p_y+\sigma_1^h+\frac{\sigma_1^g}{\sigma_2^h}\right)+\sigma_1^f\right\rangle\\
&= \left\langle p_x+\sigma_0^h+\sigma_0^g+\sigma_0^f,\sigma_2^f\sigma_2^g\sigma_2^h\left(p_y+\sigma_1^h+\frac{\sigma_1^g}{\sigma_2^h}+\frac{\sigma_1^f}{\sigma_2^g\sigma_2^h}\right)\right\rangle \tag*{(93)}
\end{aligned} f (( g ∘ h ) ( p )) = ϕ F 2 TR ( σ F 2 TR ( f ) , ( g ∘ h ) ( p )) = ϕ F 2 TR ( ⟨ σ 0 f , σ 1 f , σ 2 f ⟩ , ϕ F 2 TR ( ⟨ σ 0 h + σ 0 g , σ 1 h + σ 2 h σ 1 g , σ 2 g σ 2 h ⟩ , p ) ) = ϕ F 2 TR ( ⟨ σ 0 f , σ 1 f , σ 2 f ⟩ , ⟨ p x + σ 0 h + σ 0 g , σ 2 g σ 2 h ( p y + σ 1 h + σ 2 h σ 1 g ) ⟩ ) = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h + σ 2 h σ 1 g ) + σ 1 f ⟩ = ⟨ p x + σ 0 h + σ 0 g + σ 0 f , σ 2 f σ 2 g σ 2 h ( p y + σ 1 h + σ 2 h σ 1 g + σ 2 g σ 2 h σ 1 f ) ⟩ (93)
From (95) and (96) it follows that ( f ∘ g ) ( h ( p ) ) = f ( ( g ∘ h ) ( p ) ) (f\circ g)(h(p))=f((g\circ h)(p)) ( f ∘ g ) ( h ( p )) = f (( g ∘ h ) ( p )) and that therefore transformation composition is associative over F 2 T R F_{2\mathrm{TR}} F 2 TR .
3. Identity element If σ F 2 T R ( e ) = ⟨ 0 , 0 , 1 ⟩ \sigma_{F_{2\mathrm{TR}}}(e)=\langle0,0,1\rangle σ F 2 TR ( e ) = ⟨ 0 , 0 , 1 ⟩ , p ∈ R 2 p\in\mathbb{R}^2 p ∈ R 2 and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ , then, from (8),
e ( p ) = ϕ F 2 T R ( ⟨ 0 , 0 , 1 ⟩ , ⟨ p x , p y ⟩ ) = ⟨ p x + 0 , 1 ( p y + 0 ) ⟩ = ⟨ p x , p y ⟩ = p . \begin{aligned}
e(p)&=\phi_{F_{2\mathrm{TR}}}(\langle0,0,1\rangle,\langle p_x,p_y\rangle)\\
&=\langle p_x+0,1(p_y+0)\rangle\\
&=\langle p_x,p_y\rangle=p.
\end{aligned} e ( p ) = ϕ F 2 TR (⟨ 0 , 0 , 1 ⟩ , ⟨ p x , p y ⟩) = ⟨ p x + 0 , 1 ( p y + 0 )⟩ = ⟨ p x , p y ⟩ = p .
Therefore e ( p ) = p e(p)=p e ( p ) = p for all p ∈ R 2 p\in\mathbb{R}^2 p ∈ R 2 . e e e is therefore a universal identity element within F 2 T R F_{2\mathrm{TR}} F 2 TR .
4. Invertibility Let q = ϕ F 2 T R ( σ , p ) q=\phi_{F_{2\mathrm{TR}}}(\sigma,p) q = ϕ F 2 TR ( σ , p ) , where σ = ⟨ σ 0 , σ 1 , σ 2 ⟩ \sigma=\langle\sigma_0,\sigma_1,\sigma_2\rangle σ = ⟨ σ 0 , σ 1 , σ 2 ⟩ , and let q = ⟨ q x , q y ⟩ q=\langle q_x,q_y\rangle q = ⟨ q x , q y ⟩ and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . From (8), it follows that
q = ⟨ q x , q y ⟩ = ⟨ p x + σ 0 , σ 2 ( p y + σ 1 ) ⟩ q=\langle q_x,q_y\rangle=\langle p_x+\sigma_0,\sigma_2(p_y+\sigma_1)\rangle q = ⟨ q x , q y ⟩ = ⟨ p x + σ 0 , σ 2 ( p y + σ 1 )⟩
and therefore
p = ⟨ p x , p y ⟩ = ⟨ q x − σ 0 , q y σ 2 − σ 1 ⟩ . p=\langle p_x,p_y\rangle=\left\langle q_x-\sigma_0,\frac{q_y}{\sigma_2}-\sigma_1\right\rangle. p = ⟨ p x , p y ⟩ = ⟨ q x − σ 0 , σ 2 q y − σ 1 ⟩ .
But σ 2 ∈ { 1 , − 1 } \sigma_2\in\{1,-1\} σ 2 ∈ { 1 , − 1 } , therefore 1 σ 2 = σ 2 \frac{1}{\sigma_2}=\sigma_2 σ 2 1 = σ 2 , so
p = ⟨ p x , p y ⟩ = ⟨ q x − σ 0 , σ 2 q y − σ 1 ⟩ = ⟨ q x − σ 0 , σ 2 ( q y − σ 1 σ 2 ) ⟩ = ϕ F 2 T R ( ⟨ − σ 0 , − σ 1 σ 2 , σ 2 ⟩ , q ) . (94) \begin{aligned}
p&=\langle p_x,p_y\rangle=\langle q_x-\sigma_0,\sigma_2q_y-\sigma_1\rangle\\
&=\langle q_x-\sigma_0,\sigma_2\left(q_y-\sigma_1\sigma_2\right)\rangle\\
&=\phi_{F_{2\mathrm{TR}}}\left(\langle-\sigma_0,-\sigma_1\sigma_2,\sigma_2\rangle,q\right). \tag*{(94)}
\end{aligned} p = ⟨ p x , p y ⟩ = ⟨ q x − σ 0 , σ 2 q y − σ 1 ⟩ = ⟨ q x − σ 0 , σ 2 ( q y − σ 1 σ 2 ) ⟩ = ϕ F 2 TR ( ⟨ − σ 0 , − σ 1 σ 2 , σ 2 ⟩ , q ) . (94)
Therefore, if f ∈ F 2 T R f\in F_{2\mathrm{TR}} f ∈ F 2 TR and σ = σ F 2 T R ( f ) \sigma=\sigma_{F_{2\mathrm{TR}}}(f) σ = σ F 2 TR ( f ) , then
σ F 2 T R ( f − 1 ) = ⟨ − σ [ 0 ] , − σ [ 1 ] σ [ 2 ] , σ [ 2 ] ⟩ . \sigma_{F_{2\mathrm{TR}}}\left(f^{-1}\right)=\langle-\sigma[0],-\sigma[1]\sigma[2],\sigma[2]\rangle. σ F 2 TR ( f − 1 ) = ⟨ − σ [ 0 ] , − σ [ 1 ] σ [ 2 ] , σ [ 2 ]⟩ .
Therefore every transformation in F 2 T R F_{2\mathrm{TR}} F 2 TR has a unique inverse.
F 2 T R F_{2\mathrm{TR}} F 2 TR is therefore a transformation group. □ \square □
Corollary 4. M F 2 T R \mathcal{M}_{F_{2\mathrm{TR}}} M F 2 TR is a transformational equivalence relation.
Proof. This follows directly from Lemma 6 and Corollary 1. □ \square □
Corollary 5. If P , D ⊂ R 2 P,D\subset\mathbb{R}^2 P , D ⊂ R 2 , then OS ( P , D , F 2 T R ) \operatorname{OS}(P,D,F_{2\mathrm{TR}}) OS ( P , D , F 2 TR ) is a set of transformationally equivalent patterns.
Proof. From Corollary 4, we know that M F 2 T R \mathcal{M}_{F_{2\mathrm{TR}}} M F 2 TR is a transformational equivalence relation, and therefore an equivalence relation over 2 R 2 2^{\mathbb{R}^2} 2 R 2 . From Lemma 4, it follows that M F 2 T R \mathcal{M}_{F_{2\mathrm{TR}}} M F 2 TR partitions 2 R 2 2^{\mathbb{R}^2} 2 R 2 exhaustively and exclusively into transformational equivalence classes. It follows that OS ( P , D , F 2 T R ) ⊂ [ P ] F 2 T R \operatorname{OS}(P,D,F_{2\mathrm{TR}})\subset[P]_{F_{2\mathrm{TR}}} OS ( P , D , F 2 TR ) ⊂ [ P ] F 2 TR and that therefore OS ( P , D , F 2 T R ) \operatorname{OS}(P,D,F_{2\mathrm{TR}}) OS ( P , D , F 2 TR ) is a set of transformationally equivalent patterns. □ \square □
F 2 S T F_{2\mathrm{ST}} F 2 ST and F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ F 2 S T F_{2\mathrm{ST}} F 2 ST was defined in Section 3.2 to be the set containing those 2-dimensional transformations that consist of a scaling parallel to the x x x -axis by a real-valued scale factor (which may be zero), followed by a translation. Any transformation in F 2 S T F_{2\mathrm{ST}} F 2 ST that has an x x x -axis scale factor of zero does not have a unique inverse. Therefore F 2 S T F_{2\mathrm{ST}} F 2 ST is not a transformation group.
Let P , D ⊂ R 2 P,D\subset\mathbb{R}^2 P , D ⊂ R 2 and suppose that we have an occurrence set, OS ( P , D , F 2 S T ) \operatorname{OS}(P,D,F_{2\mathrm{ST}}) OS ( P , D , F 2 ST ) , that contains an occurrence, Q Q Q , of P P P , such that the x x x -axis scale factor of the transformation that maps P P P onto Q Q Q is zero. Let S S S be the subset of OS ( P , D , F 2 S T ) \operatorname{OS}(P,D,F_{2\mathrm{ST}}) OS ( P , D , F 2 ST ) that contains occurrences of P P P in D D D with respect to F 2 S T F_{2\mathrm{ST}} F 2 ST that can be obtained from P P P by transformations whose x x x -axis scale factor is not zero. There is then no transformation in F 2 S T F_{2\mathrm{ST}} F 2 ST that maps Q Q Q onto any of the occurrences in S S S , so if S S S is not empty, then OS ( P , D , F 2 S T ) \operatorname{OS}(P,D,F_{2\mathrm{ST}}) OS ( P , D , F 2 ST ) is not a set of transformationally equivalent patterns. Moreover, this shows that M F 2 S T \mathcal{M}_{F_{2\mathrm{ST}}} M F 2 ST is not a transformational equivalence relation.
We define the class F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ to be the set of 2-dimensional transformations that consist of an x x x -axis scaling by a non-zero real scale factor, followed by a translation. That is, F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is the subset of F 2 S T F_{2\mathrm{ST}} F 2 ST that contains only the transformations in F 2 S T F_{2\mathrm{ST}} F 2 ST whose x x x -axis
\mathcal{T}_{F'_{2\mathrm{ST}}}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}})
1 if \mathbf{b}_{\mathrm{img}} = \mathbf{b}_{\mathrm{obj}}
2 return \{\langle 1,0,0\rangle\} ▸ Identity transformation
3 p_1 \leftarrow \mathbf{b}_{\mathrm{obj}}[0], p_2 \leftarrow \mathbf{b}_{\mathrm{obj}}[1], q_1 \leftarrow \mathbf{b}_{\mathrm{img}}[0], q_2 \leftarrow \mathbf{b}_{\mathrm{img}}[1]
4 if q_2[0] \ne q_1[0] \land p_2[0] = p_1[0] ▸ \sigma[0] is undefined.
5 return \{\}
6 if q_2[0] = q_1[0] \land p_2[0] = p_1[0] ▸ \sigma[0] = 0/0
7 \sigma_0 \leftarrow 1
▸ So p_2[0] \ne p_1[0].
8 else if q_2[0] = q_1[0] ▸ Would require \sigma_0 to be zero.
9 return \{\}
10 else
11 \sigma_0 \leftarrow (q_2[0]-q_1[0])/(p_2[0]-p_1[0]) ▸ From (18)
12 \sigma_1 \leftarrow q_2[0]-p_2[0]\sigma_0 ▸ From (19)
13 if q_1[1]-p_1[1] = q_2[1]-p_2[1] ▸ From (17)
14 \sigma_2 \leftarrow q_1[1]-p_1[1] ▸ From (15)
15 return \{\langle\sigma_0,\sigma_1,\sigma_2\rangle\}
16 return \{\}
scale factors are non-zero. λ ( F 2 S T ′ ) = 3 \lambda(F'_{2\mathrm{ST}})=3 λ ( F 2 ST ′ ) = 3 and the transformation, f ∈ F 2 S T ′ f \in F'_{2\mathrm{ST}} f ∈ F 2 ST ′ , that consists of an x x x -axis scaling by a scale factor, s s s , followed by a translation by the vector, ⟨ v x , v y ⟩ \langle v_x,v_y\rangle ⟨ v x , v y ⟩ , can be uniquely identified by the transformation parameter vector, ⟨ s , v x , v y ⟩ ∈ R 3 \langle s,v_x,v_y\rangle\in\mathbb{R}^3 ⟨ s , v x , v y ⟩ ∈ R 3 , where s ∈ R ∖ { 0 } s \in\mathbb{R}\setminus\{0\} s ∈ R ∖ { 0 } and v x , v y ∈ R v_x,v_y \in\mathbb{R} v x , v y ∈ R . The transformation class function for F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is the same as that for F 2 S T F_{2\mathrm{ST}} F 2 ST —that is,
ϕ F 2 S T ′ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , p [ 1 ] + σ [ 2 ] ⟩ . (95) \phi_{F'_{2\mathrm{ST}}}(\sigma,p)=\langle p[0]\sigma[0]+\sigma[1],p[1]+\sigma[2]\rangle. \tag*{(95)} ϕ F 2 ST ′ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , p [ 1 ] + σ [ 2 ]⟩ . (95)
Also, as for F 2 S T F_{2\mathrm{ST}} F 2 ST , β ( F 2 S T ′ ) = 2 \beta(F'_{2\mathrm{ST}})=2 β ( F 2 ST ′ ) = 2 and τ ( F 2 S T ′ ) = 1 \tau(F'_{2\mathrm{ST}})=1 τ ( F 2 ST ′ ) = 1 . The basis-pair transformation set function for F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is as follows:
T F 2 S T ′ ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] ⟩ } , (96) \mathcal{T}_{F'_{2\mathrm{ST}}}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle)=\{\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],q_1[1]-p_1[1]\rangle\}, \tag*{(96)} T F 2 ST ′ (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) = {⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ]⟩} , (96)
where
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] q_1[1]-p_1[1]=q_2[1]-p_2[1] q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ]
and where
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] . (97) \sigma[0]=
\begin{cases}
1, & \text{if }p_2[0]=p_1[0]\text{ and }q_2[0]=q_1[0];\text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that }p_2[0]\ne p_1[0]\text{ and }q_2[0]\ne q_1[0].
\end{cases} \tag*{(97)} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] . (97)
T F 2 S T ′ \mathcal{T}_{F'_{2\mathrm{ST}}} T F 2 ST ′ can be computed using the algorithm in Figure 21 . Note that this algorithm is the same as that in Figure 9 except that an extra check has been added in lines 8–9 to ensure that the x x x -axis scale factor cannot be zero.
Figure 21. Algorithm for computing the basis-pair transformation set function for F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ .
We will now show that F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is a transformation group.
Lemma 7. F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is a transformation group.
Proof. In order to prove that F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is a transformation group, we need to show that it satisfies the conditions of closure, associativity, presence of a unique identity element, and invertibility.
Closure: Let f , g ∈ F 2 S T ′ f,g \in F'_{2\mathrm{ST}} f , g ∈ F 2 ST ′ , p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 and p = ⟨ p x , p y ⟩ p = \langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . By definition, f ( g ( p ) ) = ( f ∘ g ) ( p ) f(g(p)) = (f \circ g)(p) f ( g ( p )) = ( f ∘ g ) ( p ) . Let σ f = σ F 2 S T ′ ( f ) \sigma^{f} = \sigma_{F'_{2\mathrm{ST}}}(f) σ f = σ F 2 ST ′ ( f ) and let σ g = σ F 2 S T ′ ( g ) \sigma^{g} = \sigma_{F'_{2\mathrm{ST}}}(g) σ g = σ F 2 ST ′ ( g ) . Let σ i x = σ x [ i ] \sigma_i^x = \sigma^x[i] σ i x = σ x [ i ] . From (95) ,
f ( g ( p ) ) = ( f ∘ g ) ( p ) = ϕ F 2 S T ′ ( σ 0 f , ⟨ p x σ 0 g + σ 1 g , p y + σ 2 g ⟩ ) = ⟨ ( p x σ 0 g + σ 1 g ) σ 0 f + σ 1 f , ( p y + σ 2 g ) + σ 2 f ⟩ = ⟨ p x ( σ 0 g σ 0 f ) + ( σ 1 g σ 0 f + σ 1 f ) , p y + ( σ 2 g + σ 2 f ) ⟩ = ϕ F 2 S T ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , p ) (98) \begin{aligned}
f(g(p)) &= (f \circ g)(p)\\
&= \phi_{F'_{2\mathrm{ST}}}\left(\sigma^{f}_{0},\left\langle p_x\sigma^{g}_{0}+\sigma^{g}_{1},p_y+\sigma^{g}_{2}\right\rangle\right)\\
&= \left\langle\left(p_x\sigma^{g}_{0}+\sigma^{g}_{1}\right)\sigma^{f}_{0}+\sigma^{f}_{1},\left(p_y+\sigma^{g}_{2}\right)+\sigma^{f}_{2}\right\rangle\\
&= \left\langle p_x\left(\sigma^{g}_{0}\sigma^{f}_{0}\right)+\left(\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1}\right),p_y+\left(\sigma^{g}_{2}+\sigma^{f}_{2}\right)\right\rangle\\
&= \phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^{g}_{0}\sigma^{f}_{0},\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle,p\right) \tag*{(98)}
\end{aligned} f ( g ( p )) = ( f ∘ g ) ( p ) = ϕ F 2 ST ′ ( σ 0 f , ⟨ p x σ 0 g + σ 1 g , p y + σ 2 g ⟩ ) = ⟨ ( p x σ 0 g + σ 1 g ) σ 0 f + σ 1 f , ( p y + σ 2 g ) + σ 2 f ⟩ = ⟨ p x ( σ 0 g σ 0 f ) + ( σ 1 g σ 0 f + σ 1 f ) , p y + ( σ 2 g + σ 2 f ) ⟩ = ϕ F 2 ST ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , p ) (98) Therefore,
σ F 2 S T ′ ( f ∘ g ) = ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , \sigma_{F'_{2\mathrm{ST}}}(f\circ g)=\left\langle\sigma^{g}_{0}\sigma^{f}_{0},\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle, σ F 2 ST ′ ( f ∘ g ) = ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , which implies that f ∘ g ∈ F 2 S T ′ f\circ g \in F'_{2\mathrm{ST}} f ∘ g ∈ F 2 ST ′ , which implies that F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is closed under transformation composition.
Associativity: Let f , g , h ∈ F 2 S T ′ f,g,h \in F'_{2\mathrm{ST}} f , g , h ∈ F 2 ST ′ , p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 and p = ⟨ p x , p y ⟩ p = \langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Let σ f = σ F 2 S T ′ ( f ) \sigma^{f} = \sigma_{F'_{2\mathrm{ST}}}(f) σ f = σ F 2 ST ′ ( f ) , σ g = σ F 2 S T ′ ( g ) \sigma^{g} = \sigma_{F'_{2\mathrm{ST}}}(g) σ g = σ F 2 ST ′ ( g ) and σ h = σ F 2 S T ′ ( h ) \sigma^{h} = \sigma_{F'_{2\mathrm{ST}}}(h) σ h = σ F 2 ST ′ ( h ) . Let σ i x = σ x [ i ] \sigma_i^x = \sigma^x[i] σ i x = σ x [ i ] . From (98) ,
( f ∘ g ) ( p ) = ϕ F 2 S T ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , p ) (99) (f\circ g)(p)=\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^{g}_{0}\sigma^{f}_{0},\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle,p\right) \tag*{(99)} ( f ∘ g ) ( p ) = ϕ F 2 ST ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , p ) (99) ( g ∘ h ) ( p ) = ϕ F 2 S T ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 2 g ⟩ , p ) (100) (g\circ h)(p)=\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^{h}_{0}\sigma^{g}_{0},\sigma^{h}_{1}\sigma^{g}_{0}+\sigma^{g}_{1},\sigma^{h}_{2}+\sigma^{g}_{2}\right\rangle,p\right) \tag*{(100)} ( g ∘ h ) ( p ) = ϕ F 2 ST ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 2 g ⟩ , p ) (100) Therefore, from (95) and (99) ,
( f ∘ g ) ( h ( p ) ) = ϕ F 2 S T ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , ϕ F 2 S T ′ ( σ F 2 S T ′ ( h ) , p ) ) = ϕ F 2 S T ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , ⟨ p x σ 0 h + σ 1 h , p y + σ 2 h ⟩ ) = ⟨ ( p x σ 0 h + σ 1 h ) σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ϕ F 2 S T ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 2 g + σ 2 f ⟩ , p ) (101) \begin{aligned}
(f\circ g)(h(p))
&=\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^{g}_{0}\sigma^{f}_{0},\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle,\phi_{F'_{2\mathrm{ST}}}\left(\sigma_{F'_{2\mathrm{ST}}}(h),p\right)\right)\\
&=\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^{g}_{0}\sigma^{f}_{0},\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle,\left\langle p_x\sigma^{h}_{0}+\sigma^{h}_{1},p_y+\sigma^{h}_{2}\right\rangle\right)\\
&=\left\langle\left(p_x\sigma^{h}_{0}+\sigma^{h}_{1}\right)\sigma^{g}_{0}\sigma^{f}_{0}+\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},p_y+\sigma^{h}_{2}+\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle\\
&=\left\langle p_x\sigma^{h}_{0}\sigma^{g}_{0}\sigma^{f}_{0}+\sigma^{h}_{1}\sigma^{g}_{0}\sigma^{f}_{0}+\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},p_y+\sigma^{h}_{2}+\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle\\
&=\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^{h}_{0}\sigma^{g}_{0}\sigma^{f}_{0},\sigma^{h}_{1}\sigma^{g}_{0}\sigma^{f}_{0}+\sigma^{g}_{1}\sigma^{f}_{0}+\sigma^{f}_{1},\sigma^{h}_{2}+\sigma^{g}_{2}+\sigma^{f}_{2}\right\rangle,p\right) \tag*{(101)}
\end{aligned} ( f ∘ g ) ( h ( p )) = ϕ F 2 ST ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , ϕ F 2 ST ′ ( σ F 2 ST ′ ( h ) , p ) ) = ϕ F 2 ST ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f ⟩ , ⟨ p x σ 0 h + σ 1 h , p y + σ 2 h ⟩ ) = ⟨ ( p x σ 0 h + σ 1 h ) σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ϕ F 2 ST ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 2 g + σ 2 f ⟩ , p ) (101)
and, from (98) and (103),
f ( ( g ∘ h ) ( p ) ) = ϕ F 2 S T ′ ( σ F 2 S T ′ ( f ) , ϕ F 2 S T ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 2 g ⟩ , p ) ) = ϕ F 2 S T ′ ( ⟨ σ 0 f , σ 1 f , σ 2 f ⟩ , ⟨ p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g , p y + σ 2 h + σ 2 g ⟩ ) = ⟨ ( p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g ) σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ϕ F 2 S T ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 2 g + σ 2 f ⟩ , p ) (102) \begin{aligned}
f((g\circ h)(p)) &= \phi_{F'_{2\mathrm{ST}}}\left(\sigma_{F'_{2\mathrm{ST}}}(f),\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^h_0\sigma^g_0,\sigma^h_1\sigma^g_0+\sigma^g_1,\sigma^h_2+\sigma^g_2\right\rangle,p\right)\right)\\
&= \phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^f_0,\sigma^f_1,\sigma^f_2\right\rangle,\left\langle p_x\sigma^h_0\sigma^g_0+\sigma^h_1\sigma^g_0+\sigma^g_1,p_y+\sigma^h_2+\sigma^g_2\right\rangle\right)\\
&= \left\langle\left(p_x\sigma^h_0\sigma^g_0+\sigma^h_1\sigma^g_0+\sigma^g_1\right)\sigma^f_0+\sigma^f_1,p_y+\sigma^h_2+\sigma^g_2+\sigma^f_2\right\rangle\\
&= \left\langle p_x\sigma^h_0\sigma^g_0\sigma^f_0+\sigma^h_1\sigma^g_0\sigma^f_0+\sigma^g_1\sigma^f_0+\sigma^f_1,p_y+\sigma^h_2+\sigma^g_2+\sigma^f_2\right\rangle\\
&= \phi_{F'_{2\mathrm{ST}}}\left(\left\langle\sigma^h_0\sigma^g_0\sigma^f_0,\sigma^h_1\sigma^g_0\sigma^f_0+\sigma^g_1\sigma^f_0+\sigma^f_1,\sigma^h_2+\sigma^g_2+\sigma^f_2\right\rangle,p\right) \tag*{(102)}
\end{aligned} f (( g ∘ h ) ( p )) = ϕ F 2 ST ′ ( σ F 2 ST ′ ( f ) , ϕ F 2 ST ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 2 g ⟩ , p ) ) = ϕ F 2 ST ′ ( ⟨ σ 0 f , σ 1 f , σ 2 f ⟩ , ⟨ p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g , p y + σ 2 h + σ 2 g ⟩ ) = ⟨ ( p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g ) σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , p y + σ 2 h + σ 2 g + σ 2 f ⟩ = ϕ F 2 ST ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 2 g + σ 2 f ⟩ , p ) (102)
From (104) and (105) it follows that ( f ∘ g ) ( h ( p ) ) = f ( ( g ∘ h ) ( p ) ) (f\circ g)(h(p))=f((g\circ h)(p)) ( f ∘ g ) ( h ( p )) = f (( g ∘ h ) ( p )) and that therefore transformation composition is associative over F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ .
Identity element: Suppose that e ∈ F 2 S T ′ e\in F'_{2\mathrm{ST}} e ∈ F 2 ST ′ and σ F 2 S T ′ ( e ) = ⟨ 1 , 0 , 0 ⟩ \sigma_{F'_{2\mathrm{ST}}}(e)=\langle1,0,0\rangle σ F 2 ST ′ ( e ) = ⟨ 1 , 0 , 0 ⟩ . Let p ∈ R 2 p\in\mathbb{R}^2 p ∈ R 2 and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Then, from (98),
e ( p ) = ϕ F 2 S T ′ ( ⟨ 1 , 0 , 0 ⟩ , ⟨ p x , p y ⟩ ) = ⟨ 1 p x + 0 , p y + 0 ⟩ = ⟨ p x , p y ⟩ = p (103) \begin{aligned}
e(p)&=\phi_{F'_{2\mathrm{ST}}}(\langle1,0,0\rangle,\langle p_x,p_y\rangle)\\
&=\langle1p_x+0,p_y+0\rangle\\
&=\langle p_x,p_y\rangle=p \tag*{(103)}
\end{aligned} e ( p ) = ϕ F 2 ST ′ (⟨ 1 , 0 , 0 ⟩ , ⟨ p x , p y ⟩) = ⟨ 1 p x + 0 , p y + 0 ⟩ = ⟨ p x , p y ⟩ = p (103)
Therefore, e ( p ) = p e(p)=p e ( p ) = p for all p ∈ R 2 p\in\mathbb{R}^2 p ∈ R 2 . e e e is therefore a universal identity element in F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ .
Invertibility: Let p , q ∈ R 2 p,q\in\mathbb{R}^2 p , q ∈ R 2 and let q = ϕ F 2 S T ′ ( σ , p ) q=\phi_{F'_{2\mathrm{ST}}}(\sigma,p) q = ϕ F 2 ST ′ ( σ , p ) where σ = ⟨ σ 0 , σ 1 , σ 2 ⟩ \sigma=\langle\sigma_0,\sigma_1,\sigma_2\rangle σ = ⟨ σ 0 , σ 1 , σ 2 ⟩ , p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ and q = ⟨ q x , q y ⟩ q=\langle q_x,q_y\rangle q = ⟨ q x , q y ⟩ . Then, from (98),
q = ⟨ p x σ 0 + σ 1 , p y + σ 2 ⟩ q=\langle p_x\sigma_0+\sigma_1,p_y+\sigma_2\rangle q = ⟨ p x σ 0 + σ 1 , p y + σ 2 ⟩
and therefore
p = ⟨ p x , p y ⟩ = ⟨ q x − σ 1 σ 0 , q y − σ 2 ⟩ = ϕ F 2 S T ′ ( ⟨ 1 σ 0 , − σ 1 σ 0 , − σ 2 ⟩ , q ) . p=\langle p_x,p_y\rangle=\left\langle\frac{q_x-\sigma_1}{\sigma_0},q_y-\sigma_2\right\rangle=\phi_{F'_{2\mathrm{ST}}}\left(\left\langle\frac{1}{\sigma_0},-\frac{\sigma_1}{\sigma_0},-\sigma_2\right\rangle,q\right). p = ⟨ p x , p y ⟩ = ⟨ σ 0 q x − σ 1 , q y − σ 2 ⟩ = ϕ F 2 ST ′ ( ⟨ σ 0 1 , − σ 0 σ 1 , − σ 2 ⟩ , q ) .
Therefore, if f ∈ F 2 S T ′ f\in F'_{2\mathrm{ST}} f ∈ F 2 ST ′ and σ = σ F 2 S T ′ ( f ) \sigma=\sigma_{F'_{2\mathrm{ST}}}(f) σ = σ F 2 ST ′ ( f ) , then
σ F 2 S T ′ ( f − 1 ) = ⟨ 1 σ [ 0 ] , − σ [ 1 ] σ [ 0 ] , − σ [ 2 ] ⟩ . \sigma_{F'_{2\mathrm{ST}}}(f^{-1})=\left\langle\frac{1}{\sigma[0]},-\frac{\sigma[1]}{\sigma[0]},-\sigma[2]\right\rangle. σ F 2 ST ′ ( f − 1 ) = ⟨ σ [ 0 ] 1 , − σ [ 0 ] σ [ 1 ] , − σ [ 2 ] ⟩ .
Therefore, every transformation in F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ has a unique inverse.
F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ is therefore a transformation group. □ \square □
Corollary 6. M F 2 S T ′ M_{F'_{2\mathrm{ST}}} M F 2 ST ′ is a transformational equivalence relation.
Proof. This follows directly from Lemma 7 and Corollary 1. □ \square □
Corollary 7. If P , D ⊂ R 2 P,D \subset\mathbb{R}^{2} P , D ⊂ R 2 , then OS ( P , D , F 2 S T R ′ ) \operatorname{OS}(P,D,F'_{2\mathrm{STR}}) OS ( P , D , F 2 STR ′ ) is a set of transformationally equivalent patterns.
Proof. From Corollary 6, we know that M F 2 S T R ′ \mathcal{M}_{F'_{2\mathrm{STR}}} M F 2 STR ′ is a transformational equivalence relation, and therefore an equivalence relation over 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 . From Lemma 4, it follows that M F 2 S T R ′ \mathcal{M}_{F'_{2\mathrm{STR}}} M F 2 STR ′ partitions 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 exhaustively and exclusively into transformational equivalence classes. It follows that OS ( P , D , F 2 S T R ′ ) ⊂ [ P ] F 2 S T R ′ \operatorname{OS}(P,D,F'_{2\mathrm{STR}}) \subset[P]_{F'_{2\mathrm{STR}}} OS ( P , D , F 2 STR ′ ) ⊂ [ P ] F 2 STR ′ and that therefore OS ( P , D , F 2 S T R ′ ) \operatorname{OS}(P,D,F'_{2\mathrm{STR}}) OS ( P , D , F 2 STR ′ ) is a set of transformationally equivalent patterns. □ \square □
F 2 S T R F_{2\mathrm{STR}} F 2 STR and F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ . F 2 S T R F_{2\mathrm{STR}} F 2 STR was defined in Section 3.2 to be the set containing those 2-dimensional transformations that consist of a scaling parallel to the x x x -axis by a real-valued scale factor (which may be zero), followed by a translation, optionally followed by a reflection in the x x x -axis. Any transformation in F 2 S T R F_{2\mathrm{STR}} F 2 STR that has an x x x -axis scale factor of zero does not have a unique inverse. Therefore F 2 S T R F_{2\mathrm{STR}} F 2 STR is not a transformation group.
Let P , D ⊂ R 2 P,D \subset\mathbb{R}^{2} P , D ⊂ R 2 and suppose that we have an occurrence set, OS ( P , D , F 2 S T R ) \operatorname{OS}(P,D,F_{2\mathrm{STR}}) OS ( P , D , F 2 STR ) , that contains an occurrence, Q Q Q , of P P P , such that the x x x -axis scale factor of the transformation that maps P P P onto Q Q Q is zero. Let S S S be the subset of OS ( P , D , F 2 S T R ) \operatorname{OS}(P,D,F_{2\mathrm{STR}}) OS ( P , D , F 2 STR ) that contains occurrences of P P P in D D D with respect to F 2 S T R F_{2\mathrm{STR}} F 2 STR that can be obtained from P P P by transformations whose x x x -axis scale factor is not zero. There is then no transformation in F 2 S T R F_{2\mathrm{STR}} F 2 STR that maps Q Q Q onto any of the occurrences in S S S , so if S S S is not empty, then OS ( P , D , F 2 S T R ) \operatorname{OS}(P,D,F_{2\mathrm{STR}}) OS ( P , D , F 2 STR ) is not a set of transformationally equivalent patterns. Moreover, this shows that M F 2 S T R \mathcal{M}_{F_{2\mathrm{STR}}} M F 2 STR is not a transformational equivalence relation.
We define the class F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ to be the set of 2-dimensional transformations that consist of an x x x -axis scaling by a non-zero real scale factor, followed by a translation, optionally followed by a reflection in the x x x -axis. That is, F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ is the subset of F 2 S T R F_{2\mathrm{STR}} F 2 STR that contains only the transformations in F 2 S T R F_{2\mathrm{STR}} F 2 STR whose x x x -axis scale factors are non-zero. λ ( F 2 S T R ′ ) = 4 \lambda(F'_{2\mathrm{STR}})=4 λ ( F 2 STR ′ ) = 4 and each transformation f ∈ F 2 S T R ′ f \in F'_{2\mathrm{STR}} f ∈ F 2 STR ′ can be uniquely identified by a 4-vector, ⟨ s , v x , v y , b ⟩ ∈ R 4 \langle s,v_x,v_y,b\rangle\in\mathbb{R}^{4} ⟨ s , v x , v y , b ⟩ ∈ R 4 , where s ∈ R ∖ { 0 } s \in\mathbb{R}\setminus\{0\} s ∈ R ∖ { 0 } , v x , v y ∈ R v_x,v_y \in\mathbb{R} v x , v y ∈ R and b ∈ { − 1 , 1 } b \in\{-1,1\} b ∈ { − 1 , 1 } . If σ F 2 S T R ′ ( f ) = ⟨ s , v x , v y , b ⟩ \sigma_{F'_{2\mathrm{STR}}}(f)=\langle s,v_x,v_y,b\rangle σ F 2 STR ′ ( f ) = ⟨ s , v x , v y , b ⟩ , then f f f is the transformation that scales parallel to the x x x -axis by a non-zero scale factor, s s s , then translates by the vector, ⟨ v x , v y ⟩ \langle v_x,v_y\rangle ⟨ v x , v y ⟩ and then multiplies the y y y -coordinate of the resulting point by b b b (which is either − 1 -1 − 1 or 1 1 1 ).
The transformation class function for F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ is the same as that for F 2 S T R F_{2\mathrm{STR}} F 2 STR —that is,
ϕ F 2 S T R ′ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , σ [ 3 ] ( p [ 1 ] + σ [ 2 ] ) ⟩ . (104) \phi_{F'_{2\mathrm{STR}}}(\sigma,p)=\langle p[0]\sigma[0]+\sigma[1],\sigma[3](p[1]+\sigma[2])\rangle. \tag*{(104)} ϕ F 2 STR ′ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , σ [ 3 ] ( p [ 1 ] + σ [ 2 ])⟩ . (104)
Also, as for F 2 S T R F_{2\mathrm{STR}} F 2 STR , β ( F 2 S T R ′ ) = 2 \beta(F'_{2\mathrm{STR}})=2 β ( F 2 STR ′ ) = 2 and τ ( F 2 S T R ′ ) = 2 \tau(F'_{2\mathrm{STR}})=2 τ ( F 2 STR ′ ) = 2 . The basis-pair transformation set function for F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ is as follows:
T F 2 S T R ′ ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , − p 1 [ 1 ] − q 1 [ 1 ] , − 1 ⟩ } , (105) \mathcal{T}_{F'_{2\mathrm{STR}}}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle)=
\begin{aligned}
\{&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],q_1[1]-p_1[1],1\rangle,\\
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],-p_1[1]-q_1[1],-1\rangle\},
\end{aligned} \tag*{(105)} T F 2 STR ′ (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , q 1 [ 1 ] − p 1 [ 1 ] , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , − p 1 [ 1 ] − q 1 [ 1 ] , − 1 ⟩} , (105)
where
q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] when σ [ 3 ] = 1 , q_1[1]-p_1[1]=q_2[1]-p_2[1]\ \text{when}\ \sigma[3]=1, q 1 [ 1 ] − p 1 [ 1 ] = q 2 [ 1 ] − p 2 [ 1 ] when σ [ 3 ] = 1 ,
and
p 1 [ 1 ] + q 1 [ 1 ] = p 2 [ 1 ] + q 2 [ 1 ] p_1[1] + q_1[1] = p_2[1] + q_2[1] p 1 [ 1 ] + q 1 [ 1 ] = p 2 [ 1 ] + q 2 [ 1 ]
when σ [ 3 ] = − 1 \sigma[3] = -1 σ [ 3 ] = − 1 , and where
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] . (106) \sigma[0] =
\begin{cases}
1, & \text{if } p_2[0] = p_1[0] \text{ and } q_2[0] = q_1[0]; \text{ and}\\
\frac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that } p_2[0] \ne p_1[0] \text{ and } q_2[0] \ne q_1[0].
\end{cases} \tag*{(106)} σ [ 0 ] = { 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] . (106)
F 2 S T R ′ \mathcal{F}'_{2\mathrm{STR}} F 2 STR ′ can be computed using the algorithm in Figure 22 . Note that this algorithm is the same as that in Figure 10 except that an extra check has been added in lines 9–10 to ensure that the x x x -axis scale factor cannot be zero.
𝒯_{\mathcal{F}'_{2STR}}(b_obj,b_img)
1 if b_img = b_obj
2 return {⟨1,0,0,1⟩} ▸ Identity transformation
3 p_1 ← b_obj[0], p_2 ← b_obj[1], q_1 ← b_img[0], q_2 ← b_img[1]
4 if q_2[0] ≠ q_1[0] ∧ p_2[0] = p_1[0] ▸ σ[0] is undefined.
5 return {}
6 if q_2[0] = q_1[0] ∧ p_2[0] = p_1[0] ▸ σ[0] = 0/0
7 σ_0 ← 1
▸ So p_2[0] ≠ p_1[0]
8 else if q_2[0] = q_1[0] ▸ Would require σ_0 to be zero.
9 return {}
10 else
11 σ_0 ← (q_2[0] − q_1[0])/(p_2[0] − p_1[0]) ▸ From (33)
12 S ← {}
13 σ_1 ← q_2[0] − p_2[0]σ_0 ▸ From (34)
14 if q_1[1] − p_1[1] = q_2[1] − p_2[1] ▸ From (32)
15 σ_3 ← 1
16 σ_2 ← q_1[1] − p_1[1] ▸ From (30)
17 S ← {⟨σ_0,σ_1,σ_2,σ_3⟩}
18 if p_1[1] + q_1[1] = p_2[1] + q_2[1] ▸ From (41)
19 σ_3 ← −1
20 σ_2 ← −p_1[1] − q_1[1] ▸ From (39)
21 S ← S ∪ {⟨σ_0,σ_1,σ_2,σ_3⟩}
22 return SFigure 22. Algorithm for computing the basis-pair transformation set function for F 2 S T R ′ \mathcal{F}'_{2\mathrm{STR}} F 2 STR ′ .
We will now show that F 2 S T R ′ \mathcal{F}'_{2\mathrm{STR}} F 2 STR ′ is a transformation group.
Lemma 8. F 2 S T R ′ \mathcal{F}'_{2\mathrm{STR}} F 2 STR ′ is a transformation group.
Proof. In order to prove that F 2 S T R ′ \mathcal{F}'_{2\mathrm{STR}} F 2 STR ′ is a transformation group, we need to show that it satisfies the conditions of closure, associativity, presence of a unique identity element, and invertibility.
Closure: Let f , g ∈ F 2 S T R ′ f,g \in F'_{2\mathrm{STR}} f , g ∈ F 2 STR ′ , p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . By definition, f ( g ( p ) ) = ( f ∘ g ) ( p ) f(g(p))=(f\circ g)(p) f ( g ( p )) = ( f ∘ g ) ( p ) . Let σ f = σ F 2 S T R ′ ( f ) \sigma^{f}=\sigma_{F'_{2\mathrm{STR}}}(f) σ f = σ F 2 STR ′ ( f ) and let σ g = σ F 2 S T R ′ ( g ) \sigma^{g}=\sigma_{F'_{2\mathrm{STR}}}(g) σ g = σ F 2 STR ′ ( g ) . Let σ i x = σ x [ i ] \sigma_i^x=\sigma^x[i] σ i x = σ x [ i ] . From (107),
f ( g ( p ) ) = ( f ∘ g ) ( p ) = ϕ F 2 S T R ′ ( σ f , ⟨ p x σ 0 g + σ 1 g , σ 3 g ( p y + σ 2 g ) ⟩ ) = ⟨ ( p x σ 0 g + σ 1 g ) σ 0 f + σ 1 f , σ 3 f ( σ 3 g ( p y + σ 2 g ) + σ 2 f ) ⟩ = ⟨ p x σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 3 f σ 3 g ( p y + σ 2 g + σ 2 f σ 3 g ) ⟩ = ϕ F 2 S T R ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , p ) (107) \begin{aligned}
f(g(p))&=(f\circ g)(p)\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\sigma^f,\left\langle p_x\sigma_0^g+\sigma_1^g,\sigma_3^g(p_y+\sigma_2^g)\right\rangle\right)\\
&=\left\langle(p_x\sigma_0^g+\sigma_1^g)\sigma_0^f+\sigma_1^f,\sigma_3^f\left(\sigma_3^g(p_y+\sigma_2^g)+\sigma_2^f\right)\right\rangle\\
&=\left\langle p_x\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_3^f\sigma_3^g\left(p_y+\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g}\right)\right\rangle\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right\rangle,p\right) \tag*{(107)}
\end{aligned} f ( g ( p )) = ( f ∘ g ) ( p ) = ϕ F 2 STR ′ ( σ f , ⟨ p x σ 0 g + σ 1 g , σ 3 g ( p y + σ 2 g ) ⟩ ) = ⟨ ( p x σ 0 g + σ 1 g ) σ 0 f + σ 1 f , σ 3 f ( σ 3 g ( p y + σ 2 g ) + σ 2 f ) ⟩ = ⟨ p x σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 3 f σ 3 g ( p y + σ 2 g + σ 3 g σ 2 f ) ⟩ = ϕ F 2 STR ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ , p ) (107)
Therefore
σ F 2 S T R ′ ( f ∘ g ) = ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , \sigma_{F'_{2\mathrm{STR}}}(f\circ g)=\left\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right\rangle, σ F 2 STR ′ ( f ∘ g ) = ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ ,
which implies that f ∘ g ∈ F 2 S T R ′ f\circ g\in F'_{2\mathrm{STR}} f ∘ g ∈ F 2 STR ′ , which implies that F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ is closed under transformation composition.
Associativity: Let f , g , h ∈ F 2 S T R ′ f,g,h\in F'_{2\mathrm{STR}} f , g , h ∈ F 2 STR ′ , p ∈ R 2 p\in\mathbb{R}^{2} p ∈ R 2 and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Let σ f = σ F 2 S T R ′ ( f ) \sigma^f=\sigma_{F'_{2\mathrm{STR}}}(f) σ f = σ F 2 STR ′ ( f ) , σ g = σ F 2 S T R ′ ( g ) \sigma^g=\sigma_{F'_{2\mathrm{STR}}}(g) σ g = σ F 2 STR ′ ( g ) and σ h = σ F 2 S T R ′ ( h ) \sigma^h=\sigma_{F'_{2\mathrm{STR}}}(h) σ h = σ F 2 STR ′ ( h ) . Let σ i x = σ x [ i ] \sigma_i^x=\sigma^x[i] σ i x = σ x [ i ] . From (110),
( f ∘ g ) ( p ) = ϕ F 2 S T R ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , p ) (108) (f\circ g)(p)=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right\rangle,p\right) \tag*{(108)} ( f ∘ g ) ( p ) = ϕ F 2 STR ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ , p ) (108)
( g ∘ h ) ( p ) = ϕ F 2 S T R ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 2 g σ 3 h , σ 3 g σ 3 h ⟩ , p ) (109) (g\circ h)(p)=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^h\sigma_0^g,\sigma_1^h\sigma_0^g+\sigma_1^g,\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h},\sigma_3^g\sigma_3^h\right\rangle,p\right) \tag*{(109)} ( g ∘ h ) ( p ) = ϕ F 2 STR ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 3 h σ 2 g , σ 3 g σ 3 h ⟩ , p ) (109)
Therefore, from (107) and (111),
( f ∘ g ) ( h ( p ) ) = ϕ F 2 S T R ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , h ( p ) ) = ϕ F 2 S T R ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , ⟨ p x σ 0 h + σ 1 h , σ 3 h ( p y + σ 2 h ) ⟩ ) = ⟨ ( p x σ 0 h + σ 1 h ) σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 3 f σ 3 g ( σ 3 h ( p y + σ 2 h ) + σ 2 g + σ 2 f σ 3 g ) ⟩ = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h ) ⟩ = ϕ F 2 S T R ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h , σ 3 f σ 3 g σ 3 h ⟩ , p ) (110) \begin{aligned}
(f\circ g)(h(p))
&=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right\rangle,h(p)\right)\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right\rangle,\left\langle p_x\sigma_0^h+\sigma_1^h,\sigma_3^h(p_y+\sigma_2^h)\right\rangle\right)\\
&=\left\langle(p_x\sigma_0^h+\sigma_1^h)\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_3^f\sigma_3^g\left(\sigma_3^h(p_y+\sigma_2^h)+\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g}\right)\right\rangle\\
&=\left\langle p_x\sigma_0^h\sigma_0^g\sigma_0^f+\sigma_1^h\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_3^f\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h}\right)\right\rangle\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^h\sigma_0^g\sigma_0^f,\sigma_1^h\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h},\sigma_3^f\sigma_3^g\sigma_3^h\right\rangle,p\right) \tag*{(110)}
\end{aligned} ( f ∘ g ) ( h ( p )) = ϕ F 2 STR ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ , h ( p ) ) = ϕ F 2 STR ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ , ⟨ p x σ 0 h + σ 1 h , σ 3 h ( p y + σ 2 h ) ⟩ ) = ⟨ ( p x σ 0 h + σ 1 h ) σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 3 f σ 3 g ( σ 3 h ( p y + σ 2 h ) + σ 2 g + σ 3 g σ 2 f ) ⟩ = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f ) ⟩ = ϕ F 2 STR ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f , σ 3 f σ 3 g σ 3 h ⟩ , p ) (110)
and, from (107) and (112),
f ( ( g ∘ h ) ( p ) ) = ϕ F 2 S T R ′ ( σ F 2 S T R ′ ( f ) , ϕ F 2 S T R ′ ( σ F 2 S T R ′ ( g ∘ h ) , p ) ) = ϕ F 2 S T R ′ ( σ F 2 S T R ′ ( f ) , ϕ F 2 S T R ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 g + σ 2 g σ 3 h , σ 3 g σ 3 h ⟩ , p ) ) = ϕ F 2 S T R ′ ( σ F 2 S T R ′ ( f ) , ⟨ p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g , σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h ) ⟩ ) = ⟨ σ 0 f ( p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g ) + σ 1 f , σ 3 f ( σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h ) ) + σ 2 f ⟩ = ⟨ p x σ 0 f σ 0 h σ 0 g + σ 0 f σ 1 h σ 0 g + σ 0 f σ 1 g + σ 1 f , σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h ) ⟩ = ϕ F 2 S T R ′ ( ⟨ σ 0 f σ 0 h σ 0 g , σ 0 f σ 0 h σ 1 g + σ 0 f σ 1 g + σ 1 f , σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h , σ 3 f σ 3 g σ 3 h ⟩ , p ) (111) \begin{aligned}
f((g\circ h)(p))
&=\phi_{F'_{2\mathrm{STR}}}\left(\sigma_{F'_{2\mathrm{STR}}}(f),\phi_{F'_{2\mathrm{STR}}}\left(\sigma_{F'_{2\mathrm{STR}}}(g\circ h),p\right)\right)\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\sigma_{F'_{2\mathrm{STR}}}(f),\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^h\sigma_0^g,\sigma_1^h\sigma_0^g+\sigma_1^g,\sigma_2^g+\frac{\sigma_2^g}{\sigma_3^h},\sigma_3^g\sigma_3^h\right\rangle,p\right)\right)\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\sigma_{F'_{2\mathrm{STR}}}(f),\left\langle p_x\sigma_0^h\sigma_0^g+\sigma_1^h\sigma_0^g+\sigma_1^g,\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}\right)\right\rangle\right)\\
&=\left\langle\sigma_0^f\left(p_x\sigma_0^h\sigma_0^g+\sigma_1^h\sigma_0^g+\sigma_1^g\right)+\sigma_1^f,\sigma_3^f\left(\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}\right)\right)+\sigma_2^f\right\rangle\\
&=\left\langle p_x\sigma_0^f\sigma_0^h\sigma_0^g+\sigma_0^f\sigma_1^h\sigma_0^g+\sigma_0^f\sigma_1^g+\sigma_1^f,\sigma_3^f\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h}\right)\right\rangle\\
&=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\sigma_0^f\sigma_0^h\sigma_0^g,\sigma_0^f\sigma_0^h\sigma_1^g+\sigma_0^f\sigma_1^g+\sigma_1^f,\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h},\sigma_3^f\sigma_3^g\sigma_3^h\right\rangle,p\right) \tag*{(111)}
\end{aligned} f (( g ∘ h ) ( p )) = ϕ F 2 STR ′ ( σ F 2 STR ′ ( f ) , ϕ F 2 STR ′ ( σ F 2 STR ′ ( g ∘ h ) , p ) ) = ϕ F 2 STR ′ ( σ F 2 STR ′ ( f ) , ϕ F 2 STR ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 g + σ 3 h σ 2 g , σ 3 g σ 3 h ⟩ , p ) ) = ϕ F 2 STR ′ ( σ F 2 STR ′ ( f ) , ⟨ p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g , σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g ) ⟩ ) = ⟨ σ 0 f ( p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g ) + σ 1 f , σ 3 f ( σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g ) ) + σ 2 f ⟩ = ⟨ p x σ 0 f σ 0 h σ 0 g + σ 0 f σ 1 h σ 0 g + σ 0 f σ 1 g + σ 1 f , σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f ) ⟩ = ϕ F 2 STR ′ ( ⟨ σ 0 f σ 0 h σ 0 g , σ 0 f σ 0 h σ 1 g + σ 0 f σ 1 g + σ 1 f , σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f , σ 3 f σ 3 g σ 3 h ⟩ , p ) (111)
From (113) and (114), it follows that ( f ∘ g ) ( h ( p ) ) = f ( ( g ∘ h ) ( p ) ) (f\circ g)(h(p))=f((g\circ h)(p)) ( f ∘ g ) ( h ( p )) = f (( g ∘ h ) ( p )) and that therefore transformation composition is associative over F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ .
Identity element: Suppose that e ∈ F 2 S T R ′ e \in F'_{2\mathrm{STR}} e ∈ F 2 STR ′ and σ F 2 S T R ′ ( e ) = ⟨ 1 , 0 , 0 , 1 ⟩ \sigma_{F'_{2\mathrm{STR}}}(e)=\langle1,0,0,1\rangle σ F 2 STR ′ ( e ) = ⟨ 1 , 0 , 0 , 1 ⟩ . Let p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Then, from (104) ,
e ( p ) = ϕ F 2 S T R ′ ( ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ p x , p y ⟩ ) = ⟨ 1 p x + 0 , 1 ( p y + 0 ) ⟩ = ⟨ p x , p y ⟩ = p (112) \begin{aligned}
e(p) &= \phi_{F'_{2\mathrm{STR}}}\left(\langle1,0,0,1\rangle,\langle p_x,p_y\rangle\right)\\
&=\langle1p_x+0,1(p_y+0)\rangle\\
&=\langle p_x,p_y\rangle=p \tag*{(112)}
\end{aligned} e ( p ) = ϕ F 2 STR ′ ( ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ p x , p y ⟩ ) = ⟨ 1 p x + 0 , 1 ( p y + 0 )⟩ = ⟨ p x , p y ⟩ = p (112)
Therefore, e ( p ) = p e(p)=p e ( p ) = p for all p ∈ R 2 p \in\mathbb{R}^{2} p ∈ R 2 . e e e is therefore a universal identity element in F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ .
Invertibility: Let p , q ∈ R 2 p,q \in\mathbb{R}^{2} p , q ∈ R 2 and let q = ϕ F 2 S T R ′ ( σ , p ) q=\phi_{F'_{2\mathrm{STR}}}(\sigma,p) q = ϕ F 2 STR ′ ( σ , p ) where σ = ⟨ σ 0 , σ 1 , σ 2 , σ 3 ⟩ \sigma=\langle\sigma_0,\sigma_1,\sigma_2,\sigma_3\rangle σ = ⟨ σ 0 , σ 1 , σ 2 , σ 3 ⟩ , p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ and q = ⟨ q x , q y ⟩ q=\langle q_x,q_y\rangle q = ⟨ q x , q y ⟩ . Then, from (104) ,
q = ⟨ p x σ 0 + σ 1 , σ 3 ( p y + σ 2 ) ⟩ q=\langle p_x\sigma_0+\sigma_1,\sigma_3(p_y+\sigma_2)\rangle q = ⟨ p x σ 0 + σ 1 , σ 3 ( p y + σ 2 )⟩
and therefore
p = ⟨ p x , p y ⟩ = ⟨ q x − σ 1 σ 0 , 1 σ 3 ( q y − σ 3 σ 2 ) ⟩ = ϕ F 2 S T R ′ ( ⟨ 1 σ 0 , − σ 1 σ 0 , − σ 3 σ 2 , 1 σ 3 ⟩ , q ) . p=\langle p_x,p_y\rangle=\left\langle\frac{q_x-\sigma_1}{\sigma_0},\frac{1}{\sigma_3}(q_y-\sigma_3\sigma_2)\right\rangle=\phi_{F'_{2\mathrm{STR}}}\left(\left\langle\frac{1}{\sigma_0},-\frac{\sigma_1}{\sigma_0},-\sigma_3\sigma_2,\frac{1}{\sigma_3}\right\rangle,q\right). p = ⟨ p x , p y ⟩ = ⟨ σ 0 q x − σ 1 , σ 3 1 ( q y − σ 3 σ 2 ) ⟩ = ϕ F 2 STR ′ ( ⟨ σ 0 1 , − σ 0 σ 1 , − σ 3 σ 2 , σ 3 1 ⟩ , q ) .
Recall that σ 3 ∈ { 1 , − 1 } \sigma_3\in\{1,-1\} σ 3 ∈ { 1 , − 1 } . Therefore, if f ∈ F 2 S T R ′ f\in F'_{2\mathrm{STR}} f ∈ F 2 STR ′ and σ = σ F 2 S T R ′ ( f ) \sigma=\sigma_{F'_{2\mathrm{STR}}}(f) σ = σ F 2 STR ′ ( f ) , then
σ F 2 S T R ′ ( f − 1 ) = ⟨ 1 σ 0 , − σ 1 σ 0 , − σ 3 σ 2 , σ 3 ⟩ . \sigma_{F'_{2\mathrm{STR}}}(f^{-1})=\left\langle\frac{1}{\sigma_0},-\frac{\sigma_1}{\sigma_0},-\sigma_3\sigma_2,\sigma_3\right\rangle. σ F 2 STR ′ ( f − 1 ) = ⟨ σ 0 1 , − σ 0 σ 1 , − σ 3 σ 2 , σ 3 ⟩ .
Therefore, every transformation in F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ has a unique inverse.
F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ is therefore a transformation group. □ \square □
Corollary 8. M F 2 S T R ′ M_{F'_{2\mathrm{STR}}} M F 2 STR ′ is a transformational equivalence relation.
Proof. This follows directly from Lemma 8 and Corollary 1. □ \square □
Corollary 9. If P , D ⊂ R 2 P,D\subset\mathbb{R}^{2} P , D ⊂ R 2 , then OS ( P , D , F 2 S T R ′ ) \operatorname{OS}(P,D,F'_{2\mathrm{STR}}) OS ( P , D , F 2 STR ′ ) is a set of transformationally equivalent patterns.
Proof. From Corollary 8, we know that M F 2 S T R ′ M_{F'_{2\mathrm{STR}}} M F 2 STR ′ is a transformational equivalence relation, and therefore an equivalence relation over 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 . From Lemma 4, it follows that M F 2 S T R ′ M_{F'_{2\mathrm{STR}}} M F 2 STR ′ partitions 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 exhaustively and exclusively into transformational equivalence classes. It follows that OS ( P , D , F 2 S T R ′ ) ⊂ [ P ] F 2 S T R ′ \operatorname{OS}(P,D,F'_{2\mathrm{STR}})\subset[P]_{F'_{2\mathrm{STR}}} OS ( P , D , F 2 STR ′ ) ⊂ [ P ] F 2 STR ′ and that therefore OS ( P , D , F 2 S T R ′ ) \operatorname{OS}(P,D,F'_{2\mathrm{STR}}) OS ( P , D , F 2 STR ′ ) is a set of transformationally equivalent patterns. □ \square □
F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ and F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ For some specified value of μ \mu μ , F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ was defined in Section 3.2 above to be the set of 2-dimensional transformations, such that each transformation, f ∈ F 2 S T R m o d μ f\in F_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ , takes a point, p = ⟨ x , y ⟩ p=\langle x,y\rangle p = ⟨ x , y ⟩ , multiplies x x x by a real-valued scale factor, s s s , (which may be zero) to get a new point, p ′ = ⟨ s x , y ⟩ p'=\langle sx,y\rangle p ′ = ⟨ s x , y ⟩ , then translates p ′ p' p ′ by a vector, v = ⟨ v x , v y ⟩ v=\langle v_x,v_y\rangle v = ⟨ v x , v y ⟩ , with the y y y -component of p ′ p' p ′ being added modulo μ \mu μ to the y y y -component of v v v , to give a new point, p ′ ′ = ⟨ s x + v x , ( y + v y ) m o d μ ⟩ p''=\langle sx+v_x,(y+v_y)\bmod\mu\rangle p ′′ = ⟨ s x + v x , ( y + v y ) mod μ ⟩ . Finally, p ′ ′ p'' p ′′ may be reflected in the x x x -axis, modulo μ \mu μ , to give a point, q = ⟨ s x + v x , ( b ( y + v y ) ) m o d μ ⟩ q=\langle sx+v_x,(b(y+v_y))\bmod\mu\rangle q = ⟨ s x + v x , ( b ( y + v y )) mod μ ⟩ , where b = − 1 b=-1 b = − 1 if p ′ ′ p'' p ′′ is reflected and b = 1 b=1 b = 1 if it is not. As was the case with F 2 S T R F_{2\mathrm{STR}} F 2 STR and F 2 S T R F_{2\mathrm{STR}} F 2 STR , any transformation in F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that has an x x x -axis scale factor of zero does not have a unique inverse. Therefore F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ is not a transformation group.
Let P , D ⊂ R 2 P,D\subset\mathbb{R}^{2} P , D ⊂ R 2 and suppose that we have an occurrence set, OS ( P , D , F 2 S T R m o d μ ) \operatorname{OS}(P,D,F_{2\mathrm{STRmod}\mu}) OS ( P , D , F 2 STRmod μ ) , for a given value of μ \mu μ , that contains an occurrence, Q Q Q , of P P P , such that the x x x -axis scale factor of the transformation that maps P P P onto Q Q Q is zero. Let S S S be the subset of OS ( P , D , F 2 S T R m o d μ ) \operatorname{OS}(P,D,F_{2\mathrm{STRmod}\mu}) OS ( P , D , F 2 STRmod μ ) that contains occurrences of P P P in D D D with respect to F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that can be obtained from P P P by transformations whose x x x -axis scale factor is not zero. There is then no transformation in F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that maps Q Q Q onto any of the occurrences in S S S , so if S S S is not empty, then OS ( P , D , F 2 S T R m o d μ ) \operatorname{OS}(P,D,F_{2\mathrm{STRmod}\mu}) OS ( P , D , F 2 STRmod μ ) is not a set of transformationally equivalent patterns. Moreover, this shows that M F 2 S T R m o d μ \mathcal{M}_{F_{2\mathrm{STRmod}\mu}} M F 2 STRmod μ is not a transformational equivalence relation.
We therefore define that, for a given value of μ \mu μ , F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is the subset of F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ that contains only the transformations in F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ whose x x x -axis scale factors are non-zero. λ ( F 2 S T R m o d μ ′ ) = 4 \lambda(F'_{2\mathrm{STRmod}\mu})=4 λ ( F 2 STRmod μ ′ ) = 4 and each transformation, f ∈ F 2 S T R m o d μ ′ f\in F'_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ ′ , can be uniquely identified by a 4-vector, ⟨ s , v x , v y , b ⟩ \langle s,v_x,v_y,b\rangle ⟨ s , v x , v y , b ⟩ , where s ∈ R ∖ { 0 } s\in\mathbb{R}\setminus\{0\} s ∈ R ∖ { 0 } , v x ∈ R v_x\in\mathbb{R} v x ∈ R , v y ∈ R μ v_y\in\mathbb{R}_{\mu} v y ∈ R μ and b ∈ { − 1 , 1 } b\in\{-1,1\} b ∈ { − 1 , 1 } . If σ F 2 S T R m o d μ ′ ( f ) = ⟨ s , v x , v y , b ⟩ \sigma_{F'_{2\mathrm{STRmod}\mu}}(f)=\langle s,v_x,v_y,b\rangle σ F 2 STRmod μ ′ ( f ) = ⟨ s , v x , v y , b ⟩ , then f ( p ) = ⟨ s x + v x , ( b ( y + v y ) ) m o d μ ⟩ f(p)=\langle sx+v_x,(b(y+v_y))\bmod\mu\rangle f ( p ) = ⟨ s x + v x , ( b ( y + v y )) mod μ ⟩ and the transformation class function is the same as for F 2 S T R m o d μ F_{2\mathrm{STRmod}\mu} F 2 STRmod μ , that is,
ϕ F 2 S T R m o d μ ′ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , ( σ [ 3 ] ( p [ 1 ] + σ [ 2 ] ) ) m o d μ ⟩ (113) \phi_{F'_{2\mathrm{STRmod}\mu}}(\sigma,p)=\langle p[0]\sigma[0]+\sigma[1],(\sigma[3](p[1]+\sigma[2]))\bmod\mu\rangle \tag*{(113)} ϕ F 2 STRmod μ ′ ( σ , p ) = ⟨ p [ 0 ] σ [ 0 ] + σ [ 1 ] , ( σ [ 3 ] ( p [ 1 ] + σ [ 2 ])) mod μ ⟩ (113)
where p ∈ R × R μ p\in\mathbb{R}\times\mathbb{R}_{\mu} p ∈ R × R μ and there must exist a transformation, f ∈ F 2 S T R m o d μ ′ f\in F'_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ ′ , such that σ = σ F 2 S T R m o d μ ′ ( f ) \sigma=\sigma_{F'_{2\mathrm{STRmod}\mu}}(f) σ = σ F 2 STRmod μ ′ ( f ) .
We can define that β ( F 2 S T R m o d μ ′ ) = 2 \beta(F'_{2\mathrm{STRmod}\mu})=2 β ( F 2 STRmod μ ′ ) = 2 and that τ ( F 2 S T R m o d μ ′ ) = 2 \tau(F'_{2\mathrm{STRmod}\mu})=2 τ ( F 2 STRmod μ ′ ) = 2 . Given an object basis, ⟨ p 1 , p 2 ⟩ \langle p_1,p_2\rangle ⟨ p 1 , p 2 ⟩ , and an image basis, ⟨ q 1 , q 2 ⟩ \langle q_1,q_2\rangle ⟨ q 1 , q 2 ⟩ , the basis pair transformation function for F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is defined as follows:
T F 2 S T R m o d μ ′ ( ⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩ ) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( q 1 [ 1 ] − p 1 [ 1 ] ) m o d μ , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( − p 1 [ 1 ] − q 1 [ 1 ] ) m o d μ , − 1 ⟩ (114) \mathcal{T}_{F'_{2\mathrm{STRmod}\mu}}(\langle p_1,p_2\rangle,\langle q_1,q_2\rangle)=
\left\{
\begin{aligned}
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],(q_1[1]-p_1[1])\bmod\mu,1\rangle,\\
&\langle\sigma[0],q_2[0]-p_2[0]\sigma[0],(-p_1[1]-q_1[1])\bmod\mu,-1\rangle
\end{aligned}
\right. \tag*{(114)} T F 2 STRmod μ ′ (⟨ p 1 , p 2 ⟩ , ⟨ q 1 , q 2 ⟩) = { ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ , 1 ⟩ , ⟨ σ [ 0 ] , q 2 [ 0 ] − p 2 [ 0 ] σ [ 0 ] , ( − p 1 [ 1 ] − q 1 [ 1 ]) mod μ , − 1 ⟩ (114)
where
( q 1 [ 1 ] − p 1 [ 1 ] ) m o d μ = ( q 2 [ 1 ] − p 2 [ 1 ] ) m o d μ when σ [ 3 ] = 1 , (115) (q_1[1]-p_1[1])\bmod\mu=(q_2[1]-p_2[1])\bmod\mu\text{ when }\sigma[3]=1, \tag*{(115)} ( q 1 [ 1 ] − p 1 [ 1 ]) mod μ = ( q 2 [ 1 ] − p 2 [ 1 ]) mod μ when σ [ 3 ] = 1 , (115)
and
( p 1 [ 1 ] + q 1 [ 1 ] ) m o d μ = ( p 2 [ 1 ] + q 2 [ 1 ] ) m o d μ when σ [ 3 ] = − 1 , (116) (p_1[1]+q_1[1])\bmod\mu=(p_2[1]+q_2[1])\bmod\mu\text{ when }\sigma[3]=-1, \tag*{(116)} ( p 1 [ 1 ] + q 1 [ 1 ]) mod μ = ( p 2 [ 1 ] + q 2 [ 1 ]) mod μ when σ [ 3 ] = − 1 , (116)
and
σ [ 0 ] = { 1 , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and q 2 [ 0 ] − q 1 [ 0 ] p 2 [ 0 ] − p 1 [ 0 ] , otherwise, provided that p 2 [ 0 ] ≠ p 1 [ 0 ] and q 2 [ 0 ] ≠ q 1 [ 0 ] . (117) \sigma[0]=
\begin{cases}
1, & \text{if }p_2[0]=p_1[0]\text{ and }q_2[0]=q_1[0];\text{ and}\\
\dfrac{q_2[0]-q_1[0]}{p_2[0]-p_1[0]}, & \text{otherwise, provided that }p_2[0]\ne p_1[0]\text{ and }q_2[0]\ne q_1[0].
\end{cases} \tag*{(117)} σ [ 0 ] = ⎩ ⎨ ⎧ 1 , p 2 [ 0 ] − p 1 [ 0 ] q 2 [ 0 ] − q 1 [ 0 ] , if p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] ; and otherwise, provided that p 2 [ 0 ] = p 1 [ 0 ] and q 2 [ 0 ] = q 1 [ 0 ] . (117)
$\mathcal{F}'_{2\mathrm{STRmod}\mu}(\mathbf{b}_{\mathrm{obj}},\mathbf{b}_{\mathrm{img}})$
1 if $\mathbf{b}_{\mathrm{img}} = \mathbf{b}_{\mathrm{obj}}$
2 return $\{ \langle 1,0,0,1\rangle \}$ ▸ *Identity transformation*
3 $\mathbf{p}_1 \leftarrow \mathbf{b}_{\mathrm{obj}}[0], \mathbf{p}_2 \leftarrow \mathbf{b}_{\mathrm{obj}}[1], q_1 \leftarrow \mathbf{b}_{\mathrm{img}}[0], q_2 \leftarrow \mathbf{b}_{\mathrm{img}}[1]$
4 if $q_2[0] \ne q_1[0] \land p_2[0] = p_1[0]$ ▸ $\sigma[0]$ is undefined.
5 return $\{\}$
6 if $q_2[0] = q_1[0] \land p_2[0] = p_1[0]$ ▸ $\sigma[0] = 0/0$
7 $\sigma_0 \leftarrow 1$
▸ So $p_2[0] \ne p_1[0]$
8 else if $q_2[0] = q_1[0]$ ▸ Would require $\sigma_0$ to be zero.
9 return $\{\}$
10 else
11 $\sigma_0 \leftarrow (q_2[0] - q_1[0])/(p_2[0] - p_1[0])$ ▸ From (52)
12 $S \leftarrow \{\}$
13 $\sigma_1 \leftarrow q_2[0] - p_2[0]\sigma_0$ ▸ From (54)
14 if $(q_1[1] - p_1[1]) \bmod \mu = (q_2[1] - p_2[1]) \bmod \mu$ ▸ From (51)
15 $\sigma_3 \leftarrow 1$
16 $\sigma_2 \leftarrow (q_1[1] - p_1[1]) \bmod \mu$ ▸ From (49)
17 $S \leftarrow \{\langle \sigma_0,\sigma_1,\sigma_2,\sigma_3\rangle\}$
18 if $(p_1[1] + q_1[1]) \bmod \mu = (p_2[1] + q_2[1]) \bmod \mu$ ▸ From (58)
19 $\sigma_3 \leftarrow -1$
20 $\sigma_2 \leftarrow (-p_1[1] - q_1[1]) \bmod \mu$ ▸ From (56)
21 $S \leftarrow S \cup \{\langle \sigma_0,\sigma_1,\sigma_2,\sigma_3\rangle\}$
22 return $S$
F 2 S T R m o d μ ′ \mathcal{F}'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ can be computed using the algorithm in Figure 23 . Note that this algorithm is the same as that in Figure 14 except that an extra check has been added in lines 8–9 to ensure that the x x x -axis scale factor cannot be zero.
Figure 23. Algorithm for computing the basis-pair transformation set function for F 2 S T R m o d μ ′ \mathcal{F}'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ .
We will now show that F 2 S T R m o d μ ′ \mathcal{F}'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is a transformation group.
Lemma 9. For any real value of μ > 0 \mu> 0 μ > 0 , F 2 S T R m o d μ ′ \mathcal{F}'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is a transformation group.
Proof. In order to prove that F 2 S T R m o d μ ′ \mathcal{F}'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is a transformation group, we need to show that it satisfies the conditions of closure, associativity, presence of a unique identity element, and invertibility.
Closure: Let f , g ∈ F 2 S T R m o d μ ′ f,g \in\mathcal{F}'_{2\mathrm{STRmod}\mu} f , g ∈ F 2 STRmod μ ′ , p ∈ R × R μ p \in\mathbb{R} \times\mathbb{R}_{\mu} p ∈ R × R μ and p = ⟨ p x , p y ⟩ p = \langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . By definition, f ( g ( p ) ) = ( f ∘ g ) ( p ) f(g(p)) = (f \circ g)(p) f ( g ( p )) = ( f ∘ g ) ( p ) . Let σ f = σ F 2 S T R m o d μ ′ ( f ) \sigma^f = \sigma_{\mathcal{F}'_{2\mathrm{STRmod}\mu}}(f) σ f = σ F 2 STRmod μ ′ ( f ) and let σ g = σ F 2 S T R m o d μ ′ ( g ) \sigma^g = \sigma_{\mathcal{F}'_{2\mathrm{STRmod}\mu}}(g) σ g = σ F 2 STRmod μ ′ ( g ) . Let
σ i x = σ x [ i ] \sigma_i^x=\sigma^x[i] σ i x = σ x [ i ] . From (113) ,
f ( g ( p ) ) = ( f ∘ g ) ( p ) = ϕ F 2 S T R m o d μ ′ ( ⟨ p x σ 0 g + σ 1 g , ( σ 3 g ( p y + σ 2 g ) ) m o d μ ⟩ ) = ⟨ ( p x σ 0 g + σ 1 g ) σ 0 f + σ 1 f , ( σ 3 f ( σ 3 g ( p y + σ 2 g ) + σ 2 f ) ) m o d μ ⟩ = ⟨ p x σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , ( σ 3 f σ 3 g ( p y + σ 2 g + σ 2 f σ 3 g ) ) m o d μ ⟩ = ϕ F 2 S T R m o d μ ′ ( ⟨ ( σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ) , p ⟩ ) (118) \begin{aligned}
f(g(p))&=(f\circ g)(p)\\
&=\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle p_x\sigma_0^g+\sigma_1^g,\left(\sigma_3^g\left(p_y+\sigma_2^g\right)\right)\bmod\mu\right\rangle\right)\\
&=\left\langle\left(p_x\sigma_0^g+\sigma_1^g\right)\sigma_0^f+\sigma_1^f,\left(\sigma_3^f\left(\sigma_3^g\left(p_y+\sigma_2^g\right)+\sigma_2^f\right)\right)\bmod\mu\right\rangle\\
&=\left\langle p_x\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,\left(\sigma_3^f\sigma_3^g\left(p_y+\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g}\right)\right)\bmod\mu\right\rangle\\
&=\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\left(\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right),p\right\rangle\right) \tag*{(118)}
\end{aligned} f ( g ( p )) = ( f ∘ g ) ( p ) = ϕ F 2 STRmod μ ′ ( ⟨ p x σ 0 g + σ 1 g , ( σ 3 g ( p y + σ 2 g ) ) mod μ ⟩ ) = ⟨ ( p x σ 0 g + σ 1 g ) σ 0 f + σ 1 f , ( σ 3 f ( σ 3 g ( p y + σ 2 g ) + σ 2 f ) ) mod μ ⟩ = ⟨ p x σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , ( σ 3 f σ 3 g ( p y + σ 2 g + σ 3 g σ 2 f ) ) mod μ ⟩ = ϕ F 2 STRmod μ ′ ( ⟨ ( σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ) , p ⟩ ) (118)
Therefore
σ F 2 S T R m o d μ ′ ( f ∘ g ) = ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ \sigma_{F'_{2\mathrm{STRmod}\mu}}(f\circ g)=\left\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right\rangle σ F 2 STRmod μ ′ ( f ∘ g ) = ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩
which implies that f ∘ g ∈ F 2 S T R m o d μ ′ f\circ g\in F'_{2\mathrm{STRmod}\mu} f ∘ g ∈ F 2 STRmod μ ′ , which implies that F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is closed under transformation composition.
Associativity: Let f , g , h ∈ F 2 S T R m o d μ ′ f,g,h\in F'_{2\mathrm{STRmod}\mu} f , g , h ∈ F 2 STRmod μ ′ , p ∈ R × R μ p\in\mathbb{R}\times\mathbb{R}_\mu p ∈ R × R μ and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Let σ f = σ F 2 S T R m o d μ ′ ( f ) \sigma^f=\sigma_{F'_{2\mathrm{STRmod}\mu}}(f) σ f = σ F 2 STRmod μ ′ ( f ) , σ g = σ F 2 S T R m o d μ ′ ( g ) \sigma^g=\sigma_{F'_{2\mathrm{STRmod}\mu}}(g) σ g = σ F 2 STRmod μ ′ ( g ) and σ h = σ F 2 S T R m o d μ ′ ( h ) \sigma^h=\sigma_{F'_{2\mathrm{STRmod}\mu}}(h) σ h = σ F 2 STRmod μ ′ ( h ) . Let σ i x = σ x [ i ] \sigma_i^x=\sigma^x[i] σ i x = σ x [ i ] . From (118) ,
( f ∘ g ) ( p ) = ϕ F 2 S T R m o d μ ′ ( ⟨ ( σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ) , p ⟩ ) (119) (f\circ g)(p)=\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\left(\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\right),p\right\rangle\right) \tag*{(119)} ( f ∘ g ) ( p ) = ϕ F 2 STRmod μ ′ ( ⟨ ( σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ) , p ⟩ ) (119)
( g ∘ h ) ( p ) = ϕ F 2 S T R m o d μ ′ ( ⟨ ( σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 2 g σ 3 h , σ 3 g σ 3 h ) , p ⟩ ) (120) (g\circ h)(p)=\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\left(\sigma_0^h\sigma_0^g,\sigma_1^h\sigma_0^g+\sigma_1^g,\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h},\sigma_3^g\sigma_3^h\right),p\right\rangle\right) \tag*{(120)} ( g ∘ h ) ( p ) = ϕ F 2 STRmod μ ′ ( ⟨ ( σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 h + σ 3 h σ 2 g , σ 3 g σ 3 h ) , p ⟩ ) (120)
Therefore, from (113) and (119) ,
( f ∘ g ) ( h ( p ) ) = ϕ F 2 S T R m o d μ ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , h ( p ) ) = ϕ F 2 S T R m o d μ ′ ( ⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 2 f σ 3 g , σ 3 f σ 3 g ⟩ , ⟨ p x σ 0 h + σ 1 h , ( σ 3 h ( p y + σ 2 h ) ) m o d μ ⟩ ) = ⟨ ( p x σ 0 h + σ 1 h ) σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , ( σ 3 f σ 3 g ( σ 3 h ( p y + σ 2 h ) + σ 2 g + σ 2 f σ 3 g ) ) m o d μ ⟩ ) = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , ( σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h ) ) m o d μ ⟩ = ϕ F 2 S T R m o d μ ′ ( ⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h , σ 3 f σ 3 g σ 3 h ⟩ , p ) (121) \begin{aligned}
(f\circ g)(h(p)) & = \phi_{F'_{2\mathrm{STRmod}\mu}}(\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\rangle,h(p)) \\
& = \phi_{F'_{2\mathrm{STRmod}\mu}}(\langle\sigma_0^g\sigma_0^f,\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g},\sigma_3^f\sigma_3^g\rangle,\langle p_x\sigma_0^h+\sigma_1^h,(\sigma_3^h(p_y+\sigma_2^h))\bmod\mu\rangle) \\
& = \langle(p_x\sigma_0^h+\sigma_1^h)\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,(\sigma_3^f\sigma_3^g(\sigma_3^h(p_y+\sigma_2^h)+\sigma_2^g+\frac{\sigma_2^f}{\sigma_3^g}))\bmod\mu\rangle) \\
& = \langle p_x\sigma_0^h\sigma_0^g\sigma_0^f+\sigma_1^h\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,(\sigma_3^f\sigma_3^g\sigma_3^h(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h}))\bmod\mu\rangle\\
& = \phi_{F'_{2\mathrm{STRmod}\mu}}(\langle\sigma_0^h\sigma_0^g\sigma_0^f,\sigma_1^h\sigma_0^g\sigma_0^f+\sigma_1^g\sigma_0^f+\sigma_1^f,\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h},\sigma_3^f\sigma_3^g\sigma_3^h\rangle,p) \tag*{(121)}
\end{aligned} ( f ∘ g ) ( h ( p )) = ϕ F 2 STRmod μ ′ (⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ , h ( p )) = ϕ F 2 STRmod μ ′ (⟨ σ 0 g σ 0 f , σ 1 g σ 0 f + σ 1 f , σ 2 g + σ 3 g σ 2 f , σ 3 f σ 3 g ⟩ , ⟨ p x σ 0 h + σ 1 h , ( σ 3 h ( p y + σ 2 h )) mod μ ⟩) = ⟨( p x σ 0 h + σ 1 h ) σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , ( σ 3 f σ 3 g ( σ 3 h ( p y + σ 2 h ) + σ 2 g + σ 3 g σ 2 f )) mod μ ⟩) = ⟨ p x σ 0 h σ 0 g σ 0 f + σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , ( σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f )) mod μ ⟩ = ϕ F 2 STRmod μ ′ (⟨ σ 0 h σ 0 g σ 0 f , σ 1 h σ 0 g σ 0 f + σ 1 g σ 0 f + σ 1 f , σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f , σ 3 f σ 3 g σ 3 h ⟩ , p ) (121)
and, from (113) and (120) ,
f ( ( g ∘ h ) ( p ) ) = ϕ F 2 S T R m o d μ ′ ( σ f , ϕ F 2 S T R m o d μ ′ ( ⟨ σ 0 f , σ 1 f , σ 2 f , σ 3 f ⟩ , ( g ∘ h ) , p ) ) = ϕ F 2 S T R m o d μ ′ ( σ f , ϕ F 2 S T R m o d μ ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 g + σ 2 g σ 3 h , σ 3 g σ 3 h ⟩ , p ) ) = ϕ F 2 S T R m o d μ ′ ( σ f , ⟨ p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g , ( σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h ) ) m o d μ ⟩ ) = ⟨ σ 0 f ( p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g ) + σ 1 f , ( σ 3 f ( σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h ) + σ 2 f ) ) m o d μ ⟩ = ⟨ p x σ 0 f σ 0 h σ 0 g + σ 0 f σ 1 h σ 0 g + σ 0 f σ 1 g + σ 1 f , ( σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h ) ) m o d μ ⟩ = ϕ F 2 S T R m o d μ ′ ( ⟨ σ 0 f σ 0 h σ 0 g , σ 0 f σ 1 h σ 0 g + σ 0 f σ 1 g + σ 1 f , σ 2 h + σ 2 g σ 3 h + σ 2 f σ 3 g σ 3 h , σ 3 f σ 3 g σ 3 h ⟩ , p ) (122) \begin{aligned}
f((g\circ h)(p)) & = \phi_{F'_{2\mathrm{STRmod}\mu}}\left(\sigma^f,\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\sigma_0^f,\sigma_1^f,\sigma_2^f,\sigma_3^f\right\rangle,(g\circ h),p\right)\right) \\
& = \phi_{F'_{2\mathrm{STRmod}\mu}}\left(\sigma^f,\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\sigma_0^h\sigma_0^g,\sigma_1^h\sigma_0^g+\sigma_1^g,\sigma_2^g+\frac{\sigma_2^g}{\sigma_3^h},\sigma_3^g\sigma_3^h\right\rangle,p\right)\right) \\
& = \phi_{F'_{2\mathrm{STRmod}\mu}}\left(\sigma^f,\left\langle p_x\sigma_0^h\sigma_0^g+\sigma_1^h\sigma_0^g+\sigma_1^g,\left(\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}\right)\right)\bmod\mu\right\rangle\right) \\
& = \left\langle\sigma_0^f\left(p_x\sigma_0^h\sigma_0^g+\sigma_1^h\sigma_0^g+\sigma_1^g\right)+\sigma_1^f,\left(\sigma_3^f\left(\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}\right)+\sigma_2^f\right)\right)\bmod\mu\right\rangle\\
& = \left\langle p_x\sigma_0^f\sigma_0^h\sigma_0^g+\sigma_0^f\sigma_1^h\sigma_0^g+\sigma_0^f\sigma_1^g+\sigma_1^f,\left(\sigma_3^f\sigma_3^g\sigma_3^h\left(p_y+\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h}\right)\right)\bmod\mu\right\rangle\\
& = \phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\sigma_0^f\sigma_0^h\sigma_0^g,\sigma_0^f\sigma_1^h\sigma_0^g+\sigma_0^f\sigma_1^g+\sigma_1^f,\sigma_2^h+\frac{\sigma_2^g}{\sigma_3^h}+\frac{\sigma_2^f}{\sigma_3^g\sigma_3^h},\sigma_3^f\sigma_3^g\sigma_3^h\right\rangle,p\right) \tag*{(122)}
\end{aligned} f (( g ∘ h ) ( p )) = ϕ F 2 STRmod μ ′ ( σ f , ϕ F 2 STRmod μ ′ ( ⟨ σ 0 f , σ 1 f , σ 2 f , σ 3 f ⟩ , ( g ∘ h ) , p ) ) = ϕ F 2 STRmod μ ′ ( σ f , ϕ F 2 STRmod μ ′ ( ⟨ σ 0 h σ 0 g , σ 1 h σ 0 g + σ 1 g , σ 2 g + σ 3 h σ 2 g , σ 3 g σ 3 h ⟩ , p ) ) = ϕ F 2 STRmod μ ′ ( σ f , ⟨ p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g , ( σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g ) ) mod μ ⟩ ) = ⟨ σ 0 f ( p x σ 0 h σ 0 g + σ 1 h σ 0 g + σ 1 g ) + σ 1 f , ( σ 3 f ( σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g ) + σ 2 f ) ) mod μ ⟩ = ⟨ p x σ 0 f σ 0 h σ 0 g + σ 0 f σ 1 h σ 0 g + σ 0 f σ 1 g + σ 1 f , ( σ 3 f σ 3 g σ 3 h ( p y + σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f ) ) mod μ ⟩ = ϕ F 2 STRmod μ ′ ( ⟨ σ 0 f σ 0 h σ 0 g , σ 0 f σ 1 h σ 0 g + σ 0 f σ 1 g + σ 1 f , σ 2 h + σ 3 h σ 2 g + σ 3 g σ 3 h σ 2 f , σ 3 f σ 3 g σ 3 h ⟩ , p ) (122)
From (121) and (122) , it follows that ( f ∘ g ) ( h ( p ) ) = f ( ( g ∘ h ) ( p ) ) (f\circ g)(h(p))=f((g\circ h)(p)) ( f ∘ g ) ( h ( p )) = f (( g ∘ h ) ( p )) and that therefore transformation composition is associative over F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ .
Identity element: Suppose that e ∈ F 2 S T R m o d μ ′ e \in F'_{2\mathrm{STRmod}\mu} e ∈ F 2 STRmod μ ′ and σ F 2 S T R m o d μ ′ ( e ) = ⟨ 1 , 0 , 0 , 1 ⟩ \sigma_{F'_{2\mathrm{STRmod}\mu}}(e)=\langle1,0,0,1\rangle σ F 2 STRmod μ ′ ( e ) = ⟨ 1 , 0 , 0 , 1 ⟩ . Let p ∈ R × R μ p \in\mathbb{R}\times\mathbb{R}_{\mu} p ∈ R × R μ and p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ . Then, from (116),
e ( p ) = ϕ F 2 S T R m o d μ ′ ( ⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ p x , p y ⟩ ) = ⟨ 1 p x + 0 , ( 1 ( p y + 0 ) ) m o d μ ⟩ = ⟨ p x , p y ⟩ = p (123) \begin{aligned}
e(p) &= \phi_{F'_{2\mathrm{STRmod}\mu}}(\langle1,0,0,1\rangle,\langle p_x,p_y\rangle)\\
&=\langle1p_x+0,(1(p_y+0))\bmod\mu\rangle\\
&=\langle p_x,p_y\rangle=p \tag*{(123)}
\end{aligned} e ( p ) = ϕ F 2 STRmod μ ′ (⟨ 1 , 0 , 0 , 1 ⟩ , ⟨ p x , p y ⟩) = ⟨ 1 p x + 0 , ( 1 ( p y + 0 )) mod μ ⟩ = ⟨ p x , p y ⟩ = p (123)
Therefore, e ( p ) = p e(p)=p e ( p ) = p for all p ∈ R 2 p\in\mathbb{R}^{2} p ∈ R 2 . e e e is therefore a universal identity element in F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ .
Invertibility: Let p , q ∈ R × R μ p,q\in\mathbb{R}\times\mathbb{R}_{\mu} p , q ∈ R × R μ and let q = ϕ F 2 S T R m o d μ ′ ( σ , p ) q=\phi_{F'_{2\mathrm{STRmod}\mu}}(\sigma,p) q = ϕ F 2 STRmod μ ′ ( σ , p ) where σ = ⟨ σ 0 , σ 1 , σ 2 , σ 3 ⟩ \sigma=\langle\sigma_0,\sigma_1,\sigma_2,\sigma_3\rangle σ = ⟨ σ 0 , σ 1 , σ 2 , σ 3 ⟩ , p = ⟨ p x , p y ⟩ p=\langle p_x,p_y\rangle p = ⟨ p x , p y ⟩ and q = ⟨ q x , q y ⟩ q=\langle q_x,q_y\rangle q = ⟨ q x , q y ⟩ . Then, from (116),
q = ⟨ p x σ 0 + σ 1 , ( σ 3 ( p y + σ 2 ) ) m o d μ ⟩ q=\langle p_x\sigma_0+\sigma_1,(\sigma_3(p_y+\sigma_2))\bmod\mu\rangle q = ⟨ p x σ 0 + σ 1 , ( σ 3 ( p y + σ 2 )) mod μ ⟩
and therefore
p = ⟨ p x , p y ⟩ = ⟨ q x − σ 1 σ 0 , ( 1 σ 3 ( q y − σ 3 σ 2 ) ) m o d μ ⟩ = ϕ F 2 S T R m o d μ ′ ( ⟨ 1 σ 0 , − σ 1 σ 0 , − σ 3 σ 2 , 1 σ 3 ⟩ , q ) . \begin{aligned}
p&=\langle p_x,p_y\rangle\\
&=\left\langle\frac{q_x-\sigma_1}{\sigma_0},\left(\frac{1}{\sigma_3}(q_y-\sigma_3\sigma_2)\right)\bmod\mu\right\rangle\\
&=\phi_{F'_{2\mathrm{STRmod}\mu}}\left(\left\langle\frac{1}{\sigma_0},-\frac{\sigma_1}{\sigma_0},-\sigma_3\sigma_2,\frac{1}{\sigma_3}\right\rangle,q\right).
\end{aligned} p = ⟨ p x , p y ⟩ = ⟨ σ 0 q x − σ 1 , ( σ 3 1 ( q y − σ 3 σ 2 ) ) mod μ ⟩ = ϕ F 2 STRmod μ ′ ( ⟨ σ 0 1 , − σ 0 σ 1 , − σ 3 σ 2 , σ 3 1 ⟩ , q ) .
Recall that σ 3 ∈ { 1 , − 1 } \sigma_3\in\{1,-1\} σ 3 ∈ { 1 , − 1 } . Therefore, if f ∈ F 2 S T R m o d μ ′ f\in F'_{2\mathrm{STRmod}\mu} f ∈ F 2 STRmod μ ′ and σ = σ F 2 S T R m o d μ ′ ( f ) \sigma=\sigma_{F'_{2\mathrm{STRmod}\mu}}(f) σ = σ F 2 STRmod μ ′ ( f ) , then
σ F 2 S T R m o d μ ′ ( f − 1 ) = ⟨ 1 σ 0 , − σ 1 σ 0 , − σ 3 σ 2 , σ 3 ⟩ . \sigma_{F'_{2\mathrm{STRmod}\mu}}(f^{-1})=\left\langle\frac{1}{\sigma_0},-\frac{\sigma_1}{\sigma_0},-\sigma_3\sigma_2,\sigma_3\right\rangle. σ F 2 STRmod μ ′ ( f − 1 ) = ⟨ σ 0 1 , − σ 0 σ 1 , − σ 3 σ 2 , σ 3 ⟩ .
Therefore, every transformation in F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ has a unique inverse.
F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\mu} F 2 STRmod μ ′ is therefore a transformation group. □ \square □
Corollary 10. M F 2 S T R m o d μ ′ \mathcal{M}_{F'_{2\mathrm{STRmod}\mu}} M F 2 STRmod μ ′ is a transformational equivalence relation.
Proof. This follows directly from Lemma 9 and Corollary 1. □ \square □
Corollary 11. If P , D ⊂ R × R μ P,D\subset\mathbb{R}\times\mathbb{R}_{\mu} P , D ⊂ R × R μ , then OS ( P , D , F 2 S T R m o d μ ′ ) \operatorname{OS}\left(P,D,F'_{2\mathrm{STRmod}\mu}\right) OS ( P , D , F 2 STRmod μ ′ ) is a set of transformationally equivalent patterns.
Proof. From Corollary 10, we know that M F 2 S T R m o d μ ′ \mathcal{M}_{F'_{2\mathrm{STRmod}\mu}} M F 2 STRmod μ ′ is a transformational equivalence relation, and therefore an equivalence relation over 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 . From Lemma 4, it follows that M F 2 S T R m o d μ ′ \mathcal{M}_{F'_{2\mathrm{STRmod}\mu}} M F 2 STRmod μ ′ partitions 2 R 2 2^{\mathbb{R}^{2}} 2 R 2 exhaustively and exclusively into transformational equivalence classes. It follows that OS ( P , D , F 2 S T R m o d μ ′ ) ⊂ [ P ] F 2 S T R m o d μ ′ \operatorname{OS}\left(P,D,F'_{2\mathrm{STRmod}\mu}\right)\subset\left[P\right]_{F'_{2\mathrm{STRmod}\mu}} OS ( P , D , F 2 STRmod μ ′ ) ⊂ [ P ] F 2 STRmod μ ′ and that therefore OS ( P , D , F 2 S T R m o d μ ′ ) \operatorname{OS}\left(P,D,F'_{2\mathrm{STRmod}\mu}\right) OS ( P , D , F 2 STRmod μ ′ ) is a set of transformationally equivalent patterns. □ \square □
Summary
In this paper, we have presented a framework of concepts, theory, notation and terminology for geometric pattern matching. Specifically, we began by providing a formal definition of the concept of a transformation class, and derived precise definitions of the transformation classes F 2 T F_{2\mathrm{T}} F 2 T , F 2 T R F_{2\mathrm{TR}} F 2 TR , F 2 S T F_{2\mathrm{ST}} F 2 ST , F 2 S T R F_{2\mathrm{STR}} F 2 STR and F 2 S T R m o d μ F_{2\mathrm{STRmod}\,\mu} F 2 STRmod μ . For each of these transformation classes, we derived the transformation class function and the basis-pair transformation set function. Where necessary, we also provided algorithms for computing these basis-pair transformation set functions.
We then provided precise definitions of the concepts of a match and an occurrence, preparing the way for defining the concepts of a maximal match and a maximal pattern and proving a lemma that characterises the relationship between the two. We then focused on maximal matches and maximal patterns for transformations that are bijections. In particular, we showed that the maximal pattern for a pattern, a dataset and a bijection is equal to the intersection of the pattern and the dataset transformed by the inverse of the bijection. We also proved a theorem that fully describes the relationships between the maximal patterns and maximal matches for two patterns with respect to a bijection and its inverse. We noted that maximal patterns correspond to partial symmetries.
We then defined the concepts of occurrence set and heterogeneous occurrence set, along with the notions of the covered set of an occurrence set and an occurrence set’s compression factor.
Finally, we examined in detail the concepts of transformational equivalence and transformation groups and analysed the group-theoretic and transformation-equivalence properties of the specific transformation classes defined earlier in the paper. In particular, we showed that F 2 S T F_{2\mathrm{ST}} F 2 ST , F 2 S T R F_{2\mathrm{STR}} F 2 STR and F 2 S T R m o d μ F_{2\mathrm{STRmod}\,\mu} F 2 STRmod μ do not form transformation groups, but that the subsets of these classes containing transformations with non-zero x x x -axis scale factors do form transformation groups. We name these subsets F 2 S T ′ F'_{2\mathrm{ST}} F 2 ST ′ , F 2 S T R ′ F'_{2\mathrm{STR}} F 2 STR ′ and F 2 S T R m o d μ ′ F'_{2\mathrm{STRmod}\,\mu} F 2 STRmod μ ′ , respectively.