Galaxy Quenching from Cosmic Web Detachment

We propose the Cosmic Web Detachment (CWD) model, a framework to interpret the star-formation history of galaxies in a cosmological context. The CWD model unifies several starvation mechanisms known to disrupt or stop star formation into one single physical framework. Galaxies begin accreting star-forming gas at early times via a network of primordial filaments, simply related to the pattern of density fluctuations in the initial conditions. But when shell-crossing occurs on intergalactic scales, this pattern is disrupted, and the galaxy detaches from its primordial filaments, ending the accretion of cold gas. We argue that CWD encompasses known external processes halting star formation, such as harassment, strangulation and starvation. On top of these external processes, internal feedback processes such as AGN contribute to stop in star formation as well. By explicitly pointing out the non-linear nature of CWD events we introduce a simple formalism to identify CWD events in N-body simulations. With it we reproduce and explain, in the context of CWD, several observations including downsizing, the cosmic star formation rate history, the galaxy mass-color diagram and the dependence of the fraction of red galaxies with mass and local density.


INTRODUCTION
Star formation quenching, its underlying mechanism and what triggers it, is one of the most pressing problems in modern galaxy formation. Galaxies in the Universe are either actively forming stars or in a "quenched" state of practically no star formation. This dichotomy is reflected in the bi-modality in the color-magnitude diagram (Strateva et al. 2001;Hogg et al. 2004;Baldry et al. 2004;Faber et al. 2007) clearly separating blue star-forming spiral galaxies from red "quenched" elliptical galaxies (see Dekel and Birnboim (2006) for a review). Most galaxies sit in one of the two groups and only a few galaxies are found in the "green valley" in between (Schawinski et al. 2014). The clear gap between the two galaxy populations can be interpreted as star formation quenching either having occurred several Gyr ago and/or that it is a fast event (Bell et al. 2004;Blanton 2006;. Several mechanisms have been proposed as responsible for the decrease in star formation activity in galaxies. Currently favored candidates include internal feedback processes such as AGN and supernovae feedback (Silk maragon@astro.unam.mx and Rees 1998;Di Matteo et al. 2005;Best et al. 2005). However, the non-causal connection between black hole mass vs. bulge mass challenges the predominant place given to AGN in galaxy formation (Peng 2007;Jahnke and Macciò 2011) and recent deep x-ray surveys find similar SFR for normal and Type 2 AGN galaxies of similar stellar mass, showing no evidence for AGN-driven quenching. Cosmic environment has been long recognized as playing a major role shaping the properties of galaxies, specially in dense environments (Alam et al. 2018) where tidal effects are important (Kraljic et al. 2018). Dense environments affect galaxies through a series of processes including ram pressure and gas stripping (Gunn and Gott 1972;Balsara et al. 1994;Abadi et al. 1999;McCarthy et al. 2008), harassment (Moore et al. 1996(Moore et al. , 1998, strangulation (Bekki et al. 2002;Fujita 2004;Kawata andMulchaey 2008), preprocessing (Kodama andBower 2001;Treu et al. 2003;Goto et al. 2003). These processes have one key characteristic in common: they are external influences that affect star formation by preventing gas from reaching galaxies or by removing gas reservoirs. There is evidence from simulation for environmentally induced quenching independent of AGN feedback from purely geometric constraints  and an undefined but clear cosmological origin (Feldmann and Mayer 2015;Peng et al. 2015). The spatial correlation of galaxy properties, up to scales of several megaparsecs, also points to the dominant role of environment on galaxy evolution (Dressler 1980;Weinmann et al. 2006;Kauffmann et al. 2013).
Both observations and simulations point to star formation quenching being the result of both environmental (external) processes and feedback (internal) processes (Hogg et al. 2003;Blanton et al. 2005;Peng et al. 2010;van de Voort et al. 2011) but their relative importance is not clear yet. External processes are usually characterized by local density, a first-order environmental descriptor with limited power to encode the intricate geometry of the cosmic web crucial to understand the geometry and dynamics of gas accretion, galaxy interactions, etc. Internal processes seem to be driven by halo mass (Peng et al. 2010). However, halo mass and density are correlated, making this relation not straightforward to interpret.
1.1. The need for a cosmic web galaxy formation model Current galaxy formation models, in particular semianalytic implementations, can reproduce a wide range of observations and provide useful insight on the physical processes occurring inside galaxies (Rees and Ostriker 1977;White and Rees 1978;Lacey and Silk 1991;Cole 1991;White and Frenk 1991;Cole et al. 2000;Benson et al. 2001). These models intrinsically consider galaxies as isolated entities. Interactions with other galaxies and their cosmic environment are only indirectly treated via their mass accretion and merger history (Hearin and Watson 2013;Mutch et al. 2013;Rodríguez-Puebla et al. 2016), which are insensitive to the particular geometry and dynamics of the cosmic web surrounding galaxies. However, there is extensive evidence of the effect of cosmic environment on halo/galaxy properties (Trujillo et al. 2006;Aragón-Calvo et al. 2007a,b;Hahn et al. 2007;Dekel et al. 2009;Pichon et al. 2011;Laigle et al. 2015;Darvish et al. 2016) but this key information is not included in current galaxy formation models making them blind to environmental effects. Semi-analytic models can not, by construction, provide a physical mechanism for quenching beyond the ones included in its prescription. Any quenching process of large-scale origin will only be reflected indirectly by mass accretion and merger histories, severely limiting their interpretative power.
The empirical age matching model is relevant to CWD (Hearin and Watson 2013;Hearin et al. 2014;Watson et al. 2015). In age matching, the time for star formation quenching is assumed to be the first of i) the time when a galaxy reaches 10 12 h −1 M , ii) the formation time of the halo defined as the time when the slope in the mas accretion history changes or iii) the time when the halo is accreted into a larger halo, becoming a satellite. The age of the halo computed as above is then matched with observed properties of galaxies associated with time evolution such as color. Age matching is an empirical model which, despite being based on ad-hoc rules, can reproduce several observations (Hearin et al. 2014). However, it does not explain the underlying physical process related to the age of a galaxy and so its explanatory and predictive power is limited. As we will see in the following sections the criteria used to define the age of a galaxy can be associated to non-linear interactions between galaxies and their environment, pointing to a common physical mechanism of cosmological origin.

