Transient cell assembly networks encode stable spatial memories

One of the mysteries of memory is that it can last despite changes in the underlying synaptic architecture. How can we, for example, maintain an internal spatial map of an environment over months or years when the underlying network is full of transient connections? In the following, we propose a computational model for describing the emergence of the hippocampal cognitive map in a network of transient place cell assemblies and demonstrate, using methods of algebraic topology, how such a network can maintain spatial memory over time.

U 2 , …, U n , then it is possible to reconstruct the topology of X from the pattern of overlaps between these regions. To do that, one builds what is known as a "nerve simplicial complex" or simply "nerve of the cover"  : each element U i defines a vertex of  , each pair of overlapping elements, U i and U j , defines a 1D simplex (a bond), σ ij and so on. The Alexandrov-Čech theorem states that if every such overlap is contractible in X, then the nerve of the cover,  , is topologically equivalent to the covered space X 47 . If X is viewed as the environment and U i 's as the place fields, then this construction suggests that the place field map encodes the topological information of the space navigated by the rat.
One can visualize the process of building the nerve simplicial complex (i.e., learning a space) as follows: as soon as an animal enters a place field U i , the simplicial complex  acquires a vertex v i ; as soon as the intersection of two place fields is visited, a link, σ ij , appears between the vertices v i and v j . Visiting a location where three place fields overlap contributes a triangle, σ ijk , between vertices v i , v j and v k , and so on (see Suppl. Fig. 1). As the animal explores the environment, new overlaps are detected and the nerve simplicial complex grows over time,   = t ( ). If the environment is densely covered with place fields, then there will be a moment, T min , when the animal will have sampled a critical mass of the intersections between the place fields, at which point the simplicial complex T ( ) min  will be sufficiently dense to capture the topological structure of the underlying environment. One might be tempted to view this argument as a mathematical proof that the information encoded in place cell activity is sufficient to encode the topological features of the environment, but the reality is more complex: we must remember that place fields are artificial constructs used by experimentalists to visualize the spike data. The hippocampus and the downstream brain regions do not have access to the elements of the geometric construction described above-the shape of the place fields or their locations. For the brain, the information is represented only by place cell spiking activity: if the animal enters a location where several place fields overlap, this fact will be detected by the downstream brain areas only by sensing the co-firing of the respective place cells. In other words, physical overlap of place fields necessitates temporal overlap of the firing of the respective place cells.
The rest of the construction is similar: the activity of a place cell, c i , is represented by a vertex v i ; the detected coactivity of two place cells, c i and c j -by a bond, σ ij , between vertices v i and v j ; the detected coactivity of three place cells, c i , c j and c k -by a 2D simplex σ ijk and so on. This procedure will produce a temporal "coactivity complex"  t ( ) that is analogous to the  t ( ) constructed above: at every moment of time t, the coactivity complex t ( )  represents only those place cell combinations that have exhibited (co)activity. As the animal begins to explore the environment, the newly emerging coactivity complex is small, fragmented and contains many holes, most of which do not correspond to physical obstacles or to the regions that have not yet been visited by the animal (Fig. 1A). These gaps tend to disappear as the pool of place cell coactivities accumulates. Numerical simulations show that, if place cells operate within biological parameters 40 , the topological structure of  becomes equivalent to the topological structure of the environment within minutes. The minimal time T min required to produce a correct topological representation of the environment can then be used as an estimate for the time required by a given place cell ensemble to learn the topological structure or spatial connectivity of the experimental environment (Fig. 1B, refs [40][41][42][43][44], and the coactivity complex t ( )  itself may serve as a schematic model of the hippocampal map 23 . The simplexes of  t ( ), just like the individual cell groups, provide local information about the environment, but together, as a "coactivity" simplicial complex, they represent space as a whole, providing a link between the cellular and the net systemic level of the information processing.
The large-scale topology. The topological structure of a space X can be described in terms of the topological loops that it contains, i.e., in terms of its non-contractible surfaces counted up to topological equivalence. A more basic topological description of X is provided by simply counting the topological loops in different dimensions, i.e., by specifying its Betti numbers b n (X) 47 . The list of the Betti numbers of a space X is known as its topological barcode, , which in many cases captures the topological identity of topological spaces 37 . For example, the environment  shown at the bottom of Fig. 1A has the topological barcode  = … b( ) (1, 1, 0, ), which implies that  is topologically equivalent to an annulus (Fig. 1C). Other familiar examples of topological shapes identifiable via their topological barcodes are a two-dimensional sphere S and a torus T with the barcodes 1C). For the mathematically oriented reader, we note that the matching of topological barcodes does not always imply topological equivalence between topological spaces but, in the context of this study, we disregard effects related to torsion and other topological subtleties.
The analyses of the coactivity complex is based on comparing its topological barcode b( )  to the topological barcode of the environment, b( )  . If these barcodes do not match, then  and  are topologically distinct. In contrast, if the barcode of  is "physical, " i.e., coincides with  b( ), then the coactivity complex provides a faithful representation of the environment. More conservatively, one may compare only the physical dimensions in the barcodes b( )  and  b( ), i.e., 0D, 1D, 2D loops, or the dimensions containing the nontrivial 0D and 1D loops for the environment, as shown on Fig. 1B. Simplicial model of the hippocampal network. If every observed group of coactive place cells contributes a simplex, the resulting coactivity complex  makes no reference to the structure of the hippocampal network, and gives a purely phenomenological description of the information contained in the place cell coactivity. In a more detailed approach, the coactivity complex may be constructed so that its maximal simplexes (i.e., the simplexes that are not subsimplexes of any larger simplex) represent ignitions of the place cell assemblies, rather than arbitrary place cell combinations. The combinatorial arrangement of the maximal simplexes in the resulting "cell assembly coactivity complex," denoted  CA , schematically represents the network of interconnected cell assemblies 23,42 (Fig. 2A).
Scientific RepoRts | 7: 3959 | DOI:10.1038/s41598-017-03423-3 The specific algorithm for constructing the complex CA  may also reflect how neuronal coactivity is processed by the readout neurons. If these neurons function as "coincidence detectors," i.e., if they react to the spikes received within a short coactivity detection period w σ (typically, w σ ≈ 200-250 milliseconds 41,48 ), then the maximal simplexes σ in the corresponding coincidence detection coactivity complex (denoted σ  ) will appear instantaneously at the moments of the cell assemblies' ignitions 42,43 . Alternatively, if the readout neurons integrate the coactivity inputs from smaller parts of their respective assemblies over an extended coactivity integration period ϖ ς 49, 50 , then the appearance of a maximal simplex ς in the corresponding input integration coactivity complex (denoted as ς  ) will extend over time, reflecting the dynamics of synaptic integration. Physiologically, ϖ ς can be viewed as the period during which the readout neuron n ς connects synaptically to a particular combination of coactive place cells, forming a cell assembly ς, retaining these connections, responding to subsequent ignitions of ς and maintaining information of which cells spiked together-this is the readout neuron's "finite memory span. " Clearly, the distribution of the parameters ϖ ς in a given cell assembly network affects the rate at which large-scale topological information is accumulated and thus controls the model's description of spatial learning.
To model an input integrator coactivity complex  ς , we first built a relational graph G that represents the pool of the most coactive pairs of place cells. Specifically, for every cell c i , we select n 0 cells c j , j = 1, …, n 0 , that exhibit the highest rates f c c  The non-contractible closed chain of pink simplexes represents the cell assemblies ignited along one path the animal traverses (loop in ). (B) Timelines of zero-dimensional (0D, cyan), one-dimensional (1D, blue) and two-dimensional (2D, gray) topological loops in  . The number of 0D, 1D and 2D lines at every moment defines the Betti values, b 0 , b 1 and b 2 . As long as a given 0D loop persists,  contains the corresponding connected space (a gray triangle in panel A), a 1D loop represents a noncontractible hole and a 2D loop represents a bubble in  . In the illustrated case, the 0D spurious loops disappear in 1.5 mins, when  fuses into one piece. The spurious 1D loops disappear in about 2.8 min, when all the spurious holes in  close up, and the 2D loops disappear by T min = 4.2 min, at which point  becomes topologically equivalent to . (C) The barcode: topological loops in the environment , sphere S and torus T. In all three cases, any two 0D loops (i.e., points) can be matched with one another via continuous displacements. Thus, all 0D loops are topologically equivalent to a single representative 0D loop, i.e., The 1D loops are of two types: some contract to a point (blue loops), others are non-contractible due to topological obstructions, e.g., the central hole in .
Since the sphere and the torus are 2D surfaces that loop onto themselves, their second Betti numbers are b 2 (S) = b 2 (T) = 1.  is also 2D but it can be contracted to the 1D rim of the central hole, Lastly, none of the three shapes extend beyond 2D, so there are no higherorder Betti numbers. The barcodes are cliques-can then be then be identified with the cell assemblies and viewed as simplexes ς of the clique complex  ς G ( ) 51 . The process of assembling the cliques from pairwise connections can be used to model the process of integrating spiking inputs in the cell assemblies, so that the resulting clique coactivity complex ς  serves as a model of the input integration cell assembly network. Numerical simulations show that the input integration clique complexes reproduce the topological structure of the environment faster and more reliably than coincidence detection coactivity complexes   = σ ⁎ 23,42,43 . In fact, the coincidence detection coactivity complexes can be viewed as a specific case of the input integration coactivity complexes: as the integration period shrinks and approaches the coactivity period ϖ ς → w σ , the input integration coactivity complex ς  reduces to the coincidence complex σ  . For all these reasons we will model only the input integration, i.e., clique coactivity complexes.

