Epidemics on networks with preventive rewiring

A stochastic SIR (susceptible → infective → recovered) model is considered for the spread of an epidemic on a network, described initially by an Erdős–Rényi random graph, in which susceptible individuals connected to infectious neighbors may drop or rewire such connections. A novel construction of the model is used to derive a deterministic model for epidemics started with a positive fraction initially infected and prove convergence of the scaled stochastic model to that deterministic model as the population size n→∞ . For epidemics initiated by a single infective that take off, we prove that for part of the parameter space, in the limit as n→∞ , the final fraction infected τ(λ) is discontinuous in the infection rate λ at its threshold λc , thus not converging to 0 as λ↓λc . The discontinuity is particularly striking when rewiring is necessarily to susceptible individuals in that τ(λ) jumps from 0 to 1 as λ passes through λc .


Introduction
Traditional mathematical models for the spread of an infectious disease assume that individuals behave the same way all through the epidemic outbreak, and that no interventions are put in place during the outbreak. More recently models have been studied that include various public health preventive measures put in place during the outbreak, thus reducing spreading (e.g. [Ferguson et al.(2006)]). Usually such measures are easy to incorporate into a model, however the resulting model is often not susceptible to mathematical analysis and the effects of measures are qualitatively understood and quantitatively obtained through large simulations studies (e.g. [Chinazzi et al.(2020)

]).
A different type of preventive measure is those performed by separate individuals. For example, it is well known for diseases like HIV, Ebola and Covid-19 that individuals at risk also, individually, increase their preventive behaviour once they become aware of an ongoing epidemic outbreak. Recently, mathematical models containing such individual preventive measures have been defined and studied numerically (e.g. [Funk et al.(2010)]). These individually-based preventive measures, triggered by an ongoing epidemic, are however harder to analyse and few analytical results are available for epidemic models incorporating such adaptive dynamics.
In the current paper we continue the study of one such SIR (susceptible → infective → recovered) epidemic model, where transmission occurs along links of an underlying social network, and in which uninfected individuals that are connected to infectious individuals may choose to drop or rewire connections to infectious neighbors in order to avoid getting infected. [Leung et al.(2018)] study such a model and prove that for some (but not all!) networks and parameter set-ups, the model with preventive rewiring may actually give a larger epidemic outbreak than the corresponding network and parameter set-up but without rewiring. The surprising conclusion is hence that such preventive rewiring at the individual level reduces the risk for an individual to get infected, but if collectively performed it may increase the final epidemic size.
Durrett and co-workers ( [Jiang et al.(2019)]) study the same model for the special case where the underlying social network is an Erdős-Rényi network (i.e. one in which between any two distinct individuals an edge is present independently with a fixed probability) and conjecture, by means of a convincing simulation study, that the final epidemic size may be discontinuous at criticality. By this we mean that, fixing the Erdős-Rényi network model and all other model parameters apart from the transmission rate λ, the limiting final epidemic outbreak size τ (λ) (more specifically, the fraction of the population infected by an epidemic initiated by one infective, given the occurrence of a major outbreak, i.e. one that takes off and becomes established) satisfies

1)
λ c being the value for which the basic reproduction number R 0 = 1, and a being a strictly positive constant. In [Jiang et al.(2019)] the authors provide details of various approximations to the epidemic model with rewiring (none of which displayed the discontinuity) in the hope that someone can find an accurate approximation that explains the reason for discontinuous phase transition at λ = λ c . The main achievement of the present paper is to provide such a deterministic approximation, together with an associated law of large numbers for the temporal trajectory of the stochastic epidemic as the population size n → ∞. We give almost identical necessary and sufficient conditions for the final size of this deterministic model to display the discontinuity (1). For the stochastic model, we prove conditions under which the final size of a major outbreak satisfies (1) in the limit as n → ∞ and conditions under which it does not satisfy (1). Our deterministic approximation is derived from a novel construction of the stochastic epidemic with rewiring, in which the Erdős-Rényi network and epidemic are constructed simultaneously. A key observation underlying this construction is that owing to symmetries in the Erdős-Rényi network and the rewiring process it is sufficient to keep track of just the number (and not the end points) of susceptible-susceptible rewired edges. The construction yields an infinite-dimensional continuous-time Markov chain. However the epidemic dynamics are encapsulated by the four-dimensional process which records the evolution of the numbers of susceptibles, infectives, infective-susceptible edges and susceptible-susceptible rewired edges with time. We prove weak law of large numbers convergence of this fourdimensional process to the above-mentioned deterministic approximation using a theorem in [Darling and Norris(2008)].
The construction yields a process whose law is very close to but not exactly the same as that of the original model. However, the difference is very small and we prove that convergence in probability results transfer from the constructed to the original process. The approximating deterministic model is equivalent to the pair-approximation model of the epidemic, so the above law of large numbers provides a rigorous justification of the pairapproximation model.
A common approach to analysing the final size of an SIR epidemic is via a suitable random time-scale transformation which leaves the final size unchanged. For the present model this yields a deterministic limiting process that is not Lipschitz in the vicinity of disease-free states, which means that results concerning convergence of terminal values, in for example [Darling and Norris(2008)], cannot be applied. This explains why only partial results, derived by considering appropriate bounding processes, are proved concerning discontinuity of the final size of the stochastic model. For the special case of the SI model, in which there is no recovery from infection so infectious individuals remain so forever, this difficulty disappears. Moreover, for the SI model, the deterministic limiting process can be analysed to yield an explicit non-linear equation for the final size τ , which enables us to prove a necessary and sufficient condition for there to be a discontinuity at the threshold λ = λ c .
In the above models, when a susceptible individual rewires an edge from an infective neighbour it is to an individual chosen uniformly at random from all the other n − 2 individuals in the population. We analyse also an alternative model in which such rewiring is to an individual chosen uniformly at random from all other susceptible individuals. This model also does not suffer from the Lipschitz problem and a full rigorous analysis of the stochastic model is available. In particular, a necessary and sufficient condition for the (in probability) limiting final size of a major outbreak τ (λ) to have a discontinuity at λ c ) is proved. Moreover, when it exists, the discontinuity at λ c is more striking in that where ω and γ are the rewiring and recovery rates, respectively. (A necessary but not sufficient condition for τ (λ) to be discontinuous at λ c is ω > γ.) Thus the fraction of the population infected by a major outbreak jumps from 0 to 1 when λ passes through the threshold λ c . When λ is very large susceptibles become infected before they can rewire away from neighbouring infectives and in the limit n → ∞ an epidemic that takes off infects all members of the giant component of the underlying Erdős-Rényi network.
While we were completing our research, Durrett and another co-worker ([Yao and Durrett(2020)]) published a second paper concerned with epidemics with rewiring on random graphs generated by the configuration model, in which conditions (that are almost complementary) for the final size of the SIR epidemic to have and not have a discontinuity at λ c are proved. They also prove similar results for the SI model. When the degree distribution in the configuration model graph is chosen to be Poisson, the conditions in [Yao and Durrett(2020)] for τ (λ) to have a discontinuity at λ c coincide with those we give for epidemics on an Erdős-Rényi network but (at least for the SI model) the function τ (λ) in [Yao and Durrett(2020)] is different from ours. In our work an explicit equation satisfied by τ (λ) is not available for the SIR model. As we discuss later, the results in [Yao and Durrett(2020)] are obtained by analysing a construction of the network and epidemic which we believe is not probabilistically equivalent to the original model, and which yields an incorrect deterministic limit as n → ∞ (even if numerically quite close).
The remainder of the paper is organised as follows. The main SIR model with rewiring is described in Section 2.1. It is slightly more general than that indicated above in that susceptible individuals may also drop edges to infective neighbours. The main results of the paper are given in Section 2.2. The SIR model is treated in Section 2.2.1, where theorems concerning branching process approximation of the early stages of an epidemic with one initial infective (Theorem 2.1) and a weak law of large numbers for the temporal behaviour of an epidemic in which a strictly positive fraction of the population are initially infective (Theorem 2.2) are stated. A weak law of large numbers for the final size of a major outbreak is conjectured (Conjecture 2.1). Theorems giving conditions for the final size of the approximating deterministic model and stochastic model to have a discontinuity at the threshold λ c are stated (Theorems 2.3 and 2.4, respectively).
The SI model is treated in Section 2.2.2. A weak law of large numbers for the final size of a major outbreak is given in Theorem 2.5 and a necessary and sufficient condition for the final size τ (λ) to have a discontinuity at λ c is presented in Theorem 2.6. Note that a major outbreak is not guaranteed even though infected individuals remain so forever, as the initial infective may not belong to the giant component of the original network, and even if it does, susceptibles can rewire their connections away from infected neighbours. A detailed analysis of the final size of a major outbreak is given in Corollary 2.1. The SIR model in which rewiring is necessarily to susceptibles is treated in Section 2.2.3. Weak laws of large numbers for the temporal behaviour of an epidemic with a positive fraction initially infected and for the final size of a major outbreak for an epidemic with one initial infective are given in Theorems 2.7 and 2.8, respectively. The latter includes the behaviour described by (1.2). Two other rewiring models are treated briefly in Section 2.2.4. Throughout Section 2.2 results are illustrated by simulations and numerical studies.
The construction of the epidemic model which underpins its analysis is described in Section 2.3. The approximating deterministic model is shown to be equivalent to a pairapproximation model of the epidemic in Section 3. A comparison of our results with those in [Yao and Durrett(2020)] is given in Section 4, where a numerical study shows that the corresponding asymptotic final sizes differ and a simulation study gives very strong support to the correctness of our asymptotic final size. A heuristic derivation of the final size of the SI model is given in Section 5. The proofs are given in Section 6 and some very brief concluding comments are given in Section 7.

