Stat
Statistical foundations: convergence modes, limit theorems, concentration inequalities, and minimax lower-bound tools.
AttainableSet 1 core · 0 supporting This file defines the identified set of a real-valued objective as the set of values attained over its feasible parameter set; it need not be an interval. ★ IdentifiedSet
Identified sets
This file defines the identified set of a real-valued objective as the set of values attained over its feasible parameter set; it need not be an interval. The definition is shared by potential-outcome and structural-causal-model partial identification results.
For a parameter space, an objective function, and a feasibility condition on its parameter values, the identified set is the set of all objective values attained by feasible parameters.
ConditionalLaw 6 core · 14 supporting This module packages an explicitly supplied Markov kernel that disintegrates a full observation law given a real-valued dose. ★ integral_graph
Chosen conditional laws for real doses
This module packages an explicitly supplied Markov kernel that disintegrates a full observation law given a real-valued dose. It supplies pointwise conditional moments from that one chosen kernel, without asserting that such a kernel exists.
A measurable observation space, probability law, and measurable real-valued dose map determine a chosen continuous-dose conditional law. It consists of a proof that the dose map is measurable, a kernel assigning to each real dose value a measure on observations, a proof that every such measure is a probability measure, and the coherence identity: drawing a dose from its marginal law and then an observation from the kernel at that dose reproduces the joint law of the dose and the observation. The kernel is supplied, not constructed; nothing asserts that the kernel at a dose value is concentrated on observations with that dose beyond what the coherence identity implies.
Definition (Lean source)
A chosen conditional law, joint real-valued quantity, and integrability under the joint dose--observation law imply that joint integration equals first averaging within each dose and then averaging over the dose distribution.
Formal statement
Proof (Lean source)
The chosen conditional law, real observation, and specified dose determine the pointwise conditional mean, given by integration against the selected kernel fiber.
Definition (Lean source)
The chosen conditional law, real observation, dose-indexed prediction, and specified dose determine the pointwise squared prediction risk, given by the kernel-fiber average of squared prediction error.
Definition (Lean source)
The chosen conditional law, real observation, and specified dose determine the conditional second moment, given by the kernel-fiber average of the squared observation.
Definition (Lean source)
The chosen conditional law, real observation, and specified dose determine the conditional variance, given by the squared risk of the conditional mean under the same kernel fiber.
Definition (Lean source)
14 supporting declarations (lemmas, instances)
-
kernel_probabilitytheorem — The chosen conditional law assigns a probability distribution to the specified dose, so its kernel fiber has total mass one.hypothesesconclusionIsProbabilityMeasure (L.K a)Proof (Lean source)
theorem kernel_probability (L : ContinuousDoseConditionalLaw Obs P A) (a : ℝ) : IsProbabilityMeasure (L.K a) := by haveI : IsMarkovKernel L.K := L.markov infer_instance -
dose_probabilitytheorem — The chosen conditional law makes the marginal distribution of the dose a probability measure.Proof (Lean source)
theorem dose_probability (L : ContinuousDoseConditionalLaw Obs P A) : IsProbabilityMeasure (P.map A) := by exact Measure.isProbabilityMeasure_map L.measurable_dose.aemeasurable -
mean_eq_integraltheorem — A chosen conditional law, real observation, and specified dose satisfy the defining integral formula for its conditional mean.hypothesesconclusionL.mean f a = ∫ ω, f ω ∂L.K aProof (Lean source)
theorem mean_eq_integral (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (a : ℝ) : L.mean f a = ∫ ω, f ω ∂L.K a := rfl -
squaredRisk_eq_integraltheorem — A chosen conditional law, real observation, dose-indexed prediction, and specified dose satisfy the defining integral formula for their squared prediction risk.hypothesesconclusionL.squaredRisk f g a = ∫ ω, (f ω - g a) ^ 2 ∂L.K aProof (Lean source)
theorem squaredRisk_eq_integral (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (g : ℝ → ℝ) (a : ℝ) : L.squaredRisk f g a = ∫ ω, (f ω - g a) ^ 2 ∂L.K a := rfl -
secondMoment_eq_integraltheorem — A chosen conditional law, real observation, and specified dose satisfy the defining integral formula for their conditional second moment.hypothesesconclusionL.secondMoment f a = ∫ ω, (f ω) ^ 2 ∂L.K aProof (Lean source)
theorem secondMoment_eq_integral (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (a : ℝ) : L.secondMoment f a = ∫ ω, (f ω) ^ 2 ∂L.K a := rfl -
variance_eq_integraltheorem — A chosen conditional law, real observation, and specified dose satisfy the defining integral formula for their conditional variance.hypothesesconclusionL.variance f a = ∫ ω, (f ω - L.mean f a) ^ 2 ∂L.K aProof (Lean source)
theorem variance_eq_integral (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (a : ℝ) : L.variance f a = ∫ ω, (f ω - L.mean f a) ^ 2 ∂L.K a := rfl -
squaredRisk_nonnegtheorem — A chosen conditional law, real observation, dose-indexed prediction, and specified dose have a nonnegative squared prediction risk.hypothesesconclusion0 ≤ L.squaredRisk f g aProof (Lean source)
theorem squaredRisk_nonneg (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (g : ℝ → ℝ) (a : ℝ) : 0 ≤ L.squaredRisk f g a := by simp only [squaredRisk] exact integral_nonneg fun ω ↦ sq_nonneg _ -
secondMoment_nonnegtheorem — A chosen conditional law, real observation, and specified dose have a nonnegative conditional second moment.hypothesesconclusion0 ≤ L.secondMoment f aProof (Lean source)
theorem secondMoment_nonneg (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (a : ℝ) : 0 ≤ L.secondMoment f a := by simp only [secondMoment] exact integral_nonneg fun ω ↦ sq_nonneg _ -
variance_nonnegtheorem — A chosen conditional law, real observation, and specified dose have a nonnegative conditional variance.hypothesesconclusion0 ≤ L.variance f aProof (Lean source)
theorem variance_nonneg (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (a : ℝ) : 0 ≤ L.variance f a := L.squaredRisk_nonneg f (L.mean f) a -
measurable_meantheorem — A chosen conditional law and measurable real observation give a measurable pointwise conditional mean.hypothesesconclusionMeasurable (L.mean f)Proof (Lean source)
theorem measurable_mean (L : ContinuousDoseConditionalLaw Obs P A) {f : Obs → ℝ} (hf : Measurable f) : Measurable (L.mean f) := by haveI : IsMarkovKernel L.K := L.markov exact hf.stronglyMeasurable.integral_kernel.measurable -
measurable_squaredRisktheorem — A chosen conditional law, measurable real observation, and measurable dose-indexed prediction give a measurable pointwise squared prediction risk.hypothesesconclusionMeasurable (L.squaredRisk f g)Proof (Lean source)
theorem measurable_squaredRisk (L : ContinuousDoseConditionalLaw Obs P A) {f : Obs → ℝ} {g : ℝ → ℝ} (hf : Measurable f) (hg : Measurable g) : Measurable (L.squaredRisk f g) := by haveI : IsMarkovKernel L.K := L.markov have h : Measurable (fun p : ℝ × Obs ↦ (f p.2 - g p.1) ^ 2) := ((hf.comp measurable_snd).sub (hg.comp measurable_fst)).pow_const 2 exact (h.stronglyMeasurable.integral_kernel_prod_right').measurable -
measurable_secondMomenttheorem — A chosen conditional law and measurable real observation give a measurable conditional second moment.hypothesesconclusionMeasurable (L.secondMoment f)Proof (Lean source)
theorem measurable_secondMoment (L : ContinuousDoseConditionalLaw Obs P A) {f : Obs → ℝ} (hf : Measurable f) : Measurable (L.secondMoment f) := by haveI : IsMarkovKernel L.K := L.markov exact (hf.pow_const 2).stronglyMeasurable.integral_kernel.measurable -
measurable_variancetheorem — A chosen conditional law and measurable real observation give a measurable conditional variance.hypothesesconclusionMeasurable (L.variance f)Proof (Lean source)
theorem measurable_variance (L : ContinuousDoseConditionalLaw Obs P A) {f : Obs → ℝ} (hf : Measurable f) : Measurable (L.variance f) := by exact L.measurable_squaredRisk hf (L.measurable_mean hf) -
variance_eq_secondMoment_sub_sq_meantheorem — A chosen conditional law, real observation, specified dose, integrable observation on its kernel fiber, and integrable squared observation on that fiber imply that conditional variance equals the conditional second moment minus the squared conditional mean.hypothesesL :ContinuousDoseConditionalLaw Obs P Af :Obs → ℝa :ℝhf :Integrable f (L.K a)hf2 :Integrable (fun ω ↦ (f ω) ^ 2) (L.K a)conclusionL.variance f a = L.secondMoment f a - (L.mean f a) ^ 2Proof (Lean source)
theorem variance_eq_secondMoment_sub_sq_mean (L : ContinuousDoseConditionalLaw Obs P A) (f : Obs → ℝ) (a : ℝ) (hf : Integrable f (L.K a)) (hf2 : Integrable (fun ω ↦ (f ω) ^ 2) (L.K a)) : L.variance f a = L.secondMoment f a - (L.mean f a) ^ 2 := by haveI : IsMarkovKernel L.K := L.markov letI : IsProbabilityMeasure (L.K a) := L.kernel_probability a have hlinear : Integrable (fun ω ↦ 2 * L.mean f a * f ω) (L.K a) := hf.const_mul _ calc L.variance f a = ∫ ω, ((f ω) ^ 2 - 2 * L.mean f a * f ω + (L.mean f a) ^ 2) ∂L.K a := by rw [L.variance_eq_integral] apply integral_congr_ae filter_upwards with ω ring _ = (∫ ω, (f ω) ^ 2 - 2 * L.mean f a * f ω ∂L.K a) + (∫ _ω, (L.mean f a) ^ 2 ∂L.K a) := by simpa only [Pi.sub_apply, Pi.add_apply] using (integral_add (hf2.sub hlinear) (integrable_const (L.mean f a ^ 2))) _ = L.secondMoment f a - (L.mean f a) ^ 2 := by rw [integral_sub hf2 hlinear, integral_const, probReal_univ, one_smul, integral_const_mul] simp only [L.secondMoment_eq_integral, L.mean_eq_integral] ring
ContrastInformation 4 core · 17 supporting This module gives a finite-index interface for constrained quadratic information and generalized contrast variance of real positive-semidefinite matrices. ★ generalizedContrastVariance_eq_inv_constrainedInformation★ generalizedContrastVariance_antitone
Finite positive-semidefinite contrast information
This module gives a finite-index interface for constrained quadratic information and generalized contrast variance of real positive-semidefinite matrices. It includes the exact reciprocal identity in singular cases, range and positivity characterizations, and monotonicity under positive-semidefinite order.
A real finite matrix and contrast determine the constrained quadratic information, given by the infimum of the quadratic form of the matrix over all directions whose inner product with the contrast equals one.
A real finite matrix and contrast determine the generalized contrast variance, given, when the linear system with this matrix and the contrast as right-hand side has a solution, by the infimum over solutions of the inner product of the contrast with the solution, truncated below at zero, and by infinity when no solution exists.
A positive-semidefinite matrix and nonzero contrast have generalized contrast variance equal to the extended reciprocal of constrained information.
Formal statement
Proof (Lean source)
For two positive-semidefinite matrices I and J such that J minus I is positive semidefinite, and a nonzero contrast, the generalized contrast variance under J is at most the generalized contrast variance under I.
Formal statement
Proof (Lean source)
17 supporting declarations (lemmas, instances)
-
exists_unitContrastDirectiontheorem — A finite contrast that is nonzero has a direction with unit contrast pairing.hypothesesι :sharedType u_1c :ι → ℝhc :c ≠ 0conclusion∃ d : ι → ℝ, c ⬝ᵥ d = 1Proof (Lean source)
theorem exists_unitContrastDirection (c : ι → ℝ) (hc : c ≠ 0) : ∃ d : ι → ℝ, c ⬝ᵥ d = 1 := by classical have hi : ∃ i, c i ≠ 0 := by by_contra h push Not at h exact hc (funext h) obtain ⟨i, hi⟩ := hi refine ⟨Pi.single i (c i)⁻¹, ?_⟩ rw [dotProduct_single] exact mul_inv_cancel₀ hi -
constrainedInformation_nonnegtheorem — A positive-semidefinite matrix and a nonzero contrast have nonnegative constrained quadratic information.hypothesesconclusion0 ≤ constrainedInformation I cProof (Lean source)
theorem constrainedInformation_nonneg {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c : ι → ℝ} (hc : c ≠ 0) : 0 ≤ constrainedInformation I c := by unfold constrainedInformation apply le_csInf · obtain ⟨d, hd⟩ := exists_unitContrastDirection c hc exact ⟨d ⬝ᵥ I.mulVec d, d, hd, rfl⟩ · rintro r ⟨d, -, rfl⟩ simpa using hI.dotProduct_mulVec_nonneg d -
constrainedInformation_le_quadtheorem — A positive-semidefinite matrix and a direction with unit pairing against the contrast have constrained information no larger than that direction's quadratic energy.hypothesesconclusionconstrainedInformation I c ≤ d ⬝ᵥ I.mulVec dProof (Lean source)
theorem constrainedInformation_le_quad {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c d : ι → ℝ} (hd : c ⬝ᵥ d = 1) : constrainedInformation I c ≤ d ⬝ᵥ I.mulVec d := by unfold constrainedInformation apply csInf_le · refine ⟨0, ?_⟩ rintro r ⟨e, -, rfl⟩ simpa using hI.dotProduct_mulVec_nonneg e · exact ⟨d, hd, rfl⟩ -
constrainedInformation_monotheorem — A positive-semidefinite matrix and a second matrix whose difference in the stated order is positive semidefinite, at a nonzero contrast, have ordered constrained information.hypothesesconclusionconstrainedInformation I c ≤ constrainedInformation J cProof (Lean source)
theorem constrainedInformation_mono {I J : Matrix ι ι ℝ} (hI : I.PosSemidef) (hIJ : (J - I).PosSemidef) {c : ι → ℝ} (hc : c ≠ 0) : constrainedInformation I c ≤ constrainedInformation J c := by unfold constrainedInformation apply le_csInf · obtain ⟨d, hd⟩ := exists_unitContrastDirection c hc exact ⟨d ⬝ᵥ J.mulVec d, d, hd, rfl⟩ · rintro r ⟨d, hd, rfl⟩ calc sInf {r : ℝ | ∃ e : ι → ℝ, c ⬝ᵥ e = 1 ∧ r = e ⬝ᵥ I.mulVec e} ≤ d ⬝ᵥ I.mulVec d := by apply csInf_le · refine ⟨0, ?_⟩ rintro x ⟨e, -, rfl⟩ simpa using hI.dotProduct_mulVec_nonneg e · exact ⟨d, hd, rfl⟩ _ ≤ d ⬝ᵥ J.mulVec d := by have h := hIJ.dotProduct_mulVec_nonneg d simpa [Matrix.sub_mulVec, dotProduct_sub] using h -
generalizedContrastVariance_nonnegtheorem — A real finite matrix and contrast have nonnegative generalized contrast variance.hypothesesconclusion0 ≤ generalizedContrastVariance I cProof (Lean source)
theorem generalizedContrastVariance_nonneg (I : Matrix ι ι ℝ) (c : ι → ℝ) : 0 ≤ generalizedContrastVariance I c := bot_le -
exists_kernel_nonorthogonaltheorem — A positive-semidefinite matrix for which the contrast equation has no solution has a kernel direction with nonzero contrast pairing.hypothesesconclusion∃ k : ι → ℝ,conclusion 1I.mulVec k = 0conclusion 2c ⬝ᵥ k ≠ 0Proof (Lean source)
theorem exists_kernel_nonorthogonal {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c : ι → ℝ} (hnone : ¬ ∃ v : ι → ℝ, I.mulVec v = c) : ∃ k : ι → ℝ, I.mulVec k = 0 ∧ c ⬝ᵥ k ≠ 0 := by classical let T := I.toEuclideanLin have hT : T.IsSymmetric := Matrix.isSymmetric_toEuclideanLin_iff.mpr hI.isHermitian by_contra h push Not at h have hcorth : (toLp 2 c : EuclideanSpace ℝ ι) ∈ T.kerᗮ := by rw [Submodule.mem_orthogonal] intro x hx have hk : I.mulVec (ofLp x) = 0 := by have hx0 : T x = 0 := hx have := congrArg ofLp hx0 simpa [T, Matrix.toEuclideanLin_apply] using this have hck : c ⬝ᵥ ofLp x = 0 := h _ hk simpa [EuclideanSpace.inner_eq_star_dotProduct] using hck rw [T.orthogonal_ker, hT.adjoint_eq] at hcorth obtain ⟨v, hv⟩ := hcorth apply hnone refine ⟨WithLp.ofLp v, ?_⟩ have := congrArg ofLp hv simpa [T, Matrix.toEuclideanLin_apply] using this -
constrainedInformation_eq_zero_of_kerneltheorem — A positive-semidefinite matrix, nonzero contrast, and kernel direction with nonzero contrast pairing have zero constrained information.hypotheseshI :I.PosSemidefc k :ι → ℝhc :c ≠ 0hk :I.mulVec k = 0hck :c ⬝ᵥ k ≠ 0conclusionconstrainedInformation I c = 0Proof (Lean source)
theorem constrainedInformation_eq_zero_of_kernel {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c k : ι → ℝ} (hc : c ≠ 0) (hk : I.mulVec k = 0) (hck : c ⬝ᵥ k ≠ 0) : constrainedInformation I c = 0 := by let d : ι → ℝ := (c ⬝ᵥ k)⁻¹ • k have hd : c ⬝ᵥ d = 1 := by simp [d, dotProduct_smul, inv_mul_cancel₀ hck] have hId : I.mulVec d = 0 := by simp [d, mulVec_smul, hk] apply le_antisymm · simpa [hId] using constrainedInformation_le_quad hI hd · exact constrainedInformation_nonneg hI hc -
constrainedInformation_eq_zero_of_no_solutiontheorem — A positive-semidefinite matrix, nonzero contrast, and unsolvable contrast equation have zero constrained information.hypotheseshI :I.PosSemidefc :ι → ℝhc :c ≠ 0hnone :¬ ∃ v : ι → ℝ, I.mulVec v = cconclusionconstrainedInformation I c = 0Proof (Lean source)
theorem constrainedInformation_eq_zero_of_no_solution {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c : ι → ℝ} (hc : c ≠ 0) (hnone : ¬ ∃ v : ι → ℝ, I.mulVec v = c) : constrainedInformation I c = 0 := by obtain ⟨k, hk, hck⟩ := exists_kernel_nonorthogonal hI hnone exact constrainedInformation_eq_zero_of_kernel hI hc hk hck -
solution_dot_eqtheorem — A positive-semidefinite matrix and two solutions to its contrast equation have the same contrast pairing.hypotheseshI :I.PosSemidefc v w :ι → ℝhv :I.mulVec v = chw :I.mulVec w = cconclusionc ⬝ᵥ v = c ⬝ᵥ wProof (Lean source)
theorem solution_dot_eq {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c v w : ι → ℝ} (hv : I.mulVec v = c) (hw : I.mulVec w = c) : c ⬝ᵥ v = c ⬝ᵥ w := by have hs : Iᵀ = I := by simpa using hI.isHermitian.eq calc c ⬝ᵥ v = (I.mulVec w) ⬝ᵥ v := by rw [hw] _ = w ⬝ᵥ I.mulVec v := by rw [dotProduct_comm] simpa [hs] using (Matrix.dotProduct_transpose_mulVec I w v).symm _ = c ⬝ᵥ w := by rw [hv, dotProduct_comm] -
solution_dot_postheorem — A positive-semidefinite matrix, nonzero contrast, and solution to its contrast equation have a strictly positive contrast pairing.hypothesesconclusion0 < c ⬝ᵥ vProof (Lean source)
theorem solution_dot_pos {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c v : ι → ℝ} (hc : c ≠ 0) (hv : I.mulVec v = c) : 0 < c ⬝ᵥ v := by have hn : 0 ≤ c ⬝ᵥ v := by rw [← hv] simpa [dotProduct_comm] using hI.dotProduct_mulVec_nonneg v rcases hn.eq_or_lt with hz | hp · have hz' : v ⬝ᵥ I.mulVec v = 0 := by simpa [← hv, dotProduct_comm] using hz.symm exact False.elim (hc ((hI.dotProduct_mulVec_zero_iff v).mp hz' ▸ hv.symm)) · exact hp -
generalizedContrastVariance_eq_of_solutiontheorem — A positive-semidefinite matrix and a solution to its contrast equation have generalized contrast variance equal to that solution's contrast pairing.hypothesesconclusiongeneralizedContrastVariance I c = ofReal (c ⬝ᵥ v)Proof (Lean source)
theorem generalizedContrastVariance_eq_of_solution {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c v : ι → ℝ} (hv : I.mulVec v = c) : generalizedContrastVariance I c = ofReal (c ⬝ᵥ v) := by unfold generalizedContrastVariance rw [if_pos ⟨v, hv⟩] congr 1 have hs : {r : ℝ | ∃ w : ι → ℝ, I.mulVec w = c ∧ r = c ⬝ᵥ w} = {c ⬝ᵥ v} := by ext r simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff] constructor · rintro ⟨w, hw, rfl⟩ exact (solution_dot_eq hI hv hw).symm · rintro rfl exact ⟨v, hv, rfl⟩ rw [hs, csInf_singleton] -
inv_solution_dot_le_quadtheorem — A positive-semidefinite matrix, nonzero contrast, solution to its contrast equation, and unit-contrast direction have the reciprocal solution pairing no greater than that direction's energy.hypotheseshI :I.PosSemidefc v d :ι → ℝhc :c ≠ 0hv :I.mulVec v = chd :c ⬝ᵥ d = 1conclusion(c ⬝ᵥ v)⁻¹ ≤ d ⬝ᵥ I.mulVec dProof (Lean source)
theorem inv_solution_dot_le_quad {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c v d : ι → ℝ} (hc : c ≠ 0) (hv : I.mulVec v = c) (hd : c ⬝ᵥ d = 1) : (c ⬝ᵥ v)⁻¹ ≤ d ⬝ᵥ I.mulVec d := by let a := (c ⬝ᵥ v)⁻¹ have hp := solution_dot_pos hI hc hv have ha : a * (c ⬝ᵥ v) = 1 := inv_mul_cancel₀ (ne_of_gt hp) have hs : Iᵀ = I := by simpa using hI.isHermitian.eq have hcross : v ⬝ᵥ I.mulVec d = 1 := by calc v ⬝ᵥ I.mulVec d = d ⬝ᵥ I.mulVec v := by simpa [hs] using Matrix.dotProduct_transpose_mulVec I v d _ = 1 := by rw [hv, dotProduct_comm, hd] have hsq : 0 ≤ (d - a • v) ⬝ᵥ I.mulVec (d - a • v) := by simpa only [TrivialStar.star_trivial] using hI.dotProduct_mulVec_nonneg (d - a • v) simp only [Matrix.mulVec_sub, Matrix.mulVec_smul, dotProduct_sub, dotProduct_smul, smul_eq_mul] at hsq simp only [sub_dotProduct, smul_dotProduct, smul_eq_mul] at hsq have hdc : d ⬝ᵥ c = 1 := by simpa [dotProduct_comm] using hd rw [hv, hcross, hdc, dotProduct_comm v c] at hsq dsimp [a] at * nlinarith -
exists_unitContrastDirection_energy_invtheorem — A positive-semidefinite matrix, nonzero contrast, and solution to its contrast equation have a unit-contrast direction attaining reciprocal solution energy.hypothesesconclusion∃ d : ι → ℝ,conclusion 1c ⬝ᵥ d = 1conclusion 2d ⬝ᵥ I.mulVec d = (c ⬝ᵥ v)⁻¹Proof (Lean source)
theorem exists_unitContrastDirection_energy_inv {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c v : ι → ℝ} (hc : c ≠ 0) (hv : I.mulVec v = c) : ∃ d : ι → ℝ, c ⬝ᵥ d = 1 ∧ d ⬝ᵥ I.mulVec d = (c ⬝ᵥ v)⁻¹ := by let a := (c ⬝ᵥ v)⁻¹ have hp := solution_dot_pos hI hc hv have ha : a * (c ⬝ᵥ v) = 1 := inv_mul_cancel₀ (ne_of_gt hp) refine ⟨a • v, ?_, ?_⟩ · rw [dotProduct_smul, smul_eq_mul] exact ha · rw [Matrix.mulVec_smul, dotProduct_smul, smul_dotProduct, smul_eq_mul, smul_eq_mul, hv, dotProduct_comm] change a * (a * (c ⬝ᵥ v)) = a rw [ha, mul_one] -
constrainedInformation_eq_inv_of_solutiontheorem — A positive-semidefinite matrix, nonzero contrast, and solution to its contrast equation have constrained information equal to the reciprocal solution pairing.hypothesesconclusionconstrainedInformation I c = (c ⬝ᵥ v)⁻¹Proof (Lean source)
theorem constrainedInformation_eq_inv_of_solution {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c v : ι → ℝ} (hc : c ≠ 0) (hv : I.mulVec v = c) : constrainedInformation I c = (c ⬝ᵥ v)⁻¹ := by apply le_antisymm · obtain ⟨d, hd, he⟩ := exists_unitContrastDirection_energy_inv hI hc hv rw [← he] exact constrainedInformation_le_quad hI hd · unfold constrainedInformation apply le_csInf · obtain ⟨d, hd⟩ := exists_unitContrastDirection c hc exact ⟨d ⬝ᵥ I.mulVec d, d, hd, rfl⟩ · rintro r ⟨d, hd, rfl⟩ exact inv_solution_dot_le_quad hI hc hv hd -
constrainedInformation_pos_iff_solutiontheorem — A positive-semidefinite matrix and nonzero contrast have strictly positive constrained information exactly when their contrast equation is solvable.hypothesesconclusion0 < constrainedInformation I c ↔ ∃ v : ι → ℝ, I.mulVec v = cProof (Lean source)
theorem constrainedInformation_pos_iff_solution {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c : ι → ℝ} (hc : c ≠ 0) : 0 < constrainedInformation I c ↔ ∃ v : ι → ℝ, I.mulVec v = c := by constructor · intro hq by_contra h exact (ne_of_gt hq) (constrainedInformation_eq_zero_of_no_solution hI hc h) · rintro ⟨v, hv⟩ rw [constrainedInformation_eq_inv_of_solution hI hc hv] exact inv_pos.mpr (solution_dot_pos hI hc hv) -
generalizedContrastVariance_eq_top_iff_no_solutiontheorem — A positive-semidefinite matrix and a contrast have infinite generalized contrast variance exactly when their contrast equation has no solution.hypothesesconclusiongeneralizedContrastVariance I c = ⊤ ↔ ¬ ∃ v : ι → ℝ, I.mulVec v = cProof (Lean source)
theorem generalizedContrastVariance_eq_top_iff_no_solution {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c : ι → ℝ} : generalizedContrastVariance I c = ⊤ ↔ ¬ ∃ v : ι → ℝ, I.mulVec v = c := by classical constructor · intro htop h obtain ⟨v, hv⟩ := h rw [generalizedContrastVariance_eq_of_solution hI hv] at htop exact ENNReal.ofReal_ne_top htop · intro h simp [generalizedContrastVariance, h] -
generalizedContrastVariance_eq_ofReal_inv_of_constrainedInformation_postheorem — A positive-semidefinite matrix, nonzero contrast, and strictly positive constrained information have generalized contrast variance equal to the extended-real reciprocal.Proof (Lean source)
theorem generalizedContrastVariance_eq_ofReal_inv_of_constrainedInformation_pos {I : Matrix ι ι ℝ} (hI : I.PosSemidef) {c : ι → ℝ} (hc : c ≠ 0) (hq : 0 < constrainedInformation I c) : generalizedContrastVariance I c = ofReal (constrainedInformation I c)⁻¹ := by rw [generalizedContrastVariance_eq_inv_constrainedInformation hI hc, ENNReal.ofReal_inv_of_pos hq]
FiniteFiberConditioning 1 core · 0 supporting This file turns elementary probability-mass factorization within every fiber of a finite-valued conditioning map into conditional independence given that map. ★ condIndepFun_finite_of_measureReal_fibers
Conditional Independence from Finite Fibers
This file turns elementary probability-mass factorization within every fiber of a finite-valued conditioning map into conditional independence given that map. The proof computes conditional expectations of event indicators by finite-fiber probability ratios.
For a finite measure, a finite-valued conditioning map, two random elements, measurability of all three maps, and factorization of their ordinary real masses on every measurable pair of events inside every conditioning fiber, the two random elements are conditionally independent given the sigma-algebra generated by the conditioning map.
Formal statement
Proof (Lean source)
ScoreProjection 3 core · 6 supporting This module develops guarded likelihood scores for dominated laws and proves that pushing a law through any measurable statistic projects its score onto the statistic's σ-algebra, provided the derivative density on the s ★ condExp_guardedScore_eq_statistic_score★ statistic_score_memLp_and_secondMoment_le
Likelihood-score projection through measurable statistics
This module develops guarded likelihood scores for dominated laws and proves that pushing a law through any measurable statistic projects its score onto the statistic's σ-algebra, provided the derivative density on the statistic's space is assumed to be the pushforward of the source derivative density. It also gives the corresponding L² contraction, without conditional distributions or regularity assumptions on the sample spaces.
A density, signed derivative density, and observation determine the guarded likelihood score, given by their quotient away from a zero density and by zero at a zero density.
Definition (Lean source)
Take finite reference measures on the source space and on the statistic's space, a source probability law and a statistic law, a measurable statistic, and real densities and derivative densities on both spaces, all measurable except possibly the source derivative density. Suppose the densities are nonnegative almost everywhere under their reference measures, each derivative density vanishes almost everywhere where its density vanishes, the source law has the source density with respect to its reference measure, the statistic law is the law of the statistic under the source law, and it has the statistic density with respect to its reference measure, both guarded scores are integrable under their laws, and the derivative densities are linked by the same pushforward: for every measurable set of statistic values, the source derivative density integrated over the set's preimage equals the statistic derivative density integrated over the set. Then the conditional expectation, under the source law, of the source guarded score given the statistic equals the statistic's guarded score evaluated at the statistic, almost everywhere.
Formal statement
Proof (Lean source)
Take finite reference measures on the source space and on the statistic's space, a source probability law and a statistic law, a measurable statistic, and real densities and derivative densities on both spaces, all measurable except possibly the source derivative density. Suppose the densities are nonnegative almost everywhere under their reference measures, each derivative density vanishes almost everywhere where its density vanishes, the source law has the source density with respect to its reference measure, the statistic law is the law of the statistic under the source law, and it has the statistic density with respect to its reference measure, the statistic derivative density is integrable under its reference measure, for every measurable set of statistic values, the source derivative density integrated over the set's preimage equals the statistic derivative density integrated over the set, and the source guarded score is square-integrable under the source law. Then the statistic's guarded score is square-integrable under the statistic law, and its second moment is at most the second moment of the source guarded score under the source law.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
measurable_guardedScoretheorem — Measurable density and derivative functions give a measurable guarded likelihood score.hypothesesconclusionMeasurable (guardedScore q qdot)Proof (Lean source)
@[fun_prop] theorem measurable_guardedScore {q qdot : α → ℝ} (hq : Measurable q) (hqdot : Measurable qdot) : Measurable (guardedScore q qdot) := by unfold guardedScore exact Measurable.ite (hq (measurableSet_singleton 0)) measurable_const (hqdot.div hq) -
derivative_eq_density_mul_guardedScoretheorem — A reference measure, density, and derivative density whose derivative vanishes wherever the density vanishes satisfy the almost-everywhere identity between the derivative density and density times its guarded score.hypotheseshzero :∀ᵐ x ∂ν, q x = 0 → qdot x = 0conclusion∀ᵐ x ∂ν, qdot x = q x * guardedScore q qdot xProof (Lean source)
theorem derivative_eq_density_mul_guardedScore {ν : Measure α} {q qdot : α → ℝ} (hzero : ∀ᵐ x ∂ν, q x = 0 → qdot x = 0) : ∀ᵐ x ∂ν, qdot x = q x * guardedScore q qdot x := by filter_upwards [hzero] with x hx by_cases hq : q x = 0 · simp [guardedScore, hq, hx hq] · simp [guardedScore, hq, mul_div_cancel₀ _ hq] -
integrable_guardedScore_of_derivative_integrabletheorem — A reference measure and law, measurable density and derivative density, nonnegative density, zero-set derivative control, density representation of the law, and integrable derivative density give an integrable guarded likelihood score under the law.hypothesesα :sharedType u_1ν μ :Measure αq qdot :α → ℝhq :hqnonneg :∀ᵐ x ∂ν, 0 ≤ q xhzero :∀ᵐ x ∂ν, q x = 0 → qdot x = 0hμ :μ = ν.withDensity (fun x => ofReal (q x))hderivInt :Integrable qdot νconclusionIntegrable (guardedScore q qdot) μProof (Lean source)
theorem integrable_guardedScore_of_derivative_integrable (ν μ : Measure α) (q qdot : α → ℝ) (hq : Measurable q) (hqnonneg : ∀ᵐ x ∂ν, 0 ≤ q x) (hzero : ∀ᵐ x ∂ν, q x = 0 → qdot x = 0) (hμ : μ = ν.withDensity (fun x => ofReal (q x))) (hderivInt : Integrable qdot ν) : Integrable (guardedScore q qdot) μ := by rw [hμ, integrable_withDensity_iff_integrable_smul' hq.ennreal_ofReal (by simp)] apply hderivInt.congr filter_upwards [hqnonneg, derivative_eq_density_mul_guardedScore hzero] with x hx hxeq rw [ENNReal.toReal_ofReal hx, smul_eq_mul] exact hxeq -
setIntegral_guardedScore_eq_derivativetheorem — A finite reference measure and law, measurable density and derivative density, nonnegative density, zero-set derivative control, density representation, and measurable event make the guarded-score integral on that event equal the derivative-density integral.hypothesesα :sharedType u_1ν μ :q qdot :α → ℝhq :hqnonneg :∀ᵐ x ∂ν, 0 ≤ q xhzero :∀ᵐ x ∂ν, q x = 0 → qdot x = 0hμ :μ = ν.withDensity (fun x => ofReal (q x))A :Set αhA :conclusion∫ x in A, guardedScore q qdot x ∂μ = ∫ x in A, qdot x ∂νProof (Lean source)
theorem setIntegral_guardedScore_eq_derivative (ν μ : Measure α) [IsFiniteMeasure ν] (q qdot : α → ℝ) (hq : Measurable q) (hqnonneg : ∀ᵐ x ∂ν, 0 ≤ q x) (hzero : ∀ᵐ x ∂ν, q x = 0 → qdot x = 0) (hμ : μ = ν.withDensity (fun x => ofReal (q x))) {A : Set α} (hA : MeasurableSet A) : ∫ x in A, guardedScore q qdot x ∂μ = ∫ x in A, qdot x ∂ν := by rw [hμ, restrict_withDensity hA, integral_withDensity_eq_integral_toReal_smul hq.ennreal_ofReal (by simp)] apply integral_congr_ae filter_upwards [ae_restrict_of_ae hqnonneg, ae_restrict_of_ae (derivative_eq_density_mul_guardedScore hzero)] with x hxq hxeq rw [ENNReal.toReal_ofReal hxq, smul_eq_mul, ← hxeq] -
condExp_eq_statistic_iff_integral_preimage_eqtheorem — A measurable statistic with its pushed-forward law, integrable source and statistic functions, and a measurable statistic function has its conditional expectation equal to the pulled-back statistic function exactly when their integrals agree on every measurable statistic event.hypothesesΩ :sharedType u_2Y :sharedType u_3T :sharedΩ → YhT :hμYmap :μY = μΩ.map Tf :Ω → ℝg :Y → ℝhf :Integrable f μΩhg :Integrable g μYhgmeas :conclusion(μΩ[f | comap T inferInstance] =ᵐ[μΩ] fun ω => g (T ω))↔ ∀ A : Set Y, MeasurableSet A → ∫ ω in T ⁻¹' A, f ω ∂μΩ = ∫ y in A, g y ∂μYProof (Lean source)
theorem condExp_eq_statistic_iff_integral_preimage_eq (hT : Measurable T) (hμYmap : μY = μΩ.map T) (f : Ω → ℝ) (g : Y → ℝ) (hf : Integrable f μΩ) (hg : Integrable g μY) (hgmeas : Measurable g) : (μΩ[f | comap T inferInstance] =ᵐ[μΩ] fun ω => g (T ω)) ↔ ∀ A : Set Y, MeasurableSet A → ∫ ω in T ⁻¹' A, f ω ∂μΩ = ∫ y in A, g y ∂μY := by have hmap (A : Set Y) (hA : MeasurableSet A) : ∫ ω in T ⁻¹' A, g (T ω) ∂μΩ = ∫ y in A, g y ∂μY := by rw [hμYmap] exact (setIntegral_map hA hgmeas.aestronglyMeasurable hT.aemeasurable).symm constructor · intro hcond A hA calc ∫ ω in T ⁻¹' A, f ω ∂μΩ = ∫ ω in T ⁻¹' A, (μΩ[f | comap T inferInstance]) ω ∂μΩ := (setIntegral_condExp hT.comap_le hf ⟨A, hA, rfl⟩).symm _ = ∫ ω in T ⁻¹' A, g (T ω) ∂μΩ := setIntegral_congr_ae (hT hA) (hcond.mono fun ω hω _ => hω) _ = ∫ y in A, g y ∂μY := hmap A hA · intro hintegral have hgmap : Integrable g (μΩ.map T) := by simpa only [hμYmap] using hg have hgcomp : Integrable (fun ω => g (T ω)) μΩ := by simpa only [Function.comp_def] using hgmap.comp_measurable hT have hTcomap : Measurable[comap T inferInstance] T := comap_measurable T have hgstrong : StronglyMeasurable[comap T inferInstance] (fun ω => g (T ω)) := hgmeas.stronglyMeasurable.comp_measurable hTcomap exact condExp_eq_of_integral_preimage_eq μΩ T hT f (fun ω => g (T ω)) hf hgcomp hgstrong.aestronglyMeasurable (by intro A hA exact (hintegral A hA).trans (hmap A hA).symm) -
score_integral_preimage_eqtheorem — Finite source and statistic reference measures, source and statistic laws, a measurable statistic, densities and derivative densities, all measurable except possibly the source derivative density, nonnegative densities, zero-set derivative controls, the source and statistic density laws, an exact derivative pushforward identity, and a measurable statistic event give equal source-score and pulled-back statistic-score integrals on that event.hypothesesΩ :sharedType u_2Y :sharedType u_3T :sharedΩ → YqΩ :sharedΩ → ℝqdotΩ :sharedΩ → ℝqY :sharedY → ℝqdotY :sharedY → ℝhT :hqΩ :Measurable qΩhqY :Measurable qYhqdotY :Measurable qdotYhqΩnonneg :∀ᵐ ω ∂νΩ, 0 ≤ qΩ ωhqYnonneg :∀ᵐ y ∂νY, 0 ≤ qY yhzeroΩ :∀ᵐ ω ∂νΩ, qΩ ω = 0 → qdotΩ ω = 0hzeroY :∀ᵐ y ∂νY, qY y = 0 → qdotY y = 0hμΩ :μΩ = νΩ.withDensity (fun ω => ofReal (qΩ ω))hμYmap :μY = μΩ.map ThμYdensity :μY = νY.withDensity (fun y => ofReal (qY y))hderivMap :∀ A : Set Yifthen∫ ω in T ⁻¹' A, qdotΩ ω ∂νΩ = ∫ y in A, qdotY y ∂νYA :Set YhA :conclusion∫ ω in T ⁻¹' A, guardedScore qΩ qdotΩ ω ∂μΩ= ∫ ω in T ⁻¹' A, guardedScore qY qdotY (T ω) ∂μΩProof (Lean source)
theorem score_integral_preimage_eq (hT : Measurable T) (hqΩ : Measurable qΩ) (hqY : Measurable qY) (hqdotY : Measurable qdotY) (hqΩnonneg : ∀ᵐ ω ∂νΩ, 0 ≤ qΩ ω) (hqYnonneg : ∀ᵐ y ∂νY, 0 ≤ qY y) (hzeroΩ : ∀ᵐ ω ∂νΩ, qΩ ω = 0 → qdotΩ ω = 0) (hzeroY : ∀ᵐ y ∂νY, qY y = 0 → qdotY y = 0) (hμΩ : μΩ = νΩ.withDensity (fun ω => ofReal (qΩ ω))) (hμYmap : μY = μΩ.map T) (hμYdensity : μY = νY.withDensity (fun y => ofReal (qY y))) (hderivMap : ∀ A : Set Y, MeasurableSet A → ∫ ω in T ⁻¹' A, qdotΩ ω ∂νΩ = ∫ y in A, qdotY y ∂νY) (A : Set Y) (hA : MeasurableSet A) : ∫ ω in T ⁻¹' A, guardedScore qΩ qdotΩ ω ∂μΩ = ∫ ω in T ⁻¹' A, guardedScore qY qdotY (T ω) ∂μΩ := by have hmap : ∫ ω in T ⁻¹' A, guardedScore qY qdotY (T ω) ∂μΩ = ∫ y in A, guardedScore qY qdotY y ∂μY := by rw [hμYmap] exact (setIntegral_map hA (measurable_guardedScore hqY hqdotY).aestronglyMeasurable hT.aemeasurable).symm calc ∫ ω in T ⁻¹' A, guardedScore qΩ qdotΩ ω ∂μΩ = ∫ ω in T ⁻¹' A, qdotΩ ω ∂νΩ := setIntegral_guardedScore_eq_derivative νΩ μΩ qΩ qdotΩ hqΩ hqΩnonneg hzeroΩ hμΩ (hT hA) _ = ∫ y in A, qdotY y ∂νY := hderivMap A hA _ = ∫ y in A, guardedScore qY qdotY y ∂μY := (setIntegral_guardedScore_eq_derivative νY μY qY qdotY hqY hqYnonneg hzeroY hμYdensity hA).symm _ = ∫ ω in T ⁻¹' A, guardedScore qY qdotY (T ω) ∂μΩ := hmap.symm
SupportTransfer 2 core · 0 supporting This file defines a real-valued event indicator and proves a measure-theoretic support-transfer theorem under a normalized restriction to a positive-mass cell. ★ ae_abs_target_le_of_indep_positive_event
Support Transfer Across an Independent Event
This file defines a real-valued event indicator and proves a measure-theoretic support-transfer theorem under a normalized restriction to a positive-mass cell. Independence from a positive-probability event and almost-everywhere agreement on that event transfer an absolute bound from a reference quantity to the target quantity throughout the cell.
Given a sample space and an event in it, the real-valued event indicator equals one for sample points in the event and zero for all other sample points.
Definition (Lean source)
Within a measurable positive-mass cell, for a measurable event, if a target quantity is measurable, the event has positive normalized cell probability, the target is independent of the event indicator under the normalized cell law, a reference quantity agrees almost surely with the target on that event, and the reference obeys an absolute bound there, then the target obeys the same absolute bound almost surely throughout the cell.
Formal statement
Proof (Lean source)
DoobInformation 4 core · 8 supporting For a square-integrable score under one probability law, this module develops the finite-horizon decomposition into conditional-expectation increments along an arbitrary filtration. ★ fisher_eq_sum★ guarded_density_fisher_eq_doob_sum
Finite-horizon Doob information decomposition
For a square-integrable score under one probability law, this module develops the finite-horizon decomposition into conditional-expectation increments along an arbitrary filtration. It supplies centering, orthogonality, information additivity, a uniform increment-budget bound, and a density-facing Fisher-information corollary without disintegration or stagewise Radon–Nikodym derivatives.
A probability law, filtration, terminal score, and stage determine the Doob score increment, given by the change in the score's conditional expectation between the two adjacent prefix σ-algebras.
Definition (Lean source)
A probability law, filtration, terminal score, square-integrability certificate, and horizon determine the constant-row Doob martingale-difference array, given by the Doob construction in which every row uses this same law, filtration, and score, has length equal to the horizon, and has as its entry at each stage the change in the score's conditional expectation between the two adjacent prefix σ-algebras.
Definition (Lean source)
Under a probability law and filtration, if a square-integrable terminal score is its terminal conditional expectation and has zero initial conditional expectation, then its Fisher-information second moment, the expectation of the squared score, equals the sum over the stages before the horizon of the increment second moments at the given horizon.
Formal statement
Proof (Lean source)
A finite reference measure, probability law, filtration, horizon, density, density derivative, and score with a measurable density, the law having density q with respect to the reference measure, almost-everywhere nonnegative density, the score identity that the density derivative equals the density times the score almost everywhere under the reference measure, square-integrable score under the law, and the score agreeing almost surely with its conditional expectation at the horizon while its conditional expectation at stage zero vanishes almost surely have a guarded density Fisher integral, the reference-measure integral of the squared density derivative divided by the density with the integrand set to zero where the density vanishes, equal to the sum over the stages before the horizon of the second moments of the Doob score increments.
Formal statement
Proof (Lean source)
8 supporting declarations (lemmas, instances)
-
increment_eq_doobArraytheorem — Given a probability law, filtration, square-integrable terminal score, horizon, and stage, the score increment agrees with the matching entry of its constant-row Doob array.hypothesesconclusionincrement μ F S k = (doobArray μ F S hS n).increment 0 kProof (Lean source)
theorem increment_eq_doobArray (hS : MemLp S 2 μ) (n k : ℕ) : increment μ F S k = (doobArray μ F S hS n).increment 0 k := by rfl -
increment_memLptheorem — Under a probability law and filtration, a square-integrable terminal score has a square-integrable score increment at every stage, including the specified stage.Proof (Lean source)
theorem increment_memLp (hS : MemLp S 2 μ) (k : ℕ) : MemLp (increment μ F S k) 2 μ := by rw [increment_eq_doobArray (μ := μ) F S hS (k + 1) k] exact (doobArray μ F S hS (k + 1)).squareIntegrable 0 k (by simpa [doobArray, doobMartingaleDifferenceArray] using lt_succ_self k) -
increment_stronglyMeasurabletheorem — Under a probability law and filtration, a square-integrable terminal score has an increment measurable at the next prefix σ-algebra for the given stage.hypothesesconclusionStronglyMeasurable[F (k + 1)] (increment μ F S k)Proof (Lean source)
theorem increment_stronglyMeasurable (hS : MemLp S 2 μ) (k : ℕ) : StronglyMeasurable[F (k + 1)] (increment μ F S k) := by rw [increment_eq_doobArray (μ := μ) F S hS (k + 1) k] exact (doobArray μ F S hS (k + 1)).adapted 0 k (by simpa [doobArray, doobMartingaleDifferenceArray] using lt_succ_self k) -
increment_condExp_zerotheorem — Under a probability law and filtration, the increment of a square-integrable terminal score has conditional mean zero at the preceding prefix σ-algebra for the given stage.hypothesesconclusionμ[increment μ F S k | F k] =ᵐ[μ] (0 : Ω → ℝ)Proof (Lean source)
theorem increment_condExp_zero (hS : MemLp S 2 μ) (k : ℕ) : μ[increment μ F S k | F k] =ᵐ[μ] (0 : Ω → ℝ) := by rw [increment_eq_doobArray (μ := μ) F S hS (k + 1) k] exact (doobArray μ F S hS (k + 1)).condExp_zero 0 k (by simpa [doobArray, doobMartingaleDifferenceArray] using lt_succ_self k) -
increment_sumtheorem — Under a probability law and filtration, the increments of a square-integrable terminal score have a finite sum equal almost everywhere to the difference between terminal and initial conditional expectations at the given horizon.hypothesesconclusion(fun ω => ∑ k ∈ range n, increment μ F S k ω)=ᵐ[μ] (fun ω => μ[S | F n] ω - μ[S | F 0] ω)Proof (Lean source)
theorem increment_sum (hS : MemLp S 2 μ) (n : ℕ) : (fun ω => ∑ k ∈ range n, increment μ F S k ω) =ᵐ[μ] (fun ω => μ[S | F n] ω - μ[S | F 0] ω) := by have hsum : (fun ω => ∑ k ∈ range n, increment μ F S k ω) = (doobArray μ F S hS n).rowSum 0 := by funext ω simp only [MartingaleDifferenceArray.rowSum, Finset.sum_apply] change (∑ k ∈ range n, increment μ F S k ω) = ∑ k ∈ range n, (doobArray μ F S hS n).increment 0 k ω apply Finset.sum_congr rfl intro k _ exact congrFun (increment_eq_doobArray (μ := μ) F S hS n k) ω have hrow := doobMartingaleDifferenceArray_rowSum (μ := fun _ => μ) (fun _ => n) (fun _ => F) (fun _ => S) (fun _ => hS) 0 change (doobArray μ F S hS n).rowSum 0 = (fun ω => μ[S | F n] ω - μ[S | F 0] ω) at hrow exact Filter.Eventually.of_forall (fun ω => congrFun (hsum.trans hrow) ω) -
increment_orthogonaltheorem — Under a probability law and filtration, distinct stages of the Doob increments for a square-integrable terminal score are orthogonal in the squared-integrable sense, whenever the two stages differ.hypothesesconclusion∫ ω, increment μ F S i ω * increment μ F S j ω ∂μ = 0Proof (Lean source)
theorem increment_orthogonal (hS : MemLp S 2 μ) {i j : ℕ} (hij : i ≠ j) : ∫ ω, increment μ F S i ω * increment μ F S j ω ∂μ = 0 := by have hforward {a b : ℕ} (hab : a < b) : ∫ ω, increment μ F S a ω * increment μ F S b ω ∂μ = 0 := by have hm : F (a + 1) ≤ F b := F.mono (succ_le_of_lt hab) have hmeas : StronglyMeasurable[F b] (increment μ F S a) := (increment_stronglyMeasurable (μ := μ) F S hS a).mono hm have ha := increment_memLp (μ := μ) F S hS a have hb := increment_memLp (μ := μ) F S hS b have hprod : Integrable (increment μ F S a * increment μ F S b) μ := ha.integrable_mul hb have hpull := condExp_mul_of_stronglyMeasurable_left hmeas hprod (hb.integrable (by norm_num)) calc ∫ ω, increment μ F S a ω * increment μ F S b ω ∂μ = ∫ ω, μ[increment μ F S a * increment μ F S b | F b] ω ∂μ := by exact (integral_condExp (F.le b)).symm _ = ∫ ω, increment μ F S a ω * μ[increment μ F S b | F b] ω ∂μ := integral_congr_ae hpull _ = 0 := by have hz : (fun ω => increment μ F S a ω * μ[increment μ F S b | F b] ω) =ᵐ[μ] (0 : Ω → ℝ) := by filter_upwards [increment_condExp_zero (μ := μ) F S hS b] with ω hω simp only [Pi.zero_apply] at hω simp [hω] rw [integral_congr_ae hz] simp rcases lt_or_gt_of_ne hij with h | h · exact hforward h · rw [show (fun ω => increment μ F S i ω * increment μ F S j ω) = (fun ω => increment μ F S j ω * increment μ F S i ω) from funext (fun ω => mul_comm _ _)] exact hforward h -
fisher_le_multheorem — Under a probability law and filtration, if a square-integrable terminal score has the terminal and initial conditional-expectation identities and each active increment's second moment is bounded, then the score's Fisher information is at most the horizon times the common bound for the given horizon and bound.hypothesesS :sharedΩ → ℝhS :MemLp S 2 μn :ℕB :ℝhterminal :μ[S | F n] =ᵐ[μ] Shinitial :μ[S | F 0] =ᵐ[μ] (0 : Ω → ℝ)hbound :∀ k < n, ∫ ω, increment μ F S k ω ^ 2 ∂μ ≤ Bconclusion∫ ω, S ω ^ 2 ∂μ ≤ (n : ℝ) * BProof (Lean source)
theorem fisher_le_mul (hS : MemLp S 2 μ) (n : ℕ) (B : ℝ) (hterminal : μ[S | F n] =ᵐ[μ] S) (hinitial : μ[S | F 0] =ᵐ[μ] (0 : Ω → ℝ)) (hbound : ∀ k < n, ∫ ω, increment μ F S k ω ^ 2 ∂μ ≤ B) : ∫ ω, S ω ^ 2 ∂μ ≤ (n : ℝ) * B := by rw [fisher_eq_sum (μ := μ) F S hS n hterminal hinitial] calc ∑ k ∈ range n, ∫ ω, increment μ F S k ω ^ 2 ∂μ ≤ ∑ _k ∈ range n, B := by apply Finset.sum_le_sum intro k hk exact hbound k (Finset.mem_range.mp hk) _ = (n : ℝ) * B := by simp -
guarded_density_fisher_eqtheorem — A finite reference measure, probability law, density, density derivative, and score with a measurable density, the stated density representation, almost-everywhere nonnegative density, and almost-everywhere score identity have a guarded density Fisher integral equal to the score second moment.hypothesesq qdot S :Ω → ℝhq :hμ :μ = ν.withDensity (fun ω => ofReal (q ω))hqnonneg :∀ᵐ ω ∂ν, 0 ≤ q ωhscore :∀ᵐ ω ∂ν, qdot ω = q ω * S ωconclusion(∫ ω, (if q ω = 0 then 0 else qdot ω ^ 2 / q ω) ∂ν) = ∫ ω, S ω ^ 2 ∂μProof (Lean source)
theorem guarded_density_fisher_eq (q qdot S : Ω → ℝ) (hq : Measurable q) (hμ : μ = ν.withDensity (fun ω => ofReal (q ω))) (hqnonneg : ∀ᵐ ω ∂ν, 0 ≤ q ω) (hscore : ∀ᵐ ω ∂ν, qdot ω = q ω * S ω) : (∫ ω, (if q ω = 0 then 0 else qdot ω ^ 2 / q ω) ∂ν) = ∫ ω, S ω ^ 2 ∂μ := by have hquot : (fun ω => if q ω = 0 then 0 else qdot ω ^ 2 / q ω) =ᵐ[ν] (fun ω => q ω * S ω ^ 2) := by filter_upwards [hscore] with ω hs by_cases hq0 : q ω = 0 · simp [hq0] · rw [hs] simp only [hq0, ↓reduceIte] field_simp calc (∫ ω, (if q ω = 0 then 0 else qdot ω ^ 2 / q ω) ∂ν) = ∫ ω, q ω * S ω ^ 2 ∂ν := integral_congr_ae hquot _ = ∫ ω, S ω ^ 2 ∂μ := by rw [hμ, integral_withDensity_eq_integral_toReal_smul hq.ennreal_ofReal (by simp)] apply integral_congr_ae filter_upwards [hqnonneg] with ω hn simp [ENNReal.toReal_ofReal hn, smul_eq_mul]
GaussianCovariance 7 core · 13 supporting This module defines the Gaussian covariance discrepancy on finite positive-definite matrices and derives its compact-model attainment, strict separation, perturbation stability, and finite-model-selection interfaces. ★ finiteCovarianceModel_populationGap
Gaussian covariance discrepancy and finite model selection
This module defines the Gaussian covariance discrepancy on finite positive-definite matrices and derives its compact-model attainment, strict separation, perturbation stability, and finite-model-selection interfaces. The model assumptions are stated separately from the matrix inequality, so the results can be reused for any finite family of covariance models.
For a finite coordinate type, the positive covariance matrices are real square matrices equipped with a proof of positive definiteness.
For a candidate covariance matrix and target second-moment matrix, the Gaussian covariance discrepancy is log determinant plus inverse-weighted trace.
Definition (Lean source)
For positive-definite candidate and target covariances, the normalized Gaussian covariance discrepancy subtracts the criterion's value at the target.
Definition (Lean source)
For a covariance model and target matrix, discrepancy attainment means that one model member has no larger Gaussian discrepancy than every other member.
Definition (Lean source)
For a covariance model and target matrix, a compact discrepancy sublevel is a nonempty compact cut of the model below some criterion value.
Definition (Lean source)
For a covariance model and target matrix, the population loss is the infimum Gaussian discrepancy over positive-definite model covariances.
Definition (Lean source)
Given a finite family of covariance models whose members are compact and nonempty, and a positive-definite true covariance contained in at least one model, the population losses have the positive gap required by finite penalized model selection.
Formal statement
Proof (Lean source)
13 supporting declarations (lemmas, instances)
-
continuous_gaussianCovarianceDiscrepancytheorem — The Gaussian covariance discrepancy varies continuously with its positive-definite candidate and target matrix.hypothesesconclusionContinuous (fun p : PositiveCovariance V × Matrix V V ℝ => gaussianCovarianceDiscrepancy (p.1 : Matrix V V ℝ) p.2)Proof (Lean source)
theorem continuous_gaussianCovarianceDiscrepancy [Fintype V] [DecidableEq V] : Continuous (fun p : PositiveCovariance V × Matrix V V ℝ => gaussianCovarianceDiscrepancy (p.1 : Matrix V V ℝ) p.2) := by rw [continuous_iff_continuousAt] intro p unfold gaussianCovarianceDiscrepancy apply ContinuousAt.add · apply ContinuousAt.log · fun_prop · exact ne_of_gt p.1.property.det_pos · apply (continuous_id.matrix_trace.continuousAt.comp) apply ContinuousAt.mul · have hinv : ContinuousAt (fun x : ℝ => Ring.inverse x) (p.1.1.det) := by simpa [Ring.inverse_eq_inv] using continuousAt_inv₀ (ne_of_gt p.1.property.det_pos) simpa [Function.comp_def] using (continuousAt_matrix_inv _ hinv).comp (x := p) ((continuous_subtype_val.comp continuous_fst).continuousAt) · fun_prop -
continuous_normalizedCovarianceDiscrepancytheorem — The normalized Gaussian covariance discrepancy varies continuously with both positive-definite covariances.hypothesesconclusionContinuous (fun p : PositiveCovariance V × PositiveCovariance V => normalizedCovarianceDiscrepancy p.1 p.2)Proof (Lean source)
theorem continuous_normalizedCovarianceDiscrepancy [Fintype V] [DecidableEq V] : Continuous (fun p : PositiveCovariance V × PositiveCovariance V => normalizedCovarianceDiscrepancy p.1 p.2) := by unfold normalizedCovarianceDiscrepancy apply Continuous.sub · have h : Continuous (fun p : PositiveCovariance V × PositiveCovariance V => (p.1, (p.2 : Matrix V V ℝ))) := by fun_prop exact continuous_gaussianCovarianceDiscrepancy.comp h · have h : Continuous (fun p : PositiveCovariance V × PositiveCovariance V => (p.2, (p.2 : Matrix V V ℝ))) := by fun_prop exact continuous_gaussianCovarianceDiscrepancy.comp h -
normalizedCovarianceDiscrepancy_nonnegtheorem — For positive-definite candidate and target covariances, the normalized Gaussian covariance discrepancy is nonnegative.Proof (Lean source)
theorem normalizedCovarianceDiscrepancy_nonneg [Fintype V] [DecidableEq V] (K T : PositiveCovariance V) : 0 ≤ normalizedCovarianceDiscrepancy K T := by let S := CFC.sqrt ((K : Matrix V V ℝ)⁻¹) let A := S * (T : Matrix V V ℝ) * S obtain ⟨hA, hgap, -⟩ := normalizedCovarianceDiscrepancy_whiten K T rw [hgap] exact posDef_logdet_trace_gap_nonneg A hA -
normalizedCovarianceDiscrepancy_eq_zero_ifftheorem — For positive-definite candidate and target covariances, the normalized Gaussian covariance discrepancy is zero exactly when the two covariances agree.Proof (Lean source)
theorem normalizedCovarianceDiscrepancy_eq_zero_iff [Fintype V] [DecidableEq V] (K T : PositiveCovariance V) : normalizedCovarianceDiscrepancy K T = 0 ↔ K = T := by let S := CFC.sqrt ((K : Matrix V V ℝ)⁻¹) let A := S * (T : Matrix V V ℝ) * S obtain ⟨hA, hgap, hAone⟩ := normalizedCovarianceDiscrepancy_whiten K T rw [hgap, posDef_logdet_trace_gap_eq_zero_iff A hA, hAone] -
gaussianCovarianceDiscrepancy_le_truth_ifftheorem — For positive-definite candidate and target covariances, the candidate has no larger Gaussian discrepancy than the truth exactly when it is the truth.hypothesesK T :conclusiongaussianCovarianceDiscrepancy (K : Matrix V V ℝ) T≤ gaussianCovarianceDiscrepancy (T : Matrix V V ℝ) T ↔ K = TProof (Lean source)
theorem gaussianCovarianceDiscrepancy_le_truth_iff [Fintype V] [DecidableEq V] (K T : PositiveCovariance V) : gaussianCovarianceDiscrepancy (K : Matrix V V ℝ) T ≤ gaussianCovarianceDiscrepancy (T : Matrix V V ℝ) T ↔ K = T := by constructor · intro hle apply (normalizedCovarianceDiscrepancy_eq_zero_iff K T).mp have hnonneg := normalizedCovarianceDiscrepancy_nonneg K T unfold normalizedCovarianceDiscrepancy at hnonneg ⊢ linarith · rintro rfl exact le_rfl -
discrepancyAttainedOn_of_isCompacttheorem — Given a compact covariance model, a nonempty model, and a target matrix, the Gaussian discrepancy minimum is attained.Proof (Lean source)
theorem discrepancyAttainedOn_of_isCompact [Fintype V] [DecidableEq V] {M : Set (PositiveCovariance V)} (hM : IsCompact M) (hne : M.Nonempty) (T : Matrix V V ℝ) : IsDiscrepancyAttainedOn M T := by have hcont : Continuous (fun K : PositiveCovariance V => gaussianCovarianceDiscrepancy (K : Matrix V V ℝ) T) := continuous_gaussianCovarianceDiscrepancy.comp (continuous_id.prodMk continuous_const) obtain ⟨K, hKM, _, hKmin⟩ := hM.exists_sInf_image_eq_and_le hne hcont.continuousOn exact ⟨K, hKM, hKmin⟩ -
discrepancyAttainedOn_of_compactSubleveltheorem — Given a covariance model with a nonempty compact discrepancy sublevel, the global Gaussian discrepancy minimum is attained.hypotheseshM :conclusionProof (Lean source)
theorem discrepancyAttainedOn_of_compactSublevel [Fintype V] [DecidableEq V] {M : Set (PositiveCovariance V)} {T : Matrix V V ℝ} (hM : HasCompactDiscrepancySublevel M T) : IsDiscrepancyAttainedOn M T := by rcases hM with ⟨c, hne, hcompact⟩ let S : Set (PositiveCovariance V) := M ∩ {K | gaussianCovarianceDiscrepancy (K : Matrix V V ℝ) T ≤ c} have hatt := discrepancyAttainedOn_of_isCompact (M := S) hcompact hne T rcases hatt with ⟨K, hKS, hKmin⟩ refine ⟨K, hKS.1, ?_⟩ intro L hLM by_cases hLc : gaussianCovarianceDiscrepancy (L : Matrix V V ℝ) T ≤ c · exact hKmin L ⟨hLM, hLc⟩ · exact hKS.2.trans (le_of_lt (lt_of_not_ge hLc)) -
exists_positive_gap_of_attainedtheorem — Given an attained covariance-model discrepancy that omits the positive-definite truth, every model covariance has a common strictly positive normalized gap.hypotheseshatt :hT :T ∉ MProof (Lean source)
theorem exists_positive_gap_of_attained [Fintype V] [DecidableEq V] {M : Set (PositiveCovariance V)} {T : PositiveCovariance V} (hatt : IsDiscrepancyAttainedOn M T) (hT : T ∉ M) : ∃ gap : ℝ, 0 < gap ∧ ∀ K ∈ M, gap ≤ normalizedCovarianceDiscrepancy K T := by rcases hatt with ⟨K, hKM, hKmin⟩ refine ⟨normalizedCovarianceDiscrepancy K T, ?_, ?_⟩ · have hKT : K ≠ T := fun h => hT (h ▸ hKM) have hzero : normalizedCovarianceDiscrepancy K T ≠ 0 := fun h => hKT ((normalizedCovarianceDiscrepancy_eq_zero_iff K T).mp h) exact lt_of_le_of_ne (normalizedCovarianceDiscrepancy_nonneg K T) hzero.symm · intro L hLM unfold normalizedCovarianceDiscrepancy linarith [hKmin L hLM] -
exists_positive_gap_of_isCompacttheorem — Given a compact covariance model, a nonempty model, and a truth outside the model, the model is separated from the truth by a strictly positive population gap.hypotheseshM :hne :M.NonemptyT :hT :T ∉ MProof (Lean source)
theorem exists_positive_gap_of_isCompact [Fintype V] [DecidableEq V] {M : Set (PositiveCovariance V)} (hM : IsCompact M) (hne : M.Nonempty) {T : PositiveCovariance V} (hT : T ∉ M) : ∃ gap : ℝ, 0 < gap ∧ ∀ K ∈ M, gap ≤ normalizedCovarianceDiscrepancy K T := by exact exists_positive_gap_of_attained (discrepancyAttainedOn_of_isCompact hM hne T) hT -
exists_stable_positive_gaptheorem — Given a compact covariance model, a nonempty model, and a truth outside the model, the strict positive population gap persists for nearby positive-definite truths.hypotheseshM :hne :M.NonemptyT :hT :T ∉ Mconclusion∃ gap : ℝ,conclusion 10 < gapconclusion 2∃ U ∈ nhds T, ∀ T' ∈ U, ∀ K ∈ M, gap ≤ normalizedCovarianceDiscrepancy K T'Proof (Lean source)
theorem exists_stable_positive_gap [Fintype V] [DecidableEq V] {M : Set (PositiveCovariance V)} (hM : IsCompact M) (hne : M.Nonempty) {T : PositiveCovariance V} (hT : T ∉ M) : ∃ gap : ℝ, 0 < gap ∧ ∃ U ∈ nhds T, ∀ T' ∈ U, ∀ K ∈ M, gap ≤ normalizedCovarianceDiscrepancy K T' := by let m : PositiveCovariance V → ℝ := fun T' => sInf ((fun K : PositiveCovariance V => normalizedCovarianceDiscrepancy K T') '' M) have hjoint : Continuous (fun p : PositiveCovariance V × PositiveCovariance V => normalizedCovarianceDiscrepancy p.2 p.1) := continuous_normalizedCovarianceDiscrepancy.comp continuous_swap have hm : Continuous m := hM.continuous_sInf hjoint obtain ⟨delta, hdelta, hdelta_le⟩ := exists_positive_gap_of_isCompact hM hne hT have hcontT : Continuous (fun K : PositiveCovariance V => normalizedCovarianceDiscrepancy K T) := continuous_normalizedCovarianceDiscrepancy.comp (continuous_id.prodMk (continuous_const : Continuous fun _ : PositiveCovariance V => T)) obtain ⟨K0, hK0M, hm_eq, _⟩ := hM.exists_sInf_image_eq_and_le hne hcontT.continuousOn have hhalf : 0 < delta / 2 := half_pos hdelta have hhalf_m : delta / 2 < m T := by dsimp [m] rw [hm_eq] exact lt_of_lt_of_le (half_lt_self hdelta) (hdelta_le K0 hK0M) refine ⟨delta / 2, hhalf, {T' | delta / 2 < m T'}, ?_, ?_⟩ · exact (isOpen_lt continuous_const hm).mem_nhds hhalf_m · intro T' hT' K hKM exact hT'.le.trans (csInf_le (hM.image_of_continuousOn ((continuous_normalizedCovarianceDiscrepancy.comp (continuous_id.prodMk continuous_const)).continuousOn)).bddBelow (mem_image_of_mem _ hKM)) -
continuous_covarianceModelLosstheorem — Given a compact covariance model, the population loss is continuous in the target second-moment matrix.hypotheseshM :conclusionProof (Lean source)
theorem continuous_covarianceModelLoss [Fintype V] [DecidableEq V] {M : Set (PositiveCovariance V)} (hM : IsCompact M) : Continuous (covarianceModelLoss M) := by unfold covarianceModelLoss have hjoint : Continuous (fun p : Matrix V V ℝ × PositiveCovariance V => gaussianCovarianceDiscrepancy (p.2 : Matrix V V ℝ) p.1) := continuous_gaussianCovarianceDiscrepancy.comp continuous_swap exact hM.continuous_sInf hjoint -
populationMinimizers_covarianceModelLoss_ifftheorem — Given covariance models that are compact and nonempty, a positive-definite truth contained in some model, and a model index, the population minimizers are exactly the indices whose models contain the truth.hypothesesV :sharedType u_2I :sharedType u_3Fintype VFintype INonempty Imodels :I → Set (PositiveCovariance V)hcompact :∀ i, IsCompact (models i)hne :∀ i, (models i).NonemptyT :hcontains :∃ i, T ∈ models ii :Iconclusioni ∈ populationMinimizers (fun j => covarianceModelLoss (models j) T)↔ T ∈ models iProof (Lean source)
theorem populationMinimizers_covarianceModelLoss_iff [Fintype V] [DecidableEq V] [Fintype I] [Nonempty I] (models : I → Set (PositiveCovariance V)) (hcompact : ∀ i, IsCompact (models i)) (hne : ∀ i, (models i).Nonempty) (T : PositiveCovariance V) (hcontains : ∃ i, T ∈ models i) (i : I) : i ∈ populationMinimizers (fun j => covarianceModelLoss (models j) T) ↔ T ∈ models i := by rcases hcontains with ⟨j0, hj0⟩ rw [populationMinimizers] constructor · intro hi apply (covarianceModelLoss_eq_truth_iff (hcompact i) (hne i) T).mp apply le_antisymm · calc covarianceModelLoss (models i) T ≤ covarianceModelLoss (models j0) T := hi j0 _ = gaussianCovarianceDiscrepancy (T : Matrix V V ℝ) T := (covarianceModelLoss_eq_truth_iff (hcompact j0) (hne j0) T).2 hj0 · exact covarianceModelLoss_ge_truth (hcompact i) (hne i) T · intro hi j rw [(covarianceModelLoss_eq_truth_iff (hcompact i) (hne i) T).2 hi] exact covarianceModelLoss_ge_truth (hcompact j) (hne j) T -
tendstoInProb_covarianceModelLosstheorem — Given covariance models that are compact and nonempty, an empirical covariance sequence, a target matrix, a sampling measure, and entrywise convergence in probability, the model losses converge coordinatewise in probability.hypothesesV :sharedType u_2I :sharedType u_3Fintype VFintype Imodels :I → Set (PositiveCovariance V)hcompact :∀ i, IsCompact (models i)hne :∀ i, (models i).NonemptySn :ℕ → Ω → Matrix V V ℝT :Matrix V V ℝP :Measure ΩhSn :∀ a b,TendstoInProbability (fun _ : ℕ => P) (fun n ω => Sn n ω a b) atTop (fun _ _ => T a b)i :conclusionTendstoInProbability (fun _ : ℕ => P) (fun n ω => covarianceModelLoss (models i) (Sn n ω)) atTop (fun _ _ => covarianceModelLoss (models i) T)Proof (Lean source)
theorem tendstoInProb_covarianceModelLoss [MeasurableSpace Ω] [Fintype V] [DecidableEq V] [Fintype I] (models : I → Set (PositiveCovariance V)) (hcompact : ∀ i, IsCompact (models i)) (hne : ∀ i, (models i).Nonempty) (Sn : ℕ → Ω → Matrix V V ℝ) (T : Matrix V V ℝ) (P : Measure Ω) (hSn : ∀ a b, TendstoInProbability (fun _ : ℕ => P) (fun n ω => Sn n ω a b) atTop (fun _ _ => T a b)) : ∀ i, TendstoInProbability (fun _ : ℕ => P) (fun n ω => covarianceModelLoss (models i) (Sn n ω)) atTop (fun _ _ => covarianceModelLoss (models i) T) := by classical intro i let uncurryMatrix : ((V × V) → ℝ) → Matrix V V ℝ := fun x a b => x (a, b) let Yn : ℕ → Ω → ((V × V) → ℝ) := fun n ω ab => Sn n ω ab.1 ab.2 let c : (V × V) → ℝ := fun ab => T ab.1 ab.2 let g : ((V × V) → ℝ) → ℝ := fun x => covarianceModelLoss (models i) (uncurryMatrix x) have huncurry : Continuous uncurryMatrix := by fun_prop have hg : ContinuousAt g c := ((continuous_covarianceModelLoss (hcompact i)).comp huncurry).continuousAt have hcoord : ∀ ab, TendstoInProbability (fun _ : ℕ => P) (fun n ω => Yn n ω ab) atTop (fun _ _ => c ab) := by rintro ⟨a, b⟩ exact hSn a b simpa [Yn, c, g, uncurryMatrix] using pi_comp_continuousAt hg hcoord