Semi-algebraic geometry of common lines

Cryo-electron microscopy is a technique in structural biology for discovering/determining the 3D structure of small molecules. A key step in this process is detecting common lines of intersection between unknown embedded image planes. We intrinsically characterize such common lines in terms of the unembedded geometric data detected in experiments. We show these common lines form a semi-algebraic set, i.e., they are defined by polynomial equalities and inequalities. These polynomials are low degree and, using techniques from spherical geometry, we explicitly derive them in this paper.


Introduction
Cryo-electron microscopy (cryo-EM) is a technique used to discover the structure of small molecules, usually proteins in the context of structural biology research [WS06]. A basic outline of cryo-EM is presented in [ Figure 1]. First, a sample is prepared by freezing many different copies of the molecule in a thin layer of ice. The sample is then illuminated by a stream of electrons which are detected by cameras and produce N noisy 2D cryo-EM images I 1 , . . . , I N . The primary goal is to reconstruct the 3D structure of the molecule from the 2D images that are acquired. For a more detailed overview, see [SS11, Section 1].
Problem 1 (Reconstruction Problem: Structural Biology). Given N two dimensional experimental cryo-EM images I 1 , . . . , I N , reconstruct a three-dimensional model of the original molecule.

Mathematical Model
We briefly describe the mathematical model for cryo-EM, following [HS11, Section 0]. We work in the three dimensional space R 3 equipped with the usual inner product. The molecule is modeled by a function φ : R 3 → R that represents its electronic density at various spatial locations [ Figure 2a]. An actual cryo-EM experiment obtains a single image of many copies of the molecule, but we instead assume that each image is a picture of the same molecule from different microscope orientations [ Figure 2b]. To model a microscope orientation we use the following concept.  Definition 1.1. A frame F for R 3 is an ordered orthonormal basis (a, b, c) such that the determinant of the matrix [a b c] is +1, or, equivalently, that c = a × b, where × is the standard cross product on R 3 .
Remark 1.1. A frame F for R 3 is uniquely determined by the vectors (a, b). For the rest of the paper we identify frames (a, b, c) with pairs of orthonormal vectors (a, b).
For us a microscope orientation is a frame F = (a, b). We think of the span of the vectors a and b as the embedded image plane of this orientation, and the vector c = a × b as the "viewing" direction [ Figure 2c].
A cryo-EM experiment produces N images which we denote I 1 , . . . , I N -see [ Figure 2b]. We will write F i = (a i , b i ) for the microscope orientation of image I i . The embedded image plane spanned by a i , b i can be canonically identified with the plane P i = R 2 . We think of P i as the unembedded image plane of I i . We model the image I i as a real valued function on P i = R 2 . The value of the image I i at the point (x, y) is the integral of φ along a line perpendicular to the embedded image plane span{a i , b i } -see [ Figure 2d] and [Equation 1.1]. This is the X-ray transform of φ onto the frame F i , given by where c i = a i × b i . As in [HS11], to solve this reconstruction problem we assume that the X-ray projections I i and I j of φ from different microscope orientations F i and F j are different. This is equivalent to requiring the molecule φ to admit no non-trivial symmetry as a function on R 3 . In terms of this mathematical model, the goal of cryo-EM reconstruction [Problem 1] becomes to recover the function φ from the N X-ray projections I 1 , . . . , I N . A commonly used approach for this problem is to first recover the N projection orientations F 1 , . . . , F N [HS11, Section 0.1]. Note that the detected image I i is a function on the plane P i = R 2 , and a cryo-EM experiment does not directly provide information about the microscope orientation F i used to compute I i .
Once the original microscope orientations are known, the unembedded image data I 1 , . . . , I N can be placed in the original positions from where these X-ray projections were computed. Then the X-ray transform can be inverted to yield an approximation of φ. Thus, although the ultimate goal is to solve [Problem 1], we instead discuss solutions to the following problem.
Problem 2 (Reconstruction Problem: Microscope Orientations). Given N X-ray projections I 1 , . . . , I N of a molecule φ : R 3 → R, computed from the N unknown microscope orientations F 1 , . . . , F N , recover these orientations up to global rotation.
By "up to global rotation" we mean that instead of recovering φ exactly, we might recover a rotated version of φ by a transformation R in the group O(3) of all 3 × 3 rotation matrices. Rotational ambiguity in the reconstructed molecule is not a problem, since recovering a rotated version of the molecule is as good as recovering the original. It may be the case that R is an improper rotation, i.e., det R = −1, in which case the recovered version will have the opposite chirality of the original molecule which is not desirable. However, other techniques exist to resolve this chiral ambiguity, so this also does not pose a problem.

