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
λ 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.
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.
(b) Suppose that R 0 > 1 and for each n the epidemic is started by 1 infective, with the rest of the population susceptible. For ǫ ∈ (0, 1), let x ǫ (t) = (s ǫ (t), i ǫ (t), i ǫ E (t), w ǫ (t)) be the solution of (2.3)-(2.6) with x ǫ (0) = (1 − ǫ, ǫ, L −1 ǫ, 0), where L = λ λ(µ−1)−ω , and τ = 1 − lim ǫ↓0 s ǫ (∞). Then, conditional upon a major outbreak,
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.
Write τ in Conjecture 2.1(b) as τ SIR (µ, λ, γ, ω, α) to show explicitly its dependence on the parameters of the epidemic and let τ SIR (µ, λ, γ, ω, α) = 0 if R 0 ≤ 1. Our next result gives a sufficient (and almost necessary) condition for τ SIR (µ, λ, γ, ω, α) to be discontinuous at λ = λ c when all other parameters are held fixed.
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.
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.
For R 0 > 1, let τ SI (µ, λ, ω, α) denote the solution of F 0 (x) = 0 in (0, 1), i.e. the fraction of the population that is infected by a major outbreak in the limit as n → ∞, assuming 1 initial infective. The fact that τ SI (µ, λ, ω, α) satisfies an explicit equation facilitates a detailed analysis of τ SI (µ, λ, ω, α), which is given in Corollary 2.1 below. We first highlight a key result that is an immediate consequence of Corollary 2.1(b). Note that setting γ = 0 in (2.1) and (2.2) yields R 0 = µλ λ+ω and λ c = ω µ−1 . Let τ SI (µ, λ, ω, α) = 0 if R 0 ≤ 1.
Theorem 2.6 Suppose that µ > 1, ω and α are held fixed. Then τ SI (µ, λ, ω, α) is discontinuous at the threshold λ = λ c if and only if α > 1 3 and µ > 3α 3α−1 . Before stating Corrolary 2.1 we need some more notation. For (µ, α) ∈ (1, ∞) × [0, 1], let θ(µ, α) = 2α(µ−1) µ+α(µ−1) and
and, for α ≥ 7 9 , letμ
(2.11)
The following facts, required for the statement of Corollary 2.1 below, are proved in Section 6.4. There exists a unique α * ∈ ( 7 9 , 1) such that h(μ(α), α) = 0. Let τ * = x 0 (α * ,μ(α * )). (Numerical calculation yields α * ≈ 0.8209,μ(α * ) ≈ 3.3482 and τ * ≈ 0.8764.) For fixed α ∈ (α * , 1), the equation h(µ, α) = 0 has two solutions for µ ∈ (1, α 1−α ), which we denote by µ * L (α) and µ * U (α), where µ * L (α) < µ * U (α). Finally, h(µ, 1) = 0 has a unique solution µ * (1) ≈ 1.7564 in (1, ∞), which satisfies 2µ = e µ− 1 2 .
(c) For fixed ω > 0 and α ∈ [0, 1] we have the following, where implicitly λ > λ c .
(i) If α < α * then τ SI (µ, λ, ω, α) is strictly increasing in λ for all µ.
(ii) If α = α * then τ SI (µ, λ, ω, α) is strictly increasing in λ, unless µ =μ(α * ) when τ SI (µ, λ, ω, α) = τ * for all λ > λ c .
of λ if µ =μ * (1) and strictly decreasing in λ if µ >μ * (1).
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.6 By linearly rescaling time it is immediate that τ SI (µ, λ, ω, α) depends on λ and ω only through λ/ω. For fixed λ > 0, let ω c = (µ − 1)λ, so, in the limit n → ∞, a major outbreak is possible if and only if ω ∈ [0, ω c ). It follows immediately from Corollary 2.1(a) that, for fixed µ > 1, λ ≥ 0 and α ∈ [0, 1],
Hence, by Corollary 2.1(b), τ SI (µ, λ, ω, α) is discontinuous at the threshold ω c if and only if α > 1 3 and µ > 3α 3α−1 . The obvious analogue of Corollary 2.1(c) holds.
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).
Remark 2.8 Suppose that ω > 0 and α = 1, so there is no dropping of edges. Plots of τ 0 (µ, 1), which gives the size of the discontinuity in τ at the threshold λ c , and ρ(µ) are shown in Figure 3 . Note that τ 0 (µ, 1) < ρ(µ) for µ <μ * (1) and τ 0 (µ, 1) > ρ(µ) for µ >μ * (1), which is consistent with Corollary 2.1(c)(iv). Thus, when α = 1, rewiring reduces the size of a major epidemic if µ <μ * (1) and increases it if µ >μ * (1).
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).
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.
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.
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.
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.
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.
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 .
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.
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.
Let ζ (n) = inf{t ≥ 0 : I (n) E (t) = 0}, then the final size T (n) of the epidemic is given by T (n) = n−S (n) (ζ (n) ). LetX (n) = {X (n) (t) : t ≥ 0}, whereX (n) (t) = (S (n) (t),Ĩ (n) 0 (t),Ĩ (n) 1 (t), . . . ,W (n) (t)), be the process having the same state space as X (n) , viz. E (n) , and jump ratesq (n) (ξ, ξ ′ ) = q (n) (ξ, ξ ′ )/(λn E ) (ξ, ξ ′ ∈ E (n) , ξ = ξ ′ ). Recall that n E is the total number of infective edges when corresponding to state ξ. The processX (n) stops when it reaches a state ξ with n E = 0. For t ≥ 0, letĨ (n) ζ (n) ). Note thatX (n) is a random time-scale transformation of X (n) , in which when X (n) is in state ξ the clock forX (n) is slowed down by the factor λn E (ξ) (i.e. by the total force of infection), so T (n) andT (n) have the same distribution. Consequently we can use the time-transformed processX (n) andT (n) to study the asymptotic behaviour of T (n) as n → ∞. The advantage of using the time-transformed process is that, as n → ∞,ζ (n) p −→ζ < ∞ (whereζ is non-random and defined below), whereas ζ (n) p −→ ∞. Such random time-scale transformations have a long history of application to the final outcome of epidemics; see, for example, [Watson(1980) ], [Ethier and Kurtz(1986) ], page 467, [Darling and Norris(2008) ], Section 5.2, and [Janson et al.(2014) ].
LetX
x 4 (ξ)) = n −1 n S , n E , n W ; (6.26) cf. (6.2), there is no need to keep track of the number of infectives as the model is SI so n I = n − n S . (The labelling of the three coordinates ofx(ξ) is chosen to aid connection with the coordinates of x(ξ) at (6.2).) The deterministic approximation toX (n) , obtained by dividing the right-hand sides of (2.3), (2.5) and (2.6) by λi E , setting γ = 0 and using i + s = 1, isx(t) = (s(t),ĩ E (t),w(t)) (t ≥ 0), where
where ǫ ∈ (0, 1), as in part (a) of Theorem 2.5. ThenX (n) (0) p −→ (1−ǫ, ǫ, µǫ(1−ǫ), 0) also. It is shown in Appendix A.1 that the solution of (6.27) to (6.29), with initial condition (s(0),ĩ E (0),w(0)) = (1−ǫ, µǫ(1−ǫ), 0),
. Letb :Ũ → R 3 be the vector field given by the righthand sides of (6.27) to (6.29). Letζ = inf{t > 0 :ĩ E (t) = 0} and τ = 1 −s(ζ). Then it follows from (6.31) that τ is given by the smallest solution in (ǫ, 1) of F ǫ (x) = 0, where F ǫ is defined at (2.8). (We show in Appendix A.2 that such a solution exists.) We follow Section 4.2 of [Darling and Norris(2008) ], adapted to L 2 estimates rather than exponential estimates as there presented. For ǫ ′ > 0, let
We show in Appendix A.2 that, under the conditions of Theorem 2.5(a),ĩ ′ E (ζ) < 0. Thus b(x(ζ)) is not tangent to the boundary ofŨ, so there existsC < ∞ such thatρ(ǫ ′ ) <Cǫ ′ for all sufficiently small ǫ ′ > 0. Choose such an ǫ ′ and thent 0 so thatt 0 >ζ + ǫ ′ . Lets 0 =s(t 0 ) 2µ] , is Lipschitz, with Lipschitz constantK say. Letβ (n) andα (n) be defined analogously to β (n) and α (n) at (6.3) and (6.4). Let δ ′ = ǫ ′ e −Kt 0 /3 andΩ i (i = 0, 1, 2) be corresponding events to Ω i (i = 0, 1, 2) (see the proof of Theorem 2.2) forX (n) . The components ofβ (n) (ξ) are given by the corresponding components of β (n) (ξ) divided by λx (3) (ξ). (Note that β (n) R and β (n) RW R are no longer relevant.) A similar comment applies to the components ofb(x(ξ)). In an obvious notation, α (n)
RW S (ξ)/(λx 3 (ξ)) and α (n)
(6.33) cf. (6.17), the constant 2 in the expectation in (6.17) is replaced by 1 in (6.33), sincex(ξ) does not have the component x 2 (ξ) = n −1 n I corresponding to the number of infectives. (Again, α
R and α (n)
RW R are no longer relevant.) The proof of Theorem 2.2 is easily modified to show that the eventsΩ 1 andΩ 2 , with A n replaced byÃ n = C 1 n −1 log n for suitable C 1 > 0, each occur with high probability. It then follows using [Darling and Norris(2008) ], Theorem 4.3 (adapted to L 2 estimates) that
Theorem 2.5(a) follows sinceΩ 0 occurs with high probability, by assumption, and ǫ ′ > 0 can be chosen arbitrarily small. Turn now to Theorem 2.5(b). Consider first the non-time-transformed process, let t n = inf{t > 0 : S (n) (t) ≤ n − log n} and note that t n < ∞ since a major outbreak occurs. Let
is random. We apply the same random time-scale transformation as above to the process X (n) ′ , yielding a process,X (n) ′ say, withX (n) ′ (0) = X (n) (t n ). We now drop the superfix ′ , from the processX (n) ′ to yield a time-transformed processX (n) withX (n) (0) = X (n) (t n ).
It follows from the proofs of Theorem 2.1 and Lemma 2.1 that I (n)
is now the solution of (6.27)-(6.29) with initial condition (s(0),ĩ E (0),w(0)) = (1, 0, 0), which is given by setting ǫ = 0 in (6.30)-(6.32). (Note that, unlike the corresponding un-time-transformed deterministic approximation, this process does not get stuck at (1, 0, 0).) As before,ζ = inf{t > 0 :ĩ E (t) = 0} and τ = 1 −s(ζ). Thus τ satisfies F 0 (τ ) = 0. We show in Appendix A.3 that, when R 0 > 1, F 0 (τ ) = 0 has a unique solution in (0, 1) andĩ ′ E (ζ) < 0. Let τ ′ be as in Lemma 2.1, t 1 = τ ′ /2 andc =s(t 1 ) = 1 − t 1 . We now takẽ
Note that with this choice ofŨ,ζ − ǫ ′ is close toζ for all sufficiently small ǫ ′ > 0. Note also thatĨ (n) E (t) > 0 for all t ∈ [0, t 1 ] with high probability, since ifĨ (n) E (t) = 0 for some t ∈ [0, t 1 ] thenT (n) ≤ τ ′ /2 contradicting Lemma 2.1. The remainder of the proof now follows that of (a).
Recall that γ = 0 and we consider the SI model. By Theorem 2.5(b), τ SI (µ, λ, ω, α) is given by the unique solution in (0, 1) of f (x) = 0, where
Recall from (2.2) that λ c = ω µ−1 . The function f 0 , defined at (2.9) is obtained by substituting λ = λ c in (6.35).
Writing θ for θ(µ, α) = 2α(µ−1) µ+α(µ−1) , elementary calculus yields
Thus f ′ 0 (0) = 0. If θ ∈ [0, 1 2 ] then f ′ 0 (x) < 0 for all x ∈ (0, 1), whence f 0 is strictly decreasing on [0, 1) and 0 is the only root of f 0 in [0, 1). If θ > 1 2 then f ′′ 0 (0) > 0 and f 0 has a unique root in (0, 1), since f 0 (1−) = −∞ and f has at most two stationary points in (0, 1). Part (a) follows since, with µ, ω and α held fixed, lim λ↓λc f (x) = f 0 (x) for all x ∈ [0, 1). Part (b) follows on noting that θ > 1 2 if and only if α > 1 3 and µ > 3α 3α−1 . Turning to part (c), fix µ > 1, ω > 0 and α > 0, and let
so τ SI (µ, λ, ω, α) is given by the unique x ∈ (0, 1) such that g(x, λ) = 0. Let g λ denote the partial derivative of g with respect to λ. Then
Note that x 0 (µ, α) is independent of both λ and ω. Now µ > 1, so x 0 (µ, α) > 1 2α . Thus if α ≤ 1 2 , then g λ (x, λ) > 0 for all x ∈ (0, 1) and it follows that τ SI (µ, λ, ω, α) is strictly increasing in λ for λ > λ c . Now fix α ∈ ( 1 2 , 1). Noting that ω(1 − α) + 2ωα[1 − x 0 (µ, α)] = ωα µ , g(x 0 (µ, α), λ) =h(µ) (λ > λ c ), (6.37) whereh(µ) = h(µ, α) and h is defined at (2.10). (Note that g(x 0 (µ, α), λ) is independent of λ.) If µ ≥ α 1−α then x 0 (µ, α) ≥ 1 whence, as above, τ SI (µ, λ, ω, α) is strictly increasing in λ. Thus, consider 1 < µ < α 1−α .
.
(6.38)
Hence,h ′ (1) = α−1 2α(2α−1) < 0, as α ∈ ( 1 2 , 1), and h ′ (µ) = 0 if and only if (1 − α 2 )µ 2 − α(1 + α)µ + 2α 2 = 0. (6.39)
The discriminant of the quadratic (in µ) on the right-hand side of (6.39) is ∆ = α 2 (1 + α)(9α − 7). Suppose α < 7 9 . Then ∆ < 0, soh has no stationary point in (1, α 1−α ) and h (µ) < 0 for all µ ∈ (1, α 1−α ). Thus, for such µ, (6.37) implies that g(x 0 (µ, α), λ) < 0 for all λ > λ c , whence τ SI (µ, λ, ω, α) < x 0 (µ, α) for all λ > λ c . It then follows, using (6.36) and the definition of τ SI (µ, λ, ω, α), that τ SI (µ, λ, ω, α) is strictly increasing in λ on (λ c , ∞). The same conclusion holds if α = 7 9 since thenh has a unique stationary point in (1, α 1−α ), which must be an inflection ash ′ (1) < 0 andh( α 1−α ) = −∞, so againh(µ) < 0 for all µ ∈ (1, α 1−α ). Suppose now that 7 9 < α < 1. Thenh has two stationary points in (1, α 1−α ), a minimum atμ(α) and a maximum atμ(α) say, whereμ(α) <μ(α) are given by α 2(1−α) [1 ± η(α)], with η(α) = 9α−7 1+α . Note that η is strictly increasing on [ 7 9 , 1], η( 7 9 ) = 0 and η(1) = 1. Further,
.
Nowĥ(0) = 3 2 − log 7 < 0, consistent with the above analysis of the case α = 7 9 . It is shown easily thatĥ is strictly increasing andĥ(1−) = ∞. Thusĥ has a unique root (0, 1), which we denote by θ * . Numerical calculation yields θ * ≈ 0.4614, whence α * = η −1 (θ * ) ≈ 0.8209 andμ(α * ) ≈ 3.3482.
When 7 9 < α < α * , then for all µ ∈ (1, α 1−α ) we haveh(µ) < 0 and the previous analysis shows that τ SI (µ, λ, ω, α) is strictly increasing in λ on (λ c , ∞). (Thus we have now proved part (c)(i).) The same is true when α = α * and µ =μ(α * ). If α = α * and µ =μ(α * ) then g(x 0 (μ(α * )), λ) = 0 for all λ > λ c , whence τ SI (μ(α * ), λ, ω, α * ) = x 0 (μ(α * )) = τ * for all λ > λ c , thus proving part (c)(ii).
Suppose now that α * < α < 1. Thenh(μ(α)) > 0, so there exists µ * L (α) <μ(α) < µ * U (α) such that (recall that 1 < µ < α 1−α )
The cases whenh(µ) < 0 orh(µ) = 0 have been analysed previously and the same conclusions follow. Ifh(µ) > 0 then g(x 0 (µ, α), λ) > 0 for all λ > λ c . Thus now τ SI (µ, λ, ω, α) > x 0 (µ, α) for all λ > λ c , so (6.36) and the definition of τ SI (µ, λ, ω, α) implies that τ SI (µ, λ, ω, α) is strictly decreasing in λ on (λ c , ∞), which completes the proof of part (c)(iii). Suppose finally that α * < α = 1. Thenh(µ) = − log(2µ) + µ − 1 2 , soh ′ (µ) = 1 − µ −1 > 0 for all µ > 1. Further, it is shown easily thath has a unique root, denoted by µ * (1), in (1, ∞). Thush(µ) is < 0, = 0 or > 0 according to µ < µ * (1), = µ * (1) or > µ * (1) and part (c)(iv) follows.
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.
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.
To prove Conjecture 2.1(a) it is sufficient to show also that lim n→∞ P(T (n) < 1 − s(∞) + ǫ) = 1. (6.44)
One approach to proving (6.44) is as follows (cf. the proof of [Ball and Britton(2007) ], Theorem 4.3). For ǫ ′ ∈ (0, 1 − s(∞)), let t 0 (ǫ ′ ) be defined by s(t 0 (ǫ ′ )) = s(∞) + ǫ ′ . Choose ǫ ′ 0 sufficiently small so that the process {X (n) (t) : t ≥ t 0 (ǫ ′ 0 )} is subcritical; intuitively this is possible since otherwise the final fraction susceptible would be smaller than s(∞). For ǫ ′ ≤ ǫ ′ 0 , the process of infectives in {X (n) (t) : t ≥ t 0 (ǫ ′ )} can be bounded above by a subcritical branching process, B(ǫ ′ ) say, having 2ni(t 0 (ǫ ′ )) initial ancestors. Let µ B (ǫ ′ ) be the mean total progeny of B(ǫ ′ ) if it had a single ancestor. Note that µ B (ǫ ′ ) is increasing in ǫ ′ and µ B (ǫ ′ ) < ∞ for ǫ ′ < ǫ ′ 0 . A simple argument using Markov's inequality shows that, for ǫ > 0,
The right-hand side of (6.45) can be made arbitrarily small as i(t 0 (ǫ ′ )) → 0 as ǫ ′ ↓ 0, and (6.44) follows. The lack of a closed-form solution to the ordinary differential equations (6.40)-(6.43) makes it difficult to make the above argument rigorous. Turning to Conjecture 2.1(b), consider the approximating branching process B defined in Section 2.2.1. Application of [Nerman(1981) 
It is then clear from the proof of Theorem 2.1 that for the epidemic E (n) , conditional upon a major outbreak, I (n) (t n )/I (n)
a.s. −→ L as n → ∞, where t n = inf{t ≥ 0 : T (n) (t) ≥ log n} is the time when the cumulative number of infectives in E (n) first reaches log n. This suggests the initial conditions for the deterministic model used in Conjecture 2.1(b).
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.
First note that (6.42), together with the initial condition, yields 
The value of L is assumed in the theorem, see the definition of τ SIR (µ, λ, γ, ω, α) just prior to Theorem 2.3, but it can also be obtained using l'Hopital's rule. Assuming that the limit exists, l'Hopital's rule gives
using (6.41) and (6.46), whence
(6.48) Substituting (6.48) into (6.47) yields
when λ = λ c . Thus, when λ = λ c ,
i ′′ E (0) > 0 if and only if γ < ω(2α − 1) and µ > 2ωα
Theorem 2.3 follows since
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.
is the size of the modified epidemic. Suppose that the condition in Theorem 2.4(a) is satisfied. Then lim λ↓λc (1 −x(ζ)) > 0 and it follows using (6.54) that there exists τ 0 > 0 such that lim λ↓λc lim n→∞ P(n −1T (n) > τ 0 ) = 1.
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.
−→ L as n → ∞. This suggests that there exists L ′ > L and t 0 > 0 such that, conditional upon a major outbreak,Ĩ (n) (t) ≤ L ′Ĩ (n) E (t) for all t ∈ [0, t 0 ] with high probability. The term ω λ (1 − α + α(1 −ĩ)) in (6.42) arises from rewirings to susceptibles or recovered. In particular, the probability that a rewiring is to a recovered, and the infective edge is dropped, is n−X (n) (t)−I (n) (t)−2 n−2 . Modifying the model so that this probability is replaced by n−X (n) (t)−L ′ I (n) E (t)−2 n−2 leads to an upper bounding process for the true model and hence also for the time-transformed model. The latter has deterministic limit which satisfies (6.40)-(6.43) over [0, t 0 ] but with (6.42) replaced by
). (6.56) Thus (6.40), (6.56) and (6.43) form an autonomous system, that is Lipschitz provided that s is bounded away from 0 and hence susceptible to analysis. Omitting the details, when λ = λ c we obtainĩ ′′ E (0) = −µ + 2ωα λc andĩ ′′′ E (0) = − 2ωα λc < 0 ifĩ ′′ E (0) = 0, which imply that the conditions in Theorem 2.4(b) are also necessary.
It may be possible to make the argument rigorous using branching processes that bound E (n) but that does not seem straightforward since (i) t 0 depends on λ and ↓ 0 as λ ↓ λ c and (ii) the result is conditional upon a major epidemic, the probability of which also ↓ 0 as λ ↓ λ c . 6.6 Proof of Theorems 2.7 and 2.8
The proof of Theorem 2.7 is omitted as it parallels that of Theorem 2.2 in Section 6.2, with only very minor modification. Turning to Theorem 2.8, we make the same random time-scale transformation as in Section 6.3, in which the clock is slowed down by a factor given by the total force of infection. Recalling (2.12)-(2.15), this leads to the deterministic model given by ds dt = −1, (6.57)
with initial condition (s(0),ĩ(0),ĩ E (0),w(0)) = (1, 0, 0, 0). The equations for (s,ĩ E ,w) form a closed system having solutions (t) = 1 − t, (6.61)
i E (t) =s(t)g(s(t)), (6.62) w(t) = ωα λs (t)(1 −s(t)), (6.63) whereg (s) = 1 + γ + ω(1 − 2α) λ logs + µ − 2 ωα λ (1 −s(t)).
The solution is derived as follows. Equation (6.61) follows immediately from (6.57) and the initial condition. Equation (6.63) is obtained by dividing (6.60) by (6.57) and solving the resulting differential equation using the integrating factors −2 , together with the initial condition. Finally, (6.62) is obtained by dividing (6.59) by (6.57), substituting forw from (6.63) and then solving the resulting differential equation using the integrating factor s −1 , together with the initial condition. Letζ = inf{t > 0 :ĩ E (t) = 0} andŝ =s(ζ). Then eitherŝ = 0 org(ŝ) = 0. We thus investigate the solutions ofg(s) = 0 in [0, 1]. Note thatĩ ′ E (0) = µ − 1 − ω+γ λ > 0, as λ > λ c , ands(1) = 0, soζ ∈ (0, 1], so we investigate the solutions ofg(s) = 0 in [0, 1). Now g ′ (s) = 1 + γ + ω(1 − 2α) λ s −1 − µ + 2 ωα λ , sog has at most one stationary point in (0, 1]. Further,g(1) = 0 andg ′ (1) = 1−µ+ ω+γ λ < 0, as λ > λ c , so by consideringg(0+) it is seen easily thatg has no root in (0, 1) if λ + γ + ω(1 − 2α) ≤ 0 and precisely one root in (0, 1) if λ + γ + ω(1 − 2α) > 0. Note that since λ c = γ+ω µ−1 , a necessary (but not sufficient) condition forg not to have a root in (0, 1) is that r(µ, γ, ω, α) < 0, where r(µ, γ, ω, α) is defined at (2.16).
Suppose that a major epidemic occurs. Let t n = inf{t > 0 : S (n) (t) ≤ n − log n} < ∞. Define the time-transformed processX (n) analogously to the SI model, using the coordinate functions (6.26), withX (n) (0) = (n −1 (S (n) (t n ), I
E (t n ), W (n) (t n )).
Suppose that r(µ, γ, ω, α) < 0 and λ ∈ (λ c , ω(2α − 1) − γ]. Then, given any ǫ ∈ (0, 1), let t 1 = 1 − ǫ/2, sos(t 1 ) = ǫ/2. LetŨ = [ ǫ 2 , 1] × [− ǫ 2 , 2µ] × [0, 2µ]. The vector field b :Ũ → R 3 given by the right-hand sides of (6.57), (6.59) and (6.60) is Lipschitz and the proof of Theorem 2.2 is easily modified to yield lim n→∞ P sup 0≤t≤t 1 X (n) (t) −x(t) > ǫ 4 = 0, (6.64) wherex(t) = (s(t),ĩ E (t),w(t)). By a similar argument to that used at the end of the proof of Theorem 2.5(b) in Section 6.3, there exists t 2 ∈ (0, t 1 ) such thatĨ (n) E (t) > 0 for all t ∈ [0, t 2 ] with high probability. It follows that lim n→∞ P(T (n) > 1 − ǫ) ≥ lim n→∞ P(S (n) (t 1 ) < ǫ) = 1, using (6.64) and the definition of t 1 . Theorem 2.8(b) for the case when λ ∈ (λ c , ω(2α−1)−γ] now follows as ǫ ∈ (0, 1) is arbitrary.
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.
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.
It seems likely that similar results hold for epidemics on networks constructed using the configuration model. Indeed [Yao and Durrett(2020) ] provides such results although, as described in Section 4, we believe that their results are for a model which is different from the original SIR model and does not provide an exact asymptotic approximation to the original model in the limit as n → ∞. However it seems hard to extend our construction to epidemics on configuration-model networks since the construction exploits symmetries and independence properties of a Erdős-Rényi random graph that are not present in configuration-model networks. Although not considered here, it seems likely that the construction can be extended to models that are more akin to the Erdős-Rényi random graph, such as the stochastic block model. Setting ǫ = 0 in (6.31) shows that τ = 1 −s(ζ) is given by the smallest solution in (0, 1) of F 0 (x) = 0, provided there is at least one solution, otherwise τ = 1. We show now that when R 0 > 1 there is a unique solution in (0, 1). Let f be the function defined at (6.35), so τ satisfies F 0 (τ ) = 0 if and only if f (τ ) = 0. Now
so, for x ∈ (0, 1), f ′ (x) = 0 if and only if g 1 (1 − x) = g 2 (1 − x), where g 1 (x) = (λ + ω(1 − α) + 2ωαx) 2 and g 2 (x) = (λµ + ωα)[λ + ω(1 + α)]x. Now g 1 (0) > g 2 (0), lim x→∞ g 1 (x) − g 2 (x) = ∞ and a simple calculation shows that g 1 (1) < g 2 (1) if and only if λ > ω µ−1 = λ c . Suppose R 0 > 1, so λ > λ c . Then g 1 − g 2 has a root in (0, 1) and a root in (1, ∞). Moreover, g 1 − g 2 has precisely one root in each of these intervals, as it convex on R. Hence f ′ has a unique root in (0, 1). Further, f (0) = 0, f ′ (0) = −1 + (λµ + ωα)/[λ + ω(1 + α)] > 0, as λ > λ c , and f (1−) = −∞, so the unique stationary point of f ′ in (0, 1) must be a maximum. It follows that f (x) = 0, and hence also F 0 (x) = 0 has a unique solution τ in (0, 1) and f ′ (τ ) < 0. Letting ǫ = 0 in the argument in Appendix (A.2) shows thatĩ ′ E (ζ) < 0.