Star-forming gas accretion via primordial filaments
Galaxy formation is a complex process that began when, driven by gravity, nodes of a tenuous web of primordial filaments emerged from tiny density fluctuations (Zel'dovich 1970), (see also Hidding et al. 2014). At the nodes of this cosmic network proto-galaxies began to grow feeding via coherent filamentary streams of cold (T< 10 5 K) gas (Kereš et al. 2005;Dekel et al. 2009;Danovich et al. 2012;Harford and Hamilton 2016). The coherence of the streams at early times makes gas accretion highly efficient. At z ∼ 2 most of the gas in star-forming galaxies is accreted via dense narrow filamentary streams that inject cold gas into the inner regions of galaxies even in the presence of shock heating (Dekel et al. 2009;. In comparison, far less gas is accreted via the inefficient, isotropic, hot (T> 10 5 K) accretion mode.
The nature of the cold streams connected to a protogalaxy is closely linked to its surrounding matter distribution, and in particular to surrounding peaks, as described in the Cosmic Web theory (Bond et al. 1996). The quadrupolar tidal field configuration associated to a pair of peaks results in the formation of a bridge of matter in between. The Cosmic Web theory is usually invoked to explain the large megaparsec-scale filaments observed in the galaxy distribution. However, the same principle can be applied at smaller scales and earlier times to describe the formation of bridges between proto-galaxies. Primordial filaments form in a configuration directly imprinted by the pattern of fluctuations in the initial conditions, part of a highly coherent velocity field. Figure 1 shows a comparison between the density and velocity fields at z = 5 and z = 0. The velocity field was high-pass filtered at 125 kpc in order to highlight dynamics on galactic scales instead of the large-scale flows that dominate the raw velocity field (see Aragon-Calvo and Szalay (2013) for details). There are important differences between the early and later velocity fields. The velocity field at z = 5 is laminar and closely follows the filamentary network surrounding halos. All halos can be seen either at the nodes or ridges of coherent filamentary structures in the velocity field. In contrast, the velocity field at z = 0 is dominated by chaotic flows and shows no correlation with the position of the halos. The different dynamical regimes between primordial and non-linear filaments has not been explicitly noted before in the literature and it is key for a cosmological understanding of gas accretion.
1.3. Primordial vs. large-scale filaments Figure 1 shows two different kinds of structures in the cosmic web separated by their evolutionary stage: • Primordial filaments, formed immediately after halos begin their collapse, with a marked cellular nature and coherent velocity flows. These are the filamentary streams responsible for gas accretion first described by (Dekel et al. 2009). z=5 z=0 Fig. 1.-Coherent vs. chaotic velocity field around halos. Left: a 1 h −1 Mpc thick slice through the density field of a 32 h −1 Mpc box. Center: the velocity field at scales smaller than 125 h −1 kpc highlighted using the particle advection visualization technique (see Aragon-Calvo and Szalay 2013, for a description of the particle advection technique). The streams (lines delineating the velocity field) indicate the direction of the velocity field. The velocity field converges at the bright regions. Right: a zoomed region showing details in the velocity field. The red/white circles correspond to halos inside the slice. Top panels show that the velocity field at early times is highly coherent and closely delineates the location of primordial filaments connected to halos. At later times (bottom panels) the velocity field is highly chaotic and halos are not connected to the observed streams.
• Large filaments as those seen in the present-time galaxy distribution. They are formed hierarchically by the collapse of smaller primordial filaments and are larger, more massive and dynamically complex. Such large-scale structures also form a cellular system but at scales of tens of megaparsecs (Joeveer and Einasto 1978;Klypin and Shandarin 1983;Geller and Huchra 1989;Icke and van de Weygaert 1991;Aragón-Calvo et al. 2010;Aragon-Calvo and Szalay 2013).
Note that present-time voids may still contain primordial filaments due to their super-Hubble expansion which freezes the development of structure at large scales. Such small-scale filaments are prevalent in high-resolution computer simulations of voids (Gottlöber et al. 2003;Sheth and van de Weygaert 2004;Park and Lee 2009;Rieder et al. 2013) and recently have been observed in deep surveys (Kreckel et al. 2012;Beygu et al. 2013;Alpaslan et al. 2014).
1.4. Halos as nodes of the primordial filamentary web Figure 1 highlights the interplay between halos and their surrounding cosmic web as a function of time and halo mass. At z = 5 the non-linear mass M * is of the order of 10 7 h −1 M while at the present time it is close to 10 13 h −1 M (see Fig. 16). The non-linear mass value gives us a rough estimate of the mass-scale at which halos become the dominant component of their surrounding cosmic web (Dekel et al. 2009). Halos with masses larger than M * (z) act as nodes of their local cosmic web as seen in the coherent streams attached to halos at z = 5 in Fig.  1. On the other hand, halos less massive than M * (z) are usually embedded inside larger cosmic web elements as in the case of galaxies embedded in megaparsec-scale filaments. Present-time galactic halos located inside largescale filaments are part of complex large-scale motions that do not conserve the small-scale coherence seen at early times.
The picture described above is complicated by the fact that the elements of the cosmic web represent different stages in the large-scale gravitational collapse. While present-time M * (z = 0) halos are part of larger collapsed structures such as filaments and clusters, the same halos, when found inside voids, act as nodes of their local filamentary network (Kreckel et al. 2012;Beygu et al. 2013;Alpaslan et al. 2014).

The fate of cold flows and star formation quenching
The stark difference in the velocity field around halos at early and later times gives us a clue on the fate of the primordial filaments feeding galaxies. The velocity field around halos in present-time over-dense regions has no memory of the primordial filaments originally connected to them. If gas accretion through coherent cold filamentary flows is the most efficient mechanism to inject star-forming gas into galaxies then we should see a clear change in star formation in halos entering non-linear regions. The change in the accretion mode should be fast (within a few Gyr) given the efficient gas-star conversion of cold gas (Dekel et al. 2009;van de Voort et al. 2011) which forces a gas-starved galaxy to stop producing stars within a short timescale (Bauermeister et al. 2010;Peng et al. 2015). Based in our current knowledge of the relation between galaxies, star formation and gas accretion via cold flows we can enumerate the following: • Proto-galaxies are the nodes of a network of primordial filaments.
• Star-forming cold gas is accreted mainly via primordial coherent filamentary streams.
• Star formation closely follows cold gas accretion and ends (to a first approximation) when the gas supply is cut off.
These observations point to a quenching process that acts by affecting the accretion of gas through primordial filaments. Any mechanism that is able to separate a galaxy from its web of gas-accreting filaments results in star formation quenching regardless of internal processes.

Filament detachment by accretion into a cluster
The results presented in this section are based on a zoom simulation extracted from a 64h −1 Mpc box. The zoom region is centered in a 2.4×10 14 h −1 M cluster and has a mass resolution of 2 × 10 7 h −1 M per dark matter particle. The simulation includes gas with cooling and metal enrichment as well as stochastic star formation (see Appendix B for details on the simulation and Appendix C for other examples). Figure 2 shows a satellite galaxy being accreted into a large cluster with present-time masses of 2 × 10 11 h −1 M and 2.4 × 10 14 h −1 M respectively. This is an extreme example of interaction between a galaxy and its environment resulting in ram-pressure gas stripping (Mori and Burkert 2000;Quilis et al. 2000), clearly showing the effect of non-linear large-scale dynamics acting on a galaxy and its surrounding network of filaments. As the galaxy begins to interact with the cluster we see changes in its surrounding matter configuration, mass accretion and star formation.
The top panels in Fig. 2 show that at early times (z = 5) the satellite galaxy is the central node of a network of thin coherent filaments. The filaments were identified by randomly placing test particles around the proto-galaxy, letting them follow the instantaneous velocity field interpolated using a Delaunay tessellation linear interpolation scheme (Schaap and van de Weygaert 2000) and applying a high-pass filter at the scale of interests (Aragon-Calvo and Szalay 2013). The regions where the particles accumulate were used to construct a filament mask which was then used to tag particles inside filaments. The primordial velocity field is composed of coherent laminar streams of gas and dark matter that delineate the location of filaments in the matter distribution. It is worth noting that the (high-pass filtered) velocity field shows the filamentary structures in the cosmic web more clearly than the density field.
Gas accretion was computed in shells of thickness ∆R shell around the center of the halo r h with velocity v h following the approach of Faucher-Giguère et al.
(2011) as follows: where the sum is over the particles with position r i , mass m i and velocity v i inside the shell. Gas particles were segregated into hot and cold species by their instantaneous temperature at the threshold T = 10 5 K. Figure 3 shows a steady increase in the star formation rate from z = 8 up to its peak at z ∼ 4. The cold gas accretion rate at z = 5 is of the order of ∼ 1 − 3 M /yr. Around this time the galaxy begins to interact with the proto-cluster and this is reflected in both the cold gas accretion rate and the star formation rate which shows a rapid decline. After its first interaction with the protocluster, the galaxy suffers several episodes of gas loss. Around z ∼ 1 the galaxy begins its accretion into the cluster. The higher density and strong tidal field associated to the cluster induces a mechanical stress in the filamentary web around the galaxy, stretching it until the point when it can no longer remain gravitationally attached (top-right panels Fig. 2). After z ∼ 1, even before the galaxy has been completely accreted by the cluster, there is no recognizable filamentary web around the galaxy. The local velocity field is chaotic and the lack of coherent gas streams connected to the galaxy prevents the accretion of cold gas (lower panels in Fig. 2), ending its efficient star formation phase. From this point the galaxy can not longer accrete cold gas, depletes its internal reserves of gas and stops forming stars (see Fig.  3).

Cosmic Web Detachment
The star formation regulation and subsequent quenching presented in Fig. 2 is a purely mechanical/gravitational process, requiring no internal feedback from AGN. The rupture in the cold gas accretion channel is sufficient to stop star formation and, in that sense, can be considered a more fundamental process than internal feedback. Subsequent internal feedback from AGN could further prevents gas from entering the galaxy and/or cooling, removing any residual star formation (Di Matteo et al. 2005;Springel et al. 2005;Best et al. 2005). Figure 2 highlights the key role of primordial filaments in the star forming history of galaxies and the decisive role of the large-scale matter distribution around a galaxy. The time when a galaxy detaches from its primordial filamentary web marks a turning point in its star formation history.
The gas stripping event by ram pressure and tidal interactions shown in Fig. 2 is followed by quenching but it is not the fundamental process responsible for ending star formation in the satellite galaxy. The actual pro- From top to bottom we show: i) the projected density field centered at the galaxy on a 3 h −1 Mpc side box (gray background). Small colored circles correspond to individual particles inside the primordial filamentary web surrounding the galaxy at z = 5 (see text for details). For reference the particles are colored according to their distance from the central galaxy at z = 5. The same set of particles (keeping their original colors) is tracked and displayed at different times, showing the disrupting and detachment of the web of filaments as the galaxy is accreted by the cluster. ii) Coherent structures in the dark matter velocity field after removing bulk flows above scales of 250 h −1 kpc (see Fig. 1 for details). Matter flows from dark-blue regions and accumulates in the light-yellow structures. At early times the velocity field is highly coherent and filamentary, almost laminar streams feed the central galaxy. After the web detachment event at z ∼ 3 the velocity field around the galaxy becomes chaotic and the filamentary streams are lost. iii) Cold gas accretion rate as a function of the distance from the galaxy and divided into "cold" and "hot" modes (see text for details). The vertical dotted line shows the virial radius of the galaxy.
cess that induces quenching is the removal of the feeding filaments (via ram pressure) connected to the galaxy. Without them there is no way to effectively accrete cold gas to form stars and the galaxy has to rely on internal reserves. This process which we call Cosmic Web Detachment (CWD) is fundamentally a starvation process (Peng et al. 2015) triggered by non-linear interactions between galaxies their environment.