Common Lines and Reconstruction
One approach for solving [Problem 2] is to exploit common lines of intersection between the embedded image planes, which we now describe. A cryo-EM experiment produces images I i and I j from orientations F i = (a i , b i ) and F j = (a j , b j ). These frames define isometric embeddings ι i and ι j [ Figure 3] of the unembedded image planes P i and P j into R 3 , given by The images are functions on P i and P j , and we know that they were obtained as X-ray projections onto the unknown embedded image planes ι i (P i ) and ι j (P j ) [ Figure 3b]. As in [VH87,SS11] we assume that the unknown microscope orientations are sampled uniformly from the space of all frames. This implies that the planes ι i (P i ) are distinct, and, further, that each pair of these planes intersects in a different line. Such a configuration of frames is called generic. The embedded image planes ι i (P i ) and ι j (P j ) intersect in a line L [ Figure 3b], and this line corresponds to the unembedded lines ij ⊂ P i and ji ⊂ P j . Since these unembedded lines both came from L ⊂ R 3 we have a natural choice of isometry a ψ ij : ij → ji . Proceeding in this fashion, the N microscope orientations F 1 , . . . , F N produce b N 2 common line pairs {( ij , ji , ψ ij )}. This is the common lines data realized by the frames F 1 , . . . , F N . It will be useful for us to distinguish such common lines data obtained from frames. Definition 1.2. A common line pair for P i and P j is a pair of lines ij ⊂ P i and ji ⊂ P j , together with a choice of isometry ψ ij : ij → ji . A collection of common line pairs {( ij , ji , ψ ij )}, for every P i and P j , is common lines data for P 1 , . . . , P N . We say common lines data is valid if it is realized by some generic frames F 1 , . . . , F N . a Note that there are only two possible isometries between ij and ji . b For positive integers N > k, "N choose k" is the integer N k = N ! k!(N −k)! . This is the number of ways to choose k distinct numbers from {1, . . . , N }.
Despite the fact that common lines data is information in the unembedded planes P i , it is a fact that valid common lines data determines its realizing frames, up to global rotation. Further, algorithms have long been known (e.g. [VH87, Section 2.1]) that recover a set of realizing frames from valid common lines data. This is relevant to cryo-EM reconstruction, because although the microscope orientations are unknown, it is possible to detect the common lines data the orientations realize from the images I 1 , . . . , I N [SS11, Equation 2.3]. Thus we have the following common lines approach for the cryo-EM reconstruction problem [Problem 2]. We first detect the common lines data realized by the unknown microscope orientations. Next, from the valid common lines data we reconstruct a set of realizing frames. Since valid common lines data determines its realizing frames up to global rotation, the reconstructed frames are related to the original microscope orientations by a global rotation, and so in principle one has solved the reconstruction problem.

Angular Reconstruction
In this section we describe the angular reconstruction algorithm, due to van Heel [VH87], and also independently Vainshtein and Goncharov [VG86], which recovers a set of realizing frames from valid common lines data.
Our input is valid common lines data {( ij , ji , ψ ij )} for P 1 , . . . , P N [ Figure 4]. Note that recovering a frame F i is equivalent to recovering the embedding ι i of P i , which will be easier to visualize. Since we are only reconstructing up to global rotation, the first step is to embed P 1 in an arbitrary position in R 3 [ Figure 5a]. Next, we use the isometry ψ 12 between 12 and 21 to dock P 2 to ι 1 (P 1 ) [ Figure 5b]. This docking is ambiguous [ Figure 5c] since we are free to rotate ι 2 (P 2 ) about its line of intersection with ι 1 (P 1 ). We resolve this ambiguity by docking P 3 with ι 1 (P 1 ) and matching up 23 and 32 in ι 2 (P 2 ) and ι 3 (P 3 ) [ Figure 5d]. We continue in this fashion, docking each subsequent plane P i with ι 1 (P 1 ) and resolving the rotational ambiguity by comparing against the remaining frames.

