Stat.RecurrentEvent
This directory packages a finite-horizon Poisson recurrent-event experiment with independent death and censoring.
Basic 7 core · 0 supporting A generic arm, a finite Poisson sample of points with measurable event times, and independent death and censor times form a product experiment.
Finite-horizon stopped recurrent-event experiment
A generic arm, a finite Poisson sample of points with measurable event times, and independent death and censor times form a product experiment. The observed history retains only the points before the first exit or the fixed horizon. The primitive time-intensity law and cumulative-hazard survival equation are model assumptions; observable risk and event laws are derived in later files.
A nonnegative hazard and a time determine the survival probability through that time: the exponential of minus the cumulative hazard, the integral of the hazard from time zero to that time.
Definition (Lean source)
An arm space and a recurrence-mark space specify a finite-horizon Poisson recurrent-event model with independent assignment, death, and censoring blocks. The model consists of a probability law for the arm, a probability law for the recurrence marks together with a nonnegative Poisson rate, probability laws for the death and censoring times, a nonnegative horizon, a measurable map sending each mark to its event time, and measurable nonnegative hazard and intensity functions, the hazard being integrable from zero to the horizon. Two equations tie these together: the rate-scaled law of the event time has density equal to the intensity with respect to Lebesgue measure on the times from zero up to but excluding the horizon, and at every time between zero and the horizon the probability of death at or after that time equals the exponential of minus the cumulative hazard up to that time.
Definition (Lean source)
An arm space and a recurrence-mark space determine one primitive outcome, consisting of an arm, a finite recurrence sample, a death time, and a censoring time.
Definition (Lean source)
A recurrent-event model determines the independent product law of its assignment, recurrence, death, and censoring blocks.
Definition (Lean source)
A recurrent-event model and a primitive outcome determine the administrative stopping time, the earliest of death, censoring, and the fixed horizon.
A recurrent-event model and a primitive outcome determine the stopped observed history: the arm, exit time, death indicator, and recurrence times retained before exit. Missing sequence positions use a value beyond the fixed horizon.
Definition (Lean source)
A recurrent-event model determines the observed-history law by applying its stopped-observation rule to the independent primitive experiment.
DeathEventPrimitive 2 core · 1 supporting The observed death-time pushforward is reduced to the independent primitive arm, death, and censor laws before the hazard-density step. ★ death_primitive_weighted
Primitive representation of observed death events
The observed death-time pushforward is reduced to the independent primitive arm, death, and censor laws before the hazard-density step.
A recurrent-event model and an arm determine the observed armwise death-event measure, the distribution of exit times whose recorded exit is death.
A recurrent-event model and an arm have a primitive recorded-death measure equal to the open-horizon death law weighted by assignment mass and censoring retention.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
death_event_measure_primitivetheorem — A recurrent-event model and an arm have an observed death-event measure equal to the primitive death-time law restricted to assigned subjects whose death occurs before censoring and the horizon.hypothesesA :sharedType u_1X :sharedType u_2M :Model A Xa :AconclusionM.deathEventMeasure a= Measure.map (fun ω : Outcome A X => ω.2.2.1) (M.primitiveLaw.restrict {ω | ω.1 = a ∧ ω.2.2.1 ≤ ω.2.2.2 ∧ ω.2.2.1 < M.horizon})Proof (Lean source)
theorem Model.death_event_measure_primitive (M : Model A X) (a : A) : M.deathEventMeasure a = Measure.map (fun ω : Outcome A X => ω.2.2.1) (M.primitiveLaw.restrict {ω | ω.1 = a ∧ ω.2.2.1 ≤ ω.2.2.2 ∧ ω.2.2.1 < M.horizon}) := by let s : Set (A × (ℝ × (Bool × (ℕ → ℝ)))) := {y | y.1 = a ∧ y.2.2.1 = true} have hs : MeasurableSet s := by dsimp [s] measurability have hpre : M.observe ⁻¹' s = {ω : Outcome A X | ω.1 = a ∧ ω.2.2.1 ≤ ω.2.2.2 ∧ ω.2.2.1 < M.horizon} := by ext ω simp [s, Model.observe] have hmeas : Measurable (fun y : A × (ℝ × (Bool × (ℕ → ℝ))) => y.2.1) := by fun_prop have htime : Measurable (fun ω : Outcome A X => ω.2.2.1) := by fun_prop unfold Model.deathEventMeasure Model.observedLaw rw [Measure.restrict_map M.measurable_observe hs, Measure.map_map hmeas M.measurable_observe, hpre] apply Measure.map_congr apply ae_restrict_of_forall_mem (hs := by rw [← hpre] exact hs.preimage M.measurable_observe) intro ω hω have hd : ω.2.2.1 ≤ ω.2.2.2 ∧ ω.2.2.1 < M.horizon := ⟨hω.2.1, hω.2.2⟩ have hdh : ω.2.2.1 ≤ M.horizon := le_of_lt hd.2 simp [comp, Model.observe, Model.stopTime, hd, hdh]
RecurrenceEventPrimitive 3 core · 1 supporting The observed counting kernel is reduced to a finite primitive point sum, then integrated against independent stopping times and Poisson intensity. ★ recurrence_primitive_strict_tail
Primitive representation of observed recurrence events
The observed counting kernel is reduced to a finite primitive point sum, then integrated against independent stopping times and Poisson intensity.
A recurrent-event model and an arm determine the observed armwise recurrence-event measure, which counts every retained recurrence time with multiplicity.
Definition (Lean source)
A recurrent-event model, an arm, a requested time set, and a primitive outcome determine the retained primitive recurrence count in that set: the number of recurrence points whose event time lies in the set and strictly before the stopping time, with points counted by multiplicity, and zero when the outcome's arm is not the given arm.
Definition (Lean source)
A recurrent-event model, an arm, and a measurable time set have a primitive stopped recurrence count equal to Poisson intensity weighted by assignment mass and strict death and censoring retention.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
recurrence_event_measure_primitivetheorem — A recurrent-event model, an arm, and a measurable time set have observed recurrence-event mass equal to the primitive expected retained count before the observed stop.hypothesesconclusionM.recurrenceEventMeasure a s = ∫⁻ ω, M.primitiveRecurrenceCountSet a s ω ∂M.primitiveLawProof (Lean source)
theorem Model.recurrence_event_measure_primitive (M : Model A X) (a : A) (s : Set ℝ) (hs : MeasurableSet s) : M.recurrenceEventMeasure a s = ∫⁻ ω, M.primitiveRecurrenceCountSet a s ω ∂M.primitiveLaw := by classical have hcount (ω : Outcome A X) : (historyCountingKernel A (M.observe ω)) s = ∑ i : Fin ω.2.1.1, if M.time (ω.2.1.2 i) < M.stopTime ω ∧ M.time (ω.2.1.2 i) ∈ s then (1 : ℝ≥0∞) else 0 := by have hbad : ¬ M.horizon + 1 < M.stopTime ω := by have hle : M.stopTime ω ≤ M.horizon := min_le_right _ _ linarith change (Measure.sum (fun n : ℕ => if (M.observe ω).2.2.2 n < (M.observe ω).2.1 then Measure.dirac ((M.observe ω).2.2.2 n) else 0)) s = _ rw [Measure.sum_apply _ hs] rw [tsum_eq_sum (s := range ω.2.1.1)] · rw [← Fin.sum_univ_eq_sum_range] apply Finset.sum_congr rfl intro n hn have hn' : (n : ℕ) < ω.2.1.1 := n.isLt by_cases ht : M.time (ω.2.1.2 n) < M.stopTime ω · simp [Model.observe, hn', ht, Measure.dirac_apply, indicator] · simp [Model.observe, hn', ht, hbad] · intro n hn have hn' : ¬ n < ω.2.1.1 := by simpa using hn simp [Model.observe, hn', hbad] have hmeas : Measurable (fun y : A × (ℝ × (Bool × (ℕ → ℝ))) => (historyCountingKernel A y) s) := (historyCountingKernel A).measurable_coe hs have harm : MeasurableSet {y : A × (ℝ × (Bool × (ℕ → ℝ))) | y.1 = a} := (measurableSet_singleton a).preimage measurable_fst calc M.recurrenceEventMeasure a s = ∫⁻ y in {y | y.1 = a}, (historyCountingKernel A y) s ∂M.observedLaw := by unfold Model.recurrenceEventMeasure rw [Measure.bind_apply hs (historyCountingKernel A).aemeasurable] _ = ∫⁻ ω, ({y | y.1 = a}.indicator (fun y => (historyCountingKernel A y) s)) (M.observe ω) ∂M.primitiveLaw := by rw [← lintegral_indicator harm _] unfold Model.observedLaw exact lintegral_map (μ := M.primitiveLaw) (hmeas.indicator harm) M.measurable_observe _ = ∫⁻ ω, M.primitiveRecurrenceCountSet a s ω ∂M.primitiveLaw := by congr 1 funext ω change (if ω.1 = a then (historyCountingKernel A (M.observe ω)) s else 0) = M.primitiveRecurrenceCountSet a s ω by_cases ha : ω.1 = a · simp only [ha, if_true] rw [hcount ω] simp [Model.primitiveRecurrenceCountSet, ha] · simp [ha, Model.primitiveRecurrenceCountSet]
RiskSet 3 core · 0 supporting The observed risk probability and its model-side time measure factor through independent assignment, death, and censor blocks before the fixed horizon. ★ risk_factorization
Armwise observable risk sets
The observed risk probability and its model-side time measure factor through independent assignment, death, and censor blocks before the fixed horizon.
A recurrent-event model, an arm, and a time determine that arm's observable risk probability: the joint probability, under the observed-history law, that the unit is assigned to that arm and its observed exit time (the earliest of death, censoring, and the fixed horizon) is at least that time. It is a joint probability with the arm, not a probability conditional on the arm.
Definition (Lean source)
A recurrent-event model and an arm determine the armwise risk-set measure: the measure on the time axis that has, with respect to Lebesgue measure on the half-open interval from zero up to (but excluding) the fixed horizon, density equal at each time t to the arm's assignment probability times the probability that death occurs at or after t times the probability that censoring occurs at or after t.
A recurrent-event model, an arm, and a time between zero and the fixed horizon, endpoints included have an observable risk probability equal to the arm's assignment probability times the probability that death occurs at or after that time times the probability that censoring occurs at or after that time.
Formal statement
Proof (Lean source)
DeathStoppedMean 2 core · 0 supporting A finite Poisson recurrence sample is stopped strictly before independent death and the fixed horizon, without censoring. ★ death_stopped_poisson_mean
Mean recurrence count stopped by independent death
A finite Poisson recurrence sample is stopped strictly before independent death and the fixed horizon, without censoring.
A recurrent-event model determines the expected count of primitive Poisson recurrence points before independent death and the fixed horizon, without censoring.
Definition (Lean source)
A recurrent-event model has an independently death-stopped Poisson recurrence mean equal to the integral of death survival times recurrence intensity over the fixed horizon.
Formal statement
Proof (Lean source)
DeathDensity 1 core · 0 supporting Independent death and censor blocks yield the observable death-event law with hazard density relative to the armwise risk-set measure. ★ death_event_density
Observable death-event hazard density
Independent death and censor blocks yield the observable death-event law with hazard density relative to the armwise risk-set measure.
A recurrent-event model and an arm have an observable death-event measure with the death hazard as density relative to the armwise risk-set measure, including the empty zero-horizon case.
Formal statement
Proof (Lean source)
HazardDensity 1 core · 3 supporting The finite-horizon survival equation determines the death-time density on the open administrative horizon. ★ death_law_restrict_eq_withDensity
Hazard survival to death density
The finite-horizon survival equation determines the death-time density on the open administrative horizon. This is a primitive-law lemma, independent of observation and recurrence.
A recurrent-event model has a death-time law on its open finite horizon with density equal to survival times hazard relative to Lebesgue measure.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
hazardSurvival_interval_integraltheorem — A nonnegative hazard, a terminal horizon, and two ordered times with an integrable hazard over the horizon give survival-weighted hazard mass equal to the loss of survival over the interval.hypothesesh :ℝ → ℝ≥0H a b :ℝhh :IntervalIntegrable (fun t : ℝ => (h t : ℝ)) volume 0 Hha :0 ≤ ahab :a ≤ bhb :b ≤ HconclusionProof (Lean source)
theorem hazardSurvival_interval_integral (h : ℝ → ℝ≥0) (H a b : ℝ) (hh : IntervalIntegrable (fun t : ℝ => (h t : ℝ)) volume 0 H) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ H) : (∫ t in a..b, hazardSurvival h t * (h t : ℝ)) = hazardSurvival h a - hazardSurvival h b := by let G : ℝ → ℝ := fun t => ∫ u in (0 : ℝ)..t, (h u : ℝ) have h0H : 0 ≤ H := by linarith have hG : AbsolutelyContinuousOnInterval G 0 H := hh.absolutelyContinuousOnInterval_intervalIntegral (by simp [h0H]) have hsub : uIcc a b ⊆ uIcc (0 : ℝ) H := by rw [uIcc_of_le hab, uIcc_of_le h0H] exact Icc_subset_Icc ha hb have hG' : AbsolutelyContinuousOnInterval (fun t => -G t) a b := (hG.mono hsub).fun_neg obtain ⟨C, hC⟩ := hG'.exists_bound have hmap : Set.MapsTo (fun t => -G t) (uIcc a b) (Icc (-C) C) := by intro x hx have hx' := hC x hx exact mem_Icc.mpr (abs_le.mp (by simpa only [Real.norm_eq_abs] using hx')) obtain ⟨K, hK⟩ : ∃ K, LipschitzOnWith K exp (Icc (-C) C) := ((Real.contDiff_exp (n := 1)).contDiffOn).exists_lipschitzOnWith (by norm_num) (convex_Icc _ _) isCompact_Icc have hS : AbsolutelyContinuousOnInterval (hazardSurvival h) a b := by change AbsolutelyContinuousOnInterval (fun t => exp (-G t)) a b have hbound := hG'.const_mul (K : ℝ) unfold AbsolutelyContinuousOnInterval at hbound ⊢ apply squeeze_zero' ?_ ?_ (by simpa using hbound) · exact Filter.Eventually.of_forall (fun _ => Finset.sum_nonneg (fun _ _ => dist_nonneg)) · rw [eventually_inf_principal] filter_upwards with E hE apply Finset.sum_le_sum intro i hi have hi₁ := hmap (hE.1 i hi).1 have hi₂ := hmap (hE.1 i hi).2 calc _ ≤ (K : ℝ) * dist (-G (E.2 i).1) (-G (E.2 i).2) := hK.dist_le_mul _ hi₁ _ hi₂ _ = _ := by simp [Real.dist_eq, ← mul_sub, abs_mul, abs_of_nonneg K.coe_nonneg] have hderiv : ∀ᵐ x ∂volume.restrict (uIoc a b), deriv (hazardSurvival h) x = -(hazardSurvival h x * (h x : ℝ)) := by filter_upwards [ae_restrict_of_ae hh.ae_hasDerivAt_integral, ae_restrict_mem measurableSet_uIoc] with x hx hmem have hx0H : x ∈ uIcc (0 : ℝ) H := hsub (uIoc_subset_uIcc hmem) have hD : HasDerivAt G (h x : ℝ) x := by simpa only [G] using hx hx0H 0 (by simp [h0H]) have hD' : HasDerivAt (hazardSurvival h) (-(hazardSurvival h x * (h x : ℝ))) x := by convert (Real.hasDerivAt_exp (-G x)).comp x hD.neg using 1 <;> first | rfl | simp [hazardSurvival, G] exact hD'.deriv calc (∫ t in a..b, hazardSurvival h t * (h t : ℝ)) = ∫ t in a..b, -(deriv (hazardSurvival h) t) := by apply intervalIntegral.integral_congr_ae_restrict filter_upwards [hderiv] with x hx rw [hx, neg_neg] _ = hazardSurvival h a - hazardSurvival h b := by rw [intervalIntegral.integral_neg, hS.integral_deriv_eq_sub] ring -
death_law_Ico_eq_survival_subtheorem — A recurrent-event model and an ordered subinterval inside its administrative horizon give death-time mass equal to the decrease in hazard-generated survival.hypothesesA :sharedType u_1X :sharedType u_2M :Model A Xa b :ℝha :0 ≤ ahab :a ≤ bhb :b ≤ M.horizonconclusionM.deathLaw (Ico a b)Proof (Lean source)
theorem Model.death_law_Ico_eq_survival_sub (M : Model A X) (a b : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ M.horizon) : M.deathLaw (Ico a b) = ofReal (hazardSurvival M.hazard a - hazardSurvival M.hazard b) := by /- Use `Ico a b = Ici a \ Ici b`, probability finiteness, and the two instances of `death_survival`. Convert the finite ENNReal subtraction to `ofReal` of the real survival difference. The case `a = b` is empty. -/ letI := M.deathProb have hsub : Ici b ⊆ Ici a := Ici_subset_Ici.mpr hab have hdiff : Ico a b = Ici a \ Ici b := by ext x; simp rw [hdiff, measure_sdiff hsub measurableSet_Ici.nullMeasurableSet (measure_ne_top M.deathLaw (Ici b))] rw [M.death_survival a ⟨ha, le_trans hab hb⟩, M.death_survival b ⟨le_trans ha hab, hb⟩] exact (ENNReal.ofReal_sub _ (le_of_lt (Real.exp_pos _))).symm -
survival_hazard_density_Icotheorem — A recurrent-event model and an ordered subinterval inside its administrative horizon give survival-weighted hazard mass equal to the survival decrease, including empty and horizon-endpoint intervals.hypothesesA :sharedType u_1X :sharedType u_2M :Model A Xa b :ℝha :0 ≤ ahab :a ≤ bhb :b ≤ M.horizonconclusion((volume.restrict (Ico 0 M.horizon)).withDensity (fun t => ofReal (hazardSurvival M.hazard t) * (M.hazard t : ℝ≥0∞))) (Ico a b)Proof (Lean source)
theorem Model.survival_hazard_density_Ico (M : Model A X) (a b : ℝ) (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ M.horizon) : ((volume.restrict (Ico 0 M.horizon)).withDensity (fun t => ofReal (hazardSurvival M.hazard t) * (M.hazard t : ℝ≥0∞))) (Ico a b) = ofReal (hazardSurvival M.hazard a - hazardSurvival M.hazard b) := by /- Intersect nested `Ico` sets, use `withDensity_apply` and `ofReal_integral_eq_lintegral_ofReal`, and close the real integral with `hazardSurvival_interval_integral`. Establish integrability from `hazard_integrable` and bounded survival on `[0, horizon]`. -/ let f : ℝ → ℝ := fun t => hazardSurvival M.hazard t * (M.hazard t : ℝ) have hsub : Icc a b ⊆ Icc (0 : ℝ) M.horizon := Icc_subset_Icc ha hb have hG := M.hazard_integrable.absolutelyContinuousOnInterval_intervalIntegral (c := 0) (by simp [M.horizon_nonneg]) have hcont : ContinuousOn (hazardSurvival M.hazard) (Icc 0 M.horizon) := by change ContinuousOn (fun t => exp (-(∫ u in (0 : ℝ)..t, (M.hazard u : ℝ)))) _ have hc : ContinuousOn (fun t => -(∫ u in (0 : ℝ)..t, (M.hazard u : ℝ))) (Icc 0 M.horizon) := by simpa [uIcc_of_le M.horizon_nonneg] using hG.fun_neg.continuousOn simpa only [Function.comp_def] using Real.continuous_exp.continuousOn.comp hc (fun _ _ => Set.mem_univ _) have hbounds : ∀ t ∈ Icc a b, 0 ≤ hazardSurvival M.hazard t ∧ hazardSurvival M.hazard t ≤ 1 := by intro t ht have ht0 : 0 ≤ t := le_trans ha ht.1 have hnonneg : 0 ≤ ∫ u in (0 : ℝ)..t, (M.hazard u : ℝ) := intervalIntegral.integral_nonneg_of_forall ht0 (fun u => NNReal.coe_nonneg _) constructor · exact le_of_lt (Real.exp_pos _) · simpa [hazardSurvival] using Real.exp_le_one_iff.mpr (neg_nonpos.mpr hnonneg) have hh : IntervalIntegrable (fun t : ℝ => (M.hazard t : ℝ)) volume a b := M.hazard_integrable.mono_set (by rw [uIcc_of_le hab, uIcc_of_le M.horizon_nonneg] exact hsub) have hf : IntegrableOn f (Ico a b) volume := by have hfm : AEStronglyMeasurable f (volume.restrict (Ico a b)) := by apply AEStronglyMeasurable.mul · exact (hcont.mono (fun x hx => hsub ⟨hx.1, hx.2.le⟩)).aestronglyMeasurable measurableSet_Ico · exact M.measurable_hazard.coe_nnreal_real.aestronglyMeasurable have hbound : (fun t => ‖f t‖) ≤ᵐ[volume.restrict (Ico a b)] (fun t => ‖(M.hazard t : ℝ)‖) := by filter_upwards [ae_restrict_mem measurableSet_Ico] with t ht have hs := hbounds t ⟨ht.1, ht.2.le⟩ simp only [f, Real.norm_eq_abs, abs_mul, abs_of_nonneg hs.1, abs_of_nonneg (NNReal.coe_nonneg (M.hazard t))] exact mul_le_of_le_one_left (NNReal.coe_nonneg _) hs.2 exact Integrable.mono (((intervalIntegrable_iff_integrableOn_Ico_of_le hab).mp hh) : Integrable (fun t : ℝ => (M.hazard t : ℝ)) (volume.restrict (Ico a b))) hfm hbound have hmeas : Ico a b ⊆ Ico 0 M.horizon := by intro t ht exact ⟨le_trans ha ht.1, lt_of_lt_of_le ht.2 hb⟩ rw [withDensity_apply _ measurableSet_Ico] change (∫⁻ t, ofReal (hazardSurvival M.hazard t) * (M.hazard t : ℝ≥0∞) ∂((volume.restrict (Ico 0 M.horizon)).restrict (Ico a b))) = _ rw [Measure.restrict_restrict_of_subset hmeas] have hnn : 0 ≤ᵐ[volume.restrict (Ico a b)] f := by filter_upwards [] with t exact mul_nonneg (le_of_lt (Real.exp_pos _)) (NNReal.coe_nonneg _) have heq : ∀ t, ofReal (f t) = ofReal (hazardSurvival M.hazard t) * (M.hazard t : ℝ≥0∞) := by intro t change ofReal (hazardSurvival M.hazard t * (M.hazard t : ℝ)) = _ have hp : 0 ≤ hazardSurvival M.hazard t := by unfold hazardSurvival positivity rw [ENNReal.ofReal_mul hp] simp simp_rw [← heq] rw [← ofReal_integral_eq_lintegral_ofReal hf hnn] rw [integral_Ico_eq_integral_Ioc, ← intervalIntegral.integral_of_le hab] exact congrArg ofReal (hazardSurvival_interval_integral M.hazard M.horizon a b M.hazard_integrable ha hab hb)
Identification 1 core · 0 supporting Equal observed stopped-history laws identify hazard and recurrence intensity almost everywhere where the common observable risk set is positive. ★ identify_densities
Identification of recurrent-event intensities
Equal observed stopped-history laws identify hazard and recurrence intensity almost everywhere where the common observable risk set is positive.
Two recurrent-event models, an arm, and a sub-horizon time with equal stopped-history laws, positive assignment mass in the first model, and positive censoring retention of the first model throughout that interval have equal death hazards and recurrence intensities Lebesgue-almost everywhere on the interval.
Formal statement
Proof (Lean source)
Laws 1 core · 2 supporting In the finite-horizon Poisson recurrent-event model with independent treatment assignment, death and censoring, the observable death events and recurrence events of an arm have, relative to the armwise risk-set measure ( ★ death_stopped_mean_zero_horizon
Recurrent events with a terminal event: observable laws on a finite horizon
In the finite-horizon Poisson recurrent-event model with independent treatment assignment, death and censoring, the observable death events and recurrence events of an arm have, relative to the armwise risk-set measure (assignment probability × death survival × censoring survival, on times before the horizon), densities equal to the death hazard and the recurrence intensity. The mean number of recurrences before independent death equals the integral over the horizon of death survival times recurrence intensity, and two models with the same law of the observed stopped history have the same hazard and intensity almost everywhere where the risk set is positive. Those results are proved in the imported modules; this file adds their degenerate case of a zero horizon.
Main results
* Model.death_event_zero_horizon, Model.recurrence_event_zero_horizon — with horizon zero the
observable death-event and recurrence-event measures vanish.
* Model.death_stopped_mean_zero_horizon — with horizon zero the death-stopped mean recurrence
count is zero.
Imported: Model.death_event_density, Model.recurrence_event_density,
Model.death_stopped_poisson_mean (DeathStoppedMean) and Model.identify_densities
(Identification).
A recurrent-event model with a zero administrative horizon has an independently death-stopped Poisson recurrence mean of zero.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
death_event_zero_horizontheorem — A recurrent-event model, an arm, and a zero administrative horizon have no observable death event before exit.hypothesesA :sharedType u_1X :sharedType u_2M :Model A Xa :AhH :M.horizon = 0conclusionM.deathEventMeasure a = 0Proof (Lean source)
theorem Model.death_event_zero_horizon (M : Model A X) (a : A) (hH : M.horizon = 0) : M.deathEventMeasure a = 0 := by rw [M.death_event_density] simp [Model.riskSetMeasure, hH] -
recurrence_event_zero_horizontheorem — A recurrent-event model, an arm, and a zero administrative horizon have no observable recurrence event before exit.hypothesesA :sharedType u_1X :sharedType u_2M :Model A Xa :AhH :M.horizon = 0conclusionM.recurrenceEventMeasure a = 0Proof (Lean source)
theorem Model.recurrence_event_zero_horizon (M : Model A X) (a : A) (hH : M.horizon = 0) : M.recurrenceEventMeasure a = 0 := by rw [M.recurrence_event_density] simp [Model.riskSetMeasure, hH]
Observation 2 core · 0 supporting The stopped observation of a finite recurrence sample is a measurable function into an arm, exit, death flag, and countable time sequence. ★ measurable_observe
Measurability of finite stopped histories
The stopped observation of a finite recurrence sample is a measurable function into an arm, exit, death flag, and countable time sequence.
A recurrent-event model has a measurable finite-horizon stopped-observation map.
Formal statement
Proof (Lean source)
An arm space determines the stopped-history counting kernel, which places one unit of mass at every retained recurrence time and preserves ties with their multiplicities.
Definition (Lean source)
PoissonCampbell 1 core · 2 supporting The expectation of a nonnegative sum over a finite Poisson sample is the integral against its primitive intensity measure. ★ finitePoissonSample_lintegral_sum
Finite Poisson sum formula
The expectation of a nonnegative sum over a finite Poisson sample is the integral against its primitive intensity measure. This is the independent count-and-stream calculation used by the stopped-event identities.
An observation law, a nonnegative Poisson rate, and a measurable nonnegative score give an expected finite-sample sum equal to its integral against the rate-scaled observation law.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
poisson_time_lintegraltheorem — A recurrent-event model and a measurable nonnegative time score give a Poisson event-time sum whose mean is the integral against the model's time intensity.hypothesesconclusion(letI := M.pointProb ∫⁻ s, ∑ i : Fin s.1, f (M.time (s.2 i)) ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw M.pointLaw M.poissonRate)= ∫⁻ t in Ico (0 : ℝ) M.horizon, f t * (M.intensity t : ℝ≥0∞) ∂volumeProof (Lean source)
theorem Model.poisson_time_lintegral (M : Model A X) (f : ℝ → ℝ≥0∞) (hf : Measurable f) : (letI := M.pointProb ∫⁻ s, ∑ i : Fin s.1, f (M.time (s.2 i)) ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw M.pointLaw M.poissonRate) = ∫⁻ t in Ico (0 : ℝ) M.horizon, f t * (M.intensity t : ℝ≥0∞) ∂volume := by letI := M.pointProb calc (∫⁻ s, ∑ i : Fin s.1, f (M.time (s.2 i)) ∂finitePoissonSampleLaw M.pointLaw M.poissonRate) = ∫⁻ x, (f ∘ M.time) x ∂((M.poissonRate : ℝ≥0∞) • M.pointLaw) := finitePoissonSample_lintegral_sum M.pointLaw M.poissonRate (f ∘ M.time) (hf.comp M.measurable_time) _ = ∫⁻ t, f t ∂Measure.map M.time ((M.poissonRate : ℝ≥0∞) • M.pointLaw) := (lintegral_map hf M.measurable_time).symm _ = ∫⁻ t in Ico (0 : ℝ) M.horizon, f t * (M.intensity t : ℝ≥0∞) ∂volume := by rw [M.primitive_intensity, lintegral_withDensity_eq_lintegral_mul _ M.measurable_intensity.coe_nnreal_ennreal hf] congr 1 funext t exact mul_comm _ _ -
poisson_count_before_deaththeorem — A recurrent-event model and a fixed death time give a mean primitive recurrence count equal to intensity integrated before that death time and the fixed horizon.hypothesesX :sharedType u_1A :sharedType u_2M :Model A Xd :ℝconclusion(letI := M.pointProb ∫⁻ s, ∑ i : Fin s.1, if M.time (s.2 i) < d ∧ M.time (s.2 i) < M.horizon then (1 : ℝ≥0∞) else 0 ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw M.pointLaw M.poissonRate)= ∫⁻ t in Ico (0 : ℝ) M.horizon, if t < d then (M.intensity t : ℝ≥0∞) else 0 ∂volumeProof (Lean source)
theorem Model.poisson_count_before_death (M : Model A X) (d : ℝ) : (letI := M.pointProb ∫⁻ s, ∑ i : Fin s.1, if M.time (s.2 i) < d ∧ M.time (s.2 i) < M.horizon then (1 : ℝ≥0∞) else 0 ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw M.pointLaw M.poissonRate) = ∫⁻ t in Ico (0 : ℝ) M.horizon, if t < d then (M.intensity t : ℝ≥0∞) else 0 ∂volume := by letI := M.pointProb /- Apply `M.poisson_time_lintegral` to the measurable indicator `fun t => if t < d ∧ t < M.horizon then 1 else 0`. On `Ico 0 M.horizon`, the second inequality is automatic; simplify the indicator and use `lintegral_congr` for the resulting pointwise equality. Keep the strict death inequality: an atom of the independent death law is removed only after averaging, not in this fixed-death identity. -/ have hf : Measurable (fun t : ℝ => if t < d ∧ t < M.horizon then (1 : ℝ≥0∞) else 0) := by exact Measurable.ite (measurableSet_Iio.inter measurableSet_Iio) measurable_const measurable_const calc (∫⁻ s, ∑ i : Fin s.1, if M.time (s.2 i) < d ∧ M.time (s.2 i) < M.horizon then (1 : ℝ≥0∞) else 0 ∂finitePoissonSampleLaw M.pointLaw M.poissonRate) = ∫⁻ t in Ico (0 : ℝ) M.horizon, (if t < d ∧ t < M.horizon then (1 : ℝ≥0∞) else 0) * (M.intensity t : ℝ≥0∞) ∂volume := M.poisson_time_lintegral _ hf _ = ∫⁻ t in Ico (0 : ℝ) M.horizon, if t < d then (M.intensity t : ℝ≥0∞) else 0 ∂volume := by apply setLIntegral_congr_fun measurableSet_Ico intro t ht have hth : t < M.horizon := ht.2 by_cases htd : t < d <;> simp [htd, hth]
RecurrenceDensity 1 core · 0 supporting A finite Poisson recurrence sample stopped at independent death and censor times has observable event intensity relative to the armwise risk set. ★ recurrence_event_density
Observable recurrence-event intensity density
A finite Poisson recurrence sample stopped at independent death and censor times has observable event intensity relative to the armwise risk set.
A recurrent-event model and an arm have an observable recurrence-event measure with primitive Poisson intensity as density relative to the armwise risk-set measure.
Formal statement
Proof (Lean source)
TailRetention 1 core · 0 supporting A finite real-time law has only countably many atoms. ★ ae_measure_Ioi_eq_Ici
Strict and weak retention for finite exit laws
A finite real-time law has only countably many atoms. Therefore its strict and weak tail probabilities agree at Lebesgue-almost every time. This is the endpoint conversion used for strict stopping of recurrence points.
A finite exit-time law has equal strict and weak retention probabilities at Lebesgue-almost every time, including when the law has atoms.