{'fraction_non_alphanumeric': 0.03684151827205472, 'fraction_numerical': 0.013048812223502732, 'mean_word_length': 4.583229555832296, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Geometry of Spatial Memory Replay

Place cells in the rat hippocampus play a key role in creating the animal's internal representation of the world. During active navigation, these cells spike only in discrete locations, together encoding a map of the environment. Electrophysiological recordings have shown that the animal can revisit this map mentally, during both sleep and awake states, reactivating the place cells that fired during its exploration in the same sequence they were originally activated. Although consistency of place cell activity during active navigation is arguably enforced by sensory and proprioceptive inputs, it remains unclear how a consistent representation of space can be maintained during spontaneous replay. We propose a model that can account for this phenomenon and suggests that a spatially consistent replay requires a number of constraints on the hippocampal network that affect its synaptic architecture and the statistics of synaptic connection strengths.


I. INTRODUCTION
FIG. 1: Place cells, place fields and cell assemblies. A. A schematic representation of the spike trains produced by three place cells, c 1 , c 2 and c 3 . The two red rectangles mark the periods during which the cells are coactive [38]. B. The gold, green and blue areas represent place fields. Place cell firing rate is maximal at the center of the place field and attenuates towards its periphery; this pattern can be closely approximated by Gaussian distribution. Place cell cofiring reflects overlap between respective place fields: cells c 1 and c 2 are coactive in the location l 12 , cells c 2 and c 3 are coactive in the location l 23 and so on. The red links mark distances between the centers of the place fields and the triple overlap domain, l 123 (dark region in the center). C. A schematic representation of a cell assembly: the three place cells on the top synapse onto a readout neuron (red dot), which activates within the cell assembly field l 123 . D. During replay, the place cells repeat on a millisecond time scale the order of spiking that they exhibit during active navigation.

II. THE MODEL
The simplicial model of the cell assembly network. A convenient framework for representing a population of place cell assemblies is provided by simplicial topology [32][33][34]. In this approach, an assembly of d + 1 place cells, {c i 0 , c i 1 , ..., c i d }, is represented by a d−dimensional abstract simplex (not to be confused with a geometric simplex) containing d + 1 vertexes, σ = v i 0 , v i 1 , ..., v i d , where each vertex, v i , corresponds to a place cell c i (in the following, the same symbol "σ" will be used to denote a cell assembly and the simplex that represents it) [37,38]. The entire network can then be represented by a purely combinatorial simplicial complex T [31,32] whose maximal simplexes correspond to place cell assemblies [39]. Simplexes in T may overlap: physiological studies demonstrate that a given place cell may be a part of many cell assemblies [40,41]. Many authors have suggested that place cell assemblies should overlap significantly in order to better represent contiguous spatial locations [46][47][48][49]: the more cells shared by σ 1 and σ 2 , the closer the encoded locations are to one another. The most detailed representation of the environment is produced by a population of maximally overlapping cell assemblies, which differ by a single cell. In such case, a transition of the activity from one cell assembly σ 1 to another σ 2 occurs when one place cell in σ 1 turns off and another cell in the new assembly σ 2 turns on. The resulting simplicial complex T has the structure of a combinatorial d-dimensional simplicial manifold (in the literature also referred to as "pure complex" or "pseudomanifold", [31]).
Population activity in the cell assembly complex T . The simplicial complex T is a convenient instrument for relating place cell coactivity to the topology of the rat's environment [37,38]. The rat's movements in the physical environment induce a packet of place cell activity that propagates in the hippocampal network-an "activity bump" [27]. In our model the propagation of the activity bump corresponds to an "active simplex" propagating through T . The resulting population activity vector is then where the first component f σ represents the spiking rate of the readout neuron, and f σ,v i denotes the spiking rate of the place cell c i within the assembly σ. Roughly speaking, f σ,v i can be viewed as the firing rate of c i at the location where the place fields of the cells constituting the assembly σ overlap, which we refer to as the cell assembly field, l σ (the domain l 123 on Figure 1B). A given place cell c i is a part of many cell assemblies σ 1 , σ 2 , ..., whose fields l σ 1 , l σ 2 , ... are contained in the c i 's place field; thus, the higher the orders of the cell assemblies, the (statistically) smaller the l σ s [39]. Since the individual place cell spiking rates are well approximated by smooth Gaussian functions of the rat's coordinates [36], the quantities f σ,v i remain approximately constant over l σ . The components of the population activity vector (1) in a given cell assembly can then be related to the corresponding place cells' maximal firing rates f v i by a set of factors 0 ≤ h σ,v i ≤ 1, that are specific to a given cell and a given cell assembly, which may be viewed as measures of the separation between the location l σ and the respective place fields' centers ( Figure 1B). In other words, the coefficients h σ,v i provide a discrete description of the place field map's geometry.
As the rat moves from one cell assembly field to another (e.g., from l σ 1 to l σ 2 ), the activity packet in T shifts from the maximal simplex σ 1 to the maximal simplex σ 2 , then to σ 3 , and so on, tracing a "simplicial path," (these are "thick paths" in the terminology of [30]). As a result, every path γ in the rat's physical environment corresponds to a simplicial path Γ ∈ T , which can be viewed as an abstract representation of the place cell trajectory code used in [21]. However, in order to represent the path Γ in the hippocampal network, the activity of each place cell assembly σ ∈ Γ should activate the corresponding readout neuron c σ . Thus, during the activation period, the net input from the presynaptic cells in σ should exceed the corresponding readout neuron's firing threshold θ σ , where the coefficients w σ,v i represent the strengths of synaptic connections between the place cells and the readout neuron [20,61]. In other words, this is a rate model in that the activity of cells is described by a single parameter: the firing rate, f , related via coefficients h to the maximal rate (2). If the network is trained -the synaptic architecture is fixed, place fields are stable-then each cell assembly fires when the rat visits (or replays) a specific spot where the respective place fields overlap. Because this spot is very small compared to the size of place fields, the left side of (4) is the essentially the same every time.
Using (2), the condition (4) becomes where the variables θ and are defined on all simplexes (i.e., all cell assemblies), and the variable f on the vertexes (i.e., place cell).
Dressed cell assembly complex T * . The coefficients b σ,v i can be regarded as characteristics of the maximal simplexes of T and the values f v i as characteristics of its vertexes. Together, these parameters produce a "dressing" of the cell assembly complex with physiological information about the cells' spiking and the network's synaptic architecture. Equation (5) singles out a set B T * of valid dressings, b T * = {b σ,v : eq. (5) is satisfied} which enable readout neurons to respond to presynaptic activity and thus defines the scope of working synaptic architectures of the place cell assembly networks. Replays occur on a millisecond time scale and produce only a few spikes per activity period [19] (Figure 1D), which is comparable to the stochastic background activity of neurons. In order to distinguish cell assembly activation from the assembly's background activity, the readout neuron should be tuned to a particular combination of inputs; the physiological process most likely involves gating specific parts of the dendritic tree by timed inputs from the presynaptic cells. Here, the model employs a simplified version of this process: we propose that the readout neuron should remain in a sensitive, near-threshold state [50] that allows it to quickly respond to the cell assembly during each individual step of replay. Thus, we hypothesize that during replays the inequality (5) may be approximated by the equation which further restricts the set of valid dressings to a special marginal setB T * , for which spontaneous replays of place cell assemblies are possible. Note, however, that equation (7) does not fix the values of the parameters f v i and b σ,v i , and so it allows a significant variability of spiking activity and of the synaptic connection strengths. To emphasize the assumption that place cell activity during replays elicits a response from the readout neuron at a constant rate f σ > 0, it is convenient to use the notation where b σ,σ > 0 is a fixed parameter that can be interpreted as the readout neuron's susceptibility to discharge.
Replays. Equation (7) defined at each simplex of T * [30] provides a simple tool for building a model of hippocampal replay. As an illustration, consider the case when T * is two-dimensional and let σ 1 = [v 0 , v 1 , v 2 ] be a 2D simplex representing an assembly of three cells with the firing rates f v 0 , f v 1 and f v 2 . If equation (7) holds over σ 1 , then the readout neuron c σ 1 fires with the rate f σ 1 in response to the coactivity of c 1 , c 2 and c 3 , Suppose that equation (7) also holds for an adjacent (maximally overlapping) cell assembly, represented by an adjacent simplex , so that the second readout neuron c σ 2 fires with the rate A key observation here is that, since σ 2 shares vertexes v 1 and v 2 with σ 1 , the corresponding firing rates f v 1 and f v 2 in (10) define uniquely the firing rate of the remaining cell, f v 3 , required to activate the readout neuron c σ 2 ( Fig. 2A), Similarly, if there is another 2D simplex σ 3 = [v 2 , v 3 , v 4 ] adjacent to σ 2 , then, once the value f v 3 is found from (11), the firing rate at v 4 can be obtained from f v 2 and f v 3 , and so on ( Figure 2B). In other words, once the synaptic connections b σ,v are specified for all simplexes, equation (7) can be used to describe the conditions for transferring the activity vector f σ over the entire complex T * [30]. Notice however, that equations (9)-(11) do not specify the mechanism responsible for generating place cell activity; they only describe the conditions required to ignite the cell assemblies in a particular sequence. While the subsequent simplexes σ n and σ n+1 in the simplicial path (3) are not necessarily adjacent, the activity according to equation (7) is propagated along a sequence of adjacent maximal simplexes, such as depicted in Figure 2B. Discrete Holonomy. Using the notation equation (11) defined over a simplex σ p can be rewritten in matrix form where the "transfer matrix" M v t v s q,p propagates the population activity vector from the incoming facet of the simplex σ p into the activity vector of the outgoing, opposite facet shared with the next simplex σ q (edges If the simplicial path is closed, then the activity vector should be restored upon completing the loop, i.e., f n = f 1 . According to (14), this will happen if the product of the transfer matrices along Γ yields a unit matrix, It can be directly verified, however, that condition (15) is not satisfied automatically: the product of transfer matrices (15) has the structure which differs from the unit matrix M Γ 1 (see Appendix). This implies that a population activity vector f σ is in general altered by translations around closed simplicial paths, f σ (t start ) f σ (t end ). To formulate this another way, the spiking condition (7) does not automatically guarantee that the readout neurons will consistently represent spatial connectivity; the latter requires additional constraints (15), irrespective of the mechanism that shifts the activity bump.
Mathematically, a mismatch between the starting and the ending orientation of the population activity vector is akin to the differential-geometric notion of holonomy which, on Riemannian manifolds, measures FIG. 3: Discrete geometry of a dressed simplicial complex. A. Discrete holonomy: a population activity vector (red arrow) changes its direction from simplex to simplex as described by (13). Upon completing a closed path, the starting and ending vectors may differ, f start f end , which indicates nonzero holonomy. B. A 2D elementary closed path of the order n encircling a vertex v 0 . The "pivot" vertex v 0 carries the discrete curvature coefficients defined by (17). C. A higher dimensional elementary closed path consisting of d-dimensional simplexes (one such exemplary simplex σ (d) 1 is shadowed) sharing the same (d − 2)-dimensional face, the pivot simplexσ 1 , shown in red. The d − 2 dimensional pivot simplexσ shown in red carries the curvature coefficients κσ ,i . the change of a vector's orientation as a result of a parallel transport around a closed loop [30,[33][34][35]. Hence, the requirement (15) that the activity vector should be the same after completing a closed simplicial trajectory implies that the discrete holonomy along paths in T * should vanish.
Discrete Curvature. In differential geometry, zero holonomy on a Riemannian manifold is achieved by requiring that the Riemannian curvature tensor R i jkl associated with the connection Γ i jk vanishes at every point x [34,35]. This condition is established by contracting closed paths to infinitesimally small loops encircling a point x and translating in parallel a unit vector n around that loop. The difference between the starting and the ending orientations of n defines the curvature at the point x [35]. An analogous procedure can be performed on a discrete manifold T * . However, there is a natural limit to shrinking simplicial paths: in a d-dimensional complex, the tightest simplicial paths consist of d−dimensional simplexes σ (d) which intersect the same (d − 2) dimensional face (see Figure 3B). Such a path Γ σ (d−2) we will call an "elementary closed path", following [30]. The order s n of such a path is defined by the number of d-dimensional simplexes σ (d) encircling a simplex σ (d−2) . In the following we will use the short notationσ for the "pivot" simplexesσ ≡ σ (d−2) whereas the elementary simplicial path encirclingσ will be denoted as Γσ.
In order to ensure zero holonomy of place cell activity along all closed paths in T * , it is sufficient to verify that the holonomy vanishes for all elementary closed paths [30]. The product of the matrices M v t v s q,p encircling the pivotσ ( Figure 3B) has the same form as equation (16); however, the coefficients κσ ,i at the bottom row of the matrix Mσ can be viewed as the curvatures defined atσ. Thus, to ensure zero holonomies, the conditions i = 1, ..., d + 1, must be imposed on the connection coefficients b σ,v i at every pivot simplexσ of a ddimensional dressed cell assembly simplicial complex. For example, an elementary 2D closed path encircling a vertex v 0 with n simplexes enumerated as shown on Figure 3C yields the holonomy matrix The values κ v 0 ,i , i = 1, 2, 3, of the bottom row that distinguish M v 0 from the unit matrix should be considered as discrete curvatures defined at the pivot vertex v 0 (see Figure 3C and [30]), which need to vanish in order to ensure a consistent representation of space during replays.
Since there exists a finite number of pivot simplexes, the number of constraints (17) on a given dressing b T ∈B T * is finite. Thus, the scope of nontrivial zero holonomy conditions (15) drastically reduces and the task of ensuring consistency of translations of the population activity vectors over T * becomes tractable. Nevertheless, zero curvature conditions (17) are in general quite restrictive and impose nontrivial constraints on the synaptic architecture of the place cell assemblies. As the simplest illustration, consider the case when the firing rates of all the place cells and readout neurons are the same: f v i = f σ k = f , and all the connection strengths from the place cells to the readout neuron in all cell assemblies are identical: b σ i ,v i =b, giving a constant connection dressingb T * . It can be shown that in this case the resulting transfer matrix is idempotent, that is M 2 σ = 1, so that the zero curvature condition (17) is satisfied identically for the even order elementary closed paths and cannot be satisfied if the paths' order is odd. Under more general and physiologically more plausible assumptions equation (17) does not necessarily restrict the order of the cell assemblies. However, the domain of permissible dressings,B T * is significantly restricted by (17), as compared to the domain occupied by the synaptic parameters of the unconstrained cell assembly networks.

III. STATISTICS OF SYNAPTIC WEIGHTS IN THE LIMIT OF WEAK SYNAPTIC NOISE
The zero curvature constraints (17) affect the net statistics of the synaptic weights. Since the structure of the full space of marginal dressingsB T * and of the corresponding probability measures is too complex, we considered a family of connections parametrized as in which the fluctuations ε σ,v are normally distributed, In the absence of zero curvature constraints, cell assemblies are uncoupled and the synaptic fluctuations are statistically independent, so that the joint probability distribution of ε σ,v is Under zero-curvature conditions (17) the parameters of the synaptic architecture are coupled ( Figure 5) and the probability distribution for a particular variable ε σ,v is obtained by averaging the joint distribution (20) under delta-constraints:P where C is the normalization constant and D ε ≡ dε σ,v denotes integration over all ε σ ,v ε σ,v . In the Appendix it is demonstrated that for weak fluctuations, the shape of the distribution (19) remains Gaussian,P but its width decreases: ε * < ε. Thus, zero curvature conditions narrow the distribution of the uncorrelated weights, i.e., produce a "tuning" of the synaptic connections b σ,v . This result also applies to the synaptic weights: in cases where the place fields are distributed regularly, so that the coefficients h σ,v i have a well defined mean,h, and a small multiplicative variance, ,v 2 are approximately defined by the ratios of the synaptic weights, and therefore the zero curvature conditions produce the same effect on w σ,v as on b σ,v , i.e., reduce the variability of synaptic weights. Understanding the effects produced by zero curvature constraints (17) on a wider range of fluctuations is mathematically more challenging. The qualitative results obtained here, however, may generalize beyond the limit of small multiplicative synaptic noise and could eventually be experimentally verified. A physiological implication of the result (22) is that the distribution of the unconstrained synaptic weights in a network that does not encode a representation of space (e.g., measured in vitro) should be broader than the distribution measured in vivo in healthy animals, which can be tested once such measurements become technically possible.

IV. DISCUSSION
The task of encoding a consistent map of the environment imposes a system of constraints on the hippocampal network (i.e., on the coefficients b σ,v ) that enforce the correspondence between place cell activity and the animal's location in the physical world. Here we show that zero holonomy is a key condition, which is implemented by requiring that curvatures vanish at the pivot simplexes. This approach works within a combinatorial framework, but a similar intuition guided a geometric approach [29], where the place cells' ability to encode the location of the animal-but not the path leading to that location-was achieved by imposing the conditions of Stoke's theorem [34] on the synaptic weights of the hippocampal network, which were viewed as functions of Cartesian coordinates. Our model is based on the same requirement of pathinvariance of place cell population activity, implemented on a discrete representation of space-a dressed abstract simplicial complex T * -without involving geometric information about the animal's environment.
In particular, note that the concepts of "curvature" and "holonomy" are defined in combinatorial, not geometric, terms. This is an advantage in light of (and indeed was motivated by) recent work indicating that the hippocampus provides a topological framework for spatial experience rather than Cartesian map of the environment [24], and it also makes our model somewhat more realistic. It does, however, lead to a number of technical complications. For example, discrete connections (6) defined over T * are nonabelian [30], so using the approach of [29] would require a nontrivial generalization of Stoke's theorem, which is valid only in spaces with abelian differential-geometric connections [51]. Our approach is based on the analysis of discrete holonomies suggested in the pioneering work of [30] which, in fact, explains the mathematical underpinning of the Stoke's theorem approach in both abelian and nonabelian cases [33][34][35]. Indeed, the zero-holonomy constraint ensures that no matter what direction the activity is propagated in the network (forward, backward, or skipping over some cell assemblies), the integrity of the spatial information remains intact.
Generality of the approach. A key instrument of our analyses is equation (7), which describes the conditions necessary for propagating spiking conditions over the cell assembly network. The exact form of this equation is not essential-a physiologically more detailed description of near-threshold neuronal spiking [52][53][54] could be used to establish more accurate zero holonomy and curvature constraints on the hippocampal network's synaptic architecture, which should be viewed as a general requirement for any spatial replay model.
The assumption of maximally-overlapping place cell assemblies may also be relaxed, since equation (7) can be applied in cases where the order of the cell assemblies varies, that is, when the simplicial complex T * is not a manifold but a quasimanifold (see Figure 4 and [55,56]). Unfortunately, implementing the "zero holonomy" principle in this case would require rather arduous combinatorial analysis. For example, FIG. 4: A replay in simplicial quasimanifold. An example of a simplicial quasi-manifold containing 2D and 3D simplexes. The activity of cells in the 3D simplexes is induced from the 2D simplexes approaching its sides. Two simplicial paths are shown by gray triangles, marked by red dotted lines.
propagating the activity packets using (14) would impose relationships between the dimensionalities of the maximal simplexes and their placement in T * , i.e., require a particular cell assembly network architecture.
Learning the constraints. In this paper, the requirements (15) and (17) enforcing path consistency of place cell replay are imposed on a fully trained network: it is assumed that the place fields have had time to stabilize [59] and that the cell assemblies with constant weights w σ,v i have had time to form [4]. In a more realistic approach, these constraints should modulate the hippocampal network's training process. For example, if the unconstrained network is trained by minimizing a certain cost functional S (b T * ) [18,62] then the constraints (17) would contribute an additional "curvature term" R(b T * ), defined, e.g., via Lagrange multipliers r i , Physiologically, the network may be trained by "ringing out" the violations of the conditions (17) in the neuronal circuit, i.e., by replaying sequences and adapting the synaptic weights to get rid of the centers of non-vanishing holonomy. Curiously, the role played by R(b T * ) in (23) resembles the role played by the curvature term in the Hilbert-Einstein action of General Relativity Theory [34], which ensures that, in the absence of gravitational field sources, the solution of the Hilbert-Einstein equations describes a flat spacetime. By analogy, the constraints imposed by (17) may be viewed as conditions that enforce "synaptic flatness" of the hippocampal cognitive map.
It is worth noting that the mechanism suggested here is an implementation of the zero holonomy condition in this simplest case of the reader-centric cell assembly theory that is consistent with physiology. The place cell readout might involve, instead of a single neuron, a small network of a few neurons (not yet identified experimentally), which might require a different implementation of zero holonomy principle, depending on the specific architecture of such a network. If the readout network is a cluster of synchronously activated downstream neurons, then this cluster of cells could be viewed as a "meta-neuron" and the proposed approach would apply to this case as well. More complicated architectures would require modifications, but it is reasonable that the reproducibility of the population vector would require zero holonomy in all cases.

V. ACKNOWLEDGMENTS
I thank V. Brandt and R. Phenix for their critical reading of the manuscript and the reviewers for helpful comments..
The work was supported in part by Houston Bioinformatics Endowment Fund, the W. M. Keck Foundation grant for pioneering research and by the NSF 1422438 grant.

VI. APPENDIX
Transfer matrix construction is carried out for the 2D case, since higher dimensions are similar. In the matrix form, equation (11) defined over the simplex σ p , can be written as f q =M v k v j q,p f p , in which the matrix transfers the activity vector defined over the incoming edge [v i , v j ] of the p-th simplex into the activity vector at the outgoing edge [v i , v k ] of the same simplex (e.g., from the edge [v 0 , v 1 ] to the edge [v 1 , v 2 ] of σ 1 on Figure 2A), To ignite the readout neuron of the next cell assembly σ q , which shares the edge [v i , v k ] with σ p the vector (25) needs to be transformed into by the diagonal matrix D p,q = diag( f σ q / f σ p , 1, 1). Together, these two operations produce the transfer matrix A direct verification shows that a product of n transfer matrices that stat and end at the same simplex, has the form (16), in which κ Γ,i are nth order polynomials of the coefficients (12).
Tuning of the fluctuation distribution. In case when the fluctuations are small, ε 1, the constraints (17) uncouple ( Figure 5) yielding linearized curvature coefficients κσ ,i =