Noise and valid common lines data
We discussed in [Section 1.2] that valid common lines data determines its realizing frames up to global rotation. Common lines based approaches for cryo-EM reconstruction [Problem 2] assume that we can accurately detect the valid common lines realized by the unknown microscope orientations. Unfortunately cryo-EM images are very noisy [ Figure 6], so we cannot expect to correctly identify common lines data. Figure 6: Raw cryo-EM image [Hen13].
Misdetected common lines pose a problem because they lead to inconsistencies when attempting to recover realizing frames. For example, in [ Figure 5] we resolved the ambiguity of ι 2 (P 2 ) by docking P 3 to ι 1 (P 1 ) and using the common lines l 23 and l 32 [ Figure 5c]. However, we could have equally well resolved the ambiguity of ι 2 (P 2 ) by docking P 4 and using the common lines l 24 and l 42 . Thus, if we, for example, incorrectly identify the common lines in P 4 we will have two contradictory embeddings ι 2 (P 2 ) with no obvious way of determining which is correct.
More generally, the angular reconstruction algorithm makes many choices: for example which plane to begin reconstruction with, and how to resolve docking ambiguities. The final reconstructed frames depend on all these choices. By definition valid common lines data is precisely the data which has a single consistent (up to global rotation) set of realizing frames. The development of common lines reconstruction algorithms that are robust to this kind of error is an active area of research.

Our Results
We wish to understand the set C N of all valid common lines data for N planes P 1 , . . . , P N . First, we derive necessary and sufficient conditions for common lines data to be valid. These conditions are polynomial equations and inequalities, which means that C N is a semi-algebraic set, and allows us to study C N as a geometric space. In particular, we compute the dimension of C N , and show that there is a geometric bijection between C N and the space of generic frames, up to global rotation.
Main Theorem. The set C N of all valid common lines data for N frames is a 3N − 3 dimensional semialgebraic subset of the 2 N 2 dimensional space of all common lines data, and is homeomorphic to the space of N generic frames modulo O(3). The defining equations for C N are given by N 3 polynomial inequalities arising from the spherical triangle inequalities and 6 N 4 polynomial equalities arising from the spherical law of cosines.
The meaning of this theorem is as follows. As we discussed in [Section 1.2], one way to obtain valid common lines data is from the embedded frames F 1 , . . . , F N . The theorem provides an intrinsic definition of this valid common lines data, namely, the defining polynomials for C N . This is a definition for valid common lines only in terms of the data {(l ij , l ji , ψ ij )} on unembedded planes P 1 , . . . , P N , and without reference to any embedded frames F 1 , . . . , F N .
We briefly describe the idea behind our proofs. Suppose we have valid common lines data {( 12 , 21 , ψ 12 ), ( 13 , 31 , ψ 13 ), ( 23 , 32 , ψ 23 )}. (1. 2) The angles between these unembedded common lines determine a spherical triangle c [ Figure 7], and so the angles α between 12 and 13 , β between 21 and 23 and γ between 31 and 32 must satisfy the spherical triangle inequalities. These inequalities are analogs of the plane triangle inequality, i.e. necessary and c By a spherical triangle we mean the data of 3 points on the unit sphere in R 3 , together with geodesic arcs on the sphere joining these vertices sufficient conditions for a spherical triangle to exist with the specified edge lengths. In other words, a necessary condition for common lines data to be valid is that it satisfy such triangle inequalities. In fact, we will see that for N = 3 having the common lines [Equation 1.2] satisfy the spherical triangle inequalities is sufficient for the data to be valid [Proposition 2.1]. We prove our results for N > 3 by similarly appealing Figure 7: Common lines in P 1 , P 2 and P 3 determine a spherical triangle.
to spherical trigonometry. Specifically, given common lines data { ij , ji , ψ ij } for N planes, we require that for each triple 1 ≤ i < j < k ≤ N the common lines data ( ij , ji , ψ ij ), ( ik , ki , ψ ik ) and ( jk , kj , ψ jk ) satisfy the spherical triangle inequalities. Now, reducing to the N = 3 case gives us realizing embeddings ι i , ι j , ι k for each triple (i, j, k) of indices. To reconstruct a collection of N consistent frames, all these triple reconstructions must be compatible. We show that this compatibility condition is a polynomial condition arising from the spherical law of cosines. These defining equations are given by polynomials which are explicitly derived and listed in [Section 2.3].

