A reusable Isabelle/HOL framework for certified reasoning about compartmental ODE models, with the classical SIR epidemic model as the flagship instantiation.
This project provides machine-checked formalizations of:
- Forward invariance — nonnegativity of each compartment derived from nonneg initial conditions via the integrating factor technique
- Conservation laws for compartmental systems (total population is constant)
- Monotonicity of susceptible and recovered compartments
- Phase plane invariant — the Kermack–McKendrick invariant V = I + S − (γ/β)ln S
- Epidemic threshold — initial effective threshold ratio βS(a)/γ with global I-monotonicity when that ratio is at most 1
- Stationary infection condition — under
I(t) > 0,I'(t) = 0iffS(t) = γ/β; the artifact does not prove existence, uniqueness, or global maximality of an infection peak (historical source identifierpeak_iff) - Simplex invariance (all compartments bounded between 0 and N)
- Picard–Lindelöf existence/uniqueness for the SIR vector field, with global forward existence for nonnegative initial data
The generic framework lemmas apply to any supplied differentiable trajectory. The SIR existence theory constructs the unique forward ODE solution and bridges the qualitative SIR theorems to that flow.
| Theory | Contents |
|---|---|
Compartmental_Model |
Generic linear ODE solution via integrating factor; sign preservation (linear_ode_nonneg, linear_ode_pos); nonneg_deriv_nonneg; three-compartment conservation; monotonicity corollaries |
| Theory | Contents |
|---|---|
SIR_Defs |
Locale SIR_solution fixing S, I, R, β, γ with ODE and regularity assumptions; assumes only S(a)≥0, I(a)≥0, R(a)≥0 |
SIR_Forward_Invariance |
Derives S≥0, I≥0, R≥0 from initial conditions via linear_ode_nonneg and nonneg_deriv_nonneg |
SIR_Conservation |
Total population N = S + I + R is constant (via framework) |
SIR_Monotonicity |
S is nonincreasing, R is nondecreasing (via framework + forward invariance) |
SIR_Threshold |
Epidemic growth iff S > γ/β; initial effective threshold ratio βS(a)/γ; initial_epidemic_decline; I_nonincreasing_if_R_zero_le_one |
SIR_Peak |
Stationary infection condition: I'(t) = 0 iff S(t) = γ/β |
SIR_Phase_Plane |
Kermack–McKendrick invariant: V(t) = const on trajectories with S > 0 |
SIR_Invariant |
Simplex boundedness: 0 ≤ X(t) ≤ N for each compartment X |
| Theory | Contents |
|---|---|
SIR_Existence |
SIR vector field on ℝ³; C¹ proof; Picard–Lindelöf flow; conservation, global forward existence, and scalar-locale bridge for the unique solution |
SIR_Main |
Entry point importing all theories; summary documentation |
AFP-style LaTeX document generated by isabelle build.
Requires Isabelle 2024 and AFP 2024 with the
Ordinary_Differential_Equations session available.
isabelle build -d /path/to/afp-2024/thys -d . Verified_Compartmental_ModelsBuild time depends on hardware and cache state.
- Two-layer structure:
SIR_solutionrecords qualitative theorems for any differentiable solution on a finite interval.SIR_ODEconstructs the unique forward solution from positive parameters and nonnegative initial data, and instantiatesSIR_solutionon every nontrivial interval[0,b]withb > 0. - Nonnegativity derived: forward invariance is proved from nonnegative initial conditions using the integrating factor and then applied to the unique Picard–Lindelöf flow.
- The framework handles three-compartment models. Generalization to n-compartment models via finite sums is planned for future work.
- The global-existence bridge is forward in time from the initial instant
0. - Terminology: βS(a)/γ is the initial effective threshold ratio, not the
disease-free basic reproduction number βN/γ; the historical Isabelle
identifier
R_zerois retained only as a source-level name.
- Isabelle version: 2024
- ML platform: Poly/ML 5.9.1 (x86_64_32-linux)
- Session: Verified_Compartmental_Models
- External AFP session: Ordinary_Differential_Equations
- Proof holes: 0 (zero sorry/admit/oops)
- Isabelle 2024
- AFP 2024, specifically the
Ordinary_Differential_Equationssession
BSD-3-Clause