SSASliceExample.lean
1module23public import SubentropyCertificates.ClassicalStrongSubadditivity4public import Mathlib.Analysis.Complex.ExponentialBounds5import all SubentropyCertificates.ClassicalStrongSubadditivity6import all SubentropyCertificates.CounterexampleIntegral78/-! The alternating deterministic slices after Theorem 22. -/9@[expose] public section10noncomputable section11set_option maxHeartbeats 150000012set_option backward.isDefEq.respectTransparency false13open MeasureTheory Set14open scoped BigOperators15namespace SubentropyCertificates.SSAExamples16open SubentropyCertificates.ClassicalSSA17open SubentropyCertificates.ClassicalCurve18open SubentropyCertificates.QuantumCounterexample19open D5.S3.Quantum.Subentropy.UniformIntegrals2021/-- With B=0, A=0 and C is uniform. With B=1, C=0 and A is uniform. -/22def alternating (u : Fin 2 × Fin 2 × Fin 2) : ℝ :=23 if (u.2.1 = 0 ∧ u.1 = 0) ∨ (u.2.1 = 1 ∧ u.2.2 = 0) then 1/4 else 02425/-- The joint mass is normalized and its two slices factor conditionally on B. -/26theorem alternating_probability :27 alternating ∈ probabilitySimplex _ ∧28 ∀ i j k, alternating (i,j,k) * marginalB alternating j =29 marginalAB alternating (i,j) * marginalBC alternating (j,k) := by30 constructor31 · constructor32 · intro u33 unfold alternating34 split <;> norm_num35 · norm_num [alternating, Fintype.sum_prod_type, Fin.sum_univ_two]36 · intro i j k37 fin_cases i <;> fin_cases j <;> fin_cases k <;>38 norm_num [alternating, marginalB, marginalAB, marginalBC, Fin.sum_univ_two]3940private def sliceGap (t : ℝ) := ((1+t/2)⁻¹ - ((1+t/4)⁻¹)^2)^24142/-- The full reciprocal determinant difference is the square displayed after Theorem 22. -/43theorem alternating_kernel (t : ℝ) :44 kernel t alternating + kernel t (marginalB alternating) -45 kernel t (marginalAB alternating) - kernel t (marginalBC alternating) =46 ((1+t/2)⁻¹ - ((1+t/4)⁻¹)^2)^2 := by47 norm_num [kernel, factor, alternating, marginalB, marginalAB, marginalBC,48 Fintype.prod_prod_type, Fin.prod_univ_two, Fin.sum_univ_two]49 ring_nf50 rw [show 1 + t * (1/2) + t^2 * (1/16) = (1 + t * (1/4))^2 by ring, ← inv_pow]51 ring5253theorem alternating_kernel_pos {t : ℝ} (ht : 0 < t) :54 0 < ((1+t/2)⁻¹ - ((1+t/4)⁻¹)^2)^2 := by55 apply sq_pos_of_pos56 rw [inv_pow]57 apply sub_pos.mpr58 exact (inv_lt_inv₀ (by positivity) (by positivity)).2 (by nlinarith [sq_pos_of_pos ht])5960private def sliceExpansion (s : ℝ) :=61 -3 * diff (1/4) (1/2) s + 1/4 * sqInv (1/2) s + 1/2 * sqInv (1/4) s +62 (-1/16) * (1/(s+1/4)^3) + 1/256 * (1/(s+1/4)^4)6364private theorem slice_partial_fractions (s : ℝ) (hs : 0 < s) :65 sliceGap s⁻¹ = sliceExpansion s := by66 have h₁ : 0 < s+1/2 := by linarith67 have h₂ : 0 < s+1/4 := by linarith68 have hshift (a : ℝ) : 1 + s⁻¹*a = (s+a)/s := by field_simp69 unfold sliceGap sliceExpansion diff sqInv70 rw [show s⁻¹/2 = s⁻¹*(1/2) by ring, show s⁻¹/4 = s⁻¹*(1/4) by ring,71 hshift, hshift]72 simp only [inv_div]73 field_simp [hs.ne', h₁.ne', h₂.ne']74 ring7576private theorem integral_slice :77 (∫ s in Ioi (0 : ℝ), sliceGap s⁻¹) = 25/12 - 3*Real.log 2 := by78 have h₃ : Evaluates (fun s : ℝ ↦ 1/(s+1/4)^3) (1/(2*(1/4)^2)) := by79 have h := inverse_power (1/4) (by norm_num) 180 norm_num [Evaluates] at h ⊢81 exact h82 have h₄ : Evaluates (fun s : ℝ ↦ 1/(s+1/4)^4) (1/(3*(1/4)^3)) := by83 have h := inverse_power (1/4) (by norm_num) 284 norm_num [Evaluates] at h ⊢85 exact h86 have ev := eval_add (eval_add (eval_add87 (eval_add (eval_scale (-3) (eval_diff (1/4) (1/2) (by norm_num) (by norm_num)))88 (eval_scale (1/4) (eval_sq (1/2) (by norm_num))))89 (eval_scale (1/2) (eval_sq (1/4) (by norm_num)))) (eval_scale (-1/16) h₃))90 (eval_scale (1/256) h₄)91 rw [setIntegral_congr_fun measurableSet_Ioi (fun s hs ↦ slice_partial_fractions s hs)]92 change (∫ s in Ioi (0 : ℝ), sliceExpansion s) = _93 rw [show (∫ s in Ioi (0 : ℝ), sliceExpansion s) = _ from ev.2]94 rw [Real.log_div (by norm_num) (by norm_num), Real.log_div (by norm_num) (by norm_num),95 Real.log_one, show Real.log 4 = 2 * Real.log 2 by96 have h := Real.log_pow (2 : ℝ) 297 norm_num at h98 exact h]99 ring100101/-- The actual subentropy deficit of the conditionally independent triple is positive. -/102theorem alternating_subentropy_deficit :103 classicalSubentropy (marginalAB alternating) + classicalSubentropy (marginalBC alternating) -104 classicalSubentropy (marginalB alternating) - classicalSubentropy alternating =105 25/12 - 3*Real.log 2 ∧ 0 < 25/12 - 3*Real.log 2 := by106 refine ⟨?_, by linarith [Real.log_two_lt_d9]⟩107 have hpos {D : Type} [Fintype D] [DecidableEq D] (p : D → ℝ)108 (hp : p ∈ probabilitySimplex _) := kernel_integrable hp109 have hab : marginalAB alternating ∈ probabilitySimplex _ := by110 constructor111 · intro ⟨i,j⟩112 exact Finset.sum_nonneg (fun k _ ↦ alternating_probability.1.1 (i,j,k))113 · norm_num [marginalAB, alternating, Fintype.sum_prod_type, Fin.sum_univ_two]114 have hbc : marginalBC alternating ∈ probabilitySimplex _ := by115 constructor116 · intro ⟨j,k⟩117 exact Finset.sum_nonneg (fun i _ ↦ alternating_probability.1.1 (i,j,k))118 · norm_num [marginalBC, alternating, Fintype.sum_prod_type, Fin.sum_univ_two]119 have hb : marginalB alternating ∈ probabilitySimplex _ := by120 constructor121 · intro j122 exact Finset.sum_nonneg (fun i _ ↦ Finset.sum_nonneg123 (fun k _ ↦ alternating_probability.1.1 (i,j,k)))124 · norm_num [marginalB, alternating, Fin.sum_univ_two]125 rw [← integral_slice]126 let I {D : Type} [Fintype D] [DecidableEq D] (p : D → ℝ) :=127 (∫ s in Ioi (0 : ℝ), densityKernel p s)128 change I (marginalAB alternating) + I (marginalBC alternating) -129 I (marginalB alternating) - I alternating = _130 unfold I131 rw [← integral_add (hpos _ hab) (hpos _ hbc),132 ← integral_sub (f := fun s ↦ densityKernel (marginalAB alternating) s +133 densityKernel (marginalBC alternating) s) ((hpos _ hab).add (hpos _ hbc)) (hpos _ hb),134 ← integral_sub (f := fun s ↦ densityKernel (marginalAB alternating) s +135 densityKernel (marginalBC alternating) s - densityKernel (marginalB alternating) s)136 (((hpos _ hab).add (hpos _ hbc)).sub (hpos _ hb))137 (hpos _ alternating_probability.1)]138 apply setIntegral_congr_fun measurableSet_Ioi139 intro s hs140 simp only [kernel_identity _ hs]141 unfold sliceGap142 linarith only [alternating_kernel s⁻¹]143144end SubentropyCertificates.SSAExamples145
Axioms used
Choose a statement to see which axioms its proof uses.