Future Work
Thinking of valid common lines data in geometric terms provides some insight about inconsistencies during reconstruction due to noise. The space of all common lines data has dimension N (N − 1), and, since valid common lines are homeomorphic to the space of N frames up to global rotation, we have that the dimension of C N is 3N − 3. Since C N is a space of small dimension in the ambient space, it follows that the reconstruction inconsistencies described in [Section 1.4] are guaranteed to occur. In effect the most basic version of the angular reconstruction algorithm reconstructs the microscope orientations F 1 , . . . , F N using only 2N − 3 out of the N 2 common line pairs, and arbitrarily ignores inconsistencies within these pairs. The set C N is precisely the set of common lines data for which this algorithm will produce the same output regardless of which common line pairs are used, but as described above we do not expect experimental data to lie in C N .
Developing common lines reconstruction algorithms that are robust to noise is an active area of research. We are interested in exploring a geometric approach to noise reduction, which we briefly describe. In principle noisy experimental data {(l ij , l ji , ψ ij )} that lies outside of C N "came from" some noiseless valid common lines data in C N . Since the set C N is the set of solutions of a system of polynomials, it is theoretically possible to project noisy common lines to the set of noiseless common lines C N via constrained polynomial optimization. We are interested in developing effective projection algorithms along these lines to reduce the impact of noise in reconstruction.

Defining Equations
We proceed to describe in detail the results in [Main Theorem]. We derive necessary and sufficient conditions for common lines data to be valid. These will be explicit polynomial equations and inequalities only in the unembedded information {(l ij , l ji , ψ ij )}, and will provide an intrinsic definition for valid common lines without reference to the frames F 1 , . . . , F N . We only consider the case when N ≥ 3.

Projective coordinates
To obtain coordinates for C N it will be convenient for us to work with projective coordinates, which we briefly review. Suppose V is a vector space and is a line in V through the origin. We can represent by choosing any non-zero vector v ∈ . In other words, lines can be identified with equivalence classes of vectors. We denote the equivalence class of a vector v by [v], and by definition [v] = [w] if and only if the vectors v = λw, for λ = 0. The space of all lines through the origin in V is the projective space P(V ). If V = U × W and (u, w) ∈ V , then we write [u : w] for the corresponding class in P(U × W ).

Coordinates for Common Lines
Suppose now that ( ij , ji , ψ ij ) is a common line pair for P i and P j . Choose a vector v ij = (x ij , y ij ) on the line ij ⊂ P i , and consider the pair (v ij , ψ ij (v ij )) ∈ P i × P j . Note that different choices of a vector along ij will simply scale (v ij , ψ ij (v ij )) by a non-zero multiple, so the projective pair Note that we obtain the same common line pair regardless of which representing vectors (v ij , v ji ) we choose.
Thus, from now on we identify common line pairs with elements We also apply this identification to common lines data: Remark 2.1. We identify common lines data for P 1 , . . . , P N with collections By definition valid common lines data is a collection ([v ij : v ji ]) of common lines data that has N generic realizing frames F 1 , . . . , F N . In coordinates this means that the associated embeddings bring together the common line pairs, i.e. for all 1 ≤ i < j ≤ N , and for any representative (v ij , v ji ), we have

Necessary and sufficient conditions
In this section we derive equations and inequalities that are necessary and sufficient for common lines data ([v ij : v ji ]) to be valid. We first discuss necessary conditions. Recall from [Section 1.5] that for any triple of indices i, j, k the angles between the common line pairs [v ij : v ji ], [v ik : v ki ] and [v jk : v kj ] determine a spherical triangle [ Figure 7], and so these angles must satisfy the spherical triangle inequalities. The spherical triangle inequalities state that a non-degenerate spherical triangle of edge lengths α, β and γ, all in (0, π), exists if and only if β + γ > α, (2.1) ) and a triple of indices (i, j, k). Choose representatives (v ij , v ji ), (v ik , v ki ) and (v jk , v kj ). Then we write The angles α ijk , β ijk and γ ijk depend on the representatives we have chosen, however whether or not the spherical triangle inequalities [Equation 2 .1] are satisfied is independent of this choice. Thus the following definition makes sense: This definition allows us to state our first result.
is common lines data, and fix a triple (i, j, k) of indices. Suppose that (i, j, k) strictly satisfies the spherical triangle inequalities. Then there exist generic frames are another set of frames that realize these same pairs, then there is a rotation

