Notes on nilspaces: algebraic aspects, Discrete Analysis 2017:15, 59 pp. One of the fundamental insights in modern additive combinatorics is that there is a hierarchy of notions of "pseudorandomness" or "higher order Fourier uniformity" that can be applied either to subsets $A$ of an abelian group $G$, or functions $f: G \to {\bf C}$ of that abelian group. For instance, to understand the pseudorandomness of a subset $A$ of an abelian group $G$, one can count the number of parallelograms $$ (x, x+h_1, x+h_2, x+h_1+h_2)$$ that are fully contained in $A$, or (for a higher notion of pseudorandomness) instead count parallelepipeds $ (x, x+h_1, x+h_2, x+h_1+h_2, x+h_3, x+h_1+h_3,$ $x+h_2+h_3, x+h_1+h_2+h_3)$ or even higher-dimensional parallelepipeds. It turns out that the study of these parallelepipeds is of interest in its own right. For each dimension $d$, let $G^{[d]}$ denote the space of $d$-dimensional parallelepipeds in $G$; this is a certain subgroup of $G^{2^d}$. These spaces interact with each other in a number of ways: for instance, each $d-1$-dimensional face of the discrete cube $\{0,1\}^d$ induces a restriction map from $G^{[d]}$ to $G^{[d-1]}$. For instance, if $(x_1,\dots,x_8)$ lies in $G^{[3]}$, then $(x_1,x_2,x_3,x_4)$ or $(x_1,x_2,x_5,x_6)$ will lie in $G^{[2]}$. In the converse direction, we have the _corner completion_ property: if for instance one has seven vertices $(x_1,\dots,x_7)$ in $G$, with the property that all the two-dimensional subfaces such as $(x_1,x_2,x_3,x_4)$ or $(x_1,x_2,x_5,x_6)$ lie in $G^{[2]}$, then one can find an additional element $x_8$ of $G$ such that $(x_1,\dots,x_8)$ lies in $G^{[3]}$ (indeed, in this case this additional element will be unique). In papers of Host-Kra (["Parallelepipeds, Nilpotent Groups, and Gowers Norms"](https://arxiv.org/abs/math/0606004)) and Camarena-Szegedy (["Nilspaces, nilmanifolds and their morphisms"](https://arxiv.org/abs/1009.3825)), these properties of parallelepipeds were abstracted into axioms for a new type of structure, referred to as parallelepiped structures in Host-Kra and nilspaces in Camarena-Szegedy. In addition to the example given above of parallelepipeds on an abelian group $G$, another fundamental example of these structures comes from _nilmanifolds_ $G/\Gamma$, formed by quotienting a nilpotent Lie group $G$ by a lattice $\Gamma$. For instance, the analogue of parallelograms in this setting would be quadruples of the form $$ (x, g_1 x, g'_1 x, g_1 g'_1 g_2 x)$$ for $x \in G/\Gamma$, $g_1,g'_1 \in G$, and $g_2$ in the commutator subgroup $[G,G]$. Such spaces emerged naturally in an ergodic-theory context in work of Host and Kra (["Nonconventional ergodic averages and nilmanifolds"](http://annals.math.princeton.edu/wp-content/uploads/annals-v161-n1-p08.pdf)) and in a (nonstandard analysis) combinatorial context in work of Szegedy (["On higher order Fourier analysis"](https://arxiv.org/abs/1203.2260)), so it became natural to develop a systematic theory of such spaces, and in particular to look for a satisfactory classification of these spaces. As it turns out, the theory can be divided into two parts. The first part, which is simpler, is the purely "algebraic" theory of nilspaces, in which one does not require that the parallepiped structures are compatible in any way with a measure-theoretic or topological structure on the space. Then there is the "topological" and "measure-theoretic" part of the theory, in which one studies how the parallelepipeds interact with these structures. This division is analogous to the distinction between abstract group theory, and the theory of topological groups (and their interaction with measure-theoretic concepts such as Haar measure). In this paper, the first in a two-part series, the author systematically lays out the algebraic theory of nilspaces. The discussion follows closely the earlier work of Camarena and Szegedy, but with more detailed proofs and additional discussion of key examples. Just as nilpotent groups (or nilmanifolds) can be arranged in a hierarchy depending on the "step" or "nilpotency class" of the underlying nilpotent group, one can also assign a notion of a "step" to a nilspace, with higher step nilspaces being more complicated than lower step ones. For instance, as is shown in this paper, 1-step nilspaces are essentially the same as abelian groups. Perhaps the deepest result established in this paper is the fact that a $k$-step nilspace can always be viewed as an "abelian extension" of a $k-1$-step nilspace, in much the same way that a $k$-step nilpotent group can be viewed as a central extension of a $k-1$-step nilpotent group, furthermore, one can associate with the extension a certain "cocycle" which determines the $k$-step nilspace completely (up to isomorphism) once the underlying $k-1$-step nilspace is specified. Conversely, every such cocycle will generate such a $k$-step nilspace. This machinery will be used in [the second part of the series](http://discreteanalysisjournal.com/article/2106-notes-on-compact-nilspaces) to study compact nilspaces.