Basic Cosmic Web Detachment events
In this section we describe other non-linear processes that can be described as CWD mechanisms in their ability to trigger star formation quenching. In the rest of this paper we use the terms CWD and web detachment interchangeably. Figure 4 shows cartoons of basic processes that induce CWD: i) major merger, ii) satellite accretion and iii) cosmic web infall/crossing. As we discuss in the next section, in these processes, matter streams cross on scales larger than the scales of each halo. In all cases presented in Fig. 4 the initially star-forming galaxy is connected to a web of primordial filaments from which it accretes gas. Subsequent non-linear interactions between the galaxy and a nearby structure (other galaxy, a group or a large filament/wall) detaches the galaxy from its web of feeding filaments. Following the CWD event, the galaxy can no longer accrete cold gas and star formation stops. Note that in the case of a major merger the newly merged halo could remain loosely connected to its primordial filaments. However, these filaments do no penetrate to the galaxy's core (Dekel et al. 2009). A similar situation occurs in the case of satellite accretion. After web detachment the filaments originally attached to the satellite could remain connected to its parent halo but are not able to inject gas into the satellite galaxy. CWD by interaction with filaments and walls may be an important quenching mechanism for dwarf galaxies (Benítez-SFR Cold accretion

INTERACTIONS
The CWD model can be used to predict to first order the star formation history of a galaxy, and in particular its quenching time. Identifying CWD events in individual halos is a complex and computationally expensive task that must be done on a case by case basis. We instead propose to use the dynamical state of the cosmic web to identify the most likely regions where CWD events occur. The underlying assumption here is that CWD events are the result of non-linear interactions between galaxies and the cosmic web and that CWD alone can explain the bulk of star formation quenching.
We start by noting that in the three cases presented in Fig. 4 in order for CWD to occur the trajectories of a galaxy and a nearby structure such as another galaxy, group, filament or wall must cross. As a first approximation we can then associate web detachment events with shell-crossings at some meaningful scale. Consider for instance a major merger event (case A in Fig. 4). The two merging galaxies correspond each to an initial Lagrangian volume that collapsed and became non-linear and the merger is the union of the two Lagrangian clouds. We can choose a sufficiently large smoothing scale in La-grangian space where the patch corresponding to each of the two proto-galaxy clouds will shell-cross at merger. The same principle can be applied to interactions between galaxies and clusters, filaments or walls.
The use of a Lagrangian smoothing to identify shellcrossing events at a scale of interests introduces the need to define such scale: Where R WD is the scale defining web detachment events, M WD is its equivalent mass and ρ m is the mean density of the Universe. By smoothing the initial power spectrum at this scale we produce a universe lacking structures less massive than M WD (Aragon-Calvo et al. 2010; Aragon-Calvo and Szalay 2013), (see also ). We then have: where the transfer function T (k) is a filter corresponding to a spherical top-hat of radius R WD . In principle we do not know the scale R WD , instead of trying to derive a characteristic scale (or range of scales) we use R WD corresponding to the upper halo mass threshold where star formation quenching occurs M WD ∼ 10 12 h −1 M (Cattaneo et al. 2006;Birnboim et al. 2007) as a natural scale for star formation quenching. By doing so we assume that the origin of this mass threshold is not internal processes driving quenching (which could still play an important role) but the dynamical state of the cosmic web around halos of that mass. This gives R WD 2 h −1 Mpc.
2.1. Identification of multi-streaming regions Following the previous discussion we identify CWD regions in N-body simulations as places where there has been at least one shell-crossing in the Lagrangian smoothed field and assume that halos entering those regions undergo instantaneous CWD. In this approach we assume that star-forming gas is accreted only via primordial filaments and therefore ignore any subsequent gas accretion coming from the halo's new environment. Figure 5 shows a representation of a galaxy being tracked from its star forming phase to the point of web detachment and its subsequent quenched state. In practice we use the most massive progenitor line to track halos across time (see Appendix A). In order to identify multistreaming regions from the particle distribution we use a Lagrangian Sheet approach where the original particle distribution is used to define simplex volume elements (Shandarin et al. 2012;Abel et al. 2012). We modify the original implementation by following Lagrangian volume elements defined by the particle's initial positions and assigning them a constant unitary density. As the simulation evolves adjacent Lagrangian volume elements in high density regions cross each other overlapping, producing multi-streams where more than one Lagrangian volume element occupies the same space in Eulerian coordinates (Shandarin 2011;Shandarin et al. 2012;Abel et al. 2012). The complexity of the multi-streaming regions directly reflect their evolutionary stage as seen also in the origami cosmic web classification scheme (Falck -Assigning a detachment time to a galaxy. The red contour encloses regions that have been identified as multi-streaming using our Lagrangian Sheet prescription (see text for details), in this case a cluster and three large filaments connected to it. A galaxy is first detected inside a void (A) at which point it is assumed to be forming stars until it enters a multi-streaming region (B) and from this point it becomes quenched (C). Note that we consider that SF ends after a galaxy enters a multi streaming region regardless of any possible gas accretion from the new environment.  Figure 6 shows the emergence of multi-streaming regions associated with CWD events at three different times. At z = 3.9 the first multi-streaming regions begin to form around the location of large and dense peaks. At z = 2.3 several multi-streaming regions have collapsed and megaparsec-scale filamentary features begin to appear. At the nodes of the multi-streaming regions we find the precursors of the large clusters seen at the present time (see Fig. 17 for a more detailed time evolution). Note the apparent lack of evolution of the CWD regions after z ∼ 1 in Fig. 17, reflecting the role of the cosmological constant Λ in the development of the cosmic web at large scales. This is also seen in Fig. 13 which shows that the rate of growth of multi-streaming regions begins to slow down around z ∼ 2. We can see multi-streaming regions even inside voids although they arise at later times compared to denser environments.
By associating multi-streaming regions with CWD processes we define a link between large-scale dynamics and halo gas accretion. Compared to other approaches that describe galaxies as isolated objects having environmental processes entering only indirectly (e.g. via merger trees) our method considers cosmic environment as an integral component in galaxy evolution. This link between galaxies and their environment is the key to the ability of our multi-streaming prescription to successfully reproduce a range of environmental effects. In the rest of the paper the use the terms multi-streaming and CWD regions interchangeably.

Quenching fraction inside multi-streaming regions
In Fig. 7, we show the ratio of specific star formation rate (sSFR) for galaxies inside and outside multi-stream regions. The sSFR was computed from the 32Mpc box hydrodynamic simulation described in Appendix B. At sSFR ∼ 10 −11 yr −1 , there are five times more quenched galaxies inside CWD than outside. Classical quenching mechanisms involving violent interactions (e.g. rampressure stripping, harassment, satellite accretion) occur in multi-stream regions more than in more quiescent single-stream regions. The effect of non-linear interaction on sSFR is clear from Fig. 7 and provides evidence (although circumstantial) of the validity of our approach.

MULTI-STREAMING REGIONS AND HALO HISTORY
In this section we study the history of halos in order to gain insight on the type of processes occurring when a halo enters a multi-streaming region and how this could affect their star formation. The relation between halo mass accretion history and star formation is, while not completely understood yet, well established (Dekel et al. 2009;Mutch et al. 2013;Watson et al. 2015;Behroozi and Silk 2015;Rodríguez-Puebla et al. 2016). The analysis we present here shows a direct link between matter accretion and the dynamical state of the local cosmic web and by doing so provides an indirect link to star formation. Figure 8 shows a comparison between web detachment redshift z WD (i.e. the redshift when the halo became web-detached) and halo formation redshift z form for halos with masses M > 10 10 h −1 M . We used the common definition of formation time as the time when the mass accretion history (MAH) of a halo changes its slope (Wechsler et al. 2002). This was computed for each halo's mass accretion by fitting a two-component model:

Formation time and Web Detachment
Where M 0 and z 0 are the mass accretion rate and red-shift at formation time respectively, and m 1,2 indicate the difference in the mass accretion rates. Halo mass loss, typical of sub-halos, is corrected by not allowing the halo's MAH to decrease. In this approach a halo being mass-stripped will retain its mass before stripping and the formation time of the sub-halo will usually be the time of mass stripping. Figure 8 shows a clear correlation between z WD and z form with a small dispersion in redshift in the interval 0 < z < 2 after which point the dispersion increases. halos with recent web detachment times also have a recent formation time. halos with an early web detachment show a less marked correlation with formation time. This may be the result of having entered multi-streaming environments at early times which could result in complex mass accretion histories that are not easily characterized by a single property such as formation time.
An important aspect of this diagram is that formation time occurs, in general, after the time of web detachment (z WD > z form ), in agreement with the picture of halos first entering web-detachment regions that later affect their mass/gas accretion rates. This can be explained as galaxies can become web-detached by, for instance, entering a large filament and can in principle continue accreting mass (dark matter and baryons). If the galaxy subsequently enters a large group this will be reflected in its MAH and will result in a later formation time. halos inside CWD regions were restricted to those have entered multi-streaming regions more than 3 Gyr ago. Bottom: ratio between the two distributions. The vertical line indicates the sSFR threshold used in the literature to divide quenched from main sequence galaxies.

Major merger events
Major merger events have a significant effect in the mass accretion history of halos. Being highly non-linear large-scale events they provide an efficient CWD mechanism and we should expect a close relation between major mergers and web detachment times. Figure 9 shows a comparison between the time of web detachment z WD and the time of the first major merger z merger . Major mergers were defined as those with a mass ratio of M 1 /M 2 = 1.5. Figure 9 shows a clear correlation between web detachment events and major mergers. The correlation is even tighter than in the case of formation time (Sec. 3.1) and extends to the range 0 < z < 2. halos tend to enter web detachment regions earlier than the time of their largest major merger event. This trend is more pronounced at high redshift (z < 2). While the dispersion between z WD and z merger increases, the condition z WD < z merger remains valid at all times. An approximate linear fit gives z merger 0.8 z WD . At z ∼ 0 there is a small population of halos that show no correlation between z WD and z merger . The origin of this small population could be purely numerical and will be investigated in future work.

EVENTS
We now explore the spatial distribution of halos segregated by CWD times. Figure 10 shows halos that have been web-detached at early times (more than 8 Gyr ago), halos that have undergone late web detachment (less than 0.1 Gyr ago) and one intermediate case. The CWD model gives a physical underpinning to the traditional Hubble morphological division of galaxies into "early" and "late" types. Early web-detached halos have quenched their star formation long time ago, while late web-detached halos are either still star forming or in the process of quenching. There is a clear trend between web detachment time and halo radius/mass. halos with early t WD tend to be more massive and more highly clustered indicating that galaxies that entered CWD regions early mark the position of dense peaks in the initial density field. The relation between halo mass and its location inside large dense peaks naturally results in a correlation between web detachment times and spatial location. There seems to be a combination of halos with intermediate and late web detachment times at the interior of the central void in Fig. 10, hinting a relation to the void phenomenon (Peebles 2001). Fig. 9.-Comparison between web detachment redshift z WD and the redshift of the major merger event zmerger (as a twodimensional histogram) . The sample is constrained to halos that had at least one major merger event with a mass ratio between the two merging halos of rmerger > 1.5. The thick black line indicating the general trend is shown as reference.

Anti-hierarchical star formation and CWD
According to the hierarchical scenario of galaxy formation small galaxies form first (and therefore their population should be composed of old stars) while massive galaxies form later (and as such they should be forming stars at the present time). What we observe is the opposite: massive galaxies are no longer producing stars while low-mass galaxies are actively forming new stars. This apparent anti-hierarchical behavior of the star formation history of galaxies is commonly referred to as "downsizing" (Cowie et al. 1996;Heavens et al. 2004;Thomas et al. 2005). Figure 11 shows the distribution of web detachment times for several halo mass ranges (computed at the present time). There is a clear dependence between web detachment time and halo mass. The most relevant aspect of this figure is the shift in the peak from high to low redshift with decreasing halo mass. This indicates that massive halos (10 11.5−12.5 h −1 M ) already became web-detached at early times (z ∼ 2) while low-mass halos (10 9.5−10.5 h −1 M ) are still attached to their filament network or are just becoming web-detached. The peak in the web detachment time for the lowest mass bin in Fig. 11 has not been reached at the present time.
The anti-hierarchical trend in Fig. 11 of high-mass halos being quenched while low-mass halos being star forming is tantalizingly similar to the so-called downsizing (Cowie et al. 1996;Heavens et al. 2004;Thomas et al. 2005). In the context of the CWD model, the key to downsizing is the realization that low-mass star-forming galaxies are found mostly in isolated environments and therefore their surrounding cosmic web has remained unperturbed for most of the history of the Universe. Lowmass isolated galaxies can therefore experience a slow but steady gas accretion (see Fig. 11 in Aragon-Calvo and Szalay (2013)). On the other hand, massive galaxies form in dense environments where there is a higher rate of web detachment events due to the non-linear dynamics characteristic of such environments. The net effect is the observed anti-hierarchical star formation history.

TESTING CWD WITH OBSERVATIONS
In this section we reproduce and, to some extent, interpret several observations in the context of the CWD model. We use a minimum of assumptions for galaxy properties (star formation, color and quenching state) in order to emphasize the effect of CWD and we clearly indicate when we do so.

The cosmic star formation rate history
In order to assign star formation rates (SFR) to dark matter halos we start by assuming a simple relation between halo mass before CWD and star formation rate. Based on the fit provided by Dekel et al. (2009) we assume an semi-linear dependence between halo mass and gas accretion/star-formation rate as: Where the constant A summarizes complex physical processes (which in principle can also depend on halo mass and redshift). At the present time A corresponds to the SFR a halo with a mass of 10 12 h −1 M would experience if it remained connected to its network of primordial filaments, and the value of the exponent α = 1.15 is derived from halo growth rates (Neistein et al. 2006;Birnboim et al. 2007). We assume a SFR given by equation 5 before CWD and an instantaneous star formation quenching after the CWD event. This behavior is analogous to a constant star formation rate and a subsequent decline (Blanton 2006;Reddy et al. 2012). Figure 12 shows the cosmic star formation rate history (SFRH) computed by integrating the star formation from all halos which have not yet suffered CWD at a given redshift and assigning star formation rates as a function of halo mass following equation 5. The CWD model can reproduce the general shape of the SFRH curve, in particular its peak at z ∼ 3 and decline to its present value more than two orders of magnitude lower (Heavens et al. 2004). It is interesting to note that the origin in the peak of the SFRH coincides to the peak of CWD events density of massive halos in the mass range 10 11.5−12.5 h −1 M with a peak around z ∼ 2−3 (Fig. 11) indicating the time when the rate of web detachment events was maximum and the (until that point) increasing star formation rate began to slow down (Fig. 13).
The peak in the SFR at z ∼ 2 corresponds to just 3.2 Gyr after the Big Bang. At this point the megaparsecscale structures in the cosmic web are still in full development and will not reach its present-time large-scale features until z ∼ 1. Figure 13 shows the rate of change of the fraction of volume inside multi-streaming regions as a function of time. The close relation between the rate at which regions in the Universe become non-linear, web-detachment times and the peak in the cosmic star formation rate suggests a causal link between these processes. Note that the peak in both the density of web detachment events (Fig. 11) and the rate of change of volume inside multi-streaming regions (Fig. 13) is determined only from large-scale dynamics and therefore the resulting peak in the SFH of galaxies can be explained, in the CWD model, by environmental effects. Figure 14 shows the distribution of galaxy colors with halo mass. In order to assign colors to halos we assumed a monotonic relation between a halo's detachment time t WD and the color of its hosted galaxy: halos with an early CWD time host galaxies with an older/redder stellar population compared to galaxies hosted in halos with a later CWD time.

The bimodality in the color distribution of galaxies
Galaxy colors were obtained from a template of galaxies selected from the Sloan Digital Sky Survey (see Appendix B.2). These galaxies were matched to halos in our simulation using a similar matching procedure as done by Hearin and Watson (2013) but using t WD instead of their empirical age. Both halos and galaxies were sorted by t WD and u − r color respectively and matched one to one. Massive halos get webdetached at early times while dwarf galaxies web-detach very recently. The distribution of t W D for dwarf galaxies shows that they are the population that is currently undergoing CWD but has not yet reached its peak.  Figure 14 shows the familiar bimodality in the color distribution. The color bimodality is an intrinsic property of the SDSS galaxies and not a result of t WD . The ability of our CWD implementation to reproduce the mass-color diagram, i.e. the correct location of the blue and red peaks and the extended flattened shape of the red peak into the high mass region, comes from the mapping between a halo mass and its t WD (see Fig. 11).
The region between the blue and red clouds corresponds to galaxies in the green valley. In the CWD framework galaxies in the green valley suffered web de-  The grey background corresponds to the two-dimensional masscolor distribution. We show three contours to highlight the shape of the two regions. The distribution was smoothed for clarity. tachment around t W D ∼ 8.5Gyr. However, web detachment is just one of several possible paths as green valley galaxies are most likely a composite population of galaxies in the process of quenching and already quenched galaxies that are undergoing a new star forming phase. Figure 15 shows the fraction of red galaxies (here defined as galaxies with t W D > 10 Gyr) as a function of halo mass and local density. This plot is based on Fig.  6 in Peng et al. (2010) where they analyzed a sample of galaxies from the SDSS. The local density was computed using a top-hat window of radius r = 1h −1 Mpc centered on each halo and counting the dark matter particles inside the window. It is remarkable that our simple implementation of CWD reproduces to a great degree the relation between fraction of red galaxies, their mass and density. For a given halo mass the fraction of red galaxies in low-density environments is lower than for dense environments and for a given density the fraction increases with halo mass. This is interpreted by Peng et al. (2010) as suggesting two separate mechanisms of "environmental quenching" and "mass quenching". However, this relation must be taken with caution since halo mass and density are correlated so the interpretation of two different processes is not straightforward. In the CWD framework the increase in density is associated to an increase in the environment's complexity leading to CWD events and quenching. On the other hand, we expect massive halos to populate dense environments so the increase in the red fraction with mass could also be interpreted as a consequence of the increase in density.

Star formation as function of mass and density
The CWD framework also provides a simple explanation for the lack of quenched dwarf population in voids (Geha et al. 2012). Figure 15 shows that the fraction of web-detached halos, compared to the general population, is the lowest for dwarf halos in low density environments. Dwarf galaxies in the low-dense field (i.e. voids and walls) remain connected to their network of filaments. This is seen in our multi-streaming formalism as halos that have not entered yet into non-linear multistreaming regions. We should therefore expect to find star-forming dwarf galaxies at the present time in voids and walls. 6. DISCUSSION 6.1. Searching for primordial filaments in voids and walls One aspect of CWD worth exploring is its relation with the different elements of the cosmic web. In particular galaxies in voids and walls, given their dynamically young environment, could still be connected to their web of primordial filaments and thus be star forming (Ceccarelli et al. 2008;Liu et al. 2015;Moorman et al. 2016). The super-Hubble expansion in such environments (Aragon-Calvo et al. 2011) can act as a regulator for gas accretion resulting in a slow and steady star formation (Ricciardelli et al. 2014;Das et al. 2015). Present-time voids, and to a lesser extent walls, are ideal environments to search for primordial filaments. Recent deep observations have already found examples of thin filaments connected to void galaxies (Kreckel et al. 2012;Beygu et al. 2013;Alpaslan et al. 2014).

Gas accretion in the Milky Way
The Milky Way has evidence of gas supply from cosmological origin which, given the local planar LSS geometry (Tully and Fisher 1987), we can assume to be restricted to the plane of the Local Sheet. The Milky Way galaxy is currently forming ∼ 1 h −1 M per year. At this rate the gas reserves in the Milky Way would deplete within a timescale shorter than Hubble time Salim et al. 2007) but what we observe is a relatively constant star formation rate and Deuterium abundance in the solar neighborhood in the last several Gyr (Binney et al. 2000). The low SFR of the MW, given its mass, could be due to super-Hubble regulation or perhaps interactions with the Local Sheet which may have affected its feeding filaments. Another example of a galaxy with possible cosmological gas accretion is NGC 6946, the "Fireworks galaxy" featuring a high supernovae rate (9 per century) and a possible detection of filamentary structures (Pisano 2014). Based on the CWD model we can predict that most galaxies with a long and steady star formation history which are forming stars at the present time should be found in voids and walls. 6.3. A possible origin for red spirals Not all CWD events are the result of violent gravitational interactions. When a galaxy is accreted by a large filament or cluster but without experiencing major mergers this can result in CWD without morphological change. Good candidates for this scenario are the red spirals seen in dense environments (Masters et al. 2010) and SO (Larson et al. 1980). This is also consistent with findings that satellites are affected more in color than morphology (van den Bosch et al. 2008).
6.4. SFR fitting and CWD Star formation histories of high redshift galaxies support the picture of gas accretion→star formation (web attached), starburst (web detaching) and instantaneous or slow decline (web detached) (Reddy et al. 2012;Blanton 2006). Schawinski et al. (2014) found evidence that galaxies spiral galaxies move through the green valley when their external gas supply ends but continue to burn their remaining gas into stars. Ellipticals on the other hand require an scenario where both the accreting gas and their reservoirs are consumed in a very short time scale.