Instability of the cell assemblies.
In the foregoing construction of the coactivity complexes  ς , a given cell assembly could take the entire navigation period to form ϖ ς = T tot . It is then presumed to exist from the moment of its first appearance for as long as the navigation continues 42 . A natural approach to modeling cell assemblies with finite lifetimes is to restrict the period during which they can form, so that ϖ ς < T tot . In a population of cell assemblies, the integration periods can be distributed with a certain mode ϖ and a variance Δ ϖ . In order to simplify the approach, we will make two assumptions. First, we will describe the entire population of the readout neurons in terms of the integration period of a typical readout neuron, describing the ensemble of readout neurons with a single parameter, ϖ. Second, we will assume that the integration periods of all neurons are synchronized, i.e., that there exists a globally defined coactivity integration window of width ϖ during which the entire population of the readout neurons synchronously processes coactivity inputs from their respective place cell assemblies. In such case, ϖ can be viewed as a period during which the cell assembly network processes the ongoing place cell spiking activity. Below we demonstrate that these restrictions result in a simple model that allows us to describe a population of finite lifetime cell assemblies and show that the resulting cell assembly network, for a sufficiently large ϖ, reliably encodes the topological connectivity of the environment.

Computational model of the transient cell assembly network.
To build a coactivity complex  with fluctuating or "flickering" maximal simplexes that represents a network with rewiring cell assemblies, we implement a "sliding coactivity integration window" approach (see Suppl. Movie 1). First, we identify the maximal simplexes that emerge within the first ϖ-period after the onset of the navigation, ϖ 1 , based on the place cell activity rates evaluated within that window, f ς (ϖ 1 ), and construct the corresponding input integration coactivity complex  ϖ ( ) 1 . Then the algorithm is repeated for the subsequent windows ϖ 2 , ϖ 3 , … which are obtained by shifting the starting window ϖ 1 over small time steps Δt. Since consecutive windows overlap, the corresponding coactivity , … consist of overlapping sets of maximal simplexes. A given maximal simplex ς (uniquely defined by the set of its vertexes in any window) may appear in a chain of consecutive windows ϖ 1 , ϖ 2 , …, ϖ k − 1 then disappear at a step ϖ k (i.e., , then reappear in a later window ϖ l , then disappear again, and so forth (Fig. 2B). The midpoint t k of the window in which the maximal simplex ς has (re)appeared defines the moment of ς's (re)birth, and the midpoints of the windows where it disappears, are The place cells (small disks) in a given assembly ς are synaptically connected to the corresponding readout neuron n ς (pentagons below). An assembly ς ignites (red clique/tetrahedron in the middle) when its place cells elicit jointly a spiking response from the readout neuron n ς (active cells have red centers). A cell assembly may be active at a certain moment of time, then deactivate, then become active again, and so forth. If a certain cell assembly ceases to ignite and another combination of place cells begins to exhibit frequent coactivity, the old cell assembly is replaced by new one. (B) Formation and disbanding of the cell assemblies in the hippocampal network is schematically represented by appearance and disappearance of the maximal simplexes of the "flickering" coactivity complex. The sequence of figures illustrates fluctuations in a small part of the coactivity complex shown on Fig. 1A. Since the large-scale topological information encoded by the hippocampal network should persist, one would expect that the flickering complex should retain a certain skeletal structure, capable of representing such information.
viewed as the times of its deaths. Indeed, one may use the left or the right end of the shifting integration window, which would affect the endpoints of the navigation, but not the net results discussed below. As a result, the lifetime δt ς,,k of a cell assembly ς between its k-th consecutive appearance and disappearance can be as short as one discrete time step Δt (if ς appears within a window ϖ k and disappears at the next step, within ϖ k + 1 ), or as long as T tot -ϖ in the case if ς appears at the first step and never disappears. However, a typical maximal simplex exhibits a spread of lifetimes that can be characterized by a half-life, as we will discuss below.
It is natural to view the coactivity complexes  ϖ ( ) i as instances of a single flickering coactivity complex ϖ  , , with appearing and disappearing maximal simplexes (Fig. 2B). In the following, we will use ϖ  as a model of the transient cell assembly network and study whether such a network encodes a correct and stable topological map of the environment on a moment-by-moment basis.

Results
Flickering cell assemblies. We studied the dynamics of flickering cell assemblies produced by a neuronal ensemble containing N c = 300 simulated place cells. First, we built a simulated cell assembly network as described above that contains, on average, about N ς ≈ 320 finite lifetime, or transient, cell assemblies (Fig. 3A). As shown in Fig. 3B, the order of the maximal simplexes that represent these assemblies, ranges between |ς| = 2 and |ς| = 14, with the mean of about |ς| = 7, implying that a typical simulated cell assembly includes |ς| = 7 ± 2 cells.
The distribution of the maximal simplexes' lifetimes δt ς,,k as a function of their dimensionality shows that higher-dimensional simplexes (and thus the higher-order cell assemblies) are shorter-lived than the low-order cell assemblies (Fig. 3C). The histogram of the mean lifetimes t ς = 〈δt ς,,k 〉 k is closely approximated by the exponential distribution (Fig. 3D), which suggests that the duration of the cell assemblies' existence can be characterized by a half-life τ ϖ . The individual lifetimes δt ς,k , the number of appearances n ς , and net existence time ΔT ς = ∑ k δt ς,,k of the maximal simplexes are also exponentially distributed (see Fig. 3E and Suppl. Fig. 2). As expected, the mean net existence time approximately equals the product of the mean lifetime and the mean number of the cell assembly's appearances 〈ΔT ς 〉 ≈ 〈n ς 〉 〈δt ς,,k 〉. Figure 3F shows how these parameters depend on the width of the integration window. As ϖ widens, the mean lifetime t ς of maximal simplexes (and thus its half-life and the net lifetime) grows linearly, whereas the mean number of simplexes' appearances 〈n ς 〉 remains nearly unchanged. The latter result is natural since the frequency with which the cell assemblies ignite is defined by how frequently the animal visits the respective cell assembly fields (the domains where the corresponding sets of place fields overlap 42 ). This frequency does not change significantly if the changes in ϖ do not exceed the characteristic time required to turn around the maze and revisit cell assembly fields, in this case ca. 1-2 min. Thus, the model produces a population of rapidly changing cell assemblies; in the simulated case τ ϖ ≈ 9 seconds, which is close to the experimental range of values 22 . These results allow us to address our main question: can a network of transient cell assemblies encode the topology of the environment?
Flickering coactivity complex. We next studied the properties of the flickering coactivity complex ϖ  formed by the pool of fluctuating maximal simplexes. First, we observed that the size of  ϖ does not fluctuate significantly across the rats' navigation time. As shown in Fig. 4A, the number of maximal simplexes   4B). The result suggests that as temporal separation |t i − t j | increases, the differences between  ϖ t ( ) i and  ϖ t ( ) j rapidly accumulate, meaning that the pool of maximal simplexes shared by ϖ t ( ) i  and ϖ t ( ) j  rapidly thins out. After about 2 minutes (over 50 window shifts, |i − j| > 50) the difference is about 95% (Fig. 4B).
Since the coactivity complexes are induced from the pairwise coactivity graph G as clique complexes, we also studied the differences between the coactivity graphs at different moments of time by computing the normalized distance between the coactivity matrices (see Methods). The results demonstrate that the differences in G, i.e., between G(t j ) and G(t i ), accumulate more slowly with temporal separation than in ϖ  : after about two minutes the connectivity matrices differ by about 10-15% (Fig. 4C). Figure 4D shows the asymmetric distance between two consecutive coactivity complexes ϖ t ( ) i  and  ϖ + t ( ) i 1 , and the asymmetric distance between the starting and a later point ϖ t ( ) 1  and  ϖ t ( ) i , normalized by the size of  ϖ t ( ) 1 as a function of time. The results suggest that, although the sizes of the coactivity complexes at consecutive timesteps do not change significantly, the pool of the maximal simplexes in  ϖ is nearly fully renewed after about two minutes (see Suppl. Movie 1). In other words, although the coactivity complex changes its shape slowly, the integrated changes across long periods are significant (compare Fig. 4E with Fig. 2B). Biologically, this implies that the simulated cell assembly network, as described by the model, completely rewires in a matter of minutes (see Suppl. Movies 2 and 3).
Topological analysis of the flickering coactivity complex exhibits a host of different behaviors. First, we start by noticing that the 0th and the higher-order Betti numbers always assume their physical values b 0 = 1, b n>4 = 0, whereas the intermediate Betti numbers b 1 , b 2 , b 3 and (for small ϖs) b 4 can fluctuate (Fig. 5A and Suppl. Fig. 3). In other words, despite the fluctuations of its simplexes, the flickering complex ϖ  does not disintegrate into pieces (i.e., b 0 > 1 is never observed) and and produces no noncontractible topological loops in dimensions D > 4 (i.e., b n>4 = 0). Biologically, this implies that the topological fluctuations in the simulated hippocampal map are limited to 1D loops, 2D surfaces and 3D bubbles. For example, an occurrence of b 1 = 2 value indicates the appearance of an extra (non-physical) 1D loop that surrounds a spurious gap in the cognitive map (Fig. 1A). On the Scientific RepoRts | 7: 3959 | DOI:10.1038/s41598-017-03423-3 other hand, at the moments when b 1 = 0, all 1D loops in ϖ  are contractible, i.e., the central hole is not represented in the simulated hippocampal map 52 . The moments when b n>2 > 0 indicate times when the flickering complex  ϖ contains non-physical, non-contractible multidimensional topological surfaces. One can speculate about the biological implications of these fluctuations, as illustrated in Suppl. Fig. 5.
As the coactivity window increases, the fluctuating topological loops become suppressed and vice versa, as the integration window shrinks, the fluctuations of the topological loops intensify (Fig. 5). This tendency could be There are about N ς = 320 maximal simplexes at every given timestep (first 200 are enumerated along the y-axis), whereas the total number of maximal simplexes observed during the entire navigation period is about 11,000. The color of the timelines marks the order of ς (colorbar on the right). Notice that the simplexes of lower orders generally persist over longer intervals. (B) Number of maximal simplexes as a function of their order has a Gaussian shape with the mean d = 7 and standard deviation Δ d ≈ ±2, suggesting that a typical cell assembly contains about seven neurons and about two neurons may appear or disappear from it at a given moment. (C) Average existence time of the maximal simplexes tends to decay with increasing order. (D) Histogram of the maximal simplexes' individual average lifetimes t ς fit with the exponential distribution with mean τ ϖ = 9 s, defining the half-life of the simulated cell assemblies for this ϖ. (E) Histogram of the maximal simplexes' lifetimes t ς,,k , i.e., of the lengths of all intervals between consecutive appearance and disappearance of the maximal simplexes, the histogram of the number of simplex-births n ς and the histogram of the total existence periods T ς fit with their respective exponential distributions. The mean number of simplex' appearances 〈n ς 〉 ≈ 1.5 shows that most maximal simplexes appear only once or twice, though some maximal simplexes may appear 20 times or more. Notice that the mean net existence period 〈T ς 〉 ≈ 14.57 s is approximately equal to the product of the mean lifetime and the mean number of appearances 〈T ς 〉 ≈ 〈n ς 〉 〈t ς,,k 〉. (F) As the size of the memory window ϖ increases, the lifetimes, half-lives, and net existence periods of the maximal simplexes grow linearly with ϖ.
expected, since the cell assembly lifetimes reduce as the integration window shrinks and increase as the coactivity integration window grows (Fig. 3F). However, a nontrivial result suggested by Fig. 5 is that the topological parameters of the flickering complex can stabilize completely, even though its maximal simplexes keep appearing and disappearing, or "flickering. " At ϖ ≈ 6 minutes, the Betti numbers of ϖ  remain unchanged (Fig. 5A), whereas the lifetime of its typical simplex is about 10 seconds (Fig. 3F). Biologically, this implies that a stable hippocampal map can be encoded by a network of transient cell assemblies, i.e., that the ongoing synaptic plasticity in the hippocampal network does not necessarily compromise the integrity of the large-scale representation of the environment.
Local learning times. If information about the detected place cell coactivities is retained indefinitely, the time required to produce the correct topological barcode of the environment T min may be computed only once, starting from the onset of the navigation, and used as the low-bound estimate for the learning time 40,41,44 . In the case of a rewiring (transient) cell assembly network, the pool of encoded spatial connectivity relationships is constantly renewed. As a result, the time required to extract the large-scale topological signatures of the environment from place cell coactivity becomes time-dependent and its physiological interpretation also changes. T min (t k ) now defines the period over which the topological information emerges from the ongoing spiking activity at every stage of the navigation, i.e., defines a local span of the learning period. Thus, the process of extracting the large-scale topology of the environment should be quantified in terms of the mean learning time T min = 〈T min (t k )〉 k is defined as the number of the maximal simplexes at moment t i that are missing at the moment t j . As the timestep separation |i − j| grows, d ij rapidly increases. (C) The matrix of similarity coefficients r ij between the weighted coactivity graphs at different timesteps. For close timesteps i and j, the differences between the corresponding coactivity graphs G(t i ) and G(t j ) are small, but as time separation grows, the differences accumulate, though not as rapidly as with the coactivity complexes. (D) At each moment, t i , the blue line shows the proportion of maximal simplexes present at the previous time, t i − 1 . The green line shows the proportion of maximal simplexes contained at the start (in ϖ t ( ) 1  ) that remain in the coactivity complex at the later time  ϖ t ( ) i . The population of simplexes changes by about 95% in about 2 min. (E) A schematic illustration of the changes of the coactivity complex's shape: rather than exhibiting fluctuations around a certain "mean" shape ( Fig. 2B), the coactivity complex continuously restructures. and its variance ΔT min /T min , which does not exceed 40% (typically ΔT min /T min ≈ 20%). This suggests that T min provides a statistically sound characteristic of the information flow across the simulated cell assembly network.
As shown in Fig. 5B, the proportion ξ of "successful" coactivity integration windows (those windows in which T min assumes a finite value) depends on their width ϖ. For small ϖ, the coactivity complex frequently fails to reproduce the topology of the environment (Fig. 5A). As ϖ grows, the number of failing points, i.e., those for which T min (t k ) > ϖ (red asterisks on Fig. 5A), reduces due to the suppression of topological fluctuations. Moreover, the domains previously populated by the divergent points are substituted with the domains of relatively high but still finite T min (t k ). For sufficiently large coactivity windows (ϖ > 6 minutes), such divergent points become exceptional or disappear entirely: the correct topological information is recaptured within all memory windows.
Of note, the time dependence of T min (t k ) exhibits abrupt increases and decreases, with characteristic 45° slants in-between. The rapid rises of T min (t k ) correspond to appearances of obstructions in the coactivity complex ϖ  (and possibly higher-dimensional surfaces) that temporarily prevent certain spurious loops from contracting. As more connectivity information is supplied by the ongoing spiking activity, the coactivity complex ϖ  may acquire a combination of simplexes that eliminates these obstructions, allowing the unwanted loops to contract and yielding the correct topological barcode. Thus, Fig. 5B suggests that the dynamics of the coactivity complex is controlled by a sequence of coactivity events that produce or eliminate topological loops in  ϖ , while the 45° slants in T min (t k ) represent "waiting periods" between these events (since with each window shift over Δt, the local learning time decreases by exactly the same amount).
To better understand how the learning time depends on the coactivity integration window width, we tested the dependence of T min on ϖ by fixing the position of several coactivity integration windows ϖ k and expanding their right side, ϖ ϖ ϖ ( ) (Fig. 6 and Suppl. Fig. 4). As one would expect, small values of ϖ generated many failing points, whereas the learning times T min (t k ) computed for the successful trials remained nearly equal to ϖ, i.e., the width of the narrow integration windows was barely sufficient for producing the correct barcode  b( ). However, as ϖ grows further, T min stops increasing and, as ϖ exceeds a certain critical value ϖ c (typically  is about 10 secs (Fig. 4C). As the integration window narrows, the topological fluctuations intensify (Suppl. Fig. 2). (B) The variation in the time required to extract the topological information increases as the coactivity integration window shrinks. At ϖ = 6 min, there are no failing points. Notice that the starting learning time corresponds to the T min value computed for the "perennial" case ϖ = ∞, illustrated on (Fig. 1B). As the memory window shrinks to ϖ = 4 min, the topological mapping fails in only 1% of the cases-just one point over 8 minute interval, when a spurious 1D loop appears. At ϖ = 2 min, the complex ϖ  fails to produce the correct topological information in 24% of the cases (convergence score ξ = 0.76). The failing moments are marked by red dots. Here we compute the most conservative estimate for the learning time T min to be the time required to establish the correct topology only in the dimensions that may contain physical obstructions, 0D and 1D. Therefore, the points where T min diverges are marked by appearances of spurious 1D loops (encapsulated into red dashed boxes across panels). The points where the learning time rapidly changes are often accompanied by the appearance or disappearance of higher dimensional topological loops (blue dashed boxes). about five or six minutes), the learning time begins to fluctuate around a mean value T min = 〈T min (t k )〉 of about two minutes. In other words, for sufficiently large coactivity windows ϖ > ϖ c , the learning times become independent of the model parameter ϖ, and therefore the model provides a parameter-free characterization of the time required by a network of place cell assemblies to represent the topology of the environment, whereas ϖ c defines the time necessary to collect the required spiking information (Suppl. Fig. 5).

Discussion
Fundamentally, the mechanism of producing the hippocampal map depends on two key constituents: on the temporal relationships among the action potentials produced by the place cells and by the way in which spiking information is processed by the downstream networks. A key determinant for the latter is the synaptic architecture of the cell assembly network, which changes constantly due to various forms of synaptic and structural plasticity: place cell assemblies may emerge in cell groups that exhibit frequent coactivity or disband due to lack thereof. The latter phenomenon is particularly significant: since the hippocampal network is believed to be one of the principal memory substrates, frequent recycling of synaptic connections could compromise the integrity of its net function. For example, the existence of many-to-one projections from the CA3 to the CA1 region of the hippocampus suggests that the CA1 cells may serve as readout neurons for the assemblies formed by the CA3 place cells 8,53 . Electrophysiological studies suggest that the recurrent connections within CA3 and the CA3-CA1 connections rapidly renew during the learning process and subsequent navigation 54,55 . On the other hand, it is also well known that lesioning these connections disrupts the animal's performance in spatial [56][57][58] and nonspatial 59, 60 learning tasks, which suggests that an exceedingly rapid recycling of functional cell groups impairs the formation of the hippocampal map [61][62][63][64] .
The proposed model allows us to investigate whether a dynamically rewiring network of place cell assemblies can sustain a stable topological representation of the environment. The results suggest that if the intervals between consecutive appearance and disappearance of the cell assemblies are short (or, in an alternative interpretation, if the readout neurons have short memory retention span), the hippocampal map exhibits strong topological fluctuations. However, if the cell assemblies rewire sufficiently slowly, the information encoded in the hippocampal map remains stable despite the transience of connections in its neuronal substrate. Thus, the plasticity of neuronal connections, which is ultimately responsible for the network's ability to incorporate new information 65-68 , does not necessarily degrade the information that is already stored in the network. Moreover, Fig. 5 suggests that the network's failure to produce a topological barcode at a particular moment (within a particular integration window ϖ k ) is typically followed by a period of successful learning. This implies that the forgetting mechanism incorporated into the model, whereby the removal of older connectivity relationships from  ϖ as newer relationships are acquired, allows correction of some of the accidental connections that may have been responsible for producing persistent spurious loops at previous steps. In other words, a network capable of not only accumulating, but also forgetting information, exhibits better learning results. These results present a principal development of the model outlined in refs 40-42, 44 from both a computational and a biological perspective.
Physiological vs. schematic learnings. The schematic approach proposed in ref. 23 allows us to describe the process of spatial learning from two perspectives: as training of the synaptic connections within the cell assembly network-referred to as physiological learning in ref. 23-or as the process of establishing large-scale topological characteristics of the environment, referred to as cognitive learning. The difference between these two concepts is particularly apparent in the case of the rewiring cell assembly network, in which the synaptic configurations may remain unsettled due to the rapid transience of the connections. On the other hand, cognitive The learning times T min (t k ) computed within the growing coactivity window are shown by the blue line. For narrow coactivity windows, the learning times either diverge (T min (t k ) > ϖ) or converge barely (T min (t k ) ≈ ϖ). As ϖ exceeds a certain critical value ϖ c (for the simulated place cell ensemble, ϖ c ≈ 4-6 minutes), the learning time T min (t k ) stops increasing and begins to fluctuate around a certain mean value T min = 〈T min (t k )〉 k . This value is independent of the coactivity window width and hence represents a parameter-free characterization of the mean time required to extract topological information from place cell coactivity. (C) The low-dimensional Betti numbers b 1 , b 2 , b 3 and b 4 as a function of the coactivity integration window width ϖ. As ϖ exceeds a critical value ϖ c , the Betti numbers b n stabilize, indicating suppression of the topological fluctuations in  ϖ . learning is perfectly well defined since the large-scale topological characteristics of the environment can be achieved reliably.
In fact, the model outlines three spatial information processing dynamics at the short-term, intermediate-term, and long-term memory timescales 69 . First, local spatial connectivity is represented in transient cell assemblies within several seconds. This timescale corresponds to the scope of memory processes that involve temporary maintenance of information produced by the ongoing neural spiking activity, commonly associated with short-term memory 69,70 . The short-term memory capacity is around seven (7 ± 2) items 71 , corresponding in the model to the order of the simulated cell assemblies (Fig. 3B). Information about the large-scale connectivity of the environment is acquired and updated at the timescale of the mean learning time T min (Figs 5 and 6), at the order of minutes, corresponding to intermediate-term memory timescale 72,73 . Persistent topological information, represented by the stable Betti numbers, may represent long-term memory about the connectivity of the environment as a whole.

Methods
The rat's movements were modeled in a small planar environment, similar to the arenas used in electrophysiological experiments (bottom of Fig. 1A). The trajectory simulates non-preferential exploratory behavior, without favoring of one segment of the environment over another. In particular, this allows us to avoid inducing artificial topological loops in the coactivity complexes.
Place cell spiking activity is modeled as a stationary temporal Poisson process with a spatially localized Gaussian rate characterized by the peak firing amplitude f c and place field size s c 74 . The results are based on a simulated ensemble of N c = 300 place cells, with log-normally distributed peak firing amplitudes (mode f = 14 Hz) and place field sizes (mode s = 17 cm). The place cell spiking probability is modulated by the θ-component of the extracellular field oscillations (mean frequency of ~8 Hz 75 ) recorded in wild-type Long Evans rats (see Methods in ref. 17). These values, selected based on our previous studies of topological maps encoded by place cell ensembles, guarantee the existence of a correct topological map in a population of "perennial" cell assemblies (ϖ = ∞). For more computational details and a discussion of the range of behavioral and physiological parameters see refs 40, 41, 44. The activity vector of a place cell c is constructed by binning its spike trains into an array of consecutive coactivity detection periods w. If the time interval T splits into N w such periods, then the activity vector of a cell c over this period is m c (T) = [m c;1 , …, m c;Nw ], where m c;k specifies how many spikes were fired by c into the k-th time bin 42 . The activity vectors of N c cells, combined as rows of a N c × N w matrix, form the activity raster R. A binary raster B is obtained from the activity raster R by replacing the nonzero elements of R with 1.
Place cell spiking coactivity is defined as firing that occurs over two consecutive θ-cycles, which is an optimal coactivity detection period w both from the computational 41 and from the physiological 48 perspective. Coactivity ρ of a pair of cells c 1 and c 2 can be computed as the formal dot product of their respective activity vectors ρ c1c2 = m c1 (T)m c2 (T).