SIR model
We first introduce some notation, the precise meaning of which is made clear when we describe our construction of the epidemic model in Section 2.3. Let are respectively the numbers of susceptibles, infectives, infectious (i.e. infective-susceptible) edges and susceptible-susceptible rewired edges at time t.
Our first result concerns the initial phase of an epidemic starting with one initial infective, which we approximate by a branching process. Let B be a continuous-time branching process, with one ancestor, in which the lifetime of an individual follows an exponential distribution with mean γ −1 . At birth an individual is assigned Po(µ) infectious edges, where Po(µ) denotes a Poisson random variable with mean µ. An individual drops each of its infectious edges independently at rate ω and infects down them independently at rate λ. When an individual infects down an infectious edge a new individual is born and the edge is dropped. When an individual dies all of its remaining infectious edges are dropped. For t ≥ 0, let I(t), I E (t) and T (t) be respectively the number of individuals, number of infectious edges and the total progeny (including the initial ancestors) in B at time t. For n = 1, 2, . . . , let t n = inf{t ≥ 0 : T (t) ≥ log n}, where t n = ∞ if T (t) < log n for all t ≥ 0. Let E (n) be the epidemic described in Section 2.1, assuming a single initial infective. Let T (n) (t) = n−S (n) (t) be the total number of infections in E (n) during [0, t].
Theorem 2.1 There exists a probability space (Ω, F , P) on which are defined realisations of E (n) (n = 1, 2, . . . ) and B satisfying be the offspring mean of B. The quantity R 0 is known as the basic reproduction number for the epidemic E (n) . We say that a major outbreak occurs in E (n) if at least log n individuals are infected. It follows from Theorem 2.1 that as n → ∞ the probability of a major outbreak converges to the probability that B does not go extinct. Thus with high probability a major outbreak is possible if and only if R 0 > 1. (An event, A n say, is said to hold with high probability if P(A n ) → 1 as n → ∞.) In particular, if all parameters other than λ are held fixed, with high probability a major outbreak is possible if and only if λ > λ c , where Let T (n) = n − S (n) (∞) be the final size of the epidemic E (n) , i.e. the total number of individuals infected during the epidemic, andT (n) = n −1 T (n) be the fraction of the population that become infected. The above criticality of λ c and the following lemma follow from [Jiang et al.(2019)], Theorem 2, though the proof there is quite different from the current proof, given in Section 6.1.
Remark 2.1 Note that λ c and τ ′ are independent of the value of α. It is clear that the model with α = 0, so there is dropping but no rewiring of edges, provides a lower bound for any corresponding model with α > 0. For the model with α = 0, the epidemic and random graph can be constructed simultaneously on a generation basis using an obvious extension of the construction in [Neal(2003)] to yield a process that can be represented as a randomised Reed-Frost process ([Martin-Löf(1986)]). The central limit theorem in [Martin-Löf(1986)] then yields a central limit theorem for the final size of a major outbreak. We omit the details.
Our next result is concerned with the deterministic approximation of the main body of an epidemic started with many initial infects. For t ≥ 0, let x(t) = (s(t), i(t), i E (t), w(t)) be the solution of the system of ordinary differential equations is not in bold to help link with the theory in [Darling and Norris(2008)], where x(t) has a separate meaning, that is used in the proofs.) LetX (n) (t) = n −1 X (n) (t).
Remark 2.2 We show in Section 3 that (2.3)-(2.6) are equivalent to the pair-approximation model of the epidemic, so Theorem 2.2 provides a rigorous justification of the pair-approximation model of the epidemic E (n) when a positive fraction of individuals are initially infective; cf. [Altmann (1998)] and [Jacobsen et al.(2018)] who prove similar weak law of large numbers for other dynamic network epidemic models.
Theorem 2.2 is illustrated in Figure 1, which is based on simulations of epidemics with λ = 1.5, γ = 1, ω = 4 and α = 1 (so no dropping of edges) on networks with µ = 5. For each of n = 1, 000 and n = 5, 000, a realisation of the Erds-Renyi random graph G(n, µ/n) was simulated and then an epidemic, in which initially 1% of the population were infected and the remaining 99% susceptible, was simulated on that graph, with the whole process being repeated 100 times. The trajectories of the fraction of the population infected in the 100 simulations are shown, together with the trajectory of their mean (dashed curve) and the deterministic fraction i(t) (solid curve). When n = 1, 000, there are only 10 initial Figure 1: 100 simulated realisations of trajectories of fraction infected in SIR epidemics in populations of size n = 1, 000 and n = 5, 000 with 1% initially infective, when µ = 5, λ = 1.5, γ = 1, ω = 4 and α = 1. Also shown is the deterministic fraction i(t) (solid curve) and the mean of the stochastic trajectories (dashed curve). See text for details.
infectives. Consequently a few of the epidemics failed to take off and for those that took off there was noticeable variation in the time of the peak of the process of infectives. Both of these phenomena have the effect of reducing the mean trajectory and can be explained by considering the branching process B which approximates the early stages of an epidemic. See [Barbour and Reinert(2013)] for a formal proof of the latter phenomenon for a range of epidemic models. When n = 5, 000, there are 50 initial infectives, all 100 simulated epidemics took off and there was appreciably less variation in the time of the peak. The initial conditions are now closer to those of Theorem 2.2 and the deterministic model provides a good approximation to the corresponding stochastic model.
We now consider the final outcome of an epidemic. Recall that T (n) = n − S (n) (∞) is the final size of the epidemic and letT (n) = n −1 T (n) be the fraction of the population that become infected.