A possible causal link between CWD and AGN?
The peak in the AGN redshift distribution around z ∼ 2 (Shaver et al. 1996;Page et al. 2001;Hasinger et al. 2005) is tantalizingly similar to the peak in the density of web detachment for halos in the mass range ∼ 10 11.5−12.5 h −1 M (Fig. 11), the peak in the rate of change in the fraction of regions becoming non-linear (Fig. 13) and the peak in the star formation rate (Fig.  12). If we assume a link between AGN and CWD events then the anti-hierarchical behavior seen in the time distribution of CWD events with mass ( Fig. 11) could explain the difference in the peak in AGN with luminosities cited as AGN downsizing (Hasinger et al. 2005;Babić et al. 2007;Enoki et al. 2014). While this coincidence alone is not enough to establish a causal link it suggest a relation between these processes.
The link between CWD and AGN activity could be the result of interactions between galaxies and the cosmic web that are capable of perturbing gas trajectories, injecting gas into black holes (in a similar way as in the case of major mergers). However, N-body simulations lacking AGN feedback (like the ones used here) still show a sharp decline in the SF. The observational evidence for AGN quenching remains controversial; for example, recent deep x-ray surveys find little evidence for AGNdriven quenching (Suh et al. 2017). While we can not rule out the contribution of AGN in quenching, we show that it is not necessary to explain the bulk of quenching. This should be studied in more detail in the future.

