Stat.MEstimation

M- and Z-estimation: consistency, asymptotic normality, and influence-function representations.

Finite­Poisson 4 core · 6 supporting This module defines a finite Poisson criterion composed with a linear design and proves its continuity, existence and uniqueness of the pseudo-true maximizer, and the equivalence between global optimality and vanishing d ★ finitePoissonObjective_exists_unique_max

Finite positive-mean Poisson projections

This module defines a finite Poisson criterion composed with a linear design and proves its continuity, existence and uniqueness of the pseudo-true maximizer, and the equivalence between global optimality and vanishing directional scores.

def IsUniqueGlobalMax reviewed
Causalean.Stat

A point is the unique global maximizer of a real-valued criterion.

Definition (Lean source)
def IsUniqueGlobalMax {A : Type*} (f : A → ℝ) (x : A) : Prop := (∀ y, f y ≤ f x) ∧ ∀ y, f y = f x → y = x
Causalean.Stat.IsUniqueGlobalMax · Causalean/Stat/MEstimation/FinitePoisson.lean:26
def maximizerOrZero reviewed
Causalean.Stat

A total choice of a global maximizer, defaulting to zero when none exists.

Definition (Lean source)
noncomputable def maximizerOrZero {A : Type*} [Zero A] (f : A → ℝ) : A := by classical exact if h : ∃ x, ∀ y, f y ≤ f x then choose h else 0
Causalean.Stat.maximizerOrZero · Causalean/Stat/MEstimation/FinitePoisson.lean:30
def finitePoissonObjective reviewed
Causalean.Stat

A finite positive-mean Poisson criterion composed with a linear design.

