{'fraction_non_alphanumeric': 0.05584368985875983, 'fraction_numerical': 0.020419480053495122, 'mean_word_length': 3.4664918414918415, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 35, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Higher-distance commuting varieties

The commuting variety of matrices over a given field is a well-studied object in linear algebra and algebraic geometry. As a set, it consists of all pairs of square matrices with entries in that field that commute with one another. In this paper we generalize the commuting variety by using the commuting distance of matrices. We show that over an algebraically closed or a real closed field, each of our sets does indeed form a variety.


Introduction
Let k be a field, n ≥ 2 an integer, and Mat n×n the set of all n × n matrices over k. We are interested in those pairs of matrices A, B ∈ Mat n×n which commute with one another under matrix multiplication. For instance, if a matrix is scalar, that is, a constant multiple of the identity matrix, then all matrices commute with it. One fruitful approach for studying all pairs of commuting matrices is to study the n × n commuting variety [12,14]. We identify Mat 2 n×n with the 2n 2 -dimensional space k 2n 2 , so that a pair of matrices (A, B) ∈ Mat 2 n×n corresponds to a point in k 2n 2 . As a set, the commuting variety consists of all points (A, B) ∈ k 2n 2 such that AB = BA. It has the structure of an affine variety, meaning that it is the solution set of a finite collection of polynomial equations. In particular, it is defined by the n 2 polynomials of the form (XY − Y X) ij = 0, where X and Y are n × n matrices filled with variables x ij and y ij . This variety is known to be irreducible [11,14], meaning that it cannot be written as the union of two strictly smaller varieties. This can be generalized to varieties of commuting triples of matrices [12], or commuting n-tuples of matrices.
In this paper we introduce other generalizations of the commuting matrix variety, and prove that these generalizations are indeed affine varieties. To define them, we need a measure of how close two matrices are to commuting with one another. We will use the well-studied commuting distance of matrices, which are defined using the n × n commuting graph Γ(Mat n×n ) over k [2]. This graph has vertices corresponding to the n × n non-scalar matices over k, with an edge between A and B if and only if AB = BA. With a view towards defining distance, a natural question to ask is whether Γ(Mat n×n ) is connected, and if so what is its diameter ; that is, what is the supremum of the length of all shortest paths between pairs of vertices. The answer to this question depends both on the field k and on the integer n. As noted in [4,Remark 8] and discussed in Proposition 2.2, for n = 2 the graph Γ(Mat n×n ) is disconnected. However, it was shown in [3] that if n ≥ 3 and k is an algebraically closed field, then Γ(Mat n×n ) is connected, and in fact diam(Γ(Mat n×n )) = 4.
The same holds when k = R [16]. Note that the situation is quite different for other fields. For example, the graph Γ(Mat n×n ) over rationals Q is not connected [1,Remark 8].
This means that when n ≥ 3 and k is algebraically closed, for any two non-scalar matrices A, B ∈ Mat n×n we can define d(A, B) to be the distance between the corresponding vertices on the graph Γ(Mat n×n ). For instance, d(A, B) = 0 if and only if A = B, and d(A, B) = 1 if and only if A = B and A and B commute. We extend the function d(· , ·) to take any two n × n matrices as input by letting d(A, B) = 1 whenever A or B is a scalar matrix (unless A = B, in which case d(A, B) = 0).
We define the distance-d commuting set C d n to be the set of pairs of n × n matrices with commuting distance at most d. That is, Perhaps the most familiar of these sets is C 1 n , which is simply the n × n commuting variety. Our main theorem shows that regardless of our choice of d, the set C d n is still an affine variety, at least over a field that is algebraically closed or real closed. Definition 1.1. A field k is said to be algebraically closed if any polynomial with coefficients from k has a root in k. A field k is said to be real closed if k is not algebraically closed, but the field extension k[ √ −1] is algebraically closed. There are many different equivalent definitions of real closed fields. For example, they are precisely the non-algebraically closed fields such that all polynomials of odd degree have a root. The traditional definition is that real closed fields are those fields that satisfy the same first order properties as real numbers. Theorem 1.3. Let k be an algebraically closed field, or a real closed field. Then for any d ≥ 0, the set C d n is an affine variety in the 2n 2 -dimensional affine space Mat 2 n×n . The fact that C d n is a variety has many nice consequences. For instance, every variety has a well-defined notion of dimension, meaning that this set is a reasonable geometric object. Moreover, if we are working over k = R or k = C, every variety is closed in the usual Euclidean topology, so we know that these sets are closed. Remark 1.4. This result also holds when k is a finite field. This is because if k is finite, then any subset of k N is a variety: each point of k N is a variety, and a finite union of varieties is also a variety.
It turns out that many instances of Theorem 1.3 are readily proven. In the case of d = 0, we have that C 0 n = {(A, B) | A = B}, which is defined by the n 2 polynomials of the form (X − Y ) ij =0, and is thus an affine variety. As already noted, C 1 n is the commuting variety. In the case of n = 2 and d ≥ 2, any two matrices A and B with d(A, B) ≤ d must in fact satisfy d(A, B) ≤ 1 (see Proposition 2.2), so C d n = C 1 n . Since C 1 n is a variety, the theorem holds in this case. Finally, if n ≥ 3 and d ≥ 4 then we have , [16]. This set is indeed a variety: it is the vanishing locus of the zero polynomial.
Thus, it remains to show that Theorem 1.3 holds in the case where n ≥ 3, and either d = 2 or d = 3. After presenting useful background material on commuting distance and on varieties in Section 2, we handle the d = 2 case in Section 3 and the d = 3 case in Section 4. We close in Section 5 with computational results and future directions.

Commuting distance and affine varieties
Let A, B ∈ Mat n×n . We say that A and B commute if AB = BA. For notation, we will sometimes write A ↔ B to indicate that A and B commute.
Given two non-scalar matrices A and B, define the commuting distance d(A, B) to be the distance between two matrices A and B on the commuting graph Γ(Mat n×n ), so that Such a commuting chain could be written as If there does not exist such a chain, we define d(A, B) = ∞. We note that it is vital to require that the C i are non-scalar: otherwise, we would have d(A, B) ≤ 2 for all A and B. We extend the definition of the distance function to allow scalar matrices as input by defining d(A, A) = 0 and d(A, B) = d(B, A) = 1 whenever A is a scalar matrix and A = B. Proof. It will suffice to show that there do not exist any matrices A and B with d(A, B) = 2: if two matrices are separated by a commuting chain of length least 2, a subchain will yield two matrices of distance exactly 2.
Suppose for the sake of contradiction that there exist A and B with d(A, B) = 2. Let C be a non-scalar matrix such that A ↔ C ↔ B. Since C is not a scalar matrix, it is not the root of a polynomial of degree 1, meaning that the minimal polynomial of C has degree at least 2. The minimal polynomial thus coincides with the characteristic polynomial of C up to a scalar factor. Since C is a matrix with equal minimal and characteristic polynomials, the matrices commuting with C are precisely those of the form p(C), where p ∈ k[x] is a polynomial [9]. It follows that A = p(C) and B = q(C) for some polynomials p and q. But p(C) and q(C) commute, so d(A, B) ≤ 1, a contradiction.
Once n ≥ 3, the connectedness of Γ(Mat n×n ) is guaranteed by k being algebraically closed or real closed. The graph Γ(Mat n×n ) can be disconnected in other cases, such as over the field Q of rational numbers [1,Remark 8].
To prove that the diameter is as most 4, one constructs for any A and B a commuting chain A ↔ C ↔ D ↔ E ↔ B, where C, D, and E are nonscalar. Choose C and E to be rank 1 matrices built out of left and right eigenvectors of A and of B, respectively. Then choose D to be a rank 1 matrix commuting with both C and E, which is possible for any two rank 1 matrices as long as n ≥ 3. Thus, we have d(A, B) ≤ 4 for all A and B. The same result for real closed fields is proved in [16].
One way to see the diameter is indeed equal to 4 (rather than to 2 or 3) is to note that an elementary Jordan matrix is always at distance four from its transpose, as proven in [8]. The authors go on to give a necessary condition for when two matrices can be at the maximal distance of four from one another. A matrix A is said to be non-derogatory if its characteristic polynomial is equal to its minimal polynomial. Equivalently, a matrix is said to be non-derogatory if for each distinct eigenvalue λ of A there is only one Jordan block corresponding to λ in the Jordan normal form for A [6,Chapter 7]. If a matrix is not non-derogatory, we say it is derogatory.
Theorem 2.5. Let n ≥ 3 and k be algebraically closed or real closed. Then the following statements are equivalent for a non-scalar matrix A ∈ Mat n×n .
(i) A is non-derogatory. Proof. This was proved for algebraically closed k in [8, Theorem 1.1]. The equivalence of (i) and (ii) for any field with more than n+1 elements was shown in [7]. Finally, the equivalence of (iii) to (i) and (ii) when k is a real closed field follows from the corresponding argument from [8] combined with the fact that commutativity graph of matrices over real closed has diameter 4 as proved in [16].
The following corollary is straightforward and will be used in Section 4 to study C 3 n . Corollary 2.6. Let n ≥ 3, k be algebraically closed or real closed, and A, B ∈ Mat n×n be non-scalar. If d(A, B) = 4, then condition (iii) is satisfied for both A and B, so both A and B must be non-derogatory. Equivalently, if one or both of A and B is derogatory, then d(A, B) ≤ 3.
We now present the tools and results from algebraic geometry that we will use. Most of our notation and terminology comes from [5]. Let k be a field, and let R = k[x 1 , . . . , x n ] be the polynomial ring in n variables over k. We refer to k n as n-dimensional affine space. Let f 1 , . . . , f s ∈ R. The vanishing locus of f 1 , . . . , f s is the set of points in k n at which all the polynomials vanish: . . , f s ) := {(a 1 , . . . , a n ) ∈ k n | f i (a 1 , . . . , a n ) = 0 for 1 ≤ i ≤ s}.
We refer to any set of this form as an affine variety. Given an ideal I ⊂ R, we define its vanishing locus as V(I) := {(a 1 , . . . , a n ) ∈ k n | f (a 1 , . . . , a n ) = 0 for all f ∈ I}.
If I = f 1 , . . . , f s , then we have V(I) = V(f 1 , . . . , f s ) [5, Proposition 2.5.9]. Since every ideal I ⊂ R can be generated by finitely many polynomials [13], we could equivalently define an affine variety to be any set of the form V(I) where I is an ideal in R. . Our ring of polynomials can then be written as R = k[x 11 , x 12 , x 21 , x 22 , y 11 , y 12 , y 21 , y 22 ], where the variable x ij (respectively y ij ) corresponds to the coordinate a ij (respectively b ij ). For shorthand, we could also write x 21 x 22 ) and Y = ( y 11 y 12 These polynomials are simply the entries of XY −Y X. It follows that If a set S ⊂ k n is an affine variety, we say that it is Zariski-closed. This terminology comes from the Zariski topology on k n , which defines a subset of k n to be closed if it is equal to V(f 1 , . . . , f s ) for some f 1 , . . . , f s ∈ k[x 1 , . . . , x n ]. This defines a topology because the union of finitely many varieties is a variety; because the intersection of any collection of varieties is a variety; and because ∅ = V(1) and k n = V(0) are both varieties.
Definition 2.8. For a general set S ⊂ k n , the Zariski closure of S, denoted S, is the smallest Zariski-closed set (that is, the smallest variety) containing S. Example 2.9. Consider the set This set is not a variety: if a polynomial f (x, y) vanishes on the set S, then since polynomials are continuous functions we also have f (0, 0) = 0. It follows that any variety containing S must also contain the point (0, 0).
In fact, the Zariski closure of S is simply S together with this point: Remark 2.10. In the previous example over R, the Zariski closure of our set happened to equal its closure in the usual Euclidean topology. When working over R or C, since polynomials are continuous functions, all Zariski-closed sets are closed in the Euclidean topology, so it is true that the Zariski closure always contains the Euclidean closure. In general, this containment is strict, although in certain special cases we have equality.
Definition 2.11. We say that a set in k n is constructible if it is defined by a finite boolean combination of polynomial conditions. In other words, it can be written as a finite combination of intersections and unions of affine varieties and their complements.
For example, the set S from Example 2.9 is constructible, since S = V(x − y) \ V(x, y).
Proposition 2.12 (Corollary 1 in Section 1.10 of [15]). Suppose S ⊂ C n is a constructible set. Then the Zariski closure of S is equal to the Euclidean closure of S.
The ideal-variety correspondence [5, Chapter 4] allows us to connect geometric operations on affine varieties to algebraic operations on ideals. Often these correspondences only hold up to taking Zariski closures.
Proposition 2.13 (Theorem 3.2.3 in [5]). Let k be an algebraically closed field, and let I ⊂ k[x 1 , . . . , x n ] be an ideal. Let 1 ≤ m ≤ n, and let π : k n → k m denote projection onto the first m coordinates. Then In other words, up to Zariski closure, projecting a variety corresponds to eliminating variables.
Proposition 2.14 (Theorem 4.4.10 in [5] ). Let k be an algebraically closed field, and let I, J ⊂ k[x 1 , . . . , x n ] be ideals. Let Then I : J ∞ is an ideal, and So, up to Zariski closure, taking a set-theoretic difference of varieties corresponds to saturating one ideal with respect to another.
We close this section by building up some tools that will help us study the distance 3 commuting set. We briefly discuss projective algebraic geometry [5,Chapter 8]. Although our main results are stated in the language of affine varieties, projective geometry will be used in the proof of Proposition 4.4. Again we choose a field k and an integer n. The role of affine space is now played by projective space P n k , which as a set is all equivalence classes of (n + 1)-tupes (a 0 : a 1 : · · · : a n ) where a i ∈ k, not all equal to 0. The equivalence is defined by (a 0 : a 1 : · · · : a n ) ∼ (b 0 : b 1 : · · · : b n ) if and only if there exists a nonzero constant λ with a i = λb i for all i. There are a number of other constructions of projective space, such as the one given in example below.
Example 2.16. Let V be a non-zero vector space. Then the projectivization of V , denoted P(V ), is the set of one-dimensional vector subspaces of V .
In order to talk about polynomials vanishing at a point of projective space, we must consider polynomials that are homogeneous; that is, polynomials where all terms have equal degree. This is because if f ∈ k[x 0 , . . . , x n ] is homogeneous with each term having degree d, then f (λa 0 , λa 1 , . . . , λa n ) = λ d f (a 0 , a 1 , . . . , a n ) for any a i ∈ k and any λ. Thus, f vanishing at the tuple (a 0 : · · · : a n ) implies it vanishes for all other tuples in the same equivalence class. We can consider a product of a projective space and an affine space: A subset of such a space is Zariski-closed if and only if it is the vanishing locus of a collection of polynomials, which are homogeneous in the variables corresponding to the coordinates of P n k . A key result that we will use is that when projecting away from projective spaces, Zariski-closed sets are mapped to Zariski-closed sets, at least over an algebraically closed field.
Proposition 2.17 (Proposition 8.5.5 and Theorem 8.5.6 in [5]). Let k be an algebraically closed field, and let π : k m × P n k → k m be the projection map onto the affine space. Then π maps Zariski-closed sets to Zariski-closed sets.
In the language of morphisms, such a projection π is a proper morphism. We can generalize this to have more copies of affine and projective spaces, and the result still holds as long as we are projecting away from projective spaces.
Note that this result does not hold when projecting away from affine spaces rather than projective spaces: the projection map π : C × C → C defined by π(a, b) = a sends the hyperbola V(xy − 1) to the set {a ∈ C | a = 0}, which is not a variety. Moreover, an analog of Proposition 2.17 does not hold for the field of real numbers, as the following example shows.
Then S is Zariski-closed, but the projection to the second component is the set of non-negative reals, which is not Zariski-closed.
Since we won't be able to use Proposition 2.17 over R and other non-algebraically closed fields, we are motivated to develop one final tool for the distance 3 commuting set.
Lemma 2.19. Let k be a real closed field, with algebraic closure k. If V ⊂ k n is an affine variety, then so is V ∩ k n .
Having shown set containment both ways, these two sets are equal, and W is indeed an affine variety.

The distance 2 commuting set
Fix n ≥ 3. In this section we will prove that C 2 n is a variety. In Proposition 3.1, we show that it is the vanishing locus of certain minors of a 2n 2 × n 2 matrix with linear polynomials as its entries. This proof is independent of field, and thus so is the result. We then present a more geometric construction of C 2 n as an affine variety over C. The proof that this construction actually gives C 2 n , rather than some other set, relies on Proposition 3.1, and so does not constitute an independent proof that C 2 n is a variety. However, we have found that it yields a more computationally efficient way to find a set of defining polynomials for C 2 n . Proposition 3.1. Over any field, the set C 2 n is an affine variety. In particular, it is defined set-theoretically by minors of a 2n 2 × n 2 matrix with linear entries.
Proof. We will explicitly give the desired collection of polynomials that define the set C 2 n . Let A, B, C be n × n matrices with entries given by a ij , b ij , and c ij , respectively. We have It follows that the set of matrices commuting with both A and B is a vector space (namely the vector space of solutions of the above equation) whose dimension is equal to the nullity of the matrix D. The dimension of this vector space is at least 1, since the space of scalar matrices commute with all matrices. Therefore, the nullity of D is strictly greater than 1 if and only if A and B commute with a mutual non-scalar matrix, which is equivalent to To find the defining equations for C 2 3 in the polynomial ring k[x 11 , . . . , x 33 , y 11 , . . . , y 33 ], we would consider the matrix  and use as the defining equations all determinants of 8 × 8 submatrices. See Section 5 for more details.

Remark 3.3.
Specializing to the cases of k = R or k = C, the fields of real or complex numbers, Proposition 3.1 leads to a nice property: since affine varieties are closed in the Euclidean topology, the set C 2 n is closed.
and (ii) for each i, there exists a non-scalar matrix C i such that A i ↔ C i ↔ B i , then there must exist a non-scalar matrix C ∈ C n×n such that A ↔ C ↔ B. (The same holds replacing C with R.) This is not immediately obvious even with the additional assumption that the limit lim i→∞ C i exists, since the limit of non-scalar matrices could be a scalar matrix.
We now provide a direct algebro-geometric construction for C 2 n over the field C. , where the ideal I is generated by the polynomials z 11 − z ii (for 2 ≤ i ≤ n) and z ij (for i = j). The fact that C 2 n = π(T \ S) follows by definition. Now we wish to take the set-theoretic difference of one variety from another, and then project the resulting set to a lower dimensional space. It is possible to do this by manipulating ideals, at least up to Zariski closure: By Propositions 2.13 and 2.14, the set-minus operation corresponds to ideal saturation, and projection corresponds to elimination of variables. In particular, V(I : J ∞ ) = T \ S, and We will show that we may remove the Zariski closures, so that this ideal does in fact define C 2 n . Proposition 3.5. When k = C, we have Proof. Let R = T \ S. Then we wish to show π(R) = π(R).
Suppose that (A, B) ∈ π(R). It follows that there exists C such that (A, C, B) ∈ R. Since R is a constructible set, its Zariski closure is equal to its closure in the Euclidean topology by Proposition 2.12. It follows that there exists a sequence of points n , and since C 2 n is closed in the Euclidean topology, we have that n . So, π(R) ⊂ C 2 n . This completes the proof. 4. The distance 3 commuting set Note that without the degree bounds on p and q, every pair of matrices would polynomially commute with one another: if deg(p) = 0, then p(A) would be a scalar matrix; and if deg(p) = n we could choose p equal to the characteristic polynomial of A, so that p(A) is the zero matrix. In either case, we would have p(A) commuting with every matrix. However, unlike with our definition of commuting distance, it is not forbidden for p(A) or q(B) to be a scalar matrix. This will come into play in Lemma 4.2.
We also remark that we may assume that p(x) and q(x) have no constant term. This is because for any constants λ and µ, two matrices C and D commute if and only if C − λI and D − µI commute. Eliminating the constant term from p and q only effects p(A) and p(B) by subtracting off a constant multiple of the identity matrix.
Let PC n ⊂ Mat 2 n×n denote the set of all pairs of polynomially commuting matrices. To prove that C 3 n is an affine variety over an algebraically closed or a real closed field, we will first show that C 3 n = PC n . We will then show that PC n is an affine variety, at least over an algebraically closed field. We begin with the following result. Proof. Assume that A is derogatory; a symmetric argument will hold when B is derogatory. Let p ∈ k[x] be the minimal polynomial of A. Then by the definition of derogatory matrices, p(x) is not equal to the characteristic polynomial of A, which has degree n. Since the minimal polynomial divides the characteristic polynomial, we have deg(p) < n. Combined with the fact that minimal polynomial of any matrix is non-constant, this implies that 1 ≤ deg(p) ≤ n − 1. Now let q(x) = x. We then have since the zero matrix p(A) commutes with all other matrices and since B commutes with itself. Thus A and B polynomially commute. Proposition 4.3. Suppose k is algebraically closed or real closed. Then the distance-3 commuting set is equal to the set of polynomially commuting pairs of matrices: Proof. Let (A, B) ∈ Mat 2 n×n . We claim that (A, B) ∈ C 3 n if and only if (A, B) ∈ PC n . First suppose at least one of A and B is derogatory. Then by Corollary 2.6, we have (A, B) ∈ C 3 n , and by Lemma 4.2, we have (A, B) ∈ PC n . Thus our claim holds in this case. Now suppose A and B are both non-derogatory. By Theorem 2.5, A commutes with polynomials in A only, and B commutes with polynomials in B only. Now, (A, B) ∈ C 3 n if and only if there exist non-scalar matrices C and D such that Since A and B commute with polynomials in themselves only, such C and D exist if and only if there are polynomials p(x), q(x) ∈ k[x] such that C = p(A) and D = q(B). In fact, p and q must have degree at least 1, since C and D are non-scalar. Moreover, p may be chosen to have degree at most n − 1, since the characteristic polynomial is annihilating, so any power A k with k ≥ n can be written as a combination of I, A, A 2 , . . . , A n−1 . A similar argument shows we may take deg(q) ≤ n − 1. Thus, the desired matrices C and D exist if and only if (A, B) ∈ PC n . This completes our proof.
To show that C 3 n is an affine variety in the case of algebraically closed field, it remains to show the following proposition. Proof. Suppose A and B polynomially commute, and let p and q be polynomials satisfying all the conditions of our definition. As previously noted, we may assume that p and q have no constant term. Write The condition p(A)q(B) − q(B)p(A) = 0 can then be written as Thinking of the c i , the d j , the entries of A, and the entries of B as variables, this equation really consists of n 2 polynomials (one for each coordinate) in those variables. These equations are bilinear in the c i and the d j variables.
Note that the set of polynomials with no constant term and degree between 1 and n − 1 is a vector space. Call this vector space V , and let P(V ) be the projectivization of V , so that two polynomials are identified if and only if they differ by a constant multiple. π : Mat 2 n×n × P(V ) × P(V ) → Mat 2 n×n . By Proposition 2.17, π(Z) ⊂ Mat 2 n×n is Zariski-closed whenever whenever Z is. Thus, the image π(Φ) = PC n is Zariski-closed in Mat 2 n×n . We conclude that PC n is an affine variety. Combining Propositions 4.3 and 4.4, we have the following result.
Proposition 4.5. Over an algebraically closed field, the distance-3 commuting set C 3 n is an affine variety.
We can push this result further to working over real closed fields. Proposition 4.6. Over a real closed field, the distance-3 commuting set C 3 n is an affine variety.
Proof. Let k be a real closed field with algebraic closure k. First we show that if A, B ∈ Mat n×n (k) with d k (A, B) = 3, then d k (A, B) = 3. Indeed, let A ↔ C ↔ D ↔ B, where C and D have entries in k, such that there is no shorter path in the commuting graph over k. Then by Theorem 2.5 for algebraically closed fields, either A or B or both is derogatory; so by the same theorem for real-closed fields, the k-distance between them cannot be 4. Hence it is 3. It follows that C 3 n (k) = C 3 n (k) ∩ Mat n×n (k). By Lemma 2.19, if k is a real closed field and V ⊂ k m is an affine variety, then so is V ∩k m .
We know by Proposition 4.5 that C 3 n (k) is an affine variety, so its intersection with the affine space Mat n×n (k) is as well. We conclude that C 3 n (k) is an affine variety Together with with Proposition 3.1, these results imply Theorem 1.3: over an algebraically closed field or over a real closed field, the distance-d commuting set C d n is an affine variety for any n and d. When working over C or R, it also implies the following result. Just as with C 2 n , we have an algebro-geometric construction of C 3 n over C. Proposition 4.8. Let k = C, I be the ideal generated by the 3n 2 polynomials (XZ − ZX) ij , (ZW − W Z) ij , and (Y W − W Y ) ij , J 1 be the ideal generated by the polynomials z 11 − z ii (for 2 ≤ i ≤ n) and z ij (for i = j), and let J 2 be generated by the polynomials w 11 − w ii (for 2 ≤ i ≤ n) and w ij (for i = j). Let J = J 1 ∩ J 2 be the intersection of the two ideals. Then As argument identical to that in the proof of Proposition 3.5 shows that we may remove the Zariski closures in π Q \ S , so that

Computations and open questions
In this section we discuss computational results for our higher-distance commuting varieties. These results lead us to a number of open questions about their algebro-geometric properties. Our computations were done using Macaulay2 [10], with code available at https://sites.williams.edu/10rem/hdcv_supplemental/.
In Section 3, we presented two ways of finding a set of defining polynomials for C 2 n , one using minors of matrices as in Proposition 3.1, and one using saturation and projection as in Proposition 3.5. We'll first consider these two methods in the case of n = 2. Although this case is made less interesting by the fact that C 2 2 = C 1 2 , it already highlights some important differences between these two methods.
Applying the minors method to find a set of generators for C 2 2 leads us to the 8 × 4 matrix  x 21 −x 12 0 0 −y 21 y 12 0 −y 12 y 11 − y 22 0 y 12 y 21 0 −y 11 + y 22 −y 21 0 y 21 −y 12 0 Using the Macaulay2 command minors, we find the ideal I generated by 3 × 3 minors of this matrix. Although there are 4 3 · 8 3 = 224 minors, the ideal I is generated minimally by 16 polynomials. We know by Proposition 2.2 that V(I) must be the 2 × 2 commuting variety; however, I is not the same as the ideal generated by the three equations from Example 2.7. Using the Macaulay2 command radical(), we compute the radical of I, denoted as √ I and defined as the set of all f such that f N ∈ I for some N ≥ 0. We find that √ I = x 21 y 12 − x 12 y 21 , x 21 y 11 − x 11 y 21 + x 22 y 21 − x 21 y 22 , x 12 y 11 − x 11 y 12 + x 22 y 12 − x 12 y 22 , which has as its generators the usual defining equations for the 2 × 2 commuting variety.
Since V(I) = V( √ I) for any I [5, Theorem 4.2.7], we have V(I) = C 1 n , as predicted by Proposition 2.2. Indeed, this computation can be seen as an alternate proof of that result.
Call these ideals I 1 and I 2 , respectively. The ideal I 1 is the usual defining ideal for the 2 × 2 commuting variety presented in Example 2.7. Taking a radical of I 2 , we find I 2 = x 11 − x 22 , x 12 , x 21 , y 1,1 − y 2,2 , y 12 , y 21 .
As an alternative, we apply the saturation and elimination method for C 2 3 . Let I be the ideal generated by the 18 polynomials (XZ − ZX) ij and (Y Z − ZY ) ij . We saturate I with the ideal J = z 11 − z 22 , z 11 − z 33 , z 12 , z 13 , z 21 , z 23 , z 31 , z 32 and obtain the ideal I : J ∞ , which is generated by 72 elements. Eliminating the z ij variables gives an ideal (I : J ∞ ) ∩ k[X, Y ], generated by 56 elements all of degree 5. The equations for these polynomials are available on the supplemental materials website. Using the Macaulay2 commands degree() and dim(), we find that the degree of the ideal is 57, and that the affine variety C 2 3 = V((I : J ∞ ) ∩ k[X, Y ]) has dimension 14 in the 18-dimensional space Mat 2 3×3 . (It is worth noting that we performed these computations are performed over Q rather than over C. However, since the generators of I and J have integer coefficients, the operations performed in computing both the saturation and the elimination would be identical between these two fields. ) We close by posing the following open questions for the varieties C 2 n and C 3 n . (1) What are their dimensions, in terms of n? It is known that dim (C 1 n ) = n 2 + n [14], and we computed dim(C 2 3 ) = 14.
(2) What are their degrees, in terms of n? We computed deg(C 2 3 ) = 57. (3) Are they irreducible? It is known that C 1 n is irreducible [14].