For a proof of this proposition, see [Appendix A].
This proposition is a necessary and sufficient condition for realizing frames to exist for a triple (i, j, k), and so we have obtained necessary and sufficient conditions for N = 3. For N > 3, this proposition states that each triple of indices (i, j, k) must satisfy the spherical triangle inequality, but this condition is no longer sufficient.
Example 2.1. Consider the common lines data for P 1 , P 2 , P 3 , P 4 given by The angles between these common lines are given by Observe that each of these triples satisfies the spherical triangle inequality. However, this data cannot be realized by frames F 1 , F 2 , F 3 and F 4 . To see why, suppose such frames existed and, for each pair i, j, set Λ ij = ι i (v ij ) = ι j (v ji ). The points Λ 12 , Λ 13 , Λ 23 determine a spherical triangle with edge lengths (α 123 , β 123 , γ 123 ) [ Figure 8a], and the angle of this spherical triangle at the vertex between edges α 123 , β 123 is exactly the angle θ 12 between the planes ι 1 (P 1 ) and ι 2 (P 2 ). From the spherical law of cosines, we can compute this angle: cos θ 12 = cos γ 123 − cos α 123 cos β 123 sin α 123 sin β 123 = √ 2 − 1.
Similarly, the points Λ 12 , Λ 14 and Λ 24 determine a spherical triangle with edge lengths (α 124 , β 124 , γ 124 ) [ Figure 8b], and the angle of this triangle between edges α 124 and β 124 is again the angle θ 12 between the planes ι 1 (P 1 ) and ι 2 (P 2 ). However, in this triangle we have cos θ 12 = √ 2/2, which is a contradiction.   We now discuss one explanation for why the contradiction in [Example 2.1] arose that will lead us to a necessary and sufficient condition for reconstruction when N > 3. Suppose the frames F 1 , . . . , F N realize the common lines data ([v ij : v ji ]) ∈ (P 3 ) ( N 2 ) , and choose unit vector representatives (v ij , v ji ) for all the common line pairs. If we consider the intersection of the embedded planes ι i (P i ) with the unit sphere in R 3 , we obtain N geodesic arcs. Each pair of these arcs has a distinguished point of intersection ι i (v ij ) = ι j (v ji ) which we denote by Λ ij . Denote by T (i, j, k) the triangle obtained by taking Λ ij , Λ ik and Λ jk as vertices [ Figure 9].
Consider the second triangle T (i, j, m) [ Figure 10]. The two triangles T (i, j, k) and T (i, j, m) share a vertex, Λ ij , and the edges of both triangles at this vertex lie in ι i (P i ) and ι j (P j ). It follows that the angle Z in T (i, j, k) and Z in T (i, j, m) at this common vertex must be compatible: the angles are either the same, or supplementary, depending on the arrangement of the vertices. We can express this requirement in terms of the common lines data by using the spherical law of cosines:  The spherical law of cosines compatibility described above is necessary for such a system of triangles T (i, j, k) constructed from F 1 , . . . , F N to exist, and we will see it is sufficient as well. We first show that if this law of cosines compatibility between (i, j, k) and (i, j, m) is satisfied, then we can glue together reconstructions of these triples in a compatible fashion.
is common lines data, and fix triples (i, j, k) and (i, j, m) that strictly satisfy the spherical triangle inequalities. Consider the spherical law of cosines compatibility Suppose that L ijk,ijm = 0. Then, if F i , F j , F k are any realizing frames for (i, j, k), and G i , G j , G m are any realizing frames for (i, j, m), then there exists a unique rotation A ∈ O(3) such that AF i = G i and AF j = G j .

For a proof, see [Appendix A].
We now can show that the law of cosines compatibility is sufficient for reconstruction.