CONCLUSIONS
The CWD model presented here provides a fundamental mechanism to stop star formation in galaxies by separating a galaxy from its main star-forming gas supply. CWD is to first order a purely mechanical/gravitational starvation process. The nature of the particular CWD event determines the fate of the remaining gas inside the galaxy: major mergers will result in most of the gas being consumed in a starburst, often followed by a change in the galaxy's morphology, while less violent CWD events can allow gas reservoirs to be slowly consumed (Bauermeister et al. 2010).
Gas strangulation and quenching are two distinct ways of reducing the SFR. Quenching is in principle instantaneous, although in practice it is inefficient. Strangulation cuts the gas supply and allows star formation to continue at a decreasing rate. Evidence has been found for bimodality in the metallicity stellar mass relation between passive and star-forming galaxies that points to both processes in action.
CWD is an starvation process. We have shown that it fits the data on SFR histories, the mass color bimodal-ity and environmental dependence of red galaxy fraction. We therefore propose that it is an effective and natural implementation of strangulation. Indeed, AGNs are not needed to drive outflows in our approach, even for massive galaxies. Web detachment naturally regulates the gas supply at all masses. Of course AGNs may well be a consequence both of mass and of gas accretion as well as of mergers, and almost certainly play a role in quenching massive galaxies, above ∼ 10 11 h −1 M .
It is important to note that while we do not provide a smoking gun observation for CWD several pieces of evidence point in the same direction, namely that external processes that can induce gas starvation in galaxies are encompassed by one single physical mechanism which we propose to be CWD. More detailed N-body simulations and more sophisticated data analysis techniques are required and will be the subject future studies.