Remark 2.3
We present arguments in support of Conjecture 2.1 in Section 6.5, although we do not have a complete proof. The usual approach to proving limit theorems for the final size of an SIR epidemic models is via a random time-scale transformation (see the start of Section 6.3). This leads to a deterministic model in which the right-hand sides of (2.3)-(2.6) are divided by λi E (see (6.41)-(6.43) in Section 6.5.1). Note that the vector field corresponding to the time-transformed deterministic model is not Lipschitz in the neighbourhood of (i, i E ) = (0, 0) owing to the term i/i E in the transformed version of (2.4), so standard results for the approximation of Markov chains by differential equations cannot be applied. Note that for the SI epidemic (i.e. when γ = 0), i(t) = 1 − s(t) for all t ≥ 0. The timetransformed differential equations for (s, i E , w) form a closed system that is Lipschitz, so the above difficulty disappears and rigorous results are readily available.
Theorem 2.3 would immediately yield rigorous results concerning a discontinuity at λ = λ c for the final size of stochastic epidemics that take off if Conjecture 2.1(b) is true. By considering suitable bounding processes we can however obtain conditions, together with a proof, under which the final size of an epidemic started with a single infective that take off is discontinuous at the threshold and other conditions when it is continuous at the threshold λ = λ c . Our main result is that the final size may be discontinuous at the threshold λ = λ c .
Theorem 2.4 Suppose that for each n the epidemic is started by 1 infective, with the rest of the population susceptible.
(a) Suppose that ω(2α−1) > γ and µ > 2ωα ω(2α−1)−γ . Then there exists τ 0 = τ 0 (µ, λ, ω, α) > 0 such that, conditional upon a major outbreak,  Remark 2.4 Theorem 2.4 is not fully satisfactory as there is a gap between the conditions in parts (a) and (b). Note that Conjecture 2.1(b) and Theorem 2.3 imply the conjecture that the condition in Theorem 2.4(b) can be replaced by See Section 6.5 for further evidence in support of this conjecture is provided, which suggests also that the strict inequalities in (2.7) can be replaced by weak inequalities.
Figure 2, which is inspired by Figure 4 of [Jiang et al.(2019)], shows the results of simulations of the final outcome of the SIR epidemic with rewiring. In each of the two plots the final size (expressed as a fraction of the population) of 1, 000 epidemics in a population of size n = 10, 000, with values of λ equally spaced in [0, 2], γ = 1, α = 1 (so there is no dropping of edges) and ω = 3 2 (left panel) and ω = 4 (right panel). Each simulation was initiated by 5 infectives, chosen uniformly at random from the population, with the rest of the population being susceptible. The value of ω in the right panel is that used in [Jiang et al.(2019)], Figure 4, for which Theorem 2.4(a) indicates that the final size is discontinuous at the threshold λ = λ c . The value of ω in the left panel is chosen so that our conjecture predicts the final size is continuous at λ = λ c . The solid curves in the two panels show the limiting fraction infected predicted by Conjecture 2.1(b); they are calculated numerically solving the differential equation for x ǫ (t) with ǫ = 10 −10 and deeming the deterministic epidemic finished when i ǫ (t) crosses 10 −8 from above. Note the excellent agreement between the stochastic simulations and the asymptotic limits in both panels, lending credence to Conjecture 2.1(b), and the marked discontinuity at λ = λ c in the right panel. In both panels some large epidemics occur when λ ≤ λ c . This is a finite-population effect even though n is relatively large.

SI model
In this section we assume that γ = 0, so there is no recovery and the model becomes SI. We focus on the final size of the epidemic; results concerning temporal behaviour follow by setting γ = 0 in corresponding results for the SIR model. Note that as infectives remain so forever the epidemic stops when there is no edge between a susceptible and infective individuals. For this model we obtain an explicit equation satisfied by the limiting fraction ultimately infected as n → ∞ (see Theorem 2.5), which enables analysis of the dependence of that fraction on model parameters and proof of a necessary and sufficient condition for its discontinuity (Corollary 2.1). For ǫ ∈ [0, 1), define F ǫ : [ǫ, 1] → R by . (2.8) (b) Suppose that R 0 > 1 and for each n the epidemic is started by one infective, with the rest of the population susceptible. Then, conditional upon a major outbreak, where τ is the unique solution in (0, 1) of F 0 (x) = 0.
Remark 2.5 Assuming that the conjecture in Remark 2.4 is correct, as γ ↓ 0 in the SIR model the final size is discontinuous at λ c if and only if α > 1 2 and µ > 2α 2α−1 , which is different from that for the SI model, viz. α > 1 3 and µ > 3α 3α−1 (see Corollary 2.1(b)).
Remark 2.7 Note that if ω = 0 and λ > 0 then the epidemic ultimately spreads to all individuals in the components of the underlying graph G(n, µ/n) that have initial infectives, so the distribution of the final size T (n) is independent of λ. In particular, for µ > 1 and gives the fraction of individuals in the giant component of G(n, µ/n) in the limit as n → ∞. Setting ω = 0 in Theorem 2.5(b) yields that ρ(µ) is the unique solution in (0, 1) of 1 − x = e −µx (see, for example, [Durrett(2007)], Theorem 2.3.2).
It is interesting to note that [Britton and Trapman(2012)] find the identical threshold µ * (1) ≈ 1.7564 when studying the size of the giant component of a Poissonian random graph where nodes have mixed-Poisson degrees with mean µ. They found that whenever µ >μ * (1) the giant is maximized when the Poisson degree is not mixed and instead is Po(µ). The giant component is hence maximized with minimal heterogeneity in degree distribution whereas the present result shows that the fraction infected by a major outbreak is minimized when there is no rewiring whenever µ >μ * (1).

SIR model with rewiring only to susceptibles
Suppose now that when a susceptible individual rewires an edge away from an infective, instead of rewiring to an individual chosen uniformly at random from the other n − 2 individuals in the population it rewires to an individual chosen uniformly at random from the other susceptible individuals in the population. If there is no other susceptible individual then it does not rewire. The deterministic approximation becomes Note that the only changes from the ordinary differential equations (2.3)-(2.6) are in the last term in (2.14), where the factor 1−α +α(1−i) has been dropped as now rewiring necessarily leads to the loss of one infectious edge, and in the first term in (2.15), where the factor s has been dropped as now rewiring necessarily leads to the gain of one susceptible-susceptible rewired edge. (The difference when there is only one susceptible remaining does not affect the deterministic limit.) is given by the solution of (2.12)-(2.15) with initial state x(0).
Note that the differential equations (2.12), (2.14) and (2.15) form a closed system, whose time-transformed version is Lipschitz (see Section 6.6). Consequently the final outcome of the deterministic model is readily susceptible to analysis and corresponding laws of large numbers are readily available for the stochastic model. For brevity, we restrict attention to the case of the stochastic model with one initial infective. Theorem 2.1 holds also for the present model, see Remark 6.1 at the end of Section 6.1, so R 0 and λ c are still given by (2.1) and (2.2), respectively. Let Theorem 2.8 Suppose that R 0 > 1 and for each n the epidemic is started by 1 infective, with the rest of the population susceptible. Then, conditional upon a major outbreak, Remark 2.9 Note that a necessary condition for r(µ, γ, ω, α) < 0 is α > γ+ω 2ω . Moreover, if this condition is satisfied then, in the limit n → ∞, the fraction of the population that is infected by a major outbreak is one! Remark 2.10 Note from Theorem 2.8 that if λ is increased, with all other parameters held fixed, then for all sufficiently large λ the final size of the epidemic is strictly less than one and is given by the root of g in (0, 1). Thus, in the case of Theorem 2.8(b) (i.e. r(µ, γ, ω, α) < 0), as λ is increased from 0, the final size jumps from 0 to 1 at the threshold λ c , stays at 1 until λ = ω(2α − 1) − γ and then decreases. This is because when λ is very large susceptible individuals with infectious neighbours become infected before they are able to rewire away from them. Indeed, in the limit λ → ∞, all individuals in components of the graph that contain initial infectives become infected. In particular, the final size of a major outbreak coincides with that of the giant component, as is easily verified by letting λ → ∞ in the equation g(x) = 0; cf. Remark 2.7. Figure 4 shows the results of simulations of the SIR model with rewiring only to susceptibles. In each of the two plots the final size of 1, 000 epidemics in a population of size n = 10, 000, with values of λ equally spaced in the given range, γ = 1, α = 1 (so there is no dropping of edges) and ω = 4 (left panel) and ω = 10 (right panel). Each simulation was started with 10 infectives, chosen uniformly at random from the population. The two values of ω were chosen so that r(µ, γ, ω, α) < 0 (left panel) and r(µ, γ, ω, α) > 0 (right panel). The vertical dashed line shows the critical value λ c of λ. The solid curve shows the final size given by Theorem 2.8(a). The figure demonstrates clearly Theorem 2.8. Note in the right panel that the final size is less than 1 for λ > ω − γ = 9. There are a few simulations in the right panel in which the whole population is infected when λ < λ c . This is a finite-population effect, which would be reduced if n was increased and enhanced if n was decreased.