Geometry of valid common lines
In this section we use the necessary and sufficient conditions derived in [Section 2.3] for valid common lines data to deduce some geometric properties about the set C N of all valid common lines. The main result in this section is that C N is homeomorphic to the space of generic frames, up to O(3). In particular, this implies that the dimension of C N is 3N − 3.
We first explicitly describe how to obtain valid common lines from a set of generic realizing frames F 1 , . . . , F N as in [Section 1.2]. For each pair i, j, choose a vector Λ ij in the one dimensional vector space ι i (P i ) ∩ ι j (P j ). Since R 3 has a canonical structure of an inner product space, we have the corresponding orthogonal projections ι T i : R 3 → P i and ι T j : R 3 → P j . Consider the vectors By construction the pair [v ij : v ji ] = [x ij : y ij : x ji : y ji ] is a common line pair realized by the frames F i and F j . In coordinates, we have Repeating this process for all pairs 1 ≤ i < j ≤ N , we obtain valid common lines data ([v ij : v ji ]) ∈ C N that is realized by F 1 , . . . , F N . This algorithmically gives a map G → C N , where G is the subset of N generic frames in F N . It will be useful to express this function via explicit polynomial mappings. We first describe a set of coordinates on the Grassmannian Gr(3, 2N ), whose points are the three dimensional subspaces of R 2N .

Grassmannian & Plücker coordinates
If W ⊂ R 2N is a three dimensional subspace of R 2N , and we choose a basis w 1 , w 2 , w 3 ∈ R 2N for W , we can represent the point in Gr(3, 2N ) corresponding to W by the vector of all 3 × 3 minors of the 3 × 2N matrix These minors are the Plücker coordinates of W . If we choose a different basis for W , the vector of 3 × 3 minors will only change by a non-zero scalar. Since Plücker coordinates are well defined up to scaling, the Grassmannian Gr (3, 2N ) is a subvariety of the projective space P ( 2N 3 )−1 .
Given a collection of N frames F 1 , . . . , F N , we can form the 3 × 2N matrix We consider the rational map ρ : F N Gr(3, 2N ) that takes a collection of frames F 1 , . . . , F N to the Plücker coordinates of F • . A rational map is a map that is defined almost everywhere in the domain. In this case, ρ is not defined if the rank of F • is ≤ 2, since, in this case, the rows of F • do not determine a three dimensional subspace of R 2N .

Plücker coordinates for common lines
As described above, given a pair of frames F i , F j we can compute the associated common line pair [v ij : v ji ] ∈ C N by choosing any vector Λ ij in ι i (P i ) ∩ ι j (P j ). In particular, we can choose where × is the standard vector cross product on R 3 . Then, the following identity from vector algebra, called the vector quadruple product, expresses Λ ij in terms of the frames F i and F j : Comparing this with [Equation 3 .1], we see that the coordinates of the common line pair [v ij : v ji ] are given by determinants of certain 3 × 3 matrices. Explicitly, we have Observe that these 3 × 3 determinants are certain 3 × 3 minors of the matrix F • . The minors that appear are those that belong to only two frames F i and F j : in other words, any three of {a i , b i , a j , b j }. The minors not appearing as coordinates of a common line pair are those that choose three columns from three distinct frames: Thus, the coordinates on the Grassmannian Gr(3, 2N ) are the common line coordinates, together with these "bad" minors [Equation 3 .2]. If we consider the projection where we discard the "bad" minors, we obtain the map Gr(3, 2N ) 1≤i<j≤N P(P i × P j ) = (P 3 ) ( N 2 ) .
Explicitly, for each i, j, this projection maps Note that this rational map is not defined whenever the four 3 × 3 minors appearing in the common line pair [v ij : v ji ] simultaneously vanish. This cannot happen with generic frames, so this projection is an honest morphism when restricted to ρ(G) ⊂ Gr(3, 2N ). The image of this map is the set of valid common lines, and is in fact a homeomorphism.

For a proof, see [Appendix A].
This theorem means that we can identify C N with ρ(G), which is an open subset of the Grassmannian. As we discussed above, the point ρ(F • ) ∈ Gr(3, 2N ) only determines the row space of the matrix F • = [F 1 , . . . , F N ]. A different basis for this row space is given by multiplying F • on the left by a matrix A in O(3), or, equivalently, by the following action A · (F 1 , . . . , F N ) = (AF 1 , . . . , AF N ). This is the diagonal action of O(3) on the space of frames F N . We observe that this rotational ambiguity is the only difference between the space of frames and the Plücker embedding of these frames.
Theorem 3.2. The collection of generic frames G ⊂ F N is homeomorphic to ρ(G) × O(3).