ACKNOWLEDGEMENTS
MA would like to thank the many colleagues with whom he discussed, over the course of several years, aspects of the work presented here, in particular Bernard Jones, Alex Szalay and Jaan Einasto. The authors would like to thank the referee for useful comments on the manuscript. MA is grateful for support from the Gordon and Betty Moore foundation while at JHU, where this work originated, a Big Data seed grant from the office for Research and Economic Development, UC Riverside and funding from "Programa de Apoyo a Proyectos de Investigación e Innovación Tecnológica" grant DGAPA-PAPIIT IA104818. This work has been carried out in part at IAP under the ILP LABEX (ANR-10-LABX-63) supported by French state funds managed by the ANR within the Investissements d'Avenir programme under reference ANR-11-IDEX-0004-02.

SIMULATIONS AND GALAXY CATALOGS
The results presented here are based on two cosmological boxes of 64 h −1 Mpc and 32 h −1 Mpc side. Each box was run at several resolutions and including dark matter only, dark matter plus gas and with and without feedback. We assumed a ΛCDM cosmology with values of Ω m = 0.3, Ω Λ = 0.7, h = 0.73 and σ 8 = 0.8, in good agreement with the latest values obtained from the Planck mission (Planck Collaboration et al. 2015). The results presented here are insensitive to small variations in the cosmological parameters. The 64 h −1 Mpc and 32 h −1 Mpc boxes were run at a mass resolution of 1.62 × 10 8 h −1 M per particle corresponding to 512 3 and 256 3 particles respectively. Several zoom resimulations were run at higher resolution for selected individual halos at 2.02 × 10 7 and 2.53 × 10 6 h −1 M per dark matter particle.
The 64 h −1 Mpc box was run using the sph Gadget-2 code with gas and no cooling. The 32 h −1 Mpc simulation box is the same box described in (Aragon-Calvo 2012) and (Aragon-Calvo and Yang 2014). Gadget-2 computes longrange gravitational forces using a particle-mesh algorithm (Hockney and Eastwood 1988) and a tree algorithm for small separations (Barnes and Hut 1986). Gas dynamics are computed using a smoothed hydrodynamics approach (Lucy 1977;Springel and Hernquist 2002). The Gadget-3 sph code used to run the simulations with star formation implements recipes for hydrodynamics and metal enrichment including stochastic star formation, SN feedback and winds (Springel and Hernquist 2003). The critical density for star formation is set to n h = 0.1 cm −3 . While more detailed star formation recipes including feedback are possible, in the present work they are not critical, as the CWD mechanisms described here are mechanical/gravitational in nature and take place outside the star-forming regions of the galaxy.