Definition (Lean source)
noncomputable def finitePoissonObjective {E I : Type*} [AddCommGroup E] [Module ℝ E] [Fintype I] (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (x : E) : ℝ := ∑ i, q i * (m i * A x i - exp (A x i))
Causalean.Stat.finitePoissonObjective · Causalean/Stat/MEstimation/FinitePoisson.lean:77
lemma finitePoissonObjective_exists_unique_max reviewed
Causalean.Stat

Existence and uniqueness of the finite Poisson pseudo-true parameter. If every cell weight is strictly positive, every cell mean is strictly positive, and the linear design map is injective, then the finite Poisson criterion attains its supremum over the parameter space at a unique point.

Formal statement
E I :
q m :
I → ℝ
A :
E →ₗ[ℝ] (I → ℝ)
hq :
∀ i, 0 < q i
hm :
∀ i, 0 < m i
hA :
∃! x : E, ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A x
Proof (Lean source)
lemma finitePoissonObjective_exists_unique_max {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype I] [Nonempty I] (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (hq : ∀ i, 0 < q i) (hm : ∀ i, 0 < m i) (hA : Injective A) : ∃! x : E, ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A x := by classical let B : E →ₗ[ℝ] (I → ℝ) := { toFun := fun x i => q i * min (m i) 1 * A x i map_add' := by intro x y funext i simp only [map_add, Pi.add_apply] ring map_smul' := by intro c x funext i simp only [map_smul, RingHom.id_apply, Pi.smul_apply, smul_eq_mul] ring } have hB : Injective B := by intro x y hxy apply hA funext i have hi := congrFun hxy i have hqi : q i ≠ 0 := ne_of_gt (hq i) have hci : min (m i) 1 ≠ 0 := ne_of_gt (lt_min (hm i) zero_lt_one) dsimp [B] at hi have hprod : 0 < q i * min (m i) 1 := mul_pos (hq i) (lt_min (hm i) zero_lt_one) nlinarith obtain ⟨K, hK, hanti⟩ := (LinearMap.injective_iff_antilipschitz B).mp hB let kappa : ℝ := K⁻¹ have hkappa : 0 < kappa := inv_pos.mpr hK have hBnorm (x : E) : kappa * ‖x‖ ≤ ‖B x‖ := by have h := hanti x 0 have hh := ENNReal.toReal_mono (by finiteness) h have h' : ‖x‖ ≤ (K : ℝ) * ‖B x‖ := by simpa [edist_dist, dist_eq_norm, ENNReal.toReal_mul] using hh change (K : ℝ)⁻¹ * ‖x‖ ≤ ‖B x‖ calc (K : ℝ)⁻¹ * ‖x‖ ≤ (K : ℝ)⁻¹ * ((K : ℝ) * ‖B x‖) := mul_le_mul_of_nonneg_left h' (inv_nonneg.mpr hK.le) _ = ((K : ℝ)⁻¹ * (K : ℝ)) * ‖B x‖ := by ring _ = ‖B x‖ := by rw [inv_mul_cancel₀ (show (K : ℝ) ≠ 0 by exact_mod_cast ne_of_gt hK)] simp let R : ℝ := max 0 (((∑ i, q i * ((m i + 1) ^ 2 / 2)) - finitePoissonObjective q m A 0) / kappa + 1) have hR0 : 0 ≤ R := by dsimp [R] exact le_max_left _ _ have hbound (x : E) : finitePoissonObjective q m A x ≤ (∑ i, q i * ((m i + 1) ^ 2 / 2)) - ‖B x‖ := by have hterm : ∀ i, q i * (m i * A x i - exp (A x i)) ≤ q i * ((m i + 1) ^ 2 / 2) - |B x i| := by intro i have hc := poissonCell_linear_coercive_bound (m i) (A x i) (hm i) have hqi := (hq i).le have habs : |B x i| = q i * min (m i) 1 * |A x i| := by dsimp [B] rw [abs_mul, abs_mul, abs_of_pos (hq i), abs_of_pos (lt_min (hm i) zero_lt_one)] rw [habs] nlinarith [mul_le_mul_of_nonneg_left hc hqi] calc finitePoissonObjective q m A x ≤ ∑ i, (q i * ((m i + 1) ^ 2 / 2) - |B x i|) := Finset.sum_le_sum fun i _ => hterm i _ = (∑ i, q i * ((m i + 1) ^ 2 / 2)) - ∑ i, |B x i| := by rw [Finset.sum_sub_distrib] _ ≤ (∑ i, q i * ((m i + 1) ^ 2 / 2)) - ‖B x‖ := by gcongr rw [Pi.norm_def] have hnn : (Finset.univ.sup fun b => ‖B x b‖₊) ≤ ∑ i, ‖B x i‖₊ := Finset.sup_le (fun i _ => Finset.single_le_sum (f := fun k => ‖B x k‖₊) (fun _ _ => zero_le) (Finset.mem_univ i)) have hr := NNReal.coe_le_coe.mpr hnn simpa only [NNReal.coe_sum, coe_nnnorm, Real.norm_eq_abs] using hr let ball : Set E := closedBall 0 R have : ProperSpace E := proper_real E obtain ⟨xstar, hxball, hxmax⟩ := (ProperSpace.isCompact_closedBall (0 : E) R).exists_isMaxOn ⟨0, by simp [Metric.mem_closedBall, hR0]⟩ (finitePoissonObjective_continuous q m A).continuousOn have hxglobal : ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A xstar := by intro y by_cases hy : y ∈ ball · exact hxmax hy · have hyR : R < ‖y‖ := by simpa [ball, Metric.mem_closedBall, dist_eq_norm, not_le] using hy have hcoarse := hbound y have hanti' := hBnorm y have hRlower : ((∑ i, q i * ((m i + 1) ^ 2 / 2)) - finitePoissonObjective q m A 0) / kappa + 1 ≤ R := le_max_right _ _ have hzero_mem : (0 : E) ∈ ball := by simp [ball, Metric.mem_closedBall, hR0] have hxzero := hxmax hzero_mem have hKne : kappa ≠ 0 := ne_of_gt hkappa have htail : (∑ i, q i * ((m i + 1) ^ 2 / 2)) - kappa * ‖y‖ < finitePoissonObjective q m A 0 := by apply (sub_lt_iff_lt_add).2 have := lt_of_le_of_lt hRlower hyR field_simp [hKne] at this ⊢ nlinarith exact (hcoarse.trans (sub_le_sub_left hanti' _)).trans (htail.le.trans hxzero) refine ⟨xstar, hxglobal, ?_⟩ intro y hymax by_contra hyne have hAy : A y ≠ A xstar := fun h => hyne (hA h) obtain ⟨i, hi⟩ : ∃ i, A y i ≠ A xstar i := by simpa only [Function.ne_iff] using hAy let mid : E := (1 / 2 : ℝ) • y + (1 / 2 : ℝ) • xstar have hstrictTerm : (q i * (m i * A y i - exp (A y i)) + q i * (m i * A xstar i - exp (A xstar i))) / 2 < q i * (m i * A mid i - exp (A mid i)) := by have hcell := poissonCell_strictConcave_midpoint (q i) (m i) (A y i) (A xstar i) (hq i) hi dsimp [mid] simp only [map_add, map_smul, Pi.add_apply, Pi.smul_apply, smul_eq_mul] have harg : (1 / 2 : ℝ) * A y i + (1 / 2 : ℝ) * A xstar i = (A y i + A xstar i) / 2 := by ring rw [harg] exact hcell have hmid : (finitePoissonObjective q m A y + finitePoissonObjective q m A xstar) / 2 < finitePoissonObjective q m A mid := by unfold finitePoissonObjective rw [← Finset.sum_add_distrib] simp_rw [div_eq_mul_inv] rw [Finset.sum_mul] apply Finset.sum_lt_sum · intro j hj by_cases hji : j = i · subst j exact (hstrictTerm.le) · have hconv := convexOn_exp.2 (Set.mem_univ (A y j)) (Set.mem_univ (A xstar j)) (show 0 ≤ (1 / 2 : ℝ) by norm_num) (show 0 ≤ (1 / 2 : ℝ) by norm_num) (by norm_num) simp only [smul_eq_mul] at hconv have hqconv := mul_le_mul_of_nonneg_left hconv (hq j).le dsimp [mid] simp only [map_add, map_smul, Pi.add_apply, Pi.smul_apply, smul_eq_mul] nlinarith · exact ⟨i, Finset.mem_univ i, hstrictTerm⟩ have hy_eq : finitePoissonObjective q m A y = finitePoissonObjective q m A xstar := by apply le_antisymm (hxglobal y) exact hymax xstar rw [hy_eq] at hmid have hmid' : finitePoissonObjective q m A xstar < finitePoissonObjective q m A mid := by simpa using hmid exact (not_lt_of_ge (hxglobal mid)) hmid'
Causalean.Stat.finitePoissonObjective_exists_unique_max · Causalean/Stat/MEstimation/FinitePoisson.lean:92 · uses finitePoissonObjective
6 supporting declarations (lemmas, instances)
  • poissonCell_linear_coercive_bound lemma — A positive-mean Poisson cell log likelihood is bounded above by a linearly coercive function. This is the elementary tail estimate used in the finite Poisson maximizer existence argument.
    m x :
    hm :
    0 < m
    m * x - exp x ≤ (m + 1) ^ 2 / 2 - min m 1 * |x|
    Proof (Lean source)
    lemma poissonCell_linear_coercive_bound (m x : ℝ) (hm : 0 < m) : m * x - exp x ≤ (m + 1) ^ 2 / 2 - min m 1 * |x| := by have hc0 : 0 < min m 1 := lt_min hm zero_lt_one by_cases hx : x ≤ 0 · rw [abs_of_nonpos hx] have he : 0 ≤ exp x := (Real.exp_pos x).le have hc : min m 1 ≤ m := min_le_left _ _ have hK : 0 ≤ (m + 1) ^ 2 / 2 := div_nonneg (sq_nonneg _) (by norm_num) nlinarith · have hx0 : 0 ≤ x := le_of_not_ge hx have he := Real.pow_div_factorial_le_exp x hx0 2 norm_num [factorial] at he have hc : min m 1 ≤ 1 := min_le_right _ _ have hs : 0 ≤ (x - (m + 1)) ^ 2 := sq_nonneg _ rw [abs_of_nonneg hx0] nlinarith
    Causalean.Stat.poissonCell_linear_coercive_bound · Causalean/Stat/MEstimation/FinitePoisson.lean:37
  • poissonCell_strictConcave_midpoint lemma — Strict midpoint concavity of a positive-weight Poisson cell whenever the two linear predictors differ.
    q m x y :
    hq :
    0 < q
    hxy :
    x ≠ y
    (q * (m * x - exp x) + q * (m * y - exp y)) / 2 < q * (m * ((x + y) / 2) - exp ((x + y) / 2))
    Proof (Lean source)
    lemma poissonCell_strictConcave_midpoint (q m x y : ℝ) (hq : 0 < q) (hxy : x ≠ y) : (q * (m * x - exp x) + q * (m * y - exp y)) / 2 < q * (m * ((x + y) / 2) - exp ((x + y) / 2)) := by have hconv := strictConvexOn_exp.2 (Set.mem_univ x) (Set.mem_univ y) hxy (show 0 < (1 / 2 : ℝ) by norm_num) (show 0 < (1 / 2 : ℝ) by norm_num) (by norm_num : (1 / 2 : ℝ) + 1 / 2 = 1) simp only [smul_eq_mul] at hconv have := mul_lt_mul_of_pos_left hconv hq have harg : (1 / 2 : ℝ) * x + (1 / 2 : ℝ) * y = (x + y) / 2 := by ring rw [harg] at this calc _ = q * (m * ((x + y) / 2) - (exp x + exp y) / 2) := by ring _ < q * (m * ((x + y) / 2) - exp ((x + y) / 2)) := by nlinarith
    Causalean.Stat.poissonCell_strictConcave_midpoint · Causalean/Stat/MEstimation/FinitePoisson.lean:58
  • finitePoissonObjective_continuous lemma — The finite Poisson criterion is continuous in its parameter whenever the linear design acts on a finite-dimensional normed space.
    q m :
    I → ℝ
    A :
    E →ₗ[ℝ] (I → ℝ)
    Proof (Lean source)
    lemma finitePoissonObjective_continuous {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype I] (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) : Continuous (finitePoissonObjective q m A) := by unfold finitePoissonObjective fun_prop
    Causalean.Stat.finitePoissonObjective_continuous · Causalean/Stat/MEstimation/FinitePoisson.lean:83
  • finitePoissonObjective_score lemma — Every directional score vanishes at a global maximizer.
    q m :
    I → ℝ
    A :
    E →ₗ[ℝ] (I → ℝ)
    x d :
    E
    hx :
    ∑ i, q i * A d i * (m i - exp (A x i)) = 0
    Proof (Lean source)
    lemma finitePoissonObjective_score {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Fintype I] (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (x d : E) (hx : ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A x) : ∑ i, q i * A d i * (m i - exp (A x i)) = 0 := by let path : ℝ → E := fun s => x + s • d have heta (i : I) : HasDerivAt (fun s => A (path s) i) (A d i) 0 := by have hfun : (fun s : ℝ => A (path s) i) = fun s : ℝ => A x i + s * A d i := by funext s simp [path, map_add, map_smul, smul_eq_mul] rw [hfun] have h : HasDerivAt (fun s : ℝ => A x i + s * A d i) (0 + 1 * A d i) 0 := (hasDerivAt_const (𝕜 := ℝ) 0 (A x i)).fun_add ((hasDerivAt_id (𝕜 := ℝ) 0).mul_const (A d i)) simpa using h have hderiv : HasDerivAt (fun s => finitePoissonObjective q m A (path s)) (∑ i, q i * A d i * (m i - exp (A x i))) 0 := by have hraw : HasDerivAt (fun s : ℝ => ∑ i, q i * (m i * A (path s) i - exp (A (path s) i))) (∑ i, q i * (m i * A d i - exp (A (path 0) i) * A d i)) 0 := HasDerivAt.fun_sum (u := univ) (fun i _ => (((heta i).const_mul (m i)).sub (heta i).exp).const_mul (q i)) have hpath0 : path 0 = x := by simp [path] have hval : (∑ i, q i * (m i * A d i - exp (A (path 0) i) * A d i)) = ∑ i, q i * A d i * (m i - exp (A x i)) := by rw [hpath0] exact Finset.sum_congr rfl fun i _ => by ring have hfe : (fun s : ℝ => finitePoissonObjective q m A (path s)) = fun s : ℝ => ∑ i, q i * (m i * A (path s) i - exp (A (path s) i)) := rfl rw [hfe, ← hval] exact hraw have hlocal : IsLocalMax (fun s => finitePoissonObjective q m A (path s)) 0 := Filter.Eventually.of_forall fun s => by simpa [path] using hx (path s) exact hlocal.hasDerivAt_eq_zero hderiv
    Causalean.Stat.finitePoissonObjective_score · Causalean/Stat/MEstimation/FinitePoisson.lean:257
  • finitePoissonObjective_isMax_of_score lemma — For a nonnegative weighted Poisson objective, vanishing of every directional score is sufficient for global maximality.
    E I :
    q m :
    I → ℝ
    A :
    E →ₗ[ℝ] (I → ℝ)
    x :
    E
    hq :
    ∀ i, 0 ≤ q i
    hscore :
    ∀ d : E, ∑ i, q i * A d i * (m i - exp (A x i)) = 0
    Proof (Lean source)
    lemma finitePoissonObjective_isMax_of_score {E I : Type*} [AddCommGroup E] [Module ℝ E] [Fintype I] (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (x : E) (hq : ∀ i, 0 ≤ q i) (hscore : ∀ d : E, ∑ i, q i * A d i * (m i - exp (A x i)) = 0) : ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A x := by intro y have hterm (i : I) : q i * (m i * A y i - exp (A y i)) - q i * (m i * A x i - exp (A x i)) ≤ q i * A (y - x) i * (m i - exp (A x i)) := by have he : 1 + (A y i - A x i) ≤ exp (A y i - A x i) := by simpa [add_comm] using Real.add_one_le_exp (A y i - A x i) have hexp : exp (A x i) * (1 + (A y i - A x i)) ≤ exp (A y i) := by calc exp (A x i) * (1 + (A y i - A x i)) ≤ exp (A x i) * exp (A y i - A x i) := mul_le_mul_of_nonneg_left he (Real.exp_pos _).le _ = exp (A y i) := by rw [← Real.exp_add] congr 1 ring have hqexp := mul_le_mul_of_nonneg_left hexp (hq i) simp only [map_sub, Pi.sub_apply] nlinarith unfold finitePoissonObjective have hsum := Finset.sum_le_sum fun i (_ : i ∈ univ) => hterm i rw [hscore (y - x), Finset.sum_sub_distrib] at hsum linarith
    Causalean.Stat.finitePoissonObjective_isMax_of_score · Causalean/Stat/MEstimation/FinitePoisson.lean:294
  • uniqueGlobalMax_maximizerOrZero lemma — A criterion with a unique global maximum is maximized uniquely by its total maximizer selector.
    E :
    Type*
    f :
    E → ℝ
    h :
    ∃! x : E, ∀ y, f y ≤ f x
    Proof (Lean source)
    lemma uniqueGlobalMax_maximizerOrZero {E : Type*} [Zero E] (f : E → ℝ) (h : ∃! x : E, ∀ y, f y ≤ f x) : IsUniqueGlobalMax f (maximizerOrZero f) := by obtain ⟨x, hx, huniq⟩ := h have hex : ∃ z, ∀ y, f y ≤ f z := ⟨x, hx⟩ have hsel : maximizerOrZero f = x := by rw [maximizerOrZero, dif_pos hex] exact huniq _ (Classical.choose_spec hex) rw [hsel] exact ⟨hx, fun y hy => huniq y (fun z => (hx z).trans_eq hy.symm)⟩
    Causalean.Stat.uniqueGlobalMax_maximizerOrZero · Causalean/Stat/MEstimation/FinitePoisson.lean:326
ZEstimator 1 core · 0 supporting This module records the public regularity bundle ZEstimatorRegularity for parametric Z-estimator and M-estimator central limit theorems. ★ ZEstimatorRegularity

Z-estimator regularity

This module records the public regularity bundle ZEstimatorRegularity for parametric Z-estimator and M-estimator central limit theorems. The structure collects population identification, derivative invertibility, finite variance, measurability, local integrability, continuity of the population Jacobian, and an integrable L2 score envelope used by the empirical-expansion and asymptotic-linearity layers.

structure ZEstimatorRegularity reviewed
Causalean.Stat

Regularity conditions for the Z-estimator central limit theorem. Bundles, for a score function and target parameter θ₀ under a sampling law, the population identification condition that the score vanishes in mean at the truth, a Jacobian of the population score at θ₀ together with a witnessed inverse, finite variance of the score at the truth, measurability of the score at every parameter value, continuity of the population score map at θ₀, local integrability of the score on a neighborhood of θ₀, and an integrable envelope bounding local score differences.

Definition (Lean source)
ψ :
E → X → E
θ₀ :
E
P :
identification :
∫ z, ψ θ₀ z ∂P = 0
J₀ :
E →L[ℝ] E
J₀_inv :
E →L[ℝ] E
J₀_inverse :
J₀.comp J₀_inv = id ℝ E
J₀_spec :
HasFDerivAt (fun θ => ∫ z, ψ θ z ∂P) J₀ θ₀
finite_var :
Integrable (fun z => ‖ψ θ₀ z‖^2) P
psi_meas :
∀ θ, Measurable (ψ θ)
`θ ↦ ∫ ψ(z;θ) dP` is continuous at `θ₀`. Follows from `J₀_spec` but stated explicitly so downstream proofs can quote it directly.
jacobian_continuity :
ContinuousAt (fun θ : E => ∫ z, ψ θ z ∂P) θ₀
`ψ(·;θ)` is `P`-integrable on a neighborhood of `θ₀`.
psi_int_neighborhood :
∃ δ : ℝ
if
0 < δ ∧ ∀ θ : E, ‖θ - θ₀‖ < δ
then
Integrable (ψ θ) P
**Integrable almost-everywhere envelope** for the local score differences. Near the target parameter, outside one `P`-null observation set, every local score change is bounded by the parameter displacement times a nonnegative measurable envelope whose square is integrable under the sampling law. This is an `L²` envelope form of the usual local square-integrable smoothness condition in van der Vaart (1998), §5.6, and Newey--McFadden style Z-estimation arguments. The null set is uniform over nearby parameters, which is enough to transfer the bound to random sample-dependent estimators after pulling the a.e. statement through each IID coordinate. Used to close `score_diff_L2_isLittleOp_sqrt` in `EmpiricalExpansion.lean`.
score_envelope :
∃ δ : ℝ
if
0 < δ ∧ ∃ F : X
and
ℝ, Measurable F ∧
(∀ z, 0 ≤ F z) ∧
Integrable (fun z => F z ^ 2) P ∧
∀ᵐ z ∂P, ∀ θ : E, ‖θ - θ₀‖ < δ
then
‖ψ θ z - ψ θ₀ z‖ ≤ ‖θ - θ₀‖ * F z
Causalean.Stat.ZEstimatorRegularity · Causalean/Stat/MEstimation/ZEstimator.lean:45
Argmax­Stability 1 core · 0 supporting This module proves convergence of exact maximizers from uniform convergence on an eventually common compact set and uniqueness of the limiting maximizer. ★ tendsto_argmax_of_eventually_mem_compact

Deterministic argmax stability

This module proves convergence of exact maximizers from uniform convergence on an eventually common compact set and uniqueness of the limiting maximizer.

lemma tendsto_argmax_of_eventually_mem_compact reviewed
Causalean.Stat

Deterministic argmax stability. Let criterion : ℕ → E → ℝ be a sequence of objective functions with pointwise limit limitCriterion, over a compact set K. Suppose the limiting maximizer limitArgmax lies in K, limitCriterion is continuous on K, limitArgmax maximizes limitCriterion over K, and it is the unique maximizer over K, up to equal criterion values. If criterion converges to limitCriterion uniformly on K, each argmax N eventually lies in K, and argmax N eventually maximizes criterion N over K, then the sequence argmax converges to limitArgmax.

Formal statement
criterion :
ℕ → E → ℝ
limitCriterion :
E → ℝ
argmax :
ℕ → E
limitArgmax :
E
K :
Set E
hK :
hLimitMem :
limitArgmax ∈ K
hLimitContinuous :
ContinuousOn limitCriterion K
hLimitMax :
∀ y ∈ K, limitCriterion y ≤ limitCriterion limitArgmax
hUniform :
TendstoUniformlyOn criterion limitCriterion atTop K
hArgmaxMem :
∀ᶠ N in atTop, argmax N ∈ K
hArgmax :
∀ᶠ N in atTop, ∀ y ∈ K, criterion N y ≤ criterion N (argmax N)
hUnique :
∀ y ∈ K
if
limitCriterion y = limitCriterion limitArgmax
then
y = limitArgmax
Tendsto argmax atTop (nhds limitArgmax)
Proof (Lean source)
lemma tendsto_argmax_of_eventually_mem_compact {E : Type*} [PseudoMetricSpace E] [SecondCountableTopology E] (criterion : ℕ → E → ℝ) (limitCriterion : E → ℝ) (argmax : ℕ → E) (limitArgmax : E) (K : Set E) (hK : IsCompact K) (hLimitMem : limitArgmax ∈ K) (hLimitContinuous : ContinuousOn limitCriterion K) (hLimitMax : ∀ y ∈ K, limitCriterion y ≤ limitCriterion limitArgmax) (hUniform : TendstoUniformlyOn criterion limitCriterion atTop K) (hArgmaxMem : ∀ᶠ N in atTop, argmax N ∈ K) (hArgmax : ∀ᶠ N in atTop, ∀ y ∈ K, criterion N y ≤ criterion N (argmax N)) (hUnique : ∀ y ∈ K, limitCriterion y = limitCriterion limitArgmax → y = limitArgmax) : Tendsto argmax atTop (nhds limitArgmax) := by rw [Metric.tendsto_atTop] intro ε hε let S : Set E := K ∩ {y | ε ≤ dist y limitArgmax} have hScompact : IsCompact S := by apply hK.inter_right exact isClosed_le continuous_const (continuous_id.dist continuous_const) by_cases hSne : S.Nonempty · obtain ⟨z, hzS, hzmax⟩ := hScompact.exists_isMaxOn hSne (hLimitContinuous.mono inter_subset_left) have hzK : z ∈ K := hzS.1 have hzlt : limitCriterion z < limitCriterion limitArgmax := by refine lt_of_le_of_ne (hLimitMax z hzK) ?_ intro heq have hzl := hUnique z hzK heq subst z have : ε ≤ 0 := by simpa using hzS.2 exact (not_le_of_gt hε) this let d := (limitCriterion limitArgmax - limitCriterion z) / 3 have hd : 0 < d := div_pos (sub_pos.mpr hzlt) (by norm_num) have hU := (Metric.tendstoUniformlyOn_iff.mp hUniform d hd) have hevent : ∀ᶠ N in atTop, dist (argmax N) limitArgmax < ε := by filter_upwards [hU, hArgmaxMem, hArgmax] with N hUN hmem hmax by_contra hdist have hargS : argmax N ∈ S := ⟨hmem, le_of_not_gt hdist⟩ have hlimerr := hUN limitArgmax hLimitMem have hargerr := hUN (argmax N) hmem have hzbound := hzmax hargS change limitCriterion (argmax N) ≤ limitCriterion z at hzbound have hselected := hmax limitArgmax hLimitMem rw [Real.dist_eq] at hlimerr hargerr dsimp [d] at hd hlimerr hargerr linarith [abs_lt.mp hlimerr, abs_lt.mp hargerr] exact Filter.eventually_atTop.1 hevent · have hinside : ∀ y ∈ K, dist y limitArgmax < ε := by intro y hy by_contra h exact hSne ⟨y, hy, le_of_not_gt h⟩ have hevent : ∀ᶠ N in atTop, dist (argmax N) limitArgmax < ε := by filter_upwards [hArgmaxMem] with N hN exact hinside (argmax N) hN exact Filter.eventually_atTop.1 hevent
Causalean.Stat.tendsto_argmax_of_eventually_mem_compact · Causalean/Stat/MEstimation/ArgmaxStability.lean:23
Empirical­Expansion 1 core · 3 supporting This module supplies the empirical-process and population-expansion layer used by zEstimator_clt. ★ localStochasticExpansion

Empirical expansion for Z-estimators

This module supplies the empirical-process and population-expansion layer used by zEstimator_clt. It proves the mean-square score control score_diff_L2_isLittleOp_sqrt, packages local stochastic equicontinuity as StochEquicontAt, derives empiricalScoreDiff_isLittleOp_sqrt from that package and consistency, restates the population derivative as populationScoreDiff_eq_jacobian_plus_remainder, and combines the pieces in localStochasticExpansion.

theorem localStochasticExpansion reviewed
Causalean.Stat

Local stochastic expansion for Z-estimators. For a criterion function ψ with population Fréchet-Jacobian reg.J₀ at θ₀, an i.i.d. sample S, and an estimator sequence θn, suppose θn is consistent for θ₀, the centered empirical process of ψ is stochastically equicontinuous at θ₀ along θn, and θn approaches θ₀ at the parametric rate, ‖θn − θ₀‖ = O_p(1/√n). Then the empirical average score difference (1/√n) Σᵢ (ψ(θn,Zᵢ) − ψ(θ₀,Zᵢ)) agrees with its linearization √n · reg.J₀(θn − θ₀) up to an o_p(1) remainder in norm.

Formal statement
ψ :
E → X → E
θ₀ :
E
P :
reg :
S :
IIDSample Ω X μ P
θn :
ℕ → Ω → E
hConsistent :
∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)
hStochEquicont :
StochEquicontAt ψ θ₀ P μ S θn
hRate :
IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ
IsLittleOp (fun n ω => ‖(sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)) - sqrt (n : ℝ) • reg.J₀ (θn n ω - θ₀)‖) (fun _ => (1 : ℝ)) μ
Proof (Lean source)
theorem localStochasticExpansion (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (hConsistent : ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)) (hStochEquicont : StochEquicontAt ψ θ₀ P μ S θn) (hRate : IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ) : IsLittleOp (fun n ω => ‖(sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)) - sqrt (n : ℝ) • reg.J₀ (θn n ω - θ₀)‖) (fun _ => (1 : ℝ)) μ := by let Sn : ℕ → Ω → E := fun n ω => (sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)) let In : ℕ → Ω → E := fun n ω => sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P let Jn : ℕ → Ω → E := fun n ω => sqrt (n : ℝ) • reg.J₀ (θn n ω - θ₀) have hI : IsLittleOp (fun n ω => ‖Sn n ω - In n ω‖) (fun _ => (1 : ℝ)) μ := by simpa [Sn, In] using empiricalScoreDiff_isLittleOp_sqrt ψ θ₀ P reg S θn hConsistent hStochEquicont have hF : (fun θ => ∫ z, (ψ θ z - ψ θ₀ z) ∂P - reg.J₀ (θ - θ₀)) =o[𝓝 θ₀] fun θ => ‖θ - θ₀‖ := populationScoreDiff_eq_jacobian_plus_remainder ψ θ₀ P reg have hII : IsLittleOp (fun n ω => ‖In n ω - Jn n ω‖) (fun _ => (1 : ℝ)) μ := by intro ε hε rw [ENNReal.tendsto_nhds_zero] intro δ hδ by_cases hδtop : δ = ⊤ · filter_upwards with n simp [hδtop] have hδpos : 0 < δ.toReal := ENNReal.toReal_pos (ne_of_gt hδ) hδtop let α : ℝ := δ.toReal / 8 have hαpos : 0 < α := by dsimp [α] linarith rcases hRate α hαpos with ⟨M0, hM0⟩ let M : ℝ := max M0 1 have hMpos : 0 < M := by dsimp [M] exact lt_of_lt_of_le zero_lt_one (le_max_right M0 1) have hM0le : M0 ≤ M := by dsimp [M] exact le_max_left M0 1 let A : ℕ → Set Ω := fun n => {ω | M * (sqrt (n : ℝ))⁻¹ < |‖θn n ω - θ₀‖|} have hlimA : limsup (fun n => μ (A n)) atTopofReal α := by refine le_trans (Filter.limsup_le_limsup (Eventually.of_forall ?_)) hM0 intro n apply measure_mono intro ω hω dsimp [A] at hω ⊢ have hrn_nonneg : 0 ≤ (sqrt (n : ℝ))⁻¹ := inv_nonneg.mpr (Real.sqrt_nonneg _) exact lt_of_le_of_lt (mul_le_mul_of_nonneg_right hM0le hrn_nonneg) hω have halpha_two : ofReal α < ofReal (2 * α) := by rw [ENNReal.ofReal_lt_ofReal_iff] · linarith · linarith have hAevent := Filter.eventually_lt_of_limsup_lt (lt_of_le_of_lt hlimA halpha_two) let η : ℝ := ε / M have hηpos : 0 < η := by dsimp [η] exact div_pos hε hMpos have hderiv_event : ∀ᶠ θ in 𝓝 θ₀, ‖∫ z, (ψ θ z - ψ θ₀ z) ∂P - reg.J₀ (θ - θ₀)‖ ≤ η * ‖θ - θ₀‖ := by have hderiv_event0 := hF.def hηpos filter_upwards [hderiv_event0] with θ hθ simpa [Real.norm_eq_abs, abs_of_nonneg (norm_nonneg (θ - θ₀))] using hθ rcases Metric.eventually_nhds_iff.mp hderiv_event with ⟨ρ, hρpos, hρprop⟩ let B : ℕ → Set Ω := fun n => {ω | ρ ≤ ‖θn n ω - θ₀‖} have hConsistentHalf := hConsistent (ρ / 2) (by linarith) have hBsmall0 := (ENNReal.tendsto_nhds_zero.mp hConsistentHalf) (ofReal α) (ENNReal.ofReal_pos.mpr hαpos) have hBevent : ∀ᶠ n in atTop, μ (B n) < ofReal (2 * α) := by filter_upwards [hBsmall0] with n hn exact lt_of_le_of_lt (le_trans (measure_mono (by intro ω hω dsimp [B] at hω have : ρ / 2 < ‖θn n ω - θ₀‖ := by linarith exact this)) hn) halpha_two let C : ℕ → Set Ω := fun n => {ω | ε < |‖In n ω - Jn n ω‖|} have hpoint : ∀ n, μ (C n) ≤ μ (A n) + μ (B n) := by intro n have hsubset : C n ⊆ A n ∪ B n := by intro ω hω by_contra hnot have hnotA : ¬ M * (sqrt (n : ℝ))⁻¹ < |‖θn n ω - θ₀‖| := by intro hx exact hnot (inl hx) have hnotB : ¬ ρ ≤ ‖θn n ω - θ₀‖ := by intro hx exact hnot (inr hx) have hθle : ‖θn n ω - θ₀‖ ≤ M * (sqrt (n : ℝ))⁻¹ := by have := le_of_not_gt hnotA simpa [abs_of_nonneg (norm_nonneg (θn n ω - θ₀))] using this have hnear : ‖θn n ω - θ₀‖ < ρ := lt_of_not_ge hnotB have hder := hρprop (by simpa [dist_eq_norm] using hnear) have hscaled_le : sqrt (n : ℝ) * ‖θn n ω - θ₀‖ ≤ M := by by_cases hn : n = 0 · simp [hn, hMpos.le] · have hnpos_nat : 0 < n := Nat.pos_of_ne_zero hn have hnpos : 0 < (n : ℝ) := by exact_mod_cast hnpos_nat have hsqrt_pos : 0 < sqrt (n : ℝ) := Real.sqrt_pos.mpr hnpos calc sqrt (n : ℝ) * ‖θn n ω - θ₀‖ ≤ sqrt (n : ℝ) * (M * (sqrt (n : ℝ))⁻¹) := mul_le_mul_of_nonneg_left hθle (Real.sqrt_nonneg _) _ = M := by field_simp [hsqrt_pos.ne'] have hRle : ‖In n ω - Jn n ω‖ ≤ ε := by calc ‖In n ω - Jn n ω‖ = ‖Real.sqrt (n : ℝ) • (∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P - reg.J₀ (θn n ω - θ₀))‖ := by simp [In, Jn, sub_eq_add_neg, smul_add, smul_neg] _ = sqrt (n : ℝ) * ‖∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P - reg.J₀ (θn n ω - θ₀)‖ := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg _)] _ ≤ sqrt (n : ℝ) * (η * ‖θn n ω - θ₀‖) := by exact mul_le_mul_of_nonneg_left hder (Real.sqrt_nonneg _) _ = η * (sqrt (n : ℝ) * ‖θn n ω - θ₀‖) := by ring _ ≤ η * M := mul_le_mul_of_nonneg_left hscaled_le (le_of_lt hηpos) _ = ε := by dsimp [η] field_simp [hMpos.ne'] have hω' : ε < ‖In n ω - Jn n ω‖ := by simpa [C, abs_of_nonneg (norm_nonneg (In n ω - Jn n ω))] using hω exact not_lt_of_ge hRle hω' calc μ (C n) ≤ μ (A n ∪ B n) := measure_mono hsubset _ ≤ μ (A n) + μ (B n) := MeasureTheory.measure_union_le (A n) (B n) have hfour_alpha_lt_delta : ofReal (4 * α) < δ := by rw [ENNReal.ofReal_lt_iff_lt_toReal] · dsimp [α] linarith · dsimp [α] linarith [le_of_lt hδpos] · exact hδtop filter_upwards [hAevent, hBevent] with n hAn hBn exact le_of_lt <| calc μ {ω | ε * (fun _ => (1 : ℝ)) n < |‖In n ω - Jn n ω‖|} = μ (C n) := by simp [C] _ ≤ μ (A n) + μ (B n) := hpoint n _ < ofReal (2 * α) + ofReal (2 * α) := ENNReal.add_lt_add hAn hBn _ = ofReal (4 * α) := by rw [← ENNReal.ofReal_add] · congr 1 ring · linarith · linarith _ < δ := hfour_alpha_lt_delta have hLittle_add_one : ∀ {Xn Yn : ℕ → Ω → ℝ}, IsLittleOp Xn (fun _ => (1 : ℝ)) μ → IsLittleOp Yn (fun _ => (1 : ℝ)) μ → IsLittleOp (fun n ω => Xn n ω + Yn n ω) (fun _ => (1 : ℝ)) μ := by intro Xn Yn hX hY ε hε rw [ENNReal.tendsto_nhds_zero] intro δ hδ by_cases hδtop : δ = ⊤ · filter_upwards with n simp [hδtop] have hδpos : 0 < δ.toReal := ENNReal.toReal_pos (ne_of_gt hδ) hδtop let α : ℝ := δ.toReal / 4 have hαpos : 0 < α := by dsimp [α] linarith let A : ℕ → Set Ω := fun n => {ω | ε / 2 < |Xn n ω|} let B : ℕ → Set Ω := fun n => {ω | ε / 2 < |Yn n ω|} let C : ℕ → Set Ω := fun n => {ω | ε < |Xn n ω + Yn n ω|} have hXevent_le := (ENNReal.tendsto_nhds_zero.mp (hX (ε / 2) (by linarith))) (ofReal α) (ENNReal.ofReal_pos.mpr hαpos) have hYevent_le := (ENNReal.tendsto_nhds_zero.mp (hY (ε / 2) (by linarith))) (ofReal α) (ENNReal.ofReal_pos.mpr hαpos) have htwo_alpha_lt_delta : ofReal (2 * α) < δ := by rw [ENNReal.ofReal_lt_iff_lt_toReal] · dsimp [α] linarith · dsimp [α] linarith [le_of_lt hδpos] · exact hδtop filter_upwards [hXevent_le, hYevent_le] with n hXA hYB have hXA' : μ (A n) ≤ ofReal α := by simpa [A] using hXA have hYB' : μ (B n) ≤ ofReal α := by simpa [B] using hYB have hsubset : C n ⊆ A n ∪ B n := by intro ω hω by_contra hnot have hnotA : ¬ ε / 2 < |Xn n ω| := by intro hx exact hnot (inl hx) have hnotB : ¬ ε / 2 < |Yn n ω| := by intro hy exact hnot (inr hy) have hXle : |Xn n ω| ≤ ε / 2 := le_of_not_gt hnotA have hYle : |Yn n ω| ≤ ε / 2 := le_of_not_gt hnotB have hsum : |Xn n ω + Yn n ω| ≤ ε := by calc |Xn n ω + Yn n ω| ≤ |Xn n ω| + |Yn n ω| := abs_add_le _ _ _ ≤ ε / 2 + ε / 2 := add_le_add hXle hYle _ = ε := by ring exact not_lt_of_ge hsum hω exact le_of_lt <| calc μ {ω | ε * (fun _ => (1 : ℝ)) n < |Xn n ω + Yn n ω|} = μ (C n) := by simp [C] _ ≤ μ (A n ∪ B n) := measure_mono hsubset _ ≤ μ (A n) + μ (B n) := MeasureTheory.measure_union_le (A n) (B n) _ ≤ ofReal α + ofReal α := add_le_add hXA' hYB' _ = ofReal (2 * α) := by rw [← ENNReal.ofReal_add] · congr 1 ring · linarith · linarith _ < δ := htwo_alpha_lt_delta -- … truncated; follow the source link for the rest …
3 supporting declarations (lemmas, instances)
  • score_diff_L2_isLittleOp_sqrt theorem — (a) Score difference is o_p(1) in mean square.
    ψ :
    E → X → E
    θ₀ :
    E
    P :
    reg :
    S :
    IIDSample Ω X μ P
    θn :
    ℕ → Ω → E
    hConsistent :
    ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)
    IsLittleOp (fun n ω => (n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖^2) (fun _ => (1 : ℝ)) μ
    Proof (Lean source)
    theorem score_diff_L2_isLittleOp_sqrt (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (hConsistent : ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)) : IsLittleOp (fun n ω => (n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖^2) (fun _ => (1 : ℝ)) μ := by intro ε hε rw [ENNReal.tendsto_nhds_zero] intro γ hγ by_cases hγtop : γ = ⊤ · filter_upwards with n simp [hγtop] have hγpos : 0 < γ.toReal := ENNReal.toReal_pos (ne_of_gt hγ) hγtop let α : ℝ := γ.toReal / 4 have hαpos : 0 < α := by dsimp [α] linarith rcases reg.score_envelope with ⟨δenv, hδenv, F, hFmeas, hFnonneg, hFint, hFbound⟩ let K : ℝ := ∫ z, F z ^ 2 ∂P have hK_nonneg : 0 ≤ K := by dsimp [K] exact integral_nonneg fun z => sq_nonneg (F z) let M : ℝ := (K + 1) / α have hK1pos : 0 < K + 1 := by linarith have hMpos : 0 < M := div_pos hK1pos hαpos have hKM_nonneg : 0 ≤ K / M := div_nonneg hK_nonneg (le_of_lt hMpos) have hKM_le : K / M ≤ α := by dsimp [M] field_simp [hαpos.ne', hK1pos.ne'] nlinarith [hK_nonneg, hαpos] let τ : ℝ := min δenv (sqrt (ε / (M + 1))) have hM1pos : 0 < M + 1 := by linarith have hτpos : 0 < τ := by dsimp [τ] exact lt_min hδenv (Real.sqrt_pos.mpr (div_pos hε hM1pos)) have hτhalf_pos : 0 < τ / 2 := by linarith have hτ_le_env : τ ≤ δenv := by dsimp [τ] exact min_le_left _ _ have hτ_le_sqrt : τ ≤ sqrt (ε / (M + 1)) := by dsimp [τ] exact min_le_right _ _ have hτsq_le : τ ^ 2 ≤ ε / (M + 1) := by have hs := pow_le_pow_left₀ (le_of_lt hτpos) hτ_le_sqrt 2 simpa [Real.sq_sqrt (div_nonneg (le_of_lt hε) (le_of_lt hM1pos))] using hs have hτsqM_lt : τ ^ 2 * M < ε := by have hmul := mul_le_mul_of_nonneg_right hτsq_le (le_of_lt hMpos) have hfrac : ε / (M + 1) * M < ε := by rw [div_mul_eq_mul_div] rw [div_lt_iff₀ hM1pos] nlinarith [hε, hMpos] exact lt_of_le_of_lt hmul hfrac let Mn : ℕ → Ω → ℝ := fun n ω => (n : ℝ)⁻¹ * ∑ i ∈ range n, F (S.Z i ω) ^ 2 have hFpow_meas : Measurable fun z => F z ^ 2 := hFmeas.pow_const 2 have hmap_i : ∀ i, μ.map (S.Z i) = P := by intro i calc μ.map (S.Z i) = μ.map (S.Z 0) := (S.identDist i).map_eq.symm _ = P := S.law have hint_i : ∀ i, Integrable (fun ω => F (S.Z i ω) ^ 2) μ := by intro i have hi : Integrable (fun z => F z ^ 2) (μ.map (S.Z i)) := by simpa [hmap_i i] using hFint simpa [Function.comp_def] using hi.comp_measurable (S.meas i) have hint_eq_i : ∀ i, (∫ ω, F (S.Z i ω) ^ 2 ∂μ) = K := by intro i calc (∫ ω, F (S.Z i ω) ^ 2 ∂μ) = ∫ z, F z ^ 2 ∂(μ.map (S.Z i)) := by exact (integral_map (S.meas i).aemeasurable hFpow_meas.aestronglyMeasurable).symm _ = K := by rw [hmap_i i] have hMn_nonneg_point : ∀ n ω, 0 ≤ Mn n ω := by intro n ω dsimp [Mn] exact mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg n)) (sum_nonneg fun i _hi => sq_nonneg (F (S.Z i ω))) have hMn_nonneg : ∀ n, 0 ≤ᵐ[μ] Mn n := by intro n exact Eventually.of_forall (hMn_nonneg_point n) have hMn_int : ∀ n, Integrable (Mn n) μ := by intro n dsimp [Mn] exact (integrable_finset_sum (range n) (fun i _hi => hint_i i)).const_mul _ have hMn_integral_le : ∀ n, (∫ ω, Mn n ω ∂μ) ≤ K := by intro n by_cases hn : n = 0 · subst n dsimp [Mn, K] simpa using hK_nonneg · have hnpos : 0 < n := Nat.pos_of_ne_zero hn have hnR : (n : ℝ) ≠ 0 := by exact_mod_cast hn dsimp [Mn] rw [integral_const_mul] rw [MeasureTheory.integral_finset_sum (range n)] · simp_rw [hint_eq_i] simp [Finset.sum_const, hnR] · intro i _hi exact hint_i i have hMn_markov : ∀ n, μ {ω | M < Mn n ω} ≤ ofReal (K / M) := by intro n have hge_real : (μ {ω | M ≤ Mn n ω}).toReal ≤ K / M := by have hmark := MeasureTheory.mul_meas_ge_le_integral_of_nonneg (hMn_nonneg n) (hMn_int n) M have hdiv : μ.real {ω | M ≤ Mn n ω} ≤ (∫ ω, Mn n ω ∂μ) / M := by rw [measureReal_def] exact (le_div_iff₀ hMpos).mpr (by simpa [measureReal_def, mul_comm] using hmark) exact le_trans hdiv (div_le_div_of_nonneg_right (hMn_integral_le n) (le_of_lt hMpos)) exact le_trans (measure_mono (by intro ω hω change M ≤ Mn n ω exact le_of_lt hω)) ((ENNReal.le_ofReal_iff_toReal_le (measure_ne_top μ _) hKM_nonneg).mpr hge_real) have hCons_le := (ENNReal.tendsto_nhds_zero.mp (hConsistent (τ / 2) hτhalf_pos)) (ofReal α) (ENNReal.ofReal_pos.mpr hαpos) have htwo_alpha_lt_gamma : ofReal (2 * α) < γ := by rw [ENNReal.ofReal_lt_iff_lt_toReal] · dsimp [α] linarith · dsimp [α] linarith [le_of_lt hγpos] · exact hγtop filter_upwards [hCons_le] with n hnCons exact le_of_lt <| calc μ {ω | ε * (fun _ => (1 : ℝ)) n < |(n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2|} ≤ μ ({ω | τ / 2 < ‖θn n ω - θ₀‖} ∪ {ω | M < Mn n ω}) := by apply measure_mono_ae have hFbound_i : ∀ i : ℕ, ∀ᵐ ω ∂μ, ∀ θ : E, ‖θ - θ₀‖ < δenv → ‖ψ θ (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ≤ ‖θ - θ₀‖ * F (S.Z i ω) := by intro i have hbound_map : ∀ᵐ z ∂(μ.map (S.Z i)), ∀ θ : E, ‖θ - θ₀‖ < δenv → ‖ψ θ z - ψ θ₀ z‖ ≤ ‖θ - θ₀‖ * F z := by simpa [hmap_i i] using hFbound exact ae_of_ae_map (S.meas i).aemeasurable hbound_map have hFbound_all : ∀ᵐ ω ∂μ, ∀ i ∈ range n, ∀ θ : E, ‖θ - θ₀‖ < δenv → ‖ψ θ (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ≤ ‖θ - θ₀‖ * F (S.Z i ω) := by rw [Finset.eventually_all] intro i _hi exact hFbound_i i filter_upwards [hFbound_all] with ω hFboundω hω replace hω : ε * (fun _ => (1 : ℝ)) n < |(n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2| := hω by_cases hn0 : n = 0 · subst n have hω0 : ε < 0 := by simpa using hω exact elim (not_lt_of_ge hε.le hω0) · have hnR_nonneg : 0 ≤ (n : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_nonneg n) have hT_nonneg : 0 ≤ (n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2 := by exact mul_nonneg hnR_nonneg (sum_nonneg fun i _hi => sq_nonneg _) have hTgt : ε < (n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2 := by have hω' : ε < |(n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2| := by simpa using hω simpa [abs_of_nonneg hT_nonneg] using hω' by_cases hθsmall : ‖θn n ω - θ₀‖ ≤ τ / 2 · by_cases hMsmall : Mn n ω ≤ M · have hθ_lt_env : ‖θn n ω - θ₀‖ < δenv := by have hθ_lt_τ : ‖θn n ω - θ₀‖ < τ := by linarith [hθsmall, hτpos] exact lt_of_lt_of_le hθ_lt_τ hτ_le_env have hsum_le : (∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2) ≤ ‖θn n ω - θ₀‖ ^ 2 * ∑ i ∈ range n, F (S.Z i ω) ^ 2 := by rw [Finset.mul_sum] refine Finset.sum_le_sum ?_ intro i _hi have henv := hFboundω i _hi (θn n ω) hθ_lt_env have hrhs_nonneg : 0 ≤ ‖θn n ω - θ₀‖ * F (S.Z i ω) := mul_nonneg (norm_nonneg _) (hFnonneg _) have hsquare : ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2 ≤ (‖θn n ω - θ₀‖ * F (S.Z i ω)) ^ 2 := by have hnorm_nonneg : 0 ≤ ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ := norm_nonneg _ exact sq_le_sq' (by linarith) henv simpa [mul_pow] using hsquare have hT_le : (n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2 ≤ ‖θn n ω - θ₀‖ ^ 2 * Mn n ω := by have hmul := mul_le_mul_of_nonneg_left hsum_le hnR_nonneg dsimp [Mn] nlinarith have hθsq_le : ‖θn n ω - θ₀‖ ^ 2 ≤ τ ^ 2 := by exact pow_le_pow_left₀ (norm_nonneg _) (by linarith) 2 have hprod_le : ‖θn n ω - θ₀‖ ^ 2 * Mn n ω ≤ τ ^ 2 * M := by have hMn_nonnegω : 0 ≤ Mn n ω := hMn_nonneg_point n ω exact mul_le_mul hθsq_le hMsmall hMn_nonnegω (sq_nonneg τ) have hT_lt : (n : ℝ)⁻¹ * ∑ i ∈ range n, ‖ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)‖ ^ 2 < ε := lt_of_le_of_lt (le_trans hT_le hprod_le) hτsqM_lt exact elim (not_lt_of_ge hT_lt.le hTgt) · exact inr (lt_of_not_ge hMsmall) · exact inl (lt_of_not_ge hθsmall) _ ≤ μ {ω | τ / 2 < ‖θn n ω - θ₀‖} + μ {ω | M < Mn n ω} := MeasureTheory.measure_union_le _ _ _ ≤ ofReal α + ofReal (K / M) := add_le_add hnCons (hMn_markov n) _ ≤ ofReal α + ofReal α := add_le_add le_rfl (ENNReal.ofReal_le_ofReal hKM_le) _ = ofReal (2 * α) := by rw [← ENNReal.ofReal_add] · congr 1 -- … truncated; follow the source link for the rest …
    Causalean.Stat.score_diff_L2_isLittleOp_sqrt · Causalean/Stat/MEstimation/EmpiricalExpansion.lean:85
  • empiricalScoreDiff_isLittleOp_sqrt theorem — (b) Empirical-process score difference is o_p(√n).
    ψ :
    E → X → E
    θ₀ :
    E
    P :
    _reg :
    S :
    IIDSample Ω X μ P
    θn :
    ℕ → Ω → E
    hConsistent :
    ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)
    hStochEquicont :
    StochEquicontAt ψ θ₀ P μ S θn
    IsLittleOp (fun n ω => ‖(sqrt (n : ℝ))⁻¹ • (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) - sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P‖) (fun _ => (1 : ℝ)) μ
    Proof (Lean source)
    theorem empiricalScoreDiff_isLittleOp_sqrt (ψ : E → X → E) (θ₀ : E) (P : Measure X) (_reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (hConsistent : ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)) (hStochEquicont : StochEquicontAt ψ θ₀ P μ S θn) : IsLittleOp (fun n ω => ‖(sqrt (n : ℝ))⁻¹ • (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) - sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P‖) (fun _ => (1 : ℝ)) μ := by intro ε hε rw [ENNReal.tendsto_nhds_zero] intro γ hγ by_cases hγtop : γ = ⊤ · filter_upwards with n simp [hγtop] have hγpos : 0 < γ.toReal := ENNReal.toReal_pos (ne_of_gt hγ) hγtop let α : ℝ := γ.toReal / 4 have hαpos : 0 < α := by dsimp [α] linarith rcases hStochEquicont ε hε with ⟨δ, hδ_pos, hStoch⟩ have hδhalf_pos : 0 < δ / 2 := by linarith have hStoch_le := (ENNReal.tendsto_nhds_zero.mp hStoch) (ofReal α) (ENNReal.ofReal_pos.mpr hαpos) have hCons_le := (ENNReal.tendsto_nhds_zero.mp (hConsistent (δ / 2) hδhalf_pos)) (ofReal α) (ENNReal.ofReal_pos.mpr hαpos) have htwo_alpha_lt_gamma : ofReal (2 * α) < γ := by rw [ENNReal.ofReal_lt_iff_lt_toReal] · dsimp [α] linarith · dsimp [α] linarith [le_of_lt hγpos] · exact hγtop filter_upwards [hStoch_le, hCons_le] with n hnStoch hnCons exact le_of_lt <| calc μ {ω | ε * (fun _ => (1 : ℝ)) n < |‖(sqrt (n : ℝ))⁻¹ • (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) - sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P‖|} ≤ μ ({ω | ‖θn n ω - θ₀‖ < δ ∧ ε < ‖(sqrt (n : ℝ))⁻¹ • (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) - sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P‖} ∪ {ω | δ / 2 < ‖θn n ω - θ₀‖}) := by apply measure_mono intro ω hω have hR : ε < ‖(sqrt (n : ℝ))⁻¹ • (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) - sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P‖ := by simpa [abs_of_nonneg (norm_nonneg _)] using hω by_cases hθ : ‖θn n ω - θ₀‖ < δ · exact inl ⟨hθ, hR⟩ · exact inr (by have hδle : δ ≤ ‖θn n ω - θ₀‖ := le_of_not_gt hθ have hhalf_lt_delta : δ / 2 < δ := by linarith [hδ_pos] exact lt_of_lt_of_le hhalf_lt_delta hδle) _ ≤ μ {ω | ‖θn n ω - θ₀‖ < δ ∧ ε < ‖(sqrt (n : ℝ))⁻¹ • (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) - sqrt (n : ℝ) • ∫ z, (ψ (θn n ω) z - ψ θ₀ z) ∂P‖} + μ {ω | δ / 2 < ‖θn n ω - θ₀‖} := MeasureTheory.measure_union_le _ _ _ ≤ ofReal α + ofReal α := add_le_add hnStoch hnCons _ = ofReal (2 * α) := by rw [← ENNReal.ofReal_add] · congr 1 ring · linarith · linarith _ < γ := htwo_alpha_lt_gamma
    Causalean.Stat.empiricalScoreDiff_isLittleOp_sqrt · Causalean/Stat/MEstimation/EmpiricalExpansion.lean:348
  • populationScoreDiff_eq_jacobian_plus_remainder theorem — (c) Population Fréchet expansion of the score difference.
    ψ :
    E → X → E
    θ₀ :
    E
    P :
    reg :
    (fun θ => ∫ z, (ψ θ z - ψ θ₀ z) ∂P - reg.J₀ (θ - θ₀)) =o[𝓝 θ₀] fun θ => ‖θ - θ₀‖
    Proof (Lean source)
    theorem populationScoreDiff_eq_jacobian_plus_remainder (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) : (fun θ => ∫ z, (ψ θ z - ψ θ₀ z) ∂P - reg.J₀ (θ - θ₀)) =o[𝓝 θ₀] fun θ => ‖θ - θ₀‖ := by rcases reg.psi_int_neighborhood with ⟨δ, hδ_pos, hδ_int⟩ have hψ₀ : Integrable (ψ θ₀) P := by exact hδ_int θ₀ (by simpa using hδ_pos) have hbase : (fun θ => (∫ z, ψ θ z ∂P) - (∫ z, ψ θ₀ z ∂P) - reg.J₀ (θ - θ₀)) =o[𝓝 θ₀] fun θ => θ - θ₀ := reg.J₀_spec.isLittleO have hbase_norm : (fun θ => (∫ z, ψ θ z ∂P) - (∫ z, ψ θ₀ z ∂P) - reg.J₀ (θ - θ₀)) =o[𝓝 θ₀] fun θ => ‖θ - θ₀‖ := (Asymptotics.isLittleO_norm_right).mpr hbase refine hbase_norm.congr' ?_ EventuallyEq.rfl have hnear : ∀ᶠ θ in 𝓝 θ₀, ‖θ - θ₀‖ < δ := by refine Metric.eventually_nhds_iff.mpr ⟨δ, hδ_pos, ?_⟩ intro θ hθ simpa [dist_eq_norm] using hθ filter_upwards [hnear] with θ hθ rw [MeasureTheory.integral_sub (hδ_int θ (by simpa [dist_eq_norm] using hθ)) hψ₀]
    Causalean.Stat.populationScoreDiff_eq_jacobian_plus_remainder · Causalean/Stat/MEstimation/EmpiricalExpansion.lean:455
Extremum­Consistency 3 core · 1 supporting This module packages primitive extremum-estimation conditions that imply the consistency assumptions used by Z-estimator and GMM central-limit theorems. ★ zEstimator_clt_of_extremum★ zEstimator_clt_of_donsker★ zEstimator_clt_of_extremum_donsker

Extremum consistency for M-estimation

This module packages primitive extremum-estimation conditions that imply the consistency assumptions used by Z-estimator and GMM central-limit theorems. The format bridge consistent_lt_norm_of_le_dist adapts the empirical-process consistency theorem to the CLT layer, while zEstimator_clt_of_extremum, zEstimator_clt_of_donsker, and zEstimator_clt_of_extremum_donsker discharge opaque consistency and equicontinuity hypotheses from Glivenko-Cantelli, well-separated-optimum, and class-level equicontinuity inputs. (The parallel GMM reductions live in Causalean/Stat/GMM/AsymptoticNormality.lean.)

theorem zEstimator_clt_of_extremum reviewed
Causalean.Stat

Z-estimator CLT from extremum primitives. Identical conclusion to zEstimator_clt, but with consistency derived rather than assumed: given an auxiliary criterion function m, suppose the criterion class indexed by the parameter obeys a uniform law of large numbers, i.e. is Glivenko–Cantelli, the estimator sample-maximises the empirical criterion at every sample size, and the population criterion has a well-separated maximum at the target parameter. Then, provided the score process is stochastically equicontinuous at the target parameter along the estimator sequence, the estimator converges to the target at the parametric n\sqrt n-rate, and the estimator solves the empirical estimating equation eventually, almost surely, the estimator is asymptotically linear at the target parameter, with influence function minus the inverse Jacobian applied to the score at the target.

Formal statement
ψ :
E → X → E
θ₀ :
E
P :
reg :
S :
IIDSample Ω X μ P
θn :
ℕ → Ω → E
m :
E → X → ℝ
hGC :
hArgmax :
∀ n ω, S.sampleMean (m θ₀) n ω ≤ S.sampleMean (m (θn n ω)) n ω
hSep :
∀ ε : ℝ,
0 < ε → ∃ η : ℝ, 0 < η ∧ ∀ θ : E, ε ≤ dist θ θ₀ → (∫ x, m θ x ∂P) + η ≤ ∫ x, m θ₀ x ∂P
hStochEquicont :
StochEquicontAt ψ θ₀ P μ S θn
hRate :
IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ
hMoment :
∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0
IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n)
Proof (Lean source)
theorem zEstimator_clt_of_extremum (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (m : E → X → ℝ) (hGC : GlivenkoCantelli S m) (hArgmax : ∀ n ω, S.sampleMean (m θ₀) n ω ≤ S.sampleMean (m (θn n ω)) n ω) (hSep : ∀ ε : ℝ, 0 < ε → ∃ η : ℝ, 0 < η ∧ ∀ θ : E, ε ≤ dist θ θ₀ → (∫ x, m θ x ∂P) + η ≤ ∫ x, m θ₀ x ∂P) (hStochEquicont : StochEquicontAt ψ θ₀ P μ S θn) (hRate : IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ) (hMoment : ∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0) : IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n) := zEstimator_clt ψ θ₀ P reg S θn (consistent_lt_norm_of_le_dist θn θ₀ (mEstimator_consistent_of_glivenkoCantelli S m θ₀ θn hGC hArgmax hSep)) hStochEquicont hRate hMoment
theorem zEstimator_clt_of_donsker reviewed
Causalean.Stat

Z-estimator CLT with the equicontinuity hypothesis discharged. Identical conclusion to zEstimator_clt, but the estimator-sequence-specific equicontinuity modulus is replaced by a class-level Donsker condition: if the estimator converges in probability to the target parameter, the score family is asymptotically equicontinuous at the target parameter — a property of the family alone, independent of the particular estimator sequence, the estimator converges to the target at the parametric n\sqrt n-rate, and the estimator solves the empirical estimating equation eventually, almost surely, then the estimator is asymptotically linear at the target parameter, with influence function minus the inverse Jacobian applied to the score at the target.

Formal statement
ψ :
E → X → E
θ₀ :
E
P :
reg :
S :
IIDSample Ω X μ P
θn :
ℕ → Ω → E
hConsistent :
∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)
hAEC :
AsymptoticEquicont ψ θ₀ P μ S
hRate :
IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ
hMoment :
∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0
IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n)
Proof (Lean source)
theorem zEstimator_clt_of_donsker (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (hConsistent : ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)) (hAEC : AsymptoticEquicont ψ θ₀ P μ S) (hRate : IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ) (hMoment : ∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0) : IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n) := zEstimator_clt ψ θ₀ P reg S θn hConsistent (stochEquicontAt_of_asymptoticEquicont ψ θ₀ S θn hAEC hConsistent) hRate hMoment
theorem zEstimator_clt_of_extremum_donsker reviewed
Causalean.Stat

Z-estimator CLT from primitive conditions: both opaque hypotheses discharged. Combines zEstimator_clt_of_extremum and zEstimator_clt_of_donsker: if the criterion class indexed by the parameter obeys a uniform law of large numbers, the estimator sample-maximises the empirical criterion at every sample size, the population criterion has a well-separated maximum at the target parameter, the score family is asymptotically equicontinuous at the target parameter, the estimator converges to the target at the parametric n\sqrt n-rate, and the estimator solves the empirical estimating equation eventually, almost surely, then the estimator is asymptotically linear at the target parameter, with influence function minus the inverse Jacobian applied to the score at the target.

Formal statement
ψ :
E → X → E
θ₀ :
E
P :
reg :
S :
IIDSample Ω X μ P
θn :
ℕ → Ω → E
m :
E → X → ℝ
hGC :
hArgmax :
∀ n ω, S.sampleMean (m θ₀) n ω ≤ S.sampleMean (m (θn n ω)) n ω
hSep :
∀ ε : ℝ,
0 < ε → ∃ η : ℝ, 0 < η ∧ ∀ θ : E, ε ≤ dist θ θ₀ → (∫ x, m θ x ∂P) + η ≤ ∫ x, m θ₀ x ∂P
hAEC :
AsymptoticEquicont ψ θ₀ P μ S
hRate :
IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ
hMoment :
∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0
IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n)
Proof (Lean source)
theorem zEstimator_clt_of_extremum_donsker (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (m : E → X → ℝ) (hGC : GlivenkoCantelli S m) (hArgmax : ∀ n ω, S.sampleMean (m θ₀) n ω ≤ S.sampleMean (m (θn n ω)) n ω) (hSep : ∀ ε : ℝ, 0 < ε → ∃ η : ℝ, 0 < η ∧ ∀ θ : E, ε ≤ dist θ θ₀ → (∫ x, m θ x ∂P) + η ≤ ∫ x, m θ₀ x ∂P) (hAEC : AsymptoticEquicont ψ θ₀ P μ S) (hRate : IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ) (hMoment : ∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0) : IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n) := have hcons := consistent_lt_norm_of_le_dist θn θ₀ (mEstimator_consistent_of_glivenkoCantelli S m θ₀ θn hGC hArgmax hSep) zEstimator_clt ψ θ₀ P reg S θn hcons (stochEquicontAt_of_asymptoticEquicont ψ θ₀ S θn hAEC hcons) hRate hMoment
1 supporting declaration (lemmas, instances)
  • consistent_lt_norm_of_le_dist theorem — Format bridge. On a normed group dist x θ₀ = ‖x − θ₀‖, so the consistency statement produced by mEstimator_consistent_of_glivenkoCantelli (phrased with ε ≤ dist (θn n) θ₀) implies the strictly-larger-radius form ε < ‖θn n − θ₀‖ consumed by the CLT layer. {ε < ‖·‖} ⊆ {ε ≤ dist}, so the measures are squeezed to 0.
    E :
    θn :
    ℕ → Ω → E
    θ₀ :
    E
    h :
    ∀ ε : ℝ
    if
    0 < ε
    then
    Tendsto (fun n => μ {ω | ε ≤ dist (θn n ω) θ₀}) atTop (𝓝 0)
    ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)
    Proof (Lean source)
    theorem consistent_lt_norm_of_le_dist {E : Type*} [NormedAddCommGroup E] (θn : ℕ → Ω → E) (θ₀ : E) (h : ∀ ε : ℝ, 0 < ε → Tendsto (fun n => μ {ω | ε ≤ dist (θn n ω) θ₀}) atTop (𝓝 0)) : ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0) := by intro ε hε refine tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds (h ε hε) (Eventually.of_forall fun n => zero_le) (Eventually.of_forall fun n => measure_mono ?_) intro ω hω simp only [Set.mem_setOf_eq, dist_eq_norm] at hω ⊢ exact le_of_lt hω
    Causalean.Stat.consistent_lt_norm_of_le_dist · Causalean/Stat/MEstimation/ExtremumConsistency.lean:67