For a proof, see [Appendix A].
Thus, we obtain the remainder of our results.
Corollary 3.1. The set C N of valid common lines is homeomorphic to the quotient of the set of generic frames G by the group of rotations O(3) acting diagonally.
In other words, we have recovered the fact that common lines data only determines its realizing frames up to O(3): it is because we can identify common lines data with elements of ρ(G) ⊂ Gr(3, 2N ), and points in this space determine frames up to global rotation.

Defining Polynomials
In [Section 2.3] we derived the defining equations for C N in terms of spherical geometry. For the benefit of the reader we now explicitly describe these conditions as multi-homogeneous polynomials in the variables To express the spherical law of cosines compatibilities L ijk,ijm [Equation 2 .2], set Then L ijk,ijm = 0 if and only if a 2 d 2 1 − 2d 1 d 2 ab + b 2 d 2 2 = 0.
Thus, the set C N is defined as a semi-algebraic subset of (P 3 ) ( N 2 ) by the following equations and inequalities:

Acknowledgements
The author is greatly thankful to Shamgar Gurevich, for initially suggesting the cryo-EM problem and for his continued support, as well as to Bernd Sturmfels, who suggested studying defining equations in cryo-EM, provided helpful guidance, and invited the author to the Mathematical Sciences Research Institute (MSRI) in Berkeley, California. Much of this work took place at MSRI during the spring of 2013, and the author greatly appreciates helpful technical discussions with Luke Oeding, Kristian Ranestad, Yoel Shkolnisky, Amit Singer and Frank Sottile. The author's visit to MSRI was supported by the National Science Foundation under grants 0838210 and 0932078.