Halo catalogues
From the two simulations we computed halo/sub-halo catalogs using Friends-of-Friends (FoF) and SubFind (Davis et al. 1985;Springel et al. 2005). For both halos and sub-halos we generated merger trees by identifying common particles between halos/sub-halos in adjacent snapshots. This produced large and complex trees that were then pruned to identify their "most massive progenitor" lines. The mass at each point of the most massive progenitor line forms the mass accretion history (MAH) of the halo/sub-halo. The MAH of FoF halos is in most cases an increasing function of time. Sub-halos, on the other hand, tend to have more erratic MAH as a result of non-linear interactions and the particle unbinding procedure (Onions et al. 2012). One particular problem of sub-halo MAH is the decrease in mass after accretion into a larger halo as a result of mass stripping. Following a similar approach as Conroy et al. (2006) and Vale and Ostriker (2006) we allow the mass of a sub-halo to either remain constant or increase with time. In the case of satellite halos with severe mass stripping this means that the satellite is implicitly assumed to retain its mass right before accretion. For consistency we applied the same procedure to the FoF halos although they have a near monotonic increase in mass.

Galaxy catalogue (SDSS)
For the study of the galaxy mass-color distribution (Sec. 5.2) we used a sample of galaxies selected from the Sloan Digital Sky Survey data release 9 (York et al. 2000;Abazajian et al. 2009). We selected galaxies from the spectroscopic sample in the redshift range z < 0.1 and no constraints on magnitude. Given the target selection criteria this corresponds to galaxies with a Petrosian magnitude in the red filter of m r < 17.77. The total sample contains almost half a million galaxies which is enough to perform the matching with halos in our 64 h −1 Mpc simulation at z = 0. The SDSS galaxy sample used in this work was queried from the CASJOBS service 1 . We selected galaxies with spectroscopic measurements in the redshift range z = 0 − 0.1 using the following (abridged) query:

CWD EXAMPLES
In this section we present several examples of halos/subhalos undergoing CWD events and others that remain attached to their network for primordial filaments. The descriptions are based on observations on several projections as well as mass accretion rates and CWD times (not shown here for clarity). Note that the different times and scales are not the same for all figures.
This paper was built using the Open Journal of Astrophysics L A T E X template. The OJA is a journal which provides fast and easy peer review for new papers in the astro-ph section of the arXiv, making the reviewing process simpler for authors and referees alike. Learn more at http://beta.theoj.org.   Top panels correspond to ZY projections of the dark matter velocity field (see main paper for details). Subhalo entering a small group. Steady accretion of gas at early times before CWD event and afterwards a large gravitational interaction with a group resulting in mass loss.   Top panels correspond to ZY projections of the dark matter velocity field (see main paper for details). This subhalo presents steady cold gas accretion from early times. Its matter and velocity field configuration indicates that it is still attached to its filaments and this can be seen by the steady cold gas accretion/star formation at the present time.   Top panels correspond to ZY projections of the dark matter velocity field of the dark matter velocity field (see main paper for details). This halo shows cold gas accretion right until its CWD event triggered by accretion into a larger filament, after which point the accretion of cold gas stops.   Halo located in a low-density region corresponding to a present-time cosmological void. The halo never enters a non-linear region and therefore, according to our multi-streaming prescription, it is still attached to its primordial filaments. Note that the accretion the cold gas, although very small, remains relatively constant until the present time. Non-detached, Web stretching.