Finite­Poisson­Consistency 2 core · 2 supporting This module proves uniform convergence of finite Poisson objectives, compact containment and convergence of their maximizers, and continuity of the selected maximizer under perturbations of the finite mean vector. ★ finitePoissonObjective_argmax_tendsto★ finitePoissonObjective_argmax_continuousAt_mean

Consistency and continuity of finite Poisson projections

This module proves uniform convergence of finite Poisson objectives, compact containment and convergence of their maximizers, and continuity of the selected maximizer under perturbations of the finite mean vector.

lemma finitePoissonObjective_argmax_tendsto reviewed
Causalean.Stat

Stability of finite Poisson maximizers under convergence of weights and means. Given a sequence of finite Poisson criteria with weights qN N and means mN N, suppose the limiting weights are strictly positive, the limiting means are strictly positive, the linear design map is injective, the weights qN N converge cellwise to the limiting weights q, and the means mN N converge cellwise to the limiting means m. If argmax N maximizes the N-th criterion, eventually in N, and limitArgmax is the unique global maximizer of the limiting criterion, then the maximizer sequence argmax converges to limitArgmax.

Formal statement
qN mN :
ℕ → I → ℝ
q m :
I → ℝ
A :
E →ₗ[ℝ] (I → ℝ)
argmax :
ℕ → E
limitArgmax :
E
hqpos :
∀ i, 0 < q i
hmpos :
∀ i, 0 < m i
hA :
hq :
∀ i, Tendsto (fun N => qN N i) atTop (nhds (q i))
hm :
∀ i, Tendsto (fun N => mN N i) atTop (nhds (m i))
hArgmax :
∀ᶠ N in atTop,
∀ y,
finitePoissonObjective (qN N) (mN N) A y
finitePoissonObjective (qN N) (mN N) A (argmax N)
hLimit :
Tendsto argmax atTop (nhds limitArgmax)
Proof (Lean source)
lemma finitePoissonObjective_argmax_tendsto {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [SecondCountableTopology E] [Fintype I] (qN mN : ℕ → I → ℝ) (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (argmax : ℕ → E) (limitArgmax : E) (hqpos : ∀ i, 0 < q i) (hmpos : ∀ i, 0 < m i) (hA : Injective A) (hq : ∀ i, Tendsto (fun N => qN N i) atTop (nhds (q i))) (hm : ∀ i, Tendsto (fun N => mN N i) atTop (nhds (m i))) (hArgmax : ∀ᶠ N in atTop, ∀ y, finitePoissonObjective (qN N) (mN N) A y ≤ finitePoissonObjective (qN N) (mN N) A (argmax N)) (hLimit : IsUniqueGlobalMax (finitePoissonObjective q m A) limitArgmax) : Tendsto argmax atTop (nhds limitArgmax) := by obtain ⟨K₀, hK₀, hmem⟩ := finitePoissonObjective_eventually_common_compact qN mN q m A argmax hqpos hmpos hA hq hm hArgmax let K : Set E := insert limitArgmax K₀ have hK : IsCompact K := hK₀.insert limitArgmax have hlimitmem : limitArgmax ∈ K := Set.mem_insert _ _ have hargmem : ∀ᶠ N in atTop, argmax N ∈ K := hmem.mono fun N hN => Set.mem_insert_of_mem _ hN apply tendsto_argmax_of_eventually_mem_compact (fun N => finitePoissonObjective (qN N) (mN N) A) (finitePoissonObjective q m A) argmax limitArgmax K hK hlimitmem · exact (finitePoissonObjective_continuous q m A).continuousOn · intro y hy exact hLimit.1 y · exact finitePoissonObjective_tendstoUniformlyOn qN mN q m A K hK hq hm · exact hargmem · exact hArgmax.mono fun N hN y hy => hN y · intro y hy heq exact hLimit.2 y heq
lemma finitePoissonObjective_argmax_continuousAt_mean reviewed
Causalean.Stat

Continuity of the finite Poisson maximizer in the means. If every cell weight is strictly positive and the base mean vector m₀ has every entry strictly positive, and the linear design map is injective, then the selected maximizer of the finite Poisson criterion is continuous, as a function of the mean vector, at m₀.

Formal statement
E I :
q :
I → ℝ
A :
E →ₗ[ℝ] (I → ℝ)
m₀ :
I → ℝ
hq :
∀ i, 0 < q i
hm₀ :
∀ i, 0 < m₀ i
hA :
ContinuousAt (fun m : I → ℝ => maximizerOrZero (finitePoissonObjective q m A)) m₀
Proof (Lean source)
lemma finitePoissonObjective_argmax_continuousAt_mean {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype I] [Nonempty I] (q : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (m₀ : I → ℝ) (hq : ∀ i, 0 < q i) (hm₀ : ∀ i, 0 < m₀ i) (hA : Injective A) : ContinuousAt (fun m : I → ℝ => maximizerOrZero (finitePoissonObjective q m A)) m₀ := by classical rw [ContinuousAt, Filter.tendsto_iff_seq_tendsto] intro mN hmN have hm : ∀ i, Tendsto (fun N => mN N i) atTop (nhds (m₀ i)) := tendsto_pi_nhds.mp hmN have hmpos : ∀ᶠ N in atTop, ∀ i, 0 < mN N i := by rw [Filter.eventually_all] intro i exact (tendsto_order.1 (hm i)).1 0 (hm₀ i) have hmax : ∀ᶠ N in atTop, ∀ y, finitePoissonObjective q (mN N) A y ≤ finitePoissonObjective q (mN N) A (maximizerOrZero (finitePoissonObjective q (mN N) A)) := by filter_upwards [hmpos] with N hpos exact (uniqueGlobalMax_maximizerOrZero _ (finitePoissonObjective_exists_unique_max q (mN N) A hq hpos hA)).1 have hlimit : IsUniqueGlobalMax (finitePoissonObjective q m₀ A) (maximizerOrZero (finitePoissonObjective q m₀ A)) := uniqueGlobalMax_maximizerOrZero _ (finitePoissonObjective_exists_unique_max q m₀ A hq hm₀ hA) exact finitePoissonObjective_argmax_tendsto (fun _ => q) mN q m₀ A (fun N => maximizerOrZero (finitePoissonObjective q (mN N) A)) (maximizerOrZero (finitePoissonObjective q m₀ A)) hq hm₀ hA (fun i => tendsto_const_nhds) hm hmax hlimit
Causalean.Stat.finitePoissonObjective_argmax_continuousAt_mean · Causalean/Stat/MEstimation/FinitePoissonConsistency.lean:238 · uses finitePoissonObjective , maximizerOrZero
2 supporting declarations (lemmas, instances)
  • finitePoissonObjective_tendstoUniformlyOn lemma — Pointwise convergence of the finitely many weights and means gives uniform convergence of the finite Poisson objective on every compact parameter set.
    qN mN :
    ℕ → I → ℝ
    q m :
    I → ℝ
    A :
    E →ₗ[ℝ] (I → ℝ)
    K :
    Set E
    hK :
    hq :
    ∀ i, Tendsto (fun N => qN N i) atTop (nhds (q i))
    hm :
    ∀ i, Tendsto (fun N => mN N i) atTop (nhds (m i))
    Proof (Lean source)
    lemma finitePoissonObjective_tendstoUniformlyOn {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype I] (qN mN : ℕ → I → ℝ) (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (K : Set E) (hK : IsCompact K) (hq : ∀ i, Tendsto (fun N => qN N i) atTop (nhds (q i))) (hm : ∀ i, Tendsto (fun N => mN N i) atTop (nhds (m i))) : TendstoUniformlyOn (fun N => finitePoissonObjective (qN N) (mN N) A) (finitePoissonObjective q m A) atTop K := by let cN : ℕ → (I → ℝ) × (I → ℝ) := fun N => (qN N, mN N) let c : (I → ℝ) × (I → ℝ) := (q, m) let F : ((I → ℝ) × (I → ℝ)) → E → ℝ := fun p x => finitePoissonObjective p.1 p.2 A x have hc : Tendsto cN atTop (nhds c) := by exact (tendsto_pi_nhds.mpr hq).prodMk_nhds (tendsto_pi_nhds.mpr hm) let U := closedBall c 1 letI : ProperSpace ((I → ℝ) × (I → ℝ)) := FiniteDimensional.proper_real _ have hU : IsCompact U := ProperSpace.isCompact_closedBall c 1 have hcU : c ∈ U := by simp [U] have hevent : ∀ᶠ N in atTop, cN N ∈ U := by have := (Metric.tendsto_nhds.mp hc 1 zero_lt_one) filter_upwards [this] with N hN exact Metric.mem_closedBall.mpr hN.le have hcWithin : Tendsto cN atTop (nhdsWithin c U) := by rw [nhdsWithin] exact tendsto_inf.2 ⟨hc, tendsto_principal.2 hevent⟩ have hcont : Continuous (uncurry F) := by unfold F finitePoissonObjective fun_prop have hUC : UniformContinuousOn (uncurry F) (U ×ˢ K) := (hU.prod hK).uniformContinuousOn_of_continuous hcont.continuousOn have hlocal : TendstoUniformlyOn F (F c) (nhdsWithin c U) K := hUC.tendstoUniformlyOn hcU intro V hV exact hcWithin.eventually (hlocal V hV)
    Causalean.Stat.finitePoissonObjective_tendstoUniformlyOn · Causalean/Stat/MEstimation/FinitePoissonConsistency.lean:26
  • finitePoissonObjective_eventually_common_compact lemma — Convergent positive coefficients and a fixed injective design put any eventual sequence of global maximizers in one common compact ball.
    qN mN :
    ℕ → I → ℝ
    q m :
    I → ℝ
    A :
    E →ₗ[ℝ] (I → ℝ)
    argmax :
    ℕ → E
    hqpos :
    ∀ i, 0 < q i
    hmpos :
    ∀ i, 0 < m i
    hA :
    hq :
    ∀ i, Tendsto (fun N => qN N i) atTop (nhds (q i))
    hm :
    ∀ i, Tendsto (fun N => mN N i) atTop (nhds (m i))
    hmax :
    ∀ᶠ N in atTop,
    ∀ y,
    finitePoissonObjective (qN N) (mN N) A y
    finitePoissonObjective (qN N) (mN N) A (argmax N)
    ∃ K : Set E, IsCompact K ∧ ∀ᶠ N in atTop, argmax N ∈ K
    Proof (Lean source)
    lemma finitePoissonObjective_eventually_common_compact {E I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype I] (qN mN : ℕ → I → ℝ) (q m : I → ℝ) (A : E →ₗ[ℝ] (I → ℝ)) (argmax : ℕ → E) (hqpos : ∀ i, 0 < q i) (hmpos : ∀ i, 0 < m i) (hA : Injective A) (hq : ∀ i, Tendsto (fun N => qN N i) atTop (nhds (q i))) (hm : ∀ i, Tendsto (fun N => mN N i) atTop (nhds (m i))) (hmax : ∀ᶠ N in atTop, ∀ y, finitePoissonObjective (qN N) (mN N) A y ≤ finitePoissonObjective (qN N) (mN N) A (argmax N)) : ∃ K : Set E, IsCompact K ∧ ∀ᶠ N in atTop, argmax N ∈ K := by classical let w : I → ℝ := fun i => q i / 2 * min (m i / 2) 1 let B : E →ₗ[ℝ] (I → ℝ) := { toFun := fun x i => w i * A x i map_add' := by intro x y; funext i; simp; ring map_smul' := by intro c x; funext i; simp; ring } have hwpos : ∀ i, 0 < w i := by intro i exact mul_pos (half_pos (hqpos i)) (lt_min (half_pos (hmpos i)) zero_lt_one) have hB : Injective B := by intro x y hxy apply hA funext i have hi := congrFun hxy i dsimp [B] at hi exact (mul_left_cancel₀ (ne_of_gt (hwpos i)) hi) obtain ⟨L, hL, hanti⟩ := (LinearMap.injective_iff_antilipschitz B).mp hB let kappa : ℝ := L⁻¹ have hkappa : 0 < kappa := inv_pos.mpr hL have hBnorm (x : E) : kappa * ‖x‖ ≤ ‖B x‖ := by have h := hanti x 0 have hh := ENNReal.toReal_mono (by finiteness) h have h' : ‖x‖ ≤ (L : ℝ) * ‖B x‖ := by simpa [edist_dist, dist_eq_norm, ENNReal.toReal_mul] using hh change (L : ℝ)⁻¹ * ‖x‖ ≤ ‖B x‖ calc (L : ℝ)⁻¹ * ‖x‖ ≤ (L : ℝ)⁻¹ * ((L : ℝ) * ‖B x‖) := mul_le_mul_of_nonneg_left h' (inv_nonneg.mpr hL.le) _ = ((L : ℝ)⁻¹ * (L : ℝ)) * ‖B x‖ := by ring _ = ‖B x‖ := by rw [inv_mul_cancel₀ (show (L : ℝ) ≠ 0 by exact_mod_cast ne_of_gt hL)] simp have hbounds : ∀ᶠ N in atTop, ∀ i, q i / 2 < qN N i ∧ qN N i < 2 * q i ∧ m i / 2 < mN N i ∧ mN N i < 2 * m i := by rw [Filter.eventually_all] intro i filter_upwards [ (tendsto_order.1 (hq i)).1 (q i / 2) (by linarith [hqpos i]), (tendsto_order.1 (hq i)).2 (2 * q i) (by linarith [hqpos i]), (tendsto_order.1 (hm i)).1 (m i / 2) (by linarith [hmpos i]), (tendsto_order.1 (hm i)).2 (2 * m i) (by linarith [hmpos i])] with N hqlo hqhi hmlo hmhi exact ⟨hqlo, hqhi, hmlo, hmhi⟩ let M : ℝ := ∑ i, (2 * q i) * ((2 * m i + 1) ^ 2 / 2) let Q : ℝ := ∑ i, 2 * q i have hM : 0 ≤ M := sum_nonneg fun i _ => mul_nonneg (mul_nonneg (by norm_num) (hqpos i).le) (div_nonneg (sq_nonneg _) (by norm_num)) have hQ : 0 ≤ Q := sum_nonneg fun i _ => mul_nonneg (by norm_num) (hqpos i).le let R : ℝ := (M + Q) / kappa have hR : 0 ≤ R := div_nonneg (add_nonneg hM hQ) hkappa.le let K : Set E := closedBall 0 R letI : ProperSpace E := proper_real E refine ⟨K, ProperSpace.isCompact_closedBall 0 R, ?_⟩ filter_upwards [hbounds, hmax] with N hb hmaxN have htail (x : E) : finitePoissonObjective (qN N) (mN N) A x ≤ M - ‖B x‖ := by have hterm : ∀ i, qN N i * (mN N i * A x i - exp (A x i)) ≤ (2 * q i) * ((2 * m i + 1) ^ 2 / 2) - |B x i| := by intro i have hc := poissonCell_linear_coercive_bound (mN N i) (A x i) (lt_trans (half_pos (hmpos i)) (hb i).2.2.1) have hqn : 0 ≤ qN N i := (lt_trans (half_pos (hqpos i)) (hb i).1).le have hlower : w i ≤ qN N i * min (mN N i) 1 := by exact mul_le_mul (le_of_lt (hb i).1) (min_le_min (le_of_lt (hb i).2.2.1) le_rfl) (le_min (half_pos (hmpos i)).le zero_le_one) hqn have habs : |B x i| = w i * |A x i| := by dsimp [B] rw [abs_mul, abs_of_pos (hwpos i)] rw [habs] have hcoarse := mul_le_mul_of_nonneg_left hc hqn have hconst : qN N i * ((mN N i + 1) ^ 2 / 2) ≤ (2 * q i) * ((2 * m i + 1) ^ 2 / 2) := by have hmn0 : 0 ≤ mN N i := (lt_trans (half_pos (hmpos i)) (hb i).2.2.1).le have hmupper := (hb i).2.2.2 have hsq : (mN N i + 1) ^ 2 ≤ (2 * m i + 1) ^ 2 := by nlinarith exact mul_le_mul (le_of_lt (hb i).2.1) (div_le_div_of_nonneg_right hsq (by norm_num)) (div_nonneg (sq_nonneg _) (by norm_num)) (mul_nonneg (by norm_num) (hqpos i).le) nlinarith [mul_le_mul_of_nonneg_right hlower (abs_nonneg (A x i))] calc finitePoissonObjective (qN N) (mN N) A x ≤ ∑ i, ((2 * q i) * ((2 * m i + 1) ^ 2 / 2) - |B x i|) := Finset.sum_le_sum fun i _ => hterm i _ = M - ∑ i, |B x i| := by rw [Finset.sum_sub_distrib] _ ≤ M - ‖B x‖ := by gcongr rw [Pi.norm_def] have hnn : (Finset.univ.sup fun i => ‖B x i‖₊) ≤ ∑ i, ‖B x i‖₊ := Finset.sup_le fun i _ => Finset.single_le_sum (f := fun j => ‖B x j‖₊) (fun j _ => zero_le) (Finset.mem_univ i) calc ((Finset.univ.sup fun i => ‖B x i‖₊ : NNReal) : ℝ) ≤ ((∑ i, ‖B x i‖₊ : NNReal) : ℝ) := NNReal.coe_le_coe.mpr hnn _ = ∑ i, |B x i| := by simp [Real.norm_eq_abs] have hzero : -Q ≤ finitePoissonObjective (qN N) (mN N) A 0 := by unfold finitePoissonObjective simp only [map_zero, Pi.zero_apply, mul_zero, Real.exp_zero, zero_sub, mul_neg, mul_one, Finset.sum_neg_distrib, neg_le_neg_iff] exact Finset.sum_le_sum fun i _ => (hb i).2.1.le have hchain := (hzero.trans (hmaxN 0)).trans (htail (argmax N)) have hbn := hBnorm (argmax N) have hnorm : ‖argmax N‖ ≤ R := by dsimp [R] apply (le_div_iff₀ hkappa).2 linarith simpa [K, Metric.mem_closedBall, dist_eq_norm] using hnorm
    Causalean.Stat.finitePoissonObjective_eventually_common_compact · Causalean/Stat/MEstimation/FinitePoissonConsistency.lean:65
Finite­Poisson­Derivative 2 core · 0 supporting This module differentiates the unique maximizer of a full-rank finite Poisson criterion when one cell mean follows a positive exponential path. ★ finitePoissonObjective_expCell_argmax_snd_hasDerivAt

One-cell derivatives of finite Poisson projections

This module differentiates the unique maximizer of a full-rank finite Poisson criterion when one cell mean follows a positive exponential path.

def expCellUpdatedMean reviewed
Causalean.Stat

Replace one cell mean by a positive exponential path.

Definition (Lean source)
noncomputable def expCellUpdatedMean {I : Type*} [DecidableEq I] (m : I → ℝ) (j : I) (B x : ℝ) : I → ℝ := update m j (B * exp x)
lemma finitePoissonObjective_expCell_argmax_snd_hasDerivAt reviewed
Causalean.Stat

Derivative of the finite Poisson maximizer under one exponentially perturbed cell mean. Suppose every cell weight is strictly positive, every base cell mean is strictly positive, the perturbation scale B is strictly positive, and the linear design map is injective; consider replacing cell j's mean by the exponential path x ↦ B · exp x. If betaDot is the unique value solving the score equation linearized at the maximizer for base point x₀, for every perturbation direction, then the second (scalar) coordinate of the maximizer, as a function of x, has derivative betaDot at x₀.

Formal statement
q m :
I → ℝ
A :
(U × ℝ) →ₗ[ℝ] (I → ℝ)
j :
I
B x₀ betaDot :
hq :
∀ i, 0 < q i
hm :
∀ i, 0 < m i
hB :
0 < B
hA :
hbeta :
∀ v : U × ℝ
if
(∀ d : U × ℝ, ∑ i, q i * A d i * ((if i = j then B * exp x₀ else 0) - exp (A (maximizerOrZero (finitePoissonObjective q (expCellUpdatedMean m j B x₀) A)) i) * A v i) = 0)
then
v.2 = betaDot
HasDerivAt (fun x => (maximizerOrZero (finitePoissonObjective q (expCellUpdatedMean m j B x) A)).2) betaDot x₀
Proof (Lean source)
lemma finitePoissonObjective_expCell_argmax_snd_hasDerivAt {U I : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] [FiniteDimensional ℝ U] [Fintype I] [DecidableEq I] [Nonempty I] (q m : I → ℝ) (A : (U × ℝ) →ₗ[ℝ] (I → ℝ)) (j : I) (B x₀ betaDot : ℝ) (hq : ∀ i, 0 < q i) (hm : ∀ i, 0 < m i) (hB : 0 < B) (hA : Injective A) (hbeta : ∀ v : U × ℝ, (∀ d : U × ℝ, ∑ i, q i * A d i * ((if i = j then B * exp x₀ else 0) - exp (A (maximizerOrZero (finitePoissonObjective q (expCellUpdatedMean m j B x₀) A)) i) * A v i) = 0) → v.2 = betaDot) : HasDerivAt (fun x => (maximizerOrZero (finitePoissonObjective q (expCellUpdatedMean m j B x) A)).2) betaDot x₀ := by classical let E := U × ℝ let b := Basis.ofVectorSpace ℝ E let theta₀ : E := maximizerOrZero (finitePoissonObjective q (expCellUpdatedMean m j B x₀) A) let S : ℝ × E → (Basis.ofVectorSpaceIndex ℝ E → ℝ) := fun p k ↦ ∑ i, q i * A (b k) i * ((if i = j then B * exp p.1 else m i) - exp (A p.2 i)) let D : (ℝ × E) →L[ℝ] (Basis.ofVectorSpaceIndex ℝ E → ℝ) := ContinuousLinearMap.pi fun k ↦ ∑ i, (q i * A (b k) i) • (((if i = j then B * exp x₀ else 0) • ContinuousLinearMap.fst ℝ ℝ E) - (exp (A theta₀ i)) • ((ContinuousLinearMap.proj i).comp (A.toContinuousLinearMap.comp (ContinuousLinearMap.snd ℝ ℝ E)))) have hSD : HasFDerivAt S D (x₀, theta₀) := by dsimp [S, D] rw [hasFDerivAt_pi] intro k apply HasFDerivAt.fun_sum intro i hi by_cases hij : i = j · subst i have hleft := (hasFDerivAt_fst (p := (x₀, theta₀))).exp.const_mul B have hright := (((ContinuousLinearMap.proj j).comp (A.toContinuousLinearMap.comp (ContinuousLinearMap.snd ℝ ℝ E))).hasFDerivAt (x := (x₀, theta₀))).exp convert (hleft.fun_sub hright).const_mul (q j * A (b k) j) using 1 <;> first | rfl | (ext z <;> simp) · have hleft : HasFDerivAt (fun _p : ℝ × E ↦ m i) (0 : (ℝ × E) →L[ℝ] ℝ) (x₀, theta₀) := hasFDerivAt_const (x := (x₀, theta₀)) (c := m i) have hright := (((ContinuousLinearMap.proj i).comp (A.toContinuousLinearMap.comp (ContinuousLinearMap.snd ℝ ℝ E))).hasFDerivAt (x := (x₀, theta₀))).exp convert (hleft.fun_sub hright).const_mul (q i * A (b k) i) using 1 <;> first | rfl | (ext z <;> simp [hij]) let L : E →L[ℝ] (Basis.ofVectorSpaceIndex ℝ E → ℝ) := D.comp (ContinuousLinearMap.inr ℝ ℝ E) have hL_inj : Injective L := by intro v w hvw have hzero : L (v - w) = 0 := by rw [map_sub, hvw, sub_self] let G : E →ₗ[ℝ] ℝ := { toFun := fun d ↦ ∑ i, q i * exp (A theta₀ i) * A d i * A (v - w) i map_add' := by intro d e simp only [map_add, Pi.add_apply] rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i hi ring map_smul' := by intro c d simp only [map_smul, RingHom.id_apply, Pi.smul_apply, smul_eq_mul] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi ring } have hG : G = 0 := by apply b.ext intro k have hk : L (v - w) k = 0 := by simpa using congrFun hzero k norm_num [L, D] at hk have hk' : -(∑ i, q i * A (b k) i * (exp (A theta₀ i) * A (v - w) i)) = 0 := by convert hk using 1 rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro i hi by_cases hij : i = j <;> simp [hij] dsimp [G] have hk'' := neg_eq_zero.mp hk' convert hk'' using 1 apply Finset.sum_congr rfl intro i hi ring have hsum : ∑ i, q i * exp (A theta₀ i) * (A (v - w) i) ^ 2 = 0 := by have hu := LinearMap.congr_fun hG (v - w) change ∑ i, q i * exp (A theta₀ i) * A (v - w) i * A (v - w) i = 0 at hu convert hu using 1 apply Finset.sum_congr rfl intro i hi ring have hAv : A (v - w) = 0 := by funext i have hi := (Finset.sum_eq_zero_iff_of_nonneg (fun i _ ↦ mul_nonneg (mul_nonneg (le_of_lt (hq i)) (le_of_lt (Real.exp_pos _))) (sq_nonneg _))).mp hsum i (Finset.mem_univ i) have hpos : 0 < q i * exp (A theta₀ i) := mul_pos (hq i) (Real.exp_pos _) exact sq_eq_zero_iff.mp ((mul_eq_zero.mp hi).resolve_left (ne_of_gt hpos)) apply sub_eq_zero.mp apply hA simpa using hAv have hdim : finrank ℝ E = finrank ℝ (Basis.ofVectorSpaceIndex ℝ E → ℝ) := by simpa [Module.finrank_pi_fintype, finrank_self] using Module.finrank_eq_card_basis b have hL_bij : Bijective L := ⟨hL_inj, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hdim).mp hL_inj⟩ have hScont : ContDiffAt ℝ 1 S (x₀, theta₀) := by dsimp [S] rw [contDiffAt_pi] intro k apply ContDiffAt.sum intro i hi have heta : ContDiffAt ℝ 1 (fun p : ℝ × E ↦ A p.2 i) (x₀, theta₀) := ((ContinuousLinearMap.proj i).comp (A.toContinuousLinearMap.comp (ContinuousLinearMap.snd ℝ ℝ E))).contDiff.contDiffAt by_cases hij : i = j · subst i have hBexp : ContDiffAt ℝ 1 (fun p : ℝ × E ↦ B * exp p.1) (x₀, theta₀) := contDiffAt_const.mul contDiffAt_fst.exp simpa using contDiffAt_const.mul (hBexp.sub heta.exp) · have hmconst : ContDiffAt ℝ 1 (fun _p : ℝ × E ↦ m i) (x₀, theta₀) := contDiffAt_const simpa [hij] using contDiffAt_const.mul (hmconst.sub heta.exp) have hpn : (1 : WithTop ℕ∞) ≠ 0 := by norm_num have hfd : fderiv ℝ S (x₀, theta₀) = D := hSD.fderiv have hinv : ((fderiv ℝ S (x₀, theta₀)).comp (ContinuousLinearMap.inr ℝ ℝ E)).IsInvertible := by rw [hfd] exact ⟨ContinuousLinearEquiv.ofBijective L (LinearMap.ker_eq_bot.mpr hL_bij.1) (LinearMap.range_eq_top.mpr hL_bij.2), ContinuousLinearEquiv.coe_ofBijective _ _ _⟩ let phi : ℝ → E := hScont.implicitFunction hpn hinv have hmexp (x : ℝ) : ∀ i, 0 < expCellUpdatedMean m j B x i := by intro i simp only [expCellUpdatedMean, Function.update_apply] split · exact mul_pos hB (Real.exp_pos _) · exact hm i have hmax0 : ∀ y, finitePoissonObjective q (expCellUpdatedMean m j B x₀) A y ≤ finitePoissonObjective q (expCellUpdatedMean m j B x₀) A theta₀ := by obtain ⟨xstar, hxstar, huniq⟩ := finitePoissonObjective_exists_unique_max q (expCellUpdatedMean m j B x₀) A hq (hmexp x₀) hA have hex : ∃ x, ∀ y, finitePoissonObjective q (expCellUpdatedMean m j B x₀) A y ≤ finitePoissonObjective q (expCellUpdatedMean m j B x₀) A x := ⟨xstar, hxstar⟩ dsimp [theta₀, maximizerOrZero] rw [dif_pos hex] exact Classical.choose_spec hex have hS0 : S (x₀, theta₀) = 0 := by funext k have hs := finitePoissonObjective_score q (expCellUpdatedMean m j B x₀) A theta₀ (b k) hmax0 simpa [S, expCellUpdatedMean, Function.update_apply] using hs have hphi0 : phi x₀ = theta₀ := hScont.implicitFunction_apply_self hpn hinv have hphi_score : ∀ᶠ x in nhds x₀, S (x, phi x) = 0 := by filter_upwards [hScont.eventually_apply_implicitFunction hpn hinv] with x hx change S (x, phi x) = 0 simpa only [hS0] using hx have hselected_phi : (fun x ↦ maximizerOrZero (finitePoissonObjective q (expCellUpdatedMean m j B x) A)) =ᶠ[nhds x₀] phi := by filter_upwards [hphi_score] with x hx let Gx : E →ₗ[ℝ] ℝ := { toFun := fun d ↦ ∑ i, q i * A d i * (expCellUpdatedMean m j B x i - exp (A (phi x) i)) map_add' := by intro d e simp only [map_add, Pi.add_apply] rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i hi ring map_smul' := by intro c d simp only [map_smul, RingHom.id_apply, Pi.smul_apply, smul_eq_mul] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi ring } have hGx : Gx = 0 := by apply b.ext intro k have hk := congrFun hx k simpa [Gx, S, expCellUpdatedMean, Function.update_apply] using hk have hscore : ∀ d : E, ∑ i, q i * A d i * (expCellUpdatedMean m j B x i - exp (A (phi x) i)) = 0 := by intro d exact LinearMap.congr_fun hGx d have hphimax := finitePoissonObjective_isMax_of_score q (expCellUpdatedMean m j B x) A (phi x) (fun i ↦ (hq i).le) hscore obtain ⟨xstar, hxstar, huniq⟩ := finitePoissonObjective_exists_unique_max q (expCellUpdatedMean m j B x) A hq (hmexp x) hA have hex : ∃ z, ∀ y, finitePoissonObjective q (expCellUpdatedMean m j B x) A y ≤ finitePoissonObjective q (expCellUpdatedMean m j B x) A z := ⟨xstar, hxstar⟩ rw [maximizerOrZero, dif_pos hex] have hchoose : choose hex = xstar := huniq _ (Classical.choose_spec hex) have hphi : phi x = xstar := huniq _ hphimax exact hchoose.trans hphi.symm have hphidiff : DifferentiableAt ℝ phi x₀ := by exact (hScont.contDiffAt_implicitFunction hpn hinv).differentiableAt (by norm_num) let v : E := fderiv ℝ phi x₀ 1 let P : ℝ →L[ℝ] (ℝ × E) := (id ℝ ℝ).prod (fderiv ℝ phi x₀) have hpair : HasFDerivAt (fun x ↦ (x, phi x)) P x₀ := by exact (hasFDerivAt_id x₀).prodMk hphidiff.hasFDerivAt have hcomp : HasFDerivAt (fun x ↦ S (x, phi x)) (D.comp P) x₀ := by have hSD' : HasFDerivAt S D (x₀, phi x₀) := by simpa [hphi0] using hSD exact hSD'.comp x₀ hpair have hcompzero : HasFDerivAt (fun x ↦ S (x, phi x)) (0 : ℝ →L[ℝ] (Basis.ofVectorSpaceIndex ℝ E → ℝ)) x₀ := by apply (hasFDerivAt_const (x := x₀) (c := (0 : Basis.ofVectorSpaceIndex ℝ E → ℝ))).congr_of_eventuallyEq exact hphi_score have hDPzero : D.comp P = 0 := hcomp.unique hcompzero have hvscore_basis (k : Basis.ofVectorSpaceIndex ℝ E) : ∑ i, q i * A (b k) i * ((if i = j then B * exp x₀ else 0) - exp (A theta₀ i) * A v i) = 0 := by have hk := congrFun (congrArg (fun F ↦ F 1) hDPzero) k dsimp [D, P, v] at hk rw [ContinuousLinearMap.sum_apply] at hk simp only [ContinuousLinearMap.smul_apply, ContinuousLinearMap.sub_apply, ContinuousLinearMap.comp_apply] at hk simpa [mul_sub] using hk -- … truncated; follow the source link for the rest …
Finite­Poisson­Sign 1 core · 0 supporting This module characterizes the sign of one selected coefficient from the score at a conditional nuisance fit with that coefficient fixed at zero. ★ finitePoissonObjective_snd_sign_of_nuisance_score

Conditional sign characterization for finite Poisson projections

This module characterizes the sign of one selected coefficient from the score at a conditional nuisance fit with that coefficient fixed at zero.

lemma finitePoissonObjective_snd_sign_of_nuisance_score reviewed
Causalean.Stat

Sign of the selected scalar coefficient from the nuisance score. Suppose every cell weight is strictly positive, every cell mean is strictly positive, the linear design map is injective, and the conditional nuisance fit u₀, with the scalar coordinate held at zero, clears every nuisance-direction score. Then the selected scalar coefficient of the finite Poisson maximizer has exactly the sign of the remaining scalar score: it is negative, zero, or positive exactly when the scalar score is.

Formal statement
U I :
q m :
I → ℝ
A :
(U × ℝ) →ₗ[ℝ] (I → ℝ)
u₀ :
U
hq :
∀ i, 0 < q i
hm :
∀ i, 0 < m i
hA :
hNuisance :
∀ u : U, ∑ i, q i * A (u, 0) i * (m i - exp (A (u₀, 0) i)) = 0
let beta := (maximizerOrZero (finitePoissonObjective q m A)).2 let scalarScore := ∑ i, q i * A (0, 1) i * (m i - exp (A (u₀, 0) i)) (beta < 0 ↔ scalarScore < 0) ∧
(beta = 0 ↔ scalarScore = 0) ∧
(0 < beta ↔ 0 < scalarScore)
Proof (Lean source)
lemma finitePoissonObjective_snd_sign_of_nuisance_score {U I : Type*} [NormedAddCommGroup U] [NormedSpace ℝ U] [FiniteDimensional ℝ U] [Fintype I] [Nonempty I] (q m : I → ℝ) (A : (U × ℝ) →ₗ[ℝ] (I → ℝ)) (u₀ : U) (hq : ∀ i, 0 < q i) (hm : ∀ i, 0 < m i) (hA : Injective A) (hNuisance : ∀ u : U, ∑ i, q i * A (u, 0) i * (m i - exp (A (u₀, 0) i)) = 0) : let beta := (maximizerOrZero (finitePoissonObjective q m A)).2 let scalarScore := ∑ i, q i * A (0, 1) i * (m i - exp (A (u₀, 0) i)) (beta < 0 ↔ scalarScore < 0) ∧ (beta = 0 ↔ scalarScore = 0) ∧ (0 < beta ↔ 0 < scalarScore) := by classical dsimp only let xstar : U × ℝ := maximizerOrZero (finitePoissonObjective q m A) let xzero : U × ℝ := (u₀, 0) let v : U × ℝ := xstar - xzero let scalarScore : ℝ := ∑ i, q i * A (0, 1) i * (m i - exp (A xzero i)) have hunique := finitePoissonObjective_exists_unique_max q m A hq hm hA obtain ⟨x, hxmax, hxunique⟩ := hunique have hexists : ∃ x, ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A x := ⟨x, hxmax⟩ have hxstar_eq : xstar = x := by dsimp [xstar, maximizerOrZero] rw [dif_pos hexists] exact hxunique _ (Classical.choose_spec hexists) have hxstar : ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A xstar := by rw [hxstar_eq] exact hxmax have hstarScore (d : U × ℝ) : ∑ i, q i * A d i * (m i - exp (A xstar i)) = 0 := finitePoissonObjective_score q m A xstar d hxstar have hxstar_add : xstar = xzero + v := by simp [v] have hzeroScore (d : U × ℝ) : (∑ i, q i * A d i * (m i - exp (A xzero i))) = d.2 * scalarScore := by have hd : d = (d.1, 0) + d.2 • (0, (1 : ℝ)) := by ext <;> simp have hAd (i : I) : A d i = A (d.1, 0) i + d.2 * A (0, 1) i := by calc A d i = A ((d.1, 0) + d.2 • (0, (1 : ℝ))) i := congrArg (fun z => A z i) hd _ = _ := by rw [map_add, map_smul] simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul] calc _ = ∑ i, (q i * A (d.1, 0) i * (m i - exp (A xzero i)) + d.2 * (q i * A (0, 1) i * (m i - exp (A xzero i)))) := by apply Finset.sum_congr rfl intro i _ rw [hAd] ring _ = (∑ i, q i * A (d.1, 0) i * (m i - exp (A xzero i))) + d.2 * ∑ i, q i * A (0, 1) i * (m i - exp (A xzero i)) := by rw [Finset.sum_add_distrib, Finset.mul_sum] _ = d.2 * scalarScore := by rw [show (∑ i, q i * A (d.1, 0) i * (m i - exp (A xzero i))) = 0 by simpa [xzero] using hNuisance d.1] simp [scalarScore] have hvsecond : v.2 = xstar.2 := by simp [v, xzero] have hstrict (hv : v ≠ 0) : 0 < xstar.2 * scalarScore := by have hAv : A v ≠ 0 := fun hav => hv (hA (by simpa using hav)) obtain ⟨i, hi⟩ : ∃ i, A v i ≠ 0 := by simpa only [Function.ne_iff, Pi.zero_apply] using hAv have harg (j : I) : A xstar j = A xzero j + A v j := by rw [hxstar_add, map_add] rfl have hnonneg (j : I) : 0 ≤ q j * A v j * (exp (A xstar j) - exp (A xzero j)) := by have hqj := (hq j).le by_cases hav : 0 ≤ A v j · have he : exp (A xzero j) ≤ exp (A xstar j) := by apply Real.exp_le_exp.mpr rw [harg] linarith exact mul_nonneg (mul_nonneg hqj hav) (sub_nonneg.mpr he) · have hav' : A v j ≤ 0 := le_of_not_ge hav have he : exp (A xstar j) ≤ exp (A xzero j) := by apply Real.exp_le_exp.mpr rw [harg] linarith have : exp (A xstar j) - exp (A xzero j) ≤ 0 := sub_nonpos.mpr he exact mul_nonneg_of_nonpos_of_nonpos (mul_nonpos_of_nonneg_of_nonpos hqj hav') this have hposi : 0 < q i * A v i * (exp (A xstar i) - exp (A xzero i)) := by rcases lt_or_gt_of_ne hi with hav | hav · have he : exp (A xstar i) < exp (A xzero i) := by apply Real.exp_lt_exp.mpr rw [harg] linarith have hdiff : exp (A xstar i) - exp (A xzero i) < 0 := sub_neg.mpr he exact mul_pos_of_neg_of_neg (mul_neg_of_pos_of_neg (hq i) hav) hdiff · have he : exp (A xzero i) < exp (A xstar i) := by apply Real.exp_lt_exp.mpr rw [harg] linarith exact mul_pos (mul_pos (hq i) hav) (sub_pos.mpr he) have hsumpos : 0 < ∑ j, q j * A v j * (exp (A xstar j) - exp (A xzero j)) := by apply Finset.sum_pos' · intro j _ exact hnonneg j · exact ⟨i, Finset.mem_univ i, hposi⟩ have hdecomp : (∑ j, q j * A v j * (m j - exp (A xzero j))) = (∑ j, q j * A v j * (m j - exp (A xstar j))) + ∑ j, q j * A v j * (exp (A xstar j) - exp (A xzero j)) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j _ ring rw [hzeroScore v, hvsecond, hstarScore v, zero_add] at hdecomp rw [hdecomp] exact hsumpos have hzero : xstar.2 = 0 ↔ scalarScore = 0 := by constructor · intro hb by_contra hs have hv : v = 0 := by by_contra hv have := hstrict hv rw [hb, zero_mul] at this exact (lt_irrefl 0) this have hscalar := hstarScore (0, 1) rw [show xstar = xzero by simpa [v] using congrArg (fun z => z + xzero) hv] at hscalar exact hs (by simpa [scalarScore] using hscalar) · intro hs have hzeroScore' (d : U × ℝ) : ∑ i, q i * A d i * (m i - exp (A xzero i)) = 0 := by rw [hzeroScore d, hs, mul_zero] have hxzero : ∀ y, finitePoissonObjective q m A y ≤ finitePoissonObjective q m A xzero := finitePoissonObjective_isMax_of_score q m A xzero (fun i => (hq i).le) hzeroScore' have hxzero_eq : xzero = x := hxunique xzero hxzero rw [hxstar_eq, ← hxzero_eq] have hneg : xstar.2 < 0 ↔ scalarScore < 0 := by constructor · intro hb have hv : v ≠ 0 := by intro hv have := congrArg snd hv simp [v, xzero] at this linarith have hp := hstrict hv nlinarith · intro hs have hb : xstar.2 ≠ 0 := fun hb => hs.ne (hzero.mp hb) have hv : v ≠ 0 := by intro hv have hsnd : xstar.2 = 0 := by simpa [v, xzero] using congrArg snd hv exact hb hsnd have hp := hstrict hv nlinarith have hpos : 0 < xstar.2 ↔ 0 < scalarScore := by constructor · intro hb have hv : v ≠ 0 := by intro hv have := congrArg snd hv simp [v, xzero] at this linarith have hp := hstrict hv nlinarith · intro hs have hb : xstar.2 ≠ 0 := fun hb => hs.ne' (hzero.mp hb) have hv : v ≠ 0 := by intro hv have hsnd : xstar.2 = 0 := by simpa [v, xzero] using congrArg snd hv exact hb hsnd have hp := hstrict hv nlinarith simpa [xstar, xzero, scalarScore] using intro hneg (intro hzero hpos)
Causalean.Stat.finitePoissonObjective_snd_sign_of_nuisance_score · Causalean/Stat/MEstimation/FinitePoissonSign.lean:21 · uses finitePoissonObjective , maximizerOrZero
Influence­Function 1 core · 0 supporting This module defines InfluenceFunction, the basic data-layer predicate for an influence function under a sampling law. ★ InfluenceFunction

Influence-function data layer

This module defines InfluenceFunction, the basic data-layer predicate for an influence function under a sampling law. It records exactly the public requirements needed by downstream asymptotic-linearity wrappers: measurability, mean zero, and an integrable squared norm.

structure InfluenceFunction reviewed
Causalean.Stat

An influence function for a parameter θ ∈ E under the law P : Measure X is a measurable, mean-zero, square-integrable function ψ : X → E.

Definition (Lean source)
P :
ψ :
X → E
`ψ` is measurable.
measurable :
`ψ` has mean zero under `P`.
mean_zero :
∫ x, ψ x ∂P = 0
`ψ` has finite second moment: `‖ψ‖² ∈ L¹(P)`.
finite_var :
Integrable (fun x => ‖ψ x‖^2) P
Causalean.Stat.InfluenceFunction · Causalean/Stat/MEstimation/InfluenceFunction.lean:41
ZEstimator­CLT 1 core · 0 supporting This module proves zEstimator_clt, the theorem layer for parametric estimators that solve empirical estimating equations. ★ zEstimator_clt

Z-estimator asymptotic linearity

This module proves zEstimator_clt, the theorem layer for parametric estimators that solve empirical estimating equations. It connects the local stochastic expansion from EmpiricalExpansion.lean to an IsAsymLinearVec influence-function representation with influence function fun z => -(reg.J₀_inv (ψ θ₀ z)); a separate vector CLT can then turn this asymptotic-linear representation into a normal limit.

theorem zEstimator_clt reviewed
Causalean.Stat

Z-estimator asymptotic linearity. An estimator sequence that solves the empirical estimating equation eventually, almost surely, is consistent at the target parameter, converges to the target at the parametric n\sqrt n-rate, and whose score process is stochastically equicontinuous at the target parameter along the estimator sequence, admits the influence-function representation obtained by applying the negative inverse Jacobian to the target score.

Formal statement
ψ :
E → X → E
θ₀ :
E
P :
reg :
S :
IIDSample Ω X μ P
θn :
ℕ → Ω → E
hConsistent :
∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)
hStochEquicont :
StochEquicontAt ψ θ₀ P μ S θn
hRate :
IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ
hMoment :
∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0
IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n)
Proof (Lean source)
theorem zEstimator_clt (ψ : E → X → E) (θ₀ : E) (P : Measure X) (reg : ZEstimatorRegularity ψ θ₀ P) [IsProbabilityMeasure μ] (S : IIDSample Ω X μ P) (θn : ℕ → Ω → E) (hConsistent : ∀ ε > 0, Tendsto (fun n => μ {ω | ε < ‖θn n ω - θ₀‖}) atTop (𝓝 0)) (hStochEquicont : StochEquicontAt ψ θ₀ P μ S θn) (hRate : IsBigOp (fun n ω => ‖θn n ω - θ₀‖) (fun n => (sqrt (n : ℝ))⁻¹) μ) (hMoment : ∀ᶠ n in atTop, ∀ᵐ ω ∂μ, ∑ i ∈ range n, ψ (θn n ω) (S.Z i ω) = 0) : IsAsymLinearVec (E := E) θn θ₀ (fun z => -(reg.J₀_inv (ψ θ₀ z))) S (fun n => range n) := by /- Proof outline (van der Vaart 1998 Thm 5.41): 1. Apply `localStochasticExpansion ψ θ₀ P reg S θn hConsistent hRate` to obtain (1/√n) ∑ (ψ(θn,Z_i) − ψ(θ₀,Z_i)) − √n · J₀ (θn − θ₀) = o_p(1). 2. Combine with `hMoment`: `∑ ψ(θn, Z_i) = 0` eventually a.s., so (1/√n) ∑ ψ(θ₀, Z_i) + √n · J₀ (θn − θ₀) = o_p(1). 3. Apply `reg.J₀_inv` (a continuous linear map; in particular bounded), so √n · (θn − θ₀) + (√n)⁻¹ • ∑ J₀⁻¹ (ψ(θ₀, Z_i)) = o_p(1). 4. Rearrange to match `IsAsymLinearVec.remainder` with `ψ_IF` = `−J₀⁻¹ · ψ(·;θ₀)`; mean_zero from `reg.identification` + linearity of `J₀⁻¹`; finite_var from `reg.finite_var` + boundedness of `J₀⁻¹`. -/ refine ⟨?_, ?_, ?_⟩ · -- mean_zero: `∫ -(reg.J₀_inv (ψ θ₀ z)) dP = 0`. rcases reg.psi_int_neighborhood with ⟨δ, hδ_pos, hδ_int⟩ have hψ₀ : Integrable (ψ θ₀) P := by exact hδ_int θ₀ (by simpa using hδ_pos) calc ∫ x, -(reg.J₀_inv (ψ θ₀ x)) ∂P = -(∫ x, reg.J₀_inv (ψ θ₀ x) ∂P) := by rw [MeasureTheory.integral_neg] _ = -(reg.J₀_inv (∫ x, ψ θ₀ x ∂P)) := by rw [ContinuousLinearMap.integral_comp_comm reg.J₀_inv hψ₀] _ = 0 := by simp [reg.identification] · -- finite_var: `Integrable (fun z => ‖-(reg.J₀_inv (ψ θ₀ z))‖²) P`. have hbound : ∀ z, ‖-(reg.J₀_inv (ψ θ₀ z))‖^2 ≤ ‖reg.J₀_inv‖^2 * ‖ψ θ₀ z‖^2 := by intro z have hnorm : ‖reg.J₀_inv (ψ θ₀ z)‖ ≤ ‖reg.J₀_inv‖ * ‖ψ θ₀ z‖ := reg.J₀_inv.le_opNorm (ψ θ₀ z) have hleft_nonneg : 0 ≤ ‖reg.J₀_inv (ψ θ₀ z)‖ := norm_nonneg _ have hop_nonneg : 0 ≤ ‖reg.J₀_inv‖ := norm_nonneg _ have hψ_nonneg : 0 ≤ ‖ψ θ₀ z‖ := norm_nonneg _ calc ‖-(reg.J₀_inv (ψ θ₀ z))‖^2 = ‖reg.J₀_inv (ψ θ₀ z)‖^2 := by rw [norm_neg] _ ≤ ‖reg.J₀_inv‖^2 * ‖ψ θ₀ z‖^2 := by nlinarith refine (reg.finite_var.const_mul (‖reg.J₀_inv‖^2)).mono' ?_ ?_ · have hL : Measurable fun z => reg.J₀_inv (ψ θ₀ z) := reg.J₀_inv.continuous.measurable.comp (reg.psi_meas θ₀) exact (hL.neg.norm.pow_const 2).aestronglyMeasurable · refine Eventually.of_forall ?_ intro z have hz_nonneg : 0 ≤ ‖-(reg.J₀_inv (ψ θ₀ z))‖^2 := sq_nonneg _ simpa [Real.norm_eq_abs, abs_of_nonneg hz_nonneg] using hbound z · -- remainder: combine `localStochasticExpansion` with `hMoment`, -- multiply by `reg.J₀_inv` (using `reg.J₀_inverse`), and collect into -- `IsAsymLinearVec.remainder` shape. have hA : IsLittleOp (fun n ω => ‖(sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)) - sqrt (n : ℝ) • reg.J₀ (θn n ω - θ₀)‖) (fun _ => (1 : ℝ)) μ := localStochasticExpansion ψ θ₀ P reg S θn hConsistent hStochEquicont hRate let A : ℕ → Ω → E := fun n ω => (sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)) - sqrt (n : ℝ) • reg.J₀ (θn n ω - θ₀) let B : ℕ → Ω → E := fun n ω => sqrt (n : ℝ) • (θn n ω - θ₀) - (sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, -reg.J₀_inv (ψ θ₀ (S.Z i ω)) have hA' : IsLittleOp (fun n ω => ‖A n ω‖) (fun _ => (1 : ℝ)) μ := by simpa [A] using hA have hJ_left : ∀ x : E, reg.J₀_inv (reg.J₀ x) = x := by have hJ_surj : Surjective reg.J₀ := fun y => ⟨reg.J₀_inv y, by have := congrArg (fun T : E →L[ℝ] E => T y) reg.J₀_inverse simpa using this⟩ have hJ_inj : Injective reg.J₀ := by exact (LinearMap.injective_iff_surjective (f := (reg.J₀ : E →ₗ[ℝ] E))).mpr hJ_surj intro x apply hJ_inj have := congrArg (fun T : E →L[ℝ] E => T (reg.J₀ x)) reg.J₀_inverse simpa using this have hJInvA : IsLittleOp (fun n ω => ‖reg.J₀_inv (A n ω)‖) (fun _ => (1 : ℝ)) μ := by intro ε hε let C : ℝ := ‖reg.J₀_inv‖ + 1 have hC_pos : 0 < C := by have hnonneg : 0 ≤ ‖reg.J₀_inv‖ := norm_nonneg _ dsimp [C] linarith have hAε := hA' (ε / C) (div_pos hε hC_pos) rw [ENNReal.tendsto_nhds_zero] at hAε ⊢ intro δ hδ exact (hAε δ hδ).mono fun n hn => by refine (measure_mono ?_).trans hn intro ω hω have hbound0 : ‖reg.J₀_inv (A n ω)‖ ≤ ‖reg.J₀_inv‖ * ‖A n ω‖ := reg.J₀_inv.le_opNorm (A n ω) have hC_le : ‖reg.J₀_inv‖ ≤ C := by dsimp [C] linarith [norm_nonneg reg.J₀_inv] have hbound : ‖reg.J₀_inv (A n ω)‖ ≤ C * ‖A n ω‖ := le_trans hbound0 (mul_le_mul_of_nonneg_right hC_le (norm_nonneg _)) have hω' : ε < ‖reg.J₀_inv (A n ω)‖ := by simpa [abs_of_nonneg (norm_nonneg _)] using hω have hmul : ε < C * ‖A n ω‖ := lt_of_lt_of_le hω' hbound have hdiv : ε / C < ‖A n ω‖ := (div_lt_iff₀ hC_pos).2 (by simpa [mul_comm] using hmul) simpa [abs_of_nonneg (norm_nonneg _)] using hdiv have hB : IsLittleOp (fun n ω => ‖B n ω‖) (fun _ => (1 : ℝ)) μ := by intro ε hε have hJ := hJInvA ε hε rw [ENNReal.tendsto_nhds_zero] at hJ ⊢ intro δ hδ filter_upwards [hMoment, hJ δ hδ] with n hzero_ae hn have hmeasure : μ {ω | ε * (fun _ => (1 : ℝ)) n < |‖B n ω‖|} ≤ μ {ω | ε * (fun _ => (1 : ℝ)) n < |‖reg.J₀_inv (A n ω)‖|} := by apply MeasureTheory.measure_mono_ae exact hzero_ae.mono fun ω hzero hω => by have hsumdiff : (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) = -∑ i ∈ range n, ψ θ₀ (S.Z i ω) := by calc (∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω))) = (∑ i ∈ range n, ψ (θn n ω) (S.Z i ω)) - ∑ i ∈ range n, ψ θ₀ (S.Z i ω) := by rw [Finset.sum_sub_distrib] _ = -∑ i ∈ range n, ψ θ₀ (S.Z i ω) := by simp [hzero] have hnormeq : ‖B n ω‖ = ‖reg.J₀_inv (A n ω)‖ := by calc ‖B n ω‖ = ‖Real.sqrt (n : ℝ) • (θn n ω - θ₀) - (sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, -reg.J₀_inv (ψ θ₀ (S.Z i ω))‖ := by rfl _ = ‖-reg.J₀_inv ((sqrt (n : ℝ))⁻¹ • ∑ i ∈ range n, (ψ (θn n ω) (S.Z i ω) - ψ θ₀ (S.Z i ω)) - sqrt (n : ℝ) • reg.J₀ (θn n ω - θ₀))‖ := by rw [hsumdiff] simp [map_sum, hJ_left, sub_eq_add_neg, add_comm, add_left_comm, add_assoc] _ = ‖-reg.J₀_inv (A n ω)‖ := by simp [A, map_sum, hJ_left, sub_eq_add_neg, add_comm, add_left_comm, add_assoc] _ = ‖reg.J₀_inv (A n ω)‖ := by rw [norm_neg] have hω' : ε < ‖B n ω‖ := by have hω₀ : ε * (1 : ℝ) < |‖B n ω‖| := hω simpa [abs_of_nonneg (norm_nonneg _)] using hω₀ have hω'' : ε < ‖reg.J₀_inv (A n ω)‖ := by rwa [hnormeq] at hω' change ε * (1 : ℝ) < |‖reg.J₀_inv (A n ω)‖| simpa [abs_of_nonneg (norm_nonneg _)] using hω'' exact by simpa using hmeasure.trans hn simpa [B, Finset.card_range] using hB