Pratik Patil

SpatialSignSupport.lean

1module23public import SubentropyCertificates.GaussianSpatialSign4import all SubentropyCertificates.ExponentialSignMoments56/-! The spatial sign covariance is positive and has the same support as its input. -/7@[expose] public section8noncomputable section9set_option backward.isDefEq.respectTransparency false10open Matrix MeasureTheory ProbabilityTheory Set Filter11open scoped BigOperators ComplexOrder MatrixOrder Matrix.Norms.L2Operator1213namespace SubentropyCertificates.ConditionalContinuity14open SubentropyCertificates.DeterminantComparison15open SubentropyCertificates.ClassicalSSA1617variable {D : Type*} [Fintype D] [DecidableEq D]1819/-- The spatial sign integral of a positive matrix is positive semidefinite. -/20theorem spatialSign_posSemidef {M : Matrix D D ℂ} (hM : M.PosSemidef) :21    (spatialSign M).PosSemidef := by22  apply Matrix.nonneg_iff_posSemidef.mp23  apply integral_nonneg_of_ae24  filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht25  unfold signKernel26  rw [reciprocalDet_spectral hM.isHermitian]27  exact smul_nonneg (kernel_pos ht.le hM.eigenvalues_nonneg).le (signResolvent_bounds hM ht).12829private def signWeight (w : D → ℝ) (i : D) : ℝ :=30  ∫ t in Ioi (0 : ℝ), (w i / (1 + t * w i)) * ∏ j, (1 + t * w j)⁻¹3132private theorem signWeight_zero_iff (w : D → ℝ) (hw : ∀ j, 0 ≤ w j) (i : D) :33    signWeight w i = 0 ↔ w i = 0 := by34  by_cases hi : w i = 035  · simp [signWeight, hi]36  let μ := Measure.pi (fun _ : D ↦ expMeasure 1)37  let f (z : D → ℝ) := w i * z i / (∑ j, w j * z j)38  have : IsProbabilityMeasure (expMeasure 1) := isProbabilityMeasure_expMeasure one_pos39  have hbounds : ∀ᵐ z ∂μ, 0 < f z ∧ f z ≤ 1 := by40    filter_upwards [exp_coord_pos (D := D)] with z hz41    have hp := mul_pos (lt_of_le_of_ne (hw i) (Ne.symm hi)) (hz i)42    have hs := Finset.single_le_sum (s := Finset.univ) (f := fun j ↦ w j * z j)43      (fun j _ ↦ mul_nonneg (hw j) (hz j).le) (Finset.mem_univ i)44    exact ⟨div_pos hp (hp.trans_le hs), div_le_one_of_le₀ hs (hp.trans_le hs).le⟩45  have hf : Integrable f μ := (integrable_const (μ := μ) (1 : ℝ)).mono'46    (by apply Measurable.aestronglyMeasurable; dsimp [f]; fun_prop) (hbounds.mono fun z hz ↦ by47      simpa only [Real.norm_of_nonneg hz.1.le] using hz.2)48  constructor49  · intro he50    change (∫ t in Ioi (0 : ℝ), _) = 0 at he51    rw [← exponential_sign_integral w hw i] at he52    have hn := (integral_eq_zero_iff_of_nonneg_ae (hbounds.mono fun _ hz ↦ hz.1.le) hf).mp he53    obtain ⟨z, hz, hzero⟩ := (hbounds.and hn).exists54    exact False.elim (hz.1.ne' hzero)55  · exact False.elim ∘ hi5657private theorem range_spectral_mono (U : unitary (Matrix D D ℂ)) (v w : D → ℝ)58    (h : ∀ i, w i = 0 → v i = 0) :59    let C := Unitary.conjStarAlgAut ℂ _ U60    LinearMap.range (C (diagonal fun i ↦ (v i : ℂ))).mulVecLin ≤61      LinearMap.range (C (diagonal fun i ↦ (w i : ℂ))).mulVecLin := by62  let C := Unitary.conjStarAlgAut ℂ _ U63  let d (a : D → ℝ) := diagonal fun i ↦ (a i : ℂ)64  have he : C (d v) = C (d w) * C (d (fun i ↦ v i / w i)) := by65    rw [← map_mul, show d w * d (fun i ↦ v i / w i) =66      diagonal (fun i ↦ (w i : ℂ) * ((v i / w i : ℝ) : ℂ)) from diagonal_mul_diagonal _ _]67    apply congrArg C68    apply congrArg diagonal69    funext i70    rw [← Complex.ofReal_mul]71    by_cases hz : w i = 072    · simp [hz, h i hz]73    · field_simp74  change LinearMap.range (C (d v)).mulVecLin ≤ _75  rw [he, mulVecLin_mul]76  exact LinearMap.range_comp_le_range _ _7778/-- The range of K(M), equivalently its support space, is exactly the range of M, including79when M is singular. In their common eigenbasis the two diagonal weights vanish together. -/80theorem spatialSign_range {M : Matrix D D ℂ} (hM : M.PosSemidef) :81    LinearMap.range (spatialSign M).mulVecLin = LinearMap.range M.mulVecLin := by82  let w := hM.isHermitian.eigenvalues83  let U := hM.isHermitian.eigenvectorUnitary84  let C := Unitary.conjStarAlgAut ℂ _ U85  have hk : spatialSign M = C (diagonal fun i ↦ (signWeight w i : ℂ)) := spatialSign_spectral hM86  have hm : M = C (diagonal fun i ↦ (w i : ℂ)) := hM.isHermitian.spectral_theorem87  rw [hk, hm]88  exact le_antisymm (range_spectral_mono U (signWeight w) w89    (fun i ↦ (signWeight_zero_iff w hM.eigenvalues_nonneg i).2))90    (range_spectral_mono U w (signWeight w) (fun i ↦ (signWeight_zero_iff w hM.eigenvalues_nonneg i).1))9192/-- The spatial sign covariance preserves rank. -/93theorem spatialSign_rank {M : Matrix D D ℂ} (hM : M.PosSemidef) : (spatialSign M).rank = M.rank := by94  exact congrArg (fun S : Submodule ℂ (D → ℂ) ↦ Module.finrank ℂ S) (spatialSign_range hM)9596end SubentropyCertificates.ConditionalContinuity97

Axioms used

Choose a statement to see which axioms its proof uses.