A Proofs
Proof of Proposition 2.1. Fix representatives (v ij , v ji ), (v ik , v ki ) and (v jk , v kj ). Since the lengths α ijk , β ijk , γ ijk strictly satisfy the triangle inequalities, there is a non-degenerate spherical triangle with these edge lengths. Denote the vertex of this triangle opposite the edge of length α ijk by Λ jk , the vertex opposite the edge β ijk by Λ ik and the vertex opposite the edge γ ijk by Λ ij . Since this triangle is non-degenerate, we know that Λ ij , Λ ik and Λ jk are linearly independent. Thus we have embeddings ι i , ι j , ι k , given by Observe that these embeddings are isometric by construction, and so F i = (ι i (x), ι i (y)), F j = (ι j (x), ι j (y)) and F k = (ι k (x), ι k (y)) are frames. Since Λ ij , Λ ik , Λ jk are vertices of a non-degenerate spherical triangle, these three frames are in generic position. Moreover, by construction we have and so F i , F j and F k realize the required common line pairs.
Let ι G i , ι G j and ι G k be the embeddings corresponding to these frames, and set Λ . Since (i, j, k) strictly satisfies the triangle inequalities, these three vectors are linearly independent and thus define a unique spherical triangle with edge lengths (α ijk , β ijk , γ ijk ). This triangle is congruent to the triangle with vertices Λ ij , Λ ik , Λ jk constructed above, and so there exists an isometry A ∈ O(3) that maps j , and ι F k be the embeddings corresponding to F i , F j , F k , and let ι G i , ι G j , ι G m be the embeddings corresponding to G i , G j , G m . Consider the embedded common lines Λ Since the triple (i, j, k) strictly satisfies the triangle inequality, we know that both these sets of vectors are linearly independent. Let A : R 3 → R 3 be the map defined by We wish to show that A is an isometry. Observe that on the unit sphere in R 3 . Since the triple (i, j, m) strictly satisfies the triangle inequalities, these three points are the vertices of a unique spherical triangle. Let Z be the angle of this triangle at the vertex Λ G ij . Now, observe that the vectors Λ G ij and −Λ G ij cut the unit circle in the ι G i (P i ) plane into two semi-circles, and the points Λ G ik and Λ G im lie in these semi-circles. Furthermore, if sign(det[v ij , v ik ]) = sign(det[v ij , v im ]), then both of these vectors are in the same semi-circle. Similarly Λ G jk and Λ G jm lie in the same semi-circle in the ι G j (P j ) plane if sign(det[v ji , v jk ]) = sign(det[v ji , v jm ]). The points Λ G ij , Λ G ik , Λ G jk define a unique spherical triangle. Let Z be the vertex of this triangle at Λ G ij . We claim that Z is either Z or π − Z, depending on which semi-circles the points Λ G ik , Λ G jk , Λ G im , and Λ G jm lie in. We have Z = Z if Λ G ik , Λ G im are in the same semi-circle in ι G i (P i ) and Λ G jk , Λ G jm are in the same semi-circle in ι G j (P j ), or if Λ G ik , Λ G im are in opposite semi-circles and Λ G jk , Λ G jm are in opposite semi-circles. If one pair is in the same semi-circle, and the other pair is in opposite semi-circles, then we have Z = π − Z. Equivalently, ) > 0 and Z = π − Z if this product is negative. Now, based on our discussion above, the cosine of the angle at vertex Λ G ij in the triangle Λ G ij , Λ G ik , Λ G jk is σ cos Z , so from the spherical law of cosines we obtain On the other hand, L ijk,ijm = 0 implies that σ cos Z is the angle at Λ F ij in triangle Λ F ij , Λ F ik , Λ F jk , so again applying the law of cosines we have We conclude that A is an isometry, as desired. Proof of Theorem 2.1. Choose representatives (v ij , v ji ) for all common line pairs, and suppose that F i , F j , F k and G i , G j , G m are two sets of realizing frames for their associated common lines. From [Lemma 2.1] we know that there exists a unique rotation A that maps F i → G i and F j → G j . Observe that if det A = −1 we can replace G i , G j , G m by LG i , LG j , LG m , where L is an arbitrary rotation with determinant −1. Note that LG i , LG j , LG m is still a set of realizing frames, but the compatibility morphism is now L • A which has determinant 1.
We proceed with reconstructing a set of realizing frames. By [Proposition 2.1], we first obtain frames F 1 , F 2 , F 3 from the triple (1, 2, 3). For all remaining i, we choose a reconstruction G 1 , G 2 , G i from the triple (1, 2, i). By [Lemma 2.1], there exists a unique map A i that maps F 1 → G 1 and F 2 → G 2 , and, by our discussion above, we can assume that A i has determinant 1. We set F i = A −1 i G i . We now need to check that these frames are realizing frames. We will write ι F i , ι F j and ι F k for the embeddings determined by F i , F j , F k , and similarly for the other sets of reconstructed frames. Thus we need to verify that ι F i (v ij ) = ι F j (v ji ). To this end, suppose that F i = A −1 i G i was reconstructed from G 1 , G 2 , G i and F j = A −1 j D j was reconstructed from D 1 , D 2 , D j . The triple (1, i, j) also strictly satisfies the triangle inequality, so we have generic realizing frames H 1 , H i , H j . By [Lemma 2.1] we obtain unique rotations B i : (G 1 , G i ) → (H 1 , H i ) and B j : (D 1 , D j ) → (H 1 , H j ).
We claim that det B i = det B j . This follows, since , and so det B i = det B j . Now, consider the diagram Note that this diagram commutes, since both the top path and bottom path are morphisms in O(3) of the same determinant that send F 1 → H 1 . Then, since H 1 , H i , H j realize the common line pair (v ij , v ji ), we have and thus F 1 , . . . , F N realize the common lines data [v ij : v ji ]. Finally, suppose that F 1 , . . . , F N is another collection of frames that realizes [v ij : v ji ]. Choose three indices (i, j, k), and consider the vectors Λ ij = ι F i (v ij ), Λ ik = ι F i (v ik ) and Λ jk = ι F j (v jk ). The angles between these vectors are given by (α ijk , β ijk , γ ijk ). Similarly the angles between Λ ij = ι F i (v ij ), Λ ik = ι F i (v ik ) and Λ jk = ι F j (v jk ) are also given by (α ijk , β ijk , γ ijk ), so there is an isometry R ijk that sends (F i , F j , F k ) → (F i , F j , F k ). Note that, R ijk = R ijm for any i, j, k, m, since these are two isometries that agree on F i and F j . This implies that R ijk (F m ) = F m for all m, and thus there is a single isometry R : (F 1 , . . . , F N ) → (F 1 , . . . , F N ).