SIR models with alternative rewiring
Two other rewiring models are when a susceptible rewires from an infective it (i) rewires to a randomly chosen recovered individual or (ii) it rewires to an individual chosen uniformly at random from all those individuals that are not currently infectious. Note that in model (i) the edge is effectively dropped as far as disease transmission is concerned, so the model is equivalent to the dropping model (i.e. the corresponding model with α = 0). The analysis of model (ii) is similar to, and has the same difficulties as, that of the SIR model considered in Section 2.2.1. Models (i) and (ii) each have R 0 given by (2.1) and critical infection rate λ c given by (2.2). We omit the details but Theorem 2.3 holds also for model (ii) and we conjecture that the conjecture in Remark 2.4 holds as well.

Construction
The main idea of the construction is to explicitly consider only infectious individuals and connections emanating from these individuals and to keep track also of the pool of rewired edge-stubs. Only when a new individual is infected are its degree and whether it has received any rewired edges determined.
To help introduce the construction, consider first the SIR model without rewiring (or dropping). We construct a realisation of the epidemic and Erdős-Rényi random graph simultaneously as follows (cf. [Britton and O'Neill(2002)] and [Neal(2003)]). We start with I 0 infectives, n − I 0 susceptibles and no edges in the graph. Attach to each infective independently Po(µ n ) edges, where µ n = −n log(1 − µ n ) so µ n satisfies 1 − µ n = e − µn n . Such unconnected edges are called live infectious edges. Infectives make infectious contacts along each of their live infectious edges independently at rate λ. When an infective, individual i 0 say, makes infectious contact along an edge, that edge emanating from i 0 becomes dead and an individual, j 0 say, is sampled independently and uniformly from the whole population. If individual j 0 is susceptible then an edge between i 0 and j 0 is formed, individual j 0 becomes infected and (independently) has Po(µ n ) live infectious edges attached to it. If individual j 0 is not susceptible then nothing happens (apart from the edge from i 0 becoming dead). Infectives recover independently at rate γ. When an infective recovers, all live edges attached to it become dead. The epidemic stops as soon as there is no infective remaining. (Infection spread stops as soon as there is no live infectious edge remaining. In the SI model the epidemic stops when there is no live infectious edge remaining.) It is easily verified that this construction gives an epidemic that is probabilistically equivalent to the SIR epidemic on an Erdős-Rényi graph. (Note that µ n is chosen so that if γ = 0, so an infective infects down all of the edges that are initially attached to it, then it tries to infect the other n − 1 individuals independently, each with probability µ n .) An alternative approach, which is more easily generalised to incorporate rewiring, is to modify the above construction so that only live infectious edges that will be paired with susceptibles are included, and each time an infection occurs along such an edge it is with an individual chosen independently and uniformly from all susceptible individuals at that time. More specifically, suppose an individual i 0 say, is infected at time t. Then Po(µ n S (n) (t) n ) live infectious edges are attached to it. However, we now have to delete each of the live infectious edges at time t− (apart from the one that led to the infection of i 0 , which is necessarily deleted) independently with probability 1 S (n) (t) , to take account of the fact that all live infectious edges are necessarily to susceptible individuals.
Consider now the SIR model E (n) with rewiring and dropping of edges described in Section 2. We adopt the above alternative approach and treat rewiring/dropping as follows. Let W (n) (t) be the number of rewired susceptible-susceptible edges at time t, so W (n) (0) = 0. Each infective independently sends warnings down each of its unconnected live infectious edges independently at rate ω. Suppose that an individual, i 0 say, sends such a warning at time t. Then i 0 drops that edge with probability 1 − α; otherwise the edge is rewired to a susceptible individual, an infective individual or a recovered individual with probabilities (S (n) (t) − 1)/(n − 2), (I (n) (t) − 1)/(n − 2) and 1 − (S (n) (t) + I (n) (t) − 2)/(n − 2), respectively, where I (n) (t) is the number of infectives at time t (a rewiring is always to a new individual other than the individual itself). If the edge is rewired to a susceptible then W (n) (t) is increased by 1. (We do not decide the two susceptible individuals involved at this stage.) If the edge is rewired to an infective, then i 0 loses an infectious edge and an individual chosen uniformly at random from the other I (n) (t) − 1 infectives at time t gains an infectious edge. If the edge is rewired to a recovered individual then i 0 loses an infective edge but nothing else happens.
As before infectives infect along their live infectious edges at rate λ. If an infective, i 0 say, infects down a live infectious edge at time t. Then that live edge is connected with an individual, j 0 say, chosen uniformly from S (n) (t), where, for t ≥ 0, S (n) (t) is the set comprising of the S (n) (t) susceptibles at time t. The live edge then becomes dead. Individual j 0 is infected at time t and acquires Po(µ n S (n) (t) n ) live infectious edges (corresponding to edges in the original network), the fraction S (n) (t)/n comes from now only considering edges to be connected to susceptibles. Individual j 0 may also acquire rewired infectious edges as follows. For each i = 1, 2, . . . , W (n) (t−), independently sample two individuals, k i and l i say, without replacement from S (n) (t−). If j 0 ∈ {k i , l i } then j 0 acquires a further live infectious edge and W (n) (t) is reduced by one. Finally, each of the live infectious edges at time t−, apart from the one that infected j 0 , is dropped independently with probability 1/S (n) (t−) (thus reducing the number of live edges to be connected to susceptibles correctly). The live infectious edge that infected j 0 is necessarily dropped. The construction now continues in the obvious manner. The epidemic stops when there is no infective remaining (SIR model) or no infectious edge remaining (SI model).
The above construction is not fully faithful to the model E (n) , as it allows the possibility of a susceptible, i 0 say, to rewire from an infective, j 0 say, and then be subsequently infected by j 0 without having first rewired back to j 0 . Let F n be the probability that no such imperfection occurs. We show at the start of Section 6 that lim inf n→∞ P(F n ) > 0, and consequently any statement which holds with high probability for the construction, holds also with high probability when the construction is conditioned on being faithful to the original model (cf. [Janson(2009) For t ≥ 0, let I converges to the deterministic model given by (2.3)-(2.6) as n → ∞, in the sense made clear in Theorem 2.2. The terms in (2.5) are explained as follows. The first two terms correspond to a live infectious edge being lost if the associated infective infects along it or recovers. The third term is owing to the creation of new live infectious edges (corresponding to edges in the original network) when an infective transmits infection along an infectious edge; on average each such infection creates µs new live infection edges as only edges that will be paired with a susceptible are included. The fourth term arises from live infectious edges that are lost when a susceptible is infected. The fifth term comes from the gain of live infectious edges from the pool of rewired susceptible-susceptible edges when a susceptible is infected; the factor 2 is present as each such rewired susceptible-susceptible edge has probability 2/S (n) (t−) of having an end at the newly infected susceptible. The final term comes from rewiring/dropping of live infectious edges; note that any edge down which an infective sends a warning is lost unless the edge is rewired to another infective. The terms in the other 3 equations are explained similarly.

Pair approximation
In this section we describe a deterministic pair-approximation model for the SIR epidemic of Section 2.2.1 (see [Gross et al.(2006)] for a similar pair approximation to the corresponding SIS epidemic) and show that it is equivalent to the deterministic model given by (2.3)-(2.6). It then follows using Theorem 2.2 that the pair-approximation SIR model is exact in the limit as n → ∞. For simplicity we treat the case α = 1, i.e. no dropping of edges. We use the pair-approximation paradigm described in [Andersson and Britton(2000)], Chapter 7.
Consider the stochastic SIR model with rewiring described in Section 2.1. Label the nodes (individuals) in the population 1, 2, . . . , n. Let G = [g ij ] be the n × n matrix having elements g ij , where g ij is the number of edges joining nodes i and j, if i = j, and g ii = 0. (In many applications G is an adjacency matrix but here the elements of G can be > 1 owing to rewiring.) Each node is of type S, I or R, according to its disease status. For A ∈ {S, I, R} and i = 1, 2, . . . , n, Suppose that n −1 [A] n (t), n −1 [AB] n (t) and n −1 [ABC] n (t) each tend to deterministic limits as n → ∞. For example, n −1 [S] n (t) → s(t) and n −1 [SI] n (t) → x SI (t). A heuristic argument then yields the following system of ordinary differential equations: The second and third terms in (3.4) are explained as follows. The second term is added to the first since an infection along an SSI link does not change the number of SI links. The third term is present because not only is the rate doubled, although this is already counted since it consists of two SI links, but when an infection occurs the number of SI links is reduced by 2. The factor 2 in (3.3) arises from the double counting in [SS] n (t). There are other variables, such as x II , for which we could write down a differential equation but the above system is sufficient for our purposes.
To close the above system we make the pair approximation where, for example, x S = s. Equations (3.3) and (3.4) then become To connect informally with the deterministic model given by (2.3)-(2.6), note that [SS] n includes SS links in the original network and SS links arising from rewiring. Taking account of the double counting in [SS] n , it follows that For a formal proof, substitute from (3.7) into (3.6) to obtain which, noting that s + r = 1 − i, coincides with (2.5), with α = 1 and i E replaced by x SI . Also, differentiating (3.7) and using (3.1), (3.5) and (3.7), yields which agrees with (2.6). Finally, (3.1) and (3.2) clearly agree with (2.3) and (2.4). (2020)] [Yao and Durrett(2020)] consider SI and SIR epidemics with rewiring on graphs generated by the configuration model (see, for example, [Durrett(2007)], Chapter 3, and [van der Hofstad(2016)], Chapter 7) or its close relatives, which include Erdős-Rényi random graphs. Briefly, the configuration model random graph on n individuals, labelled 1, 2, . . . , n, is constructed as follows.

Comparison with [Yao and Durrett
Let D 1 , D 2 , . . . , D n be i.i.d. copies of a random variable D, which takes values in Z + . Attach D i half-edges to individual i (i = 1, 2, . . . , n) and then pair up the D 1 + D 2 + · · · + D n half-edges uniformly at random to form the graph. (If D 1 + D 2 + · · · + D n is odd then there is a left-over half-edge, which is ignored.) This yields the version of the model introduced in [Newman et al.(2001)]. In an alternative version ( [Molloy and Reed(1995)]) the degrees are prescribed deterministically. The configuration model was first introduced by [Bollobás(1980)]. We outline the main result obtained by [Yao and Durrett(2020)] for the SI model. In our notation, α = 1, so there is no dropping of edges. Let µ = E[D] and G(z) = E[z D ] be respectively the mean and probability-generating function of D. Suppose that E[D 3 ] < ∞. Let β = ωµ λ (ω is denoted by ρ in [Yao and Durrett(2020)], and β by α). Let f : (0, 1) → R be defined by Suppose that λ > λ c and let Suppose that either σ = 0, or σ ∈ (0, 1) and there exists δ > 0 such that f < 0 on (σ − δ, σ).
Suppose that there is initially one infective, chosen uniformly at random from the population of n individuals. Then ( [Yao and Durrett(2020)], Theorem 2), for any ǫ > 0, Note that ν in (4.1) has essentially the same interpretation as τ in Theorem 2.5(b) (when α = 1), so one would expect them to be equal when D ∼ Po(µ). Calculation shows that is not the case. Plots of ν and τ as functions of the rewiring rate ω when µ = 2 and λ = 1 are shown in Figure 5, together with mean fraction infected based on 1, 000 simulations of major outbreaks in a population with n = 5, 000 for each of ω = 0.2, 0.4, 0.6, 0.8 and 1.0. Each simulated epidemic was started by one infective, with the rest of the population being susceptible. A cut-off of 3, 000 was used to determine whether a major epidemic had occurred. (For each ω, epidemics were simulated until 1, 000 major epidemics had occurred. The smallest major epidemic had size 3, 840 and the largest non-major epidemic size 1, 164.) Note that R 0 = 1 when ω = 1, so major outbreaks have zero probability of occurrence in the limit n → ∞. However, they do occur when n = 5, 000. The value of τ when ω = 1 is τ 0 (2, 1) (see Remark 2.6). The simulations are consistent with Theorem 2.5(b) and suggest strongly that (4.1) is incorrect.
The results in [Yao and Durrett(2020)] are based on an effective-degree type construction ( [Ball and Neal(2008)]) in which the random graph and epidemic are constructed simultaneously. Briefly, half-edges are labelled susceptible, infective or recovered according to the disease status of the individual to which they are attached. Initially no half-edge is paired. Infectives transmit infection down their infective half-edges independently at rate λ. When such transmission occurs, the half-edge is paired with a half-edge chosen uniformly at random from all available half-edges, to form an edge in the graph. If the chosen half-edge is attached to a susceptible individual then that individual becomes infected and can then transmit infection down its remaining half-edges. If it is attached to a recovered or infective individual then nothing happens, apart from the loss of the two edges. Such an approach has been used by [Janson et al.(2014)] to prove law of large numbers results for SIR epidemics on Molloy-Reed configuration model random graphs.
In [Yao and Durrett(2020)], rewiring is added to the construction by assuming that each infective half-edge is removed from the vertex to which it is attached independently at rate ω and is immediately re-attached to a vertex chosen uniformly at random from all other vertices. It is claimed that the construction then yields a model whose final size has the same distribution as the original model. However, it is not clear that is the case. Suppose that an infective half-edge is moved from individual i to individual j at time t 0 and individual j becomes infected and transmits infection down that half-edge at time t 1 > t 0 . First, the half-edge needs to be paired to determine whether or not it should be moved; it should be moved only if it is paired with a susceptible individual. Second, if it is moved and infection is transmitted along it at time t 1 then that half-edge should be paired with an individual chosen from susceptible individuals at time t 0 , weighted by their degree at that time, and not from all half-edges at time t 1 . Third, if a half-edge is moved then one of the susceptibles (k say) at time t 0 should have a half-edge such that if k is subsequently infected (and the corresponding edge has not been rewired) and transmits infection down that half-edge at time t 2 , then that half-edge should be paired with an individual chosen (approximately) uniformly at random from the rest of the population and not with a half-edge chosen uniformly at random from the other half-edges at time t 2 . In view of these observations and the simulations, it would appear that the model analysed in [Yao and Durrett(2020)] is an approximation of the epidemic with rewiring. However, it is interesting to note that in both the SI and SIR models the condition in [Yao and Durrett(2020)] for the final size to be discontinuous at the threshold λ = λ c (see their Examples 3 and 7, respectively) coincides with that obtained by setting α = 1 in Theorems 2.3 and 2.6.

Heuristic argument for final size of SI epidemic
Consider first the SI model with α = 0, so there is dropping of edges but no rewiring. The fraction infected by a major outbreak can be obtained heuristically as follows. Suppose that a fraction τ get infected. Fix an initial susceptible, i say. The probability that i gets infected can be calculated by conditioning on the spread among all members of the population excluding i. For n large, in the event of a major outbreak, the number of infected neighbours of i has a Po(µτ ) distribution, since i has Po(µ) neighbours, each of which is independently infected by the epidemic with probability τ . (These are approximations which become exact in the limit n → ∞.) Each infected neighbour of i infects i with probability λ λ+ω , so the probability that i avoids infection is exp(− µτ λ λ+ω ). This probability is also given by 1 − τ , so τ satisfies in agreement with Theorem 2.5(b) with α = 0. This argument is straightforward to extend to the SIR model with α = 0. We now extend the argument to the model with rewiring and for ease of exposition assume that α = 1, i.e. that there is no dropping of edges. This extension involves two new features.
(1) It is no longer the case that the probability that a given infective neighbour, i * say, of i leads to i being infected by that neighbour is given by λ/(λ + ω) because if i rewires away from i * it may be to another infective.
(2) Individual i may acquire infective neighbours through rewiring, which were not neighbours of i in the original network. This happens if a susceptible rewires to i and that susceptible is subsequently infected.
We treat these in turn, again assuming that a fraction τ of the population gets infected. Consider an infective neighbour, j say, of i. Individual i rewires from j at rate ω and is infected by j at rate λ. However, if i rewires to an infective its position as far as the disease is concerned is unchanged. Now i rewires to a susceptible (in which case i avoids infection owing to the original link to j) at rate ω(1 − τ ). It follows that the probability, p I say, that i is infected owing to the original link to j is given by . (5.1) We now determine heuristically the (approximate) distribution of the number of infective neighbours, N (RW ) I (i) say, that i acquires through rewiring. Let E * denote the epidemic in which i is excluded and assume that n is large. For any susceptible-infective edge, the probability that the susceptible rewires that edge before being infected along it is ω/(λ + ω). Thus if the epidemic E * infects (n − 1)τ individuals, by the law of large numbers there will be ≈ (n − 1)τ ω/λ rewiring events in it. Each such rewiring has probability 1/(n − 2) of being to individual i, so if N (RW ) (i) denotes the number of edges that rewire to individual i, then N (RW ) (i) ∼ Po(τ ω/λ) approximately.
Consider a typical edge that rewires to i. For large n, the number of infections in E * that occur prior to that rewiring is distributed approximately as ⌈(n − 1)τ U⌉, where U ∼ U(0, 1). The number of infections that occur after that rewiring is ≈ ⌊(n − 1)τ (1 − U)⌋. By symmetry, these ⌊(n − 1)τ (1 − U)⌋ infections are with individuals drawn uniformly at random without replacement from the ≈ n − 1 − ⌈(n − 1)τ U⌉ suscpetibles remaining at the time of this typical rewire to i. Thus, given U, the probability that the susceptible who rewires to i is subsequently infected is approximately Taking expectations with respect to U, it follows that for a typical edge that rewires to i, the probability that the susceptible is subsequently infected is given approximately by Thus in the event of a major outbreak, recalling that N (RW ) (i) ∼ Po(τ ω/λ) approximately, we have approximately for large n that Taking logarithms of both sides of (5.4) and rearranging yields so F 0 (τ ) = 0, in agreement with Theorem 2.5(b) when α = 1. The arguments leading to (5.2) and (5.3) still hold for the SIR model. However, p I is no longer given by (5.1) since (i) the infective, j say, at the end of an edge from i may recover before it infects i and (ii) if i rewires from j to an individual, k say, that was infected by epidemic the rewiring needs to occur before k recovers from infection. There does not seem to be an easy way to approximate p I .

Proofs
We prove the results described in Section 2.2 by showing that corresponding results hold for the construction described in Section 2.3. As noted there, the construction is not fully faithful to the rewiring model described in Section 2.1 as it allows for the possibility of a susceptible, i 0 say, to rewire an edge in the "original network" from an infective, j 0 say, and then be subsequently infected by j 0 along another edge in the "original network". (By an edge in the "original network" we mean one of the un-rewired infectious edges allocated to i 0 when it was infected.) A realisation of a process that is probabilistically equivalent to the original model is obtained by conditioning on there being no such imperfections. The allocation of "original network" infectious edges to infectives in the construction can be achieved by labelling the individuals in the population 1, 2, . . . , n, letting X 1 , X 2 , . . . , X n be i.i.d. Po(µ n ) random variables and χ i,j (i = 1, 2, . . . , n, j = 1, 2, . . . ) be i.i.d. discrete uniform random variables on {1, 2, . . . , n}. The ith individual to be infected is allocated X i "original network" infectious edges, that are linked to individuals χ j (j = 1, 2, . . . , X i ). Those that are not linked to susceptibles are dropped immediately. Let F n be the event that the construction remains faithful to the model of Section 2.1 and D n be the event that χ j (j = 1, 2, . . . , X i ) are distinct for each i = 1, 2, . . . , n. Then D n ⊆ F n . Now P(χ 1 , χ 2 , . . . , χ X i are distinct|X i ) = Thus lim inf n→∞ P(F n ) > 0 and it follows that any statement which holds with high probability for the construction, holds also with high probability when the construction is conditioned on being faithful to the original model (cf. [Janson(2009)]).
In the proofs that follow, we use the same notation for the construction as that defined for the original model in Section 2.1. We treat the final size of the SI model before that of the SIR model as the former is simpler.
6.1 Proofs of Theorem 2.1 and Lemma 2.1 Let (Ω, F , P) be a probability space on which are defined independent unit-rate Poisson processes η 1 , η 2 , . . . . Let Z E i = η i ([0, µ]) (i = 1, 2, . . . ). For n = 1, 2, . . . , let Z 1, 2, . . . , n). A realisation of the branching process B is constructed on (Ω, F , P) in which the ith individual born in B is assigned at birth Z E i infectious edges. For n = 1, 2, . . . , a realisation of the epidemic process E (n) is constructed on (Ω, F , P), using the construction in Section 2.3, in which when first infected the ith infective has Z (n) i infectious edges. Further details of these constructions are indicated below. First we show that some events associated with the epidemic processes hold with high probability. Let ⌊log n⌋ . Then the law of large numbers implies that T (n) E ≤ 2µ log n with high probability. Let I n denote the set consisting of the first ⌊log n⌋ individuals infected in E (n) . (If the final size of E (n) is less than ⌊log n⌋ then I n consists of all individuals infected in E (n) .) Recall that T (n) (t) = n − S (n) (t) is the total number of infections in E (n) during [0, t] and lett n = inf{t ≥ 0 : be the total number of infectious edges rewired from individuals in I n during [0,t n ]. Clearly no individual in I n can have more than T (n) E infectious edges when it is first infected. If every individual in I n were to have every infectious edge they had when they were first infected rewired then, given T (n) E , the expected number that would be rewired to individuals in I n is less than (log n)T (n) E log n n−2 and it follows that, unconditionally, the number of such rewirings is zero with high probability. Thus W (n) T ≤ 2µ log n with high probability.
Recall that in E (n) a newly infected individual, at time t say, acquires Bin(W (n) (t−), 2/S (n) (t−)) rewired infectious edges upon infection. (As usual, Bin(n, p) denotes a binomial random variable with n trials and success probability p.) LetŴ  Collating the above, we have shown that in E (n) with high probability, during [0,t n ], (i) all rewired edges are to individuals not in I n , (ii) no individual in I n acquires a rewired infectious edge at infection and (iii) no individual in I n drops an infectious edge at infection. Recalling that Z (n) i and Z E i are both defined on the same Poisson process η i , we have that |Z 1, 2, . . . , n). Thus, noting that µ n > µ, 1, 2, . . . , ⌊log n⌋) with high probability. Given (i)-(iii) above, it is then straightforward to define realisations of E (n) (n = 1, 2, . . . ) from a realisation of B so that with high probability the process of infectives in E (n) coincides with the realisation of B over [0, t n ] and Theorem 2.1 follows.
Turning to the proof of Lemma 2.1, note by Theorem 2.1 and Remark 2.1 it is sufficient to consider the case α = 0, i.e. the model with only dropping of edges. Let r denote the Malthusian parameter of the branching process B. Then r is given by the unique real solution of the equation For t ≥ 0, let I E 1 (t) be the number of individuals alive in B at time t that had precisely 1 infectious edge at birth and still have that edge at time t. Recall that T (t) is the total progeny of B at time t. Let A ext = {ω ′ ∈ Ω : T (∞, ω ′ ) < ∞} denote the set on which B goes extinct. Then it follows using [Nerman(1981)], Theorem 5.4 and Corollary 3.2, that there exists a random variable W ∞ ≥ 0, where W ∞ (ω ′ ) = 0 if and only if ω ′ ∈ A ext , such that, as t → ∞, We use the construction in the above proof of Theorem 2.1 to define realisations of E (n) (n = 1, 2, . . . ) and B on (Ω, F , P). Recall that t n = inf{t ≥ 0 : T (t) ≥ log n}. It follows using Theorem 2.1 and the first limit in (6.1) that, with high probability, T (n) > log n if and only if ω ′ ∈ A C ext . Using the second limit in (6.1), there exists c 1 > 0 such that I E 1 (t n ) > c 1 log n with high probability.
Recall that R 0 > 1. There exists ǫ > 0 such that R ǫ 0 = (1 − ǫ)R 0 > 1. Note that in the above construction of E (n) , Z (n) i st ≥ Po(µ(1 − ǫ)) for i ≤ nǫ, where st ≥ denotes the usual stochastic ordering. Thus, with high probability, if T (n) ≥ log n, then until time t such that T (n) (t) ≥ nǫ, the process of infectives in the epidemic E (n) is bounded below by the branching process B ǫ , which follows B until time t n , after which each birth is aborted independently with probability ǫ. Let T ǫ (∞) be the total progeny of B ǫ . Let π ǫ be the extinction probability for the progeny of an individual with one infectious edge at time t n in B ǫ , so π ǫ < 1 as R ǫ 0 > 1. It follows that and Lemma 2.1 follows on setting τ ′ = ǫ.
Remark 6.1 It is clear from the above proofs that Theorem 2.1 and Lemma 2.1 hold also for the model of Section 2.2.3, in which rewiring is necessarily to susceptibles.

Proof of Theorem 2.2
The proof is an application of [Darling and Norris(2008)], Theorem 4.1, and much of our notation is chosen to aid that application. For t ≥ 0, let S (n) (t) be the number of susceptibles at time t, I . Then X (n) is a continuous-time Markov chain with state space E (n) having typical element ξ = (n S , n I 0 , n I 1 , . . . , n W ). Thus E (n) = {(n S , n I 0 , n I 1 , . . . , n W ) : n S , n I 0 , n I 1 , . . . , n W ∈ Z + , n S + n I ≤ n}, where n I = ∞ k=0 n I k is the number of infectives corresponding to state ξ. For future reference, n E = ∞ k=0 kn I k is the number of infectious edges corresponding to state ξ. For distinct states ξ, ξ ′ ∈ E (n) , let q (n) (ξ, ξ ′ ) = lim t↓0 t −1 P(X (n) (t) = ξ ′ |X (n) (0) = ξ) denote the jump rate of X (n) from ξ to ξ ′ . We do not write down expressions for these jump rates, as there are many different types of jumps and some jump rates are quite complex owing to binomial samplings in the construction. Moreover, the individual jump rates are not required for our purpose; see (6.3) and (6.4) below.
Let x : E (n) → R 4 be defined by to the process with the same notation in Theorem 2.2. (To ease notation we have not indexed x by n. To aid connection with [Darling and Norris(2008)], the 4-dimensional vectorX (n) (t) is rendered in bold and the infinite-dimensional vector X (n) (t) is not.) For each ξ ∈ E (n) , let be the drift function forX (n) and To define the limiting deterministic process, let U = [0, 1] 2 × [0, ∞) 2 and write x 1 = s, x 2 = i, x 3 = i E and x 4 = w. Let b : U → R 4 be the vector field defined by (The suffices R, D, RW R, RW S and I correspond to recovery, dropping of an infectious edge, rewiring of an infectious edge to a recovered individual, rewiring of an infectious edge to a susceptible individual and infection, respectively. Rewiring of an infectious edge to an infective has no effect on x.) Let x(t) = (s(t), i(t), i E (t), w(t)) be the solution of the differential equation coincides with the solution of (2.3)-(2.6) in Section 2.2. To apply [Darling and Norris(2008)], Theorem 4.1, we need bounds for |β (n) (ξ) − b(x(ξ))| and α (n) (ξ), which we now derive. We partition β (n) (ξ) and α (n) (ξ) into sums analogous to that for b(x) at (6.5). We derive first expressions for the components of β (n) (ξ). Recall that ξ = (n S , n I 0 , n I 1 , . . . , n W ), n I = ∞ k=0 n I k and n E = ∞ k=0 kn I k . Then The expression for β (n) I (ξ) is derived as follows. (The derivations of the expressions for the other components of β (n) (ξ) are much simpler and hence omitted.) When X (n) is in state ξ, infections occur at overall rate λn E . A single infection clearly decreases n S by one and increases n I by one. The newly infected individual, i 0 say, acquires X ∼ Po(µ n n −1 (n S − 1)) un-rewired infectious edges and Y ∼ Bin(n W , 2/n S ) rewired infectious edges. The infectious edge that infected i 0 is dropped, as are Z ∼ Bin(n E − 1, 1/n S ) other infectious edges. (The ones that would attempt to infect i 0 if the edge was formed.) Thus, in view of (6.2), the associated change in x(ξ) is (6.7) Summing (x(ξ ′ ) − x(ξ))q (n) (ξ, ξ ′ ) over ξ ′ = ξ is equivalent to multiplying (6.7) by λn E and taking expectations with respect to (X, Y, Z), which yields (6.6). For future reference, note that X, Y and Z are independent. Simple calculation then yields and, letting n E 2 = ∞ k=0 k 2 n I k , α (n) R (ξ) = n −2 γ(n I + n E 2 ), (6.13) α (n) Calculation of α (n) I (ξ) is more involved; an upper bound is sufficient, which we now derive. Using (6.7), α (n)  Finally, we consider rewired susceptible-susceptible edges acquired by infectives at infection. As seen later in the proof, we need consider only such acquired edges while the number of susceptibles S (n) (t) ≥ s 0 n, for fixed s 0 ∈ (0, 1). As noted above, W (n) (t) ≤ S Equations (6.19), (6.20) and (6.21) imply that, provided the number of susceptibles remains above ns 0 , then M (n) D , the maximum number of infectious edges attached to any individual throughout [0, t 0 ], is bounded above by 3 log n with high probability. Now s(t 0 ) > 0. Choose s 0 ∈ (0, s(t 0 )). Let U * = [s 0 , 1] × [0, 1] × [0, 2µ] 2 . The partial derivatives associated with the vector field b are bounded on U * , so b is Lipschitz on U * , with Lipschitz constant K say. Choose ǫ ∈ (0, s(t 0 ) − s 0 ) such that the path x(t)(0 ≤ t ≤ t 0 ) lies at a distance greater than ǫ from the complement of U * and let δ = ǫe −Kt 0 /3. Let T (n) = inf{t ≥ 0 :X (n) (t) / ∈ U * }. Then, with high probability, x 1 (X (n) (t)) ∈ [s 0 , 1], x 2 (X (n) (t)) ∈ [0, 1], x 3 (X (n) (t)) ∈ [0, 2µ] and x 4 (X (n) (t)) ∈ [0, 2µ] for all t ∈ [0, T (n) ]. It then follows using (6.8)-(6.12) that with high probability for all t ∈ [0, T (n) ], which implies that the event Ω 1 occurs with high probability, where Further, (6.14)-(6.18) imply that with high probability and α (n)  R (X (n) (t)) ≤ γn −1 (1 + 3µ log n), (6.24) for all t ∈ [0, T (n) ]. The inequalities (6.22)-(6.24) imply that there exists C ∈ (0, ∞) such that with high probability α (n) (X (n) (t)) ≤ Cn −1 log n for all t ∈ [0, T (n) ], whence the event Ω 2 occurs with high probability, where By [Darling and Norris(2008)], Theorem 4.1, and Theorem 2.2 follows since the right-hand side of (6.25) converges to 0 as n → ∞ and ǫ > 0 can be chosen arbitrarily small.

Final outcome and discontinuity of the SIR model
In this section we present arguments in support of conjectures concerning the final size of the SIR epidemic (Conjecture 2.1) and its discontinuity at the critical value λ = λ c (see Re-mark 2.4), together with proofs of Theorems 2.3 and 2.4. In Section 6.5.1, we first outline the difficulty in extending the proof in Section 6.3 of Theorem 2.5, concerning the final outcome of the SI epidemic, to the SIR model. We then make some remarks on how Conjecture 2.1 might be proved. In Section 6.5.2, we prove Theorem 2.3 concerning discontinuity at λ = λ c of the final size of the deterministic SIR model given by (2.3)-(2.6) when its initial condition converges to having zero infected in an appropriate fashion. Finally, in Section 6.5.3 we prove Theorem 2.4, which gives sufficient conditions and (implicitly) necessary conditions for the final size of the stochastic SIR model to have a discontinuity at λ = λ c , and discuss a possible approach to proving that the sufficient conditions are also necessary.

Final size of SIR epidemic
A similar random time-scale transformation to that used in Section 6.3, in which the clock is slowed down by a factor given by the total force of infection, leads to the deterministic model which causes problems in the application of [Darling and Norris(2008)], Theorem 4.1, if x 3 (ξ) can be arbitrarily small. These problems disappear if bothĩ E and x 3 (ξ) are bounded away from zero but that excludes the end of an epidemic, and also the start if there are few initial infectives. Consider Conjecture 2.1(a). For any ǫ ∈ (0, 1 − s(∞)), it follows immediately from Theorem 2.2, by choosing t 0 so that s(t 0 ) = s(∞) + ǫ 2 , that lim n→∞ P(T (n) > 1 − s(∞) − ǫ) = 1.

Proof of Theorem 2.3
The lack of a closed-form solution to (6.40)-(6.43) also means that we do not obtain an equation that is satisfied by the final size τ . We can however obtain a condition for the final size of the deterministic model (6.40)-(6.43), with initial condition (s(0),ĩ(0),ĩ E (0),w(0)) = (1 − ǫ, ǫ, Lǫ, 0) where L is a suitably chosen constant, to have a discontinuity at the threshold λ = λ c in the limit ǫ ↓ 0 and hence prove Theorem 2.3.

Proof of Theorem 2.4
Theorem 2.4 is proved by considering modifications of the epidemic model E (n) which (i) give upper and lower bounds for the process of infectives in E (n) and (ii) lead to a timetransformed deterministic model whose corresponding vector field is Lipschitz thus enabling proof of an associated law of large numbers. Part (a) of Theorem 2.4 follows by showing that under the given conditions the final size of the deterministic model for the lower bounding process has a discontinuity at the threshold λ = λ c ; part (b) follows similarly by showing that the final size of deterministic model for the upper bounding process is continuous at λ = λ c . We present the argument in detail for the lower bounding process. The proof for the upper bounding process is similar, so only an outline is given.
Suppose first that the model E (n) is modified so that if a susceptible rewires an edge from one infective to another infective then the edge is dropped. This clearly leads to a model whose final size is stochastically smaller than that of the original model E (n) . We run the original model until time t n = inf{t > 0 : S (n) (t) ≤ n − log n} and then the modified model, and make the same random time-scale transformation as in Section 6.3 to the latter. For the time-transformed modified model, in an obvious notation, letX with initial condition (ŝ(0),î(0),î E (0),ŵ(0)) = (1, 0, 0, 0). Note that the only difference between (6.40)-(6.43) and (6.50)-(6.53) is that the final term in (6.42) is replaced by ω λ since now every rewiring necessarily leads to a drop of an infective edge. For ,î E (t),ŵ(t)). Let ζ = inf{t > 0 :î E (t) = 0}. Observe that (6.50), (6.52) and (6.53) form an autonomous system that is Lipschitz provided thatŝ is bounded away from 0. Also, in an obvious notation, (6.13) becomesα leading to the bound (cf. (6.24))α (n) Consequently, it is straightforward to modify the proof of Theorem 2.2 to show that, for any so, using (6.53), when λ = λ c , Note thatî ′′ E (0) > 0 if and only if the condition in Theorem 2.4(a) is satisfied.
Theorem 2.4(a) now follows asT (n) , conditioned on the occurrence of a major outbreak, is stochastically larger than n −1T (n) .
Turning to part (b), suppose now that the model E (n) is modified so that if a susceptible rewires an edge from an infective to a recovered individual then the edge to the infective is also retained. In the construction this means that when an infective sends a warning down an infective edge and that edge is rewired to a recovered individual then the infective does not lose that infective edge. This leads to a model whose final size is stochastically larger than that of E (n) . As before, we run the model E (n) until time t n defined above and then the time-transformed modified model. The corresponding time-transformed deterministic model is given by (6.50)-(6.53), with (6.52) replaced by Note that (6.50), (6.55) and (6.53) form an autonomous system that is Lipschitz provided thatŝ is bounded away from 0. The proof parallels that of part (a) in the obvious fashion, the only difference being that now, when λ = λ c , Thusî ′′ E (0) < 0 if either ω(3α − 1) < γ or µ < 3ωα ω(3α−1)−γ . Moreover, a further calculation shows that if λ = λ c andî ′′ E (0) = 0 thenî ′′′ E (0) = − 2ωα λc < 0. Part (b) of the theorem now follows using a similar argument to that used at the end of the proof of part (a).
The bounding process used in the proof of Theorem 2.4(b) suggests an approach to proving the conditions in part(a) are also necessary for the final size to be discontinuous at λ = λ c . Run the epidemic E (n) until time t n and then make the random time-scale transformation. For the latter, letX (n) = {X (n) (t) : t ≥ 0}, whereX (n) (t) =x(X (n) (t)) (t ≥ 0) andx : E (n) → R 4 is defined by (6.2). LetĨ (n) (t) andĨ (n) E (t) denote respectively the numbers of infectives and infective edges inX (n) at time t. Recall from Section 6.5.2 that for the epidemic E (n) , conditional upon a major outbreak, I (n) (t n )/I (n) a.s.
The proof of Theorem 2.8 for the other cases, i.e. when the limitτ < 1, follows a similar argument to that of Theorem 2.5(b) and hence is omitted.

Concluding comments
We have presented a construction of an SIR epidemic with preventive rewiring on an Erdős-Rényi random graph, together with a rigorously justified deterministic approximation. For the special case of the SI model, these yielded a detailed analysis of the final outcome of the epidemic, and in particular a proof of a necessary and sufficient condition for the final size to be discontinuous at the phase transition λ = λ c . Similar results were also obtained for the SIR model when rewiring is necessarily to a susceptible individual. Moreover in that case the behaviour at the phase transition is very striking in that the final fraction infected by the epidemic jumps from 0 to 1. For the original SIR model only partial results were proved, in that there is a non-negligible gap between the necessary and sufficient conditions for a discontinuity, although stronger results were conjectured together with supporting evidence. Proving those conjectures is a worthwhile future work.